diff --git a/CHANGELOG b/CHANGELOG index be3015dc..c4b65ead 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,4 +1,10 @@ +v2.11.3 +------- + +New (missing) method: EditableTextBox#setStateMachine() + + v2.11.2 ------- diff --git a/browser/termkit.js b/browser/termkit.js index 3f51b54b..2eda3bfd 100644 --- a/browser/termkit.js +++ b/browser/termkit.js @@ -2776,7 +2776,7 @@ ScreenBuffer.prototype.saveSync = ScreenBuffer.prototype.saveSyncV2 ; }).call(this)}).call(this,require("buffer").Buffer) -},{"./misc.js":47,"./termkit.js":55,"buffer":152,"fs":141,"nextgen-events":77,"string-kit":127}],4:[function(require,module,exports){ +},{"./misc.js":47,"./termkit.js":55,"buffer":151,"fs":141,"nextgen-events":77,"string-kit":127}],4:[function(require,module,exports){ (function (Buffer){(function (){ /* Terminal Kit @@ -3941,7 +3941,7 @@ ScreenBufferHD.prototype.saveSync = ScreenBufferHD.prototype.saveSyncV2 ; }).call(this)}).call(this,require("buffer").Buffer) -},{"./ScreenBuffer.js":3,"./colorScheme/gnome.json":11,"./misc.js":47,"./termkit.js":55,"buffer":152,"fs":141,"string-kit":127}],5:[function(require,module,exports){ +},{"./ScreenBuffer.js":3,"./colorScheme/gnome.json":11,"./misc.js":47,"./termkit.js":55,"buffer":151,"fs":141,"string-kit":127}],5:[function(require,module,exports){ (function (process,Buffer){(function (){ /* Terminal Kit @@ -6163,7 +6163,7 @@ notChainable.drawImage = function( filepath , options , callback ) { }).call(this)}).call(this,require('_process'),require("buffer").Buffer) -},{"./bar.js":8,"./colorScheme/default.json":10,"./extClipboard.js":41,"./fileInput.js":43,"./gridMenu.js":44,"./inputField.js":46,"./progressBar.js":49,"./singleColumnMenu.js":50,"./singleLineMenu.js":51,"./slowTyping.js":52,"./termkit.js":55,"./yesOrNo.js":62,"_process":184,"buffer":152,"nextgen-events":77,"seventh":113,"string-kit":127,"tree-kit":139}],6:[function(require,module,exports){ +},{"./bar.js":8,"./colorScheme/default.json":10,"./extClipboard.js":41,"./fileInput.js":43,"./gridMenu.js":44,"./inputField.js":46,"./progressBar.js":49,"./singleColumnMenu.js":50,"./singleLineMenu.js":51,"./slowTyping.js":52,"./termkit.js":55,"./yesOrNo.js":62,"_process":185,"buffer":151,"nextgen-events":77,"seventh":113,"string-kit":127,"tree-kit":139}],6:[function(require,module,exports){ /* Terminal Kit @@ -8997,7 +8997,7 @@ exports.getDetectedTerminal = async function( callback ) { }).call(this)}).call(this,require('_process')) -},{"./termkit.js":55,"_process":184,"child_process":141,"os":171,"path":183,"seventh":113}],13:[function(require,module,exports){ +},{"./termkit.js":55,"_process":185,"child_process":141,"os":172,"path":184,"seventh":113}],13:[function(require,module,exports){ /* Terminal Kit @@ -9819,7 +9819,7 @@ userActions.submenu = function() { }).call(this)}).call(this,require('_process')) -},{"./Button.js":17,"./Element.js":25,"_process":184,"tree-kit":139}],16:[function(require,module,exports){ +},{"./Button.js":17,"./Element.js":25,"_process":185,"tree-kit":139}],16:[function(require,module,exports){ /* Terminal Kit @@ -14499,7 +14499,7 @@ userActions.next = function() { }).call(this)}).call(this,require('_process')) -},{"./Button.js":17,"./Element.js":25,"./LabeledInput.js":30,"_process":184}],27:[function(require,module,exports){ +},{"./Button.js":17,"./Element.js":25,"./LabeledInput.js":30,"_process":185}],27:[function(require,module,exports){ /* Terminal Kit @@ -14636,7 +14636,7 @@ InlineFileInput.prototype.submit = async function() { } ; -},{"../fileHelpers.js":42,"./Element.js":25,"./InlineInput.js":28,"fs":141,"path":183}],28:[function(require,module,exports){ +},{"../fileHelpers.js":42,"./Element.js":25,"./InlineInput.js":28,"fs":141,"path":184}],28:[function(require,module,exports){ /* Terminal Kit @@ -15672,7 +15672,7 @@ userActions.submit = function() { }).call(this)}).call(this,require('_process')) -},{"./EditableTextBox.js":24,"./Element.js":25,"./SelectList.js":33,"./SelectListMulti.js":34,"./Text.js":36,"_process":184,"string-kit":127}],31:[function(require,module,exports){ +},{"./EditableTextBox.js":24,"./Element.js":25,"./SelectList.js":33,"./SelectListMulti.js":34,"./Text.js":36,"_process":185,"string-kit":127}],31:[function(require,module,exports){ /* Terminal Kit @@ -17793,6 +17793,19 @@ TextBox.prototype.addContent = function( content , mode , dontDraw ) { +// TODOC +TextBox.prototype.setStateMachine = function( stateMachine , internal = false ) { + this.stateMachine = stateMachine ; + this.textBuffer.stateMachine = this.stateMachine ; + + if ( this.stateMachine && ! internal ) { + this.textBuffer.runStateMachine() ; + this.draw() ; + } +} ; + + + TextBox.prototype.onWheel = function( data ) { // It's a "tiny" scroll if ( ! this.hasFocus ) { @@ -18889,7 +18902,7 @@ else { }).call(this)}).call(this,require('_process')) -},{"./patches.js":48,"_process":184,"child_process":141,"seventh":113,"string-kit":127}],42:[function(require,module,exports){ +},{"./patches.js":48,"_process":185,"child_process":141,"seventh":113,"string-kit":127}],42:[function(require,module,exports){ (function (process){(function (){ /* Terminal Kit @@ -19046,7 +19059,7 @@ exports.autoCompleteFile = async ( inputString , params ) => { }).call(this)}).call(this,require('_process')) -},{"./autoComplete.js":7,"_process":184,"fs":141,"path":183,"seventh":113}],43:[function(require,module,exports){ +},{"./autoComplete.js":7,"_process":185,"fs":141,"path":184,"seventh":113}],43:[function(require,module,exports){ /* Terminal Kit @@ -19123,7 +19136,7 @@ module.exports = async function fileInput( options , callback ) { } ; -},{"./fileHelpers.js":42,"path":183}],44:[function(require,module,exports){ +},{"./fileHelpers.js":42,"path":184}],44:[function(require,module,exports){ /* Terminal Kit @@ -23531,7 +23544,7 @@ lazy.properties( termkit , { }).call(this)}).call(this,require('_process')) -},{"./Palette.js":1,"./Rect.js":2,"./ScreenBuffer.js":3,"./ScreenBufferHD.js":4,"./Terminal.js":5,"./TextBuffer.js":6,"./autoComplete.js":7,"./detectTerminal.js":12,"./document/AnimatedText.js":13,"./document/Bar.js":14,"./document/Border.js":16,"./document/Button.js":17,"./document/ColumnMenu.js":18,"./document/ColumnMenuMixed.js":19,"./document/ColumnMenuMulti.js":20,"./document/Container.js":21,"./document/Document.js":22,"./document/DropDownMenu.js":23,"./document/EditableTextBox.js":24,"./document/Element.js":25,"./document/Form.js":26,"./document/InlineFileInput.js":27,"./document/InlineInput.js":28,"./document/InlineMenu.js":29,"./document/LabeledInput.js":30,"./document/Layout.js":31,"./document/RowMenu.js":32,"./document/SelectList.js":33,"./document/SelectListMulti.js":34,"./document/Slider.js":35,"./document/Text.js":36,"./document/TextBox.js":37,"./document/TextTable.js":38,"./document/ToggleButton.js":39,"./document/Window.js":40,"./image.js":45,"./misc.js":47,"./spChars.js":53,"./tty.js":56,"./vte/Vte.js":58,"./windows.js":61,"_process":184,"chroma-js":64,"lazyness":73}],55:[function(require,module,exports){ +},{"./Palette.js":1,"./Rect.js":2,"./ScreenBuffer.js":3,"./ScreenBufferHD.js":4,"./Terminal.js":5,"./TextBuffer.js":6,"./autoComplete.js":7,"./detectTerminal.js":12,"./document/AnimatedText.js":13,"./document/Bar.js":14,"./document/Border.js":16,"./document/Button.js":17,"./document/ColumnMenu.js":18,"./document/ColumnMenuMixed.js":19,"./document/ColumnMenuMulti.js":20,"./document/Container.js":21,"./document/Document.js":22,"./document/DropDownMenu.js":23,"./document/EditableTextBox.js":24,"./document/Element.js":25,"./document/Form.js":26,"./document/InlineFileInput.js":27,"./document/InlineInput.js":28,"./document/InlineMenu.js":29,"./document/LabeledInput.js":30,"./document/Layout.js":31,"./document/RowMenu.js":32,"./document/SelectList.js":33,"./document/SelectListMulti.js":34,"./document/Slider.js":35,"./document/Text.js":36,"./document/TextBox.js":37,"./document/TextTable.js":38,"./document/ToggleButton.js":39,"./document/Window.js":40,"./image.js":45,"./misc.js":47,"./spChars.js":53,"./tty.js":56,"./vte/Vte.js":58,"./windows.js":61,"_process":185,"chroma-js":64,"lazyness":73}],55:[function(require,module,exports){ (function (process,__dirname){(function (){ /* Terminal Kit @@ -23690,7 +23703,7 @@ lazy.properties( termkit , { }).call(this)}).call(this,require('_process'),"/lib") -},{"./Terminal.js":5,"./detectTerminal.js":12,"./misc.js":47,"./termkit-no-lazy-require.js":54,"./windows.js":61,"_process":184,"lazyness":73,"path":183}],56:[function(require,module,exports){ +},{"./Terminal.js":5,"./detectTerminal.js":12,"./misc.js":47,"./termkit-no-lazy-require.js":54,"./windows.js":61,"_process":185,"lazyness":73,"path":184}],56:[function(require,module,exports){ (function (process){(function (){ /* Terminal Kit @@ -23850,7 +23863,7 @@ tty_.getOutput = function getOutput() { }).call(this)}).call(this,require('_process')) -},{"_process":184,"child_process":141,"fs":141,"tty":203}],57:[function(require,module,exports){ +},{"_process":185,"child_process":141,"fs":141,"tty":204}],57:[function(require,module,exports){ (function (Buffer){(function (){ /* Terminal Kit @@ -24205,7 +24218,7 @@ SequencesReader.prototype.streamToEvent = async function( stream ) { }).call(this)}).call(this,require("buffer").Buffer) -},{"./fromOutputSequence.js":59,"buffer":152,"nextgen-events":77,"seventh":113,"string-kit":127}],58:[function(require,module,exports){ +},{"./fromOutputSequence.js":59,"buffer":151,"nextgen-events":77,"seventh":113,"string-kit":127}],58:[function(require,module,exports){ /* Terminal Kit @@ -25956,8 +25969,8 @@ module.exports = function getPixels(url, type, cb) { } } -}).call(this)}).call(this,{"isBuffer":require("../../../../../../../../opt/node-v14.15.4/lib/node_modules/browserify/node_modules/is-buffer/index.js")}) -},{"../../../../../../../../opt/node-v14.15.4/lib/node_modules/browserify/node_modules/is-buffer/index.js":167,"fs":141,"jpeg-js":70,"ndarray":76,"ndarray-pack":74,"node-bitmap":80,"omggif":82,"path":183,"pngjs":102}],64:[function(require,module,exports){ +}).call(this)}).call(this,{"isBuffer":require("../../../../../../../../opt/node-v16.16.0/lib/node_modules/browserify/node_modules/is-buffer/index.js")}) +},{"../../../../../../../../opt/node-v16.16.0/lib/node_modules/browserify/node_modules/is-buffer/index.js":167,"fs":141,"jpeg-js":70,"ndarray":76,"ndarray-pack":74,"node-bitmap":80,"omggif":82,"path":184,"pngjs":102}],64:[function(require,module,exports){ /** * chroma.js - JavaScript library for color conversions * @@ -31300,7 +31313,7 @@ function decode(jpegData, userOpts = {}) { } }).call(this)}).call(this,require("buffer").Buffer) -},{"buffer":152}],72:[function(require,module,exports){ +},{"buffer":151}],72:[function(require,module,exports){ (function (Buffer){(function (){ /* Copyright (c) 2008, Adobe Systems Incorporated @@ -32118,7 +32131,7 @@ function getImageDataFromImage(idOrElement){ } }).call(this)}).call(this,require("buffer").Buffer) -},{"buffer":152}],73:[function(require,module,exports){ +},{"buffer":151}],73:[function(require,module,exports){ /* Lazyness @@ -33499,11 +33512,9 @@ NextGenEvents.emitToOneListener = function( event , listener , removedListeners } - if ( listener.once && self.__ngev.listeners[ event.name ] ) { + if ( listener.once ) { // We should remove the current listener RIGHT NOW because of recursive .emit() issues: // one listener may eventually fire this very same event synchronously during the current loop. - // ALSO another listener may have called .removeAllListeners(), so we first check that there are still - // a listener array for this event. self.__ngev.listeners[ event.name ] = self.__ngev.listeners[ event.name ].filter( NextGenEvents.filterOutCallback.bind( undefined , listener ) ) ; @@ -34140,7 +34151,7 @@ NextGenEvents.Proxy = require( './Proxy.js' ) ; }).call(this)}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {},require("timers").setImmediate) -},{"../package.json":79,"./Proxy.js":78,"_process":184,"timers":202}],78:[function(require,module,exports){ +},{"../package.json":79,"./Proxy.js":78,"_process":185,"timers":203}],78:[function(require,module,exports){ /* Next-Gen Events @@ -34690,7 +34701,7 @@ RemoteService.prototype.receiveAckEmit = function( message ) { },{"./NextGenEvents.js":77}],79:[function(require,module,exports){ module.exports={ "name": "nextgen-events", - "version": "1.5.3", + "version": "1.5.2", "description": "The next generation of events handling for javascript! New: abstract away the network!", "main": "lib/NextGenEvents.js", "engines": { @@ -35355,7 +35366,7 @@ Bitmap.prototype.mapColor = function(bmpBuf, bitCount){ }; }).call(this)}).call(this,require("buffer").Buffer) -},{"buffer":152}],82:[function(require,module,exports){ +},{"buffer":151}],82:[function(require,module,exports){ // (c) Dean McNamee , 2013. // // https://github.com/deanm/omggif @@ -36435,7 +36446,7 @@ exports.dataToBitMap = function (data, bitmapInfo) { }; }).call(this)}).call(this,require("buffer").Buffer) -},{"./interlace":93,"buffer":152}],84:[function(require,module,exports){ +},{"./interlace":93,"buffer":151}],84:[function(require,module,exports){ (function (Buffer){(function (){ "use strict"; @@ -36597,7 +36608,7 @@ module.exports = function (dataIn, width, height, options) { }; }).call(this)}).call(this,require("buffer").Buffer) -},{"./constants":86,"buffer":152}],85:[function(require,module,exports){ +},{"./constants":86,"buffer":151}],85:[function(require,module,exports){ (function (process,Buffer){(function (){ "use strict"; @@ -36790,7 +36801,7 @@ ChunkStream.prototype._process = function () { }; }).call(this)}).call(this,require('_process'),require("buffer").Buffer) -},{"_process":184,"buffer":152,"stream":186,"util":207}],86:[function(require,module,exports){ +},{"_process":185,"buffer":151,"stream":187,"util":208}],86:[function(require,module,exports){ "use strict"; module.exports = { @@ -37041,7 +37052,7 @@ module.exports = function (pxData, width, height, options, bpp) { }; }).call(this)}).call(this,require("buffer").Buffer) -},{"./paeth-predictor":97,"buffer":152}],89:[function(require,module,exports){ +},{"./paeth-predictor":97,"buffer":151}],89:[function(require,module,exports){ (function (Buffer){(function (){ "use strict"; @@ -37069,7 +37080,7 @@ let FilterAsync = (module.exports = function (bitmapInfo) { util.inherits(FilterAsync, ChunkStream); }).call(this)}).call(this,require("buffer").Buffer) -},{"./chunkstream":85,"./filter-parse":91,"buffer":152,"util":207}],90:[function(require,module,exports){ +},{"./chunkstream":85,"./filter-parse":91,"buffer":151,"util":208}],90:[function(require,module,exports){ (function (Buffer){(function (){ "use strict"; @@ -37094,7 +37105,7 @@ exports.process = function (inBuffer, bitmapInfo) { }; }).call(this)}).call(this,require("buffer").Buffer) -},{"./filter-parse":91,"./sync-reader":104,"buffer":152}],91:[function(require,module,exports){ +},{"./filter-parse":91,"./sync-reader":104,"buffer":151}],91:[function(require,module,exports){ (function (Buffer){(function (){ "use strict"; @@ -37275,7 +37286,7 @@ Filter.prototype._reverseFilterLine = function (rawData) { }; }).call(this)}).call(this,require("buffer").Buffer) -},{"./interlace":93,"./paeth-predictor":97,"buffer":152}],92:[function(require,module,exports){ +},{"./interlace":93,"./paeth-predictor":97,"buffer":151}],92:[function(require,module,exports){ (function (Buffer){(function (){ "use strict"; @@ -37372,7 +37383,7 @@ module.exports = function (indata, imageData, skipRescale = false) { }; }).call(this)}).call(this,require("buffer").Buffer) -},{"buffer":152}],93:[function(require,module,exports){ +},{"buffer":151}],93:[function(require,module,exports){ "use strict"; // Adam 7 @@ -37523,7 +37534,7 @@ PackerAsync.prototype.pack = function (data, width, height, gamma) { }; }).call(this)}).call(this,require("buffer").Buffer) -},{"./constants":86,"./packer":96,"buffer":152,"stream":186,"util":207}],95:[function(require,module,exports){ +},{"./constants":86,"./packer":96,"buffer":151,"stream":187,"util":208}],95:[function(require,module,exports){ (function (Buffer){(function (){ "use strict"; @@ -37583,7 +37594,7 @@ module.exports = function (metaData, opt) { }; }).call(this)}).call(this,require("buffer").Buffer) -},{"./constants":86,"./packer":96,"buffer":152,"zlib":151}],96:[function(require,module,exports){ +},{"./constants":86,"./packer":96,"buffer":151,"zlib":150}],96:[function(require,module,exports){ (function (Buffer){(function (){ "use strict"; @@ -37716,7 +37727,7 @@ Packer.prototype.packIEND = function () { }; }).call(this)}).call(this,require("buffer").Buffer) -},{"./bitpacker":84,"./constants":86,"./crc":87,"./filter-pack":88,"buffer":152,"zlib":151}],97:[function(require,module,exports){ +},{"./bitpacker":84,"./constants":86,"./crc":87,"./filter-pack":88,"buffer":151,"zlib":150}],97:[function(require,module,exports){ "use strict"; module.exports = function paethPredictor(left, above, upLeft) { @@ -37905,7 +37916,7 @@ ParserAsync.prototype._complete = function (filteredData) { this.emit("parsed", normalisedBitmapData); }; -},{"./bitmapper":83,"./chunkstream":85,"./filter-parse-async":89,"./format-normaliser":92,"./parser":100,"util":207,"zlib":151}],99:[function(require,module,exports){ +},{"./bitmapper":83,"./chunkstream":85,"./filter-parse-async":89,"./format-normaliser":92,"./parser":100,"util":208,"zlib":150}],99:[function(require,module,exports){ (function (Buffer){(function (){ "use strict"; @@ -38021,7 +38032,7 @@ module.exports = function (buffer, options) { }; }).call(this)}).call(this,require("buffer").Buffer) -},{"./bitmapper":83,"./filter-parse-sync":90,"./format-normaliser":92,"./parser":100,"./sync-inflate":103,"./sync-reader":104,"buffer":152,"zlib":151}],100:[function(require,module,exports){ +},{"./bitmapper":83,"./filter-parse-sync":90,"./format-normaliser":92,"./parser":100,"./sync-inflate":103,"./sync-reader":104,"buffer":151,"zlib":150}],100:[function(require,module,exports){ (function (Buffer){(function (){ "use strict"; @@ -38315,7 +38326,7 @@ Parser.prototype._parseIEND = function (data) { }; }).call(this)}).call(this,require("buffer").Buffer) -},{"./constants":86,"./crc":87,"buffer":152}],101:[function(require,module,exports){ +},{"./constants":86,"./crc":87,"buffer":151}],101:[function(require,module,exports){ "use strict"; let parse = require("./parser-sync"); @@ -38527,7 +38538,7 @@ PNG.prototype.adjustGamma = function () { }; }).call(this)}).call(this,require('_process'),require("buffer").Buffer) -},{"./packer-async":94,"./parser-async":98,"./png-sync":101,"_process":184,"buffer":152,"stream":186,"util":207}],103:[function(require,module,exports){ +},{"./packer-async":94,"./parser-async":98,"./png-sync":101,"_process":185,"buffer":151,"stream":187,"util":208}],103:[function(require,module,exports){ (function (process,Buffer){(function (){ "use strict"; @@ -38699,7 +38710,7 @@ exports.createInflate = createInflate; exports.inflateSync = inflateSync; }).call(this)}).call(this,require('_process'),require("buffer").Buffer) -},{"_process":184,"assert":143,"buffer":152,"util":207,"zlib":151}],104:[function(require,module,exports){ +},{"_process":185,"assert":142,"buffer":151,"util":208,"zlib":150}],104:[function(require,module,exports){ "use strict"; let SyncReader = (module.exports = function (buffer) { @@ -38936,7 +38947,7 @@ SyncReader.prototype.process = function () { }(typeof self === "undefined" ? typeof global === "undefined" ? this : global : self)); }).call(this)}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"_process":184}],106:[function(require,module,exports){ +},{"_process":185}],106:[function(require,module,exports){ /* Seventh @@ -40617,7 +40628,7 @@ if ( process.browser ) { }).call(this)}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {},require("timers").setImmediate) -},{"_process":184,"setimmediate":105,"timers":202}],110:[function(require,module,exports){ +},{"_process":185,"setimmediate":105,"timers":203}],110:[function(require,module,exports){ /* Seventh @@ -41223,7 +41234,7 @@ Promise.resolveSafeTimeout = function( timeout , value ) { }).call(this)}).call(this,require('_process')) -},{"./seventh.js":113,"_process":184}],112:[function(require,module,exports){ +},{"./seventh.js":113,"_process":185}],112:[function(require,module,exports){ /* Seventh @@ -43574,7 +43585,7 @@ function round( v , step ) { }).call(this)}).call(this,require("buffer").Buffer) -},{"./StringNumber.js":115,"./ansi.js":116,"./escape.js":118,"./inspect.js":121,"./naturalSort.js":125,"./unicode.js":130,"buffer":152}],120:[function(require,module,exports){ +},{"./StringNumber.js":115,"./ansi.js":116,"./escape.js":118,"./inspect.js":121,"./naturalSort.js":125,"./unicode.js":130,"buffer":151}],120:[function(require,module,exports){ /* String Kit @@ -44631,8 +44642,8 @@ inspectStyle.html = Object.assign( {} , inspectStyle.none , { } ) ; -}).call(this)}).call(this,{"isBuffer":require("../../../../../../../../opt/node-v14.15.4/lib/node_modules/browserify/node_modules/is-buffer/index.js")},require('_process')) -},{"../../../../../../../../opt/node-v14.15.4/lib/node_modules/browserify/node_modules/is-buffer/index.js":167,"./ansi.js":116,"./escape.js":118,"_process":184}],122:[function(require,module,exports){ +}).call(this)}).call(this,{"isBuffer":require("../../../../../../../../opt/node-v16.16.0/lib/node_modules/browserify/node_modules/is-buffer/index.js")},require('_process')) +},{"../../../../../../../../opt/node-v16.16.0/lib/node_modules/browserify/node_modules/is-buffer/index.js":167,"./ansi.js":116,"./escape.js":118,"_process":185}],122:[function(require,module,exports){ module.exports={"߀":"0","́":""," ":" ","Ⓐ":"A","A":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ɓ":"B","c":"C","Ⓒ":"C","C":"C","Ꜿ":"C","Ḉ":"C","Ç":"C","Ⓓ":"D","D":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ɗ":"D","Ɖ":"D","ᴅ":"D","Ꝺ":"D","Ð":"Dh","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"Dz","ɛ":"E","Ⓔ":"E","E":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","ᴇ":"E","ꝼ":"F","Ⓕ":"F","F":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","G":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","ɢ":"G","Ⓗ":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","I":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","J":"J","Ĵ":"J","Ɉ":"J","ȷ":"J","Ⓚ":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","L":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","M":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","ϻ":"M","Ꞥ":"N","Ƞ":"N","Ⓝ":"N","N":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ɲ":"N","Ꞑ":"N","ᴎ":"N","NJ":"NJ","Nj":"Nj","Ⓞ":"O","O":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Œ":"OE","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","P":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Q":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","R":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","S":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","T":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Þ":"Th","Ꜩ":"TZ","Ⓤ":"U","U":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","V":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","W":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Y":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Z":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","a":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ɑ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","Ƃ":"b","ⓒ":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","C":"c","Ć":"c","Ĉ":"c","Ċ":"c","Č":"c","Ƈ":"c","Ȼ":"c","ⓓ":"d","d":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","Ƌ":"d","Ꮷ":"d","ԁ":"d","Ɦ":"d","ð":"dh","dz":"dz","dž":"dz","ⓔ":"e","e":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ff":"ff","fi":"fi","fl":"fl","ffi":"ffi","ffl":"ffl","ⓖ":"g","g":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ꝿ":"g","ᵹ":"g","ⓗ":"h","h":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","l":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","ɭ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ʼn":"n","ꞑ":"n","ꞥ":"n","ԉ":"n","nj":"nj","ⓞ":"o","o":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","ɔ":"o","ᴑ":"o","œ":"oe","ƣ":"oi","ꝏ":"oo","ȣ":"ou","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ρ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","r":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","s":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ʂ":"s","ß":"ss","ⓣ":"t","t":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","þ":"th","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","y":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z"} },{}],123:[function(require,module,exports){ /* @@ -47007,7 +47018,7 @@ masklib.InverseMask.prototype.applyTo = function applyTo( input , context , cont } ; -},{"./tree.js":139,"util":207}],138:[function(require,module,exports){ +},{"./tree.js":139,"util":208}],138:[function(require,module,exports){ /* Tree Kit @@ -47422,33 +47433,6 @@ module.exports = unique },{}],141:[function(require,module,exports){ },{}],142:[function(require,module,exports){ - -/** - * Array#filter. - * - * @param {Array} arr - * @param {Function} fn - * @param {Object=} self - * @return {Array} - * @throw TypeError - */ - -module.exports = function (arr, fn, self) { - if (arr.filter) return arr.filter(fn, self); - if (void 0 === arr || null === arr) throw new TypeError; - if ('function' != typeof fn) throw new TypeError; - var ret = []; - for (var i = 0; i < arr.length; i++) { - if (!hasOwn.call(arr, i)) continue; - var val = arr[i]; - if (fn.call(self, val, i, arr)) ret.push(val); - } - return ret; -}; - -var hasOwn = Object.prototype.hasOwnProperty; - -},{}],143:[function(require,module,exports){ (function (global){(function (){ 'use strict'; @@ -47958,7 +47942,7 @@ var objectKeys = Object.keys || function (obj) { }; }).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"object-assign":170,"util/":146}],144:[function(require,module,exports){ +},{"object-assign":171,"util/":145}],143:[function(require,module,exports){ if (typeof Object.create === 'function') { // implementation from standard node.js 'util' module module.exports = function inherits(ctor, superCtor) { @@ -47983,14 +47967,14 @@ if (typeof Object.create === 'function') { } } -},{}],145:[function(require,module,exports){ +},{}],144:[function(require,module,exports){ module.exports = function isBuffer(arg) { return arg && typeof arg === 'object' && typeof arg.copy === 'function' && typeof arg.fill === 'function' && typeof arg.readUInt8 === 'function'; } -},{}],146:[function(require,module,exports){ +},{}],145:[function(require,module,exports){ (function (process,global){(function (){ // Copyright Joyent, Inc. and other Node contributors. // @@ -48580,32 +48564,38 @@ function hasOwnProperty(obj, prop) { } }).call(this)}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"./support/isBuffer":145,"_process":184,"inherits":144}],147:[function(require,module,exports){ +},{"./support/isBuffer":144,"_process":185,"inherits":143}],146:[function(require,module,exports){ (function (global){(function (){ 'use strict'; -var filter = require('array-filter'); +var possibleNames = [ + 'BigInt64Array', + 'BigUint64Array', + 'Float32Array', + 'Float64Array', + 'Int16Array', + 'Int32Array', + 'Int8Array', + 'Uint16Array', + 'Uint32Array', + 'Uint8Array', + 'Uint8ClampedArray' +]; + +var g = typeof globalThis === 'undefined' ? global : globalThis; module.exports = function availableTypedArrays() { - return filter([ - 'BigInt64Array', - 'BigUint64Array', - 'Float32Array', - 'Float64Array', - 'Int16Array', - 'Int32Array', - 'Int8Array', - 'Uint16Array', - 'Uint32Array', - 'Uint8Array', - 'Uint8ClampedArray' - ], function (typedArray) { - return typeof global[typedArray] === 'function'; - }); + var out = []; + for (var i = 0; i < possibleNames.length; i++) { + if (typeof g[possibleNames[i]] === 'function') { + out[out.length] = possibleNames[i]; + } + } + return out; }; }).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"array-filter":142}],148:[function(require,module,exports){ +},{}],147:[function(require,module,exports){ 'use strict' exports.byteLength = byteLength @@ -48757,9 +48747,9 @@ function fromByteArray (uint8) { return parts.join('') } -},{}],149:[function(require,module,exports){ +},{}],148:[function(require,module,exports){ arguments[4][141][0].apply(exports,arguments) -},{"dup":141}],150:[function(require,module,exports){ +},{"dup":141}],149:[function(require,module,exports){ (function (process,Buffer){(function (){ 'use strict'; /* eslint camelcase: "off" */ @@ -49171,7 +49161,7 @@ Zlib.prototype._reset = function () { exports.Zlib = Zlib; }).call(this)}).call(this,require('_process'),require("buffer").Buffer) -},{"_process":184,"assert":143,"buffer":152,"pako/lib/zlib/constants":174,"pako/lib/zlib/deflate.js":176,"pako/lib/zlib/inflate.js":178,"pako/lib/zlib/zstream":182}],151:[function(require,module,exports){ +},{"_process":185,"assert":142,"buffer":151,"pako/lib/zlib/constants":175,"pako/lib/zlib/deflate.js":177,"pako/lib/zlib/inflate.js":179,"pako/lib/zlib/zstream":183}],150:[function(require,module,exports){ (function (process){(function (){ 'use strict'; @@ -49783,7 +49773,7 @@ util.inherits(DeflateRaw, Zlib); util.inherits(InflateRaw, Zlib); util.inherits(Unzip, Zlib); }).call(this)}).call(this,require('_process')) -},{"./binding":150,"_process":184,"assert":143,"buffer":152,"stream":186,"util":207}],152:[function(require,module,exports){ +},{"./binding":149,"_process":185,"assert":142,"buffer":151,"stream":187,"util":208}],151:[function(require,module,exports){ (function (Buffer){(function (){ /*! * The buffer module from node.js, for the browser. @@ -51564,7 +51554,7 @@ function numberIsNaN (obj) { } }).call(this)}).call(this,require("buffer").Buffer) -},{"base64-js":148,"buffer":152,"ieee754":164}],153:[function(require,module,exports){ +},{"base64-js":147,"buffer":151,"ieee754":164}],152:[function(require,module,exports){ 'use strict'; var GetIntrinsic = require('get-intrinsic'); @@ -51581,7 +51571,7 @@ module.exports = function callBoundIntrinsic(name, allowMissing) { return intrinsic; }; -},{"./":154,"get-intrinsic":160}],154:[function(require,module,exports){ +},{"./":153,"get-intrinsic":159}],153:[function(require,module,exports){ 'use strict'; var bind = require('function-bind'); @@ -51630,12 +51620,12 @@ if ($defineProperty) { module.exports.apply = applyBind; } -},{"function-bind":159,"get-intrinsic":160}],155:[function(require,module,exports){ +},{"function-bind":158,"get-intrinsic":159}],154:[function(require,module,exports){ 'use strict'; var GetIntrinsic = require('get-intrinsic'); -var $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%'); +var $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true); if ($gOPD) { try { $gOPD([], 'length'); @@ -51647,7 +51637,7 @@ if ($gOPD) { module.exports = $gOPD; -},{"get-intrinsic":160}],156:[function(require,module,exports){ +},{"get-intrinsic":159}],155:[function(require,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a @@ -52098,58 +52088,119 @@ function unwrapListeners(arr) { function once(emitter, name) { return new Promise(function (resolve, reject) { - function eventListener() { - if (errorListener !== undefined) { + function errorListener(err) { + emitter.removeListener(name, resolver); + reject(err); + } + + function resolver() { + if (typeof emitter.removeListener === 'function') { emitter.removeListener('error', errorListener); } resolve([].slice.call(arguments)); }; - var errorListener; - - // Adding an error listener is not optional because - // if an error is thrown on an event emitter we cannot - // guarantee that the actual event we are waiting will - // be fired. The result could be a silent way to create - // memory or file descriptor leaks, which is something - // we should avoid. - if (name !== 'error') { - errorListener = function errorListener(err) { - emitter.removeListener(name, eventListener); - reject(err); - }; - emitter.once('error', errorListener); + eventTargetAgnosticAddListener(emitter, name, resolver, { once: true }); + if (name !== 'error') { + addErrorHandlerIfEventEmitter(emitter, errorListener, { once: true }); } - - emitter.once(name, eventListener); }); } -},{}],157:[function(require,module,exports){ +function addErrorHandlerIfEventEmitter(emitter, handler, flags) { + if (typeof emitter.on === 'function') { + eventTargetAgnosticAddListener(emitter, 'error', handler, flags); + } +} -var hasOwn = Object.prototype.hasOwnProperty; -var toString = Object.prototype.toString; +function eventTargetAgnosticAddListener(emitter, name, listener, flags) { + if (typeof emitter.on === 'function') { + if (flags.once) { + emitter.once(name, listener); + } else { + emitter.on(name, listener); + } + } else if (typeof emitter.addEventListener === 'function') { + // EventTarget does not have `error` event semantics like Node + // EventEmitters, we do not listen for `error` events here. + emitter.addEventListener(name, function wrapListener(arg) { + // IE does not have builtin `{ once: true }` support so we + // have to do it manually. + if (flags.once) { + emitter.removeEventListener(name, wrapListener); + } + listener(arg); + }); + } else { + throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof emitter); + } +} -module.exports = function forEach (obj, fn, ctx) { - if (toString.call(fn) !== '[object Function]') { - throw new TypeError('iterator must be a function'); +},{}],156:[function(require,module,exports){ +'use strict'; + +var isCallable = require('is-callable'); + +var toStr = Object.prototype.toString; +var hasOwnProperty = Object.prototype.hasOwnProperty; + +var forEachArray = function forEachArray(array, iterator, receiver) { + for (var i = 0, len = array.length; i < len; i++) { + if (hasOwnProperty.call(array, i)) { + if (receiver == null) { + iterator(array[i], i, array); + } else { + iterator.call(receiver, array[i], i, array); + } + } } - var l = obj.length; - if (l === +l) { - for (var i = 0; i < l; i++) { - fn.call(ctx, obj[i], i, obj); +}; + +var forEachString = function forEachString(string, iterator, receiver) { + for (var i = 0, len = string.length; i < len; i++) { + // no such thing as a sparse string. + if (receiver == null) { + iterator(string.charAt(i), i, string); + } else { + iterator.call(receiver, string.charAt(i), i, string); } - } else { - for (var k in obj) { - if (hasOwn.call(obj, k)) { - fn.call(ctx, obj[k], k, obj); + } +}; + +var forEachObject = function forEachObject(object, iterator, receiver) { + for (var k in object) { + if (hasOwnProperty.call(object, k)) { + if (receiver == null) { + iterator(object[k], k, object); + } else { + iterator.call(receiver, object[k], k, object); } } } }; +var forEach = function forEach(list, iterator, thisArg) { + if (!isCallable(iterator)) { + throw new TypeError('iterator must be a function'); + } + + var receiver; + if (arguments.length >= 3) { + receiver = thisArg; + } + + if (toStr.call(list) === '[object Array]') { + forEachArray(list, iterator, receiver); + } else if (typeof list === 'string') { + forEachString(list, iterator, receiver); + } else { + forEachObject(list, iterator, receiver); + } +}; + +module.exports = forEach; -},{}],158:[function(require,module,exports){ +},{"is-callable":168}],157:[function(require,module,exports){ 'use strict'; /* eslint no-invalid-this: 1 */ @@ -52203,14 +52254,14 @@ module.exports = function bind(that) { return bound; }; -},{}],159:[function(require,module,exports){ +},{}],158:[function(require,module,exports){ 'use strict'; var implementation = require('./implementation'); module.exports = Function.prototype.bind || implementation; -},{"./implementation":158}],160:[function(require,module,exports){ +},{"./implementation":157}],159:[function(require,module,exports){ 'use strict'; var undefined; @@ -52415,6 +52466,7 @@ var $concat = bind.call(Function.call, Array.prototype.concat); var $spliceApply = bind.call(Function.apply, Array.prototype.splice); var $replace = bind.call(Function.call, String.prototype.replace); var $strSlice = bind.call(Function.call, String.prototype.slice); +var $exec = bind.call(Function.call, RegExp.prototype.exec); /* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */ var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g; @@ -52470,6 +52522,9 @@ module.exports = function GetIntrinsic(name, allowMissing) { throw new $TypeError('"allowMissing" argument must be a boolean'); } + if ($exec(/^%?[^%]*%?$/g, name) === null) { + throw new $SyntaxError('`%` may not be present anywhere but at the beginning and end of the intrinsic name'); + } var parts = stringToPath(name); var intrinsicBaseName = parts.length > 0 ? parts[0] : ''; @@ -52542,11 +52597,10 @@ module.exports = function GetIntrinsic(name, allowMissing) { return value; }; -},{"function-bind":159,"has":163,"has-symbols":161}],161:[function(require,module,exports){ -(function (global){(function (){ +},{"function-bind":158,"has":163,"has-symbols":160}],160:[function(require,module,exports){ 'use strict'; -var origSymbol = global.Symbol; +var origSymbol = typeof Symbol !== 'undefined' && Symbol; var hasSymbolSham = require('./shams'); module.exports = function hasNativeSymbols() { @@ -52558,8 +52612,7 @@ module.exports = function hasNativeSymbols() { return hasSymbolSham(); }; -}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"./shams":162}],162:[function(require,module,exports){ +},{"./shams":161}],161:[function(require,module,exports){ 'use strict'; /* eslint complexity: [2, 18], max-statements: [2, 33] */ @@ -52585,7 +52638,7 @@ module.exports = function hasSymbols() { var symVal = 42; obj[sym] = symVal; - for (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax + for (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; } if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; } @@ -52603,14 +52656,23 @@ module.exports = function hasSymbols() { return true; }; -},{}],163:[function(require,module,exports){ +},{}],162:[function(require,module,exports){ +'use strict'; + +var hasSymbols = require('has-symbols/shams'); + +module.exports = function hasToStringTagShams() { + return hasSymbols() && !!Symbol.toStringTag; +}; + +},{"has-symbols/shams":161}],163:[function(require,module,exports){ 'use strict'; var bind = require('function-bind'); module.exports = bind.call(Function.call, Object.prototype.hasOwnProperty); -},{"function-bind":159}],164:[function(require,module,exports){ +},{"function-bind":158}],164:[function(require,module,exports){ /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ exports.read = function (buffer, offset, isLE, mLen, nBytes) { var e, m @@ -52729,7 +52791,7 @@ if (typeof Object.create === 'function') { },{}],166:[function(require,module,exports){ 'use strict'; -var hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol'; +var hasToStringTag = require('has-tostringtag/shams')(); var callBound = require('call-bind/callBound'); var $toString = callBound('Object.prototype.toString'); @@ -52761,15 +52823,91 @@ isStandardArguments.isLegacyArguments = isLegacyArguments; // for tests module.exports = supportsStandardArguments ? isStandardArguments : isLegacyArguments; -},{"call-bind/callBound":153}],167:[function(require,module,exports){ +},{"call-bind/callBound":152,"has-tostringtag/shams":162}],167:[function(require,module,exports){ arguments[4][69][0].apply(exports,arguments) },{"dup":69}],168:[function(require,module,exports){ 'use strict'; +var fnToStr = Function.prototype.toString; +var reflectApply = typeof Reflect === 'object' && Reflect !== null && Reflect.apply; +var badArrayLike; +var isCallableMarker; +if (typeof reflectApply === 'function' && typeof Object.defineProperty === 'function') { + try { + badArrayLike = Object.defineProperty({}, 'length', { + get: function () { + throw isCallableMarker; + } + }); + isCallableMarker = {}; + // eslint-disable-next-line no-throw-literal + reflectApply(function () { throw 42; }, null, badArrayLike); + } catch (_) { + if (_ !== isCallableMarker) { + reflectApply = null; + } + } +} else { + reflectApply = null; +} + +var constructorRegex = /^\s*class\b/; +var isES6ClassFn = function isES6ClassFunction(value) { + try { + var fnStr = fnToStr.call(value); + return constructorRegex.test(fnStr); + } catch (e) { + return false; // not a function + } +}; + +var tryFunctionObject = function tryFunctionToStr(value) { + try { + if (isES6ClassFn(value)) { return false; } + fnToStr.call(value); + return true; + } catch (e) { + return false; + } +}; +var toStr = Object.prototype.toString; +var fnClass = '[object Function]'; +var genClass = '[object GeneratorFunction]'; +var hasToStringTag = typeof Symbol === 'function' && !!Symbol.toStringTag; // better: use `has-tostringtag` +/* globals document: false */ +var documentDotAll = typeof document === 'object' && typeof document.all === 'undefined' && document.all !== undefined ? document.all : {}; + +module.exports = reflectApply + ? function isCallable(value) { + if (value === documentDotAll) { return true; } + if (!value) { return false; } + if (typeof value !== 'function' && typeof value !== 'object') { return false; } + if (typeof value === 'function' && !value.prototype) { return true; } + try { + reflectApply(value, null, badArrayLike); + } catch (e) { + if (e !== isCallableMarker) { return false; } + } + return !isES6ClassFn(value); + } + : function isCallable(value) { + if (value === documentDotAll) { return true; } + if (!value) { return false; } + if (typeof value !== 'function' && typeof value !== 'object') { return false; } + if (typeof value === 'function' && !value.prototype) { return true; } + if (hasToStringTag) { return tryFunctionObject(value); } + if (isES6ClassFn(value)) { return false; } + var strClass = toStr.call(value); + return strClass === fnClass || strClass === genClass; + }; + +},{}],169:[function(require,module,exports){ +'use strict'; + var toStr = Object.prototype.toString; var fnToStr = Function.prototype.toString; var isFnRegex = /^\s*(?:function)?\*/; -var hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol'; +var hasToStringTag = require('has-tostringtag/shams')(); var getProto = Object.getPrototypeOf; var getGeneratorFunc = function () { // eslint-disable-line consistent-return if (!hasToStringTag) { @@ -52780,8 +52918,7 @@ var getGeneratorFunc = function () { // eslint-disable-line consistent-return } catch (e) { } }; -var generatorFunc = getGeneratorFunc(); -var GeneratorFunction = getProto && generatorFunc ? getProto(generatorFunc) : false; +var GeneratorFunction; module.exports = function isGeneratorFunction(fn) { if (typeof fn !== 'function') { @@ -52794,21 +52931,28 @@ module.exports = function isGeneratorFunction(fn) { var str = toStr.call(fn); return str === '[object GeneratorFunction]'; } - return getProto && getProto(fn) === GeneratorFunction; + if (!getProto) { + return false; + } + if (typeof GeneratorFunction === 'undefined') { + var generatorFunc = getGeneratorFunc(); + GeneratorFunction = generatorFunc ? getProto(generatorFunc) : false; + } + return getProto(fn) === GeneratorFunction; }; -},{}],169:[function(require,module,exports){ +},{"has-tostringtag/shams":162}],170:[function(require,module,exports){ (function (global){(function (){ 'use strict'; -var forEach = require('foreach'); +var forEach = require('for-each'); var availableTypedArrays = require('available-typed-arrays'); var callBound = require('call-bind/callBound'); var $toString = callBound('Object.prototype.toString'); -var hasSymbols = require('has-symbols')(); -var hasToStringTag = hasSymbols && typeof Symbol.toStringTag === 'symbol'; +var hasToStringTag = require('has-tostringtag/shams')(); +var g = typeof globalThis === 'undefined' ? global : globalThis; var typedArrays = availableTypedArrays(); var $indexOf = callBound('Array.prototype.indexOf', true) || function indexOf(array, value) { @@ -52825,17 +52969,16 @@ var gOPD = require('es-abstract/helpers/getOwnPropertyDescriptor'); var getPrototypeOf = Object.getPrototypeOf; // require('getprototypeof'); if (hasToStringTag && gOPD && getPrototypeOf) { forEach(typedArrays, function (typedArray) { - var arr = new global[typedArray](); - if (!(Symbol.toStringTag in arr)) { - throw new EvalError('this engine has support for Symbol.toStringTag, but ' + typedArray + ' does not have the property! Please report this.'); - } - var proto = getPrototypeOf(arr); - var descriptor = gOPD(proto, Symbol.toStringTag); - if (!descriptor) { - var superProto = getPrototypeOf(proto); - descriptor = gOPD(superProto, Symbol.toStringTag); + var arr = new g[typedArray](); + if (Symbol.toStringTag in arr) { + var proto = getPrototypeOf(arr); + var descriptor = gOPD(proto, Symbol.toStringTag); + if (!descriptor) { + var superProto = getPrototypeOf(proto); + descriptor = gOPD(superProto, Symbol.toStringTag); + } + toStrTags[typedArray] = descriptor.get; } - toStrTags[typedArray] = descriptor.get; }); } @@ -52853,7 +52996,7 @@ var tryTypedArrays = function tryAllTypedArrays(value) { module.exports = function isTypedArray(value) { if (!value || typeof value !== 'object') { return false; } - if (!hasToStringTag) { + if (!hasToStringTag || !(Symbol.toStringTag in value)) { var tag = $slice($toString(value), 8, -1); return $indexOf(typedArrays, tag) > -1; } @@ -52862,7 +53005,7 @@ module.exports = function isTypedArray(value) { }; }).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"available-typed-arrays":147,"call-bind/callBound":153,"es-abstract/helpers/getOwnPropertyDescriptor":155,"foreach":157,"has-symbols":161}],170:[function(require,module,exports){ +},{"available-typed-arrays":146,"call-bind/callBound":152,"es-abstract/helpers/getOwnPropertyDescriptor":154,"for-each":156,"has-tostringtag/shams":162}],171:[function(require,module,exports){ /* object-assign (c) Sindre Sorhus @@ -52954,7 +53097,7 @@ module.exports = shouldUseNative() ? Object.assign : function (target, source) { return to; }; -},{}],171:[function(require,module,exports){ +},{}],172:[function(require,module,exports){ exports.endianness = function () { return 'LE' }; exports.hostname = function () { @@ -53005,7 +53148,7 @@ exports.homedir = function () { return '/' }; -},{}],172:[function(require,module,exports){ +},{}],173:[function(require,module,exports){ 'use strict'; @@ -53112,7 +53255,7 @@ exports.setTyped = function (on) { exports.setTyped(TYPED_OK); -},{}],173:[function(require,module,exports){ +},{}],174:[function(require,module,exports){ 'use strict'; // Note: adler32 takes 12% for level 0 and 2% for level 6. @@ -53165,7 +53308,7 @@ function adler32(adler, buf, len, pos) { module.exports = adler32; -},{}],174:[function(require,module,exports){ +},{}],175:[function(require,module,exports){ 'use strict'; // (C) 1995-2013 Jean-loup Gailly and Mark Adler @@ -53235,7 +53378,7 @@ module.exports = { //Z_NULL: null // Use -1 or null inline, depending on var type }; -},{}],175:[function(require,module,exports){ +},{}],176:[function(require,module,exports){ 'use strict'; // Note: we can't get significant speed boost here. @@ -53296,7 +53439,7 @@ function crc32(crc, buf, len, pos) { module.exports = crc32; -},{}],176:[function(require,module,exports){ +},{}],177:[function(require,module,exports){ 'use strict'; // (C) 1995-2013 Jean-loup Gailly and Mark Adler @@ -55172,7 +55315,7 @@ exports.deflatePrime = deflatePrime; exports.deflateTune = deflateTune; */ -},{"../utils/common":172,"./adler32":173,"./crc32":175,"./messages":180,"./trees":181}],177:[function(require,module,exports){ +},{"../utils/common":173,"./adler32":174,"./crc32":176,"./messages":181,"./trees":182}],178:[function(require,module,exports){ 'use strict'; // (C) 1995-2013 Jean-loup Gailly and Mark Adler @@ -55519,7 +55662,7 @@ module.exports = function inflate_fast(strm, start) { return; }; -},{}],178:[function(require,module,exports){ +},{}],179:[function(require,module,exports){ 'use strict'; // (C) 1995-2013 Jean-loup Gailly and Mark Adler @@ -57077,7 +57220,7 @@ exports.inflateSyncPoint = inflateSyncPoint; exports.inflateUndermine = inflateUndermine; */ -},{"../utils/common":172,"./adler32":173,"./crc32":175,"./inffast":177,"./inftrees":179}],179:[function(require,module,exports){ +},{"../utils/common":173,"./adler32":174,"./crc32":176,"./inffast":178,"./inftrees":180}],180:[function(require,module,exports){ 'use strict'; // (C) 1995-2013 Jean-loup Gailly and Mark Adler @@ -57422,7 +57565,7 @@ module.exports = function inflate_table(type, lens, lens_index, codes, table, ta return 0; }; -},{"../utils/common":172}],180:[function(require,module,exports){ +},{"../utils/common":173}],181:[function(require,module,exports){ 'use strict'; // (C) 1995-2013 Jean-loup Gailly and Mark Adler @@ -57456,7 +57599,7 @@ module.exports = { '-6': 'incompatible version' /* Z_VERSION_ERROR (-6) */ }; -},{}],181:[function(require,module,exports){ +},{}],182:[function(require,module,exports){ 'use strict'; // (C) 1995-2013 Jean-loup Gailly and Mark Adler @@ -58680,7 +58823,7 @@ exports._tr_flush_block = _tr_flush_block; exports._tr_tally = _tr_tally; exports._tr_align = _tr_align; -},{"../utils/common":172}],182:[function(require,module,exports){ +},{"../utils/common":173}],183:[function(require,module,exports){ 'use strict'; // (C) 1995-2013 Jean-loup Gailly and Mark Adler @@ -58729,7 +58872,7 @@ function ZStream() { module.exports = ZStream; -},{}],183:[function(require,module,exports){ +},{}],184:[function(require,module,exports){ (function (process){(function (){ // 'path' module extracted from Node.js v8.11.1 (only the posix part) // transplited with Babel @@ -59262,7 +59405,7 @@ posix.posix = posix; module.exports = posix; }).call(this)}).call(this,require('_process')) -},{"_process":184}],184:[function(require,module,exports){ +},{"_process":185}],185:[function(require,module,exports){ // shim for using process in browser var process = module.exports = {}; @@ -59448,7 +59591,7 @@ process.chdir = function (dir) { }; process.umask = function() { return 0; }; -},{}],185:[function(require,module,exports){ +},{}],186:[function(require,module,exports){ /*! safe-buffer. MIT License. Feross Aboukhadijeh */ /* eslint-disable node/no-deprecated-api */ var buffer = require('buffer') @@ -59515,7 +59658,7 @@ SafeBuffer.allocUnsafeSlow = function (size) { return buffer.SlowBuffer(size) } -},{"buffer":152}],186:[function(require,module,exports){ +},{"buffer":151}],187:[function(require,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a @@ -59646,7 +59789,7 @@ Stream.prototype.pipe = function(dest, options) { return dest; }; -},{"events":156,"inherits":165,"readable-stream/lib/_stream_duplex.js":188,"readable-stream/lib/_stream_passthrough.js":189,"readable-stream/lib/_stream_readable.js":190,"readable-stream/lib/_stream_transform.js":191,"readable-stream/lib/_stream_writable.js":192,"readable-stream/lib/internal/streams/end-of-stream.js":196,"readable-stream/lib/internal/streams/pipeline.js":198}],187:[function(require,module,exports){ +},{"events":155,"inherits":165,"readable-stream/lib/_stream_duplex.js":189,"readable-stream/lib/_stream_passthrough.js":190,"readable-stream/lib/_stream_readable.js":191,"readable-stream/lib/_stream_transform.js":192,"readable-stream/lib/_stream_writable.js":193,"readable-stream/lib/internal/streams/end-of-stream.js":197,"readable-stream/lib/internal/streams/pipeline.js":199}],188:[function(require,module,exports){ 'use strict'; function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; } @@ -59775,7 +59918,7 @@ createErrorType('ERR_UNKNOWN_ENCODING', function (arg) { createErrorType('ERR_STREAM_UNSHIFT_AFTER_END_EVENT', 'stream.unshift() after end event'); module.exports.codes = codes; -},{}],188:[function(require,module,exports){ +},{}],189:[function(require,module,exports){ (function (process){(function (){ // Copyright Joyent, Inc. and other Node contributors. // @@ -59917,7 +60060,7 @@ Object.defineProperty(Duplex.prototype, 'destroyed', { } }); }).call(this)}).call(this,require('_process')) -},{"./_stream_readable":190,"./_stream_writable":192,"_process":184,"inherits":165}],189:[function(require,module,exports){ +},{"./_stream_readable":191,"./_stream_writable":193,"_process":185,"inherits":165}],190:[function(require,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a @@ -59957,7 +60100,7 @@ function PassThrough(options) { PassThrough.prototype._transform = function (chunk, encoding, cb) { cb(null, chunk); }; -},{"./_stream_transform":191,"inherits":165}],190:[function(require,module,exports){ +},{"./_stream_transform":192,"inherits":165}],191:[function(require,module,exports){ (function (process,global){(function (){ // Copyright Joyent, Inc. and other Node contributors. // @@ -61084,7 +61227,7 @@ function indexOf(xs, x) { return -1; } }).call(this)}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"../errors":187,"./_stream_duplex":188,"./internal/streams/async_iterator":193,"./internal/streams/buffer_list":194,"./internal/streams/destroy":195,"./internal/streams/from":197,"./internal/streams/state":199,"./internal/streams/stream":200,"_process":184,"buffer":152,"events":156,"inherits":165,"string_decoder/":201,"util":149}],191:[function(require,module,exports){ +},{"../errors":188,"./_stream_duplex":189,"./internal/streams/async_iterator":194,"./internal/streams/buffer_list":195,"./internal/streams/destroy":196,"./internal/streams/from":198,"./internal/streams/state":200,"./internal/streams/stream":201,"_process":185,"buffer":151,"events":155,"inherits":165,"string_decoder/":202,"util":148}],192:[function(require,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a @@ -61286,7 +61429,7 @@ function done(stream, er, data) { if (stream._transformState.transforming) throw new ERR_TRANSFORM_ALREADY_TRANSFORMING(); return stream.push(null); } -},{"../errors":187,"./_stream_duplex":188,"inherits":165}],192:[function(require,module,exports){ +},{"../errors":188,"./_stream_duplex":189,"inherits":165}],193:[function(require,module,exports){ (function (process,global){(function (){ // Copyright Joyent, Inc. and other Node contributors. // @@ -61986,7 +62129,7 @@ Writable.prototype._destroy = function (err, cb) { cb(err); }; }).call(this)}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"../errors":187,"./_stream_duplex":188,"./internal/streams/destroy":195,"./internal/streams/state":199,"./internal/streams/stream":200,"_process":184,"buffer":152,"inherits":165,"util-deprecate":204}],193:[function(require,module,exports){ +},{"../errors":188,"./_stream_duplex":189,"./internal/streams/destroy":196,"./internal/streams/state":200,"./internal/streams/stream":201,"_process":185,"buffer":151,"inherits":165,"util-deprecate":205}],194:[function(require,module,exports){ (function (process){(function (){ 'use strict'; @@ -62196,7 +62339,7 @@ var createReadableStreamAsyncIterator = function createReadableStreamAsyncIterat module.exports = createReadableStreamAsyncIterator; }).call(this)}).call(this,require('_process')) -},{"./end-of-stream":196,"_process":184}],194:[function(require,module,exports){ +},{"./end-of-stream":197,"_process":185}],195:[function(require,module,exports){ 'use strict'; function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } @@ -62407,7 +62550,7 @@ function () { return BufferList; }(); -},{"buffer":152,"util":149}],195:[function(require,module,exports){ +},{"buffer":151,"util":148}],196:[function(require,module,exports){ (function (process){(function (){ 'use strict'; // undocumented cb() API, needed for core, not for public API @@ -62515,7 +62658,7 @@ module.exports = { errorOrDestroy: errorOrDestroy }; }).call(this)}).call(this,require('_process')) -},{"_process":184}],196:[function(require,module,exports){ +},{"_process":185}],197:[function(require,module,exports){ // Ported from https://github.com/mafintosh/end-of-stream with // permission from the author, Mathias Buus (@mafintosh). 'use strict'; @@ -62620,12 +62763,12 @@ function eos(stream, opts, callback) { } module.exports = eos; -},{"../../../errors":187}],197:[function(require,module,exports){ +},{"../../../errors":188}],198:[function(require,module,exports){ module.exports = function () { throw new Error('Readable.from is not available in the browser') }; -},{}],198:[function(require,module,exports){ +},{}],199:[function(require,module,exports){ // Ported from https://github.com/mafintosh/pump with // permission from the author, Mathias Buus (@mafintosh). 'use strict'; @@ -62723,7 +62866,7 @@ function pipeline() { } module.exports = pipeline; -},{"../../../errors":187,"./end-of-stream":196}],199:[function(require,module,exports){ +},{"../../../errors":188,"./end-of-stream":197}],200:[function(require,module,exports){ 'use strict'; var ERR_INVALID_OPT_VALUE = require('../../../errors').codes.ERR_INVALID_OPT_VALUE; @@ -62751,10 +62894,10 @@ function getHighWaterMark(state, options, duplexKey, isDuplex) { module.exports = { getHighWaterMark: getHighWaterMark }; -},{"../../../errors":187}],200:[function(require,module,exports){ +},{"../../../errors":188}],201:[function(require,module,exports){ module.exports = require('events').EventEmitter; -},{"events":156}],201:[function(require,module,exports){ +},{"events":155}],202:[function(require,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a @@ -63051,7 +63194,7 @@ function simpleWrite(buf) { function simpleEnd(buf) { return buf && buf.length ? this.write(buf) : ''; } -},{"safe-buffer":185}],202:[function(require,module,exports){ +},{"safe-buffer":186}],203:[function(require,module,exports){ (function (setImmediate,clearImmediate){(function (){ var nextTick = require('process/browser.js').nextTick; var apply = Function.prototype.apply; @@ -63130,7 +63273,7 @@ exports.clearImmediate = typeof clearImmediate === "function" ? clearImmediate : delete immediateIds[id]; }; }).call(this)}).call(this,require("timers").setImmediate,require("timers").clearImmediate) -},{"process/browser.js":184,"timers":202}],203:[function(require,module,exports){ +},{"process/browser.js":185,"timers":203}],204:[function(require,module,exports){ exports.isatty = function () { return false; }; function ReadStream() { @@ -63143,7 +63286,7 @@ function WriteStream() { } exports.WriteStream = WriteStream; -},{}],204:[function(require,module,exports){ +},{}],205:[function(require,module,exports){ (function (global){(function (){ /** @@ -63214,9 +63357,9 @@ function config (name) { } }).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{}],205:[function(require,module,exports){ -arguments[4][145][0].apply(exports,arguments) -},{"dup":145}],206:[function(require,module,exports){ +},{}],206:[function(require,module,exports){ +arguments[4][144][0].apply(exports,arguments) +},{"dup":144}],207:[function(require,module,exports){ // Currently in sync with Node.js lib/internal/util/types.js // https://github.com/nodejs/node/commit/112cc7c27551254aa2b17098fb774867f05ed0d9 @@ -63454,21 +63597,23 @@ function isDataView(value) { } exports.isDataView = isDataView; +// Store a copy of SharedArrayBuffer in case it's deleted elsewhere +var SharedArrayBufferCopy = typeof SharedArrayBuffer !== 'undefined' ? SharedArrayBuffer : undefined; function isSharedArrayBufferToString(value) { return ObjectToString(value) === '[object SharedArrayBuffer]'; } -isSharedArrayBufferToString.working = ( - typeof SharedArrayBuffer !== 'undefined' && - isSharedArrayBufferToString(new SharedArrayBuffer()) -); function isSharedArrayBuffer(value) { - if (typeof SharedArrayBuffer === 'undefined') { + if (typeof SharedArrayBufferCopy === 'undefined') { return false; } + if (typeof isSharedArrayBufferToString.working === 'undefined') { + isSharedArrayBufferToString.working = isSharedArrayBufferToString(new SharedArrayBufferCopy()); + } + return isSharedArrayBufferToString.working ? isSharedArrayBufferToString(value) - : value instanceof SharedArrayBuffer; + : value instanceof SharedArrayBufferCopy; } exports.isSharedArrayBuffer = isSharedArrayBuffer; @@ -63550,7 +63695,7 @@ exports.isAnyArrayBuffer = isAnyArrayBuffer; }); }); -},{"is-arguments":166,"is-generator-function":168,"is-typed-array":169,"which-typed-array":208}],207:[function(require,module,exports){ +},{"is-arguments":166,"is-generator-function":169,"is-typed-array":170,"which-typed-array":209}],208:[function(require,module,exports){ (function (process){(function (){ // Copyright Joyent, Inc. and other Node contributors. // @@ -64269,18 +64414,18 @@ function callbackify(original) { exports.callbackify = callbackify; }).call(this)}).call(this,require('_process')) -},{"./support/isBuffer":205,"./support/types":206,"_process":184,"inherits":165}],208:[function(require,module,exports){ +},{"./support/isBuffer":206,"./support/types":207,"_process":185,"inherits":165}],209:[function(require,module,exports){ (function (global){(function (){ 'use strict'; -var forEach = require('foreach'); +var forEach = require('for-each'); var availableTypedArrays = require('available-typed-arrays'); var callBound = require('call-bind/callBound'); var $toString = callBound('Object.prototype.toString'); -var hasSymbols = require('has-symbols')(); -var hasToStringTag = hasSymbols && typeof Symbol.toStringTag === 'symbol'; +var hasToStringTag = require('has-tostringtag/shams')(); +var g = typeof globalThis === 'undefined' ? global : globalThis; var typedArrays = availableTypedArrays(); var $slice = callBound('String.prototype.slice'); @@ -64289,18 +64434,17 @@ var gOPD = require('es-abstract/helpers/getOwnPropertyDescriptor'); var getPrototypeOf = Object.getPrototypeOf; // require('getprototypeof'); if (hasToStringTag && gOPD && getPrototypeOf) { forEach(typedArrays, function (typedArray) { - if (typeof global[typedArray] === 'function') { - var arr = new global[typedArray](); - if (!(Symbol.toStringTag in arr)) { - throw new EvalError('this engine has support for Symbol.toStringTag, but ' + typedArray + ' does not have the property! Please report this.'); - } - var proto = getPrototypeOf(arr); - var descriptor = gOPD(proto, Symbol.toStringTag); - if (!descriptor) { - var superProto = getPrototypeOf(proto); - descriptor = gOPD(superProto, Symbol.toStringTag); + if (typeof g[typedArray] === 'function') { + var arr = new g[typedArray](); + if (Symbol.toStringTag in arr) { + var proto = getPrototypeOf(arr); + var descriptor = gOPD(proto, Symbol.toStringTag); + if (!descriptor) { + var superProto = getPrototypeOf(proto); + descriptor = gOPD(superProto, Symbol.toStringTag); + } + toStrTags[typedArray] = descriptor.get; } - toStrTags[typedArray] = descriptor.get; } }); } @@ -64324,10 +64468,10 @@ var isTypedArray = require('is-typed-array'); module.exports = function whichTypedArray(value) { if (!isTypedArray(value)) { return false; } - if (!hasToStringTag) { return $slice($toString(value), 8, -1); } + if (!hasToStringTag || !(Symbol.toStringTag in value)) { return $slice($toString(value), 8, -1); } return tryTypedArrays(value); }; }).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"available-typed-arrays":147,"call-bind/callBound":153,"es-abstract/helpers/getOwnPropertyDescriptor":155,"foreach":157,"has-symbols":161,"is-typed-array":169}]},{},[9])(9) +},{"available-typed-arrays":146,"call-bind/callBound":152,"es-abstract/helpers/getOwnPropertyDescriptor":154,"for-each":156,"has-tostringtag/shams":162,"is-typed-array":170}]},{},[9])(9) }); diff --git a/browser/termkit.min.js b/browser/termkit.min.js index 57b73916..6ce2e28c 100644 --- a/browser/termkit.min.js +++ b/browser/termkit.min.js @@ -1 +1 @@ -(function(t){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=t()}else if(typeof define==="function"&&define.amd){define([],t)}else{var e;if(typeof window!=="undefined"){e=window}else if(typeof global!=="undefined"){e=global}else if(typeof self!=="undefined"){e=self}else{e=this}e.TerminalKit=t()}})(function(){var n,t,e;return function(){function f(s,o,a){function u(r,t){if(!o[r]){if(!s[r]){var e="function"==typeof require&&require;if(!t&&e)return e(r,!0);if(l)return l(r,!0);var i=new Error("Cannot find module '"+r+"'");throw i.code="MODULE_NOT_FOUND",i}var n=o[r]={exports:{}};s[r][0].call(n.exports,function(t){var e=s[r][1][t];return u(e||t)},n,n.exports,f,s,o,a)}return o[r].exports}for(var l="function"==typeof require&&require,t=0;tl.chroma(t.code));i=16;for(r=0;r>=-2;r--){if(r>0){o="!".repeat(r)}else if(r<0){o="~".repeat(-r)}else{o=""}for(e=2;e>=-3;e--){if(e>0){a="+".repeat(e)}else if(e<0){a="-".repeat(-e)}else{a=""}u=o+a;for(t=0;t<12;t++){s=this.clStep(n[t],r,e);this.addColor(i,s,this.adaptivePaletteDef[t].names,"@",u);i++}}}};o.prototype.generateExtra=function(){if(this.system){return}var t,e;e=232;for(t=0;t<13&&t{var e=i+t.replace(/-/g,"")+n;t=i+t+n;this.colorIndex[t]=r;if(e!==t){this.colorIndex[e]=r}})};const f=1.1;o.prototype.clStep=function(t,e,r,i=true){var n,s,o,a,u,l;if(!e&&!r){return t}n=t.get("hcl.c");s=t.get("hcl.l");n*=(e>0?1.6:1.7)**e;s*=(r>0?1.2:1.35)**r;t=t.set("hcl.c",n).set("hcl.l",s);if(!i||!t.clipped){return t}l=Math.abs(r)>=e;for(;;){o=t._rgb._unclipped;o.length=3;if(o.every(t=>t>-5&&t<260)){return t}u=[...o].sort();if(u[2]>=256){a=(u[0]+u[1]+u[2])/3;if(l){n=t.get("hcl.c");n/=f;t=t.set("hcl.c",n)}else{s=t.get("hcl.l");s/=f;t=t.set("hcl.l",s)}if(a>255){return t}}else if(u[1]<0){a=(u[0]+u[1]+u[2])/3;if(l){n=t.get("hcl.c");n/=f;t=t.set("hcl.c",n)}else{s=t.get("hcl.l");s*=f;t=t.set("hcl.l",s)}if(a<0){return t}}else{return t}}}},{"./termkit.js":55}],2:[function(t,e,r){"use strict";const s=t("./termkit.js");function d(t,e,r,i){var n=t;this.xmin=0;this.xmax=0;this.ymin=0;this.ymax=0;this.width=0;this.height=0;this.isNull=true;if(n&&(typeof n==="object"||typeof n==="function")){if(n instanceof s.Terminal){this.set({xmin:1,ymin:1,xmax:n.width,ymax:n.height})}else if(n instanceof s.ScreenBuffer){this.set({xmin:0,ymin:0,xmax:n.width-1,ymax:n.height-1})}else if(n instanceof s.TextBuffer){this.set({xmin:0,ymin:0,xmax:n.width-1,ymax:n.height-1})}else if(n instanceof d){this.set(n)}else if(n.xmin!==undefined||n.ymin!==undefined||n.xmax!==undefined||n.ymax!==undefined){this.set({xmin:n.xmin!==undefined?n.xmin:0,ymin:n.ymin!==undefined?n.ymin:0,xmax:n.xmax!==undefined?n.xmax:1,ymax:n.ymax!==undefined?n.ymax:1})}else if(n.x!==undefined||n.y!==undefined||n.width!==undefined||n.height!==undefined){this.set({xmin:n.x!==undefined?n.x:0,ymin:n.y!==undefined?n.y:0,xmax:n.width!==undefined?n.x+n.width-1:1,ymax:n.height!==undefined?n.y+n.height-1:1})}}else{this.set({xmin:t!==undefined?t:0,ymin:e!==undefined?e:0,xmax:r!==undefined?r:1,ymax:i!==undefined?i:1})}}e.exports=d;d.create=(...t)=>new d(...t);d.prototype.set=function(t){if(t.xmin!==undefined){this.xmin=Math.floor(t.xmin)}if(t.xmax!==undefined){this.xmax=Math.floor(t.xmax)}if(t.ymin!==undefined){this.ymin=Math.floor(t.ymin)}if(t.ymax!==undefined){this.ymax=Math.floor(t.ymax)}this.width=this.xmax-this.xmin+1;this.height=this.ymax-this.ymin+1;this.isNull=this.xmin>this.xmax||this.ymin>this.ymax};d.prototype.setSize=function(t){if(t.width!==undefined){this.width=Math.floor(t.width);this.xmax=this.xmin+this.width-1}if(t.height!==undefined){this.height=Math.floor(t.height);this.ymax=this.ymin+this.height-1}this.isNull=this.xmin>this.xmax||this.ymin>this.ymax};d.prototype.isInside=function(t,e){return t>=this.xmin&&t<=this.xmax&&e>=this.ymin&&e<=this.ymax};d.prototype.clip=function(t,e,r,i){var n=this;e=e||0;r=r||0;n.set({xmin:Math.max(n.xmin,t.xmin-e),ymin:Math.max(n.ymin,t.ymin-r),xmax:Math.min(n.xmax,t.xmax-e),ymax:Math.min(n.ymax,t.ymax-r)});if(i){t.set({xmin:Math.max(t.xmin,n.xmin+e),ymin:Math.max(t.ymin,n.ymin+r),xmax:Math.min(t.xmax,n.xmax+e),ymax:Math.min(t.ymax,n.ymax+r)})}return this};d.prototype.merge=function(t){this.set({xmin:Math.min(this.xmin,t.xmin),ymin:Math.min(this.ymin,t.ymin),xmax:Math.max(this.xmax,t.xmax),ymax:Math.max(this.ymax,t.ymax)});return this};d.wrappingRect=function(t){var e=[],r,i,n,s;r={srcRect:new d(t.srcRect),dstRect:new d(t.dstRect),offsetX:t.offsetX,offsetY:t.offsetY};if(t.wrapOnly!=="y"){r.offsetX=r.offsetX%t.dstRect.width;if(r.offsetX<0){r.offsetX+=t.dstRect.width}}if(t.wrapOnly!=="x"){r.offsetY=r.offsetY%t.dstRect.height;if(r.offsetY<0){r.offsetY+=t.dstRect.height}}r.srcRect.clip(r.dstRect,r.offsetX,r.offsetY,true);if(!r.srcRect.isNull){e.push(r)}if(r.srcRect.width=0;i--){s=t.srcClipRect.ymin+i;a=t.dstClipRect.ymin+i;e({context:t.context,srcXmin:t.srcClipRect.xmin,srcXmax:t.srcClipRect.xmax,srcY:s,srcStart:(s*t.srcRect.width+t.srcClipRect.xmin)*t.multiply,srcEnd:(s*t.srcRect.width+t.srcClipRect.xmax+1)*t.multiply,dstXmin:t.dstClipRect.xmin,dstXmax:t.dstClipRect.xmax,dstY:a,dstStart:(a*t.dstRect.width+t.dstClipRect.xmin)*t.multiply,dstEnd:(a*t.dstRect.width+t.dstClipRect.xmax+1)*t.multiply})}break;case"cell":for(i=0;inew d(...t);const p=r("./termkit.js");const h=p.Rect;d.createFromString=function(t,e){var r,i,n,s,o,a,u,l,f;if(!t){t={}}if(typeof e!=="string"){if(!e.toString){throw new Error("[terminal] ScreenBuffer.createFromDataString(): argument #1 should be a string or provide a .toString() method.")}e=e.toString()}e=p.stripControlChars(e,true).split("\n");a=0;u=e.length;s=t.attr!==undefined?t.attr:d.prototype.DEFAULT_ATTR;if(s&&typeof s==="object"&&!s.BYTES_PER_ELEMENT){s=d.object2attr(s)}o=s;if(t.transparencyChar){if(!t.transparencyType){o|=S}else{o|=t.transparencyType&S}}for(i=0;ia){a=l}}f=new d({width:a,height:u});for(i=0;i{var e,r,i,n,s=m.unicode.toArray(t),o,a=s.length;for(o=0;o=0&&h+e*(d||1)=0&&c=0&&h=0&&c=this.width){h=0;c++}}}};if(!u.markup){s(r)}else{const o=this.attr2object(this.DEFAULT_ATTR);const a=this.attr2object(i);let e=false;let t=null;switch(u.markup){case"ansi":t=m.ansi.parse(r);break;case"legacyAnsi":t=m.ansi.parse(r);e=true;break;case true:t=this.parseMarkup(r);break}t.forEach(t=>{n=Object.assign({},t.specialReset?o:a,t);delete n.text;if(n.defaultColor&&n.color){delete n.defaultColor}if(n.bgDefaultColor&&n.bgColor){delete n.bgDefaultColor}g=this.object2attr(n,undefined,e);if(t.text){s(t.text)}})}this.cx=h;this.cy=c;return g};d.prototype.get=function(t){var e,r,i;if(!t){t={}}e=t.x!==undefined?t.x:this.cx;r=t.y!==undefined?t.y:this.cy;if(typeof e!=="number"||e<0||e>=this.width){return null}e=Math.floor(e);if(typeof r!=="number"||r<0||r>=this.height){return null}r=Math.floor(r);i=(r*this.width+e)*this.ITEM_SIZE;return{attr:this.attr2object(this.readAttr(this.buffer,i)),char:this.readChar(this.buffer,i)}};d.prototype.resize=function(t){t=new h(t);var e=-t.xmin,r=-t.ymin;var i=new h({xmin:0,ymin:0,xmax:t.width-1,ymax:t.height-1});t.clip(new h(this));if(i.isNull){return false}var n=I.allocUnsafe(i.width*i.height*this.ITEM_SIZE);this.fill({buffer:n});h.regionIterator({type:"line",context:{srcBuffer:this.buffer,dstBuffer:n},dstRect:i,dstClipRect:new h(i),srcRect:new h(this),srcClipRect:t,offsetX:e,offsetY:r,multiply:this.ITEM_SIZE},this.blitterLineIterator.bind(this));this.width=i.width;this.height=i.height;this.buffer=n;this.lastBuffer=null;this.emit("resize",this.width,this.height);return true};d.prototype.draw=function(t){if(!t||typeof t!=="object"){t={}}var e={dst:t.dst||this.dst,inline:t.inline!==undefined?!!t.inline:this.inline,offsetX:t.x!==undefined?Math.floor(t.x):Math.floor(this.x),offsetY:t.y!==undefined?Math.floor(t.y):Math.floor(this.y),dstClipRect:t.dstClipRect?new h(t.dstClipRect):undefined,srcClipRect:t.srcClipRect?new h(t.srcClipRect):undefined,delta:t.delta,blending:t.blending!==undefined?t.blending:this.blending,wrap:t.wrap,tile:t.tile};if(e.dst instanceof d){return this.blitter(e)}else if(e.dst instanceof p.Terminal){return this.terminalBlitter(e)}};d.prototype.moveTo=function(t,e){this.cx=Math.max(0,Math.min(t,this.width-1));this.cy=Math.max(0,Math.min(e,this.height-1))};d.prototype.drawCursor=function(t){if(!t||typeof t!=="object"){t={}}var e=t.dst||this.dst;if(e instanceof d){if(this.ch){e.ch=true}else{e.ch=false;e.moveTo(this.cx+this.x,this.cy+this.y)}}else if(e instanceof p.Terminal){if(this.ch){if(this.ch!==this.lastCh){e.hideCursor()}}else{if(this.ch!==this.lastCh){e.hideCursor(false)}e.moveTo(Math.max(1,Math.min(this.cx+this.x,e.width)),Math.max(1,Math.min(this.cy+this.y,e.height)))}this.lastCh=this.ch}};d.prototype.blitter=function(t){var e,r,i;e={type:"line",context:{srcBuffer:this.buffer,dstBuffer:t.dst.buffer,blending:t.blending},dstRect:new h(t.dst),srcRect:new h(this),dstClipRect:t.dstClipRect||new h(t.dst),srcClipRect:t.srcClipRect||new h(this),offsetX:t.offsetX,offsetY:t.offsetY,wrap:t.wrap,tile:t.tile,multiply:this.ITEM_SIZE};r="regionIterator";i=this.blitterLineIterator.bind(this);if(t.blending){e.type="cell";i=this.blitterCellBlendingIterator.bind(this)}if(t.wrap){r="wrapIterator"}else if(t.tile){r="tileIterator"}else{r="regionIterator"}h[r](e,i)};d.prototype.blitterLineIterator=function(t){if(t.dstStart>=this.ITEM_SIZE){this.removeLeadingFullWidth(t.context.dstBuffer,t.dstStart-this.ITEM_SIZE)}t.context.srcBuffer.copy(t.context.dstBuffer,t.dstStart,t.srcStart,t.srcEnd);this.removeLeadingFullWidth(t.context.dstBuffer,t.dstEnd-this.ITEM_SIZE);if(t.dstEnd=this.ITEM_SIZE){this.removeLeadingFullWidth(t.context.dstBuffer,t.dstStart-this.ITEM_SIZE)}if(t.endOfBlitLine&&t.dstEndO){t.context.rawTerm(t.context.sequence);t.context.sequence="";t.context.writes++}};d.prototype.terminalBlitterCellIterator=function(t){var e=this.readAttr(t.context.srcBuffer,t.srcStart);if(t.context.srcLastBuffer){if(e===this.readAttr(t.context.srcLastBuffer,t.srcStart)&&this.readChar(t.context.srcBuffer,t.srcStart)===this.readChar(t.context.srcLastBuffer,t.srcStart)){return}t.context.srcBuffer.copy(t.context.srcLastBuffer,t.srcStart,t.srcStart,t.srcEnd)}if((e&S)===S||e&E){return}t.context.cells++;if(t.dstX!==t.context.cx||t.dstY!==t.context.cy){t.context.sequence+=t.context.term.optimized.moveTo(t.dstX,t.dstY);t.context.moves++}if((e&n)!==(t.context.lastAttr&n)){t.context.sequence+=t.context.lastAttr===null||!t.context.deltaEscapeSequence?this.generateEscapeSequence(t.context.term,e):this.generateDeltaEscapeSequence(t.context.term,e,t.context.lastAttr);t.context.lastAttr=e;t.context.attrs++}t.context.sequence+=this.readChar(t.context.srcBuffer,t.srcStart);if(t.context.sequence.length>O){t.context.rawTerm(t.context.sequence);t.context.sequence="";t.context.writes++}t.context.cy=t.dstY;if(e&s){t.context.cx=t.dstX+2;return true}t.context.cx=t.dstX+1};d.fromNdarrayImage=function(t,e){var r=e.terminal||p.terminal;var i,n=t.shape[0],s,o=Math.ceil(t.shape[1]/2),a=t.shape[2]===4,u=r.support["256colors"]?255:15,l,f,h={};var c=new d({width:n,height:o,blending:true,noFill:true});for(i=0;ithis.CHAR_SIZE){return"\0"}return t.toString("utf8",e,e+r)};d.prototype.writeChar=function(t,e,r){return t.write(e,r+this.ATTR_SIZE,this.CHAR_SIZE)};d.prototype.generateEscapeSequence=function(t,e){var r=this.palette||t.palette;var i=t.optimized.styleReset+(e&k?t.optimized.defaultColor:r.escape[e&255])+(e&A?t.optimized.bgDefaultColor:r.bgEscape[e>>>8&255]);if(e&f){i+=t.optimized.bold}if(e&c){i+=t.optimized.dim}if(e&g){i+=t.optimized.italic}if(e&y){i+=t.optimized.underline}if(e&b){i+=t.optimized.blink}if(e&v){i+=t.optimized.inverse}if(e&w){i+=t.optimized.hidden}if(e&x){i+=t.optimized.strike}return i};d.prototype.generateDeltaEscapeSequence=function(t,e,r){var i=this.palette||t.palette;var n="",s=e&255,o=r&255,a=e>>>8&255,u=r>>>8&255;if(e&k){if(!(r&k)){n+=t.optimized.defaultColor}}else if(s!==o||r&k){n+=i.escape[s]}if(e&A){if(!(r&A)){n+=t.optimized.bgDefaultColor}}else if(a!==u||r&A){n+=i.bgEscape[a]}if((e&l)!==(r&l)){if((e&_)!==(r&_)){if(r&f&&!(e&f)||r&c&&!(e&c)){n+=t.optimized.noBold;if(e&f){n+=t.optimized.bold}if(e&c){n+=t.optimized.dim}}else{if(e&f&&!(r&f)){n+=t.optimized.bold}if(e&c&&!(r&c)){n+=t.optimized.dim}}}if((e&g)!==(r&g)){n+=e&g?t.optimized.italic:t.optimized.noItalic}if((e&y)!==(r&y)){n+=e&y?t.optimized.underline:t.optimized.noUnderline}if((e&b)!==(r&b)){n+=e&b?t.optimized.blink:t.optimized.noBlink}if((e&v)!==(r&v)){n+=e&v?t.optimized.inverse:t.optimized.noInverse}if((e&w)!==(r&w)){n+=e&w?t.optimized.hidden:t.optimized.noHidden}if((e&x)!==(r&x)){n+=e&x?t.optimized.strike:t.optimized.noStrike}}return n};d.prototype.vScroll=function(t,e,r,i,n){if(!t){return}if(typeof e==="boolean"){n=e;e=r=i=undefined}if(e===undefined||e===null){e=this.DEFAULT_ATTR}else if(e&&typeof e==="object"&&!e.BYTES_PER_ELEMENT){e=this.object2attr(e)}if(r===undefined||r===null){r=0;i=this.height-1}else{if(r<0){r=0}if(i>this.height-1){i=this.height-1}}var s=t*this.width*this.ITEM_SIZE,o=r*this.width*this.ITEM_SIZE,a=(i+1)*this.width*this.ITEM_SIZE;if(s>0){this.buffer.copy(this.buffer,o+s,o,a-s);this.fill({start:o,end:o+s})}else{this.buffer.copy(this.buffer,o,o-s,a);this.fill({start:a+s,end:a})}if(n&&this.dst instanceof p.Terminal){if(this.lastBufferUpToDate&&this.lastBuffer){if(s>0){this.lastBuffer.copy(this.lastBuffer,o+s,o,a-s);this.fill({buffer:this.lastBuffer,start:o,end:o+s})}else{this.lastBuffer.copy(this.lastBuffer,o,o-s,a);this.fill({buffer:this.lastBuffer,start:a+s,end:a})}}this.dst.scrollingRegion(this.y+r,this.y+i);if(t>0){this.dst.scrollDown(t)}else{this.dst.scrollUp(-t)}this.dst.resetScrollingRegion()}};d.prototype.copyRegion=function(t,e,r,i){var n=new h(this),s=new h(t),o=new h(e);o.setSize(s);s.clip(n);o.clip(n);if(s.isNull){return}if(!o.isNull){h.regionIterator({type:o.ymin-s.ymin>0?"reversedLine":"line",context:{srcBuffer:this.buffer,dstBuffer:this.buffer},srcRect:new h(this),srcClipRect:s,dstRect:new h(this),dstClipRect:o,offsetX:o.xmin-s.xmin,offsetY:o.ymin-s.ymin,multiply:this.ITEM_SIZE},this.blitterLineIterator.bind(this))}if(r){throw new Error("Move is not coded ATM")}};d.attr2object=function(t){var e={};if(t&k){e.color=0;e.defaultColor=true}else{e.color=t&255}if(t&A){e.bgColor=0;e.bgDefaultColor=true}else{e.bgColor=t>>>8&255}if(t&f){e.bold=true}if(t&c){e.dim=true}if(t&g){e.italic=true}if(t&y){e.underline=true}if(t&b){e.blink=true}if(t&v){e.inverse=true}if(t&w){e.hidden=true}if(t&x){e.strike=true}if(t&a){e.fgTransparency=true}if(t&u){e.bgTransparency=true}if(t&C){e.styleTransparency=true}if(t&T){e.charTransparency=true}if((t&S)===S){e.transparency=true}return e};d.prototype.attr2object=d.attr2object;d.object2attr=function(t,e,r=false){var i=0,n=false,s=false;if(!t||typeof t!=="object"){t={}}e=e||p.colorNameToIndex;if(t.bold){if(r){n=true}else{i|=f}}if(t.dim){i|=c}if(t.italic){i|=g}if(t.underline){i|=y}if(t.blink){if(r){s=true}else{i|=b}}if(t.inverse){i|=v}if(t.hidden){i|=w}if(t.strike){i|=x}if(typeof t.color==="string"){if(t.color==="default"){t.color=0;t.defaultColor=true}else{t.color=e(t.color)}}if(typeof t.color!=="number"||t.color<0||t.color>255){t.color=0;t.defaultColor=true}else{t.color=Math.floor(t.color);if(r&&t.color<=15){if(n&&t.color<=7){t.color+=8}else if(!n&&t.color>=8){t.color-=8}}}i+=t.color;if(typeof t.bgColor==="string"){if(t.bgColor==="default"){t.bgColor=0;t.bgDefaultColor=true}else{t.bgColor=e(t.bgColor)}}if(typeof t.bgColor!=="number"||t.bgColor<0||t.bgColor>255){t.bgColor=0;t.bgDefaultColor=true}else{t.bgColor=Math.floor(t.bgColor);if(r&&t.bgColor<=15){if(s&&t.bgColor<=7){t.bgColor+=8}else if(!s&&t.bgColor>=8){t.bgColor-=8}}}i+=t.bgColor<<8;if(t.defaultColor){i|=k}if(t.bgDefaultColor){i|=A}if(t.transparency){i|=S}if(t.fgTransparency){i|=a}if(t.bgTransparency){i|=u}if(t.styleTransparency){i|=C}if(t.charTransparency){i|=T}return i};d.prototype.object2attr=function(t,e=this.palette&&this.palette.colorNameToIndex,r=false){return d.object2attr(t,e,r)};d.attrAndObject=function(t,e,r){if(!e||typeof e!=="object"){return t}r=r||p.colorNameToIndex;if(e.defaultColor||e.color==="default"){t-=t&255;t|=k}else if(typeof e.color==="string"){t=t-(t&255)+r(e.color);if(t&k){t^=k}}else if(typeof e.color==="number"&&e.color>=0&&e.color<=255){t=t-(t&255)+e.color;if(t&k){t^=k}}if(e.bgDefaultColor||e.bgColor==="default"){t-=(t>>>8&255)<<8;t|=A}else if(typeof e.bgColor==="string"){t=t-((t>>>8&255)<<8)+(r(e.bgColor)<<8);if(t&A){t^=A}}else if(typeof e.bgColor==="number"&&e.bgColor>=0&&e.bgColor<=255){t=t-((t>>>8&255)<<8)+(e.bgColor<<8);if(t&A){t^=A}}if(e.bold===true){t|=f}else if(e.bold===false){t&=~f}if(e.dim===true){t|=c}else if(e.dim===false){t&=~c}if(e.italic===true){t|=g}else if(e.italic===false){t&=~g}if(e.underline===true){t|=y}else if(e.underline===false){t&=~y}if(e.blink===true){t|=b}else if(e.blink===false){t&=~b}if(e.inverse===true){t|=v}else if(e.inverse===false){t&=~v}if(e.hidden===true){t|=w}else if(e.hidden===false){t&=~w}if(e.strike===true){t|=x}else if(e.strike===false){t&=~x}if(e.transparency===true){t|=S}else if(e.transparency===false){t&=~S}if(e.fgTransparency===true){t|=a}else if(e.fgTransparency===false){t&=~a}if(e.bgTransparency===true){t|=u}else if(e.bgTransparency===false){t&=~u}if(e.styleTransparency===true){t|=C}else if(e.styleTransparency===false){t&=~C}if(e.charTransparency===true){t|=T}else if(e.charTransparency===false){t&=~T}return t};d.prototype.attrAndObject=function(t,e){return d.attrAndObject(t,e,this.palette&&this.palette.colorNameToIndex)};d.attrInverse=d.prototype.attrInverse=t=>t^v;const i=0;const l=255<<16;const f=1<<16;const c=2<<16;const g=4<<16;const y=8<<16;const b=16<<16;const v=32<<16;const w=64<<16;const x=128<<16;const _=f|c;const a=1<<24;const u=2<<24;const C=4<<24;const T=8<<24;const S=a|u|C|T;const k=16<<24;const A=32<<24;const n=255+(255<<8)+(255<<16)+S+k+A;const s=64<<24;const E=128<<24;const B=s|E;const R=~B;const O=1e4;const M=40;d.prototype.ATTR_SIZE=4;d.prototype.CHAR_SIZE=4;d.prototype.ITEM_SIZE=d.prototype.ATTR_SIZE+d.prototype.CHAR_SIZE;d.DEFAULT_ATTR=d.prototype.DEFAULT_ATTR=d.object2attr({defaultColor:true,bgDefaultColor:true});d.prototype.CLEAR_ATTR=d.object2attr({defaultColor:true,bgDefaultColor:true,transparency:true});d.prototype.CLEAR_BUFFER=I.allocUnsafe(d.prototype.ITEM_SIZE);d.prototype.CLEAR_BUFFER.writeInt32BE(d.prototype.CLEAR_ATTR,0);d.prototype.CLEAR_BUFFER.write(" \0\0\0",d.prototype.ATTR_SIZE);d.prototype.LEADING_FULLWIDTH=s;d.prototype.TRAILING_FULLWIDTH=E;d.loadSyncV1=function(t){var e,r,i,n,s;e=o.readFileSync(t);if(e.lengthnew c(...t);c.createFromString=function(t,e){var r,i,n,s,o,a,u,l,f;if(!t){t={}}if(typeof e!=="string"){if(!e.toString){throw new Error("[terminal] ScreenBufferHD.createFromDataString(): argument #1 should be a string or provide a .toString() method.")}e=e.toString()}e=d.stripControlChars(e,true).split("\n");a=0;u=e.length;s=t.attr!==undefined?t.attr:c.prototype.DEFAULT_ATTR;if(s&&typeof s==="object"&&!s.BYTES_PER_ELEMENT){s=c.object2attr(s)}o=s;if(t.transparencyChar){if(!t.transparencyType){o|=c.prototype.TRANSPARENCY}else{o|=t.transparencyType&c.prototype.TRANSPARENCY}}for(i=0;ia){a=l}}f=new c({width:a,height:u});for(i=0;i({color:{r:t.r,g:t.g,b:t.b}}));var r=t.map(t=>({bgColor:{r:t.r,g:t.g,b:t.b}}));c.prototype.markupToAttrObject={normal:{"-":{dim:true},"+":{bold:true},_:{underline:true},"/":{italic:true},"!":{inverse:true},k:t[0],r:t[1],g:t[2],y:t[3],b:t[4],m:t[5],c:t[6],w:t[7],K:t[8],R:t[9],G:t[10],Y:t[11],B:t[12],M:t[13],C:t[14],W:t[15]},background:{k:r[0],r:r[1],g:r[2],y:r[3],b:r[4],m:r[5],c:r[6],w:r[7],K:r[8],R:r[9],G:r[10],Y:r[11],B:r[12],M:r[13],C:r[14],W:r[15]}};c.prototype.blitterCellBlendingIterator=function(t){var e=this.readAttr(t.context.srcBuffer,t.srcStart);var r=c.blendFn.normal;var i=1;var n=false;if(typeof t.context.blending==="object"){if(t.context.blending.fn){r=t.context.blending.fn}if(t.context.blending.opacity!==undefined){i=t.context.blending.opacity}if(t.context.blending.blendSrcFgWithDstBg){n=true}}if(e[w]&M&&e[w]&I&&(!i||e[p]===0&&e[b]===0)){return}if(t.startOfBlitLine&&t.dstStart>=this.ITEM_SIZE){this.removeLeadingFullWidth(t.context.dstBuffer,t.dstStart-this.ITEM_SIZE)}if(t.endOfBlitLine&&t.dstEndt,multiply:(t,e)=>255*(t/255*(e/255)),screen:(t,e)=>255*(1-(1-t/255)*(1-e/255)),overlay:(t,e)=>e<=127?255*(2*(t/255)*(e/255)):255*(1-2*(1-t/255)*(1-e/255)),hardLight:(t,e)=>t<=127?255*(2*(t/255)*(e/255)):255*(1-2*(1-t/255)*(1-e/255)),softLight:(t,e)=>{t/=255;e/=255;return 255*((1-2*t)*e*e+2*t*e)}};function n(t,e){if(t.readUInt32BE(x)!==e.readUInt32BE(x)){return false}if(t.readUInt32BE(_)!==e.readUInt32BE(_)){return false}if(t[v]!==e[v]){return false}if((t[w]&P)!==(e[w]&P)){return false}return true}c.prototype.terminalBlitterLineIterator=function(t){var e,r;if(!t.context.inline){t.context.sequence+=t.context.term.optimized.moveTo(t.dstXmin,t.dstY);t.context.moves++}for(e=t.srcStart;eW){t.context.rawTerm(t.context.sequence);t.context.sequence="";t.context.writes++}};c.prototype.terminalBlitterCellIterator=function(t){var e=this.readAttr(t.context.srcBuffer,t.srcStart);if(t.context.srcLastBuffer){if(n(e,this.readAttr(t.context.srcLastBuffer,t.srcStart))&&this.readChar(t.context.srcBuffer,t.srcStart)===this.readChar(t.context.srcLastBuffer,t.srcStart)){return}t.context.srcBuffer.copy(t.context.srcLastBuffer,t.srcStart,t.srcStart,t.srcEnd)}if(e[w]&L){return}t.context.cells++;if(t.dstX!==t.context.cx||t.dstY!==t.context.cy){t.context.sequence+=t.context.term.optimized.moveTo(t.dstX,t.dstY);t.context.moves++}if(!t.context.lastAttr||!n(e,t.context.lastAttr)){t.context.sequence+=!t.context.lastAttr||!t.context.deltaEscapeSequence?this.generateEscapeSequence(t.context.term,e):this.generateDeltaEscapeSequence(t.context.term,e,t.context.lastAttr);t.context.lastAttr=e;t.context.attrs++}t.context.sequence+=this.readChar(t.context.srcBuffer,t.srcStart);if(t.context.sequence.length>W){t.context.rawTerm(t.context.sequence);t.context.sequence="";t.context.writes++}t.context.cy=t.dstY;if(e&j){t.context.cx=t.dstX+2;return true}t.context.cx=t.dstX+1};c.fromNdarrayImage=function(t){var e,r=t.shape[0],i,n=Math.ceil(t.shape[1]/2),s=t.shape[2]===4;var o=new c({width:r,height:n,blending:true,noFill:true});for(e=0;ethis.CHAR_SIZE){return"\0"}return t.toString("utf8",e,e+r)};c.prototype.writeChar=function(t,e,r){return t.write(e,r+this.ATTR_SIZE,this.CHAR_SIZE)};c.prototype.generateEscapeSequence=function(t,e){var r=t.optimized.styleReset+t.optimized.color24bits(e[u],e[l],e[f])+t.optimized.bgColor24bits(e[g],e[y],e[m]);var i=e[v];if(i&C){r+=t.optimized.bold}if(i&T){r+=t.optimized.dim}if(i&S){r+=t.optimized.italic}if(i&k){r+=t.optimized.underline}if(i&A){r+=t.optimized.blink}if(i&E){r+=t.optimized.inverse}if(i&B){r+=t.optimized.hidden}if(i&R){r+=t.optimized.strike}return r};c.prototype.generateDeltaEscapeSequence=function(t,e,r){var i="";if(e[u]!==r[u]||e[l]!==r[l]||e[f]!==r[f]){i+=t.optimized.color24bits(e[u],e[l],e[f])}if(e[g]!==r[g]||e[y]!==r[y]||e[m]!==r[m]){i+=t.optimized.bgColor24bits(e[g],e[y],e[m])}var n=e[v];var s=r[v];if(n!==s){if((n&O)!==(s&O)){if(s&C&&!(n&C)||s&T&&!(n&T)){i+=t.optimized.noBold;if(n&C){i+=t.optimized.bold}if(n&T){i+=t.optimized.dim}}else{if(n&C&&!(s&C)){i+=t.optimized.bold}if(n&T&&!(s&T)){i+=t.optimized.dim}}}if((n&S)!==(s&S)){i+=n&S?t.optimized.italic:t.optimized.noItalic}if((n&k)!==(s&k)){i+=n&k?t.optimized.underline:t.optimized.noUnderline}if((n&A)!==(s&A)){i+=n&A?t.optimized.blink:t.optimized.noBlink}if((n&E)!==(s&E)){i+=n&E?t.optimized.inverse:t.optimized.noInverse}if((n&B)!==(s&B)){i+=n&B?t.optimized.hidden:t.optimized.noHidden}if((n&R)!==(s&R)){i+=n&R?t.optimized.strike:t.optimized.noStrike}}return i};c.attr2object=function(t){var e={color:{},bgColor:{}};e.color.r=t[u];e.color.g=t[l];e.color.b=t[f];e.color.a=t[p];e.bgColor.r=t[g];e.bgColor.g=t[y];e.bgColor.b=t[m];e.bgColor.a=t[b];e.bold=!!(t[v]&C);e.dim=!!(t[v]&T);e.italic=!!(t[v]&S);e.underline=!!(t[v]&k);e.blink=!!(t[v]&A);e.inverse=!!(t[v]&E);e.hidden=!!(t[v]&B);e.strike=!!(t[v]&R);e.styleTransparency=!!(t[w]&M);e.charTransparency=!!(t[w]&I);return e};c.prototype.attr2object=c.attr2object;c.object2attr=function(e){var r=H.allocUnsafe(c.prototype.ATTR_SIZE);if(!e||typeof e!=="object"){e={}}r[w]=0;if(typeof e.color==="string"){let t=i.hexToRgba(e.color);r[u]=t.r;r[l]=t.g;r[f]=t.b;r[p]=t.a}else if(e.color&&typeof e.color==="object"){r[u]=+e.color.r||0;r[l]=+e.color.g||0;r[f]=+e.color.b||0;r[p]=e.color.a!==undefined?+e.color.a||0:255}else{r[u]=0;r[l]=0;r[f]=0;r[p]=255}if(typeof e.bgColor==="string"){let t=i.hexToRgba(e.bgColor);r[g]=t.r;r[y]=t.g;r[m]=t.b;r[b]=t.a}else if(e.bgColor&&typeof e.bgColor==="object"){r[g]=+e.bgColor.r||0;r[y]=+e.bgColor.g||0;r[m]=+e.bgColor.b||0;r[b]=e.bgColor.a!==undefined?+e.bgColor.a||0:255}else{r[g]=0;r[y]=0;r[m]=0;r[b]=255}if(e.styleTransparency){r[w]|=M}if(e.charTransparency){r[w]|=I}r[v]=0;if(e.bold){r[v]|=C}if(e.dim){r[v]|=T}if(e.italic){r[v]|=S}if(e.underline){r[v]|=k}if(e.blink){r[v]|=A}if(e.inverse){r[v]|=E}if(e.hidden){r[v]|=B}if(e.strike){r[v]|=R}return r};c.prototype.object2attr=c.object2attr;c.attrAndObject=function(t,e){if(!e||typeof e!=="object"){return t}if(e.color&&typeof e.color==="object"){if(e.color.r!==undefined){t[u]=+e.color.r||0}if(e.color.g!==undefined){t[l]=+e.color.g||0}if(e.color.b!==undefined){t[f]=+e.color.b||0}if(e.color.a!==undefined){t[p]=+e.color.a||0}}if(e.bgColor&&typeof e.bgColor==="object"){if(e.bgColor.r!==undefined){t[g]=+e.bgColor.r||0}if(e.bgColor.g!==undefined){t[y]=+e.bgColor.g||0}if(e.bgColor.b!==undefined){t[m]=+e.bgColor.b||0}if(e.bgColor.a!==undefined){t[b]=+e.bgColor.a||0}}if(e.styleTransparency===true){t[w]|=M}else if(e.styleTransparency===false){t[w]&=~M}if(e.charTransparency===true){t[w]|=I}else if(e.charTransparency===false){t[w]&=~I}if(e.bold===true){t[v]|=C}else if(e.bold===false){t[v]&=~C}if(e.dim===true){t[v]|=T}else if(e.dim===false){t[v]&=~T}if(e.italic===true){t[v]|=S}else if(e.italic===false){t[v]&=~S}if(e.underline===true){t[v]|=k}else if(e.underline===false){t[v]&=~k}if(e.blink===true){t[v]|=A}else if(e.blink===false){t[v]&=~A}if(e.inverse===true){t[v]|=E}else if(e.inverse===false){t[v]&=~E}if(e.hidden===true){t[v]|=B}else if(e.hidden===false){t[v]&=~B}if(e.strike===true){t[v]|=R}else if(e.strike===false){t[v]&=~R}return t};c.prototype.attrAndObject=c.attrAndObject;c.attrInverse=c.prototype.attrInverse=t=>{t[v]^=E;return t};const a=0;const u=0;const l=1;const f=2;const p=3;const g=4;const y=5;const m=6;const b=7;const v=8;const w=9;const x=0;const _=4;const C=1;const T=2;const S=4;const k=8;const A=16;const E=32;const B=64;const R=128;const O=C|T;const M=4;const I=8;const P=M|I;const j=64;const L=128;const D=j|L;const F=255^D;const W=1e4;c.prototype.ATTR_SIZE=10;c.prototype.CHAR_SIZE=4;c.prototype.ITEM_SIZE=c.prototype.ATTR_SIZE+c.prototype.CHAR_SIZE;c.DEFAULT_ATTR=c.prototype.DEFAULT_ATTR=c.object2attr({color:{r:255,g:255,b:255,a:255},bgColor:{r:0,g:0,b:0,a:255}});c.prototype.CLEAR_ATTR=c.object2attr({color:{r:255,g:255,b:255,a:0},bgColor:{r:0,g:0,b:0,a:0},charTransparency:true,styleTransparency:true});c.prototype.CLEAR_BUFFER=H.allocUnsafe(c.prototype.ITEM_SIZE);c.prototype.CLEAR_ATTR.copy(c.prototype.CLEAR_BUFFER);c.prototype.CLEAR_BUFFER.write(" \0\0\0",c.prototype.ATTR_SIZE);c.prototype.LEADING_FULLWIDTH=j;c.prototype.TRAILING_FULLWIDTH=L;c.loadSyncV2=function(t){var e,r,i,n;r=s.readFileSync(t);if(r.length<3||r.toString("ascii",0,3)!=="SB\n"){throw new Error("Magic number mismatch: this is not a ScreenBufferHD file")}for(e=3;e{var e,r,i,n,s=o.keymap[t];if(!Array.isArray(s)){s=[s];o.keymap[t]=s}for(r=0;ro.rKeymapMaxSize){for(e=o.rKeymapMaxSize+1;e<=n.length;e++){o.rKeymap[e]={}}o.rKeymapMaxSize=n.length}if(o.rKeymap[n.length][n]){o.rKeymap[n.length][n].matches.push(t)}else{o.rKeymap[n.length][n]=i;o.rKeymap[n.length][n].matches=[t]}}else{if(!i.starter||!i.ender||!i.handler){continue}if(i.starter.length>o.rKeymapStarterMaxSize){for(e=o.rKeymapStarterMaxSize+1;e<=i.starter.length;e++){o.rKeymapStarter[e]={}}o.rKeymapStarterMaxSize=i.starter.length}if(o.rKeymapStarter[i.starter.length][i.starter]){o.rKeymapStarter[i.starter.length][i.starter].push(t)}else{o.rKeymapStarter[i.starter.length][i.starter]=[i]}}}});Object.keys(o.esc).forEach(r=>{if(!o.esc[r]||typeof o.esc[r]!=="object"){console.error("Bad escape sequence entry '"+r+"' using termconfig: '"+o.termconfigFile+"'.");return}if(typeof o.esc[r].on==="function"){o.esc[r].on=o.esc[r].on.call(o)}if(typeof o.esc[r].off==="function"){o.esc[r].off=o.esc[r].off.call(o)}if(o.esc[r].handler){if(typeof o.esc[r].handler==="function"){o.escHandler[r]=o.esc[r].handler.bind(o)}else{o.escHandler[r]=o.handler[o.esc[r].handler]}}if(o.esc[r].offHandler){if(typeof o.esc[r].offHandler==="function"){o.escOffHandler[r]=o.esc[r].offHandler.bind(o)}else{o.escOffHandler[r]=o.handler[o.esc[r].offHandler]}}Object.defineProperty(i,r,{configurable:true,get:function(){var t,e;e=Object.assign({},this.options);e.on+=this.root.esc[r].on||"";e.off=(this.root.esc[r].off||"")+e.off;e.params+=v.format.count(this.root.esc[r].on);if(!e.onHasFormatting&&(e.params||typeof this.root.esc[r].on==="string"&&v.format.hasFormatting(this.root.esc[r].on))){e.onHasFormatting=true}if(!e.offHasFormatting&&(typeof this.root.esc[r].off==="string"&&v.format.hasFormatting(this.root.esc[r].off))){e.offHasFormatting=true}if(this.root.esc[r].err){e.err=true;e.out=this.root.stderr}if(this.root.esc[r].str){e.str=true}if(this.root.esc[r].bind){e.bind=true}if(this.root.esc[r].forceStyleOnReset){e.forceStyleOnReset=true}if(this.root.esc[r].noFormat){e.noFormat=true}if(this.root.esc[r].markupOnly){e.markupOnly=true}if(this.root.esc[r].wrap){e.wrap=true}t=f.bind(undefined,e);Object.setPrototypeOf(t,i);t.apply=Function.prototype.apply;t.root=this.root||this;t.options=e;Object.defineProperty(this,r,{value:t,configurable:true});return t}})});o.resetString="";o.setResetString=function(t){o.resetString=v.markupMethod.call(o.formatConfig.rawMarkupConfig,t)};var s=t=>o.str.styleReset()+o.resetString+t;o.formatConfig={fn:{},endingMarkupReset:true,markupReset:s.bind(undefined,""),shiftMarkup:{"#":"background"},markup:{":":s.bind(undefined,"")," ":s.bind(undefined," "),"-":o.str.dim(),"+":o.str.bold(),_:o.str.underline(),"/":o.str.italic(),"!":o.str.inverse(),b:o.str.blue(),B:o.str.brightBlue(),c:o.str.cyan(),C:o.str.brightCyan(),g:o.str.green(),G:o.str.brightGreen(),k:o.str.black(),K:o.str.brightBlack(),m:o.str.magenta(),M:o.str.brightMagenta(),r:o.str.red(),R:o.str.brightRed(),w:o.str.white(),W:o.str.brightWhite(),y:o.str.yellow(),Y:o.str.brightYellow()},shiftedMarkup:{background:{":":s.bind(undefined,"")," ":s.bind(undefined," "),b:o.str.bgBlue(),B:o.str.bgBrightBlue(),c:o.str.bgCyan(),C:o.str.bgBrightCyan(),g:o.str.bgGreen(),G:o.str.bgBrightGreen(),k:o.str.bgBlack(),K:o.str.bgBrightBlack(),m:o.str.bgMagenta(),M:o.str.bgBrightMagenta(),r:o.str.bgRed(),R:o.str.bgBrightRed(),w:o.str.bgWhite(),W:o.str.bgBrightWhite(),y:o.str.bgYellow(),Y:o.str.bgBrightYellow()}},dataMarkup:{fg:(t,e,n)=>{var s;if(typeof n==="string"&&n[0]==="#"){let t=n.slice(1);if(t.length===3){t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]}let e=parseInt(t.slice(0,2),16)||0;let r=parseInt(t.slice(2,4),16)||0;let i=parseInt(t.slice(4,6),16)||0;s=o.optimized.color24bits(e,r,i)}else{s=o.str.color(n)}t.push(s);return s},bg:(t,e,n)=>{var s;if(typeof n==="string"&&n[0]==="#"){let t=n.slice(1);if(t.length===3){t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]}let e=parseInt(t.slice(0,2),16)||0;let r=parseInt(t.slice(2,4),16)||0;let i=parseInt(t.slice(4,6),16)||0;s=o.optimized.bgColor24bits(e,r,i)}else{s=o.str.bgColor(n)}t.push(s);return s}},markupCatchAll:(t,e,r)=>{o.optimized.bgColor24bits;var i="";if(r===undefined){if(e[0]==="#"){return o.formatConfig.dataMarkup.fg(t,"fg",e)}else if(p.markupCatchAllKeywords[e]){switch(p.markupCatchAllKeywords[e][0]){case"color":return o.formatConfig.dataMarkup.fg(t,"fg",p.markupCatchAllKeywords[e][1]);case"bgColor":return o.formatConfig.dataMarkup.bg(t,"bg",p.markupCatchAllKeywords[e][1]);case"dim":i=o.str.dim();break;case"bold":i=o.str.bold();break;case"underline":i=o.str.underline();break;case"italic":i=o.str.italic();break;case"inverse":i=o.str.inverse();break}}}t.push(i);return i}};o.formatConfig.dataMarkup.color=o.formatConfig.dataMarkup.fgColor=o.formatConfig.dataMarkup.c=o.formatConfig.dataMarkup.fg;o.formatConfig.dataMarkup.bgColor=o.formatConfig.dataMarkup.bg;o.formatConfig.rawMarkupConfig=Object.create(o.formatConfig);o.formatConfig.rawMarkupConfig.startingMarkupReset=false;o.formatConfig.rawMarkupConfig.endingMarkupReset=false;for(e in o.escHandler){o.formatConfig.fn[e]=o.escHandler[e]}for(e in o.escOffHandler){o.formatConfig.fn[e+"_off"]=o.escOffHandler[e]}o.format=v.createFormatter(o.formatConfig);o.markup=v.createMarkup(o.formatConfig);o.options=n;u(o);m.on("exit",()=>{if(o.shutdown){return}o.shutdown=true;o.styleReset();o.grabInput(false)});m.on("asyncExit",(t,e,r)=>{o.asyncCleanup().then(r)});m.once("beforeExit",()=>{o.asyncCleanup()});o.palette=new p.Palette({system:true,term:o});return o};function u(t){var e;t.optimized={};t.optimized.styleReset=t.str.styleReset();t.optimized.bold=t.str.bold();t.optimized.dim=t.str.dim();t.optimized.italic=t.str.italic();t.optimized.underline=t.str.underline();t.optimized.blink=t.str.blink();t.optimized.inverse=t.str.inverse();t.optimized.hidden=t.str.hidden();t.optimized.strike=t.str.strike();t.optimized.noBold=t.str.bold(false);t.optimized.noDim=t.str.dim(false);t.optimized.noItalic=t.str.italic(false);t.optimized.noUnderline=t.str.underline(false);t.optimized.noBlink=t.str.blink(false);t.optimized.noInverse=t.str.inverse(false);t.optimized.noHidden=t.str.hidden(false);t.optimized.noStrike=t.str.strike(false);t.optimized.color256=[];t.optimized.bgColor256=[];for(e=0;e<=255;e++){t.optimized.color256[e]=t.str.color256(e);t.optimized.bgColor256[e]=t.str.bgColor256(e)}t.optimized.defaultColor=t.str.defaultColor();t.optimized.bgDefaultColor=t.str.bgDefaultColor();t.optimized.moveTo=t.esc.moveTo.optimized||t.str.moveTo;t.optimized.right=t.str.right(1);t.optimized.color24bits=t.esc.color24bits.optimized||t.str.color24bits;t.optimized.bgColor24bits=t.esc.bgColor24bits.optimized||t.str.bgColor24bits}function f(t,...e){var r,i,n;if(t.bounded){e=t.bounded.concat(e)}if(t.bind){i=Object.assign({},t,{bind:false,bounded:e});r=f.bind(this,i);Object.setPrototypeOf(r,Object.getPrototypeOf(t.root));r.apply=Function.prototype.apply;r.root=t.root;r.options=i;return r}var s=[t.on],o,a,u;var l=e[t.params];if(t.params){s=s.concat(e.slice(0,t.params))}if(l===undefined||l===true){a=t.onHasFormatting?t.root.format(...s):t.on;if(t.str){return a}t.out.write(a);return t.root}if(l===null||l===false){u=t.offHasFormatting?t.root.format(t.off):t.off;if(t.str){return u}t.out.write(u);return t.root}if(typeof l!=="string"){if(typeof l.toString==="function"){l=l.toString()}else{l=""}}a=t.onHasFormatting?t.root.format(...s):t.on;if(t.markupOnly){l=t.root.markup(...e.slice(t.params))}else if(!t.noFormat){l=t.root.format(...e.slice(t.params))}if(t.wrap){if(t.root.wrapOptions.x&&t.root.wrapOptions.x>1){n={width:t.root.wrapOptions.width||t.root.width-t.root.wrapOptions.x+1,glue:"\n"+t.root.str.column(t.root.wrapOptions.x),offset:t.root.wrapOptions.offset,updateOffset:true,skipFn:p.escapeSequenceSkipFn};l=v.wordwrap(l,n);if(!t.root.wrapOptions.continue){l=t.root.str.column(t.root.wrapOptions.x)+l}t.root.wrapOptions.continue=true;t.root.wrapOptions.offset=n.offset}else{n={width:t.root.wrapOptions.width||t.root.width,glue:"\n",offset:t.root.wrapOptions.offset,updateOffset:true,skipFn:p.escapeSequenceSkipFn};l=v.wordwrap(l,n);t.root.wrapOptions.continue=true;t.root.wrapOptions.offset=n.offset}}else{t.root.wrapOptions.continue=false;t.root.wrapOptions.offset=0}u=t.offHasFormatting?t.root.format(t.off):t.off;if(t.forceStyleOnReset){l=l.replace(new RegExp(v.escape.regExp(t.root.optimized.styleReset),"g"),t.root.optimized.styleReset+a)}if(t.root.resetString){o=t.root.resetString+a+l+u+t.root.resetString}else{o=a+l+u}if(t.crlf){o=o.replace(/\n/g,"\r\n")}if(t.str){return o}t.out.write(o);return t.root}var h={error:{err:true},str:{str:true},attr:{attr:true},bindArgs:{bind:true},forceStyleOnReset:{forceStyleOnReset:true},noFormat:{noFormat:true},markupOnly:{markupOnly:true},wrap:{wrap:true},move:{on:"%[move:%a%a]F",handler:function t(e,r){var i="";if(e){if(e>0){i+=this.root.format(this.root.esc.right.on,e)}else{i+=this.root.format(this.root.esc.left.on,-e)}}if(r){if(r>0){i+=this.root.format(this.root.esc.down.on,r)}else{i+=this.root.format(this.root.esc.up.on,-r)}}return i}},color:{on:"%[color:%a]F",off:function(){return this.root.esc.defaultColor.on},handler:function t(e){if(typeof e==="string"){e=p.colorNameToIndex(e)}if(typeof e!=="number"){return""}e=Math.floor(e);if(e<0||e>15){return""}if(e<=7){return this.root.format(this.root.esc.darkColor.on,e)}return this.root.format(this.root.esc.brightColor.on,e-8)}},bgColor:{on:"%[bgColor:%a]F",off:function(){return this.root.esc.bgDefaultColor.on},handler:function t(e){if(typeof e==="string"){e=p.colorNameToIndex(e)}if(typeof e!=="number"){return""}e=Math.floor(e);if(e<0||e>15){return""}if(e<=7){return this.root.format(this.root.esc.bgDarkColor.on,e)}return this.root.format(this.root.esc.bgBrightColor.on,e-8)}},colorRgb:{on:"%[colorRgb:%a%a%a]F",off:function(){return this.root.esc.defaultColor.on},handler:r},bgColorRgb:{on:"%[bgColorRgb:%a%a%a]F",off:function(){return this.root.esc.bgDefaultColor.on},handler:i},colorRgbHex:{on:"%[colorRgbHex:%a]F",off:function(){return this.root.esc.defaultColor.on},handler:r},bgColorRgbHex:{on:"%[bgColorRgbHex:%a]F",off:function(){return this.root.esc.bgDefaultColor.on},handler:i},colorGrayscale:{on:"%[colorGrayscale:%a]F",off:function(){return this.root.esc.defaultColor.on},handler:function t(e){var r;if(typeof e!=="number"){return""}if(e<0||e>255){return""}if(!this.root.esc.color24bits.na&&!this.root.esc.color24bits.fb){return this.root.format(this.root.esc.color24bits.on,e,e,e)}if(!this.root.esc.color256.na&&!this.root.esc.color256.fb){e=Math.round(e*25/255);if(e<0||e>25){return""}if(e===0){r=16}else if(e===25){r=231}else{r=e+231}return this.root.format(this.root.esc.color256.on,r)}r=this.root.registerForRgb(e,e,e,0,15);return this.root.format(this.root.esc.color.on,r)}},bgColorGrayscale:{on:"%[bgColorGrayscale:%a]F",off:function(){return this.root.esc.bgDefaultColor.on},handler:function t(e){var r;if(typeof e!=="number"){return""}if(e<0||e>255){return""}if(!this.root.esc.bgColor24bits.na&&!this.root.esc.bgColor24bits.fb){return this.root.format(this.root.esc.bgColor24bits.on,e,e,e)}if(!this.root.esc.bgColor256.na&&!this.root.esc.bgColor256.fb){e=Math.round(e*25/255);if(e<0||e>25){return""}if(e===0){r=16}else if(e===25){r=231}else{r=e+231}return this.root.format(this.root.esc.bgColor256.on,r)}r=this.root.registerForRgb(e,e,e,0,15);return this.root.format(this.root.esc.bgColor.on,r)}}};function r(t,e,r){var i,n;if(typeof t==="string"){n=p.hexToRgba(t);t=n.r;e=n.g;r=n.b}if(typeof t!=="number"||isNaN(t)||typeof e!=="number"||isNaN(e)||typeof r!=="number"||isNaN(r)||t<0||t>255||e<0||e>255||r<0||r>255){return""}if(!this.root.esc.color24bits.na&&!this.root.esc.color24bits.fb){return this.root.format(this.root.esc.color24bits.on,t,e,r)}if(!this.root.esc.color256.na&&!this.root.esc.color256.fb){t=Math.round(t*5/255);e=Math.round(e*5/255);r=Math.round(r*5/255);i=16+t*36+e*6+r;return this.root.format(this.root.esc.color256.on,i)}i=this.root.registerForRgb(t,e,r,0,15);return this.root.format(this.root.esc.color.on,i)}function i(t,e,r){var i,n;if(typeof t==="string"){n=p.hexToRgba(t);t=n.r;e=n.g;r=n.b}if(typeof t!=="number"||isNaN(t)||typeof e!=="number"||isNaN(e)||typeof r!=="number"||isNaN(r)||t<0||t>255||e<0||e>255||r<0||r>255){return""}if(!this.root.esc.bgColor24bits.na&&!this.root.esc.bgColor24bits.fb){return this.root.format(this.root.esc.bgColor24bits.on,t,e,r)}if(!this.root.esc.bgColor256.na&&!this.root.esc.bgColor256.fb){t=Math.round(t*5/255);e=Math.round(e*5/255);r=Math.round(r*5/255);i=16+t*36+e*6+r;return this.root.format(this.root.esc.bgColor256.on,i)}i=this.root.registerForRgb(t,e,r,0,15);return this.root.format(this.root.esc.bgColor.on,i)}function c(){if(this.stdout.columns&&this.stdout.rows){this.width=this.stdout.columns;this.height=this.stdout.rows}this.emit("resize",this.width,this.height)}var d=Object.create(e.prototype);d.yesOrNo=b("./yesOrNo.js");d.inputField=b("./inputField.js");d.fileInput=b("./fileInput.js");d.singleRowMenu=d.singleLineMenu=b("./singleLineMenu.js");d.singleColumnMenu=b("./singleColumnMenu.js");d.gridMenu=b("./gridMenu.js");d.progressBar=b("./progressBar.js");d.bar=b("./bar.js");d.slowTyping=b("./slowTyping.js");d.createDocument=function(t){if(!t||typeof t!=="object"){t={}}t.outputDst=this;t.eventSource=this;return new p.Document(t)};d.createInlineElement=function(t,e){return p.Element.createInline(this,t,e)};d.table=function(t,e={}){return p.Element.createInline(this,p.TextTable,Object.assign({},e,{cellContents:t,fit:e.fit!==undefined?!!e.fit:true}))};d.spinner=function(t={}){if(typeof t==="string"){t={animation:t}}return p.Element.createInline(this,p.AnimatedText,t)};d.wrapColumn=function(...t){this.wrapOptions.continue=false;this.wrapOptions.offset=0;if(!t.length){return}if(t[0]&&typeof t[0]==="object"){Object.assign(this.wrapOptions,t[0]);return this.wrap}if(t.length===1){this.wrapOptions.x=1;this.wrapOptions.width=t[0];return this.wrap}this.wrapOptions.x=t[0];this.wrapOptions.width=t[1];return this.wrap};d.fullscreen=function(t){if(t===false){if(!this.state.fullscreen){return this}this.state.fullscreen=false;this.moveTo(1,this.height,"\n");this.alternateScreenBuffer(false);return this}if(!t){t={}}this.state.fullscreen=true;if(!t.noAlternate){this.alternateScreenBuffer(true)}this.clear()};function g(t){var e,r,i,n,s,o,a,u,l,f,h,c,d,p,g,y=false,m=0,b=t.length;if(this.shutdown){return}if(this.prependStdinChunk){t=w.concat([this.prependStdinChunk,t])}while(m0;e--){i=t.slice(m);a=i.toString();n=t.slice(m,m+e);u=n.toString();if(this.rKeymap[e]&&this.rKeymap[e][u]){l=this.rKeymap[e][u];p=true;if(l.handler){g=l.handler.call(this,l.name,t.slice(m+e));d=e+g.eaten;if(!g.disable){this.emit(l.event,g.name,g.data)}}else if(l.event){d=e;this.emit(l.event,l.name,l.data,{code:n})}else{d=e;this.emitKey(l.name,l.matches,{isCharacter:false,code:n})}break}else if(this.rKeymapStarter[e]&&this.rKeymapStarter[e][u]){f=this.rKeymapStarter[e][u];for(r=0;r=128){if(t[m]<192){continue}else if(t[m]<224){d=2}else if(t[m]<240){d=3}else if(t[m]<248){d=4}else if(t[m]<252){d=5}else{d=6}i=t.slice(m,m+d);s=i.toString("utf8");if(d>2){o=v.unicode.firstCodePoint(s)}else{o=s.charCodeAt(0)}this.emitKey(s,[s],{isCharacter:true,codepoint:o,code:i})}else{s=String.fromCharCode(t[m]);this.emitKey(s,[s],{isCharacter:true,codepoint:t[m],code:t[m]})}m+=d}if(y){this.prependStdinChunk=t}else{this.prependStdinChunk=null}}d.emitKey=function(r,i,t){if(this.metaKeyPrefix){t.meta=this.metaKeyPrefix;t.isCharacter=false;if(this.metaKeyRemove){let e=new RegExp("(^|_)"+this.metaKeyRemove+"_");if(i.length>1){let t=i.findIndex(t=>t.match(e));e.lastIndex=0;if(t>=0){r=i[t]}}r=r.replace(e,"$1")}r=this.metaKeyPrefix+"_"+p.characterName(r);this.metaKeyPrefix=null;this.metaKeyRemove=null}this.emit("key",r,i,t)};d.setMetaKeyPrefix=function(t,e){this.metaKeyPrefix=t&&typeof t==="string"?t:null;this.metaKeyRemove=e&&typeof e==="string"?e:null};d.grabInput=function(t,e){this.mouseButton(false);this.mouseDrag(false);this.mouseMotion(false);this.focusEvent(false);this.stdin.removeListener("data",this.onStdin);this.grabbing=false;this.mouseGrabbing=false;this.focusGrabbing=false;var r=()=>{this.stdin.pause();try{this.stdin.setRawMode(false)}catch(t){}};if(t===false){if(e){return l.resolveSafeTimeout(this.timeout/2).then(r)}r();return l.resolved}if(this.shutdown){return l.resolved}this.grabbing=true;if(!t){t={}}try{this.stdin.setRawMode(true)}catch(t){}this.stdin.on("data",this.onStdin);this.stdin.resume();if(t.mouse){this.mouseGrabbing=true;switch(t.mouse){case"button":this.mouseButton.mouseSGR();break;case"drag":this.mouseDrag.mouseSGR();break;case"motion":this.mouseMotion.mouseSGR();break}}if(t.focus){this.focusEvent();this.focusGrabbing=true}return l.resolved};d.processExit=function(t){this("\n");this.asyncCleanup().then(()=>m.exit(t))};d.asyncCleanup=async function(){if(this.shutdown){return}this.shutdown=true;this.styleReset();var t=this.grabbing;await this.waitStreamDone(this.stdout);if(!this.isTTY||!t){return}await l.resolveSafeTimeout(this.timeout/4);return this.grabInput(false,true)};d.waitStreamDone=function(t){if(!t._writableState.needDrain){return l.resolved}return l.onceEvent(t,"drain")};d.object2attr=function(t){var e=this.esc.styleReset.on;if(!t||typeof t!=="object"){t={}}if(typeof t.color==="string"){t.color=p.colorNameToIndex(t.color)}if(typeof t.color!=="number"||t.color<0||t.color>255){t.color=7}else{t.color=Math.floor(t.color)}e+=this.str.color(t.color);if(typeof t.bgColor==="string"){t.bgColor=p.colorNameToIndex(t.bgColor)}if(typeof t.bgColor!=="number"||t.bgColor<0||t.bgColor>255){t.bgColor=0}else{t.bgColor=Math.floor(t.bgColor)}e+=this.str.bgColor(t.bgColor);if(t.bold){e+=this.esc.bold.on}if(t.dim){e+=this.esc.dim.on}if(t.italic){e+=this.esc.italic.on}if(t.underline){e+=this.esc.underline.on}if(t.blink){e+=this.esc.blink.on}if(t.inverse){e+=this.esc.inverse.on}if(t.hidden){e+=this.esc.hidden.on}if(t.strike){e+=this.esc.strike.on}return e};d.eraseArea=function(t,e,r=1,i=1){t=Math.min(t,this.width);e=Math.min(e,this.height);var n,s=Math.min(t+r,this.width+1),o=Math.min(e+i,this.height+1),a=" ".repeat(s-t);for(n=e;n{this.getCursorLocation().then(t=>{if(i){i(undefined,t.x,t.y)}else{o.resolve(t)}},t=>{if(i){i(t)}else{o.reject(t)}})});return o}this.lock.getCursorLocation=true;var r=(t,e,r)=>{if(s){return}s=true;this.removeListener("terminal",a);if(!n){this.grabInput(false)}if(t){if(this.shutdown){t.code="shutdown"}if(i){i(t)}else{o.reject(t)}return}if(i){i(undefined,e,r)}else{o.resolve({x:e,y:r})}};var a=(t,e)=>{if(t!=="CURSOR_LOCATION"){return}this.lock.getCursorLocation=false;this.emit("unlock_getCursorLocation");r(undefined,e.x,e.y)};if(!n){this.grabInput()}this.on("terminal",a);this.requestCursorLocation();l.resolveSafeTimeout(this.timeout).then(()=>{if(s){return}var t=new Error(".getCursorLocation() timed out");t.code="timeout";r(t)});return o};d.getColor=function(r,i){var n=this.grabbing,s=false,t;if(this.shutdown){return l.resolved}if(this.esc.requestColor.na){t=new Error("Terminal is not capable");if(i){i(t);return l.resolved}return l.reject(t)}var o=new l;var a=(t,e)=>{if(s){return}s=true;this.removeListener("terminal",u);if(!n){this.grabInput(false)}if(t){if(this.shutdown){t.code="shutdown"}if(i){i(t)}else{o.reject(t)}return}if(i){i(undefined,e)}else{o.resolve(e)}};var u=(t,e)=>{if(t!=="COLOR_REGISTER"){return}if(e.register!==r){return}if(r<16){this.colorRegister[r]={r:e.r,g:e.g,b:e.b}}a(undefined,e)};if(!n){this.grabInput()}this.requestColor(r);this.on("terminal",u);l.resolveSafeTimeout(this.timeout).then(()=>{if(s){return}var t=new Error(".getColor() timed out");t.code="timeout";a(t)});return o};d.getPalette=function(e){var t,r=this.grabbing;if(this.shutdown){return l.resolved}if(!r){this.grabInput()}if(this.esc.requestColor.na){t=this.colorRegister.slice(0,16);if(e){e(undefined,t);return l.resolved}return l.resolve(t)}return l.concurrent(4,[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15],t=>this.getColor(t)).then(t=>{if(!r){this.grabInput(false)}if(e){e(undefined,t)}else{return t}},t=>{if(!r){this.grabInput(false)}if(e){e(t)}else{throw t}})};d.setColor=function(t,e,r,i,n){if(e&&typeof e==="object"){i=e.b;r=e.g;e=e.r;n=r}if(typeof t!=="number"||t<0||t>15){throw new Error("Bad register value")}if(!Array.isArray(n)){n=[]}if(typeof e!=="number"||e<0||e>255||typeof r!=="number"||r<0||r>255||typeof i!=="number"||i<0||i>255){throw new Error("Bad RGB value")}if(this.setColorLL.na){return}this.colorRegister[t]={r:e,g:r,b:i,names:n};this.setColorLL(t,e,r,i)};d.setPalette=function(e){var t;if(typeof e==="string"){try{e=b("./colorScheme/"+e+".json")}catch(t){throw new Error("[terminal] .setPalette(): color scheme not found: "+e)}}if(!Array.isArray(e)){throw new Error("[terminal] .setPalette(): argument #0 should be an Array of RGB Object or a built-in color scheme")}if(this.setColorLL.na){return}for(t=0;t<=15;t++){if(!e[t]||typeof e[t]!=="object"){continue}this.setColor(t,e[t])}};d.getClipboard=function(t="c"){var r=this.grabbing,i=false,e;if(this.shutdown){return l.resolved}if(this.esc.requestClipboard.na){e=b("./extClipboard.js");return e.getClipboard(t).catch(()=>"")}var n=new l;var s=(t,e)=>{if(i){return}i=true;this.removeListener("terminal",o);if(!r){this.grabInput(false)}if(t){if(this.shutdown){t.code="shutdown"}n.reject(t);return}n.resolve(e)};var o=(t,e)=>{if(t!=="CLIPBOARD"){return}s(undefined,e.content)};if(!r){this.grabInput()}this.requestClipboard(t[0]);this.on("terminal",o);l.resolveSafeTimeout(this.timeout).then(()=>{if(i){return}var t=new Error(".getClipboard() timed out");t.code="timeout";s(t)});return n};d.setClipboard=async function(t,e="c"){var r;if(this.esc.setClipboardLL.na){r=b("./extClipboard.js");return r.setClipboard(t,e).catch(()=>undefined)}var i=w.from(t).toString("base64");this.setClipboardLL(e[0],i);return l.resolved};d.getTerminfo=function(r){var i=this.grabbing,n=false;if(this.shutdown){return l.resolved}if(this.esc.xtgettcapLL.na){return l.reject(new Error("Terminal is not capable"))}var s=new l;if(this.lock.getTerminfo){this.once("unlock_getTerminfo",()=>this.getTerminfo(r).propagate(s));return s}this.lock.getTerminfo=true;var o=(t,e)=>{if(n){return}n=true;this.removeListener("terminal",a);if(!i){this.grabInput(false)}if(t){if(this.shutdown){t.code="shutdown"}s.reject(t);return}if(!e.valid||e.key!==r){s.resolve();return}s.resolve(e.value)};var a=(t,e)=>{if(t!=="TERMINFO"){return}this.lock.getTerminfo=false;this.emit("unlock_getTerminfo");o(undefined,e)};if(!i){this.grabInput()}this.on("terminal",a);this.xtgettcapLL(w.from(r).toString("hex"));l.resolveSafeTimeout(this.timeout).then(()=>{if(n){return}var t=new Error(".getTerminfo() timed out");t.code="timeout";o(t)});return s};var y=b("./colorScheme/default.json");(function t(){var e,r,i,n;for(e=16;e<232;e++){r=e-16;i=255/5;y[e]={r:Math.round(Math.floor(r/36)%6*i),g:Math.round(Math.floor(r/6)%6*i),b:Math.round(r%6*i),names:[]}}for(e=232;e<=255;e++){r=e-231;i=255/25;n=Math.round(r*i);y[e]={r:n,g:n,b:n,names:[]}}})();d.rgbForRegister=function(t){if(t<0||t>255){throw new Error("Bad register value")}return{r:this.colorRegister[t].r,g:this.colorRegister[t].g,b:this.colorRegister[t].b}};d.registerForRgb=function(t,e,r,i,n){if(t&&typeof t==="object"){n=r;i=e;r=t.b;e=t.g;t=t.r}if(typeof t!=="number"||t<0||t>255||typeof e!=="number"||e<0||e>255||typeof r!=="number"||r<0||r>255){throw new Error("Bad RGB value")}if(typeof n!=="number"||n<0||n>255){n=15}if(typeof i!=="number"||i<0||i>255){i=0}if(i>n){var s;s=n;n=i;i=s}return this._registerForRgb(t,e,r,i,n)};d._registerForRgb=function(t,e,r,i,n){var s,o,a=Infinity,u=[t,e,r];for(s=i;s<=n;s++){o=p.chroma.distance(u,this.colorRegister[s],"hcl");if(othis.width){n=this.width}else{n=Math.floor(n)}if(typeof s!=="number"||s<1){s=1}else if(s>this.height){s=this.height}else{s=Math.floor(s)}o=1;a=0;switch(t.direction){case"left":o=-1;break;case"up":o=0;a=-1;break;case"down":o=0;a=1;break;case null:case"none":o=0;a=0;break}if(typeof t.dx==="number"){o=t.dx}if(typeof t.dy==="number"){a=t.dy}d=o===1&&a===0;u=t.attr||this.esc.styleReset.on;if(u&&typeof u==="object"){u=this.object2attr(u)}if(typeof u!=="string"){u=this.esc.styleReset.on}if(typeof e!=="string"){if(e.toString){e=e.toString()}else{return}}if(r.length){e=v.format(e,...r)}e=p.stripControlChars(e);f=v.unicode.toArray(e);h=f.length;c=true;this.stdout.write(u);for(i=0;i=this.width){if(!l){break}n=0;s++;c=true}if(s<0){break}else if(s>=this.height){break}}};d.drawNdarrayImage=function(t){var e,r=Math.min(t.shape[0],this.width),i,n=Math.ceil(t.shape[1]/2),s=t.shape[2]===4,o=this.support["256colors"]?255:15,a,u,l,f,h={};for(i=0;inew s(...t);s.prototype.parseMarkup=f.markupMethod.bind(i.markupOptions);function d(t=" ",e=1,r=null,i=null){this.char=t;this.width=e>=0?e:-e-1;this.filler=e<0;this.attr=r;this.misc=i}s.Cell=d;const a=t("./termkit.js");s.prototype.getText=function(){return this.buffer.map(t=>f.unicode.fromCells(t)).join("")};s.prototype.getLineText=function(t=this.cy){if(t>=this.buffer.length){return null}if(!this.buffer[t]){this.buffer[t]=[]}return f.unicode.fromCells(this.buffer[t])};s.prototype.getLineCharCount=function(t=this.cy){if(t>=this.buffer.length){return null}if(!this.buffer[t]){this.buffer[t]=[]}return this.getCellsCharCount(this.buffer[t])};s.prototype.getCellsCharCount=function(e){var r=0;for(let t of e){if(!t.filler){r++}}return r};s.prototype.getCursorSplittedText=function(){var t,e,r="",i="";for(t=0;tthis.cy){i+=f.unicode.fromCells(e)}else{r+=f.unicode.fromCells(e.slice(0,this.cx));i+=f.unicode.fromCells(e.slice(this.cx))}}return[r,i]};s.prototype.setText=function(t,e,r){if(typeof e!=="boolean"&&typeof e!=="string"){r=e;e=false}var i=false,n=null;switch(e){case"ansi":n=f.ansi.parse;break;case"legacyAnsi":n=f.ansi.parse;i=true;break;case true:n=this.parseMarkup;break}if(r===undefined){r=this.defaultAttr}if(typeof r==="object"){r=this.object2attr(r)}this.buffer.length=0;t.split(/(?<=\n)/g).forEach(t=>{var e=this.buffer.length;this.buffer[e]=this.lineToCells(t,n,r,0,i);if(t[t.length-1]==="\n"){this.buffer[e].push(new d("\n",1,r))}if(this.lineWrapWidth){this.wrapLine(e)}});this.selectionRegion=null};s.prototype.lineToCells=function(t,e,r,i=0,n=false){if(!e){return f.unicode.toCells(d,t,this.tabWidth,i,r)}var s,o,a=[];const u=this.ScreenBuffer.attr2object(this.ScreenBuffer.DEFAULT_ATTR);const l=this.ScreenBuffer.attr2object(r);e(t).forEach(t=>{o=Object.assign({},t.specialReset?u:l,t);delete o.text;if(o.defaultColor&&o.color){delete o.defaultColor}if(o.bgDefaultColor&&o.bgColor){delete o.bgDefaultColor}s=this.object2attr(o,undefined,n);if(t.text){a.push(...f.unicode.toCells(d,t.text,this.tabWidth,i+a.length,s))}});return a};s.prototype.setHidden=function(t){this.hidden=typeof t==="string"&&t.length?t[0]:t?a.spChars.password:false};s.prototype.getHidden=function(){return this.hidden};s.prototype.setVoidTextBuffer=function(t=null){this.voidTextBuffer=t};s.prototype.getVoidTextBuffer=function(){return this.voidTextBuffer};s.prototype.getContentSize=function(){return{width:Math.max(1,...this.buffer.map(t=>t.length)),height:this.buffer.length}};s.prototype.coordinateToOffset=function(t,e){var r,i,n,s=0;for(i=0;i=this.buffer.length){return t}a=this.buffer[t];l=this.buffer[t-1];s=t?0:this.firstLineRightShift;u=e-s;if(!e||a.length&&a.length<=u&&a[a.length-1].char==="\n"&&(!l||!l.length||l[l.length-1].char==="\n")){return t+1}var p=[],g=[];for(n=t-1;n>=0;n--){a=this.buffer[n];if(a.length&&a[a.length-1].char==="\n"){t=n+1;break}else if(!n){t=0;break}}for(n=t;n=p.length){g.push(p);break}if(i===u+1&&y.has(p[i].char)&&p[u-1].char!==" "){i=u-1}else{h=true}}if(!h){f=null;while(i>=0&&(p[i].char!==" "||y.has(f)&&i>0&&p[i-1].char!==" ")){f=p[i].char;i--}if(i<0){i=u}else{i++}}g.push(p.splice(0,i))}this.buffer.splice(t,o-t,...g);o=t+g.length;if(d){for(n=t;;n++){if(n>=o){if(n>0){n--}this.cy=n;this.cx=this.buffer[n]?this.buffer[n].length:0;break}if(!this.buffer[n]){this.cy=n;this.cx=0;break}if(c=t.ymin&&r<=t.ymax&&(r!==t.ymin||e>=t.xmin)&&(r!==t.ymax||e<=t.xmax)};s.prototype.setSelectionRegion=function(t){if(!this.selectionRegion){this.selectionRegion={}}if(t.xmin!==undefined&&t.ymin!==undefined){if(t.xmin<0){t.xmin=0}if(t.ymin<0){t.ymin=0}this.selectionRegion.xmin=t.xmin;this.selectionRegion.ymin=t.ymin;this.selectionRegion.cellMin=this.buffer[t.ymin]?.[t.xmin]??null}if(t.xmax!==undefined&&t.ymax!==undefined){this.selectionRegion.xmax=t.xmax;this.selectionRegion.ymax=t.ymax;this.selectionRegion.cellMax=this.buffer[t.ymax]?.[t.xmax]??null}};s.prototype.startOfSelection=function(){if(!this.selectionRegion){this.selectionRegion={}}this.selectionRegion.xmin=this.cx;this.selectionRegion.ymin=this.cy;this.selectionRegion.cellMin=this.buffer[this.cy]?.[this.cx]??null};s.prototype.endOfSelection=function(){var t=this.oneStepBackward();if(!this.selectionRegion){this.selectionRegion={}}if(!t){this.selectionRegion=null;return}this.selectionRegion.xmax=t.x;this.selectionRegion.ymax=t.y;this.selectionRegion.cellMax=this.buffer[t.y]?.[t.x]??null};s.prototype.updateSelectionFromCells=function(i=null){if(!this.selectionRegion){return}if(!this.selectionRegion.cellMin||!this.selectionRegion.cellMax){this.selectionRegion=null;return}var n,s,o,a;for(let r=0;r=0?t:0;this.cy=e>=0?e:0;this.moveToLeadingFullWidth()};s.prototype.move=function(t,e){this.moveTo(this.cx+t,this.cy+e)};s.prototype.moveToColumn=function(t){this.moveTo(t,this.cy)};s.prototype.moveToLine=s.prototype.moveToRow=function(t){this.moveTo(this.cx,t)};s.prototype.moveUp=function(){this.cy=this.cy>0?this.cy-1:0;this.moveToLeadingFullWidth();if(this.forceInBound){this.moveInBound(true)}};s.prototype.moveDown=function(){this.cy++;this.moveToLeadingFullWidth();if(this.forceInBound){this.moveInBound(true)}};s.prototype.moveLeft=function(){this.cx=this.cx>0?this.cx-1:0;this.moveToLeadingFullWidth();if(this.forceInBound){this.moveInBound(true)}};s.prototype.moveRight=function(){this.cx++;var t=this.buffer[this.cy];while(t?.[this.cx]?.filler&&t?.[this.cx]?.width===0){this.cx++}if(this.forceInBound){this.moveInBound(true)}};s.prototype.moveForward=function(t,e){var r=this.cx,i=this.buffer[this.cy];if(e&&(!i||!i[this.cx]||!i[this.cx].filler)){return}for(;;){if(!i||this.cx+1>i.length||this.cxr){this.cx=r}else{this.cx--}if(this.cx<0){this.cy--;if(this.cy<0){this.cy=0;this.cx=0;break}this.moveToEndOfLine();break}if(!i||!i[this.cx]||!i[this.cx].filler&&(!t||t(i[this.cx].char))){break}}if(this.forceInBound){this.moveInBound()}};const o=new Set([" ","\t",".",",",";",":","!","?","/","\\","(",")","[","]","{","}","<",">","=","'",'"']);s.prototype.wordBoundary_=function(t,e){var r,i=false;if(e&&this.buffer[this.cy]&&this.buffer[this.cy][this.cx]){r=this.buffer[this.cy][this.cx].char;if(!o.has(r)){i=true}}this[t](t=>{if(o.has(t)){if(i){return true}return false}i=true;return false})};s.prototype.moveToEndOfWord=function(){return this.wordBoundary_("moveForward",true)};s.prototype.moveToStartOfWord=function(){var t,e=this.cx,r=this.cy;this.wordBoundary_("moveBackward");if(this.cxthis.buffer.length){this.cy=this.buffer.length}if(t){return}if(!e){this.cx=0}else if(e.length&&e[e.length-1].char==="\n"){if(this.cx>e.length-1){this.cx=e.length-1}}else if(this.cx>e.length){this.cx=e.length}};s.prototype.insert=function(t,e,r){var i,n,s,o=0;if(!t){return o}if(typeof e!=="boolean"&&typeof e!=="string"){r=e;e=false}var a=false,u=null;switch(e){case"ansi":u=f.ansi.parse;break;case"legacyAnsi":u=f.ansi.parse;a=true;break;case true:u=this.parseMarkup;break}i=t.split("\n");s=i.length;if(r&&typeof r==="object"){r=this.object2attr(r)}else if(typeof r!=="number"){r=this.defaultAttr}if(this.forceInBound){this.moveInBound()}o+=this.inlineInsert(i[0],u,r);for(n=1;n=this.buffer.length){while(this.buffer.length0){r=this.buffer[this.cy];if(this.cy>=this.buffer.length||this.cy===this.buffer.length-1&&this.cx>=r.length){if(this.selectionRegion){this.updateSelectionFromCells()}return a}if(r){if(this.cx>r.length){this.cx=r.length}if(r[this.cx]&&r[this.cx].char!=="\n"){s=r[r.length-1]?.char==="\n";n=this.countInlineForwardFiller(t);i=Math.min(t+n,r.length-s-this.cx);if(i>0){o=r.splice(this.cx,i);if(e){o=o.filter(t=>!t.filler);a.string+=o.map(t=>t.char).join("");a.count+=o.length}}t-=i-n}}if(t>0){if(this.joinLine(true)){t--;if(e){a.string+="\n";a.count++}}}}if(this.lineWrapWidth){this.wrapLine()}this.reTabLine();if(this.selectionRegion){this.updateSelectionFromCells()}return a};s.prototype.backDelete=function(t,e=false){var r,i,n,s,o,a=e?{string:"",count:0}:undefined;if(t===undefined){t=1}if(this.forceInBound){this.moveInBound()}if(this.buffer[this.cy]&&this.cx&&this.buffer[this.cy][this.cx-1]&&this.buffer[this.cy][this.cx-1].filler){this.moveBackward(undefined,true)}while(t>0){r=this.buffer[this.cy];if(this.cy===0&&this.cx===0){if(this.selectionRegion){this.updateSelectionFromCells()}return a}if(r){if(this.cx>r.length){if(r.length&&r[r.length-1].char==="\n"){this.cx=r.length-1}else{this.cx=r.length}t--}else if(this.cx&&this.cx===r.length&&r[r.length-1].char==="\n"){this.cx=r.length-1}n=this.countInlineBackwardFiller(t);i=Math.min(t+n,this.cx);if(i>0){o=r.splice(this.cx-i,i);if(e){o=o.filter(t=>!t.filler);a.string=o.map(t=>t.char).join("")+a.string;a.count+=o.length}this.cx-=i}t-=i-n}if(t>0){this.cy--;this.cx=r?r.length:0;if(this.joinLine(true)){t--;if(e){a.string="\n"+a.string;a.count++}}}}if(this.lineWrapWidth){this.wrapLine()}this.reTabLine(s);if(this.selectionRegion){this.updateSelectionFromCells()}return a};s.prototype.countInlineBackwardFiller=function(t){var e,r,i=0;for(e=this.cx-1;e>=0&&t;e--){r=this.buffer[this.cy][e];if(r&&r.filler){i++}else{t--}}return i};s.prototype.countInlineForwardFiller=function(t){var e,r,i=this.buffer[this.cy].length,n=0;for(e=this.cx;e=this.buffer.length){return}if(t){o={count:this.getLineCharCount(),string:this.getLineText()}}this.buffer.splice(this.cy,1);if(this.selectionRegion){this.updateSelectionFromCells()}return o};s.prototype.findNext=function(t,e,r){var i,n,s,o=this.getText(),a=f.unicode.toArray(t).length;r=!!r;if(r){e=e?e-a:o.length-a}else{e=e??0}i=r?o.lastIndexOf(t,e):o.indexOf(t,e);if(i===-1){return}n=this.offsetToCoordinate(i);s=this.offsetToCoordinate(i+a-1);return{xmin:n.x,ymin:n.y,xmax:s.x,ymax:s.y}};s.prototype.findPrevious=function(t,e){return this.findNext(t,e,true)};s.prototype.regexpFindNext=function(t,e=0){var r,i,n,s,o,a=this.getText();if(typeof t==="string"){t=new RegExp(t,"gu")}else{t.global=true;t.unicode=true}t.lastIndex=e;o=t.exec(a);if(!o){return}s=f.unicode.toArray(o[0]).length;i=this.offsetToCoordinate(o.index);n=this.offsetToCoordinate(o.index+s-1);return{xmin:i.x,ymin:i.y,xmax:n.x,ymax:n.y,match:o}};s.prototype.draw=function(t={}){var e={dst:t.dst||this.dst,offsetX:t.x!==undefined?Math.floor(t.x):Math.floor(this.x),offsetY:t.y!==undefined?Math.floor(t.y):Math.floor(this.y),dstClipRect:t.dstClipRect?new a.Rect(t.dstClipRect):this.dstClipRect,srcClipRect:t.srcClipRect?new a.Rect(t.srcClipRect):undefined,blending:t.blending,wrap:t.wrap,tile:t.tile};if(e.dst instanceof this.ScreenBuffer){this.blitter(e);if(t.cursor){e.dst.cx=this.cx+e.offsetX;e.dst.cy=this.cy+e.offsetY}}};s.prototype.drawCursor=function(t){if(!t||typeof t!=="object"){t={}}var e,r=t.dst||this.dst;if(r instanceof this.ScreenBuffer){e=this.cy?this.cx:this.cx+this.firstLineRightShift;if(!this.ch&&(this.dstClipRect||new a.Rect(this.dst)).isInside(e+this.x,this.cy+this.y)){r.cx=e+this.x;r.cy=this.cy+this.y;r.ch=false}else{r.ch=true}}};s.prototype.blitter=function(t){var e,r,i,n,s,o;r=new a.Rect(this);if(this.voidTextBuffer){n=this.voidTextBuffer.buffer;r.merge(new a.Rect(this.voidTextBuffer))}i=t.srcClipRect||new a.Rect(r);e={type:"line",context:{srcFirstLineRightShift:this.firstLineRightShift,srcBuffer:this.buffer,srcAltBuffer:n,dstBuffer:t.dst.buffer,forceChar:this.hidden,voidAttr:this.voidAttr,inverseRegion:this.selectionRegion,writeAttr:this.ScreenBuffer===a.ScreenBuffer?(t,e,r)=>{t.writeInt32BE(e,r)}:(t,e,r)=>{e.copy(t,r)}},dstRect:new a.Rect(t.dst),srcRect:r,dstClipRect:t.dstClipRect||new a.Rect(t.dst),srcClipRect:i,offsetX:t.offsetX,offsetY:t.offsetY,wrap:t.wrap,tile:t.tile,multiply:this.ScreenBuffer.prototype.ITEM_SIZE};o=this.blitterLineIterator.bind(this);if(t.wrap){s="wrapIterator"}else if(t.tile){s="tileIterator"}else{s="regionIterator"}a.Rect[s](e,o)};s.prototype.blitterLineIterator=function(t){var e,r,i,n,s,o,a,u,l,f,h=t.context.inverseRegion,c=Infinity,d=-Infinity;e=t.srcY?0:t.context.srcFirstLineRightShift;r=t.srcXmin-e;i=t.srcXmax-e;s=t.dstStart;o=t.context.srcBuffer[t.srcY];if(o){n=i;if(n>=o.length){n=o.length-1}if(h&&t.srcY>=h.ymin&&t.srcY<=h.ymax){c=t.srcY===h.ymin?h.xmin:-Infinity;d=t.srcY===h.ymax?h.xmax:Infinity}for(;r<=n;r++,s+=this.ScreenBuffer.prototype.ITEM_SIZE){if(r<0){continue}a=o[r];if(t.context.forceChar){u=a.attr;l=t.context.forceChar}else{u=a.width===2?a.attr|this.ScreenBuffer.prototype.LEADING_FULLWIDTH:a.width===0?a.attr|this.ScreenBuffer.prototype.TRAILING_FULLWIDTH:a.attr;l=(f=a.char.charCodeAt(0))<32||f===127?" ":a.char}if(r>=c&&r<=d){u=this.ScreenBuffer.attrInverse(u)}t.context.writeAttr(t.context.dstBuffer,u,s);t.context.dstBuffer.write(l,s+this.ScreenBuffer.prototype.ATTR_SIZE,this.ScreenBuffer.prototype.CHAR_SIZE)}}if(t.context.srcAltBuffer){o=t.context.srcAltBuffer[t.srcY];if(o){n=i;if(n>=o.length){n=o.length-1}for(;r<=n;r++,s+=this.ScreenBuffer.prototype.ITEM_SIZE){if(r<0){continue}a=o[r];u=a.width===2?a.attr|this.ScreenBuffer.prototype.LEADING_FULLWIDTH:a.width===0?a.attr|this.ScreenBuffer.prototype.TRAILING_FULLWIDTH:a.attr;l=(f=a.char.charCodeAt(0))<32||f===127?" ":a.char;t.context.writeAttr(t.context.dstBuffer,u,s);t.context.dstBuffer.write(l,s+this.ScreenBuffer.prototype.ATTR_SIZE,this.ScreenBuffer.prototype.CHAR_SIZE)}}}u=t.context.voidAttr;if(u!==null){for(;r<=i;r++,s+=this.ScreenBuffer.prototype.ITEM_SIZE){t.context.writeAttr(t.context.dstBuffer,u,s);t.context.dstBuffer.write(" ",s+this.ScreenBuffer.prototype.ATTR_SIZE,this.ScreenBuffer.prototype.CHAR_SIZE)}}};s.prototype.load=async function(t,e){var r;this.buffer[0]=[];this.buffer.length=1;try{r=await n.promises.readFile(t)}catch(t){if(e){e(t);return}throw t}this.setText(r.toString());if(e){e();return}};s.prototype.save=async function(t,e){try{await n.promises.writeFile(t,this.getText())}catch(t){if(e){e(t);return}throw t}if(e){e();return}};s.prototype.object2attr=function(t,e=this.palette?.colorNameToIndex,r=false){return this.ScreenBuffer.object2attr(t,e,r)};s.prototype.oneStepBackward=function(t=this.cx,e=this.cy){t--;if(t<0){e--;if(e<0){return null}t=this.buffer[e].length-1}return{x:t,y:e}};s.prototype.runStateMachine=function(){if(!this.stateMachine){return}this.stateMachine.reset();this.iterate({finalCall:true,fillerCopyAttr:true},t=>{t.textBuffer=this;this.stateMachine.pushEvent(t.text,t)})};const l={};s.TextMachineApi=l;l.style=(t,e)=>{if(!t||t.x===null){return}if(!e.code){e.code=t.textBuffer.ScreenBuffer.object2attr(e)}t.textBuffer.setAttrCodeAt(e.code,t.x,t.y)};l.blockStyle=function(t,e,r){if(!t||!e||t.x===null||e.x===null){return}if(!r.code){r.code=t.textBuffer.ScreenBuffer.object2attr(r)}t.textBuffer.setAttrCodeRegion(r.code,{xmin:t.x,xmax:e.x,ymin:t.y,ymax:e.y})};l.hint=function(e,r,i){if(!e||e.x===null||e.y===null){return}if(i[r]){let t=e.textBuffer.getMiscAt(e.x,e.y);if(t){t.hint=i[r]}}}},{"./misc.js":47,"./termkit.js":55,fs:141,"string-kit":127}],7:[function(t,e,r){"use strict";e.exports=function t(e,r,i,n,s){var o,a,u,l=[],f=r,h=false;if(!n){n=""}if(!s){s=""}for(o=0;o1){t=1}var n=e.innerSize||10;var s=Math.floor(t*n);var o=Math.round((t*n-s)*8);var a=e.barStyle||this.blue;i+="█".repeat(s);if(s=3803){u=o||a?"gnome-256color":"gnome";l=true;break}}if(s==="darwin"){u="osx-256color";break}for(e in p.env){if(e.match(/KONSOLE/)){u=o||a?"konsole-256color":"konsole";l=true;break}}break;case"linux":case"aterm":case"kuake":case"tilda":case"terminology":case"wterm":case"mrxvt":break;case"gnome":case"gnome-256color":case"gnome-terminal":case"gnome-terminal-256color":case"terminator":case"guake":u=o||a?"gnome-256color":"gnome";break;case"konsole":u=o||a?"konsole-256color":"konsole";break;case"rxvt":case"rxvt-xpm":case"rxvt-unicode-256color":case"urxvt256c":case"urxvt256c-ml":case"rxvt-unicode":case"urxvt":case"urxvt-ml":if(p.env.TERM==="rxvt"){u="rxvt-256color"}else{u=o||a?"rxvt-256color":"rxvt"}break;case"xfce":case"xfce-terminal":case"xfce4-terminal":u="xfce";break;case"eterm":case"Eterm":u=o||a?"eterm-256color":"eterm";break;case"atomic-terminal":u="atomic-terminal";break;case"xterm-kitty":case"kitty":u="kitty";break;case"iTerm":case"iterm":case"iTerm2":case"iterm2":case"Terminal":case"terminal":case"Apple_Terminal":u="osx-256color";break;case"termux":break;default:if(!u){f="unknown"}else{f=u=f.toLowerCase()}break}return{isTTY:n,isSSH:i,appId:u,safe:l,generic:l?u:f}};function d(t){var n,s;return new e((r,i)=>{o("ps -h -o ppid -p "+t,(t,e)=>{if(t){i(t);return}n=parseInt(e.match(/[0-9]+/gm)[0],10);if(!n){i(new Error("Couldn't get parent PID"));return}o("ps -h -o comm -p "+n,(t,e)=>{if(t){i(t);return}s=e.trim();r({pid:n,appName:s})})})})}r.getParentTerminalInfo=async function(e){var t,r,i,n=[],s,o=p.pid;if(p.env.SSH_CONNECTION){r=new Error("SSH connection detected, .getParentTerminalInfo() is useless in this context.");if(e){e(r);return}throw r}var a=c.platform();var u=p.env.TERM&&p.env.TERM.match(/256/)||p.env.COLORTERM&&p.env.COLORTERM.match(/256/);var l=p.env.COLORTERM&&p.env.COLORTERM.match(/^(truecolor|24bits?)$/);try{t=true;while(t){({appName:i,pid:o}=await d(o));if(a==="darwin"){i=h.parse(i).name}n.push(i);t=false;switch(i){case"linux":case"xterm":case"konsole":case"gnome-terminal":case"aterm":case"guake":case"kuake":case"tilda":case"terminology":case"wterm":case"mrxvt":s=u||l?i+"-256color":i;break;case"atomic-terminal":s=i;break;case"login":i="linux";s=i;break;case"terminator":s=u||l?"gnome-256color":"gnome";break;case"rxvt":case"urxvt256c":case"urxvt256c-ml":s="rxvt-256color";break;case"urxvt":case"urxvt-ml":s="rxvt";break;case"xfce4-terminal":s="xfce";break;case"gnome-terminal-":i="gnome-terminal";s=u||l?"gnome-256color":"gnome";break;case"Eterm":case"eterm":i="Eterm";s=u||l?"eterm-256color":"eterm";break;case"kitty":i=s="kitty";break;case"iTerm":case"iTerm2":case"Terminal":s="osx-256color";break;default:if(i.match(/gnome-terminal/)){i="gnome-terminal";s=u||l?"gnome-256color":"gnome";break}if(!o||o===1){throw new Error("Terminal not found, app names: "+n.join(", "))}t=true}}}catch(t){if(e){e(t);return}throw t}var f={appId:s,appName:i,pid:o,safe:true};if(e){e(undefined,f);return}return f};r.getDetectedTerminal=async function(t){var e,r,i=n.guessTerminal();if(i.safe||i.isSSH){e=n.createTerminal({stdin:p.stdin,stdout:p.stdout,stderr:p.stderr,generic:p.env.TERM&&p.env.TERM.toLowerCase()||"unknown",appId:i.safe?i.appId:undefined,isTTY:i.isTTY,isSSH:i.isSSH,processSigwinch:true,preferProcessSigwinch:!!n.globalConfig.preferProcessSigwinch});if(t){t(undefined,e)}return e}try{r=await n.getParentTerminalInfo();e=n.createTerminal({stdin:p.stdin,stdout:p.stdout,stderr:p.stderr,generic:p.env.TERM&&p.env.TERM.toLowerCase()||"unknown",appId:r.appId,appName:r.appName,isTTY:i.isTTY,isSSH:i.isSSH,pid:r.pid,processSigwinch:true,preferProcessSigwinch:!!n.globalConfig.preferProcessSigwinch})}catch(t){e=n.createTerminal({stdin:p.stdin,stdout:p.stdout,stderr:p.stderr,generic:p.env.TERM&&p.env.TERM.toLowerCase()||"unknown",appId:i.safe?i.appId:undefined,isTTY:i.isTTY,isSSH:i.isSSH,processSigwinch:true,preferProcessSigwinch:!!n.globalConfig.preferProcessSigwinch})}if(t){t(undefined,e)}return e}}).call(this)}).call(this,t("_process"))},{"./termkit.js":55,_process:184,child_process:141,os:171,path:183,seventh:113}],13:[function(t,e,r){"use strict";const i=t("./Element.js");const n=t("./Text.js");const s=t("../spChars.js");function o(t){t=!t?{}:t.internal?t:Object.create(t);t.internal=true;t.attr=t.attr||{};if(Array.isArray(t.animation)){this.animation=t.animation}else if(typeof t.animation==="string"){this.animation=s.animation[t.animation]||s.animation.lineSpinner;if(t.contentHasMarkup!==false){t.contentHasMarkup=true}}else{this.animation=s.animation.lineSpinner}this.animation=this.animation.map(t=>Array.isArray(t)?t:[t]);this.isAnimated=false;this.frameDuration=t.frameDuration||150;this.animationSpeed=t.animationSpeed||1;this.frame=t.frame||0;this.autoUpdateTimer=null;this.autoUpdate=this.autoUpdate.bind(this);t.content=this.animation[this.frame];n.call(this,t);if(this.elementType==="AnimatedText"&&!t.noDraw){this.draw();this.animate()}}e.exports=o;i.inherit(o,n);o.prototype.inlineCursorRestoreAfterDraw=true;o.prototype.animate=function(t=1){this.isAnimated=!!t;this.animationSpeed=+t||0;if(!this.isAnimated){if(this.autoUpdateTimer){clearTimeout(this.autoUpdateTimer)}this.autoUpdateTimer=null;return}if(!this.autoUpdateTimer){this.autoUpdateTimer=setTimeout(()=>this.autoUpdate(),this.frameDuration/this.animationSpeed)}};o.prototype.autoUpdate=function(){this.frame=(this.frame+1)%this.animation.length;this.content=this.animation[this.frame];this.draw();this.autoUpdateTimer=setTimeout(()=>this.autoUpdate(),this.frameDuration/this.animationSpeed)}},{"../spChars.js":53,"./Element.js":25,"./Text.js":36}],14:[function(t,e,r){"use strict";const d=t("./Element.js");const i=t("../spChars.js").bar;function n(t){t=!t?{}:t.internal?t:Object.create(t);t.internal=true;d.call(this,t);this.minValue=+t.minValue||0;this.maxValue=t.maxValue!==undefined?+t.maxValue||0:1;this.value=+t.value||0;if(this.valuethis.maxValue){this.value=this.maxValue}this.borderAttr=t.borderAttr||{bold:true};this.bodyAttr=t.bodyAttr||{color:"blue"};this.barChars=i.classic;if(typeof t.barChars==="object"){this.barChars=t.barChars}else if(typeof t.barChars==="string"&&i[t.barChars]){this.barChars=i[t.barChars]}this.overTextFullAttr=t.overTextFullAttr||{bgColor:"blue"};this.overTextEmptyAttr=t.overTextEmptyAttr||{bgColor:"default"};if(this.elementType==="Bar"&&!t.noDraw){this.draw()}}e.exports=n;d.inherit(n);n.prototype.preDrawSelf=function(){var t,e,r,i,n,s,o=0,a,u=0,l=false,f=null,h=this.outputWidth-2,c=(this.value-this.minValue)/(this.maxValue-this.minValue);if(!c||c<0){c=0}else if(c>1){c=1}r=Math.floor(c*h);n=c*h-r;if(this.content){if(n<.5){s=d.truncateContent(this.content,r,this.contentHasMarkup);o=d.getLastTruncateWidth();if(o=.5){r++}}else if(this.barChars.body.length===3){f=this.barChars.body[1]}else if(this.barChars.body.length===4){f=this.barChars.body[n<.5?1:2]}else{t=Math.floor(1.5+n*(this.barChars.body.length-3));f=this.barChars.body[t]}}i=h-r-(f?1:0);if(this.content&&o0){this.outputDst.put({x:e,y:this.outputY,attr:this.bodyAttr,markup:true},this.barChars.body[0].repeat(r-o));e+=r-o}if(f){this.outputDst.put({x:e++,y:this.outputY,attr:this.bodyAttr,markup:true},f)}if(u){this.outputDst.put({x:e,y:this.outputY,attr:this.overTextEmptyAttr,markup:true},a);e+=u}if(i-u>0){this.outputDst.put({x:e,y:this.outputY,attr:this.bodyAttr,markup:true},this.barChars.body[this.barChars.body.length-1].repeat(i-u));e+=i-u}this.outputDst.put({x:e,y:this.outputY,attr:this.borderAttr,markup:true},this.barChars.border[1])};n.prototype.getValue=function(){return this.value};n.prototype.setValue=function(t,e){this.value=+t||0;if(this.valuethis.maxValue){this.value=this.maxValue}if(!e){this.draw()}}},{"../spChars.js":53,"./Element.js":25}],15:[function(o,a,t){(function(s){(function(){"use strict";const e=o("tree-kit");const r=o("./Element.js");const t=o("./Button.js");function i(t={}){r.call(this,t);this.backgroundAttr=t.backgroundAttr||{bgColor:"white",color:"black"};this.contentEllipsis=t.contentEllipsis||"…";this.previousPageContent=t.previousPageContent||"«";this.previousPageContentHasMarkup=!!t.previousPageContentHasMarkup;this.nextPageContent=t.nextPageContent||"»";this.nextPageContentHasMarkup=!!t.nextPageContentHasMarkup;this.itemsDef=t.items||[];this.previousPageDef=t.previousPage;this.nextPageDef=t.nextPage;this.masterDef=t.master;this.separatorDef=t.separator;this.buttons=[];this.hotkeyToButtonIndex=new Map;this.focusChild=null;this.page=0;this.maxPage=0;this.hasSubmenu=!!t.submenu;this.isSubmenu=!!t.isSubmenu;this.submenu=null;this.submenuParentButton=null;this.submenuOptions=null;if(this.hasSubmenu){this.submenuOptions=e.extend(null,{},t,{internal:true,parent:null,items:null});if(t.submenu&&typeof t.submenu==="object"){Object.assign(this.submenuOptions,t.submenu)}}this.onButtonSubmit=this.onButtonSubmit.bind(this);this.onButtonToggle=this.onButtonToggle.bind(this);this.onButtonFocus=this.onButtonFocus.bind(this);this.onButtonBlinked=this.onButtonBlinked.bind(this);this.onSubmenuSubmit=this.onSubmenuSubmit.bind(this);this.onWheel=this.onWheel.bind(this);this.onFocus=this.onFocus.bind(this);this.buttonBlurAttr=t.buttonBlurAttr||this.defaultOptions.buttonBlurAttr||{bgColor:"black",color:"white",bold:true};this.buttonEvenBlurAttr=t.buttonEvenBlurAttr||null;this.buttonFocusAttr=t.buttonFocusAttr||this.defaultOptions.buttonFocusAttr||{bgColor:"white",color:"black",bold:true};this.buttonDisabledAttr=t.buttonDisabledAttr||this.defaultOptions.buttonDisabledAttr||{bgColor:"black",color:"gray",bold:true};this.buttonSubmittedAttr=t.buttonSubmittedAttr||this.defaultOptions.buttonSubmittedAttr||{bgColor:"gray",color:"brightWhite",bold:true};this.buttonTurnedOnBlurAttr=t.buttonTurnedOnBlurAttr||this.defaultOptions.buttonTurnedOnBlurAttr||{bgColor:"cyan"};this.buttonTurnedOnFocusAttr=t.buttonTurnedOnFocusAttr||this.defaultOptions.buttonTurnedOnFocusAttr||{bgColor:"brightCyan",color:"gray",bold:true};this.buttonTurnedOffBlurAttr=t.buttonTurnedOffBlurAttr||this.defaultOptions.buttonTurnedOffBlurAttr||{bgColor:"gray",dim:true};this.buttonTurnedOffFocusAttr=t.buttonTurnedOffFocusAttr||this.defaultOptions.buttonTurnedOffFocusAttr||{bgColor:"white",color:"black",bold:true};this.blurLeftPadding=t.blurLeftPadding??t.leftPadding??"";this.blurRightPadding=t.blurRightPadding??t.rightPadding??"";this.focusLeftPadding=t.focusLeftPadding??t.leftPadding??"";this.focusRightPadding=t.focusRightPadding??t.rightPadding??"";this.disabledLeftPadding=t.disabledLeftPadding??t.leftPadding??"";this.disabledRightPadding=t.disabledRightPadding??t.rightPadding??"";this.submittedLeftPadding=t.submittedLeftPadding??t.leftPadding??"";this.submittedRightPadding=t.submittedRightPadding??t.rightPadding??"";this.turnedOnBlurLeftPadding=t.turnedOnBlurLeftPadding??t.turnedOnLeftPadding??this.blurLeftPadding;this.turnedOnBlurRightPadding=t.turnedOnBlurRightPadding??t.turnedOnRightPadding??this.blurRightPadding;this.turnedOffBlurLeftPadding=t.turnedOffBlurLeftPadding??t.turnedOffLeftPadding??this.blurLeftPadding;this.turnedOffBlurRightPadding=t.turnedOffBlurRightPadding??t.turnedOffRightPadding??this.blurRightPadding;this.turnedOnFocusLeftPadding=t.turnedOnFocusLeftPadding??t.turnedOnLeftPadding??this.focusLeftPadding;this.turnedOnFocusRightPadding=t.turnedOnFocusRightPadding??t.turnedOnRightPadding??this.focusRightPadding;this.turnedOffFocusLeftPadding=t.turnedOffFocusLeftPadding??t.turnedOffLeftPadding??this.focusLeftPadding;this.turnedOffFocusRightPadding=t.turnedOffFocusRightPadding??t.turnedOffRightPadding??this.focusRightPadding;this.paddingHasMarkup=!!t.paddingHasMarkup;if(t.keyBindings){this.keyBindings=t.keyBindings}if(t.buttonKeyBindings){this.buttonKeyBindings=t.buttonKeyBindings}if(t.buttonActionKeyBindings){this.buttonActionKeyBindings=t.buttonActionKeyBindings}if(t.toggleButtonKeyBindings){this.toggleButtonKeyBindings=t.toggleButtonKeyBindings}if(t.toggleButtonActionKeyBindings){this.toggleButtonActionKeyBindings=t.toggleButtonActionKeyBindings}this.on("key",this.onKey);this.on("wheel",this.onWheel);this.on("focus",this.onFocus)}a.exports=i;r.inherit(i);i.prototype.needInput=true;i.prototype.destroy=function(t,e=false){if(this.destroyed){return}if(this.submenu){this.submenu.destroy(true)}r.prototype.destroy.call(this,t,e)};i.prototype.previousPage=function(t){var e;if(this.maxPage&&this.page>0){this.page--;this.initPage();this.focusChild=this.children[this.children.length-2];e=this.document.giveFocusTo_(this.focusChild,t);if(!e){this.document.focusPrevious()}this.updateDraw()}};i.prototype.nextPage=function(t){var e;if(this.maxPage&&this.page!t.disabled&&t.value===e);if(!n){return}if(this.page!==n.page||r){this.page=n.page;this.initPage()}s=this.buttons.find(t=>t.def===n);if(!s){return}this.focusChild=s;i=this.document.giveFocusTo_(this.focusChild,t);if(!i){this.document.focusNext()}this.draw()};i.prototype.setItem=function(e,t){var r,i;r=this.itemsDef.find(t=>t.value===e);if(!r){return false}Object.assign(r,t);i=this.focusChild&&this.focusChild.value;this.initChildren(true);if(i!==undefined){this.focusValue(i,"refocus",true)}else{this.initPage();this.draw()}return true};i.prototype.onWheel=function(t){if(t.yDirection<0){this.previousPage("backCycle")}else if(t.yDirection>0){this.nextPage("cycle")}};i.prototype.onFocus=function(t,e){if(e==="cycle"||e==="backCycle"){return}if(t){s.nextTick(()=>{let t=e==="clear"?e:undefined;if(this.focusChild&&!this.focusChild.destroyed){this.document.giveFocusTo(this.focusChild,t||"delegate")}else{this.focusChild=this.focusNextChild(undefined,t)}})}};i.prototype.onButtonSubmit=function(t,e,r){switch(r.internalRole){case"previousPage":this.previousPage();break;case"nextPage":this.nextPage();break;default:if(this.hasSubmenu&&r.def.items){if(this.submenuOptions.openOn==="parentSubmit"){this.openSubmenu(r.value,r)}if(this.submenu){this.document.giveFocusTo(this.submenu)}}else{this.emit("submit",t,e,this,r)}}};i.prototype.onButtonBlinked=function(t,e,r){switch(r.internalRole){case"previousPage":case"nextPage":break;default:if(this.hasSubmenu&&r.def.items){if(this.submenuOptions.openOn==="parentBlinked"){this.openSubmenu(r.value,r)}}else{this.emit("blinked",t,e,this,r)}}};i.prototype.onButtonFocus=function(t,e,r){switch(r.internalRole){case"previousPage":case"nextPage":break;default:if(t&&this.hasSubmenu&&r.def.items&&this.submenuOptions.openOn==="parentFocus"){this.openSubmenu(r.value,r)}this.emit("itemFocus",r.value,t,r)}};i.prototype.onSubmenuSubmit=function(t,e,r,n){r.once("blinked",(t,e,r,i)=>{if(this.submenuOptions.closeOn==="childSubmit"){this.closeSubmenu();this.document.giveFocusTo(this.submenuParentButton||this)}this.emit("blinked",t,e,this,n)});this.emit("submit",t,e,this,n)};i.prototype.openSubmenu=function(e,r=null){var t,i,n,s,o=r?this.itemsDef.find(t=>t===r.def):this.itemsDef.find(t=>t.value===e);if(!o||!o.items||!o.items.length){return}if(this.submenu){if(this.submenu.def===o){return}this.closeSubmenu()}this.submenuParentButton=r;switch(this.submenuOptions.disposition){case"overwrite":t=this.outputX;i=this.outputY;n=this.submenuOptions.width;s=this.submenuOptions.height;break;case"right":default:t=this.outputX+this.outputWidth;i=this.outputY;n=this.submenuOptions.width||this.outputWidth;break}if(this.submenuOptions.hideParent){this.children.forEach(t=>t.hidden=true)}this.submenu=new this.constructor(Object.assign({},this.submenuOptions,{internal:true,parent:this,isSubmenu:true,def:o,outputX:t,outputY:i,outputWidth:n,outputHeight:s,items:o.items,noDraw:true}));this.outerDraw();if(this.submenuOptions.focusOnOpen){this.document.giveFocusTo(this.submenu)}this.submenu.on("submit",this.onSubmenuSubmit);this.submenu.on("itemFocus",(...t)=>this.emit("itemFocus",...t))};i.prototype.closeSubmenu=function(){if(!this.submenu){return false}if(this.submenuOptions.hideParent){this.children.forEach(t=>t.hidden=false)}this.submenu.destroy();this.submenu=null;return true};i.prototype.defaultOptions={};i.prototype.buttonKeyBindings={};i.prototype.buttonActionKeyBindings={};i.prototype.toggleButtonKeyBindings={};i.prototype.toggleButtonActionKeyBindings={};i.prototype.initPage=function(){};i.prototype.onButtonToggle=function(){};i.prototype.childUseParentKeyValue=false;const n=i.prototype.userActions;n.character=n.specialKey=function(t){var e=this.hotkeyToButtonIndex.get(t);if(e!==undefined&&this.buttons[e]){if(this.document){this.document.giveFocusTo(this.buttons[e])}this.buttons[e].submit()}else{return false}};n.previous=function(){this.focusChild=this.focusPreviousChild(!this.maxPage);if(this.focusChild===this.children[0]&&this.maxPage&&this.page>0){this.previousPage("backCycle")}};n.next=function(){this.focusChild=this.focusNextChild(!this.maxPage);if(this.focusChild===this.children[this.children.length-1]&&this.maxPage&&this.page0){this.previousPage("backCycle")}};n.nextPage=function(){if(this.maxPage&&this.pagethis.blink(t,e-1),80)}else{this.updateStatus();this.draw();this.emit("blinked",this.value,t,this)}};s.prototype.onFocus=function(t,e){this.updateStatus();this.draw()};s.prototype.updateStatus=function(){if(this.disabled){this.attr=this.disabledAttr;this.content=this.disabledContent;this.leftPadding=this.disabledLeftPadding;this.rightPadding=this.disabledRightPadding}else if(this.submitted){this.attr=this.submittedAttr;this.content=this.submittedContent;this.leftPadding=this.submittedLeftPadding;this.rightPadding=this.submittedRightPadding}else if(this.hasFocus){this.attr=this.focusAttr;this.content=this.focusContent;this.leftPadding=this.focusLeftPadding;this.rightPadding=this.focusRightPadding}else{this.attr=this.blurAttr;this.content=this.blurContent;this.leftPadding=this.blurLeftPadding;this.rightPadding=this.blurRightPadding}};s.prototype.submit=function(t){if(this.submitOnce){this.submitted=true}this.emit("submit",this.value,t,this);this.blink(t)};s.prototype.unsubmit=function(){this.submitted=false;this.updateStatus()};s.prototype.onHover=function(t){if(this.disabled||this.submitted){return}this.document.giveFocusTo(this,"hover")};s.prototype.onClick=function(t){if(this.disabled||this.submitted){return}this.document.giveFocusTo(this,"select");this.submit(this.actionKeyBindings.click)};s.prototype.onRightClick=function(t){if(this.disabled||this.submitted){return}this.document.giveFocusTo(this,"select");this.submit(this.actionKeyBindings.rightClick)};s.prototype.onMiddleClick=function(t){if(this.disabled||this.submitted){return}this.document.giveFocusTo(this,"select");this.submit(this.actionKeyBindings.middleClick)};s.prototype.onShortcut=function(){if(this.disabled||this.submitted){return}this.document.giveFocusTo(this,"select");this.submit()};const o=s.prototype.userActions;o.submit=function(t){if(this.disabled||this.submitted){return}this.submit(this.actionKeyBindings[t])}},{"./Element.js":25,"./Text.js":36}],18:[function(t,e,r){"use strict";const f=t("./Element.js");const i=t("./BaseMenu.js");const l=t("./Button.js");const h=t("./ToggleButton.js");function n(t){t=!t?{}:t.internal?t:Object.create(t);t.internal=true;this.onParentResize=this.onParentResize.bind(this);if(!t.outputWidth&&!t.width){if(t.parent){t.outputWidth=Math.min(t.parent.inputWidth,t.parent.outputWidth)}else if(t.inlineTerm){t.outputWidth=t.inlineTerm.width}}this.buttonsMaxWidth=0;this.buttonPaddingWidth=0;this.buttonSymbolWidth=0;this.pageHeight=0;this.pageItemsDef=null;if(!t.multiLineItems){t.height=t.items&&t.items.length}i.call(this,t);this.maxHeight=this.autoHeight&&this.outputDst?Math.round(this.outputDst.height*this.autoHeight):t.maxHeight?t.maxHeight:t.pageMaxHeight?t.pageMaxHeight:this.strictInline?this.inlineTerm.height:Infinity;this.on("parentResize",this.onParentResize);this.multiLineItems=!!t.multiLineItems;this.initChildren();if(this.elementType==="ColumnMenu"&&!t.noDraw){this.draw()}}e.exports=n;f.inherit(n,i);n.prototype.inlineNewLine=true;n.prototype.ButtonClass=l;n.prototype.defaultOptions={buttonBlurAttr:{bgColor:"black",color:"white",bold:true},buttonEvenBlurAttr:null,buttonFocusAttr:{bgColor:"white",color:"black",bold:true},buttonDisabledAttr:{bgColor:"black",color:"gray",bold:true},buttonSubmittedAttr:{bgColor:"gray",color:"brightWhite",bold:true},buttonTurnedOnBlurAttr:{bgColor:"cyan"},buttonTurnedOnFocusAttr:{bgColor:"brightCyan",color:"gray",bold:true},buttonTurnedOffBlurAttr:{bgColor:"gray",dim:true},buttonTurnedOffFocusAttr:{bgColor:"white",color:"black",bold:true}};n.prototype.keyBindings={UP:"previous",DOWN:"next",PAGE_UP:"previousPage",PAGE_DOWN:"nextPage",HOME:"firstPage",END:"lastPage",ALT_ENTER:"submit",ESCAPE:"parentMenu",LEFT:"parentMenu",RIGHT:"submenu"};n.prototype.buttonKeyBindings={ENTER:"submit",KP_ENTER:"submit"};n.prototype.toggleButtonKeyBindings={ENTER:"toggle",KP_ENTER:"toggle"};n.prototype.initChildren=function(t=false){this.pageItemsDef=[];this.buttonPaddingWidth=Math.max(f.computeContentWidth(this.blurLeftPadding,this.paddingHasMarkup),f.computeContentWidth(this.focusLeftPadding,this.paddingHasMarkup),f.computeContentWidth(this.disabledLeftPadding,this.paddingHasMarkup),f.computeContentWidth(this.submittedLeftPadding,this.paddingHasMarkup),f.computeContentWidth(this.turnedOnFocusLeftPadding,this.paddingHasMarkup),f.computeContentWidth(this.turnedOffFocusLeftPadding,this.paddingHasMarkup),f.computeContentWidth(this.turnedOnBlurLeftPadding,this.paddingHasMarkup),f.computeContentWidth(this.turnedOffBlurLeftPadding,this.paddingHasMarkup))+Math.max(f.computeContentWidth(this.blurRightPadding,this.paddingHasMarkup),f.computeContentWidth(this.focusRightPadding,this.paddingHasMarkup),f.computeContentWidth(this.disabledRightPadding,this.paddingHasMarkup),f.computeContentWidth(this.submittedRightPadding,this.paddingHasMarkup),f.computeContentWidth(this.turnedOnFocusRightPadding,this.paddingHasMarkup),f.computeContentWidth(this.turnedOffFocusRightPadding,this.paddingHasMarkup),f.computeContentWidth(this.turnedOnBlurRightPadding,this.paddingHasMarkup),f.computeContentWidth(this.turnedOffBlurRightPadding,this.paddingHasMarkup));if(this.buttonPaddingWidth>this.outputWidth){return}var a=f.computeContentWidth(this.contentEllipsis,false);this.previousPageDef=Object.assign({content:"▲",internalRole:"previousPage"},this.previousPageDef);this.previousPageDef.contentHasMarkup=this.previousPageDef.contentHasMarkup||this.previousPageDef.markup;this.previousPageDef.width=this.buttonPaddingWidth+f.computeContentWidth(this.previousPageDef.content,this.previousPageDef.contentHasMarkup);this.previousPageDef.buttonContent=this.previousPageDef.content;this.nextPageDef=Object.assign({content:"▼",internalRole:"nextPage"},this.nextPageDef);this.nextPageDef.contentHasMarkup=this.nextPageDef.contentHasMarkup||this.nextPageDef.markup;this.nextPageDef.width=this.buttonPaddingWidth+f.computeContentWidth(this.nextPageDef.content,this.nextPageDef.contentHasMarkup);this.nextPageDef.buttonContent=this.nextPageDef.content;if(this.masterDef){this.masterDef=Object.assign({content:"column-menu",internalRole:"master"},this.masterDef);this.masterDef.contentHasMarkup=this.masterDef.contentHasMarkup||this.masterDef.markup;this.masterDef.buttonContent=this.masterDef.content;if(this.masterDef.symbol){this.buttonSymbolWidth=1+f.computeContentWidth(this.masterDef.symbol);this.masterDef.buttonContent+=" "+this.masterDef.symbol}this.masterDef.width=this.buttonPaddingWidth+f.computeContentWidth(this.masterDef.buttonContent,this.masterDef.contentHasMarkup)}this.buttonsMaxWidth=Math.max(this.buttonsMaxWidth,this.previousPageDef.width,this.nextPageDef.width,this.masterDef?this.masterDef.width:0);var u=0,l=0;this.itemsDef.forEach((t,e)=>{t.contentHasMarkup=t.contentHasMarkup||t.markup;t.buttonContent=t.content;t.buttonBlurContent=t.blurContent;t.buttonFocusContent=t.focusContent;t.buttonDisabledContent=t.disabledContent;t.buttonSubmittedContent=t.submittedContent;t.buttonTurnedOnBlurContent=t.turnedOnBlurContent;t.buttonTurnedOffBlurContent=t.turnedOffBlurContent;t.buttonTurnedOnFocusContent=t.turnedOnFocusContent;t.buttonTurnedOffFocusContent=t.turnedOffFocusContent;var r=f.computeContentWidth(t.content,t.contentHasMarkup),i=1,n=e===this.itemsDef.length-1,s=Math.max(1,!n?this.maxHeight-1:this.maxHeight),o=this.buttonPaddingWidth+r-this.outputWidth;if(o>0){if(this.multiLineItems){t.buttonContent=f.wordWrapContent(t.content,this.outputWidth-this.buttonPaddingWidth,t.contentHasMarkup);r=this.outputWidth-this.buttonPaddingWidth;i=t.buttonContent.length}else{t.buttonContent=f.truncateContent(t.content,r-o-a,t.contentHasMarkup)+this.contentEllipsis;r=f.computeContentWidth(t.buttonContent,t.contentHasMarkup)}}if(e&&l+i>s){u++;l=1;if(l+i>s&&i>1){i=s-l;t.buttonContent.length=i;t.buttonContent[i-1]=f.truncateContent(t.buttonContent[i-1].trimRight(),r-a,t.contentHasMarkup)+this.contentEllipsis}}l+=i;t.width=this.buttonPaddingWidth+r;t.page=u;if(t.width+this.buttonSymbolWidth>this.buttonsMaxWidth){this.buttonsMaxWidth=t.width+this.buttonSymbolWidth}if(!this.pageItemsDef[u]){this.pageItemsDef[u]=[]}this.pageItemsDef[u].push(t)});this.maxPage=u;if(this.separatorDef){this.separatorDef=Object.assign({content:"-",disabled:true,internalRole:"separator"},this.separatorDef);this.separatorDef.width=f.computeContentWidth(this.separatorDef.content,this.separatorDef.contentHasMarkup);if(this.separatorDef.contentRepeat&&this.separatorDef.width{if(e){t.unshift(this.previousPageDef)}if(ethis.buttonsMaxWidth){this.outputWidth=this.buttonsMaxWidth}if(this.elementType==="ColumnMenu"&&!t){this.initPage()}};n.prototype.initPage=function(t=this.page){var a=0,u=0;if(!this.pageItemsDef[t]){return}this.buttons.forEach(t=>t.destroy(false,true));this.buttons.length=0;this.pageItemsDef[t].forEach((t,e)=>{var r,i,n,s,o;if(!Array.isArray(t.buttonContent)){t.buttonContent=[t.buttonContent+" ".repeat(this.buttonsMaxWidth-t.width)]}r=t.internalRole?l:t.type==="button"?l:t.type==="toggle"?h:this.ButtonClass??l;i=r===h||r.prototype instanceof h;n=t.key;s=this.childUseParentKeyValue&&n&&this.value&&typeof this.value==="object"?this.value[n]:t.value===undefined&&!i&&t.key?t.key:t.value;if(e%2){o=t.blurAttr||this.buttonBlurAttr}else{o=t.evenBlurAttr||t.blurAttr||this.buttonEvenBlurAttr||this.buttonBlurAttr}this.buttons[e]=new r({internal:true,parent:this,childId:e,internalRole:t.internalRole,contentHasMarkup:t.contentHasMarkup,content:t.buttonContent,blurContent:t.buttonBlurContent,focusContent:t.buttonFocusContent,disabledContent:t.buttonDisabledContent,submittedContent:t.buttonSubmittedContent,turnedOnBlurContent:t.buttonTurnedOnBlurContent,turnedOffBlurContent:t.buttonTurnedOffBlurContent,turnedOnFocusContent:t.buttonTurnedOnFocusContent,turnedOffFocusContent:t.buttonTurnedOffFocusContent,disabled:t.disabled,def:t,key:n,value:s,outputX:this.outputX+a,outputY:this.outputY+u,blurAttr:o,focusAttr:t.focusAttr||this.buttonFocusAttr,disabledAttr:t.disabledAttr||this.buttonDisabledAttr,submittedAttr:t.submittedAttr||this.buttonSubmittedAttr,turnedOnFocusAttr:t.turnedOnFocusAttr||this.buttonTurnedOnFocusAttr,turnedOffFocusAttr:t.turnedOffFocusAttr||this.buttonTurnedOffFocusAttr,turnedOnBlurAttr:t.turnedOnBlurAttr||this.buttonTurnedOnBlurAttr,turnedOffBlurAttr:t.turnedOffBlurAttr||this.buttonTurnedOffBlurAttr,blurLeftPadding:this.blurLeftPadding,blurRightPadding:this.blurRightPadding,focusLeftPadding:this.focusLeftPadding,focusRightPadding:this.focusRightPadding,disabledLeftPadding:this.disabledLeftPadding,disabledRightPadding:this.disabledRightPadding,submittedLeftPadding:this.submittedLeftPadding,submittedRightPadding:this.submittedRightPadding,turnedOnFocusLeftPadding:this.turnedOnFocusLeftPadding,turnedOnFocusRightPadding:this.turnedOnFocusRightPadding,turnedOffFocusLeftPadding:this.turnedOffFocusLeftPadding,turnedOffFocusRightPadding:this.turnedOffFocusRightPadding,turnedOnBlurLeftPadding:this.turnedOnBlurLeftPadding,turnedOnBlurRightPadding:this.turnedOnBlurRightPadding,turnedOffBlurLeftPadding:this.turnedOffBlurLeftPadding,turnedOffBlurRightPadding:this.turnedOffBlurRightPadding,paddingHasMarkup:this.paddingHasMarkup,keyBindings:i?this.toggleButtonKeyBindings:this.buttonKeyBindings,actionKeyBindings:i?this.toggleButtonActionKeyBindings:this.buttonActionKeyBindings,shortcuts:t.shortcuts,noDraw:true});this.buttons[e].on("submit",this.onButtonSubmit);this.buttons[e].on("blinked",this.onButtonBlinked);this.buttons[e].on("focus",this.onButtonFocus);if(i){this.buttons[e].on("toggle",this.onButtonToggle)}u+=this.buttons[e].outputHeight});if(u{if(t.internalRole||!t.key||!(t instanceof o)){return}t.setValue(!!this.value[t.key],true,true)});if(!t){this.draw()}};a.prototype.setKeyValue=function(e,r,t){if(!e){return}this.value[e]=!!r;if(!this.buttons){return}this.buttons.forEach(t=>{if(t.internalRole||t.key!==e||!(t instanceof o)){return}t.setValue(!!r,true,true)});if(!t){this.draw()}};a.prototype.onButtonToggle=function(t,e,r){if(!r.key){return}if(t){this.value[r.key]=true}else{delete this.value[r.key]}this.emit("submit",r.key,t,this,r)}},{"./Button.js":17,"./ColumnMenu.js":18,"./Element.js":25,"./ToggleButton.js":39}],20:[function(t,e,r){"use strict";const i=t("./Element.js");const n=t("./ColumnMenu.js");const s=t("./ToggleButton.js");function o(t){t=!t?{}:t.internal?t:Object.create(t);t.internal=true;if(t.value&&typeof t.value==="object"){this.setValue(t.value,true)}else{this.value={}}n.call(this,t);if(this.elementType==="ColumnMenuMulti"&&!t.noDraw){this.draw()}}e.exports=o;i.inherit(o,n);o.prototype.ButtonClass=s;o.prototype.childUseParentKeyValue=true;o.prototype.initChildren=function(t=false){n.prototype.initChildren.call(this);if(this.elementType==="ColumnMenuMulti"&&!t){this.initPage()}};o.prototype.setValue=function(e,t){if(!e||typeof e!=="object"){return}this.value={};if(Array.isArray(e)||e instanceof Set){for(let t of e){if(t&&typeof t==="string"){this.value[t]=true}}}else{for(let t in e){this.value[t]=!!e[t]}}if(!this.buttons){return}this.buttons.forEach(t=>{if(t.internalRole||!t.key||!(t instanceof s)){return}t.setValue(!!this.value[t.key],true,true)});if(!t){this.draw()}};o.prototype.setKeyValue=function(e,r,t){if(!e){return}this.value[e]=!!r;if(!this.buttons){return}this.buttons.forEach(t=>{if(t.internalRole||t.key!==e||!(t instanceof s)){return}t.setValue(!!r,true,true)});if(!t){this.draw()}};o.prototype.onButtonSubmit=function(t,e,r){switch(r.internalRole){case"previousPage":this.previousPage();break;case"nextPage":this.nextPage();break;default:this.emit("submit",this.value,e,this,r)}};o.prototype.onButtonToggle=function(t,e,r){if(!r.key){return}if(t){this.value[r.key]=true}else{delete this.value[r.key]}this.emit("itemToggle",r.key,t,r)};const a=o.prototype.userActions;a.submit=function(){this.emit("submit",this.value,undefined,this)}},{"./ColumnMenu.js":18,"./Element.js":25,"./ToggleButton.js":39}],21:[function(t,e,r){"use strict";const i=t("./Element.js");const n=t("../ScreenBuffer.js");function s(t){t=!t?{}:t.internal?t:Object.create(t);t.internal=true;i.call(this,t);this.onClick=this.onClick.bind(this);this.onDrag=this.onDrag.bind(this);this.onWheel=this.onWheel.bind(this);if(t.keyBindings){this.keyBindings=t.keyBindings}this.palette=t.palette||this.document&&this.document.palette;this.object2attr=t=>n.object2attr(t,this.palette&&this.palette.colorNameToIndex);this.scrollable=!!t.scrollable;this.hasVScrollBar=this.scrollable&&!!t.vScrollBar;this.hasHScrollBar=this.scrollable&&!!t.hScrollBar;this.scrollX=t.scrollX||0;this.scrollY=t.scrollY||0;this.vScrollBarSlider=null;this.hScrollBarSlider=null;this.movable=!!t.movable;this.viewportX=this.outputX+this.containerBorderSize;this.viewportY=this.outputY+this.containerBorderSize;this.viewportWidth=this.outputWidth-this.containerBorderSize*2;this.viewportHeight=this.outputHeight-this.containerBorderSize*2;this.inputX=t.inputX||this.viewportX+this.scrollX;this.inputY=t.inputY||this.viewportY+this.scrollY;this.inputWidth=t.inputWidth||this.viewportWidth;this.inputHeight=t.inputHeight||this.viewportHeight;this.inputDst=new n({dst:this.outputDst,x:this.inputX,y:this.inputY,width:this.inputWidth,height:this.inputHeight,palette:this.palette});this.deltaDraw=false;this.backgroundAttr=t.backgroundAttr||{bgColor:"default"};this.on("key",this.onKey);this.on("click",this.onClick);this.on("drag",this.onDrag);this.on("wheel",this.onWheel);this.initChildren();if(this.elementType==="Container"&&!t.noDraw){this.draw()}}e.exports=s;i.inherit(s);s.prototype.isContainer=true;s.prototype.containerBorderSize=0;const o=t("../termkit.js");s.prototype.keyBindings={UP:"tinyScrollUp",DOWN:"tinyScrollDown",PAGE_UP:"scrollUp",PAGE_DOWN:"scrollDown"," ":"scrollDown",HOME:"scrollTop",END:"scrollBottom",LEFT:"scrollLeft",RIGHT:"scrollRight"};s.prototype.initChildren=function(){if(this.hasVScrollBar){this.vScrollBarSlider=new o.Slider({internal:true,parent:this,x:this.viewportWidth-1,y:0,height:this.viewportHeight,isVertical:true,valueToRate:t=>-t/Math.max(1,this.inputHeight-this.viewportHeight),rateToValue:t=>-t*Math.max(1,this.inputHeight-this.viewportHeight),noDraw:true});this.vScrollBarSlider.on("slideStep",t=>this.scroll(0,-t*Math.ceil(this.viewportHeight/2)));this.vScrollBarSlider.on("slide",t=>this.scrollTo(null,t))}if(this.hasHScrollBar){this.hScrollBarSlider=new o.Slider({internal:true,parent:this,x:0,y:this.inputWidth-this.containerBorderSize*2-1,width:this.viewportWidth-this.hasVScrollBar,valueToRate:t=>-t/Math.max(1,this.inputWidth-this.viewportWidth),rateToValue:t=>-t*Math.max(1,this.inputWidth-this.viewportWidth),noDraw:true});this.hScrollBarSlider.on("slideStep",t=>this.scroll(-t*Math.ceil(this.viewportWidth/2),0));this.hScrollBarSlider.on("slide",t=>this.scrollTo(t,null))}};s.prototype.resizeViewport=function(t){this.viewportWidth=t.width;this.viewportHeight=t.height};s.prototype.resizeInput=function(e){if(!e.x){e.x=0}if(!e.y){e.y=0}this.inputDst.resize(e);this.inputWidth=this.inputDst.width;this.inputHeight=this.inputDst.height;this.children.forEach(t=>t.emit("parentResize",e))};s.prototype.resize=function(e){if(!e.x){e.x=0}if(!e.y){e.y=0}this.inputDst.resize(e);this.viewportWidth=this.inputWidth=this.inputDst.width;this.viewportHeight=this.inputHeight=this.inputDst.height;this.children.forEach(t=>t.emit("parentResize",e))};s.prototype.move=function(t,e,r=false){return this.moveTo(this.outputX+t,this.outputY+e,r)};s.prototype.moveTo=function(t,e,r=false){this.outputX=t;this.outputY=e;this.viewportX=this.outputX+this.containerBorderSize;this.viewportY=this.outputY+this.containerBorderSize;this.inputDst.x=this.inputX=this.viewportX+this.scrollX;this.inputDst.y=this.inputY=this.viewportY+this.scrollY;if(!r){this.outerDraw()}};s.prototype.scroll=function(t,e,r=false){return this.scrollTo(t?this.scrollX+t:null,e?this.scrollY+e:null,r)};s.prototype.scrollToTop=function(t=false){return this.scrollTo(null,0,t)};s.prototype.scrollToBottom=function(t=false){return this.scrollTo(null,this.viewportHeight-this.inputHeight,t)};s.prototype.scrollTo=function(t,e,r=false){if(!this.scrollable){return}if(t!==undefined&&t!==null){this.scrollX=Math.min(0,Math.max(Math.round(t),this.viewportWidth-this.inputWidth+1));this.inputDst.x=this.inputX=this.viewportX+this.scrollX}if(e!==undefined&&e!==null){this.scrollY=Math.min(0,Math.max(Math.round(e),this.viewportHeight-this.inputHeight));this.inputDst.y=this.inputY=this.viewportY+this.scrollY}if(this.vScrollBarSlider){this.vScrollBarSlider.setValue(this.scrollY,true);this.vScrollBarSlider.setSizeAndPosition({y:-this.scrollY})}if(this.hScrollBarSlider){this.hScrollBarSlider.setValue(this.scrollX,true)}if(!r){this.draw()}};s.prototype.preDrawSelf=function(){this.inputDst.fill({char:" ",attr:this.backgroundAttr})};s.prototype.postDrawSelf=function(){this.inputDst.draw({dst:this.outputDst,delta:this.deltaDraw,inline:this.strictInline,x:this.inputX,y:this.inputY,dstClipRect:{x:this.viewportX,y:this.viewportY,width:this.viewportWidth,height:this.viewportHeight}})};s.prototype.drawSelfCursor=function(t){if(t){this.restoreCursor()}else{this.inputDst.drawCursor()}};s.prototype.onClick=function(t){if(this.scrollable&&!this.hasFocus){this.document.giveFocusTo(this,"select")}};s.prototype.onWheel=function(t){if(!this.hasFocus){this.document.giveFocusTo(this,"select")}if(this.scrollable){this.scroll(0,-t.yDirection*Math.ceil(this.viewportHeight/5))}};s.prototype.onDrag=function(t){if(!this.movable||!t.dx&&!t.dy){return}this.move(t.dx,t.dy)};const a=s.prototype.userActions;a.tinyScrollUp=function(){this.scroll(0,Math.ceil(this.viewportHeight/5))};a.tinyScrollDown=function(){this.scroll(0,-Math.ceil(this.viewportHeight/5))};a.scrollUp=function(){this.scroll(0,Math.ceil(this.viewportHeight/2))};a.scrollDown=function(){this.scroll(0,-Math.ceil(this.viewportHeight/2))};a.scrollLeft=function(){this.scroll(Math.ceil(this.viewportWidth/2),0)};a.scrollRight=function(){this.scroll(-Math.ceil(this.viewportWidth/2),0)};a.scrollTop=function(){this.scrollToTop()};a.scrollBottom=function(){this.scrollToBottom()}},{"../ScreenBuffer.js":3,"../termkit.js":55,"./Element.js":25}],22:[function(t,e,r){"use strict";const i=t("./Element.js");const n=t("./Container.js");const s=t("seventh");function o(t){t=!t?{}:t.internal?t:Object.create(t);t.internal=true;if(!t.inlineTerm){t.outputX=1;t.outputY=1;t.outputWidth=t.outputDst.width;t.outputHeight=t.outputDst.height}this.strictInlineSupport=!!t.strictInline;this.noInput=!!t.noInput;n.call(this,t);this.parent=null;this.document=this;this.deltaDraw=!this.strictInline;this.id="_document"+"_"+a++;this.eventSource=t.eventSource;this.focusElement=null;this.hoverElement=null;this.clickOutCandidates=new Set;this.motionData={motion:false,xFrom:null,yFrom:null,x:null,y:null,dx:null,dy:null};this.draggingData={dragging:false,xFrom:null,yFrom:null,x:null,y:null,dx:null,dy:null,element:null,localDx:null,localDy:null};this.elements={};this.onEventSourceKey=this.onEventSourceKey.bind(this);this.onEventSourceMouse=this.onEventSourceMouse.bind(this);this.onEventSourceResize=this.onEventSourceResize.bind(this);if(!this.strictInline&&!this.noInput){this.eventSource.grabInput({mouse:"motion"})}this.elementByShortcut={};this.documentClipboards={};this.getSystemClipboard=s.debounceDelay(500,async t=>{if(!this.outputDst.getClipboard){return""}return this.outputDst.getClipboard(t)});this.setSystemClipboard=s.debounceUpdate(async(t,e)=>{if(!this.outputDst.setClipboard){return}await this.outputDst.setClipboard(t,e);await s.resolveTimeout(500)});this.clearSystemClipboard=s.debounceUpdate(async(t,e)=>{if(!this.outputDst.setClipboard){return}await this.outputDst.setClipboard("",e);await s.resolveTimeout(500)});this.eventSource.on("key",this.onEventSourceKey);this.eventSource.on("mouse",this.onEventSourceMouse);this.eventSource.on("resize",this.onEventSourceResize);if(this.elementType==="Document"&&!t.noDraw){this.draw()}}e.exports=o;i.inherit(o,n);o.prototype.destroy=function(t,e=false){if(this.destroyed){return}this.eventSource.off("key",this.onEventSourceKey);this.eventSource.off("mouse",this.onEventSourceMouse);this.eventSource.off("resize",this.onEventSourceResize);i.prototype.destroy.call(this,t,e);this.eventSource=null;this.setSystemClipboard=null;this.getSystemClipboard=null};o.prototype.keyBindings=Object.assign({},n.prototype.keyBindings,{TAB:"focusNext",SHIFT_TAB:"focusPrevious"});var a=0;o.prototype.assignId=function(t,e){if(!e||typeof e!=="string"||e[0]==="_"||this.elements[e]){e="_"+t.elementType+"_"+a++}t.id=e;this.elements[e]=t};o.prototype.unassignId=function(t,e){t.id=null;delete this.elements[e]};o.prototype.giveFocusTo=function(t,e="direct"){if(!(t instanceof i)){throw new TypeError(""+t+" is not an instance of Element.")}if(this.isAncestorOf(t)){return this.giveFocusTo_(t,e)}};o.prototype.giveFocusTo_=function(t,e){var r,i;if(this.focusElement!==t){if(this.focusElement){this.focusElement.hasFocus=false;this.focusElement.emit("focus",false,e,this.focusElement)}this.focusElement=t;this.focusElement.hasFocus=true;this.focusElement.emit("focus",true,e,this.focusElement)}i=!this.focusElement.disabled&&(this.focusElement.listenerCount("focus")||this.focusElement.listenerCount("key"));if(i){r=this.focusElement;while(r){if(r.listenerCount("clickOut")){this.clickOutCandidates.add(r)}r=r.parent}}return i};o.prototype.focusNext=function(){var t,e,r,i;if(!this.focusElement||!this.isAncestorOf(this.focusElement)){r=this}else{r=this.focusElement}if(r===this&&!this.children.length){return}e=r;for(;;){if(r.children.length&&!r.noChildFocus){r=r.children[0];if(!r.hidden){i=this.giveFocusTo_(r,"cycle")}}else if(r.parent){for(;;){t=r.parent.children.indexOf(r);if(t+1=0){r=r.parent.children[t-1];while(r.children.length&&!r.noChildFocus){r=r.children[r.children.length-1]}if(!r.hidden){i=this.giveFocusTo_(r,"backCycle")}}else if(r.parent.parent){r=r.parent;if(!r.hidden){i=this.giveFocusTo_(r,"backCycle")}}else{if(e===r.parent){return}r=r.parent.children[r.parent.children.length-1];while(r.children.length&&!r.noChildFocus){r=r.children[r.children.length-1]}if(!r.hidden){i=this.giveFocusTo_(r,"backCycle")}}}else if(r.children.length){r=r.children[r.children.length-1];while(r.children.length&&!r.noChildFocus){r=r.children[r.children.length-1]}if(!r.hidden){i=this.giveFocusTo_(r,"backCycle")}}else{return}if(e===r||!r.hidden&&i){break}}};o.prototype.onEventSourceKey=function(t,e,r){if(this.focusElement){this.bubblingEvent(this.focusElement,t,e,r)}else{this.defaultKeyHandling(t,e,r)}};o.prototype.bubblingEvent=function(r,i,n,s){if(r!==this){r.emit("key",i,n,s,(t,e)=>{if(!t){if(r.parent){this.bubblingEvent(r.parent,i,n,s)}else{this.defaultKeyHandling(i,n,s)}}})}else{this.defaultKeyHandling(i,n,s)}};o.prototype.defaultKeyHandling=function(t,e,r){switch(this.keyBindings[t]){case"focusNext":this.focusNext();break;case"focusPrevious":this.focusPrevious();break;default:if(this.elementByShortcut[t]&&this.elementByShortcut[t].document===this){this.elementByShortcut[t].emit("shortcut",t,e,r)}else{this.emit("key",t,e,r)}break}};o.prototype.setMetaKeyPrefix=function(t,e){this.eventSource.setMetaKeyPrefix(t,e)};o.prototype.getDocumentClipboard=function(t="content"){return this.documentClipboards[t]};o.prototype.setDocumentClipboard=function(t,e="content"){this.documentClipboards[e]=""+t};o.prototype.clearDocumentClipboard=function(t,e="content"){delete this.documentClipboards[e]};o.prototype.createShortcuts=function(e,...t){if(e.document!==this){return}t.forEach(t=>this.elementByShortcut[t]=e)};o.prototype.removeElementShortcuts=function(e){for(let t in this.elementByShortcut){if(this.elementByShortcut[t]===e){this.elementByShortcut[t]=null}}};o.prototype.onEventSourceMouse=function(t,e){var r;switch(t){case"MOUSE_LEFT_BUTTON_PRESSED":this.mouseClick(e);break;case"MOUSE_MOTION":this.mouseMotion(e);break;case"MOUSE_DRAG":this.mouseDrag(e);break;case"MOUSE_RIGHT_BUTTON_PRESSED":this.mouseClick(e,"rightClick");break;case"MOUSE_MIDDLE_BUTTON_PRESSED":this.mouseClick(e,"middleClick");break;case"MOUSE_WHEEL_UP":e.yDirection=-1;this.mouseWheel(e);break;case"MOUSE_WHEEL_DOWN":e.yDirection=1;this.mouseWheel(e);break;case"MOUSE_LEFT_BUTTON_RELEASED":if(this.draggingData.dragging){this.mouseDragEnd(e)}break}};const u=t=>t.listenerCount("click")||t.listenerCount("clickOut")||t.listenerCount("rightClick")||t.listenerCount("middleClick")||t.listenerCount("dragStart")||t.listenerCount("drag")||t.listenerCount("dragEnd")||t.listenerCount("hover")||t.listenerCount("leave")||t.listenerCount("enter");o.prototype.mouseClick=function(t,e="click"){var r=this.childrenAt(t.x-this.outputX,t.y-this.outputY,u);if(!r.length){if(this.clickOutCandidates.size){for(let t of this.clickOutCandidates){if(t.document===this){t.emit("clickOut")}}this.clickOutCandidates.clear()}return}if(this.clickOutCandidates.size){for(let t of this.clickOutCandidates){if(t.document===this&&t!==r[0].element&&!t.isAncestorOf(r[0].element)){t.emit("clickOut")}}this.clickOutCandidates.clear()}r[0].element.emit(e,{x:r[0].x,y:r[0].y},r[0].element)};o.prototype.mouseMotion=function(t,e=null){var r=false;if(!this.motionData.motion){r=true;this.mouseMotionStart(t)}this.motionData.dx=t.x-this.motionData.x;this.motionData.dy=t.y-this.motionData.y;this.motionData.x=t.x;this.motionData.y=t.y;if(!r&&!this.motionData.dx&&!this.motionData.dy){return}var i=this.childrenAt(t.x-this.outputX,t.y-this.outputY,u);if(!i.length){if(this.hoverElement){this.hoverElement.emit("leave");this.hoverElement=null}return}if(i[0]!==e){i[0].element.emit("hover",{x:i[0].x,y:i[0].y},i[0].element)}i.forEach(t=>{if(t.element.listenerCount("clickOut")){this.clickOutCandidates.add(t.element)}});if(i[0].element!==this.hoverElement){if(this.hoverElement){this.hoverElement.emit("leave")}this.hoverElement=i[0].element;this.hoverElement.emit("enter")}};o.prototype.mouseMotionStart=function(t){var e;this.motionData.motion=true;this.motionData.xFrom=t.xFrom;this.motionData.yFrom=t.yFrom;this.motionData.x=t.xFrom;this.motionData.y=t.yFrom};o.prototype.mouseMotionEnd=function(){this.motionData.motion=false};o.prototype.mouseDrag=function(r){var t=false;if(!this.draggingData.dragging){t=true;this.mouseDragStart(r)}this.draggingData.dx=r.x-this.draggingData.x;this.draggingData.dy=r.y-this.draggingData.y;this.draggingData.x=r.x;this.draggingData.y=r.y;if(!t&&!this.draggingData.dx&&!this.draggingData.dy){return}if(this.draggingData.element){let e=true;if(!this.draggingData.element.outerDrag){let t=this.childrenAt(r.x-this.outputX,r.y-this.outputY,u);e=t.some(t=>t.element===this.draggingData.element)}if(e){this.draggingData.element.emit("drag",{xFrom:this.draggingData.xFrom+this.draggingData.localDx,yFrom:this.draggingData.yFrom+this.draggingData.localDy,x:r.x+this.draggingData.localDx,y:r.y+this.draggingData.localDy,dx:this.draggingData.dx,dy:this.draggingData.dy},this.draggingData.element)}}this.mouseMotion(r,this.draggingData.element)};o.prototype.mouseDragStart=function(t){var e;this.draggingData.dragging=true;this.draggingData.xFrom=t.xFrom;this.draggingData.yFrom=t.yFrom;this.draggingData.x=t.xFrom;this.draggingData.y=t.yFrom;e=this.childrenAt(t.xFrom-this.outputX,t.yFrom-this.outputY,u);if(!e.length){this.draggingData.element=null;this.draggingData.localDx=null;this.draggingData.localDy=null;if(this.hoverElement){this.hoverElement.emit("leave");this.hoverElement=null}return}this.draggingData.element=e[0].element;this.draggingData.localDx=e[0].x-t.xFrom;this.draggingData.localDy=e[0].y-t.yFrom;e[0].element.emit("dragStart",{x:e[0].x,y:e[0].y},e[0].element)};o.prototype.mouseDragEnd=function(t){if(this.draggingData.element){this.draggingData.element.emit("dragEnd",{xFrom:this.draggingData.xFrom+this.draggingData.localDx,yFrom:this.draggingData.yFrom+this.draggingData.localDy,x:this.draggingData.x+this.draggingData.localDx,y:this.draggingData.y+this.draggingData.localDy},this.draggingData.element)}this.draggingData.dragging=false};o.prototype.mouseWheel=function(t){var e=this.childrenAt(t.x-this.outputX,t.y-this.outputY,t=>t.listenerCount("wheel"));if(!e.length){return}e[0].element.emit("wheel",{x:e[0].x,y:e[0].y,yDirection:t.yDirection},e[0].element)};o.prototype.onEventSourceResize=function(t,e){if(this.inlineTerm){return}this.resize({x:0,y:0,width:t,height:e});this.outputWidth=t;this.outputHeight=e;this.draw()}},{"./Container.js":21,"./Element.js":25,seventh:113}],23:[function(t,e,r){"use strict";const i=t("./Element.js");const n=t("./ToggleButton.js");const s=t("./RowMenu.js");const l=t("./ColumnMenuMixed.js");function o(t){t=!t?{}:t.internal?t:Object.create(t);t.internal=true;var e,r;if(t.value&&typeof t.value==="object"){this.setValue(t.value,true)}else{this.value={}}s.call(this,t);this.initPage();this.columnMenu=null;this.columnButtonBlurAttr=t.buttonBlurAttr||{bgColor:"gray",color:"white",bold:true};this.columnButtonFocusAttr=t.buttonFocusAttr||{bgColor:"blue",color:"white",bold:true};this.columnButtonTurnedOnBlurAttr=t.buttonTurnedOnBlurAttr||{bgColor:"gray",color:"white",bold:true};this.columnButtonTurnedOnFocusAttr=t.buttonTurnedOnFocusAttr||{bgColor:"blue",color:"white",bold:true};this.columnButtonTurnedOffBlurAttr=t.buttonTurnedOffBlurAttr||{bgColor:"gray",color:"white",dim:true};this.columnButtonTurnedOffFocusAttr=t.buttonTurnedOffFocusAttr||{bgColor:"blue",color:"white",dim:true};this.clearColumnMenuOnSubmit=!!t.clearColumnMenuOnSubmit;this.lastFocusButton=null;this.onClickOut=this.onClickOut.bind(this);this.onColumnMenuSubmit=this.onColumnMenuSubmit.bind(this);this.on("clickOut",this.onClickOut);if(this.elementType==="DropDownMenu"&&!t.noDraw){this.draw()}}e.exports=o;i.inherit(o,s);o.prototype.keyBindings={LEFT:"previous",RIGHT:"next",ESCAPE:"clearColumnMenu",UP:"clearColumnMenu",DOWN:"dropDown",ENTER:"submit",KP_ENTER:"submit",ALT_ENTER:"submit"};o.prototype.dropDown=function(t,e,r,i,n,s){var o=this.itemsDef[t].items;if(this.columnMenu){if(this.columnMenu.index===t){return}this.clearColumnMenu()}if(!o||!o.length){if(i&&this.itemsDef[t].topSubmit){this.emit("submit",i,n,this,s)}return}var a=o.some(t=>t.type==="toggle");var u={internal:true,parent:this.children[t],x:e,y:r,width:this.outputWidth-e,leftPadding:" ",rightPadding:" ",items:o,value:this.value,buttonFocusAttr:this.columnButtonFocusAttr,buttonBlurAttr:this.columnButtonBlurAttr,buttonTurnedOnBlurAttr:this.columnButtonTurnedOnBlurAttr,buttonTurnedOnFocusAttr:this.columnButtonTurnedOnFocusAttr,buttonTurnedOffBlurAttr:this.columnButtonTurnedOffBlurAttr,buttonTurnedOffFocusAttr:this.columnButtonTurnedOffFocusAttr};if(a){u.leftPadding=" ";u.turnedOnLeftPadding=" ☑ ";u.turnedOffLeftPadding=" ☐ "}this.columnMenu=new l(u);this.columnMenu.on("submit",this.onColumnMenuSubmit)};o.prototype.clearColumnMenu=function(t=false){if(!this.columnMenu){return false}this.columnMenu.destroy();this.columnMenu=null;if(t&&this.lastFocusButton){this.document.giveFocusTo(this.lastFocusButton,"clear")}return true};o.prototype.setValue=function(e,t){if(!e||typeof e!=="object"){return}this.value={};for(let t in e){this.value[t]=!!e[t]}if(this.columnMenu){this.columnMenu.setValue(e,t)}};o.prototype.setKeyValue=function(t,e,r){if(!t){return}this.value[t]=!!e;if(this.columnMenu){this.columnMenu.setKeyValue(t,e,r)}};o.prototype.setDropDownItem=function(e,r,t){var i=this.itemsDef.find(t=>t.value===e);if(!i){return false}var n=i.items&&i.items.find(t=>t.value===r);if(!n){return false}this.clearColumnMenu();Object.assign(n,t);return true};o.prototype.onClickOut=function(t,e,r){this.clearColumnMenu()};o.prototype.onButtonSubmit=function(t,e,r){this.dropDown(r.childId,r.outputX,r.outputY+1,t,e,r)};o.prototype.onButtonFocus=function(t,e,r){this.lastFocusButton=r;if(t&&e!=="clear"){this.dropDown(r.childId,r.outputX,r.outputY+1)}};o.prototype.onColumnMenuSubmit=function(t,e,r,i){if(i instanceof n){if(i.key){this.value[i.key]=i.value}if(this.clearColumnMenuOnSubmit){setTimeout(()=>this.clearColumnMenu(true),400)}}else{r.once("blinked",(t,e,r,i)=>{if(this.clearColumnMenuOnSubmit){this.clearColumnMenu(true)}this.emit("blinked",t,e,this,i)})}this.emit("submit",t,e,this,i)};const a=o.prototype.userActions;a.previous=function(){this.focusChild=this.focusPreviousChild()};a.next=function(){this.focusChild=this.focusNextChild()};a.dropDown=function(){if(this.columnMenu){this.columnMenu.focusNextChild()}else if(this.lastFocusButton){this.dropDown(this.lastFocusButton.childId,this.lastFocusButton.outputX,this.lastFocusButton.outputY+1)}};a.clearColumnMenu=function(){return this.clearColumnMenu(true)}},{"./ColumnMenuMixed.js":19,"./Element.js":25,"./RowMenu.js":32,"./ToggleButton.js":39}],24:[function(t,e,r){"use strict";const i=t("./Element.js");const n=t("./TextBox.js");const s=t("string-kit");function o(t){t=!t?{}:t.internal?t:Object.create(t);t.internal=true;if(t.value){t.content=t.value}n.call(this,t);this.onFocus=this.onFocus.bind(this);this.onDragEnd=this.onDragEnd.bind(this);this.onMiddleClick=this.onMiddleClick.bind(this);this.newLineAutoIndentHook=t.newLineAutoIndentHook??null;if(t.keyBindings){this.keyBindings=t.keyBindings}this.extraScrolling=t.extraScrolling!==undefined?!!t.extraScrolling:true;this.updateStatus();this.on("focus",this.onFocus);this.on("dragEnd",this.onDragEnd);this.on("middleClick",this.onMiddleClick);if(this.setContent===o.prototype.setContent){this.setContent(t.content,t.contentHasMarkup,true)}if(this.elementType==="EditableTextBox"&&!t.noDraw){this.draw()}}e.exports=o;i.inherit(o,n);o.prototype.needInput=true;o.prototype.keyBindings={CTRL_K:"meta",ENTER:"newLine",KP_ENTER:"newLine",BACKSPACE:"backDelete",DELETE:"delete",CTRL_DELETE:"deleteLine",LEFT:"backward",RIGHT:"forward",CTRL_LEFT:"startOfWord",CTRL_RIGHT:"endOfWord",UP:"up",DOWN:"down",HOME:"startOfLine",END:"endOfLine",TAB:"tab",PAGE_UP:"scrollUp",PAGE_DOWN:"scrollDown",META_HOME:"scrollToCursor",CTRL_B:"startOfSelection",CTRL_E:"endOfSelection",SHIFT_LEFT:"expandSelectionBackward",SHIFT_RIGHT:"expandSelectionForward",SHIFT_UP:"expandSelectionUp",SHIFT_DOWN:"expandSelectionDown",CTRL_SHIFT_LEFT:"expandSelectionStartOfWord",CTRL_SHIFT_RIGHT:"expandSelectionEndOfWord",CTRL_T:"moveSelection",ALT_T:"copyToDocumentClipboard",META_T:"copyToSystemClipboard",CTRL_P:"pasteSelection",ALT_P:"pasteDocumentClipboard",META_P:"pasteSystemClipboard",CTRL_D:"deleteSelection",ALT_D:"clearDocumentClipboard",META_D:"clearSystemClipboard"};o.prototype.insert=function(t,e=false,r=false){let i=this.textBuffer.cx,n=this.textBuffer.cy;let s=this.textBuffer.insert(t,this.textAttr);if(!r){if(this.stateMachine){this.textBuffer.runStateMachine()}if(e){this.textBuffer.setSelectionRegion({xmin:i,ymin:n,xmax:this.textBuffer.cx,ymax:this.textBuffer.cy})}this.autoScrollAndDraw()}else if(e){this.textBuffer.setSelectionRegion({xmin:i,ymin:n,xmax:this.textBuffer.cx,ymax:this.textBuffer.cy})}this.emit("change",{type:"insert",insertedString:t,count:s,internal:r,startPosition:{x:i,y:n},endPosition:{x:this.textBuffer.cx,y:this.textBuffer.cy}})};o.prototype.deleteSelection=function(t=false){if(!this.textBuffer.selectionRegion){return}var{xmin:e,xmax:r,ymin:i,ymax:n}=this.textBuffer.selectionRegion;var s=this.textBuffer.deleteSelection(true);if(s&&s.count){if(!t){this.textBuffer.cx=e;this.textBuffer.cy=i;if(this.stateMachine){this.textBuffer.runStateMachine()}this.autoScrollAndDraw()}this.emit("change",{type:"delete",count:s.count,internal:t,deletedString:s.string,startPosition:{x:e,y:i},endPosition:{x:e,y:i}})}};o.prototype.deleteRegion=function(t,e=false){var{xmin:r,xmax:i,ymin:n,ymax:s}=t;var o=this.textBuffer.deleteRegion(t,true);if(o&&o.count){if(!e){this.textBuffer.cx=r;this.textBuffer.cy=n;if(this.stateMachine){this.textBuffer.runStateMachine()}this.autoScrollAndDraw()}this.emit("change",{type:"delete",count:o.count,internal:e,deletedString:o.string,startPosition:{x:r,y:n},endPosition:{x:r,y:n}})}};o.prototype.drawSelfCursor=function(){this.textBuffer.drawCursor()};o.prototype.getValue=n.prototype.getContent;o.prototype.setValue=function(t,e){return this.setContent(t,false,e)};o.prototype.onFocus=function(t,e){this.updateStatus();this.draw()};o.prototype.onClick=function(t){if(this.hasFocus){this.textBuffer.moveTo(t.x-this.scrollX,t.y-this.scrollY);if(this.textBuffer.selectionRegion){this.textBuffer.resetSelectionRegion();this.draw()}else{this.drawCursor()}}else{this.document.giveFocusTo(this,"select")}};o.prototype.onDragEnd=function(t){if(this.hasFocus){if(t.yFrom{if(t){this.textBuffer.insert(t,this.textAttr);if(this.stateMachine){this.textBuffer.runStateMachine()}this.autoScrollAndDraw()}}).catch(()=>undefined)}};o.prototype.updateStatus=function(){};const a=o.prototype.userActions;a.character=function(t){var e=this.textBuffer.cx,r=this.textBuffer.cy;var i=this.textBuffer.insert(t,this.textAttr);if(this.stateMachine){this.textBuffer.runStateMachine()}this.autoScrollAndDraw();this.emit("change",{type:"insert",insertedString:t,count:i,internal:false,startPosition:{x:e,y:r},endPosition:{x:this.textBuffer.cx,y:this.textBuffer.cy}})};a.newLine=function(){var e="\n",r=1,t=this.textBuffer.cx,i=this.textBuffer.cy;this.textBuffer.newLine();if(this.newLineAutoIndentHook){let t=this.newLineAutoIndentHook();if(t){r+=this.textBuffer.insert(t);e+=t}}if(this.stateMachine){this.textBuffer.runStateMachine()}this.autoScrollAndDraw();this.emit("change",{type:"insert",insertedString:e,count:r,internal:false,startPosition:{x:t,y:i},endPosition:{x:this.textBuffer.cx,y:this.textBuffer.cy}})};a.tab=function(){var t=this.textBuffer.cx,e=this.textBuffer.cy;this.textBuffer.insert("\t",this.textAttr);if(this.stateMachine){this.textBuffer.runStateMachine()}this.autoScrollAndDraw();this.emit("change",{type:"insert",insertedString:"\t",count:1,internal:false,startPosition:{x:t,y:e},endPosition:{x:this.textBuffer.cx,y:this.textBuffer.cy}})};a.delete=function(){var t=this.textBuffer.cx,e=this.textBuffer.cy,r=this.textBuffer.selectionRegion;if(r&&r.ymin===e&&r.xmin===t){this.deleteSelection();return}var i=this.textBuffer.delete(1,true);if(this.stateMachine){this.textBuffer.runStateMachine()}this.autoScrollAndDraw();if(i&&i.count){this.emit("change",{type:"delete",count:i.count,internal:false,deletedString:i.string,startPosition:{x:t,y:e},endPosition:{x:this.textBuffer.cx,y:this.textBuffer.cy}})}};a.backDelete=function(){var t=this.textBuffer.cx,e=this.textBuffer.cy,r=this.textBuffer.selectionRegion;if(r){let t=this.textBuffer.oneStepBackward();if(r.ymax===t.y&&r.xmax===t.x){this.deleteSelection();return}}var i=this.textBuffer.backDelete(1,true);if(this.stateMachine){this.textBuffer.runStateMachine()}this.autoScrollAndDraw();if(i&&i.count){this.emit("change",{type:"backDelete",count:i.count,internal:false,deletedString:i.string,startPosition:{x:t,y:e},endPosition:{x:this.textBuffer.cx,y:this.textBuffer.cy}})}};a.deleteLine=function(){var t=this.textBuffer.cy;var e=this.textBuffer.deleteLine(true);if(this.stateMachine){this.textBuffer.runStateMachine()}this.autoScrollAndDraw();if(e&&e.count){this.emit("change",{type:"delete",count:e.count,internal:false,deletedString:e.string,startPosition:{x:0,y:t},endPosition:{x:0,y:this.textBuffer.cy}})}};a.backward=function(){this.textBuffer.moveBackward();this.autoScrollAndSmartDraw();this.emit("cursorMove")};a.forward=function(){this.textBuffer.moveForward();this.autoScrollAndSmartDraw();this.emit("cursorMove")};a.startOfWord=function(){this.textBuffer.moveToStartOfWord();this.autoScrollAndSmartDraw();this.emit("cursorMove")};a.endOfWord=function(){this.textBuffer.moveToEndOfWord();this.autoScrollAndSmartDraw();this.emit("cursorMove")};a.startOfLine=function(){this.textBuffer.moveToColumn(0);this.autoScrollAndSmartDraw();this.emit("cursorMove")};a.smartStartOfLine=function(){if(this.textBuffer.cx!==0){this.textBuffer.moveToColumn(0)}else{let i=this.textBuffer.cy;this.textBuffer.moveForward((t,e,r)=>r!==i||t!==" "&&t!=="\t");if(this.textBuffer.cy!==i){this.textBuffer.moveTo(0,i)}}this.autoScrollAndSmartDraw();this.emit("cursorMove")};a.endOfLine=function(){this.textBuffer.moveToEndOfLine();this.autoScrollAndSmartDraw();this.emit("cursorMove")};a.down=function(){this.textBuffer.moveDown();this.autoScrollAndSmartDraw();this.emit("cursorMove")};a.up=function(){this.textBuffer.moveUp();this.autoScrollAndSmartDraw();this.emit("cursorMove")};a.left=function(){this.textBuffer.moveLeft();this.autoScrollAndSmartDraw();this.emit("cursorMove")};a.right=function(){this.textBuffer.moveRight();this.autoScrollAndSmartDraw();this.emit("cursorMove")};a.scrollUp=function(){var t=Math.ceil(this.outputHeight/2);this.textBuffer.move(0,-t);this.scroll(0,t,true);this.autoScrollAndDraw();this.emit("cursorMove")};a.scrollDown=function(){var t=-Math.ceil(this.outputHeight/2);this.textBuffer.move(0,-t);this.scroll(0,t,true);this.autoScrollAndDraw();this.emit("cursorMove")};a.scrollTop=function(){this.textBuffer.moveTo(0,0);this.scrollTo(0,0);this.emit("cursorMove")};a.scrollBottom=function(){this.textBuffer.moveTo(0,this.textBuffer.buffer.length-1);this.autoScrollAndSmartDraw();this.emit("cursorMove")};a.scrollToCursor=function(){this.autoScrollAndDraw()};a.expandSelectionBackward=function(){var t=this.textBuffer.selectionRegion,e=this.textBuffer.cx,r=this.textBuffer.cy,i=this.textBuffer.oneStepBackward();if(t&&t.xmin===e&&t.ymin===r){this.textBuffer.moveBackward();this.textBuffer.startOfSelection()}else if(t&&t.xmax===i.x&&t.ymax===i.y){this.textBuffer.moveBackward();this.textBuffer.endOfSelection()}else{this.textBuffer.endOfSelection();this.textBuffer.moveBackward();this.textBuffer.startOfSelection()}this.autoScrollAndDraw();this.emit("cursorMove")};a.expandSelectionStartOfWord=function(){var t=this.textBuffer.selectionRegion,e=this.textBuffer.cx,r=this.textBuffer.cy,i=this.textBuffer.oneStepBackward();if(t&&t.xmin===e&&t.ymin===r){this.textBuffer.moveToStartOfWord();this.textBuffer.startOfSelection()}else if(t&&t.xmax===i.x&&t.ymax===i.y){this.textBuffer.moveToStartOfWord();this.textBuffer.endOfSelection()}else{this.textBuffer.endOfSelection();this.textBuffer.moveToStartOfWord();this.textBuffer.startOfSelection()}this.autoScrollAndDraw();this.emit("cursorMove")};a.expandSelectionUp=function(){var t=this.textBuffer.selectionRegion,e=this.textBuffer.cx,r=this.textBuffer.cy,i=this.textBuffer.oneStepBackward();if(t&&t.xmin===e&&t.ymin===r){this.textBuffer.moveUp();this.textBuffer.startOfSelection()}else if(t&&t.xmax===i.x&&t.ymax===i.y&&(t.yminr+1||t.ymax===r+1&&t.xmax>=e-1)){this.textBuffer.moveDown();this.textBuffer.startOfSelection()}else{this.textBuffer.startOfSelection();this.textBuffer.moveDown();this.textBuffer.endOfSelection()}this.autoScrollAndDraw();this.emit("cursorMove")};a.startOfSelection=function(){this.textBuffer.startOfSelection();this.draw()};a.endOfSelection=function(){this.textBuffer.endOfSelection();this.draw()};a.moveSelection=function(){var t=this.textBuffer.getSelectionText();if(!t){return}this.deleteSelection(true);this.insert(t,true)};a.pasteSelection=function(){var t=this.textBuffer.getSelectionText();if(t){this.insert(t)}};a.pasteDocumentClipboard=function(){if(this.document){let t=this.document.getDocumentClipboard();if(t&&typeof t==="string"){this.insert(t)}}};a.pasteSystemClipboard=function(){if(this.document){this.document.getSystemClipboard().then(t=>{if(t&&typeof t==="string"){this.insert(t)}}).catch(()=>undefined)}};a.deleteSelection=function(){this.deleteSelection()};a.clearDocumentClipboard=function(){if(this.document){this.document.clearDocumentClipboard(this.textBuffer.getSelectionText())}};a.clearSystemClipboard=function(){if(this.document){this.document.clearSystemClipboard(this.textBuffer.getSelectionText()).catch(()=>undefined)}}},{"./Element.js":25,"./TextBox.js":37,"string-kit":127}],25:[function(t,e,r){"use strict";const n=t("../misc.js");const s=t("string-kit");const i=t("nextgen-events");var o=0;function a(t={}){this.setInterruptible(true);this.uid=o++;this.parent=t.parent&&t.parent.elementType?t.parent:null;this.document=null;this.destroyed=false;this.onKey=this.onKey.bind(this);this.inlineTerm=t.inlineTerm||null;this.strictInline=!!(this.inlineTerm&&this.strictInlineSupport&&(t.strictInline||t.strictInline===undefined));this.restoreCursorAfterDraw=!!(this.inlineTerm&&this.inlineCursorRestoreAfterDraw&&!this.strictInline);this.outputDst=t.outputDst||t.parent&&t.parent.inputDst,this.inputDst=null;this.label=t.label||"";this.key=t.key||null;if(this.value===undefined){this.value=t.value===undefined?null:t.value}this.childId=t.childId===undefined?null:t.childId;this.def=t.def||null;this.hidden=!!t.hidden;this.disabled=!!t.disabled;this.content=this.content??"";this.contentHasMarkup=this.contentHasMarkup??false;this.contentWidth=this.contentWidth??0;if(this.setContent===a.prototype.setContent){this.setContent(t.content||"",t.contentHasMarkup,true,true)}this.meta=t.meta;this.autoWidth=+t.autoWidth||0;this.autoHeight=+t.autoHeight||0;this.outputX=t.outputX||t.x||0;this.outputY=t.outputY||t.y||0;this.savedZIndex=this.zIndex=t.zIndex||t.z||0;this.interceptTempZIndex=!!t.interceptTempZIndex;this.outputWidth=this.autoWidth&&this.outputDst?Math.round(this.outputDst.width*this.autoWidth):t.outputWidth?t.outputWidth:t.width?t.width:this.strictInline?this.inlineTerm.width:1;this.outputHeight=this.autoHeight&&this.outputDst?Math.round(this.outputDst.height*this.autoHeight):t.outputHeight?t.outputHeight:t.height?t.height:this.strictInline?this.inlineTerm.height:1;this.needOuterDraw=false;this.savedCursorX=0;this.savedCursorY=0;this.hasFocus=false;this.children=[];this.zChildren=[];this.inputDst=this.outputDst;this.inputX=this.outputX;this.inputY=this.outputY;this.inputWidth=this.outputWidth;this.inputHeight=this.outputHeight;if(this.parent){this.parent.attach(this,t.id)}if(t.shortcuts&&this.document){if(Array.isArray(t.shortcuts)){this.document.createShortcuts(this,...t.shortcuts)}else{this.document.createShortcuts(this,t.shortcuts)}}}e.exports=a;a.prototype=Object.create(i.prototype);a.prototype.constructor=a;a.prototype.elementType="Element";const u=t("../termkit.js");a.prototype.destroy=function(t=false,e=false){if(this.destroyed){return}var r,i,n=this.document;for(r=0,i=this.children.length;r=0){r.children.splice(e,1)}e=r.zChildren.indexOf(this);if(e>=0){r.zChildren.splice(e,1)}delete this.document.elements[this.id];this.parent=null;this.recursiveFixAttachment(null);if(!t){r.document.draw()}return this};a.prototype.resizeToContent=function(){this.outputWidth=this.contentWidth;this.outputHeight=this.contentHeight};a.prototype.zSort=function(){this.zChildren.sort((t,e)=>t.zIndex-e.zIndex)};a.prototype.zInsert=function(t){var e,r=this.zChildren.length;while(r--){e=this.zChildren[r];if(t.zIndex>=e.zIndex){this.zChildren[r+1]=t;return}this.zChildren[r+1]=e}this.zChildren[0]=t};a.prototype.updateZ=a.prototype.updateZIndex=function(t){this.savedZIndex=this.zIndex=t;this.parent.zSort()};a.prototype.topZ=function(){if(this.parent.interceptTempZIndex){return this.parent.topZ()}if(!this.parent.zChildren.length){return}this.zIndex=this.parent.zChildren[this.parent.zChildren.length-1].zIndex+1;this.parent.zSort()};a.prototype.bottomZ=function(){if(this.parent.interceptTempZIndex){return this.parent.bottomZ()}if(!this.parent.zChildren.length){return}this.zIndex=this.parent.zChildren[0].zIndex-1;this.parent.zSort()};a.prototype.restoreZ=function(){if(this.parent.interceptTempZIndex){return this.parent.restoreZ()}this.zIndex=this.savedZIndex;this.parent.zSort()};a.computeContentWidth=(t,e)=>{if(Array.isArray(t)){return e==="ansi"||e==="legacyAnsi"?Math.max(...t.map(t=>n.ansiWidth(t))):e?Math.max(...t.map(t=>n.markupWidth(t))):Math.max(...t.map(t=>s.unicode.width(t)))}return e==="ansi"||e==="legacyAnsi"?n.ansiWidth(t):e?n.markupWidth(t):s.unicode.width(t)};var l=0;a.getLastTruncateWidth=()=>l;a.truncateContent=(t,e,r)=>{var i;if(r==="ansi"||r==="legacyAnsi"){i=n.truncateAnsiString(t,e);l=n.getLastTruncateWidth()}else if(r){i=n.truncateMarkupString(t,e);l=n.getLastTruncateWidth()}else{i=s.unicode.truncateWidth(t,e);l=s.unicode.getLastTruncateWidth()}return i};a.wordwrapContent=a.wordWrapContent=(t,e,r)=>r==="ansi"||r==="legacyAnsi"?n.wordWrapAnsi(t,e):r?n.wordWrapMarkup(t,e):s.wordwrap(t,{width:e,fill:true,noJoin:true});a.prototype.setContent=function(t,e,r=false,i=false){if(this.forceContentArray&&!Array.isArray(t)){t=[t||""]}this.content=t;this.contentHasMarkup=e;var n=this.contentWidth;this.contentWidth=a.computeContentWidth(t,this.contentHasMarkup);if(!i&&this.resizeOnContent){this.resizeOnContent()}if(!r){if(this.contentWidth!==n&&(this.contentWidth>this.outputWidth||this.resizeOnContent)){this.outerDraw()}else{this.draw()}}};a.prototype.isAncestorOf=function(t){var e=t;for(;;){if(e===this){return true}else if(!e.parent){return false}else if(e.parent.children.indexOf(e)===-1){e.parent=null;return false}e=e.parent}};a.prototype.getParentContainer=function(){var t=this;for(;;){if(!t.parent){return null}if(t.parent.isContainer){return t.parent}t=t.parent}};a.prototype.getFocusBranchIndex=function(){var t,e;if(!this.document.focusElement){return null}e=this.document.focusElement;for(;;){if(e===this){return null}else if(!e.parent){return null}if(e.parent===this){t=e.parent.children.indexOf(e);if(t===-1){e.parent=null;return null}return t}e=e.parent}};a.prototype.focusNextChild=function(t=true,e="cycle"){var r,i,n;if(!this.children.length||!this.document){return null}if(!this.document.focusElement||(r=this.getFocusBranchIndex())===null){r=this.children.length-1}i=r;for(;;){r++;if(r>=this.children.length){if(t){r=0}else{r=this.children.length-1;break}}n=this.document.giveFocusTo_(this.children[r],e);if(n||i===r){break}}return this.children[r]};a.prototype.focusPreviousChild=function(t=true){var e,r,i;if(!this.children.length||!this.document){return null}if(!this.document.focusElement||(e=this.getFocusBranchIndex())===null){e=0}r=e;for(;;){e--;if(e<0){if(t){e=this.children.length-1}else{e=0;break}}i=this.document.giveFocusTo_(this.children[e],"backCycle");if(i||r===e){break}}return this.children[e]};a.prototype.childrenAt=function(t,e,r=null,i=[]){var n,s;n=this.zChildren.length;while(n--){s=this.zChildren[n];if(s.hidden){continue}if(t>=s.outputX&&t<=s.outputX+s.outputWidth-1&&e>=s.outputY&&e<=s.outputY+s.outputHeight-1){if(s.isContainer){s.childrenAt(t-s.inputX,e-s.inputY,r,i)}else{s.childrenAt(t,e,r,i)}if(!r||r(s)){i.push({element:s,x:t-s.outputX,y:e-s.outputY})}}else if(!s.isContainer){s.childrenAt(t,e,r,i)}}return i};a.prototype.saveCursor=function(){if(this.inputDst){this.savedCursorX=this.inputDst.cx;this.savedCursorY=this.inputDst.cy}else if(this.outputDst){this.savedCursorX=this.outputDst.cx;this.savedCursorY=this.outputDst.cy}return this};a.prototype.restoreCursor=function(){if(this.inputDst){this.inputDst.cx=this.savedCursorX;this.inputDst.cy=this.savedCursorY;this.inputDst.drawCursor()}else if(this.outputDst){this.outputDst.cx=this.savedCursorX;this.outputDst.cy=this.savedCursorY;this.outputDst.drawCursor()}return this};a.prototype.draw=function(t=false){if(!this.document||this.hidden){return this}if(!t){if(this.restoreCursorAfterDraw){this.inlineTerm.saveCursor()}else if(!this.strictInline){this.saveCursor()}}this.descendantDraw();this.ascendantDraw();if(!t){if(this.restoreCursorAfterDraw){this.inlineTerm.restoreCursor()}else if(!this.strictInline){this.drawCursor()}}return this};a.prototype.redraw=a.prototype.outerDraw=function(t=false){if(!this.document||this.hidden&&!t){return this}var e=this.getParentContainer();if(!e){this.draw()}else{e.draw()}return this};a.prototype.updateDraw=function(){if(this.needOuterDraw){this.outerDraw()}else{this.draw()}this.needOuterDraw=false};a.prototype.descendantDraw=function(t){var e,r;if(this.hidden){return this}if(this.preDrawSelf){this.preDrawSelf(!t)}for(e=0,r=this.zChildren.length;e1&&s.inlineNewLine){n.x=1;if(n.y===undefined){n.y=i.y+1}}}if(n.y===undefined){n.y=i.y}}}if(!s.strictInline){let t=n.y+s.outputHeight-e.height;if(t>0){e.scrollUp(t);e.up(t);n.y-=t}}if(s.inlineResizeToContent){s.resizeToContent()}var o={internal:true,inlineTerm:e,strictInline:s.strictInline,noInput:s.strictInline||!s.needInput,outputX:n.x,outputY:n.y,outputWidth:s.outputWidth,outputHeight:s.outputHeight,outputDst:e,eventSource:e,noDraw:true};var a=new u.Document(o);a.attach(s);s.on("resize",()=>{throw new Error("not coded!")});s.draw(true);e.styleReset();if(s.staticInline){s.destroy(undefined,true)}return s};a.prototype.onKey=function(t,e,r){var i=this.keyBindings[t];if(i){if(i==="meta"){if(this.document){this.document.setMetaKeyPrefix("META","CTRL")}return true}else if(this.userActions[i]){return(this.userActions[i].call(this,t,e,r)??true)||undefined}}else if(r&&r.isCharacter){if(this.userActions.character){return(this.userActions.character.call(this,t,e,r)??true)||undefined}}else if(this.userActions.specialKey){return(this.userActions.specialKey.call(this,t,e,r)??true)||undefined}return};a.prototype.isContainer=false;a.prototype.forceContentArray=false;a.prototype.noChildFocus=false;a.prototype.computeBoundingBoxes=null;a.prototype.resizeOnContent=null;a.prototype.preDrawSelf=null;a.prototype.postDrawSelf=null;a.prototype.drawSelfCursor=null;a.prototype.getValue=()=>null;a.prototype.setValue=()=>undefined;a.prototype.strictInlineSupport=false;a.prototype.staticInline=false;a.prototype.inlineCursorRestoreAfterDraw=false;a.prototype.needInput=false;a.prototype.outerDrag=false;a.prototype.keyBindings={};a.prototype.userActions={}},{"../misc.js":47,"../termkit.js":55,"nextgen-events":77,"string-kit":127}],26:[function(i,n,t){(function(r){(function(){"use strict";const o=i("./Element.js");const a=i("./LabeledInput.js");const u=i("./Button.js");function t(t){t=!t?{}:t.internal?t:Object.create(t);t.internal=true;if(!t.outputWidth&&!t.width){t.outputWidth=78}o.call(this,t);this.submitValue=null;this.inputsDef=t.inputs||[];this.labeledInputs=[];this.buttonsDef=t.buttons||[];this.buttons=[];this.focusChild=null;this.onButtonSubmit=this.onButtonSubmit.bind(this);this.onFocus=this.onFocus.bind(this);this.textAttr=t.textAttr||null;this.voidAttr=t.voidAttr||t.emptyAttr||null;this.labelFocusAttr=t.labelFocusAttr||null;this.labelBlurAttr=t.labelBlurAttr||null;this.buttonFocusAttr=t.buttonFocusAttr||null;this.buttonBlurAttr=t.buttonBlurAttr||null;this.turnedOnBlurAttr=t.turnedOnBlurAttr||null;this.turnedOnFocusAttr=t.turnedOnFocusAttr||null;this.turnedOffBlurAttr=t.turnedOffBlurAttr||null;this.turnedOffFocusAttr=t.turnedOffFocusAttr||null;if(t.keyBindings){this.keyBindings=t.keyBindings}if(t.textInputKeyBindings){this.textInputKeyBindings=t.textInputKeyBindings}this.initChildren();this.on("key",this.onKey);this.on("focus",this.onFocus);if(this.elementType==="Form"&&!t.noDraw){this.draw()}}n.exports=t;o.inherit(t);t.prototype.needInput=true;t.prototype.keyBindings={LEFT:"previous",RIGHT:"next",UP:"previous",DOWN:"next",ENTER:"next",KP_ENTER:"next",ALT_ENTER:"next"};t.prototype.textInputKeyBindings={};t.prototype.selectInputKeyBindings={};t.prototype.selectMultiInputKeyBindings={};t.prototype.initChildren=function(){var n=0,r=0,s=0,e=0,i=0;this.inputsDef.forEach(t=>{t.labelWidth=o.computeContentWidth(t.label,t.labelHasMarkup);if(t.labelWidth>n){n=t.labelWidth}});this.inputsDef.forEach((t,e)=>{var r=1,i=t.label+" ".repeat(n-t.labelWidth);switch(t.type){case"select":this.labeledInputs[e]=new a({internal:true,parent:this,type:t.type,key:t.key,label:i,content:t.content,value:t.value,items:t.items,outputX:this.outputX,outputY:this.outputY+s,outputWidth:t.outputWidth||t.width||this.outputWidth,outputHeight:r,labelFocusAttr:t.labelFocusAttr||this.labelFocusAttr,labelBlurAttr:t.labelBlurAttr||this.labelBlurAttr,buttonBlurAttr:t.buttonBlurAttr||this.buttonBlurAttr,buttonFocusAttr:t.buttonFocusAttr||this.buttonFocusAttr,buttonDisabledAttr:t.buttonDisabledAttr||this.buttonDisabledAttr,buttonSubmittedAttr:t.buttonSubmittedAttr||this.buttonSubmittedAttr,keyBindings:this.selectInputKeyBindings,noDraw:true});break;case"select-multi":case"selectMulti":this.labeledInputs[e]=new a({internal:true,parent:this,type:t.type,key:t.key,label:i,content:t.content,value:t.value,items:t.items,outputX:this.outputX,outputY:this.outputY+s,outputWidth:t.outputWidth||t.width||this.outputWidth,outputHeight:r,labelFocusAttr:t.labelFocusAttr||this.labelFocusAttr,labelBlurAttr:t.labelBlurAttr||this.labelBlurAttr,buttonBlurAttr:t.buttonBlurAttr||this.buttonBlurAttr,buttonFocusAttr:t.buttonFocusAttr||this.buttonFocusAttr,buttonDisabledAttr:t.buttonDisabledAttr||this.buttonDisabledAttr,buttonSubmittedAttr:t.buttonSubmittedAttr||this.buttonSubmittedAttr,turnedOnBlurAttr:t.turnedOnBlurAttr||this.turnedOnBlurAttr,turnedOnFocusAttr:t.turnedOnFocusAttr||this.turnedOnFocusAttr,turnedOffBlurAttr:t.turnedOffBlurAttr||this.turnedOffBlurAttr,turnedOffFocusAttr:t.turnedOffFocusAttr||this.turnedOffFocusAttr,keyBindings:this.selectInputKeyBindings,noDraw:true});break;case"text":default:t.type="text";if(t.height){r=t.height}this.labeledInputs[e]=new a({internal:true,parent:this,type:t.type,key:t.key,label:i,content:t.content,outputX:this.outputX,outputY:this.outputY+s,outputWidth:t.outputWidth||t.width||this.outputWidth,outputHeight:r,lineWrap:!!t.lineWrap,wordWrap:!!t.wordWrap,scrollable:!!t.scrollable,vScrollBar:!!t.vScrollBar,hScrollBar:!!t.hScrollBar,hiddenContent:t.hiddenContent,labelFocusAttr:t.labelFocusAttr||this.labelFocusAttr,labelBlurAttr:t.labelBlurAttr||this.labelBlurAttr,textAttr:t.textAttr||this.textAttr,voidAttr:t.voidAttr||t.emptyAttr||this.voidAttr,keyBindings:this.textInputKeyBindings,allowNewLine:r>1,noDraw:true});break}s+=r});if(!this.buttonsDef.length){this.buttonsDef.push({content:"Submit",value:"submit"})}this.buttonsDef.forEach(t=>{t.contentWidth=o.computeContentWidth(t.content,t.contentHasMarkup);e+=t.contentWidth});i=Math.floor((this.outputWidth-e)/(this.buttonsDef.length+1));r=i;s++;this.buttonsDef.forEach((t,e)=>{this.buttons[e]=new u({internal:true,parent:this,content:t.content,value:t.value,outputX:this.outputX+r,outputY:this.outputY+s,focusAttr:t.focusAttr||this.buttonFocusAttr,blurAttr:t.blurAttr||this.buttonBlurAttr,noDraw:true});this.buttons[e].on("submit",this.onButtonSubmit);r+=t.contentWidth+i})};t.prototype.getValue=function(){var e={};this.labeledInputs.forEach(t=>{e[t.key]=t.getValue()});return{submit:this.submitValue,fields:e}};t.prototype.onFocus=function(t,e){if(e==="cycle"||e==="backCycle"){return}if(t){r.nextTick(()=>{if(this.focusChild){this.document.giveFocusTo(this.focusChild,"delegate")}else{this.focusChild=this.focusNextChild()}})}};t.prototype.onButtonSubmit=function(t,e,r){this.submitValue=t;this.emit("submit",this.getValue(),e,this,r)};const e=t.prototype.userActions;e.previous=function(){this.focusChild=this.focusPreviousChild()};e.next=function(){this.focusChild=this.focusNextChild()}}).call(this)}).call(this,i("_process"))},{"./Button.js":17,"./Element.js":25,"./LabeledInput.js":30,_process:184}],27:[function(t,e,r){"use strict";const i=t("./Element.js");const n=t("./InlineInput.js");const s=t("../fileHelpers.js");const o=t("fs");const a=t("path");function u(t){t=!t?{}:t.internal?t:Object.create(t);t.internal=true;this.baseDir=t.baseDir??null;this.resolvedBaseDir=null;this.autoCompleteFileOptions=null;this.accept=t.accept&&typeof t.accept==="object"?t.accept:{unexistant:true,file:true,directory:true};n.call(this,t);this.autoComplete=this.fileAutoComplete.bind(this);this.useAutoCompleteHint=t.useAutoCompleteHint??true;this.useAutoCompleteMenu=t.useAutoCompleteMenu??true;if(this.elementType==="InlineFileInput"&&!t.noDraw){this.draw()}this.initPromise=this.init()}e.exports=u;i.inherit(u,n);u.prototype.init=async function(){if(this.initPromise){return this.initPromise}this.resolvedBaseDir=await s.resolveBaseDir(this.baseDir);var t=Object.assign({},this.accept);t.directory=true;this.autoCompleteFileOptions={accept:t,baseDir:this.resolvedBaseDir}};u.prototype.fileAutoComplete=async function(t){await this.initPromise;return s.autoCompleteFile(t,this.autoCompleteFileOptions)};u.prototype.submit=async function(){var e,t;if(this.disabled||this.submitted||this.canceled){return}e=this.getValue();if(!e||typeof e!=="string"){if(!this.noEmpty){this.emit("submit",null,undefined,this)}return}await this.initPromise;e=a.resolve(a.isAbsolute(e)?e:this.resolvedBaseDir+e);try{t=await o.promises.stat(e)}catch(t){if(t.code==="ENOENT"&&this.accept.unexistant){this.emit("submit",e,undefined,this);return}if(!this.noEmpty){this.emit("submit",null,undefined,this)}return}if(!s.statsFilter(t,this.accept)){if(!this.noEmpty){this.emit("submit",null,undefined,this)}return}this.emit("submit",e,undefined,this)}},{"../fileHelpers.js":42,"./Element.js":25,"./InlineInput.js":28,fs:141,path:183}],28:[function(t,e,r){"use strict";const i=t("./Element.js");const n=t("./TextBox.js");const s=t("./EditableTextBox.js");const o=t("./RowMenu.js");const a=t("seventh");const u=t("string-kit");const l=t("../autoComplete.js");function f(e){e=!e?{}:e.internal?e:Object.create(e);e.internal=true;if(e.value){e.content=e.value}e.outputHeight=1;e.scrollable=e.hasVScrollBar=e.hasHScrollBar=e.extraScrolling=false;e.scrollX=e.scrollY=0;e.lineWrap=true;this.onAutoCompleteMenuSubmit=this.onAutoCompleteMenuSubmit.bind(this);this.onAutoCompleteMenuItemFocus=this.onAutoCompleteMenuItemFocus.bind(this);this.onAutoCompleteMenuCancel=this.onAutoCompleteMenuCancel.bind(this);this.promptTextBox=null;if(e.prompt){this.promptTextBox=new n(Object.assign({textAttr:e.textAttr},e.prompt,{internal:true,outputX:e.outputX||e.x,outputY:e.outputY||e.y,outputWidth:e.outputWidth||e.width,outputHeight:e.outputHeight||e.height,lineWrap:e.lineWrap,wordWrap:e.wordWrap||e.wordwrap}));this.promptTextBox.textBuffer.setVoidAttr(null);let t=this.promptTextBox.getContentSize();this.promptTextBox.setSizeAndPosition(t);if(t.height>1){e.outputY=(e.outputY||e.y)+t.height-1;e.firstLineRightShift=this.promptTextBox.textBuffer.buffer[this.promptTextBox.textBuffer.buffer.length-1].length}else{e.firstLineRightShift=t.width}}s.call(this,e);this.history=e.history;this.contentArray=e.history?[...e.history,this.content]:[this.content];this.contentIndex=this.contentArray.length-1;this.noEmpty=!!e.noEmpty;this.disabled=!!e.disabled;this.submitted=!!e.submitted;this.cancelable=!!e.cancelable;this.canceled=!!e.canceled;this.autoComplete=e.autoComplete;this.useAutoCompleteHint=!!(this.autoComplete&&(e.useAutoCompleteHint||e.autoCompleteHint));this.autoCompleteHintMinInput=e.autoCompleteHintMinInput||1;this.useAutoCompleteMenu=!!(this.autoComplete&&(e.useAutoCompleteMenu||e.autoCompleteMenu));this.autoCompleteMenu=null;this.autoCompleteLeftPart=null;this.autoCompleteRightPart=null;this.autoCompleteCursorCell=null;this.autoCompleteMenuPrefix=null;this.autoCompleteMenuPostfix=null;this.menuOptions=Object.assign({},this.defaultMenuOptions,e.menu);this.placeholder=e.placeholder;this.placeholderHasMarkup=e.placeholderHasMarkup;if(this.placeholder){this.setAltContent(this.placeholder,this.placeholderHasMarkup)}if(this.promptTextBox){this.attach(this.promptTextBox)}if(this.elementType==="InlineInput"&&!e.noDraw){this.draw()}}e.exports=f;i.inherit(f,s);f.prototype.useAltTextBuffer=true;f.prototype.defaultMenuOptions={buttonBlurAttr:{bgColor:"default",color:"default"},buttonFocusAttr:{bgColor:"green",color:"blue",dim:true},buttonDisabledAttr:{bgColor:"white",color:"brightBlack"},buttonSubmittedAttr:{bgColor:"brightWhite",color:"brightBlack"},buttonSeparatorAttr:{bgColor:"default"},backgroundAttr:{bgColor:"default"},justify:true,keyBindings:Object.assign({},o.prototype.keyBindings,{TAB:"next",SHIFT_TAB:"previous"})};f.prototype.keyBindings={CTRL_K:"meta",ENTER:"submit",KP_ENTER:"submit",ESCAPE:"cancel",TAB:"autoComplete",CTRL_R:"historyAutoComplete",UP:"historyPrevious",DOWN:"historyNext",BACKSPACE:"backDelete",DELETE:"delete",LEFT:"backward",RIGHT:"forward",CTRL_LEFT:"startOfWord",CTRL_RIGHT:"endOfWord",HOME:"startOfLine",END:"endOfLine",CTRL_B:"startOfSelection",CTRL_E:"endOfSelection",ALT_T:"copyToDocumentClipboard",META_T:"copyToSystemClipboard",CTRL_P:"pasteSelection",ALT_P:"pasteDocumentClipboard",META_P:"pasteSystemClipboard",ALT_D:"clearDocumentClipboard",META_D:"clearSystemClipboard"};f.prototype.insert=function(t){this.textBuffer.insert(t,this.textAttr);this.textBuffer.runStateMachine();if(this.useAutoCompleteHint){this.runAutoCompleteHint(this.autoComplete)}else{this.autoResizeAndDraw()}};f.prototype.preDrawSelf=function(){s.prototype.preDrawSelf.call(this)};f.prototype.autoResizeAndDraw=function(t=false){var e=Math.max(this.textBuffer.buffer.length,this.altTextBuffer&&this.altTextBuffer.buffer.length||0);if(e>this.outputHeight){this.setSizeAndPosition({outputHeight:e})}if(!t){this.draw()}else{this.drawCursor()}};f.prototype.autoResizeAndDrawCursor=function(){return this.autoResizeAndDraw(true)};f.prototype.runAutoCompleteHint=async function(t){if(this.textBuffer.cy===0&&this.textBuffer.cx1){this.altTextBuffer.setText("");this.autoResizeAndDraw();return}e=(e.prefix??"")+e[0]+(e.postfix??"")}if(e===r){this.altTextBuffer.setText("")}else{this.altTextBuffer.setText(e)}this.autoResizeAndDraw()};f.prototype.runAutoComplete=async function(t){var e;this.autoCompleteCursorCell=this.textBuffer.getCursorCell();[this.autoCompleteLeftPart,this.autoCompleteRightPart]=this.textBuffer.getCursorSplittedText();if(Array.isArray(t)){e=l(t,this.autoCompleteLeftPart,this.useAutoCompleteMenu)}else if(typeof t==="function"){e=await t(this.autoCompleteLeftPart,this.useAutoCompleteMenu)}else{return}if(Array.isArray(e)){if(!e.length){return}if(this.useAutoCompleteMenu){this.runAutoCompleteMenu(e);return}e=(e.prefix??"")+e[0]+(e.postfix??"")}this.runAutoCompleted(e)};f.prototype.runAutoCompleted=async function(t){if(t.startsWith(this.autoCompleteLeftPart)){this.textBuffer.insert(t.slice(this.autoCompleteLeftPart.length));if(!this.textBuffer.updateCursorFromCell(this.autoCompleteCursorCell)){this.textBuffer.moveToEndOfBuffer()}}else{this.textBuffer.setText(t+this.autoCompleteRightPart);this.textBuffer.moveToEndOfBuffer()}this.textBuffer.runStateMachine();this.autoResizeAndDraw()};f.prototype.runAutoCompleteMenu=async function(t){if(!t||!t.length){return}if(this.autoCompleteMenu){this.autoCompleteMenu.destroy()}this.autoCompleteMenu=new o(Object.assign({},this.menuOptions,{internal:true,parent:this,x:this.outputX,y:this.outputY+this.outputHeight,outputWidth:this.outputWidth,items:t.map(t=>({value:t,content:t}))}));this.autoCompleteMenuPrefix=t.prefix??"";this.autoCompleteMenuPostfix=t.postfix??"";this.document.giveFocusTo(this.autoCompleteMenu);this.autoCompleteMenu.once("submit",this.onAutoCompleteMenuSubmit);this.autoCompleteMenu.once("cancel",this.onAutoCompleteMenuCancel);this.autoCompleteMenu.on("itemFocus",this.onAutoCompleteMenuItemFocus)};f.prototype.onAutoCompleteMenuSubmit=function(t){t=this.autoCompleteMenuPrefix+t+this.autoCompleteMenuPostfix;this.autoCompleteMenu.destroy();this.autoCompleteMenu=null;this.autoCompleteMenuPrefix=null;this.autoCompleteMenuPostfix=null;this.document.giveFocusTo(this);this.runAutoCompleted(t)};f.prototype.onAutoCompleteMenuItemFocus=function(t,e){if(!e||this.autoCompleteRightPart){return}t=this.autoCompleteMenuPrefix+t+this.autoCompleteMenuPostfix;if(t===this.autoCompleteLeftPart){this.altTextBuffer.setText("")}else{this.altTextBuffer.setText(t)}this.autoResizeAndDraw()};f.prototype.onAutoCompleteMenuCancel=function(){this.autoCompleteMenu.destroy();this.autoCompleteMenu=null;this.document.giveFocusTo(this)};f.prototype.submit=function(){if(this.disabled||this.submitted||this.canceled){return}var t=this.getValue();if(this.noEmpty&&!t){return}this.emit("submit",t,undefined,this)};f.prototype.onKey=function(t,e,r){if(this.autoCompleteMenu){this.autoCompleteMenu.emit("cancel")}return i.prototype.onKey.call(this,t,e,r)};const h=f.prototype.userActions;h.character=function(t,e,r){if(this.placeholder){this.placeholder=null;this.setAltContent("",false,true)}this.insert(t)};h.submit=function(){this.submit()};h.cancel=function(){if(!this.cancelable||this.disabled||this.canceled){return}this.emit("cancel",this)};h.autoComplete=function(){if(!this.autoComplete){return}this.runAutoComplete(this.autoComplete)};h.historyAutoComplete=function(){if(!this.autoComplete){return}this.runAutoComplete(this.history)};h.historyPrevious=function(){if(this.contentIndex<=0){return}this.contentArray[this.contentIndex]=this.getContent();this.contentIndex--;this.setContent(this.contentArray[this.contentIndex]);this.textBuffer.runStateMachine();this.autoResizeAndDraw()};h.historyNext=function(){if(this.contentIndex>=this.contentArray.length-1){return}this.contentArray[this.contentIndex]=this.getContent();this.contentIndex++;this.setContent(this.contentArray[this.contentIndex]);this.textBuffer.runStateMachine();this.autoResizeAndDraw()};h.backDelete=function(){this.textBuffer.backDelete();this.textBuffer.runStateMachine();if(this.useAutoCompleteHint){this.runAutoCompleteHint(this.autoComplete)}else{this.autoResizeAndDraw()}};h.delete=function(){this.textBuffer.delete();this.textBuffer.runStateMachine();if(this.useAutoCompleteHint){this.runAutoCompleteHint(this.autoComplete)}else{this.autoResizeAndDraw()}}},{"../autoComplete.js":7,"./EditableTextBox.js":24,"./Element.js":25,"./RowMenu.js":32,"./TextBox.js":37,seventh:113,"string-kit":127}],29:[function(t,e,r){"use strict";const i=t("./Element.js");const n=t("./TextBox.js");const s=t("./RowMenu.js");const o=t("seventh");const a=t("string-kit");function u(e){e=!e?{}:e.internal?e:Object.create(e);e.internal=true;if(e.value){e.content=e.value}e.outputHeight=1;this.promptTextBox=null;if(e.prompt){this.promptTextBox=new n(Object.assign({textAttr:e.textAttr},e.prompt,{internal:true,outputX:e.outputX||e.x,outputY:e.outputY||e.y,outputWidth:e.outputWidth||e.width,outputHeight:e.outputHeight||e.height,lineWrap:e.lineWrap,wordWrap:e.wordWrap||e.wordwrap}));this.promptTextBox.textBuffer.setVoidAttr(null);let t=this.promptTextBox.getContentSize();this.promptTextBox.setSizeAndPosition(t);if(t.height>1){e.outputY=(e.outputY||e.y)+t.height-1}this.leftMargin=this.promptTextBox.outputWidth}s.call(this,e);if(this.promptTextBox){this.attach(this.promptTextBox)}if(this.elementType==="InlineMenu"&&!e.noDraw){this.draw()}}e.exports=u;i.inherit(u,s);u.prototype.initChildren=function(t=false){s.prototype.initChildren.call(this);if(this.elementType==="InlineMenu"&&!t){this.initPage()}}},{"./Element.js":25,"./RowMenu.js":32,"./TextBox.js":37,seventh:113,"string-kit":127}],30:[function(l,f,t){(function(u){(function(){"use strict";const i=l("./Element.js");const e=l("./Text.js");const r=l("./EditableTextBox.js");const n=l("./SelectList.js");const s=l("./SelectListMulti.js");const t=l("string-kit");function o(t){t=!t?{}:t.internal?t:Object.create(t);t.internal=true;i.call(this,t);this.hiddenContent=t.hiddenContent;this.hasInputFocus=false;this.interceptTempZIndex=true;this.labelFocusAttr=t.labelFocusAttr||{bold:true};this.labelBlurAttr=t.labelBlurAttr||{dim:true};this.buttonBlurAttr=t.buttonBlurAttr||{bgColor:"cyan",color:"white",bold:true};this.buttonFocusAttr=t.buttonFocusAttr||{bgColor:"brightCyan",color:"black",bold:true};this.buttonDisabledAttr=t.buttonDisabledAttr||{bgColor:"cyan",color:"gray",bold:true};this.buttonSubmittedAttr=t.buttonSubmittedAttr||{bgColor:"brightCyan",color:"brightWhite",bold:true};this.turnedOnBlurAttr=t.turnedOnBlurAttr||{bgColor:"cyan"};this.turnedOnFocusAttr=t.turnedOnFocusAttr||{bgColor:"brightCyan",color:"gray",bold:true};this.turnedOffBlurAttr=t.turnedOffBlurAttr||{bgColor:"gray",dim:true};this.turnedOffFocusAttr=t.turnedOffFocusAttr||{bgColor:"white",color:"black",bold:true};this.textAttr=t.textAttr||{bgColor:"blue"};this.voidAttr=t.voidAttr||t.emptyAttr||{bgColor:"blue"};if(t.keyBindings){this.keyBindings=t.keyBindings}if(this.label){this.labelText=new e({internal:true,parent:this,content:this.label,x:this.outputX,y:this.outputY,height:1,attr:this.labelBlurAttr,leftPadding:this.labelBlurLeftPadding,rightPadding:this.labelBlurRightPadding,noDraw:true})}this.inputType=t.type||"text";this.onFocus=this.onFocus.bind(this);this.onClick=this.onClick.bind(this);this.onInputSubmit=this.onInputSubmit.bind(this);this.initInput(t);this.updateStatus();this.on("key",this.onKey);this.on("focus",this.onFocus);this.on("click",this.onClick);if(this.elementType==="LabeledInput"&&!t.noDraw){this.draw()}}f.exports=o;i.inherit(o);o.prototype.needInput=true;o.prototype.noChildFocus=true;o.prototype.propagateZ=true;o.prototype.keyBindings={ENTER:"submit",KP_ENTER:"submit",ALT_ENTER:"submit"};o.prototype.editableTextBoxKeyBindings={CTRL_K:"meta",BACKSPACE:"backDelete",DELETE:"delete",LEFT:"backward",RIGHT:"forward",CTRL_LEFT:"startOfWord",CTRL_RIGHT:"endOfWord",HOME:"startOfLine",END:"endOfLine",CTRL_B:"startOfSelection",CTRL_E:"endOfSelection",CTRL_T:"moveSelection",ALT_T:"copyToDocumentClipboard",META_T:"copyToSystemClipboard",CTRL_P:"pasteSelection",ALT_P:"pasteDocumentClipboard",META_P:"pasteSystemClipboard",CTRL_D:"deleteSelection",ALT_D:"clearDocumentClipboard",META_D:"clearSystemClipboard"};o.prototype.multiLineEditableTextBoxKeyBindings=Object.assign({},o.prototype.editableTextBoxKeyBindings,{ENTER:"newLine",KP_ENTER:"newLine",UP:"up",DOWN:"down",PAGE_UP:"scrollUp",PAGE_DOWN:"scrollDown",CTRL_B:"startOfSelection",CTRL_E:"endOfSelection",CTRL_K:"meta",CTRL_Y:"copy",META_Y:"copyClipboard",CTRL_P:"paste",META_P:"pasteClipboard"});o.prototype.selectListKeyBindings={UP:"previous",DOWN:"next",ENTER:"submit",KP_ENTER:"submit"};o.prototype.selectListMultiKeyBindings={UP:"previous",DOWN:"next",ENTER:"submit",KP_ENTER:"submit"};o.prototype.initInput=function(t){switch(this.inputType){case"text":this.initTextInput(t);break;case"select":this.initSelectInput(t);break;case"selectMulti":this.initSelectMultiInput(t);break;default:throw new Error("Unknown input type: "+this.inputType)}this.input.on("focus",this.onChildFocus.bind(this))};o.prototype.initTextInput=function(t){if(t.inputKeyBindings){this.inputKeyBindings=t.inputKeyBindings}else if(t.allowNewLine){this.inputKeyBindings=this.multiLineEditableTextBoxKeyBindings}else{this.inputKeyBindings=this.editableTextBoxKeyBindings}this.input=new r({internal:true,parent:this,content:t.content,value:t.value,x:this.outputX+(this.labelText?this.labelText.outputWidth:0),y:this.outputY,width:this.outputWidth-(this.labelText?this.labelText.outputWidth:0),height:this.outputHeight,lineWrap:!!t.lineWrap,wordWrap:!!t.wordWrap,scrollable:!!t.scrollable,vScrollBar:!!t.vScrollBar,hScrollBar:!!t.hScrollBar,hiddenContent:this.hiddenContent,textAttr:this.textAttr,voidAttr:this.voidAttr,keyBindings:this.inputKeyBindings,noDraw:true})};o.prototype.initSelectInput=function(t){if(t.inputKeyBindings){this.inputKeyBindings=t.inputKeyBindings}else{this.inputKeyBindings=this.selectListKeyBindings}this.input=new n({internal:true,parent:this,content:t.content,value:t.value,x:this.outputX+(this.labelText?this.labelText.outputWidth:0),y:this.outputY,width:this.outputWidth-(this.labelText?this.labelText.outputWidth:0),items:t.items,buttonBlurAttr:this.buttonBlurAttr,buttonFocusAttr:this.buttonFocusAttr,buttonDisabledAttr:this.buttonDisabledAttr,buttonSubmittedAttr:this.buttonSubmittedAttr,keyBindings:this.inputKeyBindings,noDraw:true});this.input.on("submit",this.onInputSubmit)};o.prototype.initSelectMultiInput=function(t){if(t.inputKeyBindings){this.inputKeyBindings=t.inputKeyBindings}else{this.inputKeyBindings=this.selectListMultiKeyBindings}this.input=new s({internal:true,parent:this,content:t.content,value:t.value,x:this.outputX+(this.labelText?this.labelText.outputWidth:0),y:this.outputY,width:this.outputWidth-(this.labelText?this.labelText.outputWidth:0),items:t.items,buttonBlurAttr:this.buttonBlurAttr,buttonFocusAttr:this.buttonFocusAttr,buttonDisabledAttr:this.buttonDisabledAttr,buttonSubmittedAttr:this.buttonSubmittedAttr,turnedOnBlurAttr:this.turnedOnBlurAttr,turnedOnFocusAttr:this.turnedOnFocusAttr,turnedOffBlurAttr:this.turnedOffBlurAttr,turnedOffFocusAttr:this.turnedOffFocusAttr,keyBindings:this.inputKeyBindings,noDraw:true});this.input.on("submit",this.onInputSubmit)};o.prototype.updateStatus=function(){if(this.hasFocus||this.hasInputFocus){if(this.labelText){this.labelText.attr=this.labelFocusAttr;this.labelText.leftPadding=this.labelFocusLeftPadding;this.labelText.rightPadding=this.labelFocusRightPadding}}else if(this.labelText){this.labelText.attr=this.labelBlurAttr;this.labelText.leftPadding=this.labelBlurLeftPadding;this.labelText.rightPadding=this.labelBlurRightPadding}};o.prototype.getValue=function(){return this.input.getValue()};o.prototype.setValue=function(t,e){return this.input.setValue(t,e)};o.prototype.getContent=function(){return this.input.getContent()};o.prototype.setContent=function(t,e,r){return this.input.setContent(t,e,r)};o.prototype.drawSelfCursor=function(){if(this.input.drawSelfCursor){this.input.drawSelfCursor()}};o.prototype.onKey=function(t,e,r){if(this.input.emit("key",t,e,r).interrupt){return true}return i.prototype.onKey.call(this,t,e,r)};o.prototype.onInputSubmit=function(t){this.emit("submit",this.getValue(),undefined,this)};o.prototype.onFocus=function(t,e){if(e==="delegate"){return}if(t&&e!=="backCycle"&&this.input){u.nextTick(()=>{this.document.giveFocusTo(this.input,"delegate")})}else{this.updateStatus();if(this.labelText){this.labelText.draw()}}};o.prototype.onChildFocus=function(t,e){this.hasInputFocus=t;this.updateStatus();if(this.labelText){this.labelText.draw()}};o.prototype.onClick=function(t){this.document.giveFocusTo(this,"select")};const a=o.prototype.userActions;a.submit=function(){this.emit("submit",this.getValue(),undefined,this)}}).call(this)}).call(this,l("_process"))},{"./EditableTextBox.js":24,"./Element.js":25,"./SelectList.js":33,"./SelectListMulti.js":34,"./Text.js":36,_process:184,"string-kit":127}],31:[function(t,e,r){"use strict";const i=t("./Element.js");const u=t("./Container.js");const n=t("../spChars.js").box;function s(t){t=!t?{}:t.internal?t:Object.create(t);t.internal=true;i.call(this,t);this.onParentResize=this.onParentResize.bind(this);this.layoutDef=t.layout;this.computed={};this.boxesContainer={};this.boxChars=n.light;if(t.boxChars){if(typeof t.boxChars==="object"){this.boxChars=t.boxChars}else if(typeof t.boxChars==="string"&&n[t.boxChars]){this.boxChars=n[t.boxChars]}}this.on("parentResize",this.onParentResize);this.computeBoundingBoxes();if(this.elementType==="Layout"&&!t.noDraw){this.draw()}}e.exports=s;i.inherit(s);s.prototype.computeBoundingBoxes=function(){var t=this.computed={};var e=this.layoutDef;var r={width_:this.outputDst.width,height_:this.outputDst.height,dx_:this.outputDst.width-1,dy_:this.outputDst.height-1,xmin_:0,ymin_:0};var i={offsetX:this.layoutDef.x||0,offsetY:this.layoutDef.y||0,remainingDx:r.dx_,remainingDy:r.dy_};this.computeBoundingBoxes_(e,t,r,i)};s.prototype.computeBoundingBoxes_=function(t,e,r,i){var n,s,o=false;this.computeDxDy(t,e,r,i);e.xmin_=r.xmin_+i.offsetX;e.xmax_=e.xmin_+e.dx_;e.ymin_=r.ymin_+i.offsetY;e.ymax_=e.ymin_+e.dy_;if(e.xmax_>r.xmax_){e.xmax_=r.xmax_;e.dx_=e.xmax_-e.xmin_}if(e.ymax_>r.ymax_){e.ymax_=r.ymax_;e.dy_=e.ymax_-e.ymin_}e.width_=e.dx_+1;e.height_=e.dy_+1;e.columns=[];e.rows=[];s={offsetX:0,offsetY:0,remainingDx:e.dx_,remainingDy:e.dy_,autoDxCount:0,autoDyCount:0};if(t.columns&&t.columns.length){for(n=0;nthis.outputWidth-this.leftMargin){return}var s=l.computeContentWidth(this.contentEllipsis,false);this.separatorWidth=l.computeContentWidth(this.separator,this.separatorHasMarkup);this.previousPageDef=Object.assign({content:"◀",internalRole:"previousPage"},this.previousPageDef);this.previousPageDef.contentHasMarkup=this.previousPageDef.contentHasMarkup||this.previousPageDef.markup;this.previousPageDef.width=this.buttonPaddingWidth+l.computeContentWidth(this.previousPageDef.content,this.previousPageDef.contentHasMarkup);this.previousPageDef.buttonContent=this.previousPageDef.content;this.nextPageDef=Object.assign({content:"▶",internalRole:"nextPage"},this.nextPageDef);this.nextPageDef.contentHasMarkup=this.nextPageDef.contentHasMarkup||this.nextPageDef.markup;this.nextPageDef.width=this.buttonPaddingWidth+l.computeContentWidth(this.nextPageDef.content,this.nextPageDef.contentHasMarkup);this.nextPageDef.buttonContent=this.nextPageDef.content;var o=0,a=0,u=0;this.itemsDef.forEach((t,e)=>{t.buttonContent=t.content;t.contentHasMarkup=t.contentHasMarkup||t.markup;var r=l.computeContentWidth(t.content,t.contentHasMarkup),i=e===this.itemsDef.length-1;t.width=r+this.buttonPaddingWidth+this.buttonSymbolWidth;var n=a+t.width+(u?this.separatorWidth:0)+(i?0:this.nextPageDef.width+this.separatorWidth)-this.outputWidth-this.leftMargin;if(n>0){if(u){o++;u=0;a=this.previousPageDef.width+this.separatorWidth;n=a+t.width+(i?0:this.nextPageDef.width+this.separatorWidth)-this.outputWidth-this.leftMargin}if(n>0){t.buttonContent=l.truncateContent(t.content,r-n-s,t.contentHasMarkup)+this.contentEllipsis;r=l.computeContentWidth(t.buttonContent,t.contentHasMarkup)}}t.page=o;a+=t.width+(u?this.separatorWidth:0);u++;if(!this.pageItemsDef[o]){this.pageItemsDef[o]=[]}this.pageItemsDef[o].push(t)});this.maxPage=o;if(!this.pageItemsDef.length){this.pageItemsDef.push([])}this.pageItemsDef.forEach((t,e)=>{if(e){t.unshift(this.previousPageDef)}if(et+e.width,0);t.buttonsAndSeparatorsWidth=t.buttonsWidth+(t.length-1)*this.separatorWidth;t.justifyWidth=Math.max(0,this.justify?(this.outputWidth-this.leftMargin-t.buttonsAndSeparatorsWidth)/(t.length-1):0)});if(this.elementType==="RowMenu"&&!t){this.initPage()}};o.prototype.initPage=function(t=this.page){var l=this.pageItemsDef[t],f=0,h=this.leftMargin,c=0;if(!l){return}this.buttons.forEach(t=>t.destroy(false,true));this.buttons.length=0;this.hotkeyToButtonIndex.clear();l.forEach((t,e)=>{var r,i,n,s,o;r=t.internalRole?d:this.ButtonClass;i=r===p||r.prototype instanceof p;n=t.key;s=this.childUseParentKeyValue&&n&&this.value&&typeof this.value==="object"?this.value[n]:t.value;if(e%2){o=t.blurAttr||this.buttonBlurAttr}else{o=t.evenBlurAttr||t.blurAttr||this.buttonEvenBlurAttr||this.buttonBlurAttr}this.buttons[e]=new r({internal:true,parent:this,childId:e,internalRole:t.internalRole,content:t.buttonContent,contentHasMarkup:t.contentHasMarkup,disabled:t.disabled,def:t,key:n,value:s,outputX:this.outputX+h,outputY:this.outputY+c,blurAttr:o,focusAttr:t.focusAttr||this.buttonFocusAttr,disabledAttr:t.disabledAttr||this.buttonDisabledAttr,submittedAttr:t.submittedAttr||this.buttonSubmittedAttr,turnedOnFocusAttr:t.turnedOnFocusAttr||this.buttonTurnedOnFocusAttr,turnedOffFocusAttr:t.turnedOffFocusAttr||this.buttonTurnedOffFocusAttr,turnedOnBlurAttr:t.turnedOnBlurAttr||this.buttonTurnedOnBlurAttr,turnedOffBlurAttr:t.turnedOffBlurAttr||this.buttonTurnedOffBlurAttr,blurLeftPadding:this.blurLeftPadding,blurRightPadding:this.blurRightPadding,focusLeftPadding:this.focusLeftPadding,focusRightPadding:this.focusRightPadding,disabledLeftPadding:this.disabledLeftPadding,disabledRightPadding:this.disabledRightPadding,submittedLeftPadding:this.submittedLeftPadding,submittedRightPadding:this.submittedRightPadding,turnedOnFocusLeftPadding:this.turnedOnFocusLeftPadding,turnedOnFocusRightPadding:this.turnedOnFocusRightPadding,turnedOffFocusLeftPadding:this.turnedOffFocusLeftPadding,turnedOffFocusRightPadding:this.turnedOffFocusRightPadding,turnedOnBlurLeftPadding:this.turnedOnBlurLeftPadding,turnedOnBlurRightPadding:this.turnedOnBlurRightPadding,turnedOffBlurLeftPadding:this.turnedOffBlurLeftPadding,turnedOffBlurRightPadding:this.turnedOffBlurRightPadding,paddingHasMarkup:this.paddingHasMarkup,keyBindings:i?this.toggleButtonKeyBindings:this.buttonKeyBindings,actionKeyBindings:i?this.toggleButtonActionKeyBindings:this.buttonActionKeyBindings,shortcuts:t.shortcuts,noDraw:true});this.buttons[e].on("submit",this.onButtonSubmit);this.buttons[e].on("focus",this.onButtonFocus);this.buttons[e].on("blinked",this.onButtonBlinked);if(t.hotkey){if(Array.isArray(t.hotkey)){t.hotkey.forEach(t=>this.hotkeyToButtonIndex.set(t,e))}else{this.hotkeyToButtonIndex.set(t.hotkey,e)}}if(i){this.buttons[e].on("toggle",this.onButtonToggle)}var a=l.justifyWidth+f;var u=Math.round(a);f=a-u;h+=this.buttons[e].outputWidth+this.separatorWidth+u})};o.prototype.preDrawSelf=function(){this.outputDst.put({x:this.outputX+this.leftMargin,y:this.outputY,attr:this.backgroundAttr}," ".repeat(this.outputWidth-this.leftMargin));if(this.separator){let t,e,r;for(t=0;tthis.buttonsMaxWidth){this.masterDef.buttonContent=s.truncateContent(n,this.buttonsMaxWidth-this.buttonSymbolWidth,t.contentHasMarkup)+" "+this.masterDef.symbol}else if(rt.value===e);if(!r){return false}this.select(r,t);return true};a.prototype.onClickOut=function(){this.toggle(false)};a.prototype.getValue=function(){return this.value}},{"./BaseMenu.js":15,"./Button.js":17,"./ColumnMenu.js":18,"./Element.js":25}],34:[function(t,e,r){"use strict";const i=t("./Element.js");const n=t("./BaseMenu.js");const s=t("./ColumnMenuMulti.js");const o=t("./Button.js");function a(t){t=!t?{}:t.internal?t:Object.create(t);t.internal=true;if(!t.master||typeof t.master!=="object"){t.master=Object.assign({},this.defaultOptions.master)}else{t.master=Object.assign({},this.defaultOptions.master,t.master)}if(t.content){t.master.content=t.content}if(!t.separator||typeof t.separator!=="object"){t.separator=Object.assign({},this.defaultOptions.separator)}else{t.separator=Object.assign({},this.defaultOptions.separator,t.separator)}s.call(this,t);this.showMenu=false;this.zIndexRef=this.zIndex;this.initPage();this.toggle(this.showMenu,t.noDraw);this.onClickOut=this.onClickOut.bind(this);this.on("clickOut",this.onClickOut);if(this.elementType==="SelectListMulti"&&!t.noDraw){this.draw()}}e.exports=a;i.inherit(a,s);a.prototype.defaultOptions={buttonBlurAttr:{bgColor:"gray",color:"white",bold:true},buttonFocusAttr:{bgColor:"white",color:"black",bold:true},buttonDisabledAttr:{bgColor:"gray",color:"white",bold:true,dim:true},buttonSubmittedAttr:{bgColor:"gray",color:"brightWhite",bold:true},turnedOnBlurAttr:{bgColor:"cyan"},turnedOnFocusAttr:{bgColor:"brightCyan",color:"gray",bold:true},turnedOffBlurAttr:{bgColor:"gray",dim:true},turnedOffFocusAttr:{bgColor:"white",color:"black",bold:true},master:{content:"select-list-multi",symbol:"▼",internalRole:"toggle"},separator:{content:"-",contentRepeat:true,internalRole:"separator"}};a.prototype.toggle=function(t=null,e=false){var r,i;if(t===null){this.showMenu=!this.showMenu}else{this.showMenu=!!t}for(r=1,i=this.buttons.length;rt;function o(t){t=!t?{}:t.internal?t:Object.create(t);t.internal=true;i.call(this,t);this.onClick=this.onClick.bind(this);this.onDrag=this.onDrag.bind(this);this.onWheel=this.onWheel.bind(this);this.onButtonSubmit=this.onButtonSubmit.bind(this);this.isVertical=!!t.isVertical;this.slideRate=0;this.handleOffset=0;this.rateToValue=typeof t.rateToValue==="function"?t.rateToValue:s;this.valueToRate=typeof t.valueToRate==="function"?t.valueToRate:s;this.buttonBlurAttr=t.buttonBlurAttr||{bgColor:"black",color:"white",bold:true};this.buttonFocusAttr=t.buttonFocusAttr||{bgColor:"white",color:"black",bold:true};this.buttonSubmittedAttr=t.buttonSubmittedAttr||{bgColor:"gray",color:"brightWhite",bold:true};this.backwardSymbol=t.backwardSymbol||(this.isVertical?"▲":"◀");this.forwardSymbol=t.forwardSymbol||(this.isVertical?"▼":"▶");this.handleAttr=t.handleAttr||{bgColor:"brightWhite",color:"black"};this.handleSymbol=t.handleSymbol||"◆";this.barAttr=t.barAttr||{bgColor:"gray",color:"brightWhite"};this.barSymbol=t.barSymbol||" ";this.backwardButton=this.forwardButton=null;this.on("click",this.onClick);this.on("drag",this.onDrag);this.on("wheel",this.onWheel);this.initChildren();if(this.elementType==="Slider"&&!t.noDraw){this.draw()}}e.exports=o;i.inherit(o);o.prototype.needInput=true;o.prototype.outerDrag=true;o.prototype.keyBindings={UP:"backward",DOWN:"forward",LEFT:"backward",RIGHT:"forward",PAGE_UP:"backward",PAGE_DOWN:"forward"," ":"forward",HOME:"start",END:"end"};o.prototype.buttonKeyBindings={ENTER:"submit",KP_ENTER:"submit"};o.prototype.initChildren=function(){this.backwardButton=new n({internal:true,parent:this,internalRole:"backward",content:this.backwardSymbol,outputX:this.outputX,outputY:this.outputY,blurAttr:this.buttonBlurAttr,focusAttr:this.buttonFocusAttr,submittedAttr:this.buttonSubmittedAttr,keyBindings:this.buttonKeyBindings,noDraw:true});this.backwardButton.on("submit",this.onButtonSubmit);this.forwardButton=new n({internal:true,parent:this,internalRole:"forward",content:this.forwardSymbol,outputX:this.isVertical?this.outputX:this.outputX+this.outputWidth-1,outputY:this.isVertical?this.outputY+this.outputHeight-1:this.outputY,blurAttr:this.buttonBlurAttr,focusAttr:this.buttonFocusAttr,submittedAttr:this.buttonSubmittedAttr,keyBindings:this.buttonKeyBindings,noDraw:true});this.forwardButton.on("submit",this.onButtonSubmit);this.computeHandleOffset()};o.prototype.setSizeAndPosition=function(t){this.outputX=t.outputX!==undefined?t.outputX:t.x!==undefined?t.x:this.outputX||0;this.outputY=t.outputY!==undefined?t.outputY:t.y!==undefined?t.y:this.outputY||0;this.outputWidth=t.outputWidth!==undefined?t.outputWidth:t.width!==undefined?t.width:this.outputWidth||1;this.outputHeight=t.outputHeight!==undefined?t.outputHeight:t.height!==undefined?t.height:this.outputHeight||1;this.backwardButton.outputX=this.outputX;this.backwardButton.outputY=this.outputY;this.forwardButton.outputX=this.isVertical?this.outputX:this.outputX+this.outputWidth-1;this.forwardButton.outputY=this.isVertical?this.outputY+this.outputHeight-1:this.outputY};o.prototype.preDrawSelf=function(){return this.isVertical?this.preDrawSelfVertical():this.preDrawSelfHorizontal()};o.prototype.preDrawSelfVertical=function(){var t=0,e=this.outputY+1,r=this.outputY+this.outputHeight-2;for(;e<=r;e++,t++){if(t===this.handleOffset){this.outputDst.put({x:this.outputX,y:e,attr:this.handleAttr},this.handleSymbol)}else{this.outputDst.put({x:this.outputX,y:e,attr:this.barAttr},this.barSymbol)}}};o.prototype.preDrawSelfHorizontal=function(){var t=0,e=this.outputX+1,r=this.outputX+this.outputWidth-2;for(;e<=r;e++,t++){if(t===this.handleOffset){this.outputDst.put({x:e,y:this.outputY,attr:this.handleAttr},this.handleSymbol)}else{this.outputDst.put({x:e,y:this.outputY,attr:this.barAttr},this.barSymbol)}}};o.prototype.postDrawSelf=function(){if(this.isVertical){this.outputDst.moveTo(this.outputX,this.outputY+this.handleOffset+1)}else{this.outputDst.moveTo(this.outputX+this.handleOffset+1,this.outputY)}};o.prototype.computeHandleOffset=function(){var t=(this.isVertical?this.outputHeight:this.outputWidth)-3;this.handleOffset=Math.round(t*this.slideRate)};o.prototype.setHandleOffset=function(t,e=false){var r=(this.isVertical?this.outputHeight:this.outputWidth)-3;this.handleOffset=Math.max(0,Math.min(r,Math.round(t||0)));this.slideRate=Math.max(0,Math.min(1,this.handleOffset/r||0));if(!e){this.emit("slide",this.getValue());this.draw()}};o.prototype.setSlideRate=function(t,e=false){this.slideRate=Math.max(0,Math.min(1,t||0));this.computeHandleOffset();if(!e){this.emit("slide",this.getValue());this.draw()}};o.prototype.getValue=function(){return this.rateToValue(this.slideRate)};o.prototype.setValue=function(t,e){return this.setSlideRate(this.valueToRate(t),e)};o.prototype.getHandleOffset=function(){return this.handleOffset};o.prototype.getSlideRate=function(){return this.slideRate};o.prototype.onButtonSubmit=function(t,e,r){switch(r.internalRole){case"backward":this.emit("slideStep",-1);break;case"forward":this.emit("slideStep",1);break}};o.prototype.onClick=function(t){if(!this.hasFocus){this.document.giveFocusTo(this,"select")}this.setHandleOffset((this.isVertical?t.y:t.x)-1)};o.prototype.onDrag=function(t){this.setHandleOffset((this.isVertical?t.y:t.x)-1)};o.prototype.onWheel=function(t){this.emit("slideStep",t.yDirection)}},{"./Button.js":17,"./Element.js":25}],36:[function(t,e,r){"use strict";const i=t("./Element.js");function n(t){t=!t?{}:t.internal?t:Object.create(t);t.internal=true;this.attr=t.attr||{bgColor:"brightBlack"};this.leftPadding=t.leftPadding||"";this.rightPadding=t.rightPadding||"";if(!Array.isArray(t.content)){t.content=[t.content||""]}this.content=this.content??t.content;this.contentHasMarkup=this.contentHasMarkup??t.contentHasMarkup;if(!t.width){t.width=this.computeRequiredWidth()}t.height=this.computeRequiredHeight();i.call(this,t);if(this.elementType==="Text"&&!t.noDraw){this.draw()}}e.exports=n;i.inherit(n);n.prototype.forceContentArray=true;n.prototype.computeRequiredWidth=function(){return i.computeContentWidth(this.leftPadding,this.paddingHasMarkup)+i.computeContentWidth(this.rightPadding,this.paddingHasMarkup)+(this.animation?Math.max(...this.animation.map(t=>i.computeContentWidth(t,this.contentHasMarkup))):i.computeContentWidth(this.content,this.contentHasMarkup)||1)};n.prototype.computeRequiredHeight=function(){return this.animation?Math.max(...this.animation.map(t=>t.length)):this.content.length};n.prototype.resizeOnContent=function(){this.width=this.computeRequiredWidth(this.content,this.contentHasMarkup);this.height=this.computeRequiredHeight(this.content,this.contentHasMarkup)};n.prototype.postDrawSelf=function(){if(!this.outputDst){return this}var t,e,r,i;for(r=0;r0){this.outputDst.put({attr:this.attr}," ".repeat(t))}}}}},{"./Element.js":25}],37:[function(t,e,r){"use strict";const i=t("./Element.js");const n=t("./Slider.js");const s=t("../ScreenBuffer.js");const o=t("../TextBuffer.js");const a=t("../Rect.js");const u=t("string-kit");function l(t){t=!t?{}:t.internal?t:Object.create(t);t.internal=true;i.call(this,t);this.onClick=this.onClick.bind(this);this.onDrag=this.onDrag.bind(this);this.onWheel=this.onWheel.bind(this);this.onParentResize=this.onParentResize.bind(this);if(t.keyBindings){this.keyBindings=t.keyBindings}this.textAttr=t.textAttr||t.attr||{bgColor:"default"};this.altTextAttr=t.altTextAttr||Object.assign({},this.textAttr,{color:"gray",italic:true});this.voidAttr=t.voidAttr||t.emptyAttr||t.attr||{bgColor:"default"};this.scrollable=!!t.scrollable;this.hasVScrollBar=this.scrollable&&!!t.vScrollBar;this.hasHScrollBar=this.scrollable&&!!t.hScrollBar;this.scrollX=t.scrollX||0;this.scrollY=t.scrollY||0;this.extraScrolling=!!t.extraScrolling;this.autoScrollContextLines=t.autoScrollContextLines??0;this.autoScrollContextColumns=t.autoScrollContextColumns??1;this.firstLineRightShift=t.firstLineRightShift||0;this.wordWrap=!!(t.wordWrap||t.wordwrap);this.lineWrap=!!(t.lineWrap||this.wordWrap);this.hiddenContent=t.hiddenContent;this.stateMachine=t.stateMachine;this.textAreaWidth=this.hasVScrollBar?this.outputWidth-1:this.outputWidth;this.textAreaHeight=this.hasHScrollBar?this.outputHeight-1:this.outputHeight;this.textBuffer=null;this.altTextBuffer=null;this.vScrollBarSlider=null;this.hScrollBarSlider=null;this.on("key",this.onKey);this.on("click",this.onClick);this.on("drag",this.onDrag);this.on("wheel",this.onWheel);this.on("parentResize",this.onParentResize);this.initChildren();if(this.setContent===l.prototype.setContent){this.setContent(t.content,t.contentHasMarkup,true)}if(this.elementType==="TextBox"&&!t.noDraw){this.draw()}}e.exports=l;i.inherit(l);l.prototype.strictInlineSupport=true;l.prototype.keyBindings={CTRL_K:"meta",UP:"tinyScrollUp",DOWN:"tinyScrollDown",PAGE_UP:"scrollUp",PAGE_DOWN:"scrollDown"," ":"scrollDown",HOME:"scrollTop",END:"scrollBottom",LEFT:"scrollLeft",RIGHT:"scrollRight",ALT_T:"copyToDocumentClipboard",META_T:"copyToSystemClipboard"};l.prototype.initChildren=function(){this.textBuffer=new o({dst:this.outputDst,x:this.outputX,y:this.outputY,firstLineRightShift:this.firstLineRightShift,lineWrapWidth:this.lineWrap?this.textAreaWidth:null,wordWrap:this.wordWrap,dstClipRect:{x:this.outputX,y:this.outputY,width:this.textAreaWidth,height:this.textAreaHeight},hidden:this.hiddenContent,forceInBound:true,stateMachine:this.stateMachine});this.setAttr(undefined,undefined,true);if(this.useAltTextBuffer){this.altTextBuffer=new o({firstLineRightShift:this.firstLineRightShift,lineWrapWidth:this.lineWrap?this.textAreaWidth:null,wordWrap:this.wordWrap,dstClipRect:{x:this.outputX,y:this.outputY,width:this.textAreaWidth,height:this.textAreaHeight}});this.setAltAttr();this.textBuffer.setVoidTextBuffer(this.altTextBuffer)}if(this.hasVScrollBar){this.vScrollBarSlider=new n({internal:true,parent:this,x:this.outputX+this.outputWidth-1,y:this.outputY,height:this.outputHeight,isVertical:true,valueToRate:t=>-t/Math.max(1,this.textBuffer.buffer.length-this.textAreaHeight),rateToValue:t=>-t*Math.max(1,this.textBuffer.buffer.length-this.textAreaHeight),noDraw:true});this.vScrollBarSlider.on("slideStep",t=>this.scroll(0,-t*Math.ceil(this.textAreaHeight/2)));this.vScrollBarSlider.on("slide",t=>this.scrollTo(null,t))}if(this.hasHScrollBar){this.hScrollBarSlider=new n({internal:true,parent:this,x:this.outputX,y:this.outputY+this.outputHeight-1,width:this.outputWidth-this.hasVScrollBar,valueToRate:t=>{var e=this.textBuffer.getContentSize().width;return-t/Math.max(1,e-this.textAreaWidth)},rateToValue:t=>{var e=this.textBuffer.getContentSize().width;return-t*Math.max(1,e-this.textAreaWidth)},noDraw:true});this.hScrollBarSlider.on("slideStep",t=>this.scroll(-t*Math.ceil(this.textAreaWidth/2),0));this.hScrollBarSlider.on("slide",t=>this.scrollTo(t,null))}};l.prototype.setSizeAndPosition=function(t){this.outputX=t.outputX!==undefined?t.outputX:t.x!==undefined?t.x:this.outputX||0;this.outputY=t.outputY!==undefined?t.outputY:t.y!==undefined?t.y:this.outputY||0;this.outputWidth=t.outputWidth!==undefined?t.outputWidth:t.width!==undefined?t.width:this.outputWidth||1;this.outputHeight=t.outputHeight!==undefined?t.outputHeight:t.height!==undefined?t.height:this.outputHeight||1;this.textAreaWidth=this.hasVScrollBar?this.outputWidth-1:this.outputWidth;this.textAreaHeight=this.hasHScrollBar?this.outputHeight-1:this.outputHeight;this.textBuffer.lineWrapWidth=this.lineWrap?this.textAreaWidth:null;if(this.altTextBuffer){this.altTextBuffer.lineWrapWidth=this.lineWrap?this.textAreaWidth:null}this.textBuffer.x=this.outputX;this.textBuffer.y=this.outputY;this.textBuffer.dstClipRect=new a({x:this.outputX,y:this.outputY,width:this.textAreaWidth,height:this.textAreaHeight});if(this.lineWrap){this.textBuffer.wrapAllLines();if(this.altTextBuffer){this.altTextBuffer.wrapAllLines()}}if(this.vScrollBarSlider){this.vScrollBarSlider.setSizeAndPosition({outputX:this.outputX+this.outputWidth-1,outputY:this.outputY,outputHeight:this.outputHeight})}if(this.hScrollBarSlider){this.hScrollBarSlider.setSizeAndPosition({outputX:this.outputX,outputY:this.outputY+this.outputHeight-1,outputWidth:this.hasVScrollBar?this.outputWidth-1:this.outputWidth})}};l.prototype.preDrawSelf=function(){this.textBuffer.draw({dst:this.outputDst})};l.prototype.scrollTo=function(t,e,r=false){if(!this.scrollable){return}if(t!==undefined&&t!==null){this.scrollX=Math.min(0,Math.max(Math.round(t),(this.extraScrolling?1:this.textAreaWidth)-this.textBuffer.getContentSize().width+1));this.textBuffer.x=this.outputX+this.scrollX}if(e!==undefined&&e!==null){this.scrollY=Math.min(0,Math.max(Math.round(e),(this.extraScrolling?1:this.textAreaHeight)-this.textBuffer.buffer.length));this.textBuffer.y=this.outputY+this.scrollY}if(this.vScrollBarSlider){this.vScrollBarSlider.setValue(this.scrollY,true)}if(this.hScrollBarSlider){this.hScrollBarSlider.setValue(this.scrollX,true)}if(!r){this.draw()}};l.prototype.scroll=function(t,e,r=false){return this.scrollTo(t?this.scrollX+t:null,e?this.scrollY+e:null,r)};l.prototype.scrollToTop=function(t=false){return this.scrollTo(null,0,t)};l.prototype.scrollToBottom=function(t=false){return this.scrollTo(null,this.textAreaHeight-this.textBuffer.buffer.length,t)};l.prototype.autoScrollAndDraw=function(t=false,e=false){var r,i,n=Math.min(Math.floor(this.textAreaWidth/2),this.autoScrollContextColumns),s=Math.min(Math.floor(this.textAreaHeight/2),this.autoScrollContextLines);if(this.textBuffer.cx<-this.scrollX+n&&this.scrollX!==0){r=Math.min(0,-this.textBuffer.cx+n)}else if(this.textBuffer.cx>this.textAreaWidth-this.scrollX-1-n){r=this.textAreaWidth-1-this.textBuffer.cx-n}if(this.textBuffer.cy<-this.scrollY+s){i=Math.min(0,-this.textBuffer.cy+s)}else if(this.textBuffer.cy>this.textAreaHeight-this.scrollY-1-s){i=this.textAreaHeight-1-this.textBuffer.cy-s}if(r!==undefined||i!==undefined){this.scrollTo(r,i,e)}else if(!t){this.draw()}else{this.drawCursor()}};l.prototype.autoScrollAndSmartDraw=function(){return this.autoScrollAndDraw(true)};l.prototype.setAttr=function(t=this.textAttr,e=this.voidAttr,r=false,i=false){this.textAttr=t;this.voidAttr=e;this.textBuffer.setDefaultAttr(this.textAttr);this.textBuffer.setVoidAttr(this.voidAttr);if(!i){this.setContent(this.content,this.contentHasMarkup,r)}};l.prototype.setAltAttr=function(t=this.altTextAttr){this.altTextAttr=t;this.altTextBuffer.setDefaultAttr(this.altTextAttr);this.altTextBuffer.setVoidAttr(this.voidAttr)};l.prototype.getContentSize=function(){return this.textBuffer.getContentSize()};l.prototype.getContent=function(){return this.textBuffer.getText()};l.prototype.setContent=function(t,e,r){var i;if(typeof t!=="string"){if(t===null||t===undefined){t=""}else{t=""+t}}this.content=t;this.contentHasMarkup=e;this.textBuffer.setText(this.content,this.contentHasMarkup,this.textAttr);if(this.stateMachine){this.textBuffer.runStateMachine()}this.textBuffer.moveToEndOfBuffer();if(!r){this.drawCursor();this.outerDraw()}};l.prototype.getAltContent=function(){if(!this.altTextBuffer){return null}return this.altTextBuffer.getText()};l.prototype.setAltContent=function(t,e,r){if(!this.altTextBuffer){return}var i;if(typeof t!=="string"){if(t===null||t===undefined){t=""}else{t=""+t}}this.altTextBuffer.setText(t,e,this.altTextAttr);if(!r){this.drawCursor();this.outerDraw()}};l.prototype.prependContent=function(t,e){return this.addContent(t,"prepend",e)};l.prototype.appendContent=function(t,e){return this.addContent(t,"append",e)};l.prototype.appendLog=function(t,e){return this.addContent(t,"appendLog",e)};l.prototype.addContent=function(t,e,r){var i,n=false;if(typeof t!=="string"){if(t===null||t===undefined){t=""}else{t=""+t}}switch(e){case"prepend":this.content=t+this.content;this.textBuffer.prepend(t,this.contentHasMarkup,this.textAttr);break;case"appendLog":n=this.textBuffer.buffer.length<=this.textAreaHeight||this.scrollY<=this.textAreaHeight-this.textBuffer.buffer.length;this.textBuffer.moveToEndOfBuffer();if(this.textBuffer.cx){t="\n"+t}this.content+=t;this.textBuffer.insert(t,this.contentHasMarkup,this.textAttr);break;case"append":default:this.content+=t;this.textBuffer.append(t,this.contentHasMarkup,this.textAttr);break}if(this.stateMachine){this.textBuffer.runStateMachine()}this.textBuffer.moveToEndOfBuffer();if(n){this.scrollToBottom(r)}else if(!r){if(this.vScrollBarSlider){this.vScrollBarSlider.setValue(this.scrollY,true)}this.drawCursor();this.draw()}};l.prototype.onWheel=function(t){if(!this.hasFocus){this.document.giveFocusTo(this,"select")}if(this.scrollable){this.scroll(0,-t.yDirection*Math.ceil(this.textAreaHeight/5))}};l.prototype.onClick=function(t){if(this.hasFocus){if(this.textBuffer.selectionRegion){this.textBuffer.resetSelectionRegion();this.draw()}}else{if(this.scrollable){this.document.giveFocusTo(this,"select")}}};l.prototype.onDrag=function(t){var e,r,i,n;if(!this.hasFocus){this.document.giveFocusTo(this,"select")}if(t.yFromundefined)}this.draw()};l.prototype.onParentResize=function(){if(!this.autoWidth&&!this.autoHeight){return}var t={};if(this.autoWidth){t.outputWidth=Math.round(this.outputDst.width*this.autoWidth)}if(this.autoHeight){t.outputHeight=Math.round(this.outputDst.height*this.autoHeight)}this.setSizeAndPosition(t);this.draw()};const f=l.prototype.userActions;f.tinyScrollUp=function(){this.scroll(0,Math.ceil(this.textAreaHeight/5));this.emit("scroll")};f.tinyScrollDown=function(){this.scroll(0,-Math.ceil(this.textAreaHeight/5));this.emit("scroll")};f.scrollUp=function(){this.scroll(0,Math.ceil(this.textAreaHeight/2));this.emit("scroll")};f.scrollDown=function(){this.scroll(0,-Math.ceil(this.textAreaHeight/2));this.emit("scroll")};f.scrollLeft=function(){this.scroll(Math.ceil(this.textAreaWidth/2),0);this.emit("scroll")};f.scrollRight=function(){this.scroll(-Math.ceil(this.textAreaWidth/2),0);this.emit("scroll")};f.scrollTop=function(){this.scrollToTop();this.emit("scroll")};f.scrollBottom=function(){this.scrollToBottom();this.emit("scroll")};f.copyToDocumentClipboard=function(){if(this.document){this.document.setDocumentClipboard(this.textBuffer.getSelectionText())}};f.copyToSystemClipboard=function(){if(this.document){this.document.setSystemClipboard(this.textBuffer.getSelectionText()).catch(()=>undefined)}}},{"../Rect.js":2,"../ScreenBuffer.js":3,"../TextBuffer.js":6,"./Element.js":25,"./Slider.js":35,"string-kit":127}],38:[function(t,e,r){"use strict";const i=t("./Element.js");const o=t("./TextBox.js");const n=t("../spChars.js").box;function s(t){t=!t?{}:t.internal?t:Object.create(t);t.internal=true;i.call(this,t);this.cellContents=t.cellContents;this.rawContentWidth=0;this.rawContentHeight=0;this.contentHasMarkup=t.contentHasMarkup;this.textBoxes=null;this.rowCount=0;this.columnCount=0;this.rowHeights=[];this.columnWidths=[];this.textAttr=t.textAttr||{bgColor:"default"};this.voidAttr=t.voidAttr||t.emptyAttr||null;this.firstRowTextAttr=t.firstRowTextAttr||null;this.firstRowVoidAttr=t.firstRowVoidAttr||null;this.evenRowTextAttr=t.evenRowTextAttr||null;this.evenRowVoidAttr=t.evenRowVoidAttr||null;this.firstColumnTextAttr=t.firstColumnTextAttr||null;this.firstColumnVoidAttr=t.firstColumnVoidAttr||null;this.evenColumnTextAttr=t.evenColumnTextAttr||null;this.evenColumnVoidAttr=t.evenColumnVoidAttr||null;this.firstCellTextAttr=t.firstCellTextAttr||null;this.firstCellVoidAttr=t.firstCellVoidAttr||null;this.evenCellTextAttr=t.evenCellTextAttr||null;this.evenCellVoidAttr=t.evenCellVoidAttr||null;this.checkerEvenCellTextAttr=t.checkerEvenCellTextAttr||null;this.checkerEvenCellVoidAttr=t.checkerEvenCellVoidAttr||null;this.expandToWidth=t.expandToWidth!==undefined?!!t.expandToWidth:!!t.fit;this.shrinkToWidth=t.shrinkToWidth!==undefined?!!t.shrinkToWidth:!!t.fit;this.expandToHeight=t.expandToHeight!==undefined?!!t.expandToHeight:!t.height?false:!!t.fit;this.shrinkToHeight=t.shrinkToHeight!==undefined?!!t.shrinkToHeight:!t.height?false:!!t.fit;this.wordWrap=t.wordWrap!==undefined||t.wordwrap!==undefined?!!(t.wordWrap||t.wordwrap):!!t.fit;this.lineWrap=this.wordWrap||(t.lineWrap!==undefined?!!t.lineWrap:!!t.fit);this.hasBorder=t.hasBorder!==undefined?!!t.hasBorder:true;this.borderAttr=t.borderAttr||this.textAttr;this.borderChars=n.light;if(typeof t.borderChars==="object"){this.borderChars=n.__fix__(t.borderChars)}else if(typeof t.borderChars==="string"&&n[t.borderChars]){this.borderChars=n[t.borderChars]}if(t.textBoxKeyBindings){this.textBoxKeyBindings=t.textBoxKeyBindings}this.initChildren();this.computeCells();if(this.elementType==="TextTable"&&!t.noDraw){this.draw()}}e.exports=s;i.inherit(s);s.prototype.strictInlineSupport=true;s.prototype.staticInline=true;s.prototype.inlineResizeToContent=true;s.prototype.textBoxKeyBindings=o.prototype.keyBindings;s.prototype.setCellContent=function(t,e,r,i=false,n=false){var s=this.textBoxes[e]&&this.textBoxes[e][t];if(!s){return}this.cellContents[e][t]=r;s.setContent(r,this.contentHasMarkup,true);if(!n){this.computeCells();if(!i){this.draw()}}else{if(!i){s.draw()}}};s.prototype.setCellAttr=function(t,e,r,i,n=false){var s=this.textBoxes[e]&&this.textBoxes[e][t];if(!s){return}if(i===undefined){i=r}s.setAttr(r,i,n)};s.prototype.resetCellAttr=function(t,e,r=false){var i=this.textBoxes[e]&&this.textBoxes[e][t];if(!i){return}var n=this.getTextAttrForCell(t,e),s=this.getVoidAttrForCell(t,e,n);i.setAttr(n,s,r)};s.prototype.setRowAttr=function(e,r,i,t=false){for(let t=0;t=this.columnCount){this.columnCount=n+1}r=this.getTextAttrForCell(n,s);i=this.getVoidAttrForCell(n,s,r);this.textBoxes[s][n]=new o({internal:true,parent:this,content:e,contentHasMarkup:this.contentHasMarkup,x:this.outputX,y:this.outputY,width:this.outputWidth,height:this.outputHeight,lineWrap:this.lineWrap,wordWrap:this.wordWrap,textAttr:r,voidAttr:i,keyBindings:this.textBoxKeyBindings,noDraw:true});n++}s++}};s.prototype.computeCells=function(){var t=this.computeColumnWidths();if(t){this.textBoxesWordWrap()}this.computeRowHeights();this.textBoxesSizeAndPosition()};s.prototype.computeColumnWidths=function(){var t,e,r,i,n;this.rawContentWidth=+this.hasBorder;for(t=0;ti){i=n}}this.columnWidths[t]=i;this.rawContentWidth+=i+this.hasBorder}this.contentWidth=this.rawContentWidth;if(this.expandToWidth&&this.rawContentWidththis.outputWidth){this.shrink(this.rawContentWidth,this.outputWidth,this.columnWidths);this.contentWidth=this.outputWidth;return true}return false};s.prototype.computeRowHeights=function(){var t,e,r,i,n;this.rawContentHeight=+this.hasBorder;for(e=0;ei){i=n}}this.rowHeights[e]=i;this.rawContentHeight+=i+this.hasBorder}this.contentHeight=this.rawContentHeight;if(this.expandToHeight&&this.rawContentHeightthis.outputHeight){this.shrink(this.rawContentHeight,this.outputHeight,this.rowHeights);this.contentHeight=this.outputHeight;return true}return false};s.prototype.expand=function(t,e,r){var i,n=0,s=0,o=r.length,a=e-(this.hasBorder?o+1:0);if(a<=0){return}var u=t-(this.hasBorder?o+1:0),l=a/u;for(i=0;i0){n=0;s=0;o.length=0;for(i=0;in){s=n;n=r[i];o.length=0;o.push(i)}else if(r[i]===n){o.push(i)}else if(r[i]>s){s=r[i]}}if(!n){return}u=Math.min(n-s,h/o.length);l=Math.floor(u);if(l>=0){for(let t of o){r[t]-=l;h-=l}}if(l!==u){f=h%o.length;for(let t=0;t=1){e=s.truncateContent(this.content,n,this.contentHasMarkup);r=s.getLastTruncateWidth();this.outputDst.put({x:this.outputX,y:this.outputY,markup:this.contentHasMarkup},this.frameChars.topLeft+this.frameChars.horizontal+"["+e+"]"+this.frameChars.horizontal.repeat(this.outputWidth-5-r)+this.frameChars.topRight)}else{this.outputDst.put({x:this.outputX,y:this.outputY},this.frameChars.topLeft+this.frameChars.horizontal.repeat(this.outputWidth-2)+this.frameChars.topRight)}this.outputDst.put({x:this.outputX,y:this.outputY+this.outputHeight-1},this.frameChars.bottomLeft+this.frameChars.horizontal.repeat(this.outputWidth-2)+this.frameChars.bottomRight);i=this.frameChars.vertical.repeat(this.outputHeight-2);this.outputDst.put({x:this.outputX,y:this.outputY+1,direction:"down"},i);this.outputDst.put({x:this.outputX+this.outputWidth-1,y:this.outputY+1,direction:"down"},i);o.prototype.preDrawSelf.call(this)}},{"../spChars.js":53,"./Container.js":21,"./Element.js":25}],41:[function(n,t,u){(function(i){(function(){"use strict";const s=n("seventh");const t=n("string-kit");n("./patches.js");const e=n("child_process").execAsync;const r=n("child_process").execFileAsync;const o=n("child_process").spawn;const a={c:"clipboard",p:"primary",s:"secondary"};if(i.platform==="linux"){u.getClipboard=async t=>{var e=a[t[0]]||"clipboard";return await r("xclip",["-o","-selection",e])};u.setClipboard=async(t,e)=>{var r=new s;var i=a[e[0]]||"clipboard";var n=o("xclip",["-i","-selection",i]);n.on("error",t=>{r.reject(t)});n.on("exit",t=>{if(t!==0){r.reject(t)}else{r.resolve()}});n.stdin.end(t);return r}}else{u.getClipboard=()=>s.reject(new Error("No clipboard manipulation program found"));u.setClipboard=()=>s.reject(new Error("No clipboard manipulation program found"))}}).call(this)}).call(this,n("_process"))},{"./patches.js":48,_process:184,child_process:141,seventh:113,"string-kit":127}],42:[function(t,e,f){(function(e){(function(){"use strict";const u=t("./autoComplete.js");const n=t("fs");const l=t("path");const s=t("seventh");f.readdir=async(r,i=null)=>{if(r[r.length-1]!=="/"){r+="/"}var t=await n.promises.readdir(r);var e=await s.map(t,async t=>{var e=await n.promises.lstat(r+t);if(i&&!f.statsFilter(e,i)){return null}if(e.isDirectory()){t+="/"}return t});e=e.filter(t=>t!==null);return e};f.statsFilter=(t,e)=>{if(t.isFile()&&!e.file||t.isDirectory()&&!e.directory){return false}return true};f.resolveBaseDir=async t=>{if(!t){t=e.cwd()}else{t=l.resolve(t);if(!l.isAbsolute(t)){t=await n.promises.realpath(t)}}if(t[t.length-1]!=="/"){t+="/"}return t};f.autoCompleteFile=async(e,t)=>{var r,i,n,s,o,a=t.baseDir;if(e[e.length-1]==="/"){n=r=e;i=""}else if(e==="."){r="";n="";i="."}else{r=l.dirname(e);if(r==="."){if(e.startsWith("./")){r="./";n=""}else{r=n=""}}else{n=r=r+"/"}i=l.basename(e)}if(!l.isAbsolute(n)){n=a+n}try{s=await f.readdir(n,t.accept)}catch(t){return e}if(!Array.isArray(s)||!s.length){return e}o=u(s,i,true,r);return o}}).call(this)}).call(this,t("_process"))},{"./autoComplete.js":7,_process:184,fs:141,path:183,seventh:113}],43:[function(t,e,r){"use strict";const a=t("./fileHelpers.js");const u=t("path");e.exports=async function t(e,r){var i,n,s,o;if(typeof e==="function"){r=e;e={}}if(!e||typeof e!=="object"){e={}}try{i=await a.resolveBaseDir(e.baseDir);n={baseDir:i};s=Object.assign({},e,{autoComplete:t=>a.autoCompleteFile(t,n),autoCompleteMenu:true,minLength:1});o=await this.inputField(s).promise}catch(t){if(r){r(t);return}throw t}if(!o&&typeof o!=="string"){o=undefined}else{o=u.resolve(u.isAbsolute(o)?o:i+o)}if(r){r(undefined,o)}return o}},{"./fileHelpers.js":42,path:183}],44:[function(t,e,r){"use strict";var _=t("seventh");var C={ENTER:"submit",KP_ENTER:"submit",UP:"previous",DOWN:"next",LEFT:"previousColumn",RIGHT:"nextColumn",TAB:"cycleNext",SHIFT_TAB:"cyclePrevious",HOME:"first",END:"last"};e.exports=function t(e,n,i){if(arguments.length<1){throw new Error("[terminal] gridMenu() needs at least an array of menuItems argument")}if(!Array.isArray(e)||!e.length){throw new TypeError("[terminal] gridMenu(): argument #0 should be a non-empty array")}if(typeof n==="function"){i=n;n={}}else if(!n||typeof n!=="object"){n={}}if(!n.style){n.style=this}if(!n.selectedStyle){n.selectedStyle=this.inverse}if(n.leftPadding===undefined){n.leftPadding=" "}if(n.selectedLeftPadding===undefined){n.selectedLeftPadding=" "}if(n.rightPadding===undefined){n.rightPadding=" "}if(n.selectedRightPadding===undefined){n.selectedRightPadding=" "}if(!n.x){n.x=1}if(!n.y){this("\n")}else{this.moveTo(n.x,n.y)}if(!n.width){n.width=this.width-n.x+1}if(!n.itemMaxWidth){n.itemMaxWidth=Math.floor((n.width-1)/3)}var s=n.keyBindings||C;if(!this.grabbing){this.grabInput()}var o={},a=0,u=false,l=false,r=0,f=0,h,c,d,p;p=Math.max(n.leftPadding.length,n.selectedLeftPadding.length)+Math.max(n.rightPadding.length,n.selectedRightPadding.length);e=e.map(t=>{if(typeof t!=="string"){t=""+t}r=Math.max(r,t.length);return t});r=Math.min(r,n.itemMaxWidth-p);f=r+p;c=Math.floor(n.width/f);d=Math.ceil(e.length/c);h=e.map((t,e)=>({offsetY:e%d,offsetX:n.x-1+Math.floor(e/d)*f,index:e,text:t,displayText:t.length>r?t.slice(0,r-1)+"…":t+" ".repeat(r-t.length)}));var g=(t,e)=>{if(l){return}l=true;u=true;this.removeListener("key",v);this.removeListener("mouse",w);this.moveTo(1,o.y+d);if(t){if(i){i(t)}else{x.promise.reject(t)}return}var r=e!==undefined?e:{selectedIndex:a,selectedText:h[a].text,x:1+h[a].offsetX,y:o.y+h[a].offsetY};if(i){i(undefined,r)}else{x.promise.resolve(r)}};var y=()=>{for(var t=0;t{var e=h[t];this.moveTo(1+e.offsetX,o.y+e.offsetY);if(t===a){n.selectedStyle.noFormat(n.selectedLeftPadding);n.selectedStyle.noFormat(e.displayText);n.selectedStyle.noFormat(n.selectedRightPadding)}else{n.style.noFormat(n.leftPadding);n.style.noFormat(e.displayText);n.style.noFormat(n.rightPadding)}};var b=()=>{this.moveTo(1+h[a].offsetX,o.y+h[a].offsetY)};var v=(t,e,r)=>{if(u){return}var i=a;switch(s[t]){case"submit":g();break;case"previous":if(a>0){a--;m(a);m(a+1);b()}break;case"next":if(a=d){a-=d;m(i);m(a);b()}break;case"nextColumn":if(a=h.length){a=0}m(i);m(a);b();break;case"first":if(a!==0){a=0;m(i);m(a);b()}break;case"last":if(a!==h.length-1){a=h.length-1;m(i);m(a);b()}break;default:if(n.exitOnUnexpectedKey){g(undefined,{unexpectedKey:t,unexpectedKeyData:r})}break}};var w=(t,e)=>{if(u){return}if(e.y=o.y+d){return}var r,i=false,n=a;for(r=0;r=1+h[r].offsetX&&e.x<1+h[r].offsetX+f){i=true;if(a!==r){a=r;m(n);m(a);b()}break}}if(i&&t==="MOUSE_LEFT_BUTTON_PRESSED"){g()}};this.getCursorLocation((t,e,r)=>{if(t){this.row.eraseLineAfter(this.height)("\n");e=1;r=this.height}o.x=e;o.y=r;var i=o.y+d-this.height;if(i>0){this("\n".repeat(i));o.y-=i}y();this.on("key",v);if(this.mouseGrabbing){this.on("mouse",w)}});var x={};x.promise=new _;return x}},{seventh:113}],45:[function(l,e,t){(function(t){(function(){"use strict";const x=l("ndarray");const r=l("seventh");const u={};e.exports=u;var i;if(t.IS_BROWSER){i=l("@cronvel/get-pixels")}u.load=function t(n,e,s,o){if(!i){try{i=l("get-pixels")}catch(t){i=l("@cronvel/get-pixels")}}if(typeof s==="function"){o=s;s={}}else if(!s||typeof s!=="object"){s={}}var a=new r;i(e,(t,e)=>{if(t){var r=new Error("Bad image URL: "+t);r.code=t.code;r.parent=t;if(o){o(r)}else{a.reject(r)}return}if(e.shape.length===4){e=e.pick(0,null,null,null)}if(s.shrink){e=u.shrinkNdarrayImage(e,s.shrink)}var i=n(e,s);if(o){o(undefined,i)}else{a.resolve(i)}});return a};u.shrinkNdarrayImage=function t(e,r){var i=Math.min(r.width/e.shape[0],r.height/e.shape[1]);if(i>=1){return e}var n=Math.ceil(e.shape[0]*i);var s=Math.ceil(e.shape[1]*i);var o,a,u,l,f,h,c,d,p,g,y,m,b,v=e.shape[2]===4;var w=x(new Uint8Array(n*s*e.shape[2]),[n,s,e.shape[2]]);for(o=0;oF.unicode.toArray(t).slice(0,c.maxLength))}if(c.default&&typeof c.default==="string"){x.push(F.unicode.toArray(c.default).slice(0,c.maxLength))}else{x.push([])}var e=()=>{_=x.length-1;y=r(y);if(c.y!==undefined){c.x=c.x||1;this.moveTo.eraseLineAfter(c.x,c.y);u(c.x,c.y)}else{this.getCursorLocation((t,e,r)=>{if(t){this.row.eraseLineAfter(this.height)("\n> ");e=3;r=this.height}u(e,r)})}};var u=(t,e)=>{b.x=v.x=w.x=t;b.y=v.y=w.y=e;if(x[_].length){A();E()}this.on("key",j);n.emit("ready")};var k=(t,e)=>{if(s){return}s=true;p=true;this.removeListener("key",j);if(t==="abort"){return}this.styleReset();if(t){if(i){i(t)}else{n.promise.reject(t)}return}var r;if(typeof e==="string"){r=e}else if(e){r=e.join("")}if(i){i(undefined,r)}else{n.promise.resolve(r)}};var A=()=>{var t,e=F.unicode.arrayWidth(x[_]),r=F.unicode.arrayWidth(a);v=f(e);o=f(e+r);if(o.y>this.height){t=o.y-this.height;S.style.noFormat("\n".repeat(t));b.y-=t;v.y-=t;o.y-=t}l()};var l=()=>{w=f(F.unicode.arrayWidth(x[_],y))};var f=t=>{return{x:1+(b.x+t-1)%this.width,y:b.y+Math.floor((b.x+t-1)/this.width)}};var r=t=>{if(typeof t!=="number"||isNaN(t)){return x[_].length}if(t<0){t=x[_].length+1+t}if(t<0){t=0}else if(t>=x[_].length){t=x[_].length}return t};var E=(t,e)=>{var r,i;t=t||0;if(!S.autoCompleteHint&&e){this.moveTo(v.x,v.y);S.style.noFormat.eraseLineAfter("")}this.moveTo(b.x,b.y);if(c.tokenHook){I(x[_].join(""))}else if(c.echoChar){S.style.noFormat(c.echoChar.repeat(x[_].length))}else{S.style.noFormat(x[_].join(""))}i=O();if(t>0){for(r=1;r<=t;r++){this.moveTo(1,v.y+r);S.style.noFormat.eraseLineAfter("")}}if(!i&&(w.y{if(!n.hasState("ready")){n.once("ready",h);return}this.moveTo(w.x,w.y)};var B=()=>{if(g){return}g=true};var R=()=>{if(!g){return}g=false;if(n.hasState("ready")){E()}};var O=()=>{if(!S.autoCompleteHint){return false}var t=v.y;this.moveTo(v.x,v.y);S.style.noFormat.eraseLineAfter("");while(t{g=true;this.singleLineMenu(r,S.autoCompleteMenu,(t,e)=>{g=false;if(t){return}if(e.selectedText){if(r.prefix){e.selectedText=r.prefix+e.selectedText}if(r.postfix){e.selectedText+=r.postfix}e.selectedText=F.unicode.toArray(e.selectedText).slice(0,c.maxLength);x[_]=e.selectedText.concat(x[_].slice(y,c.maxLength+y-e.selectedText.length));y=e.selectedText.length}if(m){this.column.eraseLineAfter(1);if(v.y>=this.height&&b.y>1){b.y--}A();E();this.moveTo(w.x,w.y)}if(e.unexpectedKey&&e.unexpectedKey!=="TAB"){j(e.unexpectedKey,undefined,e.unexpectedKeyData)}}).on("highlight",t=>n.emit("highlight",t))};var I=t=>{var e,r,i=0,n=[],s,o;S.style=c.style||this;S.hintStyle=c.hintStyle||this.brightBlack;S.tokenRegExp=c.tokenRegExp||N;S.autoComplete=c.autoComplete;S.autoCompleteMenu=c.autoCompleteMenu;S.autoCompleteHint=!!c.autoCompleteHint;S.tokenRegExp.lastIndex=0;if(c.tokenResetHook){c.tokenResetHook(this,S)}while((e=S.tokenRegExp.exec(t))!==null){r=S.tokenRegExp.lastIndex;if(e.index>i){S.style.noFormat(t.slice(i,e.index))}o=e.index+e[0].length===t.length;s=c.tokenHook(e[0],o,n,this,S);if(typeof s==="function"){s.noFormat(e[0])}else if(typeof s==="string"){this.noFormat(s)}else{S.style.noFormat(e[0])}n.push(e[0]);i=e.index+e[0].length;S.tokenRegExp.lastIndex=r}if(i{if(!S.autoComplete||!S.autoCompleteHint||y{if(Array.isArray(r)){return}a=F.unicode.toArray(r.slice(t.length)).slice(0,c.maxLength-x[_].length);A();this.moveTo(v.x,v.y);S.hintStyle.noFormat(a.join(""));this.moveTo(w.x,w.y)};if(Array.isArray(S.autoComplete)){r=W(S.autoComplete,t,S.autoCompleteMenu)}else if(typeof S.autoComplete==="function"){if(S.autoComplete.length===2){S.autoComplete(t,(t,e)=>{if(t){k(t);return}r=e;i()});return}r=S.autoComplete(t);if(D.isThenable(r)){r.then(t=>{r=t;i()},t=>{k(t)});return}}i()};var j=(t,e,r)=>{if(p||g){return}var i,n,s,o,a,u,l,f=y;if(T){T=false;l="ALT_"+t.toUpperCase();if(r){r.isCharacter=false}if(d[l]){t=l}}if(r&&r.isCharacter){if(x[_].length>=c.maxLength){return}x[_].splice(y,0,t);y++;if(m){if(y===x[_].length&&!C){S.style.noFormat(c.echoChar||t);A()}else{A();E();if(S.autoCompleteHint){P()}}}}else{switch(d[t]){case"submit":if(x[_].length0){a=x[_][y-1];x[_].splice(y-1,1);y--;if(m){if(w.y0){x[_].splice(0,y);y=0;if(m){A();E(undefined,true)}}break;case"deleteAllAfter":if(x[_].length&&y0){if(S.autoCompleteHint&&y===x[_].length){O()}y--;if(m){A();this.moveTo(w.x,w.y)}}break;case"forward":if(x[_].length&&y0){if(S.autoCompleteHint&&y===x[_].length){O()}u=y--;while(y>0&&x[_][y]===" "){y--}while(y>0&&x[_][y-1]!==" "){y--}x[_].splice(y,u-y);if(m){A();this.moveTo(w.x,w.y);E(undefined,true)}}break;case"deleteNextWord":if(x[_].length&&y0){if(S.autoCompleteHint&&y===x[_].length){O()}y--;while(y>0&&x[_][y]===" "){y--}while(y>0&&x[_][y-1]!==" "){y--}if(m){A();this.moveTo(w.x,w.y)}}break;case"nextWord":if(x[_].length&&y0){_--;y=x[_].length;if(m){o=v.y-b.y;A();o-=v.y-b.y;E(o,true);this.moveTo(w.x,w.y)}}break;case"autoCompleteUsingHistory":case"autoComplete":n=d[t]==="autoCompleteUsingHistory"?c.history:S.autoComplete;if(!n){break}i=x[_].slice(0,y);var h=()=>{if(Array.isArray(s)){if(S.autoCompleteMenu){M(s)}return}i=F.unicode.toArray(s).slice(0,c.maxLength);x[_]=i.concat(x[_].slice(y,c.maxLength+y-i.length));y=i.length;if(m){A();E()}};if(Array.isArray(n)){s=W(n,i.join(""),S.autoCompleteMenu)}else if(typeof n==="function"){if(n.length===2){n(i.join(""),(t,e)=>{if(t){k(t);return}s=e;h()});return}s=n(i.join(""));if(D.isThenable(s)){s.then(t=>{s=t;h()},t=>{k(t)});return}}h();break}}};n=Object.create(L.prototype);n.defineStates("ready");Object.defineProperty(n,"ready",{get:function(){return this.hasState("ready")}});n.widgetType="inputField";n.abort=()=>{if(p){return}k("abort")};n.stop=()=>{if(p){return}k(undefined,x[_])};n.pause=B;n.resume=R;n.focus=t=>{if(t){R()}else{B()}};n.getInput=()=>x[_].join("");n.value=n.getInput;n.getPosition=()=>({x:b.x,y:b.y});n.hide=()=>{if(!n.hasState("ready")){n.once("ready",n.hide);return}var t,e;for(t=b.x,e=b.y;e<=v.y;t=1,e++){this.moveTo.eraseLineAfter(t,e)}m=false};n.show=()=>{if(!n.hasState("ready")){n.once("ready",n.show);return}m=true;E()};n.redraw=()=>{if(!n.hasState("ready")){n.once("ready",n.redraw);return}E(undefined,true)};n.redrawCursor=()=>{if(!n.hasState("ready")){n.once("ready",n.redrawCursor);return}h()};n.getCursorPosition=()=>y;n.setCursorPosition=t=>{t=r(t);if(t!==y){if(S.autoCompleteHint&&y===x[_].length){O()}y=t;if(m){A();this.moveTo(w.x,w.y)}if(S.autoCompleteHint&&y===x[_].length){P()}}};n.rebase=(t,e)=>{if(!n.hasState("ready")){n.once("ready",n.rebase);return}var i=(t,e)=>{b.x=t;b.y=e;if(c.echo){m=true;A();E()}n.emit("rebased")};if(t!==undefined&&e!==undefined){i(t,e);return}m=false;this.getCursorLocation((t,e,r)=>{if(t){return}i(e,r)})};n.promise=new D;e();return n}},{"./autoComplete.js":7,"nextgen-events":77,seventh:113,"string-kit":127}],47:[function(t,e,r){"use strict";const s=t("string-kit");const i={black:0,red:1,green:2,yellow:3,blue:4,magenta:5,violet:5,cyan:6,white:7,grey:8,gray:8,brightblack:8,brightred:9,brightgreen:10,brightyellow:11,brightblue:12,brightmagenta:13,brightviolet:13,brightcyan:14,brightwhite:15};r.colorNameToIndex=t=>i[t.toLowerCase()];const n=["black","red","green","yellow","blue","magenta","cyan","white","gray","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"];r.indexToColorName=t=>n[t];r.hexToRgba=t=>{if(t[0]==="#"){t=t.slice(1)}if(t.length===3){t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]}return{r:parseInt(t.slice(0,2),16)||0,g:parseInt(t.slice(2,4),16)||0,b:parseInt(t.slice(4,6),16)||0,a:t.length>6?parseInt(t.slice(6,8),16)||0:255}};r.color2index=r.colorNameToIndex;r.index2color=r.indexToColorName;r.hexToColor=r.hexToRgba;r.stripControlChars=(t,e)=>{if(e){return t.replace(/[\x00-\x09\x0b-\x1f\x7f]/g,"")}return t.replace(/[\x00-\x1f\x7f]/g,"")};const o=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g;const a=/([\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><])|([^\u001b\u009b]+)/g;r.stripEscapeSequences=t=>t.replace(o,"");r.ansiWidth=r.stringWidth=t=>{var e,r=0;a.lastIndex=0;while(e=a.exec(t)){if(e[2]){r+=s.unicode.width(e[2])}}return r};var u=0;r.getLastTruncateWidth=()=>u;r.truncateAnsiString=r.truncateString=(t,e)=>{var r,i=0;u=0;a.lastIndex=0;while(r=a.exec(t)){if(r[2]){i+=s.unicode.width(r[2]);if(i>=e){if(i===e){return t.slice(0,r.index+r[2].length)}return t.slice(0,r.index)+s.unicode.truncateWidth(r[2],e-u)}u=i}}return t};r.markupWidth=t=>{return s.unicode.width(t.replace(/\^\[[^\]]*]?|\^(.)/g,(t,e)=>{if(e===" "||e==="^"){return e}return""}))};r.truncateMarkupString=(t,e)=>{var r=0,i,n=s.unicode.toArray(t);u=0;while(re){n.length=r;return n.join("")}u+=i;r++}return t};r.escapeSequenceSkipFn=(t,e)=>{var r;if(t[e]!==""){return e}e++;if(t[e]!=="["){return e}e++;for(;e=65&&r<=90||r>=97&&r<=122){e++;break}}return e};r.wordWrapAnsi=(t,e)=>s.wordwrap(t,{width:e,noJoin:true,fill:true,regroupFn:t=>{var r="",i=false,n=[];t.forEach(t=>{var e;if(i){r+=t;e=t.charCodeAt(0);if(e>=65&&e<=90||e>=97&&e<=122){n.push(r);r="";i=false}}else if(r){r+=t;if(t==="["){i=true}else{n.push(r);r=""}}else if(t===""){r=t}else{n.push(t)}});return n},charWidthFn:t=>{if(t[0]===""){return 0}return s.unicode.charWidth(t)}});r.wordwrapMarkup=r.wordWrapMarkup=(t,e)=>s.wordwrap(t,{width:e,noJoin:true,fill:true,regroupFn:t=>{var e="",r=false,i=[];t.forEach(t=>{if(r){e+=t;if(t==="]"){i.push(e);e="";r=false}}else if(e){e+=t;if(t==="["){r=true}else{i.push(e);e=""}}else if(t==="^"){e=t}else{i.push(t)}});return i},charWidthFn:t=>{if(t[0]==="^"&&t[1]){if(t[1]==="^"||t[1]===" "){return 1}return 0}return s.unicode.charWidth(t)}});r.preserveMarkupFormat=s.createFormatter({argumentSanitizer:t=>t.replace(/[\x00-\x1f\x7f^]/g,t=>t==="^"?"^^":""),noMarkup:true});const l={defaultColor:["color","default"],black:["color","black"],red:["color","red"],green:["color","green"],yellow:["color","yellow"],blue:["color","blue"],magenta:["color","magenta"],cyan:["color","cyan"],white:["color","white"],grey:["color","grey"],gray:["color","gray"],brightBlack:["color","brightBlack"],brightRed:["color","brightRed"],brightGreen:["color","brightGreen"],brightYellow:["color","brightYellow"],brightBlue:["color","brightBlue"],brightMagenta:["color","brightMagenta"],brightCyan:["color","brightCyan"],brightWhite:["color","brightWhite"],defaultBgColor:["bgColor","default"],bgBlack:["bgColor","black"],bgRed:["bgColor","red"],bgGreen:["bgColor","green"],bgYellow:["bgColor","yellow"],bgBlue:["bgColor","blue"],bgMagenta:["bgColor","magenta"],bgCyan:["bgColor","cyan"],bgWhite:["bgColor","white"],bgGrey:["bgColor","grey"],bgGray:["bgColor","gray"],bgBrightBlack:["bgColor","brightBlack"],bgBrightRed:["bgColor","brightRed"],bgBrightGreen:["bgColor","brightGreen"],bgBrightYellow:["bgColor","brightYellow"],bgBrightBlue:["bgColor","brightBlue"],bgBrightMagenta:["bgColor","brightMagenta"],bgBrightCyan:["bgColor","brightCyan"],bgBrightWhite:["bgColor","brightWhite"],dim:["dim",true],bold:["bold",true],underline:["underline",true],italic:["italic",true],inverse:["inverse",true]};r.markupCatchAllKeywords=l;r.markupOptions={parse:true,shiftMarkup:{"#":"background"},markup:{":":null," ":t=>{t.length=0;return[null," "]},";":t=>{t.length=0;return[null,{specialReset:true}]},"-":{dim:true},"+":{bold:true},_:{underline:true},"/":{italic:true},"!":{inverse:true},k:{color:0},r:{color:1},g:{color:2},y:{color:3},b:{color:4},m:{color:5},c:{color:6},w:{color:7},K:{color:8},R:{color:9},G:{color:10},Y:{color:11},B:{color:12},M:{color:13},C:{color:14},W:{color:15}},shiftedMarkup:{background:{":":[null,{defaultColor:true,bgDefaultColor:true}]," ":t=>{t.length=0;return[null,{defaultColor:true,bgDefaultColor:true}," "]},";":t=>{t.length=0;return[null,{specialReset:true,defaultColor:true,bgDefaultColor:true}]},k:{bgColor:0},r:{bgColor:1},g:{bgColor:2},y:{bgColor:3},b:{bgColor:4},m:{bgColor:5},c:{bgColor:6},w:{bgColor:7},K:{bgColor:8},R:{bgColor:9},G:{bgColor:10},Y:{bgColor:11},B:{bgColor:12},M:{bgColor:13},C:{bgColor:14},W:{bgColor:15}}},dataMarkup:{color:"color",fgColor:"color",fg:"color",c:"color",bgColor:"bgColor",bg:"bgColor"},markupCatchAll:(t,e,r)=>{var i={};if(r===undefined){if(e[0]==="#"){i.color=e}else if(l[e]){i[l[e][0]]=l[e][1]}else{i.color=e}}t.push(i);return i||{}}};const f={" ":"SPACE","!":"EXCLAMATION",'"':"DOUBLE_QUOTE","#":"HASH",$:"DOLLAR","%":"PERCENT","&":"AMPERSAND","'":"SINGLE_QUOTE","(":"OPEN_PARENTHESIS",")":"CLOSE_PARENTHESIS","*":"ASTERISK","+":"PLUS",",":"COMMA","-":"HYPHEN",".":"DOT","/":"SLASH",":":"COLON",";":"SEMICOLON","<":"LESS_THAN","=":"EQUAL",">":"GREATER_THAN","?":"QUESTION","@":"AT","[":"OPEN_BRACKET","\\":"BACKSLASH","]":"CLOSE_BRACKET","^":"CARET",_:"UNDERSCORE","`":"BACK_QUOTE","{":"OPEN_BRACE","|":"PIPE","}":"CLOSE_BRACE","~":"TILDE"};r.characterName=t=>{if(f[t]){return f[t]}return t.toUpperCase()}},{"string-kit":127}],48:[function(t,e,r){"use strict";const i=t("seventh");i.promisifyNodeApi(t("child_process"))},{child_process:141,seventh:113}],49:[function(t,e,r){"use strict";e.exports=function t(c){if(!c||typeof c!=="object"){c={}}var e={},d,p=false,g=false,y,r=0,m=[],b,v,w,x,_,C,n,i,T,S=0,k=0,s=0,l=0,f,A,h,E,B,R,O;B=h=(new Date).getTime();T=["|","/","-","\\"];c.syncMode=!!c.syncMode;x=c.width||this.width-1;if(!c.barBracketStyle){if(c.barStyle){c.barBracketStyle=c.barStyle}else{c.barBracketStyle=this.blue}}if(!c.barStyle){c.barStyle=this.cyan}if(!c.percentStyle){c.percentStyle=this.yellow}if(!c.etaStyle){c.etaStyle=this.bold}if(!c.itemStyle){c.itemStyle=this.dim}if(!c.titleStyle){c.titleStyle=this.bold}if(!c.barChar){c.barChar="="}else{c.barChar=c.barChar[0]}if(!c.barHeadChar){c.barHeadChar=">"}else{c.barHeadChar=c.barHeadChar[0]}if(typeof c.maxRefreshTime!=="number"){c.maxRefreshTime=500}if(typeof c.minRefreshTime!=="number"){c.minRefreshTime=100}if(typeof c.items==="number"){y=c.items}if(y&&typeof c.itemSize!=="number"){c.itemSize=Math.round(x/3)}b=" ".repeat(c.itemSize);if(c.title&&typeof c.title==="string"){v=c.title;if(typeof c.titleSize!=="number"){c.titleSize=Math.round(Math.min(c.title.length+1,x/3))}}w=" ".repeat(c.titleSize);O=" ";var M=t=>{var e="",r,i,n,s,o,a,u;if(d>=1){e=" done"}else if(d>0){r=(new Date).getTime()-h;i=(new Date).getTime()-B;if(!t&&l>1){a=(new Date).getTime()-f;s=i/l;o=d/l;if(a.99){u=.99}}else{u=d}n=i*((1-u)/u)/1e3;e=" in ";if(n<10){e+=Math.round(n*10)/10+"s"}else if(n<120){e+=Math.round(n)+"s"}else if(n<7200){e+=Math.round(n/60)+"min"}else if(n<172800){e+=Math.round(n/3600)+"hours"}else if(n<31536e3){e+=Math.round(n/86400)+"days"}else{e="few years"}}else{B=(new Date).getTime()}e=(e+O).slice(0,O.length);R=e;return e};var I=t=>{var e,r,i=b,n=w,s,o,a,u="",l="",f="",h="";if(!p||g){return}e=(new Date).getTime();if((!d||d<1)&&A&&eb.length){i=i.slice(0,b.length-1)+"…"}else if(i.length=w.length){n=n.slice(0,w.length-2)+"… "}else{n=(n+w).slice(0,w.length)}}o=d===undefined?1:Math.round(s*Math.max(Math.min(d,1),0));a=s-o;if(o){if(d===undefined){u=T[++S%T.length]}else{u+=c.barChar.repeat(o-1);u+=c.barHeadChar}}l+=" ".repeat(a);c.titleStyle(n);if(f){c.percentStyle(f)}if(d===undefined){this(" ")}else{c.barBracketStyle("[")}c.barStyle(u);this(l);if(d===undefined){this(" ")}else{c.barBracketStyle("]")}c.etaStyle(h);c.itemStyle(i);this.restoreCursor();if(!c.syncMode){if(E){clearTimeout(E)}if(!d||d<1){E=setTimeout(I,c.maxRefreshTime)}}A=e};if(c.syncMode||c.inline||c.y){i=x;if(c.y){C=+c.x||1;_=+c.y||1}else{C=1;_=null}n=Math.min(C+x,this.width);x=n-C;if(x!==i){if(c.titleSize){c.titleSize=Math.floor(c.titleSize*x/i)}if(c.itemSize){c.itemSize=Math.floor(c.itemSize*x/i)}}p=true;I()}else{this.getCursorLocation((t,e,r)=>{if(t){this.row.eraseLineAfter(this.height)("\n");e=1;r=this.height}var i=x;C=e;n=Math.min(e+x,this.width);_=r;x=n-C;if(x!==i){if(c.titleSize){c.titleSize=Math.floor(c.titleSize*x/i)}if(c.itemSize){c.itemSize=Math.floor(c.itemSize*x/i)}}p=true;I()})}e.startItem=t=>{m.push(t);if(m.length===1){if(d>=1){I();return}if(c.syncMode){I()}else{if(E){clearTimeout(E)}E=setTimeout(I,0)}}};e.itemDone=t=>{var e;r++;if(y){d=r/y}else{d=undefined}f=(new Date).getTime();s++;l++;e=m.indexOf(t);if(e>=0){m.splice(e,1)}if(d>=1){I(true);return}if(c.syncMode){I()}else{if(E){clearTimeout(E)}E=setTimeout(I.bind(this,true),0)}};e.update=t=>{if(!t){t={}}else if(typeof t==="number"){t={progress:t}}if("progress"in t){if(typeof t.progress!=="number"){d=undefined}else{d=t.progress;if(d>1){d=1}else if(d<0){d=0}if(d>0){l++}f=(new Date).getTime();s++}}if(typeof t.items==="number"){y=t.items;if(y){d=r/y}if(typeof c.itemSize!=="number"){c.itemSize=Math.round(x/3);b=" ".repeat(c.itemSize)}}if(typeof t.title==="string"){v=t.title;if(typeof c.titleSize!=="number"){c.titleSize=Math.round(x/3);w=" ".repeat(c.titleSize)}}if(d>=1){I(true);return}if(c.syncMode){I()}else{if(E){clearTimeout(E)}E=setTimeout(I.bind(this,true),0)}};e.pause=e.stop=()=>{g=true};e.resume=()=>{if(g){g=false;I()}};e.reset=()=>{B=h=(new Date).getTime();r=0;d=undefined;m.length=0;S=k=s=l=0;I()};return e}},{}],50:[function(t,e,r){"use strict";const D=t("./termkit");const F=D.stringWidth;const W=t("string-kit");const H=t("nextgen-events");const N=t("seventh");const U={ENTER:"submit",KP_ENTER:"submit",UP:"previous",DOWN:"next",TAB:"cycleNext",SHIFT_TAB:"cyclePrevious",HOME:"first",END:"last",BACKSPACE:"cancel",DELETE:"cancel",ESCAPE:"escape"};e.exports=function t(e,s,n){if(arguments.length<1){throw new Error("[terminal] singleColumnMenu() needs at least an array of menuItems")}if(!Array.isArray(e)||!e.length){throw new TypeError("[terminal] singleColumnMenu(): argument #0 should be a non-empty array")}if(typeof s==="function"){n=s;s={}}else if(!s||typeof s!=="object"){s={}}if(!s.style){s.style=this}if(!s.selectedStyle){s.selectedStyle=this.inverse}if(!s.submittedStyle){s.submittedStyle=this.bgGray.bold}if(!s.disabledStyle){s.disabledStyle=this.dim}if(!s.disabledSelectedStyle){s.disabledSelectedStyle=this.bgGray.dim}if(!s.disabledSubmittedStyle){s.disabledSubmittedStyle=this.bgGray}if(s.leftPadding===undefined){s.leftPadding=" "}if(s.selectedLeftPadding===undefined){s.selectedLeftPadding=s.leftPadding}if(s.submittedLeftPadding===undefined){s.submittedLeftPadding=s.leftPadding}if(typeof s.extraLines!=="number"||s.extraLines<0){s.extraLines=1}if(!s.itemMaxWidth){s.itemMaxWidth=this.width-1}if(!s.unsubmittableIndexes){s.unsubmittableIndexes=[]}var o=s.selectedIndex||0;var a=s.submitted?s.selectedIndex:null;var u=!!s.paused;var l=s.keyBindings||U;if(!this.grabbing){this.grabInput()}var f={},h={},i,c,d,p,g=0,r=0,y=0,m,b=false,v=false;var w=()=>{x(e);if(s.y!==undefined){this.moveTo(1,s.y);_(1,s.y)}else{this("\n");this.getCursorLocation((t,e,r)=>{if(t){this.row.eraseLineAfter(this.height)("\n");e=1;r=this.height}_(e,r)})}};var x=t=>{i=0;d=Math.max(F(s.leftPadding),F(s.selectedLeftPadding));t=t.map(t=>{if(typeof t!=="string"){t=""+t}i=Math.max(i,F(t));return t});if(!s.oneLineItem&&i>s.itemMaxWidth-d){c=Math.min(i+d,this.width);p=t.map((t,e)=>{var r,i,n=s.itemMaxWidth-d;i=W.wordwrap(t,{width:n,noJoin:true,fill:true,skipFn:D.escapeSequenceSkipFn});r={offsetY:g,index:e,text:t,displayText:i};g+=i.length;return r});r=g}else{i=Math.min(i,s.itemMaxWidth-d);c=Math.min(i+d,this.width);p=t.map((t,e)=>{var r=F(t);return{offsetY:e,index:e,text:t,displayText:[r>i?t.slice(0,i-1)+"…":t+" ".repeat(i-r)]}});r=p.length}};var _=(t,e)=>{if(b){return}T(t,e);A();this.on("key",j);if(this.mouseGrabbing){this.on("mouse",L)}m.emit("ready");C()};var C=()=>{var t=p[o];m.emit("highlight",{highlightedIndex:t.index,highlightedText:t.text,submitted:a!==null,x:1,y:f.y+t.offsetY})};var T=(t,e)=>{f.x=t;f.y=e;h.x=1;h.y=e+r;y=f.y+r-(s.scrollRegionBottom||this.height)-1+s.extraLines;if(y>0){this("\n".repeat(y));f.y-=y;h.y-=y}};var S=(t,e,r)=>{if(v){return}v=true;b=true;this.removeListener("key",j);this.removeListener("mouse",L);if(t==="abort"){return}if(m.hasState("ready")){if(r){k()}else{this.moveTo(1,h.y)}}if(t){if(n){n(t)}else{m.promise.reject(t)}return}var i=e!==undefined?e:{selectedIndex:o,selectedText:p[o].text,submitted:a!==null,x:1,y:f.y+p[o].offsetY};if(n){n(undefined,i)}else{m.promise.resolve(i)}};var k=()=>{if(!m.hasState("ready")){m.once("ready",k);return}var t,e;for(t=f.x,e=f.y;e<=h.y;t=1,e++){this.moveTo.eraseLineAfter(t,e)}this.moveTo(1,f.y)};var A=()=>{for(var t=0;t{var i=p[r];i.displayText.forEach((t,e)=>{this.moveTo(1,f.y+i.offsetY+e);if(u||s.unsubmittableIndexes[r]){if(r===a){if(e){s.disabledSubmittedStyle.forceStyleOnReset.noFormat(s.leftPadding)}else{s.disabledSubmittedStyle.forceStyleOnReset.noFormat(s.submittedLeftPadding)}s.disabledSubmittedStyle.forceStyleOnReset.noFormat(t)}else if(r===o){if(e){s.disabledSelectedStyle.forceStyleOnReset.noFormat(s.leftPadding)}else{s.disabledSelectedStyle.forceStyleOnReset.noFormat(s.selectedLeftPadding)}s.disabledSelectedStyle.forceStyleOnReset.noFormat(t)}else{s.disabledStyle.forceStyleOnReset.noFormat(s.leftPadding);s.disabledStyle.forceStyleOnReset.noFormat(t)}}else if(r===a){if(e){s.submittedStyle.forceStyleOnReset.noFormat(s.leftPadding)}else{s.submittedStyle.forceStyleOnReset.noFormat(s.submittedLeftPadding)}s.submittedStyle.forceStyleOnReset.noFormat(t)}else if(r===o){if(e){s.selectedStyle.forceStyleOnReset.noFormat(s.leftPadding)}else{s.selectedStyle.forceStyleOnReset.noFormat(s.selectedLeftPadding)}s.selectedStyle.forceStyleOnReset.noFormat(t)}else{s.style.forceStyleOnReset.noFormat(s.leftPadding);s.style.forceStyleOnReset.noFormat(t)}})};var B=()=>{this.moveTo(1,f.y+p[o].offsetY)};var R=t=>{var e=o;if(o!==t&&t>=0&&t{if(a!==null||s.unsubmittableIndexes[o]){return}a=o;if(m.hasState("ready")){E(a);B()}m.emit("submit",{selectedIndex:a,selectedText:p[a].text,submitted:true,x:1,y:f.y+p[a].offsetY});if(!s.continueOnSubmit){S()}};var M=()=>{var t=a;if(a===null){return}a=null;E(t);B();m.emit("cancel")};var I=()=>{if(u){return}u=true;if(m.hasState("ready")){A()}};var P=()=>{if(!u){return}u=false;if(m.hasState("ready")){A()}};var j=(t,e,r)=>{if(b||u){return}var i=o;switch(l[t]){case"submit":O();break;case"previous":if(a!==null){return}if(o>0){o--;E(o);E(o+1);B();C()}break;case"next":if(a!==null){return}if(o=p.length){o=0}E(i);E(o);B();C();break;case"first":if(a!==null){return}if(o!==0){o=0;E(i);E(o);B();C()}break;case"last":if(a!==null){return}if(o!==p.length-1){o=p.length-1;E(i);E(o);B();C()}break;case"cancel":M();break;case"escape":if(s.cancelable){S(undefined,{canceled:true})}if(s.exitOnUnexpectedKey){S(undefined,{unexpectedKey:t,unexpectedKeyData:r})}break;default:if(s.exitOnUnexpectedKey){S(undefined,{unexpectedKey:t,unexpectedKeyData:r})}break}};var L=(t,e)=>{if(b||u||a!==null){return}if(e.y=h.y){return}var r,i,n,s=false;for(r=0;r=i&&e.y<=n&&e.x<1+c){s=true;R(r);break}}if(s&&t==="MOUSE_LEFT_BUTTON_PRESSED"){O()}};m=Object.create(H.prototype);m.defineStates("ready");m.abort=()=>{if(b){return}S("abort")};m.stop=t=>{if(b){return}S(undefined,undefined,t)};m.select=R;m.submit=O;m.cancel=M;m.erase=k;m.pause=I;m.resume=P;m.focus=t=>{if(t){P()}else{I()}};m.getState=()=>({selectedIndex:o,selectedText:p[o].text,submitted:a!==null,start:f,end:h,x:1,y:f.y+p[o].offsetY});m.getPosition=()=>({x:f.x,y:f.y});m.hide=()=>{if(!m.hasState("ready")){m.once("ready",m.hide);return}k()};m.show=()=>{if(!m.hasState("ready")){m.once("ready",m.show);return}A()};m.redraw=()=>{if(!m.hasState("ready")){m.once("ready",m.redraw);return}A()};m.redrawCursor=()=>{if(!m.hasState("ready")){m.once("ready",m.redrawCursor);return}B()};m.rebase=()=>{if(!m.hasState("ready")){m.once("ready",m.rebase);return}var i=u;u=true;this.getCursorLocation((t,e,r)=>{if(t){return}u=i;T(e,r);A();m.emit("rebased")})};m.promise=new N;w();return m}},{"./termkit":55,"nextgen-events":77,seventh:113,"string-kit":127}],51:[function(t,e,r){"use strict";const C=t("./termkit");const T=C.stringWidth;const S=t("nextgen-events");const k=t("seventh");const A={ENTER:"submit",KP_ENTER:"submit",LEFT:"previous",RIGHT:"next",UP:"previousPage",DOWN:"nextPage",TAB:"cycleNext",SHIFT_TAB:"cyclePrevious",HOME:"first",END:"last",ESCAPE:"escape"};e.exports=function t(e,h,n){if(arguments.length<1){throw new Error("[terminal] singleLineMenu() needs at least an array of menuItems")}if(!Array.isArray(e)||!e.length){throw new TypeError("[terminal] singleLineMenu(): argument #0 should be a non-empty array")}if(typeof h==="function"){n=h;h={}}else if(!h||typeof h!=="object"){h={}}if(h.separator===undefined){h.separator=" "}if(h.nextPageHint===undefined){h.nextPageHint=" » "}if(h.previousPageHint===undefined){h.previousPageHint=" « "}if(!h.style){h.style=this}if(!h.selectedStyle){h.selectedStyle=this.dim.blue.bgGreen}if(!h.y){this("\n")}else{this.moveTo(1,h.y)}var s=h.keyBindings||A;if(!this.grabbing){this.grabInput()}var c=e.map(t=>typeof t==="string"?t:""+t);var d=h.selectedIndex=h.selectedIndex||0;var a={},p=0,u=false,g=[],o=false;var y=T(h.nextPageHint),m=T(h.previousPageHint),b=T(h.separator);var i=()=>{var t,e,r,i=0,n=1,s,o=true,a,u,l,f=this.width-y;g=[[]];for(t=0;t=g.length){g.push([])}e=T(c[t]);s=n+e+b;if(s>f){if(o){e=f-n;r=C.truncateString(c[t],e-1)+"…";if(t===h.selectedIndex){p=i;d=g[i].length}g[i].push({index:t,text:c[t],displayText:r,displayTextWidth:e,x:n})}else{t--}i++;n=1+m;o=true;continue}if(t===h.selectedIndex){p=i;d=g[i].length}g[i].push({index:t,text:c[t],displayText:c[t],displayTextWidth:e,x:n});n=s;o=false}for(i=0;it.x+=l)}}}};var l=(t,e)=>{if(o){return}o=true;u=true;this.removeListener("key",w);this.removeListener("mouse",x);if(t){if(n){n(t)}else{_.promise.reject(t)}return}var r=g[p];var i=e!==undefined?e:{selectedIndex:r[d].index,selectedText:r[d].text,x:r[d].x,y:a.y};if(n){n(undefined,i)}else{_.promise.resolve(i)}};var f=()=>{var t,e,r=g[p],i=r.x;this.moveTo.eraseLineAfter(1,a.y);if(h.fillIn&&i>1){h.style.noFormat(" ".repeat(i-1))}else{this.column(i)}if(p){h.style.forceStyleOnReset.noFormat(h.previousPageHint);i+=m}for(t=0;t{var t=g[p][d];_.emit("highlight",{highlightedIndex:t.index,highlightedText:t.text,x:t.x,y:a.y})};var w=(t,e,r)=>{if(u){return}var i=false,n=g[p];switch(s[t]){case"submit":l();break;case"previous":if(d>0){d--;i=true}else if(p>0){p--;d=g[p].length-1;i=true}break;case"next":if(d0){d--;i=true}else if(p>0){p--;d=g[p].length-1;i=true}break;case"first":if(p!==0||d!==0){p=0;d=0;i=true}break;case"last":if(p!==g.length-1||d!==g[p].length-1){p=g.length-1;d=g[p].length-1;i=true}break;case"previousPage":if(p>0){p--;d=0;i=true}break;case"nextPage":if(p{if(u){return}if(e.y!==a.y){return}var r,i,n,s=false,o=g[p];if(t==="MOUSE_LEFT_BUTTON_PRESSED"){if(p>0&&e.x>=1&&e.x<1+m){p--;d=0;f();v();return}n=o[o.length-1].x+o[o.length-1].displayTextWidth;if(p=n&&e.x=i.x&&e.x{if(t){this.row.eraseLineAfter(this.height)("\n");e=1;r=this.height}a.x=e;a.y=r;i();f();v();this.on("key",w);if(this.mouseGrabbing){this.on("mouse",x)}});return _}},{"./termkit":55,"nextgen-events":77,seventh:113}],52:[function(t,e,r){"use strict";var l=t("seventh");e.exports=function t(e,r,i){if(typeof e!=="string"){throw new TypeError("[terminal] slowTyping(): argument #0 should be a string")}if(typeof r==="function"){i=r;r={}}if(!r||typeof r!=="object"){r={}}if(!r.style){r.style=this.green}if(!r.delay){r.delay=150}if(!r.flashStyle){r.flashStyle=this.bold.brightGreen}if(!r.flashDelay){r.flashDelay=100}var n,s,o=new l;var a=()=>{if(s){clearTimeout(s);s=null;u()}if(n===undefined){n=0}else if(n>=e.length){if(i){i()}else{o.resolve()}return}else{if(r.flashStyle&&e[n].match(/\S/)){r.flashStyle(e[n]);s=setTimeout(u,r.flashDelay)}else{r.style(e[n])}n++}setTimeout(a,(.2+Math.random()*1.8)*r.delay)};var u=()=>{this.left(1);r.style(e[n-1]);s=null};a();return o}},{seventh:113}],53:[function(t,e,r){"use strict";const i="⠀⠁⠂⠃⠄⠅⠆⠇⡀⡁⡂⡃⡄⡅⡆⡇⠈⠉⠊⠋⠌⠍⠎⠏⡈⡉⡊⡋⡌⡍⡎⡏⠐⠑⠒⠓⠔⠕⠖⠗⡐⡑⡒⡓⡔⡕⡖⡗⠘⠙⠚⠛⠜⠝⠞⠟⡘⡙⡚⡛⡜⡝⡞⡟⠠⠡⠢⠣⠤⠥⠦⠧⡠⡡⡢⡣⡤⡥⡦⡧⠨⠩⠪⠫⠬⠭⠮⠯⡨⡩⡪⡫⡬⡭⡮⡯⠰⠱⠲⠳⠴⠵⠶⠷⡰⡱⡲⡳⡴⡵⡶⡷⠸⠹⠺⠻⠼⠽⠾⠿⡸⡹⡺⡻⡼⡽⡾⡿⢀⢁⢂⢃⢄⢅⢆⢇⣀⣁⣂⣃⣄⣅⣆⣇⢈⢉⢊⢋⢌⢍⢎⢏⣈⣉⣊⣋⣌⣍⣎⣏⢐⢑⢒⢓⢔⢕⢖⢗⣐⣑⣒⣓⣔⣕⣖⣗⢘⢙⢚⢛⢜⢝⢞⢟⣘⣙⣚⣛⣜⣝⣞⣟⢠⢡⢢⢣⢤⢥⢦⢧⣠⣡⣢⣣⣤⣥⣦⣧⢨⢩⢪⢫⢬⢭⢮⢯⣨⣩⣪⣫⣬⣭⣮⣯⢰⢱⢲⢳⢴⢵⢶⢷⣰⣱⣲⣳⣴⣵⣶⣷⢸⢹⢺⢻⢼⢽⢾⢿⣸⣹⣺⣻⣼⣽⣾⣿".split("");const n=[" ","▁","▂","▃","▄","▅","▆","▇","█"];const s=[" ","▏","▎","▍","▌","▋","▊","▉","█"];e.exports={password:"●",ellispsis:"…",forwardSingleQuote:"´",overscore:"¯",multiply:"×",divide:"÷",up:"↑",down:"↓",left:"←",right:"→",leftAndRight:"↔",upAndDown:"↕",upLeft:"↖",upRight:"↗",downRight:"↘",downLeft:"↙",upLeftAndDownRight:"⤡",upRightAndDownLeft:"⤢",northWest:"↖",northEast:"↗",southEast:"↘",southWest:"↙",northWestAndSouthEast:"⤡",northEastAndSouthWest:"⤢",fullBlock:"█",upperHalfBlock:"▀",lowerHalfBlock:"▄",growingBlock:n,enlargingBlock:s,bitDots:i,bar:{classic:{border:["[","]"],body:["="," "]},classicWithArrow:{border:["[","]"],body:["=",">"," "]},classicWithHalf:{border:["[","]"],body:["="," ","-","="," "]},solid:{border:["^!▉","▏"],body:["█",...s," "]}},box:{__fix__:t=>({vertical:t.vertical||" ",horizontal:t.horizontal||" ",topLeft:t.topLeft||" ",topRight:t.topRight||" ",bottomLeft:t.bottomLeft||" ",bottomRight:t.bottomRight||" ",topTee:t.topTee||" ",bottomTee:t.bottomTee||" ",leftTee:t.leftTee||" ",rightTee:t.rightTee||" ",cross:t.cross||" "}),plain:{vertical:"█",horizontal:"█",topLeft:"█",topRight:"█",bottomLeft:"█",bottomRight:"█",topTee:"█",bottomTee:"█",leftTee:"█",rightTee:"█",cross:"█"},empty:{vertical:" ",horizontal:" ",topLeft:" ",topRight:" ",bottomLeft:" ",bottomRight:" ",topTee:" ",bottomTee:" ",leftTee:" ",rightTee:" ",cross:" "},ascii:{vertical:"|",horizontal:"-",topLeft:"|",topRight:"|",bottomLeft:"|",bottomRight:"|",topTee:"-",bottomTee:"-",leftTee:"|",rightTee:"|",cross:"+"},light:{vertical:"│",horizontal:"─",topLeft:"┌",topRight:"┐",bottomLeft:"└",bottomRight:"┘",topTee:"┬",bottomTee:"┴",leftTee:"├",rightTee:"┤",cross:"┼"},lightRounded:{vertical:"│",horizontal:"─",topLeft:"╭",topRight:"╮",bottomLeft:"╰",bottomRight:"╯",topTee:"┬",bottomTee:"┴",leftTee:"├",rightTee:"┤",cross:"┼"},heavy:{vertical:"┃",horizontal:"━",topLeft:"┏",topRight:"┓",bottomLeft:"┗",bottomRight:"┛",topTee:"┳",bottomTee:"┻",leftTee:"┣",rightTee:"┫",cross:"╋"},double:{vertical:"║",horizontal:"═",topLeft:"╔",topRight:"╗",bottomLeft:"╚",bottomRight:"╝",topTee:"╦",bottomTee:"╩",leftTee:"╠",rightTee:"╣",cross:"╬"},dotted:{vertical:"┊",horizontal:"┄",topLeft:"┌",topRight:"┐",bottomLeft:"└",bottomRight:"┘",topTee:"┬",bottomTee:"┴",leftTee:"├",rightTee:"┤",cross:"┼"}},animation:{asciiSpinner:["│","/","-","\\"],lineSpinner:["│","/","─","\\"],dotSpinner:[i[7],i[19],i[49],i[112],i[224],i[200],i[140],i[14]],bitDots:i,impulse:["∙∙∙","●∙∙","∙●∙","∙∙●","∙●∙","●∙∙","∙∙∙","∙∙∙"],unboxing:[" ","▁","▂","▃","▄","▅","▆","▇","█","▉","▊","▋","▌","▍","▎","▏"],"unboxing-color":["^r^#^b ","^r^#^b▁","^r^#^b▂","^r^#^b▃","^r^#^b▄","^r^#^b▅","^r^#^b▆","^r^#^b▇","^r^#^m█","^r^#^m▉","^r^#^m▊","^r^#^m▋","^r^#^m▌","^r^#^m▍","^r^#^m▎","^r^#^m▏","^m^#^y█","^m^#^y▇","^m^#^y▆","^m^#^y▅","^m^#^y▄","^m^#^y▃","^m^#^y▂","^m^#^y▁","^b^#^y ","^b^#^y▏","^b^#^y▎","^b^#^y▍","^b^#^y▌","^b^#^y▋","^b^#^y▊","^b^#^y▉"]},blackSquare:"■",whiteSquare:"□",blackCircle:"●",whiteCircle:"○",blackUpTriangle:"▲",whiteUpTriangle:"△",blackDownTriangle:"▼",whiteDownTriangle:"▽",blackLeftTriangle:"◀",whiteLeftTriangle:"◁",blackRightTriangle:"▶",whiteRightTriangle:"▷",blackDiamond:"◆",whiteDiamond:"◇",blackStar:"★",whiteStar:"☆",spadeSuit:"♠",heartSuit:"♥",diamondSuit:"♦",clubSuit:"♣",powerline:{branch:"",line:"",readOnly:"",rightTriangleSeparator:"",rightArrowSeparator:"",leftTriangleSeparator:"",leftArrowSeparator:""}}},{}],54:[function(e,r,t){(function(n){(function(){"use strict";const i={};r.exports=i;const t=e("lazyness")(e);i.globalConfig={};i.tty=e("./tty.js");if(n.env.TERM==="linux"){i.tty.getPath()}Object.assign(i,e("./misc.js"));Object.assign(i,e("./detectTerminal.js"));i.Terminal=e("./Terminal.js");i.createTerminal=i.Terminal.create;if(n.platform==="win32"){e("./windows.js")(i)}i.image=e("./image.js");i.Palette=e("./Palette.js");i.Rect=e("./Rect.js");i.ScreenBuffer=e("./ScreenBuffer.js");i.ScreenBufferHD=e("./ScreenBufferHD.js");i.TextBuffer=e("./TextBuffer.js");i.Vte=e("./vte/Vte.js");i.autoComplete=e("./autoComplete.js");i.spChars=e("./spChars.js");i.Element=e("./document/Element.js");i.Document=e("./document/Document.js");i.Container=e("./document/Container.js");i.Text=e("./document/Text.js");i.AnimatedText=e("./document/AnimatedText.js");i.Button=e("./document/Button.js");i.ToggleButton=e("./document/ToggleButton.js");i.TextBox=e("./document/TextBox.js");i.EditableTextBox=e("./document/EditableTextBox.js");i.Slider=e("./document/Slider.js");i.Bar=e("./document/Bar.js");i.LabeledInput=e("./document/LabeledInput.js");i.InlineInput=e("./document/InlineInput.js");i.InlineFileInput=e("./document/InlineFileInput.js");i.InlineMenu=e("./document/InlineMenu.js");i.Form=e("./document/Form.js");i.RowMenu=e("./document/RowMenu.js");i.ColumnMenu=e("./document/ColumnMenu.js");i.ColumnMenuMulti=e("./document/ColumnMenuMulti.js");i.ColumnMenuMixed=e("./document/ColumnMenuMixed.js");i.SelectList=e("./document/SelectList.js");i.SelectListMulti=e("./document/SelectListMulti.js");i.DropDownMenu=e("./document/DropDownMenu.js");i.TextTable=e("./document/TextTable.js");i.Layout=e("./document/Layout.js");i.Border=e("./document/Border.js");i.Window=e("./document/Window.js");i.chroma=e("chroma-js");t.properties(i,{terminal:()=>{var t=i.guessTerminal();return i.createTerminal({stdin:n.stdin,stdout:n.stdout,stderr:n.stderr,generic:t.generic||"unknown",appId:t.safe?t.appId:undefined,isTTY:t.isTTY,isSSH:t.isSSH,processSigwinch:true,preferProcessSigwinch:!!i.globalConfig.preferProcessSigwinch})},realTerminal:()=>{var t=i.guessTerminal(true);var e=i.tty.getInput();var r=i.tty.getOutput();return i.createTerminal({stdin:e,stdout:r,stderr:n.stderr,generic:t.generic||"unknown",appId:t.safe?t.appId:undefined,isTTY:true,isSSH:t.isSSH,processSigwinch:true,preferProcessSigwinch:!!i.globalConfig.preferProcessSigwinch})}},true)}).call(this)}).call(this,e("_process"))},{"./Palette.js":1,"./Rect.js":2,"./ScreenBuffer.js":3,"./ScreenBufferHD.js":4,"./Terminal.js":5,"./TextBuffer.js":6,"./autoComplete.js":7,"./detectTerminal.js":12,"./document/AnimatedText.js":13,"./document/Bar.js":14,"./document/Border.js":16,"./document/Button.js":17,"./document/ColumnMenu.js":18,"./document/ColumnMenuMixed.js":19,"./document/ColumnMenuMulti.js":20,"./document/Container.js":21,"./document/Document.js":22,"./document/DropDownMenu.js":23,"./document/EditableTextBox.js":24,"./document/Element.js":25,"./document/Form.js":26,"./document/InlineFileInput.js":27,"./document/InlineInput.js":28,"./document/InlineMenu.js":29,"./document/LabeledInput.js":30,"./document/Layout.js":31,"./document/RowMenu.js":32,"./document/SelectList.js":33,"./document/SelectListMulti.js":34,"./document/Slider.js":35,"./document/Text.js":36,"./document/TextBox.js":37,"./document/TextTable.js":38,"./document/ToggleButton.js":39,"./document/Window.js":40,"./image.js":45,"./misc.js":47,"./spChars.js":53,"./tty.js":56,"./vte/Vte.js":58,"./windows.js":61,_process:184,"chroma-js":64,lazyness:73}],55:[function(s,o,t){(function(n,r){(function(){"use strict";const t=s("path");if(n.browser||s.cache[t.join(r,"termkit-no-lazy-require.js")]){console.log("using termkit-no-lazy-require.js");o.exports=s("./termkit-no-lazy-require.js");return}const i={};o.exports=i;const e=s("lazyness")(s);i.globalConfig={};e.requireProperty(i,"tty","./tty.js");if(n.env.TERM==="linux"){i.tty.getPath()}Object.assign(i,s("./misc.js"));Object.assign(i,s("./detectTerminal.js"));i.Terminal=s("./Terminal.js");i.createTerminal=i.Terminal.create;if(n.platform==="win32"){s("./windows.js")(i)}e.requireProperties(i,{image:"./image.js",Palette:"./Palette.js",Rect:"./Rect.js",ScreenBuffer:"./ScreenBuffer.js",ScreenBufferHD:"./ScreenBufferHD.js",TextBuffer:"./TextBuffer.js",Vte:"./vte/Vte.js",autoComplete:"./autoComplete.js",spChars:"./spChars.js",Element:"./document/Element.js",Document:"./document/Document.js",Container:"./document/Container.js",Text:"./document/Text.js",AnimatedText:"./document/AnimatedText.js",Button:"./document/Button.js",ToggleButton:"./document/ToggleButton.js",TextBox:"./document/TextBox.js",EditableTextBox:"./document/EditableTextBox.js",Slider:"./document/Slider.js",Bar:"./document/Bar.js",LabeledInput:"./document/LabeledInput.js",InlineInput:"./document/InlineInput.js",InlineFileInput:"./document/InlineFileInput.js",InlineMenu:"./document/InlineMenu.js",Form:"./document/Form.js",RowMenu:"./document/RowMenu.js",ColumnMenu:"./document/ColumnMenu.js",ColumnMenuMulti:"./document/ColumnMenuMulti.js",ColumnMenuMixed:"./document/ColumnMenuMixed.js",SelectList:"./document/SelectList.js",SelectListMulti:"./document/SelectListMulti.js",DropDownMenu:"./document/DropDownMenu.js",TextTable:"./document/TextTable.js",Layout:"./document/Layout.js",Border:"./document/Border.js",Window:"./document/Window.js",chroma:"chroma-js"});e.properties(i,{terminal:()=>{var t=i.guessTerminal();return i.createTerminal({stdin:n.stdin,stdout:n.stdout,stderr:n.stderr,generic:t.generic||"unknown",appId:t.safe?t.appId:undefined,isTTY:t.isTTY,isSSH:t.isSSH,processSigwinch:true,preferProcessSigwinch:!!i.globalConfig.preferProcessSigwinch})},realTerminal:()=>{var t=i.guessTerminal(true);var e=i.tty.getInput();var r=i.tty.getOutput();return i.createTerminal({stdin:e,stdout:r,stderr:n.stderr,generic:t.generic||"unknown",appId:t.safe?t.appId:undefined,isTTY:true,isSSH:t.isSSH,processSigwinch:true,preferProcessSigwinch:!!i.globalConfig.preferProcessSigwinch})}},true)}).call(this)}).call(this,s("_process"),"/lib")},{"./Terminal.js":5,"./detectTerminal.js":12,"./misc.js":47,"./termkit-no-lazy-require.js":54,"./windows.js":61,_process:184,lazyness:73,path:183}],56:[function(e,r,t){(function(l){(function(){"use strict";var a=e("child_process").execSync;var i=e("fs");var n=e("tty");var t={};r.exports=t;var u;t.getPath=function t(e){var r,i,n,s,o;if(!e){e=0}if(e===0||e===l.stdin){if(u){return u}r=true}try{n=a("tty",{stdio:[e,null,null]}).toString()}catch(t){n=t.stdout.toString()}n=n.trim();o=n.match(/\/dev\/tty([0-9]*)/);s=o?o[1]||null:null;i={path:n,index:s};if(r){u=i}return i};t.getInput=function t(){var e,r;e=i.openSync("/dev/tty","r");if(!n.isatty(e)){throw new Error("Input file descriptor is not a TTY.")}r=new n.ReadStream(e);r._type="tty";return r};t.getOutput=function t(){var e,r;e=i.openSync("/dev/tty","w");if(!n.isatty(e)){throw new Error("Output file descriptor is not a TTY.")}r=new n.WriteStream(e);r._type="tty";if(r._handle&&r._handle.unref){r._handle.unref()}if(r._refreshSize){l.on("SIGWINCH",()=>{r._refreshSize()})}return r}}).call(this)}).call(this,e("_process"))},{_process:184,child_process:141,fs:141,tty:203}],57:[function(r,n,t){(function(k){(function(){"use strict";const g=r("./fromOutputSequence.js");const y=r("string-kit");const t=r("nextgen-events");const i=r("seventh");function e(t={}){}n.exports=e;e.prototype=Object.create(t.prototype);e.prototype.constructor=e;async function m(t,e=1){var r;r=t.read(e);while(r===null){await i.onceEventOrError(t,"readable",["close","end"]);r=t.read(e)}return r}function b(t){return t>=65&&t<=90||t>=97&&t<=122}function v(t){var e=t.toString(16);e=e.length>1?"\\x"+e:"\\x0"+e;return e}function w(t){if(t<=31||t===127){return v(t)}return String.fromCharCode(t)}function x(r,t){if(!t||!t.length){return r}r=Array.from(r);t.forEach((t,e)=>{if(t!==undefined&&r[e]===undefined){r[e]=t}});return r}const _=new Set("(",")","*","+","-",".","/"," ","#","%");const C=new Set("?",">","<");const T=new Set(" ","$","#",'"',"'","*");const S=new Set("?");e.prototype.streamToEvent=async function(t){var e,r,i,n,s,o,a,u,l,f,h,c,d,p=k.alloc(6);for(;;){e=(await m(t))[0];if(e<=31||e===127){r=v(e);if(e===27){e=(await m(t))[0];if(e===91){a="";while(!b(e=(await m(t))[0])){a+=String.fromCharCode(e)}o=String.fromCharCode(e);a=a?a.split(";"):[];l=true;if(a.length&&C.has(a[0][0])){o=a[0][0]+o;a[0]=a[0].slice(1)}if(a.length&&T.has(a[a.length-1][a[a.length-1]-1])){o=a[a.length-1][a[a.length-1]-1]+o;a[a.length-1]=a[a.length-1].slice(0,-1)}h=g.CSI[o];console.error(">>>>>>>>>> CSI parsing:",o,a);if(h){if(h.subTree&&a.length){d=h;for(u=0;u=128){if(e<192){continue}else if(e<224){n=2}else if(e<240){n=3}else if(e<248){n=4}else if(e<252){n=5}else{n=6}p[0]=e;p[1]=p[2]=p[3]=p[4]=p[5]=0;(await m(t,n-1)).copy(p,1);i=p.toString("utf8");s=y.unicode.firstCodePoint(i);this.emit("char",i,s)}else{i=String.fromCharCode(e);this.emit("char",i,e)}}}}).call(this)}).call(this,r("buffer").Buffer)},{"./fromOutputSequence.js":59,buffer:152,"nextgen-events":77,seventh:113,"string-kit":127}],58:[function(s,t,e){"use strict";const r=s("../ScreenBuffer.js");const i=s("../Rect.js");const n=s("string-kit");const o=s("./toInputSequence.js");const a=s("./SequencesReader.js");const u=s("nextgen-events");const l=s("seventh");const f=s("child_process").spawn;const h=(...t)=>console.error("",...t,"");const c=(...t)=>console.error(...t);function d(t={}){this.width=Math.floor(t.width)||(t.dst?t.dst.width:80);this.height=Math.floor(t.height)||(t.dst?t.dst.height:25);this.palette=t.palette||this.dst&&this.dst.palette;this.screenBuffer=new r(Object.assign({},t,this,{wrap:true}));this.screenBuffer.setClearAttr({defaultColor:true,bgDefaultColor:true});this.cx=0;this.cy=0;this.savedCx=0;this.savedCy=0;this.attr=0;this.resetAttr();this.scrollingRegion=null;this.tabWidth=8;this.mouseEvent=null;this.focusEvent=false;this.mouseIsDragging=false;this.eventInput=t.eventInput;this.childSequencesReader=new a;this.childProcess=null;this.onEventInputKey=this.onEventInputKey.bind(this);this.onEventInputMouse=this.onEventInputMouse.bind(this);this.onEventInputTerminal=this.onEventInputTerminal.bind(this);this.onChildOutputReset=this.onChildOutputReset.bind(this);this.onChildOutputChar=this.onChildOutputChar.bind(this);this.onChildOutputCursor=this.onChildOutputCursor.bind(this);this.onChildOutputEdit=this.onChildOutputEdit.bind(this);this.onChildOutputAttr=this.onChildOutputAttr.bind(this);this.onChildOutputPalette=this.onChildOutputPalette.bind(this);this.onChildOutputCursorAttr=this.onChildOutputCursorAttr.bind(this);this.onChildOutputBell=this.onChildOutputBell.bind(this);this.onChildOutputDevice=this.onChildOutputDevice.bind(this);this.onChildOutputSystem=this.onChildOutputSystem.bind(this);this.onChildOutputControl=this.onChildOutputControl.bind(this);this.onChildOutputESC=this.onChildOutputESC.bind(this);this.onChildOutputCSI=this.onChildOutputCSI.bind(this);this.onChildOutputOSC=this.onChildOutputOSC.bind(this);this.drawDebounce=l.debounce(this.drawDelay.bind(this))}t.exports=d;d.prototype=Object.create(u.prototype);d.prototype.constructor=d;d.prototype.run=function(e,r){var t,i,n=new l;if(this.childProcess){return}this.start();try{t=s("child_pty");i=t.spawn(e,r,{columns:this.width,rows:this.height})}catch(t){h("'child_pty' optional dependency not found, using regular child_process.spawn()");i=f(e,r)}this.childProcess=i;this.on("input",t=>i.stdin.write(t));this.childSequencesReader.streamToEvent(i.stdout);i.on("close",t=>{this.childProcess=null;n.resolve()});return n};d.prototype.start=function(){if(this.eventInput){this.eventInput.on("key",this.onEventInputKey);this.eventInput.on("mouse",this.onEventInputMouse);this.eventInput.on("terminal",this.onEventInputTerminal)}this.childSequencesReader.on("reset",this.onChildOutputReset);this.childSequencesReader.on("char",this.onChildOutputChar);this.childSequencesReader.on("cursor",this.onChildOutputCursor);this.childSequencesReader.on("edit",this.onChildOutputEdit);this.childSequencesReader.on("attr",this.onChildOutputAttr);this.childSequencesReader.on("palette",this.onChildOutputPalette);this.childSequencesReader.on("cursorAttr",this.onChildOutputCursorAttr);this.childSequencesReader.on("bell",this.onChildOutputBell);this.childSequencesReader.on("device",this.onChildOutputDevice);this.childSequencesReader.on("system",this.onChildOutputSystem);this.childSequencesReader.on("control",this.onChildOutputControl);this.childSequencesReader.on("ESC",this.onChildOutputESC);this.childSequencesReader.on("CSI",this.onChildOutputCSI);this.childSequencesReader.on("OSC",this.onChildOutputOSC)};d.prototype.draw=function(){var t=this.screenBuffer.draw({delta:true});this.screenBuffer.drawCursor();c("draw stats:",t)};d.prototype.redraw=function(){var t=this.screenBuffer.draw({delta:false});this.screenBuffer.drawCursor();c("redraw stats:",t)};d.prototype.drawDelay=async function(){await l.resolveNextTick();this.draw()};d.prototype.putChar=function(t){var e=t.charCodeAt(0);c("putChar:",e<=31||e===127?"(ctrl)":t,e>=16?"\\x"+e.toString(16):"\\x0"+e.toString(16),"at:",this.cx,this.cy);this.screenBuffer.put({x:this.cx,y:this.cy,attr:this.attr},t);this.cx++;if(this.cx>=this.width){this.newLine()}else{this.drawDebounce()}};d.prototype.moveCursorTo=function(t,e,r=false){if(r){if(t!==undefined){this.cx=t}if(e!==undefined){this.cy=e}}else{if(t!==undefined){this.cx=t-1}if(e!==undefined){this.cy=e-1}}if(this.cx<0){this.cx=0}else if(this.cx>=this.width-1){this.cx=this.width-1}if(this.cy<0){this.cy=0}else if(this.cy>=this.height-1){this.cy=this.height-1}this.screenBuffer.cx=this.cx;this.screenBuffer.cy=this.cy;this.screenBuffer.drawCursor()};d.prototype.moveCursor=function(t,e){this.moveCursorTo(this.cx+t,this.cy+e,true)};d.prototype.nextTab=function(){this.moveCursorTo(Math.ceil((this.cx+1)/this.tabWidth)*this.tabWidth,undefined,true)};d.prototype.vScroll=function(t,e){var r=0,i=this.height-1;if(this.scrollingRegion&&this.cy>=this.scrollingRegion.ymin&&this.cy<=this.scrollingRegion.ymax){({ymin:r,ymax:i}=this.scrollingRegion)}c("################### vScroll:",t,r,i);this.screenBuffer.vScroll(t,this.attr,r,i,true);if(!e){this.drawDebounce()}};d.prototype.lineFeed=function(t,e){var r=0,i=this.height-1;if(this.scrollingRegion&&this.cy>=this.scrollingRegion.ymin&&this.cy<=this.scrollingRegion.ymax){({ymin:r,ymax:i}=this.scrollingRegion)}this.screenBuffer.cy=++this.cy;if(t){this.screenBuffer.cx=this.cx=0}if(this.cy>i){this.screenBuffer.cy=this.cy=i;this.vScroll(-1,e);if(!e){this.screenBuffer.drawCursor()}}else if(!e){this.drawDebounce()}};d.prototype.newLine=function(t){return this.lineFeed(true,t)};d.prototype.reverseLineFeed=function(t,e){var r=0,i=this.height-1;if(this.scrollingRegion&&this.cy>=this.scrollingRegion.ymin&&this.cy<=this.scrollingRegion.ymax){({ymin:r,ymax:i}=this.scrollingRegion)}this.screenBuffer.cy=--this.cy;if(t){this.screenBuffer.cx=this.cx=0}if(this.cythis.cx){t=this.cx}if(t<=0){return}this.screenBuffer.copyRegion({xmin:this.cx,ymin:this.cy,xmax:this.width-1,ymax:this.cy},{x:this.cx-t,y:this.cy});this.cx-=t;this.screenBuffer.fill({region:{xmin:this.width-t,ymin:this.cy,xmax:this.width-1,ymax:this.cy},attr:this.attr}," ");this.screenBuffer.cx=this.cx;this.drawDebounce()};d.prototype.delete=function(t=1){if(t>this.width-this.cx){t=this.width-this.cx}if(t<=0){return}if(this.cx+tthis.width-this.cx){t=this.width-this.cx}if(t<=0){return}this.screenBuffer.fill({region:{xmin:this.cx,ymin:this.cy,xmax:this.cx+t-1,ymax:this.cy},attr:this.attr}," ");c("erase:",t,"fill region:",{xmin:this.cx,ymin:this.cy,xmax:this.cx+t-1,ymax:this.cy});this.drawDebounce()};d.prototype.deleteLine=function(t=1){if(t>this.height-this.cy){t=this.height-this.cy}if(t<=0){return}if(this.cy+tthis.height-this.cy){t=this.height-this.cy}if(t<=0){return}if(this.cy+t>> ",e);if(!e){return}this.emit("input",n.format(o.reports.registerColor,t,e.r,e.g,e.b))};d.prototype.emitMouseSGR=function(t,e){var r=0,i=false;if(e.shift){r|=4}if(e.alt){r|=8}if(e.ctrl){r|=16}switch(t){case"MOUSE_LEFT_BUTTON_PRESSED":break;case"MOUSE_MIDDLE_BUTTON_PRESSED":r|=1;break;case"MOUSE_RIGHT_BUTTON_PRESSED":r|=2;break;case"MOUSE_OTHER_BUTTON_PRESSED":r|=3;break;case"MOUSE_LEFT_BUTTON_RELEASED":i=true;break;case"MOUSE_MIDDLE_BUTTON_RELEASED":r|=1;i=true;break;case"MOUSE_RIGHT_BUTTON_RELEASED":r|=2;i=true;break;case"MOUSE_OTHER_BUTTON_RELEASED":r|=3;i=true;break;case"MOUSE_WHEEL_UP":r|=64;break;case"MOUSE_WHEEL_DOWN":r|=65;break;case"MOUSE_MOTION":r|=32;break}this.emit("input","[<"+r+";"+e.x+";"+e.y+(i?"m":"M"))};d.prototype.onEventInputKey=function(t,e,r){c("onEventInputKey:",t);if(r.isCharacter){this.emit("input",t)}else if(o.specialKeys[t]){this.emit("input",o.specialKeys[t])}};d.prototype.onEventInputMouse=function(t,e){if(!this.mouseEvent){return}if(this.eventInput===this.screenBuffer.dst){e.x-=this.screenBuffer.x-1;e.y-=this.screenBuffer.y-1}switch(t){case"MOUSE_LEFT_BUTTON_PRESSED":case"MOUSE_MIDDLE_BUTTON_PRESSED":case"MOUSE_RIGHT_BUTTON_PRESSED":case"MOUSE_OTHER_BUTTON_PRESSED":this.mouseIsDragging=true;this.emitMouseSGR(t,e);break;case"MOUSE_LEFT_BUTTON_RELEASED":case"MOUSE_MIDDLE_BUTTON_RELEASED":case"MOUSE_RIGHT_BUTTON_RELEASED":case"MOUSE_OTHER_BUTTON_RELEASED":this.mouseIsDragging=false;this.emitMouseSGR(t,e);break;case"MOUSE_WHEEL_UP":case"MOUSE_WHEEL_DOWN":this.emitMouseSGR(t,e);break;case"MOUSE_MOTION":if(this.mouseEvent==="motion"||this.mouseEvent==="drag"&&this.mouseIsDragging){this.emitMouseSGR(t,e)}break}};d.prototype.onEventInputTerminal=function(t,e){switch(t){case"FOCUS_IN":if(this.focusEvent){this.emitFocus(true)}break;case"FOCUS_OUT":if(this.focusEvent){this.emitFocus(false)}break}};d.prototype.onChildOutputReset=function(){h("full reset")};d.prototype.onChildOutputChar=function(t,e){this.putChar(t)};d.prototype.onChildOutputCursor=function(t,e,r){c("cursor:",t,e,r);var i=r&&r[0]?+r[0]:undefined;var n=r&&r[1]?+r[1]:undefined;switch(t){case"lineFeed":return this.lineFeed();case"carriageReturn":return this.moveCursorTo(0,undefined,true);case"tab":return this.nextTab();case"move":this.moveCursor(i,n);break;case"up":this.moveCursor(0,-i);break;case"down":this.moveCursor(0,i);break;case"right":this.moveCursor(i,0);break;case"left":this.moveCursor(-i,0);break;case"moveToYX":this.moveCursorTo(n,i);break;case"column":this.moveCursorTo(i);break;case"row":this.moveCursorTo(undefined,i);break;case"previousLine":this.moveCursor(-this.cx,-i);break;case"nextLine":this.moveCursor(-this.cx,i);break;case"save":this.savedCx=this.cx;this.savedCy=this.cy;break;case"restore":this.moveCursorTo(this.savedCx,this.savedCy,true);break;default:h("Unknown/unsupported cursor action",t,e,r)}};d.prototype.onChildOutputEdit=function(t,e,r){var i=r&&r[0]?+r[0]:undefined;var n=r&&r[1]?+r[1]:undefined;switch(t){case"backDelete":c("backDelete",i);return this.backDelete(i);case"delete":c("delete",i);return this.delete(i);case"erase":c("erase",e);this.erase(e);break;case"deleteLine":c("deleteLine",i);this.deleteLine(i);break;case"insertLine":c("insertLine",i);this.insertLine(i);break;case"eraseLine":c("eraseLine",e);this.eraseLine(e);break;case"eraseDisplay":c("eraseDisplay",e);this.eraseDisplay(e);break;case"reverseLineFeed":c("reverseLineFeed");this.reverseLineFeed(e);break;case"vScrollingRegion":c("vScrollingRegion",i,n);this.setVScrollingRegion(i,n);break;case"vScrollUp":c("vScrollUp",i);this.vScroll(-i);break;case"vScrollDown":c("vScrollDown",i);this.vScroll(i);break;default:h("Unknown/unsupported edit action",t,e,r)}};d.prototype.onChildOutputAttr=function(t,e,r){switch(t){case"reset":c("ATTR reset");this.resetAttr();break;case"bold":c("ATTR bold:",e);this.addAttr({bold:e});break;case"dim":c("ATTR dim:",e);this.addAttr({dim:e});break;case"italic":c("ATTR italic:",e);this.addAttr({italic:e});break;case"underline":c("ATTR underline:",e);this.addAttr({underline:e});break;case"blink":c("ATTR blink:",e);this.addAttr({blink:e});break;case"inverse":c("ATTR inverse:",e);this.addAttr({inverse:e});break;case"hidden":c("ATTR hidden:",e);this.addAttr({hidden:e});break;case"strike":c("ATTR strike:",e);this.addAttr({strike:e});break;case"noDimNoBold":c("ATTR noDimNoBold");this.addAttr({bold:false,dim:false});break;case"color":c("ATTR color:",e);this.addAttr({color:e});break;case"color256":c("ATTR color256:",r);this.addAttr({color:+r[0]});break;case"colorRgb":c("ATTR colorRgb:",r,"not supported ATM");break;case"bgColor":c("ATTR bgColor:",e);this.addAttr({bgColor:e});break;case"bgColor256":c("ATTR bgColor256:",r);this.addAttr({bgColor:+r[0]});break;case"bgColorRgb":c("ATTR bgColorRgb:",r,"not supported ATM");break;default:h("Unknown/unsupported ATTR",t,e,r)}};d.prototype.onChildOutputPalette=function(t,e){h("Palette command:",t,e);var r=e&&e[0]?+e[0]:undefined;switch(t){case"getColor":if(!isNaN(r)){this.emitRegisterColor(r)}break}};d.prototype.onChildOutputCursorAttr=function(t,e){h("Cursor ATTR command:",t,e)};d.prototype.onChildOutputBell=function(){h("bell")};d.prototype.onChildOutputDevice=function(t,e,r){h("Device command:",t,e,r);switch(t){case"mouseButton":this.mouseEvent=e?"button":null;break;case"mouseDrag":this.mouseEvent=e?"drag":null;break;case"mouseMotion":this.mouseEvent=e?"motion":null;break;case"focusEvent":this.focusEvent=!!e;break;case"cursorLocation":this.emitCursorLocation(e);break;case"screenSize":this.emitScreenSize(e);break;default:h("Unknown/unsupported device command",t,e,r)}};d.prototype.onChildOutputSystem=function(t,e){h("System command:",t,e)};d.prototype.onChildOutputControl=function(t){h("control",t)};d.prototype.onChildOutputESC=function(t,e){h("ESC -- type:",t,e)};d.prototype.onChildOutputCSI=function(t,e){h("CSI -- type:",t,", args:",e)};d.prototype.onChildOutputOSC=function(t,e){h("OSC -- type:",t,", args:",e)}},{"../Rect.js":2,"../ScreenBuffer.js":3,"./SequencesReader.js":57,"./toInputSequence.js":60,child_process:141,child_pty:141,"nextgen-events":77,seventh:113,"string-kit":127}],59:[function(t,e,r){"use strict";r.control={"\\x07":{event:"bell"},"\\x08":{event:"cursor",subType:"left",extraArgs:[1]},"\\x09":{event:"cursor",subType:"tab"},"\\x0a":{event:"cursor",subType:"lineFeed"},"\\x0d":{event:"cursor",subType:"carriageReturn"},"\\x7f":{event:"none"}};r.ESC={7:{event:"cursor",subType:"save"},8:{event:"cursor",subType:"restore"},c:{event:"reset"},M:{event:"edit",subType:"reverseLineFeed"}};r.CSI={A:{event:"cursor",subType:"up",defaultExtraArgs:[1]},B:{event:"cursor",subType:"down",defaultExtraArgs:[1]},C:{event:"cursor",subType:"right",defaultExtraArgs:[1]},D:{event:"cursor",subType:"left",defaultExtraArgs:[1]},E:{event:"cursor",subType:"nextLine",defaultExtraArgs:[1]},F:{event:"cursor",subType:"previousLine",defaultExtraArgs:[1]},G:{event:"cursor",subType:"column"},H:{event:"cursor",subType:"moveToYX",defaultExtraArgs:[1,1]},J:{event:"edit",subType:"eraseDisplay",arg:"after",subTree:{0:{arg:"after"},1:{arg:"before"},2:{arg:"display"}}},K:{event:"edit",subType:"eraseLine",arg:"after",subTree:{0:{arg:"after"},1:{arg:"before"},2:{arg:"line"}}},L:{event:"edit",subType:"insertLine",defaultExtraArgs:[1]},M:{event:"edit",subType:"deleteLine",defaultExtraArgs:[1]},P:{event:"edit",subType:"delete",defaultExtraArgs:[1]},S:{event:"edit",subType:"vScrollUp",defaultExtraArgs:[1]},T:{event:"edit",subType:"vScrollDown",defaultExtraArgs:[1]},X:{event:"edit",subType:"erase",defaultExtraArgs:[1]},d:{event:"cursor",subType:"row"},"?h":{event:"device",arg:true,subTree:{1e3:{subType:"mouseButton",continue:true},1002:{subType:"mouseDrag",continue:true},1003:{subType:"mouseMotion",continue:true},1004:{subType:"focusEvent",continue:true},1006:{event:"none",continue:true}}},"?l":{event:"device",arg:false,subTree:null},n:{event:"device",subTree:{6:{subType:"cursorLocation"}}},"?n":{event:"device",subTree:{6:{subType:"cursorLocation",arg:true}}},m:{event:"attr",subType:"reset",subTree:{0:{subType:"reset",continue:true},1:{subType:"bold",arg:true,continue:true},2:{subType:"dim",arg:true,continue:true},3:{subType:"italic",arg:true,continue:true},4:{subType:"underline",arg:true,continue:true},5:{subType:"blink",arg:true,continue:true},7:{subType:"inverse",arg:true,continue:true},8:{subType:"hidden",arg:true,continue:true},9:{subType:"strike",arg:true,continue:true},21:{subType:"bold",arg:false,continue:true},22:{subType:"noDimNoBold",continue:true},23:{subType:"italic",arg:false,continue:true},24:{subType:"underline",arg:false,continue:true},25:{subType:"blink",arg:false,continue:true},27:{subType:"inverse",arg:false,continue:true},28:{subType:"hidden",arg:false,continue:true},29:{subType:"strike",arg:false,continue:true},30:{subType:"color",arg:"black",continue:true},31:{subType:"color",arg:"red",continue:true},32:{subType:"color",arg:"green",continue:true},33:{subType:"color",arg:"yellow",continue:true},34:{subType:"color",arg:"blue",continue:true},35:{subType:"color",arg:"magenta",continue:true},36:{subType:"color",arg:"cyan",continue:true},37:{subType:"color",arg:"white",continue:true},38:{subTree:{2:{subType:"colorRgb"},5:{subType:"color256"}}},39:{subType:"color",arg:"default",continue:true},40:{subType:"bgColor",arg:"black",continue:true},41:{subType:"bgColor",arg:"red",continue:true},42:{subType:"bgColor",arg:"green",continue:true},43:{subType:"bgColor",arg:"yellow",continue:true},44:{subType:"bgColor",arg:"blue",continue:true},45:{subType:"bgColor",arg:"magenta",continue:true},46:{subType:"bgColor",arg:"cyan",continue:true},47:{subType:"bgColor",arg:"white",continue:true},48:{subTree:{2:{subType:"bgColorRgb"},5:{subType:"bgColor256"}}},49:{subType:"bgColor",arg:"default",continue:true},90:{subType:"color",arg:"gray",continue:true},91:{subType:"color",arg:"brightRed",continue:true},92:{subType:"color",arg:"brightGreen",continue:true},93:{subType:"color",arg:"brightYellow",continue:true},94:{subType:"color",arg:"brightBlue",continue:true},95:{subType:"color",arg:"brightMagenta",continue:true},96:{subType:"color",arg:"brightCyan",continue:true},97:{subType:"color",arg:"brightWhite",continue:true},100:{subType:"bgColor",arg:"gray",continue:true},101:{subType:"bgColor",arg:"brightRed",continue:true},102:{subType:"bgColor",arg:"brightGreen",continue:true},103:{subType:"bgColor",arg:"brightYellow",continue:true},104:{subType:"bgColor",arg:"brightBlue",continue:true},105:{subType:"bgColor",arg:"brightMagenta",continue:true},106:{subType:"bgColor",arg:"brightCyan",continue:true},107:{subType:"bgColor",arg:"brightWhite",continue:true}}},r:{event:"edit",subType:"vScrollingRegion"},t:{event:"device",subTree:{18:{subType:"screenSize"}}}};r.CSI["?l"].subTree=r.CSI["?h"].subTree;r.OSC={0:{event:"system",subType:"setWindowTitle"},1:{event:"system",subType:"setIconName"},2:{event:"system",subType:"setWindowTitle"},4:{event:"palette",subType:"setColor"},"4?":{event:"palette",subType:"getColor"},7:{event:"system",subType:"setCwd"},9:{event:"system",subType:"notify"},10:{event:"palette",subType:"setDefaultColor"},11:{event:"palette",subType:"setDefaultBgColor"},12:{event:"cursorAttr",subType:"setColor"},17:{event:"palette",subType:"setHighlightBgColor"},50:{event:"cursorAttr",subType:"setShape"},104:{event:"palette",subType:"resetColor"},110:{event:"palette",subType:"resetDefaultColor"},111:{event:"palette",subType:"resetDefaultBgColor"},112:{event:"cursorAttr",subType:"resetColor"},117:{event:"palette",subType:"resetHighlightBgColor"},777:{event:"system",subTree:{notify:{subType:"notify"}}}}},{}],60:[function(t,e,r){"use strict";r.specialKeys={ESCAPE:"",TAB:"\t",ENTER:"\r",SHIFT_TAB:"",ALT_TAB:"\t",ALT_ENTER:"\r",UP:"OA",DOWN:"OB",RIGHT:"OC",LEFT:"OD",SHIFT_UP:"",SHIFT_DOWN:"",SHIFT_RIGHT:"",SHIFT_LEFT:"",ALT_UP:"",ALT_DOWN:"",ALT_RIGHT:"",ALT_LEFT:"",CTRL_UP:"",CTRL_DOWN:"",CTRL_RIGHT:"",CTRL_LEFT:"",BACKSPACE:"",INSERT:"[2~",DELETE:"[3~",HOME:"[1~",END:"[4~",PAGE_UP:"[5~",PAGE_DOWN:"[6~",CTRL_BACKSPACE:"\b",CTRL_INSERT:"[2;5~",CTRL_DELETE:"[3;5~",CTRL_HOME:"[1;5~",CTRL_END:"[4;5~",CTRL_PAGE_UP:"[5;5~",CTRL_PAGE_DOWN:"[6;5~",SHIFT_INSERT:"[2;2~",SHIFT_DELETE:"[3;2~",SHIFT_HOME:"[1;2~",SHIFT_END:"[4;2~",SHIFT_PAGE_UP:"[5;2~",SHIFT_PAGE_DOWN:"[6;2~",ALT_BACKSPACE:"",ALT_INSERT:"[2;3~",ALT_DELETE:"[3;3~",ALT_HOME:"[1;3~",ALT_END:"[4;3~",ALT_PAGE_UP:"[5;3~",ALT_PAGE_DOWN:"[6;3~",F1:"OP",F2:"OQ",F3:"OR",F4:"OS",F5:"[15~",F6:"[17~",F7:"[18~",F8:"[19~",F9:"[20~",F10:"[21~",F11:"[23~",F12:"[24~",SHIFT_F1:"O1;2P",SHIFT_F2:"O1;2Q",SHIFT_F3:"O1;2R",SHIFT_F4:"O1;2S",SHIFT_F5:"[15;2~",SHIFT_F6:"[17;2~",SHIFT_F7:"[18;2~",SHIFT_F8:"[19;2~",SHIFT_F9:"[20;2~",SHIFT_F10:"[21;2~",SHIFT_F11:"[23;2~",SHIFT_F12:"[24;2~",CTRL_F1:"O1;5P",CTRL_F2:"O1;5Q",CTRL_F3:"O1;5R",CTRL_F4:"O1;5S",CTRL_F5:"[15;5~",CTRL_F6:"[17;5~",CTRL_F7:"[18;5~",CTRL_F8:"[19;5~",CTRL_F9:"[20;5~",CTRL_F10:"[21;5~",CTRL_F11:"[23;5~",CTRL_F12:"[24;5~",CTRL_SHIFT_F1:"O1;6P",CTRL_SHIFT_F2:"O1;6Q",CTRL_SHIFT_F3:"O1;6R",CTRL_SHIFT_F4:"O1;6S",CTRL_SHIFT_F5:"[15;6~",CTRL_SHIFT_F6:"[17;6~",CTRL_SHIFT_F7:"[18;6~",CTRL_SHIFT_F8:"[19;6~",CTRL_SHIFT_F9:"[20;6~",CTRL_SHIFT_F10:"[21;6~",CTRL_SHIFT_F11:"[23;6~",CTRL_SHIFT_F12:"[24;6~",NUL:"\0",ALT_SPACE:" ",CTRL_ALT_SPACE:"\0"};for(let t=1;t<=26;t++){r.specialKeys["CTRL_"+String.fromCharCode(64+t)]=String.fromCharCode(t);r.specialKeys["ALT_"+String.fromCharCode(64+t)]=""+String.fromCharCode(96+t);r.specialKeys["CTRL_ALT_"+String.fromCharCode(64+t)]=""+String.fromCharCode(t);r.specialKeys["ALT_SHIFT_"+String.fromCharCode(64+t)]=""+String.fromCharCode(64+t)}r.reports={cursorLocation:"[%+1u;%-1uR",cursorLocationDecVariant:"[?%+1u;%-1uR",screenSize:"[8;%+1u;%-1ut",focusIn:"",focusOut:"",registerColor:"]4;%u;rgb:%x/%x/%x"}},{}],61:[function(t,e,r){"use strict";e.exports=function(t){t.globalConfig.preferProcessSigwinch=true}},{}],62:[function(t,e,r){"use strict";var s=t("seventh");e.exports=function t(e,r){if(typeof e==="function"){r=e;e=undefined}if(!e||typeof e!=="object"){e={yes:["y","Y"],no:["n","N"],echoYes:"yes",echoNo:"no"}}if(typeof e.yes==="string"){e.yes=[e.yes]}if(!Array.isArray(e.yes)){e.yes=["y","Y"]}if(typeof e.no==="string"){e.no=[e.no]}if(!Array.isArray(e.no)){e.no=["n","N"]}if(!this.grabbing){this.grabInput()}var i=t=>{if(e.yes.indexOf(t)!==-1){if(e.echoYes){this(e.echoYes)}this.removeListener("key",i);if(r){r(undefined,true)}else{n.promise.resolve(true)}}else if(e.no.indexOf(t)!==-1){if(e.echoNo){this(e.echoNo)}this.removeListener("key",i);if(r){r(undefined,false)}else{n.promise.resolve(false)}}};this.on("key",i);var n={};n.abort=()=>{this.removeListener("key",i)};n.promise=new s;return n}},{seventh:113}],63:[function(t,r,e){(function(g){(function(){"use strict";var a=t("ndarray");var i=t("pngjs").PNG;var s=t("jpeg-js");var u=t("ndarray-pack");var l=t("omggif").GifReader;var f=t("node-bitmap");var e=t("fs");var o=t("path").extname;function n(t,r){var e=new i;e.parse(t,function(t,e){if(t){r(t);return}r(null,a(new Uint8Array(e.data),[e.width|0,e.height|0,4],[4,4*e.width|0,1],0))})}function h(t,e){var r;try{r=s.decode(t)}catch(t){e(t);return}if(!r){e(new Error("Error decoding jpeg"));return}var i=[r.height,r.width,4];var n=a(r.data,i);e(null,n.transpose(1,0))}function c(t,e){var r,i,n,s;try{r=new l(t)}catch(t){e(t);return}if(r.numFrames()>0){i=[r.numFrames(),r.height,r.width,4];n=new Uint8Array(i[0]*i[1]*i[2]*i[3]);s=a(n,i);try{for(var o=0;or?r:t};var r=t;var e=function(t){t._clipped=false;t._unclipped=t.slice(0);for(var e=0;e<=3;e++){if(e<3){if(t[e]<0||t[e]>255){t._clipped=true}t[e]=r(t[e],0,255)}else if(e===3){t[e]=r(t[e],0,1)}}return t};var i={};for(var n=0,s=["Boolean","Number","String","Function","Array","Date","RegExp","Undefined","Null"];n=3){return Array.prototype.slice.call(e)}if(u(e[0])=="object"&&t){return t.split("").filter(function(t){return e[0][t]!==undefined}).map(function(t){return e[0][t]})}return e[0]};var f=a;var h=function(t){if(t.length<2){return null}var e=t.length-1;if(f(t[e])=="string"){return t[e].toLowerCase()}return null};var c=Math.PI;var d={clip_rgb:e,limit:t,type:a,unpack:l,last:h,PI:c,TWOPI:c*2,PITHIRD:c/3,DEG2RAD:c/180,RAD2DEG:180/c};var p={format:{},autodetect:[]};var g=d.last;var y=d.clip_rgb;var m=d.type;var b=p;var v=function t(){var e=[],r=arguments.length;while(r--)e[r]=arguments[r];var i=this;if(m(e[0])==="object"&&e[0].constructor&&e[0].constructor===this.constructor){return e[0]}var n=g(e);var s=false;if(!n){s=true;if(!b.sorted){b.autodetect=b.autodetect.sort(function(t,e){return e.p-t.p});b.sorted=true}for(var o=0,a=b.autodetect;o4?t[4]:1;if(s===1){return[0,0,0,o]}return[r>=1?0:255*(1-r)*(1-s),i>=1?0:255*(1-i)*(1-s),n>=1?0:255*(1-n)*(1-s),o]};var B=E;var R=_;var O=w;var M=p;var I=d.unpack;var P=d.type;var j=k;O.prototype.cmyk=function(){return j(this._rgb)};R.cmyk=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];return new(Function.prototype.bind.apply(O,[null].concat(t,["cmyk"])))};M.format.cmyk=B;M.autodetect.push({p:2,test:function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];t=I(t,"cmyk");if(P(t)==="array"&&t.length===4){return"cmyk"}}});var L=d.unpack;var D=d.last;var F=function(t){return Math.round(t*100)/100};var W=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];var r=L(t,"hsla");var i=D(t)||"lsa";r[0]=F(r[0]||0);r[1]=F(r[1]*100)+"%";r[2]=F(r[2]*100)+"%";if(i==="hsla"||r.length>3&&r[3]<1){r[3]=r.length>3?r[3]:1;i="hsla"}else{r.length=3}return i+"("+r.join(",")+")"};var H=W;var N=d.unpack;var U=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];t=N(t,"rgba");var r=t[0];var i=t[1];var n=t[2];r/=255;i/=255;n/=255;var s=Math.min(r,i,n);var o=Math.max(r,i,n);var a=(o+s)/2;var u,l;if(o===s){u=0;l=Number.NaN}else{u=a<.5?(o-s)/(o+s):(o-s)/(2-o-s)}if(r==o){l=(i-n)/(o-s)}else if(i==o){l=2+(n-r)/(o-s)}else if(n==o){l=4+(r-i)/(o-s)}l*=60;if(l<0){l+=360}if(t.length>3&&t[3]!==undefined){return[l,u,a,t[3]]}return[l,u,a]};var z=U;var Y=d.unpack;var V=d.last;var G=H;var Z=z;var K=Math.round;var X=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];var r=Y(t,"rgba");var i=V(t)||"rgb";if(i.substr(0,3)=="hsl"){return G(Z(r),i)}r[0]=K(r[0]);r[1]=K(r[1]);r[2]=K(r[2]);if(i==="rgba"||r.length>3&&r[3]<1){r[3]=r.length>3?r[3]:1;i="rgba"}return i+"("+r.slice(0,i==="rgb"?3:4).join(",")+")"};var q=X;var J=d.unpack;var $=Math.round;var Q=function(){var t;var e=[],r=arguments.length;while(r--)e[r]=arguments[r];e=J(e,"hsl");var i=e[0];var n=e[1];var s=e[2];var o,a,u;if(n===0){o=a=u=s*255}else{var l=[0,0,0];var f=[0,0,0];var h=s<.5?s*(1+n):s+n-s*n;var c=2*s-h;var d=i/360;l[0]=d+1/3;l[1]=d;l[2]=d-1/3;for(var p=0;p<3;p++){if(l[p]<0){l[p]+=1}if(l[p]>1){l[p]-=1}if(6*l[p]<1){f[p]=c+(h-c)*6*l[p]}else if(2*l[p]<1){f[p]=h}else if(3*l[p]<2){f[p]=c+(h-c)*(2/3-l[p])*6}else{f[p]=c}}t=[$(f[0]*255),$(f[1]*255),$(f[2]*255)],o=t[0],a=t[1],u=t[2]}if(e.length>3){return[o,a,u,e[3]]}return[o,a,u,1]};var tt=Q;var et=tt;var rt=p;var it=/^rgb\(\s*(-?\d+),\s*(-?\d+)\s*,\s*(-?\d+)\s*\)$/;var nt=/^rgba\(\s*(-?\d+),\s*(-?\d+)\s*,\s*(-?\d+)\s*,\s*([01]|[01]?\.\d+)\)$/;var st=/^rgb\(\s*(-?\d+(?:\.\d+)?)%,\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*\)$/;var ot=/^rgba\(\s*(-?\d+(?:\.\d+)?)%,\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/;var at=/^hsl\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*\)$/;var ut=/^hsla\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/;var lt=Math.round;var ft=function(t){t=t.toLowerCase().trim();var e;if(rt.format.named){try{return rt.format.named(t)}catch(t){}}if(e=t.match(it)){var r=e.slice(1,4);for(var i=0;i<3;i++){r[i]=+r[i]}r[3]=1;return r}if(e=t.match(nt)){var n=e.slice(1,5);for(var s=0;s<4;s++){n[s]=+n[s]}return n}if(e=t.match(st)){var o=e.slice(1,4);for(var a=0;a<3;a++){o[a]=lt(o[a]*2.55)}o[3]=1;return o}if(e=t.match(ot)){var u=e.slice(1,5);for(var l=0;l<3;l++){u[l]=lt(u[l]*2.55)}u[3]=+u[3];return u}if(e=t.match(at)){var f=e.slice(1,4);f[1]*=.01;f[2]*=.01;var h=et(f);h[3]=1;return h}if(e=t.match(ut)){var c=e.slice(1,4);c[1]*=.01;c[2]*=.01;var d=et(c);d[3]=+e[4];return d}};ft.test=function(t){return it.test(t)||nt.test(t)||st.test(t)||ot.test(t)||at.test(t)||ut.test(t)};var ht=ft;var ct=_;var dt=w;var pt=p;var gt=d.type;var yt=q;var mt=ht;dt.prototype.css=function(t){return yt(this._rgb,t)};ct.css=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];return new(Function.prototype.bind.apply(dt,[null].concat(t,["css"])))};pt.format.css=mt;pt.autodetect.push({p:5,test:function(t){var e=[],r=arguments.length-1;while(r-- >0)e[r]=arguments[r+1];if(!e.length&>(t)==="string"&&mt.test(t)){return"css"}}});var bt=w;var vt=_;var wt=p;var xt=d.unpack;wt.format.gl=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];var r=xt(t,"rgba");r[0]*=255;r[1]*=255;r[2]*=255;return r};vt.gl=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];return new(Function.prototype.bind.apply(bt,[null].concat(t,["gl"])))};bt.prototype.gl=function(){var t=this._rgb;return[t[0]/255,t[1]/255,t[2]/255,t[3]]};var _t=d.unpack;var Ct=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];var r=_t(t,"rgb");var i=r[0];var n=r[1];var s=r[2];var o=Math.min(i,n,s);var a=Math.max(i,n,s);var u=a-o;var l=u*100/255;var f=o/(255-u)*100;var h;if(u===0){h=Number.NaN}else{if(i===a){h=(n-s)/u}if(n===a){h=2+(s-i)/u}if(s===a){h=4+(i-n)/u}h*=60;if(h<0){h+=360}}return[h,l,f]};var Tt=Ct;var St=d.unpack;var kt=Math.floor;var At=function(){var t,e,r,i,n,s;var o=[],a=arguments.length;while(a--)o[a]=arguments[a];o=St(o,"hcg");var u=o[0];var l=o[1];var f=o[2];var h,c,d;f=f*255;var p=l*255;if(l===0){h=c=d=f}else{if(u===360){u=0}if(u>360){u-=360}if(u<0){u+=360}u/=60;var g=kt(u);var y=u-g;var m=f*(1-l);var b=m+p*(1-y);var v=m+p*y;var w=m+p;switch(g){case 0:t=[w,v,m],h=t[0],c=t[1],d=t[2];break;case 1:e=[b,w,m],h=e[0],c=e[1],d=e[2];break;case 2:r=[m,w,v],h=r[0],c=r[1],d=r[2];break;case 3:i=[m,b,w],h=i[0],c=i[1],d=i[2];break;case 4:n=[v,m,w],h=n[0],c=n[1],d=n[2];break;case 5:s=[w,m,b],h=s[0],c=s[1],d=s[2];break}}return[h,c,d,o.length>3?o[3]:1]};var Et=At;var Bt=d.unpack;var Rt=d.type;var Ot=_;var Mt=w;var It=p;var Pt=Tt;Mt.prototype.hcg=function(){return Pt(this._rgb)};Ot.hcg=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];return new(Function.prototype.bind.apply(Mt,[null].concat(t,["hcg"])))};It.format.hcg=Et;It.autodetect.push({p:1,test:function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];t=Bt(t,"hcg");if(Rt(t)==="array"&&t.length===3){return"hcg"}}});var jt=d.unpack;var Lt=d.last;var Dt=Math.round;var Ft=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];var r=jt(t,"rgba");var i=r[0];var n=r[1];var s=r[2];var o=r[3];var a=Lt(t)||"auto";if(o===undefined){o=1}if(a==="auto"){a=o<1?"rgba":"rgb"}i=Dt(i);n=Dt(n);s=Dt(s);var u=i<<16|n<<8|s;var l="000000"+u.toString(16);l=l.substr(l.length-6);var f="0"+Dt(o*255).toString(16);f=f.substr(f.length-2);switch(a.toLowerCase()){case"rgba":return"#"+l+f;case"argb":return"#"+f+l;default:return"#"+l}};var Wt=Ft;var Ht=/^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/;var Nt=/^#?([A-Fa-f0-9]{8}|[A-Fa-f0-9]{4})$/;var Ut=function(t){if(t.match(Ht)){if(t.length===4||t.length===7){t=t.substr(1)}if(t.length===3){t=t.split("");t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]}var e=parseInt(t,16);var r=e>>16;var i=e>>8&255;var n=e&255;return[r,i,n,1]}if(t.match(Nt)){if(t.length===5||t.length===9){t=t.substr(1)}if(t.length===4){t=t.split("");t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]+t[3]+t[3]}var s=parseInt(t,16);var o=s>>24&255;var a=s>>16&255;var u=s>>8&255;var l=Math.round((s&255)/255*100)/100;return[o,a,u,l]}throw new Error("unknown hex color: "+t)};var zt=Ut;var Yt=_;var Vt=w;var Gt=d.type;var Zt=p;var Kt=Wt;Vt.prototype.hex=function(t){return Kt(this._rgb,t)};Yt.hex=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];return new(Function.prototype.bind.apply(Vt,[null].concat(t,["hex"])))};Zt.format.hex=zt;Zt.autodetect.push({p:4,test:function(t){var e=[],r=arguments.length-1;while(r-- >0)e[r]=arguments[r+1];if(!e.length&&Gt(t)==="string"&&[3,4,5,6,7,8,9].indexOf(t.length)>=0){return"hex"}}});var Xt=d.unpack;var qt=d.TWOPI;var Jt=Math.min;var $t=Math.sqrt;var Qt=Math.acos;var te=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];var r=Xt(t,"rgb");var i=r[0];var n=r[1];var s=r[2];i/=255;n/=255;s/=255;var o;var a=Jt(i,n,s);var u=(i+n+s)/3;var l=u>0?1-a/u:0;if(l===0){o=NaN}else{o=(i-n+(i-s))/2;o/=$t((i-n)*(i-n)+(i-s)*(n-s));o=Qt(o);if(s>n){o=qt-o}o/=qt}return[o*360,l,u]};var ee=te;var re=d.unpack;var ie=d.limit;var ne=d.TWOPI;var se=d.PITHIRD;var oe=Math.cos;var ae=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];t=re(t,"hsi");var r=t[0];var i=t[1];var n=t[2];var s,o,a;if(isNaN(r)){r=0}if(isNaN(i)){i=0}if(r>360){r-=360}if(r<0){r+=360}r/=360;if(r<1/3){a=(1-i)/3;s=(1+i*oe(ne*r)/oe(se-ne*r))/3;o=1-(a+s)}else if(r<2/3){r-=1/3;s=(1-i)/3;o=(1+i*oe(ne*r)/oe(se-ne*r))/3;a=1-(s+o)}else{r-=2/3;o=(1-i)/3;a=(1+i*oe(ne*r)/oe(se-ne*r))/3;s=1-(o+a)}s=ie(n*s*3);o=ie(n*o*3);a=ie(n*a*3);return[s*255,o*255,a*255,t.length>3?t[3]:1]};var ue=ae;var le=d.unpack;var fe=d.type;var he=_;var ce=w;var de=p;var pe=ee;ce.prototype.hsi=function(){return pe(this._rgb)};he.hsi=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];return new(Function.prototype.bind.apply(ce,[null].concat(t,["hsi"])))};de.format.hsi=ue;de.autodetect.push({p:2,test:function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];t=le(t,"hsi");if(fe(t)==="array"&&t.length===3){return"hsi"}}});var ge=d.unpack;var ye=d.type;var me=_;var be=w;var ve=p;var we=z;be.prototype.hsl=function(){return we(this._rgb)};me.hsl=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];return new(Function.prototype.bind.apply(be,[null].concat(t,["hsl"])))};ve.format.hsl=tt;ve.autodetect.push({p:2,test:function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];t=ge(t,"hsl");if(ye(t)==="array"&&t.length===3){return"hsl"}}});var xe=d.unpack;var _e=Math.min;var Ce=Math.max;var Te=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];t=xe(t,"rgb");var r=t[0];var i=t[1];var n=t[2];var s=_e(r,i,n);var o=Ce(r,i,n);var a=o-s;var u,l,f;f=o/255;if(o===0){u=Number.NaN;l=0}else{l=a/o;if(r===o){u=(i-n)/a}if(i===o){u=2+(n-r)/a}if(n===o){u=4+(r-i)/a}u*=60;if(u<0){u+=360}}return[u,l,f]};var Se=Te;var ke=d.unpack;var Ae=Math.floor;var Ee=function(){var t,e,r,i,n,s;var o=[],a=arguments.length;while(a--)o[a]=arguments[a];o=ke(o,"hsv");var u=o[0];var l=o[1];var f=o[2];var h,c,d;f*=255;if(l===0){h=c=d=f}else{if(u===360){u=0}if(u>360){u-=360}if(u<0){u+=360}u/=60;var p=Ae(u);var g=u-p;var y=f*(1-l);var m=f*(1-l*g);var b=f*(1-l*(1-g));switch(p){case 0:t=[f,b,y],h=t[0],c=t[1],d=t[2];break;case 1:e=[m,f,y],h=e[0],c=e[1],d=e[2];break;case 2:r=[y,f,b],h=r[0],c=r[1],d=r[2];break;case 3:i=[y,m,f],h=i[0],c=i[1],d=i[2];break;case 4:n=[b,y,f],h=n[0],c=n[1],d=n[2];break;case 5:s=[f,y,m],h=s[0],c=s[1],d=s[2];break}}return[h,c,d,o.length>3?o[3]:1]};var Be=Ee;var Re=d.unpack;var Oe=d.type;var Me=_;var Ie=w;var Pe=p;var je=Se;Ie.prototype.hsv=function(){return je(this._rgb)};Me.hsv=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];return new(Function.prototype.bind.apply(Ie,[null].concat(t,["hsv"])))};Pe.format.hsv=Be;Pe.autodetect.push({p:2,test:function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];t=Re(t,"hsv");if(Oe(t)==="array"&&t.length===3){return"hsv"}}});var Le={Kn:18,Xn:.95047,Yn:1,Zn:1.08883,t0:.137931034,t1:.206896552,t2:.12841855,t3:.008856452};var De=Le;var Fe=d.unpack;var We=Math.pow;var He=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];var r=Fe(t,"rgb");var i=r[0];var n=r[1];var s=r[2];var o=ze(i,n,s);var a=o[0];var u=o[1];var l=o[2];var f=116*u-16;return[f<0?0:f,500*(a-u),200*(u-l)]};var Ne=function(t){if((t/=255)<=.04045){return t/12.92}return We((t+.055)/1.055,2.4)};var Ue=function(t){if(t>De.t3){return We(t,1/3)}return t/De.t2+De.t0};var ze=function(t,e,r){t=Ne(t);e=Ne(e);r=Ne(r);var i=Ue((.4124564*t+.3575761*e+.1804375*r)/De.Xn);var n=Ue((.2126729*t+.7151522*e+.072175*r)/De.Yn);var s=Ue((.0193339*t+.119192*e+.9503041*r)/De.Zn);return[i,n,s]};var Ye=He;var Ve=Le;var Ge=d.unpack;var Ze=Math.pow;var Ke=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];t=Ge(t,"lab");var r=t[0];var i=t[1];var n=t[2];var s,o,a,u,l,f;o=(r+16)/116;s=isNaN(i)?o:o+i/500;a=isNaN(n)?o:o-n/200;o=Ve.Yn*qe(o);s=Ve.Xn*qe(s);a=Ve.Zn*qe(a);u=Xe(3.2404542*s-1.5371385*o-.4985314*a);l=Xe(-.969266*s+1.8760108*o+.041556*a);f=Xe(.0556434*s-.2040259*o+1.0572252*a);return[u,l,f,t.length>3?t[3]:1]};var Xe=function(t){return 255*(t<=.00304?12.92*t:1.055*Ze(t,1/2.4)-.055)};var qe=function(t){return t>Ve.t1?t*t*t:Ve.t2*(t-Ve.t0)};var Je=Ke;var $e=d.unpack;var Qe=d.type;var tr=_;var er=w;var rr=p;var ir=Ye;er.prototype.lab=function(){return ir(this._rgb)};tr.lab=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];return new(Function.prototype.bind.apply(er,[null].concat(t,["lab"])))};rr.format.lab=Je;rr.autodetect.push({p:2,test:function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];t=$e(t,"lab");if(Qe(t)==="array"&&t.length===3){return"lab"}}});var nr=d.unpack;var sr=d.RAD2DEG;var or=Math.sqrt;var ar=Math.atan2;var ur=Math.round;var lr=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];var r=nr(t,"lab");var i=r[0];var n=r[1];var s=r[2];var o=or(n*n+s*s);var a=(ar(s,n)*sr+360)%360;if(ur(o*1e4)===0){a=Number.NaN}return[i,o,a]};var fr=lr;var hr=d.unpack;var cr=Ye;var dr=fr;var pr=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];var r=hr(t,"rgb");var i=r[0];var n=r[1];var s=r[2];var o=cr(i,n,s);var a=o[0];var u=o[1];var l=o[2];return dr(a,u,l)};var gr=pr;var yr=d.unpack;var mr=d.DEG2RAD;var br=Math.sin;var vr=Math.cos;var wr=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];var r=yr(t,"lch");var i=r[0];var n=r[1];var s=r[2];if(isNaN(s)){s=0}s=s*mr;return[i,vr(s)*n,br(s)*n]};var xr=wr;var _r=d.unpack;var Cr=xr;var Tr=Je;var Sr=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];t=_r(t,"lch");var r=t[0];var i=t[1];var n=t[2];var s=Cr(r,i,n);var o=s[0];var a=s[1];var u=s[2];var l=Tr(o,a,u);var f=l[0];var h=l[1];var c=l[2];return[f,h,c,t.length>3?t[3]:1]};var kr=Sr;var Ar=d.unpack;var Er=kr;var Br=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];var r=Ar(t,"hcl").reverse();return Er.apply(void 0,r)};var Rr=Br;var Or=d.unpack;var Mr=d.type;var Ir=_;var Pr=w;var jr=p;var Lr=gr;Pr.prototype.lch=function(){return Lr(this._rgb)};Pr.prototype.hcl=function(){return Lr(this._rgb).reverse()};Ir.lch=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];return new(Function.prototype.bind.apply(Pr,[null].concat(t,["lch"])))};Ir.hcl=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];return new(Function.prototype.bind.apply(Pr,[null].concat(t,["hcl"])))};jr.format.lch=kr;jr.format.hcl=Rr;["lch","hcl"].forEach(function(r){return jr.autodetect.push({p:2,test:function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];t=Or(t,r);if(Mr(t)==="array"&&t.length===3){return r}}})});var Dr={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflower:"#6495ed",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",laserlemon:"#ffff54",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrod:"#fafad2",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",maroon2:"#7f0000",maroon3:"#b03060",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",purple2:"#7f007f",purple3:"#a020f0",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};var Fr=Dr;var Wr=w;var Hr=p;var Nr=d.type;var Ur=Fr;var zr=zt;var Yr=Wt;Wr.prototype.name=function(){var t=Yr(this._rgb,"rgb");for(var e=0,r=Object.keys(Ur);e0)e[r]=arguments[r+1];if(!e.length&&Nr(t)==="string"&&Ur[t.toLowerCase()]){return"named"}}});var Vr=d.unpack;var Gr=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];var r=Vr(t,"rgb");var i=r[0];var n=r[1];var s=r[2];return(i<<16)+(n<<8)+s};var Zr=Gr;var Kr=d.type;var Xr=function(t){if(Kr(t)=="number"&&t>=0&&t<=16777215){var e=t>>16;var r=t>>8&255;var i=t&255;return[e,r,i,1]}throw new Error("unknown num color: "+t)};var qr=Xr;var Jr=_;var $r=w;var Qr=p;var ti=d.type;var ei=Zr;$r.prototype.num=function(){return ei(this._rgb)};Jr.num=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];return new(Function.prototype.bind.apply($r,[null].concat(t,["num"])))};Qr.format.num=qr;Qr.autodetect.push({p:5,test:function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];if(t.length===1&&ti(t[0])==="number"&&t[0]>=0&&t[0]<=16777215){return"num"}}});var ri=_;var ii=w;var ni=p;var si=d.unpack;var oi=d.type;var ai=Math.round;ii.prototype.rgb=function(t){if(t===void 0)t=true;if(t===false){return this._rgb.slice(0,3)}return this._rgb.slice(0,3).map(ai)};ii.prototype.rgba=function(r){if(r===void 0)r=true;return this._rgb.slice(0,4).map(function(t,e){return e<3?r===false?t:ai(t):t})};ri.rgb=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];return new(Function.prototype.bind.apply(ii,[null].concat(t,["rgb"])))};ni.format.rgb=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];var r=si(t,"rgba");if(r[3]===undefined){r[3]=1}return r};ni.autodetect.push({p:3,test:function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];t=si(t,"rgba");if(oi(t)==="array"&&(t.length===3||t.length===4&&oi(t[3])=="number"&&t[3]>=0&&t[3]<=1)){return"rgb"}}});var ui=Math.log;var li=function(t){var e=t/100;var r,i,n;if(e<66){r=255;i=e<6?0:-155.25485562709179-.44596950469579133*(i=e-2)+104.49216199393888*ui(i);n=e<20?0:-254.76935184120902+.8274096064007395*(n=e-10)+115.67994401066147*ui(n)}else{r=351.97690566805693+.114206453784165*(r=e-55)-40.25366309332127*ui(r);i=325.4494125711974+.07943456536662342*(i=e-50)-28.0852963507957*ui(i);n=255}return[r,i,n,1]};var fi=li;var hi=fi;var ci=d.unpack;var di=Math.round;var pi=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];var r=ci(t,"rgb");var i=r[0],n=r[2];var s=1e3;var o=4e4;var a=.4;var u;while(o-s>a){u=(o+s)*.5;var l=hi(u);if(l[2]/l[0]>=n/i){o=u}else{s=u}}return di(u)};var gi=pi;var yi=_;var mi=w;var bi=p;var vi=gi;mi.prototype.temp=mi.prototype.kelvin=mi.prototype.temperature=function(){return vi(this._rgb)};yi.temp=yi.kelvin=yi.temperature=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];return new(Function.prototype.bind.apply(mi,[null].concat(t,["temp"])))};bi.format.temp=bi.format.kelvin=bi.format.temperature=fi;var wi=d.unpack;var xi=Math.cbrt;var _i=Math.pow;var Ci=Math.sign;var Ti=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];var r=wi(t,"rgb");var i=r[0];var n=r[1];var s=r[2];var o=[ki(i/255),ki(n/255),ki(s/255)];var a=o[0];var u=o[1];var l=o[2];var f=xi(.4122214708*a+.5363325363*u+.0514459929*l);var h=xi(.2119034982*a+.6806995451*u+.1073969566*l);var c=xi(.0883024619*a+.2817188376*u+.6299787005*l);return[.2104542553*f+.793617785*h-.0040720468*c,1.9779984951*f-2.428592205*h+.4505937099*c,.0259040371*f+.7827717662*h-.808675766*c]};var Si=Ti;function ki(t){var e=Math.abs(t);if(e<.04045){return t/12.92}return(Ci(t)||1)*_i((e+.055)/1.055,2.4)}var Ai=d.unpack;var Ei=Math.pow;var Bi=Math.sign;var Ri=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];t=Ai(t,"lab");var r=t[0];var i=t[1];var n=t[2];var s=Ei(r+.3963377774*i+.2158037573*n,3);var o=Ei(r-.1055613458*i-.0638541728*n,3);var a=Ei(r-.0894841775*i-1.291485548*n,3);return[255*Mi(+4.0767416621*s-3.3077115913*o+.2309699292*a),255*Mi(-1.2684380046*s+2.6097574011*o-.3413193965*a),255*Mi(-.0041960863*s-.7034186147*o+1.707614701*a),t.length>3?t[3]:1]};var Oi=Ri;function Mi(t){var e=Math.abs(t);if(e>.0031308){return(Bi(t)||1)*(1.055*Ei(e,1/2.4)-.055)}return t*12.92}var Ii=d.unpack;var Pi=d.type;var ji=_;var Li=w;var Di=p;var Fi=Si;Li.prototype.oklab=function(){return Fi(this._rgb)};ji.oklab=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];return new(Function.prototype.bind.apply(Li,[null].concat(t,["oklab"])))};Di.format.oklab=Oi;Di.autodetect.push({p:3,test:function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];t=Ii(t,"oklab");if(Pi(t)==="array"&&t.length===3){return"oklab"}}});var Wi=d.unpack;var Hi=Si;var Ni=fr;var Ui=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];var r=Wi(t,"rgb");var i=r[0];var n=r[1];var s=r[2];var o=Hi(i,n,s);var a=o[0];var u=o[1];var l=o[2];return Ni(a,u,l)};var zi=Ui;var Yi=d.unpack;var Vi=xr;var Gi=Oi;var Zi=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];t=Yi(t,"lch");var r=t[0];var i=t[1];var n=t[2];var s=Vi(r,i,n);var o=s[0];var a=s[1];var u=s[2];var l=Gi(o,a,u);var f=l[0];var h=l[1];var c=l[2];return[f,h,c,t.length>3?t[3]:1]};var Ki=Zi;var Xi=d.unpack;var qi=d.type;var Ji=_;var $i=w;var Qi=p;var tn=zi;$i.prototype.oklch=function(){return tn(this._rgb)};Ji.oklch=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];return new(Function.prototype.bind.apply($i,[null].concat(t,["oklch"])))};Qi.format.oklch=Ki;Qi.autodetect.push({p:3,test:function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];t=Xi(t,"oklch");if(qi(t)==="array"&&t.length===3){return"oklch"}}});var en=w;var rn=d.type;en.prototype.alpha=function(t,e){if(e===void 0)e=false;if(t!==undefined&&rn(t)==="number"){if(e){this._rgb[3]=t;return this}return new en([this._rgb[0],this._rgb[1],this._rgb[2],t],"rgb")}return this._rgb[3]};var nn=w;nn.prototype.clipped=function(){return this._rgb._clipped||false};var sn=w;var on=Le;sn.prototype.darken=function(t){if(t===void 0)t=1;var e=this;var r=e.lab();r[0]-=on.Kn*t;return new sn(r,"lab").alpha(e.alpha(),true)};sn.prototype.brighten=function(t){if(t===void 0)t=1;return this.darken(-t)};sn.prototype.darker=sn.prototype.darken;sn.prototype.brighter=sn.prototype.brighten;var an=w;an.prototype.get=function(t){var e=t.split(".");var r=e[0];var i=e[1];var n=this[r]();if(i){var s=r.indexOf(i)-(r.substr(0,2)==="ok"?2:0);if(s>-1){return n[s]}throw new Error("unknown channel "+i+" in mode "+r)}else{return n}};var un=w;var ln=d.type;var fn=Math.pow;var hn=1e-7;var cn=20;un.prototype.luminance=function(n){if(n!==undefined&&ln(n)==="number"){if(n===0){return new un([0,0,0,this._rgb[3]],"rgb")}if(n===1){return new un([255,255,255,this._rgb[3]],"rgb")}var t=this.luminance();var s="rgb";var o=cn;var a=function(t,e){var r=t.interpolate(e,.5,s);var i=r.luminance();if(Math.abs(n-i)n?a(t,r):a(r,e)};var e=(t>n?a(new un([0,0,0]),this):a(this,new un([255,255,255]))).rgb();return new un(e.concat([this._rgb[3]]))}return dn.apply(void 0,this._rgb.slice(0,3))};var dn=function(t,e,r){t=pn(t);e=pn(e);r=pn(r);return.2126*t+.7152*e+.0722*r};var pn=function(t){t/=255;return t<=.03928?t/12.92:fn((t+.055)/1.055,2.4)};var gn={};var yn=w;var mn=d.type;var bn=gn;var vn=function(t,e,r){if(r===void 0)r=.5;var i=[],n=arguments.length-3;while(n-- >0)i[n]=arguments[n+3];var s=i[0]||"lrgb";if(!bn[s]&&!i.length){s=Object.keys(bn)[0]}if(!bn[s]){throw new Error("interpolation mode "+s+" is not defined")}if(mn(t)!=="object"){t=new yn(t)}if(mn(e)!=="object"){e=new yn(e)}return bn[s](t,e,r).alpha(t.alpha()+r*(e.alpha()-t.alpha()))};var wn=w;var xn=vn;wn.prototype.mix=wn.prototype.interpolate=function(t,e){if(e===void 0)e=.5;var r=[],i=arguments.length-2;while(i-- >0)r[i]=arguments[i+2];return xn.apply(void 0,[this,t,e].concat(r))};var _n=w;_n.prototype.premultiply=function(t){if(t===void 0)t=false;var e=this._rgb;var r=e[3];if(t){this._rgb=[e[0]*r,e[1]*r,e[2]*r,r];return this}else{return new _n([e[0]*r,e[1]*r,e[2]*r,r],"rgb")}};var Cn=w;var Tn=Le;Cn.prototype.saturate=function(t){if(t===void 0)t=1;var e=this;var r=e.lch();r[1]+=Tn.Kn*t;if(r[1]<0){r[1]=0}return new Cn(r,"lch").alpha(e.alpha(),true)};Cn.prototype.desaturate=function(t){if(t===void 0)t=1;return this.saturate(-t)};var Sn=w;var kn=d.type;Sn.prototype.set=function(t,e,r){if(r===void 0)r=false;var i=t.split(".");var n=i[0];var s=i[1];var o=this[n]();if(s){var a=n.indexOf(s)-(n.substr(0,2)==="ok"?2:0);if(a>-1){if(kn(e)=="string"){switch(e.charAt(0)){case"+":o[a]+=+e;break;case"-":o[a]+=+e;break;case"*":o[a]*=+e.substr(1);break;case"/":o[a]/=+e.substr(1);break;default:o[a]=+e}}else if(kn(e)==="number"){o[a]=e}else{throw new Error("unsupported value for Color.set")}var u=new Sn(o,n);if(r){this._rgb=u._rgb;return this}return u}throw new Error("unknown channel "+s+" in mode "+n)}else{return o}};var An=w;var En=function(t,e,r){var i=t._rgb;var n=e._rgb;return new An(i[0]+r*(n[0]-i[0]),i[1]+r*(n[1]-i[1]),i[2]+r*(n[2]-i[2]),"rgb")};gn.rgb=En;var Bn=w;var Rn=Math.sqrt;var On=Math.pow;var Mn=function(t,e,r){var i=t._rgb;var n=i[0];var s=i[1];var o=i[2];var a=e._rgb;var u=a[0];var l=a[1];var f=a[2];return new Bn(Rn(On(n,2)*(1-r)+On(u,2)*r),Rn(On(s,2)*(1-r)+On(l,2)*r),Rn(On(o,2)*(1-r)+On(f,2)*r),"rgb")};gn.lrgb=Mn;var In=w;var Pn=function(t,e,r){var i=t.lab();var n=e.lab();return new In(i[0]+r*(n[0]-i[0]),i[1]+r*(n[1]-i[1]),i[2]+r*(n[2]-i[2]),"lab")};gn.lab=Pn;var jn=w;var Ln=function(t,e,r,i){var n,s;var o,a;if(i==="hsl"){o=t.hsl();a=e.hsl()}else if(i==="hsv"){o=t.hsv();a=e.hsv()}else if(i==="hcg"){o=t.hcg();a=e.hcg()}else if(i==="hsi"){o=t.hsi();a=e.hsi()}else if(i==="lch"||i==="hcl"){i="hcl";o=t.hcl();a=e.hcl()}else if(i==="oklch"){o=t.oklch().reverse();a=e.oklch().reverse()}var u,l,f,h,c,d;if(i.substr(0,1)==="h"||i==="oklch"){n=o,u=n[0],f=n[1],c=n[2];s=a,l=s[0],h=s[1],d=s[2]}var p,g,y,m;if(!isNaN(u)&&!isNaN(l)){if(l>u&&l-u>180){m=l-(u+360)}else if(l180){m=l+360-u}else{m=l-u}g=u+r*m}else if(!isNaN(u)){g=u;if((d==1||d==0)&&i!="hsv"){p=f}}else if(!isNaN(l)){g=l;if((c==1||c==0)&&i!="hsv"){p=h}}else{g=Number.NaN}if(p===undefined){p=f+r*(h-f)}y=c+r*(d-c);return i==="oklch"?new jn([y,p,g],i):new jn([g,p,y],i)};var Dn=Ln;var Fn=function(t,e,r){return Dn(t,e,r,"lch")};gn.lch=Fn;gn.hcl=Fn;var Wn=w;var Hn=function(t,e,r){var i=t.num();var n=e.num();return new Wn(i+r*(n-i),"num")};gn.num=Hn;var Nn=Ln;var Un=function(t,e,r){return Nn(t,e,r,"hcg")};gn.hcg=Un;var zn=Ln;var Yn=function(t,e,r){return zn(t,e,r,"hsi")};gn.hsi=Yn;var Vn=Ln;var Gn=function(t,e,r){return Vn(t,e,r,"hsl")};gn.hsl=Gn;var Zn=Ln;var Kn=function(t,e,r){return Zn(t,e,r,"hsv")};gn.hsv=Kn;var Xn=w;var qn=function(t,e,r){var i=t.oklab();var n=e.oklab();return new Xn(i[0]+r*(n[0]-i[0]),i[1]+r*(n[1]-i[1]),i[2]+r*(n[2]-i[2]),"oklab")};gn.oklab=qn;var Jn=Ln;var $n=function(t,e,r){return Jn(t,e,r,"oklch")};gn.oklch=$n;var Qn=w;var ts=d.clip_rgb;var es=Math.pow;var rs=Math.sqrt;var is=Math.PI;var ns=Math.cos;var ss=Math.sin;var os=Math.atan2;var as=function(t,s,o){if(s===void 0)s="lrgb";if(o===void 0)o=null;var e=t.length;if(!o){o=Array.from(new Array(e)).map(function(){return 1})}var r=e/o.reduce(function(t,e){return t+e});o.forEach(function(t,e){o[e]*=r});t=t.map(function(t){return new Qn(t)});if(s==="lrgb"){return us(t,o)}var i=t.shift();var a=i.get(s);var u=[];var l=0;var f=0;for(var n=0;n=360){p-=360}a[d]=p}else{a[d]=a[d]/u[d]}}c/=e;return new Qn(a,s).alpha(c>.99999?1:c,true)};var us=function(t,e){var r=t.length;var i=[0,0,0,0];for(var n=0;n.9999999){i[3]=1}return new Qn(ts(i))};var ls=_;var fs=d.type;var hs=Math.pow;var cs=function(l){var u="rgb";var f=ls("#ccc");var e=0;var h=[0,1];var c=[];var d=[0,0];var p=false;var g=[];var r=false;var y=0;var m=1;var i=false;var b={};var v=true;var w=1;var n=function(t){t=t||["#fff","#000"];if(t&&fs(t)==="string"&&ls.brewer&&ls.brewer[t.toLowerCase()]){t=ls.brewer[t.toLowerCase()]}if(fs(t)==="array"){if(t.length===1){t=[t[0],t[0]]}t=t.slice(0);for(var e=0;e=p[r]){r++}return r-1}return 0};var _=function(t){return t};var C=function(t){return t};var T=function(t,e){var r,i;if(e==null){e=false}if(isNaN(t)||t===null){return f}if(!e){if(p&&p.length>2){var n=x(t);i=n/(p.length-2)}else if(m!==y){i=(t-y)/(m-y)}else{i=1}}else{i=t}i=C(i);if(!e){i=_(i)}if(w!==1){i=hs(i,w)}i=d[0]+i*(1-d[0]-d[1]);i=Math.min(1,Math.max(0,i));var s=Math.floor(i*1e4);if(v&&b[s]){r=b[s]}else{if(fs(g)==="array"){for(var o=0;o=a&&o===c.length-1){r=g[o];break}if(i>a&&i2){var o=r.map(function(t,e){return e/(r.length-1)});var a=r.map(function(t){return(t-y)/(m-y)});if(!a.every(function(t,e){return o[e]===t})){C=function(t){if(t<=0||t>=1){return t}var e=0;while(t>=a[e+1]){e++}var r=(t-a[e])/(a[e+1]-a[e]);var i=o[e]+r*(o[e+1]-o[e]);return i}}}}h=[y,m];return S};S.mode=function(t){if(!arguments.length){return u}u=t;s();return S};S.range=function(t,e){n(t);return S};S.out=function(t){r=t;return S};S.spread=function(t){if(!arguments.length){return e}e=t;return S};S.correctLightness=function(t){if(t==null){t=true}i=t;s();if(i){_=function(t){var e=T(0,true).lab()[0];var r=T(1,true).lab()[0];var i=e>r;var n=T(t,true).lab()[0];var s=e+(r-e)*t;var o=n-s;var a=0;var u=1;var l=20;while(Math.abs(o)>.01&&l-- >0){(function(){if(i){o*=-1}if(o<0){a=t;t+=(u-t)*.5}else{u=t;t+=(a-t)*.5}n=T(t,true).lab()[0];return o=n-s})()}return t}}else{_=function(t){return t}}return S};S.padding=function(t){if(t!=null){if(fs(t)==="number"){t=[t,t]}d=t;return S}else{return d}};S.colors=function(e,r){if(arguments.length<2){r="hex"}var t=[];if(arguments.length===0){t=g.slice(0)}else if(e===1){t=[S(.5)]}else if(e>1){var i=h[0];var n=h[1]-i;t=ds(0,e,false).map(function(t){return S(i+t/(e-1)*n)})}else{l=[];var s=[];if(p&&p.length>2){for(var o=1,a=p.length,u=1<=a;u?oa;u?o++:o--){s.push((p[o-1]+p[o])*.5)}}else{s=h}t=s.map(function(t){return S(t)})}if(ls[r]){t=t.map(function(t){return t[r]()})}return t};S.cache=function(t){if(t!=null){v=t;return S}else{return v}};S.gamma=function(t){if(t!=null){w=t;return S}else{return w}};S.nodata=function(t){if(t!=null){f=ls(t);return S}else{return f}};return S};function ds(t,e,r){var i=[];var n=ts;n?o++:o--){i.push(o)}return i}var ps=w;var gs=cs;var ys=function(t){var e=[1,1];for(var r=1;r=5){var l,f,h;l=t.map(function(t){return t.lab()});h=t.length-1;f=ys(h);n=function(n){var s=1-n;var t=[0,1,2].map(function(i){return l.reduce(function(t,e,r){return t+f[r]*Math.pow(s,h-r)*Math.pow(n,r)*e[i]},0)});return new ps(t,"lab")}}else{throw new RangeError("No point in running bezier with only one color.")}return n};var bs=function(t){var e=ms(t);e.scale=function(){return gs(e)};return e};var vs=_;var ws=function(t,e,r){if(!ws[r]){throw new Error("unknown blend mode "+r)}return ws[r](t,e)};var xs=function(n){return function(t,e){var r=vs(e).rgb();var i=vs(t).rgb();return vs.rgb(n(r,i))}};var _s=function(i){return function(t,e){var r=[];r[0]=i(t[0],e[0]);r[1]=i(t[1],e[1]);r[2]=i(t[2],e[2]);return r}};var Cs=function(t){return t};var Ts=function(t,e){return t*e/255};var Ss=function(t,e){return t>e?e:t};var ks=function(t,e){return t>e?t:e};var As=function(t,e){return 255*(1-(1-t/255)*(1-e/255))};var Es=function(t,e){return e<128?2*t*e/255:255*(1-2*(1-t/255)*(1-e/255))};var Bs=function(t,e){return 255*(1-(1-e/255)/(t/255))};var Rs=function(t,e){if(t===255){return 255}t=255*(e/255)/(1-t/255);return t>255?255:t};ws.normal=xs(_s(Cs));ws.multiply=xs(_s(Ts));ws.screen=xs(_s(As));ws.overlay=xs(_s(Es));ws.darken=xs(_s(Ss));ws.lighten=xs(_s(ks));ws.dodge=xs(_s(Rs));ws.burn=xs(_s(Bs));var Os=ws;var Ms=d.type;var Is=d.clip_rgb;var Ps=d.TWOPI;var js=Math.pow;var Ls=Math.sin;var Ds=Math.cos;var Fs=_;var Ws=function(f,h,c,d,p){if(f===void 0)f=300;if(h===void 0)h=-1.5;if(c===void 0)c=1;if(d===void 0)d=1;if(p===void 0)p=[0,1];var g=0,y;if(Ms(p)==="array"){y=p[1]-p[0]}else{y=0;p=[p,p]}var e=function(t){var e=Ps*((f+120)/360+h*t);var r=js(p[0]+y*t,d);var i=g!==0?c[0]+t*g:c;var n=i*r*(1-r)/2;var s=Ds(e);var o=Ls(e);var a=r+n*(-.14861*s+1.78277*o);var u=r+n*(-.29227*s-.90649*o);var l=r+n*(+1.97294*s);return Fs(Is([a*255,u*255,l*255,1]))};e.start=function(t){if(t==null){return f}f=t;return e};e.rotations=function(t){if(t==null){return h}h=t;return e};e.gamma=function(t){if(t==null){return d}d=t;return e};e.hue=function(t){if(t==null){return c}c=t;if(Ms(c)==="array"){g=c[1]-c[0];if(g===0){c=c[1]}}else{g=0}return e};e.lightness=function(t){if(t==null){return p}if(Ms(t)==="array"){p=t;y=t[1]-t[0]}else{p=[t,t];y=0}return e};e.scale=function(){return Fs.scale(e)};e.hue(c);return e};var Hs=w;var Ns="0123456789abcdef";var Us=Math.floor;var zs=Math.random;var Ys=function(){var t="#";for(var e=0;e<6;e++){t+=Ns.charAt(Us(zs()*16))}return new Hs(t,"hex")};var Vs=a;var Gs=Math.log;var Zs=Math.pow;var Ks=Math.floor;var Xs=Math.abs;var qs=function(t,e){if(e===void 0)e=null;var r={min:Number.MAX_VALUE,max:Number.MAX_VALUE*-1,sum:0,values:[],count:0};if(Vs(t)==="object"){t=Object.values(t)}t.forEach(function(t){if(e&&Vs(t)==="object"){t=t[e]}if(t!==undefined&&t!==null&&!isNaN(t)){r.values.push(t);r.sum+=t;if(tr.max){r.max=t}r.count+=1}});r.domain=[r.min,r.max];r.limits=function(t,e){return Js(r,t,e)};return r};var Js=function(t,e,r){if(e===void 0)e="equal";if(r===void 0)r=7;if(Vs(t)=="array"){t=qs(t)}var i=t.min;var n=t.max;var s=t.values.sort(function(t,e){return t-e});if(r===1){return[i,n]}var o=[];if(e.substr(0,1)==="c"){o.push(i);o.push(n)}if(e.substr(0,1)==="e"){o.push(i);for(var a=1;a 0")}var u=Math.LOG10E*Gs(i);var l=Math.LOG10E*Gs(n);o.push(i);for(var f=1;f200){v=false}}var j={};for(var L=0;Li?(r+.05)/(i+.05):(i+.05)/(r+.05)};var eo=w;var ro=Math.sqrt;var io=Math.pow;var no=Math.min;var so=Math.max;var oo=Math.atan2;var ao=Math.abs;var uo=Math.cos;var lo=Math.sin;var fo=Math.exp;var ho=Math.PI;var co=function(t,e,r,i,n){if(r===void 0)r=1;if(i===void 0)i=1;if(n===void 0)n=1;var s=function(t){return 360*t/(2*ho)};var o=function(t){return 2*ho*t/360};t=new eo(t);e=new eo(e);var a=Array.from(t.lab());var u=a[0];var l=a[1];var f=a[2];var h=Array.from(e.lab());var c=h[0];var d=h[1];var p=h[2];var g=(u+c)/2;var y=ro(io(l,2)+io(f,2));var m=ro(io(d,2)+io(p,2));var b=(y+m)/2;var v=.5*(1-ro(io(b,7)/(io(b,7)+io(25,7))));var w=l*(1+v);var x=d*(1+v);var _=ro(io(w,2)+io(f,2));var C=ro(io(x,2)+io(p,2));var T=(_+C)/2;var S=s(oo(f,w));var k=s(oo(p,x));var A=S>=0?S:S+360;var E=k>=0?k:k+360;var B=ao(A-E)>180?(A+E+360)/2:(A+E)/2;var R=1-.17*uo(o(B-30))+.24*uo(o(2*B))+.32*uo(o(3*B+6))-.2*uo(o(4*B-63));var O=E-A;O=ao(O)<=180?O:E<=A?O+360:O-360;O=2*ro(_*C)*lo(o(O)/2);var M=c-u;var I=C-_;var P=1+.015*io(g-50,2)/ro(20+io(g-50,2));var j=1+.045*T;var L=1+.015*T*R;var D=30*fo(-io((B-275)/25,2));var F=2*ro(io(T,7)/(io(T,7)+io(25,7)));var W=-F*lo(2*o(D));var H=ro(io(M/(r*P),2)+io(I/(i*j),2)+io(O/(n*L),2)+W*(I/(i*j))*(O/(n*L)));return so(0,no(100,H))};var po=w;var go=function(t,e,r){if(r===void 0)r="lab";t=new po(t);e=new po(e);var i=t.get(r);var n=e.get(r);var s=0;for(var o in i){var a=(i[o]||0)-(n[o]||0);s+=a*a}return Math.sqrt(s)};var yo=w;var mo=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];try{new(Function.prototype.bind.apply(yo,[null].concat(t)));return true}catch(t){return false}};var bo=_;var vo=cs;var wo={cool:function t(){return vo([bo.hsl(180,1,.9),bo.hsl(250,.7,.4)])},hot:function t(){return vo(["#000","#f00","#ff0","#fff"]).mode("rgb")}};var xo={OrRd:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#b30000","#7f0000"],PuBu:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#045a8d","#023858"],BuPu:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#810f7c","#4d004b"],Oranges:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"],BuGn:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#006d2c","#00441b"],YlOrBr:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#993404","#662506"],YlGn:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"],Reds:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"],RdPu:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177","#49006a"],Greens:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"],YlGnBu:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#253494","#081d58"],Purples:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"],GnBu:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#0868ac","#084081"],Greys:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"],YlOrRd:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#bd0026","#800026"],PuRd:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#980043","#67001f"],Blues:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"],PuBuGn:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016c59","#014636"],Viridis:["#440154","#482777","#3f4a8a","#31678e","#26838f","#1f9d8a","#6cce5a","#b6de2b","#fee825"],Spectral:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"],RdYlGn:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"],RdBu:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"],PiYG:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"],PRGn:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"],RdYlBu:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],BrBG:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"],RdGy:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"],PuOr:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"],Set2:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494","#b3b3b3"],Accent:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17","#666666"],Set1:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf","#999999"],Set3:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5","#ffed6f"],Dark2:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d","#666666"],Paired:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99","#b15928"],Pastel2:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc","#cccccc"],Pastel1:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec","#f2f2f2"]};for(var _o=0,Co=Object.keys(xo);_o0){throw new Error("cwise: pre() block may not reference array args")}if(i0){throw new Error("cwise: post() block may not reference array args")}}else if(n==="scalar"){e.scalarArgs.push(i);e.shimArgs.push("scalar"+i)}else if(n==="index"){e.indexArgs.push(i);if(i0){throw new Error("cwise: pre() block may not reference array index")}if(i0){throw new Error("cwise: post() block may not reference array index")}}else if(n==="shape"){e.shapeArgs.push(i);if(ir.length){throw new Error("cwise: Too many arguments in pre() block")}if(e.body.args.length>r.length){throw new Error("cwise: Too many arguments in body() block")}if(e.post.args.length>r.length){throw new Error("cwise: Too many arguments in post() block")}e.debug=!!t.printCode||!!t.debug;e.funcName=t.funcName||"cwise";e.blockSize=t.blockSize||64;return s(e)}e.exports=i},{"./lib/thunk.js":67}],66:[function(t,e,r){"use strict";var T=t("uniq");function S(t,e,r){var i=t.length,n=e.arrayArgs.length,s=e.indexArgs.length>0,o=[],a=[],u=0,l=0,f,h;for(f=0;f0){o.push("var "+a.join(","))}for(f=i-1;f>=0;--f){u=t[f];o.push(["for(i",f,"=0;i",f,"0){o.push(["index[",l,"]-=s",l].join(""))}o.push(["++index[",u,"]"].join(""))}o.push("}")}return o.join("\n")}function k(t,e,r,i){var n=e.length,s=r.arrayArgs.length,o=r.blockSize,a=r.indexArgs.length>0,u=[];for(var l=0;l0;){"].join(""));u.push(["if(j",l,"<",o,"){"].join(""));u.push(["s",e[l],"=j",l].join(""));u.push(["j",l,"=0"].join(""));u.push(["}else{s",e[l],"=",o].join(""));u.push(["j",l,"-=",o,"}"].join(""));if(a){u.push(["index[",e[l],"]=j",l].join(""))}}for(var l=0;l0){r=r&&e[i]===e[i-1]}}if(r){return e[0]}return e.join("")}function i(t,e){var r=e[1].length-Math.abs(t.arrayBlockIndices[0])|0;var i=new Array(t.arrayArgs.length);var n=new Array(t.arrayArgs.length);for(var s=0;s0){g.push("shape=SS.slice(0)")}if(t.indexArgs.length>0){var y=new Array(r);for(var s=0;s0){p.push("var "+g.join(","))}for(var s=0;s3){p.push(E(t.pre,t,n))}var w=E(t.body,t,n);var x=A(f);if(x3){p.push(E(t.post,t,n))}if(t.debug){console.log("-----Generated cwise routine for ",e,":\n"+p.join("\n")+"\n----------")}var _=[t.funcName||"unnamed","_cwise_loop_",i[0].join("s"),"m",x,B(n)].join("");var C=new Function(["function ",_,"(",d.join(","),"){",p.join("\n"),"} return ",_].join(""));return C()}e.exports=i},{uniq:140}],67:[function(t,e,r){"use strict";var c=t("./compile.js");function i(t){var e=["'use strict'","var CACHED={}"];var r=[];var i=t.funcName+"_cwise_thunk";e.push(["return function ",i,"(",t.shimArgs.join(","),"){"].join(""));var n=[];var s=[];var o=[["array",t.arrayArgs[0],".shape.slice(",Math.max(0,t.arrayBlockIndices[0]),t.arrayBlockIndices[0]<0?","+t.arrayBlockIndices[0]+")":")"].join("")];var a=[],u=[];for(var l=0;l0){a.push("array"+t.arrayArgs[0]+".shape.length===array"+f+".shape.length+"+(Math.abs(t.arrayBlockIndices[0])-Math.abs(t.arrayBlockIndices[l])));u.push("array"+t.arrayArgs[0]+".shape[shapeIndex+"+Math.max(0,t.arrayBlockIndices[0])+"]===array"+f+".shape[shapeIndex+"+Math.max(0,t.arrayBlockIndices[l])+"]")}}if(t.arrayArgs.length>1){e.push("if (!("+a.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same dimensionality!')");e.push("for(var shapeIndex=array"+t.arrayArgs[0]+".shape.length-"+Math.abs(t.arrayBlockIndices[0])+"; shapeIndex--\x3e0;) {");e.push("if (!("+u.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same shape!')");e.push("}")}for(var l=0;l0&&!t[o-1])o--;i.push({children:[],index:0});var a=i[0],u;for(n=0;n0){if(i.length===0)throw new Error("Could not recreate Huffman Table");a=i.pop()}a.index++;i.push(a);while(i.length<=n){i.push(u={children:[],index:0});a.children[a.index]=u.children;a=u}r++}if(n+10){v--;return b>>v&1}b=e[r++];if(b==255){var t=e[r++];if(t){throw new Error("unexpected marker: "+(b<<8|t).toString(16))}}v=7;return b>>>7}function x(t){var e=t,r;while((r=w())!==null){e=e[r];if(typeof e==="number")return e;if(typeof e!=="object")throw new Error("invalid huffman sequence")}return null}function _(t){var e=0;while(t>0){var r=w();if(r===null)return;e=e<<1|r;t--}return e}function C(t){var e=_(t);if(e>=1<>4;if(o===0){if(a<15)break;n+=16;continue}n+=a;var u=tt[n];e[u]=C(o);n++}}function S(t,e){var r=x(t.huffmanTableDC);var i=r===0?0:C(r)<0){A--;return}var r=l,i=f;while(r<=i){var n=x(t.huffmanTableAC);var s=n&15,o=n>>4;if(s===0){if(o<15){A=_(o)+(1<>4;if(u===0){if(n<15){A=_(n)+(1<=65488&&U<=65495){r+=2}else break}return r-m}function it(t,b){var e=[];var r=b.blocksPerLine;var i=b.blocksPerColumn;var n=r<<3;var s=new Int32Array(64),o=new Uint8Array(64);function a(t,e,r){var i=b.quantizationTable;var n,s,o,a,u,l,f,h,c;var d=r;var p;for(p=0;p<64;p++)d[p]=t[p]*i[p];for(p=0;p<8;++p){var g=8*p;if(d[1+g]==0&&d[2+g]==0&&d[3+g]==0&&d[4+g]==0&&d[5+g]==0&&d[6+g]==0&&d[7+g]==0){c=S*d[0+g]+512>>10;d[0+g]=c;d[1+g]=c;d[2+g]=c;d[3+g]=c;d[4+g]=c;d[5+g]=c;d[6+g]=c;d[7+g]=c;continue}n=S*d[0+g]+128>>8;s=S*d[4+g]+128>>8;o=d[2+g];a=d[6+g];u=k*(d[1+g]-d[7+g])+128>>8;h=k*(d[1+g]+d[7+g])+128>>8;l=d[3+g]<<4;f=d[5+g]<<4;c=n-s+1>>1;n=n+s+1>>1;s=c;c=o*T+a*C+128>>8;o=o*C-a*T+128>>8;a=c;c=u-f+1>>1;u=u+f+1>>1;f=c;c=h+l+1>>1;l=h-l+1>>1;h=c;c=n-a+1>>1;n=n+a+1>>1;a=c;c=s-o+1>>1;s=s+o+1>>1;o=c;c=u*_+h*x+2048>>12;u=u*x-h*_+2048>>12;h=c;c=l*w+f*v+2048>>12;l=l*v-f*w+2048>>12;f=c;d[0+g]=n+h;d[7+g]=n-h;d[1+g]=s+f;d[6+g]=s-f;d[2+g]=o+l;d[5+g]=o-l;d[3+g]=a+u;d[4+g]=a-u}for(p=0;p<8;++p){var y=p;if(d[1*8+y]==0&&d[2*8+y]==0&&d[3*8+y]==0&&d[4*8+y]==0&&d[5*8+y]==0&&d[6*8+y]==0&&d[7*8+y]==0){c=S*r[p+0]+8192>>14;d[0*8+y]=c;d[1*8+y]=c;d[2*8+y]=c;d[3*8+y]=c;d[4*8+y]=c;d[5*8+y]=c;d[6*8+y]=c;d[7*8+y]=c;continue}n=S*d[0*8+y]+2048>>12;s=S*d[4*8+y]+2048>>12;o=d[2*8+y];a=d[6*8+y];u=k*(d[1*8+y]-d[7*8+y])+2048>>12;h=k*(d[1*8+y]+d[7*8+y])+2048>>12;l=d[3*8+y];f=d[5*8+y];c=n-s+1>>1;n=n+s+1>>1;s=c;c=o*T+a*C+2048>>12;o=o*C-a*T+2048>>12;a=c;c=u-f+1>>1;u=u+f+1>>1;f=c;c=h+l+1>>1;l=h-l+1>>1;h=c;c=n-a+1>>1;n=n+a+1>>1;a=c;c=s-o+1>>1;s=s+o+1>>1;o=c;c=u*_+h*x+2048>>12;u=u*x-h*_+2048>>12;h=c;c=l*w+f*v+2048>>12;l=l*v-f*w+2048>>12;f=c;d[0*8+y]=n+h;d[7*8+y]=n-h;d[1*8+y]=s+f;d[6*8+y]=s-f;d[2*8+y]=o+l;d[5*8+y]=o-l;d[3*8+y]=a+u;d[4*8+y]=a-u}for(p=0;p<64;++p){var m=128+(d[p]+8>>4);e[p]=m<0?0:m>255?255:m}}nt(n*i*8);var u,l;for(var f=0;f255?255:t}e.prototype={load:function t(e){var r=new XMLHttpRequest;r.open("GET",e,true);r.responseType="arraybuffer";r.onload=function(){var t=new Uint8Array(r.response||r.mozResponseArrayBuffer);this.parse(t);if(this.onload)this.onload()}.bind(this);r.send(null)},parse:function t(r){var e=this.opts.maxResolutionInMP*1e3*1e3;var i=0,n=r.length;function s(){var t=r[i]<<8|r[i+1];i+=2;return t}function o(){var t=s();var e=r.subarray(i,i+t-2);i+=e.length;return e}function a(t){var e=1,r=1;var i,n;for(n in t.components){if(t.components.hasOwnProperty(n)){i=t.components[n];if(e>4===0){for(w=0;w<64;w++){var E=tt[w];A[E]=r[i++]}}else if(k>>4===1){for(w=0;w<64;w++){var E=tt[w];A[E]=s()}}else throw new Error("DQT: invalid table spec");d[k&15]=A}break;case 65472:case 65473:case 65474:s();h={};h.extended=m===65473;h.progressive=m===65474;h.precision=r[i++];h.scanLines=s();h.samplesPerLine=s();h.components={};h.componentsOrder=[];var B=h.scanLines*h.samplesPerLine;if(B>e){var R=Math.ceil((B-e)/1e6);throw new Error(`maxResolutionInMP limit exceeded by ${R}MP`)}var O=r[i++],M;var I=0,P=0;for(v=0;v>4;var L=r[i+1]&15;var D=r[i+2];if(j<=0||L<=0){throw new Error("Invalid sampling factor, expected values above 0")}h.componentsOrder.push(M);h.components[M]={h:j,v:L,quantizationIdx:D};i+=3}a(h);p.push(h);break;case 65476:var F=s();for(v=2;v>4===0?y:g)[W&15]=et(H,U)}break;case 65501:s();c=s();break;case 65500:s();s();break;case 65498:var z=s();var Y=r[i++];var V=[],G;for(v=0;v>4];G.huffmanTableAC=g[Z&15];V.push(G)}var K=r[i++];var X=r[i++];var q=r[i++];var J=rt(r,i,h,V,c,K,X,q>>4,q&15,this.opts);i+=J;break;case 65535:if(r[i]!==255){i--}break;default:if(r[i-3]==255&&r[i-2]>=192&&r[i-2]<=254){i-=3;break}else if(m===224||m==225){if(b!==-1){throw new Error(`first unknown JPEG marker at offset ${b.toString(16)}, second unknown JPEG marker ${m.toString(16)} at offset ${(i-1).toString(16)}`)}b=i-1;const Q=s();if(r[i+Q-2]===255){i+=Q-2;break}}throw new Error("unknown JPEG marker "+m.toString(16))}m=s()}if(p.length!=1)throw new Error("only single frame JPEGs supported");for(var v=0;vn){var r=Math.ceil((e-n)/1024/1024);throw new Error(`maxMemoryUsageInMB limit exceeded by at least ${r}MB`)}i=e}e.resetMaxMemoryUsage=function(t){i=0;n=t};e.getBytesAllocated=function(){return i};e.requestMemoryAllocation=nt;return e}();if(typeof e!=="undefined"){e.exports=t}else if(typeof window!=="undefined"){window["jpeg-js"]=window["jpeg-js"]||{};window["jpeg-js"].decode=t}function t(t,e={}){var r={colorTransform:undefined,useTArray:false,formatAsRGBA:true,tolerantDecoding:true,maxResolutionInMP:100,maxMemoryUsageInMB:512};var i={...r,...e};var n=new Uint8Array(t);var s=new l;s.opts=i;l.resetMaxMemoryUsage(i.maxMemoryUsageInMB*1024*1024);s.parse(n);var o=i.formatAsRGBA?4:3;var a=s.width*s.height*o;try{l.requestMemoryAllocation(a);var u={width:s.width,height:s.height,exifBuffer:s.exifBuffer,data:i.useTArray?new Uint8Array(a):f.alloc(a)};if(s.comments.length>0){u["comments"]=s.comments}}catch(t){if(t instanceof RangeError){throw new Error("Could not allocate enough memory for the image. "+"Required: "+a)}if(t instanceof ReferenceError){if(t.message==="Buffer is not defined"){throw new Error("Buffer is not globally defined in this environment. "+"Consider setting useTArray to true")}}throw t}s.copyToImageData(u,i.formatAsRGBA);return u}}).call(this)}).call(this,t("buffer").Buffer)},{buffer:152}],72:[function(t,rt,e){(function(et){(function(){var tt=tt||function(t){return et.from(t).toString("base64")};function n(r){var t=this;var e=Math.round;var h=Math.floor;var c=new Array(64);var d=new Array(64);var T=new Array(64);var S=new Array(64);var k;var A;var E;var B;var w=new Array(65535);var x=new Array(65535);var Q=new Array(64);var _=new Array(64);var R=[];var O=0;var M=7;var I=new Array(64);var P=new Array(64);var j=new Array(64);var i=new Array(256);var L=new Array(2048);var n;var C=[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];var u=[0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0];var l=[0,1,2,3,4,5,6,7,8,9,10,11];var f=[0,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,125];var p=[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];var g=[0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0];var y=[0,1,2,3,4,5,6,7,8,9,10,11];var m=[0,0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,119];var b=[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 s(t){var e=[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];for(var r=0;r<64;r++){var i=h((e[r]*t+50)/100);if(i<1){i=1}else if(i>255){i=255}c[C[r]]=i}var n=[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];for(var s=0;s<64;s++){var o=h((n[s]*t+50)/100);if(o<1){o=1}else if(o>255){o=255}d[C[s]]=o}var a=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379];var u=0;for(var l=0;l<8;l++){for(var f=0;f<8;f++){T[u]=1/(c[C[u]]*a[l]*a[f]*8);S[u]=1/(d[C[u]]*a[l]*a[f]*8);u++}}}function o(t,e){var r=0;var i=0;var n=new Array;for(var s=1;s<=16;s++){for(var o=1;o<=t[s];o++){n[e[i]]=[];n[e[i]][0]=r;n[e[i]][1]=s;i++;r++}r*=2}return n}function a(){k=o(u,l);A=o(g,y);E=o(f,p);B=o(m,b)}function v(){var t=1;var e=2;for(var r=1;r<=15;r++){for(var i=t;i>0]=38470*t;L[t+512>>0]=7471*t+32768;L[t+768>>0]=-11059*t;L[t+1024>>0]=-21709*t;L[t+1280>>0]=32768*t+8421375;L[t+1536>>0]=-27439*t;L[t+1792>>0]=-5329*t}}function F(t){var e=t[0];var r=t[1]-1;while(r>=0){if(e&1<>8&255);W(t&255)}function N(t,e){var r,i,n,s,o,a,u,l;var f=0;var h;var c=8;var d=64;for(h=0;h0?$+.5|0:$-.5|0}return Q}function U(){H(65504);H(16);W(74);W(70);W(73);W(70);W(0);W(1);W(1);W(0);H(1);H(1);W(0);W(0)}function z(t){if(!t)return;H(65505);if(t[0]===69&&t[1]===120&&t[2]===105&&t[3]===102){H(t.length+2)}else{H(t.length+5+2);W(69);W(120);W(105);W(102);W(0)}for(var e=0;e{if(typeof t!=="string")return;H(65534);var e=t.length;H(e+2);var r;for(r=0;r0&&_[p]==0;p--){}if(p==0){F(s);return r}var g=1;var y;while(g<=p){var m=g;for(;_[g]==0&&g<=p;++g){}var b=g-m;if(b>=u){y=b>>4;for(var v=1;v<=y;++v)F(o);b=b&15}a=32767+_[g];F(n[(b<<4)+x[a]]);F(w[a]);g++}if(p!=l){F(s)}return r}function q(){var t=String.fromCharCode;for(var e=0;e<256;e++){i[e]=t(e)}}this.encode=function(t,e){var r=(new Date).getTime();if(e)J(e);R=new Array;O=0;M=7;H(65496);U();Z(t.comments);z(t.exifBuffer);V();Y(t.width,t.height);G();K();var i=0;var n=0;var s=0;O=0;M=7;this.encode.displayName="_encode_";var o=t.data;var a=t.width;var u=t.height;var l=a*4;var f=a*3;var h,c=0;var d,p,g;var y,m,b,v,w;while(c>3;b=(w&7)*4;m=y+v*l+b;if(c+v>=u){m-=l*(c+1+v-u)}if(h+b>=l){m-=h+b-l+4}d=o[m++];p=o[m++];g=o[m++];I[w]=(L[d]+L[p+256>>0]+L[g+512>>0]>>16)-128;P[w]=(L[d+768>>0]+L[p+1024>>0]+L[g+1280>>0]>>16)-128;j[w]=(L[d+1280>>0]+L[p+1536>>0]+L[g+1792>>0]>>16)-128}i=X(I,T,i,k,E);n=X(P,S,n,A,B);s=X(j,S,s,A,B);h+=32}c+=8}if(M>=0){var x=[];x[1]=M+1;x[0]=(1<100){t=100}if(n==t)return;var e=0;if(t<50){e=Math.floor(5e3/t)}else{e=Math.floor(200-t*2)}s(e);n=t}function $(){var t=(new Date).getTime();if(!r)r=50;q();a();v();D();J(r);var e=(new Date).getTime()-t}$()}if(typeof rt!=="undefined"){rt.exports=t}else if(typeof window!=="undefined"){window["jpeg-js"]=window["jpeg-js"]||{};window["jpeg-js"].encode=t}function t(t,e){if(typeof e==="undefined")e=50;var r=new n(e);var i=r.encode(t,e);return{data:i,width:t.width,height:t.height}}function e(t){var e=typeof t=="string"?document.getElementById(t):t;var r=document.createElement("canvas");r.width=e.width;r.height=e.height;var i=r.getContext("2d");i.drawImage(e,0,0);return i.getImageData(0,0,r.width,r.height)}}).call(this)}).call(this,t("buffer").Buffer)},{buffer:152}],73:[function(t,e,r){"use strict";function s(t){if(!this||!(this instanceof s)){return new s(t)}this.require=t}e.exports=s;s.property=(e,r,i,n)=>{Object.defineProperty(e,r,{configurable:true,enumerable:!!n,get:function(){var t=i(e,r);Object.defineProperty(e,r,{configurable:true,enumerable:!!n,writable:false,value:t});return t}});return e};s.prototype.property=s.property;s.properties=(e,r,i)=>{Object.keys(r).forEach(t=>{s.property(e,t,r[t],i)});return e};s.prototype.properties=s.properties;s.instanceProperty=(t,e,r,i)=>{Object.defineProperty(t,e,{configurable:true,enumerable:!!i,get:function(){var t=r(this,e);Object.defineProperty(this,e,{configurable:true,enumerable:!!i,writable:false,value:t});return t}});return t};s.prototype.instanceProperty=s.instanceProperty;s.instanceProperties=(e,r,i)=>{Object.keys(r).forEach(t=>{s.property(e,t,r[t],i)});return e};s.prototype.instanceProperties=s.instanceProperties;s.value=t=>{var e=true,r;return function(){if(e){r=t();e=false}return r}};s.prototype.value=s.value;s.require=function(i,n){var s=true,o;return new Proxy(()=>{},{construct:(t,e)=>{if(s){o=i(n);s=false}return Reflect.construct(o,e)},apply:(t,e,r)=>{if(s){o=i(n);s=false}return Reflect.apply(o,e,r)},get:(t,e)=>{if(s){o=i(n);s=false}return Reflect.get(o,e)}})};s.prototype.require=function(t){return s.require(this.require,t)};s.requireProperty=function(e,r,i,n,s){Object.defineProperty(r,i,{configurable:true,enumerable:!!s,get:function(){var t=e(n);Object.defineProperty(r,i,{configurable:true,enumerable:!!s,writable:false,value:t});return t}});return r};s.prototype.requireProperty=function(t,e,r,i){return s.requireProperty(this.require,t,e,r,i)};s.requireProperties=function(e,r,i,n){Object.keys(i).forEach(t=>{s.requireProperty(e,r,t,i[t],n)});return r};s.prototype.requireProperties=function(t,e,r){return s.requireProperties(this.require,t,e,r)}},{}],74:[function(t,e,r){"use strict";var o=t("ndarray");var a=t("./doConvert.js");e.exports=function t(e,r){var i=[],n=e,s=1;while(Array.isArray(n)){i.push(n.length);s*=n.length;n=n[0]}if(i.length===0){return o()}if(!r){r=o(new Float64Array(s),i)}a(r,e);return r}},{"./doConvert.js":75,ndarray:76}],75:[function(t,e,r){e.exports=t("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:true,rvalue:false,count:1},{name:"_inline_1_arg1_",lvalue:false,rvalue:true,count:1},{name:"_inline_1_arg2_",lvalue:false,rvalue:true,count:4}],thisVars:[],localVars:["_inline_1_i","_inline_1_v"]},post:{body:"{}",args:[],thisVars:[],localVars:[]},funcName:"convert",blockSize:64})},{"cwise-compiler":65}],76:[function(t,e,r){var y=t("iota-array");var i=t("is-buffer");var n=typeof Float64Array!=="undefined";function s(t,e){return t[0]-e[0]}function m(){var t=this.stride;var e=new Array(t.length);var r;for(r=0;rMath.abs(this.stride[1]))?[1,0]:[0,1]}})")}else if(e===3){n.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];}}})")}}else{n.push("ORDER})")}}n.push("proto.set=function "+r+"_set("+a.join(",")+",v){");if(i){n.push("return this.data.set("+u+",v)}")}else{n.push("return this.data["+u+"]=v}")}n.push("proto.get=function "+r+"_get("+a.join(",")+"){");if(i){n.push("return this.data.get("+u+")}")}else{n.push("return this.data["+u+"]}")}n.push("proto.index=function "+r+"_index(",a.join(),"){return "+u+"}");n.push("proto.hi=function "+r+"_hi("+a.join(",")+"){return new "+r+"(this.data,"+o.map(function(t){return["(typeof i",t,"!=='number'||i",t,"<0)?this.shape[",t,"]:i",t,"|0"].join("")}).join(",")+","+o.map(function(t){return"this.stride["+t+"]"}).join(",")+",this.offset)}");var h=o.map(function(t){return"a"+t+"=this.shape["+t+"]"});var c=o.map(function(t){return"c"+t+"=this.stride["+t+"]"});n.push("proto.lo=function "+r+"_lo("+a.join(",")+"){var b=this.offset,d=0,"+h.join(",")+","+c.join(","));for(var d=0;d=0){d=i"+d+"|0;b+=c"+d+"*d;a"+d+"-=d}")}n.push("return new "+r+"(this.data,"+o.map(function(t){return"a"+t}).join(",")+","+o.map(function(t){return"c"+t}).join(",")+",b)}");n.push("proto.step=function "+r+"_step("+a.join(",")+"){var "+o.map(function(t){return"a"+t+"=this.shape["+t+"]"}).join(",")+","+o.map(function(t){return"b"+t+"=this.stride["+t+"]"}).join(",")+",c=this.offset,d=0,ceil=Math.ceil");for(var d=0;d=0){c=(c+this.stride["+d+"]*i"+d+")|0}else{a.push(this.shape["+d+"]);b.push(this.stride["+d+"])}")}n.push("var ctor=CTOR_LIST[a.length+1];return ctor(this.data,a,b,c)}");n.push("return function construct_"+r+"(data,shape,stride,offset){return new "+r+"(data,"+o.map(function(t){return"shape["+t+"]"}).join(",")+","+o.map(function(t){return"stride["+t+"]"}).join(",")+",offset)}");var s=new Function("CTOR_LIST","ORDER",n.join("\n"));return s(b[t],m)}function h(t){if(i(t)){return"buffer"}if(n){switch(Object.prototype.toString.call(t)){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"}}if(Array.isArray(t)){return"array"}return"generic"}var b={float32:[],float64:[],int8:[],int16:[],int32:[],uint8:[],uint16:[],uint32:[],array:[],uint8_clamped:[],bigint64:[],biguint64:[],buffer:[],generic:[]};(function(){for(var t in b){b[t].push(f(t,-1))}});function o(t,e,r,i){if(t===undefined){var n=b.array[0];return n([])}else if(typeof t==="number"){t=[t]}if(e===undefined){e=[t.length]}var s=e.length;if(r===undefined){r=new Array(s);for(var o=s-1,a=1;o>=0;--o){r[o]=a;a*=e[o]}}if(i===undefined){i=0;for(var o=0;o{this.listeners[t]=r.listeners[t].slice()});Object.keys(r.contexts).forEach(t=>{var e=r.contexts[t];this.contexts[t]={nice:e.nice,ready:true,status:e.status,serial:e.serial,scopes:{}}})}};f.initFrom=function(t){if(!t.__ngev){f.init.call(t)}Object.defineProperty(this,"__ngev",{configurable:true,value:new f.Internal(t.__ngev)})};f.mergeListeners=function(s){if(!this.__ngev){f.init.call(this)}var t=this.__ngev.listeners;this.__ngev.listeners={};Object.keys(t).forEach(t=>{this.__ngev.listeners[t]=[]});s.forEach(t=>{if(!t.__ngev){f.init.call(t)}Object.keys(t.__ngev.listeners).forEach(t=>{if(!this.__ngev.listeners[t]){this.__ngev.listeners[t]=[]}})});Object.keys(this.__ngev.listeners).forEach(e=>{var r,i,n=[];if(t[e]){t[e].forEach(t=>{for(r=0,i=s.length;r{t.__ngev.listeners[e].forEach(t=>{if(this.__ngev.listeners[e].indexOf(t)===-1&&n.indexOf(t)===-1){this.__ngev.listeners[e].push(t)}})})})};f.filterOutCallback=function(t,e){return t!==e};f.prototype.addListener=function(t,e,r){var i,n;if(!this.__ngev){f.init.call(this)}if(!this.__ngev.listeners[t]){this.__ngev.listeners[t]=[]}if(!t||typeof t!=="string"){throw new TypeError(".addListener(): argument #0 should be a non-empty string")}if(typeof e==="function"){i={};if(!r||typeof r!=="object"){r={}}}else if(r===true&&e&&typeof e==="object"){r=i=e;e=undefined}else{r=e;if(!r||typeof r!=="object"){throw new TypeError(".addListener(): a function or an object with a 'fn' property which value is a function should be provided")}e=undefined;i={}}i.fn=e||r.fn;i.id=r.id!==undefined?r.id:i.fn;if(r.unique){if(this.__ngev.listeners[t].find(t=>t.id===i.id)){return}}i.once=!!r.once;i.async=!!r.async;i.eventObject=!!r.eventObject;i.nice=r.nice!==undefined?Math.floor(r.nice):f.SYNC;i.priority=+r.priority||0;i.context=r.context&&(typeof r.context==="string"||typeof r.context==="object")?r.context:null;if(typeof i.fn!=="function"){throw new TypeError(".addListener(): a function or an object with a 'fn' property which value is a function should be provided")}if(typeof i.context==="string"){i.context=this.__ngev.contexts[i.context]||this.addListenerContext(i.context)}i.event=t;if(this.__ngev.listeners.newListener.length){n=this.__ngev.listeners.newListener.slice();this.__ngev.listeners[t].push(i);f.emitEvent({emitter:this,name:"newListener",args:[[i]],listeners:n});if(this.__ngev.states[t]){f.emitToOneListener(this.__ngev.states[t],i)}return this}this.__ngev.listeners[t].push(i);if(this.__ngev.hasListenerPriority){this.__ngev.listeners[t].sort((t,e)=>e.priority-t.priority)}if(this.__ngev.listeners[t].length===this.__ngev.maxListeners+1){s.emitWarning("Possible NextGenEvents memory leak detected. "+this.__ngev.listeners[t].length+" "+t+" listeners added. Use emitter.setMaxListeners() to increase limit",{type:"MaxListenersExceededWarning"})}if(this.__ngev.states[t]){f.emitToOneListener(this.__ngev.states[t],i)}return this};f.prototype.on=f.prototype.addListener;f.prototype.once=function(t,e,r){if(e&&typeof e==="object"){e.once=true}else if(r&&typeof r==="object"){r.once=true}else{r={once:true}}return this.addListener(t,e,r)};f.prototype.waitFor=function(t){return new Promise(e=>{this.addListener(t,t=>e(t),{once:true})})};f.prototype.waitForAll=function(t){return new Promise(e=>{this.addListener(t,(...t)=>e(t),{once:true})})};f.prototype.removeListener=function(t,e){if(!t||typeof t!=="string"){throw new TypeError(".removeListener(): argument #0 should be a non-empty string")}if(!this.__ngev){f.init.call(this)}var r=this.__ngev.listeners[t];if(!r||!r.length){return this}var i,n,s=0,o=r.length,a=this.__ngev.listeners.removeListener.length;if(a){n=[]}for(i=0;i=-n){e.emitter.__ngev.desync(f.listenerWrapper.bind(undefined,t,e,r,i,f.SYNC));return}}else{setTimeout(f.listenerWrapper.bind(undefined,t,e,r,i,f.SYNC),n);return}o=t=>{a.listenersDone++;if(t&&u&&!a.interrupt&&e.name!=="interrupt"){a.interrupt=t;if(a.callback){f.emitCallback(e)}e.emitter.emit("interrupt",a.interrupt)}else if(a.listenersDone>=a.listeners.length&&a.callback){f.emitCallback(e)}if(i){f.processScopeQueue(r,true,true)}};if(t.eventObject){t.fn(e,o)}else{s=t.fn(...e.args,o)}}else{if(n<0){if(l.recursions>=-n){e.emitter.__ngev.desync(f.listenerWrapper.bind(undefined,t,e,r,i,f.SYNC));return}}else{setTimeout(f.listenerWrapper.bind(undefined,t,e,r,i,f.SYNC),n);return}if(t.eventObject){t.fn(e)}else{s=t.fn(...e.args)}a.listenersDone++}if(s&&u&&!a.interrupt&&e.name!=="interrupt"){a.interrupt=s;if(a.callback){f.emitCallback(e)}e.emitter.emit("interrupt",a.interrupt)}else if(a.listenersDone>=a.listeners.length&&a.callback){f.emitCallback(e)}};var h=0;f.prototype.emit=function(...t){var e=f.createEvent(this,...t);return f.emitEvent(e)};f.prototype.emitIfListener=function(...t){var e=typeof t[0]==="number"?t[1]:t[0];if(!this.__ngev||!this.__ngev.listeners[e]||!this.__ngev.listeners[e].length){return null}var r=f.createEvent(this,...t);return f.emitEvent(r)};f.prototype.waitForEmit=function(...t){return new Promise(e=>{this.emit(...t,t=>e(t))})};f.createEvent=function(t,...e){var r={emitter:t,interrupt:null,master:null,sync:true};if(typeof e[0]==="number"){r.nice=Math.floor(e[0]);r.name=e[1];if(!r.name||typeof r.name!=="string"){throw new TypeError(".emit(): when argument #0 is a number, argument #1 should be a non-empty string")}if(typeof e[e.length-1]==="function"){r.callback=e[e.length-1];r.args=e.slice(2,-1)}else{r.args=e.slice(2)}}else{r.name=e[0];if(!r.name||typeof r.name!=="string"){throw new TypeError(".emit(): argument #0 should be an number or a non-empty string")}if(typeof e[e.length-1]==="function"){r.callback=e[e.length-1];r.args=e.slice(1,-1)}else{r.args=e.slice(1)}}return r};f.emitEvent=function(t){var e=t.emitter,r,i,n=0,s,o;if(!e.__ngev){f.init.call(e)}s=e.__ngev.states[t.name];if(s!==undefined){if(s&&t.args.length===s.args.length&&t.args.every((t,e)=>t===s.args[e])){return}e.__ngev.stateGroups[t.name].forEach(t=>{e.__ngev.states[t]=null});e.__ngev.states[t.name]=t}if(!e.__ngev.listeners[t.name]){e.__ngev.listeners[t.name]=[]}t.id=h++;t.listenersDone=0;if(t.nice===undefined||t.nice===null){t.nice=e.__ngev.nice}if(!t.listeners){t.listeners=e.__ngev.listeners[t.name].slice()}l.recursions++;t.depth=e.__ngev.depth++;o=[];try{for(r=0,i=t.listeners.length;r{var e=f.createEvent(...t);e.master=u;if(!e.emitter.__ngev){f.init.call(e.emitter)}if(!e.emitter.__ngev.listeners[e.name]){e.emitter.__ngev.listeners[e.name]=[]}e.listeners=e.emitter.__ngev.listeners[e.name].slice();e.id=h++;e.listeners.forEach(t=>o.push({event:e,listener:t}))});o.sort((t,e)=>e.listener.priority-t.listener.priority);l.recursions++;s=[];try{for(r=0,i=o.length;re(t.master.interrupt,t))}else{e(t.master.interrupt,t)}return}e=t.callback;delete t.callback;if(t.sync&&t.emitter.__ngev.nice!==f.SYNC){t.emitter.__ngev.desync(()=>{t.emitter.__ngev.depth--;e(t.interrupt,t)})}else{t.emitter.__ngev.depth--;e(t.interrupt,t)}};f.prototype.listeners=function(t){if(!t||typeof t!=="string"){throw new TypeError(".listeners(): argument #0 should be a non-empty string")}if(!this.__ngev){f.init.call(this)}if(!this.__ngev.listeners[t]){this.__ngev.listeners[t]=[]}return this.__ngev.listeners[t].slice()};f.listenerCount=function(t,e){if(!t||!(t instanceof f)){throw new TypeError(".listenerCount(): argument #0 should be an instance of NextGenEvents")}return t.listenerCount(e)};f.prototype.listenerCount=function(t){if(!t||typeof t!=="string"){throw new TypeError(".listenerCount(): argument #1 should be a non-empty string")}if(!this.__ngev||!this.__ngev.listeners[t]){return 0}return this.__ngev.listeners[t].length};f.prototype.setNice=function(t){if(!this.__ngev){f.init.call(this)}this.__ngev.nice=Math.floor(+t||0)};f.prototype.desyncUseNextTick=function(t){if(!this.__ngev){f.init.call(this)}this.__ngev.desync=t?r:e};f.prototype.setInterruptible=function(t){if(!this.__ngev){f.init.call(this)}this.__ngev.interruptible=!!t};f.prototype.setListenerPriority=function(t){if(!this.__ngev){f.init.call(this)}this.__ngev.hasListenerPriority=!!t};f.share=function(t,e){if(!(t instanceof f)||!(e instanceof f)){throw new TypeError("NextGenEvents.share() arguments should be instances of NextGenEvents")}if(!t.__ngev){f.init.call(t)}Object.defineProperty(e,"__ngev",{configurable:true,value:t.__ngev})};f.reset=function(t){Object.defineProperty(t,"__ngev",{configurable:true,value:null})};f.prototype.getMaxListeners=function(){if(!this.__ngev){f.init.call(this)}return this.__ngev.maxListeners};f.prototype.setMaxListeners=function(t){if(!this.__ngev){f.init.call(this)}this.__ngev.maxListeners=typeof t==="number"&&!Number.isNaN(t)?Math.floor(t):f.defaultMaxListeners;return this};f.noop=()=>undefined;f.prototype.defineStates=function(...e){if(!this.__ngev){f.init.call(this)}e.forEach(t=>{this.__ngev.states[t]=null;this.__ngev.stateGroups[t]=e})};f.prototype.hasState=function(t){if(!this.__ngev){f.init.call(this)}return!!this.__ngev.states[t]};f.prototype.getAllStates=function(){if(!this.__ngev){f.init.call(this)}return Object.keys(this.__ngev.states).filter(t=>this.__ngev.states[t])};f.groupAddListener=function(t,e,r,i){if(typeof r!=="function"){i=r;r=undefined}if(!i||typeof i!=="object"){i={}}r=r||i.fn;delete i.fn;i.id=i.id||r;t.forEach(t=>{t.addListener(e,r.bind(undefined,t),i)})};f.groupOn=f.groupAddListener;f.groupOnce=function(t,e,r,i){if(r&&typeof r==="object"){r.once=true}else if(i&&typeof i==="object"){i.once=true}else{i={once:true}}return this.groupAddListener(t,e,r,i)};f.groupWaitFor=function(t,e){return Promise.all(t.map(t=>t.waitFor(e)))};f.groupWaitForAll=function(t,e){return Promise.all(t.map(t=>t.waitForAll(e)))};f.groupOnceFirst=function(e,r,i,n){var s,o=false;if(typeof i!=="function"){n=i;i=undefined}if(!n||typeof n!=="object"){n={}}i=i||n.fn;delete n.fn;n.id=n.id||i;s=(...t)=>{if(o){return}o=true;f.groupRemoveListener(e,r,n.id);i(...t)};e.forEach(t=>{t.once(r,s.bind(undefined,t),n)})};f.groupWaitForFirst=function(t,r){return new Promise(e=>{f.groupOnceFirst(t,r,t=>e(t))})};f.groupWaitForFirstAll=function(t,r){return new Promise(e=>{f.groupOnceFirst(t,r,(...t)=>e(t))})};f.groupOnceLast=function(t,e,r,i){var n,s=false,o=t.length;if(typeof r!=="function"){i=r;r=undefined}if(!i||typeof i!=="object"){i={}}r=r||i.fn;delete i.fn;i.id=i.id||r;n=(...t)=>{if(s){return}if(--o){return}s=true;r(...t)};t.forEach(t=>{t.once(e,n.bind(undefined,t),i)})};f.groupWaitForLast=function(t,r){return new Promise(e=>{f.groupOnceLast(t,r,t=>e(t))})};f.groupWaitForLastAll=function(t,r){return new Promise(e=>{f.groupOnceLast(t,r,(...t)=>e(t))})};f.groupRemoveListener=function(t,e,r){t.forEach(t=>{t.removeListener(e,r)})};f.groupOff=f.groupRemoveListener;f.groupRemoveAllListeners=function(t,e){t.forEach(t=>{t.removeAllListeners(e)})};f.groupEmit=function(t,...e){var r,i,n=1,s,o=t.length,a,u,l=false;if(typeof e[e.length-1]==="function"){s=-1;a=e[e.length-1];u=t=>{if(l){return}if(t){l=true;a(t)}else if(!--o){l=true;a()}}}if(typeof e[0]==="number"){n=2;i=typeof e[0]}r=e[n-1];e=e.slice(n,s);t.forEach(t=>{f.emitEvent({emitter:t,name:r,args:e,nice:i,callback:u})})};f.groupWaitForEmit=function(t,...r){return new Promise(e=>{f.groupEmit(t,...r,t=>e(t))})};f.groupDefineStates=function(t,...e){t.forEach(t=>{t.defineStates(...e)})};f.groupGlobalOnce=f.groupOnceFirst;f.groupGlobalOnceAll=f.groupOnceLast;f.CONTEXT_ENABLED=0;f.CONTEXT_DISABLED=1;f.CONTEXT_QUEUED=2;f.prototype.addListenerContext=function(t,e){if(!this.__ngev){f.init.call(this)}if(!t||typeof t!=="string"){throw new TypeError(".addListenerContext(): argument #0 should be a non-empty string")}if(!e||typeof e!=="object"){e={}}var r=this.__ngev.contexts[t];if(!r){r=this.__ngev.contexts[t]={nice:f.SYNC,ready:true,status:f.CONTEXT_ENABLED,serial:false,scopes:{}}}if(e.nice!==undefined){r.nice=Math.floor(e.nice)}if(e.status!==undefined){r.status=e.status}if(e.serial!==undefined){r.serial=!!e.serial}return r};f.prototype.getListenerContext=function(t){return this.__ngev.contexts[t]};f.getContextScope=function(t,e){var r=t.scopes[e];if(!r){r=t.scopes[e]={ready:true,queue:[]}}return r};f.prototype.disableListenerContext=function(t){if(!this.__ngev){f.init.call(this)}if(!t||typeof t!=="string"){throw new TypeError(".disableListenerContext(): argument #0 should be a non-empty string")}if(!this.__ngev.contexts[t]){this.addListenerContext(t)}this.__ngev.contexts[t].status=f.CONTEXT_DISABLED;return this};f.prototype.enableListenerContext=function(t){if(!this.__ngev){f.init.call(this)}if(!t||typeof t!=="string"){throw new TypeError(".enableListenerContext(): argument #0 should be a non-empty string")}if(!this.__ngev.contexts[t]){this.addListenerContext(t)}var e=this.__ngev.contexts[t];e.status=f.CONTEXT_ENABLED;Object.values(e.scopes).forEach(t=>{if(t.queue.length>0){f.processScopeQueue(t,e.serial)}});return this};f.prototype.queueListenerContext=function(t){if(!this.__ngev){f.init.call(this)}if(!t||typeof t!=="string"){throw new TypeError(".queueListenerContext(): argument #0 should be a non-empty string")}if(!this.__ngev.contexts[t]){this.addListenerContext(t)}this.__ngev.contexts[t].status=f.CONTEXT_QUEUED;return this};f.prototype.serializeListenerContext=function(t,e){if(!this.__ngev){f.init.call(this)}if(!t||typeof t!=="string"){throw new TypeError(".serializeListenerContext(): argument #0 should be a non-empty string")}if(!this.__ngev.contexts[t]){this.addListenerContext(t)}this.__ngev.contexts[t].serial=e===undefined?true:!!e;return this};f.prototype.setListenerContextNice=function(t,e){if(!this.__ngev){f.init.call(this)}if(!t||typeof t!=="string"){throw new TypeError(".setListenerContextNice(): argument #0 should be a non-empty string")}if(!this.__ngev.contexts[t]){this.addListenerContext(t)}this.__ngev.contexts[t].nice=Math.floor(e);return this};f.prototype.destroyListenerContext=function(t){var e,r,i,n,s,o=[];if(!t||typeof t!=="string"){throw new TypeError(".disableListenerContext(): argument #0 should be a non-empty string")}if(!this.__ngev){f.init.call(this)}i=this.__ngev.contexts[t];if(!i){return}for(n in this.__ngev.listeners){s=null;r=this.__ngev.listeners[n].length;for(e=0;enew i(...t);i.prototype.addLocalService=function(t,e,r){this.localServices[t]=a.create(this,t,e,r);return this.localServices[t]};i.prototype.addRemoteService=function(t){this.remoteServices[t]=u.create(this,t);return this.remoteServices[t]};i.prototype.destroy=function(){Object.keys(this.localServices).forEach(t=>{this.localServices[t].destroy();delete this.localServices[t]});Object.keys(this.remoteServices).forEach(t=>{this.remoteServices[t].destroy();delete this.remoteServices[t]});this.receive=this.send=n};i.prototype.push=function(t){if(t.__type!==o||!t.service||typeof t.service!=="string"||!t.event||typeof t.event!=="string"||!t.method){return}switch(t.method){case"event":return this.remoteServices[t.service]&&this.remoteServices[t.service].receiveEvent(t);case"ackEmit":return this.remoteServices[t.service]&&this.remoteServices[t.service].receiveAckEmit(t);case"emit":return this.localServices[t.service]&&this.localServices[t.service].receiveEmit(t);case"listen":return this.localServices[t.service]&&this.localServices[t.service].receiveListen(t);case"ignore":return this.localServices[t.service]&&this.localServices[t.service].receiveIgnore(t);case"ackEvent":return this.localServices[t.service]&&this.localServices[t.service].receiveAckEvent(t);default:return}};i.prototype.receive=function(t){this.push(t)};i.prototype.send=function(){throw new Error("The send() method of the Proxy MUST be extended/overwritten")};function a(t,e,r,i){return a.create(t,e,r,i)}i.LocalService=a;a.create=function(t,e,r,i){var n=Object.create(a.prototype,{proxy:{value:t,enumerable:true},id:{value:e,enumerable:true},emitter:{value:r,writable:true,enumerable:true},internalEvents:{value:Object.create(s.prototype),writable:true,enumerable:true},events:{value:{},enumerable:true},canListen:{value:!!i.listen,writable:true,enumerable:true},canEmit:{value:!!i.emit,writable:true,enumerable:true},canAck:{value:!!i.ack,writable:true,enumerable:true},canRpc:{value:!!i.rpc,writable:true,enumerable:true},destroyed:{value:false,writable:true,enumerable:true}});return n};a.prototype.destroy=function(){Object.keys(this.events).forEach(t=>{this.emitter.off(t,this.events[t]);delete this.events[t]});this.emitter=null;this.destroyed=true};a.prototype.receiveEmit=function(e){if(this.destroyed||!this.canEmit||e.ack&&!this.canAck){return}var t={emitter:this.emitter,name:e.event,args:e.args||[]};if(e.ack){t.callback=t=>{this.proxy.send({__type:o,service:this.id,method:"ackEmit",ack:e.ack,event:e.event,interruption:t})}}s.emitEvent(t)};a.prototype.receiveListen=function(t){if(this.destroyed||!this.canListen||t.ack&&!this.canAck){return}if(t.ack){if(this.events[t.event]){if(this.events[t.event].ack){return}this.emitter.off(t.event,this.events[t.event])}this.events[t.event]=a.forwardWithAck.bind(this);this.events[t.event].ack=true;this.emitter.on(t.event,this.events[t.event],{eventObject:true,async:true})}else{if(this.events[t.event]){if(!this.events[t.event].ack){return}this.emitter.off(t.event,this.events[t.event])}this.events[t.event]=a.forward.bind(this);this.events[t.event].ack=false;this.emitter.on(t.event,this.events[t.event],{eventObject:true})}};a.prototype.receiveIgnore=function(t){if(this.destroyed||!this.canListen){return}if(!this.events[t.event]){return}this.emitter.off(t.event,this.events[t.event]);this.events[t.event]=null};a.prototype.receiveAckEvent=function(t){if(this.destroyed||!this.canListen||!this.canAck||!t.ack||!this.events[t.event]||!this.events[t.event].ack){return}this.internalEvents.emit("ack",t)};a.forward=function(t){if(this.destroyed){return}this.proxy.send({__type:o,service:this.id,method:"event",event:t.name,args:t.args})};a.forward.ack=false;a.forwardWithAck=function(t,e){if(this.destroyed){return}if(!t.callback){this.proxy.send({__type:o,service:this.id,method:"event",event:t.name,args:t.args});e();return}var r=false;var i=this.proxy.nextAckId++;var n=t=>{if(r||t.ack!==i){return}r=true;this.internalEvents.off("ack",n);e()};this.internalEvents.on("ack",n);this.proxy.send({__type:o,service:this.id,method:"event",event:t.name,ack:i,args:t.args})};a.forwardWithAck.ack=true;function u(t,e){return u.create(t,e)}i.RemoteService=u;var l=1;var f=2;u.create=function(t,e){var r=Object.create(u.prototype,{proxy:{value:t,enumerable:true},id:{value:e,enumerable:true},emitter:{value:Object.create(s.prototype),writable:true,enumerable:true},internalEvents:{value:Object.create(s.prototype),writable:true,enumerable:true},events:{value:{},enumerable:true},destroyed:{value:false,writable:true,enumerable:true}});return r};u.prototype.destroy=function(){this.emitter.removeAllListeners();this.emitter=null;Object.keys(this.events).forEach(t=>{delete this.events[t]});this.destroyed=true};u.prototype.emit=function(t,...e){if(this.destroyed){return}var r,i,n;if(typeof t==="number"){throw new TypeError("Cannot emit with a nice value on a remote service")}if(typeof e[e.length-1]!=="function"){this.proxy.send({__type:o,service:this.id,method:"emit",event:t,args:e});return}r=e.pop();i=this.proxy.nextAckId++;n=false;var s=t=>{if(n||t.ack!==i){return}n=true;this.internalEvents.off("ack",s);r(t.interruption)};this.internalEvents.on("ack",s);this.proxy.send({__type:o,service:this.id,method:"emit",ack:i,event:t,args:e})};u.prototype.addListener=function(t,e,r){if(this.destroyed){return}if(typeof e!=="function"){r=e;e=undefined}if(!r||typeof r!=="object"){r={}}r.fn=e||r.fn;this.emitter.addListener(t,r);if(!this.emitter.__ngev.listeners[t]||!this.emitter.__ngev.listeners[t].length){return}if(r.async&&this.events[t]!==f){this.events[t]=f;this.proxy.send({__type:o,service:this.id,method:"listen",ack:true,event:t})}else if(!r.async&&!this.events[t]){this.events[t]=l;this.proxy.send({__type:o,service:this.id,method:"listen",event:t})}};u.prototype.on=u.prototype.addListener;u.prototype.once=s.prototype.once;u.prototype.removeListener=function(t,e){if(this.destroyed){return}this.emitter.removeListener(t,e);if((!this.emitter.__ngev.listeners[t]||!this.emitter.__ngev.listeners[t].length)&&this.events[t]){this.events[t]=0;this.proxy.send({__type:o,service:this.id,method:"ignore",event:t})}};u.prototype.off=u.prototype.removeListener;u.prototype.receiveEvent=function(t){if(this.destroyed||!this.events[t.event]){return}var e={emitter:this.emitter,name:t.event,args:t.args||[]};if(t.ack){e.callback=()=>{this.proxy.send({__type:o,service:this.id,method:"ackEvent",ack:t.ack,event:t.event})}}s.emitEvent(e);var r=e.name;if(!this.emitter.__ngev.listeners[r]||!this.emitter.__ngev.listeners[r].length){this.events[r]=0;this.proxy.send({__type:o,service:this.id,method:"ignore",event:r})}};u.prototype.receiveAckEmit=function(t){if(this.destroyed||!t.ack||this.events[t.event]!==f){return}this.internalEvents.emit("ack",t)}},{"./NextGenEvents.js":77}],79:[function(t,e,r){e.exports={name:"nextgen-events",version:"1.5.3",description:"The next generation of events handling for javascript! New: abstract away the network!",main:"lib/NextGenEvents.js",engines:{node:">=6.0.0"},directories:{test:"test",bench:"bench"},dependencies:{},devDependencies:{browserify:"^17.0.0","uglify-js-es6":"^2.8.9",ws:"^7.4.6"},scripts:{test:"tea-time -R dot"},repository:{type:"git",url:"https://github.com/cronvel/nextgen-events.git"},keywords:["events","async","emit","listener","context","series","serialize","namespace","proxy","network"],author:"Cédric Ronvel",license:"MIT",bugs:{url:"https://github.com/cronvel/nextgen-events/issues"},config:{"tea-time":{coverDir:["lib"]}},copyright:{title:"Next-Gen Events",years:[2015,2021],owner:"Cédric Ronvel"}}},{}],80:[function(t,e,r){e.exports=t("./lib/bitmap")},{"./lib/bitmap":81}],81:[function(t,e,r){(function(o){(function(){var t=e.exports=r=function(t){this.buffer=t;this.initialized=false;this.fileHeader=null;this.infoHeader=null;this.coreHeader=null;this.colorPalette=null;this.dataPos=-1};t.prototype.CORE_TYPE_WINDOWS_V3=40;t.prototype.CORE_TYPE_WINDOWS_V4=108;t.prototype.CORE_TYPE_WINDOWS_V5=124;t.prototype.CORE_TYPE_OS2_V1=12;t.prototype.CORE_TYPE_OS2_V2=64;t.prototype.BITMAPCOREHEADER=t.prototype.CORE_TYPE_OS2_V1;t.prototype.BITMAPINFOHEADER=t.prototype.CORE_TYPE_WINDOWS_V3;t.prototype.BITMAPINFOHEADER2=t.prototype.CORE_TYPE_OS2_V2;t.prototype.BITMAPV4HEADER=t.prototype.CORE_TYPE_WINDOWS_V4;t.prototype.BITMAPV5HEADER=t.prototype.CORE_TYPE_WINDOWS_V5;t.prototype.COMPRESSION_BI_RGB=0;t.prototype.COMPRESSION_BI_RLE8=1;t.prototype.COMPRESSION_BI_RLE4=2;t.prototype.COMPRESSION_BI_BITFIELDS=3;t.prototype.COMPRESSION_BI_JPEG=4;t.prototype.COMPRESSION_BI_PNG=5;t.prototype.BITCOUNT_2=1;t.prototype.BITCOUNT_16=4;t.prototype.BITCOUNT_256=8;t.prototype.BITCOUNT_16bit=16;t.prototype.BITCOUNT_24bit=24;t.prototype.BITCOUNT_32bit=32;t.prototype.init=function(){this.readFileHeader();this.readInfoHeader();this.readCoreHeader();this.readColorPalette();this.initDataPos();this.initialized=true};t.prototype.checkInit=function(){if(!this.initialized){throw new Error("not initialized")}};t.prototype.isBitmap=function(){this.checkInit();if("BM"==this.fileHeader.bfType){return true}return false};t.prototype.getData=function(){this.checkInit();if(this.COMPRESSION_BI_RGB!==this.coreHeader.__copmression__){throw new Error("not supported compression: "+this.coreHeader.__copmression__)}var t=this.coreHeader.__bitCount__;var e=this.getWidth();var r=this.getHeight();var i=e*t/8;if(0!=i%4){i=(i/4+1)*4}var n=[];var s=this.dataPos;for(var o=0;o65535||e>65535)throw new Error("Width/Height invalid.");function w(t){var e=t.length;if(e<2||e>256||e&e-1){throw new Error("Invalid code/color length, must be power of 2 and 2 .. 256.")}return e}m[b++]=71;m[b++]=73;m[b++]=70;m[b++]=56;m[b++]=57;m[b++]=97;var n=0;var s=0;if(v!==null){var o=w(v);while(o>>=1)++n;o=1<=o)throw new Error("Background index out of range.");if(s===0)throw new Error("Background index explicitly passed as 0.")}}m[b++]=t&255;m[b++]=t>>8&255;m[b++]=e&255;m[b++]=e>>8&255;m[b++]=(v!==null?128:0)|n;m[b++]=s;m[b++]=0;if(v!==null){for(var a=0,u=v.length;a>16&255;m[b++]=l>>8&255;m[b++]=l&255}}if(i!==null){if(i<0||i>65535)throw new Error("Loop count invalid.");m[b++]=33;m[b++]=255;m[b++]=11;m[b++]=78;m[b++]=69;m[b++]=84;m[b++]=83;m[b++]=67;m[b++]=65;m[b++]=80;m[b++]=69;m[b++]=50;m[b++]=46;m[b++]=48;m[b++]=3;m[b++]=1;m[b++]=i&255;m[b++]=i>>8&255;m[b++]=0}var x=false;this.addFrame=function(t,e,r,i,n,s){if(x===true){--b;x=false}s=s===undefined?{}:s;if(t<0||e<0||t>65535||e>65535)throw new Error("x/y invalid.");if(r<=0||i<=0||r>65535||i>65535)throw new Error("Width/Height invalid.");if(n.length>=1)++l;u=1<3)throw new Error("Disposal out of range.");var c=false;var d=0;if(s.transparent!==undefined&&s.transparent!==null){c=true;d=s.transparent;if(d<0||d>=u)throw new Error("Transparent color index.")}if(h!==0||c||f!==0){m[b++]=33;m[b++]=249;m[b++]=4;m[b++]=h<<2|(c===true?1:0);m[b++]=f&255;m[b++]=f>>8&255;m[b++]=d;m[b++]=0}m[b++]=44;m[b++]=t&255;m[b++]=t>>8&255;m[b++]=e&255;m[b++]=e>>8&255;m[b++]=r&255;m[b++]=r>>8&255;m[b++]=i&255;m[b++]=i>>8&255;m[b++]=o===true?128|l-1:0;if(o===true){for(var p=0,g=a.length;p>16&255;m[b++]=y>>8&255;m[b++]=y&255}}b=_(m,b,l<2?2:l,n);return b};this.end=function(){if(x===false){m[b++]=59;x=true}return b};this.getOutputBuffer=function(){return m};this.setOutputBuffer=function(t){m=t};this.getOutputBufferPosition=function(){return b};this.setOutputBufferPosition=function(t){b=t}}function _(e,r,t,i){e[r++]=t;var n=r++;var s=1<=t){e[r++]=h&255;h>>=8;f-=8;if(r===n+256){e[n]=255;n=r++}}}function d(t){h|=t<=8){e[r++]=h&255;h>>=8;f-=8;if(r===n+256){e[n]=255;n=r++}}if(u===4096){d(s);u=a+1;l=t+1;g={}}else{if(u>=1<>7;var n=r&7;var s=1<=0))throw Error("Invalid block size");if(g===0)break;t+=g}}break;case 249:if(x[t++]!==4||x[t+4]!==0)throw new Error("Invalid graphics extension block.");var y=x[t++];h=x[t++]|x[t++]<<8;c=x[t++];if((y&1)===0)c=null;d=y>>2&7;t++;break;case 254:while(true){var g=x[t++];if(!(g>=0))throw Error("Invalid block size");if(g===0)break;t+=g}break;default:throw new Error("Unknown graphic control label: 0x"+x[t-1].toString(16))}break;case 44:var m=x[t++]|x[t++]<<8;var b=x[t++]|x[t++]<<8;var v=x[t++]|x[t++]<<8;var w=x[t++]|x[t++]<<8;var C=x[t++];var T=C>>7;var S=C>>6&1;var k=C&7;var A=1<=0))throw Error("Invalid block size");if(g===0)break;t+=g}f.push({x:m,y:b,width:v,height:w,has_local_palette:R,palette_offset:E,palette_size:B,data_offset:O,data_length:t-O,transparent_index:c,interlaced:!!S,delay:h,disposal:d});break;case 59:l=false;break;default:throw new Error("Unknown gif block: 0x"+x[t-1].toString(16));break}}this.numFrames=function(){return f.length};this.loopCount=function(){return p};this.frameInfo=function(t){if(t<0||t>=f.length)throw new Error("Frame index out of range.");return f[t]};this.decodeAndBlitFrameBGRA=function(t,e){var r=this.frameInfo(t);var i=r.width*r.height;var n=new Uint8Array(i);M(x,r.data_offset,n,i);var s=r.palette_offset;var o=r.transparent_index;if(o===null)o=256;var a=r.width;var u=_-a;var l=a;var f=(r.y*_+r.x)*4;var h=((r.y+r.height)*_+r.x)*4;var c=f;var d=u*4;if(r.interlaced===true){d+=_*4*7}var p=8;for(var g=0,y=n.length;g=h){d=u*4+_*4*(p-1);c=f+(a+u)*(p<<1);p>>=1}}if(m===o){c+=4}else{var b=x[s+m*3];var v=x[s+m*3+1];var w=x[s+m*3+2];e[c++]=w;e[c++]=v;e[c++]=b;e[c++]=255}--l}};this.decodeAndBlitFrameRGBA=function(t,e){var r=this.frameInfo(t);var i=r.width*r.height;var n=new Uint8Array(i);M(x,r.data_offset,n,i);var s=r.palette_offset;var o=r.transparent_index;if(o===null)o=256;var a=r.width;var u=_-a;var l=a;var f=(r.y*_+r.x)*4;var h=((r.y+r.height)*_+r.x)*4;var c=f;var d=u*4;if(r.interlaced===true){d+=_*4*7}var p=8;for(var g=0,y=n.length;g=h){d=u*4+_*4*(p-1);c=f+(a+u)*(p<<1);p>>=1}}if(m===o){c+=4}else{var b=x[s+m*3];var v=x[s+m*3+1];var w=x[s+m*3+2];e[c++]=b;e[c++]=v;e[c++]=w;e[c++]=255}--l}}}function M(t,e,r,i){var n=t[e++];var s=1<>=u;f-=u;if(y===s){a=o+1;u=n+1;l=(1<s){v=p[v]>>8;++b}var w=v;var x=c+b+(m!==y?1:0);if(x>i){console.log("Warning, gif stream longer than expected.");return}r[c++]=w;c+=b;var _=c;if(m!==y)r[c++]=w;v=m;while(b--){v=p[v];r[--_]=v&255;v>>=8}if(g!==null&&a<4096){p[a++]=g<<8|w;if(a>=l+1&&u<12){++u;l=l<<1|1}}g=y}if(c!==i){console.log("Warning, gif stream shorter than expected.")}return r}try{r.GifWriter=i;r.GifReader=n}catch(t){}},{}],83:[function(t,e,r){(function(m){(function(){"use strict";let d=t("./interlace");let f=[function(){},function(t,e,r,i){if(i===e.length){throw new Error("Ran out of data")}let n=e[i];t[r]=n;t[r+1]=n;t[r+2]=n;t[r+3]=255},function(t,e,r,i){if(i+1>=e.length){throw new Error("Ran out of data")}let n=e[i];t[r]=n;t[r+1]=n;t[r+2]=n;t[r+3]=e[i+1]},function(t,e,r,i){if(i+2>=e.length){throw new Error("Ran out of data")}t[r]=e[i];t[r+1]=e[i+1];t[r+2]=e[i+2];t[r+3]=255},function(t,e,r,i){if(i+3>=e.length){throw new Error("Ran out of data")}t[r]=e[i];t[r+1]=e[i+1];t[r+2]=e[i+2];t[r+3]=e[i+3]}];let h=[function(){},function(t,e,r,i){let n=e[0];t[r]=n;t[r+1]=n;t[r+2]=n;t[r+3]=i},function(t,e,r){let i=e[0];t[r]=i;t[r+1]=i;t[r+2]=i;t[r+3]=e[1]},function(t,e,r,i){t[r]=e[0];t[r+1]=e[1];t[r+2]=e[2];t[r+3]=i},function(t,e,r){t[r]=e[0];t[r+1]=e[1];t[r+2]=e[2];t[r+3]=e[3]}];function p(l,f){let h=[];let c=0;function r(){if(c===l.length){throw new Error("Ran out of data")}let t=l[c];c++;let e,r,i,n,s,o,a,u;switch(f){default:throw new Error("unrecognised depth");case 16:a=l[c];c++;h.push((t<<8)+a);break;case 4:a=t&15;u=t>>4;h.push(u,a);break;case 2:s=t&3;o=t>>2&3;a=t>>4&3;u=t>>6&3;h.push(u,a,o,s);break;case 1:e=t&1;r=t>>1&1;i=t>>2&1;n=t>>3&1;s=t>>4&1;o=t>>5&1;a=t>>6&1;u=t>>7&1;h.push(u,a,o,s,n,i,r,e);break}}return{get:function(t){while(h.length0){this._paused=false;this.emit("drain")}}.bind(this))};r.prototype.write=function(t,e){if(!this.writable){this.emit("error",new Error("Stream not writable"));return false}let r;if(o.isBuffer(t)){r=t}else{r=o.from(t,e||this._encoding)}this._buffers.push(r);this._buffered+=r.length;this._process();if(this._reads&&this._reads.length===0){this._paused=true}return this.writable&&!this._paused};r.prototype.end=function(t,e){if(t){this.write(t,e)}this.writable=false;if(!this._buffers){return}if(this._buffers.length===0){this._end()}else{this._buffers.push(null);this._process()}};r.prototype.destroySoon=r.prototype.end;r.prototype._end=function(){if(this._reads.length>0){this.emit("error",new Error("Unexpected end of input"))}this.destroy()};r.prototype.destroy=function(){if(!this._buffers){return}this.writable=false;this._reads=null;this._buffers=null;this.emit("close")};r.prototype._processReadAllowingLess=function(t){this._reads.shift();let e=this._buffers[0];if(e.length>t.length){this._buffered-=t.length;this._buffers[0]=e.slice(t.length);t.func.call(this,e.slice(0,t.length))}else{this._buffered-=e.length;this._buffers.shift();t.func.call(this,e)}};r.prototype._processRead=function(r){this._reads.shift();let i=0;let n=0;let s=o.alloc(r.length);while(i0){this._buffers.splice(0,n)}this._buffered-=r.length;r.func.call(this,s)};r.prototype._process=function(){try{while(this._buffered>0&&this._reads&&this._reads.length>0){let t=this._reads[0];if(t.allowLess){this._processReadAllowingLess(t)}else if(this._buffered>=t.length){this._processRead(t)}else{break}}if(this._buffers&&!this.writable){this._end()}}catch(t){this.emit("error",t)}}}).call(this)}).call(this,n("_process"),n("buffer").Buffer)},{_process:184,buffer:152,stream:186,util:207}],86:[function(t,e,r){"use strict";e.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}},{}],87:[function(t,e,r){"use strict";let i=[];(function(){for(let t=0;t<256;t++){let e=t;for(let t=0;t<8;t++){if(e&1){e=3988292384^e>>>1}else{e=e>>>1}}i[t]=e}})();let n=e.exports=function(){this._crc=-1};n.prototype.write=function(e){for(let t=0;t>>8}return true};n.prototype.crc32=function(){return this._crc^-1};n.crc32=function(e){let r=-1;for(let t=0;t>>8}return r^-1}},{}],88:[function(f,g,t){(function(p){(function(){"use strict";let h=f("./paeth-predictor");function t(e,r,i,n,s){for(let t=0;t=a?i[n+r-a]:0;let e=i[n+r]-t;s[o+r]=e}}function i(i,n,t,s){let o=0;for(let r=0;r=s?i[n+r-s]:0;let e=i[n+r]-t;o+=Math.abs(e)}return o}function n(i,n,s,o,a){for(let r=0;r0?i[n+r-s]:0;let e=i[n+r]-t;o[a+r]=e}}function s(i,n,s){let o=0;let t=n+s;for(let r=n;r0?i[r-s]:0;let e=i[r]-t;o+=Math.abs(e)}return o}function o(n,s,o,a,u,l){for(let i=0;i=l?n[s+i-l]:0;let e=s>0?n[s+i-o]:0;let r=n[s+i]-(t+e>>1);a[u+i]=r}}function a(n,s,o,a){let u=0;for(let i=0;i=a?n[s+i-a]:0;let e=s>0?n[s+i-o]:0;let r=n[s+i]-(t+e>>1);u+=Math.abs(r)}return u}function u(s,o,a,u,l,f){for(let n=0;n=f?s[o+n-f]:0;let e=o>0?s[o+n-a]:0;let r=o>0&&n>=f?s[o+n-(a+f)]:0;let i=s[o+n]-h(t,e,r);u[l+n]=i}}function l(s,o,a,u){let l=0;for(let n=0;n=u?s[o+n-u]:0;let e=o>0?s[o+n-a]:0;let r=o>0&&n>=u?s[o+n-(a+u)]:0;let i=s[o+n]-h(t,e,r);l+=Math.abs(i)}return l}let c={0:t,1:r,2:n,3:o,4:u};let d={0:e,1:i,2:s,3:a,4:l};g.exports=function(i,t,e,r,n){let s;if(!("filterType"in r)||r.filterType===-1){s=[0,1,2,3,4]}else if(typeof r.filterType==="number"){s=[r.filterType]}else{throw new Error("unrecognised filter types")}if(r.bitDepth===16){n*=2}let o=t*n;let a=0;let u=0;let l=p.alloc((o+1)*e);let f=s[0];for(let t=0;t1){let r=Infinity;for(let e=0;eo?n[r-s]:0;n[r]=t+e}};t.prototype._unFilterType2=function(i,n,t){let s=this._lastLine;for(let r=0;ru?o[n-a]:0;let i=Math.floor((r+e)/2);o[n]=t+i}};t.prototype._unFilterType4=function(o,a,t){let u=this._xComparison;let l=u-1;let f=this._lastLine;for(let s=0;sl?a[s-u]:0;let i=s>l&&f?f[s-u]:0;let n=h(r,e,i);a[s]=t+n}};t.prototype._reverseFilterLine=function(t){let e=t[0];let r;let i=this._images[this._imageIndex];let n=i.byteWidth;if(e===0){r=t.slice(1,n+1)}else{r=s.alloc(n);switch(e){case 1:this._unFilterType1(t,r,n);break;case 2:this._unFilterType2(t,r,n);break;case 3:this._unFilterType3(t,r,n);break;case 4:this._unFilterType4(t,r,n);break;default:throw new Error("Unrecognised filter type - "+e)}}this.write(r);i.lineIndex++;if(i.lineIndex>=i.height){this._lastLine=null;this._imageIndex++;i=this._images[this._imageIndex]}else{this._lastLine=r}if(i){this.read(i.byteWidth+1,this._reverseFilterLine.bind(this))}else{this._lastLine=null;this.complete()}}}).call(this)}).call(this,e("buffer").Buffer)},{"./interlace":93,"./paeth-predictor":97,buffer:152}],92:[function(t,e,r){(function(d){(function(){"use strict";function f(r,i,e,n,s){let o=0;for(let t=0;t0&&i>0){n.push({width:r,height:i,index:t})}}return n};r.getInterlaceIterator=function(a){return function(t,e,r){let i=t%l[r].x.length;let n=(t-i)/l[r].x.length*8+l[r].x[i];let s=e%l[r].y.length;let o=(e-s)/l[r].y.length*8+l[r].y[s];return n*4+o*a*4}}},{}],94:[function(n,a,t){(function(o){(function(){"use strict";let t=n("util");let r=n("stream");let s=n("./constants");let i=n("./packer");let e=a.exports=function(t){r.call(this);let e=t||{};this._packer=new i(e);this._deflate=this._packer.createDeflate();this.readable=true};t.inherits(e,r);e.prototype.pack=function(t,e,r,i){this.emit("data",o.from(s.PNG_SIGNATURE));this.emit("data",this._packer.packIHDR(e,r));if(i){this.emit("data",this._packer.packGAMA(i))}let n=this._packer.filterData(t,e,r);this._deflate.on("error",this.emit.bind(this,"error"));this._deflate.on("data",function(t){this.emit("data",this._packer.packIDAT(t))}.bind(this));this._deflate.on("end",function(){this.emit("data",this._packer.packIEND());this.emit("end")}.bind(this));this._deflate.end(n)}}).call(this)}).call(this,n("buffer").Buffer)},{"./constants":86,"./packer":96,buffer:152,stream:186,util:207}],95:[function(t,e,r){(function(h){(function(){"use strict";let a=true;let u=t("zlib");if(!u.deflateSync){a=false}let l=t("./constants");let f=t("./packer");e.exports=function(t,e){if(!a){throw new Error("To use the sync capability of this library in old node versions, please pin pngjs to v2.3.0")}let r=e||{};let i=new f(r);let n=[];n.push(h.from(l.PNG_SIGNATURE));n.push(i.packIHDR(t.width,t.height));if(t.gamma){n.push(i.packGAMA(t.gamma))}let s=i.filterData(t.data,t.width,t.height);let o=u.deflateSync(s,i.getDeflateOptions());s=null;if(!o||!o.length){throw new Error("bad png - invalid compressed data response")}n.push(i.packIDAT(o));n.push(i.packIEND());return h.concat(n)}}).call(this)}).call(this,t("buffer").Buffer)},{"./constants":86,"./packer":96,buffer:152,zlib:151}],96:[function(r,i,t){(function(s){(function(){"use strict";let o=r("./constants");let n=r("./crc");let a=r("./bitpacker");let u=r("./filter-pack");let e=r("zlib");let t=i.exports=function(t){this._options=t;t.deflateChunkSize=t.deflateChunkSize||32*1024;t.deflateLevel=t.deflateLevel!=null?t.deflateLevel:9;t.deflateStrategy=t.deflateStrategy!=null?t.deflateStrategy:3;t.inputHasAlpha=t.inputHasAlpha!=null?t.inputHasAlpha:true;t.deflateFactory=t.deflateFactory||e.createDeflate;t.bitDepth=t.bitDepth||8;t.colorType=typeof t.colorType==="number"?t.colorType:o.COLORTYPE_COLOR_ALPHA;t.inputColorType=typeof t.inputColorType==="number"?t.inputColorType:o.COLORTYPE_COLOR_ALPHA;if([o.COLORTYPE_GRAYSCALE,o.COLORTYPE_COLOR,o.COLORTYPE_COLOR_ALPHA,o.COLORTYPE_ALPHA].indexOf(t.colorType)===-1){throw new Error("option color type:"+t.colorType+" is not supported at present")}if([o.COLORTYPE_GRAYSCALE,o.COLORTYPE_COLOR,o.COLORTYPE_COLOR_ALPHA,o.COLORTYPE_ALPHA].indexOf(t.inputColorType)===-1){throw new Error("option input color type:"+t.inputColorType+" is not supported at present")}if(t.bitDepth!==8&&t.bitDepth!==16){throw new Error("option bit depth:"+t.bitDepth+" is not supported at present")}};t.prototype.getDeflateOptions=function(){return{chunkSize:this._options.deflateChunkSize,level:this._options.deflateLevel,strategy:this._options.deflateStrategy}};t.prototype.createDeflate=function(){return this._options.deflateFactory(this.getDeflateOptions())};t.prototype.filterData=function(t,e,r){let i=a(t,e,r,this._options);let n=o.COLORTYPE_TO_BPP_MAP[this._options.colorType];let s=u(i,e,r,this._options,n);return s};t.prototype._packChunk=function(t,e){let r=e?e.length:0;let i=s.alloc(r+12);i.writeUInt32BE(r,0);i.writeUInt32BE(t,4);if(e){e.copy(i,8)}i.writeInt32BE(n.crc32(i.slice(4,i.length-4)),i.length-4);return i};t.prototype.packGAMA=function(t){let e=s.alloc(4);e.writeUInt32BE(Math.floor(t*o.GAMMA_DIVISION),0);return this._packChunk(o.TYPE_gAMA,e)};t.prototype.packIHDR=function(t,e){let r=s.alloc(13);r.writeUInt32BE(t,0);r.writeUInt32BE(e,4);r[8]=this._options.bitDepth;r[9]=this._options.colorType;r[10]=0;r[11]=0;r[12]=0;return this._packChunk(o.TYPE_IHDR,r)};t.prototype.packIDAT=function(t){return this._packChunk(o.TYPE_IDAT,t)};t.prototype.packIEND=function(){return this._packChunk(o.TYPE_IEND,null)}}).call(this)}).call(this,r("buffer").Buffer)},{"./bitpacker":84,"./constants":86,"./crc":87,"./filter-pack":88,buffer:152,zlib:151}],97:[function(t,e,r){"use strict";e.exports=function t(e,r,i){let n=e+r-i;let s=Math.abs(n-e);let o=Math.abs(n-r);let a=Math.abs(n-i);if(s<=o&&s<=a){return e}if(o<=a){return r}return i}},{}],98:[function(t,e,r){"use strict";let i=t("util");let o=t("zlib");let n=t("./chunkstream");let s=t("./filter-parse-async");let a=t("./parser");let u=t("./bitmapper");let l=t("./format-normaliser");let f=e.exports=function(t){n.call(this);this._parser=new a(t,{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),simpleTransparency:this._simpleTransparency.bind(this),headersFinished:this._headersFinished.bind(this)});this._options=t;this.writable=true;this._parser.start()};i.inherits(f,n);f.prototype._handleError=function(t){this.emit("error",t);this.writable=false;this.destroy();if(this._inflate&&this._inflate.destroy){this._inflate.destroy()}if(this._filter){this._filter.destroy();this._filter.on("error",function(){})}this.errord=true};f.prototype._inflateData=function(t){if(!this._inflate){if(this._bitmapInfo.interlace){this._inflate=o.createInflate();this._inflate.on("error",this.emit.bind(this,"error"));this._filter.on("complete",this._complete.bind(this));this._inflate.pipe(this._filter)}else{let t=(this._bitmapInfo.width*this._bitmapInfo.bpp*this._bitmapInfo.depth+7>>3)+1;let e=t*this._bitmapInfo.height;let r=Math.max(e,o.Z_MIN_CHUNK);this._inflate=o.createInflate({chunkSize:r});let i=e;let n=this.emit.bind(this,"error");this._inflate.on("error",function(t){if(!i){return}n(t)});this._filter.on("complete",this._complete.bind(this));let s=this._filter.write.bind(this._filter);this._inflate.on("data",function(t){if(!i){return}if(t.length>i){t=t.slice(0,i)}i-=t.length;s(t)});this._inflate.on("end",this._filter.end.bind(this._filter))}}this._inflate.write(t)};f.prototype._handleMetaData=function(t){this._metaData=t;this._bitmapInfo=Object.create(t);this._filter=new s(this._bitmapInfo)};f.prototype._handleTransColor=function(t){this._bitmapInfo.transColor=t};f.prototype._handlePalette=function(t){this._bitmapInfo.palette=t};f.prototype._simpleTransparency=function(){this._metaData.alpha=true};f.prototype._headersFinished=function(){this.emit("metadata",this._metaData)};f.prototype._finished=function(){if(this.errord){return}if(!this._inflate){this.emit("error","No Inflate block")}else{this._inflate.end()}};f.prototype._complete=function(e){if(this.errord){return}let r;try{let t=u.dataToBitMap(e,this._bitmapInfo);r=l(t,this._bitmapInfo,this._options.skipRescale);t=null}catch(t){this._handleError(t);return}this.emit("parsed",r)}},{"./bitmapper":83,"./chunkstream":85,"./filter-parse-async":89,"./format-normaliser":92,"./parser":100,util:207,zlib:151}],99:[function(t,e,r){(function(E){(function(){"use strict";let w=true;let x=t("zlib");let _=t("./sync-inflate");if(!x.deflateSync){w=false}let C=t("./sync-reader");let T=t("./filter-parse-sync");let S=t("./parser");let k=t("./bitmapper");let A=t("./format-normaliser");e.exports=function(t,e){if(!w){throw new Error("To use the sync capability of this library in old node versions, please pin pngjs to v2.3.0")}let r;function i(t){r=t}let n;function s(t){n=t}function o(t){n.transColor=t}function a(t){n.palette=t}function u(){n.alpha=true}let l;function f(t){l=t}let h=[];function c(t){h.push(t)}let d=new C(t);let p=new S(e,{read:d.read.bind(d),error:i,metadata:s,gamma:f,palette:a,transColor:o,inflateData:c,simpleTransparency:u});p.start();d.process();if(r){throw r}let g=E.concat(h);h.length=0;let y;if(n.interlace){y=x.inflateSync(g)}else{let t=(n.width*n.bpp*n.depth+7>>3)+1;let e=t*n.height;y=_(g,{chunkSize:e,maxLength:e})}g=null;if(!y||!y.length){throw new Error("bad png - invalid inflate data response")}let m=T.process(y,n);g=null;let b=k.dataToBitMap(m,n);m=null;let v=A(b,n,e.skipRescale);n.data=v;n.gamma=l||0;return n}}).call(this)}).call(this,t("buffer").Buffer)},{"./bitmapper":83,"./filter-parse-sync":90,"./format-normaliser":92,"./parser":100,"./sync-inflate":103,"./sync-reader":104,buffer:152,zlib:151}],100:[function(e,r,t){(function(o){(function(){"use strict";let l=e("./constants");let s=e("./crc");let t=r.exports=function(t,e){this._options=t;t.checkCRC=t.checkCRC!==false;this._hasIHDR=false;this._hasIEND=false;this._emittedHeadersFinished=false;this._palette=[];this._colorType=0;this._chunks={};this._chunks[l.TYPE_IHDR]=this._handleIHDR.bind(this);this._chunks[l.TYPE_IEND]=this._handleIEND.bind(this);this._chunks[l.TYPE_IDAT]=this._handleIDAT.bind(this);this._chunks[l.TYPE_PLTE]=this._handlePLTE.bind(this);this._chunks[l.TYPE_tRNS]=this._handleTRNS.bind(this);this._chunks[l.TYPE_gAMA]=this._handleGAMA.bind(this);this.read=e.read;this.error=e.error;this.metadata=e.metadata;this.gamma=e.gamma;this.transColor=e.transColor;this.palette=e.palette;this.parsed=e.parsed;this.inflateData=e.inflateData;this.finished=e.finished;this.simpleTransparency=e.simpleTransparency;this.headersFinished=e.headersFinished||function(){}};t.prototype.start=function(){this.read(l.PNG_SIGNATURE.length,this._parseSignature.bind(this))};t.prototype._parseSignature=function(e){let r=l.PNG_SIGNATURE;for(let t=0;tthis._palette.length){this.error(new Error("More transparent colors than palette size"));return}for(let t=0;t0){this._handleIDAT(r)}else{this._handleChunkEnd()}};t.prototype._handleIEND=function(t){this.read(t,this._parseIEND.bind(this))};t.prototype._parseIEND=function(t){this._crc.write(t);this._hasIEND=true;this._handleChunkEnd();if(this.finished){this.finished()}}}).call(this)}).call(this,e("buffer").Buffer)},{"./constants":86,"./crc":87,buffer:152}],101:[function(t,e,r){"use strict";let i=t("./parser-sync");let n=t("./packer-sync");r.read=function(t,e){return i(t,e||{})};r.write=function(t,e){return n(t,e)}},{"./packer-sync":95,"./parser-sync":99}],102:[function(u,t,l){(function(s,o){(function(){"use strict";let t=u("util");let e=u("stream");let r=u("./parser-async");let i=u("./packer-async");let n=u("./png-sync");let a=l.PNG=function(t){e.call(this);t=t||{};this.width=t.width|0;this.height=t.height|0;this.data=this.width>0&&this.height>0?o.alloc(4*this.width*this.height):null;if(t.fill&&this.data){this.data.fill(0)}this.gamma=0;this.readable=this.writable=true;this._parser=new r(t);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(t){this.data=t;this.emit("parsed",t)}.bind(this));this._packer=new i(t);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"))};t.inherits(a,e);a.sync=n;a.prototype.pack=function(){if(!this.data||!this.data.length){this.emit("error","No data provided");return this}s.nextTick(function(){this._packer.pack(this.data,this.width,this.height,this.gamma)}.bind(this));return this};a.prototype.parse=function(t,i){if(i){let e,r;e=function(t){this.removeListener("error",r);this.data=t;i(null,this)}.bind(this);r=function(t){this.removeListener("parsed",e);i(t,null)}.bind(this);this.once("parsed",e);this.once("error",r)}this.end(t);return this};a.prototype.write=function(t){this._parser.write(t);return true};a.prototype.end=function(t){this._parser.end(t)};a.prototype._metadata=function(t){this.width=t.width;this.height=t.height;this.emit("metadata",t)};a.prototype._gamma=function(t){this.gamma=t};a.prototype._handleClose=function(){if(!this._parser.writable&&!this._packer.readable){this.emit("close")}};a.bitblt=function(e,r,i,n,s,o,a,u){i|=0;n|=0;s|=0;o|=0;a|=0;u|=0;if(i>e.width||n>e.height||i+s>e.width||n+o>e.height){throw new Error("bitblt reading outside image")}if(a>r.width||u>r.height||a+s>r.width||u+o>r.height){throw new Error("bitblt writing outside image")}for(let t=0;t=0,"have should not go down");if(r>0){let t=i._buffer.slice(i._offset,i._offset+r);i._offset+=r;if(t.length>o){t=t.slice(0,o)}u.push(t);l+=t.length;o-=t.length;if(o===0){return false}}if(e===0||i._offset>=i._chunkSize){s=i._chunkSize;i._offset=0;i._buffer=b.allocUnsafe(i._chunkSize)}if(e===0){a+=n-t;n=t;return true}return false}p(this._handle,"zlib binding closed");let c;do{c=this._handle.writeSync(e,t,a,n,this._buffer,this._offset,s);c=c||this._writeState}while(!this._hadError&&h(c[0],c[1]));if(this._hadError){throw f}if(l>=y){m(this);throw new RangeError("Cannot create final Buffer. It would be larger than 0x"+y.toString(16)+" bytes")}let d=b.concat(u,l);m(this);return d};t.inherits(r,g.Inflate);function i(t,e){if(typeof e==="string"){e=b.from(e)}if(!(e instanceof b)){throw new TypeError("Not a string or buffer")}let r=t._finishFlushFlag;if(r==null){r=g.Z_FINISH}return t._processChunk(e,r)}function n(t,e){return i(new r(e),t)}a.exports=u=n;u.Inflate=r;u.createInflate=e;u.inflateSync=n}).call(this)}).call(this,o("_process"),o("buffer").Buffer)},{_process:184,assert:143,buffer:152,util:207,zlib:151}],104:[function(t,e,r){"use strict";let i=e.exports=function(t){this._buffer=t;this._reads=[]};i.prototype.read=function(t,e){this._reads.push({length:Math.abs(t),allowLess:t<0,func:e})};i.prototype.process=function(){while(this._reads.length>0&&this._buffer.length){let e=this._reads[0];if(this._buffer.length&&(this._buffer.length>=e.length||e.allowLess)){this._reads.shift();let t=this._buffer;this._buffer=t.slice(e.length);e.func.call(this,t.slice(0,e.length))}else{break}}if(this._reads.length>0){throw new Error("There are some read requests waitng on finished stream")}if(this._buffer.length>0){throw new Error("unrecognised content at end of stream")}}},{}],105:[function(t,e,r){(function(b,t){(function(){(function(r,i){"use strict";if(r.setImmediate){return}var n=1;var s={};var o=false;var a=r.document;var u;function t(t){if(typeof t!=="function"){t=new Function(""+t)}var e=new Array(arguments.length-1);for(var r=0;r!this.jobsDone.has(t))){continue}if(this.idle.isSettled()){this.idle=new n}this.canLoopAgain=true;await this.ready;if(!this.isQueueRunning){this.finishRun();return}this.runJob(t)}}while(this.canLoopAgain);this.finishRun()};i.prototype.finishRun=function(){this.isLoopRunning=false;if(!this.pendingJobs.size){this.drained.resolve()}if(!this.runningJobs.size){this.endTime=Date.now();this.idle.resolve()}};i.prototype.runJob=async function(e){this.pendingJobs.delete(e.id);this.runningJobs.set(e.id,e);if(this.runningJobs.size>=this.concurrency){this.ready=new n}try{e.startTime=Date.now();await this.jobRunner(e.data);e.endTime=Date.now();this.jobsDone.set(e.id,e);this.canLoopAgain=true}catch(t){e.endTime=Date.now();e.error=t;this.errorJobs.set(e.id,e)}this.runningJobs.delete(e.id);if(this.runningJobs.size{var r;n=n||"Async";s=s||"AsyncAll";t=t||(t=>t[0]!=="_"&&!t.endsWith("Sync"));if(e){r=[];for(let t in i){if(typeof i[t]==="function"){r.push(t)}}}else{r=Object.keys(i)}r.filter(e=>{if(typeof i[e]!=="function"){return false}for(let t in i[e].prototype){return false}return t(e,i)}).forEach(t=>{const e=t+n;const r=t+s;if(!i[e]){i[e]=o.promisify(i[t],i)}if(!i[r]){i[r]=o.promisifyAll(i[t],i)}})};o.promisifyAnyNodeApi=(t,e,r,i)=>{o.promisifyNodeApi(t,e,r,i,true)}},{"./seventh.js":113}],108:[function(t,e,r){"use strict";const p=t("./seventh.js");const f={};function h(){}p.all=t=>{var r=-1,i=false,n=0,s=Infinity,o,a=[],u=new p;for(o of t){if(i){break}r++;(()=>{const e=r;p.resolve(o).then(t=>{if(i){return}a[e]=t;n++;if(n>=s){i=true;u._resolveValue(a)}},t=>{if(i){return}i=true;u.reject(t)})})()}s=r+1;if(!s){u._resolveValue(a)}return u};p._allArray=t=>{var e=t.length;if(!e){p._resolveValue([])}var r,i={settled:false,count:0,length:e,values:[],allPromise:new p};for(r=0;!i.settled&&r{p._bareThen(t,t=>{if(r.settled){return}r.values[e]=t;r.count++;if(r.count>=r.length){r.settled=true;r.allPromise._resolveValue(r.values)}},t=>{if(r.settled){return}r.settled=true;r.allPromise.reject(t)})};p.every=p.map=(t,r)=>{var i=-1,n=false,s=0,o=Infinity,a,u=[],l=new p;for(a of t){if(n){break}i++;(()=>{const e=i;p.resolve(a).then(t=>{if(n){return}return r(t,e)}).then(t=>{if(n){return}u[e]=t;s++;if(s>=o){n=true;l._resolveValue(u)}},t=>{if(n){return}n=true;l.reject(t)})})()}o=i+1;if(!o){l._resolveValue(u)}return l};p.any=t=>{var r=-1,i=false,n=0,s=Infinity,o,a=[],u=new p;for(o of t){if(i){break}r++;(()=>{const e=r;p.resolve(o).then(t=>{if(i){return}i=true;u._resolveValue(t)},t=>{if(i){return}a[e]=t;n++;if(n>=s){i=true;u.reject(a)}})})()}s=r+1;if(!s){u.reject(new RangeError("Promise.any(): empty array"))}return u};p.some=(t,r)=>{var i=-1,n=false,s=0,o=Infinity,a,u=[],l=new p;for(a of t){if(n){break}i++;(()=>{const e=i;p.resolve(a).then(t=>{if(n){return}return r(t,e)}).then(t=>{if(n){return}n=true;l._resolveValue(t)},t=>{if(n){return}u[e]=t;s++;if(s>=o){n=true;l.reject(u)}})})()}o=i+1;if(!o){l.reject(new RangeError("Promise.any(): empty array"))}return l};p.filter=(t,r)=>{var i=-1,n=false,s=0,o=Infinity,a,u=[],l=new p;for(a of t){if(n){break}i++;(()=>{const e=i;p.resolve(a).then(t=>{if(n){return}u[e]=t;return r(t,e)}).then(t=>{if(n){return}s++;if(!t){u[e]=f}if(s>=o){n=true;u=u.filter(t=>t!==f);l._resolveValue(u)}},t=>{if(n){return}n=true;l.reject(t)})})()}o=i+1;if(!o){l._resolveValue(u)}else if(s>=o){n=true;u=u.filter(t=>t!==f);l._resolveValue(u)}return l};p.foreach=p.forEach=function(t,i,e){var n=-1,s=arguments.length>=3,o=t[Symbol.iterator](),a=new p,u=p.resolve(e);if(p.warnUnhandledRejection){p._handleAll(t)}var l=()=>{u.then(e=>{let{value:t,done:r}=o.next();n++;if(r){a.resolve(e)}else{u=p.resolve(t).then(s?t=>i(e,t,n):t=>i(t,n));l()}},t=>{a.reject(t);for(;;){let{value:t,done:e}=o.next();if(e){break}if(p.isThenable(t)){t.then(h,h)}}})};l();return a};p.reduce=(t,e,r)=>{return p.forEach(t,e,r)};p.mapObject=(t,r)=>{var i=false,n=0,e,s,o=Object.keys(t),a=o.length,u,l={},f=new p;for(e=0;!i&&e{const e=s;p.resolve(u).then(t=>{if(i){return}return r(t,e)}).then(t=>{if(i){return}l[e]=t;n++;if(n>=a){i=true;f._resolveValue(l)}},t=>{if(i){return}i=true;f.reject(t)})})()}if(!a){f._resolveValue(l)}return f};p.concurrent=(r,t,i)=>{var n=-1,s=false,o=0,a=0,u=Infinity,l,e=false,f=[],h=t[Symbol.iterator](),c=new p;if(p.warnUnhandledRejection){p._handleAll(t)}r=+r||1;const d=()=>{while(!e&&o=u){s=true;c._resolveValue(f);return}break}if(s){break}n++;(()=>{const e=n;o++;p.resolve(l).then(t=>{if(s){return}return i(t,e)}).then(t=>{if(s){return}f[e]=t;a++;o--;if(a>=u){s=true;c._resolveValue(f);return}if(o{if(s){return}s=true;c.reject(t)})})()}};d();if(n<0){c._resolveValue(f)}return c};p.race=t=>{var e=false,r,i=new p;for(r of t){if(e){break}p.resolve(r).then(t=>{if(e){return}e=true;i._resolveValue(t)},t=>{if(e){return}e=true;i.reject(t)})}return i}},{"./seventh.js":113}],109:[function(o,a,t){(function(e,r,s){(function(){"use strict";const t=r.Promise;var i;if(!e.browser){i=e.nextTick}else{o("setimmediate");i=s}function n(t){this.fn=t;this._then=n._dormantThen;this.value=null;this.thenHandlers=null;this.handledRejection=null;if(this.fn){this._exec()}}a.exports=n;n.Native=t;n.warnUnhandledRejection=true;n.prototype._exec=function(){this._then=n._pendingThen;try{this.fn(t=>{this.resolve(t)},t=>{this.reject(t)})}catch(t){this.reject(t)}};n.prototype.resolve=n.prototype.fulfill=function(t){if(this._then.settled){return this}if(n.isThenable(t)){this._execThenPromise(t);return this}return this._resolveValue(t)};n.prototype._resolveValue=function(t){this._then=n._fulfilledThen;this.value=t;if(this.thenHandlers&&this.thenHandlers.length){this._execFulfillHandlers()}return this};n.prototype._execThenPromise=function(t){try{t.then(t=>{this.resolve(t)},t=>{this.reject(t)})}catch(t){this.reject(t)}};n.prototype.reject=function(t){if(this._then.settled){return this}this._then=n._rejectedThen;this.value=t;if(this.thenHandlers&&this.thenHandlers.length){this._execRejectionHandlers()}else if(n.warnUnhandledRejection&&!this.handledRejection){this._unhandledRejection()}return this};n.prototype._execFulfillHandlers=function(){var t,e=this.thenHandlers.length;for(t=0;tthis.resolve(e),t)};n.prototype.rejectTimeout=function(t,e){setTimeout(()=>this.reject(e),t)};n._dormantThen=function(t,e){if(this.fn){this._exec();return this._then(t,e)}var r=new n;if(!this.thenHandlers){this.thenHandlers=[r,t,e]}else{this.thenHandlers[this.thenHandlers.length]=r;this.thenHandlers[this.thenHandlers.length]=t;this.thenHandlers[this.thenHandlers.length]=e}return r};n._dormantThen.settled=false;n._pendingThen=function(t,e){var r=new n;if(!this.thenHandlers){this.thenHandlers=[r,t,e]}else{this.thenHandlers[this.thenHandlers.length]=r;this.thenHandlers[this.thenHandlers.length]=t;this.thenHandlers[this.thenHandlers.length]=e}return r};n._pendingThen.settled=false;n._fulfilledThen=function(t){if(!t){return this}var e=new n;i(()=>{try{e.resolve(t(this.value))}catch(t){e.reject(t)}});return e};n._fulfilledThen.settled=true;n._rejectedThen=function(t,e){if(!e){return this}this.handledRejection=true;var r=new n;i(()=>{try{r.resolve(e(this.value))}catch(t){r.reject(t)}});return r};n._rejectedThen.settled=true;n.prototype.then=function(t,e){return this._then(t,e)};n.prototype.catch=function(t=()=>undefined){return this._then(undefined,t)};n.prototype.finally=function(t){return this._then(t,t)};n.prototype.tap=n.prototype.tapThen=function(t){this._then(t,undefined);return this};n.prototype.tapCatch=function(t){this._then(undefined,t);return this};n.prototype.tapFinally=function(t){this._then(t,t);return this};n.prototype.fatal=function(){this._then(undefined,t=>{i(()=>{throw t})})};n.prototype.done=function(t,e){this._then(t,e).fatal();return this};n.prototype.callback=function(e){this._then(t=>{e(undefined,t)},t=>{e(t)}).fatal();return this};n.prototype.callbackAll=function(e){this._then(t=>{if(Array.isArray(t)){e(undefined,...t)}else{e(undefined,t)}},t=>{e(t)}).fatal();return this};n.callback=function(t){return new n((r,i)=>{t((t,e)=>{if(t){i(t)}else{r(e)}})})};n.callbackAll=function(t){return new n((r,i)=>{t((t,...e)=>{if(t){i(t)}else{r(e)}})})};n.prototype.toPromise=n.prototype.propagate=function(e){this._then(t=>{e.resolve(t)},t=>{e.reject(t)});return this};n.propagate=function(t,e){t.then(t=>{e.resolve(t)},t=>{e.reject(t)});return t};n.finally=function(t,e){return t.then(e,e)};n.resolve=n.fulfill=function(t){if(n.isThenable(t)){return n.fromThenable(t)}return n._resolveValue(t)};n._resolveValue=function(t){var e=new n;e._then=n._fulfilledThen;e.value=t;return e};n.reject=function(t){var e=new n;e._then=n._rejectedThen;e.value=t;return e};n.resolveTimeout=n.fulfillTimeout=function(e,r){return new n(t=>setTimeout(()=>t(r),e))};n.rejectTimeout=function(r,i){return new n((t,e)=>setTimeout(()=>e(i),r))};n.resolveNextTick=n.fulfillNextTick=function(e){return new n(t=>i(()=>t(e)))};n.rejectNextTick=function(r){return new n((t,e)=>i(()=>e(r)))};n.dormant=function(t){var e=new n;e.fn=t;return e};n.try=function(t){try{return n.resolve(t())}catch(t){return n.reject(t)}};n.isThenable=function(t){return t&&typeof t==="object"&&typeof t.then==="function"};n.fromThenable=function(t){if(t instanceof n){return t}return new n((e,r)=>{t.then(t=>{e(t)},t=>{r(t)})})};n._bareThen=function(t,e,r){if(t&&typeof t==="object"){if(t instanceof n){if(t._then===n._fulfilledThen){e(t.value)}else if(t._then===n._rejectedThen){r(t.value)}else{t._then(e,r)}}else if(typeof t.then==="function"){t.then(e,r)}else{e(t)}}else{e(t)}};n._handleAll=function(t){var e;for(e of t){if(n.isThenable(e)){e.handledRejection=true}}};n.prototype._unhandledRejection=function(){this.handledRejection=false;const e=t=>setTimeout(t,0);if(this.value instanceof Error){e(()=>{if(this.handledRejection===false){this.value.message="Unhandled promise rejection: "+this.value.message;console.error(this.value)}})}else{let t=new Error("Unhandled promise rejection");e(()=>{if(this.handledRejection===false){console.error(t);console.error("Rejection reason:",this.value)}})}};n.prototype.isSettled=function(){return this._then.settled};n.prototype.getStatus=function(){switch(this._then){case n._dormantThen:return"dormant";case n._pendingThen:return"pending";case n._fulfilledThen:return"fulfilled";case n._rejectedThen:return"rejected"}};n.prototype.inspect=function(){switch(this._then){case n._dormantThen:return"Promise { }";case n._pendingThen:return"Promise { }";case n._fulfilledThen:return"Promise { "+this.value+" }";case n._rejectedThen:return"Promise { "+this.value+" }"}};n.resolved=n.dummy=n.resolve();if(e.browser){n.prototype.resolveAtAnimationFrame=function(t){window.requestAnimationFrame(()=>this.resolve(t))};n.prototype.rejectAtAnimationFrame=function(t){window.requestAnimationFrame(()=>this.reject(t))};n.resolveAtAnimationFrame=function(e){return new n(t=>window.requestAnimationFrame(()=>t(e)))};n.rejectAtAnimationFrame=function(r){return new n((t,e)=>window.requestAnimationFrame(()=>e(r)))}}}).call(this)}).call(this,o("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},o("timers").setImmediate)},{_process:184,setimmediate:105,timers:202}],110:[function(t,e,r){"use strict";const l=t("./seventh.js");l.promisifyAll=(e,n)=>{if(n){return(...t)=>{return new l((r,i)=>{e.call(n,...t,(t,...e)=>{if(t){if(e.length&&t instanceof Error){t.args=e}i(t)}else{r(e)}})})}}return function(...t){return new l((r,i)=>{e.call(this,...t,(t,...e)=>{if(t){if(e.length&&t instanceof Error){t.args=e}i(t)}else{r(e)}})})}};l.promisify=(e,n)=>{if(n){return(...t)=>{return new l((r,i)=>{e.call(n,...t,(t,e)=>{if(t){if(e!==undefined&&t instanceof Error){t.arg=e}i(t)}else{r(e)}})})}}return function(...t){return new l((r,i)=>{e.call(this,...t,(t,e)=>{if(t){if(e!==undefined&&t instanceof Error){t.arg=e}i(t)}else{r(e)}})})}};l.returnValueInterceptor=(r,i,n)=>{return function(...t){var e=i.call(n||this,...t);r(e);return e}};l.once=(e,r)=>{var i=false;var n;return function(...t){if(!i){i=true;n=e.call(r||this,...t)}return n}};l.serialize=(r,i)=>{var n=new l.resolve;return function(...t){var e=new l;n.finally(()=>{l.propagate(r.call(i||this,...t),e)});n=e;return e}};l.debounce=(e,r)=>{var i=null;const n=()=>{i=null};return function(...t){if(i){return i}i=e.call(r||this,...t);l.finally(i,n);return i}};l.debounceDelay=(t,e,r)=>{var i=null;const n=()=>{setTimeout(()=>i=null,t)};return function(...t){if(i){return i}i=e.call(r||this,...t);l.finally(i,n);return i}};l.debounceUpdate=(r,i)=>{var n=null;var s=null;var o=null;const a=()=>{var t,e;n=null;if(s){t=s;s=null;e=o;o=null;n=r.call(...t);l.propagate(n,e);l.finally(n,a);return n}};return function(...t){var e=i||this;if(n){if(!o){o=new l}s=[e,...t];return o}n=r.call(e,...t);l.finally(n,a);return n}};l.NO_DELAY={};l.BATCH_NO_DELAY={};l.debounceSync=(s,o)=>{var r=new Map;const a=t=>{var e=r.get(t);if(!e){e={inProgress:null,inProgressIsFull:null,last:null,lastTime:null,lastFullSync:null,lastFullSyncTime:null,nextFullSyncPromise:null,nextFullSyncWith:null,noDelayBatches:new Set};r.set(t,e)}return e};const u=(t,e)=>{var r,i,n,s=new Date;t.inProgress=null;if(e>=2){t.lastFullSyncTime=t.lastTime=s}else if(e>=1){t.lastTime=s}if(t.nextFullSyncWith){if(o.delay&&t.lastFullSyncTime&&(r=s-t.lastFullSyncTime-o.delay)<0){t.inProgress=l.resolveTimeout(-r+1);t.inProgress.finally(()=>u(t,0));return t.nextFullSyncPromise}i=t.nextFullSyncWith;t.nextFullSyncWith=null;n=t.nextFullSyncPromise;t.nextFullSyncPromise=null;t.lastFullSync=t.last=t.inProgress=o.fn.call(...i);l.propagate(t.inProgress,n);l.finally(t.inProgress,()=>u(t,2));return t.inProgress}};const t=function(t,...e){var r=false,i=s.thisBinding||this,n=a(t);if(e[0]===l.NO_DELAY){r=true;e.shift()}else if(e[0]===l.BATCH_NO_DELAY){e.shift();let t=e.shift();if(!n.noDelayBatches.has(t)){n.noDelayBatches.add(t);r=true}}if(n.inProgress){return n.inProgress}if(!r&&s.delay&&n.lastTime&&new Date-n.lastTimeu(n,1));return n.inProgress};const e=function(t,...e){var r,i=false,n=o.thisBinding||this,s=a(t);if(e[0]===l.NO_DELAY){i=true;e.shift()}else if(e[0]===l.BATCH_NO_DELAY){e.shift();let t=e.shift();if(!s.noDelayBatches.has(t)){s.noDelayBatches.add(t);i=true}}if(!s.inProgress&&!i&&o.delay&&s.lastFullSyncTime&&(r=new Date-s.lastFullSyncTime-o.delay)<0){s.inProgress=l.resolveTimeout(-r+1);l.finally(s.inProgress,()=>u(s,0))}if(s.inProgress){if(!s.nextFullSyncPromise){s.nextFullSyncPromise=new l}s.nextFullSyncWith=[n,t,...e];return s.nextFullSyncPromise}s.lastFullSync=s.last=s.inProgress=o.fn.call(n,t,...e);l.finally(s.inProgress,()=>u(s,2));return s.inProgress};return[t,e]};l.timeout=(r,i,n)=>{return function(...t){var e=i.call(n||this,...t);setTimeout(()=>e.reject(new Error("Timeout")),r);return e}};l.variableTimeout=(i,n)=>{return function(t,...e){var r=i.call(n||this,...e);setTimeout(()=>r.reject(new Error("Timeout")),t);return r}}},{"./seventh.js":113}],111:[function(t,e,r){(function(o){(function(){"use strict";const n=t("./seventh.js");var s=false;n.asyncExit=function(r,i){if(s){return}s=true;var t=o.listeners("asyncExit");if(!t.length){o.exit(r);return}if(i===undefined){i=1e3}const e=e=>{if(e.length<3){e(r,i);return n.dummy}return new n(t=>{e(r,i,()=>{t()})})};n.map(t,e).finally(()=>o.exit(r));setTimeout(()=>o.exit(r),i)};n.resolveSafeTimeout=function(e,r){return new n(t=>{setTimeout(()=>{setTimeout(()=>{setTimeout(()=>{setTimeout(()=>t(r),0)},e/2)},e/2)},0)})}}).call(this)}).call(this,t("_process"))},{"./seventh.js":113,_process:184}],112:[function(t,e,r){"use strict";const i=t("./seventh.js");i.parasite=()=>{var t=["tap","tapCatch","finally","fatal","done","callback","callbackAll"];t.forEach(t=>i.Native.prototype[t]=i.prototype[t]);i.Native.prototype._then=i.Native.prototype.then}},{"./seventh.js":113}],113:[function(t,e,r){"use strict";const i=t("./core.js");e.exports=i;t("./batch.js");t("./wrapper.js");t("./decorators.js");t("./Queue.js");t("./api.js");t("./parasite.js");t("./misc.js")},{"./Queue.js":106,"./api.js":107,"./batch.js":108,"./core.js":109,"./decorators.js":110,"./misc.js":111,"./parasite.js":112,"./wrapper.js":114}],114:[function(t,e,r){"use strict";const l=t("./seventh.js");l.timeLimit=(r,i)=>{return new l((t,e)=>{if(typeof i==="function"){i=i()}l.resolve(i).then(t,e);setTimeout(()=>e(new Error("Timeout")),r)})};l.retry=(t,e)=>{var r=t.retries||1,i=t.coolDown||0,n=t.raiseFactor||1,s=t.maxCoolDown||Infinity,o=t.timeout||0,a=t.catch||null;const u=()=>{return(o?l.timeLimit(o,e):e()).catch(t=>{if(!r--){throw t}var e=i;i=Math.min(i*n,s);if(a){return l.resolve(a(t)).then(()=>l.resolveTimeout(e).then(u))}return l.resolveTimeout(e).then(u)})};return u()};l.onceEvent=(e,r)=>{return new l(t=>e.once(r,t))};l.onceEventAll=(t,r)=>{return new l(e=>t.once(r,(...t)=>e(t)))};l.onceEventOrError=(a,u,t,r=false)=>{return new l((e,i)=>{var n;var s=(...t)=>{a.removeListener("error",o);if(n){for(let t in n){a.removeListener(t,n[t])}}e(r?t:t[0])};var o=t=>{a.removeListener(u,s);if(n){for(let t in n){a.removeListener(t,n[t])}}i(t)};a.once(u,s);a.once("error",o);if(t){if(!Array.isArray(t)){t=[t]}n={};t.forEach(r=>{var t=(...t)=>{a.removeListener("error",o);a.removeListener(u,s);var e=new Error("Received an excluded event: "+r);e.event=r;e.eventArgs=t;i(e)};a.once(r,t);n[r]=t})}})};l.onceEventAllOrError=(t,e,r)=>{return l.onceEventOrError(t,e,r,true)}},{"./seventh.js":113}],115:[function(t,e,r){"use strict";function i(t,e=".",r="",i=false){this.sign=1;this.digits=[];this.exposant=0;this.special=null;this.decimalSeparator=e;this.forceDecimalSeparator=!!i;this.groupSeparator=r;this.set(t)}e.exports=i;i.prototype.set=function(t){var e,r,i,n,s,o,a,u,l;t=+t;this.sign=1;this.digits.length=0;this.exposant=0;this.special=null;if(!Number.isFinite(t)){this.special=t;return null}t=""+t;e=t.match(/(-)?([0-9]+)(?:.([0-9]+))?(?:e([+-][0-9]+))?/);if(!e){throw new Error("Unexpected error")}this.sign=e[1]?-1:1;this.exposant=e[2].length+(parseInt(e[4],10)||0);a=0;u=false;l=0;for(s=0,o=e[2].length;s20||this.exposant<-20){return this.toScientificString(...t)}return this.toNoExpString(...t)};i.prototype.toExponential=i.prototype.toExponentialString=function(){if(this.special!==null){return""+this.special}var t=this.sign<0?"-":"";if(!this.digits.length){return t+"0"}t+=this.digits[0];if(this.digits.length>1){t+=this.decimalSeparator+this.digits.join("").slice(1)}t+="e"+(this.exposant>0?"+":"")+(this.exposant-1);return t};const n=["⁰","¹","²","³","⁴","⁵","⁶","⁷","⁸","⁹"];const s="⁺";const o="⁻";const a="0".charCodeAt(0);i.prototype.toScientific=i.prototype.toScientificString=function(){if(this.special!==null){return""+this.special}var t=this.sign<0?"-":"";if(!this.digits.length){return t+"0"}t+=this.digits[0];if(this.digits.length>1){t+=this.decimalSeparator+this.digits.join("").slice(1)}var e=(this.exposant<=0?o:"")+(""+Math.abs(this.exposant-1)).split("").map(t=>n[t.charCodeAt(0)-a]).join("");t+=" × 10"+e;return t};i.prototype.toNoExp=i.prototype.toNoExpString=function(t=1,e=0,r=false,i=false,n=this.exposant){if(this.special!==null){return""+this.special}var s=[],o=[],a=this.sign<0?"-":i?"+":"";if(!this.digits.length){h(s,0,t);if(e&&!r){h(o,0,e)}}else if(n<=0){h(s,0,t);h(o,0,-n);c(o,this.digits);if(e&&this.digits.length-n=this.digits.length){if(n0)){h(o,0,e-this.digits.length+n)}}a+=this.groupSeparator?this.groupDigits(s,this.groupSeparator):s.join("");if(o.length){a+=this.decimalSeparator+(this.decimalGroupSeparator?this.groupDigits(o,this.decimalGroupSeparator):o.join(""))}else if(this.forceDecimalSeparator){a+=this.decimalSeparator}return a};const u=["","k","M","G","T","P","E","Z","Y"];const l=["","m","µ","n","p","f","a","z","y"];i.prototype.toMetric=i.prototype.toMetricString=function(t=1,e=0,r=false,i=false){if(this.special!==null){return""+this.special}if(!this.digits.length){return this.sign>0?"0":"-0"}var n="",s;if(this.exposant>0){s=1+(this.exposant-1)%3;n=u[Math.floor((this.exposant-1)/3)];if(n===undefined){return this.toScientificString()}}else{s=3- -this.exposant%3;n=l[1+Math.floor(-this.exposant/3)];if(n===undefined){return this.toScientificString()}}return this.toNoExpString(t,e,r,i,s)+n};i.prototype.precision=function(r,t=0){var e;if(this.special!==null||r>=this.digits.length){return this}if(r<0){this.digits.length=0;return this}t*=this.sign;if(t<0){e=this.digits.length>r+4&&this.digits[r]===9&&this.digits[r+1]===9&&this.digits[r+2]===9&&this.digits[r+3]===9&&this.digits[r+4]===9}else if(t>0){e=this.digits[r]>0||this.digits[r+1]>0||this.digits[r+2]>0||this.digits[r+3]>0||this.digits[r+4]>0}else{e=this.digits[r]>=5}if(e){let t=r-1,e=false;for(;t>=0;t--){if(this.digits[t]<9){this.digits[t]++;e=true;break}else{this.digits[t]=0}}if(!e){this.exposant++;this.digits[0]=1;this.digits.length=1}else{this.digits.length=t+1}}else{this.digits.length=r;this.removeTrailingZero()}return this};i.prototype.round=function(t=0,e=0){var r=this.exposant+t;return this.precision(r,e)};i.prototype.floor=function(t=0){var e=this.exposant+t;return this.precision(e,-1)};i.prototype.ceil=function(t=0){var e=this.exposant+t;return this.precision(e,1)};i.prototype.removeTrailingZero=function(){var t=this.digits.length-1;while(t>=0&&this.digits[t]===0){t--}this.digits.length=t+1};const f=3;i.prototype.groupDigits=function(t,e,r=false){var i="",n=r?0:f-t.length%f,s=0,o=t.length;for(;s{if(r===undefined&&typeof e==="string"){let t=e;if(t[0]==="#"){t=t.slice(1)}if(t.length===3){t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]}e=parseInt(t.slice(0,2),16)||0;r=parseInt(t.slice(2,4),16)||0;i=parseInt(t.slice(4,6),16)||0}return"[38;2;"+e+";"+r+";"+i+"m"};i.bgTrueColor=(e,r,i)=>{if(r===undefined&&typeof e==="string"){let t=e;if(t[0]==="#"){t=t.slice(1)}if(t.length===3){t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]}e=parseInt(t.slice(0,2),16)||0;r=parseInt(t.slice(2,4),16)||0;i=parseInt(t.slice(4,6),16)||0}return"[48;2;"+e+";"+r+";"+i+"m"};const o={0:null,1:{bold:true},2:{dim:true},22:{bold:false,dim:false},3:{italic:true},23:{italic:false},4:{underline:true},24:{underline:false},5:{blink:true},25:{blink:false},7:{inverse:true},27:{inverse:false},8:{hidden:true},28:{hidden:false},9:{strike:true},29:{strike:false},30:{color:0},31:{color:1},32:{color:2},33:{color:3},34:{color:4},35:{color:5},36:{color:6},37:{color:7},39:{color:"default"},90:{color:8},91:{color:9},92:{color:10},93:{color:11},94:{color:12},95:{color:13},96:{color:14},97:{color:15},40:{bgColor:0},41:{bgColor:1},42:{bgColor:2},43:{bgColor:3},44:{bgColor:4},45:{bgColor:5},46:{bgColor:6},47:{bgColor:7},49:{bgColor:"default"},100:{bgColor:8},101:{bgColor:9},102:{bgColor:10},103:{bgColor:11},104:{bgColor:12},105:{bgColor:13},106:{bgColor:14},107:{bgColor:15}};i.parse=t=>{var e,r,i,n,s=[];for([,e,r]of t.matchAll(/\x1b\[([0-9;]+)m|(.[^\x1b]*)/g)){if(r){if(s.length){s[s.length-1].text+=r}else{s.push({text:r})}}else{e.split(";").forEach(t=>{n=o[t];if(n===undefined){return}if(!s.length||s[s.length-1].text){if(!n){i={text:""}}else{i=Object.assign({},i,n);i.text=""}s.push(i)}else{if(!n){s[s.length-1]={text:""}}else{Object.assign(i,n)}}})}}return s}},{}],117:[function(t,e,r){"use strict";var i={};e.exports=i;i.toCamelCase=function(t,s=false,o=false){if(!t||typeof t!=="string"){return""}return t.replace(/(?:^[\s_-]*|([\s_-]+))(([^\s_-]?)([^\s_-]*))/g,(t,e,r,i,n)=>{if(s){if(!e&&!o){return r}if(!i){return""}return i.toUpperCase()+n}if(!e&&!o){return r.toLowerCase()}if(!i){return""}return i.toUpperCase()+n.toLowerCase()})};i.camelCaseToSeparated=function(t,i=" "){if(!t||typeof t!=="string"){return""}return t.replace(/^([A-Z])|([A-Z])/g,(t,e,r)=>{if(e){return e.toLowerCase()}return i+r.toLowerCase()})};i.camelCaseToDash=i.camelCaseToDashed=t=>i.camelCaseToSeparated(t,"-")},{}],118:[function(t,e,r){"use strict";r.regExp=r.regExpPattern=t=>t.replace(/([.*+?^${}()|[\]/\\])/g,"\\$1");r.regExpReplacement=t=>t.replace(/\$/g,"$$$$");r.format=t=>t.replace(/%/g,"%%");r.jsSingleQuote=t=>r.control(t).replace(/'/g,"\\'");r.jsDoubleQuote=t=>r.control(t).replace(/"/g,'\\"');r.shellArg=t=>"'"+t.replace(/'/g,"'\\''")+"'";var i={"\r":"\\r","\n":"\\n","\t":"\\t","":"\\x7f"};r.control=(t,r=false)=>t.replace(/[\x00-\x1f\x7f]/g,t=>{if(r&&(t==="\n"||t==="\t")){return t}if(i[t]!==undefined){return i[t]}var e=t.charCodeAt(0).toString(16);if(e.length%2){e="0"+e}return"\\x"+e});var n={"&":"&","<":"<",">":">",'"':""","'":"'"};r.html=t=>t.replace(/[&<>]/g,t=>n[t]);r.htmlAttr=t=>t.replace(/[&<>"]/g,t=>n[t]);r.htmlSpecialChars=t=>t.replace(/[&<>"']/g,t=>n[t]);r.unicodePercentEncode=t=>t.replace(/[\x00-\x1f\u0100-\uffff\x7f%]/g,t=>{try{return encodeURI(t)}catch(t){return""}});r.httpHeaderValue=t=>r.unicodePercentEncode(t)},{}],119:[function(B,t,R){(function(E){(function(){"use strict";const l=B("./inspect.js").inspect;const f=B("./inspect.js").inspectError;const e=B("./escape.js");const n=B("./ansi.js");const s=B("./unicode.js");const i=B("./naturalSort.js");const p=B("./StringNumber.js");R.formatMethod=function(...g){var y,t=g[0],m=1,b=g.length;if(typeof t!=="string"){if(!t){t=""}else if(typeof t.toString==="function"){t=t.toString()}else{t=""}}var v={hasMarkup:false,shift:null,markupStack:[]};if(this.markupReset&&this.startingMarkupReset){t=(typeof this.markupReset==="function"?this.markupReset(v.markupStack):this.markupReset)+t}t=t.replace(/\^\[([^\]]*)]?|\^(.)|(%%)|%([+-]?)([0-9]*)(?:\[([^\]]*)\])?([a-zA-Z])/g,(t,e,r,i,n,s,o,a)=>{var u,l,f,h,c,d,p=[];if(i){return"%"}if(e){r=e}if(r){if(this.noMarkup){return"^"+r}return w.call(this,v,t,r)}if(s){s=parseInt(s,10);if(n){if(n==="+"){s=m+s}else if(n==="-"){s=m-s}}}else{s=m}m++;if(s>=b||s<1){y=undefined}else{y=g[s]}if(x[a]){u=x[a](y,o,this);if(this.argumentSanitizer&&!x[a].noSanitize){u=this.argumentSanitizer(u)}if(o&&!x[a].noCommonModeArg){u=_(u,o)}return u}if(a==="F"){m--;if(o===undefined){return""}f=o.split(":");h=f[0];c=f[1];if(!h){return""}if(c&&(d=c.match(/%([+-]?)([0-9]*)[a-zA-Z]/g))){for(l=0;l=b||s<1){p[l]=undefined}else{p[l]=g[s]}}}if(!this||!this.fn||typeof this.fn[h]!=="function"){return""}return this.fn[h].apply(this,p)}return""});if(v.hasMarkup&&this.markupReset&&this.endingMarkupReset){t+=typeof this.markupReset==="function"?this.markupReset(v.markupStack):this.markupReset}if(this.extraArguments){for(;m1){a.push({text:""})}}else{if(o&&o.text.length){a.push(Object.assign({text:""},...l.markupStack))}else{if(o){Object.assign(o,e)}else{a.push(Object.assign({text:""},e))}}}}}return a}if(this.markupReset&&this.startingMarkupReset){u=(typeof this.markupReset==="function"?this.markupReset(l.markupStack):this.markupReset)+u}u=u.replace(/\^\[([^\]]*)]?|\^(.)/g,(t,e,r)=>w.call(this,l,t,e||r));if(l.hasMarkup&&this.markupReset&&this.endingMarkupReset){u+=typeof this.markupReset==="function"?this.markupReset(l.markupStack):this.markupReset}return u};function w(t,e,r){var i,n,s,o,a;if(r==="^"){return"^"}if(this.shiftMarkup&&this.shiftMarkup[r]){t.shift=this.shiftMarkup[r];return""}if(r.length>1&&this.dataMarkup&&(a=r.indexOf(":"))!==-1){n=r.slice(0,a);i=this.dataMarkup[n];if(i===undefined){if(this.markupCatchAll===undefined){return""}i=this.markupCatchAll}t.hasMarkup=true;s=r.slice(a+1);if(typeof i==="function"){o=i(t.markupStack,n,s)}else{o={[i]:s};u(t,o)}return o}if(t.shift){i=this.shiftedMarkup?.[t.shift]?.[r];t.shift=null}else{i=this.markup?.[r]}if(i===undefined){if(this.markupCatchAll===undefined){return""}i=this.markupCatchAll}t.hasMarkup=true;if(typeof i==="function"){o=i(t.markupStack,r)}else{o=i;u(t,o)}return o}function u(e,r){if(Array.isArray(r)){for(let t of r){if(t===null){e.markupStack.length=0}else{e.markupStack.push(t)}}}else{if(r===null){e.markupStack.length=0}else{e.markupStack.push(r)}}}R.stripMarkup=t=>t.replace(/\^\[[^\]]*]?|\^./g,t=>t==="^^"?"^":t==="^ "?" ":"");const r={argumentSanitizer:t=>e.control(t,true),extraArguments:true,color:false,noMarkup:false,endingMarkupReset:true,startingMarkupReset:false,markupReset:n.reset,shiftMarkup:{"#":"background"},markup:{":":n.reset," ":n.reset+" ","-":n.dim,"+":n.bold,_:n.underline,"/":n.italic,"!":n.inverse,b:n.blue,B:n.brightBlue,c:n.cyan,C:n.brightCyan,g:n.green,G:n.brightGreen,k:n.black,K:n.brightBlack,m:n.magenta,M:n.brightMagenta,r:n.red,R:n.brightRed,w:n.white,W:n.brightWhite,y:n.yellow,Y:n.brightYellow},shiftedMarkup:{background:{":":n.reset," ":n.reset+" ",b:n.bgBlue,B:n.bgBrightBlue,c:n.bgCyan,C:n.bgBrightCyan,g:n.bgGreen,G:n.bgBrightGreen,k:n.bgBlack,K:n.bgBrightBlack,m:n.bgMagenta,M:n.bgBrightMagenta,r:n.bgRed,R:n.bgBrightRed,w:n.bgWhite,W:n.bgBrightWhite,y:n.bgYellow,Y:n.bgBrightYellow}},dataMarkup:{fg:(t,e,r)=>{var i=n.fgColor[r]||n.trueColor(r);t.push(i);return i},bg:(t,e,r)=>{var i=n.bgColor[r]||n.bgTrueColor(r);t.push(i);return i}},markupCatchAll:(t,e,r)=>{var i="";if(r===undefined){if(e[0]==="#"){i=n.trueColor(e)}else if(typeof n[e]==="string"){i=n[e]}}t.push(i);return i}};r.dataMarkup.color=r.dataMarkup.c=r.dataMarkup.fgColor=r.dataMarkup.fg;r.dataMarkup.bgColor=r.dataMarkup.bg;R.createFormatter=t=>R.formatMethod.bind(Object.assign({},r,t));R.format=R.formatMethod.bind(r);R.format.default=r;R.createMarkup=t=>R.markupMethod.bind(Object.assign({},r,t));R.markup=R.markupMethod.bind(r);R.format.count=function(t,e=false){var r,i,n,s=1,o=0;if(typeof t!=="string"){return 0}var a=e?/%([+-]?)([0-9]*)(?:\[[^\]]*\])?[a-zA-EG-Z]/g:/%([+-]?)([0-9]*)(?:\[[^\]]*\])?[a-zA-EG-Z]|(\^\[[^\]]*]?|\^.)/g;for([,n,i,r]of t.matchAll(a)){if(r){continue}if(i){i=parseInt(i,10);if(n){if(n==="+"){i=s+i}else if(n==="-"){i=s-i}}}else{i=s}s++;if(o{if(typeof t==="string"){return t}if(t===null||t===undefined||t===true||t===false){return"("+t+")"}if(typeof t==="number"){return""+t}if(typeof t.toString==="function"){return t.toString()}return"("+t+")"};x.r=t=>x.s(t);x.r.noSanitize=true;x.S=(t,e,r)=>{var i=t=>R.markupMethod.call(r,r.argumentSanitizer?r.argumentSanitizer(t):t);if(typeof t==="string"){return i(t)}if(t===null||t===undefined||t===true||t===false){return"("+t+")"}if(typeof t==="number"){return""+t}if(typeof t.toString==="function"){return i(t.toString())}return i("("+t+")")};x.S.noSanitize=true;x.S.noCommonModeArg=true;x.N=(t,e)=>{if(typeof t==="string"){return t}if(t===null||t===undefined||t===true||t===false){return""+t}if(typeof t==="number"){return x.f(t,".3g ")}if(Array.isArray(t)){t=t.map(t=>x.N(t,true));if(e){return"["+t.join(",")+"]"}return t.join(", ")}if(E.isBuffer(t)){t=[...t].map(t=>{t=t.toString(16);if(t.length===1){t="0"+t}return t});return"<"+t.join(" ")+">"}var r=Object.getPrototypeOf(t);if(r===null||r===Object.prototype){t=Object.entries(t).sort(i).map(t=>t[0]+": "+x.N(t[1],true));if(e){return"{"+t.join(", ")+"}"}return t.join(", ")}if(typeof t.inspect==="function"){return t.inspect()}if(typeof t.toString==="function"){return t.toString()}return"("+t+")"};x.n=t=>x.N(t,true);x.f=(t,e)=>{if(typeof t==="string"){t=parseFloat(t)}if(typeof t!=="number"){t=0}var r=m(e),i=new p(t,".",r.groupSeparator);if(r.rounding!==null){i.round(r.rounding)}if(r.precision){i.precision(r.precision)}return i.toString(r.leftPadding,r.rightPadding,r.rightPaddingOnlyIfDecimal)};x.f.noSanitize=true;x.P=(t,e)=>{if(typeof t==="string"){t=parseFloat(t)}if(typeof t!=="number"){t=0}t*=100;var r=m(e),i=new p(t,".",r.groupSeparator);if(r.rounding!==null||!r.precision){i.round(r.rounding||0)}if(r.precision){i.precision(r.precision)}return i.toNoExpString(r.leftPadding,r.rightPadding,r.rightPaddingOnlyIfDecimal)+"%"};x.P.noSanitize=true;x.p=(t,e)=>{if(typeof t==="string"){t=parseFloat(t)}if(typeof t!=="number"){t=0}t=(t-1)*100;var r=m(e),i=new p(t,".",r.groupSeparator);if(r.rounding!==null||!r.precision){i.round(r.rounding||0)}if(r.precision){i.precision(r.precision)}return i.toNoExpString(r.leftPadding,r.rightPadding,r.rightPaddingOnlyIfDecimal,true)+"%"};x.p.noSanitize=true;x.k=(t,e)=>{if(typeof t==="string"){t=parseFloat(t)}if(typeof t!=="number"){return"0"}var r=m(e),i=new p(t,".",r.groupSeparator);if(r.rounding!==null){i.round(r.rounding)}if(r.precision||r.rounding===null){i.precision(r.precision||3)}return i.toMetricString(r.leftPadding,r.rightPadding,r.rightPaddingOnlyIfDecimal)};x.k.noSanitize=true;x.e=(t,e)=>{if(typeof t==="string"){t=parseFloat(t)}if(typeof t!=="number"){t=0}var r=m(e),i=new p(t,".",r.groupSeparator);if(r.rounding!==null){i.round(r.rounding)}if(r.precision){i.precision(r.precision)}return i.toExponential()};x.e.noSanitize=true;x.K=(t,e)=>{if(typeof t==="string"){t=parseFloat(t)}if(typeof t!=="number"){t=0}var r=m(e),i=new p(t,".",r.groupSeparator);if(r.rounding!==null){i.round(r.rounding)}if(r.precision){i.precision(r.precision)}return i.toScientific()};x.K.noSanitize=true;x.d=x.i=t=>{if(typeof t==="string"){t=parseFloat(t)}if(typeof t==="number"){return""+Math.floor(t)}return"0"};x.i.noSanitize=true;x.u=t=>{if(typeof t==="string"){t=parseFloat(t)}if(typeof t==="number"){return""+Math.max(Math.floor(t),0)}return"0"};x.u.noSanitize=true;x.U=t=>{if(typeof t==="string"){t=parseFloat(t)}if(typeof t==="number"){return""+Math.max(Math.floor(t),1)}return"1"};x.U.noSanitize=true;x.m=t=>{if(typeof t==="string"){t=parseFloat(t)}if(typeof t!=="number"){return"(NaN)"}var e="";if(t<0){e="-";t=-t}var r=A(t),i=t-r;if(!i){return e+r+"°"}var n=A(i*60),s=A(i*3600-n*60);if(s){return e+r+"°"+(""+n).padStart(2,"0")+"′"+(""+s).padStart(2,"0")+"″"}return e+r+"°"+(""+n).padStart(2,"0")+"′"};x.m.noSanitize=true;x.t=(t,e)=>{if(typeof t==="string"){t=parseFloat(t)}if(typeof t!=="number"){return"(NaN)"}var r,i,n,s,o,a="",u=v(e),l=u.roundingType,f=u.useAbbreviation?"h":":",h=u.useAbbreviation?"min":":",c=u.useAbbreviation?"s":".",d=u.useAbbreviation;n=t/1e3;if(n<0){n=-n;l*=-1;a="-"}if(n<60&&!u.forceMinutes){s=new p(n,c,undefined,d);s.round(u.rounding,l);if(s.toNumber()<60){o=s.toString(1,u.rightPadding,u.rightPaddingOnlyIfDecimal);return a+o}n=60}i=Math.floor(n/60);n=n%60;s=new p(n,c,undefined,d);s.round(u.rounding,l);if(s.toNumber()<60){o=s.toString(2,u.rightPadding,u.rightPaddingOnlyIfDecimal)}else{i++;n=0;s.set(n);o=s.toString(2,u.rightPadding,u.rightPaddingOnlyIfDecimal)}if(i<60&&!u.forceHours){return a+i+h+o}r=Math.floor(i/60);i=i%60;return a+r+f+(""+i).padStart(2,"0")+h+o};x.t.noSanitize=true;x.h=t=>{if(typeof t==="string"){t=parseFloat(t)}if(typeof t==="number"){return""+Math.max(Math.floor(t),0).toString(16)}return"0"};x.h.noSanitize=true;x.x=t=>{if(typeof t==="string"){t=parseFloat(t)}if(typeof t!=="number"){return"00"}var e=""+Math.max(Math.floor(t),0).toString(16);if(e.length%2){e="0"+e}return e};x.x.noSanitize=true;x.o=t=>{if(typeof t==="string"){t=parseFloat(t)}if(typeof t==="number"){return""+Math.max(Math.floor(t),0).toString(8)}return"0"};x.o.noSanitize=true;x.b=t=>{if(typeof t==="string"){t=parseFloat(t)}if(typeof t==="number"){return""+Math.max(Math.floor(t),0).toString(2)}return"0"};x.b.noSanitize=true;x.X=t=>{if(typeof t==="string"){t=E.from(t)}else if(!E.isBuffer(t)){return""}return t.toString("hex")};x.X.noSanitize=true;x.z=t=>{if(typeof t==="string"){t=E.from(t)}else if(!E.isBuffer(t)){return""}return t.toString("base64")};x.Z=t=>{if(typeof t==="string"){t=E.from(t)}else if(!E.isBuffer(t)){return""}return t.toString("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/[=]{1,2}$/g,"")};const o={};x.I=(t,e,r)=>C(t,e,r,o);x.I.noSanitize=true;const a={noFunc:true,enumOnly:true,noDescriptor:true,useInspect:true,useInspectPropertyBlackList:true};x.Y=(t,e,r)=>C(t,e,r,a);x.Y.noSanitize=true;const h={minimal:true,noIndex:true};x.O=(t,e,r)=>C(t,e,r,h);x.O.noSanitize=true;const c={};x.E=(t,e,r)=>C(t,e,r,c,true);x.E.noSanitize=true;x.J=t=>t===undefined?"null":JSON.stringify(t);x.D=()=>"";x.D.noSanitize=true;const d=/([a-zA-Z])(.[^a-zA-Z]*)/g;const g=/([a-zA-Z]|^)([^a-zA-Z]*)/g;function _(r,i){for(let[,t,e]of i.matchAll(d)){if(t==="L"){let t=s.width(r);e=+e||1;if(t>e){r=s.truncateWidth(r,e-1).trim()+"…";t=s.width(r)}if(te){r=s.truncateWidth(r,e-1).trim()+"…";t=s.width(r)}if(t{if(t===e){return 1}if(t.length===0||e.length===0){return 0}return Math.max(0,1-_.levenshtein(t,e)/e.length)};const C=0;const T=.88;const x=.9;_.bestMatch=(t,e,r={})=>{var i=r.scoreLimit||C,n,s,o,a,u=-1,l=null;for(n=0,s=e.length;ni){i=o;l=a;u=n}}return r.indexOf?u:l};_.topMatch=(r,t,e={})=>{var i=e.scoreLimit||C,n=e.deltaRate||x,s,o,a;a=t.map((t,e)=>({pattern:t,index:e,score:_.score(r,t)}));a.sort((t,e)=>e.score-t.score);if(a[0].score<=i){return[]}i=Math.max(i,a[0].score*n);for(s=1,o=a.length;st.index):a.map(t=>t.pattern)};const i=new Set(["a","an","the","this","that","those","some","of","in","on","at","my","your","her","his","its","our","their"]);function S(t,e=i){return t.split(/[ '"/|,:_-]+/g).filter(t=>t&&!e.has(t))}_.bestTokenMatch=(t,e,r={})=>{var i=r.scoreLimit||C,n=r.tokenDisparityPenalty||T,s,o,a,u,l,f,h,c,d,p,g=i,y,m,b=S(t),v,w=-1,x=null;if(!b.length||!e.length){return r.indexOf?w:x}for(s=0,o=e.length;sv){v=m;if(m===1){break}}}p+=v}p/=b.length;if(b.length!==c.length){p*=n**Math.abs(c.length-b.length)}if(p>g){g=p;x=h;w=s}}return r.indexOf?w:x};_.topTokenMatch=(t,e,r={})=>{var i=r.scoreLimit||C,n=r.tokenDisparityPenalty||T,s=r.deltaRate||x,o,a,u,l,f,h,c,d,p,g,y,m,b=S(t),v,w=[];if(!b.length||!e.length){return[]}for(o=0,a=e.length;ov){v=m;if(m===1){break}}}g+=v}g/=b.length;if(b.length!==d.length){g*=n**Math.abs(d.length-b.length)}w.push({pattern:c,index:o,score:g})}w.sort((t,e)=>e.score-t.score);if(w[0].score<=i){return[]}i=Math.max(i,w[0].score*s);for(o=1,a=w.length;ot.index):w.map(t=>t.pattern)};const h=[];const c=[];_.levenshtein=(e,r)=>{if(e===r){return 0}if(e.length>r.length){let t=e;e=r;r=t}let t=e.length;let i=r.length;while(t>0&&e.charCodeAt(t-1)===r.charCodeAt(i-1)){t--;i--}let n=0;while(no?u>o?o+1:u:u>a?a+1:u}}return o}},{}],121:[function(e,t,r){(function(E,h){(function(){"use strict";const _=e("./escape.js");const n=e("./ansi.js");const C={};const T=new Set([Object,Array]);function o(t,e){if(arguments.length<2){e=t;t={}}else if(!t||typeof t!=="object"){t={}}var r={depth:0,ancestors:[]};if(!t.style){t.style=f.none}else if(typeof t.style==="string"){t.style=f[t.style]}if(t.depth===undefined){t.depth=3}if(t.maxLength===undefined){t.maxLength=250}if(t.outputMaxLength===undefined){t.outputMaxLength=5e3}if(t.nofunc){t.noFunc=true}if(t.minimal){t.noFunc=true;t.noDescriptor=true;t.noType=true;t.noArrayProperty=true;t.enumOnly=true;t.proto=false;t.funcDetails=false}if(t.minimalPlusConstructor){t.noFunc=true;t.noDescriptor=true;t.noTypeButConstructor=true;t.noArrayProperty=true;t.enumOnly=true;t.proto=false;t.funcDetails=false}var i=S(r,t,e);if(i.length>t.outputMaxLength){i=t.style.truncate(i,t.outputMaxLength)}return i}r.inspect=o;function S(e,r,t){var i,n,s,o,a,u,l,f,h,c,d,p,g,y,m="",b="",v="",w,x;h=typeof t;d=(r.tab??r.style.tab).repeat(e.depth);if(h==="function"&&r.noFunc){return""}if(e.key!==undefined){if(e.descriptor){v=[];if(!e.descriptor.configurable){v.push("-conf")}if(!e.descriptor.enumerable){v.push("-enum")}if(!e.descriptor.writable){v.push("-w")}if(v.length){v=v.join(" ")}else{v=""}}if(e.keyIsProperty){if(k(e.key)){b='"'+r.style.key(e.key)+'": '}else{b=r.style.key(e.key)+": "}}else if(!r.noIndex){b=r.style.index(e.key)}if(v){v=" "+r.style.type(v)}}c=e.noPre?"":d+b;if(t===undefined){m+=c+r.style.constant("undefined")+v+r.style.newline}else if(t===C){m+=c+r.style.constant("[empty]")+v+r.style.newline}else if(t===null){m+=c+r.style.constant("null")+v+r.style.newline}else if(t===false){m+=c+r.style.constant("false")+v+r.style.newline}else if(t===true){m+=c+r.style.constant("true")+v+r.style.newline}else if(h==="number"){m+=c+r.style.number(t.toString())+(r.noType||r.noTypeButConstructor?"":" "+r.style.type("number"))+v+r.style.newline}else if(h==="string"){if(t.length>r.maxLength){m+=c+'"'+r.style.string(_.control(t.slice(0,r.maxLength-1)))+'…"'+(r.noType||r.noTypeButConstructor?"":" "+r.style.type("string")+r.style.length("("+t.length+" - TRUNCATED)"))+v+r.style.newline}else{m+=c+'"'+r.style.string(_.control(t))+'"'+(r.noType||r.noTypeButConstructor?"":" "+r.style.type("string")+r.style.length("("+t.length+")"))+v+r.style.newline}}else if(E.isBuffer(t)){m+=c+r.style.inspect(t.inspect())+(r.noType?"":" "+r.style.type("Buffer")+r.style.length("("+t.length+")"))+v+r.style.newline}else if(h==="object"||h==="function"){n=s="";g=false;if(h==="function"){g=true;n=" "+r.style.funcName(t.name?t.name:"(anonymous)");s=r.style.length("("+t.length+")")}p=false;if(Array.isArray(t)){p=true;s=r.style.length("("+t.length+")")}if(!t.constructor){l="(no constructor)"}else if(!t.constructor.name){l="(anonymous)"}else{l=t.constructor.name}u=!t.constructor||T.has(t.constructor);l=r.style.constructorName(l);o=Object.getPrototypeOf(t);m+=c;if(!r.noType&&(!r.noTypeButConstructor||!u)){if(e.forceType&&!r.noType&&!r.noTypeButConstructor){m+=r.style.type(e.forceType)}else if(r.noTypeButConstructor){m+=l}else{m+=l+n+s+" "+r.style.type(h)+v}if(!g||r.funcDetails){m+=" "}}if(p&&r.noArrayProperty){a=[...Array(t.length).keys()]}else{a=Object.getOwnPropertyNames(t)}if(r.sort){a.sort()}y=A(t,e,r);if(r.protoBlackList&&r.protoBlackList.has(o)){m+=r.style.limit("[skip]")+r.style.newline}else if(y!==undefined){if(typeof y==="string"){m+="=> "+y+r.style.newline}else{m+="=> "+S({depth:e.depth,ancestors:e.ancestors,noPre:true},r,y)}}else if(g&&!r.funcDetails){m+=r.style.newline}else if(!a.length&&!r.proto){m+=(p?"[]":"{}")+r.style.newline}else if(e.depth>=r.depth){m+=r.style.limit("[depth limit]")+r.style.newline}else if(e.ancestors.indexOf(t)!==-1){m+=r.style.limit("[circular]")+r.style.newline}else{m+=(p?"[":"{")+r.style.newline;x=e.ancestors.slice();x.push(t);for(i=0;i";if(e==="fulfilled"){r+=" "+S({depth:n.depth,ancestors:n.ancestors,noPre:true},s,t[1])}else if(e==="rejected"){if(t[1]instanceof Error){r+=" "+u({style:s.style,noErrorStack:true},t[1])}else{r+=" "+S({depth:n.depth,ancestors:n.ancestors,noPre:true},s,t[1])}}return r}}if(i._bsontype){return i.toString()}if(s.useInspect&&typeof i.inspect==="function"){return i.inspect()}return}function u(e,r){var i="",t,n,s;if(arguments.length<2){r=e;e={}}else if(!e||typeof e!=="object"){e={}}if(!e.style){e.style=f.none}else if(typeof e.style==="string"){e.style=f[e.style]}if(!(r instanceof Error)){i+="[not an Error] ";if(typeof r==="string"){let t=5e3;if(r.length>t){i+=e.style.errorMessage(_.control(r.slice(0,t-1),true))+"…"+e.style.length("("+r.length+" - TRUNCATED)")+e.style.newline}else{i+=e.style.errorMessage(_.control(r,true))+e.style.newline}return i}else if(!r||typeof r!=="object"||!r.name||typeof r.name!=="string"||!r.message||typeof r.message!=="string"){i+=o(e,r);return i}}if(r.stack&&!e.noErrorStack){t=l(e,r.stack)}n=r.type||r.constructor.name;s=r.code||r.name||r.errno||r.number;i+=e.style.errorType(n)+(s?" ["+e.style.errorType(s)+"]":"")+": ";i+=e.style.errorMessage(r.message)+"\n";if(t){i+=e.style.errorStack(t)+"\n"}if(r.from){i+=e.style.newline+e.style.errorFromMessage("From error:")+e.style.newline+u(e,r.from)}return i}r.inspectError=u;function l(u,t){if(arguments.length<2){t=u;u={}}else if(!u||typeof u!=="object"){u={}}if(!u.style){u.style=f.none}else if(typeof u.style==="string"){u.style=f[u.style]}if(!t){return}if((u.browser||h.browser)&&t.indexOf("@")!==-1){t=t.replace(/[{return u.style.errorStack(" at ")+(e?u.style.errorStackMethod(e)+" ":"")+u.style.errorStack("(")+(r?u.style.errorStackFile(r):u.style.errorStack("unknown"))+(i?u.style.errorStack(":")+u.style.errorStackLine(i):"")+(n?u.style.errorStack(":")+u.style.errorStackColumn(n):"")+u.style.errorStack(")")})}else{t=t.replace(/^[^\n]*\n/,"");t=t.replace(/^\s*(at)\s+(?:(?:(async|new)\s+)?([^\s:()[\]\n]+(?:\([^)]+\))?)\s)?(?:\[as ([^\s:()[\]\n]+)\]\s)?(?:\(?([^:()[\]\n]+):([0-9]+):([0-9]+)\)?)?$/gm,(t,e,r,i,n,s,o,a)=>{return u.style.errorStack(" at ")+(r?u.style.errorStackKeyword(r)+" ":"")+(i?u.style.errorStackMethod(i)+" ":"")+(n?u.style.errorStack("[as ")+u.style.errorStackMethodAs(n)+u.style.errorStack("] "):"")+u.style.errorStack("(")+(s?u.style.errorStackFile(s):u.style.errorStack("unknown"))+(o?u.style.errorStack(":")+u.style.errorStackLine(o):"")+(a?u.style.errorStack(":")+u.style.errorStackColumn(a):"")+u.style.errorStack(")")})}return t}r.inspectStack=l;var f={};var t=t=>t;f.none={trim:false,tab:" ",newline:"\n",comma:"",limit:t,type:t=>"<"+t+">",constant:t,funcName:t,constructorName:t=>"<"+t+">",length:t,key:t,index:t=>"["+t+"] ",number:t,inspect:t,string:t,errorType:t,errorMessage:t,errorStack:t,errorStackKeyword:t,errorStackMethod:t,errorStackMethodAs:t,errorStackFile:t,errorStackLine:t,errorStackColumn:t,errorFromMessage:t,truncate:(t,e)=>t.slice(0,e-1)+"…"};f.inline=Object.assign({},f.none,{trim:true,tab:"",newline:" ",comma:", ",length:()=>"",index:()=>""});f.color=Object.assign({},f.none,{limit:t=>n.bold+n.brightRed+t+n.reset,type:t=>n.italic+n.brightBlack+t+n.reset,constant:t=>n.cyan+t+n.reset,funcName:t=>n.italic+n.magenta+t+n.reset,constructorName:t=>n.magenta+t+n.reset,length:t=>n.italic+n.brightBlack+t+n.reset,key:t=>n.green+t+n.reset,index:t=>n.blue+"["+t+"]"+n.reset+" ",number:t=>n.cyan+t+n.reset,inspect:t=>n.cyan+t+n.reset,string:t=>n.blue+t+n.reset,errorType:t=>n.red+n.bold+t+n.reset,errorMessage:t=>n.red+n.italic+t+n.reset,errorStack:t=>n.brightBlack+t+n.reset,errorStackKeyword:t=>n.italic+n.bold+t+n.reset,errorStackMethod:t=>n.brightYellow+t+n.reset,errorStackMethodAs:t=>n.yellow+t+n.reset,errorStackFile:t=>n.brightCyan+t+n.reset,errorStackLine:t=>n.blue+t+n.reset,errorStackColumn:t=>n.magenta+t+n.reset,errorFromMessage:t=>n.yellow+n.underline+t+n.reset,truncate:(t,e)=>{var r=n.gray+"…"+n.reset;t=t.slice(0,e-r.length);var i=t.lastIndexOf("");if(i>=t.length-6){t=t.slice(0,i)}return t+r}});f.html=Object.assign({},f.none,{tab:"    ",newline:"
",limit:t=>''+t+"",type:t=>''+t+"",constant:t=>''+t+"",funcName:t=>''+t+"",constructorName:t=>''+t+"",length:t=>''+t+"",key:t=>''+t+"",index:t=>'['+t+"] ",number:t=>''+t+"",inspect:t=>''+t+"",string:t=>''+t+"",errorType:t=>''+t+"",errorMessage:t=>''+t+"",errorStack:t=>''+t+"",errorStackKeyword:t=>""+t+"",errorStackMethod:t=>''+t+"",errorStackMethodAs:t=>''+t+"",errorStackFile:t=>''+t+"",errorStackLine:t=>''+t+"",errorStackColumn:t=>''+t+"",errorFromMessage:t=>''+t+""})}).call(this)}).call(this,{isBuffer:e("../../../../../../../../opt/node-v14.15.4/lib/node_modules/browserify/node_modules/is-buffer/index.js")},e("_process"))},{"../../../../../../../../opt/node-v14.15.4/lib/node_modules/browserify/node_modules/is-buffer/index.js":167,"./ansi.js":116,"./escape.js":118,_process:184}],122:[function(t,e,r){e.exports={"߀":"0","́":""," ":" ","Ⓐ":"A","A":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ɓ":"B","c":"C","Ⓒ":"C","C":"C","Ꜿ":"C","Ḉ":"C","Ç":"C","Ⓓ":"D","D":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ɗ":"D","Ɖ":"D","ᴅ":"D","Ꝺ":"D","Ð":"Dh","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"Dz","ɛ":"E","Ⓔ":"E","E":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","ᴇ":"E","ꝼ":"F","Ⓕ":"F","F":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","G":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","ɢ":"G","Ⓗ":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","I":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","J":"J","Ĵ":"J","Ɉ":"J","ȷ":"J","Ⓚ":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","L":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","M":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","ϻ":"M","Ꞥ":"N","Ƞ":"N","Ⓝ":"N","N":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ɲ":"N","Ꞑ":"N","ᴎ":"N","NJ":"NJ","Nj":"Nj","Ⓞ":"O","O":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Œ":"OE","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","P":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Q":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","R":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","S":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","T":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Þ":"Th","Ꜩ":"TZ","Ⓤ":"U","U":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","V":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","W":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Y":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Z":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","a":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ɑ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","Ƃ":"b","ⓒ":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c",C:"c","Ć":"c","Ĉ":"c","Ċ":"c","Č":"c","Ƈ":"c","Ȼ":"c","ⓓ":"d","d":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","Ƌ":"d","Ꮷ":"d","ԁ":"d","Ɦ":"d","ð":"dh","dz":"dz","dž":"dz","ⓔ":"e","e":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ff":"ff","fi":"fi","fl":"fl","ffi":"ffi","ffl":"ffl","ⓖ":"g","g":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ꝿ":"g","ᵹ":"g","ⓗ":"h","h":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","l":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","ɭ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ʼn":"n","ꞑ":"n","ꞥ":"n","ԉ":"n","nj":"nj","ⓞ":"o","o":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","ɔ":"o","ᴑ":"o","œ":"oe","ƣ":"oi","ꝏ":"oo","ȣ":"ou","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ρ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","r":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","s":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ʂ":"s","ß":"ss","ⓣ":"t","t":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","þ":"th","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","y":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z"}},{}],123:[function(t,e,r){"use strict";var i=t("./latinize-map.json");e.exports=function(t){return t.replace(/[^\u0000-\u007e]/g,t=>{return i[t]||t})}},{"./latinize-map.json":122}],124:[function(t,e,r){"use strict";r.resize=function(t,e){if(t.length===e){return t}else if(t.length>e){return t.slice(0,e)}return t+" ".repeat(e-t.length)};r.occurrenceCount=function(t,e,r=false){if(!t||!e){return 0}var i=0,n=0,s=r?1:e.length;while((n=t.indexOf(e,n))!==-1){i++;n+=s}return i}},{}],125:[function(t,e,r){"use strict";const x=1;const _=2;const C=3;const T=4;const S=5;function k(t,e){if(A(e)){return _}if(e<=31||e===127){return x}if(E(e)){return T}if(t.toUpperCase()!==t.toLowerCase()){return C}return S}function A(t){if(t===32||t===9||t===160||t===45||t===95){return true}return false}function E(t){if(t>=48&&t<=57){return true}return false}function i(t,e){t=""+t;e=""+e;var r,i,n,s,o,a,u,l=t.trim(),f=l.length,h,c,d,p,g,y,m,b=e.trim(),v=b.length,w=0;for(r=h=0;ry?1:-1}if(!w&&n!==d){w=n!==a?-1:1}break;case T:i=r+1;while(E(l.charCodeAt(i))){i++}u=parseFloat(l.slice(r,i));c=h+1;while(E(b.charCodeAt(c))){c++}m=parseFloat(b.slice(h,c));if(u!==m){return u-m}if(!w&&i-r!==c-h){w=i-r-(c-h)}r=i-1;h=c-1;break}}if(w){return w}return f-r-(v-h)||f-v||t.length-e.length}e.exports=i},{}],126:[function(t,e,r){"use strict";var n=t("./escape.js");r.regexp={};r.regexp.array2alternatives=function t(e){var r,i=e.slice();i.sort((t,e)=>{return e.length-t.length});for(r=0;r{if(!r||typeof r!=="string"){return""}var e=t.dashToSpace??a.dashToSpace,i=t.underscoreToSpace??a.underscoreToSpace,n=t.zealous??a.zealous,s=t.preserveAllCaps??a.preserveAllCaps,o=t.lowerCaseWords??a.lowerCaseWords;o=o instanceof Set?o:Array.isArray(o)?new Set(o):null;if(e){r=r.replace(/-+/g," ")}if(i){r=r.replace(/_+/g," ")}r=r.replace(/ +/g," ").trim();return r.replace(/[^\s_-]+/g,(e,t)=>{if(o&&t&&t+e.lengthString.fromCodePoint(...t);f.decode=t=>Array.from(t,t=>t.codePointAt(0));f.firstCodePoint=t=>t.codePointAt(0);f.firstChar=t=>t.length?String.fromCodePoint(t.codePointAt(0)):undefined;f.toArray=t=>Array.from(t);f.toCells=(t,e,r=4,i=0,...n)=>{var s,o,a,u,l=[];for(s of e){o=s.codePointAt(0);if(o===10){i=0}else if(o===9){a=r-i%r-1;l.push(new t("\t",1,...n));i+=1+a;while(a--){l.push(new t(" ",-2,...n))}}else{u=f.codePointWidth(o),l.push(new t(s,u,...n));i+=u;while(--u>0){l.push(new t(" ",-1,...n))}}}return l};f.fromCells=t=>{var e,r="";for(e of t){if(!e.filler){r+=e.char}}return r};f.length=t=>{var e,r=0;for(e of t){r++}return r};f.width=t=>{var e,r=0;for(e of t){r+=f.codePointWidth(e.codePointAt(0))}return r};f.arrayWidth=(t,e)=>{var r,i=0;if(e===undefined){e=t.length}for(r=0;rs;f.widthLimit=f.truncateWidth=(t,e)=>{var r,i,n=0;s=0;for(r of t){i=f.codePointWidth(r.codePointAt(0));if(s+i>e){return t.slice(0,n)}s+=i;n+=r.length}return t};f.surrogatePair=t=>{var e=t.charCodeAt(0);if(e<55296||e>=57344){return 0}else if(e<56320){return 1}return-1};f.isFullWidth=t=>f.isFullWidthCodePoint(t.codePointAt(0));f.charWidth=t=>f.codePointWidth(t.codePointAt(0));const i=new Map;(function(){var t=e("./unicode-emoji-width-ranges.json");for(let e of t){for(let t=e.s;t<=e.e;t++){i.set(t,e.w)}}})();f.codePointWidth=t=>{if(f.isEmojiCodePoint(t)){return i.get(t)??2}if(t>=4352&&(t<=4447||t===9001||t===9002||11904<=t&&t<=12871&&t!==12351||12880<=t&&t<=19903||19968<=t&&t<=42182||43360<=t&&t<=43388||44032<=t&&t<=55203||63744<=t&&t<=64255||65040<=t&&t<=65049||65072<=t&&t<=65131||65281<=t&&t<=65376||65504<=t&&t<=65510||110592<=t&&t<=110593||127488<=t&&t<=127569||131072<=t&&t<=262141)){return 2}if(f.isEmojiModifierCodePoint(t)||f.isZeroWidthDiacriticCodePoint(t)){return 0}return 1};f.isFullWidthCodePoint=t=>f.codePointWidth(t)===2;f.toFullWidth=t=>{return String.fromCodePoint(...Array.from(t,t=>{var e=t.codePointAt(0);return e>=33&&e<=126?65280+e-32:e}))};f.isZeroWidthDiacritic=t=>f.isZeroWidthDiacriticCodePoint(t.codePointAt(0));f.isZeroWidthDiacriticCodePoint=t=>768<=t&&t<=879||6832<=t&&t<=6911||7616<=t&&t<=7679||8400<=t&&t<=8447||65056<=t&&t<=65071||t===12441||t===12442||2304<=t&&t<=2307||2362<=t&&t<=2391&&t!==2365&&t!==2384||t===2402||t===2403||t===3633||3636<=t&&t<=3642||3655<=t&&t<=3662;f.isEmoji=t=>f.isEmojiCodePoint(t.codePointAt(0));f.isEmojiCodePoint=t=>9728<=t&&t<=9983||9984<=t&&t<=10175||126976<=t&&t<=127487||127744<=t&&t<=127994||128e3<=t&&t<=129791;f.isEmojiModifier=t=>f.isEmojiModifierCodePoint(t.codePointAt(0));f.isEmojiModifierCodePoint=t=>127995<=t&&t<=127999||t===65039},{"./unicode-emoji-width-ranges.json":129}],131:[function(t,e,r){"use strict";const w=t("./unicode.js");const x={"!":true,"?":true,":":true,";":true};e.exports=function t(e,r){var i=0,n,s,o,a,u,l,f,h,c,d,p=true,g=w.toArray(e),y=false,m,b=[];if(typeof r!=="object"){r={width:r}}if(!r.width||typeof r.width!=="number"||r.width<=0){r.width=80}o=r.offset?r.width-r.offset:r.width;if(typeof r.glue!=="string"){r.glue="\n"}if(r.regroupFn){g=r.regroupFn(g);d=r.charWidthFn||w.width}else{d=r.charWidthFn||w.charWidth}l=g.length;var v=()=>{if(!p||y){while(g[i]===" "){i++}if(y&&g[i]==="\n"){p=true;i++}}if(i>=l){return null}p=false;y=false;c=false;n=f=i;u=h=0;for(;;){if(n>=l){return g.slice(i,n).join("")}if(g[n]==="\n"){p=true;a=g.slice(i,n++).join("");if(r.fill){a+=" ".repeat(o-u)}return a}if(r.skipFn){s=r.skipFn(g,n);if(s!==n){n=s;continue}}if(g[n]===" "&&!c&&!x[g[n+1]]){f=n;h=u}else{c=false}u+=d(g[n]);if(u>o){y=true;if(f!==i){n=f}else if(oe===b.length-1?t:t.trimRight())}if(!r.noJoin){b=b.join(r.glue)}if(r.updateOffset){r.offset=u}return b}},{"./unicode.js":130}],132:[function(t,e,r){"use strict";function c(t,e){var r=Object.getPrototypeOf(t);if(c.opaque.has(r)){return c.opaque.get(r)(t)}var i,n,s,o,a,u,l=[{source:t,target:Array.isArray(t)?[]:Object.create(r)}],f=l[0].target,h=new Map;h.set(t,f);while(o=l.shift()){s=Object.getOwnPropertyNames(o.source);for(i=0;inew Date(t))},{}],133:[function(t,e,r){"use strict";function p(t,e,r){var i,n,s,o,a,u,l,f,h,c,d;u=typeof t;l=typeof e;if(!t||u!=="object"&&u!=="function"||!e||l!=="object"&&l!=="function"){throw new Error("[tree] diff() needs objects as argument #0 and #1")}if(!r||typeof r!=="object"){r={}}f=r.depth||0;if(!f){r.diffObject={};if(!r.path){r.path=""}if(!r.pathSeparator){r.pathSeparator="."}}h=r.diffObject;if(Array.isArray(t)){d=true;c=t.length}else{d=false;o=Object.keys(t);c=o.length}for(i=0;is(t,o(e));i.set=(t,e,r)=>{if(!t||typeof t!=="object"){return undefined}var i=o(e),n=i[i.length-1];if(typeof n==="object"||n==="__proto__"){throw new Error(a)}var s=u(t,i);s[n]=r;return r};i.define=(t,e,r)=>{if(!t||typeof t!=="object"){return undefined}var i=o(e),n=i[i.length-1];if(typeof n==="object"||n==="__proto__"){throw new Error(a)}var s=u(t,i);if(!(n in s)){s[n]=r}return r};i.inc=(t,e,r)=>{if(!t||typeof t!=="object"){return undefined}var i=o(e),n=i[i.length-1];if(typeof n==="object"||n==="__proto__"){throw new Error(a)}var s=u(t,i);if(typeof s[n]==="number"){s[n]++}else if(!s[n]||typeof s[n]!=="object"){s[n]=1}return r};i.dec=(t,e,r)=>{if(!t||typeof t!=="object"){return undefined}var i=o(e),n=i[i.length-1];if(typeof n==="object"||n==="__proto__"){throw new Error(a)}var s=u(t,i);if(typeof s[n]==="number"){s[n]--}else if(!s[n]||typeof s[n]!=="object"){s[n]=-1}return r};i.concat=(t,e,r)=>{if(!t||typeof t!=="object"){return undefined}var i=o(e),n=i[i.length-1];if(typeof n==="object"||n==="__proto__"){throw new Error(a)}var s=u(t,i);if(!s[n]){s[n]=r}else if(Array.isArray(s[n])&&Array.isArray(r)){s[n]=s[n].concat(r)}return r};i.insert=(t,e,r)=>{if(!t||typeof t!=="object"){return undefined}var i=o(e),n=i[i.length-1];if(typeof n==="object"||n==="__proto__"){throw new Error(a)}var s=u(t,i);if(!s[n]){s[n]=r}else if(Array.isArray(s[n])&&Array.isArray(r)){s[n]=r.concat(s[n])}return r};i.delete=(t,e)=>{var r=o(e),i=r[r.length-1];if(typeof i==="object"||i==="__proto__"){throw new Error(a)}var n=s(t,r,-1);if(!n||typeof n!=="object"){return false}return delete n[i]};i.autoPush=(t,e,r)=>{if(!t||typeof t!=="object"){return undefined}var i=o(e),n=i[i.length-1];if(typeof n==="object"||n==="__proto__"){throw new Error(a)}var s=u(t,i);if(s[n]===undefined){s[n]=r}else if(Array.isArray(s[n])){s[n].push(r)}else{s[n]=[s[n],r]}return s[n]};i.append=(t,e,r)=>{if(!t||typeof t!=="object"){return undefined}var i=o(e),n=i[i.length-1];if(typeof n==="object"||n==="__proto__"){throw new Error(a)}var s=u(t,i);if(!s[n]){s[n]=[r]}else if(Array.isArray(s[n])){s[n].push(r)}return s[n]};i.prepend=(t,e,r)=>{if(!t||typeof t!=="object"){return undefined}var i=o(e),n=i[i.length-1];if(typeof n==="object"||n==="__proto__"){throw new Error(a)}var s=u(t,i);if(!s[n]){s[n]=[r]}else if(Array.isArray(s[n])){s[n].unshift(r)}return s[n]}},{}],135:[function(t,e,r){"use strict";function i(t,e,...r){var i,n,s=false,o=r.length;if(!o){return e}if(!t||typeof t!=="object"){t={}}var a={depth:0,prefix:""};if(t.deep){if(Array.isArray(t.deep)){t.deep=new Set(t.deep)}else if(!(t.deep instanceof Set)){t.deep=true}}if(t.immutables){if(Array.isArray(t.immutables)){t.immutables=new Set(t.immutables)}else if(!(t.immutables instanceof Set)){delete t.immutables}}if(!t.maxDepth&&t.deep&&!t.circular){t.maxDepth=100}if(t.deepFunc){t.deep=true}if(t.flat){t.deep=true;t.proto=false;t.inherit=false;t.unflat=false;if(typeof t.flat!=="string"){t.flat="."}}if(t.unflat){t.deep=false;t.proto=false;t.inherit=false;t.flat=false;if(typeof t.unflat!=="string"){t.unflat="."}}if(t.inherit){t.own=true;t.proto=false}else if(t.proto){t.own=true}if(!e||typeof e!=="object"&&typeof e!=="function"){s=true}if(!t.skipRoot&&(t.inherit||t.proto)){for(i=o-1;i>=0;i--){n=r[i];if(n&&(typeof n==="object"||typeof n==="function")){if(t.inherit){if(s){e=Object.create(n)}else{Object.setPrototypeOf(e,n)}}else if(t.proto){if(s){e=Object.create(Object.getPrototypeOf(n))}else{Object.setPrototypeOf(e,Object.getPrototypeOf(n))}}break}}}else if(s){e={}}a.references={sources:[],targets:[]};for(i=0;ie.maxDepth){throw new Error("[tree] extend(): max depth reached("+e.maxDepth+")")}if(e.circular){t.references.sources.push(i);t.references.targets.push(r)}if(e.own){if(e.nonEnum){u=Object.getOwnPropertyNames(i)}else{u=Object.keys(i)}}else{u=i}for(l in u){if(e.own){l=u[l]}if(l==="__proto__"){continue}if(e.descriptor){d=Object.getOwnPropertyDescriptor(i,l);f=d.value}else{f=i[l]}g=r;p=t.prefix+l;if(e.nofunc&&typeof f==="function"){continue}if(e.unflat&&t.depth===0){a=l.split(e.unflat);o=a.length-1;if(o){for(s=0;s=0){continue}v({depth:t.depth+1,prefix:t.prefix+l+e.flat,references:t.references},e,g,f,n)}else{if(b>=0){y=t.references.targets[b];if(e.descriptor){Object.defineProperty(g,p,{value:y,enumerable:d.enumerable,writable:d.writable,configurable:d.configurable})}else{g[p]=y}continue}if(!m||!Object.prototype.hasOwnProperty.call(g,p)){if(Array.isArray(f)){y=[]}else if(e.proto){y=Object.create(c)}else if(e.inherit){y=Object.create(f)}else{y={}}if(e.descriptor){Object.defineProperty(g,p,{value:y,enumerable:d.enumerable,writable:d.writable,configurable:d.configurable})}else{g[p]=y}}else if(e.proto&&Object.getPrototypeOf(y)!==c){Object.setPrototypeOf(y,c)}else if(e.inherit&&Object.getPrototypeOf(y)!==f){Object.setPrototypeOf(y,f)}if(e.circular){t.references.sources.push(f);t.references.targets.push(y)}v({depth:t.depth+1,prefix:"",references:t.references},e,y,f,n)}}else if(n&&(y===undefined||m||h)){continue}else if(e.preserve&&y!==undefined){continue}else if(!e.inherit){if(e.descriptor){Object.defineProperty(g,p,d)}else{g[p]=y=f}}if(e.move){delete i[l]}}}},{}],136:[function(t,e,r){"use strict";r.defineLazyProperty=function t(e,r,i){Object.defineProperty(e,r,{configurable:true,enumerable:true,get:function(){var t=i();Object.defineProperty(e,r,{configurable:true,enumerable:true,writable:false,value:t});return t}})}},{}],137:[function(t,e,r){"use strict";const g=t("./tree.js");const i=t("util");const y={};e.exports=y;y.Mask=function t(){throw new Error("Cannot create a tree.Mask() directly")};const n={clone:false,path:"",pathSeparator:"."};y.createMask=function t(e,r){if(e===null||typeof e!=="object"){throw new TypeError("[tree] .createMask() : Argument #1 should be an object")}if(r!==null&&typeof r==="object"){r=g.extend(null,{},n,r)}else{r=n}var i=Object.create(y.Mask.prototype,{__options__:{value:r,writable:true}});g.extend(null,i,e);return i};y.Mask.prototype.applyTo=function t(e,r,i){if(e===null||typeof e!=="object"){throw new TypeError("[tree] .applyTo() : Argument #1 should be an object")}if(i){r=g.extend(null,{mask:this,options:this.__options__,path:this.__options__.path},r)}else if(r===undefined){r={mask:this,options:this.__options__,path:this.__options__.path}}var n,s,o,a,u,l,f=Object.keys(r.mask),h,c,d,p;if(Array.isArray(e)){o=[]}else{o={}}for(a=0;a=0){var a=n.indexOf("\n",o+1);n=n.substring(a+1)}this.stack=n}}};f.inherits(l.AssertionError,Error);function e(t,e){if(typeof t==="string"){return t.length=0;l--){if(o[l]!==a[l])return false}for(l=o.length-1;l>=0;l--){u=o[l];if(!m(t[u],e[u],r,i))return false}return true}l.notDeepEqual=function t(e,r,i){if(m(e,r,false)){g(e,r,i,"notDeepEqual",l.notDeepEqual)}};l.notDeepStrictEqual=w;function w(t,e,r){if(m(t,e,true)){g(t,e,r,"notDeepStrictEqual",w)}}l.strictEqual=function t(e,r,i){if(e!==r){g(e,r,i,"===",l.strictEqual)}};l.notStrictEqual=function t(e,r,i){if(e===r){g(e,r,i,"!==",l.notStrictEqual)}};function x(t,e){if(!t||!e){return false}if(Object.prototype.toString.call(e)=="[object RegExp]"){return e.test(t)}try{if(t instanceof e){return true}}catch(t){}if(Error.isPrototypeOf(e)){return false}return e.call({},t)===true}function _(t){var e;try{t()}catch(t){e=t}return e}function C(t,e,r,i){var n;if(typeof e!=="function"){throw new TypeError('"block" argument must be a function')}if(typeof r==="string"){i=r;r=null}n=_(e);i=(r&&r.name?" ("+r.name+").":".")+(i?" "+i:".");if(t&&!n){g(n,r,"Missing expected exception"+i)}var s=typeof i==="string";var o=!t&&f.isError(n);var a=!t&&n&&!r;if(o&&s&&x(n,r)||a){g(n,r,"Got unwanted exception"+i)}if(t&&n&&r&&!x(n,r)||!t&&n){throw n}}l.throws=function(t,e,r){C(true,t,e,r)};l.doesNotThrow=function(t,e,r){C(false,t,e,r)};l.ifError=function(t){if(t)throw t};function T(t,e){if(!t)g(t,true,e,"==",T)}l.strict=t(T,l,{equal:l.strictEqual,deepEqual:l.deepStrictEqual,notEqual:l.notStrictEqual,notDeepEqual:l.notDeepStrictEqual});l.strict.strict=l.strict;var S=Object.keys||function(t){var e=[];for(var r in t){if(i.call(t,r))e.push(r)}return e}}).call(this)}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"object-assign":170,"util/":146}],144:[function(t,e,r){if(typeof Object.create==="function"){e.exports=function t(e,r){e.super_=r;e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}})}}else{e.exports=function t(e,r){e.super_=r;var i=function(){};i.prototype=r.prototype;e.prototype=new i;e.prototype.constructor=e}}},{}],145:[function(t,e,r){e.exports=function t(e){return e&&typeof e==="object"&&typeof e.copy==="function"&&typeof e.fill==="function"&&typeof e.readUInt8==="function"}},{}],146:[function(P,t,j){(function(M,I){(function(){var a=/%[sdj%]/g;j.format=function(t){if(!x(t)){var e=[];for(var r=0;r=n)return t;switch(t){case"%s":return String(i[r++]);case"%d":return Number(i[r++]);case"%j":try{return JSON.stringify(i[r++])}catch(t){return"[Circular]"}default:return t}});for(var o=i[r];r=3)r.depth=arguments[2];if(arguments.length>=4)r.colors=arguments[3];if(o(e)){r.showHidden=e}else if(e){j._extend(r,e)}if(h(r.showHidden))r.showHidden=false;if(h(r.depth))r.depth=2;if(h(r.colors))r.colors=false;if(h(r.customInspect))r.customInspect=true;if(r.colors)r.stylize=n;return p(r,t,r.depth)}j.inspect=u;u.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]};u.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function n(t,e){var r=u.styles[e];if(r){return"["+u.colors[r][0]+"m"+t+"["+u.colors[r][1]+"m"}else{return t}}function s(t,e){return t}function d(t){var r={};t.forEach(function(t,e){r[t]=true});return r}function p(e,r,i){if(e.customInspect&&r&&S(r.inspect)&&r.inspect!==j.inspect&&!(r.constructor&&r.constructor.prototype===r)){var t=r.inspect(i,e);if(!x(t)){t=p(e,t,i)}return t}var n=g(e,r);if(n){return n}var s=Object.keys(r);var o=d(s);if(e.showHidden){s=Object.getOwnPropertyNames(r)}if(T(r)&&(s.indexOf("message")>=0||s.indexOf("description")>=0)){return y(r)}if(s.length===0){if(S(r)){var a=r.name?": "+r.name:"";return e.stylize("[Function"+a+"]","special")}if(_(r)){return e.stylize(RegExp.prototype.toString.call(r),"regexp")}if(C(r)){return e.stylize(Date.prototype.toString.call(r),"date")}if(T(r)){return y(r)}}var u="",l=false,f=["{","}"];if(w(r)){l=true;f=["[","]"]}if(S(r)){var h=r.name?": "+r.name:"";u=" [Function"+h+"]"}if(_(r)){u=" "+RegExp.prototype.toString.call(r)}if(C(r)){u=" "+Date.prototype.toUTCString.call(r)}if(T(r)){u=" "+y(r)}if(s.length===0&&(!l||r.length==0)){return f[0]+u+f[1]}if(i<0){if(_(r)){return e.stylize(RegExp.prototype.toString.call(r),"regexp")}else{return e.stylize("[Object]","special")}}e.seen.push(r);var c;if(l){c=m(e,r,i,o,s)}else{c=s.map(function(t){return b(e,r,i,o,t,l)})}e.seen.pop();return v(c,u,f)}function g(t,e){if(h(e))return t.stylize("undefined","undefined");if(x(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}if(f(e))return t.stylize(""+e,"number");if(o(e))return t.stylize(""+e,"boolean");if(l(e))return t.stylize("null","null")}function y(t){return"["+Error.prototype.toString.call(t)+"]"}function m(e,r,i,n,t){var s=[];for(var o=0,a=r.length;o-1){if(s){a=a.split("\n").map(function(t){return" "+t}).join("\n").substr(2)}else{a="\n"+a.split("\n").map(function(t){return" "+t}).join("\n")}}}else{a=t.stylize("[Circular]","special")}}if(h(o)){if(s&&n.match(/^\d+$/)){return a}o=JSON.stringify(""+n);if(o.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)){o=o.substr(1,o.length-2);o=t.stylize(o,"name")}else{o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'");o=t.stylize(o,"string")}}return o+": "+a}function v(t,e,r){var i=0;var n=t.reduce(function(t,e){i++;if(e.indexOf("\n")>=0)i++;return t+e.replace(/\u001b\[\d\d?m/g,"").length+1},0);if(n>60){return r[0]+(e===""?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1]}return r[0]+e+" "+t.join(", ")+" "+r[1]}function w(t){return Array.isArray(t)}j.isArray=w;function o(t){return typeof t==="boolean"}j.isBoolean=o;function l(t){return t===null}j.isNull=l;function e(t){return t==null}j.isNullOrUndefined=e;function f(t){return typeof t==="number"}j.isNumber=f;function x(t){return typeof t==="string"}j.isString=x;function r(t){return typeof t==="symbol"}j.isSymbol=r;function h(t){return t===void 0}j.isUndefined=h;function _(t){return c(t)&&A(t)==="[object RegExp]"}j.isRegExp=_;function c(t){return typeof t==="object"&&t!==null}j.isObject=c;function C(t){return c(t)&&A(t)==="[object Date]"}j.isDate=C;function T(t){return c(t)&&(A(t)==="[object Error]"||t instanceof Error)}j.isError=T;function S(t){return typeof t==="function"}j.isFunction=S;function k(t){return t===null||typeof t==="boolean"||typeof t==="number"||typeof t==="string"||typeof t==="symbol"||typeof t==="undefined"}j.isPrimitive=k;j.isBuffer=P("./support/isBuffer");function A(t){return Object.prototype.toString.call(t)}function E(t){return t<10?"0"+t.toString(10):t.toString(10)}var B=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function R(){var t=new Date;var e=[E(t.getHours()),E(t.getMinutes()),E(t.getSeconds())].join(":");return[t.getDate(),B[t.getMonth()],e].join(" ")}j.log=function(){console.log("%s - %s",R(),j.format.apply(j,arguments))};j.inherits=P("inherits");j._extend=function(t,e){if(!e||!c(e))return t;var r=Object.keys(e);var i=r.length;while(i--){t[r[i]]=e[r[i]]}return t};function O(t,e){return Object.prototype.hasOwnProperty.call(t,e)}}).call(this)}).call(this,P("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./support/isBuffer":145,_process:184,inherits:144}],147:[function(t,i,e){(function(r){(function(){"use strict";var e=t("array-filter");i.exports=function t(){return e(["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],function(t){return typeof r[t]==="function"})}}).call(this)}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"array-filter":142}],148:[function(t,e,r){"use strict";r.byteLength=o;r.toByteArray=a;r.fromByteArray=g;var u=[];var l=[];var f=typeof Uint8Array!=="undefined"?Uint8Array:Array;var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var n=0,s=i.length;n0){throw new Error("Invalid string. Length must be a multiple of 4")}var r=t.indexOf("=");if(r===-1)r=e;var i=r===e?0:4-r%4;return[r,i]}function o(t){var e=h(t);var r=e[0];var i=e[1];return(r+i)*3/4-i}function c(t,e,r){return(e+r)*3/4-r}function a(t){var e;var r=h(t);var i=r[0];var n=r[1];var s=new f(c(t,i,n));var o=0;var a=n>0?i-4:i;var u;for(u=0;u>16&255;s[o++]=e>>8&255;s[o++]=e&255}if(n===2){e=l[t.charCodeAt(u)]<<2|l[t.charCodeAt(u+1)]>>4;s[o++]=e&255}if(n===1){e=l[t.charCodeAt(u)]<<10|l[t.charCodeAt(u+1)]<<4|l[t.charCodeAt(u+2)]>>2;s[o++]=e>>8&255;s[o++]=e&255}return s}function d(t){return u[t>>18&63]+u[t>>12&63]+u[t>>6&63]+u[t&63]}function p(t,e,r){var i;var n=[];for(var s=e;sa?a:o+s))}if(i===1){e=t[r-1];n.push(u[e>>2]+u[e<<4&63]+"==")}else if(i===2){e=(t[r-2]<<8)+t[r-1];n.push(u[e>>10]+u[e>>4&63]+u[e<<2&63]+"=")}return n.join("")}},{}],149:[function(t,e,r){arguments[4][141][0].apply(r,arguments)},{dup:141}],150:[function(u,t,c){(function(f,h){(function(){"use strict";var l=u("assert");var s=u("pako/lib/zlib/zstream");var o=u("pako/lib/zlib/deflate.js");var a=u("pako/lib/zlib/inflate.js");var t=u("pako/lib/zlib/constants");for(var e in t){c[e]=t[e]}c.NONE=0;c.DEFLATE=1;c.INFLATE=2;c.GZIP=3;c.GUNZIP=4;c.DEFLATERAW=5;c.INFLATERAW=6;c.UNZIP=7;var r=31;var i=139;function n(t){if(typeof t!=="number"||tc.UNZIP){throw new TypeError("Bad argument")}this.dictionary=null;this.err=0;this.flush=0;this.init_done=false;this.level=0;this.memLevel=0;this.mode=t;this.strategy=0;this.windowBits=0;this.write_in_progress=false;this.pending_close=false;this.gzip_id_bytes_read=0}n.prototype.close=function(){if(this.write_in_progress){this.pending_close=true;return}this.pending_close=false;l(this.init_done,"close before init");l(this.mode<=c.UNZIP);if(this.mode===c.DEFLATE||this.mode===c.GZIP||this.mode===c.DEFLATERAW){o.deflateEnd(this.strm)}else if(this.mode===c.INFLATE||this.mode===c.GUNZIP||this.mode===c.INFLATERAW||this.mode===c.UNZIP){a.inflateEnd(this.strm)}this.mode=c.NONE;this.dictionary=null};n.prototype.write=function(t,e,r,i,n,s,o){return this._write(true,t,e,r,i,n,s,o)};n.prototype.writeSync=function(t,e,r,i,n,s,o){return this._write(false,t,e,r,i,n,s,o)};n.prototype._write=function(t,e,r,i,n,s,o,a){l.equal(arguments.length,8);l(this.init_done,"write before init");l(this.mode!==c.NONE,"already finalized");l.equal(false,this.write_in_progress,"write already in progress");l.equal(false,this.pending_close,"close is pending");this.write_in_progress=true;l.equal(false,e===undefined,"must provide flush value");this.write_in_progress=true;if(e!==c.Z_NO_FLUSH&&e!==c.Z_PARTIAL_FLUSH&&e!==c.Z_SYNC_FLUSH&&e!==c.Z_FULL_FLUSH&&e!==c.Z_FINISH&&e!==c.Z_BLOCK){throw new Error("Invalid flush value")}if(r==null){r=h.alloc(0);n=0;i=0}this.strm.avail_in=n;this.strm.input=r;this.strm.next_in=i;this.strm.avail_out=a;this.strm.output=s;this.strm.next_out=o;this.flush=e;if(!t){this._process();if(this._checkError()){return this._afterSync()}return}var u=this;f.nextTick(function(){u._process();u._after()});return this};n.prototype._afterSync=function(){var t=this.strm.avail_out;var e=this.strm.avail_in;this.write_in_progress=false;return[e,t]};n.prototype._process=function(){var t=null;switch(this.mode){case c.DEFLATE:case c.GZIP:case c.DEFLATERAW:this.err=o.deflate(this.strm,this.flush);break;case c.UNZIP:if(this.strm.avail_in>0){t=this.strm.next_in}switch(this.gzip_id_bytes_read){case 0:if(t===null){break}if(this.strm.input[t]===r){this.gzip_id_bytes_read=1;t++;if(this.strm.avail_in===1){break}}else{this.mode=c.INFLATE;break}case 1:if(t===null){break}if(this.strm.input[t]===i){this.gzip_id_bytes_read=2;this.mode=c.GUNZIP}else{this.mode=c.INFLATE}break;default:throw new Error("invalid number of gzip magic number bytes read")}case c.INFLATE:case c.GUNZIP:case c.INFLATERAW:this.err=a.inflate(this.strm,this.flush);if(this.err===c.Z_NEED_DICT&&this.dictionary){this.err=a.inflateSetDictionary(this.strm,this.dictionary);if(this.err===c.Z_OK){this.err=a.inflate(this.strm,this.flush)}else if(this.err===c.Z_DATA_ERROR){this.err=c.Z_NEED_DICT}}while(this.strm.avail_in>0&&this.mode===c.GUNZIP&&this.err===c.Z_STREAM_END&&this.strm.next_in[0]!==0){this.reset();this.err=a.inflate(this.strm,this.flush)}break;default:throw new Error("Unknown mode "+this.mode)}};n.prototype._checkError=function(){switch(this.err){case c.Z_OK:case c.Z_BUF_ERROR:if(this.strm.avail_out!==0&&this.flush===c.Z_FINISH){this._error("unexpected end of file");return false}break;case c.Z_STREAM_END:break;case c.Z_NEED_DICT:if(this.dictionary==null){this._error("Missing dictionary")}else{this._error("Bad dictionary")}return false;default:this._error("Zlib error");return false}return true};n.prototype._after=function(){if(!this._checkError()){return}var t=this.strm.avail_out;var e=this.strm.avail_in;this.write_in_progress=false;this.callback(e,t);if(this.pending_close){this.close()}};n.prototype._error=function(t){if(this.strm.msg){t=this.strm.msg}this.onerror(t,this.err);this.write_in_progress=false;if(this.pending_close){this.close()}};n.prototype.init=function(t,e,r,i,n){l(arguments.length===4||arguments.length===5,"init(windowBits, level, memLevel, strategy, [dictionary])");l(t>=8&&t<=15,"invalid windowBits");l(e>=-1&&e<=9,"invalid compression level");l(r>=1&&r<=9,"invalid memlevel");l(i===c.Z_FILTERED||i===c.Z_HUFFMAN_ONLY||i===c.Z_RLE||i===c.Z_FIXED||i===c.Z_DEFAULT_STRATEGY,"invalid strategy");this._init(e,t,r,i,n);this._setDictionary()};n.prototype.params=function(){throw new Error("deflateParams Not supported")};n.prototype.reset=function(){this._reset();this._setDictionary()};n.prototype._init=function(t,e,r,i,n){this.level=t;this.windowBits=e;this.memLevel=r;this.strategy=i;this.flush=c.Z_NO_FLUSH;this.err=c.Z_OK;if(this.mode===c.GZIP||this.mode===c.GUNZIP){this.windowBits+=16}if(this.mode===c.UNZIP){this.windowBits+=32}if(this.mode===c.DEFLATERAW||this.mode===c.INFLATERAW){this.windowBits=-1*this.windowBits}this.strm=new s;switch(this.mode){case c.DEFLATE:case c.GZIP:case c.DEFLATERAW:this.err=o.deflateInit2(this.strm,this.level,c.Z_DEFLATED,this.windowBits,this.memLevel,this.strategy);break;case c.INFLATE:case c.GUNZIP:case c.INFLATERAW:case c.UNZIP:this.err=a.inflateInit2(this.strm,this.windowBits);break;default:throw new Error("Unknown mode "+this.mode)}if(this.err!==c.Z_OK){this._error("Init error")}this.dictionary=n;this.write_in_progress=false;this.init_done=true};n.prototype._setDictionary=function(){if(this.dictionary==null){return}this.err=c.Z_OK;switch(this.mode){case c.DEFLATE:case c.DEFLATERAW:this.err=o.deflateSetDictionary(this.strm,this.dictionary);break;default:break}if(this.err!==c.Z_OK){this._error("Failed to set dictionary")}};n.prototype._reset=function(){this.err=c.Z_OK;switch(this.mode){case c.DEFLATE:case c.DEFLATERAW:case c.GZIP:this.err=o.deflateReset(this.strm);break;case c.INFLATE:case c.INFLATERAW:case c.GUNZIP:this.err=a.inflateReset(this.strm);break;default:break}if(this.err!==c.Z_OK){this._error("Failed to reset stream")}};c.Zlib=n}).call(this)}).call(this,u("_process"),u("buffer").Buffer)},{_process:184,assert:143,buffer:152,"pako/lib/zlib/constants":174,"pako/lib/zlib/deflate.js":176,"pako/lib/zlib/inflate.js":178,"pako/lib/zlib/zstream":182}],151:[function(E,t,B){(function(A){(function(){"use strict";var y=E("buffer").Buffer;var o=E("stream").Transform;var a=E("./binding");var t=E("util");var m=E("assert").ok;var b=E("buffer").kMaxLength;var v="Cannot create final Buffer. It would be larger "+"than 0x"+b.toString(16)+" bytes";a.Z_MIN_WINDOWBITS=8;a.Z_MAX_WINDOWBITS=15;a.Z_DEFAULT_WINDOWBITS=15;a.Z_MIN_CHUNK=64;a.Z_MAX_CHUNK=Infinity;a.Z_DEFAULT_CHUNK=16*1024;a.Z_MIN_MEMLEVEL=1;a.Z_MAX_MEMLEVEL=9;a.Z_DEFAULT_MEMLEVEL=8;a.Z_MIN_LEVEL=-1;a.Z_MAX_LEVEL=9;a.Z_DEFAULT_LEVEL=a.Z_DEFAULT_COMPRESSION;var e=Object.keys(a);for(var r=0;r=b){e=new RangeError(v)}else{t=y.concat(n,s)}n=[];r.close();i(e,t)}}function h(t,e){if(typeof e==="string")e=y.from(e);if(!y.isBuffer(e))throw new TypeError("Not a string or buffer");var r=t._finishFlushFlag;return t._processChunk(e,r)}function c(t){if(!(this instanceof c))return new c(t);T.call(this,t,a.DEFLATE)}function d(t){if(!(this instanceof d))return new d(t);T.call(this,t,a.INFLATE)}function p(t){if(!(this instanceof p))return new p(t);T.call(this,t,a.GZIP)}function g(t){if(!(this instanceof g))return new g(t);T.call(this,t,a.GUNZIP)}function w(t){if(!(this instanceof w))return new w(t);T.call(this,t,a.DEFLATERAW)}function x(t){if(!(this instanceof x))return new x(t);T.call(this,t,a.INFLATERAW)}function _(t){if(!(this instanceof _))return new _(t);T.call(this,t,a.UNZIP)}function C(t){return t===a.Z_NO_FLUSH||t===a.Z_PARTIAL_FLUSH||t===a.Z_SYNC_FLUSH||t===a.Z_FULL_FLUSH||t===a.Z_FINISH||t===a.Z_BLOCK}function T(t,e){var r=this;this._opts=t=t||{};this._chunkSize=t.chunkSize||B.Z_DEFAULT_CHUNK;o.call(this,t);if(t.flush&&!C(t.flush)){throw new Error("Invalid flush flag: "+t.flush)}if(t.finishFlush&&!C(t.finishFlush)){throw new Error("Invalid flush flag: "+t.finishFlush)}this._flushFlag=t.flush||a.Z_NO_FLUSH;this._finishFlushFlag=typeof t.finishFlush!=="undefined"?t.finishFlush:a.Z_FINISH;if(t.chunkSize){if(t.chunkSizeB.Z_MAX_CHUNK){throw new Error("Invalid chunk size: "+t.chunkSize)}}if(t.windowBits){if(t.windowBitsB.Z_MAX_WINDOWBITS){throw new Error("Invalid windowBits: "+t.windowBits)}}if(t.level){if(t.levelB.Z_MAX_LEVEL){throw new Error("Invalid compression level: "+t.level)}}if(t.memLevel){if(t.memLevelB.Z_MAX_MEMLEVEL){throw new Error("Invalid memLevel: "+t.memLevel)}}if(t.strategy){if(t.strategy!=B.Z_FILTERED&&t.strategy!=B.Z_HUFFMAN_ONLY&&t.strategy!=B.Z_RLE&&t.strategy!=B.Z_FIXED&&t.strategy!=B.Z_DEFAULT_STRATEGY){throw new Error("Invalid strategy: "+t.strategy)}}if(t.dictionary){if(!y.isBuffer(t.dictionary)){throw new Error("Invalid dictionary: it should be a Buffer instance")}}this._handle=new a.Zlib(e);var i=this;this._hadError=false;this._handle.onerror=function(t,e){S(i);i._hadError=true;var r=new Error(t);r.errno=e;r.code=B.codes[e];i.emit("error",r)};var n=B.Z_DEFAULT_COMPRESSION;if(typeof t.level==="number")n=t.level;var s=B.Z_DEFAULT_STRATEGY;if(typeof t.strategy==="number")s=t.strategy;this._handle.init(t.windowBits||B.Z_DEFAULT_WINDOWBITS,n,t.memLevel||B.Z_DEFAULT_MEMLEVEL,s,t.dictionary);this._buffer=y.allocUnsafe(this._chunkSize);this._offset=0;this._level=n;this._strategy=s;this.once("end",this.close);Object.defineProperty(this,"_closed",{get:function(){return!r._handle},configurable:true,enumerable:true})}t.inherits(T,o);T.prototype.params=function(t,e,r){if(tB.Z_MAX_LEVEL){throw new RangeError("Invalid compression level: "+t)}if(e!=B.Z_FILTERED&&e!=B.Z_HUFFMAN_ONLY&&e!=B.Z_RLE&&e!=B.Z_FIXED&&e!=B.Z_DEFAULT_STRATEGY){throw new TypeError("Invalid strategy: "+e)}if(this._level!==t||this._strategy!==e){var i=this;this.flush(a.Z_SYNC_FLUSH,function(){m(i._handle,"zlib binding closed");i._handle.params(t,e);if(!i._hadError){i._level=t;i._strategy=e;if(r)r()}})}else{A.nextTick(r)}};T.prototype.reset=function(){m(this._handle,"zlib binding closed");return this._handle.reset()};T.prototype._flush=function(t){this._transform(y.alloc(0),"",t)};T.prototype.flush=function(t,e){var r=this;var i=this._writableState;if(typeof t==="function"||t===undefined&&!e){e=t;t=a.Z_FULL_FLUSH}if(i.ended){if(e)A.nextTick(e)}else if(i.ending){if(e)this.once("end",e)}else if(i.needDrain){if(e){this.once("drain",function(){return r.flush(t,e)})}}else{this._flushFlag=t;this.write(y.alloc(0),"",e)}};T.prototype.close=function(t){S(this,t);A.nextTick(k,this)};function S(t,e){if(e)A.nextTick(e);if(!t._handle)return;t._handle.close();t._handle=null}function k(t){t.emit("close")}T.prototype._transform=function(t,e,r){var i;var n=this._writableState;var s=n.ending||n.ended;var o=s&&(!t||n.length===t.length);if(t!==null&&!y.isBuffer(t))return r(new Error("invalid input"));if(!this._handle)return r(new Error("zlib binding closed"));if(o)i=this._finishFlushFlag;else{i=this._flushFlag;if(t.length>=n.length){this._flushFlag=this._opts.flush||a.Z_NO_FLUSH}}this._processChunk(t,i,r)};T.prototype._processChunk=function(s,o,a){var u=s&&s.length;var l=this._chunkSize-this._offset;var f=0;var h=this;var c=typeof a==="function";if(!c){var d=[];var p=0;var e;this.on("error",function(t){e=t});m(this._handle,"zlib binding closed");do{var t=this._handle.writeSync(o,s,f,u,this._buffer,this._offset,l)}while(!this._hadError&&g(t[0],t[1]));if(this._hadError){throw e}if(p>=b){S(this);throw new RangeError(v)}var r=y.concat(d,p);S(this);return r}m(this._handle,"zlib binding closed");var i=this._handle.write(o,s,f,u,this._buffer,this._offset,l);i.buffer=s;i.callback=g;function g(t,e){if(this){this.buffer=null;this.callback=null}if(h._hadError)return;var r=l-e;m(r>=0,"have should not go down");if(r>0){var i=h._buffer.slice(h._offset,h._offset+r);h._offset+=r;if(c){h.push(i)}else{d.push(i);p+=i.length}}if(e===0||h._offset>=h._chunkSize){l=h._chunkSize;h._offset=0;h._buffer=y.allocUnsafe(h._chunkSize)}if(e===0){f+=u-t;u=t;if(!c)return true;var n=h._handle.write(o,s,f,u,h._buffer,h._offset,h._chunkSize);n.callback=g;n.buffer=s;return}if(!c)return false;a()}};t.inherits(c,T);t.inherits(d,T);t.inherits(p,T);t.inherits(g,T);t.inherits(w,T);t.inherits(x,T);t.inherits(_,T)}).call(this)}).call(this,E("_process"))},{"./binding":150,_process:184,assert:143,buffer:152,stream:186,util:207}],152:[function(q,t,J){(function(t){(function(){"use strict";var i=q("base64-js");var s=q("ieee754");J.Buffer=c;J.SlowBuffer=e;J.INSPECT_MAX_BYTES=50;var r=2147483647;J.kMaxLength=r;c.TYPED_ARRAY_SUPPORT=t();if(!c.TYPED_ARRAY_SUPPORT&&typeof console!=="undefined"&&typeof console.error==="function"){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.")}function t(){try{var t=new Uint8Array(1);t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}};return t.foo()===42}catch(t){return false}}Object.defineProperty(c.prototype,"parent",{enumerable:true,get:function(){if(!c.isBuffer(this))return undefined;return this.buffer}});Object.defineProperty(c.prototype,"offset",{enumerable:true,get:function(){if(!c.isBuffer(this))return undefined;return this.byteOffset}});function o(t){if(t>r){throw new RangeError('The value "'+t+'" is invalid for option "size"')}var e=new Uint8Array(t);e.__proto__=c.prototype;return e}function c(t,e,r){if(typeof t==="number"){if(typeof e==="string"){throw new TypeError('The "string" argument must be of type string. Received type number')}return l(t)}return n(t,e,r)}if(typeof Symbol!=="undefined"&&Symbol.species!=null&&c[Symbol.species]===c){Object.defineProperty(c,Symbol.species,{value:null,configurable:true,enumerable:false,writable:false})}c.poolSize=8192;function n(t,e,r){if(typeof t==="string"){return f(t,e)}if(ArrayBuffer.isView(t)){return h(t)}if(t==null){throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, "+"or Array-like Object. Received type "+typeof t)}if(K(t,ArrayBuffer)||t&&K(t.buffer,ArrayBuffer)){return d(t,e,r)}if(typeof t==="number"){throw new TypeError('The "value" argument must not be of type number. Received type number')}var i=t.valueOf&&t.valueOf();if(i!=null&&i!==t){return c.from(i,e,r)}var n=p(t);if(n)return n;if(typeof Symbol!=="undefined"&&Symbol.toPrimitive!=null&&typeof t[Symbol.toPrimitive]==="function"){return c.from(t[Symbol.toPrimitive]("string"),e,r)}throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, "+"or Array-like Object. Received type "+typeof t)}c.from=function(t,e,r){return n(t,e,r)};c.prototype.__proto__=Uint8Array.prototype;c.__proto__=Uint8Array;function a(t){if(typeof t!=="number"){throw new TypeError('"size" argument must be of type number')}else if(t<0){throw new RangeError('The value "'+t+'" is invalid for option "size"')}}function u(t,e,r){a(t);if(t<=0){return o(t)}if(e!==undefined){return typeof r==="string"?o(t).fill(e,r):o(t).fill(e)}return o(t)}c.alloc=function(t,e,r){return u(t,e,r)};function l(t){a(t);return o(t<0?0:g(t)|0)}c.allocUnsafe=function(t){return l(t)};c.allocUnsafeSlow=function(t){return l(t)};function f(t,e){if(typeof e!=="string"||e===""){e="utf8"}if(!c.isEncoding(e)){throw new TypeError("Unknown encoding: "+e)}var r=y(t,e)|0;var i=o(r);var n=i.write(t,e);if(n!==r){i=i.slice(0,n)}return i}function h(t){var e=t.length<0?0:g(t.length)|0;var r=o(e);for(var i=0;i=r){throw new RangeError("Attempt to allocate Buffer larger than maximum "+"size: 0x"+r.toString(16)+" bytes")}return t|0}function e(t){if(+t!=t){t=0}return c.alloc(+t)}c.isBuffer=function t(e){return e!=null&&e._isBuffer===true&&e!==c.prototype};c.compare=function t(e,r){if(K(e,Uint8Array))e=c.from(e,e.offset,e.byteLength);if(K(r,Uint8Array))r=c.from(r,r.offset,r.byteLength);if(!c.isBuffer(e)||!c.isBuffer(r)){throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array')}if(e===r)return 0;var i=e.length;var n=r.length;for(var s=0,o=Math.min(i,n);s2&&arguments[2]===true;if(!i&&r===0)return 0;var n=false;for(;;){switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return z(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return G(t).length;default:if(n){return i?-1:z(t).length}e=(""+e).toLowerCase();n=true}}}c.byteLength=y;function m(t,e,r){var i=false;if(e===undefined||e<0){e=0}if(e>this.length){return""}if(r===undefined||r>this.length){r=this.length}if(r<=0){return""}r>>>=0;e>>>=0;if(r<=e){return""}if(!t)t="utf8";while(true){switch(t){case"hex":return I(this,e,r);case"utf8":case"utf-8":return E(this,e,r);case"ascii":return O(this,e,r);case"latin1":case"binary":return M(this,e,r);case"base64":return A(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,e,r);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase();i=true}}}c.prototype._isBuffer=true;function b(t,e,r){var i=t[e];t[e]=t[r];t[r]=i}c.prototype.swap16=function t(){var e=this.length;if(e%2!==0){throw new RangeError("Buffer size must be a multiple of 16-bits")}for(var r=0;rr)e+=" ... ";return""};c.prototype.compare=function t(e,r,i,n,s){if(K(e,Uint8Array)){e=c.from(e,e.offset,e.byteLength)}if(!c.isBuffer(e)){throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. '+"Received type "+typeof e)}if(r===undefined){r=0}if(i===undefined){i=e?e.length:0}if(n===undefined){n=0}if(s===undefined){s=this.length}if(r<0||i>e.length||n<0||s>this.length){throw new RangeError("out of range index")}if(n>=s&&r>=i){return 0}if(n>=s){return-1}if(r>=i){return 1}r>>>=0;i>>>=0;n>>>=0;s>>>=0;if(this===e)return 0;var o=s-n;var a=i-r;var u=Math.min(o,a);var l=this.slice(n,s);var f=e.slice(r,i);for(var h=0;h2147483647){r=2147483647}else if(r<-2147483648){r=-2147483648}r=+r;if(X(r)){r=n?0:t.length-1}if(r<0)r=t.length+r;if(r>=t.length){if(n)return-1;else r=t.length-1}else if(r<0){if(n)r=0;else return-1}if(typeof e==="string"){e=c.from(e,i)}if(c.isBuffer(e)){if(e.length===0){return-1}return w(t,e,r,i,n)}else if(typeof e==="number"){e=e&255;if(typeof Uint8Array.prototype.indexOf==="function"){if(n){return Uint8Array.prototype.indexOf.call(t,e,r)}else{return Uint8Array.prototype.lastIndexOf.call(t,e,r)}}return w(t,[e],r,i,n)}throw new TypeError("val must be string, number or Buffer")}function w(t,e,r,i,n){var s=1;var o=t.length;var a=e.length;if(i!==undefined){i=String(i).toLowerCase();if(i==="ucs2"||i==="ucs-2"||i==="utf16le"||i==="utf-16le"){if(t.length<2||e.length<2){return-1}s=2;o/=2;a/=2;r/=2}}function u(t,e){if(s===1){return t[e]}else{return t.readUInt16BE(e*s)}}var l;if(n){var f=-1;for(l=r;lo)r=o-a;for(l=r;l>=0;l--){var h=true;for(var c=0;cn){i=n}}var s=e.length;if(i>s/2){i=s/2}for(var o=0;o>>0;if(isFinite(i)){i=i>>>0;if(n===undefined)n="utf8"}else{n=i;i=undefined}}else{throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported")}var s=this.length-r;if(i===undefined||i>s)i=s;if(e.length>0&&(i<0||r<0)||r>this.length){throw new RangeError("Attempt to write outside buffer bounds")}if(!n)n="utf8";var o=false;for(;;){switch(n){case"hex":return x(this,e,r,i);case"utf8":case"utf-8":return _(this,e,r,i);case"ascii":return C(this,e,r,i);case"latin1":case"binary":return T(this,e,r,i);case"base64":return S(this,e,r,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,e,r,i);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase();o=true}}};c.prototype.toJSON=function t(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function A(t,e,r){if(e===0&&r===t.length){return i.fromByteArray(t)}else{return i.fromByteArray(t.slice(e,r))}}function E(t,e,r){r=Math.min(t.length,r);var i=[];var n=e;while(n239?4:s>223?3:s>191?2:1;if(n+a<=r){var u,l,f,h;switch(a){case 1:if(s<128){o=s}break;case 2:u=t[n+1];if((u&192)===128){h=(s&31)<<6|u&63;if(h>127){o=h}}break;case 3:u=t[n+1];l=t[n+2];if((u&192)===128&&(l&192)===128){h=(s&15)<<12|(u&63)<<6|l&63;if(h>2047&&(h<55296||h>57343)){o=h}}break;case 4:u=t[n+1];l=t[n+2];f=t[n+3];if((u&192)===128&&(l&192)===128&&(f&192)===128){h=(s&15)<<18|(u&63)<<12|(l&63)<<6|f&63;if(h>65535&&h<1114112){o=h}}}}if(o===null){o=65533;a=1}else if(o>65535){o-=65536;i.push(o>>>10&1023|55296);o=56320|o&1023}i.push(o);n+=a}return R(i)}var B=4096;function R(t){var e=t.length;if(e<=B){return String.fromCharCode.apply(String,t)}var r="";var i=0;while(ii)r=i;var n="";for(var s=e;si){e=i}if(r<0){r+=i;if(r<0)r=0}else if(r>i){r=i}if(rr)throw new RangeError("Trying to access beyond buffer length")}c.prototype.readUIntLE=function t(e,r,i){e=e>>>0;r=r>>>0;if(!i)j(e,r,this.length);var n=this[e];var s=1;var o=0;while(++o>>0;r=r>>>0;if(!i){j(e,r,this.length)}var n=this[e+--r];var s=1;while(r>0&&(s*=256)){n+=this[e+--r]*s}return n};c.prototype.readUInt8=function t(e,r){e=e>>>0;if(!r)j(e,1,this.length);return this[e]};c.prototype.readUInt16LE=function t(e,r){e=e>>>0;if(!r)j(e,2,this.length);return this[e]|this[e+1]<<8};c.prototype.readUInt16BE=function t(e,r){e=e>>>0;if(!r)j(e,2,this.length);return this[e]<<8|this[e+1]};c.prototype.readUInt32LE=function t(e,r){e=e>>>0;if(!r)j(e,4,this.length);return(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};c.prototype.readUInt32BE=function t(e,r){e=e>>>0;if(!r)j(e,4,this.length);return this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};c.prototype.readIntLE=function t(e,r,i){e=e>>>0;r=r>>>0;if(!i)j(e,r,this.length);var n=this[e];var s=1;var o=0;while(++o=s)n-=Math.pow(2,8*r);return n};c.prototype.readIntBE=function t(e,r,i){e=e>>>0;r=r>>>0;if(!i)j(e,r,this.length);var n=r;var s=1;var o=this[e+--n];while(n>0&&(s*=256)){o+=this[e+--n]*s}s*=128;if(o>=s)o-=Math.pow(2,8*r);return o};c.prototype.readInt8=function t(e,r){e=e>>>0;if(!r)j(e,1,this.length);if(!(this[e]&128))return this[e];return(255-this[e]+1)*-1};c.prototype.readInt16LE=function t(e,r){e=e>>>0;if(!r)j(e,2,this.length);var i=this[e]|this[e+1]<<8;return i&32768?i|4294901760:i};c.prototype.readInt16BE=function t(e,r){e=e>>>0;if(!r)j(e,2,this.length);var i=this[e+1]|this[e]<<8;return i&32768?i|4294901760:i};c.prototype.readInt32LE=function t(e,r){e=e>>>0;if(!r)j(e,4,this.length);return this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};c.prototype.readInt32BE=function t(e,r){e=e>>>0;if(!r)j(e,4,this.length);return this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};c.prototype.readFloatLE=function t(e,r){e=e>>>0;if(!r)j(e,4,this.length);return s.read(this,e,true,23,4)};c.prototype.readFloatBE=function t(e,r){e=e>>>0;if(!r)j(e,4,this.length);return s.read(this,e,false,23,4)};c.prototype.readDoubleLE=function t(e,r){e=e>>>0;if(!r)j(e,8,this.length);return s.read(this,e,true,52,8)};c.prototype.readDoubleBE=function t(e,r){e=e>>>0;if(!r)j(e,8,this.length);return s.read(this,e,false,52,8)};function L(t,e,r,i,n,s){if(!c.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>n||et.length)throw new RangeError("Index out of range")}c.prototype.writeUIntLE=function t(e,r,i,n){e=+e;r=r>>>0;i=i>>>0;if(!n){var s=Math.pow(2,8*i)-1;L(this,e,r,i,s,0)}var o=1;var a=0;this[r]=e&255;while(++a>>0;i=i>>>0;if(!n){var s=Math.pow(2,8*i)-1;L(this,e,r,i,s,0)}var o=i-1;var a=1;this[r+o]=e&255;while(--o>=0&&(a*=256)){this[r+o]=e/a&255}return r+i};c.prototype.writeUInt8=function t(e,r,i){e=+e;r=r>>>0;if(!i)L(this,e,r,1,255,0);this[r]=e&255;return r+1};c.prototype.writeUInt16LE=function t(e,r,i){e=+e;r=r>>>0;if(!i)L(this,e,r,2,65535,0);this[r]=e&255;this[r+1]=e>>>8;return r+2};c.prototype.writeUInt16BE=function t(e,r,i){e=+e;r=r>>>0;if(!i)L(this,e,r,2,65535,0);this[r]=e>>>8;this[r+1]=e&255;return r+2};c.prototype.writeUInt32LE=function t(e,r,i){e=+e;r=r>>>0;if(!i)L(this,e,r,4,4294967295,0);this[r+3]=e>>>24;this[r+2]=e>>>16;this[r+1]=e>>>8;this[r]=e&255;return r+4};c.prototype.writeUInt32BE=function t(e,r,i){e=+e;r=r>>>0;if(!i)L(this,e,r,4,4294967295,0);this[r]=e>>>24;this[r+1]=e>>>16;this[r+2]=e>>>8;this[r+3]=e&255;return r+4};c.prototype.writeIntLE=function t(e,r,i,n){e=+e;r=r>>>0;if(!n){var s=Math.pow(2,8*i-1);L(this,e,r,i,s-1,-s)}var o=0;var a=1;var u=0;this[r]=e&255;while(++o>0)-u&255}return r+i};c.prototype.writeIntBE=function t(e,r,i,n){e=+e;r=r>>>0;if(!n){var s=Math.pow(2,8*i-1);L(this,e,r,i,s-1,-s)}var o=i-1;var a=1;var u=0;this[r+o]=e&255;while(--o>=0&&(a*=256)){if(e<0&&u===0&&this[r+o+1]!==0){u=1}this[r+o]=(e/a>>0)-u&255}return r+i};c.prototype.writeInt8=function t(e,r,i){e=+e;r=r>>>0;if(!i)L(this,e,r,1,127,-128);if(e<0)e=255+e+1;this[r]=e&255;return r+1};c.prototype.writeInt16LE=function t(e,r,i){e=+e;r=r>>>0;if(!i)L(this,e,r,2,32767,-32768);this[r]=e&255;this[r+1]=e>>>8;return r+2};c.prototype.writeInt16BE=function t(e,r,i){e=+e;r=r>>>0;if(!i)L(this,e,r,2,32767,-32768);this[r]=e>>>8;this[r+1]=e&255;return r+2};c.prototype.writeInt32LE=function t(e,r,i){e=+e;r=r>>>0;if(!i)L(this,e,r,4,2147483647,-2147483648);this[r]=e&255;this[r+1]=e>>>8;this[r+2]=e>>>16;this[r+3]=e>>>24;return r+4};c.prototype.writeInt32BE=function t(e,r,i){e=+e;r=r>>>0;if(!i)L(this,e,r,4,2147483647,-2147483648);if(e<0)e=4294967295+e+1;this[r]=e>>>24;this[r+1]=e>>>16;this[r+2]=e>>>8;this[r+3]=e&255;return r+4};function D(t,e,r,i,n,s){if(r+i>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function F(t,e,r,i,n){e=+e;r=r>>>0;if(!n){D(t,e,r,4,34028234663852886e22,-34028234663852886e22)}s.write(t,e,r,i,23,4);return r+4}c.prototype.writeFloatLE=function t(e,r,i){return F(this,e,r,true,i)};c.prototype.writeFloatBE=function t(e,r,i){return F(this,e,r,false,i)};function W(t,e,r,i,n){e=+e;r=r>>>0;if(!n){D(t,e,r,8,17976931348623157e292,-17976931348623157e292)}s.write(t,e,r,i,52,8);return r+8}c.prototype.writeDoubleLE=function t(e,r,i){return W(this,e,r,true,i)};c.prototype.writeDoubleBE=function t(e,r,i){return W(this,e,r,false,i)};c.prototype.copy=function t(e,r,i,n){if(!c.isBuffer(e))throw new TypeError("argument should be a Buffer");if(!i)i=0;if(!n&&n!==0)n=this.length;if(r>=e.length)r=e.length;if(!r)r=0;if(n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");if(n>this.length)n=this.length;if(e.length-r=0;--o){e[o+r]=this[o+i]}}else{Uint8Array.prototype.set.call(e,this.subarray(i,n),r)}return s};c.prototype.fill=function t(e,r,i,n){if(typeof e==="string"){if(typeof r==="string"){n=r;r=0;i=this.length}else if(typeof i==="string"){n=i;i=this.length}if(n!==undefined&&typeof n!=="string"){throw new TypeError("encoding must be a string")}if(typeof n==="string"&&!c.isEncoding(n)){throw new TypeError("Unknown encoding: "+n)}if(e.length===1){var s=e.charCodeAt(0);if(n==="utf8"&&s<128||n==="latin1"){e=s}}}else if(typeof e==="number"){e=e&255}if(r<0||this.length>>0;i=i===undefined?this.length:i>>>0;if(!e)e=0;var o;if(typeof e==="number"){for(o=r;o55295&&r<57344){if(!n){if(r>56319){if((e-=3)>-1)s.push(239,191,189);continue}else if(o+1===i){if((e-=3)>-1)s.push(239,191,189);continue}n=r;continue}if(r<56320){if((e-=3)>-1)s.push(239,191,189);n=r;continue}r=(n-55296<<10|r-56320)+65536}else if(n){if((e-=3)>-1)s.push(239,191,189)}n=null;if(r<128){if((e-=1)<0)break;s.push(r)}else if(r<2048){if((e-=2)<0)break;s.push(r>>6|192,r&63|128)}else if(r<65536){if((e-=3)<0)break;s.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((e-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else{throw new Error("Invalid code point")}}return s}function Y(t){var e=[];for(var r=0;r>8;n=r%256;s.push(n);s.push(i)}return s}function G(t){return i.toByteArray(N(t))}function Z(t,e,r,i){for(var n=0;n=e.length||n>=t.length)break;e[n+r]=t[n]}return n}function K(t,e){return t instanceof e||t!=null&&t.constructor!=null&&t.constructor.name!=null&&t.constructor.name===e.name}function X(t){return t!==t}}).call(this)}).call(this,q("buffer").Buffer)},{"base64-js":148,buffer:152,ieee754:164}],153:[function(t,e,r){"use strict";var n=t("get-intrinsic");var s=t("./");var o=s(n("String.prototype.indexOf"));e.exports=function t(e,r){var i=n(e,!!r);if(typeof i==="function"&&o(e,".prototype.")>-1){return s(i)}return i}},{"./":154,"get-intrinsic":160}],154:[function(t,e,r){"use strict";var n=t("function-bind");var i=t("get-intrinsic");var s=i("%Function.prototype.apply%");var o=i("%Function.prototype.call%");var a=i("%Reflect.apply%",true)||n.call(o,s);var u=i("%Object.getOwnPropertyDescriptor%",true);var l=i("%Object.defineProperty%",true);var f=i("%Math.max%");if(l){try{l({},"a",{value:1})}catch(t){l=null}}e.exports=function t(e){var r=a(n,o,arguments);if(u&&l){var i=u(r,"length");if(i.configurable){l(r,"length",{value:1+f(0,e.length-(arguments.length-1))})}}return r};var h=function t(){return a(n,s,arguments)};if(l){l(e.exports,"apply",{value:h})}else{e.exports.apply=h}},{"function-bind":159,"get-intrinsic":160}],155:[function(t,e,r){"use strict";var i=t("get-intrinsic");var n=i("%Object.getOwnPropertyDescriptor%");if(n){try{n([],"length")}catch(t){n=null}}e.exports=n},{"get-intrinsic":160}],156:[function(t,e,r){"use strict";var i=typeof Reflect==="object"?Reflect:null;var h=i&&typeof i.apply==="function"?i.apply:function t(e,r,i){return Function.prototype.apply.call(e,r,i)};var n;if(i&&typeof i.ownKeys==="function"){n=i.ownKeys}else if(Object.getOwnPropertySymbols){n=function t(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}}else{n=function t(e){return Object.getOwnPropertyNames(e)}}function u(t){if(console&&console.warn)console.warn(t)}var s=Number.isNaN||function t(e){return e!==e};function o(){o.init.call(this)}e.exports=o;e.exports.once=w;o.EventEmitter=o;o.prototype._events=undefined;o.prototype._eventsCount=0;o.prototype._maxListeners=undefined;var a=10;function l(t){if(typeof t!=="function"){throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}}Object.defineProperty(o,"defaultMaxListeners",{enumerable:true,get:function(){return a},set:function(t){if(typeof t!=="number"||t<0||s(t)){throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".")}a=t}});o.init=function(){if(this._events===undefined||this._events===Object.getPrototypeOf(this)._events){this._events=Object.create(null);this._eventsCount=0}this._maxListeners=this._maxListeners||undefined};o.prototype.setMaxListeners=function t(e){if(typeof e!=="number"||e<0||s(e)){throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".")}this._maxListeners=e;return this};function f(t){if(t._maxListeners===undefined)return o.defaultMaxListeners;return t._maxListeners}o.prototype.getMaxListeners=function t(){return f(this)};o.prototype.emit=function t(e){var r=[];for(var i=1;i0)o=r[0];if(o instanceof Error){throw o}var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));a.context=o;throw a}var u=s[e];if(u===undefined)return false;if(typeof u==="function"){h(u,this,r)}else{var l=u.length;var f=m(u,l);for(var i=0;i0&&o.length>n&&!o.warned){o.warned=true;var a=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners "+"added. Use emitter.setMaxListeners() to "+"increase limit");a.name="MaxListenersExceededWarning";a.emitter=t;a.type=e;a.count=o.length;u(a)}}return t}o.prototype.addListener=function t(e,r){return c(this,e,r,false)};o.prototype.on=o.prototype.addListener;o.prototype.prependListener=function t(e,r){return c(this,e,r,true)};function d(){if(!this.fired){this.target.removeListener(this.type,this.wrapFn);this.fired=true;if(arguments.length===0)return this.listener.call(this.target);return this.listener.apply(this.target,arguments)}}function p(t,e,r){var i={fired:false,wrapFn:undefined,target:t,type:e,listener:r};var n=d.bind(i);n.listener=r;i.wrapFn=n;return n}o.prototype.once=function t(e,r){l(r);this.on(e,p(this,e,r));return this};o.prototype.prependOnceListener=function t(e,r){l(r);this.prependListener(e,p(this,e,r));return this};o.prototype.removeListener=function t(e,r){var i,n,s,o,a;l(r);n=this._events;if(n===undefined)return this;i=n[e];if(i===undefined)return this;if(i===r||i.listener===r){if(--this._eventsCount===0)this._events=Object.create(null);else{delete n[e];if(n.removeListener)this.emit("removeListener",e,i.listener||r)}}else if(typeof i!=="function"){s=-1;for(o=i.length-1;o>=0;o--){if(i[o]===r||i[o].listener===r){a=i[o].listener;s=o;break}}if(s<0)return this;if(s===0)i.shift();else{b(i,s)}if(i.length===1)n[e]=i[0];if(n.removeListener!==undefined)this.emit("removeListener",e,a||r)}return this};o.prototype.off=o.prototype.removeListener;o.prototype.removeAllListeners=function t(e){var r,i,n;i=this._events;if(i===undefined)return this;if(i.removeListener===undefined){if(arguments.length===0){this._events=Object.create(null);this._eventsCount=0}else if(i[e]!==undefined){if(--this._eventsCount===0)this._events=Object.create(null);else delete i[e]}return this}if(arguments.length===0){var s=Object.keys(i);var o;for(n=0;n=0;n--){this.removeListener(e,r[n])}}return this};function g(t,e,r){var i=t._events;if(i===undefined)return[];var n=i[e];if(n===undefined)return[];if(typeof n==="function")return r?[n.listener||n]:[n];return r?v(n):m(n,n.length)}o.prototype.listeners=function t(e){return g(this,e,true)};o.prototype.rawListeners=function t(e){return g(this,e,false)};o.listenerCount=function(t,e){if(typeof t.listenerCount==="function"){return t.listenerCount(e)}else{return y.call(t,e)}};o.prototype.listenerCount=y;function y(t){var e=this._events;if(e!==undefined){var r=e[t];if(typeof r==="function"){return 1}else if(r!==undefined){return r.length}}return 0}o.prototype.eventNames=function t(){return this._eventsCount>0?n(this._events):[]};function m(t,e){var r=new Array(e);for(var i=0;i1&&typeof r!=="boolean"){throw new b('"allowMissing" argument must be a boolean')}var i=k(e);var n=i.length>0?i[0]:"";var s=A("%"+n+"%",r);var o=s.name;var a=s.value;var u=false;var l=s.alias;if(l){n=l[0];C(i,_([0,1],l))}for(var f=1,h=true;f=i.length){var g=v(a,c);h=!!g;if(h&&"get"in g&&!("originalValue"in g.get)){a=g.get}else{a=a[c]}}else{h=x(a,c);a=a[c]}if(h&&!u){w[o]=a}}}return a}},{"function-bind":159,has:163,"has-symbols":161}],161:[function(i,n,t){(function(t){(function(){"use strict";var e=t.Symbol;var r=i("./shams");n.exports=function t(){if(typeof e!=="function"){return false}if(typeof Symbol!=="function"){return false}if(typeof e("foo")!=="symbol"){return false}if(typeof Symbol("bar")!=="symbol"){return false}return r()}}).call(this)}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./shams":162}],162:[function(t,e,r){"use strict";e.exports=function t(){if(typeof Symbol!=="function"||typeof Object.getOwnPropertySymbols!=="function"){return false}if(typeof Symbol.iterator==="symbol"){return true}var e={};var r=Symbol("test");var i=Object(r);if(typeof r==="string"){return false}if(Object.prototype.toString.call(r)!=="[object Symbol]"){return false}if(Object.prototype.toString.call(i)!=="[object Symbol]"){return false}var n=42;e[r]=n;for(r in e){return false}if(typeof Object.keys==="function"&&Object.keys(e).length!==0){return false}if(typeof Object.getOwnPropertyNames==="function"&&Object.getOwnPropertyNames(e).length!==0){return false}var s=Object.getOwnPropertySymbols(e);if(s.length!==1||s[0]!==r){return false}if(!Object.prototype.propertyIsEnumerable.call(e,r)){return false}if(typeof Object.getOwnPropertyDescriptor==="function"){var o=Object.getOwnPropertyDescriptor(e,r);if(o.value!==n||o.enumerable!==true){return false}}return true}},{}],163:[function(t,e,r){"use strict";var i=t("function-bind");e.exports=i.call(Function.call,Object.prototype.hasOwnProperty)},{"function-bind":159}],164:[function(t,e,r){r.read=function(t,e,r,i,n){var s,o;var a=n*8-i-1;var u=(1<>1;var f=-7;var h=r?n-1:0;var c=r?-1:1;var d=t[e+h];h+=c;s=d&(1<<-f)-1;d>>=-f;f+=a;for(;f>0;s=s*256+t[e+h],h+=c,f-=8){}o=s&(1<<-f)-1;s>>=-f;f+=i;for(;f>0;o=o*256+t[e+h],h+=c,f-=8){}if(s===0){s=1-l}else if(s===u){return o?NaN:(d?-1:1)*Infinity}else{o=o+Math.pow(2,i);s=s-l}return(d?-1:1)*o*Math.pow(2,s-i)};r.write=function(t,e,r,i,n,s){var o,a,u;var l=s*8-n-1;var f=(1<>1;var c=n===23?Math.pow(2,-24)-Math.pow(2,-77):0;var d=i?0:s-1;var p=i?1:-1;var g=e<0||e===0&&1/e<0?1:0;e=Math.abs(e);if(isNaN(e)||e===Infinity){a=isNaN(e)?1:0;o=f}else{o=Math.floor(Math.log(e)/Math.LN2);if(e*(u=Math.pow(2,-o))<1){o--;u*=2}if(o+h>=1){e+=c/u}else{e+=c*Math.pow(2,1-h)}if(e*u>=2){o++;u/=2}if(o+h>=f){a=0;o=f}else if(o+h>=1){a=(e*u-1)*Math.pow(2,n);o=o+h}else{a=e*Math.pow(2,h-1)*Math.pow(2,n);o=0}}for(;n>=8;t[r+d]=a&255,d+=p,a/=256,n-=8){}o=o<0;t[r+d]=o&255,d+=p,o/=256,l-=8){}t[r+d-p]|=g*128}},{}],165:[function(t,e,r){if(typeof Object.create==="function"){e.exports=function t(e,r){if(r){e.super_=r;e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}})}}}else{e.exports=function t(e,r){if(r){e.super_=r;var i=function(){};i.prototype=r.prototype;e.prototype=new i;e.prototype.constructor=e}}}},{}],166:[function(t,e,r){"use strict";var i=typeof Symbol==="function"&&typeof Symbol.toStringTag==="symbol";var n=t("call-bind/callBound");var s=n("Object.prototype.toString");var o=function t(e){if(i&&e&&typeof e==="object"&&Symbol.toStringTag in e){return false}return s(e)==="[object Arguments]"};var a=function t(e){if(o(e)){return true}return e!==null&&typeof e==="object"&&typeof e.length==="number"&&e.length>=0&&s(e)!=="[object Array]"&&s(e.callee)==="[object Function]"};var u=function(){return o(arguments)}();o.isLegacyArguments=a;e.exports=u?o:a},{"call-bind/callBound":153}],167:[function(t,e,r){arguments[4][69][0].apply(r,arguments)},{dup:69}],168:[function(t,e,r){"use strict";var i=Object.prototype.toString;var n=Function.prototype.toString;var s=/^\s*(?:function)?\*/;var o=typeof Symbol==="function"&&typeof Symbol.toStringTag==="symbol";var a=Object.getPrototypeOf;var u=function(){if(!o){return false}try{return Function("return function*() {}")()}catch(t){}};var l=u();var f=a&&l?a(l):false;e.exports=function t(e){if(typeof e!=="function"){return false}if(s.test(n.call(e))){return true}if(!o){var r=i.call(e);return r==="[object GeneratorFunction]"}return a&&a(e)===f}},{}],169:[function(p,g,t){(function(d){(function(){"use strict";var e=p("foreach");var t=p("available-typed-arrays");var r=p("call-bind/callBound");var i=r("Object.prototype.toString");var n=p("has-symbols")();var s=n&&typeof Symbol.toStringTag==="symbol";var o=t();var a=r("Array.prototype.indexOf",true)||function t(e,r){for(var i=0;i-1}if(!f){return false}return c(e)}}).call(this)}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"available-typed-arrays":147,"call-bind/callBound":153,"es-abstract/helpers/getOwnPropertyDescriptor":155,foreach:157,"has-symbols":161}],170:[function(t,e,r){"use strict";var u=Object.getOwnPropertySymbols;var l=Object.prototype.hasOwnProperty;var f=Object.prototype.propertyIsEnumerable;function h(t){if(t===null||t===undefined){throw new TypeError("Object.assign cannot be called with null or undefined")}return Object(t)}function i(){try{if(!Object.assign){return false}var t=new String("abc");t[5]="de";if(Object.getOwnPropertyNames(t)[0]==="5"){return false}var e={};for(var r=0;r<10;r++){e["_"+String.fromCharCode(r)]=r}var i=Object.getOwnPropertyNames(e).map(function(t){return e[t]});if(i.join("")!=="0123456789"){return false}var n={};"abcdefghijklmnopqrst".split("").forEach(function(t){n[t]=t});if(Object.keys(Object.assign({},n)).join("")!=="abcdefghijklmnopqrst"){return false}return true}catch(t){return false}}e.exports=i()?Object.assign:function(t,e){var r;var i=h(t);var n;for(var s=1;s>>16&65535|0,o=0;while(r!==0){o=r>2e3?2e3:r;r-=o;do{n=n+e[i++]|0;s=s+n|0}while(--o);n%=65521;s%=65521}return n|s<<16|0}e.exports=i},{}],174:[function(t,e,r){"use strict";e.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],175:[function(t,e,r){"use strict";function i(){var t,e=[];for(var r=0;r<256;r++){t=r;for(var i=0;i<8;i++){t=t&1?3988292384^t>>>1:t>>>1}e[r]=t}return e}var a=i();function n(t,e,r,i){var n=a,s=i+r;t^=-1;for(var o=i;o>>8^n[(t^e[o])&255]}return t^-1}e.exports=n},{}],176:[function(t,e,r){"use strict";var h=t("../utils/common");var l=t("./trees");var c=t("./adler32");var f=t("./crc32");var i=t("./messages");var d=0;var p=1;var g=3;var y=4;var m=5;var b=0;var v=1;var w=-2;var n=-3;var x=-5;var u=-1;var s=1;var _=2;var C=3;var T=4;var o=0;var a=2;var S=8;var k=9;var A=15;var E=8;var B=29;var R=256;var O=R+1+B;var M=30;var I=19;var P=2*O+1;var j=15;var L=3;var D=258;var F=D+L+1;var W=32;var H=42;var N=69;var U=73;var z=91;var Y=103;var V=113;var G=666;var Z=1;var K=2;var X=3;var q=4;var J=3;function $(t,e){t.msg=i[e];return e}function Q(t){return(t<<1)-(t>4?9:0)}function tt(t){var e=t.length;while(--e>=0){t[e]=0}}function et(t){var e=t.state;var r=e.pending;if(r>t.avail_out){r=t.avail_out}if(r===0){return}h.arraySet(t.output,e.pending_buf,e.pending_out,r,t.next_out);t.next_out+=r;e.pending_out+=r;t.total_out+=r;t.avail_out-=r;e.pending-=r;if(e.pending===0){e.pending_out=0}}function rt(t,e){l._tr_flush_block(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e);t.block_start=t.strstart;et(t.strm)}function it(t,e){t.pending_buf[t.pending++]=e}function nt(t,e){t.pending_buf[t.pending++]=e>>>8&255;t.pending_buf[t.pending++]=e&255}function st(t,e,r,i){var n=t.avail_in;if(n>i){n=i}if(n===0){return 0}t.avail_in-=n;h.arraySet(e,t.input,t.next_in,n,r);if(t.state.wrap===1){t.adler=c(t.adler,e,n,r)}else if(t.state.wrap===2){t.adler=f(t.adler,e,n,r)}t.next_in+=n;t.total_in+=n;return n}function ot(t,e){var r=t.max_chain_length;var i=t.strstart;var n;var s;var o=t.prev_length;var a=t.nice_match;var u=t.strstart>t.w_size-F?t.strstart-(t.w_size-F):0;var l=t.window;var f=t.w_mask;var h=t.prev;var c=t.strstart+D;var d=l[i+o-1];var p=l[i+o];if(t.prev_length>=t.good_match){r>>=2}if(a>t.lookahead){a=t.lookahead}do{n=e;if(l[n+o]!==p||l[n+o-1]!==d||l[n]!==l[i]||l[++n]!==l[i+1]){continue}i+=2;n++;do{}while(l[++i]===l[++n]&&l[++i]===l[++n]&&l[++i]===l[++n]&&l[++i]===l[++n]&&l[++i]===l[++n]&&l[++i]===l[++n]&&l[++i]===l[++n]&&l[++i]===l[++n]&&io){t.match_start=e;o=s;if(s>=a){break}d=l[i+o-1];p=l[i+o]}}while((e=h[e&f])>u&&--r!==0);if(o<=t.lookahead){return o}return t.lookahead}function at(t){var e=t.w_size;var r,i,n,s,o;do{s=t.window_size-t.lookahead-t.strstart;if(t.strstart>=e+(e-F)){h.arraySet(t.window,t.window,e,e,0);t.match_start-=e;t.strstart-=e;t.block_start-=e;i=t.hash_size;r=i;do{n=t.head[--r];t.head[r]=n>=e?n-e:0}while(--i);i=e;r=i;do{n=t.prev[--r];t.prev[r]=n>=e?n-e:0}while(--i);s+=e}if(t.strm.avail_in===0){break}i=st(t.strm,t.window,t.strstart+t.lookahead,s);t.lookahead+=i;if(t.lookahead+t.insert>=L){o=t.strstart-t.insert;t.ins_h=t.window[o];t.ins_h=(t.ins_h<t.pending_buf_size-5){r=t.pending_buf_size-5}for(;;){if(t.lookahead<=1){at(t);if(t.lookahead===0&&e===d){return Z}if(t.lookahead===0){break}}t.strstart+=t.lookahead;t.lookahead=0;var i=t.block_start+r;if(t.strstart===0||t.strstart>=i){t.lookahead=t.strstart-i;t.strstart=i;rt(t,false);if(t.strm.avail_out===0){return Z}}if(t.strstart-t.block_start>=t.w_size-F){rt(t,false);if(t.strm.avail_out===0){return Z}}}t.insert=0;if(e===y){rt(t,true);if(t.strm.avail_out===0){return X}return q}if(t.strstart>t.block_start){rt(t,false);if(t.strm.avail_out===0){return Z}}return Z}function lt(t,e){var r;var i;for(;;){if(t.lookahead=L){t.ins_h=(t.ins_h<=L){i=l._tr_tally(t,t.strstart-t.match_start,t.match_length-L);t.lookahead-=t.match_length;if(t.match_length<=t.max_lazy_match&&t.lookahead>=L){t.match_length--;do{t.strstart++;t.ins_h=(t.ins_h<=L){t.ins_h=(t.ins_h<4096)){t.match_length=L-1}}if(t.prev_length>=L&&t.match_length<=t.prev_length){n=t.strstart+t.lookahead-L;i=l._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-L);t.lookahead-=t.prev_length-1;t.prev_length-=2;do{if(++t.strstart<=n){t.ins_h=(t.ins_h<=L&&t.strstart>0){n=t.strstart-1;i=o[n];if(i===o[++n]&&i===o[++n]&&i===o[++n]){s=t.strstart+D;do{}while(i===o[++n]&&i===o[++n]&&i===o[++n]&&i===o[++n]&&i===o[++n]&&i===o[++n]&&i===o[++n]&&i===o[++n]&&nt.lookahead){t.match_length=t.lookahead}}}if(t.match_length>=L){r=l._tr_tally(t,1,t.match_length-L);t.lookahead-=t.match_length;t.strstart+=t.match_length;t.match_length=0}else{r=l._tr_tally(t,0,t.window[t.strstart]);t.lookahead--;t.strstart++}if(r){rt(t,false);if(t.strm.avail_out===0){return Z}}}t.insert=0;if(e===y){rt(t,true);if(t.strm.avail_out===0){return X}return q}if(t.last_lit){rt(t,false);if(t.strm.avail_out===0){return Z}}return K}function ct(t,e){var r;for(;;){if(t.lookahead===0){at(t);if(t.lookahead===0){if(e===d){return Z}break}}t.match_length=0;r=l._tr_tally(t,0,t.window[t.strstart]);t.lookahead--;t.strstart++;if(r){rt(t,false);if(t.strm.avail_out===0){return Z}}}t.insert=0;if(e===y){rt(t,true);if(t.strm.avail_out===0){return X}return q}if(t.last_lit){rt(t,false);if(t.strm.avail_out===0){return Z}}return K}function dt(t,e,r,i,n){this.good_length=t;this.max_lazy=e;this.nice_length=r;this.max_chain=i;this.func=n}var pt;pt=[new dt(0,0,0,0,ut),new dt(4,4,8,4,lt),new dt(4,5,16,8,lt),new dt(4,6,32,32,lt),new dt(4,4,16,16,ft),new dt(8,16,32,32,ft),new dt(8,16,128,128,ft),new dt(8,32,128,256,ft),new dt(32,128,258,1024,ft),new dt(32,258,258,4096,ft)];function gt(t){t.window_size=2*t.w_size;tt(t.head);t.max_lazy_match=pt[t.level].max_lazy;t.good_match=pt[t.level].good_length;t.nice_match=pt[t.level].nice_length;t.max_chain_length=pt[t.level].max_chain;t.strstart=0;t.block_start=0;t.lookahead=0;t.insert=0;t.match_length=t.prev_length=L-1;t.match_available=0;t.ins_h=0}function yt(){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 h.Buf16(P*2);this.dyn_dtree=new h.Buf16((2*M+1)*2);this.bl_tree=new h.Buf16((2*I+1)*2);tt(this.dyn_ltree);tt(this.dyn_dtree);tt(this.bl_tree);this.l_desc=null;this.d_desc=null;this.bl_desc=null;this.bl_count=new h.Buf16(j+1);this.heap=new h.Buf16(2*O+1);tt(this.heap);this.heap_len=0;this.heap_max=0;this.depth=new h.Buf16(2*O+1);tt(this.depth);this.l_buf=0;this.lit_bufsize=0;this.last_lit=0;this.d_buf=0;this.opt_len=0;this.static_len=0;this.matches=0;this.insert=0;this.bi_buf=0;this.bi_valid=0}function mt(t){var e;if(!t||!t.state){return $(t,w)}t.total_in=t.total_out=0;t.data_type=a;e=t.state;e.pending=0;e.pending_out=0;if(e.wrap<0){e.wrap=-e.wrap}e.status=e.wrap?H:V;t.adler=e.wrap===2?0:1;e.last_flush=d;l._tr_init(e);return b}function bt(t){var e=mt(t);if(e===b){gt(t.state)}return e}function vt(t,e){if(!t||!t.state){return w}if(t.state.wrap!==2){return w}t.state.gzhead=e;return b}function wt(t,e,r,i,n,s){if(!t){return w}var o=1;if(e===u){e=6}if(i<0){o=0;i=-i}else if(i>15){o=2;i-=16}if(n<1||n>k||r!==S||i<8||i>15||e<0||e>9||s<0||s>T){return $(t,w)}if(i===8){i=9}var a=new yt;t.state=a;a.strm=t;a.wrap=o;a.gzhead=null;a.w_bits=i;a.w_size=1<m||e<0){return t?$(t,w):w}i=t.state;if(!t.output||!t.input&&t.avail_in!==0||i.status===G&&e!==y){return $(t,t.avail_out===0?x:w)}i.strm=t;r=i.last_flush;i.last_flush=e;if(i.status===H){if(i.wrap===2){t.adler=0;it(i,31);it(i,139);it(i,8);if(!i.gzhead){it(i,0);it(i,0);it(i,0);it(i,0);it(i,0);it(i,i.level===9?2:i.strategy>=_||i.level<2?4:0);it(i,J);i.status=V}else{it(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(!i.gzhead.extra?0:4)+(!i.gzhead.name?0:8)+(!i.gzhead.comment?0:16));it(i,i.gzhead.time&255);it(i,i.gzhead.time>>8&255);it(i,i.gzhead.time>>16&255);it(i,i.gzhead.time>>24&255);it(i,i.level===9?2:i.strategy>=_||i.level<2?4:0);it(i,i.gzhead.os&255);if(i.gzhead.extra&&i.gzhead.extra.length){it(i,i.gzhead.extra.length&255);it(i,i.gzhead.extra.length>>8&255)}if(i.gzhead.hcrc){t.adler=f(t.adler,i.pending_buf,i.pending,0)}i.gzindex=0;i.status=N}}else{var o=S+(i.w_bits-8<<4)<<8;var a=-1;if(i.strategy>=_||i.level<2){a=0}else if(i.level<6){a=1}else if(i.level===6){a=2}else{a=3}o|=a<<6;if(i.strstart!==0){o|=W}o+=31-o%31;i.status=V;nt(i,o);if(i.strstart!==0){nt(i,t.adler>>>16);nt(i,t.adler&65535)}t.adler=1}}if(i.status===N){if(i.gzhead.extra){n=i.pending;while(i.gzindex<(i.gzhead.extra.length&65535)){if(i.pending===i.pending_buf_size){if(i.gzhead.hcrc&&i.pending>n){t.adler=f(t.adler,i.pending_buf,i.pending-n,n)}et(t);n=i.pending;if(i.pending===i.pending_buf_size){break}}it(i,i.gzhead.extra[i.gzindex]&255);i.gzindex++}if(i.gzhead.hcrc&&i.pending>n){t.adler=f(t.adler,i.pending_buf,i.pending-n,n)}if(i.gzindex===i.gzhead.extra.length){i.gzindex=0;i.status=U}}else{i.status=U}}if(i.status===U){if(i.gzhead.name){n=i.pending;do{if(i.pending===i.pending_buf_size){if(i.gzhead.hcrc&&i.pending>n){t.adler=f(t.adler,i.pending_buf,i.pending-n,n)}et(t);n=i.pending;if(i.pending===i.pending_buf_size){s=1;break}}if(i.gzindexn){t.adler=f(t.adler,i.pending_buf,i.pending-n,n)}if(s===0){i.gzindex=0;i.status=z}}else{i.status=z}}if(i.status===z){if(i.gzhead.comment){n=i.pending;do{if(i.pending===i.pending_buf_size){if(i.gzhead.hcrc&&i.pending>n){t.adler=f(t.adler,i.pending_buf,i.pending-n,n)}et(t);n=i.pending;if(i.pending===i.pending_buf_size){s=1;break}}if(i.gzindexn){t.adler=f(t.adler,i.pending_buf,i.pending-n,n)}if(s===0){i.status=Y}}else{i.status=Y}}if(i.status===Y){if(i.gzhead.hcrc){if(i.pending+2>i.pending_buf_size){et(t)}if(i.pending+2<=i.pending_buf_size){it(i,t.adler&255);it(i,t.adler>>8&255);t.adler=0;i.status=V}}else{i.status=V}}if(i.pending!==0){et(t);if(t.avail_out===0){i.last_flush=-1;return b}}else if(t.avail_in===0&&Q(e)<=Q(r)&&e!==y){return $(t,x)}if(i.status===G&&t.avail_in!==0){return $(t,x)}if(t.avail_in!==0||i.lookahead!==0||e!==d&&i.status!==G){var u=i.strategy===_?ct(i,e):i.strategy===C?ht(i,e):pt[i.level].func(i,e);if(u===X||u===q){i.status=G}if(u===Z||u===X){if(t.avail_out===0){i.last_flush=-1}return b}if(u===K){if(e===p){l._tr_align(i)}else if(e!==m){l._tr_stored_block(i,0,0,false);if(e===g){tt(i.head);if(i.lookahead===0){i.strstart=0;i.block_start=0;i.insert=0}}}et(t);if(t.avail_out===0){i.last_flush=-1;return b}}}if(e!==y){return b}if(i.wrap<=0){return v}if(i.wrap===2){it(i,t.adler&255);it(i,t.adler>>8&255);it(i,t.adler>>16&255);it(i,t.adler>>24&255);it(i,t.total_in&255);it(i,t.total_in>>8&255);it(i,t.total_in>>16&255);it(i,t.total_in>>24&255)}else{nt(i,t.adler>>>16);nt(i,t.adler&65535)}et(t);if(i.wrap>0){i.wrap=-i.wrap}return i.pending!==0?b:v}function Ct(t){var e;if(!t||!t.state){return w}e=t.state.status;if(e!==H&&e!==N&&e!==U&&e!==z&&e!==Y&&e!==V&&e!==G){return $(t,w)}t.state=null;return e===V?$(t,n):b}function Tt(t,e){var r=e.length;var i;var n,s;var o;var a;var u;var l;var f;if(!t||!t.state){return w}i=t.state;o=i.wrap;if(o===2||o===1&&i.status!==H||i.lookahead){return w}if(o===1){t.adler=c(t.adler,e,r,0)}i.wrap=0;if(r>=i.w_size){if(o===0){tt(i.head);i.strstart=0;i.block_start=0;i.insert=0}f=new h.Buf8(i.w_size);h.arraySet(f,e,r-i.w_size,i.w_size,0);e=f;r=i.w_size}a=t.avail_in;u=t.next_in;l=t.input;t.avail_in=r;t.next_in=0;t.input=e;at(i);while(i.lookahead>=L){n=i.strstart;s=i.lookahead-(L-1);do{i.ins_h=(i.ins_h<>>24;p>>>=x;g-=x;x=w>>>16&255;if(x===0){A[o++]=w&65535}else if(x&16){_=w&65535;x&=15;if(x){if(g>>=x;g-=x}if(g<15){p+=k[n++]<>>24;p>>>=x;g-=x;x=w>>>16&255;if(x&16){C=w&65535;x&=15;if(gl){e.msg="invalid distance too far back";i.mode=E;break t}p>>>=x;g-=x;x=o-a;if(C>x){x=C-x;if(x>h){if(i.sane){e.msg="invalid distance too far back";i.mode=E;break t}}T=0;S=d;if(c===0){T+=f-x;if(x<_){_-=x;do{A[o++]=d[T++]}while(--x);T=o-C;S=A}}else if(c2){A[o++]=S[T++];A[o++]=S[T++];A[o++]=S[T++];_-=3}if(_){A[o++]=S[T++];if(_>1){A[o++]=S[T++]}}}else{T=o-C;do{A[o++]=A[T++];A[o++]=A[T++];A[o++]=A[T++];_-=3}while(_>2);if(_){A[o++]=A[T++];if(_>1){A[o++]=A[T++]}}}}else if((x&64)===0){w=m[(w&65535)+(p&(1<>3;n-=_;g-=_<<3;p&=(1<>>24&255)+(t>>>8&65280)+((t&65280)<<8)+((t&255)<<24)}function a(){this.mode=0;this.last=false;this.wrap=0;this.havedict=false;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 B.Buf16(320);this.work=new B.Buf16(288);this.lendyn=null;this.distdyn=null;this.sane=0;this.back=0;this.was=0}function u(t){var e;if(!t||!t.state){return z}e=t.state;t.total_in=t.total_out=e.total=0;t.msg="";if(e.wrap){t.adler=e.wrap&1}e.mode=K;e.last=0;e.havedict=0;e.dmax=32768;e.head=null;e.hold=0;e.bits=0;e.lencode=e.lendyn=new B.Buf32(i);e.distcode=e.distdyn=new B.Buf32(n);e.sane=1;e.back=-1;return H}function l(t){var e;if(!t||!t.state){return z}e=t.state;e.wsize=0;e.whave=0;e.wnext=0;return u(t)}function f(t,e){var r;var i;if(!t||!t.state){return z}i=t.state;if(e<0){r=0;e=-e}else{r=(e>>4)+1;if(e<48){e&=15}}if(e&&(e<8||e>15)){return z}if(i.window!==null&&i.wbits!==e){i.window=null}i.wrap=r;i.wbits=e;return l(t)}function h(t,e){var r;var i;if(!t){return z}i=new a;t.state=i;i.window=null;r=f(t,e);if(r!==H){t.state=null}return r}function c(t){return h(t,o)}var d=true;var p,g;function At(t){if(d){var e;p=new B.Buf32(512);g=new B.Buf32(32);e=0;while(e<144){t.lens[e++]=8}while(e<256){t.lens[e++]=9}while(e<280){t.lens[e++]=7}while(e<288){t.lens[e++]=8}I(j,t.lens,0,288,p,0,t.work,{bits:9});e=0;while(e<32){t.lens[e++]=5}I(L,t.lens,0,32,g,0,t.work,{bits:5});d=false}t.lencode=p;t.lenbits=9;t.distcode=g;t.distbits=5}function Et(t,e,r,i){var n;var s=t.state;if(s.window===null){s.wsize=1<=s.wsize){B.arraySet(s.window,e,r-s.wsize,s.wsize,0);s.wnext=0;s.whave=s.wsize}else{n=s.wsize-s.wnext;if(n>i){n=i}B.arraySet(s.window,e,r-i,n,s.wnext);i-=n;if(i){B.arraySet(s.window,e,r-i,i,0);s.wnext=i;s.whave=s.wsize}else{s.wnext+=n;if(s.wnext===s.wsize){s.wnext=0}if(s.whave>>8&255;r.check=O(r.check,S,2,0);l=0;f=0;r.mode=X;break}r.flags=0;if(r.head){r.head.done=false}if(!(r.wrap&1)||(((l&255)<<8)+(l>>8))%31){t.msg="incorrect header check";r.mode=Ct;break}if((l&15)!==Z){t.msg="unknown compression method";r.mode=Ct;break}l>>>=4;f-=4;C=(l&15)+8;if(r.wbits===0){r.wbits=C}else if(C>r.wbits){t.msg="invalid window size";r.mode=Ct;break}r.dmax=1<>8&1}if(r.flags&512){S[0]=l&255;S[1]=l>>>8&255;r.check=O(r.check,S,2,0)}l=0;f=0;r.mode=q;case q:while(f<32){if(a===0){break t}a--;l+=i[s++]<>>8&255;S[2]=l>>>16&255;S[3]=l>>>24&255;r.check=O(r.check,S,4,0)}l=0;f=0;r.mode=J;case J:while(f<16){if(a===0){break t}a--;l+=i[s++]<>8}if(r.flags&512){S[0]=l&255;S[1]=l>>>8&255;r.check=O(r.check,S,2,0)}l=0;f=0;r.mode=$;case $:if(r.flags&1024){while(f<16){if(a===0){break t}a--;l+=i[s++]<>>8&255;r.check=O(r.check,S,2,0)}l=0;f=0}else if(r.head){r.head.extra=null}r.mode=Q;case Q:if(r.flags&1024){d=r.length;if(d>a){d=a}if(d){if(r.head){C=r.head.extra_len-r.length;if(!r.head.extra){r.head.extra=new Array(r.head.extra_len)}B.arraySet(r.head.extra,i,s,d,C)}if(r.flags&512){r.check=O(r.check,i,d,s)}a-=d;s+=d;r.length-=d}if(r.length){break t}}r.length=0;r.mode=tt;case tt:if(r.flags&2048){if(a===0){break t}d=0;do{C=i[s+d++];if(r.head&&C&&r.length<65536){r.head.name+=String.fromCharCode(C)}}while(C&&d>9&1;r.head.done=true}t.adler=r.check=0;r.mode=st;break;case it:while(f<32){if(a===0){break t}a--;l+=i[s++]<>>=f&7;f-=f&7;r.mode=wt;break}while(f<3){if(a===0){break t}a--;l+=i[s++]<>>=1;f-=1;switch(l&3){case 0:r.mode=at;break;case 1:At(r);r.mode=dt;if(e===W){l>>>=2;f-=2;break t}break;case 2:r.mode=ft;break;case 3:t.msg="invalid block type";r.mode=Ct}l>>>=2;f-=2;break;case at:l>>>=f&7;f-=f&7;while(f<32){if(a===0){break t}a--;l+=i[s++]<>>16^65535)){t.msg="invalid stored block lengths";r.mode=Ct;break}r.length=l&65535;l=0;f=0;r.mode=ut;if(e===W){break t}case ut:r.mode=lt;case lt:d=r.length;if(d){if(d>a){d=a}if(d>u){d=u}if(d===0){break t}B.arraySet(n,i,s,d,o);a-=d;s+=d;u-=d;o+=d;r.length-=d;break}r.mode=st;break;case ft:while(f<14){if(a===0){break t}a--;l+=i[s++]<>>=5;f-=5;r.ndist=(l&31)+1;l>>>=5;f-=5;r.ncode=(l&15)+4;l>>>=4;f-=4;if(r.nlen>286||r.ndist>30){t.msg="too many length or distance symbols";r.mode=Ct;break}r.have=0;r.mode=ht;case ht:while(r.have>>=3;f-=3}while(r.have<19){r.lens[E[r.have++]]=0}r.lencode=r.lendyn;r.lenbits=7;k={bits:r.lenbits};T=I(P,r.lens,0,19,r.lencode,0,r.work,k);r.lenbits=k.bits;if(T){t.msg="invalid code lengths set";r.mode=Ct;break}r.have=0;r.mode=ct;case ct:while(r.have>>24;b=y>>>16&255;v=y&65535;if(m<=f){break}if(a===0){break t}a--;l+=i[s++]<>>=m;f-=m;r.lens[r.have++]=v}else{if(v===16){A=m+2;while(f>>=m;f-=m;if(r.have===0){t.msg="invalid bit length repeat";r.mode=Ct;break}C=r.lens[r.have-1];d=3+(l&3);l>>>=2;f-=2}else if(v===17){A=m+3;while(f>>=m;f-=m;C=0;d=3+(l&7);l>>>=3;f-=3}else{A=m+7;while(f>>=m;f-=m;C=0;d=11+(l&127);l>>>=7;f-=7}if(r.have+d>r.nlen+r.ndist){t.msg="invalid bit length repeat";r.mode=Ct;break}while(d--){r.lens[r.have++]=C}}}if(r.mode===Ct){break}if(r.lens[256]===0){t.msg="invalid code -- missing end-of-block";r.mode=Ct;break}r.lenbits=9;k={bits:r.lenbits};T=I(j,r.lens,0,r.nlen,r.lencode,0,r.work,k);r.lenbits=k.bits;if(T){t.msg="invalid literal/lengths set";r.mode=Ct;break}r.distbits=6;r.distcode=r.distdyn;k={bits:r.distbits};T=I(L,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,k);r.distbits=k.bits;if(T){t.msg="invalid distances set";r.mode=Ct;break}r.mode=dt;if(e===W){break t}case dt:r.mode=pt;case pt:if(a>=6&&u>=258){t.next_out=o;t.avail_out=u;t.next_in=s;t.avail_in=a;r.hold=l;r.bits=f;M(t,c);o=t.next_out;n=t.output;u=t.avail_out;s=t.next_in;i=t.input;a=t.avail_in;l=r.hold;f=r.bits;if(r.mode===st){r.back=-1}break}r.back=0;for(;;){y=r.lencode[l&(1<>>24;b=y>>>16&255;v=y&65535;if(m<=f){break}if(a===0){break t}a--;l+=i[s++]<>w)];m=y>>>24;b=y>>>16&255;v=y&65535;if(w+m<=f){break}if(a===0){break t}a--;l+=i[s++]<>>=w;f-=w;r.back+=w}l>>>=m;f-=m;r.back+=m;r.length=v;if(b===0){r.mode=vt;break}if(b&32){r.back=-1;r.mode=st;break}if(b&64){t.msg="invalid literal/length code";r.mode=Ct;break}r.extra=b&15;r.mode=gt;case gt:if(r.extra){A=r.extra;while(f>>=r.extra;f-=r.extra;r.back+=r.extra}r.was=r.length;r.mode=yt;case yt:for(;;){y=r.distcode[l&(1<>>24;b=y>>>16&255;v=y&65535;if(m<=f){break}if(a===0){break t}a--;l+=i[s++]<>w)];m=y>>>24;b=y>>>16&255;v=y&65535;if(w+m<=f){break}if(a===0){break t}a--;l+=i[s++]<>>=w;f-=w;r.back+=w}l>>>=m;f-=m;r.back+=m;if(b&64){t.msg="invalid distance code";r.mode=Ct;break}r.offset=v;r.extra=b&15;r.mode=mt;case mt:if(r.extra){A=r.extra;while(f>>=r.extra;f-=r.extra;r.back+=r.extra}if(r.offset>r.dmax){t.msg="invalid distance too far back";r.mode=Ct;break}r.mode=bt;case bt:if(u===0){break t}d=c-u;if(r.offset>d){d=r.offset-d;if(d>r.whave){if(r.sane){t.msg="invalid distance too far back";r.mode=Ct;break}}if(d>r.wnext){d-=r.wnext;p=r.wsize-d}else{p=r.wnext-d}if(d>r.length){d=r.length}g=r.window}else{g=n;p=o-r.offset;d=r.length}if(d>u){d=u}u-=d;r.length-=d;do{n[o++]=g[p++]}while(--d);if(r.length===0){r.mode=pt}break;case vt:if(u===0){break t}n[o++]=r.length;u--;r.mode=pt;break;case wt:if(r.wrap){while(f<32){if(a===0){break t}a--;l|=i[s++]<=1;d--){if(E[d]!==0){break}}if(p>d){p=d}if(d===0){s[o++]=1<<24|64<<16|0;s[o++]=1<<24|64<<16|0;u.bits=1;return 0}for(c=1;c0&&(e===W||d!==1)){return-1}B[1]=0;for(f=1;fD||e===N&&b>F){return 1}for(;;){M=f-y;if(a[h]A){I=R[O+a[h]];P=S[k+a[h]]}else{I=32+64;P=0}w=1<>y)+x]=M<<24|I<<16|P|0}while(x!==0);w=1<>=1}if(w!==0){v&=w-1;v+=w}else{v=0}h++;if(--E[f]===0){if(f===d){break}f=r[i+a[h]]}if(f>p&&(v&C)!==_){if(y===0){y=p}T+=c;g=f-y;m=1<D||e===N&&b>F){return 1}_=v&C;s[_]=p<<24|g<<16|T-o|0}}if(v!==0){s[T+v]=f-y<<24|64<<16|0}u.bits=p;return 0}},{"../utils/common":172}],180:[function(t,e,r){"use strict";e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],181:[function(t,e,r){"use strict";var n=t("../utils/common");var a=4;var i=0;var s=1;var u=2;function o(t){var e=t.length;while(--e>=0){t[e]=0}}var l=0;var f=1;var h=2;var c=3;var d=258;var p=29;var g=256;var y=g+1+p;var m=30;var b=19;var v=2*y+1;var w=15;var x=16;var _=7;var C=256;var T=16;var S=17;var k=18;var 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];var E=[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];var B=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7];var R=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];var O=512;var M=new Array((y+2)*2);o(M);var I=new Array(m*2);o(I);var P=new Array(O);o(P);var j=new Array(d-c+1);o(j);var L=new Array(p);o(L);var D=new Array(m);o(D);function F(t,e,r,i,n){this.static_tree=t;this.extra_bits=e;this.extra_base=r;this.elems=i;this.max_length=n;this.has_stree=t&&t.length}var W;var H;var N;function U(t,e){this.dyn_tree=t;this.max_code=0;this.stat_desc=e}function z(t){return t<256?P[t]:P[256+(t>>>7)]}function Y(t,e){t.pending_buf[t.pending++]=e&255;t.pending_buf[t.pending++]=e>>>8&255}function V(t,e,r){if(t.bi_valid>x-r){t.bi_buf|=e<>x-t.bi_valid;t.bi_valid+=r-x}else{t.bi_buf|=e<>>=1;r<<=1}while(--e>0);return r>>>1}function K(t){if(t.bi_valid===16){Y(t,t.bi_buf);t.bi_buf=0;t.bi_valid=0}else if(t.bi_valid>=8){t.pending_buf[t.pending++]=t.bi_buf&255;t.bi_buf>>=8;t.bi_valid-=8}}function X(t,e){var r=e.dyn_tree;var i=e.max_code;var n=e.stat_desc.static_tree;var s=e.stat_desc.has_stree;var o=e.stat_desc.extra_bits;var a=e.stat_desc.extra_base;var u=e.stat_desc.max_length;var l;var f,h;var c;var d;var p;var g=0;for(c=0;c<=w;c++){t.bl_count[c]=0}r[t.heap[t.heap_max]*2+1]=0;for(l=t.heap_max+1;lu){c=u;g++}r[f*2+1]=c;if(f>i){continue}t.bl_count[c]++;d=0;if(f>=a){d=o[f-a]}p=r[f*2];t.opt_len+=p*(c+d);if(s){t.static_len+=p*(n[f*2+1]+d)}}if(g===0){return}do{c=u-1;while(t.bl_count[c]===0){c--}t.bl_count[c]--;t.bl_count[c+1]+=2;t.bl_count[u]--;g-=2}while(g>0);for(c=u;c!==0;c--){f=t.bl_count[c];while(f!==0){h=t.heap[--l];if(h>i){continue}if(r[h*2+1]!==c){t.opt_len+=(c-r[h*2+1])*r[h*2];r[h*2+1]=c}f--}}}function q(t,e,r){var i=new Array(w+1);var n=0;var s;var o;for(s=1;s<=w;s++){i[s]=n=n+r[s-1]<<1}for(o=0;o<=e;o++){var a=t[o*2+1];if(a===0){continue}t[o*2]=Z(i[a]++,a)}}function J(){var t;var e;var r;var i;var n;var s=new Array(w+1);r=0;for(i=0;i>=7;for(;i8){Y(t,t.bi_buf)}else if(t.bi_valid>0){t.pending_buf[t.pending++]=t.bi_buf}t.bi_buf=0;t.bi_valid=0}function tt(t,e,r,i){Q(t);if(i){Y(t,r);Y(t,~r)}n.arraySet(t.pending_buf,t.window,e,r,t.pending);t.pending+=r}function et(t,e,r,i){var n=e*2;var s=r*2;return t[n]>1;o>=1;o--){rt(t,r,o)}l=s;do{o=t.heap[1];t.heap[1]=t.heap[t.heap_len--];rt(t,r,1);a=t.heap[1];t.heap[--t.heap_max]=o;t.heap[--t.heap_max]=a;r[l*2]=r[o*2]+r[a*2];t.depth[l]=(t.depth[o]>=t.depth[a]?t.depth[o]:t.depth[a])+1;r[o*2+1]=r[a*2+1]=l;t.heap[1]=l++;rt(t,r,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1];X(t,e);q(r,u,t.bl_count)}function st(t,e,r){var i;var n=-1;var s;var o=e[0*2+1];var a=0;var u=7;var l=4;if(o===0){u=138;l=3}e[(r+1)*2+1]=65535;for(i=0;i<=r;i++){s=o;o=e[(i+1)*2+1];if(++a=3;e--){if(t.bl_tree[R[e]*2+1]!==0){break}}t.opt_len+=3*(e+1)+5+5+4;return e}function ut(t,e,r,i){var n;V(t,e-257,5);V(t,r-1,5);V(t,i-4,4);for(n=0;n>>=1){if(e&1&&t.dyn_ltree[r*2]!==0){return i}}if(t.dyn_ltree[9*2]!==0||t.dyn_ltree[10*2]!==0||t.dyn_ltree[13*2]!==0){return s}for(r=32;r0){if(t.strm.data_type===u){t.strm.data_type=lt(t)}nt(t,t.l_desc);nt(t,t.d_desc);o=at(t);n=t.opt_len+3+7>>>3;s=t.static_len+3+7>>>3;if(s<=n){n=s}}else{n=s=r+5}if(r+4<=n&&e!==-1){ct(t,e,r,i)}else if(t.strategy===a||s===n){V(t,(f<<1)+(i?1:0),3);it(t,M,I)}else{V(t,(h<<1)+(i?1:0),3);ut(t,t.l_desc.max_code+1,t.d_desc.max_code+1,o+1);it(t,t.dyn_ltree,t.dyn_dtree)}$(t);if(i){Q(t)}}function gt(t,e,r){t.pending_buf[t.d_buf+t.last_lit*2]=e>>>8&255;t.pending_buf[t.d_buf+t.last_lit*2+1]=e&255;t.pending_buf[t.l_buf+t.last_lit]=r&255;t.last_lit++;if(e===0){t.dyn_ltree[r*2]++}else{t.matches++;e--;t.dyn_ltree[(j[r]+g+1)*2]++;t.dyn_dtree[z(e)*2]++}return t.last_lit===t.lit_bufsize-1}r._tr_init=ht;r._tr_stored_block=ct;r._tr_flush_block=pt;r._tr_tally=gt;r._tr_align=dt},{"../utils/common":172}],182:[function(t,e,r){"use strict";function i(){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}e.exports=i},{}],183:[function(t,e,r){(function(a){(function(){"use strict";function g(t){if(typeof t!=="string"){throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}}function o(t,e){var r="";var i=0;var n=-1;var s=0;var o;for(var a=0;a<=t.length;++a){if(a2){var u=r.lastIndexOf("/");if(u!==r.length-1){if(u===-1){r="";i=0}else{r=r.slice(0,u);i=r.length-1-r.lastIndexOf("/")}n=a;s=0;continue}}else if(r.length===2||r.length===1){r="";i=0;n=a;s=0;continue}}if(e){if(r.length>0)r+="/..";else r="..";i=2}}else{if(r.length>0)r+="/"+t.slice(n+1,a);else r=t.slice(n+1,a);i=a-n-1}n=a;s=0}else if(o===46&&s!==-1){++s}else{s=-1}}return r}function r(t,e){var r=e.dir||e.root;var i=e.base||(e.name||"")+(e.ext||"");if(!r){return i}if(r===e.root){return r+i}return r+t+i}var y={resolve:function t(){var e="";var r=false;var i;for(var n=arguments.length-1;n>=-1&&!r;n--){var s;if(n>=0)s=arguments[n];else{if(i===undefined)i=a.cwd();s=i}g(s);if(s.length===0){continue}e=s+"/"+e;r=s.charCodeAt(0)===47}e=o(e,!r);if(r){if(e.length>0)return"/"+e;else return"/"}else if(e.length>0){return e}else{return"."}},normalize:function t(e){g(e);if(e.length===0)return".";var r=e.charCodeAt(0)===47;var i=e.charCodeAt(e.length-1)===47;e=o(e,!r);if(e.length===0&&!r)e=".";if(e.length>0&&i)e+="/";if(r)return"/"+e;return e},isAbsolute:function t(e){g(e);return e.length>0&&e.charCodeAt(0)===47},join:function t(){if(arguments.length===0)return".";var e;for(var r=0;r0){if(e===undefined)e=i;else e+="/"+i}}if(e===undefined)return".";return y.normalize(e)},relative:function t(e,r){g(e);g(r);if(e===r)return"";e=y.resolve(e);r=y.resolve(r);if(e===r)return"";var i=1;for(;il){if(r.charCodeAt(o+h)===47){return r.slice(o+h+1)}else if(h===0){return r.slice(o+h)}}else if(s>l){if(e.charCodeAt(i+h)===47){f=h}else if(h===0){f=0}}break}var c=e.charCodeAt(i+h);var d=r.charCodeAt(o+h);if(c!==d)break;else if(c===47)f=h}var p="";for(h=i+f+1;h<=n;++h){if(h===n||e.charCodeAt(h)===47){if(p.length===0)p+="..";else p+="/.."}}if(p.length>0)return p+r.slice(o+f);else{o+=f;if(r.charCodeAt(o)===47)++o;return r.slice(o)}},_makeLong:function t(e){return e},dirname:function t(e){g(e);if(e.length===0)return".";var r=e.charCodeAt(0);var i=r===47;var n=-1;var s=true;for(var o=e.length-1;o>=1;--o){r=e.charCodeAt(o);if(r===47){if(!s){n=o;break}}else{s=false}}if(n===-1)return i?"/":".";if(i&&n===1)return"//";return e.slice(0,n)},basename:function t(e,r){if(r!==undefined&&typeof r!=="string")throw new TypeError('"ext" argument must be a string');g(e);var i=0;var n=-1;var s=true;var o;if(r!==undefined&&r.length>0&&r.length<=e.length){if(r.length===e.length&&r===e)return"";var a=r.length-1;var u=-1;for(o=e.length-1;o>=0;--o){var l=e.charCodeAt(o);if(l===47){if(!s){i=o+1;break}}else{if(u===-1){s=false;u=o+1}if(a>=0){if(l===r.charCodeAt(a)){if(--a===-1){n=o}}else{a=-1;n=u}}}}if(i===n)n=u;else if(n===-1)n=e.length;return e.slice(i,n)}else{for(o=e.length-1;o>=0;--o){if(e.charCodeAt(o)===47){if(!s){i=o+1;break}}else if(n===-1){s=false;n=o+1}}if(n===-1)return"";return e.slice(i,n)}},extname:function t(e){g(e);var r=-1;var i=0;var n=-1;var s=true;var o=0;for(var a=e.length-1;a>=0;--a){var u=e.charCodeAt(a);if(u===47){if(!s){i=a+1;break}continue}if(n===-1){s=false;n=a+1}if(u===46){if(r===-1)r=a;else if(o!==1)o=1}else if(r!==-1){o=-1}}if(r===-1||n===-1||o===0||o===1&&r===n-1&&r===i+1){return""}return e.slice(r,n)},format:function t(e){if(e===null||typeof e!=="object"){throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e)}return r("/",e)},parse:function t(e){g(e);var r={root:"",dir:"",base:"",ext:"",name:""};if(e.length===0)return r;var i=e.charCodeAt(0);var n=i===47;var s;if(n){r.root="/";s=1}else{s=0}var o=-1;var a=0;var u=-1;var l=true;var f=e.length-1;var h=0;for(;f>=s;--f){i=e.charCodeAt(f);if(i===47){if(!l){a=f+1;break}continue}if(u===-1){l=false;u=f+1}if(i===46){if(o===-1)o=f;else if(h!==1)h=1}else if(o!==-1){h=-1}}if(o===-1||u===-1||h===0||h===1&&o===u-1&&o===a+1){if(u!==-1){if(a===0&&n)r.base=r.name=e.slice(1,u);else r.base=r.name=e.slice(a,u)}}else{if(a===0&&n){r.name=e.slice(1,o);r.base=e.slice(1,u)}else{r.name=e.slice(a,o);r.base=e.slice(a,u)}r.ext=e.slice(o,u)}if(a>0)r.dir=e.slice(0,a-1);else if(n)r.dir="/";return r},sep:"/",delimiter:":",win32:null,posix:null};y.posix=y;e.exports=y}).call(this)}).call(this,t("_process"))},{_process:184}],184:[function(t,e,r){var i=e.exports={};var n;var s;function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}(function(){try{if(typeof setTimeout==="function"){n=setTimeout}else{n=o}}catch(t){n=o}try{if(typeof clearTimeout==="function"){s=clearTimeout}else{s=a}}catch(t){s=a}})();function u(e){if(n===setTimeout){return setTimeout(e,0)}if((n===o||!n)&&setTimeout){n=setTimeout;return 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 l(e){if(s===clearTimeout){return clearTimeout(e)}if((s===a||!s)&&clearTimeout){s=clearTimeout;return clearTimeout(e)}try{return s(e)}catch(t){try{return s.call(null,e)}catch(t){return s.call(this,e)}}}var f=[];var h=false;var c;var d=-1;function p(){if(!h||!c){return}h=false;if(c.length){f=c.concat(f)}else{d=-1}if(f.length){g()}}function g(){if(h){return}var t=u(p);h=true;var e=f.length;while(e){c=f;f=[];while(++d1){for(var r=1;r2){return"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]}else if(r===2){return"one of ".concat(e," ").concat(t[0]," or ").concat(t[1])}else{return"of ".concat(e," ").concat(t[0])}}else{return"of ".concat(e," ").concat(String(t))}}function u(t,e,r){return t.substr(!r||r<0?0:+r,e.length)===e}function l(t,e,r){if(r===undefined||r>t.length){r=t.length}return t.substring(r-e.length,r)===e}function f(t,e,r){if(typeof r!=="number"){r=0}if(r+e.length>t.length){return false}else{return t.indexOf(e,r)!==-1}}i("ERR_INVALID_OPT_VALUE",function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'},TypeError);i("ERR_INVALID_ARG_TYPE",function(t,e,r){var i;if(typeof e==="string"&&u(e,"not ")){i="must not be";e=e.replace(/^not /,"")}else{i="must be"}var n;if(l(t," argument")){n="The ".concat(t," ").concat(i," ").concat(a(e,"type"))}else{var s=f(t,".")?"property":"argument";n='The "'.concat(t,'" ').concat(s," ").concat(i," ").concat(a(e,"type"))}n+=". Received type ".concat(typeof r);return n},TypeError);i("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");i("ERR_METHOD_NOT_IMPLEMENTED",function(t){return"The "+t+" method is not implemented"});i("ERR_STREAM_PREMATURE_CLOSE","Premature close");i("ERR_STREAM_DESTROYED",function(t){return"Cannot call "+t+" after a stream was destroyed"});i("ERR_MULTIPLE_CALLBACK","Callback called multiple times");i("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");i("ERR_STREAM_WRITE_AFTER_END","write after end");i("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);i("ERR_UNKNOWN_ENCODING",function(t){return"Unknown encoding: "+t},TypeError);i("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");e.exports.codes=o},{}],188:[function(f,h,t){(function(l){(function(){"use strict";var t=Object.keys||function(t){var e=[];for(var r in t){e.push(r)}return e};h.exports=o;var e=f("./_stream_readable");var r=f("./_stream_writable");f("inherits")(o,e);{var i=t(r.prototype);for(var n=0;n0){if(typeof e!=="string"&&!s.objectMode&&Object.getPrototypeOf(e)!==a.prototype){e=u(e)}if(i){if(s.endEmitted)_(t,new b);else E(t,s,e,true)}else if(s.ended){_(t,new p)}else if(s.destroyed){return false}else{s.reading=false;if(s.decoder&&!r){e=s.decoder.write(e);if(s.objectMode||e.length!==0)E(t,s,e,false);else L(t,s)}else{E(t,s,e,false)}}}else if(!i){s.reading=false;L(t,s)}}return!s.ended&&(s.length=R){t=R}else{t--;t|=t>>>1;t|=t>>>2;t|=t>>>4;t|=t>>>8;t|=t>>>16;t++}return t}function M(t,e){if(t<=0||e.length===0&&e.ended)return 0;if(e.objectMode)return 1;if(t!==t){if(e.flowing&&e.length)return e.buffer.head.data.length;else return e.length}if(t>e.highWaterMark)e.highWaterMark=O(t);if(t<=e.length)return t;if(!e.ended){e.needReadable=true;return 0}return e.length}k.prototype.read=function(t){m("read",t);t=parseInt(t,10);var e=this._readableState;var r=t;if(t!==0)e.emittedReadable=false;if(t===0&&e.needReadable&&((e.highWaterMark!==0?e.length>=e.highWaterMark:e.length>0)||e.ended)){m("read: emitReadable",e.length,e.ended);if(e.length===0&&e.ended)V(this);else P(this);return null}t=M(t,e);if(t===0&&e.ended){if(e.length===0)V(this);return null}var i=e.needReadable;m("need readable",i);if(e.length===0||e.length-t0)n=Y(t,e);else n=null;if(n===null){e.needReadable=e.length<=e.highWaterMark;t=0}else{e.length-=t;e.awaitDrain=0}if(e.length===0){if(!e.ended)e.needReadable=true;if(r!==t&&e.ended)V(this)}if(n!==null)this.emit("data",n);return n};function I(t,e){m("onEofChunk");if(e.ended)return;if(e.decoder){var r=e.decoder.end();if(r&&r.length){e.buffer.push(r);e.length+=e.objectMode?1:r.length}}e.ended=true;if(e.sync){P(t)}else{e.needReadable=false;if(!e.emittedReadable){e.emittedReadable=true;j(t)}}}function P(t){var e=t._readableState;m("emitReadable",e.needReadable,e.emittedReadable);e.needReadable=false;if(!e.emittedReadable){m("emitReadable",e.flowing);e.emittedReadable=true;K.nextTick(j,t)}}function j(t){var e=t._readableState;m("emitReadable_",e.destroyed,e.length,e.ended);if(!e.destroyed&&(e.length||e.ended)){t.emit("readable");e.emittedReadable=false}e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark;z(t)}function L(t,e){if(!e.readingMore){e.readingMore=true;K.nextTick(D,t,e)}}function D(t,e){while(!e.reading&&!e.ended&&(e.length1&&Z(n.pipes,r)!==-1)&&!l){m("false write response, pause",n.awaitDrain);n.awaitDrain++}i.pause()}}function c(t){m("onerror",t);g();r.removeListener("error",c);if(y(r,"error")===0)_(r,t)}T(r,"error",c);function d(){r.removeListener("finish",p);g()}r.once("close",d);function p(){m("onfinish");r.removeListener("close",d);g()}r.once("finish",p);function g(){m("unpipe");i.unpipe(r)}r.emit("pipe",i);if(!n.flowing){m("pipe resume");i.resume()}return r};function F(r){return function t(){var e=r._readableState;m("pipeOnDrain",e.awaitDrain);if(e.awaitDrain)e.awaitDrain--;if(e.awaitDrain===0&&y(r,"data")){e.flowing=true;z(r)}}}k.prototype.unpipe=function(t){var e=this._readableState;var r={hasUnpiped:false};if(e.pipesCount===0)return this;if(e.pipesCount===1){if(t&&t!==e.pipes)return this;if(!t)t=e.pipes;e.pipes=null;e.pipesCount=0;e.flowing=false;if(t)t.emit("unpipe",this,r);return this}if(!t){var i=e.pipes;var n=e.pipesCount;e.pipes=null;e.pipesCount=0;e.flowing=false;for(var s=0;s0;if(i.flowing!==false)this.resume()}else if(t==="readable"){if(!i.endEmitted&&!i.readableListening){i.readableListening=i.needReadable=true;i.flowing=false;i.emittedReadable=false;m("on readable",i.length,i.reading);if(i.length){P(this)}else if(!i.reading){K.nextTick(H,this)}}}return r};k.prototype.addListener=k.prototype.on;k.prototype.removeListener=function(t,e){var r=n.prototype.removeListener.call(this,t,e);if(t==="readable"){K.nextTick(W,this)}return r};k.prototype.removeAllListeners=function(t){var e=n.prototype.removeAllListeners.apply(this,arguments);if(t==="readable"||t===undefined){K.nextTick(W,this)}return e};function W(t){var e=t._readableState;e.readableListening=t.listenerCount("readable")>0;if(e.resumeScheduled&&!e.paused){e.flowing=true}else if(t.listenerCount("data")>0){t.resume()}}function H(t){m("readable nexttick read 0");t.read(0)}k.prototype.resume=function(){var t=this._readableState;if(!t.flowing){m("resume");t.flowing=!t.readableListening;N(this,t)}t.paused=false;return this};function N(t,e){if(!e.resumeScheduled){e.resumeScheduled=true;K.nextTick(U,t,e)}}function U(t,e){m("resume",e.reading);if(!e.reading){t.read(0)}e.resumeScheduled=false;t.emit("resume");z(t);if(e.flowing&&!e.reading)t.read(0)}k.prototype.pause=function(){m("call pause flowing=%j",this._readableState.flowing);if(this._readableState.flowing!==false){m("pause");this._readableState.flowing=false;this.emit("pause")}this._readableState.paused=true;return this};function z(t){var e=t._readableState;m("flow",e.flowing);while(e.flowing&&t.read()!==null){}}k.prototype.wrap=function(r){var i=this;var n=this._readableState;var s=false;r.on("end",function(){m("wrapped end");if(n.decoder&&!n.ended){var t=n.decoder.end();if(t&&t.length)i.push(t)}i.push(null)});r.on("data",function(t){m("wrapped data");if(n.decoder)t=n.decoder.write(t);if(n.objectMode&&(t===null||t===undefined))return;else if(!n.objectMode&&(!t||!t.length))return;var e=i.push(t);if(!e){s=true;r.pause()}});for(var t in r){if(this[t]===undefined&&typeof r[t]==="function"){this[t]=function t(e){return function t(){return r[e].apply(r,arguments)}}(t)}}for(var e=0;e=e.length){if(e.decoder)r=e.buffer.join("");else if(e.buffer.length===1)r=e.buffer.first();else r=e.buffer.concat(e.length);e.buffer.clear()}else{r=e.buffer.consume(t,e.decoder)}return r}function V(t){var e=t._readableState;m("endReadable",e.endEmitted);if(!e.endEmitted){e.ended=true;K.nextTick(G,e,t)}}function G(t,e){m("endReadableNT",t.endEmitted,t.length);if(!t.endEmitted&&t.length===0){t.endEmitted=true;e.readable=false;e.emit("end");if(t.autoDestroy){var r=e._writableState;if(!r||r.autoDestroy&&r.finished){e.destroy()}}}}if(typeof Symbol==="function"){k.from=function(t,e){if(x===undefined){x=q("./internal/streams/from")}return x(k,t,e)}}function Z(t,e){for(var r=0,i=t.length;r-1))throw new w(e);this._writableState.defaultEncoding=e;return this};Object.defineProperty(S.prototype,"writableBuffer",{enumerable:false,get:function t(){return this._writableState&&this._writableState.getBuffer()}});function E(t,e,r){if(!t.objectMode&&t.decodeStrings!==false&&typeof e==="string"){e=o.from(e,r)}return e}Object.defineProperty(S.prototype,"writableHighWaterMark",{enumerable:false,get:function t(){return this._writableState.highWaterMark}});function B(t,e,r,i,n,s){if(!r){var o=E(e,i,n);if(i!==o){r=true;n="buffer";i=o}}var a=e.objectMode?1:i.length;e.length+=a;var u=e.length0)this.tail.next=r;else this.head=r;this.tail=r;++this.length}},{key:"unshift",value:function t(e){var r={data:e,next:this.head};if(this.length===0)this.tail=r;this.head=r;++this.length}},{key:"shift",value:function t(){if(this.length===0)return;var e=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;--this.length;return e}},{key:"clear",value:function t(){this.head=this.tail=null;this.length=0}},{key:"join",value:function t(e){if(this.length===0)return"";var r=this.head;var i=""+r.data;while(r=r.next){i+=e+r.data}return i}},{key:"concat",value:function t(e){if(this.length===0)return f.alloc(0);var r=f.allocUnsafe(e>>>0);var i=this.head;var n=0;while(i){p(i.data,r,n);n+=i.data.length;i=i.next}return r}},{key:"consume",value:function t(e,r){var i;if(es.length?s.length:e;if(o===s.length)n+=s;else n+=s.slice(0,e);e-=o;if(e===0){if(o===s.length){++i;if(r.next)this.head=r.next;else this.head=this.tail=null}else{this.head=r;r.data=s.slice(o)}break}++i}this.length-=i;return n}},{key:"_getBuffer",value:function t(e){var r=f.allocUnsafe(e);var i=this.head;var n=1;i.data.copy(r);e-=i.data.length;while(i=i.next){var s=i.data;var o=e>s.length?s.length:e;s.copy(r,r.length-e,0,o);e-=o;if(e===0){if(o===s.length){++n;if(i.next)this.head=i.next;else this.head=this.tail=null}else{this.head=i;i.data=s.slice(o)}break}++n}this.length-=n;return r}},{key:d,value:function t(e,r){return c(this,n({},r,{depth:0,customInspect:false}))}}]);return t}()},{buffer:152,util:149}],195:[function(t,i,e){(function(u){(function(){"use strict";function t(t,e){var r=this;var i=this._readableState&&this._readableState.destroyed;var n=this._writableState&&this._writableState.destroyed;if(i||n){if(e){e(t)}else if(t){if(!this._writableState){u.nextTick(a,this,t)}else if(!this._writableState.errorEmitted){this._writableState.errorEmitted=true;u.nextTick(a,this,t)}}return this}if(this._readableState){this._readableState.destroyed=true}if(this._writableState){this._writableState.destroyed=true}this._destroy(t||null,function(t){if(!e&&t){if(!r._writableState){u.nextTick(s,r,t)}else if(!r._writableState.errorEmitted){r._writableState.errorEmitted=true;u.nextTick(s,r,t)}else{u.nextTick(o,r)}}else if(e){u.nextTick(o,r);e(t)}else{u.nextTick(o,r)}});return this}function s(t,e){a(t,e);o(t)}function o(t){if(t._writableState&&!t._writableState.emitClose)return;if(t._readableState&&!t._readableState.emitClose)return;t.emit("close")}function e(){if(this._readableState){this._readableState.destroyed=false;this._readableState.reading=false;this._readableState.ended=false;this._readableState.endEmitted=false}if(this._writableState){this._writableState.destroyed=false;this._writableState.ended=false;this._writableState.ending=false;this._writableState.finalCalled=false;this._writableState.prefinished=false;this._writableState.finished=false;this._writableState.errorEmitted=false}}function a(t,e){t.emit("error",e)}function r(t,e){var r=t._readableState;var i=t._writableState;if(r&&r.autoDestroy||i&&i.autoDestroy)t.destroy(e);else t.emit("error",e)}i.exports={destroy:t,undestroy:e,errorOrDestroy:r}}).call(this)}).call(this,t("_process"))},{_process:184}],196:[function(t,e,r){"use strict";var d=t("../../../errors").codes.ERR_STREAM_PREMATURE_CLOSE;function p(i){var n=false;return function(){if(n)return;n=true;for(var t=arguments.length,e=new Array(t),r=0;r0;return h(t,r,i,function(t){if(!o)o=t;if(t)a.forEach(c);if(r)return;a.forEach(c);s(o)})});return n.reduce(d)}t.exports=s},{"../../../errors":187,"./end-of-stream":196}],199:[function(t,e,r){"use strict";var o=t("../../../errors").codes.ERR_INVALID_OPT_VALUE;function a(t,e,r){return t.highWaterMark!=null?t.highWaterMark:e?t[r]:null}function i(t,e,r,i){var n=a(e,i,r);if(n!=null){if(!(isFinite(n)&&Math.floor(n)===n)||n<0){var s=i?r:"highWaterMark";throw new o(s,n)}return Math.floor(n)}return t.objectMode?16:16*1024}e.exports={getHighWaterMark:i}},{"../../../errors":187}],200:[function(t,e,r){e.exports=t("events").EventEmitter},{events:156}],201:[function(t,e,r){"use strict";var i=t("safe-buffer").Buffer;var n=i.isEncoding||function(t){t=""+t;switch(t&&t.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 true;default:return false}};function s(t){if(!t)return"utf8";var e;while(true){switch(t){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 t;default:if(e)return;t=(""+t).toLowerCase();e=true}}}function o(t){var e=s(t);if(typeof e!=="string"&&(i.isEncoding===n||!n(t)))throw new Error("Unknown encoding: "+t);return e||t}r.StringDecoder=a;function a(t){this.encoding=o(t);var e;switch(this.encoding){case"utf16le":this.text=p;this.end=g;e=4;break;case"utf8":this.fillLast=h;e=4;break;case"base64":this.text=y;this.end=m;e=3;break;default:this.write=b;this.end=v;return}this.lastNeed=0;this.lastTotal=0;this.lastChar=i.allocUnsafe(e)}a.prototype.write=function(t){if(t.length===0)return"";var e;var r;if(this.lastNeed){e=this.fillLast(t);if(e===undefined)return"";r=this.lastNeed;this.lastNeed=0}else{r=0}if(r>5===6)return 2;else if(t>>4===14)return 3;else if(t>>3===30)return 4;return t>>6===2?-1:-2}function l(t,e,r){var i=e.length-1;if(i=0){if(n>0)t.lastNeed=n-1;return n}if(--i=0){if(n>0)t.lastNeed=n-2;return n}if(--i=0){if(n>0){if(n===2)n=0;else t.lastNeed=n-3}return n}return 0}function f(t,e,r){if((e[0]&192)!==128){t.lastNeed=0;return"�"}if(t.lastNeed>1&&e.length>1){if((e[1]&192)!==128){t.lastNeed=1;return"�"}if(t.lastNeed>2&&e.length>2){if((e[2]&192)!==128){t.lastNeed=2;return"�"}}}}function h(t){var e=this.lastTotal-this.lastNeed;var r=f(this,t,e);if(r!==undefined)return r;if(this.lastNeed<=t.length){t.copy(this.lastChar,e,0,this.lastNeed);return this.lastChar.toString(this.encoding,0,this.lastTotal)}t.copy(this.lastChar,e,0,t.length);this.lastNeed-=t.length}function c(t,e){var r=l(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var i=t.length-(r-this.lastNeed);t.copy(this.lastChar,0,i);return t.toString("utf8",e,i)}function d(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed)return e+"�";return e}function p(t,e){if((t.length-e)%2===0){var r=t.toString("utf16le",e);if(r){var i=r.charCodeAt(r.length-1);if(i>=55296&&i<=56319){this.lastNeed=2;this.lastTotal=4;this.lastChar[0]=t[t.length-2];this.lastChar[1]=t[t.length-1];return r.slice(0,-1)}}return r}this.lastNeed=1;this.lastTotal=2;this.lastChar[0]=t[t.length-1];return t.toString("utf16le",e,t.length-1)}function g(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function y(t,e){var r=(t.length-e)%3;if(r===0)return t.toString("base64",e);this.lastNeed=3-r;this.lastTotal=3;if(r===1){this.lastChar[0]=t[t.length-1]}else{this.lastChar[0]=t[t.length-2];this.lastChar[1]=t[t.length-1]}return t.toString("base64",e,t.length-r)}function m(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed)return e+this.lastChar.toString("base64",0,3-this.lastNeed);return e}function b(t){return t.toString(this.encoding)}function v(t){return t&&t.length?this.write(t):""}},{"safe-buffer":185}],202:[function(u,t,l){(function(i,a){(function(){var t=u("process/browser.js").nextTick;var e=Function.prototype.apply;var n=Array.prototype.slice;var s={};var o=0;l.setTimeout=function(){return new r(e.call(setTimeout,window,arguments),clearTimeout)};l.setInterval=function(){return new r(e.call(setInterval,window,arguments),clearInterval)};l.clearTimeout=l.clearInterval=function(t){t.close()};function r(t,e){this._id=t;this._clearFn=e}r.prototype.unref=r.prototype.ref=function(){};r.prototype.close=function(){this._clearFn.call(window,this._id)};l.enroll=function(t,e){clearTimeout(t._idleTimeoutId);t._idleTimeout=e};l.unenroll=function(t){clearTimeout(t._idleTimeoutId);t._idleTimeout=-1};l._unrefActive=l.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;if(t>=0){e._idleTimeoutId=setTimeout(function t(){if(e._onTimeout)e._onTimeout()},t)}};l.setImmediate=typeof i==="function"?i:function(e){var r=o++;var i=arguments.length<2?false:n.call(arguments,1);s[r]=true;t(function t(){if(s[r]){if(i){e.apply(null,i)}else{e.call(null)}l.clearImmediate(r)}});return r};l.clearImmediate=typeof a==="function"?a:function(t){delete s[t]}}).call(this)}).call(this,u("timers").setImmediate,u("timers").clearImmediate)},{"process/browser.js":184,timers:202}],203:[function(t,e,r){r.isatty=function(){return false};function i(){throw new Error("tty.ReadStream is not implemented")}r.ReadStream=i;function n(){throw new Error("tty.WriteStream is not implemented")}r.WriteStream=n},{}],204:[function(t,e,r){(function(r){(function(){e.exports=t;function t(t,e){if(n("noDeprecation")){return t}var r=false;function i(){if(!r){if(n("throwDeprecation")){throw new Error(e)}else if(n("traceDeprecation")){console.trace(e)}else{console.warn(e)}r=true}return t.apply(this,arguments)}return i}function n(t){try{if(!r.localStorage)return false}catch(t){return false}var e=r.localStorage[t];if(null==e)return false;return String(e).toLowerCase()==="true"}}).call(this)}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],205:[function(t,e,r){arguments[4][145][0].apply(r,arguments)},{dup:145}],206:[function(t,e,r){"use strict";var i=t("is-arguments");var n=t("is-generator-function");var s=t("which-typed-array");var o=t("is-typed-array");function a(t){return t.call.bind(t)}var u=typeof BigInt!=="undefined";var l=typeof Symbol!=="undefined";var f=a(Object.prototype.toString);var h=a(Number.prototype.valueOf);var c=a(String.prototype.valueOf);var d=a(Boolean.prototype.valueOf);if(u){var p=a(BigInt.prototype.valueOf)}if(l){var g=a(Symbol.prototype.valueOf)}function y(t,e){if(typeof t!=="object"){return false}try{e(t);return true}catch(t){return false}}r.isArgumentsObject=i;r.isGeneratorFunction=n;r.isTypedArray=o;function m(t){return typeof Promise!=="undefined"&&t instanceof Promise||t!==null&&typeof t==="object"&&typeof t.then==="function"&&typeof t.catch==="function"}r.isPromise=m;function b(t){if(typeof ArrayBuffer!=="undefined"&&ArrayBuffer.isView){return ArrayBuffer.isView(t)}return o(t)||N(t)}r.isArrayBufferView=b;function v(t){return s(t)==="Uint8Array"}r.isUint8Array=v;function w(t){return s(t)==="Uint8ClampedArray"}r.isUint8ClampedArray=w;function x(t){return s(t)==="Uint16Array"}r.isUint16Array=x;function _(t){return s(t)==="Uint32Array"}r.isUint32Array=_;function C(t){return s(t)==="Int8Array"}r.isInt8Array=C;function T(t){return s(t)==="Int16Array"}r.isInt16Array=T;function S(t){return s(t)==="Int32Array"}r.isInt32Array=S;function k(t){return s(t)==="Float32Array"}r.isFloat32Array=k;function A(t){return s(t)==="Float64Array"}r.isFloat64Array=A;function E(t){return s(t)==="BigInt64Array"}r.isBigInt64Array=E;function B(t){return s(t)==="BigUint64Array"}r.isBigUint64Array=B;function R(t){return f(t)==="[object Map]"}R.working=typeof Map!=="undefined"&&R(new Map);function O(t){if(typeof Map==="undefined"){return false}return R.working?R(t):t instanceof Map}r.isMap=O;function M(t){return f(t)==="[object Set]"}M.working=typeof Set!=="undefined"&&M(new Set);function I(t){if(typeof Set==="undefined"){return false}return M.working?M(t):t instanceof Set}r.isSet=I;function P(t){return f(t)==="[object WeakMap]"}P.working=typeof WeakMap!=="undefined"&&P(new WeakMap);function j(t){if(typeof WeakMap==="undefined"){return false}return P.working?P(t):t instanceof WeakMap}r.isWeakMap=j;function L(t){return f(t)==="[object WeakSet]"}L.working=typeof WeakSet!=="undefined"&&L(new WeakSet);function D(t){return L(t)}r.isWeakSet=D;function F(t){return f(t)==="[object ArrayBuffer]"}F.working=typeof ArrayBuffer!=="undefined"&&F(new ArrayBuffer);function W(t){if(typeof ArrayBuffer==="undefined"){return false}return F.working?F(t):t instanceof ArrayBuffer}r.isArrayBuffer=W;function H(t){return f(t)==="[object DataView]"}H.working=typeof ArrayBuffer!=="undefined"&&typeof DataView!=="undefined"&&H(new DataView(new ArrayBuffer(1),0,1));function N(t){if(typeof DataView==="undefined"){return false}return H.working?H(t):t instanceof DataView}r.isDataView=N;function U(t){return f(t)==="[object SharedArrayBuffer]"}U.working=typeof SharedArrayBuffer!=="undefined"&&U(new SharedArrayBuffer);function z(t){if(typeof SharedArrayBuffer==="undefined"){return false}return U.working?U(t):t instanceof SharedArrayBuffer}r.isSharedArrayBuffer=z;function Y(t){return f(t)==="[object AsyncFunction]"}r.isAsyncFunction=Y;function V(t){return f(t)==="[object Map Iterator]"}r.isMapIterator=V;function G(t){return f(t)==="[object Set Iterator]"}r.isSetIterator=G;function Z(t){return f(t)==="[object Generator]"}r.isGeneratorObject=Z;function K(t){return f(t)==="[object WebAssembly.Module]"}r.isWebAssemblyCompiledModule=K;function X(t){return y(t,h)}r.isNumberObject=X;function q(t){return y(t,c)}r.isStringObject=q;function J(t){return y(t,d)}r.isBooleanObject=J;function $(t){return u&&y(t,p)}r.isBigIntObject=$;function Q(t){return l&&y(t,g)}r.isSymbolObject=Q;function tt(t){return X(t)||q(t)||J(t)||$(t)||Q(t)}r.isBoxedPrimitive=tt;function et(t){return typeof Uint8Array!=="undefined"&&(W(t)||z(t))}r.isAnyArrayBuffer=et;["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(t){Object.defineProperty(r,t,{enumerable:false,value:function(){throw new Error(t+" is not supported in userland")}})})},{"is-arguments":166,"is-generator-function":168,"is-typed-array":169,"which-typed-array":208}],207:[function(F,t,W){(function(D){(function(){var r=Object.getOwnPropertyDescriptors||function t(e){var r=Object.keys(e);var i={};for(var n=0;n=n)return t;switch(t){case"%s":return String(i[r++]);case"%d":return Number(i[r++]);case"%j":try{return JSON.stringify(i[r++])}catch(t){return"[Circular]"}default:return t}});for(var o=i[r];r=3)r.depth=arguments[2];if(arguments.length>=4)r.colors=arguments[3];if(o(e)){r.showHidden=e}else if(e){W._extend(r,e)}if(_(r.showHidden))r.showHidden=false;if(_(r.depth))r.depth=2;if(_(r.colors))r.colors=false;if(_(r.customInspect))r.customInspect=true;if(r.colors)r.stylize=n;return p(r,t,r.depth)}W.inspect=u;u.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]};u.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function n(t,e){var r=u.styles[e];if(r){return"["+u.colors[r][0]+"m"+t+"["+u.colors[r][1]+"m"}else{return t}}function s(t,e){return t}function d(t){var r={};t.forEach(function(t,e){r[t]=true});return r}function p(e,r,i){if(e.customInspect&&r&&A(r.inspect)&&r.inspect!==W.inspect&&!(r.constructor&&r.constructor.prototype===r)){var t=r.inspect(i,e);if(!x(t)){t=p(e,t,i)}return t}var n=g(e,r);if(n){return n}var s=Object.keys(r);var o=d(s);if(e.showHidden){s=Object.getOwnPropertyNames(r)}if(k(r)&&(s.indexOf("message")>=0||s.indexOf("description")>=0)){return y(r)}if(s.length===0){if(A(r)){var a=r.name?": "+r.name:"";return e.stylize("[Function"+a+"]","special")}if(C(r)){return e.stylize(RegExp.prototype.toString.call(r),"regexp")}if(S(r)){return e.stylize(Date.prototype.toString.call(r),"date")}if(k(r)){return y(r)}}var u="",l=false,f=["{","}"];if(w(r)){l=true;f=["[","]"]}if(A(r)){var h=r.name?": "+r.name:"";u=" [Function"+h+"]"}if(C(r)){u=" "+RegExp.prototype.toString.call(r)}if(S(r)){u=" "+Date.prototype.toUTCString.call(r)}if(k(r)){u=" "+y(r)}if(s.length===0&&(!l||r.length==0)){return f[0]+u+f[1]}if(i<0){if(C(r)){return e.stylize(RegExp.prototype.toString.call(r),"regexp")}else{return e.stylize("[Object]","special")}}e.seen.push(r);var c;if(l){c=m(e,r,i,o,s)}else{c=s.map(function(t){return b(e,r,i,o,t,l)})}e.seen.pop();return v(c,u,f)}function g(t,e){if(_(e))return t.stylize("undefined","undefined");if(x(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}if(h(e))return t.stylize(""+e,"number");if(o(e))return t.stylize(""+e,"boolean");if(l(e))return t.stylize("null","null")}function y(t){return"["+Error.prototype.toString.call(t)+"]"}function m(e,r,i,n,t){var s=[];for(var o=0,a=r.length;o-1){if(s){a=a.split("\n").map(function(t){return" "+t}).join("\n").substr(2)}else{a="\n"+a.split("\n").map(function(t){return" "+t}).join("\n")}}}else{a=t.stylize("[Circular]","special")}}if(_(o)){if(s&&n.match(/^\d+$/)){return a}o=JSON.stringify(""+n);if(o.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)){o=o.substr(1,o.length-2);o=t.stylize(o,"name")}else{o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'");o=t.stylize(o,"string")}}return o+": "+a}function v(t,e,r){var i=0;var n=t.reduce(function(t,e){i++;if(e.indexOf("\n")>=0)i++;return t+e.replace(/\u001b\[\d\d?m/g,"").length+1},0);if(n>60){return r[0]+(e===""?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1]}return r[0]+e+" "+t.join(", ")+" "+r[1]}W.types=F("./support/types");function w(t){return Array.isArray(t)}W.isArray=w;function o(t){return typeof t==="boolean"}W.isBoolean=o;function l(t){return t===null}W.isNull=l;function f(t){return t==null}W.isNullOrUndefined=f;function h(t){return typeof t==="number"}W.isNumber=h;function x(t){return typeof t==="string"}W.isString=x;function c(t){return typeof t==="symbol"}W.isSymbol=c;function _(t){return t===void 0}W.isUndefined=_;function C(t){return T(t)&&B(t)==="[object RegExp]"}W.isRegExp=C;W.types.isRegExp=C;function T(t){return typeof t==="object"&&t!==null}W.isObject=T;function S(t){return T(t)&&B(t)==="[object Date]"}W.isDate=S;W.types.isDate=S;function k(t){return T(t)&&(B(t)==="[object Error]"||t instanceof Error)}W.isError=k;W.types.isNativeError=k;function A(t){return typeof t==="function"}W.isFunction=A;function E(t){return t===null||typeof t==="boolean"||typeof t==="number"||typeof t==="string"||typeof t==="symbol"||typeof t==="undefined"}W.isPrimitive=E;W.isBuffer=F("./support/isBuffer");function B(t){return Object.prototype.toString.call(t)}function R(t){return t<10?"0"+t.toString(10):t.toString(10)}var O=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function M(){var t=new Date;var e=[R(t.getHours()),R(t.getMinutes()),R(t.getSeconds())].join(":");return[t.getDate(),O[t.getMonth()],e].join(" ")}W.log=function(){console.log("%s - %s",M(),W.format.apply(W,arguments))};W.inherits=F("inherits");W._extend=function(t,e){if(!e||!T(e))return t;var r=Object.keys(e);var i=r.length;while(i--){t[r[i]]=e[r[i]]}return t};function I(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var P=typeof Symbol!=="undefined"?Symbol("util.promisify.custom"):undefined;W.promisify=function t(s){if(typeof s!=="function")throw new TypeError('The "original" argument must be of type Function');if(P&&s[P]){var e=s[P];if(typeof e!=="function"){throw new TypeError('The "util.promisify.custom" argument must be of type Function')}Object.defineProperty(e,P,{value:e,enumerable:false,writable:false,configurable:true});return e}function e(){var r,i;var t=new Promise(function(t,e){r=t;i=e});var e=[];for(var n=0;nl.chroma(t.code));i=16;for(r=0;r>=-2;r--){if(r>0){o="!".repeat(r)}else if(r<0){o="~".repeat(-r)}else{o=""}for(e=2;e>=-3;e--){if(e>0){a="+".repeat(e)}else if(e<0){a="-".repeat(-e)}else{a=""}u=o+a;for(t=0;t<12;t++){s=this.clStep(n[t],r,e);this.addColor(i,s,this.adaptivePaletteDef[t].names,"@",u);i++}}}};o.prototype.generateExtra=function(){if(this.system){return}var t,e;e=232;for(t=0;t<13&&t{var e=i+t.replace(/-/g,"")+n;t=i+t+n;this.colorIndex[t]=r;if(e!==t){this.colorIndex[e]=r}})};const f=1.1;o.prototype.clStep=function(t,e,r,i=true){var n,s,o,a,u,l;if(!e&&!r){return t}n=t.get("hcl.c");s=t.get("hcl.l");n*=(e>0?1.6:1.7)**e;s*=(r>0?1.2:1.35)**r;t=t.set("hcl.c",n).set("hcl.l",s);if(!i||!t.clipped){return t}l=Math.abs(r)>=e;for(;;){o=t._rgb._unclipped;o.length=3;if(o.every(t=>t>-5&&t<260)){return t}u=[...o].sort();if(u[2]>=256){a=(u[0]+u[1]+u[2])/3;if(l){n=t.get("hcl.c");n/=f;t=t.set("hcl.c",n)}else{s=t.get("hcl.l");s/=f;t=t.set("hcl.l",s)}if(a>255){return t}}else if(u[1]<0){a=(u[0]+u[1]+u[2])/3;if(l){n=t.get("hcl.c");n/=f;t=t.set("hcl.c",n)}else{s=t.get("hcl.l");s*=f;t=t.set("hcl.l",s)}if(a<0){return t}}else{return t}}}},{"./termkit.js":55}],2:[function(t,e,r){"use strict";const s=t("./termkit.js");function d(t,e,r,i){var n=t;this.xmin=0;this.xmax=0;this.ymin=0;this.ymax=0;this.width=0;this.height=0;this.isNull=true;if(n&&(typeof n==="object"||typeof n==="function")){if(n instanceof s.Terminal){this.set({xmin:1,ymin:1,xmax:n.width,ymax:n.height})}else if(n instanceof s.ScreenBuffer){this.set({xmin:0,ymin:0,xmax:n.width-1,ymax:n.height-1})}else if(n instanceof s.TextBuffer){this.set({xmin:0,ymin:0,xmax:n.width-1,ymax:n.height-1})}else if(n instanceof d){this.set(n)}else if(n.xmin!==undefined||n.ymin!==undefined||n.xmax!==undefined||n.ymax!==undefined){this.set({xmin:n.xmin!==undefined?n.xmin:0,ymin:n.ymin!==undefined?n.ymin:0,xmax:n.xmax!==undefined?n.xmax:1,ymax:n.ymax!==undefined?n.ymax:1})}else if(n.x!==undefined||n.y!==undefined||n.width!==undefined||n.height!==undefined){this.set({xmin:n.x!==undefined?n.x:0,ymin:n.y!==undefined?n.y:0,xmax:n.width!==undefined?n.x+n.width-1:1,ymax:n.height!==undefined?n.y+n.height-1:1})}}else{this.set({xmin:t!==undefined?t:0,ymin:e!==undefined?e:0,xmax:r!==undefined?r:1,ymax:i!==undefined?i:1})}}e.exports=d;d.create=(...t)=>new d(...t);d.prototype.set=function(t){if(t.xmin!==undefined){this.xmin=Math.floor(t.xmin)}if(t.xmax!==undefined){this.xmax=Math.floor(t.xmax)}if(t.ymin!==undefined){this.ymin=Math.floor(t.ymin)}if(t.ymax!==undefined){this.ymax=Math.floor(t.ymax)}this.width=this.xmax-this.xmin+1;this.height=this.ymax-this.ymin+1;this.isNull=this.xmin>this.xmax||this.ymin>this.ymax};d.prototype.setSize=function(t){if(t.width!==undefined){this.width=Math.floor(t.width);this.xmax=this.xmin+this.width-1}if(t.height!==undefined){this.height=Math.floor(t.height);this.ymax=this.ymin+this.height-1}this.isNull=this.xmin>this.xmax||this.ymin>this.ymax};d.prototype.isInside=function(t,e){return t>=this.xmin&&t<=this.xmax&&e>=this.ymin&&e<=this.ymax};d.prototype.clip=function(t,e,r,i){var n=this;e=e||0;r=r||0;n.set({xmin:Math.max(n.xmin,t.xmin-e),ymin:Math.max(n.ymin,t.ymin-r),xmax:Math.min(n.xmax,t.xmax-e),ymax:Math.min(n.ymax,t.ymax-r)});if(i){t.set({xmin:Math.max(t.xmin,n.xmin+e),ymin:Math.max(t.ymin,n.ymin+r),xmax:Math.min(t.xmax,n.xmax+e),ymax:Math.min(t.ymax,n.ymax+r)})}return this};d.prototype.merge=function(t){this.set({xmin:Math.min(this.xmin,t.xmin),ymin:Math.min(this.ymin,t.ymin),xmax:Math.max(this.xmax,t.xmax),ymax:Math.max(this.ymax,t.ymax)});return this};d.wrappingRect=function(t){var e=[],r,i,n,s;r={srcRect:new d(t.srcRect),dstRect:new d(t.dstRect),offsetX:t.offsetX,offsetY:t.offsetY};if(t.wrapOnly!=="y"){r.offsetX=r.offsetX%t.dstRect.width;if(r.offsetX<0){r.offsetX+=t.dstRect.width}}if(t.wrapOnly!=="x"){r.offsetY=r.offsetY%t.dstRect.height;if(r.offsetY<0){r.offsetY+=t.dstRect.height}}r.srcRect.clip(r.dstRect,r.offsetX,r.offsetY,true);if(!r.srcRect.isNull){e.push(r)}if(r.srcRect.width=0;i--){s=t.srcClipRect.ymin+i;a=t.dstClipRect.ymin+i;e({context:t.context,srcXmin:t.srcClipRect.xmin,srcXmax:t.srcClipRect.xmax,srcY:s,srcStart:(s*t.srcRect.width+t.srcClipRect.xmin)*t.multiply,srcEnd:(s*t.srcRect.width+t.srcClipRect.xmax+1)*t.multiply,dstXmin:t.dstClipRect.xmin,dstXmax:t.dstClipRect.xmax,dstY:a,dstStart:(a*t.dstRect.width+t.dstClipRect.xmin)*t.multiply,dstEnd:(a*t.dstRect.width+t.dstClipRect.xmax+1)*t.multiply})}break;case"cell":for(i=0;inew d(...t);const p=r("./termkit.js");const h=p.Rect;d.createFromString=function(t,e){var r,i,n,s,o,a,u,l,f;if(!t){t={}}if(typeof e!=="string"){if(!e.toString){throw new Error("[terminal] ScreenBuffer.createFromDataString(): argument #1 should be a string or provide a .toString() method.")}e=e.toString()}e=p.stripControlChars(e,true).split("\n");a=0;u=e.length;s=t.attr!==undefined?t.attr:d.prototype.DEFAULT_ATTR;if(s&&typeof s==="object"&&!s.BYTES_PER_ELEMENT){s=d.object2attr(s)}o=s;if(t.transparencyChar){if(!t.transparencyType){o|=S}else{o|=t.transparencyType&S}}for(i=0;ia){a=l}}f=new d({width:a,height:u});for(i=0;i{var e,r,i,n,s=m.unicode.toArray(t),o,a=s.length;for(o=0;o=0&&h+e*(d||1)=0&&c=0&&h=0&&c=this.width){h=0;c++}}}};if(!u.markup){s(r)}else{const o=this.attr2object(this.DEFAULT_ATTR);const a=this.attr2object(i);let e=false;let t=null;switch(u.markup){case"ansi":t=m.ansi.parse(r);break;case"legacyAnsi":t=m.ansi.parse(r);e=true;break;case true:t=this.parseMarkup(r);break}t.forEach(t=>{n=Object.assign({},t.specialReset?o:a,t);delete n.text;if(n.defaultColor&&n.color){delete n.defaultColor}if(n.bgDefaultColor&&n.bgColor){delete n.bgDefaultColor}g=this.object2attr(n,undefined,e);if(t.text){s(t.text)}})}this.cx=h;this.cy=c;return g};d.prototype.get=function(t){var e,r,i;if(!t){t={}}e=t.x!==undefined?t.x:this.cx;r=t.y!==undefined?t.y:this.cy;if(typeof e!=="number"||e<0||e>=this.width){return null}e=Math.floor(e);if(typeof r!=="number"||r<0||r>=this.height){return null}r=Math.floor(r);i=(r*this.width+e)*this.ITEM_SIZE;return{attr:this.attr2object(this.readAttr(this.buffer,i)),char:this.readChar(this.buffer,i)}};d.prototype.resize=function(t){t=new h(t);var e=-t.xmin,r=-t.ymin;var i=new h({xmin:0,ymin:0,xmax:t.width-1,ymax:t.height-1});t.clip(new h(this));if(i.isNull){return false}var n=I.allocUnsafe(i.width*i.height*this.ITEM_SIZE);this.fill({buffer:n});h.regionIterator({type:"line",context:{srcBuffer:this.buffer,dstBuffer:n},dstRect:i,dstClipRect:new h(i),srcRect:new h(this),srcClipRect:t,offsetX:e,offsetY:r,multiply:this.ITEM_SIZE},this.blitterLineIterator.bind(this));this.width=i.width;this.height=i.height;this.buffer=n;this.lastBuffer=null;this.emit("resize",this.width,this.height);return true};d.prototype.draw=function(t){if(!t||typeof t!=="object"){t={}}var e={dst:t.dst||this.dst,inline:t.inline!==undefined?!!t.inline:this.inline,offsetX:t.x!==undefined?Math.floor(t.x):Math.floor(this.x),offsetY:t.y!==undefined?Math.floor(t.y):Math.floor(this.y),dstClipRect:t.dstClipRect?new h(t.dstClipRect):undefined,srcClipRect:t.srcClipRect?new h(t.srcClipRect):undefined,delta:t.delta,blending:t.blending!==undefined?t.blending:this.blending,wrap:t.wrap,tile:t.tile};if(e.dst instanceof d){return this.blitter(e)}else if(e.dst instanceof p.Terminal){return this.terminalBlitter(e)}};d.prototype.moveTo=function(t,e){this.cx=Math.max(0,Math.min(t,this.width-1));this.cy=Math.max(0,Math.min(e,this.height-1))};d.prototype.drawCursor=function(t){if(!t||typeof t!=="object"){t={}}var e=t.dst||this.dst;if(e instanceof d){if(this.ch){e.ch=true}else{e.ch=false;e.moveTo(this.cx+this.x,this.cy+this.y)}}else if(e instanceof p.Terminal){if(this.ch){if(this.ch!==this.lastCh){e.hideCursor()}}else{if(this.ch!==this.lastCh){e.hideCursor(false)}e.moveTo(Math.max(1,Math.min(this.cx+this.x,e.width)),Math.max(1,Math.min(this.cy+this.y,e.height)))}this.lastCh=this.ch}};d.prototype.blitter=function(t){var e,r,i;e={type:"line",context:{srcBuffer:this.buffer,dstBuffer:t.dst.buffer,blending:t.blending},dstRect:new h(t.dst),srcRect:new h(this),dstClipRect:t.dstClipRect||new h(t.dst),srcClipRect:t.srcClipRect||new h(this),offsetX:t.offsetX,offsetY:t.offsetY,wrap:t.wrap,tile:t.tile,multiply:this.ITEM_SIZE};r="regionIterator";i=this.blitterLineIterator.bind(this);if(t.blending){e.type="cell";i=this.blitterCellBlendingIterator.bind(this)}if(t.wrap){r="wrapIterator"}else if(t.tile){r="tileIterator"}else{r="regionIterator"}h[r](e,i)};d.prototype.blitterLineIterator=function(t){if(t.dstStart>=this.ITEM_SIZE){this.removeLeadingFullWidth(t.context.dstBuffer,t.dstStart-this.ITEM_SIZE)}t.context.srcBuffer.copy(t.context.dstBuffer,t.dstStart,t.srcStart,t.srcEnd);this.removeLeadingFullWidth(t.context.dstBuffer,t.dstEnd-this.ITEM_SIZE);if(t.dstEnd=this.ITEM_SIZE){this.removeLeadingFullWidth(t.context.dstBuffer,t.dstStart-this.ITEM_SIZE)}if(t.endOfBlitLine&&t.dstEndO){t.context.rawTerm(t.context.sequence);t.context.sequence="";t.context.writes++}};d.prototype.terminalBlitterCellIterator=function(t){var e=this.readAttr(t.context.srcBuffer,t.srcStart);if(t.context.srcLastBuffer){if(e===this.readAttr(t.context.srcLastBuffer,t.srcStart)&&this.readChar(t.context.srcBuffer,t.srcStart)===this.readChar(t.context.srcLastBuffer,t.srcStart)){return}t.context.srcBuffer.copy(t.context.srcLastBuffer,t.srcStart,t.srcStart,t.srcEnd)}if((e&S)===S||e&E){return}t.context.cells++;if(t.dstX!==t.context.cx||t.dstY!==t.context.cy){t.context.sequence+=t.context.term.optimized.moveTo(t.dstX,t.dstY);t.context.moves++}if((e&n)!==(t.context.lastAttr&n)){t.context.sequence+=t.context.lastAttr===null||!t.context.deltaEscapeSequence?this.generateEscapeSequence(t.context.term,e):this.generateDeltaEscapeSequence(t.context.term,e,t.context.lastAttr);t.context.lastAttr=e;t.context.attrs++}t.context.sequence+=this.readChar(t.context.srcBuffer,t.srcStart);if(t.context.sequence.length>O){t.context.rawTerm(t.context.sequence);t.context.sequence="";t.context.writes++}t.context.cy=t.dstY;if(e&s){t.context.cx=t.dstX+2;return true}t.context.cx=t.dstX+1};d.fromNdarrayImage=function(t,e){var r=e.terminal||p.terminal;var i,n=t.shape[0],s,o=Math.ceil(t.shape[1]/2),a=t.shape[2]===4,u=r.support["256colors"]?255:15,l,f,h={};var c=new d({width:n,height:o,blending:true,noFill:true});for(i=0;ithis.CHAR_SIZE){return"\0"}return t.toString("utf8",e,e+r)};d.prototype.writeChar=function(t,e,r){return t.write(e,r+this.ATTR_SIZE,this.CHAR_SIZE)};d.prototype.generateEscapeSequence=function(t,e){var r=this.palette||t.palette;var i=t.optimized.styleReset+(e&k?t.optimized.defaultColor:r.escape[e&255])+(e&A?t.optimized.bgDefaultColor:r.bgEscape[e>>>8&255]);if(e&f){i+=t.optimized.bold}if(e&c){i+=t.optimized.dim}if(e&g){i+=t.optimized.italic}if(e&y){i+=t.optimized.underline}if(e&b){i+=t.optimized.blink}if(e&v){i+=t.optimized.inverse}if(e&w){i+=t.optimized.hidden}if(e&x){i+=t.optimized.strike}return i};d.prototype.generateDeltaEscapeSequence=function(t,e,r){var i=this.palette||t.palette;var n="",s=e&255,o=r&255,a=e>>>8&255,u=r>>>8&255;if(e&k){if(!(r&k)){n+=t.optimized.defaultColor}}else if(s!==o||r&k){n+=i.escape[s]}if(e&A){if(!(r&A)){n+=t.optimized.bgDefaultColor}}else if(a!==u||r&A){n+=i.bgEscape[a]}if((e&l)!==(r&l)){if((e&_)!==(r&_)){if(r&f&&!(e&f)||r&c&&!(e&c)){n+=t.optimized.noBold;if(e&f){n+=t.optimized.bold}if(e&c){n+=t.optimized.dim}}else{if(e&f&&!(r&f)){n+=t.optimized.bold}if(e&c&&!(r&c)){n+=t.optimized.dim}}}if((e&g)!==(r&g)){n+=e&g?t.optimized.italic:t.optimized.noItalic}if((e&y)!==(r&y)){n+=e&y?t.optimized.underline:t.optimized.noUnderline}if((e&b)!==(r&b)){n+=e&b?t.optimized.blink:t.optimized.noBlink}if((e&v)!==(r&v)){n+=e&v?t.optimized.inverse:t.optimized.noInverse}if((e&w)!==(r&w)){n+=e&w?t.optimized.hidden:t.optimized.noHidden}if((e&x)!==(r&x)){n+=e&x?t.optimized.strike:t.optimized.noStrike}}return n};d.prototype.vScroll=function(t,e,r,i,n){if(!t){return}if(typeof e==="boolean"){n=e;e=r=i=undefined}if(e===undefined||e===null){e=this.DEFAULT_ATTR}else if(e&&typeof e==="object"&&!e.BYTES_PER_ELEMENT){e=this.object2attr(e)}if(r===undefined||r===null){r=0;i=this.height-1}else{if(r<0){r=0}if(i>this.height-1){i=this.height-1}}var s=t*this.width*this.ITEM_SIZE,o=r*this.width*this.ITEM_SIZE,a=(i+1)*this.width*this.ITEM_SIZE;if(s>0){this.buffer.copy(this.buffer,o+s,o,a-s);this.fill({start:o,end:o+s})}else{this.buffer.copy(this.buffer,o,o-s,a);this.fill({start:a+s,end:a})}if(n&&this.dst instanceof p.Terminal){if(this.lastBufferUpToDate&&this.lastBuffer){if(s>0){this.lastBuffer.copy(this.lastBuffer,o+s,o,a-s);this.fill({buffer:this.lastBuffer,start:o,end:o+s})}else{this.lastBuffer.copy(this.lastBuffer,o,o-s,a);this.fill({buffer:this.lastBuffer,start:a+s,end:a})}}this.dst.scrollingRegion(this.y+r,this.y+i);if(t>0){this.dst.scrollDown(t)}else{this.dst.scrollUp(-t)}this.dst.resetScrollingRegion()}};d.prototype.copyRegion=function(t,e,r,i){var n=new h(this),s=new h(t),o=new h(e);o.setSize(s);s.clip(n);o.clip(n);if(s.isNull){return}if(!o.isNull){h.regionIterator({type:o.ymin-s.ymin>0?"reversedLine":"line",context:{srcBuffer:this.buffer,dstBuffer:this.buffer},srcRect:new h(this),srcClipRect:s,dstRect:new h(this),dstClipRect:o,offsetX:o.xmin-s.xmin,offsetY:o.ymin-s.ymin,multiply:this.ITEM_SIZE},this.blitterLineIterator.bind(this))}if(r){throw new Error("Move is not coded ATM")}};d.attr2object=function(t){var e={};if(t&k){e.color=0;e.defaultColor=true}else{e.color=t&255}if(t&A){e.bgColor=0;e.bgDefaultColor=true}else{e.bgColor=t>>>8&255}if(t&f){e.bold=true}if(t&c){e.dim=true}if(t&g){e.italic=true}if(t&y){e.underline=true}if(t&b){e.blink=true}if(t&v){e.inverse=true}if(t&w){e.hidden=true}if(t&x){e.strike=true}if(t&a){e.fgTransparency=true}if(t&u){e.bgTransparency=true}if(t&C){e.styleTransparency=true}if(t&T){e.charTransparency=true}if((t&S)===S){e.transparency=true}return e};d.prototype.attr2object=d.attr2object;d.object2attr=function(t,e,r=false){var i=0,n=false,s=false;if(!t||typeof t!=="object"){t={}}e=e||p.colorNameToIndex;if(t.bold){if(r){n=true}else{i|=f}}if(t.dim){i|=c}if(t.italic){i|=g}if(t.underline){i|=y}if(t.blink){if(r){s=true}else{i|=b}}if(t.inverse){i|=v}if(t.hidden){i|=w}if(t.strike){i|=x}if(typeof t.color==="string"){if(t.color==="default"){t.color=0;t.defaultColor=true}else{t.color=e(t.color)}}if(typeof t.color!=="number"||t.color<0||t.color>255){t.color=0;t.defaultColor=true}else{t.color=Math.floor(t.color);if(r&&t.color<=15){if(n&&t.color<=7){t.color+=8}else if(!n&&t.color>=8){t.color-=8}}}i+=t.color;if(typeof t.bgColor==="string"){if(t.bgColor==="default"){t.bgColor=0;t.bgDefaultColor=true}else{t.bgColor=e(t.bgColor)}}if(typeof t.bgColor!=="number"||t.bgColor<0||t.bgColor>255){t.bgColor=0;t.bgDefaultColor=true}else{t.bgColor=Math.floor(t.bgColor);if(r&&t.bgColor<=15){if(s&&t.bgColor<=7){t.bgColor+=8}else if(!s&&t.bgColor>=8){t.bgColor-=8}}}i+=t.bgColor<<8;if(t.defaultColor){i|=k}if(t.bgDefaultColor){i|=A}if(t.transparency){i|=S}if(t.fgTransparency){i|=a}if(t.bgTransparency){i|=u}if(t.styleTransparency){i|=C}if(t.charTransparency){i|=T}return i};d.prototype.object2attr=function(t,e=this.palette&&this.palette.colorNameToIndex,r=false){return d.object2attr(t,e,r)};d.attrAndObject=function(t,e,r){if(!e||typeof e!=="object"){return t}r=r||p.colorNameToIndex;if(e.defaultColor||e.color==="default"){t-=t&255;t|=k}else if(typeof e.color==="string"){t=t-(t&255)+r(e.color);if(t&k){t^=k}}else if(typeof e.color==="number"&&e.color>=0&&e.color<=255){t=t-(t&255)+e.color;if(t&k){t^=k}}if(e.bgDefaultColor||e.bgColor==="default"){t-=(t>>>8&255)<<8;t|=A}else if(typeof e.bgColor==="string"){t=t-((t>>>8&255)<<8)+(r(e.bgColor)<<8);if(t&A){t^=A}}else if(typeof e.bgColor==="number"&&e.bgColor>=0&&e.bgColor<=255){t=t-((t>>>8&255)<<8)+(e.bgColor<<8);if(t&A){t^=A}}if(e.bold===true){t|=f}else if(e.bold===false){t&=~f}if(e.dim===true){t|=c}else if(e.dim===false){t&=~c}if(e.italic===true){t|=g}else if(e.italic===false){t&=~g}if(e.underline===true){t|=y}else if(e.underline===false){t&=~y}if(e.blink===true){t|=b}else if(e.blink===false){t&=~b}if(e.inverse===true){t|=v}else if(e.inverse===false){t&=~v}if(e.hidden===true){t|=w}else if(e.hidden===false){t&=~w}if(e.strike===true){t|=x}else if(e.strike===false){t&=~x}if(e.transparency===true){t|=S}else if(e.transparency===false){t&=~S}if(e.fgTransparency===true){t|=a}else if(e.fgTransparency===false){t&=~a}if(e.bgTransparency===true){t|=u}else if(e.bgTransparency===false){t&=~u}if(e.styleTransparency===true){t|=C}else if(e.styleTransparency===false){t&=~C}if(e.charTransparency===true){t|=T}else if(e.charTransparency===false){t&=~T}return t};d.prototype.attrAndObject=function(t,e){return d.attrAndObject(t,e,this.palette&&this.palette.colorNameToIndex)};d.attrInverse=d.prototype.attrInverse=t=>t^v;const i=0;const l=255<<16;const f=1<<16;const c=2<<16;const g=4<<16;const y=8<<16;const b=16<<16;const v=32<<16;const w=64<<16;const x=128<<16;const _=f|c;const a=1<<24;const u=2<<24;const C=4<<24;const T=8<<24;const S=a|u|C|T;const k=16<<24;const A=32<<24;const n=255+(255<<8)+(255<<16)+S+k+A;const s=64<<24;const E=128<<24;const B=s|E;const R=~B;const O=1e4;const M=40;d.prototype.ATTR_SIZE=4;d.prototype.CHAR_SIZE=4;d.prototype.ITEM_SIZE=d.prototype.ATTR_SIZE+d.prototype.CHAR_SIZE;d.DEFAULT_ATTR=d.prototype.DEFAULT_ATTR=d.object2attr({defaultColor:true,bgDefaultColor:true});d.prototype.CLEAR_ATTR=d.object2attr({defaultColor:true,bgDefaultColor:true,transparency:true});d.prototype.CLEAR_BUFFER=I.allocUnsafe(d.prototype.ITEM_SIZE);d.prototype.CLEAR_BUFFER.writeInt32BE(d.prototype.CLEAR_ATTR,0);d.prototype.CLEAR_BUFFER.write(" \0\0\0",d.prototype.ATTR_SIZE);d.prototype.LEADING_FULLWIDTH=s;d.prototype.TRAILING_FULLWIDTH=E;d.loadSyncV1=function(t){var e,r,i,n,s;e=o.readFileSync(t);if(e.lengthnew c(...t);c.createFromString=function(t,e){var r,i,n,s,o,a,u,l,f;if(!t){t={}}if(typeof e!=="string"){if(!e.toString){throw new Error("[terminal] ScreenBufferHD.createFromDataString(): argument #1 should be a string or provide a .toString() method.")}e=e.toString()}e=d.stripControlChars(e,true).split("\n");a=0;u=e.length;s=t.attr!==undefined?t.attr:c.prototype.DEFAULT_ATTR;if(s&&typeof s==="object"&&!s.BYTES_PER_ELEMENT){s=c.object2attr(s)}o=s;if(t.transparencyChar){if(!t.transparencyType){o|=c.prototype.TRANSPARENCY}else{o|=t.transparencyType&c.prototype.TRANSPARENCY}}for(i=0;ia){a=l}}f=new c({width:a,height:u});for(i=0;i({color:{r:t.r,g:t.g,b:t.b}}));var r=t.map(t=>({bgColor:{r:t.r,g:t.g,b:t.b}}));c.prototype.markupToAttrObject={normal:{"-":{dim:true},"+":{bold:true},_:{underline:true},"/":{italic:true},"!":{inverse:true},k:t[0],r:t[1],g:t[2],y:t[3],b:t[4],m:t[5],c:t[6],w:t[7],K:t[8],R:t[9],G:t[10],Y:t[11],B:t[12],M:t[13],C:t[14],W:t[15]},background:{k:r[0],r:r[1],g:r[2],y:r[3],b:r[4],m:r[5],c:r[6],w:r[7],K:r[8],R:r[9],G:r[10],Y:r[11],B:r[12],M:r[13],C:r[14],W:r[15]}};c.prototype.blitterCellBlendingIterator=function(t){var e=this.readAttr(t.context.srcBuffer,t.srcStart);var r=c.blendFn.normal;var i=1;var n=false;if(typeof t.context.blending==="object"){if(t.context.blending.fn){r=t.context.blending.fn}if(t.context.blending.opacity!==undefined){i=t.context.blending.opacity}if(t.context.blending.blendSrcFgWithDstBg){n=true}}if(e[v]&O&&e[v]&M&&(!i||e[f]===0&&e[m]===0)){return}if(t.startOfBlitLine&&t.dstStart>=this.ITEM_SIZE){this.removeLeadingFullWidth(t.context.dstBuffer,t.dstStart-this.ITEM_SIZE)}if(t.endOfBlitLine&&t.dstEndt,multiply:(t,e)=>255*(t/255*(e/255)),screen:(t,e)=>255*(1-(1-t/255)*(1-e/255)),overlay:(t,e)=>e<=127?255*(2*(t/255)*(e/255)):255*(1-2*(1-t/255)*(1-e/255)),hardLight:(t,e)=>t<=127?255*(2*(t/255)*(e/255)):255*(1-2*(1-t/255)*(1-e/255)),softLight:(t,e)=>{t/=255;e/=255;return 255*((1-2*t)*e*e+2*t*e)}};function n(t,e){if(t.readUInt32BE(w)!==e.readUInt32BE(w)){return false}if(t.readUInt32BE(x)!==e.readUInt32BE(x)){return false}if(t[b]!==e[b]){return false}if((t[v]&I)!==(e[v]&I)){return false}return true}c.prototype.terminalBlitterLineIterator=function(t){var e,r;if(!t.context.inline){t.context.sequence+=t.context.term.optimized.moveTo(t.dstXmin,t.dstY);t.context.moves++}for(e=t.srcStart;eW){t.context.rawTerm(t.context.sequence);t.context.sequence="";t.context.writes++}};c.prototype.terminalBlitterCellIterator=function(t){var e=this.readAttr(t.context.srcBuffer,t.srcStart);if(t.context.srcLastBuffer){if(n(e,this.readAttr(t.context.srcLastBuffer,t.srcStart))&&this.readChar(t.context.srcBuffer,t.srcStart)===this.readChar(t.context.srcLastBuffer,t.srcStart)){return}t.context.srcBuffer.copy(t.context.srcLastBuffer,t.srcStart,t.srcStart,t.srcEnd)}if(e[v]&j){return}t.context.cells++;if(t.dstX!==t.context.cx||t.dstY!==t.context.cy){t.context.sequence+=t.context.term.optimized.moveTo(t.dstX,t.dstY);t.context.moves++}if(!t.context.lastAttr||!n(e,t.context.lastAttr)){t.context.sequence+=!t.context.lastAttr||!t.context.deltaEscapeSequence?this.generateEscapeSequence(t.context.term,e):this.generateDeltaEscapeSequence(t.context.term,e,t.context.lastAttr);t.context.lastAttr=e;t.context.attrs++}t.context.sequence+=this.readChar(t.context.srcBuffer,t.srcStart);if(t.context.sequence.length>W){t.context.rawTerm(t.context.sequence);t.context.sequence="";t.context.writes++}t.context.cy=t.dstY;if(e&P){t.context.cx=t.dstX+2;return true}t.context.cx=t.dstX+1};c.fromNdarrayImage=function(t){var e,r=t.shape[0],i,n=Math.ceil(t.shape[1]/2),s=t.shape[2]===4;var o=new c({width:r,height:n,blending:true,noFill:true});for(e=0;ethis.CHAR_SIZE){return"\0"}return t.toString("utf8",e,e+r)};c.prototype.writeChar=function(t,e,r){return t.write(e,r+this.ATTR_SIZE,this.CHAR_SIZE)};c.prototype.generateEscapeSequence=function(t,e){var r=t.optimized.styleReset+t.optimized.color24bits(e[a],e[u],e[l])+t.optimized.bgColor24bits(e[p],e[g],e[y]);var i=e[b];if(i&_){r+=t.optimized.bold}if(i&C){r+=t.optimized.dim}if(i&T){r+=t.optimized.italic}if(i&S){r+=t.optimized.underline}if(i&k){r+=t.optimized.blink}if(i&A){r+=t.optimized.inverse}if(i&E){r+=t.optimized.hidden}if(i&B){r+=t.optimized.strike}return r};c.prototype.generateDeltaEscapeSequence=function(t,e,r){var i="";if(e[a]!==r[a]||e[u]!==r[u]||e[l]!==r[l]){i+=t.optimized.color24bits(e[a],e[u],e[l])}if(e[p]!==r[p]||e[g]!==r[g]||e[y]!==r[y]){i+=t.optimized.bgColor24bits(e[p],e[g],e[y])}var n=e[b];var s=r[b];if(n!==s){if((n&R)!==(s&R)){if(s&_&&!(n&_)||s&C&&!(n&C)){i+=t.optimized.noBold;if(n&_){i+=t.optimized.bold}if(n&C){i+=t.optimized.dim}}else{if(n&_&&!(s&_)){i+=t.optimized.bold}if(n&C&&!(s&C)){i+=t.optimized.dim}}}if((n&T)!==(s&T)){i+=n&T?t.optimized.italic:t.optimized.noItalic}if((n&S)!==(s&S)){i+=n&S?t.optimized.underline:t.optimized.noUnderline}if((n&k)!==(s&k)){i+=n&k?t.optimized.blink:t.optimized.noBlink}if((n&A)!==(s&A)){i+=n&A?t.optimized.inverse:t.optimized.noInverse}if((n&E)!==(s&E)){i+=n&E?t.optimized.hidden:t.optimized.noHidden}if((n&B)!==(s&B)){i+=n&B?t.optimized.strike:t.optimized.noStrike}}return i};c.attr2object=function(t){var e={color:{},bgColor:{}};e.color.r=t[a];e.color.g=t[u];e.color.b=t[l];e.color.a=t[f];e.bgColor.r=t[p];e.bgColor.g=t[g];e.bgColor.b=t[y];e.bgColor.a=t[m];e.bold=!!(t[b]&_);e.dim=!!(t[b]&C);e.italic=!!(t[b]&T);e.underline=!!(t[b]&S);e.blink=!!(t[b]&k);e.inverse=!!(t[b]&A);e.hidden=!!(t[b]&E);e.strike=!!(t[b]&B);e.styleTransparency=!!(t[v]&O);e.charTransparency=!!(t[v]&M);return e};c.prototype.attr2object=c.attr2object;c.object2attr=function(e){var r=H.allocUnsafe(c.prototype.ATTR_SIZE);if(!e||typeof e!=="object"){e={}}r[v]=0;if(typeof e.color==="string"){let t=i.hexToRgba(e.color);r[a]=t.r;r[u]=t.g;r[l]=t.b;r[f]=t.a}else if(e.color&&typeof e.color==="object"){r[a]=+e.color.r||0;r[u]=+e.color.g||0;r[l]=+e.color.b||0;r[f]=e.color.a!==undefined?+e.color.a||0:255}else{r[a]=0;r[u]=0;r[l]=0;r[f]=255}if(typeof e.bgColor==="string"){let t=i.hexToRgba(e.bgColor);r[p]=t.r;r[g]=t.g;r[y]=t.b;r[m]=t.a}else if(e.bgColor&&typeof e.bgColor==="object"){r[p]=+e.bgColor.r||0;r[g]=+e.bgColor.g||0;r[y]=+e.bgColor.b||0;r[m]=e.bgColor.a!==undefined?+e.bgColor.a||0:255}else{r[p]=0;r[g]=0;r[y]=0;r[m]=255}if(e.styleTransparency){r[v]|=O}if(e.charTransparency){r[v]|=M}r[b]=0;if(e.bold){r[b]|=_}if(e.dim){r[b]|=C}if(e.italic){r[b]|=T}if(e.underline){r[b]|=S}if(e.blink){r[b]|=k}if(e.inverse){r[b]|=A}if(e.hidden){r[b]|=E}if(e.strike){r[b]|=B}return r};c.prototype.object2attr=c.object2attr;c.attrAndObject=function(t,e){if(!e||typeof e!=="object"){return t}if(e.color&&typeof e.color==="object"){if(e.color.r!==undefined){t[a]=+e.color.r||0}if(e.color.g!==undefined){t[u]=+e.color.g||0}if(e.color.b!==undefined){t[l]=+e.color.b||0}if(e.color.a!==undefined){t[f]=+e.color.a||0}}if(e.bgColor&&typeof e.bgColor==="object"){if(e.bgColor.r!==undefined){t[p]=+e.bgColor.r||0}if(e.bgColor.g!==undefined){t[g]=+e.bgColor.g||0}if(e.bgColor.b!==undefined){t[y]=+e.bgColor.b||0}if(e.bgColor.a!==undefined){t[m]=+e.bgColor.a||0}}if(e.styleTransparency===true){t[v]|=O}else if(e.styleTransparency===false){t[v]&=~O}if(e.charTransparency===true){t[v]|=M}else if(e.charTransparency===false){t[v]&=~M}if(e.bold===true){t[b]|=_}else if(e.bold===false){t[b]&=~_}if(e.dim===true){t[b]|=C}else if(e.dim===false){t[b]&=~C}if(e.italic===true){t[b]|=T}else if(e.italic===false){t[b]&=~T}if(e.underline===true){t[b]|=S}else if(e.underline===false){t[b]&=~S}if(e.blink===true){t[b]|=k}else if(e.blink===false){t[b]&=~k}if(e.inverse===true){t[b]|=A}else if(e.inverse===false){t[b]&=~A}if(e.hidden===true){t[b]|=E}else if(e.hidden===false){t[b]&=~E}if(e.strike===true){t[b]|=B}else if(e.strike===false){t[b]&=~B}return t};c.prototype.attrAndObject=c.attrAndObject;c.attrInverse=c.prototype.attrInverse=t=>{t[b]^=A;return t};const L=0;const a=0;const u=1;const l=2;const f=3;const p=4;const g=5;const y=6;const m=7;const b=8;const v=9;const w=0;const x=4;const _=1;const C=2;const T=4;const S=8;const k=16;const A=32;const E=64;const B=128;const R=_|C;const O=4;const M=8;const I=O|M;const P=64;const j=128;const D=P|j;const F=255^D;const W=1e4;c.prototype.ATTR_SIZE=10;c.prototype.CHAR_SIZE=4;c.prototype.ITEM_SIZE=c.prototype.ATTR_SIZE+c.prototype.CHAR_SIZE;c.DEFAULT_ATTR=c.prototype.DEFAULT_ATTR=c.object2attr({color:{r:255,g:255,b:255,a:255},bgColor:{r:0,g:0,b:0,a:255}});c.prototype.CLEAR_ATTR=c.object2attr({color:{r:255,g:255,b:255,a:0},bgColor:{r:0,g:0,b:0,a:0},charTransparency:true,styleTransparency:true});c.prototype.CLEAR_BUFFER=H.allocUnsafe(c.prototype.ITEM_SIZE);c.prototype.CLEAR_ATTR.copy(c.prototype.CLEAR_BUFFER);c.prototype.CLEAR_BUFFER.write(" \0\0\0",c.prototype.ATTR_SIZE);c.prototype.LEADING_FULLWIDTH=P;c.prototype.TRAILING_FULLWIDTH=j;c.loadSyncV2=function(t){var e,r,i,n;r=s.readFileSync(t);if(r.length<3||r.toString("ascii",0,3)!=="SB\n"){throw new Error("Magic number mismatch: this is not a ScreenBufferHD file")}for(e=3;e{var e,r,i,n,s=o.keymap[t];if(!Array.isArray(s)){s=[s];o.keymap[t]=s}for(r=0;ro.rKeymapMaxSize){for(e=o.rKeymapMaxSize+1;e<=n.length;e++){o.rKeymap[e]={}}o.rKeymapMaxSize=n.length}if(o.rKeymap[n.length][n]){o.rKeymap[n.length][n].matches.push(t)}else{o.rKeymap[n.length][n]=i;o.rKeymap[n.length][n].matches=[t]}}else{if(!i.starter||!i.ender||!i.handler){continue}if(i.starter.length>o.rKeymapStarterMaxSize){for(e=o.rKeymapStarterMaxSize+1;e<=i.starter.length;e++){o.rKeymapStarter[e]={}}o.rKeymapStarterMaxSize=i.starter.length}if(o.rKeymapStarter[i.starter.length][i.starter]){o.rKeymapStarter[i.starter.length][i.starter].push(t)}else{o.rKeymapStarter[i.starter.length][i.starter]=[i]}}}});Object.keys(o.esc).forEach(r=>{if(!o.esc[r]||typeof o.esc[r]!=="object"){console.error("Bad escape sequence entry '"+r+"' using termconfig: '"+o.termconfigFile+"'.");return}if(typeof o.esc[r].on==="function"){o.esc[r].on=o.esc[r].on.call(o)}if(typeof o.esc[r].off==="function"){o.esc[r].off=o.esc[r].off.call(o)}if(o.esc[r].handler){if(typeof o.esc[r].handler==="function"){o.escHandler[r]=o.esc[r].handler.bind(o)}else{o.escHandler[r]=o.handler[o.esc[r].handler]}}if(o.esc[r].offHandler){if(typeof o.esc[r].offHandler==="function"){o.escOffHandler[r]=o.esc[r].offHandler.bind(o)}else{o.escOffHandler[r]=o.handler[o.esc[r].offHandler]}}Object.defineProperty(i,r,{configurable:true,get:function(){var t,e;e=Object.assign({},this.options);e.on+=this.root.esc[r].on||"";e.off=(this.root.esc[r].off||"")+e.off;e.params+=v.format.count(this.root.esc[r].on);if(!e.onHasFormatting&&(e.params||typeof this.root.esc[r].on==="string"&&v.format.hasFormatting(this.root.esc[r].on))){e.onHasFormatting=true}if(!e.offHasFormatting&&(typeof this.root.esc[r].off==="string"&&v.format.hasFormatting(this.root.esc[r].off))){e.offHasFormatting=true}if(this.root.esc[r].err){e.err=true;e.out=this.root.stderr}if(this.root.esc[r].str){e.str=true}if(this.root.esc[r].bind){e.bind=true}if(this.root.esc[r].forceStyleOnReset){e.forceStyleOnReset=true}if(this.root.esc[r].noFormat){e.noFormat=true}if(this.root.esc[r].markupOnly){e.markupOnly=true}if(this.root.esc[r].wrap){e.wrap=true}t=f.bind(undefined,e);Object.setPrototypeOf(t,i);t.apply=Function.prototype.apply;t.root=this.root||this;t.options=e;Object.defineProperty(this,r,{value:t,configurable:true});return t}})});o.resetString="";o.setResetString=function(t){o.resetString=v.markupMethod.call(o.formatConfig.rawMarkupConfig,t)};var s=t=>o.str.styleReset()+o.resetString+t;o.formatConfig={fn:{},endingMarkupReset:true,markupReset:s.bind(undefined,""),shiftMarkup:{"#":"background"},markup:{":":s.bind(undefined,"")," ":s.bind(undefined," "),"-":o.str.dim(),"+":o.str.bold(),_:o.str.underline(),"/":o.str.italic(),"!":o.str.inverse(),b:o.str.blue(),B:o.str.brightBlue(),c:o.str.cyan(),C:o.str.brightCyan(),g:o.str.green(),G:o.str.brightGreen(),k:o.str.black(),K:o.str.brightBlack(),m:o.str.magenta(),M:o.str.brightMagenta(),r:o.str.red(),R:o.str.brightRed(),w:o.str.white(),W:o.str.brightWhite(),y:o.str.yellow(),Y:o.str.brightYellow()},shiftedMarkup:{background:{":":s.bind(undefined,"")," ":s.bind(undefined," "),b:o.str.bgBlue(),B:o.str.bgBrightBlue(),c:o.str.bgCyan(),C:o.str.bgBrightCyan(),g:o.str.bgGreen(),G:o.str.bgBrightGreen(),k:o.str.bgBlack(),K:o.str.bgBrightBlack(),m:o.str.bgMagenta(),M:o.str.bgBrightMagenta(),r:o.str.bgRed(),R:o.str.bgBrightRed(),w:o.str.bgWhite(),W:o.str.bgBrightWhite(),y:o.str.bgYellow(),Y:o.str.bgBrightYellow()}},dataMarkup:{fg:(t,e,n)=>{var s;if(typeof n==="string"&&n[0]==="#"){let t=n.slice(1);if(t.length===3){t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]}let e=parseInt(t.slice(0,2),16)||0;let r=parseInt(t.slice(2,4),16)||0;let i=parseInt(t.slice(4,6),16)||0;s=o.optimized.color24bits(e,r,i)}else{s=o.str.color(n)}t.push(s);return s},bg:(t,e,n)=>{var s;if(typeof n==="string"&&n[0]==="#"){let t=n.slice(1);if(t.length===3){t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]}let e=parseInt(t.slice(0,2),16)||0;let r=parseInt(t.slice(2,4),16)||0;let i=parseInt(t.slice(4,6),16)||0;s=o.optimized.bgColor24bits(e,r,i)}else{s=o.str.bgColor(n)}t.push(s);return s}},markupCatchAll:(t,e,r)=>{o.optimized.bgColor24bits;var i="";if(r===undefined){if(e[0]==="#"){return o.formatConfig.dataMarkup.fg(t,"fg",e)}else if(p.markupCatchAllKeywords[e]){switch(p.markupCatchAllKeywords[e][0]){case"color":return o.formatConfig.dataMarkup.fg(t,"fg",p.markupCatchAllKeywords[e][1]);case"bgColor":return o.formatConfig.dataMarkup.bg(t,"bg",p.markupCatchAllKeywords[e][1]);case"dim":i=o.str.dim();break;case"bold":i=o.str.bold();break;case"underline":i=o.str.underline();break;case"italic":i=o.str.italic();break;case"inverse":i=o.str.inverse();break}}}t.push(i);return i}};o.formatConfig.dataMarkup.color=o.formatConfig.dataMarkup.fgColor=o.formatConfig.dataMarkup.c=o.formatConfig.dataMarkup.fg;o.formatConfig.dataMarkup.bgColor=o.formatConfig.dataMarkup.bg;o.formatConfig.rawMarkupConfig=Object.create(o.formatConfig);o.formatConfig.rawMarkupConfig.startingMarkupReset=false;o.formatConfig.rawMarkupConfig.endingMarkupReset=false;for(e in o.escHandler){o.formatConfig.fn[e]=o.escHandler[e]}for(e in o.escOffHandler){o.formatConfig.fn[e+"_off"]=o.escOffHandler[e]}o.format=v.createFormatter(o.formatConfig);o.markup=v.createMarkup(o.formatConfig);o.options=n;u(o);m.on("exit",()=>{if(o.shutdown){return}o.shutdown=true;o.styleReset();o.grabInput(false)});m.on("asyncExit",(t,e,r)=>{o.asyncCleanup().then(r)});m.once("beforeExit",()=>{o.asyncCleanup()});o.palette=new p.Palette({system:true,term:o});return o};function u(t){var e;t.optimized={};t.optimized.styleReset=t.str.styleReset();t.optimized.bold=t.str.bold();t.optimized.dim=t.str.dim();t.optimized.italic=t.str.italic();t.optimized.underline=t.str.underline();t.optimized.blink=t.str.blink();t.optimized.inverse=t.str.inverse();t.optimized.hidden=t.str.hidden();t.optimized.strike=t.str.strike();t.optimized.noBold=t.str.bold(false);t.optimized.noDim=t.str.dim(false);t.optimized.noItalic=t.str.italic(false);t.optimized.noUnderline=t.str.underline(false);t.optimized.noBlink=t.str.blink(false);t.optimized.noInverse=t.str.inverse(false);t.optimized.noHidden=t.str.hidden(false);t.optimized.noStrike=t.str.strike(false);t.optimized.color256=[];t.optimized.bgColor256=[];for(e=0;e<=255;e++){t.optimized.color256[e]=t.str.color256(e);t.optimized.bgColor256[e]=t.str.bgColor256(e)}t.optimized.defaultColor=t.str.defaultColor();t.optimized.bgDefaultColor=t.str.bgDefaultColor();t.optimized.moveTo=t.esc.moveTo.optimized||t.str.moveTo;t.optimized.right=t.str.right(1);t.optimized.color24bits=t.esc.color24bits.optimized||t.str.color24bits;t.optimized.bgColor24bits=t.esc.bgColor24bits.optimized||t.str.bgColor24bits}function f(t,...e){var r,i,n;if(t.bounded){e=t.bounded.concat(e)}if(t.bind){i=Object.assign({},t,{bind:false,bounded:e});r=f.bind(this,i);Object.setPrototypeOf(r,Object.getPrototypeOf(t.root));r.apply=Function.prototype.apply;r.root=t.root;r.options=i;return r}var s=[t.on],o,a,u;var l=e[t.params];if(t.params){s=s.concat(e.slice(0,t.params))}if(l===undefined||l===true){a=t.onHasFormatting?t.root.format(...s):t.on;if(t.str){return a}t.out.write(a);return t.root}if(l===null||l===false){u=t.offHasFormatting?t.root.format(t.off):t.off;if(t.str){return u}t.out.write(u);return t.root}if(typeof l!=="string"){if(typeof l.toString==="function"){l=l.toString()}else{l=""}}a=t.onHasFormatting?t.root.format(...s):t.on;if(t.markupOnly){l=t.root.markup(...e.slice(t.params))}else if(!t.noFormat){l=t.root.format(...e.slice(t.params))}if(t.wrap){if(t.root.wrapOptions.x&&t.root.wrapOptions.x>1){n={width:t.root.wrapOptions.width||t.root.width-t.root.wrapOptions.x+1,glue:"\n"+t.root.str.column(t.root.wrapOptions.x),offset:t.root.wrapOptions.offset,updateOffset:true,skipFn:p.escapeSequenceSkipFn};l=v.wordwrap(l,n);if(!t.root.wrapOptions.continue){l=t.root.str.column(t.root.wrapOptions.x)+l}t.root.wrapOptions.continue=true;t.root.wrapOptions.offset=n.offset}else{n={width:t.root.wrapOptions.width||t.root.width,glue:"\n",offset:t.root.wrapOptions.offset,updateOffset:true,skipFn:p.escapeSequenceSkipFn};l=v.wordwrap(l,n);t.root.wrapOptions.continue=true;t.root.wrapOptions.offset=n.offset}}else{t.root.wrapOptions.continue=false;t.root.wrapOptions.offset=0}u=t.offHasFormatting?t.root.format(t.off):t.off;if(t.forceStyleOnReset){l=l.replace(new RegExp(v.escape.regExp(t.root.optimized.styleReset),"g"),t.root.optimized.styleReset+a)}if(t.root.resetString){o=t.root.resetString+a+l+u+t.root.resetString}else{o=a+l+u}if(t.crlf){o=o.replace(/\n/g,"\r\n")}if(t.str){return o}t.out.write(o);return t.root}var h={error:{err:true},str:{str:true},attr:{attr:true},bindArgs:{bind:true},forceStyleOnReset:{forceStyleOnReset:true},noFormat:{noFormat:true},markupOnly:{markupOnly:true},wrap:{wrap:true},move:{on:"%[move:%a%a]F",handler:function t(e,r){var i="";if(e){if(e>0){i+=this.root.format(this.root.esc.right.on,e)}else{i+=this.root.format(this.root.esc.left.on,-e)}}if(r){if(r>0){i+=this.root.format(this.root.esc.down.on,r)}else{i+=this.root.format(this.root.esc.up.on,-r)}}return i}},color:{on:"%[color:%a]F",off:function(){return this.root.esc.defaultColor.on},handler:function t(e){if(typeof e==="string"){e=p.colorNameToIndex(e)}if(typeof e!=="number"){return""}e=Math.floor(e);if(e<0||e>15){return""}if(e<=7){return this.root.format(this.root.esc.darkColor.on,e)}return this.root.format(this.root.esc.brightColor.on,e-8)}},bgColor:{on:"%[bgColor:%a]F",off:function(){return this.root.esc.bgDefaultColor.on},handler:function t(e){if(typeof e==="string"){e=p.colorNameToIndex(e)}if(typeof e!=="number"){return""}e=Math.floor(e);if(e<0||e>15){return""}if(e<=7){return this.root.format(this.root.esc.bgDarkColor.on,e)}return this.root.format(this.root.esc.bgBrightColor.on,e-8)}},colorRgb:{on:"%[colorRgb:%a%a%a]F",off:function(){return this.root.esc.defaultColor.on},handler:r},bgColorRgb:{on:"%[bgColorRgb:%a%a%a]F",off:function(){return this.root.esc.bgDefaultColor.on},handler:i},colorRgbHex:{on:"%[colorRgbHex:%a]F",off:function(){return this.root.esc.defaultColor.on},handler:r},bgColorRgbHex:{on:"%[bgColorRgbHex:%a]F",off:function(){return this.root.esc.bgDefaultColor.on},handler:i},colorGrayscale:{on:"%[colorGrayscale:%a]F",off:function(){return this.root.esc.defaultColor.on},handler:function t(e){var r;if(typeof e!=="number"){return""}if(e<0||e>255){return""}if(!this.root.esc.color24bits.na&&!this.root.esc.color24bits.fb){return this.root.format(this.root.esc.color24bits.on,e,e,e)}if(!this.root.esc.color256.na&&!this.root.esc.color256.fb){e=Math.round(e*25/255);if(e<0||e>25){return""}if(e===0){r=16}else if(e===25){r=231}else{r=e+231}return this.root.format(this.root.esc.color256.on,r)}r=this.root.registerForRgb(e,e,e,0,15);return this.root.format(this.root.esc.color.on,r)}},bgColorGrayscale:{on:"%[bgColorGrayscale:%a]F",off:function(){return this.root.esc.bgDefaultColor.on},handler:function t(e){var r;if(typeof e!=="number"){return""}if(e<0||e>255){return""}if(!this.root.esc.bgColor24bits.na&&!this.root.esc.bgColor24bits.fb){return this.root.format(this.root.esc.bgColor24bits.on,e,e,e)}if(!this.root.esc.bgColor256.na&&!this.root.esc.bgColor256.fb){e=Math.round(e*25/255);if(e<0||e>25){return""}if(e===0){r=16}else if(e===25){r=231}else{r=e+231}return this.root.format(this.root.esc.bgColor256.on,r)}r=this.root.registerForRgb(e,e,e,0,15);return this.root.format(this.root.esc.bgColor.on,r)}}};function r(t,e,r){var i,n;if(typeof t==="string"){n=p.hexToRgba(t);t=n.r;e=n.g;r=n.b}if(typeof t!=="number"||isNaN(t)||typeof e!=="number"||isNaN(e)||typeof r!=="number"||isNaN(r)||t<0||t>255||e<0||e>255||r<0||r>255){return""}if(!this.root.esc.color24bits.na&&!this.root.esc.color24bits.fb){return this.root.format(this.root.esc.color24bits.on,t,e,r)}if(!this.root.esc.color256.na&&!this.root.esc.color256.fb){t=Math.round(t*5/255);e=Math.round(e*5/255);r=Math.round(r*5/255);i=16+t*36+e*6+r;return this.root.format(this.root.esc.color256.on,i)}i=this.root.registerForRgb(t,e,r,0,15);return this.root.format(this.root.esc.color.on,i)}function i(t,e,r){var i,n;if(typeof t==="string"){n=p.hexToRgba(t);t=n.r;e=n.g;r=n.b}if(typeof t!=="number"||isNaN(t)||typeof e!=="number"||isNaN(e)||typeof r!=="number"||isNaN(r)||t<0||t>255||e<0||e>255||r<0||r>255){return""}if(!this.root.esc.bgColor24bits.na&&!this.root.esc.bgColor24bits.fb){return this.root.format(this.root.esc.bgColor24bits.on,t,e,r)}if(!this.root.esc.bgColor256.na&&!this.root.esc.bgColor256.fb){t=Math.round(t*5/255);e=Math.round(e*5/255);r=Math.round(r*5/255);i=16+t*36+e*6+r;return this.root.format(this.root.esc.bgColor256.on,i)}i=this.root.registerForRgb(t,e,r,0,15);return this.root.format(this.root.esc.bgColor.on,i)}function c(){if(this.stdout.columns&&this.stdout.rows){this.width=this.stdout.columns;this.height=this.stdout.rows}this.emit("resize",this.width,this.height)}var d=Object.create(e.prototype);d.yesOrNo=b("./yesOrNo.js");d.inputField=b("./inputField.js");d.fileInput=b("./fileInput.js");d.singleRowMenu=d.singleLineMenu=b("./singleLineMenu.js");d.singleColumnMenu=b("./singleColumnMenu.js");d.gridMenu=b("./gridMenu.js");d.progressBar=b("./progressBar.js");d.bar=b("./bar.js");d.slowTyping=b("./slowTyping.js");d.createDocument=function(t){if(!t||typeof t!=="object"){t={}}t.outputDst=this;t.eventSource=this;return new p.Document(t)};d.createInlineElement=function(t,e){return p.Element.createInline(this,t,e)};d.table=function(t,e={}){return p.Element.createInline(this,p.TextTable,Object.assign({},e,{cellContents:t,fit:e.fit!==undefined?!!e.fit:true}))};d.spinner=function(t={}){if(typeof t==="string"){t={animation:t}}return p.Element.createInline(this,p.AnimatedText,t)};d.wrapColumn=function(...t){this.wrapOptions.continue=false;this.wrapOptions.offset=0;if(!t.length){return}if(t[0]&&typeof t[0]==="object"){Object.assign(this.wrapOptions,t[0]);return this.wrap}if(t.length===1){this.wrapOptions.x=1;this.wrapOptions.width=t[0];return this.wrap}this.wrapOptions.x=t[0];this.wrapOptions.width=t[1];return this.wrap};d.fullscreen=function(t){if(t===false){if(!this.state.fullscreen){return this}this.state.fullscreen=false;this.moveTo(1,this.height,"\n");this.alternateScreenBuffer(false);return this}if(!t){t={}}this.state.fullscreen=true;if(!t.noAlternate){this.alternateScreenBuffer(true)}this.clear()};function g(t){var e,r,i,n,s,o,a,u,l,f,h,c,d,p,g,y=false,m=0,b=t.length;if(this.shutdown){return}if(this.prependStdinChunk){t=w.concat([this.prependStdinChunk,t])}while(m0;e--){i=t.slice(m);a=i.toString();n=t.slice(m,m+e);u=n.toString();if(this.rKeymap[e]&&this.rKeymap[e][u]){l=this.rKeymap[e][u];p=true;if(l.handler){g=l.handler.call(this,l.name,t.slice(m+e));d=e+g.eaten;if(!g.disable){this.emit(l.event,g.name,g.data)}}else if(l.event){d=e;this.emit(l.event,l.name,l.data,{code:n})}else{d=e;this.emitKey(l.name,l.matches,{isCharacter:false,code:n})}break}else if(this.rKeymapStarter[e]&&this.rKeymapStarter[e][u]){f=this.rKeymapStarter[e][u];for(r=0;r=128){if(t[m]<192){continue}else if(t[m]<224){d=2}else if(t[m]<240){d=3}else if(t[m]<248){d=4}else if(t[m]<252){d=5}else{d=6}i=t.slice(m,m+d);s=i.toString("utf8");if(d>2){o=v.unicode.firstCodePoint(s)}else{o=s.charCodeAt(0)}this.emitKey(s,[s],{isCharacter:true,codepoint:o,code:i})}else{s=String.fromCharCode(t[m]);this.emitKey(s,[s],{isCharacter:true,codepoint:t[m],code:t[m]})}m+=d}if(y){this.prependStdinChunk=t}else{this.prependStdinChunk=null}}d.emitKey=function(r,i,t){if(this.metaKeyPrefix){t.meta=this.metaKeyPrefix;t.isCharacter=false;if(this.metaKeyRemove){let e=new RegExp("(^|_)"+this.metaKeyRemove+"_");if(i.length>1){let t=i.findIndex(t=>t.match(e));e.lastIndex=0;if(t>=0){r=i[t]}}r=r.replace(e,"$1")}r=this.metaKeyPrefix+"_"+p.characterName(r);this.metaKeyPrefix=null;this.metaKeyRemove=null}this.emit("key",r,i,t)};d.setMetaKeyPrefix=function(t,e){this.metaKeyPrefix=t&&typeof t==="string"?t:null;this.metaKeyRemove=e&&typeof e==="string"?e:null};d.grabInput=function(t,e){this.mouseButton(false);this.mouseDrag(false);this.mouseMotion(false);this.focusEvent(false);this.stdin.removeListener("data",this.onStdin);this.grabbing=false;this.mouseGrabbing=false;this.focusGrabbing=false;var r=()=>{this.stdin.pause();try{this.stdin.setRawMode(false)}catch(t){}};if(t===false){if(e){return l.resolveSafeTimeout(this.timeout/2).then(r)}r();return l.resolved}if(this.shutdown){return l.resolved}this.grabbing=true;if(!t){t={}}try{this.stdin.setRawMode(true)}catch(t){}this.stdin.on("data",this.onStdin);this.stdin.resume();if(t.mouse){this.mouseGrabbing=true;switch(t.mouse){case"button":this.mouseButton.mouseSGR();break;case"drag":this.mouseDrag.mouseSGR();break;case"motion":this.mouseMotion.mouseSGR();break}}if(t.focus){this.focusEvent();this.focusGrabbing=true}return l.resolved};d.processExit=function(t){this("\n");this.asyncCleanup().then(()=>m.exit(t))};d.asyncCleanup=async function(){if(this.shutdown){return}this.shutdown=true;this.styleReset();var t=this.grabbing;await this.waitStreamDone(this.stdout);if(!this.isTTY||!t){return}await l.resolveSafeTimeout(this.timeout/4);return this.grabInput(false,true)};d.waitStreamDone=function(t){if(!t._writableState.needDrain){return l.resolved}return l.onceEvent(t,"drain")};d.object2attr=function(t){var e=this.esc.styleReset.on;if(!t||typeof t!=="object"){t={}}if(typeof t.color==="string"){t.color=p.colorNameToIndex(t.color)}if(typeof t.color!=="number"||t.color<0||t.color>255){t.color=7}else{t.color=Math.floor(t.color)}e+=this.str.color(t.color);if(typeof t.bgColor==="string"){t.bgColor=p.colorNameToIndex(t.bgColor)}if(typeof t.bgColor!=="number"||t.bgColor<0||t.bgColor>255){t.bgColor=0}else{t.bgColor=Math.floor(t.bgColor)}e+=this.str.bgColor(t.bgColor);if(t.bold){e+=this.esc.bold.on}if(t.dim){e+=this.esc.dim.on}if(t.italic){e+=this.esc.italic.on}if(t.underline){e+=this.esc.underline.on}if(t.blink){e+=this.esc.blink.on}if(t.inverse){e+=this.esc.inverse.on}if(t.hidden){e+=this.esc.hidden.on}if(t.strike){e+=this.esc.strike.on}return e};d.eraseArea=function(t,e,r=1,i=1){t=Math.min(t,this.width);e=Math.min(e,this.height);var n,s=Math.min(t+r,this.width+1),o=Math.min(e+i,this.height+1),a=" ".repeat(s-t);for(n=e;n{this.getCursorLocation().then(t=>{if(i){i(undefined,t.x,t.y)}else{o.resolve(t)}},t=>{if(i){i(t)}else{o.reject(t)}})});return o}this.lock.getCursorLocation=true;var r=(t,e,r)=>{if(s){return}s=true;this.removeListener("terminal",a);if(!n){this.grabInput(false)}if(t){if(this.shutdown){t.code="shutdown"}if(i){i(t)}else{o.reject(t)}return}if(i){i(undefined,e,r)}else{o.resolve({x:e,y:r})}};var a=(t,e)=>{if(t!=="CURSOR_LOCATION"){return}this.lock.getCursorLocation=false;this.emit("unlock_getCursorLocation");r(undefined,e.x,e.y)};if(!n){this.grabInput()}this.on("terminal",a);this.requestCursorLocation();l.resolveSafeTimeout(this.timeout).then(()=>{if(s){return}var t=new Error(".getCursorLocation() timed out");t.code="timeout";r(t)});return o};d.getColor=function(r,i){var n=this.grabbing,s=false,t;if(this.shutdown){return l.resolved}if(this.esc.requestColor.na){t=new Error("Terminal is not capable");if(i){i(t);return l.resolved}return l.reject(t)}var o=new l;var a=(t,e)=>{if(s){return}s=true;this.removeListener("terminal",u);if(!n){this.grabInput(false)}if(t){if(this.shutdown){t.code="shutdown"}if(i){i(t)}else{o.reject(t)}return}if(i){i(undefined,e)}else{o.resolve(e)}};var u=(t,e)=>{if(t!=="COLOR_REGISTER"){return}if(e.register!==r){return}if(r<16){this.colorRegister[r]={r:e.r,g:e.g,b:e.b}}a(undefined,e)};if(!n){this.grabInput()}this.requestColor(r);this.on("terminal",u);l.resolveSafeTimeout(this.timeout).then(()=>{if(s){return}var t=new Error(".getColor() timed out");t.code="timeout";a(t)});return o};d.getPalette=function(e){var t,r=this.grabbing;if(this.shutdown){return l.resolved}if(!r){this.grabInput()}if(this.esc.requestColor.na){t=this.colorRegister.slice(0,16);if(e){e(undefined,t);return l.resolved}return l.resolve(t)}return l.concurrent(4,[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15],t=>this.getColor(t)).then(t=>{if(!r){this.grabInput(false)}if(e){e(undefined,t)}else{return t}},t=>{if(!r){this.grabInput(false)}if(e){e(t)}else{throw t}})};d.setColor=function(t,e,r,i,n){if(e&&typeof e==="object"){i=e.b;r=e.g;e=e.r;n=r}if(typeof t!=="number"||t<0||t>15){throw new Error("Bad register value")}if(!Array.isArray(n)){n=[]}if(typeof e!=="number"||e<0||e>255||typeof r!=="number"||r<0||r>255||typeof i!=="number"||i<0||i>255){throw new Error("Bad RGB value")}if(this.setColorLL.na){return}this.colorRegister[t]={r:e,g:r,b:i,names:n};this.setColorLL(t,e,r,i)};d.setPalette=function(e){var t;if(typeof e==="string"){try{e=b("./colorScheme/"+e+".json")}catch(t){throw new Error("[terminal] .setPalette(): color scheme not found: "+e)}}if(!Array.isArray(e)){throw new Error("[terminal] .setPalette(): argument #0 should be an Array of RGB Object or a built-in color scheme")}if(this.setColorLL.na){return}for(t=0;t<=15;t++){if(!e[t]||typeof e[t]!=="object"){continue}this.setColor(t,e[t])}};d.getClipboard=function(t="c"){var r=this.grabbing,i=false,e;if(this.shutdown){return l.resolved}if(this.esc.requestClipboard.na){e=b("./extClipboard.js");return e.getClipboard(t).catch(()=>"")}var n=new l;var s=(t,e)=>{if(i){return}i=true;this.removeListener("terminal",o);if(!r){this.grabInput(false)}if(t){if(this.shutdown){t.code="shutdown"}n.reject(t);return}n.resolve(e)};var o=(t,e)=>{if(t!=="CLIPBOARD"){return}s(undefined,e.content)};if(!r){this.grabInput()}this.requestClipboard(t[0]);this.on("terminal",o);l.resolveSafeTimeout(this.timeout).then(()=>{if(i){return}var t=new Error(".getClipboard() timed out");t.code="timeout";s(t)});return n};d.setClipboard=async function(t,e="c"){var r;if(this.esc.setClipboardLL.na){r=b("./extClipboard.js");return r.setClipboard(t,e).catch(()=>undefined)}var i=w.from(t).toString("base64");this.setClipboardLL(e[0],i);return l.resolved};d.getTerminfo=function(r){var i=this.grabbing,n=false;if(this.shutdown){return l.resolved}if(this.esc.xtgettcapLL.na){return l.reject(new Error("Terminal is not capable"))}var s=new l;if(this.lock.getTerminfo){this.once("unlock_getTerminfo",()=>this.getTerminfo(r).propagate(s));return s}this.lock.getTerminfo=true;var o=(t,e)=>{if(n){return}n=true;this.removeListener("terminal",a);if(!i){this.grabInput(false)}if(t){if(this.shutdown){t.code="shutdown"}s.reject(t);return}if(!e.valid||e.key!==r){s.resolve();return}s.resolve(e.value)};var a=(t,e)=>{if(t!=="TERMINFO"){return}this.lock.getTerminfo=false;this.emit("unlock_getTerminfo");o(undefined,e)};if(!i){this.grabInput()}this.on("terminal",a);this.xtgettcapLL(w.from(r).toString("hex"));l.resolveSafeTimeout(this.timeout).then(()=>{if(n){return}var t=new Error(".getTerminfo() timed out");t.code="timeout";o(t)});return s};var y=b("./colorScheme/default.json");(function t(){var e,r,i,n;for(e=16;e<232;e++){r=e-16;i=255/5;y[e]={r:Math.round(Math.floor(r/36)%6*i),g:Math.round(Math.floor(r/6)%6*i),b:Math.round(r%6*i),names:[]}}for(e=232;e<=255;e++){r=e-231;i=255/25;n=Math.round(r*i);y[e]={r:n,g:n,b:n,names:[]}}})();d.rgbForRegister=function(t){if(t<0||t>255){throw new Error("Bad register value")}return{r:this.colorRegister[t].r,g:this.colorRegister[t].g,b:this.colorRegister[t].b}};d.registerForRgb=function(t,e,r,i,n){if(t&&typeof t==="object"){n=r;i=e;r=t.b;e=t.g;t=t.r}if(typeof t!=="number"||t<0||t>255||typeof e!=="number"||e<0||e>255||typeof r!=="number"||r<0||r>255){throw new Error("Bad RGB value")}if(typeof n!=="number"||n<0||n>255){n=15}if(typeof i!=="number"||i<0||i>255){i=0}if(i>n){var s;s=n;n=i;i=s}return this._registerForRgb(t,e,r,i,n)};d._registerForRgb=function(t,e,r,i,n){var s,o,a=Infinity,u=[t,e,r];for(s=i;s<=n;s++){o=p.chroma.distance(u,this.colorRegister[s],"hcl");if(othis.width){n=this.width}else{n=Math.floor(n)}if(typeof s!=="number"||s<1){s=1}else if(s>this.height){s=this.height}else{s=Math.floor(s)}o=1;a=0;switch(t.direction){case"left":o=-1;break;case"up":o=0;a=-1;break;case"down":o=0;a=1;break;case null:case"none":o=0;a=0;break}if(typeof t.dx==="number"){o=t.dx}if(typeof t.dy==="number"){a=t.dy}d=o===1&&a===0;u=t.attr||this.esc.styleReset.on;if(u&&typeof u==="object"){u=this.object2attr(u)}if(typeof u!=="string"){u=this.esc.styleReset.on}if(typeof e!=="string"){if(e.toString){e=e.toString()}else{return}}if(r.length){e=v.format(e,...r)}e=p.stripControlChars(e);f=v.unicode.toArray(e);h=f.length;c=true;this.stdout.write(u);for(i=0;i=this.width){if(!l){break}n=0;s++;c=true}if(s<0){break}else if(s>=this.height){break}}};d.drawNdarrayImage=function(t){var e,r=Math.min(t.shape[0],this.width),i,n=Math.ceil(t.shape[1]/2),s=t.shape[2]===4,o=this.support["256colors"]?255:15,a,u,l,f,h={};for(i=0;inew s(...t);s.prototype.parseMarkup=f.markupMethod.bind(i.markupOptions);function d(t=" ",e=1,r=null,i=null){this.char=t;this.width=e>=0?e:-e-1;this.filler=e<0;this.attr=r;this.misc=i}s.Cell=d;const a=t("./termkit.js");s.prototype.getText=function(){return this.buffer.map(t=>f.unicode.fromCells(t)).join("")};s.prototype.getLineText=function(t=this.cy){if(t>=this.buffer.length){return null}if(!this.buffer[t]){this.buffer[t]=[]}return f.unicode.fromCells(this.buffer[t])};s.prototype.getLineCharCount=function(t=this.cy){if(t>=this.buffer.length){return null}if(!this.buffer[t]){this.buffer[t]=[]}return this.getCellsCharCount(this.buffer[t])};s.prototype.getCellsCharCount=function(e){var r=0;for(let t of e){if(!t.filler){r++}}return r};s.prototype.getCursorSplittedText=function(){var t,e,r="",i="";for(t=0;tthis.cy){i+=f.unicode.fromCells(e)}else{r+=f.unicode.fromCells(e.slice(0,this.cx));i+=f.unicode.fromCells(e.slice(this.cx))}}return[r,i]};s.prototype.setText=function(t,e,r){if(typeof e!=="boolean"&&typeof e!=="string"){r=e;e=false}var i=false,n=null;switch(e){case"ansi":n=f.ansi.parse;break;case"legacyAnsi":n=f.ansi.parse;i=true;break;case true:n=this.parseMarkup;break}if(r===undefined){r=this.defaultAttr}if(typeof r==="object"){r=this.object2attr(r)}this.buffer.length=0;t.split(/(?<=\n)/g).forEach(t=>{var e=this.buffer.length;this.buffer[e]=this.lineToCells(t,n,r,0,i);if(t[t.length-1]==="\n"){this.buffer[e].push(new d("\n",1,r))}if(this.lineWrapWidth){this.wrapLine(e)}});this.selectionRegion=null};s.prototype.lineToCells=function(t,e,r,i=0,n=false){if(!e){return f.unicode.toCells(d,t,this.tabWidth,i,r)}var s,o,a=[];const u=this.ScreenBuffer.attr2object(this.ScreenBuffer.DEFAULT_ATTR);const l=this.ScreenBuffer.attr2object(r);e(t).forEach(t=>{o=Object.assign({},t.specialReset?u:l,t);delete o.text;if(o.defaultColor&&o.color){delete o.defaultColor}if(o.bgDefaultColor&&o.bgColor){delete o.bgDefaultColor}s=this.object2attr(o,undefined,n);if(t.text){a.push(...f.unicode.toCells(d,t.text,this.tabWidth,i+a.length,s))}});return a};s.prototype.setHidden=function(t){this.hidden=typeof t==="string"&&t.length?t[0]:t?a.spChars.password:false};s.prototype.getHidden=function(){return this.hidden};s.prototype.setVoidTextBuffer=function(t=null){this.voidTextBuffer=t};s.prototype.getVoidTextBuffer=function(){return this.voidTextBuffer};s.prototype.getContentSize=function(){return{width:Math.max(1,...this.buffer.map(t=>t.length)),height:this.buffer.length}};s.prototype.coordinateToOffset=function(t,e){var r,i,n,s=0;for(i=0;i=this.buffer.length){return t}a=this.buffer[t];l=this.buffer[t-1];s=t?0:this.firstLineRightShift;u=e-s;if(!e||a.length&&a.length<=u&&a[a.length-1].char==="\n"&&(!l||!l.length||l[l.length-1].char==="\n")){return t+1}var p=[],g=[];for(n=t-1;n>=0;n--){a=this.buffer[n];if(a.length&&a[a.length-1].char==="\n"){t=n+1;break}else if(!n){t=0;break}}for(n=t;n=p.length){g.push(p);break}if(i===u+1&&y.has(p[i].char)&&p[u-1].char!==" "){i=u-1}else{h=true}}if(!h){f=null;while(i>=0&&(p[i].char!==" "||y.has(f)&&i>0&&p[i-1].char!==" ")){f=p[i].char;i--}if(i<0){i=u}else{i++}}g.push(p.splice(0,i))}this.buffer.splice(t,o-t,...g);o=t+g.length;if(d){for(n=t;;n++){if(n>=o){if(n>0){n--}this.cy=n;this.cx=this.buffer[n]?this.buffer[n].length:0;break}if(!this.buffer[n]){this.cy=n;this.cx=0;break}if(c=t.ymin&&r<=t.ymax&&(r!==t.ymin||e>=t.xmin)&&(r!==t.ymax||e<=t.xmax)};s.prototype.setSelectionRegion=function(t){if(!this.selectionRegion){this.selectionRegion={}}if(t.xmin!==undefined&&t.ymin!==undefined){if(t.xmin<0){t.xmin=0}if(t.ymin<0){t.ymin=0}this.selectionRegion.xmin=t.xmin;this.selectionRegion.ymin=t.ymin;this.selectionRegion.cellMin=this.buffer[t.ymin]?.[t.xmin]??null}if(t.xmax!==undefined&&t.ymax!==undefined){this.selectionRegion.xmax=t.xmax;this.selectionRegion.ymax=t.ymax;this.selectionRegion.cellMax=this.buffer[t.ymax]?.[t.xmax]??null}};s.prototype.startOfSelection=function(){if(!this.selectionRegion){this.selectionRegion={}}this.selectionRegion.xmin=this.cx;this.selectionRegion.ymin=this.cy;this.selectionRegion.cellMin=this.buffer[this.cy]?.[this.cx]??null};s.prototype.endOfSelection=function(){var t=this.oneStepBackward();if(!this.selectionRegion){this.selectionRegion={}}if(!t){this.selectionRegion=null;return}this.selectionRegion.xmax=t.x;this.selectionRegion.ymax=t.y;this.selectionRegion.cellMax=this.buffer[t.y]?.[t.x]??null};s.prototype.updateSelectionFromCells=function(i=null){if(!this.selectionRegion){return}if(!this.selectionRegion.cellMin||!this.selectionRegion.cellMax){this.selectionRegion=null;return}var n,s,o,a;for(let r=0;r=0?t:0;this.cy=e>=0?e:0;this.moveToLeadingFullWidth()};s.prototype.move=function(t,e){this.moveTo(this.cx+t,this.cy+e)};s.prototype.moveToColumn=function(t){this.moveTo(t,this.cy)};s.prototype.moveToLine=s.prototype.moveToRow=function(t){this.moveTo(this.cx,t)};s.prototype.moveUp=function(){this.cy=this.cy>0?this.cy-1:0;this.moveToLeadingFullWidth();if(this.forceInBound){this.moveInBound(true)}};s.prototype.moveDown=function(){this.cy++;this.moveToLeadingFullWidth();if(this.forceInBound){this.moveInBound(true)}};s.prototype.moveLeft=function(){this.cx=this.cx>0?this.cx-1:0;this.moveToLeadingFullWidth();if(this.forceInBound){this.moveInBound(true)}};s.prototype.moveRight=function(){this.cx++;var t=this.buffer[this.cy];while(t?.[this.cx]?.filler&&t?.[this.cx]?.width===0){this.cx++}if(this.forceInBound){this.moveInBound(true)}};s.prototype.moveForward=function(t,e){var r=this.cx,i=this.buffer[this.cy];if(e&&(!i||!i[this.cx]||!i[this.cx].filler)){return}for(;;){if(!i||this.cx+1>i.length||this.cxr){this.cx=r}else{this.cx--}if(this.cx<0){this.cy--;if(this.cy<0){this.cy=0;this.cx=0;break}this.moveToEndOfLine();break}if(!i||!i[this.cx]||!i[this.cx].filler&&(!t||t(i[this.cx].char))){break}}if(this.forceInBound){this.moveInBound()}};const o=new Set([" ","\t",".",",",";",":","!","?","/","\\","(",")","[","]","{","}","<",">","=","'",'"']);s.prototype.wordBoundary_=function(t,e){var r,i=false;if(e&&this.buffer[this.cy]&&this.buffer[this.cy][this.cx]){r=this.buffer[this.cy][this.cx].char;if(!o.has(r)){i=true}}this[t](t=>{if(o.has(t)){if(i){return true}return false}i=true;return false})};s.prototype.moveToEndOfWord=function(){return this.wordBoundary_("moveForward",true)};s.prototype.moveToStartOfWord=function(){var t,e=this.cx,r=this.cy;this.wordBoundary_("moveBackward");if(this.cxthis.buffer.length){this.cy=this.buffer.length}if(t){return}if(!e){this.cx=0}else if(e.length&&e[e.length-1].char==="\n"){if(this.cx>e.length-1){this.cx=e.length-1}}else if(this.cx>e.length){this.cx=e.length}};s.prototype.insert=function(t,e,r){var i,n,s,o=0;if(!t){return o}if(typeof e!=="boolean"&&typeof e!=="string"){r=e;e=false}var a=false,u=null;switch(e){case"ansi":u=f.ansi.parse;break;case"legacyAnsi":u=f.ansi.parse;a=true;break;case true:u=this.parseMarkup;break}i=t.split("\n");s=i.length;if(r&&typeof r==="object"){r=this.object2attr(r)}else if(typeof r!=="number"){r=this.defaultAttr}if(this.forceInBound){this.moveInBound()}o+=this.inlineInsert(i[0],u,r);for(n=1;n=this.buffer.length){while(this.buffer.length0){r=this.buffer[this.cy];if(this.cy>=this.buffer.length||this.cy===this.buffer.length-1&&this.cx>=r.length){if(this.selectionRegion){this.updateSelectionFromCells()}return a}if(r){if(this.cx>r.length){this.cx=r.length}if(r[this.cx]&&r[this.cx].char!=="\n"){s=r[r.length-1]?.char==="\n";n=this.countInlineForwardFiller(t);i=Math.min(t+n,r.length-s-this.cx);if(i>0){o=r.splice(this.cx,i);if(e){o=o.filter(t=>!t.filler);a.string+=o.map(t=>t.char).join("");a.count+=o.length}}t-=i-n}}if(t>0){if(this.joinLine(true)){t--;if(e){a.string+="\n";a.count++}}}}if(this.lineWrapWidth){this.wrapLine()}this.reTabLine();if(this.selectionRegion){this.updateSelectionFromCells()}return a};s.prototype.backDelete=function(t,e=false){var r,i,n,s,o,a=e?{string:"",count:0}:undefined;if(t===undefined){t=1}if(this.forceInBound){this.moveInBound()}if(this.buffer[this.cy]&&this.cx&&this.buffer[this.cy][this.cx-1]&&this.buffer[this.cy][this.cx-1].filler){this.moveBackward(undefined,true)}while(t>0){r=this.buffer[this.cy];if(this.cy===0&&this.cx===0){if(this.selectionRegion){this.updateSelectionFromCells()}return a}if(r){if(this.cx>r.length){if(r.length&&r[r.length-1].char==="\n"){this.cx=r.length-1}else{this.cx=r.length}t--}else if(this.cx&&this.cx===r.length&&r[r.length-1].char==="\n"){this.cx=r.length-1}n=this.countInlineBackwardFiller(t);i=Math.min(t+n,this.cx);if(i>0){o=r.splice(this.cx-i,i);if(e){o=o.filter(t=>!t.filler);a.string=o.map(t=>t.char).join("")+a.string;a.count+=o.length}this.cx-=i}t-=i-n}if(t>0){this.cy--;this.cx=r?r.length:0;if(this.joinLine(true)){t--;if(e){a.string="\n"+a.string;a.count++}}}}if(this.lineWrapWidth){this.wrapLine()}this.reTabLine(s);if(this.selectionRegion){this.updateSelectionFromCells()}return a};s.prototype.countInlineBackwardFiller=function(t){var e,r,i=0;for(e=this.cx-1;e>=0&&t;e--){r=this.buffer[this.cy][e];if(r&&r.filler){i++}else{t--}}return i};s.prototype.countInlineForwardFiller=function(t){var e,r,i=this.buffer[this.cy].length,n=0;for(e=this.cx;e=this.buffer.length){return}if(t){o={count:this.getLineCharCount(),string:this.getLineText()}}this.buffer.splice(this.cy,1);if(this.selectionRegion){this.updateSelectionFromCells()}return o};s.prototype.findNext=function(t,e,r){var i,n,s,o=this.getText(),a=f.unicode.toArray(t).length;r=!!r;if(r){e=e?e-a:o.length-a}else{e=e??0}i=r?o.lastIndexOf(t,e):o.indexOf(t,e);if(i===-1){return}n=this.offsetToCoordinate(i);s=this.offsetToCoordinate(i+a-1);return{xmin:n.x,ymin:n.y,xmax:s.x,ymax:s.y}};s.prototype.findPrevious=function(t,e){return this.findNext(t,e,true)};s.prototype.regexpFindNext=function(t,e=0){var r,i,n,s,o,a=this.getText();if(typeof t==="string"){t=new RegExp(t,"gu")}else{t.global=true;t.unicode=true}t.lastIndex=e;o=t.exec(a);if(!o){return}s=f.unicode.toArray(o[0]).length;i=this.offsetToCoordinate(o.index);n=this.offsetToCoordinate(o.index+s-1);return{xmin:i.x,ymin:i.y,xmax:n.x,ymax:n.y,match:o}};s.prototype.draw=function(t={}){var e={dst:t.dst||this.dst,offsetX:t.x!==undefined?Math.floor(t.x):Math.floor(this.x),offsetY:t.y!==undefined?Math.floor(t.y):Math.floor(this.y),dstClipRect:t.dstClipRect?new a.Rect(t.dstClipRect):this.dstClipRect,srcClipRect:t.srcClipRect?new a.Rect(t.srcClipRect):undefined,blending:t.blending,wrap:t.wrap,tile:t.tile};if(e.dst instanceof this.ScreenBuffer){this.blitter(e);if(t.cursor){e.dst.cx=this.cx+e.offsetX;e.dst.cy=this.cy+e.offsetY}}};s.prototype.drawCursor=function(t){if(!t||typeof t!=="object"){t={}}var e,r=t.dst||this.dst;if(r instanceof this.ScreenBuffer){e=this.cy?this.cx:this.cx+this.firstLineRightShift;if(!this.ch&&(this.dstClipRect||new a.Rect(this.dst)).isInside(e+this.x,this.cy+this.y)){r.cx=e+this.x;r.cy=this.cy+this.y;r.ch=false}else{r.ch=true}}};s.prototype.blitter=function(t){var e,r,i,n,s,o;r=new a.Rect(this);if(this.voidTextBuffer){n=this.voidTextBuffer.buffer;r.merge(new a.Rect(this.voidTextBuffer))}i=t.srcClipRect||new a.Rect(r);e={type:"line",context:{srcFirstLineRightShift:this.firstLineRightShift,srcBuffer:this.buffer,srcAltBuffer:n,dstBuffer:t.dst.buffer,forceChar:this.hidden,voidAttr:this.voidAttr,inverseRegion:this.selectionRegion,writeAttr:this.ScreenBuffer===a.ScreenBuffer?(t,e,r)=>{t.writeInt32BE(e,r)}:(t,e,r)=>{e.copy(t,r)}},dstRect:new a.Rect(t.dst),srcRect:r,dstClipRect:t.dstClipRect||new a.Rect(t.dst),srcClipRect:i,offsetX:t.offsetX,offsetY:t.offsetY,wrap:t.wrap,tile:t.tile,multiply:this.ScreenBuffer.prototype.ITEM_SIZE};o=this.blitterLineIterator.bind(this);if(t.wrap){s="wrapIterator"}else if(t.tile){s="tileIterator"}else{s="regionIterator"}a.Rect[s](e,o)};s.prototype.blitterLineIterator=function(t){var e,r,i,n,s,o,a,u,l,f,h=t.context.inverseRegion,c=Infinity,d=-Infinity;e=t.srcY?0:t.context.srcFirstLineRightShift;r=t.srcXmin-e;i=t.srcXmax-e;s=t.dstStart;o=t.context.srcBuffer[t.srcY];if(o){n=i;if(n>=o.length){n=o.length-1}if(h&&t.srcY>=h.ymin&&t.srcY<=h.ymax){c=t.srcY===h.ymin?h.xmin:-Infinity;d=t.srcY===h.ymax?h.xmax:Infinity}for(;r<=n;r++,s+=this.ScreenBuffer.prototype.ITEM_SIZE){if(r<0){continue}a=o[r];if(t.context.forceChar){u=a.attr;l=t.context.forceChar}else{u=a.width===2?a.attr|this.ScreenBuffer.prototype.LEADING_FULLWIDTH:a.width===0?a.attr|this.ScreenBuffer.prototype.TRAILING_FULLWIDTH:a.attr;l=(f=a.char.charCodeAt(0))<32||f===127?" ":a.char}if(r>=c&&r<=d){u=this.ScreenBuffer.attrInverse(u)}t.context.writeAttr(t.context.dstBuffer,u,s);t.context.dstBuffer.write(l,s+this.ScreenBuffer.prototype.ATTR_SIZE,this.ScreenBuffer.prototype.CHAR_SIZE)}}if(t.context.srcAltBuffer){o=t.context.srcAltBuffer[t.srcY];if(o){n=i;if(n>=o.length){n=o.length-1}for(;r<=n;r++,s+=this.ScreenBuffer.prototype.ITEM_SIZE){if(r<0){continue}a=o[r];u=a.width===2?a.attr|this.ScreenBuffer.prototype.LEADING_FULLWIDTH:a.width===0?a.attr|this.ScreenBuffer.prototype.TRAILING_FULLWIDTH:a.attr;l=(f=a.char.charCodeAt(0))<32||f===127?" ":a.char;t.context.writeAttr(t.context.dstBuffer,u,s);t.context.dstBuffer.write(l,s+this.ScreenBuffer.prototype.ATTR_SIZE,this.ScreenBuffer.prototype.CHAR_SIZE)}}}u=t.context.voidAttr;if(u!==null){for(;r<=i;r++,s+=this.ScreenBuffer.prototype.ITEM_SIZE){t.context.writeAttr(t.context.dstBuffer,u,s);t.context.dstBuffer.write(" ",s+this.ScreenBuffer.prototype.ATTR_SIZE,this.ScreenBuffer.prototype.CHAR_SIZE)}}};s.prototype.load=async function(t,e){var r;this.buffer[0]=[];this.buffer.length=1;try{r=await n.promises.readFile(t)}catch(t){if(e){e(t);return}throw t}this.setText(r.toString());if(e){e();return}};s.prototype.save=async function(t,e){try{await n.promises.writeFile(t,this.getText())}catch(t){if(e){e(t);return}throw t}if(e){e();return}};s.prototype.object2attr=function(t,e=this.palette?.colorNameToIndex,r=false){return this.ScreenBuffer.object2attr(t,e,r)};s.prototype.oneStepBackward=function(t=this.cx,e=this.cy){t--;if(t<0){e--;if(e<0){return null}t=this.buffer[e].length-1}return{x:t,y:e}};s.prototype.runStateMachine=function(){if(!this.stateMachine){return}this.stateMachine.reset();this.iterate({finalCall:true,fillerCopyAttr:true},t=>{t.textBuffer=this;this.stateMachine.pushEvent(t.text,t)})};const l={};s.TextMachineApi=l;l.style=(t,e)=>{if(!t||t.x===null){return}if(!e.code){e.code=t.textBuffer.ScreenBuffer.object2attr(e)}t.textBuffer.setAttrCodeAt(e.code,t.x,t.y)};l.blockStyle=function(t,e,r){if(!t||!e||t.x===null||e.x===null){return}if(!r.code){r.code=t.textBuffer.ScreenBuffer.object2attr(r)}t.textBuffer.setAttrCodeRegion(r.code,{xmin:t.x,xmax:e.x,ymin:t.y,ymax:e.y})};l.hint=function(e,r,i){if(!e||e.x===null||e.y===null){return}if(i[r]){let t=e.textBuffer.getMiscAt(e.x,e.y);if(t){t.hint=i[r]}}}},{"./misc.js":47,"./termkit.js":55,fs:141,"string-kit":127}],7:[function(t,e,r){"use strict";e.exports=function t(e,r,i,n,s){var o,a,u,l=[],f=r,h=false;if(!n){n=""}if(!s){s=""}for(o=0;o1){t=1}var n=e.innerSize||10;var s=Math.floor(t*n);var o=Math.round((t*n-s)*8);var a=e.barStyle||this.blue;i+="█".repeat(s);if(s=3803){u=o||a?"gnome-256color":"gnome";l=true;break}}if(s==="darwin"){u="osx-256color";break}for(e in p.env){if(e.match(/KONSOLE/)){u=o||a?"konsole-256color":"konsole";l=true;break}}break;case"linux":case"aterm":case"kuake":case"tilda":case"terminology":case"wterm":case"mrxvt":break;case"gnome":case"gnome-256color":case"gnome-terminal":case"gnome-terminal-256color":case"terminator":case"guake":u=o||a?"gnome-256color":"gnome";break;case"konsole":u=o||a?"konsole-256color":"konsole";break;case"rxvt":case"rxvt-xpm":case"rxvt-unicode-256color":case"urxvt256c":case"urxvt256c-ml":case"rxvt-unicode":case"urxvt":case"urxvt-ml":if(p.env.TERM==="rxvt"){u="rxvt-256color"}else{u=o||a?"rxvt-256color":"rxvt"}break;case"xfce":case"xfce-terminal":case"xfce4-terminal":u="xfce";break;case"eterm":case"Eterm":u=o||a?"eterm-256color":"eterm";break;case"atomic-terminal":u="atomic-terminal";break;case"xterm-kitty":case"kitty":u="kitty";break;case"iTerm":case"iterm":case"iTerm2":case"iterm2":case"Terminal":case"terminal":case"Apple_Terminal":u="osx-256color";break;case"termux":break;default:if(!u){f="unknown"}else{f=u=f.toLowerCase()}break}return{isTTY:n,isSSH:i,appId:u,safe:l,generic:l?u:f}};function d(t){var n,s;return new e((r,i)=>{o("ps -h -o ppid -p "+t,(t,e)=>{if(t){i(t);return}n=parseInt(e.match(/[0-9]+/gm)[0],10);if(!n){i(new Error("Couldn't get parent PID"));return}o("ps -h -o comm -p "+n,(t,e)=>{if(t){i(t);return}s=e.trim();r({pid:n,appName:s})})})})}r.getParentTerminalInfo=async function(e){var t,r,i,n=[],s,o=p.pid;if(p.env.SSH_CONNECTION){r=new Error("SSH connection detected, .getParentTerminalInfo() is useless in this context.");if(e){e(r);return}throw r}var a=c.platform();var u=p.env.TERM&&p.env.TERM.match(/256/)||p.env.COLORTERM&&p.env.COLORTERM.match(/256/);var l=p.env.COLORTERM&&p.env.COLORTERM.match(/^(truecolor|24bits?)$/);try{t=true;while(t){({appName:i,pid:o}=await d(o));if(a==="darwin"){i=h.parse(i).name}n.push(i);t=false;switch(i){case"linux":case"xterm":case"konsole":case"gnome-terminal":case"aterm":case"guake":case"kuake":case"tilda":case"terminology":case"wterm":case"mrxvt":s=u||l?i+"-256color":i;break;case"atomic-terminal":s=i;break;case"login":i="linux";s=i;break;case"terminator":s=u||l?"gnome-256color":"gnome";break;case"rxvt":case"urxvt256c":case"urxvt256c-ml":s="rxvt-256color";break;case"urxvt":case"urxvt-ml":s="rxvt";break;case"xfce4-terminal":s="xfce";break;case"gnome-terminal-":i="gnome-terminal";s=u||l?"gnome-256color":"gnome";break;case"Eterm":case"eterm":i="Eterm";s=u||l?"eterm-256color":"eterm";break;case"kitty":i=s="kitty";break;case"iTerm":case"iTerm2":case"Terminal":s="osx-256color";break;default:if(i.match(/gnome-terminal/)){i="gnome-terminal";s=u||l?"gnome-256color":"gnome";break}if(!o||o===1){throw new Error("Terminal not found, app names: "+n.join(", "))}t=true}}}catch(t){if(e){e(t);return}throw t}var f={appId:s,appName:i,pid:o,safe:true};if(e){e(undefined,f);return}return f};r.getDetectedTerminal=async function(t){var e,r,i=n.guessTerminal();if(i.safe||i.isSSH){e=n.createTerminal({stdin:p.stdin,stdout:p.stdout,stderr:p.stderr,generic:p.env.TERM&&p.env.TERM.toLowerCase()||"unknown",appId:i.safe?i.appId:undefined,isTTY:i.isTTY,isSSH:i.isSSH,processSigwinch:true,preferProcessSigwinch:!!n.globalConfig.preferProcessSigwinch});if(t){t(undefined,e)}return e}try{r=await n.getParentTerminalInfo();e=n.createTerminal({stdin:p.stdin,stdout:p.stdout,stderr:p.stderr,generic:p.env.TERM&&p.env.TERM.toLowerCase()||"unknown",appId:r.appId,appName:r.appName,isTTY:i.isTTY,isSSH:i.isSSH,pid:r.pid,processSigwinch:true,preferProcessSigwinch:!!n.globalConfig.preferProcessSigwinch})}catch(t){e=n.createTerminal({stdin:p.stdin,stdout:p.stdout,stderr:p.stderr,generic:p.env.TERM&&p.env.TERM.toLowerCase()||"unknown",appId:i.safe?i.appId:undefined,isTTY:i.isTTY,isSSH:i.isSSH,processSigwinch:true,preferProcessSigwinch:!!n.globalConfig.preferProcessSigwinch})}if(t){t(undefined,e)}return e}}).call(this)}).call(this,t("_process"))},{"./termkit.js":55,_process:185,child_process:141,os:172,path:184,seventh:113}],13:[function(t,e,r){"use strict";const i=t("./Element.js");const n=t("./Text.js");const s=t("../spChars.js");function o(t){t=!t?{}:t.internal?t:Object.create(t);t.internal=true;t.attr=t.attr||{};if(Array.isArray(t.animation)){this.animation=t.animation}else if(typeof t.animation==="string"){this.animation=s.animation[t.animation]||s.animation.lineSpinner;if(t.contentHasMarkup!==false){t.contentHasMarkup=true}}else{this.animation=s.animation.lineSpinner}this.animation=this.animation.map(t=>Array.isArray(t)?t:[t]);this.isAnimated=false;this.frameDuration=t.frameDuration||150;this.animationSpeed=t.animationSpeed||1;this.frame=t.frame||0;this.autoUpdateTimer=null;this.autoUpdate=this.autoUpdate.bind(this);t.content=this.animation[this.frame];n.call(this,t);if(this.elementType==="AnimatedText"&&!t.noDraw){this.draw();this.animate()}}e.exports=o;i.inherit(o,n);o.prototype.inlineCursorRestoreAfterDraw=true;o.prototype.animate=function(t=1){this.isAnimated=!!t;this.animationSpeed=+t||0;if(!this.isAnimated){if(this.autoUpdateTimer){clearTimeout(this.autoUpdateTimer)}this.autoUpdateTimer=null;return}if(!this.autoUpdateTimer){this.autoUpdateTimer=setTimeout(()=>this.autoUpdate(),this.frameDuration/this.animationSpeed)}};o.prototype.autoUpdate=function(){this.frame=(this.frame+1)%this.animation.length;this.content=this.animation[this.frame];this.draw();this.autoUpdateTimer=setTimeout(()=>this.autoUpdate(),this.frameDuration/this.animationSpeed)}},{"../spChars.js":53,"./Element.js":25,"./Text.js":36}],14:[function(t,e,r){"use strict";const d=t("./Element.js");const i=t("../spChars.js").bar;function n(t){t=!t?{}:t.internal?t:Object.create(t);t.internal=true;d.call(this,t);this.minValue=+t.minValue||0;this.maxValue=t.maxValue!==undefined?+t.maxValue||0:1;this.value=+t.value||0;if(this.valuethis.maxValue){this.value=this.maxValue}this.borderAttr=t.borderAttr||{bold:true};this.bodyAttr=t.bodyAttr||{color:"blue"};this.barChars=i.classic;if(typeof t.barChars==="object"){this.barChars=t.barChars}else if(typeof t.barChars==="string"&&i[t.barChars]){this.barChars=i[t.barChars]}this.overTextFullAttr=t.overTextFullAttr||{bgColor:"blue"};this.overTextEmptyAttr=t.overTextEmptyAttr||{bgColor:"default"};if(this.elementType==="Bar"&&!t.noDraw){this.draw()}}e.exports=n;d.inherit(n);n.prototype.preDrawSelf=function(){var t,e,r,i,n,s,o=0,a,u=0,l=false,f=null,h=this.outputWidth-2,c=(this.value-this.minValue)/(this.maxValue-this.minValue);if(!c||c<0){c=0}else if(c>1){c=1}r=Math.floor(c*h);n=c*h-r;if(this.content){if(n<.5){s=d.truncateContent(this.content,r,this.contentHasMarkup);o=d.getLastTruncateWidth();if(o=.5){r++}}else if(this.barChars.body.length===3){f=this.barChars.body[1]}else if(this.barChars.body.length===4){f=this.barChars.body[n<.5?1:2]}else{t=Math.floor(1.5+n*(this.barChars.body.length-3));f=this.barChars.body[t]}}i=h-r-(f?1:0);if(this.content&&o0){this.outputDst.put({x:e,y:this.outputY,attr:this.bodyAttr,markup:true},this.barChars.body[0].repeat(r-o));e+=r-o}if(f){this.outputDst.put({x:e++,y:this.outputY,attr:this.bodyAttr,markup:true},f)}if(u){this.outputDst.put({x:e,y:this.outputY,attr:this.overTextEmptyAttr,markup:true},a);e+=u}if(i-u>0){this.outputDst.put({x:e,y:this.outputY,attr:this.bodyAttr,markup:true},this.barChars.body[this.barChars.body.length-1].repeat(i-u));e+=i-u}this.outputDst.put({x:e,y:this.outputY,attr:this.borderAttr,markup:true},this.barChars.border[1])};n.prototype.getValue=function(){return this.value};n.prototype.setValue=function(t,e){this.value=+t||0;if(this.valuethis.maxValue){this.value=this.maxValue}if(!e){this.draw()}}},{"../spChars.js":53,"./Element.js":25}],15:[function(o,a,t){(function(s){(function(){"use strict";const e=o("tree-kit");const r=o("./Element.js");const t=o("./Button.js");function i(t={}){r.call(this,t);this.backgroundAttr=t.backgroundAttr||{bgColor:"white",color:"black"};this.contentEllipsis=t.contentEllipsis||"…";this.previousPageContent=t.previousPageContent||"«";this.previousPageContentHasMarkup=!!t.previousPageContentHasMarkup;this.nextPageContent=t.nextPageContent||"»";this.nextPageContentHasMarkup=!!t.nextPageContentHasMarkup;this.itemsDef=t.items||[];this.previousPageDef=t.previousPage;this.nextPageDef=t.nextPage;this.masterDef=t.master;this.separatorDef=t.separator;this.buttons=[];this.hotkeyToButtonIndex=new Map;this.focusChild=null;this.page=0;this.maxPage=0;this.hasSubmenu=!!t.submenu;this.isSubmenu=!!t.isSubmenu;this.submenu=null;this.submenuParentButton=null;this.submenuOptions=null;if(this.hasSubmenu){this.submenuOptions=e.extend(null,{},t,{internal:true,parent:null,items:null});if(t.submenu&&typeof t.submenu==="object"){Object.assign(this.submenuOptions,t.submenu)}}this.onButtonSubmit=this.onButtonSubmit.bind(this);this.onButtonToggle=this.onButtonToggle.bind(this);this.onButtonFocus=this.onButtonFocus.bind(this);this.onButtonBlinked=this.onButtonBlinked.bind(this);this.onSubmenuSubmit=this.onSubmenuSubmit.bind(this);this.onWheel=this.onWheel.bind(this);this.onFocus=this.onFocus.bind(this);this.buttonBlurAttr=t.buttonBlurAttr||this.defaultOptions.buttonBlurAttr||{bgColor:"black",color:"white",bold:true};this.buttonEvenBlurAttr=t.buttonEvenBlurAttr||null;this.buttonFocusAttr=t.buttonFocusAttr||this.defaultOptions.buttonFocusAttr||{bgColor:"white",color:"black",bold:true};this.buttonDisabledAttr=t.buttonDisabledAttr||this.defaultOptions.buttonDisabledAttr||{bgColor:"black",color:"gray",bold:true};this.buttonSubmittedAttr=t.buttonSubmittedAttr||this.defaultOptions.buttonSubmittedAttr||{bgColor:"gray",color:"brightWhite",bold:true};this.buttonTurnedOnBlurAttr=t.buttonTurnedOnBlurAttr||this.defaultOptions.buttonTurnedOnBlurAttr||{bgColor:"cyan"};this.buttonTurnedOnFocusAttr=t.buttonTurnedOnFocusAttr||this.defaultOptions.buttonTurnedOnFocusAttr||{bgColor:"brightCyan",color:"gray",bold:true};this.buttonTurnedOffBlurAttr=t.buttonTurnedOffBlurAttr||this.defaultOptions.buttonTurnedOffBlurAttr||{bgColor:"gray",dim:true};this.buttonTurnedOffFocusAttr=t.buttonTurnedOffFocusAttr||this.defaultOptions.buttonTurnedOffFocusAttr||{bgColor:"white",color:"black",bold:true};this.blurLeftPadding=t.blurLeftPadding??t.leftPadding??"";this.blurRightPadding=t.blurRightPadding??t.rightPadding??"";this.focusLeftPadding=t.focusLeftPadding??t.leftPadding??"";this.focusRightPadding=t.focusRightPadding??t.rightPadding??"";this.disabledLeftPadding=t.disabledLeftPadding??t.leftPadding??"";this.disabledRightPadding=t.disabledRightPadding??t.rightPadding??"";this.submittedLeftPadding=t.submittedLeftPadding??t.leftPadding??"";this.submittedRightPadding=t.submittedRightPadding??t.rightPadding??"";this.turnedOnBlurLeftPadding=t.turnedOnBlurLeftPadding??t.turnedOnLeftPadding??this.blurLeftPadding;this.turnedOnBlurRightPadding=t.turnedOnBlurRightPadding??t.turnedOnRightPadding??this.blurRightPadding;this.turnedOffBlurLeftPadding=t.turnedOffBlurLeftPadding??t.turnedOffLeftPadding??this.blurLeftPadding;this.turnedOffBlurRightPadding=t.turnedOffBlurRightPadding??t.turnedOffRightPadding??this.blurRightPadding;this.turnedOnFocusLeftPadding=t.turnedOnFocusLeftPadding??t.turnedOnLeftPadding??this.focusLeftPadding;this.turnedOnFocusRightPadding=t.turnedOnFocusRightPadding??t.turnedOnRightPadding??this.focusRightPadding;this.turnedOffFocusLeftPadding=t.turnedOffFocusLeftPadding??t.turnedOffLeftPadding??this.focusLeftPadding;this.turnedOffFocusRightPadding=t.turnedOffFocusRightPadding??t.turnedOffRightPadding??this.focusRightPadding;this.paddingHasMarkup=!!t.paddingHasMarkup;if(t.keyBindings){this.keyBindings=t.keyBindings}if(t.buttonKeyBindings){this.buttonKeyBindings=t.buttonKeyBindings}if(t.buttonActionKeyBindings){this.buttonActionKeyBindings=t.buttonActionKeyBindings}if(t.toggleButtonKeyBindings){this.toggleButtonKeyBindings=t.toggleButtonKeyBindings}if(t.toggleButtonActionKeyBindings){this.toggleButtonActionKeyBindings=t.toggleButtonActionKeyBindings}this.on("key",this.onKey);this.on("wheel",this.onWheel);this.on("focus",this.onFocus)}a.exports=i;r.inherit(i);i.prototype.needInput=true;i.prototype.destroy=function(t,e=false){if(this.destroyed){return}if(this.submenu){this.submenu.destroy(true)}r.prototype.destroy.call(this,t,e)};i.prototype.previousPage=function(t){var e;if(this.maxPage&&this.page>0){this.page--;this.initPage();this.focusChild=this.children[this.children.length-2];e=this.document.giveFocusTo_(this.focusChild,t);if(!e){this.document.focusPrevious()}this.updateDraw()}};i.prototype.nextPage=function(t){var e;if(this.maxPage&&this.page!t.disabled&&t.value===e);if(!n){return}if(this.page!==n.page||r){this.page=n.page;this.initPage()}s=this.buttons.find(t=>t.def===n);if(!s){return}this.focusChild=s;i=this.document.giveFocusTo_(this.focusChild,t);if(!i){this.document.focusNext()}this.draw()};i.prototype.setItem=function(e,t){var r,i;r=this.itemsDef.find(t=>t.value===e);if(!r){return false}Object.assign(r,t);i=this.focusChild&&this.focusChild.value;this.initChildren(true);if(i!==undefined){this.focusValue(i,"refocus",true)}else{this.initPage();this.draw()}return true};i.prototype.onWheel=function(t){if(t.yDirection<0){this.previousPage("backCycle")}else if(t.yDirection>0){this.nextPage("cycle")}};i.prototype.onFocus=function(t,e){if(e==="cycle"||e==="backCycle"){return}if(t){s.nextTick(()=>{let t=e==="clear"?e:undefined;if(this.focusChild&&!this.focusChild.destroyed){this.document.giveFocusTo(this.focusChild,t||"delegate")}else{this.focusChild=this.focusNextChild(undefined,t)}})}};i.prototype.onButtonSubmit=function(t,e,r){switch(r.internalRole){case"previousPage":this.previousPage();break;case"nextPage":this.nextPage();break;default:if(this.hasSubmenu&&r.def.items){if(this.submenuOptions.openOn==="parentSubmit"){this.openSubmenu(r.value,r)}if(this.submenu){this.document.giveFocusTo(this.submenu)}}else{this.emit("submit",t,e,this,r)}}};i.prototype.onButtonBlinked=function(t,e,r){switch(r.internalRole){case"previousPage":case"nextPage":break;default:if(this.hasSubmenu&&r.def.items){if(this.submenuOptions.openOn==="parentBlinked"){this.openSubmenu(r.value,r)}}else{this.emit("blinked",t,e,this,r)}}};i.prototype.onButtonFocus=function(t,e,r){switch(r.internalRole){case"previousPage":case"nextPage":break;default:if(t&&this.hasSubmenu&&r.def.items&&this.submenuOptions.openOn==="parentFocus"){this.openSubmenu(r.value,r)}this.emit("itemFocus",r.value,t,r)}};i.prototype.onSubmenuSubmit=function(t,e,r,n){r.once("blinked",(t,e,r,i)=>{if(this.submenuOptions.closeOn==="childSubmit"){this.closeSubmenu();this.document.giveFocusTo(this.submenuParentButton||this)}this.emit("blinked",t,e,this,n)});this.emit("submit",t,e,this,n)};i.prototype.openSubmenu=function(e,r=null){var t,i,n,s,o=r?this.itemsDef.find(t=>t===r.def):this.itemsDef.find(t=>t.value===e);if(!o||!o.items||!o.items.length){return}if(this.submenu){if(this.submenu.def===o){return}this.closeSubmenu()}this.submenuParentButton=r;switch(this.submenuOptions.disposition){case"overwrite":t=this.outputX;i=this.outputY;n=this.submenuOptions.width;s=this.submenuOptions.height;break;case"right":default:t=this.outputX+this.outputWidth;i=this.outputY;n=this.submenuOptions.width||this.outputWidth;break}if(this.submenuOptions.hideParent){this.children.forEach(t=>t.hidden=true)}this.submenu=new this.constructor(Object.assign({},this.submenuOptions,{internal:true,parent:this,isSubmenu:true,def:o,outputX:t,outputY:i,outputWidth:n,outputHeight:s,items:o.items,noDraw:true}));this.outerDraw();if(this.submenuOptions.focusOnOpen){this.document.giveFocusTo(this.submenu)}this.submenu.on("submit",this.onSubmenuSubmit);this.submenu.on("itemFocus",(...t)=>this.emit("itemFocus",...t))};i.prototype.closeSubmenu=function(){if(!this.submenu){return false}if(this.submenuOptions.hideParent){this.children.forEach(t=>t.hidden=false)}this.submenu.destroy();this.submenu=null;return true};i.prototype.defaultOptions={};i.prototype.buttonKeyBindings={};i.prototype.buttonActionKeyBindings={};i.prototype.toggleButtonKeyBindings={};i.prototype.toggleButtonActionKeyBindings={};i.prototype.initPage=function(){};i.prototype.onButtonToggle=function(){};i.prototype.childUseParentKeyValue=false;const n=i.prototype.userActions;n.character=n.specialKey=function(t){var e=this.hotkeyToButtonIndex.get(t);if(e!==undefined&&this.buttons[e]){if(this.document){this.document.giveFocusTo(this.buttons[e])}this.buttons[e].submit()}else{return false}};n.previous=function(){this.focusChild=this.focusPreviousChild(!this.maxPage);if(this.focusChild===this.children[0]&&this.maxPage&&this.page>0){this.previousPage("backCycle")}};n.next=function(){this.focusChild=this.focusNextChild(!this.maxPage);if(this.focusChild===this.children[this.children.length-1]&&this.maxPage&&this.page0){this.previousPage("backCycle")}};n.nextPage=function(){if(this.maxPage&&this.pagethis.blink(t,e-1),80)}else{this.updateStatus();this.draw();this.emit("blinked",this.value,t,this)}};s.prototype.onFocus=function(t,e){this.updateStatus();this.draw()};s.prototype.updateStatus=function(){if(this.disabled){this.attr=this.disabledAttr;this.content=this.disabledContent;this.leftPadding=this.disabledLeftPadding;this.rightPadding=this.disabledRightPadding}else if(this.submitted){this.attr=this.submittedAttr;this.content=this.submittedContent;this.leftPadding=this.submittedLeftPadding;this.rightPadding=this.submittedRightPadding}else if(this.hasFocus){this.attr=this.focusAttr;this.content=this.focusContent;this.leftPadding=this.focusLeftPadding;this.rightPadding=this.focusRightPadding}else{this.attr=this.blurAttr;this.content=this.blurContent;this.leftPadding=this.blurLeftPadding;this.rightPadding=this.blurRightPadding}};s.prototype.submit=function(t){if(this.submitOnce){this.submitted=true}this.emit("submit",this.value,t,this);this.blink(t)};s.prototype.unsubmit=function(){this.submitted=false;this.updateStatus()};s.prototype.onHover=function(t){if(this.disabled||this.submitted){return}this.document.giveFocusTo(this,"hover")};s.prototype.onClick=function(t){if(this.disabled||this.submitted){return}this.document.giveFocusTo(this,"select");this.submit(this.actionKeyBindings.click)};s.prototype.onRightClick=function(t){if(this.disabled||this.submitted){return}this.document.giveFocusTo(this,"select");this.submit(this.actionKeyBindings.rightClick)};s.prototype.onMiddleClick=function(t){if(this.disabled||this.submitted){return}this.document.giveFocusTo(this,"select");this.submit(this.actionKeyBindings.middleClick)};s.prototype.onShortcut=function(){if(this.disabled||this.submitted){return}this.document.giveFocusTo(this,"select");this.submit()};const o=s.prototype.userActions;o.submit=function(t){if(this.disabled||this.submitted){return}this.submit(this.actionKeyBindings[t])}},{"./Element.js":25,"./Text.js":36}],18:[function(t,e,r){"use strict";const f=t("./Element.js");const i=t("./BaseMenu.js");const l=t("./Button.js");const h=t("./ToggleButton.js");function n(t){t=!t?{}:t.internal?t:Object.create(t);t.internal=true;this.onParentResize=this.onParentResize.bind(this);if(!t.outputWidth&&!t.width){if(t.parent){t.outputWidth=Math.min(t.parent.inputWidth,t.parent.outputWidth)}else if(t.inlineTerm){t.outputWidth=t.inlineTerm.width}}this.buttonsMaxWidth=0;this.buttonPaddingWidth=0;this.buttonSymbolWidth=0;this.pageHeight=0;this.pageItemsDef=null;if(!t.multiLineItems){t.height=t.items&&t.items.length}i.call(this,t);this.maxHeight=this.autoHeight&&this.outputDst?Math.round(this.outputDst.height*this.autoHeight):t.maxHeight?t.maxHeight:t.pageMaxHeight?t.pageMaxHeight:this.strictInline?this.inlineTerm.height:Infinity;this.on("parentResize",this.onParentResize);this.multiLineItems=!!t.multiLineItems;this.initChildren();if(this.elementType==="ColumnMenu"&&!t.noDraw){this.draw()}}e.exports=n;f.inherit(n,i);n.prototype.inlineNewLine=true;n.prototype.ButtonClass=l;n.prototype.defaultOptions={buttonBlurAttr:{bgColor:"black",color:"white",bold:true},buttonEvenBlurAttr:null,buttonFocusAttr:{bgColor:"white",color:"black",bold:true},buttonDisabledAttr:{bgColor:"black",color:"gray",bold:true},buttonSubmittedAttr:{bgColor:"gray",color:"brightWhite",bold:true},buttonTurnedOnBlurAttr:{bgColor:"cyan"},buttonTurnedOnFocusAttr:{bgColor:"brightCyan",color:"gray",bold:true},buttonTurnedOffBlurAttr:{bgColor:"gray",dim:true},buttonTurnedOffFocusAttr:{bgColor:"white",color:"black",bold:true}};n.prototype.keyBindings={UP:"previous",DOWN:"next",PAGE_UP:"previousPage",PAGE_DOWN:"nextPage",HOME:"firstPage",END:"lastPage",ALT_ENTER:"submit",ESCAPE:"parentMenu",LEFT:"parentMenu",RIGHT:"submenu"};n.prototype.buttonKeyBindings={ENTER:"submit",KP_ENTER:"submit"};n.prototype.toggleButtonKeyBindings={ENTER:"toggle",KP_ENTER:"toggle"};n.prototype.initChildren=function(t=false){this.pageItemsDef=[];this.buttonPaddingWidth=Math.max(f.computeContentWidth(this.blurLeftPadding,this.paddingHasMarkup),f.computeContentWidth(this.focusLeftPadding,this.paddingHasMarkup),f.computeContentWidth(this.disabledLeftPadding,this.paddingHasMarkup),f.computeContentWidth(this.submittedLeftPadding,this.paddingHasMarkup),f.computeContentWidth(this.turnedOnFocusLeftPadding,this.paddingHasMarkup),f.computeContentWidth(this.turnedOffFocusLeftPadding,this.paddingHasMarkup),f.computeContentWidth(this.turnedOnBlurLeftPadding,this.paddingHasMarkup),f.computeContentWidth(this.turnedOffBlurLeftPadding,this.paddingHasMarkup))+Math.max(f.computeContentWidth(this.blurRightPadding,this.paddingHasMarkup),f.computeContentWidth(this.focusRightPadding,this.paddingHasMarkup),f.computeContentWidth(this.disabledRightPadding,this.paddingHasMarkup),f.computeContentWidth(this.submittedRightPadding,this.paddingHasMarkup),f.computeContentWidth(this.turnedOnFocusRightPadding,this.paddingHasMarkup),f.computeContentWidth(this.turnedOffFocusRightPadding,this.paddingHasMarkup),f.computeContentWidth(this.turnedOnBlurRightPadding,this.paddingHasMarkup),f.computeContentWidth(this.turnedOffBlurRightPadding,this.paddingHasMarkup));if(this.buttonPaddingWidth>this.outputWidth){return}var a=f.computeContentWidth(this.contentEllipsis,false);this.previousPageDef=Object.assign({content:"▲",internalRole:"previousPage"},this.previousPageDef);this.previousPageDef.contentHasMarkup=this.previousPageDef.contentHasMarkup||this.previousPageDef.markup;this.previousPageDef.width=this.buttonPaddingWidth+f.computeContentWidth(this.previousPageDef.content,this.previousPageDef.contentHasMarkup);this.previousPageDef.buttonContent=this.previousPageDef.content;this.nextPageDef=Object.assign({content:"▼",internalRole:"nextPage"},this.nextPageDef);this.nextPageDef.contentHasMarkup=this.nextPageDef.contentHasMarkup||this.nextPageDef.markup;this.nextPageDef.width=this.buttonPaddingWidth+f.computeContentWidth(this.nextPageDef.content,this.nextPageDef.contentHasMarkup);this.nextPageDef.buttonContent=this.nextPageDef.content;if(this.masterDef){this.masterDef=Object.assign({content:"column-menu",internalRole:"master"},this.masterDef);this.masterDef.contentHasMarkup=this.masterDef.contentHasMarkup||this.masterDef.markup;this.masterDef.buttonContent=this.masterDef.content;if(this.masterDef.symbol){this.buttonSymbolWidth=1+f.computeContentWidth(this.masterDef.symbol);this.masterDef.buttonContent+=" "+this.masterDef.symbol}this.masterDef.width=this.buttonPaddingWidth+f.computeContentWidth(this.masterDef.buttonContent,this.masterDef.contentHasMarkup)}this.buttonsMaxWidth=Math.max(this.buttonsMaxWidth,this.previousPageDef.width,this.nextPageDef.width,this.masterDef?this.masterDef.width:0);var u=0,l=0;this.itemsDef.forEach((t,e)=>{t.contentHasMarkup=t.contentHasMarkup||t.markup;t.buttonContent=t.content;t.buttonBlurContent=t.blurContent;t.buttonFocusContent=t.focusContent;t.buttonDisabledContent=t.disabledContent;t.buttonSubmittedContent=t.submittedContent;t.buttonTurnedOnBlurContent=t.turnedOnBlurContent;t.buttonTurnedOffBlurContent=t.turnedOffBlurContent;t.buttonTurnedOnFocusContent=t.turnedOnFocusContent;t.buttonTurnedOffFocusContent=t.turnedOffFocusContent;var r=f.computeContentWidth(t.content,t.contentHasMarkup),i=1,n=e===this.itemsDef.length-1,s=Math.max(1,!n?this.maxHeight-1:this.maxHeight),o=this.buttonPaddingWidth+r-this.outputWidth;if(o>0){if(this.multiLineItems){t.buttonContent=f.wordWrapContent(t.content,this.outputWidth-this.buttonPaddingWidth,t.contentHasMarkup);r=this.outputWidth-this.buttonPaddingWidth;i=t.buttonContent.length}else{t.buttonContent=f.truncateContent(t.content,r-o-a,t.contentHasMarkup)+this.contentEllipsis;r=f.computeContentWidth(t.buttonContent,t.contentHasMarkup)}}if(e&&l+i>s){u++;l=1;if(l+i>s&&i>1){i=s-l;t.buttonContent.length=i;t.buttonContent[i-1]=f.truncateContent(t.buttonContent[i-1].trimRight(),r-a,t.contentHasMarkup)+this.contentEllipsis}}l+=i;t.width=this.buttonPaddingWidth+r;t.page=u;if(t.width+this.buttonSymbolWidth>this.buttonsMaxWidth){this.buttonsMaxWidth=t.width+this.buttonSymbolWidth}if(!this.pageItemsDef[u]){this.pageItemsDef[u]=[]}this.pageItemsDef[u].push(t)});this.maxPage=u;if(this.separatorDef){this.separatorDef=Object.assign({content:"-",disabled:true,internalRole:"separator"},this.separatorDef);this.separatorDef.width=f.computeContentWidth(this.separatorDef.content,this.separatorDef.contentHasMarkup);if(this.separatorDef.contentRepeat&&this.separatorDef.width{if(e){t.unshift(this.previousPageDef)}if(ethis.buttonsMaxWidth){this.outputWidth=this.buttonsMaxWidth}if(this.elementType==="ColumnMenu"&&!t){this.initPage()}};n.prototype.initPage=function(t=this.page){var a=0,u=0;if(!this.pageItemsDef[t]){return}this.buttons.forEach(t=>t.destroy(false,true));this.buttons.length=0;this.pageItemsDef[t].forEach((t,e)=>{var r,i,n,s,o;if(!Array.isArray(t.buttonContent)){t.buttonContent=[t.buttonContent+" ".repeat(this.buttonsMaxWidth-t.width)]}r=t.internalRole?l:t.type==="button"?l:t.type==="toggle"?h:this.ButtonClass??l;i=r===h||r.prototype instanceof h;n=t.key;s=this.childUseParentKeyValue&&n&&this.value&&typeof this.value==="object"?this.value[n]:t.value===undefined&&!i&&t.key?t.key:t.value;if(e%2){o=t.blurAttr||this.buttonBlurAttr}else{o=t.evenBlurAttr||t.blurAttr||this.buttonEvenBlurAttr||this.buttonBlurAttr}this.buttons[e]=new r({internal:true,parent:this,childId:e,internalRole:t.internalRole,contentHasMarkup:t.contentHasMarkup,content:t.buttonContent,blurContent:t.buttonBlurContent,focusContent:t.buttonFocusContent,disabledContent:t.buttonDisabledContent,submittedContent:t.buttonSubmittedContent,turnedOnBlurContent:t.buttonTurnedOnBlurContent,turnedOffBlurContent:t.buttonTurnedOffBlurContent,turnedOnFocusContent:t.buttonTurnedOnFocusContent,turnedOffFocusContent:t.buttonTurnedOffFocusContent,disabled:t.disabled,def:t,key:n,value:s,outputX:this.outputX+a,outputY:this.outputY+u,blurAttr:o,focusAttr:t.focusAttr||this.buttonFocusAttr,disabledAttr:t.disabledAttr||this.buttonDisabledAttr,submittedAttr:t.submittedAttr||this.buttonSubmittedAttr,turnedOnFocusAttr:t.turnedOnFocusAttr||this.buttonTurnedOnFocusAttr,turnedOffFocusAttr:t.turnedOffFocusAttr||this.buttonTurnedOffFocusAttr,turnedOnBlurAttr:t.turnedOnBlurAttr||this.buttonTurnedOnBlurAttr,turnedOffBlurAttr:t.turnedOffBlurAttr||this.buttonTurnedOffBlurAttr,blurLeftPadding:this.blurLeftPadding,blurRightPadding:this.blurRightPadding,focusLeftPadding:this.focusLeftPadding,focusRightPadding:this.focusRightPadding,disabledLeftPadding:this.disabledLeftPadding,disabledRightPadding:this.disabledRightPadding,submittedLeftPadding:this.submittedLeftPadding,submittedRightPadding:this.submittedRightPadding,turnedOnFocusLeftPadding:this.turnedOnFocusLeftPadding,turnedOnFocusRightPadding:this.turnedOnFocusRightPadding,turnedOffFocusLeftPadding:this.turnedOffFocusLeftPadding,turnedOffFocusRightPadding:this.turnedOffFocusRightPadding,turnedOnBlurLeftPadding:this.turnedOnBlurLeftPadding,turnedOnBlurRightPadding:this.turnedOnBlurRightPadding,turnedOffBlurLeftPadding:this.turnedOffBlurLeftPadding,turnedOffBlurRightPadding:this.turnedOffBlurRightPadding,paddingHasMarkup:this.paddingHasMarkup,keyBindings:i?this.toggleButtonKeyBindings:this.buttonKeyBindings,actionKeyBindings:i?this.toggleButtonActionKeyBindings:this.buttonActionKeyBindings,shortcuts:t.shortcuts,noDraw:true});this.buttons[e].on("submit",this.onButtonSubmit);this.buttons[e].on("blinked",this.onButtonBlinked);this.buttons[e].on("focus",this.onButtonFocus);if(i){this.buttons[e].on("toggle",this.onButtonToggle)}u+=this.buttons[e].outputHeight});if(u{if(t.internalRole||!t.key||!(t instanceof o)){return}t.setValue(!!this.value[t.key],true,true)});if(!t){this.draw()}};a.prototype.setKeyValue=function(e,r,t){if(!e){return}this.value[e]=!!r;if(!this.buttons){return}this.buttons.forEach(t=>{if(t.internalRole||t.key!==e||!(t instanceof o)){return}t.setValue(!!r,true,true)});if(!t){this.draw()}};a.prototype.onButtonToggle=function(t,e,r){if(!r.key){return}if(t){this.value[r.key]=true}else{delete this.value[r.key]}this.emit("submit",r.key,t,this,r)}},{"./Button.js":17,"./ColumnMenu.js":18,"./Element.js":25,"./ToggleButton.js":39}],20:[function(t,e,r){"use strict";const i=t("./Element.js");const n=t("./ColumnMenu.js");const s=t("./ToggleButton.js");function o(t){t=!t?{}:t.internal?t:Object.create(t);t.internal=true;if(t.value&&typeof t.value==="object"){this.setValue(t.value,true)}else{this.value={}}n.call(this,t);if(this.elementType==="ColumnMenuMulti"&&!t.noDraw){this.draw()}}e.exports=o;i.inherit(o,n);o.prototype.ButtonClass=s;o.prototype.childUseParentKeyValue=true;o.prototype.initChildren=function(t=false){n.prototype.initChildren.call(this);if(this.elementType==="ColumnMenuMulti"&&!t){this.initPage()}};o.prototype.setValue=function(e,t){if(!e||typeof e!=="object"){return}this.value={};if(Array.isArray(e)||e instanceof Set){for(let t of e){if(t&&typeof t==="string"){this.value[t]=true}}}else{for(let t in e){this.value[t]=!!e[t]}}if(!this.buttons){return}this.buttons.forEach(t=>{if(t.internalRole||!t.key||!(t instanceof s)){return}t.setValue(!!this.value[t.key],true,true)});if(!t){this.draw()}};o.prototype.setKeyValue=function(e,r,t){if(!e){return}this.value[e]=!!r;if(!this.buttons){return}this.buttons.forEach(t=>{if(t.internalRole||t.key!==e||!(t instanceof s)){return}t.setValue(!!r,true,true)});if(!t){this.draw()}};o.prototype.onButtonSubmit=function(t,e,r){switch(r.internalRole){case"previousPage":this.previousPage();break;case"nextPage":this.nextPage();break;default:this.emit("submit",this.value,e,this,r)}};o.prototype.onButtonToggle=function(t,e,r){if(!r.key){return}if(t){this.value[r.key]=true}else{delete this.value[r.key]}this.emit("itemToggle",r.key,t,r)};const a=o.prototype.userActions;a.submit=function(){this.emit("submit",this.value,undefined,this)}},{"./ColumnMenu.js":18,"./Element.js":25,"./ToggleButton.js":39}],21:[function(t,e,r){"use strict";const i=t("./Element.js");const n=t("../ScreenBuffer.js");function s(t){t=!t?{}:t.internal?t:Object.create(t);t.internal=true;i.call(this,t);this.onClick=this.onClick.bind(this);this.onDrag=this.onDrag.bind(this);this.onWheel=this.onWheel.bind(this);if(t.keyBindings){this.keyBindings=t.keyBindings}this.palette=t.palette||this.document&&this.document.palette;this.object2attr=t=>n.object2attr(t,this.palette&&this.palette.colorNameToIndex);this.scrollable=!!t.scrollable;this.hasVScrollBar=this.scrollable&&!!t.vScrollBar;this.hasHScrollBar=this.scrollable&&!!t.hScrollBar;this.scrollX=t.scrollX||0;this.scrollY=t.scrollY||0;this.vScrollBarSlider=null;this.hScrollBarSlider=null;this.movable=!!t.movable;this.viewportX=this.outputX+this.containerBorderSize;this.viewportY=this.outputY+this.containerBorderSize;this.viewportWidth=this.outputWidth-this.containerBorderSize*2;this.viewportHeight=this.outputHeight-this.containerBorderSize*2;this.inputX=t.inputX||this.viewportX+this.scrollX;this.inputY=t.inputY||this.viewportY+this.scrollY;this.inputWidth=t.inputWidth||this.viewportWidth;this.inputHeight=t.inputHeight||this.viewportHeight;this.inputDst=new n({dst:this.outputDst,x:this.inputX,y:this.inputY,width:this.inputWidth,height:this.inputHeight,palette:this.palette});this.deltaDraw=false;this.backgroundAttr=t.backgroundAttr||{bgColor:"default"};this.on("key",this.onKey);this.on("click",this.onClick);this.on("drag",this.onDrag);this.on("wheel",this.onWheel);this.initChildren();if(this.elementType==="Container"&&!t.noDraw){this.draw()}}e.exports=s;i.inherit(s);s.prototype.isContainer=true;s.prototype.containerBorderSize=0;const o=t("../termkit.js");s.prototype.keyBindings={UP:"tinyScrollUp",DOWN:"tinyScrollDown",PAGE_UP:"scrollUp",PAGE_DOWN:"scrollDown"," ":"scrollDown",HOME:"scrollTop",END:"scrollBottom",LEFT:"scrollLeft",RIGHT:"scrollRight"};s.prototype.initChildren=function(){if(this.hasVScrollBar){this.vScrollBarSlider=new o.Slider({internal:true,parent:this,x:this.viewportWidth-1,y:0,height:this.viewportHeight,isVertical:true,valueToRate:t=>-t/Math.max(1,this.inputHeight-this.viewportHeight),rateToValue:t=>-t*Math.max(1,this.inputHeight-this.viewportHeight),noDraw:true});this.vScrollBarSlider.on("slideStep",t=>this.scroll(0,-t*Math.ceil(this.viewportHeight/2)));this.vScrollBarSlider.on("slide",t=>this.scrollTo(null,t))}if(this.hasHScrollBar){this.hScrollBarSlider=new o.Slider({internal:true,parent:this,x:0,y:this.inputWidth-this.containerBorderSize*2-1,width:this.viewportWidth-this.hasVScrollBar,valueToRate:t=>-t/Math.max(1,this.inputWidth-this.viewportWidth),rateToValue:t=>-t*Math.max(1,this.inputWidth-this.viewportWidth),noDraw:true});this.hScrollBarSlider.on("slideStep",t=>this.scroll(-t*Math.ceil(this.viewportWidth/2),0));this.hScrollBarSlider.on("slide",t=>this.scrollTo(t,null))}};s.prototype.resizeViewport=function(t){this.viewportWidth=t.width;this.viewportHeight=t.height};s.prototype.resizeInput=function(e){if(!e.x){e.x=0}if(!e.y){e.y=0}this.inputDst.resize(e);this.inputWidth=this.inputDst.width;this.inputHeight=this.inputDst.height;this.children.forEach(t=>t.emit("parentResize",e))};s.prototype.resize=function(e){if(!e.x){e.x=0}if(!e.y){e.y=0}this.inputDst.resize(e);this.viewportWidth=this.inputWidth=this.inputDst.width;this.viewportHeight=this.inputHeight=this.inputDst.height;this.children.forEach(t=>t.emit("parentResize",e))};s.prototype.move=function(t,e,r=false){return this.moveTo(this.outputX+t,this.outputY+e,r)};s.prototype.moveTo=function(t,e,r=false){this.outputX=t;this.outputY=e;this.viewportX=this.outputX+this.containerBorderSize;this.viewportY=this.outputY+this.containerBorderSize;this.inputDst.x=this.inputX=this.viewportX+this.scrollX;this.inputDst.y=this.inputY=this.viewportY+this.scrollY;if(!r){this.outerDraw()}};s.prototype.scroll=function(t,e,r=false){return this.scrollTo(t?this.scrollX+t:null,e?this.scrollY+e:null,r)};s.prototype.scrollToTop=function(t=false){return this.scrollTo(null,0,t)};s.prototype.scrollToBottom=function(t=false){return this.scrollTo(null,this.viewportHeight-this.inputHeight,t)};s.prototype.scrollTo=function(t,e,r=false){if(!this.scrollable){return}if(t!==undefined&&t!==null){this.scrollX=Math.min(0,Math.max(Math.round(t),this.viewportWidth-this.inputWidth+1));this.inputDst.x=this.inputX=this.viewportX+this.scrollX}if(e!==undefined&&e!==null){this.scrollY=Math.min(0,Math.max(Math.round(e),this.viewportHeight-this.inputHeight));this.inputDst.y=this.inputY=this.viewportY+this.scrollY}if(this.vScrollBarSlider){this.vScrollBarSlider.setValue(this.scrollY,true);this.vScrollBarSlider.setSizeAndPosition({y:-this.scrollY})}if(this.hScrollBarSlider){this.hScrollBarSlider.setValue(this.scrollX,true)}if(!r){this.draw()}};s.prototype.preDrawSelf=function(){this.inputDst.fill({char:" ",attr:this.backgroundAttr})};s.prototype.postDrawSelf=function(){this.inputDst.draw({dst:this.outputDst,delta:this.deltaDraw,inline:this.strictInline,x:this.inputX,y:this.inputY,dstClipRect:{x:this.viewportX,y:this.viewportY,width:this.viewportWidth,height:this.viewportHeight}})};s.prototype.drawSelfCursor=function(t){if(t){this.restoreCursor()}else{this.inputDst.drawCursor()}};s.prototype.onClick=function(t){if(this.scrollable&&!this.hasFocus){this.document.giveFocusTo(this,"select")}};s.prototype.onWheel=function(t){if(!this.hasFocus){this.document.giveFocusTo(this,"select")}if(this.scrollable){this.scroll(0,-t.yDirection*Math.ceil(this.viewportHeight/5))}};s.prototype.onDrag=function(t){if(!this.movable||!t.dx&&!t.dy){return}this.move(t.dx,t.dy)};const a=s.prototype.userActions;a.tinyScrollUp=function(){this.scroll(0,Math.ceil(this.viewportHeight/5))};a.tinyScrollDown=function(){this.scroll(0,-Math.ceil(this.viewportHeight/5))};a.scrollUp=function(){this.scroll(0,Math.ceil(this.viewportHeight/2))};a.scrollDown=function(){this.scroll(0,-Math.ceil(this.viewportHeight/2))};a.scrollLeft=function(){this.scroll(Math.ceil(this.viewportWidth/2),0)};a.scrollRight=function(){this.scroll(-Math.ceil(this.viewportWidth/2),0)};a.scrollTop=function(){this.scrollToTop()};a.scrollBottom=function(){this.scrollToBottom()}},{"../ScreenBuffer.js":3,"../termkit.js":55,"./Element.js":25}],22:[function(t,e,r){"use strict";const i=t("./Element.js");const n=t("./Container.js");const s=t("seventh");function o(t){t=!t?{}:t.internal?t:Object.create(t);t.internal=true;if(!t.inlineTerm){t.outputX=1;t.outputY=1;t.outputWidth=t.outputDst.width;t.outputHeight=t.outputDst.height}this.strictInlineSupport=!!t.strictInline;this.noInput=!!t.noInput;n.call(this,t);this.parent=null;this.document=this;this.deltaDraw=!this.strictInline;this.id="_document"+"_"+a++;this.eventSource=t.eventSource;this.focusElement=null;this.hoverElement=null;this.clickOutCandidates=new Set;this.motionData={motion:false,xFrom:null,yFrom:null,x:null,y:null,dx:null,dy:null};this.draggingData={dragging:false,xFrom:null,yFrom:null,x:null,y:null,dx:null,dy:null,element:null,localDx:null,localDy:null};this.elements={};this.onEventSourceKey=this.onEventSourceKey.bind(this);this.onEventSourceMouse=this.onEventSourceMouse.bind(this);this.onEventSourceResize=this.onEventSourceResize.bind(this);if(!this.strictInline&&!this.noInput){this.eventSource.grabInput({mouse:"motion"})}this.elementByShortcut={};this.documentClipboards={};this.getSystemClipboard=s.debounceDelay(500,async t=>{if(!this.outputDst.getClipboard){return""}return this.outputDst.getClipboard(t)});this.setSystemClipboard=s.debounceUpdate(async(t,e)=>{if(!this.outputDst.setClipboard){return}await this.outputDst.setClipboard(t,e);await s.resolveTimeout(500)});this.clearSystemClipboard=s.debounceUpdate(async(t,e)=>{if(!this.outputDst.setClipboard){return}await this.outputDst.setClipboard("",e);await s.resolveTimeout(500)});this.eventSource.on("key",this.onEventSourceKey);this.eventSource.on("mouse",this.onEventSourceMouse);this.eventSource.on("resize",this.onEventSourceResize);if(this.elementType==="Document"&&!t.noDraw){this.draw()}}e.exports=o;i.inherit(o,n);o.prototype.destroy=function(t,e=false){if(this.destroyed){return}this.eventSource.off("key",this.onEventSourceKey);this.eventSource.off("mouse",this.onEventSourceMouse);this.eventSource.off("resize",this.onEventSourceResize);i.prototype.destroy.call(this,t,e);this.eventSource=null;this.setSystemClipboard=null;this.getSystemClipboard=null};o.prototype.keyBindings=Object.assign({},n.prototype.keyBindings,{TAB:"focusNext",SHIFT_TAB:"focusPrevious"});var a=0;o.prototype.assignId=function(t,e){if(!e||typeof e!=="string"||e[0]==="_"||this.elements[e]){e="_"+t.elementType+"_"+a++}t.id=e;this.elements[e]=t};o.prototype.unassignId=function(t,e){t.id=null;delete this.elements[e]};o.prototype.giveFocusTo=function(t,e="direct"){if(!(t instanceof i)){throw new TypeError(""+t+" is not an instance of Element.")}if(this.isAncestorOf(t)){return this.giveFocusTo_(t,e)}};o.prototype.giveFocusTo_=function(t,e){var r,i;if(this.focusElement!==t){if(this.focusElement){this.focusElement.hasFocus=false;this.focusElement.emit("focus",false,e,this.focusElement)}this.focusElement=t;this.focusElement.hasFocus=true;this.focusElement.emit("focus",true,e,this.focusElement)}i=!this.focusElement.disabled&&(this.focusElement.listenerCount("focus")||this.focusElement.listenerCount("key"));if(i){r=this.focusElement;while(r){if(r.listenerCount("clickOut")){this.clickOutCandidates.add(r)}r=r.parent}}return i};o.prototype.focusNext=function(){var t,e,r,i;if(!this.focusElement||!this.isAncestorOf(this.focusElement)){r=this}else{r=this.focusElement}if(r===this&&!this.children.length){return}e=r;for(;;){if(r.children.length&&!r.noChildFocus){r=r.children[0];if(!r.hidden){i=this.giveFocusTo_(r,"cycle")}}else if(r.parent){for(;;){t=r.parent.children.indexOf(r);if(t+1=0){r=r.parent.children[t-1];while(r.children.length&&!r.noChildFocus){r=r.children[r.children.length-1]}if(!r.hidden){i=this.giveFocusTo_(r,"backCycle")}}else if(r.parent.parent){r=r.parent;if(!r.hidden){i=this.giveFocusTo_(r,"backCycle")}}else{if(e===r.parent){return}r=r.parent.children[r.parent.children.length-1];while(r.children.length&&!r.noChildFocus){r=r.children[r.children.length-1]}if(!r.hidden){i=this.giveFocusTo_(r,"backCycle")}}}else if(r.children.length){r=r.children[r.children.length-1];while(r.children.length&&!r.noChildFocus){r=r.children[r.children.length-1]}if(!r.hidden){i=this.giveFocusTo_(r,"backCycle")}}else{return}if(e===r||!r.hidden&&i){break}}};o.prototype.onEventSourceKey=function(t,e,r){if(this.focusElement){this.bubblingEvent(this.focusElement,t,e,r)}else{this.defaultKeyHandling(t,e,r)}};o.prototype.bubblingEvent=function(r,i,n,s){if(r!==this){r.emit("key",i,n,s,(t,e)=>{if(!t){if(r.parent){this.bubblingEvent(r.parent,i,n,s)}else{this.defaultKeyHandling(i,n,s)}}})}else{this.defaultKeyHandling(i,n,s)}};o.prototype.defaultKeyHandling=function(t,e,r){switch(this.keyBindings[t]){case"focusNext":this.focusNext();break;case"focusPrevious":this.focusPrevious();break;default:if(this.elementByShortcut[t]&&this.elementByShortcut[t].document===this){this.elementByShortcut[t].emit("shortcut",t,e,r)}else{this.emit("key",t,e,r)}break}};o.prototype.setMetaKeyPrefix=function(t,e){this.eventSource.setMetaKeyPrefix(t,e)};o.prototype.getDocumentClipboard=function(t="content"){return this.documentClipboards[t]};o.prototype.setDocumentClipboard=function(t,e="content"){this.documentClipboards[e]=""+t};o.prototype.clearDocumentClipboard=function(t,e="content"){delete this.documentClipboards[e]};o.prototype.createShortcuts=function(e,...t){if(e.document!==this){return}t.forEach(t=>this.elementByShortcut[t]=e)};o.prototype.removeElementShortcuts=function(e){for(let t in this.elementByShortcut){if(this.elementByShortcut[t]===e){this.elementByShortcut[t]=null}}};o.prototype.onEventSourceMouse=function(t,e){var r;switch(t){case"MOUSE_LEFT_BUTTON_PRESSED":this.mouseClick(e);break;case"MOUSE_MOTION":this.mouseMotion(e);break;case"MOUSE_DRAG":this.mouseDrag(e);break;case"MOUSE_RIGHT_BUTTON_PRESSED":this.mouseClick(e,"rightClick");break;case"MOUSE_MIDDLE_BUTTON_PRESSED":this.mouseClick(e,"middleClick");break;case"MOUSE_WHEEL_UP":e.yDirection=-1;this.mouseWheel(e);break;case"MOUSE_WHEEL_DOWN":e.yDirection=1;this.mouseWheel(e);break;case"MOUSE_LEFT_BUTTON_RELEASED":if(this.draggingData.dragging){this.mouseDragEnd(e)}break}};const u=t=>t.listenerCount("click")||t.listenerCount("clickOut")||t.listenerCount("rightClick")||t.listenerCount("middleClick")||t.listenerCount("dragStart")||t.listenerCount("drag")||t.listenerCount("dragEnd")||t.listenerCount("hover")||t.listenerCount("leave")||t.listenerCount("enter");o.prototype.mouseClick=function(t,e="click"){var r=this.childrenAt(t.x-this.outputX,t.y-this.outputY,u);if(!r.length){if(this.clickOutCandidates.size){for(let t of this.clickOutCandidates){if(t.document===this){t.emit("clickOut")}}this.clickOutCandidates.clear()}return}if(this.clickOutCandidates.size){for(let t of this.clickOutCandidates){if(t.document===this&&t!==r[0].element&&!t.isAncestorOf(r[0].element)){t.emit("clickOut")}}this.clickOutCandidates.clear()}r[0].element.emit(e,{x:r[0].x,y:r[0].y},r[0].element)};o.prototype.mouseMotion=function(t,e=null){var r=false;if(!this.motionData.motion){r=true;this.mouseMotionStart(t)}this.motionData.dx=t.x-this.motionData.x;this.motionData.dy=t.y-this.motionData.y;this.motionData.x=t.x;this.motionData.y=t.y;if(!r&&!this.motionData.dx&&!this.motionData.dy){return}var i=this.childrenAt(t.x-this.outputX,t.y-this.outputY,u);if(!i.length){if(this.hoverElement){this.hoverElement.emit("leave");this.hoverElement=null}return}if(i[0]!==e){i[0].element.emit("hover",{x:i[0].x,y:i[0].y},i[0].element)}i.forEach(t=>{if(t.element.listenerCount("clickOut")){this.clickOutCandidates.add(t.element)}});if(i[0].element!==this.hoverElement){if(this.hoverElement){this.hoverElement.emit("leave")}this.hoverElement=i[0].element;this.hoverElement.emit("enter")}};o.prototype.mouseMotionStart=function(t){var e;this.motionData.motion=true;this.motionData.xFrom=t.xFrom;this.motionData.yFrom=t.yFrom;this.motionData.x=t.xFrom;this.motionData.y=t.yFrom};o.prototype.mouseMotionEnd=function(){this.motionData.motion=false};o.prototype.mouseDrag=function(r){var t=false;if(!this.draggingData.dragging){t=true;this.mouseDragStart(r)}this.draggingData.dx=r.x-this.draggingData.x;this.draggingData.dy=r.y-this.draggingData.y;this.draggingData.x=r.x;this.draggingData.y=r.y;if(!t&&!this.draggingData.dx&&!this.draggingData.dy){return}if(this.draggingData.element){let e=true;if(!this.draggingData.element.outerDrag){let t=this.childrenAt(r.x-this.outputX,r.y-this.outputY,u);e=t.some(t=>t.element===this.draggingData.element)}if(e){this.draggingData.element.emit("drag",{xFrom:this.draggingData.xFrom+this.draggingData.localDx,yFrom:this.draggingData.yFrom+this.draggingData.localDy,x:r.x+this.draggingData.localDx,y:r.y+this.draggingData.localDy,dx:this.draggingData.dx,dy:this.draggingData.dy},this.draggingData.element)}}this.mouseMotion(r,this.draggingData.element)};o.prototype.mouseDragStart=function(t){var e;this.draggingData.dragging=true;this.draggingData.xFrom=t.xFrom;this.draggingData.yFrom=t.yFrom;this.draggingData.x=t.xFrom;this.draggingData.y=t.yFrom;e=this.childrenAt(t.xFrom-this.outputX,t.yFrom-this.outputY,u);if(!e.length){this.draggingData.element=null;this.draggingData.localDx=null;this.draggingData.localDy=null;if(this.hoverElement){this.hoverElement.emit("leave");this.hoverElement=null}return}this.draggingData.element=e[0].element;this.draggingData.localDx=e[0].x-t.xFrom;this.draggingData.localDy=e[0].y-t.yFrom;e[0].element.emit("dragStart",{x:e[0].x,y:e[0].y},e[0].element)};o.prototype.mouseDragEnd=function(t){if(this.draggingData.element){this.draggingData.element.emit("dragEnd",{xFrom:this.draggingData.xFrom+this.draggingData.localDx,yFrom:this.draggingData.yFrom+this.draggingData.localDy,x:this.draggingData.x+this.draggingData.localDx,y:this.draggingData.y+this.draggingData.localDy},this.draggingData.element)}this.draggingData.dragging=false};o.prototype.mouseWheel=function(t){var e=this.childrenAt(t.x-this.outputX,t.y-this.outputY,t=>t.listenerCount("wheel"));if(!e.length){return}e[0].element.emit("wheel",{x:e[0].x,y:e[0].y,yDirection:t.yDirection},e[0].element)};o.prototype.onEventSourceResize=function(t,e){if(this.inlineTerm){return}this.resize({x:0,y:0,width:t,height:e});this.outputWidth=t;this.outputHeight=e;this.draw()}},{"./Container.js":21,"./Element.js":25,seventh:113}],23:[function(t,e,r){"use strict";const i=t("./Element.js");const n=t("./ToggleButton.js");const s=t("./RowMenu.js");const l=t("./ColumnMenuMixed.js");function o(t){t=!t?{}:t.internal?t:Object.create(t);t.internal=true;var e,r;if(t.value&&typeof t.value==="object"){this.setValue(t.value,true)}else{this.value={}}s.call(this,t);this.initPage();this.columnMenu=null;this.columnButtonBlurAttr=t.buttonBlurAttr||{bgColor:"gray",color:"white",bold:true};this.columnButtonFocusAttr=t.buttonFocusAttr||{bgColor:"blue",color:"white",bold:true};this.columnButtonTurnedOnBlurAttr=t.buttonTurnedOnBlurAttr||{bgColor:"gray",color:"white",bold:true};this.columnButtonTurnedOnFocusAttr=t.buttonTurnedOnFocusAttr||{bgColor:"blue",color:"white",bold:true};this.columnButtonTurnedOffBlurAttr=t.buttonTurnedOffBlurAttr||{bgColor:"gray",color:"white",dim:true};this.columnButtonTurnedOffFocusAttr=t.buttonTurnedOffFocusAttr||{bgColor:"blue",color:"white",dim:true};this.clearColumnMenuOnSubmit=!!t.clearColumnMenuOnSubmit;this.lastFocusButton=null;this.onClickOut=this.onClickOut.bind(this);this.onColumnMenuSubmit=this.onColumnMenuSubmit.bind(this);this.on("clickOut",this.onClickOut);if(this.elementType==="DropDownMenu"&&!t.noDraw){this.draw()}}e.exports=o;i.inherit(o,s);o.prototype.keyBindings={LEFT:"previous",RIGHT:"next",ESCAPE:"clearColumnMenu",UP:"clearColumnMenu",DOWN:"dropDown",ENTER:"submit",KP_ENTER:"submit",ALT_ENTER:"submit"};o.prototype.dropDown=function(t,e,r,i,n,s){var o=this.itemsDef[t].items;if(this.columnMenu){if(this.columnMenu.index===t){return}this.clearColumnMenu()}if(!o||!o.length){if(i&&this.itemsDef[t].topSubmit){this.emit("submit",i,n,this,s)}return}var a=o.some(t=>t.type==="toggle");var u={internal:true,parent:this.children[t],x:e,y:r,width:this.outputWidth-e,leftPadding:" ",rightPadding:" ",items:o,value:this.value,buttonFocusAttr:this.columnButtonFocusAttr,buttonBlurAttr:this.columnButtonBlurAttr,buttonTurnedOnBlurAttr:this.columnButtonTurnedOnBlurAttr,buttonTurnedOnFocusAttr:this.columnButtonTurnedOnFocusAttr,buttonTurnedOffBlurAttr:this.columnButtonTurnedOffBlurAttr,buttonTurnedOffFocusAttr:this.columnButtonTurnedOffFocusAttr};if(a){u.leftPadding=" ";u.turnedOnLeftPadding=" ☑ ";u.turnedOffLeftPadding=" ☐ "}this.columnMenu=new l(u);this.columnMenu.on("submit",this.onColumnMenuSubmit)};o.prototype.clearColumnMenu=function(t=false){if(!this.columnMenu){return false}this.columnMenu.destroy();this.columnMenu=null;if(t&&this.lastFocusButton){this.document.giveFocusTo(this.lastFocusButton,"clear")}return true};o.prototype.setValue=function(e,t){if(!e||typeof e!=="object"){return}this.value={};for(let t in e){this.value[t]=!!e[t]}if(this.columnMenu){this.columnMenu.setValue(e,t)}};o.prototype.setKeyValue=function(t,e,r){if(!t){return}this.value[t]=!!e;if(this.columnMenu){this.columnMenu.setKeyValue(t,e,r)}};o.prototype.setDropDownItem=function(e,r,t){var i=this.itemsDef.find(t=>t.value===e);if(!i){return false}var n=i.items&&i.items.find(t=>t.value===r);if(!n){return false}this.clearColumnMenu();Object.assign(n,t);return true};o.prototype.onClickOut=function(t,e,r){this.clearColumnMenu()};o.prototype.onButtonSubmit=function(t,e,r){this.dropDown(r.childId,r.outputX,r.outputY+1,t,e,r)};o.prototype.onButtonFocus=function(t,e,r){this.lastFocusButton=r;if(t&&e!=="clear"){this.dropDown(r.childId,r.outputX,r.outputY+1)}};o.prototype.onColumnMenuSubmit=function(t,e,r,i){if(i instanceof n){if(i.key){this.value[i.key]=i.value}if(this.clearColumnMenuOnSubmit){setTimeout(()=>this.clearColumnMenu(true),400)}}else{r.once("blinked",(t,e,r,i)=>{if(this.clearColumnMenuOnSubmit){this.clearColumnMenu(true)}this.emit("blinked",t,e,this,i)})}this.emit("submit",t,e,this,i)};const a=o.prototype.userActions;a.previous=function(){this.focusChild=this.focusPreviousChild()};a.next=function(){this.focusChild=this.focusNextChild()};a.dropDown=function(){if(this.columnMenu){this.columnMenu.focusNextChild()}else if(this.lastFocusButton){this.dropDown(this.lastFocusButton.childId,this.lastFocusButton.outputX,this.lastFocusButton.outputY+1)}};a.clearColumnMenu=function(){return this.clearColumnMenu(true)}},{"./ColumnMenuMixed.js":19,"./Element.js":25,"./RowMenu.js":32,"./ToggleButton.js":39}],24:[function(t,e,r){"use strict";const i=t("./Element.js");const n=t("./TextBox.js");const s=t("string-kit");function o(t){t=!t?{}:t.internal?t:Object.create(t);t.internal=true;if(t.value){t.content=t.value}n.call(this,t);this.onFocus=this.onFocus.bind(this);this.onDragEnd=this.onDragEnd.bind(this);this.onMiddleClick=this.onMiddleClick.bind(this);this.newLineAutoIndentHook=t.newLineAutoIndentHook??null;if(t.keyBindings){this.keyBindings=t.keyBindings}this.extraScrolling=t.extraScrolling!==undefined?!!t.extraScrolling:true;this.updateStatus();this.on("focus",this.onFocus);this.on("dragEnd",this.onDragEnd);this.on("middleClick",this.onMiddleClick);if(this.setContent===o.prototype.setContent){this.setContent(t.content,t.contentHasMarkup,true)}if(this.elementType==="EditableTextBox"&&!t.noDraw){this.draw()}}e.exports=o;i.inherit(o,n);o.prototype.needInput=true;o.prototype.keyBindings={CTRL_K:"meta",ENTER:"newLine",KP_ENTER:"newLine",BACKSPACE:"backDelete",DELETE:"delete",CTRL_DELETE:"deleteLine",LEFT:"backward",RIGHT:"forward",CTRL_LEFT:"startOfWord",CTRL_RIGHT:"endOfWord",UP:"up",DOWN:"down",HOME:"startOfLine",END:"endOfLine",TAB:"tab",PAGE_UP:"scrollUp",PAGE_DOWN:"scrollDown",META_HOME:"scrollToCursor",CTRL_B:"startOfSelection",CTRL_E:"endOfSelection",SHIFT_LEFT:"expandSelectionBackward",SHIFT_RIGHT:"expandSelectionForward",SHIFT_UP:"expandSelectionUp",SHIFT_DOWN:"expandSelectionDown",CTRL_SHIFT_LEFT:"expandSelectionStartOfWord",CTRL_SHIFT_RIGHT:"expandSelectionEndOfWord",CTRL_T:"moveSelection",ALT_T:"copyToDocumentClipboard",META_T:"copyToSystemClipboard",CTRL_P:"pasteSelection",ALT_P:"pasteDocumentClipboard",META_P:"pasteSystemClipboard",CTRL_D:"deleteSelection",ALT_D:"clearDocumentClipboard",META_D:"clearSystemClipboard"};o.prototype.insert=function(t,e=false,r=false){let i=this.textBuffer.cx,n=this.textBuffer.cy;let s=this.textBuffer.insert(t,this.textAttr);if(!r){if(this.stateMachine){this.textBuffer.runStateMachine()}if(e){this.textBuffer.setSelectionRegion({xmin:i,ymin:n,xmax:this.textBuffer.cx,ymax:this.textBuffer.cy})}this.autoScrollAndDraw()}else if(e){this.textBuffer.setSelectionRegion({xmin:i,ymin:n,xmax:this.textBuffer.cx,ymax:this.textBuffer.cy})}this.emit("change",{type:"insert",insertedString:t,count:s,internal:r,startPosition:{x:i,y:n},endPosition:{x:this.textBuffer.cx,y:this.textBuffer.cy}})};o.prototype.deleteSelection=function(t=false){if(!this.textBuffer.selectionRegion){return}var{xmin:e,xmax:r,ymin:i,ymax:n}=this.textBuffer.selectionRegion;var s=this.textBuffer.deleteSelection(true);if(s&&s.count){if(!t){this.textBuffer.cx=e;this.textBuffer.cy=i;if(this.stateMachine){this.textBuffer.runStateMachine()}this.autoScrollAndDraw()}this.emit("change",{type:"delete",count:s.count,internal:t,deletedString:s.string,startPosition:{x:e,y:i},endPosition:{x:e,y:i}})}};o.prototype.deleteRegion=function(t,e=false){var{xmin:r,xmax:i,ymin:n,ymax:s}=t;var o=this.textBuffer.deleteRegion(t,true);if(o&&o.count){if(!e){this.textBuffer.cx=r;this.textBuffer.cy=n;if(this.stateMachine){this.textBuffer.runStateMachine()}this.autoScrollAndDraw()}this.emit("change",{type:"delete",count:o.count,internal:e,deletedString:o.string,startPosition:{x:r,y:n},endPosition:{x:r,y:n}})}};o.prototype.drawSelfCursor=function(){this.textBuffer.drawCursor()};o.prototype.getValue=n.prototype.getContent;o.prototype.setValue=function(t,e){return this.setContent(t,false,e)};o.prototype.onFocus=function(t,e){this.updateStatus();this.draw()};o.prototype.onClick=function(t){if(this.hasFocus){this.textBuffer.moveTo(t.x-this.scrollX,t.y-this.scrollY);if(this.textBuffer.selectionRegion){this.textBuffer.resetSelectionRegion();this.draw()}else{this.drawCursor()}}else{this.document.giveFocusTo(this,"select")}};o.prototype.onDragEnd=function(t){if(this.hasFocus){if(t.yFrom{if(t){this.textBuffer.insert(t,this.textAttr);if(this.stateMachine){this.textBuffer.runStateMachine()}this.autoScrollAndDraw()}}).catch(()=>undefined)}};o.prototype.updateStatus=function(){};const a=o.prototype.userActions;a.character=function(t){var e=this.textBuffer.cx,r=this.textBuffer.cy;var i=this.textBuffer.insert(t,this.textAttr);if(this.stateMachine){this.textBuffer.runStateMachine()}this.autoScrollAndDraw();this.emit("change",{type:"insert",insertedString:t,count:i,internal:false,startPosition:{x:e,y:r},endPosition:{x:this.textBuffer.cx,y:this.textBuffer.cy}})};a.newLine=function(){var e="\n",r=1,t=this.textBuffer.cx,i=this.textBuffer.cy;this.textBuffer.newLine();if(this.newLineAutoIndentHook){let t=this.newLineAutoIndentHook();if(t){r+=this.textBuffer.insert(t);e+=t}}if(this.stateMachine){this.textBuffer.runStateMachine()}this.autoScrollAndDraw();this.emit("change",{type:"insert",insertedString:e,count:r,internal:false,startPosition:{x:t,y:i},endPosition:{x:this.textBuffer.cx,y:this.textBuffer.cy}})};a.tab=function(){var t=this.textBuffer.cx,e=this.textBuffer.cy;this.textBuffer.insert("\t",this.textAttr);if(this.stateMachine){this.textBuffer.runStateMachine()}this.autoScrollAndDraw();this.emit("change",{type:"insert",insertedString:"\t",count:1,internal:false,startPosition:{x:t,y:e},endPosition:{x:this.textBuffer.cx,y:this.textBuffer.cy}})};a.delete=function(){var t=this.textBuffer.cx,e=this.textBuffer.cy,r=this.textBuffer.selectionRegion;if(r&&r.ymin===e&&r.xmin===t){this.deleteSelection();return}var i=this.textBuffer.delete(1,true);if(this.stateMachine){this.textBuffer.runStateMachine()}this.autoScrollAndDraw();if(i&&i.count){this.emit("change",{type:"delete",count:i.count,internal:false,deletedString:i.string,startPosition:{x:t,y:e},endPosition:{x:this.textBuffer.cx,y:this.textBuffer.cy}})}};a.backDelete=function(){var t=this.textBuffer.cx,e=this.textBuffer.cy,r=this.textBuffer.selectionRegion;if(r){let t=this.textBuffer.oneStepBackward();if(r.ymax===t.y&&r.xmax===t.x){this.deleteSelection();return}}var i=this.textBuffer.backDelete(1,true);if(this.stateMachine){this.textBuffer.runStateMachine()}this.autoScrollAndDraw();if(i&&i.count){this.emit("change",{type:"backDelete",count:i.count,internal:false,deletedString:i.string,startPosition:{x:t,y:e},endPosition:{x:this.textBuffer.cx,y:this.textBuffer.cy}})}};a.deleteLine=function(){var t=this.textBuffer.cy;var e=this.textBuffer.deleteLine(true);if(this.stateMachine){this.textBuffer.runStateMachine()}this.autoScrollAndDraw();if(e&&e.count){this.emit("change",{type:"delete",count:e.count,internal:false,deletedString:e.string,startPosition:{x:0,y:t},endPosition:{x:0,y:this.textBuffer.cy}})}};a.backward=function(){this.textBuffer.moveBackward();this.autoScrollAndSmartDraw();this.emit("cursorMove")};a.forward=function(){this.textBuffer.moveForward();this.autoScrollAndSmartDraw();this.emit("cursorMove")};a.startOfWord=function(){this.textBuffer.moveToStartOfWord();this.autoScrollAndSmartDraw();this.emit("cursorMove")};a.endOfWord=function(){this.textBuffer.moveToEndOfWord();this.autoScrollAndSmartDraw();this.emit("cursorMove")};a.startOfLine=function(){this.textBuffer.moveToColumn(0);this.autoScrollAndSmartDraw();this.emit("cursorMove")};a.smartStartOfLine=function(){if(this.textBuffer.cx!==0){this.textBuffer.moveToColumn(0)}else{let i=this.textBuffer.cy;this.textBuffer.moveForward((t,e,r)=>r!==i||t!==" "&&t!=="\t");if(this.textBuffer.cy!==i){this.textBuffer.moveTo(0,i)}}this.autoScrollAndSmartDraw();this.emit("cursorMove")};a.endOfLine=function(){this.textBuffer.moveToEndOfLine();this.autoScrollAndSmartDraw();this.emit("cursorMove")};a.down=function(){this.textBuffer.moveDown();this.autoScrollAndSmartDraw();this.emit("cursorMove")};a.up=function(){this.textBuffer.moveUp();this.autoScrollAndSmartDraw();this.emit("cursorMove")};a.left=function(){this.textBuffer.moveLeft();this.autoScrollAndSmartDraw();this.emit("cursorMove")};a.right=function(){this.textBuffer.moveRight();this.autoScrollAndSmartDraw();this.emit("cursorMove")};a.scrollUp=function(){var t=Math.ceil(this.outputHeight/2);this.textBuffer.move(0,-t);this.scroll(0,t,true);this.autoScrollAndDraw();this.emit("cursorMove")};a.scrollDown=function(){var t=-Math.ceil(this.outputHeight/2);this.textBuffer.move(0,-t);this.scroll(0,t,true);this.autoScrollAndDraw();this.emit("cursorMove")};a.scrollTop=function(){this.textBuffer.moveTo(0,0);this.scrollTo(0,0);this.emit("cursorMove")};a.scrollBottom=function(){this.textBuffer.moveTo(0,this.textBuffer.buffer.length-1);this.autoScrollAndSmartDraw();this.emit("cursorMove")};a.scrollToCursor=function(){this.autoScrollAndDraw()};a.expandSelectionBackward=function(){var t=this.textBuffer.selectionRegion,e=this.textBuffer.cx,r=this.textBuffer.cy,i=this.textBuffer.oneStepBackward();if(t&&t.xmin===e&&t.ymin===r){this.textBuffer.moveBackward();this.textBuffer.startOfSelection()}else if(t&&t.xmax===i.x&&t.ymax===i.y){this.textBuffer.moveBackward();this.textBuffer.endOfSelection()}else{this.textBuffer.endOfSelection();this.textBuffer.moveBackward();this.textBuffer.startOfSelection()}this.autoScrollAndDraw();this.emit("cursorMove")};a.expandSelectionStartOfWord=function(){var t=this.textBuffer.selectionRegion,e=this.textBuffer.cx,r=this.textBuffer.cy,i=this.textBuffer.oneStepBackward();if(t&&t.xmin===e&&t.ymin===r){this.textBuffer.moveToStartOfWord();this.textBuffer.startOfSelection()}else if(t&&t.xmax===i.x&&t.ymax===i.y){this.textBuffer.moveToStartOfWord();this.textBuffer.endOfSelection()}else{this.textBuffer.endOfSelection();this.textBuffer.moveToStartOfWord();this.textBuffer.startOfSelection()}this.autoScrollAndDraw();this.emit("cursorMove")};a.expandSelectionUp=function(){var t=this.textBuffer.selectionRegion,e=this.textBuffer.cx,r=this.textBuffer.cy,i=this.textBuffer.oneStepBackward();if(t&&t.xmin===e&&t.ymin===r){this.textBuffer.moveUp();this.textBuffer.startOfSelection()}else if(t&&t.xmax===i.x&&t.ymax===i.y&&(t.yminr+1||t.ymax===r+1&&t.xmax>=e-1)){this.textBuffer.moveDown();this.textBuffer.startOfSelection()}else{this.textBuffer.startOfSelection();this.textBuffer.moveDown();this.textBuffer.endOfSelection()}this.autoScrollAndDraw();this.emit("cursorMove")};a.startOfSelection=function(){this.textBuffer.startOfSelection();this.draw()};a.endOfSelection=function(){this.textBuffer.endOfSelection();this.draw()};a.moveSelection=function(){var t=this.textBuffer.getSelectionText();if(!t){return}this.deleteSelection(true);this.insert(t,true)};a.pasteSelection=function(){var t=this.textBuffer.getSelectionText();if(t){this.insert(t)}};a.pasteDocumentClipboard=function(){if(this.document){let t=this.document.getDocumentClipboard();if(t&&typeof t==="string"){this.insert(t)}}};a.pasteSystemClipboard=function(){if(this.document){this.document.getSystemClipboard().then(t=>{if(t&&typeof t==="string"){this.insert(t)}}).catch(()=>undefined)}};a.deleteSelection=function(){this.deleteSelection()};a.clearDocumentClipboard=function(){if(this.document){this.document.clearDocumentClipboard(this.textBuffer.getSelectionText())}};a.clearSystemClipboard=function(){if(this.document){this.document.clearSystemClipboard(this.textBuffer.getSelectionText()).catch(()=>undefined)}}},{"./Element.js":25,"./TextBox.js":37,"string-kit":127}],25:[function(t,e,r){"use strict";const n=t("../misc.js");const s=t("string-kit");const i=t("nextgen-events");var o=0;function a(t={}){this.setInterruptible(true);this.uid=o++;this.parent=t.parent&&t.parent.elementType?t.parent:null;this.document=null;this.destroyed=false;this.onKey=this.onKey.bind(this);this.inlineTerm=t.inlineTerm||null;this.strictInline=!!(this.inlineTerm&&this.strictInlineSupport&&(t.strictInline||t.strictInline===undefined));this.restoreCursorAfterDraw=!!(this.inlineTerm&&this.inlineCursorRestoreAfterDraw&&!this.strictInline);this.outputDst=t.outputDst||t.parent&&t.parent.inputDst,this.inputDst=null;this.label=t.label||"";this.key=t.key||null;if(this.value===undefined){this.value=t.value===undefined?null:t.value}this.childId=t.childId===undefined?null:t.childId;this.def=t.def||null;this.hidden=!!t.hidden;this.disabled=!!t.disabled;this.content=this.content??"";this.contentHasMarkup=this.contentHasMarkup??false;this.contentWidth=this.contentWidth??0;if(this.setContent===a.prototype.setContent){this.setContent(t.content||"",t.contentHasMarkup,true,true)}this.meta=t.meta;this.autoWidth=+t.autoWidth||0;this.autoHeight=+t.autoHeight||0;this.outputX=t.outputX||t.x||0;this.outputY=t.outputY||t.y||0;this.savedZIndex=this.zIndex=t.zIndex||t.z||0;this.interceptTempZIndex=!!t.interceptTempZIndex;this.outputWidth=this.autoWidth&&this.outputDst?Math.round(this.outputDst.width*this.autoWidth):t.outputWidth?t.outputWidth:t.width?t.width:this.strictInline?this.inlineTerm.width:1;this.outputHeight=this.autoHeight&&this.outputDst?Math.round(this.outputDst.height*this.autoHeight):t.outputHeight?t.outputHeight:t.height?t.height:this.strictInline?this.inlineTerm.height:1;this.needOuterDraw=false;this.savedCursorX=0;this.savedCursorY=0;this.hasFocus=false;this.children=[];this.zChildren=[];this.inputDst=this.outputDst;this.inputX=this.outputX;this.inputY=this.outputY;this.inputWidth=this.outputWidth;this.inputHeight=this.outputHeight;if(this.parent){this.parent.attach(this,t.id)}if(t.shortcuts&&this.document){if(Array.isArray(t.shortcuts)){this.document.createShortcuts(this,...t.shortcuts)}else{this.document.createShortcuts(this,t.shortcuts)}}}e.exports=a;a.prototype=Object.create(i.prototype);a.prototype.constructor=a;a.prototype.elementType="Element";const u=t("../termkit.js");a.prototype.destroy=function(t=false,e=false){if(this.destroyed){return}var r,i,n=this.document;for(r=0,i=this.children.length;r=0){r.children.splice(e,1)}e=r.zChildren.indexOf(this);if(e>=0){r.zChildren.splice(e,1)}delete this.document.elements[this.id];this.parent=null;this.recursiveFixAttachment(null);if(!t){r.document.draw()}return this};a.prototype.resizeToContent=function(){this.outputWidth=this.contentWidth;this.outputHeight=this.contentHeight};a.prototype.zSort=function(){this.zChildren.sort((t,e)=>t.zIndex-e.zIndex)};a.prototype.zInsert=function(t){var e,r=this.zChildren.length;while(r--){e=this.zChildren[r];if(t.zIndex>=e.zIndex){this.zChildren[r+1]=t;return}this.zChildren[r+1]=e}this.zChildren[0]=t};a.prototype.updateZ=a.prototype.updateZIndex=function(t){this.savedZIndex=this.zIndex=t;this.parent.zSort()};a.prototype.topZ=function(){if(this.parent.interceptTempZIndex){return this.parent.topZ()}if(!this.parent.zChildren.length){return}this.zIndex=this.parent.zChildren[this.parent.zChildren.length-1].zIndex+1;this.parent.zSort()};a.prototype.bottomZ=function(){if(this.parent.interceptTempZIndex){return this.parent.bottomZ()}if(!this.parent.zChildren.length){return}this.zIndex=this.parent.zChildren[0].zIndex-1;this.parent.zSort()};a.prototype.restoreZ=function(){if(this.parent.interceptTempZIndex){return this.parent.restoreZ()}this.zIndex=this.savedZIndex;this.parent.zSort()};a.computeContentWidth=(t,e)=>{if(Array.isArray(t)){return e==="ansi"||e==="legacyAnsi"?Math.max(...t.map(t=>n.ansiWidth(t))):e?Math.max(...t.map(t=>n.markupWidth(t))):Math.max(...t.map(t=>s.unicode.width(t)))}return e==="ansi"||e==="legacyAnsi"?n.ansiWidth(t):e?n.markupWidth(t):s.unicode.width(t)};var l=0;a.getLastTruncateWidth=()=>l;a.truncateContent=(t,e,r)=>{var i;if(r==="ansi"||r==="legacyAnsi"){i=n.truncateAnsiString(t,e);l=n.getLastTruncateWidth()}else if(r){i=n.truncateMarkupString(t,e);l=n.getLastTruncateWidth()}else{i=s.unicode.truncateWidth(t,e);l=s.unicode.getLastTruncateWidth()}return i};a.wordwrapContent=a.wordWrapContent=(t,e,r)=>r==="ansi"||r==="legacyAnsi"?n.wordWrapAnsi(t,e):r?n.wordWrapMarkup(t,e):s.wordwrap(t,{width:e,fill:true,noJoin:true});a.prototype.setContent=function(t,e,r=false,i=false){if(this.forceContentArray&&!Array.isArray(t)){t=[t||""]}this.content=t;this.contentHasMarkup=e;var n=this.contentWidth;this.contentWidth=a.computeContentWidth(t,this.contentHasMarkup);if(!i&&this.resizeOnContent){this.resizeOnContent()}if(!r){if(this.contentWidth!==n&&(this.contentWidth>this.outputWidth||this.resizeOnContent)){this.outerDraw()}else{this.draw()}}};a.prototype.isAncestorOf=function(t){var e=t;for(;;){if(e===this){return true}else if(!e.parent){return false}else if(e.parent.children.indexOf(e)===-1){e.parent=null;return false}e=e.parent}};a.prototype.getParentContainer=function(){var t=this;for(;;){if(!t.parent){return null}if(t.parent.isContainer){return t.parent}t=t.parent}};a.prototype.getFocusBranchIndex=function(){var t,e;if(!this.document.focusElement){return null}e=this.document.focusElement;for(;;){if(e===this){return null}else if(!e.parent){return null}if(e.parent===this){t=e.parent.children.indexOf(e);if(t===-1){e.parent=null;return null}return t}e=e.parent}};a.prototype.focusNextChild=function(t=true,e="cycle"){var r,i,n;if(!this.children.length||!this.document){return null}if(!this.document.focusElement||(r=this.getFocusBranchIndex())===null){r=this.children.length-1}i=r;for(;;){r++;if(r>=this.children.length){if(t){r=0}else{r=this.children.length-1;break}}n=this.document.giveFocusTo_(this.children[r],e);if(n||i===r){break}}return this.children[r]};a.prototype.focusPreviousChild=function(t=true){var e,r,i;if(!this.children.length||!this.document){return null}if(!this.document.focusElement||(e=this.getFocusBranchIndex())===null){e=0}r=e;for(;;){e--;if(e<0){if(t){e=this.children.length-1}else{e=0;break}}i=this.document.giveFocusTo_(this.children[e],"backCycle");if(i||r===e){break}}return this.children[e]};a.prototype.childrenAt=function(t,e,r=null,i=[]){var n,s;n=this.zChildren.length;while(n--){s=this.zChildren[n];if(s.hidden){continue}if(t>=s.outputX&&t<=s.outputX+s.outputWidth-1&&e>=s.outputY&&e<=s.outputY+s.outputHeight-1){if(s.isContainer){s.childrenAt(t-s.inputX,e-s.inputY,r,i)}else{s.childrenAt(t,e,r,i)}if(!r||r(s)){i.push({element:s,x:t-s.outputX,y:e-s.outputY})}}else if(!s.isContainer){s.childrenAt(t,e,r,i)}}return i};a.prototype.saveCursor=function(){if(this.inputDst){this.savedCursorX=this.inputDst.cx;this.savedCursorY=this.inputDst.cy}else if(this.outputDst){this.savedCursorX=this.outputDst.cx;this.savedCursorY=this.outputDst.cy}return this};a.prototype.restoreCursor=function(){if(this.inputDst){this.inputDst.cx=this.savedCursorX;this.inputDst.cy=this.savedCursorY;this.inputDst.drawCursor()}else if(this.outputDst){this.outputDst.cx=this.savedCursorX;this.outputDst.cy=this.savedCursorY;this.outputDst.drawCursor()}return this};a.prototype.draw=function(t=false){if(!this.document||this.hidden){return this}if(!t){if(this.restoreCursorAfterDraw){this.inlineTerm.saveCursor()}else if(!this.strictInline){this.saveCursor()}}this.descendantDraw();this.ascendantDraw();if(!t){if(this.restoreCursorAfterDraw){this.inlineTerm.restoreCursor()}else if(!this.strictInline){this.drawCursor()}}return this};a.prototype.redraw=a.prototype.outerDraw=function(t=false){if(!this.document||this.hidden&&!t){return this}var e=this.getParentContainer();if(!e){this.draw()}else{e.draw()}return this};a.prototype.updateDraw=function(){if(this.needOuterDraw){this.outerDraw()}else{this.draw()}this.needOuterDraw=false};a.prototype.descendantDraw=function(t){var e,r;if(this.hidden){return this}if(this.preDrawSelf){this.preDrawSelf(!t)}for(e=0,r=this.zChildren.length;e1&&s.inlineNewLine){n.x=1;if(n.y===undefined){n.y=i.y+1}}}if(n.y===undefined){n.y=i.y}}}if(!s.strictInline){let t=n.y+s.outputHeight-e.height;if(t>0){e.scrollUp(t);e.up(t);n.y-=t}}if(s.inlineResizeToContent){s.resizeToContent()}var o={internal:true,inlineTerm:e,strictInline:s.strictInline,noInput:s.strictInline||!s.needInput,outputX:n.x,outputY:n.y,outputWidth:s.outputWidth,outputHeight:s.outputHeight,outputDst:e,eventSource:e,noDraw:true};var a=new u.Document(o);a.attach(s);s.on("resize",()=>{throw new Error("not coded!")});s.draw(true);e.styleReset();if(s.staticInline){s.destroy(undefined,true)}return s};a.prototype.onKey=function(t,e,r){var i=this.keyBindings[t];if(i){if(i==="meta"){if(this.document){this.document.setMetaKeyPrefix("META","CTRL")}return true}else if(this.userActions[i]){return(this.userActions[i].call(this,t,e,r)??true)||undefined}}else if(r&&r.isCharacter){if(this.userActions.character){return(this.userActions.character.call(this,t,e,r)??true)||undefined}}else if(this.userActions.specialKey){return(this.userActions.specialKey.call(this,t,e,r)??true)||undefined}return};a.prototype.isContainer=false;a.prototype.forceContentArray=false;a.prototype.noChildFocus=false;a.prototype.computeBoundingBoxes=null;a.prototype.resizeOnContent=null;a.prototype.preDrawSelf=null;a.prototype.postDrawSelf=null;a.prototype.drawSelfCursor=null;a.prototype.getValue=()=>null;a.prototype.setValue=()=>undefined;a.prototype.strictInlineSupport=false;a.prototype.staticInline=false;a.prototype.inlineCursorRestoreAfterDraw=false;a.prototype.needInput=false;a.prototype.outerDrag=false;a.prototype.keyBindings={};a.prototype.userActions={}},{"../misc.js":47,"../termkit.js":55,"nextgen-events":77,"string-kit":127}],26:[function(i,n,t){(function(r){(function(){"use strict";const o=i("./Element.js");const a=i("./LabeledInput.js");const u=i("./Button.js");function t(t){t=!t?{}:t.internal?t:Object.create(t);t.internal=true;if(!t.outputWidth&&!t.width){t.outputWidth=78}o.call(this,t);this.submitValue=null;this.inputsDef=t.inputs||[];this.labeledInputs=[];this.buttonsDef=t.buttons||[];this.buttons=[];this.focusChild=null;this.onButtonSubmit=this.onButtonSubmit.bind(this);this.onFocus=this.onFocus.bind(this);this.textAttr=t.textAttr||null;this.voidAttr=t.voidAttr||t.emptyAttr||null;this.labelFocusAttr=t.labelFocusAttr||null;this.labelBlurAttr=t.labelBlurAttr||null;this.buttonFocusAttr=t.buttonFocusAttr||null;this.buttonBlurAttr=t.buttonBlurAttr||null;this.turnedOnBlurAttr=t.turnedOnBlurAttr||null;this.turnedOnFocusAttr=t.turnedOnFocusAttr||null;this.turnedOffBlurAttr=t.turnedOffBlurAttr||null;this.turnedOffFocusAttr=t.turnedOffFocusAttr||null;if(t.keyBindings){this.keyBindings=t.keyBindings}if(t.textInputKeyBindings){this.textInputKeyBindings=t.textInputKeyBindings}this.initChildren();this.on("key",this.onKey);this.on("focus",this.onFocus);if(this.elementType==="Form"&&!t.noDraw){this.draw()}}n.exports=t;o.inherit(t);t.prototype.needInput=true;t.prototype.keyBindings={LEFT:"previous",RIGHT:"next",UP:"previous",DOWN:"next",ENTER:"next",KP_ENTER:"next",ALT_ENTER:"next"};t.prototype.textInputKeyBindings={};t.prototype.selectInputKeyBindings={};t.prototype.selectMultiInputKeyBindings={};t.prototype.initChildren=function(){var n=0,r=0,s=0,e=0,i=0;this.inputsDef.forEach(t=>{t.labelWidth=o.computeContentWidth(t.label,t.labelHasMarkup);if(t.labelWidth>n){n=t.labelWidth}});this.inputsDef.forEach((t,e)=>{var r=1,i=t.label+" ".repeat(n-t.labelWidth);switch(t.type){case"select":this.labeledInputs[e]=new a({internal:true,parent:this,type:t.type,key:t.key,label:i,content:t.content,value:t.value,items:t.items,outputX:this.outputX,outputY:this.outputY+s,outputWidth:t.outputWidth||t.width||this.outputWidth,outputHeight:r,labelFocusAttr:t.labelFocusAttr||this.labelFocusAttr,labelBlurAttr:t.labelBlurAttr||this.labelBlurAttr,buttonBlurAttr:t.buttonBlurAttr||this.buttonBlurAttr,buttonFocusAttr:t.buttonFocusAttr||this.buttonFocusAttr,buttonDisabledAttr:t.buttonDisabledAttr||this.buttonDisabledAttr,buttonSubmittedAttr:t.buttonSubmittedAttr||this.buttonSubmittedAttr,keyBindings:this.selectInputKeyBindings,noDraw:true});break;case"select-multi":case"selectMulti":this.labeledInputs[e]=new a({internal:true,parent:this,type:t.type,key:t.key,label:i,content:t.content,value:t.value,items:t.items,outputX:this.outputX,outputY:this.outputY+s,outputWidth:t.outputWidth||t.width||this.outputWidth,outputHeight:r,labelFocusAttr:t.labelFocusAttr||this.labelFocusAttr,labelBlurAttr:t.labelBlurAttr||this.labelBlurAttr,buttonBlurAttr:t.buttonBlurAttr||this.buttonBlurAttr,buttonFocusAttr:t.buttonFocusAttr||this.buttonFocusAttr,buttonDisabledAttr:t.buttonDisabledAttr||this.buttonDisabledAttr,buttonSubmittedAttr:t.buttonSubmittedAttr||this.buttonSubmittedAttr,turnedOnBlurAttr:t.turnedOnBlurAttr||this.turnedOnBlurAttr,turnedOnFocusAttr:t.turnedOnFocusAttr||this.turnedOnFocusAttr,turnedOffBlurAttr:t.turnedOffBlurAttr||this.turnedOffBlurAttr,turnedOffFocusAttr:t.turnedOffFocusAttr||this.turnedOffFocusAttr,keyBindings:this.selectInputKeyBindings,noDraw:true});break;case"text":default:t.type="text";if(t.height){r=t.height}this.labeledInputs[e]=new a({internal:true,parent:this,type:t.type,key:t.key,label:i,content:t.content,outputX:this.outputX,outputY:this.outputY+s,outputWidth:t.outputWidth||t.width||this.outputWidth,outputHeight:r,lineWrap:!!t.lineWrap,wordWrap:!!t.wordWrap,scrollable:!!t.scrollable,vScrollBar:!!t.vScrollBar,hScrollBar:!!t.hScrollBar,hiddenContent:t.hiddenContent,labelFocusAttr:t.labelFocusAttr||this.labelFocusAttr,labelBlurAttr:t.labelBlurAttr||this.labelBlurAttr,textAttr:t.textAttr||this.textAttr,voidAttr:t.voidAttr||t.emptyAttr||this.voidAttr,keyBindings:this.textInputKeyBindings,allowNewLine:r>1,noDraw:true});break}s+=r});if(!this.buttonsDef.length){this.buttonsDef.push({content:"Submit",value:"submit"})}this.buttonsDef.forEach(t=>{t.contentWidth=o.computeContentWidth(t.content,t.contentHasMarkup);e+=t.contentWidth});i=Math.floor((this.outputWidth-e)/(this.buttonsDef.length+1));r=i;s++;this.buttonsDef.forEach((t,e)=>{this.buttons[e]=new u({internal:true,parent:this,content:t.content,value:t.value,outputX:this.outputX+r,outputY:this.outputY+s,focusAttr:t.focusAttr||this.buttonFocusAttr,blurAttr:t.blurAttr||this.buttonBlurAttr,noDraw:true});this.buttons[e].on("submit",this.onButtonSubmit);r+=t.contentWidth+i})};t.prototype.getValue=function(){var e={};this.labeledInputs.forEach(t=>{e[t.key]=t.getValue()});return{submit:this.submitValue,fields:e}};t.prototype.onFocus=function(t,e){if(e==="cycle"||e==="backCycle"){return}if(t){r.nextTick(()=>{if(this.focusChild){this.document.giveFocusTo(this.focusChild,"delegate")}else{this.focusChild=this.focusNextChild()}})}};t.prototype.onButtonSubmit=function(t,e,r){this.submitValue=t;this.emit("submit",this.getValue(),e,this,r)};const e=t.prototype.userActions;e.previous=function(){this.focusChild=this.focusPreviousChild()};e.next=function(){this.focusChild=this.focusNextChild()}}).call(this)}).call(this,i("_process"))},{"./Button.js":17,"./Element.js":25,"./LabeledInput.js":30,_process:185}],27:[function(t,e,r){"use strict";const i=t("./Element.js");const n=t("./InlineInput.js");const s=t("../fileHelpers.js");const o=t("fs");const a=t("path");function u(t){t=!t?{}:t.internal?t:Object.create(t);t.internal=true;this.baseDir=t.baseDir??null;this.resolvedBaseDir=null;this.autoCompleteFileOptions=null;this.accept=t.accept&&typeof t.accept==="object"?t.accept:{unexistant:true,file:true,directory:true};n.call(this,t);this.autoComplete=this.fileAutoComplete.bind(this);this.useAutoCompleteHint=t.useAutoCompleteHint??true;this.useAutoCompleteMenu=t.useAutoCompleteMenu??true;if(this.elementType==="InlineFileInput"&&!t.noDraw){this.draw()}this.initPromise=this.init()}e.exports=u;i.inherit(u,n);u.prototype.init=async function(){if(this.initPromise){return this.initPromise}this.resolvedBaseDir=await s.resolveBaseDir(this.baseDir);var t=Object.assign({},this.accept);t.directory=true;this.autoCompleteFileOptions={accept:t,baseDir:this.resolvedBaseDir}};u.prototype.fileAutoComplete=async function(t){await this.initPromise;return s.autoCompleteFile(t,this.autoCompleteFileOptions)};u.prototype.submit=async function(){var e,t;if(this.disabled||this.submitted||this.canceled){return}e=this.getValue();if(!e||typeof e!=="string"){if(!this.noEmpty){this.emit("submit",null,undefined,this)}return}await this.initPromise;e=a.resolve(a.isAbsolute(e)?e:this.resolvedBaseDir+e);try{t=await o.promises.stat(e)}catch(t){if(t.code==="ENOENT"&&this.accept.unexistant){this.emit("submit",e,undefined,this);return}if(!this.noEmpty){this.emit("submit",null,undefined,this)}return}if(!s.statsFilter(t,this.accept)){if(!this.noEmpty){this.emit("submit",null,undefined,this)}return}this.emit("submit",e,undefined,this)}},{"../fileHelpers.js":42,"./Element.js":25,"./InlineInput.js":28,fs:141,path:184}],28:[function(t,e,r){"use strict";const i=t("./Element.js");const n=t("./TextBox.js");const s=t("./EditableTextBox.js");const o=t("./RowMenu.js");const a=t("seventh");const u=t("string-kit");const l=t("../autoComplete.js");function f(e){e=!e?{}:e.internal?e:Object.create(e);e.internal=true;if(e.value){e.content=e.value}e.outputHeight=1;e.scrollable=e.hasVScrollBar=e.hasHScrollBar=e.extraScrolling=false;e.scrollX=e.scrollY=0;e.lineWrap=true;this.onAutoCompleteMenuSubmit=this.onAutoCompleteMenuSubmit.bind(this);this.onAutoCompleteMenuItemFocus=this.onAutoCompleteMenuItemFocus.bind(this);this.onAutoCompleteMenuCancel=this.onAutoCompleteMenuCancel.bind(this);this.promptTextBox=null;if(e.prompt){this.promptTextBox=new n(Object.assign({textAttr:e.textAttr},e.prompt,{internal:true,outputX:e.outputX||e.x,outputY:e.outputY||e.y,outputWidth:e.outputWidth||e.width,outputHeight:e.outputHeight||e.height,lineWrap:e.lineWrap,wordWrap:e.wordWrap||e.wordwrap}));this.promptTextBox.textBuffer.setVoidAttr(null);let t=this.promptTextBox.getContentSize();this.promptTextBox.setSizeAndPosition(t);if(t.height>1){e.outputY=(e.outputY||e.y)+t.height-1;e.firstLineRightShift=this.promptTextBox.textBuffer.buffer[this.promptTextBox.textBuffer.buffer.length-1].length}else{e.firstLineRightShift=t.width}}s.call(this,e);this.history=e.history;this.contentArray=e.history?[...e.history,this.content]:[this.content];this.contentIndex=this.contentArray.length-1;this.noEmpty=!!e.noEmpty;this.disabled=!!e.disabled;this.submitted=!!e.submitted;this.cancelable=!!e.cancelable;this.canceled=!!e.canceled;this.autoComplete=e.autoComplete;this.useAutoCompleteHint=!!(this.autoComplete&&(e.useAutoCompleteHint||e.autoCompleteHint));this.autoCompleteHintMinInput=e.autoCompleteHintMinInput||1;this.useAutoCompleteMenu=!!(this.autoComplete&&(e.useAutoCompleteMenu||e.autoCompleteMenu));this.autoCompleteMenu=null;this.autoCompleteLeftPart=null;this.autoCompleteRightPart=null;this.autoCompleteCursorCell=null;this.autoCompleteMenuPrefix=null;this.autoCompleteMenuPostfix=null;this.menuOptions=Object.assign({},this.defaultMenuOptions,e.menu);this.placeholder=e.placeholder;this.placeholderHasMarkup=e.placeholderHasMarkup;if(this.placeholder){this.setAltContent(this.placeholder,this.placeholderHasMarkup)}if(this.promptTextBox){this.attach(this.promptTextBox)}if(this.elementType==="InlineInput"&&!e.noDraw){this.draw()}}e.exports=f;i.inherit(f,s);f.prototype.useAltTextBuffer=true;f.prototype.defaultMenuOptions={buttonBlurAttr:{bgColor:"default",color:"default"},buttonFocusAttr:{bgColor:"green",color:"blue",dim:true},buttonDisabledAttr:{bgColor:"white",color:"brightBlack"},buttonSubmittedAttr:{bgColor:"brightWhite",color:"brightBlack"},buttonSeparatorAttr:{bgColor:"default"},backgroundAttr:{bgColor:"default"},justify:true,keyBindings:Object.assign({},o.prototype.keyBindings,{TAB:"next",SHIFT_TAB:"previous"})};f.prototype.keyBindings={CTRL_K:"meta",ENTER:"submit",KP_ENTER:"submit",ESCAPE:"cancel",TAB:"autoComplete",CTRL_R:"historyAutoComplete",UP:"historyPrevious",DOWN:"historyNext",BACKSPACE:"backDelete",DELETE:"delete",LEFT:"backward",RIGHT:"forward",CTRL_LEFT:"startOfWord",CTRL_RIGHT:"endOfWord",HOME:"startOfLine",END:"endOfLine",CTRL_B:"startOfSelection",CTRL_E:"endOfSelection",ALT_T:"copyToDocumentClipboard",META_T:"copyToSystemClipboard",CTRL_P:"pasteSelection",ALT_P:"pasteDocumentClipboard",META_P:"pasteSystemClipboard",ALT_D:"clearDocumentClipboard",META_D:"clearSystemClipboard"};f.prototype.insert=function(t){this.textBuffer.insert(t,this.textAttr);this.textBuffer.runStateMachine();if(this.useAutoCompleteHint){this.runAutoCompleteHint(this.autoComplete)}else{this.autoResizeAndDraw()}};f.prototype.preDrawSelf=function(){s.prototype.preDrawSelf.call(this)};f.prototype.autoResizeAndDraw=function(t=false){var e=Math.max(this.textBuffer.buffer.length,this.altTextBuffer&&this.altTextBuffer.buffer.length||0);if(e>this.outputHeight){this.setSizeAndPosition({outputHeight:e})}if(!t){this.draw()}else{this.drawCursor()}};f.prototype.autoResizeAndDrawCursor=function(){return this.autoResizeAndDraw(true)};f.prototype.runAutoCompleteHint=async function(t){if(this.textBuffer.cy===0&&this.textBuffer.cx1){this.altTextBuffer.setText("");this.autoResizeAndDraw();return}e=(e.prefix??"")+e[0]+(e.postfix??"")}if(e===r){this.altTextBuffer.setText("")}else{this.altTextBuffer.setText(e)}this.autoResizeAndDraw()};f.prototype.runAutoComplete=async function(t){var e;this.autoCompleteCursorCell=this.textBuffer.getCursorCell();[this.autoCompleteLeftPart,this.autoCompleteRightPart]=this.textBuffer.getCursorSplittedText();if(Array.isArray(t)){e=l(t,this.autoCompleteLeftPart,this.useAutoCompleteMenu)}else if(typeof t==="function"){e=await t(this.autoCompleteLeftPart,this.useAutoCompleteMenu)}else{return}if(Array.isArray(e)){if(!e.length){return}if(this.useAutoCompleteMenu){this.runAutoCompleteMenu(e);return}e=(e.prefix??"")+e[0]+(e.postfix??"")}this.runAutoCompleted(e)};f.prototype.runAutoCompleted=async function(t){if(t.startsWith(this.autoCompleteLeftPart)){this.textBuffer.insert(t.slice(this.autoCompleteLeftPart.length));if(!this.textBuffer.updateCursorFromCell(this.autoCompleteCursorCell)){this.textBuffer.moveToEndOfBuffer()}}else{this.textBuffer.setText(t+this.autoCompleteRightPart);this.textBuffer.moveToEndOfBuffer()}this.textBuffer.runStateMachine();this.autoResizeAndDraw()};f.prototype.runAutoCompleteMenu=async function(t){if(!t||!t.length){return}if(this.autoCompleteMenu){this.autoCompleteMenu.destroy()}this.autoCompleteMenu=new o(Object.assign({},this.menuOptions,{internal:true,parent:this,x:this.outputX,y:this.outputY+this.outputHeight,outputWidth:this.outputWidth,items:t.map(t=>({value:t,content:t}))}));this.autoCompleteMenuPrefix=t.prefix??"";this.autoCompleteMenuPostfix=t.postfix??"";this.document.giveFocusTo(this.autoCompleteMenu);this.autoCompleteMenu.once("submit",this.onAutoCompleteMenuSubmit);this.autoCompleteMenu.once("cancel",this.onAutoCompleteMenuCancel);this.autoCompleteMenu.on("itemFocus",this.onAutoCompleteMenuItemFocus)};f.prototype.onAutoCompleteMenuSubmit=function(t){t=this.autoCompleteMenuPrefix+t+this.autoCompleteMenuPostfix;this.autoCompleteMenu.destroy();this.autoCompleteMenu=null;this.autoCompleteMenuPrefix=null;this.autoCompleteMenuPostfix=null;this.document.giveFocusTo(this);this.runAutoCompleted(t)};f.prototype.onAutoCompleteMenuItemFocus=function(t,e){if(!e||this.autoCompleteRightPart){return}t=this.autoCompleteMenuPrefix+t+this.autoCompleteMenuPostfix;if(t===this.autoCompleteLeftPart){this.altTextBuffer.setText("")}else{this.altTextBuffer.setText(t)}this.autoResizeAndDraw()};f.prototype.onAutoCompleteMenuCancel=function(){this.autoCompleteMenu.destroy();this.autoCompleteMenu=null;this.document.giveFocusTo(this)};f.prototype.submit=function(){if(this.disabled||this.submitted||this.canceled){return}var t=this.getValue();if(this.noEmpty&&!t){return}this.emit("submit",t,undefined,this)};f.prototype.onKey=function(t,e,r){if(this.autoCompleteMenu){this.autoCompleteMenu.emit("cancel")}return i.prototype.onKey.call(this,t,e,r)};const h=f.prototype.userActions;h.character=function(t,e,r){if(this.placeholder){this.placeholder=null;this.setAltContent("",false,true)}this.insert(t)};h.submit=function(){this.submit()};h.cancel=function(){if(!this.cancelable||this.disabled||this.canceled){return}this.emit("cancel",this)};h.autoComplete=function(){if(!this.autoComplete){return}this.runAutoComplete(this.autoComplete)};h.historyAutoComplete=function(){if(!this.autoComplete){return}this.runAutoComplete(this.history)};h.historyPrevious=function(){if(this.contentIndex<=0){return}this.contentArray[this.contentIndex]=this.getContent();this.contentIndex--;this.setContent(this.contentArray[this.contentIndex]);this.textBuffer.runStateMachine();this.autoResizeAndDraw()};h.historyNext=function(){if(this.contentIndex>=this.contentArray.length-1){return}this.contentArray[this.contentIndex]=this.getContent();this.contentIndex++;this.setContent(this.contentArray[this.contentIndex]);this.textBuffer.runStateMachine();this.autoResizeAndDraw()};h.backDelete=function(){this.textBuffer.backDelete();this.textBuffer.runStateMachine();if(this.useAutoCompleteHint){this.runAutoCompleteHint(this.autoComplete)}else{this.autoResizeAndDraw()}};h.delete=function(){this.textBuffer.delete();this.textBuffer.runStateMachine();if(this.useAutoCompleteHint){this.runAutoCompleteHint(this.autoComplete)}else{this.autoResizeAndDraw()}}},{"../autoComplete.js":7,"./EditableTextBox.js":24,"./Element.js":25,"./RowMenu.js":32,"./TextBox.js":37,seventh:113,"string-kit":127}],29:[function(t,e,r){"use strict";const i=t("./Element.js");const n=t("./TextBox.js");const s=t("./RowMenu.js");const o=t("seventh");const a=t("string-kit");function u(e){e=!e?{}:e.internal?e:Object.create(e);e.internal=true;if(e.value){e.content=e.value}e.outputHeight=1;this.promptTextBox=null;if(e.prompt){this.promptTextBox=new n(Object.assign({textAttr:e.textAttr},e.prompt,{internal:true,outputX:e.outputX||e.x,outputY:e.outputY||e.y,outputWidth:e.outputWidth||e.width,outputHeight:e.outputHeight||e.height,lineWrap:e.lineWrap,wordWrap:e.wordWrap||e.wordwrap}));this.promptTextBox.textBuffer.setVoidAttr(null);let t=this.promptTextBox.getContentSize();this.promptTextBox.setSizeAndPosition(t);if(t.height>1){e.outputY=(e.outputY||e.y)+t.height-1}this.leftMargin=this.promptTextBox.outputWidth}s.call(this,e);if(this.promptTextBox){this.attach(this.promptTextBox)}if(this.elementType==="InlineMenu"&&!e.noDraw){this.draw()}}e.exports=u;i.inherit(u,s);u.prototype.initChildren=function(t=false){s.prototype.initChildren.call(this);if(this.elementType==="InlineMenu"&&!t){this.initPage()}}},{"./Element.js":25,"./RowMenu.js":32,"./TextBox.js":37,seventh:113,"string-kit":127}],30:[function(l,f,t){(function(u){(function(){"use strict";const i=l("./Element.js");const e=l("./Text.js");const r=l("./EditableTextBox.js");const n=l("./SelectList.js");const s=l("./SelectListMulti.js");const t=l("string-kit");function o(t){t=!t?{}:t.internal?t:Object.create(t);t.internal=true;i.call(this,t);this.hiddenContent=t.hiddenContent;this.hasInputFocus=false;this.interceptTempZIndex=true;this.labelFocusAttr=t.labelFocusAttr||{bold:true};this.labelBlurAttr=t.labelBlurAttr||{dim:true};this.buttonBlurAttr=t.buttonBlurAttr||{bgColor:"cyan",color:"white",bold:true};this.buttonFocusAttr=t.buttonFocusAttr||{bgColor:"brightCyan",color:"black",bold:true};this.buttonDisabledAttr=t.buttonDisabledAttr||{bgColor:"cyan",color:"gray",bold:true};this.buttonSubmittedAttr=t.buttonSubmittedAttr||{bgColor:"brightCyan",color:"brightWhite",bold:true};this.turnedOnBlurAttr=t.turnedOnBlurAttr||{bgColor:"cyan"};this.turnedOnFocusAttr=t.turnedOnFocusAttr||{bgColor:"brightCyan",color:"gray",bold:true};this.turnedOffBlurAttr=t.turnedOffBlurAttr||{bgColor:"gray",dim:true};this.turnedOffFocusAttr=t.turnedOffFocusAttr||{bgColor:"white",color:"black",bold:true};this.textAttr=t.textAttr||{bgColor:"blue"};this.voidAttr=t.voidAttr||t.emptyAttr||{bgColor:"blue"};if(t.keyBindings){this.keyBindings=t.keyBindings}if(this.label){this.labelText=new e({internal:true,parent:this,content:this.label,x:this.outputX,y:this.outputY,height:1,attr:this.labelBlurAttr,leftPadding:this.labelBlurLeftPadding,rightPadding:this.labelBlurRightPadding,noDraw:true})}this.inputType=t.type||"text";this.onFocus=this.onFocus.bind(this);this.onClick=this.onClick.bind(this);this.onInputSubmit=this.onInputSubmit.bind(this);this.initInput(t);this.updateStatus();this.on("key",this.onKey);this.on("focus",this.onFocus);this.on("click",this.onClick);if(this.elementType==="LabeledInput"&&!t.noDraw){this.draw()}}f.exports=o;i.inherit(o);o.prototype.needInput=true;o.prototype.noChildFocus=true;o.prototype.propagateZ=true;o.prototype.keyBindings={ENTER:"submit",KP_ENTER:"submit",ALT_ENTER:"submit"};o.prototype.editableTextBoxKeyBindings={CTRL_K:"meta",BACKSPACE:"backDelete",DELETE:"delete",LEFT:"backward",RIGHT:"forward",CTRL_LEFT:"startOfWord",CTRL_RIGHT:"endOfWord",HOME:"startOfLine",END:"endOfLine",CTRL_B:"startOfSelection",CTRL_E:"endOfSelection",CTRL_T:"moveSelection",ALT_T:"copyToDocumentClipboard",META_T:"copyToSystemClipboard",CTRL_P:"pasteSelection",ALT_P:"pasteDocumentClipboard",META_P:"pasteSystemClipboard",CTRL_D:"deleteSelection",ALT_D:"clearDocumentClipboard",META_D:"clearSystemClipboard"};o.prototype.multiLineEditableTextBoxKeyBindings=Object.assign({},o.prototype.editableTextBoxKeyBindings,{ENTER:"newLine",KP_ENTER:"newLine",UP:"up",DOWN:"down",PAGE_UP:"scrollUp",PAGE_DOWN:"scrollDown",CTRL_B:"startOfSelection",CTRL_E:"endOfSelection",CTRL_K:"meta",CTRL_Y:"copy",META_Y:"copyClipboard",CTRL_P:"paste",META_P:"pasteClipboard"});o.prototype.selectListKeyBindings={UP:"previous",DOWN:"next",ENTER:"submit",KP_ENTER:"submit"};o.prototype.selectListMultiKeyBindings={UP:"previous",DOWN:"next",ENTER:"submit",KP_ENTER:"submit"};o.prototype.initInput=function(t){switch(this.inputType){case"text":this.initTextInput(t);break;case"select":this.initSelectInput(t);break;case"selectMulti":this.initSelectMultiInput(t);break;default:throw new Error("Unknown input type: "+this.inputType)}this.input.on("focus",this.onChildFocus.bind(this))};o.prototype.initTextInput=function(t){if(t.inputKeyBindings){this.inputKeyBindings=t.inputKeyBindings}else if(t.allowNewLine){this.inputKeyBindings=this.multiLineEditableTextBoxKeyBindings}else{this.inputKeyBindings=this.editableTextBoxKeyBindings}this.input=new r({internal:true,parent:this,content:t.content,value:t.value,x:this.outputX+(this.labelText?this.labelText.outputWidth:0),y:this.outputY,width:this.outputWidth-(this.labelText?this.labelText.outputWidth:0),height:this.outputHeight,lineWrap:!!t.lineWrap,wordWrap:!!t.wordWrap,scrollable:!!t.scrollable,vScrollBar:!!t.vScrollBar,hScrollBar:!!t.hScrollBar,hiddenContent:this.hiddenContent,textAttr:this.textAttr,voidAttr:this.voidAttr,keyBindings:this.inputKeyBindings,noDraw:true})};o.prototype.initSelectInput=function(t){if(t.inputKeyBindings){this.inputKeyBindings=t.inputKeyBindings}else{this.inputKeyBindings=this.selectListKeyBindings}this.input=new n({internal:true,parent:this,content:t.content,value:t.value,x:this.outputX+(this.labelText?this.labelText.outputWidth:0),y:this.outputY,width:this.outputWidth-(this.labelText?this.labelText.outputWidth:0),items:t.items,buttonBlurAttr:this.buttonBlurAttr,buttonFocusAttr:this.buttonFocusAttr,buttonDisabledAttr:this.buttonDisabledAttr,buttonSubmittedAttr:this.buttonSubmittedAttr,keyBindings:this.inputKeyBindings,noDraw:true});this.input.on("submit",this.onInputSubmit)};o.prototype.initSelectMultiInput=function(t){if(t.inputKeyBindings){this.inputKeyBindings=t.inputKeyBindings}else{this.inputKeyBindings=this.selectListMultiKeyBindings}this.input=new s({internal:true,parent:this,content:t.content,value:t.value,x:this.outputX+(this.labelText?this.labelText.outputWidth:0),y:this.outputY,width:this.outputWidth-(this.labelText?this.labelText.outputWidth:0),items:t.items,buttonBlurAttr:this.buttonBlurAttr,buttonFocusAttr:this.buttonFocusAttr,buttonDisabledAttr:this.buttonDisabledAttr,buttonSubmittedAttr:this.buttonSubmittedAttr,turnedOnBlurAttr:this.turnedOnBlurAttr,turnedOnFocusAttr:this.turnedOnFocusAttr,turnedOffBlurAttr:this.turnedOffBlurAttr,turnedOffFocusAttr:this.turnedOffFocusAttr,keyBindings:this.inputKeyBindings,noDraw:true});this.input.on("submit",this.onInputSubmit)};o.prototype.updateStatus=function(){if(this.hasFocus||this.hasInputFocus){if(this.labelText){this.labelText.attr=this.labelFocusAttr;this.labelText.leftPadding=this.labelFocusLeftPadding;this.labelText.rightPadding=this.labelFocusRightPadding}}else if(this.labelText){this.labelText.attr=this.labelBlurAttr;this.labelText.leftPadding=this.labelBlurLeftPadding;this.labelText.rightPadding=this.labelBlurRightPadding}};o.prototype.getValue=function(){return this.input.getValue()};o.prototype.setValue=function(t,e){return this.input.setValue(t,e)};o.prototype.getContent=function(){return this.input.getContent()};o.prototype.setContent=function(t,e,r){return this.input.setContent(t,e,r)};o.prototype.drawSelfCursor=function(){if(this.input.drawSelfCursor){this.input.drawSelfCursor()}};o.prototype.onKey=function(t,e,r){if(this.input.emit("key",t,e,r).interrupt){return true}return i.prototype.onKey.call(this,t,e,r)};o.prototype.onInputSubmit=function(t){this.emit("submit",this.getValue(),undefined,this)};o.prototype.onFocus=function(t,e){if(e==="delegate"){return}if(t&&e!=="backCycle"&&this.input){u.nextTick(()=>{this.document.giveFocusTo(this.input,"delegate")})}else{this.updateStatus();if(this.labelText){this.labelText.draw()}}};o.prototype.onChildFocus=function(t,e){this.hasInputFocus=t;this.updateStatus();if(this.labelText){this.labelText.draw()}};o.prototype.onClick=function(t){this.document.giveFocusTo(this,"select")};const a=o.prototype.userActions;a.submit=function(){this.emit("submit",this.getValue(),undefined,this)}}).call(this)}).call(this,l("_process"))},{"./EditableTextBox.js":24,"./Element.js":25,"./SelectList.js":33,"./SelectListMulti.js":34,"./Text.js":36,_process:185,"string-kit":127}],31:[function(t,e,r){"use strict";const i=t("./Element.js");const u=t("./Container.js");const n=t("../spChars.js").box;function s(t){t=!t?{}:t.internal?t:Object.create(t);t.internal=true;i.call(this,t);this.onParentResize=this.onParentResize.bind(this);this.layoutDef=t.layout;this.computed={};this.boxesContainer={};this.boxChars=n.light;if(t.boxChars){if(typeof t.boxChars==="object"){this.boxChars=t.boxChars}else if(typeof t.boxChars==="string"&&n[t.boxChars]){this.boxChars=n[t.boxChars]}}this.on("parentResize",this.onParentResize);this.computeBoundingBoxes();if(this.elementType==="Layout"&&!t.noDraw){this.draw()}}e.exports=s;i.inherit(s);s.prototype.computeBoundingBoxes=function(){var t=this.computed={};var e=this.layoutDef;var r={width_:this.outputDst.width,height_:this.outputDst.height,dx_:this.outputDst.width-1,dy_:this.outputDst.height-1,xmin_:0,ymin_:0};var i={offsetX:this.layoutDef.x||0,offsetY:this.layoutDef.y||0,remainingDx:r.dx_,remainingDy:r.dy_};this.computeBoundingBoxes_(e,t,r,i)};s.prototype.computeBoundingBoxes_=function(t,e,r,i){var n,s,o=false;this.computeDxDy(t,e,r,i);e.xmin_=r.xmin_+i.offsetX;e.xmax_=e.xmin_+e.dx_;e.ymin_=r.ymin_+i.offsetY;e.ymax_=e.ymin_+e.dy_;if(e.xmax_>r.xmax_){e.xmax_=r.xmax_;e.dx_=e.xmax_-e.xmin_}if(e.ymax_>r.ymax_){e.ymax_=r.ymax_;e.dy_=e.ymax_-e.ymin_}e.width_=e.dx_+1;e.height_=e.dy_+1;e.columns=[];e.rows=[];s={offsetX:0,offsetY:0,remainingDx:e.dx_,remainingDy:e.dy_,autoDxCount:0,autoDyCount:0};if(t.columns&&t.columns.length){for(n=0;nthis.outputWidth-this.leftMargin){return}var s=l.computeContentWidth(this.contentEllipsis,false);this.separatorWidth=l.computeContentWidth(this.separator,this.separatorHasMarkup);this.previousPageDef=Object.assign({content:"◀",internalRole:"previousPage"},this.previousPageDef);this.previousPageDef.contentHasMarkup=this.previousPageDef.contentHasMarkup||this.previousPageDef.markup;this.previousPageDef.width=this.buttonPaddingWidth+l.computeContentWidth(this.previousPageDef.content,this.previousPageDef.contentHasMarkup);this.previousPageDef.buttonContent=this.previousPageDef.content;this.nextPageDef=Object.assign({content:"▶",internalRole:"nextPage"},this.nextPageDef);this.nextPageDef.contentHasMarkup=this.nextPageDef.contentHasMarkup||this.nextPageDef.markup;this.nextPageDef.width=this.buttonPaddingWidth+l.computeContentWidth(this.nextPageDef.content,this.nextPageDef.contentHasMarkup);this.nextPageDef.buttonContent=this.nextPageDef.content;var o=0,a=0,u=0;this.itemsDef.forEach((t,e)=>{t.buttonContent=t.content;t.contentHasMarkup=t.contentHasMarkup||t.markup;var r=l.computeContentWidth(t.content,t.contentHasMarkup),i=e===this.itemsDef.length-1;t.width=r+this.buttonPaddingWidth+this.buttonSymbolWidth;var n=a+t.width+(u?this.separatorWidth:0)+(i?0:this.nextPageDef.width+this.separatorWidth)-this.outputWidth-this.leftMargin;if(n>0){if(u){o++;u=0;a=this.previousPageDef.width+this.separatorWidth;n=a+t.width+(i?0:this.nextPageDef.width+this.separatorWidth)-this.outputWidth-this.leftMargin}if(n>0){t.buttonContent=l.truncateContent(t.content,r-n-s,t.contentHasMarkup)+this.contentEllipsis;r=l.computeContentWidth(t.buttonContent,t.contentHasMarkup)}}t.page=o;a+=t.width+(u?this.separatorWidth:0);u++;if(!this.pageItemsDef[o]){this.pageItemsDef[o]=[]}this.pageItemsDef[o].push(t)});this.maxPage=o;if(!this.pageItemsDef.length){this.pageItemsDef.push([])}this.pageItemsDef.forEach((t,e)=>{if(e){t.unshift(this.previousPageDef)}if(et+e.width,0);t.buttonsAndSeparatorsWidth=t.buttonsWidth+(t.length-1)*this.separatorWidth;t.justifyWidth=Math.max(0,this.justify?(this.outputWidth-this.leftMargin-t.buttonsAndSeparatorsWidth)/(t.length-1):0)});if(this.elementType==="RowMenu"&&!t){this.initPage()}};o.prototype.initPage=function(t=this.page){var l=this.pageItemsDef[t],f=0,h=this.leftMargin,c=0;if(!l){return}this.buttons.forEach(t=>t.destroy(false,true));this.buttons.length=0;this.hotkeyToButtonIndex.clear();l.forEach((t,e)=>{var r,i,n,s,o;r=t.internalRole?d:this.ButtonClass;i=r===p||r.prototype instanceof p;n=t.key;s=this.childUseParentKeyValue&&n&&this.value&&typeof this.value==="object"?this.value[n]:t.value;if(e%2){o=t.blurAttr||this.buttonBlurAttr}else{o=t.evenBlurAttr||t.blurAttr||this.buttonEvenBlurAttr||this.buttonBlurAttr}this.buttons[e]=new r({internal:true,parent:this,childId:e,internalRole:t.internalRole,content:t.buttonContent,contentHasMarkup:t.contentHasMarkup,disabled:t.disabled,def:t,key:n,value:s,outputX:this.outputX+h,outputY:this.outputY+c,blurAttr:o,focusAttr:t.focusAttr||this.buttonFocusAttr,disabledAttr:t.disabledAttr||this.buttonDisabledAttr,submittedAttr:t.submittedAttr||this.buttonSubmittedAttr,turnedOnFocusAttr:t.turnedOnFocusAttr||this.buttonTurnedOnFocusAttr,turnedOffFocusAttr:t.turnedOffFocusAttr||this.buttonTurnedOffFocusAttr,turnedOnBlurAttr:t.turnedOnBlurAttr||this.buttonTurnedOnBlurAttr,turnedOffBlurAttr:t.turnedOffBlurAttr||this.buttonTurnedOffBlurAttr,blurLeftPadding:this.blurLeftPadding,blurRightPadding:this.blurRightPadding,focusLeftPadding:this.focusLeftPadding,focusRightPadding:this.focusRightPadding,disabledLeftPadding:this.disabledLeftPadding,disabledRightPadding:this.disabledRightPadding,submittedLeftPadding:this.submittedLeftPadding,submittedRightPadding:this.submittedRightPadding,turnedOnFocusLeftPadding:this.turnedOnFocusLeftPadding,turnedOnFocusRightPadding:this.turnedOnFocusRightPadding,turnedOffFocusLeftPadding:this.turnedOffFocusLeftPadding,turnedOffFocusRightPadding:this.turnedOffFocusRightPadding,turnedOnBlurLeftPadding:this.turnedOnBlurLeftPadding,turnedOnBlurRightPadding:this.turnedOnBlurRightPadding,turnedOffBlurLeftPadding:this.turnedOffBlurLeftPadding,turnedOffBlurRightPadding:this.turnedOffBlurRightPadding,paddingHasMarkup:this.paddingHasMarkup,keyBindings:i?this.toggleButtonKeyBindings:this.buttonKeyBindings,actionKeyBindings:i?this.toggleButtonActionKeyBindings:this.buttonActionKeyBindings,shortcuts:t.shortcuts,noDraw:true});this.buttons[e].on("submit",this.onButtonSubmit);this.buttons[e].on("focus",this.onButtonFocus);this.buttons[e].on("blinked",this.onButtonBlinked);if(t.hotkey){if(Array.isArray(t.hotkey)){t.hotkey.forEach(t=>this.hotkeyToButtonIndex.set(t,e))}else{this.hotkeyToButtonIndex.set(t.hotkey,e)}}if(i){this.buttons[e].on("toggle",this.onButtonToggle)}var a=l.justifyWidth+f;var u=Math.round(a);f=a-u;h+=this.buttons[e].outputWidth+this.separatorWidth+u})};o.prototype.preDrawSelf=function(){this.outputDst.put({x:this.outputX+this.leftMargin,y:this.outputY,attr:this.backgroundAttr}," ".repeat(this.outputWidth-this.leftMargin));if(this.separator){let t,e,r;for(t=0;tthis.buttonsMaxWidth){this.masterDef.buttonContent=s.truncateContent(n,this.buttonsMaxWidth-this.buttonSymbolWidth,t.contentHasMarkup)+" "+this.masterDef.symbol}else if(rt.value===e);if(!r){return false}this.select(r,t);return true};a.prototype.onClickOut=function(){this.toggle(false)};a.prototype.getValue=function(){return this.value}},{"./BaseMenu.js":15,"./Button.js":17,"./ColumnMenu.js":18,"./Element.js":25}],34:[function(t,e,r){"use strict";const i=t("./Element.js");const n=t("./BaseMenu.js");const s=t("./ColumnMenuMulti.js");const o=t("./Button.js");function a(t){t=!t?{}:t.internal?t:Object.create(t);t.internal=true;if(!t.master||typeof t.master!=="object"){t.master=Object.assign({},this.defaultOptions.master)}else{t.master=Object.assign({},this.defaultOptions.master,t.master)}if(t.content){t.master.content=t.content}if(!t.separator||typeof t.separator!=="object"){t.separator=Object.assign({},this.defaultOptions.separator)}else{t.separator=Object.assign({},this.defaultOptions.separator,t.separator)}s.call(this,t);this.showMenu=false;this.zIndexRef=this.zIndex;this.initPage();this.toggle(this.showMenu,t.noDraw);this.onClickOut=this.onClickOut.bind(this);this.on("clickOut",this.onClickOut);if(this.elementType==="SelectListMulti"&&!t.noDraw){this.draw()}}e.exports=a;i.inherit(a,s);a.prototype.defaultOptions={buttonBlurAttr:{bgColor:"gray",color:"white",bold:true},buttonFocusAttr:{bgColor:"white",color:"black",bold:true},buttonDisabledAttr:{bgColor:"gray",color:"white",bold:true,dim:true},buttonSubmittedAttr:{bgColor:"gray",color:"brightWhite",bold:true},turnedOnBlurAttr:{bgColor:"cyan"},turnedOnFocusAttr:{bgColor:"brightCyan",color:"gray",bold:true},turnedOffBlurAttr:{bgColor:"gray",dim:true},turnedOffFocusAttr:{bgColor:"white",color:"black",bold:true},master:{content:"select-list-multi",symbol:"▼",internalRole:"toggle"},separator:{content:"-",contentRepeat:true,internalRole:"separator"}};a.prototype.toggle=function(t=null,e=false){var r,i;if(t===null){this.showMenu=!this.showMenu}else{this.showMenu=!!t}for(r=1,i=this.buttons.length;rt;function o(t){t=!t?{}:t.internal?t:Object.create(t);t.internal=true;i.call(this,t);this.onClick=this.onClick.bind(this);this.onDrag=this.onDrag.bind(this);this.onWheel=this.onWheel.bind(this);this.onButtonSubmit=this.onButtonSubmit.bind(this);this.isVertical=!!t.isVertical;this.slideRate=0;this.handleOffset=0;this.rateToValue=typeof t.rateToValue==="function"?t.rateToValue:s;this.valueToRate=typeof t.valueToRate==="function"?t.valueToRate:s;this.buttonBlurAttr=t.buttonBlurAttr||{bgColor:"black",color:"white",bold:true};this.buttonFocusAttr=t.buttonFocusAttr||{bgColor:"white",color:"black",bold:true};this.buttonSubmittedAttr=t.buttonSubmittedAttr||{bgColor:"gray",color:"brightWhite",bold:true};this.backwardSymbol=t.backwardSymbol||(this.isVertical?"▲":"◀");this.forwardSymbol=t.forwardSymbol||(this.isVertical?"▼":"▶");this.handleAttr=t.handleAttr||{bgColor:"brightWhite",color:"black"};this.handleSymbol=t.handleSymbol||"◆";this.barAttr=t.barAttr||{bgColor:"gray",color:"brightWhite"};this.barSymbol=t.barSymbol||" ";this.backwardButton=this.forwardButton=null;this.on("click",this.onClick);this.on("drag",this.onDrag);this.on("wheel",this.onWheel);this.initChildren();if(this.elementType==="Slider"&&!t.noDraw){this.draw()}}e.exports=o;i.inherit(o);o.prototype.needInput=true;o.prototype.outerDrag=true;o.prototype.keyBindings={UP:"backward",DOWN:"forward",LEFT:"backward",RIGHT:"forward",PAGE_UP:"backward",PAGE_DOWN:"forward"," ":"forward",HOME:"start",END:"end"};o.prototype.buttonKeyBindings={ENTER:"submit",KP_ENTER:"submit"};o.prototype.initChildren=function(){this.backwardButton=new n({internal:true,parent:this,internalRole:"backward",content:this.backwardSymbol,outputX:this.outputX,outputY:this.outputY,blurAttr:this.buttonBlurAttr,focusAttr:this.buttonFocusAttr,submittedAttr:this.buttonSubmittedAttr,keyBindings:this.buttonKeyBindings,noDraw:true});this.backwardButton.on("submit",this.onButtonSubmit);this.forwardButton=new n({internal:true,parent:this,internalRole:"forward",content:this.forwardSymbol,outputX:this.isVertical?this.outputX:this.outputX+this.outputWidth-1,outputY:this.isVertical?this.outputY+this.outputHeight-1:this.outputY,blurAttr:this.buttonBlurAttr,focusAttr:this.buttonFocusAttr,submittedAttr:this.buttonSubmittedAttr,keyBindings:this.buttonKeyBindings,noDraw:true});this.forwardButton.on("submit",this.onButtonSubmit);this.computeHandleOffset()};o.prototype.setSizeAndPosition=function(t){this.outputX=t.outputX!==undefined?t.outputX:t.x!==undefined?t.x:this.outputX||0;this.outputY=t.outputY!==undefined?t.outputY:t.y!==undefined?t.y:this.outputY||0;this.outputWidth=t.outputWidth!==undefined?t.outputWidth:t.width!==undefined?t.width:this.outputWidth||1;this.outputHeight=t.outputHeight!==undefined?t.outputHeight:t.height!==undefined?t.height:this.outputHeight||1;this.backwardButton.outputX=this.outputX;this.backwardButton.outputY=this.outputY;this.forwardButton.outputX=this.isVertical?this.outputX:this.outputX+this.outputWidth-1;this.forwardButton.outputY=this.isVertical?this.outputY+this.outputHeight-1:this.outputY};o.prototype.preDrawSelf=function(){return this.isVertical?this.preDrawSelfVertical():this.preDrawSelfHorizontal()};o.prototype.preDrawSelfVertical=function(){var t=0,e=this.outputY+1,r=this.outputY+this.outputHeight-2;for(;e<=r;e++,t++){if(t===this.handleOffset){this.outputDst.put({x:this.outputX,y:e,attr:this.handleAttr},this.handleSymbol)}else{this.outputDst.put({x:this.outputX,y:e,attr:this.barAttr},this.barSymbol)}}};o.prototype.preDrawSelfHorizontal=function(){var t=0,e=this.outputX+1,r=this.outputX+this.outputWidth-2;for(;e<=r;e++,t++){if(t===this.handleOffset){this.outputDst.put({x:e,y:this.outputY,attr:this.handleAttr},this.handleSymbol)}else{this.outputDst.put({x:e,y:this.outputY,attr:this.barAttr},this.barSymbol)}}};o.prototype.postDrawSelf=function(){if(this.isVertical){this.outputDst.moveTo(this.outputX,this.outputY+this.handleOffset+1)}else{this.outputDst.moveTo(this.outputX+this.handleOffset+1,this.outputY)}};o.prototype.computeHandleOffset=function(){var t=(this.isVertical?this.outputHeight:this.outputWidth)-3;this.handleOffset=Math.round(t*this.slideRate)};o.prototype.setHandleOffset=function(t,e=false){var r=(this.isVertical?this.outputHeight:this.outputWidth)-3;this.handleOffset=Math.max(0,Math.min(r,Math.round(t||0)));this.slideRate=Math.max(0,Math.min(1,this.handleOffset/r||0));if(!e){this.emit("slide",this.getValue());this.draw()}};o.prototype.setSlideRate=function(t,e=false){this.slideRate=Math.max(0,Math.min(1,t||0));this.computeHandleOffset();if(!e){this.emit("slide",this.getValue());this.draw()}};o.prototype.getValue=function(){return this.rateToValue(this.slideRate)};o.prototype.setValue=function(t,e){return this.setSlideRate(this.valueToRate(t),e)};o.prototype.getHandleOffset=function(){return this.handleOffset};o.prototype.getSlideRate=function(){return this.slideRate};o.prototype.onButtonSubmit=function(t,e,r){switch(r.internalRole){case"backward":this.emit("slideStep",-1);break;case"forward":this.emit("slideStep",1);break}};o.prototype.onClick=function(t){if(!this.hasFocus){this.document.giveFocusTo(this,"select")}this.setHandleOffset((this.isVertical?t.y:t.x)-1)};o.prototype.onDrag=function(t){this.setHandleOffset((this.isVertical?t.y:t.x)-1)};o.prototype.onWheel=function(t){this.emit("slideStep",t.yDirection)}},{"./Button.js":17,"./Element.js":25}],36:[function(t,e,r){"use strict";const i=t("./Element.js");function n(t){t=!t?{}:t.internal?t:Object.create(t);t.internal=true;this.attr=t.attr||{bgColor:"brightBlack"};this.leftPadding=t.leftPadding||"";this.rightPadding=t.rightPadding||"";if(!Array.isArray(t.content)){t.content=[t.content||""]}this.content=this.content??t.content;this.contentHasMarkup=this.contentHasMarkup??t.contentHasMarkup;if(!t.width){t.width=this.computeRequiredWidth()}t.height=this.computeRequiredHeight();i.call(this,t);if(this.elementType==="Text"&&!t.noDraw){this.draw()}}e.exports=n;i.inherit(n);n.prototype.forceContentArray=true;n.prototype.computeRequiredWidth=function(){return i.computeContentWidth(this.leftPadding,this.paddingHasMarkup)+i.computeContentWidth(this.rightPadding,this.paddingHasMarkup)+(this.animation?Math.max(...this.animation.map(t=>i.computeContentWidth(t,this.contentHasMarkup))):i.computeContentWidth(this.content,this.contentHasMarkup)||1)};n.prototype.computeRequiredHeight=function(){return this.animation?Math.max(...this.animation.map(t=>t.length)):this.content.length};n.prototype.resizeOnContent=function(){this.width=this.computeRequiredWidth(this.content,this.contentHasMarkup);this.height=this.computeRequiredHeight(this.content,this.contentHasMarkup)};n.prototype.postDrawSelf=function(){if(!this.outputDst){return this}var t,e,r,i;for(r=0;r0){this.outputDst.put({attr:this.attr}," ".repeat(t))}}}}},{"./Element.js":25}],37:[function(t,e,r){"use strict";const i=t("./Element.js");const n=t("./Slider.js");const s=t("../ScreenBuffer.js");const o=t("../TextBuffer.js");const a=t("../Rect.js");const u=t("string-kit");function l(t){t=!t?{}:t.internal?t:Object.create(t);t.internal=true;i.call(this,t);this.onClick=this.onClick.bind(this);this.onDrag=this.onDrag.bind(this);this.onWheel=this.onWheel.bind(this);this.onParentResize=this.onParentResize.bind(this);if(t.keyBindings){this.keyBindings=t.keyBindings}this.textAttr=t.textAttr||t.attr||{bgColor:"default"};this.altTextAttr=t.altTextAttr||Object.assign({},this.textAttr,{color:"gray",italic:true});this.voidAttr=t.voidAttr||t.emptyAttr||t.attr||{bgColor:"default"};this.scrollable=!!t.scrollable;this.hasVScrollBar=this.scrollable&&!!t.vScrollBar;this.hasHScrollBar=this.scrollable&&!!t.hScrollBar;this.scrollX=t.scrollX||0;this.scrollY=t.scrollY||0;this.extraScrolling=!!t.extraScrolling;this.autoScrollContextLines=t.autoScrollContextLines??0;this.autoScrollContextColumns=t.autoScrollContextColumns??1;this.firstLineRightShift=t.firstLineRightShift||0;this.wordWrap=!!(t.wordWrap||t.wordwrap);this.lineWrap=!!(t.lineWrap||this.wordWrap);this.hiddenContent=t.hiddenContent;this.stateMachine=t.stateMachine;this.textAreaWidth=this.hasVScrollBar?this.outputWidth-1:this.outputWidth;this.textAreaHeight=this.hasHScrollBar?this.outputHeight-1:this.outputHeight;this.textBuffer=null;this.altTextBuffer=null;this.vScrollBarSlider=null;this.hScrollBarSlider=null;this.on("key",this.onKey);this.on("click",this.onClick);this.on("drag",this.onDrag);this.on("wheel",this.onWheel);this.on("parentResize",this.onParentResize);this.initChildren();if(this.setContent===l.prototype.setContent){this.setContent(t.content,t.contentHasMarkup,true)}if(this.elementType==="TextBox"&&!t.noDraw){this.draw()}}e.exports=l;i.inherit(l);l.prototype.strictInlineSupport=true;l.prototype.keyBindings={CTRL_K:"meta",UP:"tinyScrollUp",DOWN:"tinyScrollDown",PAGE_UP:"scrollUp",PAGE_DOWN:"scrollDown"," ":"scrollDown",HOME:"scrollTop",END:"scrollBottom",LEFT:"scrollLeft",RIGHT:"scrollRight",ALT_T:"copyToDocumentClipboard",META_T:"copyToSystemClipboard"};l.prototype.initChildren=function(){this.textBuffer=new o({dst:this.outputDst,x:this.outputX,y:this.outputY,firstLineRightShift:this.firstLineRightShift,lineWrapWidth:this.lineWrap?this.textAreaWidth:null,wordWrap:this.wordWrap,dstClipRect:{x:this.outputX,y:this.outputY,width:this.textAreaWidth,height:this.textAreaHeight},hidden:this.hiddenContent,forceInBound:true,stateMachine:this.stateMachine});this.setAttr(undefined,undefined,true);if(this.useAltTextBuffer){this.altTextBuffer=new o({firstLineRightShift:this.firstLineRightShift,lineWrapWidth:this.lineWrap?this.textAreaWidth:null,wordWrap:this.wordWrap,dstClipRect:{x:this.outputX,y:this.outputY,width:this.textAreaWidth,height:this.textAreaHeight}});this.setAltAttr();this.textBuffer.setVoidTextBuffer(this.altTextBuffer)}if(this.hasVScrollBar){this.vScrollBarSlider=new n({internal:true,parent:this,x:this.outputX+this.outputWidth-1,y:this.outputY,height:this.outputHeight,isVertical:true,valueToRate:t=>-t/Math.max(1,this.textBuffer.buffer.length-this.textAreaHeight),rateToValue:t=>-t*Math.max(1,this.textBuffer.buffer.length-this.textAreaHeight),noDraw:true});this.vScrollBarSlider.on("slideStep",t=>this.scroll(0,-t*Math.ceil(this.textAreaHeight/2)));this.vScrollBarSlider.on("slide",t=>this.scrollTo(null,t))}if(this.hasHScrollBar){this.hScrollBarSlider=new n({internal:true,parent:this,x:this.outputX,y:this.outputY+this.outputHeight-1,width:this.outputWidth-this.hasVScrollBar,valueToRate:t=>{var e=this.textBuffer.getContentSize().width;return-t/Math.max(1,e-this.textAreaWidth)},rateToValue:t=>{var e=this.textBuffer.getContentSize().width;return-t*Math.max(1,e-this.textAreaWidth)},noDraw:true});this.hScrollBarSlider.on("slideStep",t=>this.scroll(-t*Math.ceil(this.textAreaWidth/2),0));this.hScrollBarSlider.on("slide",t=>this.scrollTo(t,null))}};l.prototype.setSizeAndPosition=function(t){this.outputX=t.outputX!==undefined?t.outputX:t.x!==undefined?t.x:this.outputX||0;this.outputY=t.outputY!==undefined?t.outputY:t.y!==undefined?t.y:this.outputY||0;this.outputWidth=t.outputWidth!==undefined?t.outputWidth:t.width!==undefined?t.width:this.outputWidth||1;this.outputHeight=t.outputHeight!==undefined?t.outputHeight:t.height!==undefined?t.height:this.outputHeight||1;this.textAreaWidth=this.hasVScrollBar?this.outputWidth-1:this.outputWidth;this.textAreaHeight=this.hasHScrollBar?this.outputHeight-1:this.outputHeight;this.textBuffer.lineWrapWidth=this.lineWrap?this.textAreaWidth:null;if(this.altTextBuffer){this.altTextBuffer.lineWrapWidth=this.lineWrap?this.textAreaWidth:null}this.textBuffer.x=this.outputX;this.textBuffer.y=this.outputY;this.textBuffer.dstClipRect=new a({x:this.outputX,y:this.outputY,width:this.textAreaWidth,height:this.textAreaHeight});if(this.lineWrap){this.textBuffer.wrapAllLines();if(this.altTextBuffer){this.altTextBuffer.wrapAllLines()}}if(this.vScrollBarSlider){this.vScrollBarSlider.setSizeAndPosition({outputX:this.outputX+this.outputWidth-1,outputY:this.outputY,outputHeight:this.outputHeight})}if(this.hScrollBarSlider){this.hScrollBarSlider.setSizeAndPosition({outputX:this.outputX,outputY:this.outputY+this.outputHeight-1,outputWidth:this.hasVScrollBar?this.outputWidth-1:this.outputWidth})}};l.prototype.preDrawSelf=function(){this.textBuffer.draw({dst:this.outputDst})};l.prototype.scrollTo=function(t,e,r=false){if(!this.scrollable){return}if(t!==undefined&&t!==null){this.scrollX=Math.min(0,Math.max(Math.round(t),(this.extraScrolling?1:this.textAreaWidth)-this.textBuffer.getContentSize().width+1));this.textBuffer.x=this.outputX+this.scrollX}if(e!==undefined&&e!==null){this.scrollY=Math.min(0,Math.max(Math.round(e),(this.extraScrolling?1:this.textAreaHeight)-this.textBuffer.buffer.length));this.textBuffer.y=this.outputY+this.scrollY}if(this.vScrollBarSlider){this.vScrollBarSlider.setValue(this.scrollY,true)}if(this.hScrollBarSlider){this.hScrollBarSlider.setValue(this.scrollX,true)}if(!r){this.draw()}};l.prototype.scroll=function(t,e,r=false){return this.scrollTo(t?this.scrollX+t:null,e?this.scrollY+e:null,r)};l.prototype.scrollToTop=function(t=false){return this.scrollTo(null,0,t)};l.prototype.scrollToBottom=function(t=false){return this.scrollTo(null,this.textAreaHeight-this.textBuffer.buffer.length,t)};l.prototype.autoScrollAndDraw=function(t=false,e=false){var r,i,n=Math.min(Math.floor(this.textAreaWidth/2),this.autoScrollContextColumns),s=Math.min(Math.floor(this.textAreaHeight/2),this.autoScrollContextLines);if(this.textBuffer.cx<-this.scrollX+n&&this.scrollX!==0){r=Math.min(0,-this.textBuffer.cx+n)}else if(this.textBuffer.cx>this.textAreaWidth-this.scrollX-1-n){r=this.textAreaWidth-1-this.textBuffer.cx-n}if(this.textBuffer.cy<-this.scrollY+s){i=Math.min(0,-this.textBuffer.cy+s)}else if(this.textBuffer.cy>this.textAreaHeight-this.scrollY-1-s){i=this.textAreaHeight-1-this.textBuffer.cy-s}if(r!==undefined||i!==undefined){this.scrollTo(r,i,e)}else if(!t){this.draw()}else{this.drawCursor()}};l.prototype.autoScrollAndSmartDraw=function(){return this.autoScrollAndDraw(true)};l.prototype.setAttr=function(t=this.textAttr,e=this.voidAttr,r=false,i=false){this.textAttr=t;this.voidAttr=e;this.textBuffer.setDefaultAttr(this.textAttr);this.textBuffer.setVoidAttr(this.voidAttr);if(!i){this.setContent(this.content,this.contentHasMarkup,r)}};l.prototype.setAltAttr=function(t=this.altTextAttr){this.altTextAttr=t;this.altTextBuffer.setDefaultAttr(this.altTextAttr);this.altTextBuffer.setVoidAttr(this.voidAttr)};l.prototype.getContentSize=function(){return this.textBuffer.getContentSize()};l.prototype.getContent=function(){return this.textBuffer.getText()};l.prototype.setContent=function(t,e,r){var i;if(typeof t!=="string"){if(t===null||t===undefined){t=""}else{t=""+t}}this.content=t;this.contentHasMarkup=e;this.textBuffer.setText(this.content,this.contentHasMarkup,this.textAttr);if(this.stateMachine){this.textBuffer.runStateMachine()}this.textBuffer.moveToEndOfBuffer();if(!r){this.drawCursor();this.outerDraw()}};l.prototype.getAltContent=function(){if(!this.altTextBuffer){return null}return this.altTextBuffer.getText()};l.prototype.setAltContent=function(t,e,r){if(!this.altTextBuffer){return}var i;if(typeof t!=="string"){if(t===null||t===undefined){t=""}else{t=""+t}}this.altTextBuffer.setText(t,e,this.altTextAttr);if(!r){this.drawCursor();this.outerDraw()}};l.prototype.prependContent=function(t,e){return this.addContent(t,"prepend",e)};l.prototype.appendContent=function(t,e){return this.addContent(t,"append",e)};l.prototype.appendLog=function(t,e){return this.addContent(t,"appendLog",e)};l.prototype.addContent=function(t,e,r){var i,n=false;if(typeof t!=="string"){if(t===null||t===undefined){t=""}else{t=""+t}}switch(e){case"prepend":this.content=t+this.content;this.textBuffer.prepend(t,this.contentHasMarkup,this.textAttr);break;case"appendLog":n=this.textBuffer.buffer.length<=this.textAreaHeight||this.scrollY<=this.textAreaHeight-this.textBuffer.buffer.length;this.textBuffer.moveToEndOfBuffer();if(this.textBuffer.cx){t="\n"+t}this.content+=t;this.textBuffer.insert(t,this.contentHasMarkup,this.textAttr);break;case"append":default:this.content+=t;this.textBuffer.append(t,this.contentHasMarkup,this.textAttr);break}if(this.stateMachine){this.textBuffer.runStateMachine()}this.textBuffer.moveToEndOfBuffer();if(n){this.scrollToBottom(r)}else if(!r){if(this.vScrollBarSlider){this.vScrollBarSlider.setValue(this.scrollY,true)}this.drawCursor();this.draw()}};l.prototype.setStateMachine=function(t,e=false){this.stateMachine=t;this.textBuffer.stateMachine=this.stateMachine;if(this.stateMachine&&!e){this.textBuffer.runStateMachine();this.draw()}};l.prototype.onWheel=function(t){if(!this.hasFocus){this.document.giveFocusTo(this,"select")}if(this.scrollable){this.scroll(0,-t.yDirection*Math.ceil(this.textAreaHeight/5))}};l.prototype.onClick=function(t){if(this.hasFocus){if(this.textBuffer.selectionRegion){this.textBuffer.resetSelectionRegion();this.draw()}}else{if(this.scrollable){this.document.giveFocusTo(this,"select")}}};l.prototype.onDrag=function(t){var e,r,i,n;if(!this.hasFocus){this.document.giveFocusTo(this,"select")}if(t.yFromundefined)}this.draw()};l.prototype.onParentResize=function(){if(!this.autoWidth&&!this.autoHeight){return}var t={};if(this.autoWidth){t.outputWidth=Math.round(this.outputDst.width*this.autoWidth)}if(this.autoHeight){t.outputHeight=Math.round(this.outputDst.height*this.autoHeight)}this.setSizeAndPosition(t);this.draw()};const f=l.prototype.userActions;f.tinyScrollUp=function(){this.scroll(0,Math.ceil(this.textAreaHeight/5));this.emit("scroll")};f.tinyScrollDown=function(){this.scroll(0,-Math.ceil(this.textAreaHeight/5));this.emit("scroll")};f.scrollUp=function(){this.scroll(0,Math.ceil(this.textAreaHeight/2));this.emit("scroll")};f.scrollDown=function(){this.scroll(0,-Math.ceil(this.textAreaHeight/2));this.emit("scroll")};f.scrollLeft=function(){this.scroll(Math.ceil(this.textAreaWidth/2),0);this.emit("scroll")};f.scrollRight=function(){this.scroll(-Math.ceil(this.textAreaWidth/2),0);this.emit("scroll")};f.scrollTop=function(){this.scrollToTop();this.emit("scroll")};f.scrollBottom=function(){this.scrollToBottom();this.emit("scroll")};f.copyToDocumentClipboard=function(){if(this.document){this.document.setDocumentClipboard(this.textBuffer.getSelectionText())}};f.copyToSystemClipboard=function(){if(this.document){this.document.setSystemClipboard(this.textBuffer.getSelectionText()).catch(()=>undefined)}}},{"../Rect.js":2,"../ScreenBuffer.js":3,"../TextBuffer.js":6,"./Element.js":25,"./Slider.js":35,"string-kit":127}],38:[function(t,e,r){"use strict";const i=t("./Element.js");const o=t("./TextBox.js");const n=t("../spChars.js").box;function s(t){t=!t?{}:t.internal?t:Object.create(t);t.internal=true;i.call(this,t);this.cellContents=t.cellContents;this.rawContentWidth=0;this.rawContentHeight=0;this.contentHasMarkup=t.contentHasMarkup;this.textBoxes=null;this.rowCount=0;this.columnCount=0;this.rowHeights=[];this.columnWidths=[];this.textAttr=t.textAttr||{bgColor:"default"};this.voidAttr=t.voidAttr||t.emptyAttr||null;this.firstRowTextAttr=t.firstRowTextAttr||null;this.firstRowVoidAttr=t.firstRowVoidAttr||null;this.evenRowTextAttr=t.evenRowTextAttr||null;this.evenRowVoidAttr=t.evenRowVoidAttr||null;this.firstColumnTextAttr=t.firstColumnTextAttr||null;this.firstColumnVoidAttr=t.firstColumnVoidAttr||null;this.evenColumnTextAttr=t.evenColumnTextAttr||null;this.evenColumnVoidAttr=t.evenColumnVoidAttr||null;this.firstCellTextAttr=t.firstCellTextAttr||null;this.firstCellVoidAttr=t.firstCellVoidAttr||null;this.evenCellTextAttr=t.evenCellTextAttr||null;this.evenCellVoidAttr=t.evenCellVoidAttr||null;this.checkerEvenCellTextAttr=t.checkerEvenCellTextAttr||null;this.checkerEvenCellVoidAttr=t.checkerEvenCellVoidAttr||null;this.expandToWidth=t.expandToWidth!==undefined?!!t.expandToWidth:!!t.fit;this.shrinkToWidth=t.shrinkToWidth!==undefined?!!t.shrinkToWidth:!!t.fit;this.expandToHeight=t.expandToHeight!==undefined?!!t.expandToHeight:!t.height?false:!!t.fit;this.shrinkToHeight=t.shrinkToHeight!==undefined?!!t.shrinkToHeight:!t.height?false:!!t.fit;this.wordWrap=t.wordWrap!==undefined||t.wordwrap!==undefined?!!(t.wordWrap||t.wordwrap):!!t.fit;this.lineWrap=this.wordWrap||(t.lineWrap!==undefined?!!t.lineWrap:!!t.fit);this.hasBorder=t.hasBorder!==undefined?!!t.hasBorder:true;this.borderAttr=t.borderAttr||this.textAttr;this.borderChars=n.light;if(typeof t.borderChars==="object"){this.borderChars=n.__fix__(t.borderChars)}else if(typeof t.borderChars==="string"&&n[t.borderChars]){this.borderChars=n[t.borderChars]}if(t.textBoxKeyBindings){this.textBoxKeyBindings=t.textBoxKeyBindings}this.initChildren();this.computeCells();if(this.elementType==="TextTable"&&!t.noDraw){this.draw()}}e.exports=s;i.inherit(s);s.prototype.strictInlineSupport=true;s.prototype.staticInline=true;s.prototype.inlineResizeToContent=true;s.prototype.textBoxKeyBindings=o.prototype.keyBindings;s.prototype.setCellContent=function(t,e,r,i=false,n=false){var s=this.textBoxes[e]&&this.textBoxes[e][t];if(!s){return}this.cellContents[e][t]=r;s.setContent(r,this.contentHasMarkup,true);if(!n){this.computeCells();if(!i){this.draw()}}else{if(!i){s.draw()}}};s.prototype.setCellAttr=function(t,e,r,i,n=false){var s=this.textBoxes[e]&&this.textBoxes[e][t];if(!s){return}if(i===undefined){i=r}s.setAttr(r,i,n)};s.prototype.resetCellAttr=function(t,e,r=false){var i=this.textBoxes[e]&&this.textBoxes[e][t];if(!i){return}var n=this.getTextAttrForCell(t,e),s=this.getVoidAttrForCell(t,e,n);i.setAttr(n,s,r)};s.prototype.setRowAttr=function(e,r,i,t=false){for(let t=0;t=this.columnCount){this.columnCount=n+1}r=this.getTextAttrForCell(n,s);i=this.getVoidAttrForCell(n,s,r);this.textBoxes[s][n]=new o({internal:true,parent:this,content:e,contentHasMarkup:this.contentHasMarkup,x:this.outputX,y:this.outputY,width:this.outputWidth,height:this.outputHeight,lineWrap:this.lineWrap,wordWrap:this.wordWrap,textAttr:r,voidAttr:i,keyBindings:this.textBoxKeyBindings,noDraw:true});n++}s++}};s.prototype.computeCells=function(){var t=this.computeColumnWidths();if(t){this.textBoxesWordWrap()}this.computeRowHeights();this.textBoxesSizeAndPosition()};s.prototype.computeColumnWidths=function(){var t,e,r,i,n;this.rawContentWidth=+this.hasBorder;for(t=0;ti){i=n}}this.columnWidths[t]=i;this.rawContentWidth+=i+this.hasBorder}this.contentWidth=this.rawContentWidth;if(this.expandToWidth&&this.rawContentWidththis.outputWidth){this.shrink(this.rawContentWidth,this.outputWidth,this.columnWidths);this.contentWidth=this.outputWidth;return true}return false};s.prototype.computeRowHeights=function(){var t,e,r,i,n;this.rawContentHeight=+this.hasBorder;for(e=0;ei){i=n}}this.rowHeights[e]=i;this.rawContentHeight+=i+this.hasBorder}this.contentHeight=this.rawContentHeight;if(this.expandToHeight&&this.rawContentHeightthis.outputHeight){this.shrink(this.rawContentHeight,this.outputHeight,this.rowHeights);this.contentHeight=this.outputHeight;return true}return false};s.prototype.expand=function(t,e,r){var i,n=0,s=0,o=r.length,a=e-(this.hasBorder?o+1:0);if(a<=0){return}var u=t-(this.hasBorder?o+1:0),l=a/u;for(i=0;i0){n=0;s=0;o.length=0;for(i=0;in){s=n;n=r[i];o.length=0;o.push(i)}else if(r[i]===n){o.push(i)}else if(r[i]>s){s=r[i]}}if(!n){return}u=Math.min(n-s,h/o.length);l=Math.floor(u);if(l>=0){for(let t of o){r[t]-=l;h-=l}}if(l!==u){f=h%o.length;for(let t=0;t=1){e=s.truncateContent(this.content,n,this.contentHasMarkup);r=s.getLastTruncateWidth();this.outputDst.put({x:this.outputX,y:this.outputY,markup:this.contentHasMarkup},this.frameChars.topLeft+this.frameChars.horizontal+"["+e+"]"+this.frameChars.horizontal.repeat(this.outputWidth-5-r)+this.frameChars.topRight)}else{this.outputDst.put({x:this.outputX,y:this.outputY},this.frameChars.topLeft+this.frameChars.horizontal.repeat(this.outputWidth-2)+this.frameChars.topRight)}this.outputDst.put({x:this.outputX,y:this.outputY+this.outputHeight-1},this.frameChars.bottomLeft+this.frameChars.horizontal.repeat(this.outputWidth-2)+this.frameChars.bottomRight);i=this.frameChars.vertical.repeat(this.outputHeight-2);this.outputDst.put({x:this.outputX,y:this.outputY+1,direction:"down"},i);this.outputDst.put({x:this.outputX+this.outputWidth-1,y:this.outputY+1,direction:"down"},i);o.prototype.preDrawSelf.call(this)}},{"../spChars.js":53,"./Container.js":21,"./Element.js":25}],41:[function(n,t,u){(function(i){(function(){"use strict";const s=n("seventh");const t=n("string-kit");n("./patches.js");const e=n("child_process").execAsync;const r=n("child_process").execFileAsync;const o=n("child_process").spawn;const a={c:"clipboard",p:"primary",s:"secondary"};if(i.platform==="linux"){u.getClipboard=async t=>{var e=a[t[0]]||"clipboard";return await r("xclip",["-o","-selection",e])};u.setClipboard=async(t,e)=>{var r=new s;var i=a[e[0]]||"clipboard";var n=o("xclip",["-i","-selection",i]);n.on("error",t=>{r.reject(t)});n.on("exit",t=>{if(t!==0){r.reject(t)}else{r.resolve()}});n.stdin.end(t);return r}}else{u.getClipboard=()=>s.reject(new Error("No clipboard manipulation program found"));u.setClipboard=()=>s.reject(new Error("No clipboard manipulation program found"))}}).call(this)}).call(this,n("_process"))},{"./patches.js":48,_process:185,child_process:141,seventh:113,"string-kit":127}],42:[function(t,e,f){(function(e){(function(){"use strict";const u=t("./autoComplete.js");const n=t("fs");const l=t("path");const s=t("seventh");f.readdir=async(r,i=null)=>{if(r[r.length-1]!=="/"){r+="/"}var t=await n.promises.readdir(r);var e=await s.map(t,async t=>{var e=await n.promises.lstat(r+t);if(i&&!f.statsFilter(e,i)){return null}if(e.isDirectory()){t+="/"}return t});e=e.filter(t=>t!==null);return e};f.statsFilter=(t,e)=>{if(t.isFile()&&!e.file||t.isDirectory()&&!e.directory){return false}return true};f.resolveBaseDir=async t=>{if(!t){t=e.cwd()}else{t=l.resolve(t);if(!l.isAbsolute(t)){t=await n.promises.realpath(t)}}if(t[t.length-1]!=="/"){t+="/"}return t};f.autoCompleteFile=async(e,t)=>{var r,i,n,s,o,a=t.baseDir;if(e[e.length-1]==="/"){n=r=e;i=""}else if(e==="."){r="";n="";i="."}else{r=l.dirname(e);if(r==="."){if(e.startsWith("./")){r="./";n=""}else{r=n=""}}else{n=r=r+"/"}i=l.basename(e)}if(!l.isAbsolute(n)){n=a+n}try{s=await f.readdir(n,t.accept)}catch(t){return e}if(!Array.isArray(s)||!s.length){return e}o=u(s,i,true,r);return o}}).call(this)}).call(this,t("_process"))},{"./autoComplete.js":7,_process:185,fs:141,path:184,seventh:113}],43:[function(t,e,r){"use strict";const a=t("./fileHelpers.js");const u=t("path");e.exports=async function t(e,r){var i,n,s,o;if(typeof e==="function"){r=e;e={}}if(!e||typeof e!=="object"){e={}}try{i=await a.resolveBaseDir(e.baseDir);n={baseDir:i};s=Object.assign({},e,{autoComplete:t=>a.autoCompleteFile(t,n),autoCompleteMenu:true,minLength:1});o=await this.inputField(s).promise}catch(t){if(r){r(t);return}throw t}if(!o&&typeof o!=="string"){o=undefined}else{o=u.resolve(u.isAbsolute(o)?o:i+o)}if(r){r(undefined,o)}return o}},{"./fileHelpers.js":42,path:184}],44:[function(t,e,r){"use strict";var _=t("seventh");var C={ENTER:"submit",KP_ENTER:"submit",UP:"previous",DOWN:"next",LEFT:"previousColumn",RIGHT:"nextColumn",TAB:"cycleNext",SHIFT_TAB:"cyclePrevious",HOME:"first",END:"last"};e.exports=function t(e,n,i){if(arguments.length<1){throw new Error("[terminal] gridMenu() needs at least an array of menuItems argument")}if(!Array.isArray(e)||!e.length){throw new TypeError("[terminal] gridMenu(): argument #0 should be a non-empty array")}if(typeof n==="function"){i=n;n={}}else if(!n||typeof n!=="object"){n={}}if(!n.style){n.style=this}if(!n.selectedStyle){n.selectedStyle=this.inverse}if(n.leftPadding===undefined){n.leftPadding=" "}if(n.selectedLeftPadding===undefined){n.selectedLeftPadding=" "}if(n.rightPadding===undefined){n.rightPadding=" "}if(n.selectedRightPadding===undefined){n.selectedRightPadding=" "}if(!n.x){n.x=1}if(!n.y){this("\n")}else{this.moveTo(n.x,n.y)}if(!n.width){n.width=this.width-n.x+1}if(!n.itemMaxWidth){n.itemMaxWidth=Math.floor((n.width-1)/3)}var s=n.keyBindings||C;if(!this.grabbing){this.grabInput()}var o={},a=0,u=false,l=false,r=0,f=0,h,c,d,p;p=Math.max(n.leftPadding.length,n.selectedLeftPadding.length)+Math.max(n.rightPadding.length,n.selectedRightPadding.length);e=e.map(t=>{if(typeof t!=="string"){t=""+t}r=Math.max(r,t.length);return t});r=Math.min(r,n.itemMaxWidth-p);f=r+p;c=Math.floor(n.width/f);d=Math.ceil(e.length/c);h=e.map((t,e)=>({offsetY:e%d,offsetX:n.x-1+Math.floor(e/d)*f,index:e,text:t,displayText:t.length>r?t.slice(0,r-1)+"…":t+" ".repeat(r-t.length)}));var g=(t,e)=>{if(l){return}l=true;u=true;this.removeListener("key",v);this.removeListener("mouse",w);this.moveTo(1,o.y+d);if(t){if(i){i(t)}else{x.promise.reject(t)}return}var r=e!==undefined?e:{selectedIndex:a,selectedText:h[a].text,x:1+h[a].offsetX,y:o.y+h[a].offsetY};if(i){i(undefined,r)}else{x.promise.resolve(r)}};var y=()=>{for(var t=0;t{var e=h[t];this.moveTo(1+e.offsetX,o.y+e.offsetY);if(t===a){n.selectedStyle.noFormat(n.selectedLeftPadding);n.selectedStyle.noFormat(e.displayText);n.selectedStyle.noFormat(n.selectedRightPadding)}else{n.style.noFormat(n.leftPadding);n.style.noFormat(e.displayText);n.style.noFormat(n.rightPadding)}};var b=()=>{this.moveTo(1+h[a].offsetX,o.y+h[a].offsetY)};var v=(t,e,r)=>{if(u){return}var i=a;switch(s[t]){case"submit":g();break;case"previous":if(a>0){a--;m(a);m(a+1);b()}break;case"next":if(a=d){a-=d;m(i);m(a);b()}break;case"nextColumn":if(a=h.length){a=0}m(i);m(a);b();break;case"first":if(a!==0){a=0;m(i);m(a);b()}break;case"last":if(a!==h.length-1){a=h.length-1;m(i);m(a);b()}break;default:if(n.exitOnUnexpectedKey){g(undefined,{unexpectedKey:t,unexpectedKeyData:r})}break}};var w=(t,e)=>{if(u){return}if(e.y=o.y+d){return}var r,i=false,n=a;for(r=0;r=1+h[r].offsetX&&e.x<1+h[r].offsetX+f){i=true;if(a!==r){a=r;m(n);m(a);b()}break}}if(i&&t==="MOUSE_LEFT_BUTTON_PRESSED"){g()}};this.getCursorLocation((t,e,r)=>{if(t){this.row.eraseLineAfter(this.height)("\n");e=1;r=this.height}o.x=e;o.y=r;var i=o.y+d-this.height;if(i>0){this("\n".repeat(i));o.y-=i}y();this.on("key",v);if(this.mouseGrabbing){this.on("mouse",w)}});var x={};x.promise=new _;return x}},{seventh:113}],45:[function(l,e,t){(function(t){(function(){"use strict";const x=l("ndarray");const r=l("seventh");const u={};e.exports=u;var i;if(t.IS_BROWSER){i=l("@cronvel/get-pixels")}u.load=function t(n,e,s,o){if(!i){try{i=l("get-pixels")}catch(t){i=l("@cronvel/get-pixels")}}if(typeof s==="function"){o=s;s={}}else if(!s||typeof s!=="object"){s={}}var a=new r;i(e,(t,e)=>{if(t){var r=new Error("Bad image URL: "+t);r.code=t.code;r.parent=t;if(o){o(r)}else{a.reject(r)}return}if(e.shape.length===4){e=e.pick(0,null,null,null)}if(s.shrink){e=u.shrinkNdarrayImage(e,s.shrink)}var i=n(e,s);if(o){o(undefined,i)}else{a.resolve(i)}});return a};u.shrinkNdarrayImage=function t(e,r){var i=Math.min(r.width/e.shape[0],r.height/e.shape[1]);if(i>=1){return e}var n=Math.ceil(e.shape[0]*i);var s=Math.ceil(e.shape[1]*i);var o,a,u,l,f,h,c,d,p,g,y,m,b,v=e.shape[2]===4;var w=x(new Uint8Array(n*s*e.shape[2]),[n,s,e.shape[2]]);for(o=0;oF.unicode.toArray(t).slice(0,c.maxLength))}if(c.default&&typeof c.default==="string"){x.push(F.unicode.toArray(c.default).slice(0,c.maxLength))}else{x.push([])}var t=()=>{_=x.length-1;y=e(y);if(c.y!==undefined){c.x=c.x||1;this.moveTo.eraseLineAfter(c.x,c.y);u(c.x,c.y)}else{this.getCursorLocation((t,e,r)=>{if(t){this.row.eraseLineAfter(this.height)("\n> ");e=3;r=this.height}u(e,r)})}};var u=(t,e)=>{b.x=v.x=w.x=t;b.y=v.y=w.y=e;if(x[_].length){A();E()}this.on("key",P);n.emit("ready")};var k=(t,e)=>{if(s){return}s=true;p=true;this.removeListener("key",P);if(t==="abort"){return}this.styleReset();if(t){if(i){i(t)}else{n.promise.reject(t)}return}var r;if(typeof e==="string"){r=e}else if(e){r=e.join("")}if(i){i(undefined,r)}else{n.promise.resolve(r)}};var A=()=>{var t,e=F.unicode.arrayWidth(x[_]),r=F.unicode.arrayWidth(a);v=f(e);o=f(e+r);if(o.y>this.height){t=o.y-this.height;S.style.noFormat("\n".repeat(t));b.y-=t;v.y-=t;o.y-=t}l()};var l=()=>{w=f(F.unicode.arrayWidth(x[_],y))};var f=t=>{return{x:1+(b.x+t-1)%this.width,y:b.y+Math.floor((b.x+t-1)/this.width)}};var e=t=>{if(typeof t!=="number"||isNaN(t)){return x[_].length}if(t<0){t=x[_].length+1+t}if(t<0){t=0}else if(t>=x[_].length){t=x[_].length}return t};var E=(t,e)=>{var r,i;t=t||0;if(!S.autoCompleteHint&&e){this.moveTo(v.x,v.y);S.style.noFormat.eraseLineAfter("")}this.moveTo(b.x,b.y);if(c.tokenHook){M(x[_].join(""))}else if(c.echoChar){S.style.noFormat(c.echoChar.repeat(x[_].length))}else{S.style.noFormat(x[_].join(""))}i=R();if(t>0){for(r=1;r<=t;r++){this.moveTo(1,v.y+r);S.style.noFormat.eraseLineAfter("")}}if(!i&&(w.y{if(!n.hasState("ready")){n.once("ready",r);return}this.moveTo(w.x,w.y)};var h=()=>{if(g){return}g=true};var B=()=>{if(!g){return}g=false;if(n.hasState("ready")){E()}};var R=()=>{if(!S.autoCompleteHint){return false}var t=v.y;this.moveTo(v.x,v.y);S.style.noFormat.eraseLineAfter("");while(t{g=true;this.singleLineMenu(r,S.autoCompleteMenu,(t,e)=>{g=false;if(t){return}if(e.selectedText){if(r.prefix){e.selectedText=r.prefix+e.selectedText}if(r.postfix){e.selectedText+=r.postfix}e.selectedText=F.unicode.toArray(e.selectedText).slice(0,c.maxLength);x[_]=e.selectedText.concat(x[_].slice(y,c.maxLength+y-e.selectedText.length));y=e.selectedText.length}if(m){this.column.eraseLineAfter(1);if(v.y>=this.height&&b.y>1){b.y--}A();E();this.moveTo(w.x,w.y)}if(e.unexpectedKey&&e.unexpectedKey!=="TAB"){P(e.unexpectedKey,undefined,e.unexpectedKeyData)}}).on("highlight",t=>n.emit("highlight",t))};var M=t=>{var e,r,i=0,n=[],s,o;S.style=c.style||this;S.hintStyle=c.hintStyle||this.brightBlack;S.tokenRegExp=c.tokenRegExp||N;S.autoComplete=c.autoComplete;S.autoCompleteMenu=c.autoCompleteMenu;S.autoCompleteHint=!!c.autoCompleteHint;S.tokenRegExp.lastIndex=0;if(c.tokenResetHook){c.tokenResetHook(this,S)}while((e=S.tokenRegExp.exec(t))!==null){r=S.tokenRegExp.lastIndex;if(e.index>i){S.style.noFormat(t.slice(i,e.index))}o=e.index+e[0].length===t.length;s=c.tokenHook(e[0],o,n,this,S);if(typeof s==="function"){s.noFormat(e[0])}else if(typeof s==="string"){this.noFormat(s)}else{S.style.noFormat(e[0])}n.push(e[0]);i=e.index+e[0].length;S.tokenRegExp.lastIndex=r}if(i{if(!S.autoComplete||!S.autoCompleteHint||y{if(Array.isArray(r)){return}a=F.unicode.toArray(r.slice(t.length)).slice(0,c.maxLength-x[_].length);A();this.moveTo(v.x,v.y);S.hintStyle.noFormat(a.join(""));this.moveTo(w.x,w.y)};if(Array.isArray(S.autoComplete)){r=W(S.autoComplete,t,S.autoCompleteMenu)}else if(typeof S.autoComplete==="function"){if(S.autoComplete.length===2){S.autoComplete(t,(t,e)=>{if(t){k(t);return}r=e;i()});return}r=S.autoComplete(t);if(D.isThenable(r)){r.then(t=>{r=t;i()},t=>{k(t)});return}}i()};var P=(t,e,r)=>{if(p||g){return}var i,n,s,o,a,u,l,f=y;if(T){T=false;l="ALT_"+t.toUpperCase();if(r){r.isCharacter=false}if(d[l]){t=l}}if(r&&r.isCharacter){if(x[_].length>=c.maxLength){return}x[_].splice(y,0,t);y++;if(m){if(y===x[_].length&&!C){S.style.noFormat(c.echoChar||t);A()}else{A();E();if(S.autoCompleteHint){I()}}}}else{switch(d[t]){case"submit":if(x[_].length0){a=x[_][y-1];x[_].splice(y-1,1);y--;if(m){if(w.y0){x[_].splice(0,y);y=0;if(m){A();E(undefined,true)}}break;case"deleteAllAfter":if(x[_].length&&y0){if(S.autoCompleteHint&&y===x[_].length){R()}y--;if(m){A();this.moveTo(w.x,w.y)}}break;case"forward":if(x[_].length&&y0){if(S.autoCompleteHint&&y===x[_].length){R()}u=y--;while(y>0&&x[_][y]===" "){y--}while(y>0&&x[_][y-1]!==" "){y--}x[_].splice(y,u-y);if(m){A();this.moveTo(w.x,w.y);E(undefined,true)}}break;case"deleteNextWord":if(x[_].length&&y0){if(S.autoCompleteHint&&y===x[_].length){R()}y--;while(y>0&&x[_][y]===" "){y--}while(y>0&&x[_][y-1]!==" "){y--}if(m){A();this.moveTo(w.x,w.y)}}break;case"nextWord":if(x[_].length&&y0){_--;y=x[_].length;if(m){o=v.y-b.y;A();o-=v.y-b.y;E(o,true);this.moveTo(w.x,w.y)}}break;case"autoCompleteUsingHistory":case"autoComplete":n=d[t]==="autoCompleteUsingHistory"?c.history:S.autoComplete;if(!n){break}i=x[_].slice(0,y);var h=()=>{if(Array.isArray(s)){if(S.autoCompleteMenu){O(s)}return}i=F.unicode.toArray(s).slice(0,c.maxLength);x[_]=i.concat(x[_].slice(y,c.maxLength+y-i.length));y=i.length;if(m){A();E()}};if(Array.isArray(n)){s=W(n,i.join(""),S.autoCompleteMenu)}else if(typeof n==="function"){if(n.length===2){n(i.join(""),(t,e)=>{if(t){k(t);return}s=e;h()});return}s=n(i.join(""));if(D.isThenable(s)){s.then(t=>{s=t;h()},t=>{k(t)});return}}h();break}}};n=Object.create(L.prototype);n.defineStates("ready");Object.defineProperty(n,"ready",{get:function(){return this.hasState("ready")}});n.widgetType="inputField";n.abort=()=>{if(p){return}k("abort")};n.stop=()=>{if(p){return}k(undefined,x[_])};n.pause=h;n.resume=B;n.focus=t=>{if(t){B()}else{h()}};n.getInput=()=>x[_].join("");n.value=n.getInput;n.getPosition=()=>({x:b.x,y:b.y});n.hide=()=>{if(!n.hasState("ready")){n.once("ready",n.hide);return}var t,e;for(t=b.x,e=b.y;e<=v.y;t=1,e++){this.moveTo.eraseLineAfter(t,e)}m=false};n.show=()=>{if(!n.hasState("ready")){n.once("ready",n.show);return}m=true;E()};n.redraw=()=>{if(!n.hasState("ready")){n.once("ready",n.redraw);return}E(undefined,true)};n.redrawCursor=()=>{if(!n.hasState("ready")){n.once("ready",n.redrawCursor);return}r()};n.getCursorPosition=()=>y;n.setCursorPosition=t=>{t=e(t);if(t!==y){if(S.autoCompleteHint&&y===x[_].length){R()}y=t;if(m){A();this.moveTo(w.x,w.y)}if(S.autoCompleteHint&&y===x[_].length){I()}}};n.rebase=(t,e)=>{if(!n.hasState("ready")){n.once("ready",n.rebase);return}var i=(t,e)=>{b.x=t;b.y=e;if(c.echo){m=true;A();E()}n.emit("rebased")};if(t!==undefined&&e!==undefined){i(t,e);return}m=false;this.getCursorLocation((t,e,r)=>{if(t){return}i(e,r)})};n.promise=new D;t();return n}},{"./autoComplete.js":7,"nextgen-events":77,seventh:113,"string-kit":127}],47:[function(t,e,r){"use strict";const s=t("string-kit");const i={black:0,red:1,green:2,yellow:3,blue:4,magenta:5,violet:5,cyan:6,white:7,grey:8,gray:8,brightblack:8,brightred:9,brightgreen:10,brightyellow:11,brightblue:12,brightmagenta:13,brightviolet:13,brightcyan:14,brightwhite:15};r.colorNameToIndex=t=>i[t.toLowerCase()];const n=["black","red","green","yellow","blue","magenta","cyan","white","gray","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"];r.indexToColorName=t=>n[t];r.hexToRgba=t=>{if(t[0]==="#"){t=t.slice(1)}if(t.length===3){t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]}return{r:parseInt(t.slice(0,2),16)||0,g:parseInt(t.slice(2,4),16)||0,b:parseInt(t.slice(4,6),16)||0,a:t.length>6?parseInt(t.slice(6,8),16)||0:255}};r.color2index=r.colorNameToIndex;r.index2color=r.indexToColorName;r.hexToColor=r.hexToRgba;r.stripControlChars=(t,e)=>{if(e){return t.replace(/[\x00-\x09\x0b-\x1f\x7f]/g,"")}return t.replace(/[\x00-\x1f\x7f]/g,"")};const o=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g;const a=/([\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><])|([^\u001b\u009b]+)/g;r.stripEscapeSequences=t=>t.replace(o,"");r.ansiWidth=r.stringWidth=t=>{var e,r=0;a.lastIndex=0;while(e=a.exec(t)){if(e[2]){r+=s.unicode.width(e[2])}}return r};var u=0;r.getLastTruncateWidth=()=>u;r.truncateAnsiString=r.truncateString=(t,e)=>{var r,i=0;u=0;a.lastIndex=0;while(r=a.exec(t)){if(r[2]){i+=s.unicode.width(r[2]);if(i>=e){if(i===e){return t.slice(0,r.index+r[2].length)}return t.slice(0,r.index)+s.unicode.truncateWidth(r[2],e-u)}u=i}}return t};r.markupWidth=t=>{return s.unicode.width(t.replace(/\^\[[^\]]*]?|\^(.)/g,(t,e)=>{if(e===" "||e==="^"){return e}return""}))};r.truncateMarkupString=(t,e)=>{var r=0,i,n=s.unicode.toArray(t);u=0;while(re){n.length=r;return n.join("")}u+=i;r++}return t};r.escapeSequenceSkipFn=(t,e)=>{var r;if(t[e]!==""){return e}e++;if(t[e]!=="["){return e}e++;for(;e=65&&r<=90||r>=97&&r<=122){e++;break}}return e};r.wordWrapAnsi=(t,e)=>s.wordwrap(t,{width:e,noJoin:true,fill:true,regroupFn:t=>{var r="",i=false,n=[];t.forEach(t=>{var e;if(i){r+=t;e=t.charCodeAt(0);if(e>=65&&e<=90||e>=97&&e<=122){n.push(r);r="";i=false}}else if(r){r+=t;if(t==="["){i=true}else{n.push(r);r=""}}else if(t===""){r=t}else{n.push(t)}});return n},charWidthFn:t=>{if(t[0]===""){return 0}return s.unicode.charWidth(t)}});r.wordwrapMarkup=r.wordWrapMarkup=(t,e)=>s.wordwrap(t,{width:e,noJoin:true,fill:true,regroupFn:t=>{var e="",r=false,i=[];t.forEach(t=>{if(r){e+=t;if(t==="]"){i.push(e);e="";r=false}}else if(e){e+=t;if(t==="["){r=true}else{i.push(e);e=""}}else if(t==="^"){e=t}else{i.push(t)}});return i},charWidthFn:t=>{if(t[0]==="^"&&t[1]){if(t[1]==="^"||t[1]===" "){return 1}return 0}return s.unicode.charWidth(t)}});r.preserveMarkupFormat=s.createFormatter({argumentSanitizer:t=>t.replace(/[\x00-\x1f\x7f^]/g,t=>t==="^"?"^^":""),noMarkup:true});const l={defaultColor:["color","default"],black:["color","black"],red:["color","red"],green:["color","green"],yellow:["color","yellow"],blue:["color","blue"],magenta:["color","magenta"],cyan:["color","cyan"],white:["color","white"],grey:["color","grey"],gray:["color","gray"],brightBlack:["color","brightBlack"],brightRed:["color","brightRed"],brightGreen:["color","brightGreen"],brightYellow:["color","brightYellow"],brightBlue:["color","brightBlue"],brightMagenta:["color","brightMagenta"],brightCyan:["color","brightCyan"],brightWhite:["color","brightWhite"],defaultBgColor:["bgColor","default"],bgBlack:["bgColor","black"],bgRed:["bgColor","red"],bgGreen:["bgColor","green"],bgYellow:["bgColor","yellow"],bgBlue:["bgColor","blue"],bgMagenta:["bgColor","magenta"],bgCyan:["bgColor","cyan"],bgWhite:["bgColor","white"],bgGrey:["bgColor","grey"],bgGray:["bgColor","gray"],bgBrightBlack:["bgColor","brightBlack"],bgBrightRed:["bgColor","brightRed"],bgBrightGreen:["bgColor","brightGreen"],bgBrightYellow:["bgColor","brightYellow"],bgBrightBlue:["bgColor","brightBlue"],bgBrightMagenta:["bgColor","brightMagenta"],bgBrightCyan:["bgColor","brightCyan"],bgBrightWhite:["bgColor","brightWhite"],dim:["dim",true],bold:["bold",true],underline:["underline",true],italic:["italic",true],inverse:["inverse",true]};r.markupCatchAllKeywords=l;r.markupOptions={parse:true,shiftMarkup:{"#":"background"},markup:{":":null," ":t=>{t.length=0;return[null," "]},";":t=>{t.length=0;return[null,{specialReset:true}]},"-":{dim:true},"+":{bold:true},_:{underline:true},"/":{italic:true},"!":{inverse:true},k:{color:0},r:{color:1},g:{color:2},y:{color:3},b:{color:4},m:{color:5},c:{color:6},w:{color:7},K:{color:8},R:{color:9},G:{color:10},Y:{color:11},B:{color:12},M:{color:13},C:{color:14},W:{color:15}},shiftedMarkup:{background:{":":[null,{defaultColor:true,bgDefaultColor:true}]," ":t=>{t.length=0;return[null,{defaultColor:true,bgDefaultColor:true}," "]},";":t=>{t.length=0;return[null,{specialReset:true,defaultColor:true,bgDefaultColor:true}]},k:{bgColor:0},r:{bgColor:1},g:{bgColor:2},y:{bgColor:3},b:{bgColor:4},m:{bgColor:5},c:{bgColor:6},w:{bgColor:7},K:{bgColor:8},R:{bgColor:9},G:{bgColor:10},Y:{bgColor:11},B:{bgColor:12},M:{bgColor:13},C:{bgColor:14},W:{bgColor:15}}},dataMarkup:{color:"color",fgColor:"color",fg:"color",c:"color",bgColor:"bgColor",bg:"bgColor"},markupCatchAll:(t,e,r)=>{var i={};if(r===undefined){if(e[0]==="#"){i.color=e}else if(l[e]){i[l[e][0]]=l[e][1]}else{i.color=e}}t.push(i);return i||{}}};const f={" ":"SPACE","!":"EXCLAMATION",'"':"DOUBLE_QUOTE","#":"HASH",$:"DOLLAR","%":"PERCENT","&":"AMPERSAND","'":"SINGLE_QUOTE","(":"OPEN_PARENTHESIS",")":"CLOSE_PARENTHESIS","*":"ASTERISK","+":"PLUS",",":"COMMA","-":"HYPHEN",".":"DOT","/":"SLASH",":":"COLON",";":"SEMICOLON","<":"LESS_THAN","=":"EQUAL",">":"GREATER_THAN","?":"QUESTION","@":"AT","[":"OPEN_BRACKET","\\":"BACKSLASH","]":"CLOSE_BRACKET","^":"CARET",_:"UNDERSCORE","`":"BACK_QUOTE","{":"OPEN_BRACE","|":"PIPE","}":"CLOSE_BRACE","~":"TILDE"};r.characterName=t=>{if(f[t]){return f[t]}return t.toUpperCase()}},{"string-kit":127}],48:[function(t,e,r){"use strict";const i=t("seventh");i.promisifyNodeApi(t("child_process"))},{child_process:141,seventh:113}],49:[function(t,e,r){"use strict";e.exports=function t(c){if(!c||typeof c!=="object"){c={}}var e={},d,p=false,g=false,y,r=0,m=[],b,v,w,x,_,C,n,i,T,S=0,k=0,s=0,l=0,f,A,h,E,B,R,O;B=h=(new Date).getTime();T=["|","/","-","\\"];c.syncMode=!!c.syncMode;x=c.width||this.width-1;if(!c.barBracketStyle){if(c.barStyle){c.barBracketStyle=c.barStyle}else{c.barBracketStyle=this.blue}}if(!c.barStyle){c.barStyle=this.cyan}if(!c.percentStyle){c.percentStyle=this.yellow}if(!c.etaStyle){c.etaStyle=this.bold}if(!c.itemStyle){c.itemStyle=this.dim}if(!c.titleStyle){c.titleStyle=this.bold}if(!c.barChar){c.barChar="="}else{c.barChar=c.barChar[0]}if(!c.barHeadChar){c.barHeadChar=">"}else{c.barHeadChar=c.barHeadChar[0]}if(typeof c.maxRefreshTime!=="number"){c.maxRefreshTime=500}if(typeof c.minRefreshTime!=="number"){c.minRefreshTime=100}if(typeof c.items==="number"){y=c.items}if(y&&typeof c.itemSize!=="number"){c.itemSize=Math.round(x/3)}b=" ".repeat(c.itemSize);if(c.title&&typeof c.title==="string"){v=c.title;if(typeof c.titleSize!=="number"){c.titleSize=Math.round(Math.min(c.title.length+1,x/3))}}w=" ".repeat(c.titleSize);O=" ";var M=t=>{var e="",r,i,n,s,o,a,u;if(d>=1){e=" done"}else if(d>0){r=(new Date).getTime()-h;i=(new Date).getTime()-B;if(!t&&l>1){a=(new Date).getTime()-f;s=i/l;o=d/l;if(a.99){u=.99}}else{u=d}n=i*((1-u)/u)/1e3;e=" in ";if(n<10){e+=Math.round(n*10)/10+"s"}else if(n<120){e+=Math.round(n)+"s"}else if(n<7200){e+=Math.round(n/60)+"min"}else if(n<172800){e+=Math.round(n/3600)+"hours"}else if(n<31536e3){e+=Math.round(n/86400)+"days"}else{e="few years"}}else{B=(new Date).getTime()}e=(e+O).slice(0,O.length);R=e;return e};var I=t=>{var e,r,i=b,n=w,s,o,a,u="",l="",f="",h="";if(!p||g){return}e=(new Date).getTime();if((!d||d<1)&&A&&eb.length){i=i.slice(0,b.length-1)+"…"}else if(i.length=w.length){n=n.slice(0,w.length-2)+"… "}else{n=(n+w).slice(0,w.length)}}o=d===undefined?1:Math.round(s*Math.max(Math.min(d,1),0));a=s-o;if(o){if(d===undefined){u=T[++S%T.length]}else{u+=c.barChar.repeat(o-1);u+=c.barHeadChar}}l+=" ".repeat(a);c.titleStyle(n);if(f){c.percentStyle(f)}if(d===undefined){this(" ")}else{c.barBracketStyle("[")}c.barStyle(u);this(l);if(d===undefined){this(" ")}else{c.barBracketStyle("]")}c.etaStyle(h);c.itemStyle(i);this.restoreCursor();if(!c.syncMode){if(E){clearTimeout(E)}if(!d||d<1){E=setTimeout(I,c.maxRefreshTime)}}A=e};if(c.syncMode||c.inline||c.y){i=x;if(c.y){C=+c.x||1;_=+c.y||1}else{C=1;_=null}n=Math.min(C+x,this.width);x=n-C;if(x!==i){if(c.titleSize){c.titleSize=Math.floor(c.titleSize*x/i)}if(c.itemSize){c.itemSize=Math.floor(c.itemSize*x/i)}}p=true;I()}else{this.getCursorLocation((t,e,r)=>{if(t){this.row.eraseLineAfter(this.height)("\n");e=1;r=this.height}var i=x;C=e;n=Math.min(e+x,this.width);_=r;x=n-C;if(x!==i){if(c.titleSize){c.titleSize=Math.floor(c.titleSize*x/i)}if(c.itemSize){c.itemSize=Math.floor(c.itemSize*x/i)}}p=true;I()})}e.startItem=t=>{m.push(t);if(m.length===1){if(d>=1){I();return}if(c.syncMode){I()}else{if(E){clearTimeout(E)}E=setTimeout(I,0)}}};e.itemDone=t=>{var e;r++;if(y){d=r/y}else{d=undefined}f=(new Date).getTime();s++;l++;e=m.indexOf(t);if(e>=0){m.splice(e,1)}if(d>=1){I(true);return}if(c.syncMode){I()}else{if(E){clearTimeout(E)}E=setTimeout(I.bind(this,true),0)}};e.update=t=>{if(!t){t={}}else if(typeof t==="number"){t={progress:t}}if("progress"in t){if(typeof t.progress!=="number"){d=undefined}else{d=t.progress;if(d>1){d=1}else if(d<0){d=0}if(d>0){l++}f=(new Date).getTime();s++}}if(typeof t.items==="number"){y=t.items;if(y){d=r/y}if(typeof c.itemSize!=="number"){c.itemSize=Math.round(x/3);b=" ".repeat(c.itemSize)}}if(typeof t.title==="string"){v=t.title;if(typeof c.titleSize!=="number"){c.titleSize=Math.round(x/3);w=" ".repeat(c.titleSize)}}if(d>=1){I(true);return}if(c.syncMode){I()}else{if(E){clearTimeout(E)}E=setTimeout(I.bind(this,true),0)}};e.pause=e.stop=()=>{g=true};e.resume=()=>{if(g){g=false;I()}};e.reset=()=>{B=h=(new Date).getTime();r=0;d=undefined;m.length=0;S=k=s=l=0;I()};return e}},{}],50:[function(t,e,r){"use strict";const D=t("./termkit");const F=D.stringWidth;const W=t("string-kit");const H=t("nextgen-events");const N=t("seventh");const U={ENTER:"submit",KP_ENTER:"submit",UP:"previous",DOWN:"next",TAB:"cycleNext",SHIFT_TAB:"cyclePrevious",HOME:"first",END:"last",BACKSPACE:"cancel",DELETE:"cancel",ESCAPE:"escape"};e.exports=function j(t,s,n){if(arguments.length<1){throw new Error("[terminal] singleColumnMenu() needs at least an array of menuItems")}if(!Array.isArray(t)||!t.length){throw new TypeError("[terminal] singleColumnMenu(): argument #0 should be a non-empty array")}if(typeof s==="function"){n=s;s={}}else if(!s||typeof s!=="object"){s={}}if(!s.style){s.style=this}if(!s.selectedStyle){s.selectedStyle=this.inverse}if(!s.submittedStyle){s.submittedStyle=this.bgGray.bold}if(!s.disabledStyle){s.disabledStyle=this.dim}if(!s.disabledSelectedStyle){s.disabledSelectedStyle=this.bgGray.dim}if(!s.disabledSubmittedStyle){s.disabledSubmittedStyle=this.bgGray}if(s.leftPadding===undefined){s.leftPadding=" "}if(s.selectedLeftPadding===undefined){s.selectedLeftPadding=s.leftPadding}if(s.submittedLeftPadding===undefined){s.submittedLeftPadding=s.leftPadding}if(typeof s.extraLines!=="number"||s.extraLines<0){s.extraLines=1}if(!s.itemMaxWidth){s.itemMaxWidth=this.width-1}if(!s.unsubmittableIndexes){s.unsubmittableIndexes=[]}var o=s.selectedIndex||0;var a=s.submitted?s.selectedIndex:null;var u=!!s.paused;var l=s.keyBindings||U;if(!this.grabbing){this.grabInput()}var f={},h={},i,c,d,p,g=0,r=0,y=0,m,b=false,v=false;var e=()=>{L(t);if(s.y!==undefined){this.moveTo(1,s.y);w(1,s.y)}else{this("\n");this.getCursorLocation((t,e,r)=>{if(t){this.row.eraseLineAfter(this.height)("\n");e=1;r=this.height}w(e,r)})}};var L=t=>{i=0;d=Math.max(F(s.leftPadding),F(s.selectedLeftPadding));t=t.map(t=>{if(typeof t!=="string"){t=""+t}i=Math.max(i,F(t));return t});if(!s.oneLineItem&&i>s.itemMaxWidth-d){c=Math.min(i+d,this.width);p=t.map((t,e)=>{var r,i,n=s.itemMaxWidth-d;i=W.wordwrap(t,{width:n,noJoin:true,fill:true,skipFn:D.escapeSequenceSkipFn});r={offsetY:g,index:e,text:t,displayText:i};g+=i.length;return r});r=g}else{i=Math.min(i,s.itemMaxWidth-d);c=Math.min(i+d,this.width);p=t.map((t,e)=>{var r=F(t);return{offsetY:e,index:e,text:t,displayText:[r>i?t.slice(0,i-1)+"…":t+" ".repeat(i-r)]}});r=p.length}};var w=(t,e)=>{if(b){return}_(t,e);S();this.on("key",I);if(this.mouseGrabbing){this.on("mouse",P)}m.emit("ready");x()};var x=()=>{var t=p[o];m.emit("highlight",{highlightedIndex:t.index,highlightedText:t.text,submitted:a!==null,x:1,y:f.y+t.offsetY})};var _=(t,e)=>{f.x=t;f.y=e;h.x=1;h.y=e+r;y=f.y+r-(s.scrollRegionBottom||this.height)-1+s.extraLines;if(y>0){this("\n".repeat(y));f.y-=y;h.y-=y}};var C=(t,e,r)=>{if(v){return}v=true;b=true;this.removeListener("key",I);this.removeListener("mouse",P);if(t==="abort"){return}if(m.hasState("ready")){if(r){T()}else{this.moveTo(1,h.y)}}if(t){if(n){n(t)}else{m.promise.reject(t)}return}var i=e!==undefined?e:{selectedIndex:o,selectedText:p[o].text,submitted:a!==null,x:1,y:f.y+p[o].offsetY};if(n){n(undefined,i)}else{m.promise.resolve(i)}};var T=()=>{if(!m.hasState("ready")){m.once("ready",T);return}var t,e;for(t=f.x,e=f.y;e<=h.y;t=1,e++){this.moveTo.eraseLineAfter(t,e)}this.moveTo(1,f.y)};var S=()=>{for(var t=0;t{var i=p[r];i.displayText.forEach((t,e)=>{this.moveTo(1,f.y+i.offsetY+e);if(u||s.unsubmittableIndexes[r]){if(r===a){if(e){s.disabledSubmittedStyle.forceStyleOnReset.noFormat(s.leftPadding)}else{s.disabledSubmittedStyle.forceStyleOnReset.noFormat(s.submittedLeftPadding)}s.disabledSubmittedStyle.forceStyleOnReset.noFormat(t)}else if(r===o){if(e){s.disabledSelectedStyle.forceStyleOnReset.noFormat(s.leftPadding)}else{s.disabledSelectedStyle.forceStyleOnReset.noFormat(s.selectedLeftPadding)}s.disabledSelectedStyle.forceStyleOnReset.noFormat(t)}else{s.disabledStyle.forceStyleOnReset.noFormat(s.leftPadding);s.disabledStyle.forceStyleOnReset.noFormat(t)}}else if(r===a){if(e){s.submittedStyle.forceStyleOnReset.noFormat(s.leftPadding)}else{s.submittedStyle.forceStyleOnReset.noFormat(s.submittedLeftPadding)}s.submittedStyle.forceStyleOnReset.noFormat(t)}else if(r===o){if(e){s.selectedStyle.forceStyleOnReset.noFormat(s.leftPadding)}else{s.selectedStyle.forceStyleOnReset.noFormat(s.selectedLeftPadding)}s.selectedStyle.forceStyleOnReset.noFormat(t)}else{s.style.forceStyleOnReset.noFormat(s.leftPadding);s.style.forceStyleOnReset.noFormat(t)}})};var A=()=>{this.moveTo(1,f.y+p[o].offsetY)};var E=t=>{var e=o;if(o!==t&&t>=0&&t{if(a!==null||s.unsubmittableIndexes[o]){return}a=o;if(m.hasState("ready")){k(a);A()}m.emit("submit",{selectedIndex:a,selectedText:p[a].text,submitted:true,x:1,y:f.y+p[a].offsetY});if(!s.continueOnSubmit){C()}};var R=()=>{var t=a;if(a===null){return}a=null;k(t);A();m.emit("cancel")};var O=()=>{if(u){return}u=true;if(m.hasState("ready")){S()}};var M=()=>{if(!u){return}u=false;if(m.hasState("ready")){S()}};var I=(t,e,r)=>{if(b||u){return}var i=o;switch(l[t]){case"submit":B();break;case"previous":if(a!==null){return}if(o>0){o--;k(o);k(o+1);A();x()}break;case"next":if(a!==null){return}if(o=p.length){o=0}k(i);k(o);A();x();break;case"first":if(a!==null){return}if(o!==0){o=0;k(i);k(o);A();x()}break;case"last":if(a!==null){return}if(o!==p.length-1){o=p.length-1;k(i);k(o);A();x()}break;case"cancel":R();break;case"escape":if(s.cancelable){C(undefined,{canceled:true})}if(s.exitOnUnexpectedKey){C(undefined,{unexpectedKey:t,unexpectedKeyData:r})}break;default:if(s.exitOnUnexpectedKey){C(undefined,{unexpectedKey:t,unexpectedKeyData:r})}break}};var P=(t,e)=>{if(b||u||a!==null){return}if(e.y=h.y){return}var r,i,n,s=false;for(r=0;r=i&&e.y<=n&&e.x<1+c){s=true;E(r);break}}if(s&&t==="MOUSE_LEFT_BUTTON_PRESSED"){B()}};m=Object.create(H.prototype);m.defineStates("ready");m.abort=()=>{if(b){return}C("abort")};m.stop=t=>{if(b){return}C(undefined,undefined,t)};m.select=E;m.submit=B;m.cancel=R;m.erase=T;m.pause=O;m.resume=M;m.focus=t=>{if(t){M()}else{O()}};m.getState=()=>({selectedIndex:o,selectedText:p[o].text,submitted:a!==null,start:f,end:h,x:1,y:f.y+p[o].offsetY});m.getPosition=()=>({x:f.x,y:f.y});m.hide=()=>{if(!m.hasState("ready")){m.once("ready",m.hide);return}T()};m.show=()=>{if(!m.hasState("ready")){m.once("ready",m.show);return}S()};m.redraw=()=>{if(!m.hasState("ready")){m.once("ready",m.redraw);return}S()};m.redrawCursor=()=>{if(!m.hasState("ready")){m.once("ready",m.redrawCursor);return}A()};m.rebase=()=>{if(!m.hasState("ready")){m.once("ready",m.rebase);return}var i=u;u=true;this.getCursorLocation((t,e,r)=>{if(t){return}u=i;_(e,r);S();m.emit("rebased")})};m.promise=new N;e();return m}},{"./termkit":55,"nextgen-events":77,seventh:113,"string-kit":127}],51:[function(t,e,r){"use strict";const C=t("./termkit");const T=C.stringWidth;const S=t("nextgen-events");const k=t("seventh");const A={ENTER:"submit",KP_ENTER:"submit",LEFT:"previous",RIGHT:"next",UP:"previousPage",DOWN:"nextPage",TAB:"cycleNext",SHIFT_TAB:"cyclePrevious",HOME:"first",END:"last",ESCAPE:"escape"};e.exports=function t(e,h,n){if(arguments.length<1){throw new Error("[terminal] singleLineMenu() needs at least an array of menuItems")}if(!Array.isArray(e)||!e.length){throw new TypeError("[terminal] singleLineMenu(): argument #0 should be a non-empty array")}if(typeof h==="function"){n=h;h={}}else if(!h||typeof h!=="object"){h={}}if(h.separator===undefined){h.separator=" "}if(h.nextPageHint===undefined){h.nextPageHint=" » "}if(h.previousPageHint===undefined){h.previousPageHint=" « "}if(!h.style){h.style=this}if(!h.selectedStyle){h.selectedStyle=this.dim.blue.bgGreen}if(!h.y){this("\n")}else{this.moveTo(1,h.y)}var s=h.keyBindings||A;if(!this.grabbing){this.grabInput()}var c=e.map(t=>typeof t==="string"?t:""+t);var d=h.selectedIndex=h.selectedIndex||0;var a={},p=0,u=false,g=[],o=false;var y=T(h.nextPageHint),m=T(h.previousPageHint),b=T(h.separator);var i=()=>{var t,e,r,i=0,n=1,s,o=true,a,u,l,f=this.width-y;g=[[]];for(t=0;t=g.length){g.push([])}e=T(c[t]);s=n+e+b;if(s>f){if(o){e=f-n;r=C.truncateString(c[t],e-1)+"…";if(t===h.selectedIndex){p=i;d=g[i].length}g[i].push({index:t,text:c[t],displayText:r,displayTextWidth:e,x:n})}else{t--}i++;n=1+m;o=true;continue}if(t===h.selectedIndex){p=i;d=g[i].length}g[i].push({index:t,text:c[t],displayText:c[t],displayTextWidth:e,x:n});n=s;o=false}for(i=0;it.x+=l)}}}};var l=(t,e)=>{if(o){return}o=true;u=true;this.removeListener("key",w);this.removeListener("mouse",x);if(t){if(n){n(t)}else{_.promise.reject(t)}return}var r=g[p];var i=e!==undefined?e:{selectedIndex:r[d].index,selectedText:r[d].text,x:r[d].x,y:a.y};if(n){n(undefined,i)}else{_.promise.resolve(i)}};var f=()=>{var t,e,r=g[p],i=r.x;this.moveTo.eraseLineAfter(1,a.y);if(h.fillIn&&i>1){h.style.noFormat(" ".repeat(i-1))}else{this.column(i)}if(p){h.style.forceStyleOnReset.noFormat(h.previousPageHint);i+=m}for(t=0;t{var t=g[p][d];_.emit("highlight",{highlightedIndex:t.index,highlightedText:t.text,x:t.x,y:a.y})};var w=(t,e,r)=>{if(u){return}var i=false,n=g[p];switch(s[t]){case"submit":l();break;case"previous":if(d>0){d--;i=true}else if(p>0){p--;d=g[p].length-1;i=true}break;case"next":if(d0){d--;i=true}else if(p>0){p--;d=g[p].length-1;i=true}break;case"first":if(p!==0||d!==0){p=0;d=0;i=true}break;case"last":if(p!==g.length-1||d!==g[p].length-1){p=g.length-1;d=g[p].length-1;i=true}break;case"previousPage":if(p>0){p--;d=0;i=true}break;case"nextPage":if(p{if(u){return}if(e.y!==a.y){return}var r,i,n,s=false,o=g[p];if(t==="MOUSE_LEFT_BUTTON_PRESSED"){if(p>0&&e.x>=1&&e.x<1+m){p--;d=0;f();v();return}n=o[o.length-1].x+o[o.length-1].displayTextWidth;if(p=n&&e.x=i.x&&e.x{if(t){this.row.eraseLineAfter(this.height)("\n");e=1;r=this.height}a.x=e;a.y=r;i();f();v();this.on("key",w);if(this.mouseGrabbing){this.on("mouse",x)}});return _}},{"./termkit":55,"nextgen-events":77,seventh:113}],52:[function(t,e,r){"use strict";var l=t("seventh");e.exports=function t(e,r,i){if(typeof e!=="string"){throw new TypeError("[terminal] slowTyping(): argument #0 should be a string")}if(typeof r==="function"){i=r;r={}}if(!r||typeof r!=="object"){r={}}if(!r.style){r.style=this.green}if(!r.delay){r.delay=150}if(!r.flashStyle){r.flashStyle=this.bold.brightGreen}if(!r.flashDelay){r.flashDelay=100}var n,s,o=new l;var a=()=>{if(s){clearTimeout(s);s=null;u()}if(n===undefined){n=0}else if(n>=e.length){if(i){i()}else{o.resolve()}return}else{if(r.flashStyle&&e[n].match(/\S/)){r.flashStyle(e[n]);s=setTimeout(u,r.flashDelay)}else{r.style(e[n])}n++}setTimeout(a,(.2+Math.random()*1.8)*r.delay)};var u=()=>{this.left(1);r.style(e[n-1]);s=null};a();return o}},{seventh:113}],53:[function(t,e,r){"use strict";const i="⠀⠁⠂⠃⠄⠅⠆⠇⡀⡁⡂⡃⡄⡅⡆⡇⠈⠉⠊⠋⠌⠍⠎⠏⡈⡉⡊⡋⡌⡍⡎⡏⠐⠑⠒⠓⠔⠕⠖⠗⡐⡑⡒⡓⡔⡕⡖⡗⠘⠙⠚⠛⠜⠝⠞⠟⡘⡙⡚⡛⡜⡝⡞⡟⠠⠡⠢⠣⠤⠥⠦⠧⡠⡡⡢⡣⡤⡥⡦⡧⠨⠩⠪⠫⠬⠭⠮⠯⡨⡩⡪⡫⡬⡭⡮⡯⠰⠱⠲⠳⠴⠵⠶⠷⡰⡱⡲⡳⡴⡵⡶⡷⠸⠹⠺⠻⠼⠽⠾⠿⡸⡹⡺⡻⡼⡽⡾⡿⢀⢁⢂⢃⢄⢅⢆⢇⣀⣁⣂⣃⣄⣅⣆⣇⢈⢉⢊⢋⢌⢍⢎⢏⣈⣉⣊⣋⣌⣍⣎⣏⢐⢑⢒⢓⢔⢕⢖⢗⣐⣑⣒⣓⣔⣕⣖⣗⢘⢙⢚⢛⢜⢝⢞⢟⣘⣙⣚⣛⣜⣝⣞⣟⢠⢡⢢⢣⢤⢥⢦⢧⣠⣡⣢⣣⣤⣥⣦⣧⢨⢩⢪⢫⢬⢭⢮⢯⣨⣩⣪⣫⣬⣭⣮⣯⢰⢱⢲⢳⢴⢵⢶⢷⣰⣱⣲⣳⣴⣵⣶⣷⢸⢹⢺⢻⢼⢽⢾⢿⣸⣹⣺⣻⣼⣽⣾⣿".split("");const n=[" ","▁","▂","▃","▄","▅","▆","▇","█"];const s=[" ","▏","▎","▍","▌","▋","▊","▉","█"];e.exports={password:"●",ellispsis:"…",forwardSingleQuote:"´",overscore:"¯",multiply:"×",divide:"÷",up:"↑",down:"↓",left:"←",right:"→",leftAndRight:"↔",upAndDown:"↕",upLeft:"↖",upRight:"↗",downRight:"↘",downLeft:"↙",upLeftAndDownRight:"⤡",upRightAndDownLeft:"⤢",northWest:"↖",northEast:"↗",southEast:"↘",southWest:"↙",northWestAndSouthEast:"⤡",northEastAndSouthWest:"⤢",fullBlock:"█",upperHalfBlock:"▀",lowerHalfBlock:"▄",growingBlock:n,enlargingBlock:s,bitDots:i,bar:{classic:{border:["[","]"],body:["="," "]},classicWithArrow:{border:["[","]"],body:["=",">"," "]},classicWithHalf:{border:["[","]"],body:["="," ","-","="," "]},solid:{border:["^!▉","▏"],body:["█",...s," "]}},box:{__fix__:t=>({vertical:t.vertical||" ",horizontal:t.horizontal||" ",topLeft:t.topLeft||" ",topRight:t.topRight||" ",bottomLeft:t.bottomLeft||" ",bottomRight:t.bottomRight||" ",topTee:t.topTee||" ",bottomTee:t.bottomTee||" ",leftTee:t.leftTee||" ",rightTee:t.rightTee||" ",cross:t.cross||" "}),plain:{vertical:"█",horizontal:"█",topLeft:"█",topRight:"█",bottomLeft:"█",bottomRight:"█",topTee:"█",bottomTee:"█",leftTee:"█",rightTee:"█",cross:"█"},empty:{vertical:" ",horizontal:" ",topLeft:" ",topRight:" ",bottomLeft:" ",bottomRight:" ",topTee:" ",bottomTee:" ",leftTee:" ",rightTee:" ",cross:" "},ascii:{vertical:"|",horizontal:"-",topLeft:"|",topRight:"|",bottomLeft:"|",bottomRight:"|",topTee:"-",bottomTee:"-",leftTee:"|",rightTee:"|",cross:"+"},light:{vertical:"│",horizontal:"─",topLeft:"┌",topRight:"┐",bottomLeft:"└",bottomRight:"┘",topTee:"┬",bottomTee:"┴",leftTee:"├",rightTee:"┤",cross:"┼"},lightRounded:{vertical:"│",horizontal:"─",topLeft:"╭",topRight:"╮",bottomLeft:"╰",bottomRight:"╯",topTee:"┬",bottomTee:"┴",leftTee:"├",rightTee:"┤",cross:"┼"},heavy:{vertical:"┃",horizontal:"━",topLeft:"┏",topRight:"┓",bottomLeft:"┗",bottomRight:"┛",topTee:"┳",bottomTee:"┻",leftTee:"┣",rightTee:"┫",cross:"╋"},double:{vertical:"║",horizontal:"═",topLeft:"╔",topRight:"╗",bottomLeft:"╚",bottomRight:"╝",topTee:"╦",bottomTee:"╩",leftTee:"╠",rightTee:"╣",cross:"╬"},dotted:{vertical:"┊",horizontal:"┄",topLeft:"┌",topRight:"┐",bottomLeft:"└",bottomRight:"┘",topTee:"┬",bottomTee:"┴",leftTee:"├",rightTee:"┤",cross:"┼"}},animation:{asciiSpinner:["│","/","-","\\"],lineSpinner:["│","/","─","\\"],dotSpinner:[i[7],i[19],i[49],i[112],i[224],i[200],i[140],i[14]],bitDots:i,impulse:["∙∙∙","●∙∙","∙●∙","∙∙●","∙●∙","●∙∙","∙∙∙","∙∙∙"],unboxing:[" ","▁","▂","▃","▄","▅","▆","▇","█","▉","▊","▋","▌","▍","▎","▏"],"unboxing-color":["^r^#^b ","^r^#^b▁","^r^#^b▂","^r^#^b▃","^r^#^b▄","^r^#^b▅","^r^#^b▆","^r^#^b▇","^r^#^m█","^r^#^m▉","^r^#^m▊","^r^#^m▋","^r^#^m▌","^r^#^m▍","^r^#^m▎","^r^#^m▏","^m^#^y█","^m^#^y▇","^m^#^y▆","^m^#^y▅","^m^#^y▄","^m^#^y▃","^m^#^y▂","^m^#^y▁","^b^#^y ","^b^#^y▏","^b^#^y▎","^b^#^y▍","^b^#^y▌","^b^#^y▋","^b^#^y▊","^b^#^y▉"]},blackSquare:"■",whiteSquare:"□",blackCircle:"●",whiteCircle:"○",blackUpTriangle:"▲",whiteUpTriangle:"△",blackDownTriangle:"▼",whiteDownTriangle:"▽",blackLeftTriangle:"◀",whiteLeftTriangle:"◁",blackRightTriangle:"▶",whiteRightTriangle:"▷",blackDiamond:"◆",whiteDiamond:"◇",blackStar:"★",whiteStar:"☆",spadeSuit:"♠",heartSuit:"♥",diamondSuit:"♦",clubSuit:"♣",powerline:{branch:"",line:"",readOnly:"",rightTriangleSeparator:"",rightArrowSeparator:"",leftTriangleSeparator:"",leftArrowSeparator:""}}},{}],54:[function(e,r,t){(function(n){(function(){"use strict";const i={};r.exports=i;const t=e("lazyness")(e);i.globalConfig={};i.tty=e("./tty.js");if(n.env.TERM==="linux"){i.tty.getPath()}Object.assign(i,e("./misc.js"));Object.assign(i,e("./detectTerminal.js"));i.Terminal=e("./Terminal.js");i.createTerminal=i.Terminal.create;if(n.platform==="win32"){e("./windows.js")(i)}i.image=e("./image.js");i.Palette=e("./Palette.js");i.Rect=e("./Rect.js");i.ScreenBuffer=e("./ScreenBuffer.js");i.ScreenBufferHD=e("./ScreenBufferHD.js");i.TextBuffer=e("./TextBuffer.js");i.Vte=e("./vte/Vte.js");i.autoComplete=e("./autoComplete.js");i.spChars=e("./spChars.js");i.Element=e("./document/Element.js");i.Document=e("./document/Document.js");i.Container=e("./document/Container.js");i.Text=e("./document/Text.js");i.AnimatedText=e("./document/AnimatedText.js");i.Button=e("./document/Button.js");i.ToggleButton=e("./document/ToggleButton.js");i.TextBox=e("./document/TextBox.js");i.EditableTextBox=e("./document/EditableTextBox.js");i.Slider=e("./document/Slider.js");i.Bar=e("./document/Bar.js");i.LabeledInput=e("./document/LabeledInput.js");i.InlineInput=e("./document/InlineInput.js");i.InlineFileInput=e("./document/InlineFileInput.js");i.InlineMenu=e("./document/InlineMenu.js");i.Form=e("./document/Form.js");i.RowMenu=e("./document/RowMenu.js");i.ColumnMenu=e("./document/ColumnMenu.js");i.ColumnMenuMulti=e("./document/ColumnMenuMulti.js");i.ColumnMenuMixed=e("./document/ColumnMenuMixed.js");i.SelectList=e("./document/SelectList.js");i.SelectListMulti=e("./document/SelectListMulti.js");i.DropDownMenu=e("./document/DropDownMenu.js");i.TextTable=e("./document/TextTable.js");i.Layout=e("./document/Layout.js");i.Border=e("./document/Border.js");i.Window=e("./document/Window.js");i.chroma=e("chroma-js");t.properties(i,{terminal:()=>{var t=i.guessTerminal();return i.createTerminal({stdin:n.stdin,stdout:n.stdout,stderr:n.stderr,generic:t.generic||"unknown",appId:t.safe?t.appId:undefined,isTTY:t.isTTY,isSSH:t.isSSH,processSigwinch:true,preferProcessSigwinch:!!i.globalConfig.preferProcessSigwinch})},realTerminal:()=>{var t=i.guessTerminal(true);var e=i.tty.getInput();var r=i.tty.getOutput();return i.createTerminal({stdin:e,stdout:r,stderr:n.stderr,generic:t.generic||"unknown",appId:t.safe?t.appId:undefined,isTTY:true,isSSH:t.isSSH,processSigwinch:true,preferProcessSigwinch:!!i.globalConfig.preferProcessSigwinch})}},true)}).call(this)}).call(this,e("_process"))},{"./Palette.js":1,"./Rect.js":2,"./ScreenBuffer.js":3,"./ScreenBufferHD.js":4,"./Terminal.js":5,"./TextBuffer.js":6,"./autoComplete.js":7,"./detectTerminal.js":12,"./document/AnimatedText.js":13,"./document/Bar.js":14,"./document/Border.js":16,"./document/Button.js":17,"./document/ColumnMenu.js":18,"./document/ColumnMenuMixed.js":19,"./document/ColumnMenuMulti.js":20,"./document/Container.js":21,"./document/Document.js":22,"./document/DropDownMenu.js":23,"./document/EditableTextBox.js":24,"./document/Element.js":25,"./document/Form.js":26,"./document/InlineFileInput.js":27,"./document/InlineInput.js":28,"./document/InlineMenu.js":29,"./document/LabeledInput.js":30,"./document/Layout.js":31,"./document/RowMenu.js":32,"./document/SelectList.js":33,"./document/SelectListMulti.js":34,"./document/Slider.js":35,"./document/Text.js":36,"./document/TextBox.js":37,"./document/TextTable.js":38,"./document/ToggleButton.js":39,"./document/Window.js":40,"./image.js":45,"./misc.js":47,"./spChars.js":53,"./tty.js":56,"./vte/Vte.js":58,"./windows.js":61,_process:185,"chroma-js":64,lazyness:73}],55:[function(s,o,t){(function(n,r){(function(){"use strict";const t=s("path");if(n.browser||s.cache[t.join(r,"termkit-no-lazy-require.js")]){console.log("using termkit-no-lazy-require.js");o.exports=s("./termkit-no-lazy-require.js");return}const i={};o.exports=i;const e=s("lazyness")(s);i.globalConfig={};e.requireProperty(i,"tty","./tty.js");if(n.env.TERM==="linux"){i.tty.getPath()}Object.assign(i,s("./misc.js"));Object.assign(i,s("./detectTerminal.js"));i.Terminal=s("./Terminal.js");i.createTerminal=i.Terminal.create;if(n.platform==="win32"){s("./windows.js")(i)}e.requireProperties(i,{image:"./image.js",Palette:"./Palette.js",Rect:"./Rect.js",ScreenBuffer:"./ScreenBuffer.js",ScreenBufferHD:"./ScreenBufferHD.js",TextBuffer:"./TextBuffer.js",Vte:"./vte/Vte.js",autoComplete:"./autoComplete.js",spChars:"./spChars.js",Element:"./document/Element.js",Document:"./document/Document.js",Container:"./document/Container.js",Text:"./document/Text.js",AnimatedText:"./document/AnimatedText.js",Button:"./document/Button.js",ToggleButton:"./document/ToggleButton.js",TextBox:"./document/TextBox.js",EditableTextBox:"./document/EditableTextBox.js",Slider:"./document/Slider.js",Bar:"./document/Bar.js",LabeledInput:"./document/LabeledInput.js",InlineInput:"./document/InlineInput.js",InlineFileInput:"./document/InlineFileInput.js",InlineMenu:"./document/InlineMenu.js",Form:"./document/Form.js",RowMenu:"./document/RowMenu.js",ColumnMenu:"./document/ColumnMenu.js",ColumnMenuMulti:"./document/ColumnMenuMulti.js",ColumnMenuMixed:"./document/ColumnMenuMixed.js",SelectList:"./document/SelectList.js",SelectListMulti:"./document/SelectListMulti.js",DropDownMenu:"./document/DropDownMenu.js",TextTable:"./document/TextTable.js",Layout:"./document/Layout.js",Border:"./document/Border.js",Window:"./document/Window.js",chroma:"chroma-js"});e.properties(i,{terminal:()=>{var t=i.guessTerminal();return i.createTerminal({stdin:n.stdin,stdout:n.stdout,stderr:n.stderr,generic:t.generic||"unknown",appId:t.safe?t.appId:undefined,isTTY:t.isTTY,isSSH:t.isSSH,processSigwinch:true,preferProcessSigwinch:!!i.globalConfig.preferProcessSigwinch})},realTerminal:()=>{var t=i.guessTerminal(true);var e=i.tty.getInput();var r=i.tty.getOutput();return i.createTerminal({stdin:e,stdout:r,stderr:n.stderr,generic:t.generic||"unknown",appId:t.safe?t.appId:undefined,isTTY:true,isSSH:t.isSSH,processSigwinch:true,preferProcessSigwinch:!!i.globalConfig.preferProcessSigwinch})}},true)}).call(this)}).call(this,s("_process"),"/lib")},{"./Terminal.js":5,"./detectTerminal.js":12,"./misc.js":47,"./termkit-no-lazy-require.js":54,"./windows.js":61,_process:185,lazyness:73,path:184}],56:[function(e,r,t){(function(l){(function(){"use strict";var a=e("child_process").execSync;var i=e("fs");var n=e("tty");var t={};r.exports=t;var u;t.getPath=function t(e){var r,i,n,s,o;if(!e){e=0}if(e===0||e===l.stdin){if(u){return u}r=true}try{n=a("tty",{stdio:[e,null,null]}).toString()}catch(t){n=t.stdout.toString()}n=n.trim();o=n.match(/\/dev\/tty([0-9]*)/);s=o?o[1]||null:null;i={path:n,index:s};if(r){u=i}return i};t.getInput=function t(){var e,r;e=i.openSync("/dev/tty","r");if(!n.isatty(e)){throw new Error("Input file descriptor is not a TTY.")}r=new n.ReadStream(e);r._type="tty";return r};t.getOutput=function t(){var e,r;e=i.openSync("/dev/tty","w");if(!n.isatty(e)){throw new Error("Output file descriptor is not a TTY.")}r=new n.WriteStream(e);r._type="tty";if(r._handle&&r._handle.unref){r._handle.unref()}if(r._refreshSize){l.on("SIGWINCH",()=>{r._refreshSize()})}return r}}).call(this)}).call(this,e("_process"))},{_process:185,child_process:141,fs:141,tty:204}],57:[function(r,n,t){(function(k){(function(){"use strict";const g=r("./fromOutputSequence.js");const y=r("string-kit");const t=r("nextgen-events");const i=r("seventh");function e(t={}){}n.exports=e;e.prototype=Object.create(t.prototype);e.prototype.constructor=e;async function m(t,e=1){var r;r=t.read(e);while(r===null){await i.onceEventOrError(t,"readable",["close","end"]);r=t.read(e)}return r}function b(t){return t>=65&&t<=90||t>=97&&t<=122}function v(t){var e=t.toString(16);e=e.length>1?"\\x"+e:"\\x0"+e;return e}function w(t){if(t<=31||t===127){return v(t)}return String.fromCharCode(t)}function x(r,t){if(!t||!t.length){return r}r=Array.from(r);t.forEach((t,e)=>{if(t!==undefined&&r[e]===undefined){r[e]=t}});return r}const _=new Set("(",")","*","+","-",".","/"," ","#","%");const C=new Set("?",">","<");const T=new Set(" ","$","#",'"',"'","*");const S=new Set("?");e.prototype.streamToEvent=async function(t){var e,r,i,n,s,o,a,u,l,f,h,c,d,p=k.alloc(6);for(;;){e=(await m(t))[0];if(e<=31||e===127){r=v(e);if(e===27){e=(await m(t))[0];if(e===91){a="";while(!b(e=(await m(t))[0])){a+=String.fromCharCode(e)}o=String.fromCharCode(e);a=a?a.split(";"):[];l=true;if(a.length&&C.has(a[0][0])){o=a[0][0]+o;a[0]=a[0].slice(1)}if(a.length&&T.has(a[a.length-1][a[a.length-1]-1])){o=a[a.length-1][a[a.length-1]-1]+o;a[a.length-1]=a[a.length-1].slice(0,-1)}h=g.CSI[o];console.error(">>>>>>>>>> CSI parsing:",o,a);if(h){if(h.subTree&&a.length){d=h;for(u=0;u=128){if(e<192){continue}else if(e<224){n=2}else if(e<240){n=3}else if(e<248){n=4}else if(e<252){n=5}else{n=6}p[0]=e;p[1]=p[2]=p[3]=p[4]=p[5]=0;(await m(t,n-1)).copy(p,1);i=p.toString("utf8");s=y.unicode.firstCodePoint(i);this.emit("char",i,s)}else{i=String.fromCharCode(e);this.emit("char",i,e)}}}}).call(this)}).call(this,r("buffer").Buffer)},{"./fromOutputSequence.js":59,buffer:151,"nextgen-events":77,seventh:113,"string-kit":127}],58:[function(s,t,e){"use strict";const r=s("../ScreenBuffer.js");const i=s("../Rect.js");const n=s("string-kit");const o=s("./toInputSequence.js");const a=s("./SequencesReader.js");const u=s("nextgen-events");const l=s("seventh");const f=s("child_process").spawn;const h=(...t)=>console.error("",...t,"");const c=(...t)=>console.error(...t);function d(t={}){this.width=Math.floor(t.width)||(t.dst?t.dst.width:80);this.height=Math.floor(t.height)||(t.dst?t.dst.height:25);this.palette=t.palette||this.dst&&this.dst.palette;this.screenBuffer=new r(Object.assign({},t,this,{wrap:true}));this.screenBuffer.setClearAttr({defaultColor:true,bgDefaultColor:true});this.cx=0;this.cy=0;this.savedCx=0;this.savedCy=0;this.attr=0;this.resetAttr();this.scrollingRegion=null;this.tabWidth=8;this.mouseEvent=null;this.focusEvent=false;this.mouseIsDragging=false;this.eventInput=t.eventInput;this.childSequencesReader=new a;this.childProcess=null;this.onEventInputKey=this.onEventInputKey.bind(this);this.onEventInputMouse=this.onEventInputMouse.bind(this);this.onEventInputTerminal=this.onEventInputTerminal.bind(this);this.onChildOutputReset=this.onChildOutputReset.bind(this);this.onChildOutputChar=this.onChildOutputChar.bind(this);this.onChildOutputCursor=this.onChildOutputCursor.bind(this);this.onChildOutputEdit=this.onChildOutputEdit.bind(this);this.onChildOutputAttr=this.onChildOutputAttr.bind(this);this.onChildOutputPalette=this.onChildOutputPalette.bind(this);this.onChildOutputCursorAttr=this.onChildOutputCursorAttr.bind(this);this.onChildOutputBell=this.onChildOutputBell.bind(this);this.onChildOutputDevice=this.onChildOutputDevice.bind(this);this.onChildOutputSystem=this.onChildOutputSystem.bind(this);this.onChildOutputControl=this.onChildOutputControl.bind(this);this.onChildOutputESC=this.onChildOutputESC.bind(this);this.onChildOutputCSI=this.onChildOutputCSI.bind(this);this.onChildOutputOSC=this.onChildOutputOSC.bind(this);this.drawDebounce=l.debounce(this.drawDelay.bind(this))}t.exports=d;d.prototype=Object.create(u.prototype);d.prototype.constructor=d;d.prototype.run=function(e,r){var t,i,n=new l;if(this.childProcess){return}this.start();try{t=s("child_pty");i=t.spawn(e,r,{columns:this.width,rows:this.height})}catch(t){h("'child_pty' optional dependency not found, using regular child_process.spawn()");i=f(e,r)}this.childProcess=i;this.on("input",t=>i.stdin.write(t));this.childSequencesReader.streamToEvent(i.stdout);i.on("close",t=>{this.childProcess=null;n.resolve()});return n};d.prototype.start=function(){if(this.eventInput){this.eventInput.on("key",this.onEventInputKey);this.eventInput.on("mouse",this.onEventInputMouse);this.eventInput.on("terminal",this.onEventInputTerminal)}this.childSequencesReader.on("reset",this.onChildOutputReset);this.childSequencesReader.on("char",this.onChildOutputChar);this.childSequencesReader.on("cursor",this.onChildOutputCursor);this.childSequencesReader.on("edit",this.onChildOutputEdit);this.childSequencesReader.on("attr",this.onChildOutputAttr);this.childSequencesReader.on("palette",this.onChildOutputPalette);this.childSequencesReader.on("cursorAttr",this.onChildOutputCursorAttr);this.childSequencesReader.on("bell",this.onChildOutputBell);this.childSequencesReader.on("device",this.onChildOutputDevice);this.childSequencesReader.on("system",this.onChildOutputSystem);this.childSequencesReader.on("control",this.onChildOutputControl);this.childSequencesReader.on("ESC",this.onChildOutputESC);this.childSequencesReader.on("CSI",this.onChildOutputCSI);this.childSequencesReader.on("OSC",this.onChildOutputOSC)};d.prototype.draw=function(){var t=this.screenBuffer.draw({delta:true});this.screenBuffer.drawCursor();c("draw stats:",t)};d.prototype.redraw=function(){var t=this.screenBuffer.draw({delta:false});this.screenBuffer.drawCursor();c("redraw stats:",t)};d.prototype.drawDelay=async function(){await l.resolveNextTick();this.draw()};d.prototype.putChar=function(t){var e=t.charCodeAt(0);c("putChar:",e<=31||e===127?"(ctrl)":t,e>=16?"\\x"+e.toString(16):"\\x0"+e.toString(16),"at:",this.cx,this.cy);this.screenBuffer.put({x:this.cx,y:this.cy,attr:this.attr},t);this.cx++;if(this.cx>=this.width){this.newLine()}else{this.drawDebounce()}};d.prototype.moveCursorTo=function(t,e,r=false){if(r){if(t!==undefined){this.cx=t}if(e!==undefined){this.cy=e}}else{if(t!==undefined){this.cx=t-1}if(e!==undefined){this.cy=e-1}}if(this.cx<0){this.cx=0}else if(this.cx>=this.width-1){this.cx=this.width-1}if(this.cy<0){this.cy=0}else if(this.cy>=this.height-1){this.cy=this.height-1}this.screenBuffer.cx=this.cx;this.screenBuffer.cy=this.cy;this.screenBuffer.drawCursor()};d.prototype.moveCursor=function(t,e){this.moveCursorTo(this.cx+t,this.cy+e,true)};d.prototype.nextTab=function(){this.moveCursorTo(Math.ceil((this.cx+1)/this.tabWidth)*this.tabWidth,undefined,true)};d.prototype.vScroll=function(t,e){var r=0,i=this.height-1;if(this.scrollingRegion&&this.cy>=this.scrollingRegion.ymin&&this.cy<=this.scrollingRegion.ymax){({ymin:r,ymax:i}=this.scrollingRegion)}c("################### vScroll:",t,r,i);this.screenBuffer.vScroll(t,this.attr,r,i,true);if(!e){this.drawDebounce()}};d.prototype.lineFeed=function(t,e){var r=0,i=this.height-1;if(this.scrollingRegion&&this.cy>=this.scrollingRegion.ymin&&this.cy<=this.scrollingRegion.ymax){({ymin:r,ymax:i}=this.scrollingRegion)}this.screenBuffer.cy=++this.cy;if(t){this.screenBuffer.cx=this.cx=0}if(this.cy>i){this.screenBuffer.cy=this.cy=i;this.vScroll(-1,e);if(!e){this.screenBuffer.drawCursor()}}else if(!e){this.drawDebounce()}};d.prototype.newLine=function(t){return this.lineFeed(true,t)};d.prototype.reverseLineFeed=function(t,e){var r=0,i=this.height-1;if(this.scrollingRegion&&this.cy>=this.scrollingRegion.ymin&&this.cy<=this.scrollingRegion.ymax){({ymin:r,ymax:i}=this.scrollingRegion)}this.screenBuffer.cy=--this.cy;if(t){this.screenBuffer.cx=this.cx=0}if(this.cythis.cx){t=this.cx}if(t<=0){return}this.screenBuffer.copyRegion({xmin:this.cx,ymin:this.cy,xmax:this.width-1,ymax:this.cy},{x:this.cx-t,y:this.cy});this.cx-=t;this.screenBuffer.fill({region:{xmin:this.width-t,ymin:this.cy,xmax:this.width-1,ymax:this.cy},attr:this.attr}," ");this.screenBuffer.cx=this.cx;this.drawDebounce()};d.prototype.delete=function(t=1){if(t>this.width-this.cx){t=this.width-this.cx}if(t<=0){return}if(this.cx+tthis.width-this.cx){t=this.width-this.cx}if(t<=0){return}this.screenBuffer.fill({region:{xmin:this.cx,ymin:this.cy,xmax:this.cx+t-1,ymax:this.cy},attr:this.attr}," ");c("erase:",t,"fill region:",{xmin:this.cx,ymin:this.cy,xmax:this.cx+t-1,ymax:this.cy});this.drawDebounce()};d.prototype.deleteLine=function(t=1){if(t>this.height-this.cy){t=this.height-this.cy}if(t<=0){return}if(this.cy+tthis.height-this.cy){t=this.height-this.cy}if(t<=0){return}if(this.cy+t>> ",e);if(!e){return}this.emit("input",n.format(o.reports.registerColor,t,e.r,e.g,e.b))};d.prototype.emitMouseSGR=function(t,e){var r=0,i=false;if(e.shift){r|=4}if(e.alt){r|=8}if(e.ctrl){r|=16}switch(t){case"MOUSE_LEFT_BUTTON_PRESSED":break;case"MOUSE_MIDDLE_BUTTON_PRESSED":r|=1;break;case"MOUSE_RIGHT_BUTTON_PRESSED":r|=2;break;case"MOUSE_OTHER_BUTTON_PRESSED":r|=3;break;case"MOUSE_LEFT_BUTTON_RELEASED":i=true;break;case"MOUSE_MIDDLE_BUTTON_RELEASED":r|=1;i=true;break;case"MOUSE_RIGHT_BUTTON_RELEASED":r|=2;i=true;break;case"MOUSE_OTHER_BUTTON_RELEASED":r|=3;i=true;break;case"MOUSE_WHEEL_UP":r|=64;break;case"MOUSE_WHEEL_DOWN":r|=65;break;case"MOUSE_MOTION":r|=32;break}this.emit("input","[<"+r+";"+e.x+";"+e.y+(i?"m":"M"))};d.prototype.onEventInputKey=function(t,e,r){c("onEventInputKey:",t);if(r.isCharacter){this.emit("input",t)}else if(o.specialKeys[t]){this.emit("input",o.specialKeys[t])}};d.prototype.onEventInputMouse=function(t,e){if(!this.mouseEvent){return}if(this.eventInput===this.screenBuffer.dst){e.x-=this.screenBuffer.x-1;e.y-=this.screenBuffer.y-1}switch(t){case"MOUSE_LEFT_BUTTON_PRESSED":case"MOUSE_MIDDLE_BUTTON_PRESSED":case"MOUSE_RIGHT_BUTTON_PRESSED":case"MOUSE_OTHER_BUTTON_PRESSED":this.mouseIsDragging=true;this.emitMouseSGR(t,e);break;case"MOUSE_LEFT_BUTTON_RELEASED":case"MOUSE_MIDDLE_BUTTON_RELEASED":case"MOUSE_RIGHT_BUTTON_RELEASED":case"MOUSE_OTHER_BUTTON_RELEASED":this.mouseIsDragging=false;this.emitMouseSGR(t,e);break;case"MOUSE_WHEEL_UP":case"MOUSE_WHEEL_DOWN":this.emitMouseSGR(t,e);break;case"MOUSE_MOTION":if(this.mouseEvent==="motion"||this.mouseEvent==="drag"&&this.mouseIsDragging){this.emitMouseSGR(t,e)}break}};d.prototype.onEventInputTerminal=function(t,e){switch(t){case"FOCUS_IN":if(this.focusEvent){this.emitFocus(true)}break;case"FOCUS_OUT":if(this.focusEvent){this.emitFocus(false)}break}};d.prototype.onChildOutputReset=function(){h("full reset")};d.prototype.onChildOutputChar=function(t,e){this.putChar(t)};d.prototype.onChildOutputCursor=function(t,e,r){c("cursor:",t,e,r);var i=r&&r[0]?+r[0]:undefined;var n=r&&r[1]?+r[1]:undefined;switch(t){case"lineFeed":return this.lineFeed();case"carriageReturn":return this.moveCursorTo(0,undefined,true);case"tab":return this.nextTab();case"move":this.moveCursor(i,n);break;case"up":this.moveCursor(0,-i);break;case"down":this.moveCursor(0,i);break;case"right":this.moveCursor(i,0);break;case"left":this.moveCursor(-i,0);break;case"moveToYX":this.moveCursorTo(n,i);break;case"column":this.moveCursorTo(i);break;case"row":this.moveCursorTo(undefined,i);break;case"previousLine":this.moveCursor(-this.cx,-i);break;case"nextLine":this.moveCursor(-this.cx,i);break;case"save":this.savedCx=this.cx;this.savedCy=this.cy;break;case"restore":this.moveCursorTo(this.savedCx,this.savedCy,true);break;default:h("Unknown/unsupported cursor action",t,e,r)}};d.prototype.onChildOutputEdit=function(t,e,r){var i=r&&r[0]?+r[0]:undefined;var n=r&&r[1]?+r[1]:undefined;switch(t){case"backDelete":c("backDelete",i);return this.backDelete(i);case"delete":c("delete",i);return this.delete(i);case"erase":c("erase",e);this.erase(e);break;case"deleteLine":c("deleteLine",i);this.deleteLine(i);break;case"insertLine":c("insertLine",i);this.insertLine(i);break;case"eraseLine":c("eraseLine",e);this.eraseLine(e);break;case"eraseDisplay":c("eraseDisplay",e);this.eraseDisplay(e);break;case"reverseLineFeed":c("reverseLineFeed");this.reverseLineFeed(e);break;case"vScrollingRegion":c("vScrollingRegion",i,n);this.setVScrollingRegion(i,n);break;case"vScrollUp":c("vScrollUp",i);this.vScroll(-i);break;case"vScrollDown":c("vScrollDown",i);this.vScroll(i);break;default:h("Unknown/unsupported edit action",t,e,r)}};d.prototype.onChildOutputAttr=function(t,e,r){switch(t){case"reset":c("ATTR reset");this.resetAttr();break;case"bold":c("ATTR bold:",e);this.addAttr({bold:e});break;case"dim":c("ATTR dim:",e);this.addAttr({dim:e});break;case"italic":c("ATTR italic:",e);this.addAttr({italic:e});break;case"underline":c("ATTR underline:",e);this.addAttr({underline:e});break;case"blink":c("ATTR blink:",e);this.addAttr({blink:e});break;case"inverse":c("ATTR inverse:",e);this.addAttr({inverse:e});break;case"hidden":c("ATTR hidden:",e);this.addAttr({hidden:e});break;case"strike":c("ATTR strike:",e);this.addAttr({strike:e});break;case"noDimNoBold":c("ATTR noDimNoBold");this.addAttr({bold:false,dim:false});break;case"color":c("ATTR color:",e);this.addAttr({color:e});break;case"color256":c("ATTR color256:",r);this.addAttr({color:+r[0]});break;case"colorRgb":c("ATTR colorRgb:",r,"not supported ATM");break;case"bgColor":c("ATTR bgColor:",e);this.addAttr({bgColor:e});break;case"bgColor256":c("ATTR bgColor256:",r);this.addAttr({bgColor:+r[0]});break;case"bgColorRgb":c("ATTR bgColorRgb:",r,"not supported ATM");break;default:h("Unknown/unsupported ATTR",t,e,r)}};d.prototype.onChildOutputPalette=function(t,e){h("Palette command:",t,e);var r=e&&e[0]?+e[0]:undefined;switch(t){case"getColor":if(!isNaN(r)){this.emitRegisterColor(r)}break}};d.prototype.onChildOutputCursorAttr=function(t,e){h("Cursor ATTR command:",t,e)};d.prototype.onChildOutputBell=function(){h("bell")};d.prototype.onChildOutputDevice=function(t,e,r){h("Device command:",t,e,r);switch(t){case"mouseButton":this.mouseEvent=e?"button":null;break;case"mouseDrag":this.mouseEvent=e?"drag":null;break;case"mouseMotion":this.mouseEvent=e?"motion":null;break;case"focusEvent":this.focusEvent=!!e;break;case"cursorLocation":this.emitCursorLocation(e);break;case"screenSize":this.emitScreenSize(e);break;default:h("Unknown/unsupported device command",t,e,r)}};d.prototype.onChildOutputSystem=function(t,e){h("System command:",t,e)};d.prototype.onChildOutputControl=function(t){h("control",t)};d.prototype.onChildOutputESC=function(t,e){h("ESC -- type:",t,e)};d.prototype.onChildOutputCSI=function(t,e){h("CSI -- type:",t,", args:",e)};d.prototype.onChildOutputOSC=function(t,e){h("OSC -- type:",t,", args:",e)}},{"../Rect.js":2,"../ScreenBuffer.js":3,"./SequencesReader.js":57,"./toInputSequence.js":60,child_process:141,child_pty:141,"nextgen-events":77,seventh:113,"string-kit":127}],59:[function(t,e,r){"use strict";r.control={"\\x07":{event:"bell"},"\\x08":{event:"cursor",subType:"left",extraArgs:[1]},"\\x09":{event:"cursor",subType:"tab"},"\\x0a":{event:"cursor",subType:"lineFeed"},"\\x0d":{event:"cursor",subType:"carriageReturn"},"\\x7f":{event:"none"}};r.ESC={7:{event:"cursor",subType:"save"},8:{event:"cursor",subType:"restore"},c:{event:"reset"},M:{event:"edit",subType:"reverseLineFeed"}};r.CSI={A:{event:"cursor",subType:"up",defaultExtraArgs:[1]},B:{event:"cursor",subType:"down",defaultExtraArgs:[1]},C:{event:"cursor",subType:"right",defaultExtraArgs:[1]},D:{event:"cursor",subType:"left",defaultExtraArgs:[1]},E:{event:"cursor",subType:"nextLine",defaultExtraArgs:[1]},F:{event:"cursor",subType:"previousLine",defaultExtraArgs:[1]},G:{event:"cursor",subType:"column"},H:{event:"cursor",subType:"moveToYX",defaultExtraArgs:[1,1]},J:{event:"edit",subType:"eraseDisplay",arg:"after",subTree:{0:{arg:"after"},1:{arg:"before"},2:{arg:"display"}}},K:{event:"edit",subType:"eraseLine",arg:"after",subTree:{0:{arg:"after"},1:{arg:"before"},2:{arg:"line"}}},L:{event:"edit",subType:"insertLine",defaultExtraArgs:[1]},M:{event:"edit",subType:"deleteLine",defaultExtraArgs:[1]},P:{event:"edit",subType:"delete",defaultExtraArgs:[1]},S:{event:"edit",subType:"vScrollUp",defaultExtraArgs:[1]},T:{event:"edit",subType:"vScrollDown",defaultExtraArgs:[1]},X:{event:"edit",subType:"erase",defaultExtraArgs:[1]},d:{event:"cursor",subType:"row"},"?h":{event:"device",arg:true,subTree:{1e3:{subType:"mouseButton",continue:true},1002:{subType:"mouseDrag",continue:true},1003:{subType:"mouseMotion",continue:true},1004:{subType:"focusEvent",continue:true},1006:{event:"none",continue:true}}},"?l":{event:"device",arg:false,subTree:null},n:{event:"device",subTree:{6:{subType:"cursorLocation"}}},"?n":{event:"device",subTree:{6:{subType:"cursorLocation",arg:true}}},m:{event:"attr",subType:"reset",subTree:{0:{subType:"reset",continue:true},1:{subType:"bold",arg:true,continue:true},2:{subType:"dim",arg:true,continue:true},3:{subType:"italic",arg:true,continue:true},4:{subType:"underline",arg:true,continue:true},5:{subType:"blink",arg:true,continue:true},7:{subType:"inverse",arg:true,continue:true},8:{subType:"hidden",arg:true,continue:true},9:{subType:"strike",arg:true,continue:true},21:{subType:"bold",arg:false,continue:true},22:{subType:"noDimNoBold",continue:true},23:{subType:"italic",arg:false,continue:true},24:{subType:"underline",arg:false,continue:true},25:{subType:"blink",arg:false,continue:true},27:{subType:"inverse",arg:false,continue:true},28:{subType:"hidden",arg:false,continue:true},29:{subType:"strike",arg:false,continue:true},30:{subType:"color",arg:"black",continue:true},31:{subType:"color",arg:"red",continue:true},32:{subType:"color",arg:"green",continue:true},33:{subType:"color",arg:"yellow",continue:true},34:{subType:"color",arg:"blue",continue:true},35:{subType:"color",arg:"magenta",continue:true},36:{subType:"color",arg:"cyan",continue:true},37:{subType:"color",arg:"white",continue:true},38:{subTree:{2:{subType:"colorRgb"},5:{subType:"color256"}}},39:{subType:"color",arg:"default",continue:true},40:{subType:"bgColor",arg:"black",continue:true},41:{subType:"bgColor",arg:"red",continue:true},42:{subType:"bgColor",arg:"green",continue:true},43:{subType:"bgColor",arg:"yellow",continue:true},44:{subType:"bgColor",arg:"blue",continue:true},45:{subType:"bgColor",arg:"magenta",continue:true},46:{subType:"bgColor",arg:"cyan",continue:true},47:{subType:"bgColor",arg:"white",continue:true},48:{subTree:{2:{subType:"bgColorRgb"},5:{subType:"bgColor256"}}},49:{subType:"bgColor",arg:"default",continue:true},90:{subType:"color",arg:"gray",continue:true},91:{subType:"color",arg:"brightRed",continue:true},92:{subType:"color",arg:"brightGreen",continue:true},93:{subType:"color",arg:"brightYellow",continue:true},94:{subType:"color",arg:"brightBlue",continue:true},95:{subType:"color",arg:"brightMagenta",continue:true},96:{subType:"color",arg:"brightCyan",continue:true},97:{subType:"color",arg:"brightWhite",continue:true},100:{subType:"bgColor",arg:"gray",continue:true},101:{subType:"bgColor",arg:"brightRed",continue:true},102:{subType:"bgColor",arg:"brightGreen",continue:true},103:{subType:"bgColor",arg:"brightYellow",continue:true},104:{subType:"bgColor",arg:"brightBlue",continue:true},105:{subType:"bgColor",arg:"brightMagenta",continue:true},106:{subType:"bgColor",arg:"brightCyan",continue:true},107:{subType:"bgColor",arg:"brightWhite",continue:true}}},r:{event:"edit",subType:"vScrollingRegion"},t:{event:"device",subTree:{18:{subType:"screenSize"}}}};r.CSI["?l"].subTree=r.CSI["?h"].subTree;r.OSC={0:{event:"system",subType:"setWindowTitle"},1:{event:"system",subType:"setIconName"},2:{event:"system",subType:"setWindowTitle"},4:{event:"palette",subType:"setColor"},"4?":{event:"palette",subType:"getColor"},7:{event:"system",subType:"setCwd"},9:{event:"system",subType:"notify"},10:{event:"palette",subType:"setDefaultColor"},11:{event:"palette",subType:"setDefaultBgColor"},12:{event:"cursorAttr",subType:"setColor"},17:{event:"palette",subType:"setHighlightBgColor"},50:{event:"cursorAttr",subType:"setShape"},104:{event:"palette",subType:"resetColor"},110:{event:"palette",subType:"resetDefaultColor"},111:{event:"palette",subType:"resetDefaultBgColor"},112:{event:"cursorAttr",subType:"resetColor"},117:{event:"palette",subType:"resetHighlightBgColor"},777:{event:"system",subTree:{notify:{subType:"notify"}}}}},{}],60:[function(t,e,r){"use strict";r.specialKeys={ESCAPE:"",TAB:"\t",ENTER:"\r",SHIFT_TAB:"",ALT_TAB:"\t",ALT_ENTER:"\r",UP:"OA",DOWN:"OB",RIGHT:"OC",LEFT:"OD",SHIFT_UP:"",SHIFT_DOWN:"",SHIFT_RIGHT:"",SHIFT_LEFT:"",ALT_UP:"",ALT_DOWN:"",ALT_RIGHT:"",ALT_LEFT:"",CTRL_UP:"",CTRL_DOWN:"",CTRL_RIGHT:"",CTRL_LEFT:"",BACKSPACE:"",INSERT:"[2~",DELETE:"[3~",HOME:"[1~",END:"[4~",PAGE_UP:"[5~",PAGE_DOWN:"[6~",CTRL_BACKSPACE:"\b",CTRL_INSERT:"[2;5~",CTRL_DELETE:"[3;5~",CTRL_HOME:"[1;5~",CTRL_END:"[4;5~",CTRL_PAGE_UP:"[5;5~",CTRL_PAGE_DOWN:"[6;5~",SHIFT_INSERT:"[2;2~",SHIFT_DELETE:"[3;2~",SHIFT_HOME:"[1;2~",SHIFT_END:"[4;2~",SHIFT_PAGE_UP:"[5;2~",SHIFT_PAGE_DOWN:"[6;2~",ALT_BACKSPACE:"",ALT_INSERT:"[2;3~",ALT_DELETE:"[3;3~",ALT_HOME:"[1;3~",ALT_END:"[4;3~",ALT_PAGE_UP:"[5;3~",ALT_PAGE_DOWN:"[6;3~",F1:"OP",F2:"OQ",F3:"OR",F4:"OS",F5:"[15~",F6:"[17~",F7:"[18~",F8:"[19~",F9:"[20~",F10:"[21~",F11:"[23~",F12:"[24~",SHIFT_F1:"O1;2P",SHIFT_F2:"O1;2Q",SHIFT_F3:"O1;2R",SHIFT_F4:"O1;2S",SHIFT_F5:"[15;2~",SHIFT_F6:"[17;2~",SHIFT_F7:"[18;2~",SHIFT_F8:"[19;2~",SHIFT_F9:"[20;2~",SHIFT_F10:"[21;2~",SHIFT_F11:"[23;2~",SHIFT_F12:"[24;2~",CTRL_F1:"O1;5P",CTRL_F2:"O1;5Q",CTRL_F3:"O1;5R",CTRL_F4:"O1;5S",CTRL_F5:"[15;5~",CTRL_F6:"[17;5~",CTRL_F7:"[18;5~",CTRL_F8:"[19;5~",CTRL_F9:"[20;5~",CTRL_F10:"[21;5~",CTRL_F11:"[23;5~",CTRL_F12:"[24;5~",CTRL_SHIFT_F1:"O1;6P",CTRL_SHIFT_F2:"O1;6Q",CTRL_SHIFT_F3:"O1;6R",CTRL_SHIFT_F4:"O1;6S",CTRL_SHIFT_F5:"[15;6~",CTRL_SHIFT_F6:"[17;6~",CTRL_SHIFT_F7:"[18;6~",CTRL_SHIFT_F8:"[19;6~",CTRL_SHIFT_F9:"[20;6~",CTRL_SHIFT_F10:"[21;6~",CTRL_SHIFT_F11:"[23;6~",CTRL_SHIFT_F12:"[24;6~",NUL:"\0",ALT_SPACE:" ",CTRL_ALT_SPACE:"\0"};for(let t=1;t<=26;t++){r.specialKeys["CTRL_"+String.fromCharCode(64+t)]=String.fromCharCode(t);r.specialKeys["ALT_"+String.fromCharCode(64+t)]=""+String.fromCharCode(96+t);r.specialKeys["CTRL_ALT_"+String.fromCharCode(64+t)]=""+String.fromCharCode(t);r.specialKeys["ALT_SHIFT_"+String.fromCharCode(64+t)]=""+String.fromCharCode(64+t)}r.reports={cursorLocation:"[%+1u;%-1uR",cursorLocationDecVariant:"[?%+1u;%-1uR",screenSize:"[8;%+1u;%-1ut",focusIn:"",focusOut:"",registerColor:"]4;%u;rgb:%x/%x/%x"}},{}],61:[function(t,e,r){"use strict";e.exports=function(t){t.globalConfig.preferProcessSigwinch=true}},{}],62:[function(t,e,r){"use strict";var s=t("seventh");e.exports=function t(e,r){if(typeof e==="function"){r=e;e=undefined}if(!e||typeof e!=="object"){e={yes:["y","Y"],no:["n","N"],echoYes:"yes",echoNo:"no"}}if(typeof e.yes==="string"){e.yes=[e.yes]}if(!Array.isArray(e.yes)){e.yes=["y","Y"]}if(typeof e.no==="string"){e.no=[e.no]}if(!Array.isArray(e.no)){e.no=["n","N"]}if(!this.grabbing){this.grabInput()}var i=t=>{if(e.yes.indexOf(t)!==-1){if(e.echoYes){this(e.echoYes)}this.removeListener("key",i);if(r){r(undefined,true)}else{n.promise.resolve(true)}}else if(e.no.indexOf(t)!==-1){if(e.echoNo){this(e.echoNo)}this.removeListener("key",i);if(r){r(undefined,false)}else{n.promise.resolve(false)}}};this.on("key",i);var n={};n.abort=()=>{this.removeListener("key",i)};n.promise=new s;return n}},{seventh:113}],63:[function(t,r,e){(function(g){(function(){"use strict";var a=t("ndarray");var i=t("pngjs").PNG;var s=t("jpeg-js");var u=t("ndarray-pack");var l=t("omggif").GifReader;var f=t("node-bitmap");var e=t("fs");var o=t("path").extname;function n(t,r){var e=new i;e.parse(t,function(t,e){if(t){r(t);return}r(null,a(new Uint8Array(e.data),[e.width|0,e.height|0,4],[4,4*e.width|0,1],0))})}function h(t,e){var r;try{r=s.decode(t)}catch(t){e(t);return}if(!r){e(new Error("Error decoding jpeg"));return}var i=[r.height,r.width,4];var n=a(r.data,i);e(null,n.transpose(1,0))}function c(t,e){var r,i,n,s;try{r=new l(t)}catch(t){e(t);return}if(r.numFrames()>0){i=[r.numFrames(),r.height,r.width,4];n=new Uint8Array(i[0]*i[1]*i[2]*i[3]);s=a(n,i);try{for(var o=0;or?r:t};var P=I;var j=function(t){t._clipped=false;t._unclipped=t.slice(0);for(var e=0;e<=3;e++){if(e<3){if(t[e]<0||t[e]>255){t._clipped=true}t[e]=P(t[e],0,255)}else if(e===3){t[e]=P(t[e],0,1)}}return t};var L={};for(var D=0,F=["Boolean","Number","String","Function","Array","Date","RegExp","Undefined","Null"];D=3){return Array.prototype.slice.call(e)}if(H(e[0])=="object"&&t){return t.split("").filter(function(t){return e[0][t]!==undefined}).map(function(t){return e[0][t]})}return e[0]};var V=t;var G=function(t){if(t.length<2){return null}var e=t.length-1;if(V(t[e])=="string"){return t[e].toLowerCase()}return null};var e=Math.PI;var r={clip_rgb:j,limit:I,type:t,unpack:Y,last:G,PI:e,TWOPI:e*2,PITHIRD:e/3,DEG2RAD:e/180,RAD2DEG:180/e};var i={format:{},autodetect:[]};var Z=r.last;var K=r.clip_rgb;var X=r.type;var f=i;var q=function t(){var e=[],r=arguments.length;while(r--)e[r]=arguments[r];var i=this;if(X(e[0])==="object"&&e[0].constructor&&e[0].constructor===this.constructor){return e[0]}var n=Z(e);var s=false;if(!n){s=true;if(!f.sorted){f.autodetect=f.autodetect.sort(function(t,e){return e.p-t.p});f.sorted=true}for(var o=0,a=f.autodetect;o4?t[4]:1;if(s===1){return[0,0,0,o]}return[r>=1?0:255*(1-r)*(1-s),i>=1?0:255*(1-i)*(1-s),n>=1?0:255*(1-n)*(1-s),o]};var it=rt;var nt=o;var st=n;var ot=i;var at=r.unpack;var ut=r.type;var lt=tt;st.prototype.cmyk=function(){return lt(this._rgb)};nt.cmyk=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];return new(Function.prototype.bind.apply(st,[null].concat(t,["cmyk"])))};ot.format.cmyk=it;ot.autodetect.push({p:2,test:function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];t=at(t,"cmyk");if(ut(t)==="array"&&t.length===4){return"cmyk"}}});var ft=r.unpack;var ht=r.last;var ct=function(t){return Math.round(t*100)/100};var dt=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];var r=ft(t,"hsla");var i=ht(t)||"lsa";r[0]=ct(r[0]||0);r[1]=ct(r[1]*100)+"%";r[2]=ct(r[2]*100)+"%";if(i==="hsla"||r.length>3&&r[3]<1){r[3]=r.length>3?r[3]:1;i="hsla"}else{r.length=3}return i+"("+r.join(",")+")"};var pt=dt;var gt=r.unpack;var yt=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];t=gt(t,"rgba");var r=t[0];var i=t[1];var n=t[2];r/=255;i/=255;n/=255;var s=Math.min(r,i,n);var o=Math.max(r,i,n);var a=(o+s)/2;var u,l;if(o===s){u=0;l=Number.NaN}else{u=a<.5?(o-s)/(o+s):(o-s)/(2-o-s)}if(r==o){l=(i-n)/(o-s)}else if(i==o){l=2+(n-r)/(o-s)}else if(n==o){l=4+(r-i)/(o-s)}l*=60;if(l<0){l+=360}if(t.length>3&&t[3]!==undefined){return[l,u,a,t[3]]}return[l,u,a]};var mt=yt;var bt=r.unpack;var vt=r.last;var wt=pt;var xt=mt;var _t=Math.round;var Ct=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];var r=bt(t,"rgba");var i=vt(t)||"rgb";if(i.substr(0,3)=="hsl"){return wt(xt(r),i)}r[0]=_t(r[0]);r[1]=_t(r[1]);r[2]=_t(r[2]);if(i==="rgba"||r.length>3&&r[3]<1){r[3]=r.length>3?r[3]:1;i="rgba"}return i+"("+r.slice(0,i==="rgb"?3:4).join(",")+")"};var Tt=Ct;var St=r.unpack;var kt=Math.round;var At=function(){var t;var e=[],r=arguments.length;while(r--)e[r]=arguments[r];e=St(e,"hsl");var i=e[0];var n=e[1];var s=e[2];var o,a,u;if(n===0){o=a=u=s*255}else{var l=[0,0,0];var f=[0,0,0];var h=s<.5?s*(1+n):s+n-s*n;var c=2*s-h;var d=i/360;l[0]=d+1/3;l[1]=d;l[2]=d-1/3;for(var p=0;p<3;p++){if(l[p]<0){l[p]+=1}if(l[p]>1){l[p]-=1}if(6*l[p]<1){f[p]=c+(h-c)*6*l[p]}else if(2*l[p]<1){f[p]=h}else if(3*l[p]<2){f[p]=c+(h-c)*(2/3-l[p])*6}else{f[p]=c}}t=[kt(f[0]*255),kt(f[1]*255),kt(f[2]*255)],o=t[0],a=t[1],u=t[2]}if(e.length>3){return[o,a,u,e[3]]}return[o,a,u,1]};var Et=At;var Bt=Et;var Rt=i;var Ot=/^rgb\(\s*(-?\d+),\s*(-?\d+)\s*,\s*(-?\d+)\s*\)$/;var Mt=/^rgba\(\s*(-?\d+),\s*(-?\d+)\s*,\s*(-?\d+)\s*,\s*([01]|[01]?\.\d+)\)$/;var It=/^rgb\(\s*(-?\d+(?:\.\d+)?)%,\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*\)$/;var Pt=/^rgba\(\s*(-?\d+(?:\.\d+)?)%,\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/;var jt=/^hsl\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*\)$/;var Lt=/^hsla\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/;var Dt=Math.round;var Ft=function(t){t=t.toLowerCase().trim();var e;if(Rt.format.named){try{return Rt.format.named(t)}catch(t){}}if(e=t.match(Ot)){var r=e.slice(1,4);for(var i=0;i<3;i++){r[i]=+r[i]}r[3]=1;return r}if(e=t.match(Mt)){var n=e.slice(1,5);for(var s=0;s<4;s++){n[s]=+n[s]}return n}if(e=t.match(It)){var o=e.slice(1,4);for(var a=0;a<3;a++){o[a]=Dt(o[a]*2.55)}o[3]=1;return o}if(e=t.match(Pt)){var u=e.slice(1,5);for(var l=0;l<3;l++){u[l]=Dt(u[l]*2.55)}u[3]=+u[3];return u}if(e=t.match(jt)){var f=e.slice(1,4);f[1]*=.01;f[2]*=.01;var h=Bt(f);h[3]=1;return h}if(e=t.match(Lt)){var c=e.slice(1,4);c[1]*=.01;c[2]*=.01;var d=Bt(c);d[3]=+e[4];return d}};Ft.test=function(t){return Ot.test(t)||Mt.test(t)||It.test(t)||Pt.test(t)||jt.test(t)||Lt.test(t)};var Wt=Ft;var Ht=o;var Nt=n;var Ut=i;var zt=r.type;var Yt=Tt;var Vt=Wt;Nt.prototype.css=function(t){return Yt(this._rgb,t)};Ht.css=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];return new(Function.prototype.bind.apply(Nt,[null].concat(t,["css"])))};Ut.format.css=Vt;Ut.autodetect.push({p:5,test:function(t){var e=[],r=arguments.length-1;while(r-- >0)e[r]=arguments[r+1];if(!e.length&&zt(t)==="string"&&Vt.test(t)){return"css"}}});var Gt=n;var Zt=o;var Kt=i;var Xt=r.unpack;Kt.format.gl=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];var r=Xt(t,"rgba");r[0]*=255;r[1]*=255;r[2]*=255;return r};Zt.gl=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];return new(Function.prototype.bind.apply(Gt,[null].concat(t,["gl"])))};Gt.prototype.gl=function(){var t=this._rgb;return[t[0]/255,t[1]/255,t[2]/255,t[3]]};var qt=r.unpack;var Jt=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];var r=qt(t,"rgb");var i=r[0];var n=r[1];var s=r[2];var o=Math.min(i,n,s);var a=Math.max(i,n,s);var u=a-o;var l=u*100/255;var f=o/(255-u)*100;var h;if(u===0){h=Number.NaN}else{if(i===a){h=(n-s)/u}if(n===a){h=2+(s-i)/u}if(s===a){h=4+(i-n)/u}h*=60;if(h<0){h+=360}}return[h,l,f]};var $t=Jt;var Qt=r.unpack;var te=Math.floor;var ee=function(){var t,e,r,i,n,s;var o=[],a=arguments.length;while(a--)o[a]=arguments[a];o=Qt(o,"hcg");var u=o[0];var l=o[1];var f=o[2];var h,c,d;f=f*255;var p=l*255;if(l===0){h=c=d=f}else{if(u===360){u=0}if(u>360){u-=360}if(u<0){u+=360}u/=60;var g=te(u);var y=u-g;var m=f*(1-l);var b=m+p*(1-y);var v=m+p*y;var w=m+p;switch(g){case 0:t=[w,v,m],h=t[0],c=t[1],d=t[2];break;case 1:e=[b,w,m],h=e[0],c=e[1],d=e[2];break;case 2:r=[m,w,v],h=r[0],c=r[1],d=r[2];break;case 3:i=[m,b,w],h=i[0],c=i[1],d=i[2];break;case 4:n=[v,m,w],h=n[0],c=n[1],d=n[2];break;case 5:s=[w,m,b],h=s[0],c=s[1],d=s[2];break}}return[h,c,d,o.length>3?o[3]:1]};var re=ee;var ie=r.unpack;var ne=r.type;var se=o;var oe=n;var ae=i;var ue=$t;oe.prototype.hcg=function(){return ue(this._rgb)};se.hcg=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];return new(Function.prototype.bind.apply(oe,[null].concat(t,["hcg"])))};ae.format.hcg=re;ae.autodetect.push({p:1,test:function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];t=ie(t,"hcg");if(ne(t)==="array"&&t.length===3){return"hcg"}}});var le=r.unpack;var fe=r.last;var h=Math.round;var he=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];var r=le(t,"rgba");var i=r[0];var n=r[1];var s=r[2];var o=r[3];var a=fe(t)||"auto";if(o===undefined){o=1}if(a==="auto"){a=o<1?"rgba":"rgb"}i=h(i);n=h(n);s=h(s);var u=i<<16|n<<8|s;var l="000000"+u.toString(16);l=l.substr(l.length-6);var f="0"+h(o*255).toString(16);f=f.substr(f.length-2);switch(a.toLowerCase()){case"rgba":return"#"+l+f;case"argb":return"#"+f+l;default:return"#"+l}};var ce=he;var de=/^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/;var pe=/^#?([A-Fa-f0-9]{8}|[A-Fa-f0-9]{4})$/;var ge=function(t){if(t.match(de)){if(t.length===4||t.length===7){t=t.substr(1)}if(t.length===3){t=t.split("");t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]}var e=parseInt(t,16);var r=e>>16;var i=e>>8&255;var n=e&255;return[r,i,n,1]}if(t.match(pe)){if(t.length===5||t.length===9){t=t.substr(1)}if(t.length===4){t=t.split("");t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]+t[3]+t[3]}var s=parseInt(t,16);var o=s>>24&255;var a=s>>16&255;var u=s>>8&255;var l=Math.round((s&255)/255*100)/100;return[o,a,u,l]}throw new Error("unknown hex color: "+t)};var ye=ge;var me=o;var be=n;var ve=r.type;var we=i;var xe=ce;be.prototype.hex=function(t){return xe(this._rgb,t)};me.hex=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];return new(Function.prototype.bind.apply(be,[null].concat(t,["hex"])))};we.format.hex=ye;we.autodetect.push({p:4,test:function(t){var e=[],r=arguments.length-1;while(r-- >0)e[r]=arguments[r+1];if(!e.length&&ve(t)==="string"&&[3,4,5,6,7,8,9].indexOf(t.length)>=0){return"hex"}}});var _e=r.unpack;var Ce=r.TWOPI;var Te=Math.min;var Se=Math.sqrt;var ke=Math.acos;var Ae=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];var r=_e(t,"rgb");var i=r[0];var n=r[1];var s=r[2];i/=255;n/=255;s/=255;var o;var a=Te(i,n,s);var u=(i+n+s)/3;var l=u>0?1-a/u:0;if(l===0){o=NaN}else{o=(i-n+(i-s))/2;o/=Se((i-n)*(i-n)+(i-s)*(n-s));o=ke(o);if(s>n){o=Ce-o}o/=Ce}return[o*360,l,u]};var Ee=Ae;var Be=r.unpack;var Re=r.limit;var u=r.TWOPI;var Oe=r.PITHIRD;var l=Math.cos;var Me=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];t=Be(t,"hsi");var r=t[0];var i=t[1];var n=t[2];var s,o,a;if(isNaN(r)){r=0}if(isNaN(i)){i=0}if(r>360){r-=360}if(r<0){r+=360}r/=360;if(r<1/3){a=(1-i)/3;s=(1+i*l(u*r)/l(Oe-u*r))/3;o=1-(a+s)}else if(r<2/3){r-=1/3;s=(1-i)/3;o=(1+i*l(u*r)/l(Oe-u*r))/3;a=1-(s+o)}else{r-=2/3;o=(1-i)/3;a=(1+i*l(u*r)/l(Oe-u*r))/3;s=1-(o+a)}s=Re(n*s*3);o=Re(n*o*3);a=Re(n*a*3);return[s*255,o*255,a*255,t.length>3?t[3]:1]};var Ie=Me;var Pe=r.unpack;var je=r.type;var Le=o;var De=n;var Fe=i;var We=Ee;De.prototype.hsi=function(){return We(this._rgb)};Le.hsi=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];return new(Function.prototype.bind.apply(De,[null].concat(t,["hsi"])))};Fe.format.hsi=Ie;Fe.autodetect.push({p:2,test:function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];t=Pe(t,"hsi");if(je(t)==="array"&&t.length===3){return"hsi"}}});var He=r.unpack;var Ne=r.type;var Ue=o;var ze=n;var Ye=i;var Ve=mt;ze.prototype.hsl=function(){return Ve(this._rgb)};Ue.hsl=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];return new(Function.prototype.bind.apply(ze,[null].concat(t,["hsl"])))};Ye.format.hsl=Et;Ye.autodetect.push({p:2,test:function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];t=He(t,"hsl");if(Ne(t)==="array"&&t.length===3){return"hsl"}}});var Ge=r.unpack;var Ze=Math.min;var Ke=Math.max;var Xe=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];t=Ge(t,"rgb");var r=t[0];var i=t[1];var n=t[2];var s=Ze(r,i,n);var o=Ke(r,i,n);var a=o-s;var u,l,f;f=o/255;if(o===0){u=Number.NaN;l=0}else{l=a/o;if(r===o){u=(i-n)/a}if(i===o){u=2+(n-r)/a}if(n===o){u=4+(r-i)/a}u*=60;if(u<0){u+=360}}return[u,l,f]};var qe=Xe;var Je=r.unpack;var $e=Math.floor;var Qe=function(){var t,e,r,i,n,s;var o=[],a=arguments.length;while(a--)o[a]=arguments[a];o=Je(o,"hsv");var u=o[0];var l=o[1];var f=o[2];var h,c,d;f*=255;if(l===0){h=c=d=f}else{if(u===360){u=0}if(u>360){u-=360}if(u<0){u+=360}u/=60;var p=$e(u);var g=u-p;var y=f*(1-l);var m=f*(1-l*g);var b=f*(1-l*(1-g));switch(p){case 0:t=[f,b,y],h=t[0],c=t[1],d=t[2];break;case 1:e=[m,f,y],h=e[0],c=e[1],d=e[2];break;case 2:r=[y,f,b],h=r[0],c=r[1],d=r[2];break;case 3:i=[y,m,f],h=i[0],c=i[1],d=i[2];break;case 4:n=[b,y,f],h=n[0],c=n[1],d=n[2];break;case 5:s=[f,y,m],h=s[0],c=s[1],d=s[2];break}}return[h,c,d,o.length>3?o[3]:1]};var tr=Qe;var er=r.unpack;var rr=r.type;var ir=o;var nr=n;var sr=i;var or=qe;nr.prototype.hsv=function(){return or(this._rgb)};ir.hsv=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];return new(Function.prototype.bind.apply(nr,[null].concat(t,["hsv"])))};sr.format.hsv=tr;sr.autodetect.push({p:2,test:function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];t=er(t,"hsv");if(rr(t)==="array"&&t.length===3){return"hsv"}}});var a={Kn:18,Xn:.95047,Yn:1,Zn:1.08883,t0:.137931034,t1:.206896552,t2:.12841855,t3:.008856452};var c=a;var ar=r.unpack;var ur=Math.pow;var lr=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];var r=ar(t,"rgb");var i=r[0];var n=r[1];var s=r[2];var o=cr(i,n,s);var a=o[0];var u=o[1];var l=o[2];var f=116*u-16;return[f<0?0:f,500*(a-u),200*(u-l)]};var fr=function(t){if((t/=255)<=.04045){return t/12.92}return ur((t+.055)/1.055,2.4)};var hr=function(t){if(t>c.t3){return ur(t,1/3)}return t/c.t2+c.t0};var cr=function(t,e,r){t=fr(t);e=fr(e);r=fr(r);var i=hr((.4124564*t+.3575761*e+.1804375*r)/c.Xn);var n=hr((.2126729*t+.7151522*e+.072175*r)/c.Yn);var s=hr((.0193339*t+.119192*e+.9503041*r)/c.Zn);return[i,n,s]};var dr=lr;var d=a;var pr=r.unpack;var gr=Math.pow;var yr=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];t=pr(t,"lab");var r=t[0];var i=t[1];var n=t[2];var s,o,a,u,l,f;o=(r+16)/116;s=isNaN(i)?o:o+i/500;a=isNaN(n)?o:o-n/200;o=d.Yn*br(o);s=d.Xn*br(s);a=d.Zn*br(a);u=mr(3.2404542*s-1.5371385*o-.4985314*a);l=mr(-.969266*s+1.8760108*o+.041556*a);f=mr(.0556434*s-.2040259*o+1.0572252*a);return[u,l,f,t.length>3?t[3]:1]};var mr=function(t){return 255*(t<=.00304?12.92*t:1.055*gr(t,1/2.4)-.055)};var br=function(t){return t>d.t1?t*t*t:d.t2*(t-d.t0)};var vr=yr;var wr=r.unpack;var xr=r.type;var _r=o;var Cr=n;var Tr=i;var Sr=dr;Cr.prototype.lab=function(){return Sr(this._rgb)};_r.lab=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];return new(Function.prototype.bind.apply(Cr,[null].concat(t,["lab"])))};Tr.format.lab=vr;Tr.autodetect.push({p:2,test:function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];t=wr(t,"lab");if(xr(t)==="array"&&t.length===3){return"lab"}}});var kr=r.unpack;var Ar=r.RAD2DEG;var Er=Math.sqrt;var Br=Math.atan2;var Rr=Math.round;var Or=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];var r=kr(t,"lab");var i=r[0];var n=r[1];var s=r[2];var o=Er(n*n+s*s);var a=(Br(s,n)*Ar+360)%360;if(Rr(o*1e4)===0){a=Number.NaN}return[i,o,a]};var Mr=Or;var Ir=r.unpack;var Pr=dr;var jr=Mr;var Lr=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];var r=Ir(t,"rgb");var i=r[0];var n=r[1];var s=r[2];var o=Pr(i,n,s);var a=o[0];var u=o[1];var l=o[2];return jr(a,u,l)};var Dr=Lr;var Fr=r.unpack;var Wr=r.DEG2RAD;var Hr=Math.sin;var Nr=Math.cos;var Ur=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];var r=Fr(t,"lch");var i=r[0];var n=r[1];var s=r[2];if(isNaN(s)){s=0}s=s*Wr;return[i,Nr(s)*n,Hr(s)*n]};var zr=Ur;var Yr=r.unpack;var Vr=zr;var Gr=vr;var Zr=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];t=Yr(t,"lch");var r=t[0];var i=t[1];var n=t[2];var s=Vr(r,i,n);var o=s[0];var a=s[1];var u=s[2];var l=Gr(o,a,u);var f=l[0];var h=l[1];var c=l[2];return[f,h,c,t.length>3?t[3]:1]};var Kr=Zr;var Xr=r.unpack;var qr=Kr;var Jr=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];var r=Xr(t,"hcl").reverse();return qr.apply(void 0,r)};var $r=Jr;var Qr=r.unpack;var ti=r.type;var ei=o;var p=n;var ri=i;var ii=Dr;p.prototype.lch=function(){return ii(this._rgb)};p.prototype.hcl=function(){return ii(this._rgb).reverse()};ei.lch=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];return new(Function.prototype.bind.apply(p,[null].concat(t,["lch"])))};ei.hcl=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];return new(Function.prototype.bind.apply(p,[null].concat(t,["hcl"])))};ri.format.lch=Kr;ri.format.hcl=$r;["lch","hcl"].forEach(function(r){return ri.autodetect.push({p:2,test:function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];t=Qr(t,r);if(ti(t)==="array"&&t.length===3){return r}}})});var ni={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflower:"#6495ed",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",laserlemon:"#ffff54",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrod:"#fafad2",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",maroon2:"#7f0000",maroon3:"#b03060",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",purple2:"#7f007f",purple3:"#a020f0",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};var si=ni;var oi=n;var ai=i;var ui=r.type;var g=si;var li=ye;var fi=ce;oi.prototype.name=function(){var t=fi(this._rgb,"rgb");for(var e=0,r=Object.keys(g);e0)e[r]=arguments[r+1];if(!e.length&&ui(t)==="string"&&g[t.toLowerCase()]){return"named"}}});var hi=r.unpack;var ci=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];var r=hi(t,"rgb");var i=r[0];var n=r[1];var s=r[2];return(i<<16)+(n<<8)+s};var di=ci;var pi=r.type;var gi=function(t){if(pi(t)=="number"&&t>=0&&t<=16777215){var e=t>>16;var r=t>>8&255;var i=t&255;return[e,r,i,1]}throw new Error("unknown num color: "+t)};var yi=gi;var mi=o;var bi=n;var vi=i;var wi=r.type;var xi=di;bi.prototype.num=function(){return xi(this._rgb)};mi.num=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];return new(Function.prototype.bind.apply(bi,[null].concat(t,["num"])))};vi.format.num=yi;vi.autodetect.push({p:5,test:function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];if(t.length===1&&wi(t[0])==="number"&&t[0]>=0&&t[0]<=16777215){return"num"}}});var _i=o;var Ci=n;var Ti=i;var Si=r.unpack;var ki=r.type;var Ai=Math.round;Ci.prototype.rgb=function(t){if(t===void 0)t=true;if(t===false){return this._rgb.slice(0,3)}return this._rgb.slice(0,3).map(Ai)};Ci.prototype.rgba=function(r){if(r===void 0)r=true;return this._rgb.slice(0,4).map(function(t,e){return e<3?r===false?t:Ai(t):t})};_i.rgb=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];return new(Function.prototype.bind.apply(Ci,[null].concat(t,["rgb"])))};Ti.format.rgb=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];var r=Si(t,"rgba");if(r[3]===undefined){r[3]=1}return r};Ti.autodetect.push({p:3,test:function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];t=Si(t,"rgba");if(ki(t)==="array"&&(t.length===3||t.length===4&&ki(t[3])=="number"&&t[3]>=0&&t[3]<=1)){return"rgb"}}});var y=Math.log;var Ei=function(t){var e=t/100;var r,i,n;if(e<66){r=255;i=e<6?0:-155.25485562709179-.44596950469579133*(i=e-2)+104.49216199393888*y(i);n=e<20?0:-254.76935184120902+.8274096064007395*(n=e-10)+115.67994401066147*y(n)}else{r=351.97690566805693+.114206453784165*(r=e-55)-40.25366309332127*y(r);i=325.4494125711974+.07943456536662342*(i=e-50)-28.0852963507957*y(i);n=255}return[r,i,n,1]};var Bi=Ei;var Ri=Bi;var Oi=r.unpack;var Mi=Math.round;var Ii=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];var r=Oi(t,"rgb");var i=r[0],n=r[2];var s=1e3;var o=4e4;var a=.4;var u;while(o-s>a){u=(o+s)*.5;var l=Ri(u);if(l[2]/l[0]>=n/i){o=u}else{s=u}}return Mi(u)};var Pi=Ii;var ji=o;var m=n;var Li=i;var Di=Pi;m.prototype.temp=m.prototype.kelvin=m.prototype.temperature=function(){return Di(this._rgb)};ji.temp=ji.kelvin=ji.temperature=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];return new(Function.prototype.bind.apply(m,[null].concat(t,["temp"])))};Li.format.temp=Li.format.kelvin=Li.format.temperature=Bi;var Fi=r.unpack;var Wi=Math.cbrt;var Hi=Math.pow;var Ni=Math.sign;var Ui=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];var r=Fi(t,"rgb");var i=r[0];var n=r[1];var s=r[2];var o=[Yi(i/255),Yi(n/255),Yi(s/255)];var a=o[0];var u=o[1];var l=o[2];var f=Wi(.4122214708*a+.5363325363*u+.0514459929*l);var h=Wi(.2119034982*a+.6806995451*u+.1073969566*l);var c=Wi(.0883024619*a+.2817188376*u+.6299787005*l);return[.2104542553*f+.793617785*h-.0040720468*c,1.9779984951*f-2.428592205*h+.4505937099*c,.0259040371*f+.7827717662*h-.808675766*c]};var zi=Ui;function Yi(t){var e=Math.abs(t);if(e<.04045){return t/12.92}return(Ni(t)||1)*Hi((e+.055)/1.055,2.4)}var Vi=r.unpack;var b=Math.pow;var Gi=Math.sign;var Zi=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];t=Vi(t,"lab");var r=t[0];var i=t[1];var n=t[2];var s=b(r+.3963377774*i+.2158037573*n,3);var o=b(r-.1055613458*i-.0638541728*n,3);var a=b(r-.0894841775*i-1.291485548*n,3);return[255*Xi(+4.0767416621*s-3.3077115913*o+.2309699292*a),255*Xi(-1.2684380046*s+2.6097574011*o-.3413193965*a),255*Xi(-.0041960863*s-.7034186147*o+1.707614701*a),t.length>3?t[3]:1]};var Ki=Zi;function Xi(t){var e=Math.abs(t);if(e>.0031308){return(Gi(t)||1)*(1.055*b(e,1/2.4)-.055)}return t*12.92}var qi=r.unpack;var Ji=r.type;var $i=o;var Qi=n;var tn=i;var en=zi;Qi.prototype.oklab=function(){return en(this._rgb)};$i.oklab=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];return new(Function.prototype.bind.apply(Qi,[null].concat(t,["oklab"])))};tn.format.oklab=Ki;tn.autodetect.push({p:3,test:function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];t=qi(t,"oklab");if(Ji(t)==="array"&&t.length===3){return"oklab"}}});var rn=r.unpack;var nn=zi;var sn=Mr;var on=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];var r=rn(t,"rgb");var i=r[0];var n=r[1];var s=r[2];var o=nn(i,n,s);var a=o[0];var u=o[1];var l=o[2];return sn(a,u,l)};var an=on;var un=r.unpack;var ln=zr;var fn=Ki;var hn=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];t=un(t,"lch");var r=t[0];var i=t[1];var n=t[2];var s=ln(r,i,n);var o=s[0];var a=s[1];var u=s[2];var l=fn(o,a,u);var f=l[0];var h=l[1];var c=l[2];return[f,h,c,t.length>3?t[3]:1]};var cn=hn;var dn=r.unpack;var pn=r.type;var gn=o;var yn=n;var mn=i;var bn=an;yn.prototype.oklch=function(){return bn(this._rgb)};gn.oklch=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];return new(Function.prototype.bind.apply(yn,[null].concat(t,["oklch"])))};mn.format.oklch=cn;mn.autodetect.push({p:3,test:function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];t=dn(t,"oklch");if(pn(t)==="array"&&t.length===3){return"oklch"}}});var vn=n;var wn=r.type;vn.prototype.alpha=function(t,e){if(e===void 0)e=false;if(t!==undefined&&wn(t)==="number"){if(e){this._rgb[3]=t;return this}return new vn([this._rgb[0],this._rgb[1],this._rgb[2],t],"rgb")}return this._rgb[3]};var xn=n;xn.prototype.clipped=function(){return this._rgb._clipped||false};var v=n;var _n=a;v.prototype.darken=function(t){if(t===void 0)t=1;var e=this;var r=e.lab();r[0]-=_n.Kn*t;return new v(r,"lab").alpha(e.alpha(),true)};v.prototype.brighten=function(t){if(t===void 0)t=1;return this.darken(-t)};v.prototype.darker=v.prototype.darken;v.prototype.brighter=v.prototype.brighten;var Cn=n;Cn.prototype.get=function(t){var e=t.split(".");var r=e[0];var i=e[1];var n=this[r]();if(i){var s=r.indexOf(i)-(r.substr(0,2)==="ok"?2:0);if(s>-1){return n[s]}throw new Error("unknown channel "+i+" in mode "+r)}else{return n}};var w=n;var Tn=r.type;var Sn=Math.pow;var kn=1e-7;var An=20;w.prototype.luminance=function(n){if(n!==undefined&&Tn(n)==="number"){if(n===0){return new w([0,0,0,this._rgb[3]],"rgb")}if(n===1){return new w([255,255,255,this._rgb[3]],"rgb")}var t=this.luminance();var s="rgb";var o=An;var a=function(t,e){var r=t.interpolate(e,.5,s);var i=r.luminance();if(Math.abs(n-i)n?a(t,r):a(r,e)};var e=(t>n?a(new w([0,0,0]),this):a(this,new w([255,255,255]))).rgb();return new w(e.concat([this._rgb[3]]))}return En.apply(void 0,this._rgb.slice(0,3))};var En=function(t,e,r){t=Bn(t);e=Bn(e);r=Bn(r);return.2126*t+.7152*e+.0722*r};var Bn=function(t){t/=255;return t<=.03928?t/12.92:Sn((t+.055)/1.055,2.4)};var x={};var Rn=n;var On=r.type;var _=x;var Mn=function(t,e,r){if(r===void 0)r=.5;var i=[],n=arguments.length-3;while(n-- >0)i[n]=arguments[n+3];var s=i[0]||"lrgb";if(!_[s]&&!i.length){s=Object.keys(_)[0]}if(!_[s]){throw new Error("interpolation mode "+s+" is not defined")}if(On(t)!=="object"){t=new Rn(t)}if(On(e)!=="object"){e=new Rn(e)}return _[s](t,e,r).alpha(t.alpha()+r*(e.alpha()-t.alpha()))};var In=n;var Pn=Mn;In.prototype.mix=In.prototype.interpolate=function(t,e){if(e===void 0)e=.5;var r=[],i=arguments.length-2;while(i-- >0)r[i]=arguments[i+2];return Pn.apply(void 0,[this,t,e].concat(r))};var jn=n;jn.prototype.premultiply=function(t){if(t===void 0)t=false;var e=this._rgb;var r=e[3];if(t){this._rgb=[e[0]*r,e[1]*r,e[2]*r,r];return this}else{return new jn([e[0]*r,e[1]*r,e[2]*r,r],"rgb")}};var Ln=n;var Dn=a;Ln.prototype.saturate=function(t){if(t===void 0)t=1;var e=this;var r=e.lch();r[1]+=Dn.Kn*t;if(r[1]<0){r[1]=0}return new Ln(r,"lch").alpha(e.alpha(),true)};Ln.prototype.desaturate=function(t){if(t===void 0)t=1;return this.saturate(-t)};var Fn=n;var Wn=r.type;Fn.prototype.set=function(t,e,r){if(r===void 0)r=false;var i=t.split(".");var n=i[0];var s=i[1];var o=this[n]();if(s){var a=n.indexOf(s)-(n.substr(0,2)==="ok"?2:0);if(a>-1){if(Wn(e)=="string"){switch(e.charAt(0)){case"+":o[a]+=+e;break;case"-":o[a]+=+e;break;case"*":o[a]*=+e.substr(1);break;case"/":o[a]/=+e.substr(1);break;default:o[a]=+e}}else if(Wn(e)==="number"){o[a]=e}else{throw new Error("unsupported value for Color.set")}var u=new Fn(o,n);if(r){this._rgb=u._rgb;return this}return u}throw new Error("unknown channel "+s+" in mode "+n)}else{return o}};var Hn=n;var Nn=function(t,e,r){var i=t._rgb;var n=e._rgb;return new Hn(i[0]+r*(n[0]-i[0]),i[1]+r*(n[1]-i[1]),i[2]+r*(n[2]-i[2]),"rgb")};x.rgb=Nn;var Un=n;var zn=Math.sqrt;var C=Math.pow;var Yn=function(t,e,r){var i=t._rgb;var n=i[0];var s=i[1];var o=i[2];var a=e._rgb;var u=a[0];var l=a[1];var f=a[2];return new Un(zn(C(n,2)*(1-r)+C(u,2)*r),zn(C(s,2)*(1-r)+C(l,2)*r),zn(C(o,2)*(1-r)+C(f,2)*r),"rgb")};x.lrgb=Yn;var Vn=n;var Gn=function(t,e,r){var i=t.lab();var n=e.lab();return new Vn(i[0]+r*(n[0]-i[0]),i[1]+r*(n[1]-i[1]),i[2]+r*(n[2]-i[2]),"lab")};x.lab=Gn;var Zn=n;var T=function(t,e,r,i){var n,s;var o,a;if(i==="hsl"){o=t.hsl();a=e.hsl()}else if(i==="hsv"){o=t.hsv();a=e.hsv()}else if(i==="hcg"){o=t.hcg();a=e.hcg()}else if(i==="hsi"){o=t.hsi();a=e.hsi()}else if(i==="lch"||i==="hcl"){i="hcl";o=t.hcl();a=e.hcl()}else if(i==="oklch"){o=t.oklch().reverse();a=e.oklch().reverse()}var u,l,f,h,c,d;if(i.substr(0,1)==="h"||i==="oklch"){n=o,u=n[0],f=n[1],c=n[2];s=a,l=s[0],h=s[1],d=s[2]}var p,g,y,m;if(!isNaN(u)&&!isNaN(l)){if(l>u&&l-u>180){m=l-(u+360)}else if(l180){m=l+360-u}else{m=l-u}g=u+r*m}else if(!isNaN(u)){g=u;if((d==1||d==0)&&i!="hsv"){p=f}}else if(!isNaN(l)){g=l;if((c==1||c==0)&&i!="hsv"){p=h}}else{g=Number.NaN}if(p===undefined){p=f+r*(h-f)}y=c+r*(d-c);return i==="oklch"?new Zn([y,p,g],i):new Zn([g,p,y],i)};var Kn=T;var Xn=function(t,e,r){return Kn(t,e,r,"lch")};x.lch=Xn;x.hcl=Xn;var qn=n;var Jn=function(t,e,r){var i=t.num();var n=e.num();return new qn(i+r*(n-i),"num")};x.num=Jn;var $n=T;var Qn=function(t,e,r){return $n(t,e,r,"hcg")};x.hcg=Qn;var ts=T;var es=function(t,e,r){return ts(t,e,r,"hsi")};x.hsi=es;var rs=T;var is=function(t,e,r){return rs(t,e,r,"hsl")};x.hsl=is;var ns=T;var ss=function(t,e,r){return ns(t,e,r,"hsv")};x.hsv=ss;var os=n;var as=function(t,e,r){var i=t.oklab();var n=e.oklab();return new os(i[0]+r*(n[0]-i[0]),i[1]+r*(n[1]-i[1]),i[2]+r*(n[2]-i[2]),"oklab")};x.oklab=as;var us=T;var ls=function(t,e,r){return us(t,e,r,"oklch")};x.oklch=ls;var fs=n;var hs=r.clip_rgb;var cs=Math.pow;var ds=Math.sqrt;var ps=Math.PI;var gs=Math.cos;var ys=Math.sin;var ms=Math.atan2;var bs=function(t,s,o){if(s===void 0)s="lrgb";if(o===void 0)o=null;var e=t.length;if(!o){o=Array.from(new Array(e)).map(function(){return 1})}var r=e/o.reduce(function(t,e){return t+e});o.forEach(function(t,e){o[e]*=r});t=t.map(function(t){return new fs(t)});if(s==="lrgb"){return vs(t,o)}var i=t.shift();var a=i.get(s);var u=[];var l=0;var f=0;for(var n=0;n=360){p-=360}a[d]=p}else{a[d]=a[d]/u[d]}}c/=e;return new fs(a,s).alpha(c>.99999?1:c,true)};var vs=function(t,e){var r=t.length;var i=[0,0,0,0];for(var n=0;n.9999999){i[3]=1}return new fs(hs(i))};var k=o;var A=r.type;var ws=Math.pow;var xs=function(l){var u="rgb";var f=k("#ccc");var e=0;var h=[0,1];var c=[];var d=[0,0];var p=false;var g=[];var r=false;var y=0;var m=1;var i=false;var b={};var v=true;var w=1;var n=function(t){t=t||["#fff","#000"];if(t&&A(t)==="string"&&k.brewer&&k.brewer[t.toLowerCase()]){t=k.brewer[t.toLowerCase()]}if(A(t)==="array"){if(t.length===1){t=[t[0],t[0]]}t=t.slice(0);for(var e=0;e=p[r]){r++}return r-1}return 0};var _=function(t){return t};var C=function(t){return t};var T=function(t,e){var r,i;if(e==null){e=false}if(isNaN(t)||t===null){return f}if(!e){if(p&&p.length>2){var n=x(t);i=n/(p.length-2)}else if(m!==y){i=(t-y)/(m-y)}else{i=1}}else{i=t}i=C(i);if(!e){i=_(i)}if(w!==1){i=ws(i,w)}i=d[0]+i*(1-d[0]-d[1]);i=Math.min(1,Math.max(0,i));var s=Math.floor(i*1e4);if(v&&b[s]){r=b[s]}else{if(A(g)==="array"){for(var o=0;o=a&&o===c.length-1){r=g[o];break}if(i>a&&i2){var o=r.map(function(t,e){return e/(r.length-1)});var a=r.map(function(t){return(t-y)/(m-y)});if(!a.every(function(t,e){return o[e]===t})){C=function(t){if(t<=0||t>=1){return t}var e=0;while(t>=a[e+1]){e++}var r=(t-a[e])/(a[e+1]-a[e]);var i=o[e]+r*(o[e+1]-o[e]);return i}}}}h=[y,m];return S};S.mode=function(t){if(!arguments.length){return u}u=t;s();return S};S.range=function(t,e){n(t);return S};S.out=function(t){r=t;return S};S.spread=function(t){if(!arguments.length){return e}e=t;return S};S.correctLightness=function(t){if(t==null){t=true}i=t;s();if(i){_=function(t){var e=T(0,true).lab()[0];var r=T(1,true).lab()[0];var i=e>r;var n=T(t,true).lab()[0];var s=e+(r-e)*t;var o=n-s;var a=0;var u=1;var l=20;while(Math.abs(o)>.01&&l-- >0){(function(){if(i){o*=-1}if(o<0){a=t;t+=(u-t)*.5}else{u=t;t+=(a-t)*.5}n=T(t,true).lab()[0];return o=n-s})()}return t}}else{_=function(t){return t}}return S};S.padding=function(t){if(t!=null){if(A(t)==="number"){t=[t,t]}d=t;return S}else{return d}};S.colors=function(e,r){if(arguments.length<2){r="hex"}var t=[];if(arguments.length===0){t=g.slice(0)}else if(e===1){t=[S(.5)]}else if(e>1){var i=h[0];var n=h[1]-i;t=_s(0,e,false).map(function(t){return S(i+t/(e-1)*n)})}else{l=[];var s=[];if(p&&p.length>2){for(var o=1,a=p.length,u=1<=a;u?oa;u?o++:o--){s.push((p[o-1]+p[o])*.5)}}else{s=h}t=s.map(function(t){return S(t)})}if(k[r]){t=t.map(function(t){return t[r]()})}return t};S.cache=function(t){if(t!=null){v=t;return S}else{return v}};S.gamma=function(t){if(t!=null){w=t;return S}else{return w}};S.nodata=function(t){if(t!=null){f=k(t);return S}else{return f}};return S};function _s(t,e,r){var i=[];var n=ts;n?o++:o--){i.push(o)}return i}var S=n;var Cs=xs;var Ts=function(t){var e=[1,1];for(var r=1;r=5){var l,f,h;l=t.map(function(t){return t.lab()});h=t.length-1;f=Ts(h);n=function(n){var s=1-n;var t=[0,1,2].map(function(i){return l.reduce(function(t,e,r){return t+f[r]*Math.pow(s,h-r)*Math.pow(n,r)*e[i]},0)});return new S(t,"lab")}}else{throw new RangeError("No point in running bezier with only one color.")}return n};var ks=function(t){var e=Ss(t);e.scale=function(){return Cs(e)};return e};var As=o;var E=function(t,e,r){if(!E[r]){throw new Error("unknown blend mode "+r)}return E[r](t,e)};var B=function(n){return function(t,e){var r=As(e).rgb();var i=As(t).rgb();return As.rgb(n(r,i))}};var R=function(i){return function(t,e){var r=[];r[0]=i(t[0],e[0]);r[1]=i(t[1],e[1]);r[2]=i(t[2],e[2]);return r}};var Es=function(t){return t};var Bs=function(t,e){return t*e/255};var Rs=function(t,e){return t>e?e:t};var Os=function(t,e){return t>e?t:e};var Ms=function(t,e){return 255*(1-(1-t/255)*(1-e/255))};var Is=function(t,e){return e<128?2*t*e/255:255*(1-2*(1-t/255)*(1-e/255))};var Ps=function(t,e){return 255*(1-(1-e/255)/(t/255))};var js=function(t,e){if(t===255){return 255}t=255*(e/255)/(1-t/255);return t>255?255:t};E.normal=B(R(Es));E.multiply=B(R(Bs));E.screen=B(R(Ms));E.overlay=B(R(Is));E.darken=B(R(Rs));E.lighten=B(R(Os));E.dodge=B(R(js));E.burn=B(R(Ps));var Ls=E;var Ds=r.type;var Fs=r.clip_rgb;var Ws=r.TWOPI;var Hs=Math.pow;var Ns=Math.sin;var Us=Math.cos;var zs=o;var Ys=function(f,h,c,d,p){if(f===void 0)f=300;if(h===void 0)h=-1.5;if(c===void 0)c=1;if(d===void 0)d=1;if(p===void 0)p=[0,1];var g=0,y;if(Ds(p)==="array"){y=p[1]-p[0]}else{y=0;p=[p,p]}var e=function(t){var e=Ws*((f+120)/360+h*t);var r=Hs(p[0]+y*t,d);var i=g!==0?c[0]+t*g:c;var n=i*r*(1-r)/2;var s=Us(e);var o=Ns(e);var a=r+n*(-.14861*s+1.78277*o);var u=r+n*(-.29227*s-.90649*o);var l=r+n*(+1.97294*s);return zs(Fs([a*255,u*255,l*255,1]))};e.start=function(t){if(t==null){return f}f=t;return e};e.rotations=function(t){if(t==null){return h}h=t;return e};e.gamma=function(t){if(t==null){return d}d=t;return e};e.hue=function(t){if(t==null){return c}c=t;if(Ds(c)==="array"){g=c[1]-c[0];if(g===0){c=c[1]}}else{g=0}return e};e.lightness=function(t){if(t==null){return p}if(Ds(t)==="array"){p=t;y=t[1]-t[0]}else{p=[t,t];y=0}return e};e.scale=function(){return zs.scale(e)};e.hue(c);return e};var Vs=n;var Gs="0123456789abcdef";var Zs=Math.floor;var Ks=Math.random;var Xs=function(){var t="#";for(var e=0;e<6;e++){t+=Gs.charAt(Zs(Ks()*16))}return new Vs(t,"hex")};var qs=t;var Js=Math.log;var $s=Math.pow;var Qs=Math.floor;var to=Math.abs;var eo=function(t,e){if(e===void 0)e=null;var r={min:Number.MAX_VALUE,max:Number.MAX_VALUE*-1,sum:0,values:[],count:0};if(qs(t)==="object"){t=Object.values(t)}t.forEach(function(t){if(e&&qs(t)==="object"){t=t[e]}if(t!==undefined&&t!==null&&!isNaN(t)){r.values.push(t);r.sum+=t;if(tr.max){r.max=t}r.count+=1}});r.domain=[r.min,r.max];r.limits=function(t,e){return ro(r,t,e)};return r};var ro=function(t,e,r){if(e===void 0)e="equal";if(r===void 0)r=7;if(qs(t)=="array"){t=eo(t)}var i=t.min;var n=t.max;var s=t.values.sort(function(t,e){return t-e});if(r===1){return[i,n]}var o=[];if(e.substr(0,1)==="c"){o.push(i);o.push(n)}if(e.substr(0,1)==="e"){o.push(i);for(var a=1;a 0")}var u=Math.LOG10E*Js(i);var L=Math.LOG10E*Js(n);o.push(i);for(var l=1;l200){m=false}}var B={};for(var R=0;Ri?(r+.05)/(i+.05):(i+.05)/(r+.05)};var oo=n;var N=Math.sqrt;var U=Math.pow;var ao=Math.min;var uo=Math.max;var lo=Math.atan2;var fo=Math.abs;var z=Math.cos;var ho=Math.sin;var co=Math.exp;var po=Math.PI;var go=function(t,e,r,i,n){if(r===void 0)r=1;if(i===void 0)i=1;if(n===void 0)n=1;var s=function(t){return 360*t/(2*po)};var o=function(t){return 2*po*t/360};t=new oo(t);e=new oo(e);var a=Array.from(t.lab());var u=a[0];var l=a[1];var f=a[2];var h=Array.from(e.lab());var c=h[0];var d=h[1];var p=h[2];var g=(u+c)/2;var y=N(U(l,2)+U(f,2));var m=N(U(d,2)+U(p,2));var b=(y+m)/2;var v=.5*(1-N(U(b,7)/(U(b,7)+U(25,7))));var w=l*(1+v);var x=d*(1+v);var _=N(U(w,2)+U(f,2));var C=N(U(x,2)+U(p,2));var T=(_+C)/2;var S=s(lo(f,w));var k=s(lo(p,x));var A=S>=0?S:S+360;var E=k>=0?k:k+360;var B=fo(A-E)>180?(A+E+360)/2:(A+E)/2;var R=1-.17*z(o(B-30))+.24*z(o(2*B))+.32*z(o(3*B+6))-.2*z(o(4*B-63));var O=E-A;O=fo(O)<=180?O:E<=A?O+360:O-360;O=2*N(_*C)*ho(o(O)/2);var M=c-u;var I=C-_;var L=1+.015*U(g-50,2)/N(20+U(g-50,2));var P=1+.045*T;var j=1+.015*T*R;var D=30*co(-U((B-275)/25,2));var F=2*N(U(T,7)/(U(T,7)+U(25,7)));var W=-F*ho(2*o(D));var H=N(U(M/(r*L),2)+U(I/(i*P),2)+U(O/(n*j),2)+W*(I/(i*P))*(O/(n*j)));return uo(0,ao(100,H))};var yo=n;var mo=function(t,e,r){if(r===void 0)r="lab";t=new yo(t);e=new yo(e);var i=t.get(r);var n=e.get(r);var s=0;for(var o in i){var a=(i[o]||0)-(n[o]||0);s+=a*a}return Math.sqrt(s)};var bo=n;var vo=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];try{new(Function.prototype.bind.apply(bo,[null].concat(t)));return true}catch(t){return false}};var wo=o;var xo=xs;var _o={cool:function t(){return xo([wo.hsl(180,1,.9),wo.hsl(250,.7,.4)])},hot:function t(){return xo(["#000","#f00","#ff0","#fff"]).mode("rgb")}};var O={OrRd:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#b30000","#7f0000"],PuBu:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#045a8d","#023858"],BuPu:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#810f7c","#4d004b"],Oranges:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"],BuGn:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#006d2c","#00441b"],YlOrBr:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#993404","#662506"],YlGn:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"],Reds:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"],RdPu:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177","#49006a"],Greens:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"],YlGnBu:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#253494","#081d58"],Purples:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"],GnBu:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#0868ac","#084081"],Greys:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"],YlOrRd:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#bd0026","#800026"],PuRd:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#980043","#67001f"],Blues:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"],PuBuGn:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016c59","#014636"],Viridis:["#440154","#482777","#3f4a8a","#31678e","#26838f","#1f9d8a","#6cce5a","#b6de2b","#fee825"],Spectral:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"],RdYlGn:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"],RdBu:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"],PiYG:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"],PRGn:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"],RdYlBu:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],BrBG:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"],RdGy:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"],PuOr:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"],Set2:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494","#b3b3b3"],Accent:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17","#666666"],Set1:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf","#999999"],Set3:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5","#ffed6f"],Dark2:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d","#666666"],Paired:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99","#b15928"],Pastel2:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc","#cccccc"],Pastel1:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec","#f2f2f2"]};for(var Co=0,To=Object.keys(O);Co0){throw new Error("cwise: pre() block may not reference array args")}if(i0){throw new Error("cwise: post() block may not reference array args")}}else if(n==="scalar"){e.scalarArgs.push(i);e.shimArgs.push("scalar"+i)}else if(n==="index"){e.indexArgs.push(i);if(i0){throw new Error("cwise: pre() block may not reference array index")}if(i0){throw new Error("cwise: post() block may not reference array index")}}else if(n==="shape"){e.shapeArgs.push(i);if(ir.length){throw new Error("cwise: Too many arguments in pre() block")}if(e.body.args.length>r.length){throw new Error("cwise: Too many arguments in body() block")}if(e.post.args.length>r.length){throw new Error("cwise: Too many arguments in post() block")}e.debug=!!t.printCode||!!t.debug;e.funcName=t.funcName||"cwise";e.blockSize=t.blockSize||64;return s(e)}e.exports=i},{"./lib/thunk.js":67}],66:[function(t,e,r){"use strict";var T=t("uniq");function S(t,e,r){var i=t.length,n=e.arrayArgs.length,s=e.indexArgs.length>0,o=[],a=[],u=0,l=0,f,h;for(f=0;f0){o.push("var "+a.join(","))}for(f=i-1;f>=0;--f){u=t[f];o.push(["for(i",f,"=0;i",f,"0){o.push(["index[",l,"]-=s",l].join(""))}o.push(["++index[",u,"]"].join(""))}o.push("}")}return o.join("\n")}function k(t,e,r,i){var n=e.length,s=r.arrayArgs.length,o=r.blockSize,a=r.indexArgs.length>0,u=[];for(var l=0;l0;){"].join(""));u.push(["if(j",l,"<",o,"){"].join(""));u.push(["s",e[l],"=j",l].join(""));u.push(["j",l,"=0"].join(""));u.push(["}else{s",e[l],"=",o].join(""));u.push(["j",l,"-=",o,"}"].join(""));if(a){u.push(["index[",e[l],"]=j",l].join(""))}}for(var l=0;l0){r=r&&e[i]===e[i-1]}}if(r){return e[0]}return e.join("")}function i(t,e){var r=e[1].length-Math.abs(t.arrayBlockIndices[0])|0;var i=new Array(t.arrayArgs.length);var n=new Array(t.arrayArgs.length);for(var s=0;s0){g.push("shape=SS.slice(0)")}if(t.indexArgs.length>0){var y=new Array(r);for(var s=0;s0){p.push("var "+g.join(","))}for(var s=0;s3){p.push(E(t.pre,t,n))}var w=E(t.body,t,n);var x=A(f);if(x3){p.push(E(t.post,t,n))}if(t.debug){console.log("-----Generated cwise routine for ",e,":\n"+p.join("\n")+"\n----------")}var _=[t.funcName||"unnamed","_cwise_loop_",i[0].join("s"),"m",x,B(n)].join("");var C=new Function(["function ",_,"(",d.join(","),"){",p.join("\n"),"} return ",_].join(""));return C()}e.exports=i},{uniq:140}],67:[function(t,e,r){"use strict";var c=t("./compile.js");function i(t){var e=["'use strict'","var CACHED={}"];var r=[];var i=t.funcName+"_cwise_thunk";e.push(["return function ",i,"(",t.shimArgs.join(","),"){"].join(""));var n=[];var s=[];var o=[["array",t.arrayArgs[0],".shape.slice(",Math.max(0,t.arrayBlockIndices[0]),t.arrayBlockIndices[0]<0?","+t.arrayBlockIndices[0]+")":")"].join("")];var a=[],u=[];for(var l=0;l0){a.push("array"+t.arrayArgs[0]+".shape.length===array"+f+".shape.length+"+(Math.abs(t.arrayBlockIndices[0])-Math.abs(t.arrayBlockIndices[l])));u.push("array"+t.arrayArgs[0]+".shape[shapeIndex+"+Math.max(0,t.arrayBlockIndices[0])+"]===array"+f+".shape[shapeIndex+"+Math.max(0,t.arrayBlockIndices[l])+"]")}}if(t.arrayArgs.length>1){e.push("if (!("+a.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same dimensionality!')");e.push("for(var shapeIndex=array"+t.arrayArgs[0]+".shape.length-"+Math.abs(t.arrayBlockIndices[0])+"; shapeIndex--\x3e0;) {");e.push("if (!("+u.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same shape!')");e.push("}")}for(var l=0;l0&&!t[o-1])o--;i.push({children:[],index:0});var a=i[0],u;for(n=0;n0){if(i.length===0)throw new Error("Could not recreate Huffman Table");a=i.pop()}a.index++;i.push(a);while(i.length<=n){i.push(u={children:[],index:0});a.children[a.index]=u.children;a=u}r++}if(n+10){p--;return u>>p&1}u=e[r++];if(u==255){var t=e[r++];if(t){throw new Error("unexpected marker: "+(u<<8|t).toString(16))}}p=7;return u>>>7}function y(t){var e=t,r;while((r=g())!==null){e=e[r];if(typeof e==="number")return e;if(typeof e!=="object")throw new Error("invalid huffman sequence")}return null}function m(t){var e=0;while(t>0){var r=g();if(r===null)return;e=e<<1|r;t--}return e}function b(t){var e=m(t);if(e>=1<>4;if(o===0){if(a<15)break;n+=16;continue}n+=a;var u=tt[n];e[u]=b(o);n++}}function w(t,e){var r=y(t.huffmanTableDC);var i=r===0?0:b(r)<0){x--;return}var r=l,i=f;while(r<=i){var n=y(t.huffmanTableAC);var s=n&15,o=n>>4;if(s===0){if(o<15){x=m(o)+(1<>4;if(u===0){if(n<15){x=m(n)+(1<=65488&&M<=65495){r+=2}else break}return r-a}function it(t,b){var e=[];var r=b.blocksPerLine;var i=b.blocksPerColumn;var n=r<<3;var s=new Int32Array(64),o=new Uint8Array(64);function a(t,e,r){var i=b.quantizationTable;var n,s,o,a,u,l,f,h,c;var d=r;var p;for(p=0;p<64;p++)d[p]=t[p]*i[p];for(p=0;p<8;++p){var g=8*p;if(d[1+g]==0&&d[2+g]==0&&d[3+g]==0&&d[4+g]==0&&d[5+g]==0&&d[6+g]==0&&d[7+g]==0){c=S*d[0+g]+512>>10;d[0+g]=c;d[1+g]=c;d[2+g]=c;d[3+g]=c;d[4+g]=c;d[5+g]=c;d[6+g]=c;d[7+g]=c;continue}n=S*d[0+g]+128>>8;s=S*d[4+g]+128>>8;o=d[2+g];a=d[6+g];u=k*(d[1+g]-d[7+g])+128>>8;h=k*(d[1+g]+d[7+g])+128>>8;l=d[3+g]<<4;f=d[5+g]<<4;c=n-s+1>>1;n=n+s+1>>1;s=c;c=o*T+a*C+128>>8;o=o*C-a*T+128>>8;a=c;c=u-f+1>>1;u=u+f+1>>1;f=c;c=h+l+1>>1;l=h-l+1>>1;h=c;c=n-a+1>>1;n=n+a+1>>1;a=c;c=s-o+1>>1;s=s+o+1>>1;o=c;c=u*_+h*x+2048>>12;u=u*x-h*_+2048>>12;h=c;c=l*w+f*v+2048>>12;l=l*v-f*w+2048>>12;f=c;d[0+g]=n+h;d[7+g]=n-h;d[1+g]=s+f;d[6+g]=s-f;d[2+g]=o+l;d[5+g]=o-l;d[3+g]=a+u;d[4+g]=a-u}for(p=0;p<8;++p){var y=p;if(d[1*8+y]==0&&d[2*8+y]==0&&d[3*8+y]==0&&d[4*8+y]==0&&d[5*8+y]==0&&d[6*8+y]==0&&d[7*8+y]==0){c=S*r[p+0]+8192>>14;d[0*8+y]=c;d[1*8+y]=c;d[2*8+y]=c;d[3*8+y]=c;d[4*8+y]=c;d[5*8+y]=c;d[6*8+y]=c;d[7*8+y]=c;continue}n=S*d[0*8+y]+2048>>12;s=S*d[4*8+y]+2048>>12;o=d[2*8+y];a=d[6*8+y];u=k*(d[1*8+y]-d[7*8+y])+2048>>12;h=k*(d[1*8+y]+d[7*8+y])+2048>>12;l=d[3*8+y];f=d[5*8+y];c=n-s+1>>1;n=n+s+1>>1;s=c;c=o*T+a*C+2048>>12;o=o*C-a*T+2048>>12;a=c;c=u-f+1>>1;u=u+f+1>>1;f=c;c=h+l+1>>1;l=h-l+1>>1;h=c;c=n-a+1>>1;n=n+a+1>>1;a=c;c=s-o+1>>1;s=s+o+1>>1;o=c;c=u*_+h*x+2048>>12;u=u*x-h*_+2048>>12;h=c;c=l*w+f*v+2048>>12;l=l*v-f*w+2048>>12;f=c;d[0*8+y]=n+h;d[7*8+y]=n-h;d[1*8+y]=s+f;d[6*8+y]=s-f;d[2*8+y]=o+l;d[5*8+y]=o-l;d[3*8+y]=a+u;d[4*8+y]=a-u}for(p=0;p<64;++p){var m=128+(d[p]+8>>4);e[p]=m<0?0:m>255?255:m}}nt(n*i*8);var u,l;for(var f=0;f255?255:t}e.prototype={load:function t(e){var r=new XMLHttpRequest;r.open("GET",e,true);r.responseType="arraybuffer";r.onload=function(){var t=new Uint8Array(r.response||r.mozResponseArrayBuffer);this.parse(t);if(this.onload)this.onload()}.bind(this);r.send(null)},parse:function L(r){var t=this.opts.maxResolutionInMP*1e3*1e3;var i=0,D=r.length;function n(){var t=r[i]<<8|r[i+1];i+=2;return t}function e(){var t=n();var e=r.subarray(i,i+t-2);i+=e.length;return e}function s(t){var e=1,r=1;var i,n;for(n in t.components){if(t.components.hasOwnProperty(n)){i=t.components[n];if(e>4===0){for(m=0;m<64;m++){var x=tt[m];w[x]=r[i++]}}else if(v>>4===1){for(m=0;m<64;m++){var x=tt[m];w[x]=n()}}else throw new Error("DQT: invalid table spec");f[v&15]=w}break;case 65472:case 65473:case 65474:n();u={};u.extended=p===65473;u.progressive=p===65474;u.precision=r[i++];u.scanLines=n();u.samplesPerLine=n();u.components={};u.componentsOrder=[];var _=u.scanLines*u.samplesPerLine;if(_>t){var z=Math.ceil((_-t)/1e6);throw new Error(`maxResolutionInMP limit exceeded by ${z}MP`)}var Y=r[i++],C;var V=0,G=0;for(y=0;y>4;var S=r[i+1]&15;var Z=r[i+2];if(T<=0||S<=0){throw new Error("Invalid sampling factor, expected values above 0")}u.componentsOrder.push(C);u.components[C]={h:T,v:S,quantizationIdx:Z};i+=3}s(u);h.push(u);break;case 65476:var K=n();for(y=2;y>4===0?d:c)[k&15]=et(A,B)}break;case 65501:n();l=n();break;case 65500:n();n();break;case 65498:var X=n();var q=r[i++];var R=[],O;for(y=0;y>4];O.huffmanTableAC=c[M&15];R.push(O)}var J=r[i++];var $=r[i++];var I=r[i++];var Q=rt(r,i,u,R,l,J,$,I>>4,I&15,this.opts);i+=Q;break;case 65535:if(r[i]!==255){i--}break;default:if(r[i-3]==255&&r[i-2]>=192&&r[i-2]<=254){i-=3;break}else if(p===224||p==225){if(g!==-1){throw new Error(`first unknown JPEG marker at offset ${g.toString(16)}, second unknown JPEG marker ${p.toString(16)} at offset ${(i-1).toString(16)}`)}g=i-1;const j=n();if(r[i+j-2]===255){i+=j-2;break}}throw new Error("unknown JPEG marker "+p.toString(16))}p=n()}if(h.length!=1)throw new Error("only single frame JPEGs supported");for(var y=0;yn){var r=Math.ceil((e-n)/1024/1024);throw new Error(`maxMemoryUsageInMB limit exceeded by at least ${r}MB`)}i=e}e.resetMaxMemoryUsage=function(t){i=0;n=t};e.getBytesAllocated=function(){return i};e.requestMemoryAllocation=nt;return e}();if(typeof e!=="undefined"){e.exports=t}else if(typeof window!=="undefined"){window["jpeg-js"]=window["jpeg-js"]||{};window["jpeg-js"].decode=t}function t(t,e={}){var r={colorTransform:undefined,useTArray:false,formatAsRGBA:true,tolerantDecoding:true,maxResolutionInMP:100,maxMemoryUsageInMB:512};var i={...r,...e};var n=new Uint8Array(t);var s=new l;s.opts=i;l.resetMaxMemoryUsage(i.maxMemoryUsageInMB*1024*1024);s.parse(n);var o=i.formatAsRGBA?4:3;var a=s.width*s.height*o;try{l.requestMemoryAllocation(a);var u={width:s.width,height:s.height,exifBuffer:s.exifBuffer,data:i.useTArray?new Uint8Array(a):f.alloc(a)};if(s.comments.length>0){u["comments"]=s.comments}}catch(t){if(t instanceof RangeError){throw new Error("Could not allocate enough memory for the image. "+"Required: "+a)}if(t instanceof ReferenceError){if(t.message==="Buffer is not defined"){throw new Error("Buffer is not globally defined in this environment. "+"Consider setting useTArray to true")}}throw t}s.copyToImageData(u,i.formatAsRGBA);return u}}).call(this)}).call(this,t("buffer").Buffer)},{buffer:151}],72:[function(t,rt,e){(function(et){(function(){var tt=tt||function(t){return et.from(t).toString("base64")};function n(r){var e=this;var n=Math.round;var h=Math.floor;var c=new Array(64);var d=new Array(64);var T=new Array(64);var S=new Array(64);var k;var A;var E;var B;var w=new Array(65535);var x=new Array(65535);var Q=new Array(64);var _=new Array(64);var R=[];var O=0;var M=7;var I=new Array(64);var P=new Array(64);var j=new Array(64);var s=new Array(256);var L=new Array(2048);var i;var C=[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];var u=[0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0];var l=[0,1,2,3,4,5,6,7,8,9,10,11];var f=[0,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,125];var p=[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];var g=[0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0];var y=[0,1,2,3,4,5,6,7,8,9,10,11];var m=[0,0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,119];var b=[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 o(t){var e=[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];for(var r=0;r<64;r++){var i=h((e[r]*t+50)/100);if(i<1){i=1}else if(i>255){i=255}c[C[r]]=i}var n=[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];for(var s=0;s<64;s++){var o=h((n[s]*t+50)/100);if(o<1){o=1}else if(o>255){o=255}d[C[s]]=o}var a=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379];var u=0;for(var l=0;l<8;l++){for(var f=0;f<8;f++){T[u]=1/(c[C[u]]*a[l]*a[f]*8);S[u]=1/(d[C[u]]*a[l]*a[f]*8);u++}}}function t(t,e){var r=0;var i=0;var n=new Array;for(var s=1;s<=16;s++){for(var o=1;o<=t[s];o++){n[e[i]]=[];n[e[i]][0]=r;n[e[i]][1]=s;i++;r++}r*=2}return n}function a(){k=t(u,l);A=t(g,y);E=t(f,p);B=t(m,b)}function H(){var t=1;var e=2;for(var r=1;r<=15;r++){for(var i=t;i>0]=38470*t;L[t+512>>0]=7471*t+32768;L[t+768>>0]=-11059*t;L[t+1024>>0]=-21709*t;L[t+1280>>0]=32768*t+8421375;L[t+1536>>0]=-27439*t;L[t+1792>>0]=-5329*t}}function D(t){var e=t[0];var r=t[1]-1;while(r>=0){if(e&1<>8&255);v(t&255)}function U(t,L){var e,r,i,n,s,o,a,u;var l=0;var f;var h=8;var D=64;for(f=0;f0?j+.5|0:j-.5|0}return Q}function z(){F(65504);F(16);v(74);v(70);v(73);v(70);v(0);v(1);v(1);v(0);F(1);F(1);v(0);v(0)}function Y(t){if(!t)return;F(65505);if(t[0]===69&&t[1]===120&&t[2]===105&&t[3]===102){F(t.length+2)}else{F(t.length+5+2);v(69);v(120);v(105);v(102);v(0)}for(var e=0;e{if(typeof t!=="string")return;F(65534);var e=t.length;F(e+2);var r;for(r=0;r0&&_[p]==0;p--){}if(p==0){D(s);return r}var g=1;var y;while(g<=p){var m=g;for(;_[g]==0&&g<=p;++g){}var b=g-m;if(b>=u){y=b>>4;for(var v=1;v<=y;++v)D(o);b=b&15}a=32767+_[g];D(n[(b<<4)+x[a]]);D(w[a]);g++}if(p!=l){D(s)}return r}function q(){var t=String.fromCharCode;for(var e=0;e<256;e++){s[e]=t(e)}}this.encode=function(t,e){var r=(new Date).getTime();if(e)J(e);R=new Array;O=0;M=7;F(65496);z();K(t.comments);Y(t.exifBuffer);G();V(t.width,t.height);Z();X();var i=0;var n=0;var s=0;O=0;M=7;this.encode.displayName="_encode_";var o=t.data;var a=t.width;var u=t.height;var l=a*4;var f=a*3;var h,c=0;var d,p,g;var y,m,b,v,w;while(c>3;b=(w&7)*4;m=y+v*l+b;if(c+v>=u){m-=l*(c+1+v-u)}if(h+b>=l){m-=h+b-l+4}d=o[m++];p=o[m++];g=o[m++];I[w]=(L[d]+L[p+256>>0]+L[g+512>>0]>>16)-128;P[w]=(L[d+768>>0]+L[p+1024>>0]+L[g+1280>>0]>>16)-128;j[w]=(L[d+1280>>0]+L[p+1536>>0]+L[g+1792>>0]>>16)-128}i=W(I,T,i,k,E);n=W(P,S,n,A,B);s=W(j,S,s,A,B);h+=32}c+=8}if(M>=0){var x=[];x[1]=M+1;x[0]=(1<100){t=100}if(i==t)return;var e=0;if(t<50){e=Math.floor(5e3/t)}else{e=Math.floor(200-t*2)}o(e);i=t}function $(){var t=(new Date).getTime();if(!r)r=50;q();a();H();N();J(r);var e=(new Date).getTime()-t}$()}if(typeof rt!=="undefined"){rt.exports=t}else if(typeof window!=="undefined"){window["jpeg-js"]=window["jpeg-js"]||{};window["jpeg-js"].encode=t}function t(t,e){if(typeof e==="undefined")e=50;var r=new n(e);var i=r.encode(t,e);return{data:i,width:t.width,height:t.height}}function e(t){var e=typeof t=="string"?document.getElementById(t):t;var r=document.createElement("canvas");r.width=e.width;r.height=e.height;var i=r.getContext("2d");i.drawImage(e,0,0);return i.getImageData(0,0,r.width,r.height)}}).call(this)}).call(this,t("buffer").Buffer)},{buffer:151}],73:[function(t,e,r){"use strict";function s(t){if(!this||!(this instanceof s)){return new s(t)}this.require=t}e.exports=s;s.property=(e,r,i,n)=>{Object.defineProperty(e,r,{configurable:true,enumerable:!!n,get:function(){var t=i(e,r);Object.defineProperty(e,r,{configurable:true,enumerable:!!n,writable:false,value:t});return t}});return e};s.prototype.property=s.property;s.properties=(e,r,i)=>{Object.keys(r).forEach(t=>{s.property(e,t,r[t],i)});return e};s.prototype.properties=s.properties;s.instanceProperty=(t,e,r,i)=>{Object.defineProperty(t,e,{configurable:true,enumerable:!!i,get:function(){var t=r(this,e);Object.defineProperty(this,e,{configurable:true,enumerable:!!i,writable:false,value:t});return t}});return t};s.prototype.instanceProperty=s.instanceProperty;s.instanceProperties=(e,r,i)=>{Object.keys(r).forEach(t=>{s.property(e,t,r[t],i)});return e};s.prototype.instanceProperties=s.instanceProperties;s.value=t=>{var e=true,r;return function(){if(e){r=t();e=false}return r}};s.prototype.value=s.value;s.require=function(i,n){var s=true,o;return new Proxy(()=>{},{construct:(t,e)=>{if(s){o=i(n);s=false}return Reflect.construct(o,e)},apply:(t,e,r)=>{if(s){o=i(n);s=false}return Reflect.apply(o,e,r)},get:(t,e)=>{if(s){o=i(n);s=false}return Reflect.get(o,e)}})};s.prototype.require=function(t){return s.require(this.require,t)};s.requireProperty=function(e,r,i,n,s){Object.defineProperty(r,i,{configurable:true,enumerable:!!s,get:function(){var t=e(n);Object.defineProperty(r,i,{configurable:true,enumerable:!!s,writable:false,value:t});return t}});return r};s.prototype.requireProperty=function(t,e,r,i){return s.requireProperty(this.require,t,e,r,i)};s.requireProperties=function(e,r,i,n){Object.keys(i).forEach(t=>{s.requireProperty(e,r,t,i[t],n)});return r};s.prototype.requireProperties=function(t,e,r){return s.requireProperties(this.require,t,e,r)}},{}],74:[function(t,e,r){"use strict";var o=t("ndarray");var a=t("./doConvert.js");e.exports=function t(e,r){var i=[],n=e,s=1;while(Array.isArray(n)){i.push(n.length);s*=n.length;n=n[0]}if(i.length===0){return o()}if(!r){r=o(new Float64Array(s),i)}a(r,e);return r}},{"./doConvert.js":75,ndarray:76}],75:[function(t,e,r){e.exports=t("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:true,rvalue:false,count:1},{name:"_inline_1_arg1_",lvalue:false,rvalue:true,count:1},{name:"_inline_1_arg2_",lvalue:false,rvalue:true,count:4}],thisVars:[],localVars:["_inline_1_i","_inline_1_v"]},post:{body:"{}",args:[],thisVars:[],localVars:[]},funcName:"convert",blockSize:64})},{"cwise-compiler":65}],76:[function(t,e,r){var y=t("iota-array");var i=t("is-buffer");var n=typeof Float64Array!=="undefined";function s(t,e){return t[0]-e[0]}function m(){var t=this.stride;var e=new Array(t.length);var r;for(r=0;rMath.abs(this.stride[1]))?[1,0]:[0,1]}})")}else if(e===3){n.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];}}})")}}else{n.push("ORDER})")}}n.push("proto.set=function "+r+"_set("+a.join(",")+",v){");if(i){n.push("return this.data.set("+u+",v)}")}else{n.push("return this.data["+u+"]=v}")}n.push("proto.get=function "+r+"_get("+a.join(",")+"){");if(i){n.push("return this.data.get("+u+")}")}else{n.push("return this.data["+u+"]}")}n.push("proto.index=function "+r+"_index(",a.join(),"){return "+u+"}");n.push("proto.hi=function "+r+"_hi("+a.join(",")+"){return new "+r+"(this.data,"+o.map(function(t){return["(typeof i",t,"!=='number'||i",t,"<0)?this.shape[",t,"]:i",t,"|0"].join("")}).join(",")+","+o.map(function(t){return"this.stride["+t+"]"}).join(",")+",this.offset)}");var h=o.map(function(t){return"a"+t+"=this.shape["+t+"]"});var c=o.map(function(t){return"c"+t+"=this.stride["+t+"]"});n.push("proto.lo=function "+r+"_lo("+a.join(",")+"){var b=this.offset,d=0,"+h.join(",")+","+c.join(","));for(var d=0;d=0){d=i"+d+"|0;b+=c"+d+"*d;a"+d+"-=d}")}n.push("return new "+r+"(this.data,"+o.map(function(t){return"a"+t}).join(",")+","+o.map(function(t){return"c"+t}).join(",")+",b)}");n.push("proto.step=function "+r+"_step("+a.join(",")+"){var "+o.map(function(t){return"a"+t+"=this.shape["+t+"]"}).join(",")+","+o.map(function(t){return"b"+t+"=this.stride["+t+"]"}).join(",")+",c=this.offset,d=0,ceil=Math.ceil");for(var d=0;d=0){c=(c+this.stride["+d+"]*i"+d+")|0}else{a.push(this.shape["+d+"]);b.push(this.stride["+d+"])}")}n.push("var ctor=CTOR_LIST[a.length+1];return ctor(this.data,a,b,c)}");n.push("return function construct_"+r+"(data,shape,stride,offset){return new "+r+"(data,"+o.map(function(t){return"shape["+t+"]"}).join(",")+","+o.map(function(t){return"stride["+t+"]"}).join(",")+",offset)}");var s=new Function("CTOR_LIST","ORDER",n.join("\n"));return s(b[t],m)}function h(t){if(i(t)){return"buffer"}if(n){switch(Object.prototype.toString.call(t)){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"}}if(Array.isArray(t)){return"array"}return"generic"}var b={float32:[],float64:[],int8:[],int16:[],int32:[],uint8:[],uint16:[],uint32:[],array:[],uint8_clamped:[],bigint64:[],biguint64:[],buffer:[],generic:[]};(function(){for(var t in b){b[t].push(f(t,-1))}});function o(t,e,r,i){if(t===undefined){var n=b.array[0];return n([])}else if(typeof t==="number"){t=[t]}if(e===undefined){e=[t.length]}var s=e.length;if(r===undefined){r=new Array(s);for(var o=s-1,a=1;o>=0;--o){r[o]=a;a*=e[o]}}if(i===undefined){i=0;for(var o=0;o{this.listeners[t]=r.listeners[t].slice()});Object.keys(r.contexts).forEach(t=>{var e=r.contexts[t];this.contexts[t]={nice:e.nice,ready:true,status:e.status,serial:e.serial,scopes:{}}})}};f.initFrom=function(t){if(!t.__ngev){f.init.call(t)}Object.defineProperty(this,"__ngev",{configurable:true,value:new f.Internal(t.__ngev)})};f.mergeListeners=function(s){if(!this.__ngev){f.init.call(this)}var t=this.__ngev.listeners;this.__ngev.listeners={};Object.keys(t).forEach(t=>{this.__ngev.listeners[t]=[]});s.forEach(t=>{if(!t.__ngev){f.init.call(t)}Object.keys(t.__ngev.listeners).forEach(t=>{if(!this.__ngev.listeners[t]){this.__ngev.listeners[t]=[]}})});Object.keys(this.__ngev.listeners).forEach(e=>{var r,i,n=[];if(t[e]){t[e].forEach(t=>{for(r=0,i=s.length;r{t.__ngev.listeners[e].forEach(t=>{if(this.__ngev.listeners[e].indexOf(t)===-1&&n.indexOf(t)===-1){this.__ngev.listeners[e].push(t)}})})})};f.filterOutCallback=function(t,e){return t!==e};f.prototype.addListener=function(t,e,r){var i,n;if(!this.__ngev){f.init.call(this)}if(!this.__ngev.listeners[t]){this.__ngev.listeners[t]=[]}if(!t||typeof t!=="string"){throw new TypeError(".addListener(): argument #0 should be a non-empty string")}if(typeof e==="function"){i={};if(!r||typeof r!=="object"){r={}}}else if(r===true&&e&&typeof e==="object"){r=i=e;e=undefined}else{r=e;if(!r||typeof r!=="object"){throw new TypeError(".addListener(): a function or an object with a 'fn' property which value is a function should be provided")}e=undefined;i={}}i.fn=e||r.fn;i.id=r.id!==undefined?r.id:i.fn;if(r.unique){if(this.__ngev.listeners[t].find(t=>t.id===i.id)){return}}i.once=!!r.once;i.async=!!r.async;i.eventObject=!!r.eventObject;i.nice=r.nice!==undefined?Math.floor(r.nice):f.SYNC;i.priority=+r.priority||0;i.context=r.context&&(typeof r.context==="string"||typeof r.context==="object")?r.context:null;if(typeof i.fn!=="function"){throw new TypeError(".addListener(): a function or an object with a 'fn' property which value is a function should be provided")}if(typeof i.context==="string"){i.context=this.__ngev.contexts[i.context]||this.addListenerContext(i.context)}i.event=t;if(this.__ngev.listeners.newListener.length){n=this.__ngev.listeners.newListener.slice();this.__ngev.listeners[t].push(i);f.emitEvent({emitter:this,name:"newListener",args:[[i]],listeners:n});if(this.__ngev.states[t]){f.emitToOneListener(this.__ngev.states[t],i)}return this}this.__ngev.listeners[t].push(i);if(this.__ngev.hasListenerPriority){this.__ngev.listeners[t].sort((t,e)=>e.priority-t.priority)}if(this.__ngev.listeners[t].length===this.__ngev.maxListeners+1){s.emitWarning("Possible NextGenEvents memory leak detected. "+this.__ngev.listeners[t].length+" "+t+" listeners added. Use emitter.setMaxListeners() to increase limit",{type:"MaxListenersExceededWarning"})}if(this.__ngev.states[t]){f.emitToOneListener(this.__ngev.states[t],i)}return this};f.prototype.on=f.prototype.addListener;f.prototype.once=function(t,e,r){if(e&&typeof e==="object"){e.once=true}else if(r&&typeof r==="object"){r.once=true}else{r={once:true}}return this.addListener(t,e,r)};f.prototype.waitFor=function(t){return new Promise(e=>{this.addListener(t,t=>e(t),{once:true})})};f.prototype.waitForAll=function(t){return new Promise(e=>{this.addListener(t,(...t)=>e(t),{once:true})})};f.prototype.removeListener=function(t,e){if(!t||typeof t!=="string"){throw new TypeError(".removeListener(): argument #0 should be a non-empty string")}if(!this.__ngev){f.init.call(this)}var r=this.__ngev.listeners[t];if(!r||!r.length){return this}var i,n,s=0,o=r.length,a=this.__ngev.listeners.removeListener.length;if(a){n=[]}for(i=0;i=-n){e.emitter.__ngev.desync(f.listenerWrapper.bind(undefined,t,e,r,i,f.SYNC));return}}else{setTimeout(f.listenerWrapper.bind(undefined,t,e,r,i,f.SYNC),n);return}o=t=>{a.listenersDone++;if(t&&u&&!a.interrupt&&e.name!=="interrupt"){a.interrupt=t;if(a.callback){f.emitCallback(e)}e.emitter.emit("interrupt",a.interrupt)}else if(a.listenersDone>=a.listeners.length&&a.callback){f.emitCallback(e)}if(i){f.processScopeQueue(r,true,true)}};if(t.eventObject){t.fn(e,o)}else{s=t.fn(...e.args,o)}}else{if(n<0){if(l.recursions>=-n){e.emitter.__ngev.desync(f.listenerWrapper.bind(undefined,t,e,r,i,f.SYNC));return}}else{setTimeout(f.listenerWrapper.bind(undefined,t,e,r,i,f.SYNC),n);return}if(t.eventObject){t.fn(e)}else{s=t.fn(...e.args)}a.listenersDone++}if(s&&u&&!a.interrupt&&e.name!=="interrupt"){a.interrupt=s;if(a.callback){f.emitCallback(e)}e.emitter.emit("interrupt",a.interrupt)}else if(a.listenersDone>=a.listeners.length&&a.callback){f.emitCallback(e)}};var h=0;f.prototype.emit=function(...t){var e=f.createEvent(this,...t);return f.emitEvent(e)};f.prototype.emitIfListener=function(...t){var e=typeof t[0]==="number"?t[1]:t[0];if(!this.__ngev||!this.__ngev.listeners[e]||!this.__ngev.listeners[e].length){return null}var r=f.createEvent(this,...t);return f.emitEvent(r)};f.prototype.waitForEmit=function(...t){return new Promise(e=>{this.emit(...t,t=>e(t))})};f.createEvent=function(t,...e){var r={emitter:t,interrupt:null,master:null,sync:true};if(typeof e[0]==="number"){r.nice=Math.floor(e[0]);r.name=e[1];if(!r.name||typeof r.name!=="string"){throw new TypeError(".emit(): when argument #0 is a number, argument #1 should be a non-empty string")}if(typeof e[e.length-1]==="function"){r.callback=e[e.length-1];r.args=e.slice(2,-1)}else{r.args=e.slice(2)}}else{r.name=e[0];if(!r.name||typeof r.name!=="string"){throw new TypeError(".emit(): argument #0 should be an number or a non-empty string")}if(typeof e[e.length-1]==="function"){r.callback=e[e.length-1];r.args=e.slice(1,-1)}else{r.args=e.slice(1)}}return r};f.emitEvent=function(t){var e=t.emitter,r,i,n=0,s,o;if(!e.__ngev){f.init.call(e)}s=e.__ngev.states[t.name];if(s!==undefined){if(s&&t.args.length===s.args.length&&t.args.every((t,e)=>t===s.args[e])){return}e.__ngev.stateGroups[t.name].forEach(t=>{e.__ngev.states[t]=null});e.__ngev.states[t.name]=t}if(!e.__ngev.listeners[t.name]){e.__ngev.listeners[t.name]=[]}t.id=h++;t.listenersDone=0;if(t.nice===undefined||t.nice===null){t.nice=e.__ngev.nice}if(!t.listeners){t.listeners=e.__ngev.listeners[t.name].slice()}l.recursions++;t.depth=e.__ngev.depth++;o=[];try{for(r=0,i=t.listeners.length;r{var e=f.createEvent(...t);e.master=u;if(!e.emitter.__ngev){f.init.call(e.emitter)}if(!e.emitter.__ngev.listeners[e.name]){e.emitter.__ngev.listeners[e.name]=[]}e.listeners=e.emitter.__ngev.listeners[e.name].slice();e.id=h++;e.listeners.forEach(t=>o.push({event:e,listener:t}))});o.sort((t,e)=>e.listener.priority-t.listener.priority);l.recursions++;s=[];try{for(r=0,i=o.length;re(t.master.interrupt,t))}else{e(t.master.interrupt,t)}return}e=t.callback;delete t.callback;if(t.sync&&t.emitter.__ngev.nice!==f.SYNC){t.emitter.__ngev.desync(()=>{t.emitter.__ngev.depth--;e(t.interrupt,t)})}else{t.emitter.__ngev.depth--;e(t.interrupt,t)}};f.prototype.listeners=function(t){if(!t||typeof t!=="string"){throw new TypeError(".listeners(): argument #0 should be a non-empty string")}if(!this.__ngev){f.init.call(this)}if(!this.__ngev.listeners[t]){this.__ngev.listeners[t]=[]}return this.__ngev.listeners[t].slice()};f.listenerCount=function(t,e){if(!t||!(t instanceof f)){throw new TypeError(".listenerCount(): argument #0 should be an instance of NextGenEvents")}return t.listenerCount(e)};f.prototype.listenerCount=function(t){if(!t||typeof t!=="string"){throw new TypeError(".listenerCount(): argument #1 should be a non-empty string")}if(!this.__ngev||!this.__ngev.listeners[t]){return 0}return this.__ngev.listeners[t].length};f.prototype.setNice=function(t){if(!this.__ngev){f.init.call(this)}this.__ngev.nice=Math.floor(+t||0)};f.prototype.desyncUseNextTick=function(t){if(!this.__ngev){f.init.call(this)}this.__ngev.desync=t?r:e};f.prototype.setInterruptible=function(t){if(!this.__ngev){f.init.call(this)}this.__ngev.interruptible=!!t};f.prototype.setListenerPriority=function(t){if(!this.__ngev){f.init.call(this)}this.__ngev.hasListenerPriority=!!t};f.share=function(t,e){if(!(t instanceof f)||!(e instanceof f)){throw new TypeError("NextGenEvents.share() arguments should be instances of NextGenEvents")}if(!t.__ngev){f.init.call(t)}Object.defineProperty(e,"__ngev",{configurable:true,value:t.__ngev})};f.reset=function(t){Object.defineProperty(t,"__ngev",{configurable:true,value:null})};f.prototype.getMaxListeners=function(){if(!this.__ngev){f.init.call(this)}return this.__ngev.maxListeners};f.prototype.setMaxListeners=function(t){if(!this.__ngev){f.init.call(this)}this.__ngev.maxListeners=typeof t==="number"&&!Number.isNaN(t)?Math.floor(t):f.defaultMaxListeners;return this};f.noop=()=>undefined;f.prototype.defineStates=function(...e){if(!this.__ngev){f.init.call(this)}e.forEach(t=>{this.__ngev.states[t]=null;this.__ngev.stateGroups[t]=e})};f.prototype.hasState=function(t){if(!this.__ngev){f.init.call(this)}return!!this.__ngev.states[t]};f.prototype.getAllStates=function(){if(!this.__ngev){f.init.call(this)}return Object.keys(this.__ngev.states).filter(t=>this.__ngev.states[t])};f.groupAddListener=function(t,e,r,i){if(typeof r!=="function"){i=r;r=undefined}if(!i||typeof i!=="object"){i={}}r=r||i.fn;delete i.fn;i.id=i.id||r;t.forEach(t=>{t.addListener(e,r.bind(undefined,t),i)})};f.groupOn=f.groupAddListener;f.groupOnce=function(t,e,r,i){if(r&&typeof r==="object"){r.once=true}else if(i&&typeof i==="object"){i.once=true}else{i={once:true}}return this.groupAddListener(t,e,r,i)};f.groupWaitFor=function(t,e){return Promise.all(t.map(t=>t.waitFor(e)))};f.groupWaitForAll=function(t,e){return Promise.all(t.map(t=>t.waitForAll(e)))};f.groupOnceFirst=function(e,r,i,n){var s,o=false;if(typeof i!=="function"){n=i;i=undefined}if(!n||typeof n!=="object"){n={}}i=i||n.fn;delete n.fn;n.id=n.id||i;s=(...t)=>{if(o){return}o=true;f.groupRemoveListener(e,r,n.id);i(...t)};e.forEach(t=>{t.once(r,s.bind(undefined,t),n)})};f.groupWaitForFirst=function(t,r){return new Promise(e=>{f.groupOnceFirst(t,r,t=>e(t))})};f.groupWaitForFirstAll=function(t,r){return new Promise(e=>{f.groupOnceFirst(t,r,(...t)=>e(t))})};f.groupOnceLast=function(t,e,r,i){var n,s=false,o=t.length;if(typeof r!=="function"){i=r;r=undefined}if(!i||typeof i!=="object"){i={}}r=r||i.fn;delete i.fn;i.id=i.id||r;n=(...t)=>{if(s){return}if(--o){return}s=true;r(...t)};t.forEach(t=>{t.once(e,n.bind(undefined,t),i)})};f.groupWaitForLast=function(t,r){return new Promise(e=>{f.groupOnceLast(t,r,t=>e(t))})};f.groupWaitForLastAll=function(t,r){return new Promise(e=>{f.groupOnceLast(t,r,(...t)=>e(t))})};f.groupRemoveListener=function(t,e,r){t.forEach(t=>{t.removeListener(e,r)})};f.groupOff=f.groupRemoveListener;f.groupRemoveAllListeners=function(t,e){t.forEach(t=>{t.removeAllListeners(e)})};f.groupEmit=function(t,...e){var r,i,n=1,s,o=t.length,a,u,l=false;if(typeof e[e.length-1]==="function"){s=-1;a=e[e.length-1];u=t=>{if(l){return}if(t){l=true;a(t)}else if(!--o){l=true;a()}}}if(typeof e[0]==="number"){n=2;i=typeof e[0]}r=e[n-1];e=e.slice(n,s);t.forEach(t=>{f.emitEvent({emitter:t,name:r,args:e,nice:i,callback:u})})};f.groupWaitForEmit=function(t,...r){return new Promise(e=>{f.groupEmit(t,...r,t=>e(t))})};f.groupDefineStates=function(t,...e){t.forEach(t=>{t.defineStates(...e)})};f.groupGlobalOnce=f.groupOnceFirst;f.groupGlobalOnceAll=f.groupOnceLast;f.CONTEXT_ENABLED=0;f.CONTEXT_DISABLED=1;f.CONTEXT_QUEUED=2;f.prototype.addListenerContext=function(t,e){if(!this.__ngev){f.init.call(this)}if(!t||typeof t!=="string"){throw new TypeError(".addListenerContext(): argument #0 should be a non-empty string")}if(!e||typeof e!=="object"){e={}}var r=this.__ngev.contexts[t];if(!r){r=this.__ngev.contexts[t]={nice:f.SYNC,ready:true,status:f.CONTEXT_ENABLED,serial:false,scopes:{}}}if(e.nice!==undefined){r.nice=Math.floor(e.nice)}if(e.status!==undefined){r.status=e.status}if(e.serial!==undefined){r.serial=!!e.serial}return r};f.prototype.getListenerContext=function(t){return this.__ngev.contexts[t]};f.getContextScope=function(t,e){var r=t.scopes[e];if(!r){r=t.scopes[e]={ready:true,queue:[]}}return r};f.prototype.disableListenerContext=function(t){if(!this.__ngev){f.init.call(this)}if(!t||typeof t!=="string"){throw new TypeError(".disableListenerContext(): argument #0 should be a non-empty string")}if(!this.__ngev.contexts[t]){this.addListenerContext(t)}this.__ngev.contexts[t].status=f.CONTEXT_DISABLED;return this};f.prototype.enableListenerContext=function(t){if(!this.__ngev){f.init.call(this)}if(!t||typeof t!=="string"){throw new TypeError(".enableListenerContext(): argument #0 should be a non-empty string")}if(!this.__ngev.contexts[t]){this.addListenerContext(t)}var e=this.__ngev.contexts[t];e.status=f.CONTEXT_ENABLED;Object.values(e.scopes).forEach(t=>{if(t.queue.length>0){f.processScopeQueue(t,e.serial)}});return this};f.prototype.queueListenerContext=function(t){if(!this.__ngev){f.init.call(this)}if(!t||typeof t!=="string"){throw new TypeError(".queueListenerContext(): argument #0 should be a non-empty string")}if(!this.__ngev.contexts[t]){this.addListenerContext(t)}this.__ngev.contexts[t].status=f.CONTEXT_QUEUED;return this};f.prototype.serializeListenerContext=function(t,e){if(!this.__ngev){f.init.call(this)}if(!t||typeof t!=="string"){throw new TypeError(".serializeListenerContext(): argument #0 should be a non-empty string")}if(!this.__ngev.contexts[t]){this.addListenerContext(t)}this.__ngev.contexts[t].serial=e===undefined?true:!!e;return this};f.prototype.setListenerContextNice=function(t,e){if(!this.__ngev){f.init.call(this)}if(!t||typeof t!=="string"){throw new TypeError(".setListenerContextNice(): argument #0 should be a non-empty string")}if(!this.__ngev.contexts[t]){this.addListenerContext(t)}this.__ngev.contexts[t].nice=Math.floor(e);return this};f.prototype.destroyListenerContext=function(t){var e,r,i,n,s,o=[];if(!t||typeof t!=="string"){throw new TypeError(".disableListenerContext(): argument #0 should be a non-empty string")}if(!this.__ngev){f.init.call(this)}i=this.__ngev.contexts[t];if(!i){return}for(n in this.__ngev.listeners){s=null;r=this.__ngev.listeners[n].length;for(e=0;enew i(...t);i.prototype.addLocalService=function(t,e,r){this.localServices[t]=a.create(this,t,e,r);return this.localServices[t]};i.prototype.addRemoteService=function(t){this.remoteServices[t]=u.create(this,t);return this.remoteServices[t]};i.prototype.destroy=function(){Object.keys(this.localServices).forEach(t=>{this.localServices[t].destroy();delete this.localServices[t]});Object.keys(this.remoteServices).forEach(t=>{this.remoteServices[t].destroy();delete this.remoteServices[t]});this.receive=this.send=n};i.prototype.push=function(t){if(t.__type!==o||!t.service||typeof t.service!=="string"||!t.event||typeof t.event!=="string"||!t.method){return}switch(t.method){case"event":return this.remoteServices[t.service]&&this.remoteServices[t.service].receiveEvent(t);case"ackEmit":return this.remoteServices[t.service]&&this.remoteServices[t.service].receiveAckEmit(t);case"emit":return this.localServices[t.service]&&this.localServices[t.service].receiveEmit(t);case"listen":return this.localServices[t.service]&&this.localServices[t.service].receiveListen(t);case"ignore":return this.localServices[t.service]&&this.localServices[t.service].receiveIgnore(t);case"ackEvent":return this.localServices[t.service]&&this.localServices[t.service].receiveAckEvent(t);default:return}};i.prototype.receive=function(t){this.push(t)};i.prototype.send=function(){throw new Error("The send() method of the Proxy MUST be extended/overwritten")};function a(t,e,r,i){return a.create(t,e,r,i)}i.LocalService=a;a.create=function(t,e,r,i){var n=Object.create(a.prototype,{proxy:{value:t,enumerable:true},id:{value:e,enumerable:true},emitter:{value:r,writable:true,enumerable:true},internalEvents:{value:Object.create(s.prototype),writable:true,enumerable:true},events:{value:{},enumerable:true},canListen:{value:!!i.listen,writable:true,enumerable:true},canEmit:{value:!!i.emit,writable:true,enumerable:true},canAck:{value:!!i.ack,writable:true,enumerable:true},canRpc:{value:!!i.rpc,writable:true,enumerable:true},destroyed:{value:false,writable:true,enumerable:true}});return n};a.prototype.destroy=function(){Object.keys(this.events).forEach(t=>{this.emitter.off(t,this.events[t]);delete this.events[t]});this.emitter=null;this.destroyed=true};a.prototype.receiveEmit=function(e){if(this.destroyed||!this.canEmit||e.ack&&!this.canAck){return}var t={emitter:this.emitter,name:e.event,args:e.args||[]};if(e.ack){t.callback=t=>{this.proxy.send({__type:o,service:this.id,method:"ackEmit",ack:e.ack,event:e.event,interruption:t})}}s.emitEvent(t)};a.prototype.receiveListen=function(t){if(this.destroyed||!this.canListen||t.ack&&!this.canAck){return}if(t.ack){if(this.events[t.event]){if(this.events[t.event].ack){return}this.emitter.off(t.event,this.events[t.event])}this.events[t.event]=a.forwardWithAck.bind(this);this.events[t.event].ack=true;this.emitter.on(t.event,this.events[t.event],{eventObject:true,async:true})}else{if(this.events[t.event]){if(!this.events[t.event].ack){return}this.emitter.off(t.event,this.events[t.event])}this.events[t.event]=a.forward.bind(this);this.events[t.event].ack=false;this.emitter.on(t.event,this.events[t.event],{eventObject:true})}};a.prototype.receiveIgnore=function(t){if(this.destroyed||!this.canListen){return}if(!this.events[t.event]){return}this.emitter.off(t.event,this.events[t.event]);this.events[t.event]=null};a.prototype.receiveAckEvent=function(t){if(this.destroyed||!this.canListen||!this.canAck||!t.ack||!this.events[t.event]||!this.events[t.event].ack){return}this.internalEvents.emit("ack",t)};a.forward=function(t){if(this.destroyed){return}this.proxy.send({__type:o,service:this.id,method:"event",event:t.name,args:t.args})};a.forward.ack=false;a.forwardWithAck=function(t,e){if(this.destroyed){return}if(!t.callback){this.proxy.send({__type:o,service:this.id,method:"event",event:t.name,args:t.args});e();return}var r=false;var i=this.proxy.nextAckId++;var n=t=>{if(r||t.ack!==i){return}r=true;this.internalEvents.off("ack",n);e()};this.internalEvents.on("ack",n);this.proxy.send({__type:o,service:this.id,method:"event",event:t.name,ack:i,args:t.args})};a.forwardWithAck.ack=true;function u(t,e){return u.create(t,e)}i.RemoteService=u;var l=1;var f=2;u.create=function(t,e){var r=Object.create(u.prototype,{proxy:{value:t,enumerable:true},id:{value:e,enumerable:true},emitter:{value:Object.create(s.prototype),writable:true,enumerable:true},internalEvents:{value:Object.create(s.prototype),writable:true,enumerable:true},events:{value:{},enumerable:true},destroyed:{value:false,writable:true,enumerable:true}});return r};u.prototype.destroy=function(){this.emitter.removeAllListeners();this.emitter=null;Object.keys(this.events).forEach(t=>{delete this.events[t]});this.destroyed=true};u.prototype.emit=function(t,...e){if(this.destroyed){return}var r,i,n;if(typeof t==="number"){throw new TypeError("Cannot emit with a nice value on a remote service")}if(typeof e[e.length-1]!=="function"){this.proxy.send({__type:o,service:this.id,method:"emit",event:t,args:e});return}r=e.pop();i=this.proxy.nextAckId++;n=false;var s=t=>{if(n||t.ack!==i){return}n=true;this.internalEvents.off("ack",s);r(t.interruption)};this.internalEvents.on("ack",s);this.proxy.send({__type:o,service:this.id,method:"emit",ack:i,event:t,args:e})};u.prototype.addListener=function(t,e,r){if(this.destroyed){return}if(typeof e!=="function"){r=e;e=undefined}if(!r||typeof r!=="object"){r={}}r.fn=e||r.fn;this.emitter.addListener(t,r);if(!this.emitter.__ngev.listeners[t]||!this.emitter.__ngev.listeners[t].length){return}if(r.async&&this.events[t]!==f){this.events[t]=f;this.proxy.send({__type:o,service:this.id,method:"listen",ack:true,event:t})}else if(!r.async&&!this.events[t]){this.events[t]=l;this.proxy.send({__type:o,service:this.id,method:"listen",event:t})}};u.prototype.on=u.prototype.addListener;u.prototype.once=s.prototype.once;u.prototype.removeListener=function(t,e){if(this.destroyed){return}this.emitter.removeListener(t,e);if((!this.emitter.__ngev.listeners[t]||!this.emitter.__ngev.listeners[t].length)&&this.events[t]){this.events[t]=0;this.proxy.send({__type:o,service:this.id,method:"ignore",event:t})}};u.prototype.off=u.prototype.removeListener;u.prototype.receiveEvent=function(t){if(this.destroyed||!this.events[t.event]){return}var e={emitter:this.emitter,name:t.event,args:t.args||[]};if(t.ack){e.callback=()=>{this.proxy.send({__type:o,service:this.id,method:"ackEvent",ack:t.ack,event:t.event})}}s.emitEvent(e);var r=e.name;if(!this.emitter.__ngev.listeners[r]||!this.emitter.__ngev.listeners[r].length){this.events[r]=0;this.proxy.send({__type:o,service:this.id,method:"ignore",event:r})}};u.prototype.receiveAckEmit=function(t){if(this.destroyed||!t.ack||this.events[t.event]!==f){return}this.internalEvents.emit("ack",t)}},{"./NextGenEvents.js":77}],79:[function(t,e,r){e.exports={name:"nextgen-events",version:"1.5.2",description:"The next generation of events handling for javascript! New: abstract away the network!",main:"lib/NextGenEvents.js",engines:{node:">=6.0.0"},directories:{test:"test",bench:"bench"},dependencies:{},devDependencies:{browserify:"^17.0.0","uglify-js-es6":"^2.8.9",ws:"^7.4.6"},scripts:{test:"tea-time -R dot"},repository:{type:"git",url:"https://github.com/cronvel/nextgen-events.git"},keywords:["events","async","emit","listener","context","series","serialize","namespace","proxy","network"],author:"Cédric Ronvel",license:"MIT",bugs:{url:"https://github.com/cronvel/nextgen-events/issues"},config:{"tea-time":{coverDir:["lib"]}},copyright:{title:"Next-Gen Events",years:[2015,2021],owner:"Cédric Ronvel"}}},{}],80:[function(t,e,r){e.exports=t("./lib/bitmap")},{"./lib/bitmap":81}],81:[function(t,e,r){(function(o){(function(){var t=e.exports=r=function(t){this.buffer=t;this.initialized=false;this.fileHeader=null;this.infoHeader=null;this.coreHeader=null;this.colorPalette=null;this.dataPos=-1};t.prototype.CORE_TYPE_WINDOWS_V3=40;t.prototype.CORE_TYPE_WINDOWS_V4=108;t.prototype.CORE_TYPE_WINDOWS_V5=124;t.prototype.CORE_TYPE_OS2_V1=12;t.prototype.CORE_TYPE_OS2_V2=64;t.prototype.BITMAPCOREHEADER=t.prototype.CORE_TYPE_OS2_V1;t.prototype.BITMAPINFOHEADER=t.prototype.CORE_TYPE_WINDOWS_V3;t.prototype.BITMAPINFOHEADER2=t.prototype.CORE_TYPE_OS2_V2;t.prototype.BITMAPV4HEADER=t.prototype.CORE_TYPE_WINDOWS_V4;t.prototype.BITMAPV5HEADER=t.prototype.CORE_TYPE_WINDOWS_V5;t.prototype.COMPRESSION_BI_RGB=0;t.prototype.COMPRESSION_BI_RLE8=1;t.prototype.COMPRESSION_BI_RLE4=2;t.prototype.COMPRESSION_BI_BITFIELDS=3;t.prototype.COMPRESSION_BI_JPEG=4;t.prototype.COMPRESSION_BI_PNG=5;t.prototype.BITCOUNT_2=1;t.prototype.BITCOUNT_16=4;t.prototype.BITCOUNT_256=8;t.prototype.BITCOUNT_16bit=16;t.prototype.BITCOUNT_24bit=24;t.prototype.BITCOUNT_32bit=32;t.prototype.init=function(){this.readFileHeader();this.readInfoHeader();this.readCoreHeader();this.readColorPalette();this.initDataPos();this.initialized=true};t.prototype.checkInit=function(){if(!this.initialized){throw new Error("not initialized")}};t.prototype.isBitmap=function(){this.checkInit();if("BM"==this.fileHeader.bfType){return true}return false};t.prototype.getData=function(){this.checkInit();if(this.COMPRESSION_BI_RGB!==this.coreHeader.__copmression__){throw new Error("not supported compression: "+this.coreHeader.__copmression__)}var t=this.coreHeader.__bitCount__;var e=this.getWidth();var r=this.getHeight();var i=e*t/8;if(0!=i%4){i=(i/4+1)*4}var n=[];var s=this.dataPos;for(var o=0;o65535||e>65535)throw new Error("Width/Height invalid.");function w(t){var e=t.length;if(e<2||e>256||e&e-1){throw new Error("Invalid code/color length, must be power of 2 and 2 .. 256.")}return e}m[b++]=71;m[b++]=73;m[b++]=70;m[b++]=56;m[b++]=57;m[b++]=97;var n=0;var s=0;if(v!==null){var o=w(v);while(o>>=1)++n;o=1<=o)throw new Error("Background index out of range.");if(s===0)throw new Error("Background index explicitly passed as 0.")}}m[b++]=t&255;m[b++]=t>>8&255;m[b++]=e&255;m[b++]=e>>8&255;m[b++]=(v!==null?128:0)|n;m[b++]=s;m[b++]=0;if(v!==null){for(var a=0,u=v.length;a>16&255;m[b++]=l>>8&255;m[b++]=l&255}}if(i!==null){if(i<0||i>65535)throw new Error("Loop count invalid.");m[b++]=33;m[b++]=255;m[b++]=11;m[b++]=78;m[b++]=69;m[b++]=84;m[b++]=83;m[b++]=67;m[b++]=65;m[b++]=80;m[b++]=69;m[b++]=50;m[b++]=46;m[b++]=48;m[b++]=3;m[b++]=1;m[b++]=i&255;m[b++]=i>>8&255;m[b++]=0}var x=false;this.addFrame=function(t,e,r,i,n,s){if(x===true){--b;x=false}s=s===undefined?{}:s;if(t<0||e<0||t>65535||e>65535)throw new Error("x/y invalid.");if(r<=0||i<=0||r>65535||i>65535)throw new Error("Width/Height invalid.");if(n.length>=1)++l;u=1<3)throw new Error("Disposal out of range.");var c=false;var d=0;if(s.transparent!==undefined&&s.transparent!==null){c=true;d=s.transparent;if(d<0||d>=u)throw new Error("Transparent color index.")}if(h!==0||c||f!==0){m[b++]=33;m[b++]=249;m[b++]=4;m[b++]=h<<2|(c===true?1:0);m[b++]=f&255;m[b++]=f>>8&255;m[b++]=d;m[b++]=0}m[b++]=44;m[b++]=t&255;m[b++]=t>>8&255;m[b++]=e&255;m[b++]=e>>8&255;m[b++]=r&255;m[b++]=r>>8&255;m[b++]=i&255;m[b++]=i>>8&255;m[b++]=o===true?128|l-1:0;if(o===true){for(var p=0,g=a.length;p>16&255;m[b++]=y>>8&255;m[b++]=y&255}}b=_(m,b,l<2?2:l,n);return b};this.end=function(){if(x===false){m[b++]=59;x=true}return b};this.getOutputBuffer=function(){return m};this.setOutputBuffer=function(t){m=t};this.getOutputBufferPosition=function(){return b};this.setOutputBufferPosition=function(t){b=t}}function _(e,r,t,i){e[r++]=t;var n=r++;var s=1<=t){e[r++]=h&255;h>>=8;f-=8;if(r===n+256){e[n]=255;n=r++}}}function d(t){h|=t<=8){e[r++]=h&255;h>>=8;f-=8;if(r===n+256){e[n]=255;n=r++}}if(u===4096){d(s);u=a+1;l=t+1;g={}}else{if(u>=1<>7;var n=r&7;var s=1<=0))throw Error("Invalid block size");if(g===0)break;t+=g}}break;case 249:if(x[t++]!==4||x[t+4]!==0)throw new Error("Invalid graphics extension block.");var y=x[t++];h=x[t++]|x[t++]<<8;c=x[t++];if((y&1)===0)c=null;d=y>>2&7;t++;break;case 254:while(true){var g=x[t++];if(!(g>=0))throw Error("Invalid block size");if(g===0)break;t+=g}break;default:throw new Error("Unknown graphic control label: 0x"+x[t-1].toString(16))}break;case 44:var m=x[t++]|x[t++]<<8;var b=x[t++]|x[t++]<<8;var v=x[t++]|x[t++]<<8;var w=x[t++]|x[t++]<<8;var C=x[t++];var T=C>>7;var S=C>>6&1;var k=C&7;var A=1<=0))throw Error("Invalid block size");if(g===0)break;t+=g}f.push({x:m,y:b,width:v,height:w,has_local_palette:R,palette_offset:E,palette_size:B,data_offset:O,data_length:t-O,transparent_index:c,interlaced:!!S,delay:h,disposal:d});break;case 59:l=false;break;default:throw new Error("Unknown gif block: 0x"+x[t-1].toString(16));break}}this.numFrames=function(){return f.length};this.loopCount=function(){return p};this.frameInfo=function(t){if(t<0||t>=f.length)throw new Error("Frame index out of range.");return f[t]};this.decodeAndBlitFrameBGRA=function(t,e){var r=this.frameInfo(t);var i=r.width*r.height;var n=new Uint8Array(i);M(x,r.data_offset,n,i);var s=r.palette_offset;var o=r.transparent_index;if(o===null)o=256;var a=r.width;var u=_-a;var l=a;var f=(r.y*_+r.x)*4;var h=((r.y+r.height)*_+r.x)*4;var c=f;var d=u*4;if(r.interlaced===true){d+=_*4*7}var p=8;for(var g=0,y=n.length;g=h){d=u*4+_*4*(p-1);c=f+(a+u)*(p<<1);p>>=1}}if(m===o){c+=4}else{var b=x[s+m*3];var v=x[s+m*3+1];var w=x[s+m*3+2];e[c++]=w;e[c++]=v;e[c++]=b;e[c++]=255}--l}};this.decodeAndBlitFrameRGBA=function(t,e){var r=this.frameInfo(t);var i=r.width*r.height;var n=new Uint8Array(i);M(x,r.data_offset,n,i);var s=r.palette_offset;var o=r.transparent_index;if(o===null)o=256;var a=r.width;var u=_-a;var l=a;var f=(r.y*_+r.x)*4;var h=((r.y+r.height)*_+r.x)*4;var c=f;var d=u*4;if(r.interlaced===true){d+=_*4*7}var p=8;for(var g=0,y=n.length;g=h){d=u*4+_*4*(p-1);c=f+(a+u)*(p<<1);p>>=1}}if(m===o){c+=4}else{var b=x[s+m*3];var v=x[s+m*3+1];var w=x[s+m*3+2];e[c++]=b;e[c++]=v;e[c++]=w;e[c++]=255}--l}}}function M(t,e,r,i){var n=t[e++];var s=1<>=u;f-=u;if(y===s){a=o+1;u=n+1;l=(1<s){v=p[v]>>8;++b}var w=v;var x=c+b+(m!==y?1:0);if(x>i){console.log("Warning, gif stream longer than expected.");return}r[c++]=w;c+=b;var _=c;if(m!==y)r[c++]=w;v=m;while(b--){v=p[v];r[--_]=v&255;v>>=8}if(g!==null&&a<4096){p[a++]=g<<8|w;if(a>=l+1&&u<12){++u;l=l<<1|1}}g=y}if(c!==i){console.log("Warning, gif stream shorter than expected.")}return r}try{r.GifWriter=i;r.GifReader=n}catch(t){}},{}],83:[function(t,e,r){(function(m){(function(){"use strict";let d=t("./interlace");let f=[function(){},function(t,e,r,i){if(i===e.length){throw new Error("Ran out of data")}let n=e[i];t[r]=n;t[r+1]=n;t[r+2]=n;t[r+3]=255},function(t,e,r,i){if(i+1>=e.length){throw new Error("Ran out of data")}let n=e[i];t[r]=n;t[r+1]=n;t[r+2]=n;t[r+3]=e[i+1]},function(t,e,r,i){if(i+2>=e.length){throw new Error("Ran out of data")}t[r]=e[i];t[r+1]=e[i+1];t[r+2]=e[i+2];t[r+3]=255},function(t,e,r,i){if(i+3>=e.length){throw new Error("Ran out of data")}t[r]=e[i];t[r+1]=e[i+1];t[r+2]=e[i+2];t[r+3]=e[i+3]}];let h=[function(){},function(t,e,r,i){let n=e[0];t[r]=n;t[r+1]=n;t[r+2]=n;t[r+3]=i},function(t,e,r){let i=e[0];t[r]=i;t[r+1]=i;t[r+2]=i;t[r+3]=e[1]},function(t,e,r,i){t[r]=e[0];t[r+1]=e[1];t[r+2]=e[2];t[r+3]=i},function(t,e,r){t[r]=e[0];t[r+1]=e[1];t[r+2]=e[2];t[r+3]=e[3]}];function p(l,f){let h=[];let c=0;function r(){if(c===l.length){throw new Error("Ran out of data")}let t=l[c];c++;let e,r,i,n,s,o,a,u;switch(f){default:throw new Error("unrecognised depth");case 16:a=l[c];c++;h.push((t<<8)+a);break;case 4:a=t&15;u=t>>4;h.push(u,a);break;case 2:s=t&3;o=t>>2&3;a=t>>4&3;u=t>>6&3;h.push(u,a,o,s);break;case 1:e=t&1;r=t>>1&1;i=t>>2&1;n=t>>3&1;s=t>>4&1;o=t>>5&1;a=t>>6&1;u=t>>7&1;h.push(u,a,o,s,n,i,r,e);break}}return{get:function(t){while(h.length0){this._paused=false;this.emit("drain")}}.bind(this))};r.prototype.write=function(t,e){if(!this.writable){this.emit("error",new Error("Stream not writable"));return false}let r;if(o.isBuffer(t)){r=t}else{r=o.from(t,e||this._encoding)}this._buffers.push(r);this._buffered+=r.length;this._process();if(this._reads&&this._reads.length===0){this._paused=true}return this.writable&&!this._paused};r.prototype.end=function(t,e){if(t){this.write(t,e)}this.writable=false;if(!this._buffers){return}if(this._buffers.length===0){this._end()}else{this._buffers.push(null);this._process()}};r.prototype.destroySoon=r.prototype.end;r.prototype._end=function(){if(this._reads.length>0){this.emit("error",new Error("Unexpected end of input"))}this.destroy()};r.prototype.destroy=function(){if(!this._buffers){return}this.writable=false;this._reads=null;this._buffers=null;this.emit("close")};r.prototype._processReadAllowingLess=function(t){this._reads.shift();let e=this._buffers[0];if(e.length>t.length){this._buffered-=t.length;this._buffers[0]=e.slice(t.length);t.func.call(this,e.slice(0,t.length))}else{this._buffered-=e.length;this._buffers.shift();t.func.call(this,e)}};r.prototype._processRead=function(r){this._reads.shift();let i=0;let n=0;let s=o.alloc(r.length);while(i0){this._buffers.splice(0,n)}this._buffered-=r.length;r.func.call(this,s)};r.prototype._process=function(){try{while(this._buffered>0&&this._reads&&this._reads.length>0){let t=this._reads[0];if(t.allowLess){this._processReadAllowingLess(t)}else if(this._buffered>=t.length){this._processRead(t)}else{break}}if(this._buffers&&!this.writable){this._end()}}catch(t){this.emit("error",t)}}}).call(this)}).call(this,n("_process"),n("buffer").Buffer)},{_process:185,buffer:151,stream:187,util:208}],86:[function(t,e,r){"use strict";e.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}},{}],87:[function(t,e,r){"use strict";let i=[];(function(){for(let t=0;t<256;t++){let e=t;for(let t=0;t<8;t++){if(e&1){e=3988292384^e>>>1}else{e=e>>>1}}i[t]=e}})();let n=e.exports=function(){this._crc=-1};n.prototype.write=function(e){for(let t=0;t>>8}return true};n.prototype.crc32=function(){return this._crc^-1};n.crc32=function(e){let r=-1;for(let t=0;t>>8}return r^-1}},{}],88:[function(f,g,t){(function(p){(function(){"use strict";let h=f("./paeth-predictor");function t(e,r,i,n,s){for(let t=0;t=a?i[n+r-a]:0;let e=i[n+r]-t;s[o+r]=e}}function i(i,n,t,s){let o=0;for(let r=0;r=s?i[n+r-s]:0;let e=i[n+r]-t;o+=Math.abs(e)}return o}function n(i,n,s,o,a){for(let r=0;r0?i[n+r-s]:0;let e=i[n+r]-t;o[a+r]=e}}function s(i,n,s){let o=0;let t=n+s;for(let r=n;r0?i[r-s]:0;let e=i[r]-t;o+=Math.abs(e)}return o}function o(n,s,o,a,u,l){for(let i=0;i=l?n[s+i-l]:0;let e=s>0?n[s+i-o]:0;let r=n[s+i]-(t+e>>1);a[u+i]=r}}function a(n,s,o,a){let u=0;for(let i=0;i=a?n[s+i-a]:0;let e=s>0?n[s+i-o]:0;let r=n[s+i]-(t+e>>1);u+=Math.abs(r)}return u}function u(s,o,a,u,l,f){for(let n=0;n=f?s[o+n-f]:0;let e=o>0?s[o+n-a]:0;let r=o>0&&n>=f?s[o+n-(a+f)]:0;let i=s[o+n]-h(t,e,r);u[l+n]=i}}function l(s,o,a,u){let l=0;for(let n=0;n=u?s[o+n-u]:0;let e=o>0?s[o+n-a]:0;let r=o>0&&n>=u?s[o+n-(a+u)]:0;let i=s[o+n]-h(t,e,r);l+=Math.abs(i)}return l}let c={0:t,1:r,2:n,3:o,4:u};let d={0:e,1:i,2:s,3:a,4:l};g.exports=function(i,t,e,r,n){let s;if(!("filterType"in r)||r.filterType===-1){s=[0,1,2,3,4]}else if(typeof r.filterType==="number"){s=[r.filterType]}else{throw new Error("unrecognised filter types")}if(r.bitDepth===16){n*=2}let o=t*n;let a=0;let u=0;let l=p.alloc((o+1)*e);let f=s[0];for(let t=0;t1){let r=Infinity;for(let e=0;eo?n[r-s]:0;n[r]=t+e}};t.prototype._unFilterType2=function(i,n,t){let s=this._lastLine;for(let r=0;ru?o[n-a]:0;let i=Math.floor((r+e)/2);o[n]=t+i}};t.prototype._unFilterType4=function(o,a,t){let u=this._xComparison;let l=u-1;let f=this._lastLine;for(let s=0;sl?a[s-u]:0;let i=s>l&&f?f[s-u]:0;let n=h(r,e,i);a[s]=t+n}};t.prototype._reverseFilterLine=function(t){let e=t[0];let r;let i=this._images[this._imageIndex];let n=i.byteWidth;if(e===0){r=t.slice(1,n+1)}else{r=s.alloc(n);switch(e){case 1:this._unFilterType1(t,r,n);break;case 2:this._unFilterType2(t,r,n);break;case 3:this._unFilterType3(t,r,n);break;case 4:this._unFilterType4(t,r,n);break;default:throw new Error("Unrecognised filter type - "+e)}}this.write(r);i.lineIndex++;if(i.lineIndex>=i.height){this._lastLine=null;this._imageIndex++;i=this._images[this._imageIndex]}else{this._lastLine=r}if(i){this.read(i.byteWidth+1,this._reverseFilterLine.bind(this))}else{this._lastLine=null;this.complete()}}}).call(this)}).call(this,e("buffer").Buffer)},{"./interlace":93,"./paeth-predictor":97,buffer:151}],92:[function(t,e,r){(function(d){(function(){"use strict";function f(r,i,e,n,s){let o=0;for(let t=0;t0&&i>0){n.push({width:r,height:i,index:t})}}return n};r.getInterlaceIterator=function(a){return function(t,e,r){let i=t%l[r].x.length;let n=(t-i)/l[r].x.length*8+l[r].x[i];let s=e%l[r].y.length;let o=(e-s)/l[r].y.length*8+l[r].y[s];return n*4+o*a*4}}},{}],94:[function(n,a,t){(function(o){(function(){"use strict";let t=n("util");let r=n("stream");let s=n("./constants");let i=n("./packer");let e=a.exports=function(t){r.call(this);let e=t||{};this._packer=new i(e);this._deflate=this._packer.createDeflate();this.readable=true};t.inherits(e,r);e.prototype.pack=function(t,e,r,i){this.emit("data",o.from(s.PNG_SIGNATURE));this.emit("data",this._packer.packIHDR(e,r));if(i){this.emit("data",this._packer.packGAMA(i))}let n=this._packer.filterData(t,e,r);this._deflate.on("error",this.emit.bind(this,"error"));this._deflate.on("data",function(t){this.emit("data",this._packer.packIDAT(t))}.bind(this));this._deflate.on("end",function(){this.emit("data",this._packer.packIEND());this.emit("end")}.bind(this));this._deflate.end(n)}}).call(this)}).call(this,n("buffer").Buffer)},{"./constants":86,"./packer":96,buffer:151,stream:187,util:208}],95:[function(t,e,r){(function(h){(function(){"use strict";let a=true;let u=t("zlib");if(!u.deflateSync){a=false}let l=t("./constants");let f=t("./packer");e.exports=function(t,e){if(!a){throw new Error("To use the sync capability of this library in old node versions, please pin pngjs to v2.3.0")}let r=e||{};let i=new f(r);let n=[];n.push(h.from(l.PNG_SIGNATURE));n.push(i.packIHDR(t.width,t.height));if(t.gamma){n.push(i.packGAMA(t.gamma))}let s=i.filterData(t.data,t.width,t.height);let o=u.deflateSync(s,i.getDeflateOptions());s=null;if(!o||!o.length){throw new Error("bad png - invalid compressed data response")}n.push(i.packIDAT(o));n.push(i.packIEND());return h.concat(n)}}).call(this)}).call(this,t("buffer").Buffer)},{"./constants":86,"./packer":96,buffer:151,zlib:150}],96:[function(r,i,t){(function(s){(function(){"use strict";let o=r("./constants");let n=r("./crc");let a=r("./bitpacker");let u=r("./filter-pack");let e=r("zlib");let t=i.exports=function(t){this._options=t;t.deflateChunkSize=t.deflateChunkSize||32*1024;t.deflateLevel=t.deflateLevel!=null?t.deflateLevel:9;t.deflateStrategy=t.deflateStrategy!=null?t.deflateStrategy:3;t.inputHasAlpha=t.inputHasAlpha!=null?t.inputHasAlpha:true;t.deflateFactory=t.deflateFactory||e.createDeflate;t.bitDepth=t.bitDepth||8;t.colorType=typeof t.colorType==="number"?t.colorType:o.COLORTYPE_COLOR_ALPHA;t.inputColorType=typeof t.inputColorType==="number"?t.inputColorType:o.COLORTYPE_COLOR_ALPHA;if([o.COLORTYPE_GRAYSCALE,o.COLORTYPE_COLOR,o.COLORTYPE_COLOR_ALPHA,o.COLORTYPE_ALPHA].indexOf(t.colorType)===-1){throw new Error("option color type:"+t.colorType+" is not supported at present")}if([o.COLORTYPE_GRAYSCALE,o.COLORTYPE_COLOR,o.COLORTYPE_COLOR_ALPHA,o.COLORTYPE_ALPHA].indexOf(t.inputColorType)===-1){throw new Error("option input color type:"+t.inputColorType+" is not supported at present")}if(t.bitDepth!==8&&t.bitDepth!==16){throw new Error("option bit depth:"+t.bitDepth+" is not supported at present")}};t.prototype.getDeflateOptions=function(){return{chunkSize:this._options.deflateChunkSize,level:this._options.deflateLevel,strategy:this._options.deflateStrategy}};t.prototype.createDeflate=function(){return this._options.deflateFactory(this.getDeflateOptions())};t.prototype.filterData=function(t,e,r){let i=a(t,e,r,this._options);let n=o.COLORTYPE_TO_BPP_MAP[this._options.colorType];let s=u(i,e,r,this._options,n);return s};t.prototype._packChunk=function(t,e){let r=e?e.length:0;let i=s.alloc(r+12);i.writeUInt32BE(r,0);i.writeUInt32BE(t,4);if(e){e.copy(i,8)}i.writeInt32BE(n.crc32(i.slice(4,i.length-4)),i.length-4);return i};t.prototype.packGAMA=function(t){let e=s.alloc(4);e.writeUInt32BE(Math.floor(t*o.GAMMA_DIVISION),0);return this._packChunk(o.TYPE_gAMA,e)};t.prototype.packIHDR=function(t,e){let r=s.alloc(13);r.writeUInt32BE(t,0);r.writeUInt32BE(e,4);r[8]=this._options.bitDepth;r[9]=this._options.colorType;r[10]=0;r[11]=0;r[12]=0;return this._packChunk(o.TYPE_IHDR,r)};t.prototype.packIDAT=function(t){return this._packChunk(o.TYPE_IDAT,t)};t.prototype.packIEND=function(){return this._packChunk(o.TYPE_IEND,null)}}).call(this)}).call(this,r("buffer").Buffer)},{"./bitpacker":84,"./constants":86,"./crc":87,"./filter-pack":88,buffer:151,zlib:150}],97:[function(t,e,r){"use strict";e.exports=function t(e,r,i){let n=e+r-i;let s=Math.abs(n-e);let o=Math.abs(n-r);let a=Math.abs(n-i);if(s<=o&&s<=a){return e}if(o<=a){return r}return i}},{}],98:[function(t,e,r){"use strict";let i=t("util");let o=t("zlib");let n=t("./chunkstream");let s=t("./filter-parse-async");let a=t("./parser");let u=t("./bitmapper");let l=t("./format-normaliser");let f=e.exports=function(t){n.call(this);this._parser=new a(t,{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),simpleTransparency:this._simpleTransparency.bind(this),headersFinished:this._headersFinished.bind(this)});this._options=t;this.writable=true;this._parser.start()};i.inherits(f,n);f.prototype._handleError=function(t){this.emit("error",t);this.writable=false;this.destroy();if(this._inflate&&this._inflate.destroy){this._inflate.destroy()}if(this._filter){this._filter.destroy();this._filter.on("error",function(){})}this.errord=true};f.prototype._inflateData=function(t){if(!this._inflate){if(this._bitmapInfo.interlace){this._inflate=o.createInflate();this._inflate.on("error",this.emit.bind(this,"error"));this._filter.on("complete",this._complete.bind(this));this._inflate.pipe(this._filter)}else{let t=(this._bitmapInfo.width*this._bitmapInfo.bpp*this._bitmapInfo.depth+7>>3)+1;let e=t*this._bitmapInfo.height;let r=Math.max(e,o.Z_MIN_CHUNK);this._inflate=o.createInflate({chunkSize:r});let i=e;let n=this.emit.bind(this,"error");this._inflate.on("error",function(t){if(!i){return}n(t)});this._filter.on("complete",this._complete.bind(this));let s=this._filter.write.bind(this._filter);this._inflate.on("data",function(t){if(!i){return}if(t.length>i){t=t.slice(0,i)}i-=t.length;s(t)});this._inflate.on("end",this._filter.end.bind(this._filter))}}this._inflate.write(t)};f.prototype._handleMetaData=function(t){this._metaData=t;this._bitmapInfo=Object.create(t);this._filter=new s(this._bitmapInfo)};f.prototype._handleTransColor=function(t){this._bitmapInfo.transColor=t};f.prototype._handlePalette=function(t){this._bitmapInfo.palette=t};f.prototype._simpleTransparency=function(){this._metaData.alpha=true};f.prototype._headersFinished=function(){this.emit("metadata",this._metaData)};f.prototype._finished=function(){if(this.errord){return}if(!this._inflate){this.emit("error","No Inflate block")}else{this._inflate.end()}};f.prototype._complete=function(e){if(this.errord){return}let r;try{let t=u.dataToBitMap(e,this._bitmapInfo);r=l(t,this._bitmapInfo,this._options.skipRescale);t=null}catch(t){this._handleError(t);return}this.emit("parsed",r)}},{"./bitmapper":83,"./chunkstream":85,"./filter-parse-async":89,"./format-normaliser":92,"./parser":100,util:208,zlib:150}],99:[function(t,e,r){(function(E){(function(){"use strict";let w=true;let x=t("zlib");let _=t("./sync-inflate");if(!x.deflateSync){w=false}let C=t("./sync-reader");let T=t("./filter-parse-sync");let S=t("./parser");let k=t("./bitmapper");let A=t("./format-normaliser");e.exports=function(t,e){if(!w){throw new Error("To use the sync capability of this library in old node versions, please pin pngjs to v2.3.0")}let r;function i(t){r=t}let n;function s(t){n=t}function o(t){n.transColor=t}function a(t){n.palette=t}function u(){n.alpha=true}let l;function f(t){l=t}let h=[];function c(t){h.push(t)}let d=new C(t);let p=new S(e,{read:d.read.bind(d),error:i,metadata:s,gamma:f,palette:a,transColor:o,inflateData:c,simpleTransparency:u});p.start();d.process();if(r){throw r}let g=E.concat(h);h.length=0;let y;if(n.interlace){y=x.inflateSync(g)}else{let t=(n.width*n.bpp*n.depth+7>>3)+1;let e=t*n.height;y=_(g,{chunkSize:e,maxLength:e})}g=null;if(!y||!y.length){throw new Error("bad png - invalid inflate data response")}let m=T.process(y,n);g=null;let b=k.dataToBitMap(m,n);m=null;let v=A(b,n,e.skipRescale);n.data=v;n.gamma=l||0;return n}}).call(this)}).call(this,t("buffer").Buffer)},{"./bitmapper":83,"./filter-parse-sync":90,"./format-normaliser":92,"./parser":100,"./sync-inflate":103,"./sync-reader":104,buffer:151,zlib:150}],100:[function(e,r,t){(function(o){(function(){"use strict";let l=e("./constants");let s=e("./crc");let t=r.exports=function(t,e){this._options=t;t.checkCRC=t.checkCRC!==false;this._hasIHDR=false;this._hasIEND=false;this._emittedHeadersFinished=false;this._palette=[];this._colorType=0;this._chunks={};this._chunks[l.TYPE_IHDR]=this._handleIHDR.bind(this);this._chunks[l.TYPE_IEND]=this._handleIEND.bind(this);this._chunks[l.TYPE_IDAT]=this._handleIDAT.bind(this);this._chunks[l.TYPE_PLTE]=this._handlePLTE.bind(this);this._chunks[l.TYPE_tRNS]=this._handleTRNS.bind(this);this._chunks[l.TYPE_gAMA]=this._handleGAMA.bind(this);this.read=e.read;this.error=e.error;this.metadata=e.metadata;this.gamma=e.gamma;this.transColor=e.transColor;this.palette=e.palette;this.parsed=e.parsed;this.inflateData=e.inflateData;this.finished=e.finished;this.simpleTransparency=e.simpleTransparency;this.headersFinished=e.headersFinished||function(){}};t.prototype.start=function(){this.read(l.PNG_SIGNATURE.length,this._parseSignature.bind(this))};t.prototype._parseSignature=function(e){let r=l.PNG_SIGNATURE;for(let t=0;tthis._palette.length){this.error(new Error("More transparent colors than palette size"));return}for(let t=0;t0){this._handleIDAT(r)}else{this._handleChunkEnd()}};t.prototype._handleIEND=function(t){this.read(t,this._parseIEND.bind(this))};t.prototype._parseIEND=function(t){this._crc.write(t);this._hasIEND=true;this._handleChunkEnd();if(this.finished){this.finished()}}}).call(this)}).call(this,e("buffer").Buffer)},{"./constants":86,"./crc":87,buffer:151}],101:[function(t,e,r){"use strict";let i=t("./parser-sync");let n=t("./packer-sync");r.read=function(t,e){return i(t,e||{})};r.write=function(t,e){return n(t,e)}},{"./packer-sync":95,"./parser-sync":99}],102:[function(u,t,l){(function(s,o){(function(){"use strict";let t=u("util");let e=u("stream");let r=u("./parser-async");let i=u("./packer-async");let n=u("./png-sync");let a=l.PNG=function(t){e.call(this);t=t||{};this.width=t.width|0;this.height=t.height|0;this.data=this.width>0&&this.height>0?o.alloc(4*this.width*this.height):null;if(t.fill&&this.data){this.data.fill(0)}this.gamma=0;this.readable=this.writable=true;this._parser=new r(t);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(t){this.data=t;this.emit("parsed",t)}.bind(this));this._packer=new i(t);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"))};t.inherits(a,e);a.sync=n;a.prototype.pack=function(){if(!this.data||!this.data.length){this.emit("error","No data provided");return this}s.nextTick(function(){this._packer.pack(this.data,this.width,this.height,this.gamma)}.bind(this));return this};a.prototype.parse=function(t,i){if(i){let e,r;e=function(t){this.removeListener("error",r);this.data=t;i(null,this)}.bind(this);r=function(t){this.removeListener("parsed",e);i(t,null)}.bind(this);this.once("parsed",e);this.once("error",r)}this.end(t);return this};a.prototype.write=function(t){this._parser.write(t);return true};a.prototype.end=function(t){this._parser.end(t)};a.prototype._metadata=function(t){this.width=t.width;this.height=t.height;this.emit("metadata",t)};a.prototype._gamma=function(t){this.gamma=t};a.prototype._handleClose=function(){if(!this._parser.writable&&!this._packer.readable){this.emit("close")}};a.bitblt=function(e,r,i,n,s,o,a,u){i|=0;n|=0;s|=0;o|=0;a|=0;u|=0;if(i>e.width||n>e.height||i+s>e.width||n+o>e.height){throw new Error("bitblt reading outside image")}if(a>r.width||u>r.height||a+s>r.width||u+o>r.height){throw new Error("bitblt writing outside image")}for(let t=0;t=0,"have should not go down");if(r>0){let t=i._buffer.slice(i._offset,i._offset+r);i._offset+=r;if(t.length>o){t=t.slice(0,o)}u.push(t);l+=t.length;o-=t.length;if(o===0){return false}}if(e===0||i._offset>=i._chunkSize){s=i._chunkSize;i._offset=0;i._buffer=b.allocUnsafe(i._chunkSize)}if(e===0){a+=n-t;n=t;return true}return false}p(this._handle,"zlib binding closed");let c;do{c=this._handle.writeSync(e,t,a,n,this._buffer,this._offset,s);c=c||this._writeState}while(!this._hadError&&h(c[0],c[1]));if(this._hadError){throw f}if(l>=y){m(this);throw new RangeError("Cannot create final Buffer. It would be larger than 0x"+y.toString(16)+" bytes")}let d=b.concat(u,l);m(this);return d};t.inherits(r,g.Inflate);function i(t,e){if(typeof e==="string"){e=b.from(e)}if(!(e instanceof b)){throw new TypeError("Not a string or buffer")}let r=t._finishFlushFlag;if(r==null){r=g.Z_FINISH}return t._processChunk(e,r)}function n(t,e){return i(new r(e),t)}a.exports=u=n;u.Inflate=r;u.createInflate=e;u.inflateSync=n}).call(this)}).call(this,o("_process"),o("buffer").Buffer)},{_process:185,assert:142,buffer:151,util:208,zlib:150}],104:[function(t,e,r){"use strict";let i=e.exports=function(t){this._buffer=t;this._reads=[]};i.prototype.read=function(t,e){this._reads.push({length:Math.abs(t),allowLess:t<0,func:e})};i.prototype.process=function(){while(this._reads.length>0&&this._buffer.length){let e=this._reads[0];if(this._buffer.length&&(this._buffer.length>=e.length||e.allowLess)){this._reads.shift();let t=this._buffer;this._buffer=t.slice(e.length);e.func.call(this,t.slice(0,e.length))}else{break}}if(this._reads.length>0){throw new Error("There are some read requests waitng on finished stream")}if(this._buffer.length>0){throw new Error("unrecognised content at end of stream")}}},{}],105:[function(t,e,r){(function(b,t){(function(){(function(r,i){"use strict";if(r.setImmediate){return}var n=1;var s={};var o=false;var a=r.document;var u;function t(t){if(typeof t!=="function"){t=new Function(""+t)}var e=new Array(arguments.length-1);for(var r=0;r!this.jobsDone.has(t))){continue}if(this.idle.isSettled()){this.idle=new n}this.canLoopAgain=true;await this.ready;if(!this.isQueueRunning){this.finishRun();return}this.runJob(t)}}while(this.canLoopAgain);this.finishRun()};i.prototype.finishRun=function(){this.isLoopRunning=false;if(!this.pendingJobs.size){this.drained.resolve()}if(!this.runningJobs.size){this.endTime=Date.now();this.idle.resolve()}};i.prototype.runJob=async function(e){this.pendingJobs.delete(e.id);this.runningJobs.set(e.id,e);if(this.runningJobs.size>=this.concurrency){this.ready=new n}try{e.startTime=Date.now();await this.jobRunner(e.data);e.endTime=Date.now();this.jobsDone.set(e.id,e);this.canLoopAgain=true}catch(t){e.endTime=Date.now();e.error=t;this.errorJobs.set(e.id,e)}this.runningJobs.delete(e.id);if(this.runningJobs.size{var r;n=n||"Async";s=s||"AsyncAll";t=t||(t=>t[0]!=="_"&&!t.endsWith("Sync"));if(e){r=[];for(let t in i){if(typeof i[t]==="function"){r.push(t)}}}else{r=Object.keys(i)}r.filter(e=>{if(typeof i[e]!=="function"){return false}for(let t in i[e].prototype){return false}return t(e,i)}).forEach(t=>{const e=t+n;const r=t+s;if(!i[e]){i[e]=o.promisify(i[t],i)}if(!i[r]){i[r]=o.promisifyAll(i[t],i)}})};o.promisifyAnyNodeApi=(t,e,r,i)=>{o.promisifyNodeApi(t,e,r,i,true)}},{"./seventh.js":113}],108:[function(t,e,r){"use strict";const p=t("./seventh.js");const f={};function h(){}p.all=t=>{var r=-1,i=false,n=0,s=Infinity,o,a=[],u=new p;for(o of t){if(i){break}r++;(()=>{const e=r;p.resolve(o).then(t=>{if(i){return}a[e]=t;n++;if(n>=s){i=true;u._resolveValue(a)}},t=>{if(i){return}i=true;u.reject(t)})})()}s=r+1;if(!s){u._resolveValue(a)}return u};p._allArray=t=>{var e=t.length;if(!e){p._resolveValue([])}var r,i={settled:false,count:0,length:e,values:[],allPromise:new p};for(r=0;!i.settled&&r{p._bareThen(t,t=>{if(r.settled){return}r.values[e]=t;r.count++;if(r.count>=r.length){r.settled=true;r.allPromise._resolveValue(r.values)}},t=>{if(r.settled){return}r.settled=true;r.allPromise.reject(t)})};p.every=p.map=(t,r)=>{var i=-1,n=false,s=0,o=Infinity,a,u=[],l=new p;for(a of t){if(n){break}i++;(()=>{const e=i;p.resolve(a).then(t=>{if(n){return}return r(t,e)}).then(t=>{if(n){return}u[e]=t;s++;if(s>=o){n=true;l._resolveValue(u)}},t=>{if(n){return}n=true;l.reject(t)})})()}o=i+1;if(!o){l._resolveValue(u)}return l};p.any=t=>{var r=-1,i=false,n=0,s=Infinity,o,a=[],u=new p;for(o of t){if(i){break}r++;(()=>{const e=r;p.resolve(o).then(t=>{if(i){return}i=true;u._resolveValue(t)},t=>{if(i){return}a[e]=t;n++;if(n>=s){i=true;u.reject(a)}})})()}s=r+1;if(!s){u.reject(new RangeError("Promise.any(): empty array"))}return u};p.some=(t,r)=>{var i=-1,n=false,s=0,o=Infinity,a,u=[],l=new p;for(a of t){if(n){break}i++;(()=>{const e=i;p.resolve(a).then(t=>{if(n){return}return r(t,e)}).then(t=>{if(n){return}n=true;l._resolveValue(t)},t=>{if(n){return}u[e]=t;s++;if(s>=o){n=true;l.reject(u)}})})()}o=i+1;if(!o){l.reject(new RangeError("Promise.any(): empty array"))}return l};p.filter=(t,r)=>{var i=-1,n=false,s=0,o=Infinity,a,u=[],l=new p;for(a of t){if(n){break}i++;(()=>{const e=i;p.resolve(a).then(t=>{if(n){return}u[e]=t;return r(t,e)}).then(t=>{if(n){return}s++;if(!t){u[e]=f}if(s>=o){n=true;u=u.filter(t=>t!==f);l._resolveValue(u)}},t=>{if(n){return}n=true;l.reject(t)})})()}o=i+1;if(!o){l._resolveValue(u)}else if(s>=o){n=true;u=u.filter(t=>t!==f);l._resolveValue(u)}return l};p.foreach=p.forEach=function(t,i,e){var n=-1,s=arguments.length>=3,o=t[Symbol.iterator](),a=new p,u=p.resolve(e);if(p.warnUnhandledRejection){p._handleAll(t)}var l=()=>{u.then(e=>{let{value:t,done:r}=o.next();n++;if(r){a.resolve(e)}else{u=p.resolve(t).then(s?t=>i(e,t,n):t=>i(t,n));l()}},t=>{a.reject(t);for(;;){let{value:t,done:e}=o.next();if(e){break}if(p.isThenable(t)){t.then(h,h)}}})};l();return a};p.reduce=(t,e,r)=>{return p.forEach(t,e,r)};p.mapObject=(t,r)=>{var i=false,n=0,e,s,o=Object.keys(t),a=o.length,u,l={},f=new p;for(e=0;!i&&e{const e=s;p.resolve(u).then(t=>{if(i){return}return r(t,e)}).then(t=>{if(i){return}l[e]=t;n++;if(n>=a){i=true;f._resolveValue(l)}},t=>{if(i){return}i=true;f.reject(t)})})()}if(!a){f._resolveValue(l)}return f};p.concurrent=(r,t,i)=>{var n=-1,s=false,o=0,a=0,u=Infinity,l,e=false,f=[],h=t[Symbol.iterator](),c=new p;if(p.warnUnhandledRejection){p._handleAll(t)}r=+r||1;const d=()=>{while(!e&&o=u){s=true;c._resolveValue(f);return}break}if(s){break}n++;(()=>{const e=n;o++;p.resolve(l).then(t=>{if(s){return}return i(t,e)}).then(t=>{if(s){return}f[e]=t;a++;o--;if(a>=u){s=true;c._resolveValue(f);return}if(o{if(s){return}s=true;c.reject(t)})})()}};d();if(n<0){c._resolveValue(f)}return c};p.race=t=>{var e=false,r,i=new p;for(r of t){if(e){break}p.resolve(r).then(t=>{if(e){return}e=true;i._resolveValue(t)},t=>{if(e){return}e=true;i.reject(t)})}return i}},{"./seventh.js":113}],109:[function(o,a,t){(function(e,r,s){(function(){"use strict";const t=r.Promise;var i;if(!e.browser){i=e.nextTick}else{o("setimmediate");i=s}function n(t){this.fn=t;this._then=n._dormantThen;this.value=null;this.thenHandlers=null;this.handledRejection=null;if(this.fn){this._exec()}}a.exports=n;n.Native=t;n.warnUnhandledRejection=true;n.prototype._exec=function(){this._then=n._pendingThen;try{this.fn(t=>{this.resolve(t)},t=>{this.reject(t)})}catch(t){this.reject(t)}};n.prototype.resolve=n.prototype.fulfill=function(t){if(this._then.settled){return this}if(n.isThenable(t)){this._execThenPromise(t);return this}return this._resolveValue(t)};n.prototype._resolveValue=function(t){this._then=n._fulfilledThen;this.value=t;if(this.thenHandlers&&this.thenHandlers.length){this._execFulfillHandlers()}return this};n.prototype._execThenPromise=function(t){try{t.then(t=>{this.resolve(t)},t=>{this.reject(t)})}catch(t){this.reject(t)}};n.prototype.reject=function(t){if(this._then.settled){return this}this._then=n._rejectedThen;this.value=t;if(this.thenHandlers&&this.thenHandlers.length){this._execRejectionHandlers()}else if(n.warnUnhandledRejection&&!this.handledRejection){this._unhandledRejection()}return this};n.prototype._execFulfillHandlers=function(){var t,e=this.thenHandlers.length;for(t=0;tthis.resolve(e),t)};n.prototype.rejectTimeout=function(t,e){setTimeout(()=>this.reject(e),t)};n._dormantThen=function(t,e){if(this.fn){this._exec();return this._then(t,e)}var r=new n;if(!this.thenHandlers){this.thenHandlers=[r,t,e]}else{this.thenHandlers[this.thenHandlers.length]=r;this.thenHandlers[this.thenHandlers.length]=t;this.thenHandlers[this.thenHandlers.length]=e}return r};n._dormantThen.settled=false;n._pendingThen=function(t,e){var r=new n;if(!this.thenHandlers){this.thenHandlers=[r,t,e]}else{this.thenHandlers[this.thenHandlers.length]=r;this.thenHandlers[this.thenHandlers.length]=t;this.thenHandlers[this.thenHandlers.length]=e}return r};n._pendingThen.settled=false;n._fulfilledThen=function(t){if(!t){return this}var e=new n;i(()=>{try{e.resolve(t(this.value))}catch(t){e.reject(t)}});return e};n._fulfilledThen.settled=true;n._rejectedThen=function(t,e){if(!e){return this}this.handledRejection=true;var r=new n;i(()=>{try{r.resolve(e(this.value))}catch(t){r.reject(t)}});return r};n._rejectedThen.settled=true;n.prototype.then=function(t,e){return this._then(t,e)};n.prototype.catch=function(t=()=>undefined){return this._then(undefined,t)};n.prototype.finally=function(t){return this._then(t,t)};n.prototype.tap=n.prototype.tapThen=function(t){this._then(t,undefined);return this};n.prototype.tapCatch=function(t){this._then(undefined,t);return this};n.prototype.tapFinally=function(t){this._then(t,t);return this};n.prototype.fatal=function(){this._then(undefined,t=>{i(()=>{throw t})})};n.prototype.done=function(t,e){this._then(t,e).fatal();return this};n.prototype.callback=function(e){this._then(t=>{e(undefined,t)},t=>{e(t)}).fatal();return this};n.prototype.callbackAll=function(e){this._then(t=>{if(Array.isArray(t)){e(undefined,...t)}else{e(undefined,t)}},t=>{e(t)}).fatal();return this};n.callback=function(t){return new n((r,i)=>{t((t,e)=>{if(t){i(t)}else{r(e)}})})};n.callbackAll=function(t){return new n((r,i)=>{t((t,...e)=>{if(t){i(t)}else{r(e)}})})};n.prototype.toPromise=n.prototype.propagate=function(e){this._then(t=>{e.resolve(t)},t=>{e.reject(t)});return this};n.propagate=function(t,e){t.then(t=>{e.resolve(t)},t=>{e.reject(t)});return t};n.finally=function(t,e){return t.then(e,e)};n.resolve=n.fulfill=function(t){if(n.isThenable(t)){return n.fromThenable(t)}return n._resolveValue(t)};n._resolveValue=function(t){var e=new n;e._then=n._fulfilledThen;e.value=t;return e};n.reject=function(t){var e=new n;e._then=n._rejectedThen;e.value=t;return e};n.resolveTimeout=n.fulfillTimeout=function(e,r){return new n(t=>setTimeout(()=>t(r),e))};n.rejectTimeout=function(r,i){return new n((t,e)=>setTimeout(()=>e(i),r))};n.resolveNextTick=n.fulfillNextTick=function(e){return new n(t=>i(()=>t(e)))};n.rejectNextTick=function(r){return new n((t,e)=>i(()=>e(r)))};n.dormant=function(t){var e=new n;e.fn=t;return e};n.try=function(t){try{return n.resolve(t())}catch(t){return n.reject(t)}};n.isThenable=function(t){return t&&typeof t==="object"&&typeof t.then==="function"};n.fromThenable=function(t){if(t instanceof n){return t}return new n((e,r)=>{t.then(t=>{e(t)},t=>{r(t)})})};n._bareThen=function(t,e,r){if(t&&typeof t==="object"){if(t instanceof n){if(t._then===n._fulfilledThen){e(t.value)}else if(t._then===n._rejectedThen){r(t.value)}else{t._then(e,r)}}else if(typeof t.then==="function"){t.then(e,r)}else{e(t)}}else{e(t)}};n._handleAll=function(t){var e;for(e of t){if(n.isThenable(e)){e.handledRejection=true}}};n.prototype._unhandledRejection=function(){this.handledRejection=false;const e=t=>setTimeout(t,0);if(this.value instanceof Error){e(()=>{if(this.handledRejection===false){this.value.message="Unhandled promise rejection: "+this.value.message;console.error(this.value)}})}else{let t=new Error("Unhandled promise rejection");e(()=>{if(this.handledRejection===false){console.error(t);console.error("Rejection reason:",this.value)}})}};n.prototype.isSettled=function(){return this._then.settled};n.prototype.getStatus=function(){switch(this._then){case n._dormantThen:return"dormant";case n._pendingThen:return"pending";case n._fulfilledThen:return"fulfilled";case n._rejectedThen:return"rejected"}};n.prototype.inspect=function(){switch(this._then){case n._dormantThen:return"Promise { }";case n._pendingThen:return"Promise { }";case n._fulfilledThen:return"Promise { "+this.value+" }";case n._rejectedThen:return"Promise { "+this.value+" }"}};n.resolved=n.dummy=n.resolve();if(e.browser){n.prototype.resolveAtAnimationFrame=function(t){window.requestAnimationFrame(()=>this.resolve(t))};n.prototype.rejectAtAnimationFrame=function(t){window.requestAnimationFrame(()=>this.reject(t))};n.resolveAtAnimationFrame=function(e){return new n(t=>window.requestAnimationFrame(()=>t(e)))};n.rejectAtAnimationFrame=function(r){return new n((t,e)=>window.requestAnimationFrame(()=>e(r)))}}}).call(this)}).call(this,o("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},o("timers").setImmediate)},{_process:185,setimmediate:105,timers:203}],110:[function(t,e,r){"use strict";const l=t("./seventh.js");l.promisifyAll=(e,n)=>{if(n){return(...t)=>{return new l((r,i)=>{e.call(n,...t,(t,...e)=>{if(t){if(e.length&&t instanceof Error){t.args=e}i(t)}else{r(e)}})})}}return function(...t){return new l((r,i)=>{e.call(this,...t,(t,...e)=>{if(t){if(e.length&&t instanceof Error){t.args=e}i(t)}else{r(e)}})})}};l.promisify=(e,n)=>{if(n){return(...t)=>{return new l((r,i)=>{e.call(n,...t,(t,e)=>{if(t){if(e!==undefined&&t instanceof Error){t.arg=e}i(t)}else{r(e)}})})}}return function(...t){return new l((r,i)=>{e.call(this,...t,(t,e)=>{if(t){if(e!==undefined&&t instanceof Error){t.arg=e}i(t)}else{r(e)}})})}};l.returnValueInterceptor=(r,i,n)=>{return function(...t){var e=i.call(n||this,...t);r(e);return e}};l.once=(e,r)=>{var i=false;var n;return function(...t){if(!i){i=true;n=e.call(r||this,...t)}return n}};l.serialize=(r,i)=>{var n=new l.resolve;return function(...t){var e=new l;n.finally(()=>{l.propagate(r.call(i||this,...t),e)});n=e;return e}};l.debounce=(e,r)=>{var i=null;const n=()=>{i=null};return function(...t){if(i){return i}i=e.call(r||this,...t);l.finally(i,n);return i}};l.debounceDelay=(t,e,r)=>{var i=null;const n=()=>{setTimeout(()=>i=null,t)};return function(...t){if(i){return i}i=e.call(r||this,...t);l.finally(i,n);return i}};l.debounceUpdate=(r,i)=>{var n=null;var s=null;var o=null;const a=()=>{var t,e;n=null;if(s){t=s;s=null;e=o;o=null;n=r.call(...t);l.propagate(n,e);l.finally(n,a);return n}};return function(...t){var e=i||this;if(n){if(!o){o=new l}s=[e,...t];return o}n=r.call(e,...t);l.finally(n,a);return n}};l.NO_DELAY={};l.BATCH_NO_DELAY={};l.debounceSync=(s,o)=>{var r=new Map;const a=t=>{var e=r.get(t);if(!e){e={inProgress:null,inProgressIsFull:null,last:null,lastTime:null,lastFullSync:null,lastFullSyncTime:null,nextFullSyncPromise:null,nextFullSyncWith:null,noDelayBatches:new Set};r.set(t,e)}return e};const u=(t,e)=>{var r,i,n,s=new Date;t.inProgress=null;if(e>=2){t.lastFullSyncTime=t.lastTime=s}else if(e>=1){t.lastTime=s}if(t.nextFullSyncWith){if(o.delay&&t.lastFullSyncTime&&(r=s-t.lastFullSyncTime-o.delay)<0){t.inProgress=l.resolveTimeout(-r+1);t.inProgress.finally(()=>u(t,0));return t.nextFullSyncPromise}i=t.nextFullSyncWith;t.nextFullSyncWith=null;n=t.nextFullSyncPromise;t.nextFullSyncPromise=null;t.lastFullSync=t.last=t.inProgress=o.fn.call(...i);l.propagate(t.inProgress,n);l.finally(t.inProgress,()=>u(t,2));return t.inProgress}};const t=function(t,...e){var r=false,i=s.thisBinding||this,n=a(t);if(e[0]===l.NO_DELAY){r=true;e.shift()}else if(e[0]===l.BATCH_NO_DELAY){e.shift();let t=e.shift();if(!n.noDelayBatches.has(t)){n.noDelayBatches.add(t);r=true}}if(n.inProgress){return n.inProgress}if(!r&&s.delay&&n.lastTime&&new Date-n.lastTimeu(n,1));return n.inProgress};const e=function(t,...e){var r,i=false,n=o.thisBinding||this,s=a(t);if(e[0]===l.NO_DELAY){i=true;e.shift()}else if(e[0]===l.BATCH_NO_DELAY){e.shift();let t=e.shift();if(!s.noDelayBatches.has(t)){s.noDelayBatches.add(t);i=true}}if(!s.inProgress&&!i&&o.delay&&s.lastFullSyncTime&&(r=new Date-s.lastFullSyncTime-o.delay)<0){s.inProgress=l.resolveTimeout(-r+1);l.finally(s.inProgress,()=>u(s,0))}if(s.inProgress){if(!s.nextFullSyncPromise){s.nextFullSyncPromise=new l}s.nextFullSyncWith=[n,t,...e];return s.nextFullSyncPromise}s.lastFullSync=s.last=s.inProgress=o.fn.call(n,t,...e);l.finally(s.inProgress,()=>u(s,2));return s.inProgress};return[t,e]};l.timeout=(r,i,n)=>{return function(...t){var e=i.call(n||this,...t);setTimeout(()=>e.reject(new Error("Timeout")),r);return e}};l.variableTimeout=(i,n)=>{return function(t,...e){var r=i.call(n||this,...e);setTimeout(()=>r.reject(new Error("Timeout")),t);return r}}},{"./seventh.js":113}],111:[function(t,e,r){(function(o){(function(){"use strict";const n=t("./seventh.js");var s=false;n.asyncExit=function(r,i){if(s){return}s=true;var t=o.listeners("asyncExit");if(!t.length){o.exit(r);return}if(i===undefined){i=1e3}const e=e=>{if(e.length<3){e(r,i);return n.dummy}return new n(t=>{e(r,i,()=>{t()})})};n.map(t,e).finally(()=>o.exit(r));setTimeout(()=>o.exit(r),i)};n.resolveSafeTimeout=function(e,r){return new n(t=>{setTimeout(()=>{setTimeout(()=>{setTimeout(()=>{setTimeout(()=>t(r),0)},e/2)},e/2)},0)})}}).call(this)}).call(this,t("_process"))},{"./seventh.js":113,_process:185}],112:[function(t,e,r){"use strict";const i=t("./seventh.js");i.parasite=()=>{var t=["tap","tapCatch","finally","fatal","done","callback","callbackAll"];t.forEach(t=>i.Native.prototype[t]=i.prototype[t]);i.Native.prototype._then=i.Native.prototype.then}},{"./seventh.js":113}],113:[function(t,e,r){"use strict";const i=t("./core.js");e.exports=i;t("./batch.js");t("./wrapper.js");t("./decorators.js");t("./Queue.js");t("./api.js");t("./parasite.js");t("./misc.js")},{"./Queue.js":106,"./api.js":107,"./batch.js":108,"./core.js":109,"./decorators.js":110,"./misc.js":111,"./parasite.js":112,"./wrapper.js":114}],114:[function(t,e,r){"use strict";const l=t("./seventh.js");l.timeLimit=(r,i)=>{return new l((t,e)=>{if(typeof i==="function"){i=i()}l.resolve(i).then(t,e);setTimeout(()=>e(new Error("Timeout")),r)})};l.retry=(t,e)=>{var r=t.retries||1,i=t.coolDown||0,n=t.raiseFactor||1,s=t.maxCoolDown||Infinity,o=t.timeout||0,a=t.catch||null;const u=()=>{return(o?l.timeLimit(o,e):e()).catch(t=>{if(!r--){throw t}var e=i;i=Math.min(i*n,s);if(a){return l.resolve(a(t)).then(()=>l.resolveTimeout(e).then(u))}return l.resolveTimeout(e).then(u)})};return u()};l.onceEvent=(e,r)=>{return new l(t=>e.once(r,t))};l.onceEventAll=(t,r)=>{return new l(e=>t.once(r,(...t)=>e(t)))};l.onceEventOrError=(a,u,t,r=false)=>{return new l((e,i)=>{var n;var s=(...t)=>{a.removeListener("error",o);if(n){for(let t in n){a.removeListener(t,n[t])}}e(r?t:t[0])};var o=t=>{a.removeListener(u,s);if(n){for(let t in n){a.removeListener(t,n[t])}}i(t)};a.once(u,s);a.once("error",o);if(t){if(!Array.isArray(t)){t=[t]}n={};t.forEach(r=>{var t=(...t)=>{a.removeListener("error",o);a.removeListener(u,s);var e=new Error("Received an excluded event: "+r);e.event=r;e.eventArgs=t;i(e)};a.once(r,t);n[r]=t})}})};l.onceEventAllOrError=(t,e,r)=>{return l.onceEventOrError(t,e,r,true)}},{"./seventh.js":113}],115:[function(t,e,r){"use strict";function i(t,e=".",r="",i=false){this.sign=1;this.digits=[];this.exposant=0;this.special=null;this.decimalSeparator=e;this.forceDecimalSeparator=!!i;this.groupSeparator=r;this.set(t)}e.exports=i;i.prototype.set=function(t){var e,r,i,n,s,o,a,u,l;t=+t;this.sign=1;this.digits.length=0;this.exposant=0;this.special=null;if(!Number.isFinite(t)){this.special=t;return null}t=""+t;e=t.match(/(-)?([0-9]+)(?:.([0-9]+))?(?:e([+-][0-9]+))?/);if(!e){throw new Error("Unexpected error")}this.sign=e[1]?-1:1;this.exposant=e[2].length+(parseInt(e[4],10)||0);a=0;u=false;l=0;for(s=0,o=e[2].length;s20||this.exposant<-20){return this.toScientificString(...t)}return this.toNoExpString(...t)};i.prototype.toExponential=i.prototype.toExponentialString=function(){if(this.special!==null){return""+this.special}var t=this.sign<0?"-":"";if(!this.digits.length){return t+"0"}t+=this.digits[0];if(this.digits.length>1){t+=this.decimalSeparator+this.digits.join("").slice(1)}t+="e"+(this.exposant>0?"+":"")+(this.exposant-1);return t};const n=["⁰","¹","²","³","⁴","⁵","⁶","⁷","⁸","⁹"];const s="⁺";const o="⁻";const a="0".charCodeAt(0);i.prototype.toScientific=i.prototype.toScientificString=function(){if(this.special!==null){return""+this.special}var t=this.sign<0?"-":"";if(!this.digits.length){return t+"0"}t+=this.digits[0];if(this.digits.length>1){t+=this.decimalSeparator+this.digits.join("").slice(1)}var e=(this.exposant<=0?o:"")+(""+Math.abs(this.exposant-1)).split("").map(t=>n[t.charCodeAt(0)-a]).join("");t+=" × 10"+e;return t};i.prototype.toNoExp=i.prototype.toNoExpString=function(t=1,e=0,r=false,i=false,n=this.exposant){if(this.special!==null){return""+this.special}var s=[],o=[],a=this.sign<0?"-":i?"+":"";if(!this.digits.length){h(s,0,t);if(e&&!r){h(o,0,e)}}else if(n<=0){h(s,0,t);h(o,0,-n);c(o,this.digits);if(e&&this.digits.length-n=this.digits.length){if(n0)){h(o,0,e-this.digits.length+n)}}a+=this.groupSeparator?this.groupDigits(s,this.groupSeparator):s.join("");if(o.length){a+=this.decimalSeparator+(this.decimalGroupSeparator?this.groupDigits(o,this.decimalGroupSeparator):o.join(""))}else if(this.forceDecimalSeparator){a+=this.decimalSeparator}return a};const u=["","k","M","G","T","P","E","Z","Y"];const l=["","m","µ","n","p","f","a","z","y"];i.prototype.toMetric=i.prototype.toMetricString=function(t=1,e=0,r=false,i=false){if(this.special!==null){return""+this.special}if(!this.digits.length){return this.sign>0?"0":"-0"}var n="",s;if(this.exposant>0){s=1+(this.exposant-1)%3;n=u[Math.floor((this.exposant-1)/3)];if(n===undefined){return this.toScientificString()}}else{s=3- -this.exposant%3;n=l[1+Math.floor(-this.exposant/3)];if(n===undefined){return this.toScientificString()}}return this.toNoExpString(t,e,r,i,s)+n};i.prototype.precision=function(r,t=0){var e;if(this.special!==null||r>=this.digits.length){return this}if(r<0){this.digits.length=0;return this}t*=this.sign;if(t<0){e=this.digits.length>r+4&&this.digits[r]===9&&this.digits[r+1]===9&&this.digits[r+2]===9&&this.digits[r+3]===9&&this.digits[r+4]===9}else if(t>0){e=this.digits[r]>0||this.digits[r+1]>0||this.digits[r+2]>0||this.digits[r+3]>0||this.digits[r+4]>0}else{e=this.digits[r]>=5}if(e){let t=r-1,e=false;for(;t>=0;t--){if(this.digits[t]<9){this.digits[t]++;e=true;break}else{this.digits[t]=0}}if(!e){this.exposant++;this.digits[0]=1;this.digits.length=1}else{this.digits.length=t+1}}else{this.digits.length=r;this.removeTrailingZero()}return this};i.prototype.round=function(t=0,e=0){var r=this.exposant+t;return this.precision(r,e)};i.prototype.floor=function(t=0){var e=this.exposant+t;return this.precision(e,-1)};i.prototype.ceil=function(t=0){var e=this.exposant+t;return this.precision(e,1)};i.prototype.removeTrailingZero=function(){var t=this.digits.length-1;while(t>=0&&this.digits[t]===0){t--}this.digits.length=t+1};const f=3;i.prototype.groupDigits=function(t,e,r=false){var i="",n=r?0:f-t.length%f,s=0,o=t.length;for(;s{if(r===undefined&&typeof e==="string"){let t=e;if(t[0]==="#"){t=t.slice(1)}if(t.length===3){t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]}e=parseInt(t.slice(0,2),16)||0;r=parseInt(t.slice(2,4),16)||0;i=parseInt(t.slice(4,6),16)||0}return"[38;2;"+e+";"+r+";"+i+"m"};i.bgTrueColor=(e,r,i)=>{if(r===undefined&&typeof e==="string"){let t=e;if(t[0]==="#"){t=t.slice(1)}if(t.length===3){t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]}e=parseInt(t.slice(0,2),16)||0;r=parseInt(t.slice(2,4),16)||0;i=parseInt(t.slice(4,6),16)||0}return"[48;2;"+e+";"+r+";"+i+"m"};const o={0:null,1:{bold:true},2:{dim:true},22:{bold:false,dim:false},3:{italic:true},23:{italic:false},4:{underline:true},24:{underline:false},5:{blink:true},25:{blink:false},7:{inverse:true},27:{inverse:false},8:{hidden:true},28:{hidden:false},9:{strike:true},29:{strike:false},30:{color:0},31:{color:1},32:{color:2},33:{color:3},34:{color:4},35:{color:5},36:{color:6},37:{color:7},39:{color:"default"},90:{color:8},91:{color:9},92:{color:10},93:{color:11},94:{color:12},95:{color:13},96:{color:14},97:{color:15},40:{bgColor:0},41:{bgColor:1},42:{bgColor:2},43:{bgColor:3},44:{bgColor:4},45:{bgColor:5},46:{bgColor:6},47:{bgColor:7},49:{bgColor:"default"},100:{bgColor:8},101:{bgColor:9},102:{bgColor:10},103:{bgColor:11},104:{bgColor:12},105:{bgColor:13},106:{bgColor:14},107:{bgColor:15}};i.parse=t=>{var e,r,i,n,s=[];for([,e,r]of t.matchAll(/\x1b\[([0-9;]+)m|(.[^\x1b]*)/g)){if(r){if(s.length){s[s.length-1].text+=r}else{s.push({text:r})}}else{e.split(";").forEach(t=>{n=o[t];if(n===undefined){return}if(!s.length||s[s.length-1].text){if(!n){i={text:""}}else{i=Object.assign({},i,n);i.text=""}s.push(i)}else{if(!n){s[s.length-1]={text:""}}else{Object.assign(i,n)}}})}}return s}},{}],117:[function(t,e,r){"use strict";var i={};e.exports=i;i.toCamelCase=function(t,s=false,o=false){if(!t||typeof t!=="string"){return""}return t.replace(/(?:^[\s_-]*|([\s_-]+))(([^\s_-]?)([^\s_-]*))/g,(t,e,r,i,n)=>{if(s){if(!e&&!o){return r}if(!i){return""}return i.toUpperCase()+n}if(!e&&!o){return r.toLowerCase()}if(!i){return""}return i.toUpperCase()+n.toLowerCase()})};i.camelCaseToSeparated=function(t,i=" "){if(!t||typeof t!=="string"){return""}return t.replace(/^([A-Z])|([A-Z])/g,(t,e,r)=>{if(e){return e.toLowerCase()}return i+r.toLowerCase()})};i.camelCaseToDash=i.camelCaseToDashed=t=>i.camelCaseToSeparated(t,"-")},{}],118:[function(t,e,r){"use strict";r.regExp=r.regExpPattern=t=>t.replace(/([.*+?^${}()|[\]/\\])/g,"\\$1");r.regExpReplacement=t=>t.replace(/\$/g,"$$$$");r.format=t=>t.replace(/%/g,"%%");r.jsSingleQuote=t=>r.control(t).replace(/'/g,"\\'");r.jsDoubleQuote=t=>r.control(t).replace(/"/g,'\\"');r.shellArg=t=>"'"+t.replace(/'/g,"'\\''")+"'";var i={"\r":"\\r","\n":"\\n","\t":"\\t","":"\\x7f"};r.control=(t,r=false)=>t.replace(/[\x00-\x1f\x7f]/g,t=>{if(r&&(t==="\n"||t==="\t")){return t}if(i[t]!==undefined){return i[t]}var e=t.charCodeAt(0).toString(16);if(e.length%2){e="0"+e}return"\\x"+e});var n={"&":"&","<":"<",">":">",'"':""","'":"'"};r.html=t=>t.replace(/[&<>]/g,t=>n[t]);r.htmlAttr=t=>t.replace(/[&<>"]/g,t=>n[t]);r.htmlSpecialChars=t=>t.replace(/[&<>"']/g,t=>n[t]);r.unicodePercentEncode=t=>t.replace(/[\x00-\x1f\u0100-\uffff\x7f%]/g,t=>{try{return encodeURI(t)}catch(t){return""}});r.httpHeaderValue=t=>r.unicodePercentEncode(t)},{}],119:[function(B,t,R){(function(E){(function(){"use strict";const l=B("./inspect.js").inspect;const f=B("./inspect.js").inspectError;const e=B("./escape.js");const n=B("./ansi.js");const s=B("./unicode.js");const i=B("./naturalSort.js");const p=B("./StringNumber.js");R.formatMethod=function(...g){var y,t=g[0],m=1,b=g.length;if(typeof t!=="string"){if(!t){t=""}else if(typeof t.toString==="function"){t=t.toString()}else{t=""}}var v={hasMarkup:false,shift:null,markupStack:[]};if(this.markupReset&&this.startingMarkupReset){t=(typeof this.markupReset==="function"?this.markupReset(v.markupStack):this.markupReset)+t}t=t.replace(/\^\[([^\]]*)]?|\^(.)|(%%)|%([+-]?)([0-9]*)(?:\[([^\]]*)\])?([a-zA-Z])/g,(t,e,r,i,n,s,o,a)=>{var u,l,f,h,c,d,p=[];if(i){return"%"}if(e){r=e}if(r){if(this.noMarkup){return"^"+r}return w.call(this,v,t,r)}if(s){s=parseInt(s,10);if(n){if(n==="+"){s=m+s}else if(n==="-"){s=m-s}}}else{s=m}m++;if(s>=b||s<1){y=undefined}else{y=g[s]}if(x[a]){u=x[a](y,o,this);if(this.argumentSanitizer&&!x[a].noSanitize){u=this.argumentSanitizer(u)}if(o&&!x[a].noCommonModeArg){u=_(u,o)}return u}if(a==="F"){m--;if(o===undefined){return""}f=o.split(":");h=f[0];c=f[1];if(!h){return""}if(c&&(d=c.match(/%([+-]?)([0-9]*)[a-zA-Z]/g))){for(l=0;l=b||s<1){p[l]=undefined}else{p[l]=g[s]}}}if(!this||!this.fn||typeof this.fn[h]!=="function"){return""}return this.fn[h].apply(this,p)}return""});if(v.hasMarkup&&this.markupReset&&this.endingMarkupReset){t+=typeof this.markupReset==="function"?this.markupReset(v.markupStack):this.markupReset}if(this.extraArguments){for(;m1){a.push({text:""})}}else{if(o&&o.text.length){a.push(Object.assign({text:""},...l.markupStack))}else{if(o){Object.assign(o,e)}else{a.push(Object.assign({text:""},e))}}}}}return a}if(this.markupReset&&this.startingMarkupReset){u=(typeof this.markupReset==="function"?this.markupReset(l.markupStack):this.markupReset)+u}u=u.replace(/\^\[([^\]]*)]?|\^(.)/g,(t,e,r)=>w.call(this,l,t,e||r));if(l.hasMarkup&&this.markupReset&&this.endingMarkupReset){u+=typeof this.markupReset==="function"?this.markupReset(l.markupStack):this.markupReset}return u};function w(t,e,r){var i,n,s,o,a;if(r==="^"){return"^"}if(this.shiftMarkup&&this.shiftMarkup[r]){t.shift=this.shiftMarkup[r];return""}if(r.length>1&&this.dataMarkup&&(a=r.indexOf(":"))!==-1){n=r.slice(0,a);i=this.dataMarkup[n];if(i===undefined){if(this.markupCatchAll===undefined){return""}i=this.markupCatchAll}t.hasMarkup=true;s=r.slice(a+1);if(typeof i==="function"){o=i(t.markupStack,n,s)}else{o={[i]:s};u(t,o)}return o}if(t.shift){i=this.shiftedMarkup?.[t.shift]?.[r];t.shift=null}else{i=this.markup?.[r]}if(i===undefined){if(this.markupCatchAll===undefined){return""}i=this.markupCatchAll}t.hasMarkup=true;if(typeof i==="function"){o=i(t.markupStack,r)}else{o=i;u(t,o)}return o}function u(e,r){if(Array.isArray(r)){for(let t of r){if(t===null){e.markupStack.length=0}else{e.markupStack.push(t)}}}else{if(r===null){e.markupStack.length=0}else{e.markupStack.push(r)}}}R.stripMarkup=t=>t.replace(/\^\[[^\]]*]?|\^./g,t=>t==="^^"?"^":t==="^ "?" ":"");const r={argumentSanitizer:t=>e.control(t,true),extraArguments:true,color:false,noMarkup:false,endingMarkupReset:true,startingMarkupReset:false,markupReset:n.reset,shiftMarkup:{"#":"background"},markup:{":":n.reset," ":n.reset+" ","-":n.dim,"+":n.bold,_:n.underline,"/":n.italic,"!":n.inverse,b:n.blue,B:n.brightBlue,c:n.cyan,C:n.brightCyan,g:n.green,G:n.brightGreen,k:n.black,K:n.brightBlack,m:n.magenta,M:n.brightMagenta,r:n.red,R:n.brightRed,w:n.white,W:n.brightWhite,y:n.yellow,Y:n.brightYellow},shiftedMarkup:{background:{":":n.reset," ":n.reset+" ",b:n.bgBlue,B:n.bgBrightBlue,c:n.bgCyan,C:n.bgBrightCyan,g:n.bgGreen,G:n.bgBrightGreen,k:n.bgBlack,K:n.bgBrightBlack,m:n.bgMagenta,M:n.bgBrightMagenta,r:n.bgRed,R:n.bgBrightRed,w:n.bgWhite,W:n.bgBrightWhite,y:n.bgYellow,Y:n.bgBrightYellow}},dataMarkup:{fg:(t,e,r)=>{var i=n.fgColor[r]||n.trueColor(r);t.push(i);return i},bg:(t,e,r)=>{var i=n.bgColor[r]||n.bgTrueColor(r);t.push(i);return i}},markupCatchAll:(t,e,r)=>{var i="";if(r===undefined){if(e[0]==="#"){i=n.trueColor(e)}else if(typeof n[e]==="string"){i=n[e]}}t.push(i);return i}};r.dataMarkup.color=r.dataMarkup.c=r.dataMarkup.fgColor=r.dataMarkup.fg;r.dataMarkup.bgColor=r.dataMarkup.bg;R.createFormatter=t=>R.formatMethod.bind(Object.assign({},r,t));R.format=R.formatMethod.bind(r);R.format.default=r;R.createMarkup=t=>R.markupMethod.bind(Object.assign({},r,t));R.markup=R.markupMethod.bind(r);R.format.count=function(t,e=false){var r,i,n,s=1,o=0;if(typeof t!=="string"){return 0}var a=e?/%([+-]?)([0-9]*)(?:\[[^\]]*\])?[a-zA-EG-Z]/g:/%([+-]?)([0-9]*)(?:\[[^\]]*\])?[a-zA-EG-Z]|(\^\[[^\]]*]?|\^.)/g;for([,n,i,r]of t.matchAll(a)){if(r){continue}if(i){i=parseInt(i,10);if(n){if(n==="+"){i=s+i}else if(n==="-"){i=s-i}}}else{i=s}s++;if(o{if(typeof t==="string"){return t}if(t===null||t===undefined||t===true||t===false){return"("+t+")"}if(typeof t==="number"){return""+t}if(typeof t.toString==="function"){return t.toString()}return"("+t+")"};x.r=t=>x.s(t);x.r.noSanitize=true;x.S=(t,e,r)=>{var i=t=>R.markupMethod.call(r,r.argumentSanitizer?r.argumentSanitizer(t):t);if(typeof t==="string"){return i(t)}if(t===null||t===undefined||t===true||t===false){return"("+t+")"}if(typeof t==="number"){return""+t}if(typeof t.toString==="function"){return i(t.toString())}return i("("+t+")")};x.S.noSanitize=true;x.S.noCommonModeArg=true;x.N=(t,e)=>{if(typeof t==="string"){return t}if(t===null||t===undefined||t===true||t===false){return""+t}if(typeof t==="number"){return x.f(t,".3g ")}if(Array.isArray(t)){t=t.map(t=>x.N(t,true));if(e){return"["+t.join(",")+"]"}return t.join(", ")}if(E.isBuffer(t)){t=[...t].map(t=>{t=t.toString(16);if(t.length===1){t="0"+t}return t});return"<"+t.join(" ")+">"}var r=Object.getPrototypeOf(t);if(r===null||r===Object.prototype){t=Object.entries(t).sort(i).map(t=>t[0]+": "+x.N(t[1],true));if(e){return"{"+t.join(", ")+"}"}return t.join(", ")}if(typeof t.inspect==="function"){return t.inspect()}if(typeof t.toString==="function"){return t.toString()}return"("+t+")"};x.n=t=>x.N(t,true);x.f=(t,e)=>{if(typeof t==="string"){t=parseFloat(t)}if(typeof t!=="number"){t=0}var r=m(e),i=new p(t,".",r.groupSeparator);if(r.rounding!==null){i.round(r.rounding)}if(r.precision){i.precision(r.precision)}return i.toString(r.leftPadding,r.rightPadding,r.rightPaddingOnlyIfDecimal)};x.f.noSanitize=true;x.P=(t,e)=>{if(typeof t==="string"){t=parseFloat(t)}if(typeof t!=="number"){t=0}t*=100;var r=m(e),i=new p(t,".",r.groupSeparator);if(r.rounding!==null||!r.precision){i.round(r.rounding||0)}if(r.precision){i.precision(r.precision)}return i.toNoExpString(r.leftPadding,r.rightPadding,r.rightPaddingOnlyIfDecimal)+"%"};x.P.noSanitize=true;x.p=(t,e)=>{if(typeof t==="string"){t=parseFloat(t)}if(typeof t!=="number"){t=0}t=(t-1)*100;var r=m(e),i=new p(t,".",r.groupSeparator);if(r.rounding!==null||!r.precision){i.round(r.rounding||0)}if(r.precision){i.precision(r.precision)}return i.toNoExpString(r.leftPadding,r.rightPadding,r.rightPaddingOnlyIfDecimal,true)+"%"};x.p.noSanitize=true;x.k=(t,e)=>{if(typeof t==="string"){t=parseFloat(t)}if(typeof t!=="number"){return"0"}var r=m(e),i=new p(t,".",r.groupSeparator);if(r.rounding!==null){i.round(r.rounding)}if(r.precision||r.rounding===null){i.precision(r.precision||3)}return i.toMetricString(r.leftPadding,r.rightPadding,r.rightPaddingOnlyIfDecimal)};x.k.noSanitize=true;x.e=(t,e)=>{if(typeof t==="string"){t=parseFloat(t)}if(typeof t!=="number"){t=0}var r=m(e),i=new p(t,".",r.groupSeparator);if(r.rounding!==null){i.round(r.rounding)}if(r.precision){i.precision(r.precision)}return i.toExponential()};x.e.noSanitize=true;x.K=(t,e)=>{if(typeof t==="string"){t=parseFloat(t)}if(typeof t!=="number"){t=0}var r=m(e),i=new p(t,".",r.groupSeparator);if(r.rounding!==null){i.round(r.rounding)}if(r.precision){i.precision(r.precision)}return i.toScientific()};x.K.noSanitize=true;x.d=x.i=t=>{if(typeof t==="string"){t=parseFloat(t)}if(typeof t==="number"){return""+Math.floor(t)}return"0"};x.i.noSanitize=true;x.u=t=>{if(typeof t==="string"){t=parseFloat(t)}if(typeof t==="number"){return""+Math.max(Math.floor(t),0)}return"0"};x.u.noSanitize=true;x.U=t=>{if(typeof t==="string"){t=parseFloat(t)}if(typeof t==="number"){return""+Math.max(Math.floor(t),1)}return"1"};x.U.noSanitize=true;x.m=t=>{if(typeof t==="string"){t=parseFloat(t)}if(typeof t!=="number"){return"(NaN)"}var e="";if(t<0){e="-";t=-t}var r=A(t),i=t-r;if(!i){return e+r+"°"}var n=A(i*60),s=A(i*3600-n*60);if(s){return e+r+"°"+(""+n).padStart(2,"0")+"′"+(""+s).padStart(2,"0")+"″"}return e+r+"°"+(""+n).padStart(2,"0")+"′"};x.m.noSanitize=true;x.t=(t,e)=>{if(typeof t==="string"){t=parseFloat(t)}if(typeof t!=="number"){return"(NaN)"}var r,i,n,s,o,a="",u=v(e),l=u.roundingType,f=u.useAbbreviation?"h":":",h=u.useAbbreviation?"min":":",c=u.useAbbreviation?"s":".",d=u.useAbbreviation;n=t/1e3;if(n<0){n=-n;l*=-1;a="-"}if(n<60&&!u.forceMinutes){s=new p(n,c,undefined,d);s.round(u.rounding,l);if(s.toNumber()<60){o=s.toString(1,u.rightPadding,u.rightPaddingOnlyIfDecimal);return a+o}n=60}i=Math.floor(n/60);n=n%60;s=new p(n,c,undefined,d);s.round(u.rounding,l);if(s.toNumber()<60){o=s.toString(2,u.rightPadding,u.rightPaddingOnlyIfDecimal)}else{i++;n=0;s.set(n);o=s.toString(2,u.rightPadding,u.rightPaddingOnlyIfDecimal)}if(i<60&&!u.forceHours){return a+i+h+o}r=Math.floor(i/60);i=i%60;return a+r+f+(""+i).padStart(2,"0")+h+o};x.t.noSanitize=true;x.h=t=>{if(typeof t==="string"){t=parseFloat(t)}if(typeof t==="number"){return""+Math.max(Math.floor(t),0).toString(16)}return"0"};x.h.noSanitize=true;x.x=t=>{if(typeof t==="string"){t=parseFloat(t)}if(typeof t!=="number"){return"00"}var e=""+Math.max(Math.floor(t),0).toString(16);if(e.length%2){e="0"+e}return e};x.x.noSanitize=true;x.o=t=>{if(typeof t==="string"){t=parseFloat(t)}if(typeof t==="number"){return""+Math.max(Math.floor(t),0).toString(8)}return"0"};x.o.noSanitize=true;x.b=t=>{if(typeof t==="string"){t=parseFloat(t)}if(typeof t==="number"){return""+Math.max(Math.floor(t),0).toString(2)}return"0"};x.b.noSanitize=true;x.X=t=>{if(typeof t==="string"){t=E.from(t)}else if(!E.isBuffer(t)){return""}return t.toString("hex")};x.X.noSanitize=true;x.z=t=>{if(typeof t==="string"){t=E.from(t)}else if(!E.isBuffer(t)){return""}return t.toString("base64")};x.Z=t=>{if(typeof t==="string"){t=E.from(t)}else if(!E.isBuffer(t)){return""}return t.toString("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/[=]{1,2}$/g,"")};const o={};x.I=(t,e,r)=>C(t,e,r,o);x.I.noSanitize=true;const a={noFunc:true,enumOnly:true,noDescriptor:true,useInspect:true,useInspectPropertyBlackList:true};x.Y=(t,e,r)=>C(t,e,r,a);x.Y.noSanitize=true;const h={minimal:true,noIndex:true};x.O=(t,e,r)=>C(t,e,r,h);x.O.noSanitize=true;const c={};x.E=(t,e,r)=>C(t,e,r,c,true);x.E.noSanitize=true;x.J=t=>t===undefined?"null":JSON.stringify(t);x.D=()=>"";x.D.noSanitize=true;const d=/([a-zA-Z])(.[^a-zA-Z]*)/g;const g=/([a-zA-Z]|^)([^a-zA-Z]*)/g;function _(r,i){for(let[,t,e]of i.matchAll(d)){if(t==="L"){let t=s.width(r);e=+e||1;if(t>e){r=s.truncateWidth(r,e-1).trim()+"…";t=s.width(r)}if(te){r=s.truncateWidth(r,e-1).trim()+"…";t=s.width(r)}if(t{if(t===e){return 1}if(t.length===0||e.length===0){return 0}return Math.max(0,1-_.levenshtein(t,e)/e.length)};const C=0;const T=.88;const x=.9;_.bestMatch=(t,e,r={})=>{var i=r.scoreLimit||C,n,s,o,a,u=-1,l=null;for(n=0,s=e.length;ni){i=o;l=a;u=n}}return r.indexOf?u:l};_.topMatch=(r,t,e={})=>{var i=e.scoreLimit||C,n=e.deltaRate||x,s,o,a;a=t.map((t,e)=>({pattern:t,index:e,score:_.score(r,t)}));a.sort((t,e)=>e.score-t.score);if(a[0].score<=i){return[]}i=Math.max(i,a[0].score*n);for(s=1,o=a.length;st.index):a.map(t=>t.pattern)};const i=new Set(["a","an","the","this","that","those","some","of","in","on","at","my","your","her","his","its","our","their"]);function S(t,e=i){return t.split(/[ '"/|,:_-]+/g).filter(t=>t&&!e.has(t))}_.bestTokenMatch=(t,e,r={})=>{var i=r.scoreLimit||C,n=r.tokenDisparityPenalty||T,s,o,a,u,l,f,h,c,d,p,g=i,y,m,b=S(t),v,w=-1,x=null;if(!b.length||!e.length){return r.indexOf?w:x}for(s=0,o=e.length;sv){v=m;if(m===1){break}}}p+=v}p/=b.length;if(b.length!==c.length){p*=n**Math.abs(c.length-b.length)}if(p>g){g=p;x=h;w=s}}return r.indexOf?w:x};_.topTokenMatch=(t,e,r={})=>{var i=r.scoreLimit||C,n=r.tokenDisparityPenalty||T,s=r.deltaRate||x,o,a,u,l,f,h,c,d,p,g,y,m,b=S(t),v,w=[];if(!b.length||!e.length){return[]}for(o=0,a=e.length;ov){v=m;if(m===1){break}}}g+=v}g/=b.length;if(b.length!==d.length){g*=n**Math.abs(d.length-b.length)}w.push({pattern:c,index:o,score:g})}w.sort((t,e)=>e.score-t.score);if(w[0].score<=i){return[]}i=Math.max(i,w[0].score*s);for(o=1,a=w.length;ot.index):w.map(t=>t.pattern)};const h=[];const c=[];_.levenshtein=(e,r)=>{if(e===r){return 0}if(e.length>r.length){let t=e;e=r;r=t}let t=e.length;let i=r.length;while(t>0&&e.charCodeAt(t-1)===r.charCodeAt(i-1)){t--;i--}let n=0;while(no?u>o?o+1:u:u>a?a+1:u}}return o}},{}],121:[function(e,t,r){(function(E,h){(function(){"use strict";const _=e("./escape.js");const n=e("./ansi.js");const C={};const T=new Set([Object,Array]);function o(t,e){if(arguments.length<2){e=t;t={}}else if(!t||typeof t!=="object"){t={}}var r={depth:0,ancestors:[]};if(!t.style){t.style=f.none}else if(typeof t.style==="string"){t.style=f[t.style]}if(t.depth===undefined){t.depth=3}if(t.maxLength===undefined){t.maxLength=250}if(t.outputMaxLength===undefined){t.outputMaxLength=5e3}if(t.nofunc){t.noFunc=true}if(t.minimal){t.noFunc=true;t.noDescriptor=true;t.noType=true;t.noArrayProperty=true;t.enumOnly=true;t.proto=false;t.funcDetails=false}if(t.minimalPlusConstructor){t.noFunc=true;t.noDescriptor=true;t.noTypeButConstructor=true;t.noArrayProperty=true;t.enumOnly=true;t.proto=false;t.funcDetails=false}var i=S(r,t,e);if(i.length>t.outputMaxLength){i=t.style.truncate(i,t.outputMaxLength)}return i}r.inspect=o;function S(e,r,t){var i,n,s,o,a,u,l,f,h,c,d,p,g,y,m="",b="",v="",w,x;h=typeof t;d=(r.tab??r.style.tab).repeat(e.depth);if(h==="function"&&r.noFunc){return""}if(e.key!==undefined){if(e.descriptor){v=[];if(!e.descriptor.configurable){v.push("-conf")}if(!e.descriptor.enumerable){v.push("-enum")}if(!e.descriptor.writable){v.push("-w")}if(v.length){v=v.join(" ")}else{v=""}}if(e.keyIsProperty){if(k(e.key)){b='"'+r.style.key(e.key)+'": '}else{b=r.style.key(e.key)+": "}}else if(!r.noIndex){b=r.style.index(e.key)}if(v){v=" "+r.style.type(v)}}c=e.noPre?"":d+b;if(t===undefined){m+=c+r.style.constant("undefined")+v+r.style.newline}else if(t===C){m+=c+r.style.constant("[empty]")+v+r.style.newline}else if(t===null){m+=c+r.style.constant("null")+v+r.style.newline}else if(t===false){m+=c+r.style.constant("false")+v+r.style.newline}else if(t===true){m+=c+r.style.constant("true")+v+r.style.newline}else if(h==="number"){m+=c+r.style.number(t.toString())+(r.noType||r.noTypeButConstructor?"":" "+r.style.type("number"))+v+r.style.newline}else if(h==="string"){if(t.length>r.maxLength){m+=c+'"'+r.style.string(_.control(t.slice(0,r.maxLength-1)))+'…"'+(r.noType||r.noTypeButConstructor?"":" "+r.style.type("string")+r.style.length("("+t.length+" - TRUNCATED)"))+v+r.style.newline}else{m+=c+'"'+r.style.string(_.control(t))+'"'+(r.noType||r.noTypeButConstructor?"":" "+r.style.type("string")+r.style.length("("+t.length+")"))+v+r.style.newline}}else if(E.isBuffer(t)){m+=c+r.style.inspect(t.inspect())+(r.noType?"":" "+r.style.type("Buffer")+r.style.length("("+t.length+")"))+v+r.style.newline}else if(h==="object"||h==="function"){n=s="";g=false;if(h==="function"){g=true;n=" "+r.style.funcName(t.name?t.name:"(anonymous)");s=r.style.length("("+t.length+")")}p=false;if(Array.isArray(t)){p=true;s=r.style.length("("+t.length+")")}if(!t.constructor){l="(no constructor)"}else if(!t.constructor.name){l="(anonymous)"}else{l=t.constructor.name}u=!t.constructor||T.has(t.constructor);l=r.style.constructorName(l);o=Object.getPrototypeOf(t);m+=c;if(!r.noType&&(!r.noTypeButConstructor||!u)){if(e.forceType&&!r.noType&&!r.noTypeButConstructor){m+=r.style.type(e.forceType)}else if(r.noTypeButConstructor){m+=l}else{m+=l+n+s+" "+r.style.type(h)+v}if(!g||r.funcDetails){m+=" "}}if(p&&r.noArrayProperty){a=[...Array(t.length).keys()]}else{a=Object.getOwnPropertyNames(t)}if(r.sort){a.sort()}y=A(t,e,r);if(r.protoBlackList&&r.protoBlackList.has(o)){m+=r.style.limit("[skip]")+r.style.newline}else if(y!==undefined){if(typeof y==="string"){m+="=> "+y+r.style.newline}else{m+="=> "+S({depth:e.depth,ancestors:e.ancestors,noPre:true},r,y)}}else if(g&&!r.funcDetails){m+=r.style.newline}else if(!a.length&&!r.proto){m+=(p?"[]":"{}")+r.style.newline}else if(e.depth>=r.depth){m+=r.style.limit("[depth limit]")+r.style.newline}else if(e.ancestors.indexOf(t)!==-1){m+=r.style.limit("[circular]")+r.style.newline}else{m+=(p?"[":"{")+r.style.newline;x=e.ancestors.slice();x.push(t);for(i=0;i";if(e==="fulfilled"){r+=" "+S({depth:n.depth,ancestors:n.ancestors,noPre:true},s,t[1])}else if(e==="rejected"){if(t[1]instanceof Error){r+=" "+u({style:s.style,noErrorStack:true},t[1])}else{r+=" "+S({depth:n.depth,ancestors:n.ancestors,noPre:true},s,t[1])}}return r}}if(i._bsontype){return i.toString()}if(s.useInspect&&typeof i.inspect==="function"){return i.inspect()}return}function u(e,r){var i="",t,n,s;if(arguments.length<2){r=e;e={}}else if(!e||typeof e!=="object"){e={}}if(!e.style){e.style=f.none}else if(typeof e.style==="string"){e.style=f[e.style]}if(!(r instanceof Error)){i+="[not an Error] ";if(typeof r==="string"){let t=5e3;if(r.length>t){i+=e.style.errorMessage(_.control(r.slice(0,t-1),true))+"…"+e.style.length("("+r.length+" - TRUNCATED)")+e.style.newline}else{i+=e.style.errorMessage(_.control(r,true))+e.style.newline}return i}else if(!r||typeof r!=="object"||!r.name||typeof r.name!=="string"||!r.message||typeof r.message!=="string"){i+=o(e,r);return i}}if(r.stack&&!e.noErrorStack){t=l(e,r.stack)}n=r.type||r.constructor.name;s=r.code||r.name||r.errno||r.number;i+=e.style.errorType(n)+(s?" ["+e.style.errorType(s)+"]":"")+": ";i+=e.style.errorMessage(r.message)+"\n";if(t){i+=e.style.errorStack(t)+"\n"}if(r.from){i+=e.style.newline+e.style.errorFromMessage("From error:")+e.style.newline+u(e,r.from)}return i}r.inspectError=u;function l(u,t){if(arguments.length<2){t=u;u={}}else if(!u||typeof u!=="object"){u={}}if(!u.style){u.style=f.none}else if(typeof u.style==="string"){u.style=f[u.style]}if(!t){return}if((u.browser||h.browser)&&t.indexOf("@")!==-1){t=t.replace(/[{return u.style.errorStack(" at ")+(e?u.style.errorStackMethod(e)+" ":"")+u.style.errorStack("(")+(r?u.style.errorStackFile(r):u.style.errorStack("unknown"))+(i?u.style.errorStack(":")+u.style.errorStackLine(i):"")+(n?u.style.errorStack(":")+u.style.errorStackColumn(n):"")+u.style.errorStack(")")})}else{t=t.replace(/^[^\n]*\n/,"");t=t.replace(/^\s*(at)\s+(?:(?:(async|new)\s+)?([^\s:()[\]\n]+(?:\([^)]+\))?)\s)?(?:\[as ([^\s:()[\]\n]+)\]\s)?(?:\(?([^:()[\]\n]+):([0-9]+):([0-9]+)\)?)?$/gm,(t,e,r,i,n,s,o,a)=>{return u.style.errorStack(" at ")+(r?u.style.errorStackKeyword(r)+" ":"")+(i?u.style.errorStackMethod(i)+" ":"")+(n?u.style.errorStack("[as ")+u.style.errorStackMethodAs(n)+u.style.errorStack("] "):"")+u.style.errorStack("(")+(s?u.style.errorStackFile(s):u.style.errorStack("unknown"))+(o?u.style.errorStack(":")+u.style.errorStackLine(o):"")+(a?u.style.errorStack(":")+u.style.errorStackColumn(a):"")+u.style.errorStack(")")})}return t}r.inspectStack=l;var f={};var t=t=>t;f.none={trim:false,tab:" ",newline:"\n",comma:"",limit:t,type:t=>"<"+t+">",constant:t,funcName:t,constructorName:t=>"<"+t+">",length:t,key:t,index:t=>"["+t+"] ",number:t,inspect:t,string:t,errorType:t,errorMessage:t,errorStack:t,errorStackKeyword:t,errorStackMethod:t,errorStackMethodAs:t,errorStackFile:t,errorStackLine:t,errorStackColumn:t,errorFromMessage:t,truncate:(t,e)=>t.slice(0,e-1)+"…"};f.inline=Object.assign({},f.none,{trim:true,tab:"",newline:" ",comma:", ",length:()=>"",index:()=>""});f.color=Object.assign({},f.none,{limit:t=>n.bold+n.brightRed+t+n.reset,type:t=>n.italic+n.brightBlack+t+n.reset,constant:t=>n.cyan+t+n.reset,funcName:t=>n.italic+n.magenta+t+n.reset,constructorName:t=>n.magenta+t+n.reset,length:t=>n.italic+n.brightBlack+t+n.reset,key:t=>n.green+t+n.reset,index:t=>n.blue+"["+t+"]"+n.reset+" ",number:t=>n.cyan+t+n.reset,inspect:t=>n.cyan+t+n.reset,string:t=>n.blue+t+n.reset,errorType:t=>n.red+n.bold+t+n.reset,errorMessage:t=>n.red+n.italic+t+n.reset,errorStack:t=>n.brightBlack+t+n.reset,errorStackKeyword:t=>n.italic+n.bold+t+n.reset,errorStackMethod:t=>n.brightYellow+t+n.reset,errorStackMethodAs:t=>n.yellow+t+n.reset,errorStackFile:t=>n.brightCyan+t+n.reset,errorStackLine:t=>n.blue+t+n.reset,errorStackColumn:t=>n.magenta+t+n.reset,errorFromMessage:t=>n.yellow+n.underline+t+n.reset,truncate:(t,e)=>{var r=n.gray+"…"+n.reset;t=t.slice(0,e-r.length);var i=t.lastIndexOf("");if(i>=t.length-6){t=t.slice(0,i)}return t+r}});f.html=Object.assign({},f.none,{tab:"    ",newline:"
",limit:t=>''+t+"",type:t=>''+t+"",constant:t=>''+t+"",funcName:t=>''+t+"",constructorName:t=>''+t+"",length:t=>''+t+"",key:t=>''+t+"",index:t=>'['+t+"] ",number:t=>''+t+"",inspect:t=>''+t+"",string:t=>''+t+"",errorType:t=>''+t+"",errorMessage:t=>''+t+"",errorStack:t=>''+t+"",errorStackKeyword:t=>""+t+"",errorStackMethod:t=>''+t+"",errorStackMethodAs:t=>''+t+"",errorStackFile:t=>''+t+"",errorStackLine:t=>''+t+"",errorStackColumn:t=>''+t+"",errorFromMessage:t=>''+t+""})}).call(this)}).call(this,{isBuffer:e("../../../../../../../../opt/node-v16.16.0/lib/node_modules/browserify/node_modules/is-buffer/index.js")},e("_process"))},{"../../../../../../../../opt/node-v16.16.0/lib/node_modules/browserify/node_modules/is-buffer/index.js":167,"./ansi.js":116,"./escape.js":118,_process:185}],122:[function(t,e,r){e.exports={"߀":"0","́":""," ":" ","Ⓐ":"A","A":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ɓ":"B","c":"C","Ⓒ":"C","C":"C","Ꜿ":"C","Ḉ":"C","Ç":"C","Ⓓ":"D","D":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ɗ":"D","Ɖ":"D","ᴅ":"D","Ꝺ":"D","Ð":"Dh","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"Dz","ɛ":"E","Ⓔ":"E","E":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","ᴇ":"E","ꝼ":"F","Ⓕ":"F","F":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","G":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","ɢ":"G","Ⓗ":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","I":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","J":"J","Ĵ":"J","Ɉ":"J","ȷ":"J","Ⓚ":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","L":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","M":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","ϻ":"M","Ꞥ":"N","Ƞ":"N","Ⓝ":"N","N":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ɲ":"N","Ꞑ":"N","ᴎ":"N","NJ":"NJ","Nj":"Nj","Ⓞ":"O","O":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Œ":"OE","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","P":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Q":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","R":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","S":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","T":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Þ":"Th","Ꜩ":"TZ","Ⓤ":"U","U":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","V":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","W":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Y":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Z":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","a":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ɑ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","Ƃ":"b","ⓒ":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c",C:"c","Ć":"c","Ĉ":"c","Ċ":"c","Č":"c","Ƈ":"c","Ȼ":"c","ⓓ":"d","d":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","Ƌ":"d","Ꮷ":"d","ԁ":"d","Ɦ":"d","ð":"dh","dz":"dz","dž":"dz","ⓔ":"e","e":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ff":"ff","fi":"fi","fl":"fl","ffi":"ffi","ffl":"ffl","ⓖ":"g","g":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ꝿ":"g","ᵹ":"g","ⓗ":"h","h":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","l":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","ɭ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ʼn":"n","ꞑ":"n","ꞥ":"n","ԉ":"n","nj":"nj","ⓞ":"o","o":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","ɔ":"o","ᴑ":"o","œ":"oe","ƣ":"oi","ꝏ":"oo","ȣ":"ou","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ρ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","r":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","s":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ʂ":"s","ß":"ss","ⓣ":"t","t":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","þ":"th","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","y":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z"}},{}],123:[function(t,e,r){"use strict";var i=t("./latinize-map.json");e.exports=function(t){return t.replace(/[^\u0000-\u007e]/g,t=>{return i[t]||t})}},{"./latinize-map.json":122}],124:[function(t,e,r){"use strict";r.resize=function(t,e){if(t.length===e){return t}else if(t.length>e){return t.slice(0,e)}return t+" ".repeat(e-t.length)};r.occurrenceCount=function(t,e,r=false){if(!t||!e){return 0}var i=0,n=0,s=r?1:e.length;while((n=t.indexOf(e,n))!==-1){i++;n+=s}return i}},{}],125:[function(t,e,r){"use strict";const x=1;const _=2;const C=3;const T=4;const S=5;function k(t,e){if(A(e)){return _}if(e<=31||e===127){return x}if(E(e)){return T}if(t.toUpperCase()!==t.toLowerCase()){return C}return S}function A(t){if(t===32||t===9||t===160||t===45||t===95){return true}return false}function E(t){if(t>=48&&t<=57){return true}return false}function i(t,e){t=""+t;e=""+e;var r,i,n,s,o,a,u,l=t.trim(),f=l.length,h,c,d,p,g,y,m,b=e.trim(),v=b.length,w=0;for(r=h=0;ry?1:-1}if(!w&&n!==d){w=n!==a?-1:1}break;case T:i=r+1;while(E(l.charCodeAt(i))){i++}u=parseFloat(l.slice(r,i));c=h+1;while(E(b.charCodeAt(c))){c++}m=parseFloat(b.slice(h,c));if(u!==m){return u-m}if(!w&&i-r!==c-h){w=i-r-(c-h)}r=i-1;h=c-1;break}}if(w){return w}return f-r-(v-h)||f-v||t.length-e.length}e.exports=i},{}],126:[function(t,e,r){"use strict";var n=t("./escape.js");r.regexp={};r.regexp.array2alternatives=function t(e){var r,i=e.slice();i.sort((t,e)=>{return e.length-t.length});for(r=0;r{if(!r||typeof r!=="string"){return""}var e=t.dashToSpace??a.dashToSpace,i=t.underscoreToSpace??a.underscoreToSpace,n=t.zealous??a.zealous,s=t.preserveAllCaps??a.preserveAllCaps,o=t.lowerCaseWords??a.lowerCaseWords;o=o instanceof Set?o:Array.isArray(o)?new Set(o):null;if(e){r=r.replace(/-+/g," ")}if(i){r=r.replace(/_+/g," ")}r=r.replace(/ +/g," ").trim();return r.replace(/[^\s_-]+/g,(e,t)=>{if(o&&t&&t+e.lengthString.fromCodePoint(...t);f.decode=t=>Array.from(t,t=>t.codePointAt(0));f.firstCodePoint=t=>t.codePointAt(0);f.firstChar=t=>t.length?String.fromCodePoint(t.codePointAt(0)):undefined;f.toArray=t=>Array.from(t);f.toCells=(t,e,r=4,i=0,...n)=>{var s,o,a,u,l=[];for(s of e){o=s.codePointAt(0);if(o===10){i=0}else if(o===9){a=r-i%r-1;l.push(new t("\t",1,...n));i+=1+a;while(a--){l.push(new t(" ",-2,...n))}}else{u=f.codePointWidth(o),l.push(new t(s,u,...n));i+=u;while(--u>0){l.push(new t(" ",-1,...n))}}}return l};f.fromCells=t=>{var e,r="";for(e of t){if(!e.filler){r+=e.char}}return r};f.length=t=>{var e,r=0;for(e of t){r++}return r};f.width=t=>{var e,r=0;for(e of t){r+=f.codePointWidth(e.codePointAt(0))}return r};f.arrayWidth=(t,e)=>{var r,i=0;if(e===undefined){e=t.length}for(r=0;rs;f.widthLimit=f.truncateWidth=(t,e)=>{var r,i,n=0;s=0;for(r of t){i=f.codePointWidth(r.codePointAt(0));if(s+i>e){return t.slice(0,n)}s+=i;n+=r.length}return t};f.surrogatePair=t=>{var e=t.charCodeAt(0);if(e<55296||e>=57344){return 0}else if(e<56320){return 1}return-1};f.isFullWidth=t=>f.isFullWidthCodePoint(t.codePointAt(0));f.charWidth=t=>f.codePointWidth(t.codePointAt(0));const i=new Map;(function(){var t=e("./unicode-emoji-width-ranges.json");for(let e of t){for(let t=e.s;t<=e.e;t++){i.set(t,e.w)}}})();f.codePointWidth=t=>{if(f.isEmojiCodePoint(t)){return i.get(t)??2}if(t>=4352&&(t<=4447||t===9001||t===9002||11904<=t&&t<=12871&&t!==12351||12880<=t&&t<=19903||19968<=t&&t<=42182||43360<=t&&t<=43388||44032<=t&&t<=55203||63744<=t&&t<=64255||65040<=t&&t<=65049||65072<=t&&t<=65131||65281<=t&&t<=65376||65504<=t&&t<=65510||110592<=t&&t<=110593||127488<=t&&t<=127569||131072<=t&&t<=262141)){return 2}if(f.isEmojiModifierCodePoint(t)||f.isZeroWidthDiacriticCodePoint(t)){return 0}return 1};f.isFullWidthCodePoint=t=>f.codePointWidth(t)===2;f.toFullWidth=t=>{return String.fromCodePoint(...Array.from(t,t=>{var e=t.codePointAt(0);return e>=33&&e<=126?65280+e-32:e}))};f.isZeroWidthDiacritic=t=>f.isZeroWidthDiacriticCodePoint(t.codePointAt(0));f.isZeroWidthDiacriticCodePoint=t=>768<=t&&t<=879||6832<=t&&t<=6911||7616<=t&&t<=7679||8400<=t&&t<=8447||65056<=t&&t<=65071||t===12441||t===12442||2304<=t&&t<=2307||2362<=t&&t<=2391&&t!==2365&&t!==2384||t===2402||t===2403||t===3633||3636<=t&&t<=3642||3655<=t&&t<=3662;f.isEmoji=t=>f.isEmojiCodePoint(t.codePointAt(0));f.isEmojiCodePoint=t=>9728<=t&&t<=9983||9984<=t&&t<=10175||126976<=t&&t<=127487||127744<=t&&t<=127994||128e3<=t&&t<=129791;f.isEmojiModifier=t=>f.isEmojiModifierCodePoint(t.codePointAt(0));f.isEmojiModifierCodePoint=t=>127995<=t&&t<=127999||t===65039},{"./unicode-emoji-width-ranges.json":129}],131:[function(t,e,r){"use strict";const w=t("./unicode.js");const x={"!":true,"?":true,":":true,";":true};e.exports=function t(e,r){var i=0,n,s,o,a,u,l,f,h,c,d,p=true,g=w.toArray(e),y=false,m,b=[];if(typeof r!=="object"){r={width:r}}if(!r.width||typeof r.width!=="number"||r.width<=0){r.width=80}o=r.offset?r.width-r.offset:r.width;if(typeof r.glue!=="string"){r.glue="\n"}if(r.regroupFn){g=r.regroupFn(g);d=r.charWidthFn||w.width}else{d=r.charWidthFn||w.charWidth}l=g.length;var v=()=>{if(!p||y){while(g[i]===" "){i++}if(y&&g[i]==="\n"){p=true;i++}}if(i>=l){return null}p=false;y=false;c=false;n=f=i;u=h=0;for(;;){if(n>=l){return g.slice(i,n).join("")}if(g[n]==="\n"){p=true;a=g.slice(i,n++).join("");if(r.fill){a+=" ".repeat(o-u)}return a}if(r.skipFn){s=r.skipFn(g,n);if(s!==n){n=s;continue}}if(g[n]===" "&&!c&&!x[g[n+1]]){f=n;h=u}else{c=false}u+=d(g[n]);if(u>o){y=true;if(f!==i){n=f}else if(oe===b.length-1?t:t.trimRight())}if(!r.noJoin){b=b.join(r.glue)}if(r.updateOffset){r.offset=u}return b}},{"./unicode.js":130}],132:[function(t,e,r){"use strict";function c(t,e){var r=Object.getPrototypeOf(t);if(c.opaque.has(r)){return c.opaque.get(r)(t)}var i,n,s,o,a,u,l=[{source:t,target:Array.isArray(t)?[]:Object.create(r)}],f=l[0].target,h=new Map;h.set(t,f);while(o=l.shift()){s=Object.getOwnPropertyNames(o.source);for(i=0;inew Date(t))},{}],133:[function(t,e,r){"use strict";function p(t,e,r){var i,n,s,o,a,u,l,f,h,c,d;u=typeof t;l=typeof e;if(!t||u!=="object"&&u!=="function"||!e||l!=="object"&&l!=="function"){throw new Error("[tree] diff() needs objects as argument #0 and #1")}if(!r||typeof r!=="object"){r={}}f=r.depth||0;if(!f){r.diffObject={};if(!r.path){r.path=""}if(!r.pathSeparator){r.pathSeparator="."}}h=r.diffObject;if(Array.isArray(t)){d=true;c=t.length}else{d=false;o=Object.keys(t);c=o.length}for(i=0;is(t,o(e));i.set=(t,e,r)=>{if(!t||typeof t!=="object"){return undefined}var i=o(e),n=i[i.length-1];if(typeof n==="object"||n==="__proto__"){throw new Error(a)}var s=u(t,i);s[n]=r;return r};i.define=(t,e,r)=>{if(!t||typeof t!=="object"){return undefined}var i=o(e),n=i[i.length-1];if(typeof n==="object"||n==="__proto__"){throw new Error(a)}var s=u(t,i);if(!(n in s)){s[n]=r}return r};i.inc=(t,e,r)=>{if(!t||typeof t!=="object"){return undefined}var i=o(e),n=i[i.length-1];if(typeof n==="object"||n==="__proto__"){throw new Error(a)}var s=u(t,i);if(typeof s[n]==="number"){s[n]++}else if(!s[n]||typeof s[n]!=="object"){s[n]=1}return r};i.dec=(t,e,r)=>{if(!t||typeof t!=="object"){return undefined}var i=o(e),n=i[i.length-1];if(typeof n==="object"||n==="__proto__"){throw new Error(a)}var s=u(t,i);if(typeof s[n]==="number"){s[n]--}else if(!s[n]||typeof s[n]!=="object"){s[n]=-1}return r};i.concat=(t,e,r)=>{if(!t||typeof t!=="object"){return undefined}var i=o(e),n=i[i.length-1];if(typeof n==="object"||n==="__proto__"){throw new Error(a)}var s=u(t,i);if(!s[n]){s[n]=r}else if(Array.isArray(s[n])&&Array.isArray(r)){s[n]=s[n].concat(r)}return r};i.insert=(t,e,r)=>{if(!t||typeof t!=="object"){return undefined}var i=o(e),n=i[i.length-1];if(typeof n==="object"||n==="__proto__"){throw new Error(a)}var s=u(t,i);if(!s[n]){s[n]=r}else if(Array.isArray(s[n])&&Array.isArray(r)){s[n]=r.concat(s[n])}return r};i.delete=(t,e)=>{var r=o(e),i=r[r.length-1];if(typeof i==="object"||i==="__proto__"){throw new Error(a)}var n=s(t,r,-1);if(!n||typeof n!=="object"){return false}return delete n[i]};i.autoPush=(t,e,r)=>{if(!t||typeof t!=="object"){return undefined}var i=o(e),n=i[i.length-1];if(typeof n==="object"||n==="__proto__"){throw new Error(a)}var s=u(t,i);if(s[n]===undefined){s[n]=r}else if(Array.isArray(s[n])){s[n].push(r)}else{s[n]=[s[n],r]}return s[n]};i.append=(t,e,r)=>{if(!t||typeof t!=="object"){return undefined}var i=o(e),n=i[i.length-1];if(typeof n==="object"||n==="__proto__"){throw new Error(a)}var s=u(t,i);if(!s[n]){s[n]=[r]}else if(Array.isArray(s[n])){s[n].push(r)}return s[n]};i.prepend=(t,e,r)=>{if(!t||typeof t!=="object"){return undefined}var i=o(e),n=i[i.length-1];if(typeof n==="object"||n==="__proto__"){throw new Error(a)}var s=u(t,i);if(!s[n]){s[n]=[r]}else if(Array.isArray(s[n])){s[n].unshift(r)}return s[n]}},{}],135:[function(t,e,r){"use strict";function i(t,e,...r){var i,n,s=false,o=r.length;if(!o){return e}if(!t||typeof t!=="object"){t={}}var a={depth:0,prefix:""};if(t.deep){if(Array.isArray(t.deep)){t.deep=new Set(t.deep)}else if(!(t.deep instanceof Set)){t.deep=true}}if(t.immutables){if(Array.isArray(t.immutables)){t.immutables=new Set(t.immutables)}else if(!(t.immutables instanceof Set)){delete t.immutables}}if(!t.maxDepth&&t.deep&&!t.circular){t.maxDepth=100}if(t.deepFunc){t.deep=true}if(t.flat){t.deep=true;t.proto=false;t.inherit=false;t.unflat=false;if(typeof t.flat!=="string"){t.flat="."}}if(t.unflat){t.deep=false;t.proto=false;t.inherit=false;t.flat=false;if(typeof t.unflat!=="string"){t.unflat="."}}if(t.inherit){t.own=true;t.proto=false}else if(t.proto){t.own=true}if(!e||typeof e!=="object"&&typeof e!=="function"){s=true}if(!t.skipRoot&&(t.inherit||t.proto)){for(i=o-1;i>=0;i--){n=r[i];if(n&&(typeof n==="object"||typeof n==="function")){if(t.inherit){if(s){e=Object.create(n)}else{Object.setPrototypeOf(e,n)}}else if(t.proto){if(s){e=Object.create(Object.getPrototypeOf(n))}else{Object.setPrototypeOf(e,Object.getPrototypeOf(n))}}break}}}else if(s){e={}}a.references={sources:[],targets:[]};for(i=0;ie.maxDepth){throw new Error("[tree] extend(): max depth reached("+e.maxDepth+")")}if(e.circular){t.references.sources.push(i);t.references.targets.push(r)}if(e.own){if(e.nonEnum){u=Object.getOwnPropertyNames(i)}else{u=Object.keys(i)}}else{u=i}for(l in u){if(e.own){l=u[l]}if(l==="__proto__"){continue}if(e.descriptor){d=Object.getOwnPropertyDescriptor(i,l);f=d.value}else{f=i[l]}g=r;p=t.prefix+l;if(e.nofunc&&typeof f==="function"){continue}if(e.unflat&&t.depth===0){a=l.split(e.unflat);o=a.length-1;if(o){for(s=0;s=0){continue}v({depth:t.depth+1,prefix:t.prefix+l+e.flat,references:t.references},e,g,f,n)}else{if(b>=0){y=t.references.targets[b];if(e.descriptor){Object.defineProperty(g,p,{value:y,enumerable:d.enumerable,writable:d.writable,configurable:d.configurable})}else{g[p]=y}continue}if(!m||!Object.prototype.hasOwnProperty.call(g,p)){if(Array.isArray(f)){y=[]}else if(e.proto){y=Object.create(c)}else if(e.inherit){y=Object.create(f)}else{y={}}if(e.descriptor){Object.defineProperty(g,p,{value:y,enumerable:d.enumerable,writable:d.writable,configurable:d.configurable})}else{g[p]=y}}else if(e.proto&&Object.getPrototypeOf(y)!==c){Object.setPrototypeOf(y,c)}else if(e.inherit&&Object.getPrototypeOf(y)!==f){Object.setPrototypeOf(y,f)}if(e.circular){t.references.sources.push(f);t.references.targets.push(y)}v({depth:t.depth+1,prefix:"",references:t.references},e,y,f,n)}}else if(n&&(y===undefined||m||h)){continue}else if(e.preserve&&y!==undefined){continue}else if(!e.inherit){if(e.descriptor){Object.defineProperty(g,p,d)}else{g[p]=y=f}}if(e.move){delete i[l]}}}},{}],136:[function(t,e,r){"use strict";r.defineLazyProperty=function t(e,r,i){Object.defineProperty(e,r,{configurable:true,enumerable:true,get:function(){var t=i();Object.defineProperty(e,r,{configurable:true,enumerable:true,writable:false,value:t});return t}})}},{}],137:[function(t,e,r){"use strict";const g=t("./tree.js");const i=t("util");const y={};e.exports=y;y.Mask=function t(){throw new Error("Cannot create a tree.Mask() directly")};const n={clone:false,path:"",pathSeparator:"."};y.createMask=function t(e,r){if(e===null||typeof e!=="object"){throw new TypeError("[tree] .createMask() : Argument #1 should be an object")}if(r!==null&&typeof r==="object"){r=g.extend(null,{},n,r)}else{r=n}var i=Object.create(y.Mask.prototype,{__options__:{value:r,writable:true}});g.extend(null,i,e);return i};y.Mask.prototype.applyTo=function t(e,r,i){if(e===null||typeof e!=="object"){throw new TypeError("[tree] .applyTo() : Argument #1 should be an object")}if(i){r=g.extend(null,{mask:this,options:this.__options__,path:this.__options__.path},r)}else if(r===undefined){r={mask:this,options:this.__options__,path:this.__options__.path}}var n,s,o,a,u,l,f=Object.keys(r.mask),h,c,d,p;if(Array.isArray(e)){o=[]}else{o={}}for(a=0;a=0){var a=n.indexOf("\n",o+1);n=n.substring(a+1)}this.stack=n}}};f.inherits(l.AssertionError,Error);function e(t,e){if(typeof t==="string"){return t.length=0;l--){if(o[l]!==a[l])return false}for(l=o.length-1;l>=0;l--){u=o[l];if(!m(t[u],e[u],r,i))return false}return true}l.notDeepEqual=function t(e,r,i){if(m(e,r,false)){g(e,r,i,"notDeepEqual",l.notDeepEqual)}};l.notDeepStrictEqual=w;function w(t,e,r){if(m(t,e,true)){g(t,e,r,"notDeepStrictEqual",w)}}l.strictEqual=function t(e,r,i){if(e!==r){g(e,r,i,"===",l.strictEqual)}};l.notStrictEqual=function t(e,r,i){if(e===r){g(e,r,i,"!==",l.notStrictEqual)}};function x(t,e){if(!t||!e){return false}if(Object.prototype.toString.call(e)=="[object RegExp]"){return e.test(t)}try{if(t instanceof e){return true}}catch(t){}if(Error.isPrototypeOf(e)){return false}return e.call({},t)===true}function _(t){var e;try{t()}catch(t){e=t}return e}function C(t,e,r,i){var n;if(typeof e!=="function"){throw new TypeError('"block" argument must be a function')}if(typeof r==="string"){i=r;r=null}n=_(e);i=(r&&r.name?" ("+r.name+").":".")+(i?" "+i:".");if(t&&!n){g(n,r,"Missing expected exception"+i)}var s=typeof i==="string";var o=!t&&f.isError(n);var a=!t&&n&&!r;if(o&&s&&x(n,r)||a){g(n,r,"Got unwanted exception"+i)}if(t&&n&&r&&!x(n,r)||!t&&n){throw n}}l.throws=function(t,e,r){C(true,t,e,r)};l.doesNotThrow=function(t,e,r){C(false,t,e,r)};l.ifError=function(t){if(t)throw t};function T(t,e){if(!t)g(t,true,e,"==",T)}l.strict=t(T,l,{equal:l.strictEqual,deepEqual:l.deepStrictEqual,notEqual:l.notStrictEqual,notDeepEqual:l.notDeepStrictEqual});l.strict.strict=l.strict;var S=Object.keys||function(t){var e=[];for(var r in t){if(i.call(t,r))e.push(r)}return e}}).call(this)}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"object-assign":171,"util/":145}],143:[function(t,e,r){if(typeof Object.create==="function"){e.exports=function t(e,r){e.super_=r;e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}})}}else{e.exports=function t(e,r){e.super_=r;var i=function(){};i.prototype=r.prototype;e.prototype=new i;e.prototype.constructor=e}}},{}],144:[function(t,e,r){e.exports=function t(e){return e&&typeof e==="object"&&typeof e.copy==="function"&&typeof e.fill==="function"&&typeof e.readUInt8==="function"}},{}],145:[function(P,t,j){(function(M,I){(function(){var a=/%[sdj%]/g;j.format=function(t){if(!x(t)){var e=[];for(var r=0;r=n)return t;switch(t){case"%s":return String(i[r++]);case"%d":return Number(i[r++]);case"%j":try{return JSON.stringify(i[r++])}catch(t){return"[Circular]"}default:return t}});for(var o=i[r];r=3)r.depth=arguments[2];if(arguments.length>=4)r.colors=arguments[3];if(o(e)){r.showHidden=e}else if(e){j._extend(r,e)}if(h(r.showHidden))r.showHidden=false;if(h(r.depth))r.depth=2;if(h(r.colors))r.colors=false;if(h(r.customInspect))r.customInspect=true;if(r.colors)r.stylize=n;return p(r,t,r.depth)}j.inspect=u;u.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]};u.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function n(t,e){var r=u.styles[e];if(r){return"["+u.colors[r][0]+"m"+t+"["+u.colors[r][1]+"m"}else{return t}}function s(t,e){return t}function d(t){var r={};t.forEach(function(t,e){r[t]=true});return r}function p(e,r,i){if(e.customInspect&&r&&S(r.inspect)&&r.inspect!==j.inspect&&!(r.constructor&&r.constructor.prototype===r)){var t=r.inspect(i,e);if(!x(t)){t=p(e,t,i)}return t}var n=g(e,r);if(n){return n}var s=Object.keys(r);var o=d(s);if(e.showHidden){s=Object.getOwnPropertyNames(r)}if(T(r)&&(s.indexOf("message")>=0||s.indexOf("description")>=0)){return y(r)}if(s.length===0){if(S(r)){var a=r.name?": "+r.name:"";return e.stylize("[Function"+a+"]","special")}if(_(r)){return e.stylize(RegExp.prototype.toString.call(r),"regexp")}if(C(r)){return e.stylize(Date.prototype.toString.call(r),"date")}if(T(r)){return y(r)}}var u="",l=false,f=["{","}"];if(w(r)){l=true;f=["[","]"]}if(S(r)){var h=r.name?": "+r.name:"";u=" [Function"+h+"]"}if(_(r)){u=" "+RegExp.prototype.toString.call(r)}if(C(r)){u=" "+Date.prototype.toUTCString.call(r)}if(T(r)){u=" "+y(r)}if(s.length===0&&(!l||r.length==0)){return f[0]+u+f[1]}if(i<0){if(_(r)){return e.stylize(RegExp.prototype.toString.call(r),"regexp")}else{return e.stylize("[Object]","special")}}e.seen.push(r);var c;if(l){c=m(e,r,i,o,s)}else{c=s.map(function(t){return b(e,r,i,o,t,l)})}e.seen.pop();return v(c,u,f)}function g(t,e){if(h(e))return t.stylize("undefined","undefined");if(x(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}if(f(e))return t.stylize(""+e,"number");if(o(e))return t.stylize(""+e,"boolean");if(l(e))return t.stylize("null","null")}function y(t){return"["+Error.prototype.toString.call(t)+"]"}function m(e,r,i,n,t){var s=[];for(var o=0,a=r.length;o-1){if(s){a=a.split("\n").map(function(t){return" "+t}).join("\n").substr(2)}else{a="\n"+a.split("\n").map(function(t){return" "+t}).join("\n")}}}else{a=t.stylize("[Circular]","special")}}if(h(o)){if(s&&n.match(/^\d+$/)){return a}o=JSON.stringify(""+n);if(o.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)){o=o.substr(1,o.length-2);o=t.stylize(o,"name")}else{o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'");o=t.stylize(o,"string")}}return o+": "+a}function v(t,e,r){var i=0;var n=t.reduce(function(t,e){i++;if(e.indexOf("\n")>=0)i++;return t+e.replace(/\u001b\[\d\d?m/g,"").length+1},0);if(n>60){return r[0]+(e===""?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1]}return r[0]+e+" "+t.join(", ")+" "+r[1]}function w(t){return Array.isArray(t)}j.isArray=w;function o(t){return typeof t==="boolean"}j.isBoolean=o;function l(t){return t===null}j.isNull=l;function e(t){return t==null}j.isNullOrUndefined=e;function f(t){return typeof t==="number"}j.isNumber=f;function x(t){return typeof t==="string"}j.isString=x;function r(t){return typeof t==="symbol"}j.isSymbol=r;function h(t){return t===void 0}j.isUndefined=h;function _(t){return c(t)&&A(t)==="[object RegExp]"}j.isRegExp=_;function c(t){return typeof t==="object"&&t!==null}j.isObject=c;function C(t){return c(t)&&A(t)==="[object Date]"}j.isDate=C;function T(t){return c(t)&&(A(t)==="[object Error]"||t instanceof Error)}j.isError=T;function S(t){return typeof t==="function"}j.isFunction=S;function k(t){return t===null||typeof t==="boolean"||typeof t==="number"||typeof t==="string"||typeof t==="symbol"||typeof t==="undefined"}j.isPrimitive=k;j.isBuffer=P("./support/isBuffer");function A(t){return Object.prototype.toString.call(t)}function E(t){return t<10?"0"+t.toString(10):t.toString(10)}var B=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function R(){var t=new Date;var e=[E(t.getHours()),E(t.getMinutes()),E(t.getSeconds())].join(":");return[t.getDate(),B[t.getMonth()],e].join(" ")}j.log=function(){console.log("%s - %s",R(),j.format.apply(j,arguments))};j.inherits=P("inherits");j._extend=function(t,e){if(!e||!c(e))return t;var r=Object.keys(e);var i=r.length;while(i--){t[r[i]]=e[r[i]]}return t};function O(t,e){return Object.prototype.hasOwnProperty.call(t,e)}}).call(this)}).call(this,P("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./support/isBuffer":144,_process:185,inherits:143}],146:[function(t,e,r){(function(t){(function(){"use strict";var i=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"];var n=typeof globalThis==="undefined"?t:globalThis;e.exports=function t(){var e=[];for(var r=0;r0){throw new Error("Invalid string. Length must be a multiple of 4")}var r=t.indexOf("=");if(r===-1)r=e;var i=r===e?0:4-r%4;return[r,i]}function o(t){var e=h(t);var r=e[0];var i=e[1];return(r+i)*3/4-i}function c(t,e,r){return(e+r)*3/4-r}function a(t){var e;var r=h(t);var i=r[0];var n=r[1];var s=new f(c(t,i,n));var o=0;var a=n>0?i-4:i;var u;for(u=0;u>16&255;s[o++]=e>>8&255;s[o++]=e&255}if(n===2){e=l[t.charCodeAt(u)]<<2|l[t.charCodeAt(u+1)]>>4;s[o++]=e&255}if(n===1){e=l[t.charCodeAt(u)]<<10|l[t.charCodeAt(u+1)]<<4|l[t.charCodeAt(u+2)]>>2;s[o++]=e>>8&255;s[o++]=e&255}return s}function d(t){return u[t>>18&63]+u[t>>12&63]+u[t>>6&63]+u[t&63]}function p(t,e,r){var i;var n=[];for(var s=e;sa?a:o+s))}if(i===1){e=t[r-1];n.push(u[e>>2]+u[e<<4&63]+"==")}else if(i===2){e=(t[r-2]<<8)+t[r-1];n.push(u[e>>10]+u[e>>4&63]+u[e<<2&63]+"=")}return n.join("")}},{}],148:[function(t,e,r){arguments[4][141][0].apply(r,arguments)},{dup:141}],149:[function(u,t,c){(function(f,h){(function(){"use strict";var l=u("assert");var s=u("pako/lib/zlib/zstream");var o=u("pako/lib/zlib/deflate.js");var a=u("pako/lib/zlib/inflate.js");var t=u("pako/lib/zlib/constants");for(var e in t){c[e]=t[e]}c.NONE=0;c.DEFLATE=1;c.INFLATE=2;c.GZIP=3;c.GUNZIP=4;c.DEFLATERAW=5;c.INFLATERAW=6;c.UNZIP=7;var r=31;var i=139;function n(t){if(typeof t!=="number"||tc.UNZIP){throw new TypeError("Bad argument")}this.dictionary=null;this.err=0;this.flush=0;this.init_done=false;this.level=0;this.memLevel=0;this.mode=t;this.strategy=0;this.windowBits=0;this.write_in_progress=false;this.pending_close=false;this.gzip_id_bytes_read=0}n.prototype.close=function(){if(this.write_in_progress){this.pending_close=true;return}this.pending_close=false;l(this.init_done,"close before init");l(this.mode<=c.UNZIP);if(this.mode===c.DEFLATE||this.mode===c.GZIP||this.mode===c.DEFLATERAW){o.deflateEnd(this.strm)}else if(this.mode===c.INFLATE||this.mode===c.GUNZIP||this.mode===c.INFLATERAW||this.mode===c.UNZIP){a.inflateEnd(this.strm)}this.mode=c.NONE;this.dictionary=null};n.prototype.write=function(t,e,r,i,n,s,o){return this._write(true,t,e,r,i,n,s,o)};n.prototype.writeSync=function(t,e,r,i,n,s,o){return this._write(false,t,e,r,i,n,s,o)};n.prototype._write=function(t,e,r,i,n,s,o,a){l.equal(arguments.length,8);l(this.init_done,"write before init");l(this.mode!==c.NONE,"already finalized");l.equal(false,this.write_in_progress,"write already in progress");l.equal(false,this.pending_close,"close is pending");this.write_in_progress=true;l.equal(false,e===undefined,"must provide flush value");this.write_in_progress=true;if(e!==c.Z_NO_FLUSH&&e!==c.Z_PARTIAL_FLUSH&&e!==c.Z_SYNC_FLUSH&&e!==c.Z_FULL_FLUSH&&e!==c.Z_FINISH&&e!==c.Z_BLOCK){throw new Error("Invalid flush value")}if(r==null){r=h.alloc(0);n=0;i=0}this.strm.avail_in=n;this.strm.input=r;this.strm.next_in=i;this.strm.avail_out=a;this.strm.output=s;this.strm.next_out=o;this.flush=e;if(!t){this._process();if(this._checkError()){return this._afterSync()}return}var u=this;f.nextTick(function(){u._process();u._after()});return this};n.prototype._afterSync=function(){var t=this.strm.avail_out;var e=this.strm.avail_in;this.write_in_progress=false;return[e,t]};n.prototype._process=function(){var t=null;switch(this.mode){case c.DEFLATE:case c.GZIP:case c.DEFLATERAW:this.err=o.deflate(this.strm,this.flush);break;case c.UNZIP:if(this.strm.avail_in>0){t=this.strm.next_in}switch(this.gzip_id_bytes_read){case 0:if(t===null){break}if(this.strm.input[t]===r){this.gzip_id_bytes_read=1;t++;if(this.strm.avail_in===1){break}}else{this.mode=c.INFLATE;break}case 1:if(t===null){break}if(this.strm.input[t]===i){this.gzip_id_bytes_read=2;this.mode=c.GUNZIP}else{this.mode=c.INFLATE}break;default:throw new Error("invalid number of gzip magic number bytes read")}case c.INFLATE:case c.GUNZIP:case c.INFLATERAW:this.err=a.inflate(this.strm,this.flush);if(this.err===c.Z_NEED_DICT&&this.dictionary){this.err=a.inflateSetDictionary(this.strm,this.dictionary);if(this.err===c.Z_OK){this.err=a.inflate(this.strm,this.flush)}else if(this.err===c.Z_DATA_ERROR){this.err=c.Z_NEED_DICT}}while(this.strm.avail_in>0&&this.mode===c.GUNZIP&&this.err===c.Z_STREAM_END&&this.strm.next_in[0]!==0){this.reset();this.err=a.inflate(this.strm,this.flush)}break;default:throw new Error("Unknown mode "+this.mode)}};n.prototype._checkError=function(){switch(this.err){case c.Z_OK:case c.Z_BUF_ERROR:if(this.strm.avail_out!==0&&this.flush===c.Z_FINISH){this._error("unexpected end of file");return false}break;case c.Z_STREAM_END:break;case c.Z_NEED_DICT:if(this.dictionary==null){this._error("Missing dictionary")}else{this._error("Bad dictionary")}return false;default:this._error("Zlib error");return false}return true};n.prototype._after=function(){if(!this._checkError()){return}var t=this.strm.avail_out;var e=this.strm.avail_in;this.write_in_progress=false;this.callback(e,t);if(this.pending_close){this.close()}};n.prototype._error=function(t){if(this.strm.msg){t=this.strm.msg}this.onerror(t,this.err);this.write_in_progress=false;if(this.pending_close){this.close()}};n.prototype.init=function(t,e,r,i,n){l(arguments.length===4||arguments.length===5,"init(windowBits, level, memLevel, strategy, [dictionary])");l(t>=8&&t<=15,"invalid windowBits");l(e>=-1&&e<=9,"invalid compression level");l(r>=1&&r<=9,"invalid memlevel");l(i===c.Z_FILTERED||i===c.Z_HUFFMAN_ONLY||i===c.Z_RLE||i===c.Z_FIXED||i===c.Z_DEFAULT_STRATEGY,"invalid strategy");this._init(e,t,r,i,n);this._setDictionary()};n.prototype.params=function(){throw new Error("deflateParams Not supported")};n.prototype.reset=function(){this._reset();this._setDictionary()};n.prototype._init=function(t,e,r,i,n){this.level=t;this.windowBits=e;this.memLevel=r;this.strategy=i;this.flush=c.Z_NO_FLUSH;this.err=c.Z_OK;if(this.mode===c.GZIP||this.mode===c.GUNZIP){this.windowBits+=16}if(this.mode===c.UNZIP){this.windowBits+=32}if(this.mode===c.DEFLATERAW||this.mode===c.INFLATERAW){this.windowBits=-1*this.windowBits}this.strm=new s;switch(this.mode){case c.DEFLATE:case c.GZIP:case c.DEFLATERAW:this.err=o.deflateInit2(this.strm,this.level,c.Z_DEFLATED,this.windowBits,this.memLevel,this.strategy);break;case c.INFLATE:case c.GUNZIP:case c.INFLATERAW:case c.UNZIP:this.err=a.inflateInit2(this.strm,this.windowBits);break;default:throw new Error("Unknown mode "+this.mode)}if(this.err!==c.Z_OK){this._error("Init error")}this.dictionary=n;this.write_in_progress=false;this.init_done=true};n.prototype._setDictionary=function(){if(this.dictionary==null){return}this.err=c.Z_OK;switch(this.mode){case c.DEFLATE:case c.DEFLATERAW:this.err=o.deflateSetDictionary(this.strm,this.dictionary);break;default:break}if(this.err!==c.Z_OK){this._error("Failed to set dictionary")}};n.prototype._reset=function(){this.err=c.Z_OK;switch(this.mode){case c.DEFLATE:case c.DEFLATERAW:case c.GZIP:this.err=o.deflateReset(this.strm);break;case c.INFLATE:case c.INFLATERAW:case c.GUNZIP:this.err=a.inflateReset(this.strm);break;default:break}if(this.err!==c.Z_OK){this._error("Failed to reset stream")}};c.Zlib=n}).call(this)}).call(this,u("_process"),u("buffer").Buffer)},{_process:185,assert:142,buffer:151,"pako/lib/zlib/constants":175,"pako/lib/zlib/deflate.js":177,"pako/lib/zlib/inflate.js":179,"pako/lib/zlib/zstream":183}],150:[function(E,t,B){(function(A){(function(){"use strict";var y=E("buffer").Buffer;var o=E("stream").Transform;var a=E("./binding");var t=E("util");var m=E("assert").ok;var b=E("buffer").kMaxLength;var v="Cannot create final Buffer. It would be larger "+"than 0x"+b.toString(16)+" bytes";a.Z_MIN_WINDOWBITS=8;a.Z_MAX_WINDOWBITS=15;a.Z_DEFAULT_WINDOWBITS=15;a.Z_MIN_CHUNK=64;a.Z_MAX_CHUNK=Infinity;a.Z_DEFAULT_CHUNK=16*1024;a.Z_MIN_MEMLEVEL=1;a.Z_MAX_MEMLEVEL=9;a.Z_DEFAULT_MEMLEVEL=8;a.Z_MIN_LEVEL=-1;a.Z_MAX_LEVEL=9;a.Z_DEFAULT_LEVEL=a.Z_DEFAULT_COMPRESSION;var e=Object.keys(a);for(var r=0;r=b){e=new RangeError(v)}else{t=y.concat(n,s)}n=[];r.close();i(e,t)}}function h(t,e){if(typeof e==="string")e=y.from(e);if(!y.isBuffer(e))throw new TypeError("Not a string or buffer");var r=t._finishFlushFlag;return t._processChunk(e,r)}function c(t){if(!(this instanceof c))return new c(t);T.call(this,t,a.DEFLATE)}function d(t){if(!(this instanceof d))return new d(t);T.call(this,t,a.INFLATE)}function p(t){if(!(this instanceof p))return new p(t);T.call(this,t,a.GZIP)}function g(t){if(!(this instanceof g))return new g(t);T.call(this,t,a.GUNZIP)}function w(t){if(!(this instanceof w))return new w(t);T.call(this,t,a.DEFLATERAW)}function x(t){if(!(this instanceof x))return new x(t);T.call(this,t,a.INFLATERAW)}function _(t){if(!(this instanceof _))return new _(t);T.call(this,t,a.UNZIP)}function C(t){return t===a.Z_NO_FLUSH||t===a.Z_PARTIAL_FLUSH||t===a.Z_SYNC_FLUSH||t===a.Z_FULL_FLUSH||t===a.Z_FINISH||t===a.Z_BLOCK}function T(t,e){var r=this;this._opts=t=t||{};this._chunkSize=t.chunkSize||B.Z_DEFAULT_CHUNK;o.call(this,t);if(t.flush&&!C(t.flush)){throw new Error("Invalid flush flag: "+t.flush)}if(t.finishFlush&&!C(t.finishFlush)){throw new Error("Invalid flush flag: "+t.finishFlush)}this._flushFlag=t.flush||a.Z_NO_FLUSH;this._finishFlushFlag=typeof t.finishFlush!=="undefined"?t.finishFlush:a.Z_FINISH;if(t.chunkSize){if(t.chunkSizeB.Z_MAX_CHUNK){throw new Error("Invalid chunk size: "+t.chunkSize)}}if(t.windowBits){if(t.windowBitsB.Z_MAX_WINDOWBITS){throw new Error("Invalid windowBits: "+t.windowBits)}}if(t.level){if(t.levelB.Z_MAX_LEVEL){throw new Error("Invalid compression level: "+t.level)}}if(t.memLevel){if(t.memLevelB.Z_MAX_MEMLEVEL){throw new Error("Invalid memLevel: "+t.memLevel)}}if(t.strategy){if(t.strategy!=B.Z_FILTERED&&t.strategy!=B.Z_HUFFMAN_ONLY&&t.strategy!=B.Z_RLE&&t.strategy!=B.Z_FIXED&&t.strategy!=B.Z_DEFAULT_STRATEGY){throw new Error("Invalid strategy: "+t.strategy)}}if(t.dictionary){if(!y.isBuffer(t.dictionary)){throw new Error("Invalid dictionary: it should be a Buffer instance")}}this._handle=new a.Zlib(e);var i=this;this._hadError=false;this._handle.onerror=function(t,e){S(i);i._hadError=true;var r=new Error(t);r.errno=e;r.code=B.codes[e];i.emit("error",r)};var n=B.Z_DEFAULT_COMPRESSION;if(typeof t.level==="number")n=t.level;var s=B.Z_DEFAULT_STRATEGY;if(typeof t.strategy==="number")s=t.strategy;this._handle.init(t.windowBits||B.Z_DEFAULT_WINDOWBITS,n,t.memLevel||B.Z_DEFAULT_MEMLEVEL,s,t.dictionary);this._buffer=y.allocUnsafe(this._chunkSize);this._offset=0;this._level=n;this._strategy=s;this.once("end",this.close);Object.defineProperty(this,"_closed",{get:function(){return!r._handle},configurable:true,enumerable:true})}t.inherits(T,o);T.prototype.params=function(t,e,r){if(tB.Z_MAX_LEVEL){throw new RangeError("Invalid compression level: "+t)}if(e!=B.Z_FILTERED&&e!=B.Z_HUFFMAN_ONLY&&e!=B.Z_RLE&&e!=B.Z_FIXED&&e!=B.Z_DEFAULT_STRATEGY){throw new TypeError("Invalid strategy: "+e)}if(this._level!==t||this._strategy!==e){var i=this;this.flush(a.Z_SYNC_FLUSH,function(){m(i._handle,"zlib binding closed");i._handle.params(t,e);if(!i._hadError){i._level=t;i._strategy=e;if(r)r()}})}else{A.nextTick(r)}};T.prototype.reset=function(){m(this._handle,"zlib binding closed");return this._handle.reset()};T.prototype._flush=function(t){this._transform(y.alloc(0),"",t)};T.prototype.flush=function(t,e){var r=this;var i=this._writableState;if(typeof t==="function"||t===undefined&&!e){e=t;t=a.Z_FULL_FLUSH}if(i.ended){if(e)A.nextTick(e)}else if(i.ending){if(e)this.once("end",e)}else if(i.needDrain){if(e){this.once("drain",function(){return r.flush(t,e)})}}else{this._flushFlag=t;this.write(y.alloc(0),"",e)}};T.prototype.close=function(t){S(this,t);A.nextTick(k,this)};function S(t,e){if(e)A.nextTick(e);if(!t._handle)return;t._handle.close();t._handle=null}function k(t){t.emit("close")}T.prototype._transform=function(t,e,r){var i;var n=this._writableState;var s=n.ending||n.ended;var o=s&&(!t||n.length===t.length);if(t!==null&&!y.isBuffer(t))return r(new Error("invalid input"));if(!this._handle)return r(new Error("zlib binding closed"));if(o)i=this._finishFlushFlag;else{i=this._flushFlag;if(t.length>=n.length){this._flushFlag=this._opts.flush||a.Z_NO_FLUSH}}this._processChunk(t,i,r)};T.prototype._processChunk=function(s,o,a){var u=s&&s.length;var l=this._chunkSize-this._offset;var f=0;var h=this;var c=typeof a==="function";if(!c){var d=[];var p=0;var e;this.on("error",function(t){e=t});m(this._handle,"zlib binding closed");do{var t=this._handle.writeSync(o,s,f,u,this._buffer,this._offset,l)}while(!this._hadError&&g(t[0],t[1]));if(this._hadError){throw e}if(p>=b){S(this);throw new RangeError(v)}var r=y.concat(d,p);S(this);return r}m(this._handle,"zlib binding closed");var i=this._handle.write(o,s,f,u,this._buffer,this._offset,l);i.buffer=s;i.callback=g;function g(t,e){if(this){this.buffer=null;this.callback=null}if(h._hadError)return;var r=l-e;m(r>=0,"have should not go down");if(r>0){var i=h._buffer.slice(h._offset,h._offset+r);h._offset+=r;if(c){h.push(i)}else{d.push(i);p+=i.length}}if(e===0||h._offset>=h._chunkSize){l=h._chunkSize;h._offset=0;h._buffer=y.allocUnsafe(h._chunkSize)}if(e===0){f+=u-t;u=t;if(!c)return true;var n=h._handle.write(o,s,f,u,h._buffer,h._offset,h._chunkSize);n.callback=g;n.buffer=s;return}if(!c)return false;a()}};t.inherits(c,T);t.inherits(d,T);t.inherits(p,T);t.inherits(g,T);t.inherits(w,T);t.inherits(x,T);t.inherits(_,T)}).call(this)}).call(this,E("_process"))},{"./binding":149,_process:185,assert:142,buffer:151,stream:187,util:208}],151:[function(q,t,J){(function(t){(function(){"use strict";var i=q("base64-js");var s=q("ieee754");J.Buffer=c;J.SlowBuffer=e;J.INSPECT_MAX_BYTES=50;var r=2147483647;J.kMaxLength=r;c.TYPED_ARRAY_SUPPORT=t();if(!c.TYPED_ARRAY_SUPPORT&&typeof console!=="undefined"&&typeof console.error==="function"){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.")}function t(){try{var t=new Uint8Array(1);t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}};return t.foo()===42}catch(t){return false}}Object.defineProperty(c.prototype,"parent",{enumerable:true,get:function(){if(!c.isBuffer(this))return undefined;return this.buffer}});Object.defineProperty(c.prototype,"offset",{enumerable:true,get:function(){if(!c.isBuffer(this))return undefined;return this.byteOffset}});function o(t){if(t>r){throw new RangeError('The value "'+t+'" is invalid for option "size"')}var e=new Uint8Array(t);e.__proto__=c.prototype;return e}function c(t,e,r){if(typeof t==="number"){if(typeof e==="string"){throw new TypeError('The "string" argument must be of type string. Received type number')}return l(t)}return n(t,e,r)}if(typeof Symbol!=="undefined"&&Symbol.species!=null&&c[Symbol.species]===c){Object.defineProperty(c,Symbol.species,{value:null,configurable:true,enumerable:false,writable:false})}c.poolSize=8192;function n(t,e,r){if(typeof t==="string"){return f(t,e)}if(ArrayBuffer.isView(t)){return h(t)}if(t==null){throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, "+"or Array-like Object. Received type "+typeof t)}if(P(t,ArrayBuffer)||t&&P(t.buffer,ArrayBuffer)){return d(t,e,r)}if(typeof t==="number"){throw new TypeError('The "value" argument must not be of type number. Received type number')}var i=t.valueOf&&t.valueOf();if(i!=null&&i!==t){return c.from(i,e,r)}var n=p(t);if(n)return n;if(typeof Symbol!=="undefined"&&Symbol.toPrimitive!=null&&typeof t[Symbol.toPrimitive]==="function"){return c.from(t[Symbol.toPrimitive]("string"),e,r)}throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, "+"or Array-like Object. Received type "+typeof t)}c.from=function(t,e,r){return n(t,e,r)};c.prototype.__proto__=Uint8Array.prototype;c.__proto__=Uint8Array;function a(t){if(typeof t!=="number"){throw new TypeError('"size" argument must be of type number')}else if(t<0){throw new RangeError('The value "'+t+'" is invalid for option "size"')}}function u(t,e,r){a(t);if(t<=0){return o(t)}if(e!==undefined){return typeof r==="string"?o(t).fill(e,r):o(t).fill(e)}return o(t)}c.alloc=function(t,e,r){return u(t,e,r)};function l(t){a(t);return o(t<0?0:g(t)|0)}c.allocUnsafe=function(t){return l(t)};c.allocUnsafeSlow=function(t){return l(t)};function f(t,e){if(typeof e!=="string"||e===""){e="utf8"}if(!c.isEncoding(e)){throw new TypeError("Unknown encoding: "+e)}var r=y(t,e)|0;var i=o(r);var n=i.write(t,e);if(n!==r){i=i.slice(0,n)}return i}function h(t){var e=t.length<0?0:g(t.length)|0;var r=o(e);for(var i=0;i=r){throw new RangeError("Attempt to allocate Buffer larger than maximum "+"size: 0x"+r.toString(16)+" bytes")}return t|0}function e(t){if(+t!=t){t=0}return c.alloc(+t)}c.isBuffer=function t(e){return e!=null&&e._isBuffer===true&&e!==c.prototype};c.compare=function t(e,r){if(P(e,Uint8Array))e=c.from(e,e.offset,e.byteLength);if(P(r,Uint8Array))r=c.from(r,r.offset,r.byteLength);if(!c.isBuffer(e)||!c.isBuffer(r)){throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array')}if(e===r)return 0;var i=e.length;var n=r.length;for(var s=0,o=Math.min(i,n);s2&&arguments[2]===true;if(!i&&r===0)return 0;var n=false;for(;;){switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return O(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return M(t).length;default:if(n){return i?-1:O(t).length}e=(""+e).toLowerCase();n=true}}}c.byteLength=y;function m(t,e,r){var i=false;if(e===undefined||e<0){e=0}if(e>this.length){return""}if(r===undefined||r>this.length){r=this.length}if(r<=0){return""}r>>>=0;e>>>=0;if(r<=e){return""}if(!t)t="utf8";while(true){switch(t){case"hex":return z(this,e,r);case"utf8":case"utf-8":return T(this,e,r);case"ascii":return N(this,e,r);case"latin1":case"binary":return U(this,e,r);case"base64":return W(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Y(this,e,r);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase();i=true}}}c.prototype._isBuffer=true;function b(t,e,r){var i=t[e];t[e]=t[r];t[r]=i}c.prototype.swap16=function t(){var e=this.length;if(e%2!==0){throw new RangeError("Buffer size must be a multiple of 16-bits")}for(var r=0;rr)e+=" ... ";return""};c.prototype.compare=function t(e,r,i,n,s){if(P(e,Uint8Array)){e=c.from(e,e.offset,e.byteLength)}if(!c.isBuffer(e)){throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. '+"Received type "+typeof e)}if(r===undefined){r=0}if(i===undefined){i=e?e.length:0}if(n===undefined){n=0}if(s===undefined){s=this.length}if(r<0||i>e.length||n<0||s>this.length){throw new RangeError("out of range index")}if(n>=s&&r>=i){return 0}if(n>=s){return-1}if(r>=i){return 1}r>>>=0;i>>>=0;n>>>=0;s>>>=0;if(this===e)return 0;var o=s-n;var a=i-r;var u=Math.min(o,a);var l=this.slice(n,s);var f=e.slice(r,i);for(var h=0;h2147483647){r=2147483647}else if(r<-2147483648){r=-2147483648}r=+r;if(j(r)){r=n?0:t.length-1}if(r<0)r=t.length+r;if(r>=t.length){if(n)return-1;else r=t.length-1}else if(r<0){if(n)r=0;else return-1}if(typeof e==="string"){e=c.from(e,i)}if(c.isBuffer(e)){if(e.length===0){return-1}return w(t,e,r,i,n)}else if(typeof e==="number"){e=e&255;if(typeof Uint8Array.prototype.indexOf==="function"){if(n){return Uint8Array.prototype.indexOf.call(t,e,r)}else{return Uint8Array.prototype.lastIndexOf.call(t,e,r)}}return w(t,[e],r,i,n)}throw new TypeError("val must be string, number or Buffer")}function w(t,e,r,i,n){var s=1;var o=t.length;var a=e.length;if(i!==undefined){i=String(i).toLowerCase();if(i==="ucs2"||i==="ucs-2"||i==="utf16le"||i==="utf-16le"){if(t.length<2||e.length<2){return-1}s=2;o/=2;a/=2;r/=2}}function u(t,e){if(s===1){return t[e]}else{return t.readUInt16BE(e*s)}}var l;if(n){var f=-1;for(l=r;lo)r=o-a;for(l=r;l>=0;l--){var h=true;for(var c=0;cn){i=n}}var s=e.length;if(i>s/2){i=s/2}for(var o=0;o>>0;if(isFinite(i)){i=i>>>0;if(n===undefined)n="utf8"}else{n=i;i=undefined}}else{throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported")}var s=this.length-r;if(i===undefined||i>s)i=s;if(e.length>0&&(i<0||r<0)||r>this.length){throw new RangeError("Attempt to write outside buffer bounds")}if(!n)n="utf8";var o=false;for(;;){switch(n){case"hex":return x(this,e,r,i);case"utf8":case"utf-8":return _(this,e,r,i);case"ascii":return C(this,e,r,i);case"latin1":case"binary":return L(this,e,r,i);case"base64":return D(this,e,r,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return F(this,e,r,i);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase();o=true}}};c.prototype.toJSON=function t(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function W(t,e,r){if(e===0&&r===t.length){return i.fromByteArray(t)}else{return i.fromByteArray(t.slice(e,r))}}function T(t,e,r){r=Math.min(t.length,r);var i=[];var n=e;while(n239?4:s>223?3:s>191?2:1;if(n+a<=r){var u,l,f,h;switch(a){case 1:if(s<128){o=s}break;case 2:u=t[n+1];if((u&192)===128){h=(s&31)<<6|u&63;if(h>127){o=h}}break;case 3:u=t[n+1];l=t[n+2];if((u&192)===128&&(l&192)===128){h=(s&15)<<12|(u&63)<<6|l&63;if(h>2047&&(h<55296||h>57343)){o=h}}break;case 4:u=t[n+1];l=t[n+2];f=t[n+3];if((u&192)===128&&(l&192)===128&&(f&192)===128){h=(s&15)<<18|(u&63)<<12|(l&63)<<6|f&63;if(h>65535&&h<1114112){o=h}}}}if(o===null){o=65533;a=1}else if(o>65535){o-=65536;i.push(o>>>10&1023|55296);o=56320|o&1023}i.push(o);n+=a}return H(i)}var S=4096;function H(t){var e=t.length;if(e<=S){return String.fromCharCode.apply(String,t)}var r="";var i=0;while(ii)r=i;var n="";for(var s=e;si){e=i}if(r<0){r+=i;if(r<0)r=0}else if(r>i){r=i}if(rr)throw new RangeError("Trying to access beyond buffer length")}c.prototype.readUIntLE=function t(e,r,i){e=e>>>0;r=r>>>0;if(!i)k(e,r,this.length);var n=this[e];var s=1;var o=0;while(++o>>0;r=r>>>0;if(!i){k(e,r,this.length)}var n=this[e+--r];var s=1;while(r>0&&(s*=256)){n+=this[e+--r]*s}return n};c.prototype.readUInt8=function t(e,r){e=e>>>0;if(!r)k(e,1,this.length);return this[e]};c.prototype.readUInt16LE=function t(e,r){e=e>>>0;if(!r)k(e,2,this.length);return this[e]|this[e+1]<<8};c.prototype.readUInt16BE=function t(e,r){e=e>>>0;if(!r)k(e,2,this.length);return this[e]<<8|this[e+1]};c.prototype.readUInt32LE=function t(e,r){e=e>>>0;if(!r)k(e,4,this.length);return(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};c.prototype.readUInt32BE=function t(e,r){e=e>>>0;if(!r)k(e,4,this.length);return this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};c.prototype.readIntLE=function t(e,r,i){e=e>>>0;r=r>>>0;if(!i)k(e,r,this.length);var n=this[e];var s=1;var o=0;while(++o=s)n-=Math.pow(2,8*r);return n};c.prototype.readIntBE=function t(e,r,i){e=e>>>0;r=r>>>0;if(!i)k(e,r,this.length);var n=r;var s=1;var o=this[e+--n];while(n>0&&(s*=256)){o+=this[e+--n]*s}s*=128;if(o>=s)o-=Math.pow(2,8*r);return o};c.prototype.readInt8=function t(e,r){e=e>>>0;if(!r)k(e,1,this.length);if(!(this[e]&128))return this[e];return(255-this[e]+1)*-1};c.prototype.readInt16LE=function t(e,r){e=e>>>0;if(!r)k(e,2,this.length);var i=this[e]|this[e+1]<<8;return i&32768?i|4294901760:i};c.prototype.readInt16BE=function t(e,r){e=e>>>0;if(!r)k(e,2,this.length);var i=this[e+1]|this[e]<<8;return i&32768?i|4294901760:i};c.prototype.readInt32LE=function t(e,r){e=e>>>0;if(!r)k(e,4,this.length);return this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};c.prototype.readInt32BE=function t(e,r){e=e>>>0;if(!r)k(e,4,this.length);return this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};c.prototype.readFloatLE=function t(e,r){e=e>>>0;if(!r)k(e,4,this.length);return s.read(this,e,true,23,4)};c.prototype.readFloatBE=function t(e,r){e=e>>>0;if(!r)k(e,4,this.length);return s.read(this,e,false,23,4)};c.prototype.readDoubleLE=function t(e,r){e=e>>>0;if(!r)k(e,8,this.length);return s.read(this,e,true,52,8)};c.prototype.readDoubleBE=function t(e,r){e=e>>>0;if(!r)k(e,8,this.length);return s.read(this,e,false,52,8)};function A(t,e,r,i,n,s){if(!c.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>n||et.length)throw new RangeError("Index out of range")}c.prototype.writeUIntLE=function t(e,r,i,n){e=+e;r=r>>>0;i=i>>>0;if(!n){var s=Math.pow(2,8*i)-1;A(this,e,r,i,s,0)}var o=1;var a=0;this[r]=e&255;while(++a>>0;i=i>>>0;if(!n){var s=Math.pow(2,8*i)-1;A(this,e,r,i,s,0)}var o=i-1;var a=1;this[r+o]=e&255;while(--o>=0&&(a*=256)){this[r+o]=e/a&255}return r+i};c.prototype.writeUInt8=function t(e,r,i){e=+e;r=r>>>0;if(!i)A(this,e,r,1,255,0);this[r]=e&255;return r+1};c.prototype.writeUInt16LE=function t(e,r,i){e=+e;r=r>>>0;if(!i)A(this,e,r,2,65535,0);this[r]=e&255;this[r+1]=e>>>8;return r+2};c.prototype.writeUInt16BE=function t(e,r,i){e=+e;r=r>>>0;if(!i)A(this,e,r,2,65535,0);this[r]=e>>>8;this[r+1]=e&255;return r+2};c.prototype.writeUInt32LE=function t(e,r,i){e=+e;r=r>>>0;if(!i)A(this,e,r,4,4294967295,0);this[r+3]=e>>>24;this[r+2]=e>>>16;this[r+1]=e>>>8;this[r]=e&255;return r+4};c.prototype.writeUInt32BE=function t(e,r,i){e=+e;r=r>>>0;if(!i)A(this,e,r,4,4294967295,0);this[r]=e>>>24;this[r+1]=e>>>16;this[r+2]=e>>>8;this[r+3]=e&255;return r+4};c.prototype.writeIntLE=function t(e,r,i,n){e=+e;r=r>>>0;if(!n){var s=Math.pow(2,8*i-1);A(this,e,r,i,s-1,-s)}var o=0;var a=1;var u=0;this[r]=e&255;while(++o>0)-u&255}return r+i};c.prototype.writeIntBE=function t(e,r,i,n){e=+e;r=r>>>0;if(!n){var s=Math.pow(2,8*i-1);A(this,e,r,i,s-1,-s)}var o=i-1;var a=1;var u=0;this[r+o]=e&255;while(--o>=0&&(a*=256)){if(e<0&&u===0&&this[r+o+1]!==0){u=1}this[r+o]=(e/a>>0)-u&255}return r+i};c.prototype.writeInt8=function t(e,r,i){e=+e;r=r>>>0;if(!i)A(this,e,r,1,127,-128);if(e<0)e=255+e+1;this[r]=e&255;return r+1};c.prototype.writeInt16LE=function t(e,r,i){e=+e;r=r>>>0;if(!i)A(this,e,r,2,32767,-32768);this[r]=e&255;this[r+1]=e>>>8;return r+2};c.prototype.writeInt16BE=function t(e,r,i){e=+e;r=r>>>0;if(!i)A(this,e,r,2,32767,-32768);this[r]=e>>>8;this[r+1]=e&255;return r+2};c.prototype.writeInt32LE=function t(e,r,i){e=+e;r=r>>>0;if(!i)A(this,e,r,4,2147483647,-2147483648);this[r]=e&255;this[r+1]=e>>>8;this[r+2]=e>>>16;this[r+3]=e>>>24;return r+4};c.prototype.writeInt32BE=function t(e,r,i){e=+e;r=r>>>0;if(!i)A(this,e,r,4,2147483647,-2147483648);if(e<0)e=4294967295+e+1;this[r]=e>>>24;this[r+1]=e>>>16;this[r+2]=e>>>8;this[r+3]=e&255;return r+4};function E(t,e,r,i,n,s){if(r+i>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function B(t,e,r,i,n){e=+e;r=r>>>0;if(!n){E(t,e,r,4,34028234663852886e22,-34028234663852886e22)}s.write(t,e,r,i,23,4);return r+4}c.prototype.writeFloatLE=function t(e,r,i){return B(this,e,r,true,i)};c.prototype.writeFloatBE=function t(e,r,i){return B(this,e,r,false,i)};function R(t,e,r,i,n){e=+e;r=r>>>0;if(!n){E(t,e,r,8,17976931348623157e292,-17976931348623157e292)}s.write(t,e,r,i,52,8);return r+8}c.prototype.writeDoubleLE=function t(e,r,i){return R(this,e,r,true,i)};c.prototype.writeDoubleBE=function t(e,r,i){return R(this,e,r,false,i)};c.prototype.copy=function t(e,r,i,n){if(!c.isBuffer(e))throw new TypeError("argument should be a Buffer");if(!i)i=0;if(!n&&n!==0)n=this.length;if(r>=e.length)r=e.length;if(!r)r=0;if(n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");if(n>this.length)n=this.length;if(e.length-r=0;--o){e[o+r]=this[o+i]}}else{Uint8Array.prototype.set.call(e,this.subarray(i,n),r)}return s};c.prototype.fill=function t(e,r,i,n){if(typeof e==="string"){if(typeof r==="string"){n=r;r=0;i=this.length}else if(typeof i==="string"){n=i;i=this.length}if(n!==undefined&&typeof n!=="string"){throw new TypeError("encoding must be a string")}if(typeof n==="string"&&!c.isEncoding(n)){throw new TypeError("Unknown encoding: "+n)}if(e.length===1){var s=e.charCodeAt(0);if(n==="utf8"&&s<128||n==="latin1"){e=s}}}else if(typeof e==="number"){e=e&255}if(r<0||this.length>>0;i=i===undefined?this.length:i>>>0;if(!e)e=0;var o;if(typeof e==="number"){for(o=r;o55295&&r<57344){if(!n){if(r>56319){if((e-=3)>-1)s.push(239,191,189);continue}else if(o+1===i){if((e-=3)>-1)s.push(239,191,189);continue}n=r;continue}if(r<56320){if((e-=3)>-1)s.push(239,191,189);n=r;continue}r=(n-55296<<10|r-56320)+65536}else if(n){if((e-=3)>-1)s.push(239,191,189)}n=null;if(r<128){if((e-=1)<0)break;s.push(r)}else if(r<2048){if((e-=2)<0)break;s.push(r>>6|192,r&63|128)}else if(r<65536){if((e-=3)<0)break;s.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((e-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else{throw new Error("Invalid code point")}}return s}function K(t){var e=[];for(var r=0;r>8;n=r%256;s.push(n);s.push(i)}return s}function M(t){return i.toByteArray(G(t))}function I(t,e,r,i){for(var n=0;n=e.length||n>=t.length)break;e[n+r]=t[n]}return n}function P(t,e){return t instanceof e||t!=null&&t.constructor!=null&&t.constructor.name!=null&&t.constructor.name===e.name}function j(t){return t!==t}}).call(this)}).call(this,q("buffer").Buffer)},{"base64-js":147,buffer:151,ieee754:164}],152:[function(t,e,r){"use strict";var n=t("get-intrinsic");var s=t("./");var o=s(n("String.prototype.indexOf"));e.exports=function t(e,r){var i=n(e,!!r);if(typeof i==="function"&&o(e,".prototype.")>-1){return s(i)}return i}},{"./":153,"get-intrinsic":159}],153:[function(t,e,r){"use strict";var n=t("function-bind");var i=t("get-intrinsic");var s=i("%Function.prototype.apply%");var o=i("%Function.prototype.call%");var a=i("%Reflect.apply%",true)||n.call(o,s);var u=i("%Object.getOwnPropertyDescriptor%",true);var l=i("%Object.defineProperty%",true);var f=i("%Math.max%");if(l){try{l({},"a",{value:1})}catch(t){l=null}}e.exports=function t(e){var r=a(n,o,arguments);if(u&&l){var i=u(r,"length");if(i.configurable){l(r,"length",{value:1+f(0,e.length-(arguments.length-1))})}}return r};var h=function t(){return a(n,s,arguments)};if(l){l(e.exports,"apply",{value:h})}else{e.exports.apply=h}},{"function-bind":158,"get-intrinsic":159}],154:[function(t,e,r){"use strict";var i=t("get-intrinsic");var n=i("%Object.getOwnPropertyDescriptor%",true);if(n){try{n([],"length")}catch(t){n=null}}e.exports=n},{"get-intrinsic":159}],155:[function(t,e,r){"use strict";var i=typeof Reflect==="object"?Reflect:null;var h=i&&typeof i.apply==="function"?i.apply:function t(e,r,i){return Function.prototype.apply.call(e,r,i)};var n;if(i&&typeof i.ownKeys==="function"){n=i.ownKeys}else if(Object.getOwnPropertySymbols){n=function t(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}}else{n=function t(e){return Object.getOwnPropertyNames(e)}}function u(t){if(console&&console.warn)console.warn(t)}var s=Number.isNaN||function t(e){return e!==e};function o(){o.init.call(this)}e.exports=o;e.exports.once=w;o.EventEmitter=o;o.prototype._events=undefined;o.prototype._eventsCount=0;o.prototype._maxListeners=undefined;var a=10;function l(t){if(typeof t!=="function"){throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}}Object.defineProperty(o,"defaultMaxListeners",{enumerable:true,get:function(){return a},set:function(t){if(typeof t!=="number"||t<0||s(t)){throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".")}a=t}});o.init=function(){if(this._events===undefined||this._events===Object.getPrototypeOf(this)._events){this._events=Object.create(null);this._eventsCount=0}this._maxListeners=this._maxListeners||undefined};o.prototype.setMaxListeners=function t(e){if(typeof e!=="number"||e<0||s(e)){throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".")}this._maxListeners=e;return this};function f(t){if(t._maxListeners===undefined)return o.defaultMaxListeners;return t._maxListeners}o.prototype.getMaxListeners=function t(){return f(this)};o.prototype.emit=function t(e){var r=[];for(var i=1;i0)o=r[0];if(o instanceof Error){throw o}var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));a.context=o;throw a}var u=s[e];if(u===undefined)return false;if(typeof u==="function"){h(u,this,r)}else{var l=u.length;var f=m(u,l);for(var i=0;i0&&o.length>n&&!o.warned){o.warned=true;var a=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners "+"added. Use emitter.setMaxListeners() to "+"increase limit");a.name="MaxListenersExceededWarning";a.emitter=t;a.type=e;a.count=o.length;u(a)}}return t}o.prototype.addListener=function t(e,r){return c(this,e,r,false)};o.prototype.on=o.prototype.addListener;o.prototype.prependListener=function t(e,r){return c(this,e,r,true)};function d(){if(!this.fired){this.target.removeListener(this.type,this.wrapFn);this.fired=true;if(arguments.length===0)return this.listener.call(this.target);return this.listener.apply(this.target,arguments)}}function p(t,e,r){var i={fired:false,wrapFn:undefined,target:t,type:e,listener:r};var n=d.bind(i);n.listener=r;i.wrapFn=n;return n}o.prototype.once=function t(e,r){l(r);this.on(e,p(this,e,r));return this};o.prototype.prependOnceListener=function t(e,r){l(r);this.prependListener(e,p(this,e,r));return this};o.prototype.removeListener=function t(e,r){var i,n,s,o,a;l(r);n=this._events;if(n===undefined)return this;i=n[e];if(i===undefined)return this;if(i===r||i.listener===r){if(--this._eventsCount===0)this._events=Object.create(null);else{delete n[e];if(n.removeListener)this.emit("removeListener",e,i.listener||r)}}else if(typeof i!=="function"){s=-1;for(o=i.length-1;o>=0;o--){if(i[o]===r||i[o].listener===r){a=i[o].listener;s=o;break}}if(s<0)return this;if(s===0)i.shift();else{b(i,s)}if(i.length===1)n[e]=i[0];if(n.removeListener!==undefined)this.emit("removeListener",e,a||r)}return this};o.prototype.off=o.prototype.removeListener;o.prototype.removeAllListeners=function t(e){var r,i,n;i=this._events;if(i===undefined)return this;if(i.removeListener===undefined){if(arguments.length===0){this._events=Object.create(null);this._eventsCount=0}else if(i[e]!==undefined){if(--this._eventsCount===0)this._events=Object.create(null);else delete i[e]}return this}if(arguments.length===0){var s=Object.keys(i);var o;for(n=0;n=0;n--){this.removeListener(e,r[n])}}return this};function g(t,e,r){var i=t._events;if(i===undefined)return[];var n=i[e];if(n===undefined)return[];if(typeof n==="function")return r?[n.listener||n]:[n];return r?v(n):m(n,n.length)}o.prototype.listeners=function t(e){return g(this,e,true)};o.prototype.rawListeners=function t(e){return g(this,e,false)};o.listenerCount=function(t,e){if(typeof t.listenerCount==="function"){return t.listenerCount(e)}else{return y.call(t,e)}};o.prototype.listenerCount=y;function y(t){var e=this._events;if(e!==undefined){var r=e[t];if(typeof r==="function"){return 1}else if(r!==undefined){return r.length}}return 0}o.prototype.eventNames=function t(){return this._eventsCount>0?n(this._events):[]};function m(t,e){var r=new Array(e);for(var i=0;i=3){n=i}if(o.call(e)==="[object Array]"){u(e,r,n)}else if(typeof e==="string"){l(e,r,n)}else{f(e,r,n)}};e.exports=i},{"is-callable":168}],157:[function(t,e,r){"use strict";var f="Function.prototype.bind called on incompatible ";var h=Array.prototype.slice;var c=Object.prototype.toString;var d="[object Function]";e.exports=function t(e){var r=this;if(typeof r!=="function"||c.call(r)!==d){throw new TypeError(f+r)}var i=h.call(arguments,1);var n;var s=function(){if(this instanceof n){var t=r.apply(this,i.concat(h.call(arguments)));if(Object(t)===t){return t}return this}else{return r.apply(e,i.concat(h.call(arguments)))}};var o=Math.max(0,r.length-i.length);var a=[];for(var u=0;u1&&typeof r!=="boolean"){throw new b('"allowMissing" argument must be a boolean')}if(S(/^%?[^%]*%?$/g,e)===null){throw new m("`%` may not be present anywhere but at the beginning and end of the intrinsic name")}var i=A(e);var n=i.length>0?i[0]:"";var s=E("%"+n+"%",r);var o=s.name;var a=s.value;var u=false;var l=s.alias;if(l){n=l[0];C(i,_([0,1],l))}for(var f=1,h=true;f=i.length){var g=v(a,c);h=!!g;if(h&&"get"in g&&!("originalValue"in g.get)){a=g.get}else{a=a[c]}}else{h=x(a,c);a=a[c]}if(h&&!u){w[o]=a}}}return a}},{"function-bind":158,has:163,"has-symbols":160}],160:[function(t,e,r){"use strict";var i=typeof Symbol!=="undefined"&&Symbol;var n=t("./shams");e.exports=function t(){if(typeof i!=="function"){return false}if(typeof Symbol!=="function"){return false}if(typeof i("foo")!=="symbol"){return false}if(typeof Symbol("bar")!=="symbol"){return false}return n()}},{"./shams":161}],161:[function(t,e,r){"use strict";e.exports=function t(){if(typeof Symbol!=="function"||typeof Object.getOwnPropertySymbols!=="function"){return false}if(typeof Symbol.iterator==="symbol"){return true}var e={};var r=Symbol("test");var i=Object(r);if(typeof r==="string"){return false}if(Object.prototype.toString.call(r)!=="[object Symbol]"){return false}if(Object.prototype.toString.call(i)!=="[object Symbol]"){return false}var n=42;e[r]=n;for(r in e){return false}if(typeof Object.keys==="function"&&Object.keys(e).length!==0){return false}if(typeof Object.getOwnPropertyNames==="function"&&Object.getOwnPropertyNames(e).length!==0){return false}var s=Object.getOwnPropertySymbols(e);if(s.length!==1||s[0]!==r){return false}if(!Object.prototype.propertyIsEnumerable.call(e,r)){return false}if(typeof Object.getOwnPropertyDescriptor==="function"){var o=Object.getOwnPropertyDescriptor(e,r);if(o.value!==n||o.enumerable!==true){return false}}return true}},{}],162:[function(t,e,r){"use strict";var i=t("has-symbols/shams");e.exports=function t(){return i()&&!!Symbol.toStringTag}},{"has-symbols/shams":161}],163:[function(t,e,r){"use strict";var i=t("function-bind");e.exports=i.call(Function.call,Object.prototype.hasOwnProperty)},{"function-bind":158}],164:[function(t,e,r){r.read=function(t,e,r,i,n){var s,o;var a=n*8-i-1;var u=(1<>1;var f=-7;var h=r?n-1:0;var c=r?-1:1;var d=t[e+h];h+=c;s=d&(1<<-f)-1;d>>=-f;f+=a;for(;f>0;s=s*256+t[e+h],h+=c,f-=8){}o=s&(1<<-f)-1;s>>=-f;f+=i;for(;f>0;o=o*256+t[e+h],h+=c,f-=8){}if(s===0){s=1-l}else if(s===u){return o?NaN:(d?-1:1)*Infinity}else{o=o+Math.pow(2,i);s=s-l}return(d?-1:1)*o*Math.pow(2,s-i)};r.write=function(t,e,r,i,n,s){var o,a,u;var l=s*8-n-1;var f=(1<>1;var c=n===23?Math.pow(2,-24)-Math.pow(2,-77):0;var d=i?0:s-1;var p=i?1:-1;var g=e<0||e===0&&1/e<0?1:0;e=Math.abs(e);if(isNaN(e)||e===Infinity){a=isNaN(e)?1:0;o=f}else{o=Math.floor(Math.log(e)/Math.LN2);if(e*(u=Math.pow(2,-o))<1){o--;u*=2}if(o+h>=1){e+=c/u}else{e+=c*Math.pow(2,1-h)}if(e*u>=2){o++;u/=2}if(o+h>=f){a=0;o=f}else if(o+h>=1){a=(e*u-1)*Math.pow(2,n);o=o+h}else{a=e*Math.pow(2,h-1)*Math.pow(2,n);o=0}}for(;n>=8;t[r+d]=a&255,d+=p,a/=256,n-=8){}o=o<0;t[r+d]=o&255,d+=p,o/=256,l-=8){}t[r+d-p]|=g*128}},{}],165:[function(t,e,r){if(typeof Object.create==="function"){e.exports=function t(e,r){if(r){e.super_=r;e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}})}}}else{e.exports=function t(e,r){if(r){e.super_=r;var i=function(){};i.prototype=r.prototype;e.prototype=new i;e.prototype.constructor=e}}}},{}],166:[function(t,e,r){"use strict";var i=t("has-tostringtag/shams")();var n=t("call-bind/callBound");var s=n("Object.prototype.toString");var o=function t(e){if(i&&e&&typeof e==="object"&&Symbol.toStringTag in e){return false}return s(e)==="[object Arguments]"};var a=function t(e){if(o(e)){return true}return e!==null&&typeof e==="object"&&typeof e.length==="number"&&e.length>=0&&s(e)!=="[object Array]"&&s(e.callee)==="[object Function]"};var u=function(){return o(arguments)}();o.isLegacyArguments=a;e.exports=u?o:a},{"call-bind/callBound":152,"has-tostringtag/shams":162}],167:[function(t,e,r){arguments[4][69][0].apply(r,arguments)},{dup:69}],168:[function(t,e,r){"use strict";var i=Function.prototype.toString;var n=typeof Reflect==="object"&&Reflect!==null&&Reflect.apply;var s;var o;if(typeof n==="function"&&typeof Object.defineProperty==="function"){try{s=Object.defineProperty({},"length",{get:function(){throw o}});o={};n(function(){throw 42},null,s)}catch(t){if(t!==o){n=null}}}else{n=null}var a=/^\s*class\b/;var u=function t(e){try{var r=i.call(e);return a.test(r)}catch(t){return false}};var l=function t(e){try{if(u(e)){return false}i.call(e);return true}catch(t){return false}};var f=Object.prototype.toString;var h="[object Function]";var c="[object GeneratorFunction]";var d=typeof Symbol==="function"&&!!Symbol.toStringTag;var p=typeof document==="object"&&typeof document.all==="undefined"&&document.all!==undefined?document.all:{};e.exports=n?function t(e){if(e===p){return true}if(!e){return false}if(typeof e!=="function"&&typeof e!=="object"){return false}if(typeof e==="function"&&!e.prototype){return true}try{n(e,null,s)}catch(t){if(t!==o){return false}}return!u(e)}:function t(e){if(e===p){return true}if(!e){return false}if(typeof e!=="function"&&typeof e!=="object"){return false}if(typeof e==="function"&&!e.prototype){return true}if(d){return l(e)}if(u(e)){return false}var r=f.call(e);return r===h||r===c}},{}],169:[function(t,e,r){"use strict";var n=Object.prototype.toString;var s=Function.prototype.toString;var o=/^\s*(?:function)?\*/;var a=t("has-tostringtag/shams")();var u=Object.getPrototypeOf;var l=function(){if(!a){return false}try{return Function("return function*() {}")()}catch(t){}};var f;e.exports=function t(e){if(typeof e!=="function"){return false}if(o.test(s.call(e))){return true}if(!a){var r=n.call(e);return r==="[object GeneratorFunction]"}if(!u){return false}if(typeof f==="undefined"){var i=l();f=i?u(i):false}return u(e)===f}},{"has-tostringtag/shams":162}],170:[function(p,g,t){(function(d){(function(){"use strict";var e=p("for-each");var t=p("available-typed-arrays");var r=p("call-bind/callBound");var i=r("Object.prototype.toString");var n=p("has-tostringtag/shams")();var s=typeof globalThis==="undefined"?d:globalThis;var o=t();var a=r("Array.prototype.indexOf",true)||function t(e,r){for(var i=0;i-1}if(!f){return false}return c(e)}}).call(this)}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"available-typed-arrays":146,"call-bind/callBound":152,"es-abstract/helpers/getOwnPropertyDescriptor":154,"for-each":156,"has-tostringtag/shams":162}],171:[function(t,e,r){"use strict";var u=Object.getOwnPropertySymbols;var l=Object.prototype.hasOwnProperty;var f=Object.prototype.propertyIsEnumerable;function h(t){if(t===null||t===undefined){throw new TypeError("Object.assign cannot be called with null or undefined")}return Object(t)}function i(){try{if(!Object.assign){return false}var t=new String("abc");t[5]="de";if(Object.getOwnPropertyNames(t)[0]==="5"){return false}var e={};for(var r=0;r<10;r++){e["_"+String.fromCharCode(r)]=r}var i=Object.getOwnPropertyNames(e).map(function(t){return e[t]});if(i.join("")!=="0123456789"){return false}var n={};"abcdefghijklmnopqrst".split("").forEach(function(t){n[t]=t});if(Object.keys(Object.assign({},n)).join("")!=="abcdefghijklmnopqrst"){return false}return true}catch(t){return false}}e.exports=i()?Object.assign:function(t,e){var r;var i=h(t);var n;for(var s=1;s>>16&65535|0,o=0;while(r!==0){o=r>2e3?2e3:r;r-=o;do{n=n+e[i++]|0;s=s+n|0}while(--o);n%=65521;s%=65521}return n|s<<16|0}e.exports=i},{}],175:[function(t,e,r){"use strict";e.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],176:[function(t,e,r){"use strict";function i(){var t,e=[];for(var r=0;r<256;r++){t=r;for(var i=0;i<8;i++){t=t&1?3988292384^t>>>1:t>>>1}e[r]=t}return e}var a=i();function n(t,e,r,i){var n=a,s=i+r;t^=-1;for(var o=i;o>>8^n[(t^e[o])&255]}return t^-1}e.exports=n},{}],177:[function(t,s,e){"use strict";var h=t("../utils/common");var l=t("./trees");var W=t("./adler32");var f=t("./crc32");var o=t("./messages");var c=0;var H=1;var N=3;var d=4;var U=5;var p=0;var z=1;var g=-2;var u=-3;var y=-5;var Y=-1;var V=1;var m=2;var G=3;var Z=4;var K=0;var X=2;var b=8;var q=9;var J=15;var $=8;var Q=29;var tt=256;var r=tt+1+Q;var et=30;var rt=19;var it=2*r+1;var nt=15;var v=3;var w=258;var x=w+v+1;var st=32;var _=42;var ot=69;var C=73;var T=91;var S=103;var k=113;var A=666;var E=1;var B=2;var R=3;var O=4;var at=3;function M(t,e){t.msg=o[e];return e}function ut(t){return(t<<1)-(t>4?9:0)}function I(t){var e=t.length;while(--e>=0){t[e]=0}}function P(t){var e=t.state;var r=e.pending;if(r>t.avail_out){r=t.avail_out}if(r===0){return}h.arraySet(t.output,e.pending_buf,e.pending_out,r,t.next_out);t.next_out+=r;e.pending_out+=r;t.total_out+=r;t.avail_out-=r;e.pending-=r;if(e.pending===0){e.pending_out=0}}function a(t,e){l._tr_flush_block(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e);t.block_start=t.strstart;P(t.strm)}function j(t,e){t.pending_buf[t.pending++]=e}function L(t,e){t.pending_buf[t.pending++]=e>>>8&255;t.pending_buf[t.pending++]=e&255}function lt(t,e,r,i){var n=t.avail_in;if(n>i){n=i}if(n===0){return 0}t.avail_in-=n;h.arraySet(e,t.input,t.next_in,n,r);if(t.state.wrap===1){t.adler=W(t.adler,e,n,r)}else if(t.state.wrap===2){t.adler=f(t.adler,e,n,r)}t.next_in+=n;t.total_in+=n;return n}function ft(t,e){var r=t.max_chain_length;var i=t.strstart;var n;var s;var o=t.prev_length;var a=t.nice_match;var u=t.strstart>t.w_size-x?t.strstart-(t.w_size-x):0;var l=t.window;var f=t.w_mask;var h=t.prev;var c=t.strstart+w;var d=l[i+o-1];var p=l[i+o];if(t.prev_length>=t.good_match){r>>=2}if(a>t.lookahead){a=t.lookahead}do{n=e;if(l[n+o]!==p||l[n+o-1]!==d||l[n]!==l[i]||l[++n]!==l[i+1]){continue}i+=2;n++;do{}while(l[++i]===l[++n]&&l[++i]===l[++n]&&l[++i]===l[++n]&&l[++i]===l[++n]&&l[++i]===l[++n]&&l[++i]===l[++n]&&l[++i]===l[++n]&&l[++i]===l[++n]&&io){t.match_start=e;o=s;if(s>=a){break}d=l[i+o-1];p=l[i+o]}}while((e=h[e&f])>u&&--r!==0);if(o<=t.lookahead){return o}return t.lookahead}function D(t){var e=t.w_size;var r,i,n,s,o;do{s=t.window_size-t.lookahead-t.strstart;if(t.strstart>=e+(e-x)){h.arraySet(t.window,t.window,e,e,0);t.match_start-=e;t.strstart-=e;t.block_start-=e;i=t.hash_size;r=i;do{n=t.head[--r];t.head[r]=n>=e?n-e:0}while(--i);i=e;r=i;do{n=t.prev[--r];t.prev[r]=n>=e?n-e:0}while(--i);s+=e}if(t.strm.avail_in===0){break}i=lt(t.strm,t.window,t.strstart+t.lookahead,s);t.lookahead+=i;if(t.lookahead+t.insert>=v){o=t.strstart-t.insert;t.ins_h=t.window[o];t.ins_h=(t.ins_h<t.pending_buf_size-5){r=t.pending_buf_size-5}for(;;){if(t.lookahead<=1){D(t);if(t.lookahead===0&&e===c){return E}if(t.lookahead===0){break}}t.strstart+=t.lookahead;t.lookahead=0;var i=t.block_start+r;if(t.strstart===0||t.strstart>=i){t.lookahead=t.strstart-i;t.strstart=i;a(t,false);if(t.strm.avail_out===0){return E}}if(t.strstart-t.block_start>=t.w_size-x){a(t,false);if(t.strm.avail_out===0){return E}}}t.insert=0;if(e===d){a(t,true);if(t.strm.avail_out===0){return R}return O}if(t.strstart>t.block_start){a(t,false);if(t.strm.avail_out===0){return E}}return E}function ct(t,e){var r;var i;for(;;){if(t.lookahead=v){t.ins_h=(t.ins_h<=v){i=l._tr_tally(t,t.strstart-t.match_start,t.match_length-v);t.lookahead-=t.match_length;if(t.match_length<=t.max_lazy_match&&t.lookahead>=v){t.match_length--;do{t.strstart++;t.ins_h=(t.ins_h<=v){t.ins_h=(t.ins_h<4096)){t.match_length=v-1}}if(t.prev_length>=v&&t.match_length<=t.prev_length){n=t.strstart+t.lookahead-v;i=l._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-v);t.lookahead-=t.prev_length-1;t.prev_length-=2;do{if(++t.strstart<=n){t.ins_h=(t.ins_h<=v&&t.strstart>0){n=t.strstart-1;i=o[n];if(i===o[++n]&&i===o[++n]&&i===o[++n]){s=t.strstart+w;do{}while(i===o[++n]&&i===o[++n]&&i===o[++n]&&i===o[++n]&&i===o[++n]&&i===o[++n]&&i===o[++n]&&i===o[++n]&&nt.lookahead){t.match_length=t.lookahead}}}if(t.match_length>=v){r=l._tr_tally(t,1,t.match_length-v);t.lookahead-=t.match_length;t.strstart+=t.match_length;t.match_length=0}else{r=l._tr_tally(t,0,t.window[t.strstart]);t.lookahead--;t.strstart++}if(r){a(t,false);if(t.strm.avail_out===0){return E}}}t.insert=0;if(e===d){a(t,true);if(t.strm.avail_out===0){return R}return O}if(t.last_lit){a(t,false);if(t.strm.avail_out===0){return E}}return B}function pt(t,e){var r;for(;;){if(t.lookahead===0){D(t);if(t.lookahead===0){if(e===c){return E}break}}t.match_length=0;r=l._tr_tally(t,0,t.window[t.strstart]);t.lookahead--;t.strstart++;if(r){a(t,false);if(t.strm.avail_out===0){return E}}}t.insert=0;if(e===d){a(t,true);if(t.strm.avail_out===0){return R}return O}if(t.last_lit){a(t,false);if(t.strm.avail_out===0){return E}}return B}function n(t,e,r,i,n){this.good_length=t;this.max_lazy=e;this.nice_length=r;this.max_chain=i;this.func=n}var F;F=[new n(0,0,0,0,ht),new n(4,4,8,4,ct),new n(4,5,16,8,ct),new n(4,6,32,32,ct),new n(4,4,16,16,i),new n(8,16,32,32,i),new n(8,16,128,128,i),new n(8,32,128,256,i),new n(32,128,258,1024,i),new n(32,258,258,4096,i)];function gt(t){t.window_size=2*t.w_size;I(t.head);t.max_lazy_match=F[t.level].max_lazy;t.good_match=F[t.level].good_length;t.nice_match=F[t.level].nice_length;t.max_chain_length=F[t.level].max_chain;t.strstart=0;t.block_start=0;t.lookahead=0;t.insert=0;t.match_length=t.prev_length=v-1;t.match_available=0;t.ins_h=0}function yt(){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=b;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 h.Buf16(it*2);this.dyn_dtree=new h.Buf16((2*et+1)*2);this.bl_tree=new h.Buf16((2*rt+1)*2);I(this.dyn_ltree);I(this.dyn_dtree);I(this.bl_tree);this.l_desc=null;this.d_desc=null;this.bl_desc=null;this.bl_count=new h.Buf16(nt+1);this.heap=new h.Buf16(2*r+1);I(this.heap);this.heap_len=0;this.heap_max=0;this.depth=new h.Buf16(2*r+1);I(this.depth);this.l_buf=0;this.lit_bufsize=0;this.last_lit=0;this.d_buf=0;this.opt_len=0;this.static_len=0;this.matches=0;this.insert=0;this.bi_buf=0;this.bi_valid=0}function mt(t){var e;if(!t||!t.state){return M(t,g)}t.total_in=t.total_out=0;t.data_type=X;e=t.state;e.pending=0;e.pending_out=0;if(e.wrap<0){e.wrap=-e.wrap}e.status=e.wrap?_:k;t.adler=e.wrap===2?0:1;e.last_flush=c;l._tr_init(e);return p}function bt(t){var e=mt(t);if(e===p){gt(t.state)}return e}function vt(t,e){if(!t||!t.state){return g}if(t.state.wrap!==2){return g}t.state.gzhead=e;return p}function wt(t,e,r,i,n,s){if(!t){return g}var o=1;if(e===Y){e=6}if(i<0){o=0;i=-i}else if(i>15){o=2;i-=16}if(n<1||n>q||r!==b||i<8||i>15||e<0||e>9||s<0||s>Z){return M(t,g)}if(i===8){i=9}var a=new yt;t.state=a;a.strm=t;a.wrap=o;a.gzhead=null;a.w_bits=i;a.w_size=1<U||e<0){return t?M(t,g):g}i=t.state;if(!t.output||!t.input&&t.avail_in!==0||i.status===A&&e!==d){return M(t,t.avail_out===0?y:g)}i.strm=t;r=i.last_flush;i.last_flush=e;if(i.status===_){if(i.wrap===2){t.adler=0;j(i,31);j(i,139);j(i,8);if(!i.gzhead){j(i,0);j(i,0);j(i,0);j(i,0);j(i,0);j(i,i.level===9?2:i.strategy>=m||i.level<2?4:0);j(i,at);i.status=k}else{j(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(!i.gzhead.extra?0:4)+(!i.gzhead.name?0:8)+(!i.gzhead.comment?0:16));j(i,i.gzhead.time&255);j(i,i.gzhead.time>>8&255);j(i,i.gzhead.time>>16&255);j(i,i.gzhead.time>>24&255);j(i,i.level===9?2:i.strategy>=m||i.level<2?4:0);j(i,i.gzhead.os&255);if(i.gzhead.extra&&i.gzhead.extra.length){j(i,i.gzhead.extra.length&255);j(i,i.gzhead.extra.length>>8&255)}if(i.gzhead.hcrc){t.adler=f(t.adler,i.pending_buf,i.pending,0)}i.gzindex=0;i.status=ot}}else{var o=b+(i.w_bits-8<<4)<<8;var a=-1;if(i.strategy>=m||i.level<2){a=0}else if(i.level<6){a=1}else if(i.level===6){a=2}else{a=3}o|=a<<6;if(i.strstart!==0){o|=st}o+=31-o%31;i.status=k;L(i,o);if(i.strstart!==0){L(i,t.adler>>>16);L(i,t.adler&65535)}t.adler=1}}if(i.status===ot){if(i.gzhead.extra){n=i.pending;while(i.gzindex<(i.gzhead.extra.length&65535)){if(i.pending===i.pending_buf_size){if(i.gzhead.hcrc&&i.pending>n){t.adler=f(t.adler,i.pending_buf,i.pending-n,n)}P(t);n=i.pending;if(i.pending===i.pending_buf_size){break}}j(i,i.gzhead.extra[i.gzindex]&255);i.gzindex++}if(i.gzhead.hcrc&&i.pending>n){t.adler=f(t.adler,i.pending_buf,i.pending-n,n)}if(i.gzindex===i.gzhead.extra.length){i.gzindex=0;i.status=C}}else{i.status=C}}if(i.status===C){if(i.gzhead.name){n=i.pending;do{if(i.pending===i.pending_buf_size){if(i.gzhead.hcrc&&i.pending>n){t.adler=f(t.adler,i.pending_buf,i.pending-n,n)}P(t);n=i.pending;if(i.pending===i.pending_buf_size){s=1;break}}if(i.gzindexn){t.adler=f(t.adler,i.pending_buf,i.pending-n,n)}if(s===0){i.gzindex=0;i.status=T}}else{i.status=T}}if(i.status===T){if(i.gzhead.comment){n=i.pending;do{if(i.pending===i.pending_buf_size){if(i.gzhead.hcrc&&i.pending>n){t.adler=f(t.adler,i.pending_buf,i.pending-n,n)}P(t);n=i.pending;if(i.pending===i.pending_buf_size){s=1;break}}if(i.gzindexn){t.adler=f(t.adler,i.pending_buf,i.pending-n,n)}if(s===0){i.status=S}}else{i.status=S}}if(i.status===S){if(i.gzhead.hcrc){if(i.pending+2>i.pending_buf_size){P(t)}if(i.pending+2<=i.pending_buf_size){j(i,t.adler&255);j(i,t.adler>>8&255);t.adler=0;i.status=k}}else{i.status=k}}if(i.pending!==0){P(t);if(t.avail_out===0){i.last_flush=-1;return p}}else if(t.avail_in===0&&ut(e)<=ut(r)&&e!==d){return M(t,y)}if(i.status===A&&t.avail_in!==0){return M(t,y)}if(t.avail_in!==0||i.lookahead!==0||e!==c&&i.status!==A){var u=i.strategy===m?pt(i,e):i.strategy===G?dt(i,e):F[i.level].func(i,e);if(u===R||u===O){i.status=A}if(u===E||u===R){if(t.avail_out===0){i.last_flush=-1}return p}if(u===B){if(e===H){l._tr_align(i)}else if(e!==U){l._tr_stored_block(i,0,0,false);if(e===N){I(i.head);if(i.lookahead===0){i.strstart=0;i.block_start=0;i.insert=0}}}P(t);if(t.avail_out===0){i.last_flush=-1;return p}}}if(e!==d){return p}if(i.wrap<=0){return z}if(i.wrap===2){j(i,t.adler&255);j(i,t.adler>>8&255);j(i,t.adler>>16&255);j(i,t.adler>>24&255);j(i,t.total_in&255);j(i,t.total_in>>8&255);j(i,t.total_in>>16&255);j(i,t.total_in>>24&255)}else{L(i,t.adler>>>16);L(i,t.adler&65535)}P(t);if(i.wrap>0){i.wrap=-i.wrap}return i.pending!==0?p:z}function Ct(t){var e;if(!t||!t.state){return g}e=t.state.status;if(e!==_&&e!==ot&&e!==C&&e!==T&&e!==S&&e!==k&&e!==A){return M(t,g)}t.state=null;return e===k?M(t,u):p}function Tt(t,e){var r=e.length;var i;var n,s;var o;var a;var u;var l;var f;if(!t||!t.state){return g}i=t.state;o=i.wrap;if(o===2||o===1&&i.status!==_||i.lookahead){return g}if(o===1){t.adler=W(t.adler,e,r,0)}i.wrap=0;if(r>=i.w_size){if(o===0){I(i.head);i.strstart=0;i.block_start=0;i.insert=0}f=new h.Buf8(i.w_size);h.arraySet(f,e,r-i.w_size,i.w_size,0);e=f;r=i.w_size}a=t.avail_in;u=t.next_in;l=t.input;t.avail_in=r;t.next_in=0;t.input=e;D(i);while(i.lookahead>=v){n=i.strstart;s=i.lookahead-(v-1);do{i.ins_h=(i.ins_h<>>24;p>>>=x;g-=x;x=w>>>16&255;if(x===0){A[o++]=w&65535}else if(x&16){_=w&65535;x&=15;if(x){if(g>>=x;g-=x}if(g<15){p+=k[n++]<>>24;p>>>=x;g-=x;x=w>>>16&255;if(x&16){C=w&65535;x&=15;if(gl){e.msg="invalid distance too far back";i.mode=E;break t}p>>>=x;g-=x;x=o-a;if(C>x){x=C-x;if(x>h){if(i.sane){e.msg="invalid distance too far back";i.mode=E;break t}}T=0;S=d;if(c===0){T+=f-x;if(x<_){_-=x;do{A[o++]=d[T++]}while(--x);T=o-C;S=A}}else if(c2){A[o++]=S[T++];A[o++]=S[T++];A[o++]=S[T++];_-=3}if(_){A[o++]=S[T++];if(_>1){A[o++]=S[T++]}}}else{T=o-C;do{A[o++]=A[T++];A[o++]=A[T++];A[o++]=A[T++];_-=3}while(_>2);if(_){A[o++]=A[T++];if(_>1){A[o++]=A[T++]}}}}else if((x&64)===0){w=m[(w&65535)+(p&(1<>3;n-=_;g-=_<<3;p&=(1<>>24&255)+(t>>>8&65280)+((t&65280)<<8)+((t&255)<<24)}function l(){this.mode=0;this.last=false;this.wrap=0;this.havedict=false;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 B.Buf16(320);this.work=new B.Buf16(288);this.lendyn=null;this.distdyn=null;this.sane=0;this.back=0;this.was=0}function f(t){var e;if(!t||!t.state){return F}e=t.state;t.total_in=t.total_out=e.total=0;t.msg="";if(e.wrap){t.adler=e.wrap&1}e.mode=U;e.last=0;e.havedict=0;e.dmax=32768;e.head=null;e.hold=0;e.bits=0;e.lencode=e.lendyn=new B.Buf32(s);e.distcode=e.distdyn=new B.Buf32(o);e.sane=1;e.back=-1;return D}function h(t){var e;if(!t||!t.state){return F}e=t.state;e.wsize=0;e.whave=0;e.wnext=0;return f(t)}function c(t,e){var r;var i;if(!t||!t.state){return F}i=t.state;if(e<0){r=0;e=-e}else{r=(e>>4)+1;if(e<48){e&=15}}if(e&&(e<8||e>15)){return F}if(i.window!==null&&i.wbits!==e){i.window=null}i.wrap=r;i.wbits=e;return h(t)}function d(t,e){var r;var i;if(!t){return F}i=new l;t.state=i;i.window=null;r=c(t,e);if(r!==D){t.state=null}return r}function p(t){return d(t,u)}var g=true;var r,i;function At(t){if(g){var e;r=new B.Buf32(512);i=new B.Buf32(32);e=0;while(e<144){t.lens[e++]=8}while(e<256){t.lens[e++]=9}while(e<280){t.lens[e++]=7}while(e<288){t.lens[e++]=8}M(I,t.lens,0,288,r,0,t.work,{bits:9});e=0;while(e<32){t.lens[e++]=5}M(P,t.lens,0,32,i,0,t.work,{bits:5});g=false}t.lencode=r;t.lenbits=9;t.distcode=i;t.distbits=5}function Et(t,e,r,i){var n;var s=t.state;if(s.window===null){s.wsize=1<=s.wsize){B.arraySet(s.window,e,r-s.wsize,s.wsize,0);s.wnext=0;s.whave=s.wsize}else{n=s.wsize-s.wnext;if(n>i){n=i}B.arraySet(s.window,e,r-i,n,s.wnext);i-=n;if(i){B.arraySet(s.window,e,r-i,i,0);s.wnext=i;s.whave=s.wsize}else{s.wnext+=n;if(s.wnext===s.wsize){s.wnext=0}if(s.whave>>8&255;r.check=O(r.check,S,2,0);l=0;f=0;r.mode=z;break}r.flags=0;if(r.head){r.head.done=false}if(!(r.wrap&1)||(((l&255)<<8)+(l>>8))%31){t.msg="incorrect header check";r.mode=st;break}if((l&15)!==N){t.msg="unknown compression method";r.mode=st;break}l>>>=4;f-=4;C=(l&15)+8;if(r.wbits===0){r.wbits=C}else if(C>r.wbits){t.msg="invalid window size";r.mode=st;break}r.dmax=1<>8&1}if(r.flags&512){S[0]=l&255;S[1]=l>>>8&255;r.check=O(r.check,S,2,0)}l=0;f=0;r.mode=Y;case Y:while(f<32){if(a===0){break t}a--;l+=i[s++]<>>8&255;S[2]=l>>>16&255;S[3]=l>>>24&255;r.check=O(r.check,S,4,0)}l=0;f=0;r.mode=V;case V:while(f<16){if(a===0){break t}a--;l+=i[s++]<>8}if(r.flags&512){S[0]=l&255;S[1]=l>>>8&255;r.check=O(r.check,S,2,0)}l=0;f=0;r.mode=G;case G:if(r.flags&1024){while(f<16){if(a===0){break t}a--;l+=i[s++]<>>8&255;r.check=O(r.check,S,2,0)}l=0;f=0}else if(r.head){r.head.extra=null}r.mode=Z;case Z:if(r.flags&1024){d=r.length;if(d>a){d=a}if(d){if(r.head){C=r.head.extra_len-r.length;if(!r.head.extra){r.head.extra=new Array(r.head.extra_len)}B.arraySet(r.head.extra,i,s,d,C)}if(r.flags&512){r.check=O(r.check,i,d,s)}a-=d;s+=d;r.length-=d}if(r.length){break t}}r.length=0;r.mode=K;case K:if(r.flags&2048){if(a===0){break t}d=0;do{C=i[s+d++];if(r.head&&C&&r.length<65536){r.head.name+=String.fromCharCode(C)}}while(C&&d>9&1;r.head.done=true}t.adler=r.check=0;r.mode=Q;break;case J:while(f<32){if(a===0){break t}a--;l+=i[s++]<>>=f&7;f-=f&7;r.mode=nt;break}while(f<3){if(a===0){break t}a--;l+=i[s++]<>>=1;f-=1;switch(l&3){case 0:r.mode=dt;break;case 1:At(r);r.mode=rt;if(e===L){l>>>=2;f-=2;break t}break;case 2:r.mode=gt;break;case 3:t.msg="invalid block type";r.mode=st}l>>>=2;f-=2;break;case dt:l>>>=f&7;f-=f&7;while(f<32){if(a===0){break t}a--;l+=i[s++]<>>16^65535)){t.msg="invalid stored block lengths";r.mode=st;break}r.length=l&65535;l=0;f=0;r.mode=et;if(e===L){break t}case et:r.mode=pt;case pt:d=r.length;if(d){if(d>a){d=a}if(d>u){d=u}if(d===0){break t}B.arraySet(n,i,s,d,o);a-=d;s+=d;u-=d;o+=d;r.length-=d;break}r.mode=Q;break;case gt:while(f<14){if(a===0){break t}a--;l+=i[s++]<>>=5;f-=5;r.ndist=(l&31)+1;l>>>=5;f-=5;r.ncode=(l&15)+4;l>>>=4;f-=4;if(r.nlen>286||r.ndist>30){t.msg="too many length or distance symbols";r.mode=st;break}r.have=0;r.mode=yt;case yt:while(r.have>>=3;f-=3}while(r.have<19){r.lens[E[r.have++]]=0}r.lencode=r.lendyn;r.lenbits=7;k={bits:r.lenbits};T=M(ut,r.lens,0,19,r.lencode,0,r.work,k);r.lenbits=k.bits;if(T){t.msg="invalid code lengths set";r.mode=st;break}r.have=0;r.mode=mt;case mt:while(r.have>>24;b=y>>>16&255;v=y&65535;if(m<=f){break}if(a===0){break t}a--;l+=i[s++]<>>=m;f-=m;r.lens[r.have++]=v}else{if(v===16){A=m+2;while(f>>=m;f-=m;if(r.have===0){t.msg="invalid bit length repeat";r.mode=st;break}C=r.lens[r.have-1];d=3+(l&3);l>>>=2;f-=2}else if(v===17){A=m+3;while(f>>=m;f-=m;C=0;d=3+(l&7);l>>>=3;f-=3}else{A=m+7;while(f>>=m;f-=m;C=0;d=11+(l&127);l>>>=7;f-=7}if(r.have+d>r.nlen+r.ndist){t.msg="invalid bit length repeat";r.mode=st;break}while(d--){r.lens[r.have++]=C}}}if(r.mode===st){break}if(r.lens[256]===0){t.msg="invalid code -- missing end-of-block";r.mode=st;break}r.lenbits=9;k={bits:r.lenbits};T=M(I,r.lens,0,r.nlen,r.lencode,0,r.work,k);r.lenbits=k.bits;if(T){t.msg="invalid literal/lengths set";r.mode=st;break}r.distbits=6;r.distcode=r.distdyn;k={bits:r.distbits};T=M(P,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,k);r.distbits=k.bits;if(T){t.msg="invalid distances set";r.mode=st;break}r.mode=rt;if(e===L){break t}case rt:r.mode=it;case it:if(a>=6&&u>=258){t.next_out=o;t.avail_out=u;t.next_in=s;t.avail_in=a;r.hold=l;r.bits=f;at(t,c);o=t.next_out;n=t.output;u=t.avail_out;s=t.next_in;i=t.input;a=t.avail_in;l=r.hold;f=r.bits;if(r.mode===Q){r.back=-1}break}r.back=0;for(;;){y=r.lencode[l&(1<>>24;b=y>>>16&255;v=y&65535;if(m<=f){break}if(a===0){break t}a--;l+=i[s++]<>w)];m=y>>>24;b=y>>>16&255;v=y&65535;if(w+m<=f){break}if(a===0){break t}a--;l+=i[s++]<>>=w;f-=w;r.back+=w}l>>>=m;f-=m;r.back+=m;r.length=v;if(b===0){r.mode=_t;break}if(b&32){r.back=-1;r.mode=Q;break}if(b&64){t.msg="invalid literal/length code";r.mode=st;break}r.extra=b&15;r.mode=bt;case bt:if(r.extra){A=r.extra;while(f>>=r.extra;f-=r.extra;r.back+=r.extra}r.was=r.length;r.mode=vt;case vt:for(;;){y=r.distcode[l&(1<>>24;b=y>>>16&255;v=y&65535;if(m<=f){break}if(a===0){break t}a--;l+=i[s++]<>w)];m=y>>>24;b=y>>>16&255;v=y&65535;if(w+m<=f){break}if(a===0){break t}a--;l+=i[s++]<>>=w;f-=w;r.back+=w}l>>>=m;f-=m;r.back+=m;if(b&64){t.msg="invalid distance code";r.mode=st;break}r.offset=v;r.extra=b&15;r.mode=wt;case wt:if(r.extra){A=r.extra;while(f>>=r.extra;f-=r.extra;r.back+=r.extra}if(r.offset>r.dmax){t.msg="invalid distance too far back";r.mode=st;break}r.mode=xt;case xt:if(u===0){break t}d=c-u;if(r.offset>d){d=r.offset-d;if(d>r.whave){if(r.sane){t.msg="invalid distance too far back";r.mode=st;break}}if(d>r.wnext){d-=r.wnext;p=r.wsize-d}else{p=r.wnext-d}if(d>r.length){d=r.length}g=r.window}else{g=n;p=o-r.offset;d=r.length}if(d>u){d=u}u-=d;r.length-=d;do{n[o++]=g[p++]}while(--d);if(r.length===0){r.mode=it}break;case _t:if(u===0){break t}n[o++]=r.length;u--;r.mode=it;break;case nt:if(r.wrap){while(f<32){if(a===0){break t}a--;l|=i[s++]<=1;d--){if(E[d]!==0){break}}if(p>d){p=d}if(d===0){s[o++]=1<<24|64<<16|0;s[o++]=1<<24|64<<16|0;u.bits=1;return 0}for(c=1;c0&&(e===W||d!==1)){return-1}B[1]=0;for(f=1;fD||e===N&&b>F){return 1}for(;;){M=f-y;if(a[h]A){I=R[O+a[h]];P=S[k+a[h]]}else{I=32+64;P=0}w=1<>y)+x]=M<<24|I<<16|P|0}while(x!==0);w=1<>=1}if(w!==0){v&=w-1;v+=w}else{v=0}h++;if(--E[f]===0){if(f===d){break}f=r[i+a[h]]}if(f>p&&(v&C)!==_){if(y===0){y=p}T+=c;g=f-y;m=1<D||e===N&&b>F){return 1}_=v&C;s[_]=p<<24|g<<16|T-o|0}}if(v!==0){s[T+v]=f-y<<24|64<<16|0}u.bits=p;return 0}},{"../utils/common":173}],181:[function(t,e,r){"use strict";e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],182:[function(L,D,t){"use strict";var F=L("../utils/common");var W=4;var i=0;var n=1;var H=2;function e(t){var e=t.length;while(--e>=0){t[e]=0}}var N=0;var a=1;var U=2;var z=3;var Y=258;var o=29;var u=256;var l=u+1+o;var f=30;var h=19;var y=2*l+1;var m=15;var s=16;var V=7;var c=256;var d=16;var p=17;var g=18;var b=[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];var v=[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];var G=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7];var w=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];var Z=512;var x=new Array((l+2)*2);e(x);var _=new Array(f*2);e(_);var C=new Array(Z);e(C);var T=new Array(Y-z+1);e(T);var S=new Array(o);e(S);var k=new Array(f);e(k);function A(t,e,r,i,n){this.static_tree=t;this.extra_bits=e;this.extra_base=r;this.elems=i;this.max_length=n;this.has_stree=t&&t.length}var E;var B;var R;function r(t,e){this.dyn_tree=t;this.max_code=0;this.stat_desc=e}function K(t){return t<256?C[t]:C[256+(t>>>7)]}function O(t,e){t.pending_buf[t.pending++]=e&255;t.pending_buf[t.pending++]=e>>>8&255}function M(t,e,r){if(t.bi_valid>s-r){t.bi_buf|=e<>s-t.bi_valid;t.bi_valid+=r-s}else{t.bi_buf|=e<>>=1;r<<=1}while(--e>0);return r>>>1}function q(t){if(t.bi_valid===16){O(t,t.bi_buf);t.bi_buf=0;t.bi_valid=0}else if(t.bi_valid>=8){t.pending_buf[t.pending++]=t.bi_buf&255;t.bi_buf>>=8;t.bi_valid-=8}}function J(t,e){var r=e.dyn_tree;var i=e.max_code;var n=e.stat_desc.static_tree;var s=e.stat_desc.has_stree;var o=e.stat_desc.extra_bits;var a=e.stat_desc.extra_base;var u=e.stat_desc.max_length;var l;var f,h;var c;var d;var p;var g=0;for(c=0;c<=m;c++){t.bl_count[c]=0}r[t.heap[t.heap_max]*2+1]=0;for(l=t.heap_max+1;lu){c=u;g++}r[f*2+1]=c;if(f>i){continue}t.bl_count[c]++;d=0;if(f>=a){d=o[f-a]}p=r[f*2];t.opt_len+=p*(c+d);if(s){t.static_len+=p*(n[f*2+1]+d)}}if(g===0){return}do{c=u-1;while(t.bl_count[c]===0){c--}t.bl_count[c]--;t.bl_count[c+1]+=2;t.bl_count[u]--;g-=2}while(g>0);for(c=u;c!==0;c--){f=t.bl_count[c];while(f!==0){h=t.heap[--l];if(h>i){continue}if(r[h*2+1]!==c){t.opt_len+=(c-r[h*2+1])*r[h*2];r[h*2+1]=c}f--}}}function $(t,e,r){var i=new Array(m+1);var n=0;var s;var o;for(s=1;s<=m;s++){i[s]=n=n+r[s-1]<<1}for(o=0;o<=e;o++){var a=t[o*2+1];if(a===0){continue}t[o*2]=X(i[a]++,a)}}function Q(){var t;var e;var r;var i;var n;var s=new Array(m+1);r=0;for(i=0;i>=7;for(;i8){O(t,t.bi_buf)}else if(t.bi_valid>0){t.pending_buf[t.pending++]=t.bi_buf}t.bi_buf=0;t.bi_valid=0}function rt(t,e,r,i){et(t);if(i){O(t,r);O(t,~r)}F.arraySet(t.pending_buf,t.window,e,r,t.pending);t.pending+=r}function it(t,e,r,i){var n=e*2;var s=r*2;return t[n]>1;o>=1;o--){P(t,r,o)}l=s;do{o=t.heap[1];t.heap[1]=t.heap[t.heap_len--];P(t,r,1);a=t.heap[1];t.heap[--t.heap_max]=o;t.heap[--t.heap_max]=a;r[l*2]=r[o*2]+r[a*2];t.depth[l]=(t.depth[o]>=t.depth[a]?t.depth[o]:t.depth[a])+1;r[o*2+1]=r[a*2+1]=l;t.heap[1]=l++;P(t,r,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1];J(t,e);$(r,u,t.bl_count)}function st(t,e,r){var i;var n=-1;var s;var o=e[0*2+1];var a=0;var u=7;var l=4;if(o===0){u=138;l=3}e[(r+1)*2+1]=65535;for(i=0;i<=r;i++){s=o;o=e[(i+1)*2+1];if(++a=3;e--){if(t.bl_tree[w[e]*2+1]!==0){break}}t.opt_len+=3*(e+1)+5+5+4;return e}function ut(t,e,r,i){var n;M(t,e-257,5);M(t,r-1,5);M(t,i-4,4);for(n=0;n>>=1){if(e&1&&t.dyn_ltree[r*2]!==0){return i}}if(t.dyn_ltree[9*2]!==0||t.dyn_ltree[10*2]!==0||t.dyn_ltree[13*2]!==0){return n}for(r=32;r0){if(t.strm.data_type===H){t.strm.data_type=lt(t)}j(t,t.l_desc);j(t,t.d_desc);o=at(t);n=t.opt_len+3+7>>>3;s=t.static_len+3+7>>>3;if(s<=n){n=s}}else{n=s=r+5}if(r+4<=n&&e!==-1){ct(t,e,r,i)}else if(t.strategy===W||s===n){M(t,(a<<1)+(i?1:0),3);nt(t,x,_)}else{M(t,(U<<1)+(i?1:0),3);ut(t,t.l_desc.max_code+1,t.d_desc.max_code+1,o+1);nt(t,t.dyn_ltree,t.dyn_dtree)}tt(t);if(i){et(t)}}function gt(t,e,r){t.pending_buf[t.d_buf+t.last_lit*2]=e>>>8&255;t.pending_buf[t.d_buf+t.last_lit*2+1]=e&255;t.pending_buf[t.l_buf+t.last_lit]=r&255;t.last_lit++;if(e===0){t.dyn_ltree[r*2]++}else{t.matches++;e--;t.dyn_ltree[(T[r]+u+1)*2]++;t.dyn_dtree[K(e)*2]++}return t.last_lit===t.lit_bufsize-1}t._tr_init=ht;t._tr_stored_block=ct;t._tr_flush_block=pt;t._tr_tally=gt;t._tr_align=dt},{"../utils/common":173}],183:[function(t,e,r){"use strict";function i(){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}e.exports=i},{}],184:[function(t,e,r){(function(a){(function(){"use strict";function g(t){if(typeof t!=="string"){throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}}function o(t,e){var r="";var i=0;var n=-1;var s=0;var o;for(var a=0;a<=t.length;++a){if(a2){var u=r.lastIndexOf("/");if(u!==r.length-1){if(u===-1){r="";i=0}else{r=r.slice(0,u);i=r.length-1-r.lastIndexOf("/")}n=a;s=0;continue}}else if(r.length===2||r.length===1){r="";i=0;n=a;s=0;continue}}if(e){if(r.length>0)r+="/..";else r="..";i=2}}else{if(r.length>0)r+="/"+t.slice(n+1,a);else r=t.slice(n+1,a);i=a-n-1}n=a;s=0}else if(o===46&&s!==-1){++s}else{s=-1}}return r}function r(t,e){var r=e.dir||e.root;var i=e.base||(e.name||"")+(e.ext||"");if(!r){return i}if(r===e.root){return r+i}return r+t+i}var y={resolve:function t(){var e="";var r=false;var i;for(var n=arguments.length-1;n>=-1&&!r;n--){var s;if(n>=0)s=arguments[n];else{if(i===undefined)i=a.cwd();s=i}g(s);if(s.length===0){continue}e=s+"/"+e;r=s.charCodeAt(0)===47}e=o(e,!r);if(r){if(e.length>0)return"/"+e;else return"/"}else if(e.length>0){return e}else{return"."}},normalize:function t(e){g(e);if(e.length===0)return".";var r=e.charCodeAt(0)===47;var i=e.charCodeAt(e.length-1)===47;e=o(e,!r);if(e.length===0&&!r)e=".";if(e.length>0&&i)e+="/";if(r)return"/"+e;return e},isAbsolute:function t(e){g(e);return e.length>0&&e.charCodeAt(0)===47},join:function t(){if(arguments.length===0)return".";var e;for(var r=0;r0){if(e===undefined)e=i;else e+="/"+i}}if(e===undefined)return".";return y.normalize(e)},relative:function t(e,r){g(e);g(r);if(e===r)return"";e=y.resolve(e);r=y.resolve(r);if(e===r)return"";var i=1;for(;il){if(r.charCodeAt(o+h)===47){return r.slice(o+h+1)}else if(h===0){return r.slice(o+h)}}else if(s>l){if(e.charCodeAt(i+h)===47){f=h}else if(h===0){f=0}}break}var c=e.charCodeAt(i+h);var d=r.charCodeAt(o+h);if(c!==d)break;else if(c===47)f=h}var p="";for(h=i+f+1;h<=n;++h){if(h===n||e.charCodeAt(h)===47){if(p.length===0)p+="..";else p+="/.."}}if(p.length>0)return p+r.slice(o+f);else{o+=f;if(r.charCodeAt(o)===47)++o;return r.slice(o)}},_makeLong:function t(e){return e},dirname:function t(e){g(e);if(e.length===0)return".";var r=e.charCodeAt(0);var i=r===47;var n=-1;var s=true;for(var o=e.length-1;o>=1;--o){r=e.charCodeAt(o);if(r===47){if(!s){n=o;break}}else{s=false}}if(n===-1)return i?"/":".";if(i&&n===1)return"//";return e.slice(0,n)},basename:function t(e,r){if(r!==undefined&&typeof r!=="string")throw new TypeError('"ext" argument must be a string');g(e);var i=0;var n=-1;var s=true;var o;if(r!==undefined&&r.length>0&&r.length<=e.length){if(r.length===e.length&&r===e)return"";var a=r.length-1;var u=-1;for(o=e.length-1;o>=0;--o){var l=e.charCodeAt(o);if(l===47){if(!s){i=o+1;break}}else{if(u===-1){s=false;u=o+1}if(a>=0){if(l===r.charCodeAt(a)){if(--a===-1){n=o}}else{a=-1;n=u}}}}if(i===n)n=u;else if(n===-1)n=e.length;return e.slice(i,n)}else{for(o=e.length-1;o>=0;--o){if(e.charCodeAt(o)===47){if(!s){i=o+1;break}}else if(n===-1){s=false;n=o+1}}if(n===-1)return"";return e.slice(i,n)}},extname:function t(e){g(e);var r=-1;var i=0;var n=-1;var s=true;var o=0;for(var a=e.length-1;a>=0;--a){var u=e.charCodeAt(a);if(u===47){if(!s){i=a+1;break}continue}if(n===-1){s=false;n=a+1}if(u===46){if(r===-1)r=a;else if(o!==1)o=1}else if(r!==-1){o=-1}}if(r===-1||n===-1||o===0||o===1&&r===n-1&&r===i+1){return""}return e.slice(r,n)},format:function t(e){if(e===null||typeof e!=="object"){throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e)}return r("/",e)},parse:function t(e){g(e);var r={root:"",dir:"",base:"",ext:"",name:""};if(e.length===0)return r;var i=e.charCodeAt(0);var n=i===47;var s;if(n){r.root="/";s=1}else{s=0}var o=-1;var a=0;var u=-1;var l=true;var f=e.length-1;var h=0;for(;f>=s;--f){i=e.charCodeAt(f);if(i===47){if(!l){a=f+1;break}continue}if(u===-1){l=false;u=f+1}if(i===46){if(o===-1)o=f;else if(h!==1)h=1}else if(o!==-1){h=-1}}if(o===-1||u===-1||h===0||h===1&&o===u-1&&o===a+1){if(u!==-1){if(a===0&&n)r.base=r.name=e.slice(1,u);else r.base=r.name=e.slice(a,u)}}else{if(a===0&&n){r.name=e.slice(1,o);r.base=e.slice(1,u)}else{r.name=e.slice(a,o);r.base=e.slice(a,u)}r.ext=e.slice(o,u)}if(a>0)r.dir=e.slice(0,a-1);else if(n)r.dir="/";return r},sep:"/",delimiter:":",win32:null,posix:null};y.posix=y;e.exports=y}).call(this)}).call(this,t("_process"))},{_process:185}],185:[function(t,e,r){var i=e.exports={};var n;var s;function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}(function(){try{if(typeof setTimeout==="function"){n=setTimeout}else{n=o}}catch(t){n=o}try{if(typeof clearTimeout==="function"){s=clearTimeout}else{s=a}}catch(t){s=a}})();function u(e){if(n===setTimeout){return setTimeout(e,0)}if((n===o||!n)&&setTimeout){n=setTimeout;return 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 l(e){if(s===clearTimeout){return clearTimeout(e)}if((s===a||!s)&&clearTimeout){s=clearTimeout;return clearTimeout(e)}try{return s(e)}catch(t){try{return s.call(null,e)}catch(t){return s.call(this,e)}}}var f=[];var h=false;var c;var d=-1;function p(){if(!h||!c){return}h=false;if(c.length){f=c.concat(f)}else{d=-1}if(f.length){g()}}function g(){if(h){return}var t=u(p);h=true;var e=f.length;while(e){c=f;f=[];while(++d1){for(var r=1;r2){return"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]}else if(r===2){return"one of ".concat(e," ").concat(t[0]," or ").concat(t[1])}else{return"of ".concat(e," ").concat(t[0])}}else{return"of ".concat(e," ").concat(String(t))}}function u(t,e,r){return t.substr(!r||r<0?0:+r,e.length)===e}function l(t,e,r){if(r===undefined||r>t.length){r=t.length}return t.substring(r-e.length,r)===e}function f(t,e,r){if(typeof r!=="number"){r=0}if(r+e.length>t.length){return false}else{return t.indexOf(e,r)!==-1}}i("ERR_INVALID_OPT_VALUE",function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'},TypeError);i("ERR_INVALID_ARG_TYPE",function(t,e,r){var i;if(typeof e==="string"&&u(e,"not ")){i="must not be";e=e.replace(/^not /,"")}else{i="must be"}var n;if(l(t," argument")){n="The ".concat(t," ").concat(i," ").concat(a(e,"type"))}else{var s=f(t,".")?"property":"argument";n='The "'.concat(t,'" ').concat(s," ").concat(i," ").concat(a(e,"type"))}n+=". Received type ".concat(typeof r);return n},TypeError);i("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");i("ERR_METHOD_NOT_IMPLEMENTED",function(t){return"The "+t+" method is not implemented"});i("ERR_STREAM_PREMATURE_CLOSE","Premature close");i("ERR_STREAM_DESTROYED",function(t){return"Cannot call "+t+" after a stream was destroyed"});i("ERR_MULTIPLE_CALLBACK","Callback called multiple times");i("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");i("ERR_STREAM_WRITE_AFTER_END","write after end");i("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);i("ERR_UNKNOWN_ENCODING",function(t){return"Unknown encoding: "+t},TypeError);i("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");e.exports.codes=o},{}],189:[function(f,h,t){(function(l){(function(){"use strict";var t=Object.keys||function(t){var e=[];for(var r in t){e.push(r)}return e};h.exports=o;var e=f("./_stream_readable");var r=f("./_stream_writable");f("inherits")(o,e);{var i=t(r.prototype);for(var n=0;n0){if(typeof e!=="string"&&!s.objectMode&&Object.getPrototypeOf(e)!==a.prototype){e=u(e)}if(i){if(s.endEmitted)w(t,new D);else S(t,s,e,true)}else if(s.ended){w(t,new d)}else if(s.destroyed){return false}else{s.reading=false;if(s.decoder&&!r){e=s.decoder.write(e);if(s.objectMode||e.length!==0)S(t,s,e,false);else R(t,s)}else{S(t,s,e,false)}}}else if(!i){s.reading=false;R(t,s)}}return!s.ended&&(s.length=k){t=k}else{t--;t|=t>>>1;t|=t>>>2;t|=t>>>4;t|=t>>>8;t|=t>>>16;t++}return t}function A(t,e){if(t<=0||e.length===0&&e.ended)return 0;if(e.objectMode)return 1;if(t!==t){if(e.flowing&&e.length)return e.buffer.head.data.length;else return e.length}if(t>e.highWaterMark)e.highWaterMark=H(t);if(t<=e.length)return t;if(!e.ended){e.needReadable=true;return 0}return e.length}C.prototype.read=function(t){m("read",t);t=parseInt(t,10);var e=this._readableState;var r=t;if(t!==0)e.emittedReadable=false;if(t===0&&e.needReadable&&((e.highWaterMark!==0?e.length>=e.highWaterMark:e.length>0)||e.ended)){m("read: emitReadable",e.length,e.ended);if(e.length===0&&e.ended)P(this);else E(this);return null}t=A(t,e);if(t===0&&e.ended){if(e.length===0)P(this);return null}var i=e.needReadable;m("need readable",i);if(e.length===0||e.length-t0)n=I(t,e);else n=null;if(n===null){e.needReadable=e.length<=e.highWaterMark;t=0}else{e.length-=t;e.awaitDrain=0}if(e.length===0){if(!e.ended)e.needReadable=true;if(r!==t&&e.ended)P(this)}if(n!==null)this.emit("data",n);return n};function N(t,e){m("onEofChunk");if(e.ended)return;if(e.decoder){var r=e.decoder.end();if(r&&r.length){e.buffer.push(r);e.length+=e.objectMode?1:r.length}}e.ended=true;if(e.sync){E(t)}else{e.needReadable=false;if(!e.emittedReadable){e.emittedReadable=true;B(t)}}}function E(t){var e=t._readableState;m("emitReadable",e.needReadable,e.emittedReadable);e.needReadable=false;if(!e.emittedReadable){m("emitReadable",e.flowing);e.emittedReadable=true;K.nextTick(B,t)}}function B(t){var e=t._readableState;m("emitReadable_",e.destroyed,e.length,e.ended);if(!e.destroyed&&(e.length||e.ended)){t.emit("readable");e.emittedReadable=false}e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark;M(t)}function R(t,e){if(!e.readingMore){e.readingMore=true;K.nextTick(U,t,e)}}function U(t,e){while(!e.reading&&!e.ended&&(e.length1&&j(n.pipes,r)!==-1)&&!l){m("false write response, pause",n.awaitDrain);n.awaitDrain++}i.pause()}}function c(t){m("onerror",t);g();r.removeListener("error",c);if(y(r,"error")===0)w(r,t)}F(r,"error",c);function d(){r.removeListener("finish",p);g()}r.once("close",d);function p(){m("onfinish");r.removeListener("close",d);g()}r.once("finish",p);function g(){m("unpipe");i.unpipe(r)}r.emit("pipe",i);if(!n.flowing){m("pipe resume");i.resume()}return r};function z(r){return function t(){var e=r._readableState;m("pipeOnDrain",e.awaitDrain);if(e.awaitDrain)e.awaitDrain--;if(e.awaitDrain===0&&y(r,"data")){e.flowing=true;M(r)}}}C.prototype.unpipe=function(t){var e=this._readableState;var r={hasUnpiped:false};if(e.pipesCount===0)return this;if(e.pipesCount===1){if(t&&t!==e.pipes)return this;if(!t)t=e.pipes;e.pipes=null;e.pipesCount=0;e.flowing=false;if(t)t.emit("unpipe",this,r);return this}if(!t){var i=e.pipes;var n=e.pipesCount;e.pipes=null;e.pipesCount=0;e.flowing=false;for(var s=0;s0;if(i.flowing!==false)this.resume()}else if(t==="readable"){if(!i.endEmitted&&!i.readableListening){i.readableListening=i.needReadable=true;i.flowing=false;i.emittedReadable=false;m("on readable",i.length,i.reading);if(i.length){E(this)}else if(!i.reading){K.nextTick(Y,this)}}}return r};C.prototype.addListener=C.prototype.on;C.prototype.removeListener=function(t,e){var r=n.prototype.removeListener.call(this,t,e);if(t==="readable"){K.nextTick(O,this)}return r};C.prototype.removeAllListeners=function(t){var e=n.prototype.removeAllListeners.apply(this,arguments);if(t==="readable"||t===undefined){K.nextTick(O,this)}return e};function O(t){var e=t._readableState;e.readableListening=t.listenerCount("readable")>0;if(e.resumeScheduled&&!e.paused){e.flowing=true}else if(t.listenerCount("data")>0){t.resume()}}function Y(t){m("readable nexttick read 0");t.read(0)}C.prototype.resume=function(){var t=this._readableState;if(!t.flowing){m("resume");t.flowing=!t.readableListening;V(this,t)}t.paused=false;return this};function V(t,e){if(!e.resumeScheduled){e.resumeScheduled=true;K.nextTick(G,t,e)}}function G(t,e){m("resume",e.reading);if(!e.reading){t.read(0)}e.resumeScheduled=false;t.emit("resume");M(t);if(e.flowing&&!e.reading)t.read(0)}C.prototype.pause=function(){m("call pause flowing=%j",this._readableState.flowing);if(this._readableState.flowing!==false){m("pause");this._readableState.flowing=false;this.emit("pause")}this._readableState.paused=true;return this};function M(t){var e=t._readableState;m("flow",e.flowing);while(e.flowing&&t.read()!==null){}}C.prototype.wrap=function(r){var i=this;var n=this._readableState;var s=false;r.on("end",function(){m("wrapped end");if(n.decoder&&!n.ended){var t=n.decoder.end();if(t&&t.length)i.push(t)}i.push(null)});r.on("data",function(t){m("wrapped data");if(n.decoder)t=n.decoder.write(t);if(n.objectMode&&(t===null||t===undefined))return;else if(!n.objectMode&&(!t||!t.length))return;var e=i.push(t);if(!e){s=true;r.pause()}});for(var t in r){if(this[t]===undefined&&typeof r[t]==="function"){this[t]=function t(e){return function t(){return r[e].apply(r,arguments)}}(t)}}for(var e=0;e=e.length){if(e.decoder)r=e.buffer.join("");else if(e.buffer.length===1)r=e.buffer.first();else r=e.buffer.concat(e.length);e.buffer.clear()}else{r=e.buffer.consume(t,e.decoder)}return r}function P(t){var e=t._readableState;m("endReadable",e.endEmitted);if(!e.endEmitted){e.ended=true;K.nextTick(Z,e,t)}}function Z(t,e){m("endReadableNT",t.endEmitted,t.length);if(!t.endEmitted&&t.length===0){t.endEmitted=true;e.readable=false;e.emit("end");if(t.autoDestroy){var r=e._writableState;if(!r||r.autoDestroy&&r.finished){e.destroy()}}}}if(typeof Symbol==="function"){C.from=function(t,e){if(v===undefined){v=q("./internal/streams/from")}return v(C,t,e)}}function j(t,e){for(var r=0,i=t.length;r-1))throw new v(e);this._writableState.defaultEncoding=e;return this};Object.defineProperty(T.prototype,"writableBuffer",{enumerable:false,get:function t(){return this._writableState&&this._writableState.getBuffer()}});function A(t,e,r){if(!t.objectMode&&t.decodeStrings!==false&&typeof e==="string"){e=o.from(e,r)}return e}Object.defineProperty(T.prototype,"writableHighWaterMark",{enumerable:false,get:function t(){return this._writableState.highWaterMark}});function E(t,e,r,i,n,s){if(!r){var o=A(e,i,n);if(i!==o){r=true;n="buffer";i=o}}var a=e.objectMode?1:i.length;e.length+=a;var u=e.length0)this.tail.next=r;else this.head=r;this.tail=r;++this.length}},{key:"unshift",value:function t(e){var r={data:e,next:this.head};if(this.length===0)this.tail=r;this.head=r;++this.length}},{key:"shift",value:function t(){if(this.length===0)return;var e=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;--this.length;return e}},{key:"clear",value:function t(){this.head=this.tail=null;this.length=0}},{key:"join",value:function t(e){if(this.length===0)return"";var r=this.head;var i=""+r.data;while(r=r.next){i+=e+r.data}return i}},{key:"concat",value:function t(e){if(this.length===0)return f.alloc(0);var r=f.allocUnsafe(e>>>0);var i=this.head;var n=0;while(i){p(i.data,r,n);n+=i.data.length;i=i.next}return r}},{key:"consume",value:function t(e,r){var i;if(es.length?s.length:e;if(o===s.length)n+=s;else n+=s.slice(0,e);e-=o;if(e===0){if(o===s.length){++i;if(r.next)this.head=r.next;else this.head=this.tail=null}else{this.head=r;r.data=s.slice(o)}break}++i}this.length-=i;return n}},{key:"_getBuffer",value:function t(e){var r=f.allocUnsafe(e);var i=this.head;var n=1;i.data.copy(r);e-=i.data.length;while(i=i.next){var s=i.data;var o=e>s.length?s.length:e;s.copy(r,r.length-e,0,o);e-=o;if(e===0){if(o===s.length){++n;if(i.next)this.head=i.next;else this.head=this.tail=null}else{this.head=i;i.data=s.slice(o)}break}++n}this.length-=n;return r}},{key:d,value:function t(e,r){return c(this,n({},r,{depth:0,customInspect:false}))}}]);return t}()},{buffer:151,util:148}],196:[function(t,i,e){(function(u){(function(){"use strict";function t(t,e){var r=this;var i=this._readableState&&this._readableState.destroyed;var n=this._writableState&&this._writableState.destroyed;if(i||n){if(e){e(t)}else if(t){if(!this._writableState){u.nextTick(a,this,t)}else if(!this._writableState.errorEmitted){this._writableState.errorEmitted=true;u.nextTick(a,this,t)}}return this}if(this._readableState){this._readableState.destroyed=true}if(this._writableState){this._writableState.destroyed=true}this._destroy(t||null,function(t){if(!e&&t){if(!r._writableState){u.nextTick(s,r,t)}else if(!r._writableState.errorEmitted){r._writableState.errorEmitted=true;u.nextTick(s,r,t)}else{u.nextTick(o,r)}}else if(e){u.nextTick(o,r);e(t)}else{u.nextTick(o,r)}});return this}function s(t,e){a(t,e);o(t)}function o(t){if(t._writableState&&!t._writableState.emitClose)return;if(t._readableState&&!t._readableState.emitClose)return;t.emit("close")}function e(){if(this._readableState){this._readableState.destroyed=false;this._readableState.reading=false;this._readableState.ended=false;this._readableState.endEmitted=false}if(this._writableState){this._writableState.destroyed=false;this._writableState.ended=false;this._writableState.ending=false;this._writableState.finalCalled=false;this._writableState.prefinished=false;this._writableState.finished=false;this._writableState.errorEmitted=false}}function a(t,e){t.emit("error",e)}function r(t,e){var r=t._readableState;var i=t._writableState;if(r&&r.autoDestroy||i&&i.autoDestroy)t.destroy(e);else t.emit("error",e)}i.exports={destroy:t,undestroy:e,errorOrDestroy:r}}).call(this)}).call(this,t("_process"))},{_process:185}],197:[function(t,e,r){"use strict";var d=t("../../../errors").codes.ERR_STREAM_PREMATURE_CLOSE;function p(i){var n=false;return function(){if(n)return;n=true;for(var t=arguments.length,e=new Array(t),r=0;r0;return h(t,r,i,function(t){if(!o)o=t;if(t)a.forEach(c);if(r)return;a.forEach(c);s(o)})});return n.reduce(d)}t.exports=s},{"../../../errors":188,"./end-of-stream":197}],200:[function(t,e,r){"use strict";var o=t("../../../errors").codes.ERR_INVALID_OPT_VALUE;function a(t,e,r){return t.highWaterMark!=null?t.highWaterMark:e?t[r]:null}function i(t,e,r,i){var n=a(e,i,r);if(n!=null){if(!(isFinite(n)&&Math.floor(n)===n)||n<0){var s=i?r:"highWaterMark";throw new o(s,n)}return Math.floor(n)}return t.objectMode?16:16*1024}e.exports={getHighWaterMark:i}},{"../../../errors":188}],201:[function(t,e,r){e.exports=t("events").EventEmitter},{events:155}],202:[function(t,e,r){"use strict";var i=t("safe-buffer").Buffer;var n=i.isEncoding||function(t){t=""+t;switch(t&&t.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 true;default:return false}};function s(t){if(!t)return"utf8";var e;while(true){switch(t){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 t;default:if(e)return;t=(""+t).toLowerCase();e=true}}}function o(t){var e=s(t);if(typeof e!=="string"&&(i.isEncoding===n||!n(t)))throw new Error("Unknown encoding: "+t);return e||t}r.StringDecoder=a;function a(t){this.encoding=o(t);var e;switch(this.encoding){case"utf16le":this.text=p;this.end=g;e=4;break;case"utf8":this.fillLast=h;e=4;break;case"base64":this.text=y;this.end=m;e=3;break;default:this.write=b;this.end=v;return}this.lastNeed=0;this.lastTotal=0;this.lastChar=i.allocUnsafe(e)}a.prototype.write=function(t){if(t.length===0)return"";var e;var r;if(this.lastNeed){e=this.fillLast(t);if(e===undefined)return"";r=this.lastNeed;this.lastNeed=0}else{r=0}if(r>5===6)return 2;else if(t>>4===14)return 3;else if(t>>3===30)return 4;return t>>6===2?-1:-2}function l(t,e,r){var i=e.length-1;if(i=0){if(n>0)t.lastNeed=n-1;return n}if(--i=0){if(n>0)t.lastNeed=n-2;return n}if(--i=0){if(n>0){if(n===2)n=0;else t.lastNeed=n-3}return n}return 0}function f(t,e,r){if((e[0]&192)!==128){t.lastNeed=0;return"�"}if(t.lastNeed>1&&e.length>1){if((e[1]&192)!==128){t.lastNeed=1;return"�"}if(t.lastNeed>2&&e.length>2){if((e[2]&192)!==128){t.lastNeed=2;return"�"}}}}function h(t){var e=this.lastTotal-this.lastNeed;var r=f(this,t,e);if(r!==undefined)return r;if(this.lastNeed<=t.length){t.copy(this.lastChar,e,0,this.lastNeed);return this.lastChar.toString(this.encoding,0,this.lastTotal)}t.copy(this.lastChar,e,0,t.length);this.lastNeed-=t.length}function c(t,e){var r=l(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var i=t.length-(r-this.lastNeed);t.copy(this.lastChar,0,i);return t.toString("utf8",e,i)}function d(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed)return e+"�";return e}function p(t,e){if((t.length-e)%2===0){var r=t.toString("utf16le",e);if(r){var i=r.charCodeAt(r.length-1);if(i>=55296&&i<=56319){this.lastNeed=2;this.lastTotal=4;this.lastChar[0]=t[t.length-2];this.lastChar[1]=t[t.length-1];return r.slice(0,-1)}}return r}this.lastNeed=1;this.lastTotal=2;this.lastChar[0]=t[t.length-1];return t.toString("utf16le",e,t.length-1)}function g(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function y(t,e){var r=(t.length-e)%3;if(r===0)return t.toString("base64",e);this.lastNeed=3-r;this.lastTotal=3;if(r===1){this.lastChar[0]=t[t.length-1]}else{this.lastChar[0]=t[t.length-2];this.lastChar[1]=t[t.length-1]}return t.toString("base64",e,t.length-r)}function m(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed)return e+this.lastChar.toString("base64",0,3-this.lastNeed);return e}function b(t){return t.toString(this.encoding)}function v(t){return t&&t.length?this.write(t):""}},{"safe-buffer":186}],203:[function(u,t,l){(function(i,a){(function(){var t=u("process/browser.js").nextTick;var e=Function.prototype.apply;var n=Array.prototype.slice;var s={};var o=0;l.setTimeout=function(){return new r(e.call(setTimeout,window,arguments),clearTimeout)};l.setInterval=function(){return new r(e.call(setInterval,window,arguments),clearInterval)};l.clearTimeout=l.clearInterval=function(t){t.close()};function r(t,e){this._id=t;this._clearFn=e}r.prototype.unref=r.prototype.ref=function(){};r.prototype.close=function(){this._clearFn.call(window,this._id)};l.enroll=function(t,e){clearTimeout(t._idleTimeoutId);t._idleTimeout=e};l.unenroll=function(t){clearTimeout(t._idleTimeoutId);t._idleTimeout=-1};l._unrefActive=l.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;if(t>=0){e._idleTimeoutId=setTimeout(function t(){if(e._onTimeout)e._onTimeout()},t)}};l.setImmediate=typeof i==="function"?i:function(e){var r=o++;var i=arguments.length<2?false:n.call(arguments,1);s[r]=true;t(function t(){if(s[r]){if(i){e.apply(null,i)}else{e.call(null)}l.clearImmediate(r)}});return r};l.clearImmediate=typeof a==="function"?a:function(t){delete s[t]}}).call(this)}).call(this,u("timers").setImmediate,u("timers").clearImmediate)},{"process/browser.js":185,timers:203}],204:[function(t,e,r){r.isatty=function(){return false};function i(){throw new Error("tty.ReadStream is not implemented")}r.ReadStream=i;function n(){throw new Error("tty.WriteStream is not implemented")}r.WriteStream=n},{}],205:[function(t,e,r){(function(r){(function(){e.exports=t;function t(t,e){if(n("noDeprecation")){return t}var r=false;function i(){if(!r){if(n("throwDeprecation")){throw new Error(e)}else if(n("traceDeprecation")){console.trace(e)}else{console.warn(e)}r=true}return t.apply(this,arguments)}return i}function n(t){try{if(!r.localStorage)return false}catch(t){return false}var e=r.localStorage[t];if(null==e)return false;return String(e).toLowerCase()==="true"}}).call(this)}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],206:[function(t,e,r){arguments[4][144][0].apply(r,arguments)},{dup:144}],207:[function(t,L,e){"use strict";var r=t("is-arguments");var i=t("is-generator-function");var n=t("which-typed-array");var s=t("is-typed-array");function o(t){return t.call.bind(t)}var a=typeof BigInt!=="undefined";var u=typeof Symbol!=="undefined";var l=o(Object.prototype.toString);var f=o(Number.prototype.valueOf);var h=o(String.prototype.valueOf);var c=o(Boolean.prototype.valueOf);if(a){var d=o(BigInt.prototype.valueOf)}if(u){var p=o(Symbol.prototype.valueOf)}function g(t,e){if(typeof t!=="object"){return false}try{e(t);return true}catch(t){return false}}e.isArgumentsObject=r;e.isGeneratorFunction=i;e.isTypedArray=s;function y(t){return typeof Promise!=="undefined"&&t instanceof Promise||t!==null&&typeof t==="object"&&typeof t.then==="function"&&typeof t.catch==="function"}e.isPromise=y;function m(t){if(typeof ArrayBuffer!=="undefined"&&ArrayBuffer.isView){return ArrayBuffer.isView(t)}return s(t)||A(t)}e.isArrayBufferView=m;function b(t){return n(t)==="Uint8Array"}e.isUint8Array=b;function v(t){return n(t)==="Uint8ClampedArray"}e.isUint8ClampedArray=v;function D(t){return n(t)==="Uint16Array"}e.isUint16Array=D;function F(t){return n(t)==="Uint32Array"}e.isUint32Array=F;function W(t){return n(t)==="Int8Array"}e.isInt8Array=W;function H(t){return n(t)==="Int16Array"}e.isInt16Array=H;function N(t){return n(t)==="Int32Array"}e.isInt32Array=N;function U(t){return n(t)==="Float32Array"}e.isFloat32Array=U;function z(t){return n(t)==="Float64Array"}e.isFloat64Array=z;function Y(t){return n(t)==="BigInt64Array"}e.isBigInt64Array=Y;function V(t){return n(t)==="BigUint64Array"}e.isBigUint64Array=V;function w(t){return l(t)==="[object Map]"}w.working=typeof Map!=="undefined"&&w(new Map);function G(t){if(typeof Map==="undefined"){return false}return w.working?w(t):t instanceof Map}e.isMap=G;function x(t){return l(t)==="[object Set]"}x.working=typeof Set!=="undefined"&&x(new Set);function Z(t){if(typeof Set==="undefined"){return false}return x.working?x(t):t instanceof Set}e.isSet=Z;function _(t){return l(t)==="[object WeakMap]"}_.working=typeof WeakMap!=="undefined"&&_(new WeakMap);function K(t){if(typeof WeakMap==="undefined"){return false}return _.working?_(t):t instanceof WeakMap}e.isWeakMap=K;function C(t){return l(t)==="[object WeakSet]"}C.working=typeof WeakSet!=="undefined"&&C(new WeakSet);function X(t){return C(t)}e.isWeakSet=X;function T(t){return l(t)==="[object ArrayBuffer]"}T.working=typeof ArrayBuffer!=="undefined"&&T(new ArrayBuffer);function S(t){if(typeof ArrayBuffer==="undefined"){return false}return T.working?T(t):t instanceof ArrayBuffer}e.isArrayBuffer=S;function k(t){return l(t)==="[object DataView]"}k.working=typeof ArrayBuffer!=="undefined"&&typeof DataView!=="undefined"&&k(new DataView(new ArrayBuffer(1),0,1));function A(t){if(typeof DataView==="undefined"){return false}return k.working?k(t):t instanceof DataView}e.isDataView=A;var E=typeof SharedArrayBuffer!=="undefined"?SharedArrayBuffer:undefined;function B(t){return l(t)==="[object SharedArrayBuffer]"}function R(t){if(typeof E==="undefined"){return false}if(typeof B.working==="undefined"){B.working=B(new E)}return B.working?B(t):t instanceof E}e.isSharedArrayBuffer=R;function q(t){return l(t)==="[object AsyncFunction]"}e.isAsyncFunction=q;function J(t){return l(t)==="[object Map Iterator]"}e.isMapIterator=J;function $(t){return l(t)==="[object Set Iterator]"}e.isSetIterator=$;function Q(t){return l(t)==="[object Generator]"}e.isGeneratorObject=Q;function tt(t){return l(t)==="[object WebAssembly.Module]"}e.isWebAssemblyCompiledModule=tt;function O(t){return g(t,f)}e.isNumberObject=O;function M(t){return g(t,h)}e.isStringObject=M;function I(t){return g(t,c)}e.isBooleanObject=I;function P(t){return a&&g(t,d)}e.isBigIntObject=P;function j(t){return u&&g(t,p)}e.isSymbolObject=j;function et(t){return O(t)||M(t)||I(t)||P(t)||j(t)}e.isBoxedPrimitive=et;function rt(t){return typeof Uint8Array!=="undefined"&&(S(t)||R(t))}e.isAnyArrayBuffer=rt;["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(t){Object.defineProperty(e,t,{enumerable:false,value:function(){throw new Error(t+" is not supported in userland")}})})},{"is-arguments":166,"is-generator-function":169,"is-typed-array":170,"which-typed-array":209}],208:[function(F,t,W){(function(D){(function(){var r=Object.getOwnPropertyDescriptors||function t(e){var r=Object.keys(e);var i={};for(var n=0;n=n)return t;switch(t){case"%s":return String(i[r++]);case"%d":return Number(i[r++]);case"%j":try{return JSON.stringify(i[r++])}catch(t){return"[Circular]"}default:return t}});for(var o=i[r];r=3)r.depth=arguments[2];if(arguments.length>=4)r.colors=arguments[3];if(o(e)){r.showHidden=e}else if(e){W._extend(r,e)}if(_(r.showHidden))r.showHidden=false;if(_(r.depth))r.depth=2;if(_(r.colors))r.colors=false;if(_(r.customInspect))r.customInspect=true;if(r.colors)r.stylize=n;return p(r,t,r.depth)}W.inspect=u;u.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]};u.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function n(t,e){var r=u.styles[e];if(r){return"["+u.colors[r][0]+"m"+t+"["+u.colors[r][1]+"m"}else{return t}}function s(t,e){return t}function d(t){var r={};t.forEach(function(t,e){r[t]=true});return r}function p(e,r,i){if(e.customInspect&&r&&A(r.inspect)&&r.inspect!==W.inspect&&!(r.constructor&&r.constructor.prototype===r)){var t=r.inspect(i,e);if(!x(t)){t=p(e,t,i)}return t}var n=g(e,r);if(n){return n}var s=Object.keys(r);var o=d(s);if(e.showHidden){s=Object.getOwnPropertyNames(r)}if(k(r)&&(s.indexOf("message")>=0||s.indexOf("description")>=0)){return y(r)}if(s.length===0){if(A(r)){var a=r.name?": "+r.name:"";return e.stylize("[Function"+a+"]","special")}if(C(r)){return e.stylize(RegExp.prototype.toString.call(r),"regexp")}if(S(r)){return e.stylize(Date.prototype.toString.call(r),"date")}if(k(r)){return y(r)}}var u="",l=false,f=["{","}"];if(w(r)){l=true;f=["[","]"]}if(A(r)){var h=r.name?": "+r.name:"";u=" [Function"+h+"]"}if(C(r)){u=" "+RegExp.prototype.toString.call(r)}if(S(r)){u=" "+Date.prototype.toUTCString.call(r)}if(k(r)){u=" "+y(r)}if(s.length===0&&(!l||r.length==0)){return f[0]+u+f[1]}if(i<0){if(C(r)){return e.stylize(RegExp.prototype.toString.call(r),"regexp")}else{return e.stylize("[Object]","special")}}e.seen.push(r);var c;if(l){c=m(e,r,i,o,s)}else{c=s.map(function(t){return b(e,r,i,o,t,l)})}e.seen.pop();return v(c,u,f)}function g(t,e){if(_(e))return t.stylize("undefined","undefined");if(x(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}if(h(e))return t.stylize(""+e,"number");if(o(e))return t.stylize(""+e,"boolean");if(l(e))return t.stylize("null","null")}function y(t){return"["+Error.prototype.toString.call(t)+"]"}function m(e,r,i,n,t){var s=[];for(var o=0,a=r.length;o-1){if(s){a=a.split("\n").map(function(t){return" "+t}).join("\n").substr(2)}else{a="\n"+a.split("\n").map(function(t){return" "+t}).join("\n")}}}else{a=t.stylize("[Circular]","special")}}if(_(o)){if(s&&n.match(/^\d+$/)){return a}o=JSON.stringify(""+n);if(o.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)){o=o.substr(1,o.length-2);o=t.stylize(o,"name")}else{o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'");o=t.stylize(o,"string")}}return o+": "+a}function v(t,e,r){var i=0;var n=t.reduce(function(t,e){i++;if(e.indexOf("\n")>=0)i++;return t+e.replace(/\u001b\[\d\d?m/g,"").length+1},0);if(n>60){return r[0]+(e===""?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1]}return r[0]+e+" "+t.join(", ")+" "+r[1]}W.types=F("./support/types");function w(t){return Array.isArray(t)}W.isArray=w;function o(t){return typeof t==="boolean"}W.isBoolean=o;function l(t){return t===null}W.isNull=l;function f(t){return t==null}W.isNullOrUndefined=f;function h(t){return typeof t==="number"}W.isNumber=h;function x(t){return typeof t==="string"}W.isString=x;function c(t){return typeof t==="symbol"}W.isSymbol=c;function _(t){return t===void 0}W.isUndefined=_;function C(t){return T(t)&&B(t)==="[object RegExp]"}W.isRegExp=C;W.types.isRegExp=C;function T(t){return typeof t==="object"&&t!==null}W.isObject=T;function S(t){return T(t)&&B(t)==="[object Date]"}W.isDate=S;W.types.isDate=S;function k(t){return T(t)&&(B(t)==="[object Error]"||t instanceof Error)}W.isError=k;W.types.isNativeError=k;function A(t){return typeof t==="function"}W.isFunction=A;function E(t){return t===null||typeof t==="boolean"||typeof t==="number"||typeof t==="string"||typeof t==="symbol"||typeof t==="undefined"}W.isPrimitive=E;W.isBuffer=F("./support/isBuffer");function B(t){return Object.prototype.toString.call(t)}function R(t){return t<10?"0"+t.toString(10):t.toString(10)}var O=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function M(){var t=new Date;var e=[R(t.getHours()),R(t.getMinutes()),R(t.getSeconds())].join(":");return[t.getDate(),O[t.getMonth()],e].join(" ")}W.log=function(){console.log("%s - %s",M(),W.format.apply(W,arguments))};W.inherits=F("inherits");W._extend=function(t,e){if(!e||!T(e))return t;var r=Object.keys(e);var i=r.length;while(i--){t[r[i]]=e[r[i]]}return t};function I(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var P=typeof Symbol!=="undefined"?Symbol("util.promisify.custom"):undefined;W.promisify=function t(s){if(typeof s!=="function")throw new TypeError('The "original" argument must be of type Function');if(P&&s[P]){var e=s[P];if(typeof e!=="function"){throw new TypeError('The "util.promisify.custom" argument must be of type Function')}Object.defineProperty(e,P,{value:e,enumerable:false,writable:false,configurable:true});return e}function e(){var r,i;var t=new Promise(function(t,e){r=t;i=e});var e=[];for(var n=0;n