brsh 2.1.1 → 2.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.nvmrc +1 -0
- package/CHANGELOG.md +7 -0
- package/bin/brsh-shell.js +65 -0
- package/dist/brsh.css +1 -1
- package/dist/shell.es.js +585 -495
- package/dist/shell.es.js.map +1 -1
- package/dist/shell.min.js +6 -6
- package/dist/shell.min.js.map +1 -1
- package/dist/terminal.es.js +598 -499
- package/dist/terminal.es.js.map +1 -1
- package/dist/terminal.min.js +8 -8
- package/dist/terminal.min.js.map +1 -1
- package/index.js +9 -4
- package/lib/Command.js +3 -1
- package/lib/Context.js +1 -0
- package/lib/NodeFileSystem.js +5 -1
- package/lib/Terminal.js +29 -2
- package/lib/WasmCommand.js +14 -7
- package/lib/buildFilesystemStructure.js +9 -4
- package/lib/local/curl.js +133 -0
- package/lib/local/index.js +2 -1
- package/lib/local/source.js +1 -3
- package/package.json +6 -3
- package/styles/terminal.css +8 -1
- package/test/exportFileSystem.test.js +28 -8
- package/test/scripts.test.js +57 -0
- package/vite.config.js +34 -0
package/dist/shell.min.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
"use strict";var Shell=(function(){var e=(e,t)=>()=>(e&&(t=e(e=0)),t),t=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),n,r=e((()=>{n=globalThis||self})),i=t(((e,t)=>{var n=typeof Reflect==`object`?Reflect:null,r=n&&typeof n.apply==`function`?n.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)},i=n&&typeof n.ownKeys==`function`?n.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};function a(e){console&&console.warn&&console.warn(e)}var o=Number.isNaN||function(e){return e!==e};function s(){s.init.call(this)}t.exports=s,t.exports.once=y,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var c=10;function l(e){if(typeof e!=`function`)throw TypeError(`The "listener" argument must be of type Function. Received type `+typeof e)}Object.defineProperty(s,`defaultMaxListeners`,{enumerable:!0,get:function(){return c},set:function(e){if(typeof e!=`number`||e<0||o(e))throw RangeError(`The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received `+e+`.`);c=e}}),s.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(e){if(typeof e!=`number`||e<0||o(e))throw RangeError(`The value of "n" is out of range. It must be a non-negative number. Received `+e+`.`);return this._maxListeners=e,this};function u(e){return e._maxListeners===void 0?s.defaultMaxListeners:e._maxListeners}s.prototype.getMaxListeners=function(){return u(this)},s.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var i=e===`error`,a=this._events;if(a!==void 0)i&&=a.error===void 0;else if(!i)return!1;if(i){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var s=Error(`Unhandled error.`+(o?` (`+o.message+`)`:``));throw s.context=o,s}var c=a[e];if(c===void 0)return!1;if(typeof c==`function`)r(c,this,t);else for(var l=c.length,u=g(c,l),n=0;n<l;++n)r(u[n],this,t);return!0};function d(e,t,n,r){var i,o,s;if(l(n),o=e._events,o===void 0?(o=e._events=Object.create(null),e._eventsCount=0):(o.newListener!==void 0&&(e.emit(`newListener`,t,n.listener?n.listener:n),o=e._events),s=o[t]),s===void 0)s=o[t]=n,++e._eventsCount;else if(typeof s==`function`?s=o[t]=r?[n,s]:[s,n]:r?s.unshift(n):s.push(n),i=u(e),i>0&&s.length>i&&!s.warned){s.warned=!0;var c=Error(`Possible EventEmitter memory leak detected. `+s.length+` `+String(t)+` listeners added. Use emitter.setMaxListeners() to increase limit`);c.name=`MaxListenersExceededWarning`,c.emitter=e,c.type=t,c.count=s.length,a(c)}return e}s.prototype.addListener=function(e,t){return d(this,e,t,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(e,t){return d(this,e,t,!0)};function f(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=f.bind(r);return i.listener=n,r.wrapFn=i,i}s.prototype.once=function(e,t){return l(t),this.on(e,p(this,e,t)),this},s.prototype.prependOnceListener=function(e,t){return l(t),this.prependListener(e,p(this,e,t)),this},s.prototype.removeListener=function(e,t){var n,r,i,a,o;if(l(t),r=this._events,r===void 0||(n=r[e],n===void 0))return this;if(n===t||n.listener===t)--this._eventsCount===0?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit(`removeListener`,e,n.listener||t));else if(typeof n!=`function`){for(i=-1,a=n.length-1;a>=0;a--)if(n[a]===t||n[a].listener===t){o=n[a].listener,i=a;break}if(i<0)return this;i===0?n.shift():_(n,i),n.length===1&&(r[e]=n[0]),r.removeListener!==void 0&&this.emit(`removeListener`,e,o||t)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(e){var t,n=this._events,r;if(n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]),this;if(arguments.length===0){var i=Object.keys(n),a;for(r=0;r<i.length;++r)a=i[r],a!==`removeListener`&&this.removeAllListeners(a);return this.removeAllListeners(`removeListener`),this._events=Object.create(null),this._eventsCount=0,this}if(t=n[e],typeof t==`function`)this.removeListener(e,t);else if(t!==void 0)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this};function m(e,t,n){var r=e._events;if(r===void 0)return[];var i=r[t];return i===void 0?[]:typeof i==`function`?n?[i.listener||i]:[i]:n?v(i):g(i,i.length)}s.prototype.listeners=function(e){return m(this,e,!0)},s.prototype.rawListeners=function(e){return m(this,e,!1)},s.listenerCount=function(e,t){return typeof e.listenerCount==`function`?e.listenerCount(t):h.call(e,t)},s.prototype.listenerCount=h;function h(e){var t=this._events;if(t!==void 0){var n=t[e];if(typeof n==`function`)return 1;if(n!==void 0)return n.length}return 0}s.prototype.eventNames=function(){return this._eventsCount>0?i(this._events):[]};function g(e,t){for(var n=Array(t),r=0;r<t;++r)n[r]=e[r];return n}function _(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}function v(e){for(var t=Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}function y(e,t){return new Promise(function(n,r){function i(n){e.removeListener(t,a),r(n)}function a(){typeof e.removeListener==`function`&&e.removeListener(`error`,i),n([].slice.call(arguments))}x(e,t,a,{once:!0}),t!==`error`&&b(e,i,{once:!0})})}function b(e,t,n){typeof e.on==`function`&&x(e,`error`,t,n)}function x(e,t,n,r){if(typeof e.on==`function`)r.once?e.once(t,n):e.on(t,n);else if(typeof e.addEventListener==`function`)e.addEventListener(t,function i(a){r.once&&e.removeEventListener(t,i),n(a)});else throw TypeError(`The "emitter" argument must be of type EventEmitter. Received type `+typeof e)}})),a=t(((e,t)=>{t.exports=class{constructor(e=`/`,t={},n={},r=null){this.fileSystem=t,this.permissions=Object.assign({},n),this.cwd=e,this._onChange=r,this._changeScheduled=!1}getFileByPath(e){return this._getFileByAbsolutePath(this._pathToAbsolute(e))}_pathToAbsolute(e){return e.startsWith(`./`)&&(e=e.substring(2)),e.startsWith(`/`)||(e=this.cwd+e),this._traverseComplexAbsolutePath(e)}_traverseComplexAbsolutePath(e){let t=e.split(`/`);for(;t.includes(`..`);){let e=t.indexOf(`..`)-1;t.splice(e,2)}return t.join(`/`)}absolutePath(e){return this._pathToAbsolute(e)}setFileByPath(e,t,n=!1){let r=this._pathToAbsolute(e);this._setFileByAbsolutePath(r,t,n),this._triggerChange()}_setFileByAbsolutePath(e,t,n=!0){let r=e.split(`/`);r.shift();let i=r.pop(),a=r.reduce((e,t)=>{if(!e[t]){if(!n)throw Error(`${t}: No such file or directory`);e[t]={}}return e[t]},this.fileSystem);a[i]=t}_getFileByAbsolutePath(e){let t=e.split(`/`);return t.shift(),t[t.length-1].length<1&&t.pop(),t.reduce((e,t)=>e&&e[t]?e[t]:null,this.fileSystem)}deleteFileByPath(e){let t=this._pathToAbsolute(e);this._deleteByAbsolutePath(t);let n=t+`/`;Object.keys(this.permissions).forEach(e=>{(e===t||e.startsWith(n))&&delete this.permissions[e]}),this._triggerChange()}_deleteByAbsolutePath(e){let t=e.split(`/`);t.shift(),t[t.length-1]===``&&t.pop();let n=t.pop();if(!n)return;let r=t.reduce((e,t)=>e&&e[t]?e[t]:null,this.fileSystem);r&&n in r&&delete r[n]}getMode(e){let t=this._pathToAbsolute(e);if(this.permissions[t]!==void 0)return this.permissions[t];let n=this._getFileByAbsolutePath(t);return n==null?null:n.constructor===Object||typeof n==`function`?493:420}setMode(e,t){let n=this._pathToAbsolute(e);this.permissions[n]=t,this._triggerChange()}isExecutable(e){let t=this.getMode(e);return t===null?!1:(t&64)!=0}getSize(e){let t=this._pathToAbsolute(e),n=this._getFileByAbsolutePath(t);return n==null?0:n.constructor===Object?JSON.stringify(n).length:n.toString().length}getRawPermissions(){return Object.assign({},this.permissions)}setCwd(e){this.cwd=this._pathToAbsolute(e.endsWith(`/`)?e:e+`/`)}getRaw(){return this.fileSystem}getRawPermissions(){return Object.assign({},this.permissions)}addFiles(e){Object.entries(e).forEach(([e,t])=>{this.setFileByPath(e,t,!0)})}autoComplete(e,t){let n=this._pathToAbsolute(e).split(`/`),r=n.pop(),i=this.getFileByPath(n.length>1?n.join(`/`):`/`),a=this.getFileByPath(t);if(i&&i.constructor===Object){let t=Object.keys(i).filter(e=>e.startsWith(r));r.length<1&&(t=t.filter(e=>!e.startsWith(`.`)));let n=e.split(`/`);n.pop();let o=i;if(t.length<1&&n.length<1&&a&&(t=Object.keys(a).filter(e=>e.startsWith(r)),o=a),t.length)return{path:n.length?n.join(`/`):null,options:t.map(e=>o[e]&&o[e].constructor===Object?e.concat(`/`):e)}}return null}_triggerChange(){!this._onChange||this._changeScheduled||(this._changeScheduled=!0,Promise.resolve().then(()=>{this._changeScheduled=!1,typeof this._onChange==`function`&&this._onChange(this.getRaw(),this.getRawPermissions())}))}}}));function o(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}function s(){throw Error(`setTimeout has not been defined`)}function c(){throw Error(`clearTimeout has not been defined`)}function l(e){if(_===setTimeout)return setTimeout(e,0);if((_===s||!_)&&setTimeout)return _=setTimeout,setTimeout(e,0);try{return _(e,0)}catch{try{return _.call(null,e,0)}catch{return _.call(this,e,0)}}}function u(e){if(v===clearTimeout)return clearTimeout(e);if((v===c||!v)&&clearTimeout)return v=clearTimeout,clearTimeout(e);try{return v(e)}catch{try{return v.call(null,e)}catch{return v.call(this,e)}}}function d(){!b||!x||(b=!1,x.length?y=x.concat(y):S=-1,y.length&&f())}function f(){if(!b){var e=l(d);b=!0;for(var t=y.length;t;){for(x=y,y=[];++S<t;)x&&x[S].run();S=-1,t=y.length}x=null,b=!1,u(e)}}function p(e,t){this.fun=e,this.array=t}function m(){}var h,g,_,v,y,b,x,S,C,w,T=e((()=>{h={exports:{}},g=h.exports={},(function(){try{_=typeof setTimeout==`function`?setTimeout:s}catch{_=s}try{v=typeof clearTimeout==`function`?clearTimeout:c}catch{v=c}})(),y=[],b=!1,S=-1,g.nextTick=function(e){var t=Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];y.push(new p(e,t)),y.length===1&&!b&&l(f)},p.prototype.run=function(){this.fun.apply(null,this.array)},g.title=`browser`,g.browser=!0,g.env={},g.argv=[],g.version=``,g.versions={},g.on=m,g.addListener=m,g.once=m,g.off=m,g.removeListener=m,g.removeAllListeners=m,g.emit=m,g.prependListener=m,g.prependOnceListener=m,g.listeners=function(e){return[]},g.binding=function(e){throw Error(`process.binding is not supported`)},g.cwd=function(){return`/`},g.chdir=function(e){throw Error(`process.chdir is not supported`)},g.umask=function(){return 0},C=h.exports,w=o(C)})),E=t(((e,t)=>{t.exports=null})),D=t(((e,t)=>{T();function n(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}function r(e,t){for(var n=``,r=0,i=-1,a=0,o,s=0;s<=e.length;++s){if(s<e.length)o=e.charCodeAt(s);else if(o===47)break;else o=47;if(o===47){if(!(i===s-1||a===1))if(i!==s-1&&a===2){if(n.length<2||r!==2||n.charCodeAt(n.length-1)!==46||n.charCodeAt(n.length-2)!==46){if(n.length>2){var c=n.lastIndexOf(`/`);if(c!==n.length-1){c===-1?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=s,a=0;continue}}else if(n.length===2||n.length===1){n=``,r=0,i=s,a=0;continue}}t&&(n.length>0?n+=`/..`:n=`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,s):n=e.slice(i+1,s),r=s-i-1;i=s,a=0}else o===46&&a!==-1?++a:a=-1}return n}function i(e,t){var n=t.dir||t.root,r=t.base||(t.name||``)+(t.ext||``);return n?n===t.root?n+r:n+e+r:r}var a={resolve:function(){for(var e=``,t=!1,i,a=arguments.length-1;a>=-1&&!t;a--){var o;a>=0?o=arguments[a]:(i===void 0&&(i=w.cwd()),o=i),n(o),o.length!==0&&(e=o+`/`+e,t=o.charCodeAt(0)===47)}return e=r(e,!t),t?e.length>0?`/`+e:`/`:e.length>0?e:`.`},normalize:function(e){if(n(e),e.length===0)return`.`;var t=e.charCodeAt(0)===47,i=e.charCodeAt(e.length-1)===47;return e=r(e,!t),e.length===0&&!t&&(e=`.`),e.length>0&&i&&(e+=`/`),t?`/`+e:e},isAbsolute:function(e){return n(e),e.length>0&&e.charCodeAt(0)===47},join:function(){if(arguments.length===0)return`.`;for(var e,t=0;t<arguments.length;++t){var r=arguments[t];n(r),r.length>0&&(e===void 0?e=r:e+=`/`+r)}return e===void 0?`.`:a.normalize(e)},relative:function(e,t){if(n(e),n(t),e===t||(e=a.resolve(e),t=a.resolve(t),e===t))return``;for(var r=1;r<e.length&&e.charCodeAt(r)===47;++r);for(var i=e.length,o=i-r,s=1;s<t.length&&t.charCodeAt(s)===47;++s);for(var c=t.length-s,l=o<c?o:c,u=-1,d=0;d<=l;++d){if(d===l){if(c>l){if(t.charCodeAt(s+d)===47)return t.slice(s+d+1);if(d===0)return t.slice(s+d)}else o>l&&(e.charCodeAt(r+d)===47?u=d:d===0&&(u=0));break}var f=e.charCodeAt(r+d);if(f!==t.charCodeAt(s+d))break;f===47&&(u=d)}var p=``;for(d=r+u+1;d<=i;++d)(d===i||e.charCodeAt(d)===47)&&(p.length===0?p+=`..`:p+=`/..`);return p.length>0?p+t.slice(s+u):(s+=u,t.charCodeAt(s)===47&&++s,t.slice(s))},_makeLong:function(e){return e},dirname:function(e){if(n(e),e.length===0)return`.`;for(var t=e.charCodeAt(0),r=t===47,i=-1,a=!0,o=e.length-1;o>=1;--o)if(t=e.charCodeAt(o),t===47){if(!a){i=o;break}}else a=!1;return i===-1?r?`/`:`.`:r&&i===1?`//`:e.slice(0,i)},basename:function(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);n(e);var r=0,i=-1,a=!0,o;if(t!==void 0&&t.length>0&&t.length<=e.length){if(t.length===e.length&&t===e)return``;var s=t.length-1,c=-1;for(o=e.length-1;o>=0;--o){var l=e.charCodeAt(o);if(l===47){if(!a){r=o+1;break}}else c===-1&&(a=!1,c=o+1),s>=0&&(l===t.charCodeAt(s)?--s===-1&&(i=o):(s=-1,i=c))}return r===i?i=c:i===-1&&(i=e.length),e.slice(r,i)}else{for(o=e.length-1;o>=0;--o)if(e.charCodeAt(o)===47){if(!a){r=o+1;break}}else i===-1&&(a=!1,i=o+1);return i===-1?``:e.slice(r,i)}},extname:function(e){n(e);for(var t=-1,r=0,i=-1,a=!0,o=0,s=e.length-1;s>=0;--s){var c=e.charCodeAt(s);if(c===47){if(!a){r=s+1;break}continue}i===-1&&(a=!1,i=s+1),c===46?t===-1?t=s:o!==1&&(o=1):t!==-1&&(o=-1)}return t===-1||i===-1||o===0||o===1&&t===i-1&&t===r+1?``:e.slice(t,i)},format:function(e){if(typeof e!=`object`||!e)throw TypeError(`The "pathObject" argument must be of type Object. Received type `+typeof e);return i(`/`,e)},parse:function(e){n(e);var t={root:``,dir:``,base:``,ext:``,name:``};if(e.length===0)return t;var r=e.charCodeAt(0),i=r===47,a;i?(t.root=`/`,a=1):a=0;for(var o=-1,s=0,c=-1,l=!0,u=e.length-1,d=0;u>=a;--u){if(r=e.charCodeAt(u),r===47){if(!l){s=u+1;break}continue}c===-1&&(l=!1,c=u+1),r===46?o===-1?o=u:d!==1&&(d=1):o!==-1&&(d=-1)}return o===-1||c===-1||d===0||d===1&&o===c-1&&o===s+1?c!==-1&&(s===0&&i?t.base=t.name=e.slice(1,c):t.base=t.name=e.slice(s,c)):(s===0&&i?(t.name=e.slice(1,o),t.base=e.slice(1,c)):(t.name=e.slice(s,o),t.base=e.slice(s,c)),t.ext=e.slice(o,c)),s>0?t.dir=e.slice(0,s-1):i&&(t.dir=`/`),t},sep:`/`,delimiter:`:`,win32:null,posix:null};a.posix=a,t.exports=a})),O=t(((e,t)=>{T();var n=E(),r=D();t.exports=class{constructor(e,t=null){this._onChange=t,this._changeScheduled=!1,this._virtualFiles={},this.cwd=this._normalizeCwd(e||w.cwd())}get isRealFilesystem(){return!0}_normalizeCwd(e){let t=r.resolve(e);return t===`/`?`/`:t+`/`}absolutePath(e){e.startsWith(`./`)&&(e=e.slice(2));let t=e.startsWith(`/`)?e:r.join(this.cwd,e);return r.normalize(t)}setCwd(e){let t=e.endsWith(`/`)?e.slice(0,-1):e,n=this.absolutePath(t);this.cwd=n===`/`?`/`:n+`/`}getFileByPath(e){let t=this.absolutePath(e);if(this._virtualFiles[t]!==void 0)return this._virtualFiles[t];let i;try{i=n.statSync(t)}catch{return null}if(i.isDirectory()){let e={};try{for(let i of n.readdirSync(t)){let a=r.join(t,i);if(this._virtualFiles[a]!==void 0)e[i]=this._virtualFiles[a];else try{e[i]=n.statSync(a).isDirectory()?{}:``}catch{}}}catch{}let i=t===`/`?`/`:t+`/`;for(let t of Object.keys(this._virtualFiles))if(t.startsWith(i)&&!t.slice(i.length).includes(`/`)){let n=t.slice(i.length);n in e||(e[n]=this._virtualFiles[t])}return e}try{return n.readFileSync(t,`utf8`)}catch{return null}}setFileByPath(e,t,i=!1){let a=this.absolutePath(e);if(typeof t==`function`){this._virtualFiles[a]=t;return}if(t!=null&&t.constructor===Object){n.mkdirSync(a,{recursive:i}),this._triggerChange();return}i&&n.mkdirSync(r.dirname(a),{recursive:!0}),n.writeFileSync(a,String(t)),this._triggerChange()}deleteFileByPath(e){let t=this.absolutePath(e);delete this._virtualFiles[t];try{n.lstatSync(t).isDirectory()?n.rmdirSync(t):n.unlinkSync(t),this._triggerChange()}catch{}}getMode(e){let t=this.absolutePath(e);if(this._virtualFiles[t]!==void 0)return typeof this._virtualFiles[t]==`function`?493:420;try{return n.statSync(t).mode&511}catch{return null}}setMode(e,t){n.chmodSync(this.absolutePath(e),t),this._triggerChange()}isExecutable(e){let t=this.getMode(e);return t===null?!1:(t&64)!=0}getSize(e){let t=this.absolutePath(e);if(this._virtualFiles[t]!==void 0)return 0;try{return n.statSync(t).size}catch{return 0}}isSymlink(e){let t=this.absolutePath(e);try{return n.lstatSync(t).isSymbolicLink()}catch{return!1}}readSymlink(e){let t=this.absolutePath(e);try{return n.readlinkSync(t)}catch{return null}}createSymlink(e,t){let i=this.absolutePath(t);n.mkdirSync(r.dirname(i),{recursive:!0}),n.symlinkSync(e,i),this._triggerChange()}getRaw(){return null}getRawPermissions(){return{}}addFiles(e){Object.entries(e).forEach(([e,t])=>{this.setFileByPath(e,t,!0)})}autoComplete(e,t){let i=this.absolutePath(e).split(`/`),a=i.pop(),o=i.join(`/`)||`/`,s=[];try{s=n.readdirSync(o)}catch{}let c=o===`/`?`/`:o+`/`;for(let e of Object.keys(this._virtualFiles))if(e.startsWith(c)&&!e.slice(c.length).includes(`/`)){let t=e.slice(c.length);s.includes(t)||s.push(t)}let l=s.filter(e=>e.startsWith(a));if(l.length===0&&!e.includes(`/`)){let n=this.getFileByPath(t);if(n&&n.constructor===Object&&(l=Object.keys(n).filter(t=>t.startsWith(e)),l.length))return{path:null,options:l}}if(!l.length)return null;let u=e.split(`/`);return u.pop(),{path:u.length?u.join(`/`):null,options:l.map(e=>{let t=r.join(o,e);if(this._virtualFiles[t]!==void 0)return e;try{return n.statSync(t).isDirectory()?e+`/`:e}catch{return e}})}}_triggerChange(){!this._onChange||this._changeScheduled||(this._changeScheduled=!0,Promise.resolve().then(()=>{this._changeScheduled=!1,typeof this._onChange==`function`&&this._onChange(null,null)}))}}})),k=t(((e,t)=>{var n=a();t.exports=class{constructor(e){this.options=e;let{cwd:t=`/`,clearFn:r,destroyFn:i,onFsChange:a}=this.options;this.vars={},this.aliases={},this.fs=new n(t,{},{},a||null),this._clearFn=r,this._destroyFn=i}setVar(e,t){t?this.vars[e]=t:delete this.vars[e]}unsetVar(e){this.setVar(e)}getVar(e){return this.vars[e]||``}setAlias(e,t){t?this.aliases[e]=t:delete this.aliases[e]}unsetAlias(e){this.setAlias(e)}getAlias(e){return this.aliases[e]||null}setCommand(e){let t=`${this.getVar(`PATH`)}/${e.name.toLowerCase()}`;this.fs.addFiles({[t]:e})}getCommand(e){let t=`${this.getVar(`PATH`)}/${e}`;return this.fs.getFileByPath(t)||null}setNodeFilesystem(e){let t=O(),n=this.fs._onChange;this.fs=new t(e,n)}setFilesystem(e,t={}){let r=this.fs.getFileByPath(this.getVar(`PATH`))||{},i=this.fs.getRawPermissions(),a=this.fs._onChange;this.fs=new n(this.fs.cwd,e,Object.assign({},i,t),a),this.fs.addFiles(r)}setCwd(e){this.fs.setCwd(e)}source(e){this.vars=Object.assign({},this.vars,e.vars),this.aliases=Object.assign({},this.aliases,e.aliases)}clear(){typeof this._clearFn==`function`&&this._clearFn()}destroy(e=0){typeof this._destroyFn==`function`&&this._destroyFn(e)}}})),A=t(((e,t)=>{var n=[`out`,`err`];t.exports=class{constructor(e,t){if(!n.includes(e))throw Error(`incorrect std output type`);this.type=e,this.string=t}}})),j=t(((e,t)=>{var n=A();t.exports=class{constructor(e=[],t=0){if(typeof t!=`number`)throw Error(`Command Result ExitCode must be a number`);if(!Array.isArray(e))throw Error(`Command Result be array`);this.std=e,this.exitCode=t}addStdOutLine(e){this.std.push(new n(`out`,e))}addStdErrLine(e){this.std.push(new n(`err`,e))}getStdOutput(){return this.std}getExitCode(){return this.exitCode}flush(){let e=this.std;return this.std=[],e}}})),M=t(((e,t)=>{var n=i(),r=j();t.exports=class extends n{constructor(e){super(),this.arguments=e,this.result=new r}get name(){return`unnamed`}run(){return Promise.reject(`Command not implemented...`)}runCommand(){return this.run().then(e=>(e&&e.split(/\r?\n/).forEach(e=>this.stdOut=e),this.result)).catch(e=>(e&&(this.stdErr=e.message||e),this.exitCode=127,this.result))}onInput(e){}set exitCode(e){this.result.exitCode=e}set stdOut(e){this.result.addStdOutLine(e)}set stdErr(e){this.result.addStdErrLine(e)}flush(){console.log(`flush now`),this.emit(`flush`,this.result.flush())}}})),N=t(((e,t)=>{var n=M();t.exports=class extends n{constructor(e,t){super(e),this.context=t}}})),P=t(((e,t)=>{r();var i=N();t.exports=class extends i{constructor(e,t,n,r=!1){super(t,n),this.script=e,this.source=r}run(){let e=this.context.fs.isRealFilesystem?{useRealFilesystem:!0}:{filesystem:this.context.fs.getRaw(),permissions:this.context.fs.getRawPermissions()};this.sandbox=new n.shell({cwd:this.context.fs.cwd,...e}),this.sandbox.context.source(this.context),this.sandbox.on(`stdOut`,e=>this.stdOut=e),this.sandbox.on(`stdErr`,e=>this.stdErr=e);let t=this.script.split(/\r?\n/);if(!t[0].startsWith(`#!`))return Promise.reject(`no interpreter set`);let r=this._parseLines(t.slice(1));return this._executeNodes(r).then(()=>{this.exitCode=this.sandbox.lastCode,this.source&&this.context.source(this.sandbox.context)})}_parseLines(e){let t=[],n=0;for(;n<e.length;){let r=e[n].trim();if(!r||r.startsWith(`#`)){n++;continue}if(r.startsWith(`if `)||r===`if`){let r=this._parseIf(e,n);t.push(r.node),n+=r.consumed;continue}if(r.startsWith(`while `)){let r=this._parseWhile(e,n);t.push(r.node),n+=r.consumed;continue}if(r.startsWith(`for `)){let r=this._parseFor(e,n);t.push(r.node),n+=r.consumed;continue}t.push({type:`command`,line:r}),n++}return t}_parseIf(e,t){let n=e[t].trim().replace(/^if\s+/,``).replace(/\s*;\s*then\s*$/,``).replace(/\s+then\s*$/,``).trim(),r=t+1;r<e.length&&e[r].trim()===`then`&&r++;let i=[],a=[],o=!1,s=!1,c=1;for(;r<e.length;){let t=e[r].trim();if(t.startsWith(`if `)&&c++,t===`fi`&&(c--,c===0)){s&&a.push(`fi`),r++;break}if(c===1&&(t===`else`||t.startsWith(`elif `))){o||=!0,t.startsWith(`elif `)?(s=!0,a.push(t.replace(/^elif/,`if`))):s&&a.push(e[r]),r++;continue}o?a.push(e[r]):i.push(e[r]),r++}return{node:{type:`if`,condition:n,thenLines:i,elseLines:a},consumed:r-t}}_parseWhile(e,t){let n=e[t].trim().replace(/^while\s+/,``).replace(/\s*;\s*do\s*$/,``).replace(/\s+do\s*$/,``).trim(),r=t+1;r<e.length&&e[r].trim()===`do`&&r++;let i=[],a=1;for(;r<e.length;){let t=e[r].trim();if((t.startsWith(`while `)||t.startsWith(`for `))&&a++,t===`done`&&(a--,a===0)){r++;break}i.push(e[r]),r++}return{node:{type:`while`,condition:n,bodyLines:i},consumed:r-t}}_parseFor(e,t){let n=e[t].trim().replace(/\s*;\s*do\s*$/,``).replace(/\s+do\s*$/,``).match(/^for\s+(\w+)\s+in\s+(.+)$/),r=n?n[1]:``,i=n?n[2].trim():``,a=t+1;a<e.length&&e[a].trim()===`do`&&a++;let o=[],s=1;for(;a<e.length;){let t=e[a].trim();if((t.startsWith(`while `)||t.startsWith(`for `))&&s++,t===`done`&&(s--,s===0)){a++;break}o.push(e[a]),a++}return{node:{type:`for`,variable:r,list:i,bodyLines:o},consumed:a-t}}_executeNodes(e){return e.reduce((e,t)=>e.then(()=>this._executeNode(t)),Promise.resolve())}_executeNode(e){return e.type===`command`?this.sandbox.onCommand(e.line,!1):e.type===`if`?this._executeIf(e):e.type===`while`?this._executeWhile(e):e.type===`for`?this._executeFor(e):Promise.resolve()}_executeIf(e){return this.sandbox.onCommand(e.condition,!1).then(()=>{if(this.sandbox.lastCode===0)return this._executeNodes(this._parseLines(e.thenLines));if(e.elseLines.length>0)return this._executeNodes(this._parseLines(e.elseLines))})}_executeWhile(e){let t=()=>this.sandbox.onCommand(e.condition,!1).then(()=>{if(this.sandbox.lastCode===0)return this._executeNodes(this._parseLines(e.bodyLines)).then(t)});return t()}_executeFor(e){return e.list.replace(/\${?([\w\d]+)}?/g,(e,t)=>this.sandbox.context.getVar(t)||``).split(/\s+/).filter(Boolean).reduce((t,n)=>t.then(()=>(this.sandbox.context.setVar(e.variable,n),this._executeNodes(this._parseLines(e.bodyLines)))),Promise.resolve())}}}));function F(e){var t=e.length;if(t%4>0)throw Error(`Invalid string. Length must be a multiple of 4`);var n=e.indexOf(`=`);n===-1&&(n=t);var r=n===t?0:4-n%4;return[n,r]}function I(e){var t=F(e),n=t[0],r=t[1];return(n+r)*3/4-r}function L(e,t,n){return(t+n)*3/4-n}function ee(e){var t,n=F(e),r=n[0],i=n[1],a=new te(L(e,r,i)),o=0,s=i>0?r-4:r,c;for(c=0;c<s;c+=4)t=W[e.charCodeAt(c)]<<18|W[e.charCodeAt(c+1)]<<12|W[e.charCodeAt(c+2)]<<6|W[e.charCodeAt(c+3)],a[o++]=t>>16&255,a[o++]=t>>8&255,a[o++]=t&255;return i===2&&(t=W[e.charCodeAt(c)]<<2|W[e.charCodeAt(c+1)]>>4,a[o++]=t&255),i===1&&(t=W[e.charCodeAt(c)]<<10|W[e.charCodeAt(c+1)]<<4|W[e.charCodeAt(c+2)]>>2,a[o++]=t>>8&255,a[o++]=t&255),a}function R(e){return U[e>>18&63]+U[e>>12&63]+U[e>>6&63]+U[e&63]}function z(e,t,n){for(var r,i=[],a=t;a<n;a+=3)r=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(e[a+2]&255),i.push(R(r));return i.join(``)}function B(e){for(var t,n=e.length,r=n%3,i=[],a=16383,o=0,s=n-r;o<s;o+=a)i.push(z(e,o,o+a>s?s:o+a));return r===1?(t=e[n-1],i.push(U[t>>2]+U[t<<4&63]+`==`)):r===2&&(t=(e[n-2]<<8)+e[n-1],i.push(U[t>>10]+U[t>>4&63]+U[t<<2&63]+`=`)),i.join(``)}var V,H,U,W,te,ne,G,re,ie,ae,oe=e((()=>{for(V={},H={},H.byteLength=I,H.toByteArray=ee,H.fromByteArray=B,U=[],W=[],te=typeof Uint8Array<`u`?Uint8Array:Array,ne=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,G=0,re=ne.length;G<re;++G)U[G]=ne[G],W[ne.charCodeAt(G)]=G;W[45]=62,W[95]=63,ie={},ie.read=function(e,t,n,r,i){var a,o,s=i*8-r-1,c=(1<<s)-1,l=c>>1,u=-7,d=n?i-1:0,f=n?-1:1,p=e[t+d];for(d+=f,a=p&(1<<-u)-1,p>>=-u,u+=s;u>0;a=a*256+e[t+d],d+=f,u-=8);for(o=a&(1<<-u)-1,a>>=-u,u+=r;u>0;o=o*256+e[t+d],d+=f,u-=8);if(a===0)a=1-l;else if(a===c)return o?NaN:(p?-1:1)*(1/0);else o+=2**r,a-=l;return(p?-1:1)*o*2**(a-r)},ie.write=function(e,t,n,r,i,a){var o,s,c,l=a*8-i-1,u=(1<<l)-1,d=u>>1,f=i===23?2**-24-2**-77:0,p=r?0:a-1,m=r?1:-1,h=+(t<0||t===0&&1/t<0);for(t=Math.abs(t),isNaN(t)||t===1/0?(s=+!!isNaN(t),o=u):(o=Math.floor(Math.log(t)/Math.LN2),t*(c=2**-o)<1&&(o--,c*=2),o+d>=1?t+=f/c:t+=f*2**(1-d),t*c>=2&&(o++,c/=2),o+d>=u?(s=0,o=u):o+d>=1?(s=(t*c-1)*2**i,o+=d):(s=t*2**(d-1)*2**i,o=0));i>=8;e[n+p]=s&255,p+=m,s/=256,i-=8);for(o=o<<i|s,l+=i;l>0;e[n+p]=o&255,p+=m,o/=256,l-=8);e[n+p-m]|=h*128},(function(e){let t=H,n=ie,r=typeof Symbol==`function`&&typeof Symbol.for==`function`?Symbol.for(`nodejs.util.inspect.custom`):null;e.Buffer=u,e.SlowBuffer=x,e.INSPECT_MAX_BYTES=50;let i=2147483647;e.kMaxLength=i;let{Uint8Array:a,ArrayBuffer:o,SharedArrayBuffer:s}=globalThis;u.TYPED_ARRAY_SUPPORT=c(),!u.TYPED_ARRAY_SUPPORT&&typeof console<`u`&&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 c(){try{let e=new a(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,a.prototype),Object.setPrototypeOf(e,t),e.foo()===42}catch{return!1}}Object.defineProperty(u.prototype,`parent`,{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,`offset`,{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}});function l(e){if(e>i)throw RangeError(`The value "`+e+`" is invalid for option "size"`);let t=new a(e);return Object.setPrototypeOf(t,u.prototype),t}function u(e,t,n){if(typeof e==`number`){if(typeof t==`string`)throw TypeError(`The "string" argument must be of type string. Received type number`);return m(e)}return d(e,t,n)}u.poolSize=8192;function d(e,t,n){if(typeof e==`string`)return h(e,t);if(o.isView(e))return _(e);if(e==null)throw TypeError(`The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type `+typeof e);if(J(e,o)||e&&J(e.buffer,o)||s!==void 0&&(J(e,s)||e&&J(e.buffer,s)))return v(e,t,n);if(typeof e==`number`)throw TypeError(`The "value" argument must not be of type number. Received type number`);let r=e.valueOf&&e.valueOf();if(r!=null&&r!==e)return u.from(r,t,n);let i=y(e);if(i)return i;if(typeof Symbol<`u`&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]==`function`)return u.from(e[Symbol.toPrimitive](`string`),t,n);throw TypeError(`The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type `+typeof e)}u.from=function(e,t,n){return d(e,t,n)},Object.setPrototypeOf(u.prototype,a.prototype),Object.setPrototypeOf(u,a);function f(e){if(typeof e!=`number`)throw TypeError(`"size" argument must be of type number`);if(e<0)throw RangeError(`The value "`+e+`" is invalid for option "size"`)}function p(e,t,n){return f(e),e<=0||t===void 0?l(e):typeof n==`string`?l(e).fill(t,n):l(e).fill(t)}u.alloc=function(e,t,n){return p(e,t,n)};function m(e){return f(e),l(e<0?0:b(e)|0)}u.allocUnsafe=function(e){return m(e)},u.allocUnsafeSlow=function(e){return m(e)};function h(e,t){if((typeof t!=`string`||t===``)&&(t=`utf8`),!u.isEncoding(t))throw TypeError(`Unknown encoding: `+t);let n=S(e,t)|0,r=l(n),i=r.write(e,t);return i!==n&&(r=r.slice(0,i)),r}function g(e){let t=e.length<0?0:b(e.length)|0,n=l(t);for(let r=0;r<t;r+=1)n[r]=e[r]&255;return n}function _(e){if(J(e,a)){let t=new a(e);return v(t.buffer,t.byteOffset,t.byteLength)}return g(e)}function v(e,t,n){if(t<0||e.byteLength<t)throw RangeError(`"offset" is outside of buffer bounds`);if(e.byteLength<t+(n||0))throw RangeError(`"length" is outside of buffer bounds`);let r;return r=t===void 0&&n===void 0?new a(e):n===void 0?new a(e,t):new a(e,t,n),Object.setPrototypeOf(r,u.prototype),r}function y(e){if(u.isBuffer(e)){let t=b(e.length)|0,n=l(t);return n.length===0||e.copy(n,0,0,t),n}if(e.length!==void 0)return typeof e.length!=`number`||he(e.length)?l(0):g(e);if(e.type===`Buffer`&&Array.isArray(e.data))return g(e.data)}function b(e){if(e>=i)throw RangeError(`Attempt to allocate Buffer larger than maximum size: 0x`+i.toString(16)+` bytes`);return e|0}function x(e){return+e!=e&&(e=0),u.alloc(+e)}u.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==u.prototype},u.compare=function(e,t){if(J(e,a)&&(e=u.from(e,e.offset,e.byteLength)),J(t,a)&&(t=u.from(t,t.offset,t.byteLength)),!u.isBuffer(e)||!u.isBuffer(t))throw TypeError(`The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array`);if(e===t)return 0;let n=e.length,r=t.length;for(let i=0,a=Math.min(n,r);i<a;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:+(r<n)},u.isEncoding=function(e){switch(String(e).toLowerCase()){case`hex`:case`utf8`:case`utf-8`:case`ascii`:case`latin1`:case`binary`:case`base64`:case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return!0;default:return!1}},u.concat=function(e,t){if(!Array.isArray(e))throw TypeError(`"list" argument must be an Array of Buffers`);if(e.length===0)return u.alloc(0);let n;if(t===void 0)for(t=0,n=0;n<e.length;++n)t+=e[n].length;let r=u.allocUnsafe(t),i=0;for(n=0;n<e.length;++n){let t=e[n];if(J(t,a))i+t.length>r.length?(u.isBuffer(t)||(t=u.from(t)),t.copy(r,i)):a.prototype.set.call(r,t,i);else if(u.isBuffer(t))t.copy(r,i);else throw TypeError(`"list" argument must be an Array of Buffers`);i+=t.length}return r};function S(e,t){if(u.isBuffer(e))return e.length;if(o.isView(e)||J(e,o))return e.byteLength;if(typeof e!=`string`)throw TypeError(`The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type `+typeof e);let n=e.length,r=arguments.length>2&&arguments[2]===!0;if(!r&&n===0)return 0;let i=!1;for(;;)switch(t){case`ascii`:case`latin1`:case`binary`:return n;case`utf8`:case`utf-8`:return ue(e).length;case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return n*2;case`hex`:return n>>>1;case`base64`:return pe(e).length;default:if(i)return r?-1:ue(e).length;t=(``+t).toLowerCase(),i=!0}}u.byteLength=S;function C(e,t,n){let r=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((n===void 0||n>this.length)&&(n=this.length),n<=0)||(n>>>=0,t>>>=0,n<=t))return``;for(e||=`utf8`;;)switch(e){case`hex`:return ee(this,t,n);case`utf8`:case`utf-8`:return N(this,t,n);case`ascii`:return I(this,t,n);case`latin1`:case`binary`:return L(this,t,n);case`base64`:return M(this,t,n);case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return R(this,t,n);default:if(r)throw TypeError(`Unknown encoding: `+e);e=(e+``).toLowerCase(),r=!0}}u.prototype._isBuffer=!0;function w(e,t,n){let r=e[t];e[t]=e[n],e[n]=r}u.prototype.swap16=function(){let e=this.length;if(e%2!=0)throw RangeError(`Buffer size must be a multiple of 16-bits`);for(let t=0;t<e;t+=2)w(this,t,t+1);return this},u.prototype.swap32=function(){let e=this.length;if(e%4!=0)throw RangeError(`Buffer size must be a multiple of 32-bits`);for(let t=0;t<e;t+=4)w(this,t,t+3),w(this,t+1,t+2);return this},u.prototype.swap64=function(){let e=this.length;if(e%8!=0)throw RangeError(`Buffer size must be a multiple of 64-bits`);for(let t=0;t<e;t+=8)w(this,t,t+7),w(this,t+1,t+6),w(this,t+2,t+5),w(this,t+3,t+4);return this},u.prototype.toString=function(){let e=this.length;return e===0?``:arguments.length===0?N(this,0,e):C.apply(this,arguments)},u.prototype.toLocaleString=u.prototype.toString,u.prototype.equals=function(e){if(!u.isBuffer(e))throw TypeError(`Argument must be a Buffer`);return this===e?!0:u.compare(this,e)===0},u.prototype.inspect=function(){let t=``,n=e.INSPECT_MAX_BYTES;return t=this.toString(`hex`,0,n).replace(/(.{2})/g,`$1 `).trim(),this.length>n&&(t+=` ... `),`<Buffer `+t+`>`},r&&(u.prototype[r]=u.prototype.inspect),u.prototype.compare=function(e,t,n,r,i){if(J(e,a)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(e))throw TypeError(`The "target" argument must be one of type Buffer or Uint8Array. Received type `+typeof e);if(t===void 0&&(t=0),n===void 0&&(n=e?e.length:0),r===void 0&&(r=0),i===void 0&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw RangeError(`out of range index`);if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,r>>>=0,i>>>=0,this===e)return 0;let o=i-r,s=n-t,c=Math.min(o,s),l=this.slice(r,i),d=e.slice(t,n);for(let e=0;e<c;++e)if(l[e]!==d[e]){o=l[e],s=d[e];break}return o<s?-1:+(s<o)};function T(e,t,n,r,i){if(e.length===0)return-1;if(typeof n==`string`?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,he(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0)if(i)n=0;else return-1;if(typeof t==`string`&&(t=u.from(t,r)),u.isBuffer(t))return t.length===0?-1:E(e,t,n,r,i);if(typeof t==`number`)return t&=255,typeof a.prototype.indexOf==`function`?i?a.prototype.indexOf.call(e,t,n):a.prototype.lastIndexOf.call(e,t,n):E(e,[t],n,r,i);throw TypeError(`val must be string, number or Buffer`)}function E(e,t,n,r,i){let a=1,o=e.length,s=t.length;if(r!==void 0&&(r=String(r).toLowerCase(),r===`ucs2`||r===`ucs-2`||r===`utf16le`||r===`utf-16le`)){if(e.length<2||t.length<2)return-1;a=2,o/=2,s/=2,n/=2}function c(e,t){return a===1?e[t]:e.readUInt16BE(t*a)}let l;if(i){let r=-1;for(l=n;l<o;l++)if(c(e,l)===c(t,r===-1?0:l-r)){if(r===-1&&(r=l),l-r+1===s)return r*a}else r!==-1&&(l-=l-r),r=-1}else for(n+s>o&&(n=o-s),l=n;l>=0;l--){let n=!0;for(let r=0;r<s;r++)if(c(e,l+r)!==c(t,r)){n=!1;break}if(n)return l}return-1}u.prototype.includes=function(e,t,n){return this.indexOf(e,t,n)!==-1},u.prototype.indexOf=function(e,t,n){return T(this,e,t,n,!0)},u.prototype.lastIndexOf=function(e,t,n){return T(this,e,t,n,!1)};function D(e,t,n,r){n=Number(n)||0;let i=e.length-n;r?(r=Number(r),r>i&&(r=i)):r=i;let a=t.length;r>a/2&&(r=a/2);let o;for(o=0;o<r;++o){let r=parseInt(t.substr(o*2,2),16);if(he(r))return o;e[n+o]=r}return o}function O(e,t,n,r){return me(ue(t,e.length-n),e,n,r)}function k(e,t,n,r){return me(de(t),e,n,r)}function A(e,t,n,r){return me(pe(t),e,n,r)}function j(e,t,n,r){return me(fe(t,e.length-n),e,n,r)}u.prototype.write=function(e,t,n,r){if(t===void 0)r=`utf8`,n=this.length,t=0;else if(n===void 0&&typeof t==`string`)r=t,n=this.length,t=0;else if(isFinite(t))t>>>=0,isFinite(n)?(n>>>=0,r===void 0&&(r=`utf8`)):(r=n,n=void 0);else throw Error(`Buffer.write(string, encoding, offset[, length]) is no longer supported`);let i=this.length-t;if((n===void 0||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw RangeError(`Attempt to write outside buffer bounds`);r||=`utf8`;let a=!1;for(;;)switch(r){case`hex`:return D(this,e,t,n);case`utf8`:case`utf-8`:return O(this,e,t,n);case`ascii`:case`latin1`:case`binary`:return k(this,e,t,n);case`base64`:return A(this,e,t,n);case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return j(this,e,t,n);default:if(a)throw TypeError(`Unknown encoding: `+r);r=(``+r).toLowerCase(),a=!0}},u.prototype.toJSON=function(){return{type:`Buffer`,data:Array.prototype.slice.call(this._arr||this,0)}};function M(e,n,r){return n===0&&r===e.length?t.fromByteArray(e):t.fromByteArray(e.slice(n,r))}function N(e,t,n){n=Math.min(e.length,n);let r=[],i=t;for(;i<n;){let t=e[i],a=null,o=t>239?4:t>223?3:t>191?2:1;if(i+o<=n){let n,r,s,c;switch(o){case 1:t<128&&(a=t);break;case 2:n=e[i+1],(n&192)==128&&(c=(t&31)<<6|n&63,c>127&&(a=c));break;case 3:n=e[i+1],r=e[i+2],(n&192)==128&&(r&192)==128&&(c=(t&15)<<12|(n&63)<<6|r&63,c>2047&&(c<55296||c>57343)&&(a=c));break;case 4:n=e[i+1],r=e[i+2],s=e[i+3],(n&192)==128&&(r&192)==128&&(s&192)==128&&(c=(t&15)<<18|(n&63)<<12|(r&63)<<6|s&63,c>65535&&c<1114112&&(a=c))}}a===null?(a=65533,o=1):a>65535&&(a-=65536,r.push(a>>>10&1023|55296),a=56320|a&1023),r.push(a),i+=o}return F(r)}let P=4096;function F(e){let t=e.length;if(t<=P)return String.fromCharCode.apply(String,e);let n=``,r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=P));return n}function I(e,t,n){let r=``;n=Math.min(e.length,n);for(let i=t;i<n;++i)r+=String.fromCharCode(e[i]&127);return r}function L(e,t,n){let r=``;n=Math.min(e.length,n);for(let i=t;i<n;++i)r+=String.fromCharCode(e[i]);return r}function ee(e,t,n){let r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);let i=``;for(let r=t;r<n;++r)i+=ge[e[r]];return i}function R(e,t,n){let r=e.slice(t,n),i=``;for(let e=0;e<r.length-1;e+=2)i+=String.fromCharCode(r[e]+r[e+1]*256);return i}u.prototype.slice=function(e,t){let n=this.length;e=~~e,t=t===void 0?n:~~t,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),t<e&&(t=e);let r=this.subarray(e,t);return Object.setPrototypeOf(r,u.prototype),r};function z(e,t,n){if(e%1!=0||e<0)throw RangeError(`offset is not uint`);if(e+t>n)throw RangeError(`Trying to access beyond buffer length`)}u.prototype.readUintLE=u.prototype.readUIntLE=function(e,t,n){e>>>=0,t>>>=0,n||z(e,t,this.length);let r=this[e],i=1,a=0;for(;++a<t&&(i*=256);)r+=this[e+a]*i;return r},u.prototype.readUintBE=u.prototype.readUIntBE=function(e,t,n){e>>>=0,t>>>=0,n||z(e,t,this.length);let r=this[e+--t],i=1;for(;t>0&&(i*=256);)r+=this[e+--t]*i;return r},u.prototype.readUint8=u.prototype.readUInt8=function(e,t){return e>>>=0,t||z(e,1,this.length),this[e]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(e,t){return e>>>=0,t||z(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(e,t){return e>>>=0,t||z(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(e,t){return e>>>=0,t||z(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(e,t){return e>>>=0,t||z(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readBigUInt64LE=Y(function(e){e>>>=0,K(e,`offset`);let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&q(e,this.length-8);let r=t+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,i=this[++e]+this[++e]*2**8+this[++e]*2**16+n*2**24;return BigInt(r)+(BigInt(i)<<BigInt(32))}),u.prototype.readBigUInt64BE=Y(function(e){e>>>=0,K(e,`offset`);let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&q(e,this.length-8);let r=t*2**24+this[++e]*2**16+this[++e]*2**8+this[++e],i=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n;return(BigInt(r)<<BigInt(32))+BigInt(i)}),u.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||z(e,t,this.length);let r=this[e],i=1,a=0;for(;++a<t&&(i*=256);)r+=this[e+a]*i;return i*=128,r>=i&&(r-=2**(8*t)),r},u.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||z(e,t,this.length);let r=t,i=1,a=this[e+--r];for(;r>0&&(i*=256);)a+=this[e+--r]*i;return i*=128,a>=i&&(a-=2**(8*t)),a},u.prototype.readInt8=function(e,t){return e>>>=0,t||z(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]},u.prototype.readInt16LE=function(e,t){e>>>=0,t||z(e,2,this.length);let n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n},u.prototype.readInt16BE=function(e,t){e>>>=0,t||z(e,2,this.length);let n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n},u.prototype.readInt32LE=function(e,t){return e>>>=0,t||z(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return e>>>=0,t||z(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readBigInt64LE=Y(function(e){e>>>=0,K(e,`offset`);let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&q(e,this.length-8);let r=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(n<<24);return(BigInt(r)<<BigInt(32))+BigInt(t+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24)}),u.prototype.readBigInt64BE=Y(function(e){e>>>=0,K(e,`offset`);let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&q(e,this.length-8);let r=(t<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(r)<<BigInt(32))+BigInt(this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n)}),u.prototype.readFloatLE=function(e,t){return e>>>=0,t||z(e,4,this.length),n.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return e>>>=0,t||z(e,4,this.length),n.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return e>>>=0,t||z(e,8,this.length),n.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return e>>>=0,t||z(e,8,this.length),n.read(this,e,!1,52,8)};function B(e,t,n,r,i,a){if(!u.isBuffer(e))throw TypeError(`"buffer" argument must be a Buffer instance`);if(t>i||t<a)throw RangeError(`"value" argument is out of bounds`);if(n+r>e.length)throw RangeError(`Index out of range`)}u.prototype.writeUintLE=u.prototype.writeUIntLE=function(e,t,n,r){if(e=+e,t>>>=0,n>>>=0,!r){let r=2**(8*n)-1;B(this,e,t,n,r,0)}let i=1,a=0;for(this[t]=e&255;++a<n&&(i*=256);)this[t+a]=e/i&255;return t+n},u.prototype.writeUintBE=u.prototype.writeUIntBE=function(e,t,n,r){if(e=+e,t>>>=0,n>>>=0,!r){let r=2**(8*n)-1;B(this,e,t,n,r,0)}let i=n-1,a=1;for(this[t+i]=e&255;--i>=0&&(a*=256);)this[t+i]=e/a&255;return t+n},u.prototype.writeUint8=u.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||B(this,e,t,1,255,0),this[t]=e&255,t+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||B(this,e,t,2,65535,0),this[t]=e&255,this[t+1]=e>>>8,t+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||B(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=e&255,t+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||B(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e&255,t+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||B(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4};function V(e,t,n,r,i){se(t,r,i,e,n,7);let a=Number(t&BigInt(4294967295));e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a;let o=Number(t>>BigInt(32)&BigInt(4294967295));return e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o,n}function U(e,t,n,r,i){se(t,r,i,e,n,7);let a=Number(t&BigInt(4294967295));e[n+7]=a,a>>=8,e[n+6]=a,a>>=8,e[n+5]=a,a>>=8,e[n+4]=a;let o=Number(t>>BigInt(32)&BigInt(4294967295));return e[n+3]=o,o>>=8,e[n+2]=o,o>>=8,e[n+1]=o,o>>=8,e[n]=o,n+8}u.prototype.writeBigUInt64LE=Y(function(e,t=0){return V(this,e,t,BigInt(0),BigInt(`0xffffffffffffffff`))}),u.prototype.writeBigUInt64BE=Y(function(e,t=0){return U(this,e,t,BigInt(0),BigInt(`0xffffffffffffffff`))}),u.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){let r=2**(8*n-1);B(this,e,t,n,r-1,-r)}let i=0,a=1,o=0;for(this[t]=e&255;++i<n&&(a*=256);)e<0&&o===0&&this[t+i-1]!==0&&(o=1),this[t+i]=(e/a>>0)-o&255;return t+n},u.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){let r=2**(8*n-1);B(this,e,t,n,r-1,-r)}let i=n-1,a=1,o=0;for(this[t+i]=e&255;--i>=0&&(a*=256);)e<0&&o===0&&this[t+i+1]!==0&&(o=1),this[t+i]=(e/a>>0)-o&255;return t+n},u.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||B(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=e&255,t+1},u.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||B(this,e,t,2,32767,-32768),this[t]=e&255,this[t+1]=e>>>8,t+2},u.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||B(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=e&255,t+2},u.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||B(this,e,t,4,2147483647,-2147483648),this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},u.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||B(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4},u.prototype.writeBigInt64LE=Y(function(e,t=0){return V(this,e,t,-BigInt(`0x8000000000000000`),BigInt(`0x7fffffffffffffff`))}),u.prototype.writeBigInt64BE=Y(function(e,t=0){return U(this,e,t,-BigInt(`0x8000000000000000`),BigInt(`0x7fffffffffffffff`))});function W(e,t,n,r,i,a){if(n+r>e.length||n<0)throw RangeError(`Index out of range`)}function te(e,t,r,i,a){return t=+t,r>>>=0,a||W(e,t,r,4),n.write(e,t,r,i,23,4),r+4}u.prototype.writeFloatLE=function(e,t,n){return te(this,e,t,!0,n)},u.prototype.writeFloatBE=function(e,t,n){return te(this,e,t,!1,n)};function ne(e,t,r,i,a){return t=+t,r>>>=0,a||W(e,t,r,8),n.write(e,t,r,i,52,8),r+8}u.prototype.writeDoubleLE=function(e,t,n){return ne(this,e,t,!0,n)},u.prototype.writeDoubleBE=function(e,t,n){return ne(this,e,t,!1,n)},u.prototype.copy=function(e,t,n,r){if(!u.isBuffer(e))throw TypeError(`argument should be a Buffer`);if(n||=0,!r&&r!==0&&(r=this.length),t>=e.length&&(t=e.length),t||=0,r>0&&r<n&&(r=n),r===n||e.length===0||this.length===0)return 0;if(t<0)throw RangeError(`targetStart out of bounds`);if(n<0||n>=this.length)throw RangeError(`Index out of range`);if(r<0)throw RangeError(`sourceEnd out of bounds`);r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);let i=r-n;return this===e&&typeof a.prototype.copyWithin==`function`?this.copyWithin(t,n,r):a.prototype.set.call(e,this.subarray(n,r),t),i},u.prototype.fill=function(e,t,n,r){if(typeof e==`string`){if(typeof t==`string`?(r=t,t=0,n=this.length):typeof n==`string`&&(r=n,n=this.length),r!==void 0&&typeof r!=`string`)throw TypeError(`encoding must be a string`);if(typeof r==`string`&&!u.isEncoding(r))throw TypeError(`Unknown encoding: `+r);if(e.length===1){let t=e.charCodeAt(0);(r===`utf8`&&t<128||r===`latin1`)&&(e=t)}}else typeof e==`number`?e&=255:typeof e==`boolean`&&(e=Number(e));if(t<0||this.length<t||this.length<n)throw RangeError(`Out of range index`);if(n<=t)return this;t>>>=0,n=n===void 0?this.length:n>>>0,e||=0;let i;if(typeof e==`number`)for(i=t;i<n;++i)this[i]=e;else{let a=u.isBuffer(e)?e:u.from(e,r),o=a.length;if(o===0)throw TypeError(`The value "`+e+`" is invalid for argument "value"`);for(i=0;i<n-t;++i)this[i+t]=a[i%o]}return this};let G={};function re(e,t,n){G[e]=class extends n{constructor(){super(),Object.defineProperty(this,`message`,{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,`code`,{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}re(`ERR_BUFFER_OUT_OF_BOUNDS`,function(e){return e?`${e} is outside of buffer bounds`:`Attempt to access memory outside buffer bounds`},RangeError),re(`ERR_INVALID_ARG_TYPE`,function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),re(`ERR_OUT_OF_RANGE`,function(e,t,n){let r=`The value of "${e}" is out of range.`,i=n;return Number.isInteger(n)&&Math.abs(n)>2**32?i=ae(String(n)):typeof n==`bigint`&&(i=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(i=ae(i)),i+=`n`),r+=` It must be ${t}. Received ${i}`,r},RangeError);function ae(e){let t=``,n=e.length,r=+(e[0]===`-`);for(;n>=r+4;n-=3)t=`_${e.slice(n-3,n)}${t}`;return`${e.slice(0,n)}${t}`}function oe(e,t,n){K(t,`offset`),(e[t]===void 0||e[t+n]===void 0)&&q(t,e.length-(n+1))}function se(e,t,n,r,i,a){if(e>n||e<t){let r=typeof t==`bigint`?`n`:``,i;throw i=a>3?t===0||t===BigInt(0)?`>= 0${r} and < 2${r} ** ${(a+1)*8}${r}`:`>= -(2${r} ** ${(a+1)*8-1}${r}) and < 2 ** ${(a+1)*8-1}${r}`:`>= ${t}${r} and <= ${n}${r}`,new G.ERR_OUT_OF_RANGE(`value`,i,e)}oe(r,i,a)}function K(e,t){if(typeof e!=`number`)throw new G.ERR_INVALID_ARG_TYPE(t,`number`,e)}function q(e,t,n){throw Math.floor(e)===e?t<0?new G.ERR_BUFFER_OUT_OF_BOUNDS:new G.ERR_OUT_OF_RANGE(n||`offset`,`>= ${+!!n} and <= ${t}`,e):(K(e,n),new G.ERR_OUT_OF_RANGE(n||`offset`,`an integer`,e))}let ce=/[^+/0-9A-Za-z-_]/g;function le(e){if(e=e.split(`=`)[0],e=e.trim().replace(ce,``),e.length<2)return``;for(;e.length%4!=0;)e+=`=`;return e}function ue(e,t){t||=1/0;let n,r=e.length,i=null,a=[];for(let o=0;o<r;++o){if(n=e.charCodeAt(o),n>55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&a.push(239,191,189);continue}else if(o+1===r){(t-=3)>-1&&a.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&a.push(239,191,189),i=n;continue}n=(i-55296<<10|n-56320)+65536}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,n<128){if(--t<0)break;a.push(n)}else if(n<2048){if((t-=2)<0)break;a.push(n>>6|192,n&63|128)}else if(n<65536){if((t-=3)<0)break;a.push(n>>12|224,n>>6&63|128,n&63|128)}else if(n<1114112){if((t-=4)<0)break;a.push(n>>18|240,n>>12&63|128,n>>6&63|128,n&63|128)}else throw Error(`Invalid code point`)}return a}function de(e){let t=[];for(let n=0;n<e.length;++n)t.push(e.charCodeAt(n)&255);return t}function fe(e,t){let n,r,i,a=[];for(let o=0;o<e.length&&!((t-=2)<0);++o)n=e.charCodeAt(o),r=n>>8,i=n%256,a.push(i),a.push(r);return a}function pe(e){return t.toByteArray(le(e))}function me(e,t,n,r){let i;for(i=0;i<r&&!(i+n>=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function J(e,t){return e instanceof t||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===t.name}function he(e){return e!==e}let ge=(function(){let e=`0123456789abcdef`,t=Array(256);for(let n=0;n<16;++n){let r=n*16;for(let i=0;i<16;++i)t[r+i]=e[n]+e[i]}return t})();function Y(e){return typeof BigInt>`u`?_e:e}function _e(){throw Error(`BigInt not supported`)}})(V),ae=V.Buffer,V.Blob,V.BlobOptions,V.Buffer,V.File,V.FileOptions,V.INSPECT_MAX_BYTES,V.SlowBuffer,V.TranscodeEncoding,V.atob,V.btoa,V.constants,V.isAscii,V.isUtf8,V.kMaxLength,V.kStringMaxLength,V.resolveObjectURL,V.transcode})),se=t(((e,t)=>{oe();var n=P();t.exports=class extends n{get name(){return`wasm`}get requiresFilesystem(){return!0}run(){let e=this.script,t=(()=>{try{return E()}catch{return null}})();return this._loadBytes(e,t).then(({bytes:e,isWat:t})=>t?this._runWat(e):this._runWasm(e)).catch(e=>{this.stdErr=e.message||String(e),this.exitCode=1})}_loadBytes(e,t){if(this.context.fs.isRealFilesystem&&t)try{let n=t.readFileSync(this.context.fs.absolutePath(e)),r=new Uint8Array(n);return Promise.resolve({bytes:r,isWat:this._isWat(e,r)})}catch(t){return Promise.reject(Error(`${e}: ${t.message}`))}let n=this.context.fs.getFileByPath(e);if(n==null)return Promise.reject(Error(`${e}: No such file or directory`));let r=this._contentToBytes(n);return Promise.resolve({bytes:r,isWat:this._isWat(e,r)})}_isWat(e,t){return e.endsWith(`.wat`)?!0:t.length>0&&t[0]===40}_contentToBytes(e){if(e instanceof Uint8Array)return e;if(ae!==void 0&&ae.isBuffer(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);if(e instanceof ArrayBuffer)return new Uint8Array(e);let t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n)&255;return t}async _runWat(e){let t=new TextDecoder().decode(e),n;try{let e=require(`wabt`),{buffer:r}=(typeof e==`function`?await e():e).parseWat(this.script,t,{mutable_globals:!0}).toBinary({});n=new Uint8Array(r)}catch(e){e.code===`MODULE_NOT_FOUND`?(this.stdErr=`${this.script}: WAT execution requires the 'wabt' package`,this.stdErr=`Install it with: npm install wabt`):this.stdErr=`${this.script}: WAT compilation error: ${e.message}`,this.exitCode=1;return}return this._runWasm(n)}async _runWasm(e){if(typeof WebAssembly>`u`){this.stdErr=`${this.script}: WebAssembly is not available in this environment`,this.exitCode=1;return}let t={1:``,2:``},n=new TextDecoder,r=null,i=(e,n)=>{t[e]=(t[e]||``)+n;let r=t[e].split(`
|
|
2
|
-
`);t[e]=r.pop();for(let t of r)e===1?this.stdOut=t:this.stdErr=t},a=()=>{t[1]&&=(this.stdOut=t[1],``),t[2]&&=(this.stdErr=t[2],``)},o=new TextEncoder().encode(this.stdin||``),s=0,c=new Proxy({fd_write:(e,t,a,o)=>{if(!r)return 8;let s=new DataView(r.buffer),c=0;for(let o=0;o<a;o++){let a=s.getUint32(t+o*8,!0),l=s.getUint32(t+o*8+4,!0);l>0&&i(e,n.decode(new Uint8Array(r.buffer,a,l))),c+=l}return s.setUint32(o,c,!0),0},fd_read:(e,t,n,i)=>{if(e!==0||!r)return 8;let a=new DataView(r.buffer),c=0;for(let e=0;e<n&&s<o.length;e++){let n=a.getUint32(t+e*8,!0),i=a.getUint32(t+e*8+4,!0),l=Math.min(i,o.length-s);new Uint8Array(r.buffer).set(o.slice(s,s+l),n),s+=l,c+=l}return a.setUint32(i,c,!0),0},proc_exit:e=>{throw e!==0&&(this.exitCode=e),{_wasmExit:!0,code:e}},args_sizes_get:(e,t)=>{if(!r)return 28;let n=[this.script,...this.arguments||[]],i=new DataView(r.buffer);return i.setUint32(e,n.length,!0),i.setUint32(t,n.reduce((e,t)=>e+t.length+1,0),!0),0},args_get:(e,t)=>{if(!r)return 28;let n=[this.script,...this.arguments||[]],i=new DataView(r.buffer),a=new TextEncoder,o=t;for(let t=0;t<n.length;t++){i.setUint32(e+t*4,o,!0);let s=a.encode(n[t]+`\0`);new Uint8Array(r.buffer).set(s,o),o+=s.length}return 0},environ_sizes_get:(e,t)=>{if(r){let n=new DataView(r.buffer);n.setUint32(e,0,!0),n.setUint32(t,0,!0)}return 0},environ_get:()=>0,clock_time_get:(e,t,n)=>{if(r){let e=BigInt(Date.now())*1000000n;new DataView(r.buffer).setBigUint64(n,e,!0)}return 0},fd_close:()=>0,fd_seek:()=>70,fd_prestat_get:()=>8,fd_prestat_dir_name:()=>8,path_open:()=>76,random_get:(e,t)=>{if(r){let n=new Uint8Array(r.buffer,e,t);for(let e=0;e<t;e++)n[e]=Math.random()*256|0}return 0}},{get(e,t){return t in e?e[t]:()=>0}}),l={wasi_snapshot_preview1:c,wasi_unstable:c,env:new Proxy({print:(e,t)=>{r&&i(1,n.decode(new Uint8Array(r.buffer,e,t)))},eprint:(e,t)=>{r&&i(2,n.decode(new Uint8Array(r.buffer,e,t)))},abort:()=>{throw this.exitCode=134,{_wasmExit:!0,code:134}}},{get(e,t){return t in e?e[t]:()=>0}})};try{let t=await WebAssembly.compile(e);for(let e of WebAssembly.Module.imports(t))if(e.kind===`memory`){let t=new WebAssembly.Memory({initial:1,maximum:256});r=t,l[e.module]||(l[e.module]={}),l[e.module][e.name]=t}let n=await WebAssembly.instantiate(t,l);n.exports.memory&&(r=n.exports.memory);let i=n.exports._start||n.exports.__wasi_command||n.exports.main||n.exports.run;if(!i)this.stdErr=`${this.script}: no entry point found (export _start, main, or run)`,this.exitCode=1;else try{await i()}catch(e){(!e||!e._wasmExit)&&(this.stdErr=`${this.script}: runtime error: ${e?.message||String(e)}`,this.exitCode=1)}}catch(e){(!e||!e._wasmExit)&&(this.stdErr=`${this.script}: ${e?.message||String(e)}`,this.exitCode=1)}a()}}})),K=t(((e,t)=>{var n=M(),r=class extends n{get name(){return`test`}get requiresFilesystem(){return!0}run(){let e=[...this.arguments];return e[e.length-1]===`]`&&e.pop(),this._evaluate(e)||(this.exitCode=1),Promise.resolve()}_evaluate(e){if(e.length===0)return!1;let t=e.indexOf(`-o`);if(t!==-1)return this._evaluate(e.slice(0,t))||this._evaluate(e.slice(t+1));let n=e.indexOf(`-a`);if(n!==-1)return this._evaluate(e.slice(0,n))&&this._evaluate(e.slice(n+1));if(e[0]===`!`)return!this._evaluate(e.slice(1));if(e.length===1)return e[0].length>0;if(e.length===2){let[t,n]=e;switch(t){case`-n`:return n.length>0;case`-z`:return n.length===0;case`-e`:return this.fs?this.fs.getFileByPath(n)!=null:!1;case`-f`:{if(!this.fs)return!1;let e=this.fs.getFileByPath(n);return e!=null&&e.constructor!==Object}case`-d`:{if(!this.fs)return!1;let e=this.fs.getFileByPath(n);return e!=null&&e.constructor===Object}case`-r`:{if(!this.fs)return!1;let e=this.fs.getMode(n);return e!==null&&(e&292)!=0}case`-w`:{if(!this.fs)return!1;let e=this.fs.getMode(n);return e!==null&&(e&146)!=0}case`-x`:{if(!this.fs)return!1;let e=this.fs.getMode(n);return e!==null&&(e&73)!=0}case`-s`:{if(!this.fs)return!1;let e=this.fs.getFileByPath(n);return e==null||e.constructor===Object?!1:e.toString().length>0}default:return!1}}if(e.length===3){let[t,n,r]=e;switch(n){case`=`:case`==`:return t===r;case`!=`:return t!==r;case`-eq`:return parseInt(t)===parseInt(r);case`-ne`:return parseInt(t)!==parseInt(r);case`-lt`:return parseInt(t)<parseInt(r);case`-le`:return parseInt(t)<=parseInt(r);case`-gt`:return parseInt(t)>parseInt(r);case`-ge`:return parseInt(t)>=parseInt(r);default:return!1}}return!1}},i=class extends r{get name(){return`[`}};Object.defineProperty(i
|
|
1
|
+
"use strict";var Shell=(function(){var e=(e,t)=>()=>(e&&(t=e(e=0)),t),t=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),n,r=e((()=>{n=globalThis||self})),i=t(((e,t)=>{t.exports=class{constructor(e=`/`,t={},n={},r=null){this.fileSystem=t,this.permissions=Object.assign({},n),this.cwd=e,this._onChange=r,this._changeScheduled=!1}getFileByPath(e){return this._getFileByAbsolutePath(this._pathToAbsolute(e))}_pathToAbsolute(e){return e.startsWith(`./`)&&(e=e.substring(2)),e.startsWith(`/`)||(e=this.cwd+e),this._traverseComplexAbsolutePath(e)}_traverseComplexAbsolutePath(e){let t=e.split(`/`);for(;t.includes(`..`);){let e=t.indexOf(`..`)-1;t.splice(e,2)}return t.join(`/`)}absolutePath(e){return this._pathToAbsolute(e)}setFileByPath(e,t,n=!1){let r=this._pathToAbsolute(e);this._setFileByAbsolutePath(r,t,n),this._triggerChange()}_setFileByAbsolutePath(e,t,n=!0){let r=e.split(`/`);r.shift();let i=r.pop(),a=r.reduce((e,t)=>{if(!e[t]){if(!n)throw Error(`${t}: No such file or directory`);e[t]={}}return e[t]},this.fileSystem);a[i]=t}_getFileByAbsolutePath(e){let t=e.split(`/`);return t.shift(),t[t.length-1].length<1&&t.pop(),t.reduce((e,t)=>e&&e[t]?e[t]:null,this.fileSystem)}deleteFileByPath(e){let t=this._pathToAbsolute(e);this._deleteByAbsolutePath(t);let n=t+`/`;Object.keys(this.permissions).forEach(e=>{(e===t||e.startsWith(n))&&delete this.permissions[e]}),this._triggerChange()}_deleteByAbsolutePath(e){let t=e.split(`/`);t.shift(),t[t.length-1]===``&&t.pop();let n=t.pop();if(!n)return;let r=t.reduce((e,t)=>e&&e[t]?e[t]:null,this.fileSystem);r&&n in r&&delete r[n]}getMode(e){let t=this._pathToAbsolute(e);if(this.permissions[t]!==void 0)return this.permissions[t];let n=this._getFileByAbsolutePath(t);return n==null?null:n.constructor===Object||typeof n==`function`?493:420}setMode(e,t){let n=this._pathToAbsolute(e);this.permissions[n]=t,this._triggerChange()}isExecutable(e){let t=this.getMode(e);return t===null?!1:(t&64)!=0}getSize(e){let t=this._pathToAbsolute(e),n=this._getFileByAbsolutePath(t);return n==null?0:n.constructor===Object?JSON.stringify(n).length:n.toString().length}getRawPermissions(){return Object.assign({},this.permissions)}setCwd(e){this.cwd=this._pathToAbsolute(e.endsWith(`/`)?e:e+`/`)}getRaw(){return this.fileSystem}getRawPermissions(){return Object.assign({},this.permissions)}addFiles(e){Object.entries(e).forEach(([e,t])=>{this.setFileByPath(e,t,!0)})}autoComplete(e,t){let n=this._pathToAbsolute(e).split(`/`),r=n.pop(),i=this.getFileByPath(n.length>1?n.join(`/`):`/`),a=this.getFileByPath(t);if(i&&i.constructor===Object){let t=Object.keys(i).filter(e=>e.startsWith(r));r.length<1&&(t=t.filter(e=>!e.startsWith(`.`)));let n=e.split(`/`);n.pop();let o=i;if(t.length<1&&n.length<1&&a&&(t=Object.keys(a).filter(e=>e.startsWith(r)),o=a),t.length)return{path:n.length?n.join(`/`):null,options:t.map(e=>o[e]&&o[e].constructor===Object?e.concat(`/`):e)}}return null}_triggerChange(){!this._onChange||this._changeScheduled||(this._changeScheduled=!0,Promise.resolve().then(()=>{this._changeScheduled=!1,typeof this._onChange==`function`&&this._onChange(this.getRaw(),this.getRawPermissions())}))}}}));function a(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}function o(){throw Error(`setTimeout has not been defined`)}function s(){throw Error(`clearTimeout has not been defined`)}function c(e){if(g===setTimeout)return setTimeout(e,0);if((g===o||!g)&&setTimeout)return g=setTimeout,setTimeout(e,0);try{return g(e,0)}catch{try{return g.call(null,e,0)}catch{return g.call(this,e,0)}}}function l(e){if(_===clearTimeout)return clearTimeout(e);if((_===s||!_)&&clearTimeout)return _=clearTimeout,clearTimeout(e);try{return _(e)}catch{try{return _.call(null,e)}catch{return _.call(this,e)}}}function u(){!y||!b||(y=!1,b.length?v=b.concat(v):x=-1,v.length&&d())}function d(){if(!y){var e=c(u);y=!0;for(var t=v.length;t;){for(b=v,v=[];++x<t;)b&&b[x].run();x=-1,t=v.length}b=null,y=!1,l(e)}}function f(e,t){this.fun=e,this.array=t}function p(){}var m,h,g,_,v,y,b,x,S,C,w=e((()=>{m={exports:{}},h=m.exports={},(function(){try{g=typeof setTimeout==`function`?setTimeout:o}catch{g=o}try{_=typeof clearTimeout==`function`?clearTimeout:s}catch{_=s}})(),v=[],y=!1,x=-1,h.nextTick=function(e){var t=Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];v.push(new f(e,t)),v.length===1&&!y&&c(d)},f.prototype.run=function(){this.fun.apply(null,this.array)},h.title=`browser`,h.browser=!0,h.env={},h.argv=[],h.version=``,h.versions={},h.on=p,h.addListener=p,h.once=p,h.off=p,h.removeListener=p,h.removeAllListeners=p,h.emit=p,h.prependListener=p,h.prependOnceListener=p,h.listeners=function(e){return[]},h.binding=function(e){throw Error(`process.binding is not supported`)},h.cwd=function(){return`/`},h.chdir=function(e){throw Error(`process.chdir is not supported`)},h.umask=function(){return 0},S=m.exports,C=a(S)})),T=t(((e,t)=>{t.exports=null})),E=t(((e,t)=>{w();function n(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}function r(e,t){for(var n=``,r=0,i=-1,a=0,o,s=0;s<=e.length;++s){if(s<e.length)o=e.charCodeAt(s);else if(o===47)break;else o=47;if(o===47){if(!(i===s-1||a===1))if(i!==s-1&&a===2){if(n.length<2||r!==2||n.charCodeAt(n.length-1)!==46||n.charCodeAt(n.length-2)!==46){if(n.length>2){var c=n.lastIndexOf(`/`);if(c!==n.length-1){c===-1?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=s,a=0;continue}}else if(n.length===2||n.length===1){n=``,r=0,i=s,a=0;continue}}t&&(n.length>0?n+=`/..`:n=`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,s):n=e.slice(i+1,s),r=s-i-1;i=s,a=0}else o===46&&a!==-1?++a:a=-1}return n}function i(e,t){var n=t.dir||t.root,r=t.base||(t.name||``)+(t.ext||``);return n?n===t.root?n+r:n+e+r:r}var a={resolve:function(){for(var e=``,t=!1,i,a=arguments.length-1;a>=-1&&!t;a--){var o;a>=0?o=arguments[a]:(i===void 0&&(i=C.cwd()),o=i),n(o),o.length!==0&&(e=o+`/`+e,t=o.charCodeAt(0)===47)}return e=r(e,!t),t?e.length>0?`/`+e:`/`:e.length>0?e:`.`},normalize:function(e){if(n(e),e.length===0)return`.`;var t=e.charCodeAt(0)===47,i=e.charCodeAt(e.length-1)===47;return e=r(e,!t),e.length===0&&!t&&(e=`.`),e.length>0&&i&&(e+=`/`),t?`/`+e:e},isAbsolute:function(e){return n(e),e.length>0&&e.charCodeAt(0)===47},join:function(){if(arguments.length===0)return`.`;for(var e,t=0;t<arguments.length;++t){var r=arguments[t];n(r),r.length>0&&(e===void 0?e=r:e+=`/`+r)}return e===void 0?`.`:a.normalize(e)},relative:function(e,t){if(n(e),n(t),e===t||(e=a.resolve(e),t=a.resolve(t),e===t))return``;for(var r=1;r<e.length&&e.charCodeAt(r)===47;++r);for(var i=e.length,o=i-r,s=1;s<t.length&&t.charCodeAt(s)===47;++s);for(var c=t.length-s,l=o<c?o:c,u=-1,d=0;d<=l;++d){if(d===l){if(c>l){if(t.charCodeAt(s+d)===47)return t.slice(s+d+1);if(d===0)return t.slice(s+d)}else o>l&&(e.charCodeAt(r+d)===47?u=d:d===0&&(u=0));break}var f=e.charCodeAt(r+d);if(f!==t.charCodeAt(s+d))break;f===47&&(u=d)}var p=``;for(d=r+u+1;d<=i;++d)(d===i||e.charCodeAt(d)===47)&&(p.length===0?p+=`..`:p+=`/..`);return p.length>0?p+t.slice(s+u):(s+=u,t.charCodeAt(s)===47&&++s,t.slice(s))},_makeLong:function(e){return e},dirname:function(e){if(n(e),e.length===0)return`.`;for(var t=e.charCodeAt(0),r=t===47,i=-1,a=!0,o=e.length-1;o>=1;--o)if(t=e.charCodeAt(o),t===47){if(!a){i=o;break}}else a=!1;return i===-1?r?`/`:`.`:r&&i===1?`//`:e.slice(0,i)},basename:function(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);n(e);var r=0,i=-1,a=!0,o;if(t!==void 0&&t.length>0&&t.length<=e.length){if(t.length===e.length&&t===e)return``;var s=t.length-1,c=-1;for(o=e.length-1;o>=0;--o){var l=e.charCodeAt(o);if(l===47){if(!a){r=o+1;break}}else c===-1&&(a=!1,c=o+1),s>=0&&(l===t.charCodeAt(s)?--s===-1&&(i=o):(s=-1,i=c))}return r===i?i=c:i===-1&&(i=e.length),e.slice(r,i)}else{for(o=e.length-1;o>=0;--o)if(e.charCodeAt(o)===47){if(!a){r=o+1;break}}else i===-1&&(a=!1,i=o+1);return i===-1?``:e.slice(r,i)}},extname:function(e){n(e);for(var t=-1,r=0,i=-1,a=!0,o=0,s=e.length-1;s>=0;--s){var c=e.charCodeAt(s);if(c===47){if(!a){r=s+1;break}continue}i===-1&&(a=!1,i=s+1),c===46?t===-1?t=s:o!==1&&(o=1):t!==-1&&(o=-1)}return t===-1||i===-1||o===0||o===1&&t===i-1&&t===r+1?``:e.slice(t,i)},format:function(e){if(typeof e!=`object`||!e)throw TypeError(`The "pathObject" argument must be of type Object. Received type `+typeof e);return i(`/`,e)},parse:function(e){n(e);var t={root:``,dir:``,base:``,ext:``,name:``};if(e.length===0)return t;var r=e.charCodeAt(0),i=r===47,a;i?(t.root=`/`,a=1):a=0;for(var o=-1,s=0,c=-1,l=!0,u=e.length-1,d=0;u>=a;--u){if(r=e.charCodeAt(u),r===47){if(!l){s=u+1;break}continue}c===-1&&(l=!1,c=u+1),r===46?o===-1?o=u:d!==1&&(d=1):o!==-1&&(d=-1)}return o===-1||c===-1||d===0||d===1&&o===c-1&&o===s+1?c!==-1&&(s===0&&i?t.base=t.name=e.slice(1,c):t.base=t.name=e.slice(s,c)):(s===0&&i?(t.name=e.slice(1,o),t.base=e.slice(1,c)):(t.name=e.slice(s,o),t.base=e.slice(s,c)),t.ext=e.slice(o,c)),s>0?t.dir=e.slice(0,s-1):i&&(t.dir=`/`),t},sep:`/`,delimiter:`:`,win32:null,posix:null};a.posix=a,t.exports=a})),D=t(((e,t)=>{w();var n=T(),r=E();t.exports=class{constructor(e,t=null){this._onChange=t,this._changeScheduled=!1,this._virtualFiles={},this.cwd=this._normalizeCwd(e||C.cwd())}get isRealFilesystem(){return!0}_normalizeCwd(e){let t=r.resolve(e);return t===`/`?`/`:t+`/`}absolutePath(e){e.startsWith(`./`)&&(e=e.slice(2));let t=e.startsWith(`/`)?e:r.join(this.cwd,e);return r.normalize(t)}setCwd(e){let t=e.endsWith(`/`)?e.slice(0,-1):e,n=this.absolutePath(t);this.cwd=n===`/`?`/`:n+`/`}getFileByPath(e){let t=this.absolutePath(e);if(this._virtualFiles[t]!==void 0)return this._virtualFiles[t];let i;try{i=n.statSync(t)}catch{return null}if(i.isDirectory()){let e={};try{for(let i of n.readdirSync(t)){let a=r.join(t,i);if(this._virtualFiles[a]!==void 0)e[i]=this._virtualFiles[a];else try{e[i]=n.statSync(a).isDirectory()?{}:``}catch{}}}catch{}let i=t===`/`?`/`:t+`/`;for(let t of Object.keys(this._virtualFiles))if(t.startsWith(i)&&!t.slice(i.length).includes(`/`)){let n=t.slice(i.length);n in e||(e[n]=this._virtualFiles[t])}return e}try{return n.readFileSync(t,`utf8`)}catch{return null}}setFileByPath(e,t,i=!1){let a=this.absolutePath(e);if(typeof t==`function`){this._virtualFiles[a]=t;return}if(t!=null&&t.constructor===Object){n.mkdirSync(a,{recursive:i}),this._triggerChange();return}i&&n.mkdirSync(r.dirname(a),{recursive:!0}),n.writeFileSync(a,String(t)),this._triggerChange()}deleteFileByPath(e){let t=this.absolutePath(e);delete this._virtualFiles[t];try{n.lstatSync(t).isDirectory()?n.rmdirSync(t):n.unlinkSync(t),this._triggerChange()}catch{}}getMode(e){let t=this.absolutePath(e);if(this._virtualFiles[t]!==void 0)return typeof this._virtualFiles[t]==`function`?493:420;try{return n.statSync(t).mode&511}catch{return null}}setMode(e,t){let r=this.absolutePath(e);this._virtualFiles[r]===void 0&&(n.chmodSync(r,t),this._triggerChange())}isExecutable(e){let t=this.getMode(e);return t===null?!1:(t&64)!=0}getSize(e){let t=this.absolutePath(e);if(this._virtualFiles[t]!==void 0)return 0;try{return n.statSync(t).size}catch{return 0}}isSymlink(e){let t=this.absolutePath(e);try{return n.lstatSync(t).isSymbolicLink()}catch{return!1}}readSymlink(e){let t=this.absolutePath(e);try{return n.readlinkSync(t)}catch{return null}}createSymlink(e,t){let i=this.absolutePath(t);n.mkdirSync(r.dirname(i),{recursive:!0}),n.symlinkSync(e,i),this._triggerChange()}getRaw(){return null}getRawPermissions(){return{}}addFiles(e){Object.entries(e).forEach(([e,t])=>{this.setFileByPath(e,t,!0)})}autoComplete(e,t){let i=this.absolutePath(e).split(`/`),a=i.pop(),o=i.join(`/`)||`/`,s=[];try{s=n.readdirSync(o)}catch{}let c=o===`/`?`/`:o+`/`;for(let e of Object.keys(this._virtualFiles))if(e.startsWith(c)&&!e.slice(c.length).includes(`/`)){let t=e.slice(c.length);s.includes(t)||s.push(t)}let l=s.filter(e=>e.startsWith(a));if(l.length===0&&!e.includes(`/`)){let n=this.getFileByPath(t);if(n&&n.constructor===Object&&(l=Object.keys(n).filter(t=>t.startsWith(e)),l.length))return{path:null,options:l}}if(!l.length)return null;let u=e.split(`/`);return u.pop(),{path:u.length?u.join(`/`):null,options:l.map(e=>{let t=r.join(o,e);if(this._virtualFiles[t]!==void 0)return e;try{return n.statSync(t).isDirectory()?e+`/`:e}catch{return e}})}}_triggerChange(){!this._onChange||this._changeScheduled||(this._changeScheduled=!0,Promise.resolve().then(()=>{this._changeScheduled=!1,typeof this._onChange==`function`&&this._onChange(null,null)}))}}})),O=t(((e,t)=>{var n=i();t.exports=class{constructor(e){this.options=e;let{cwd:t=`/`,clearFn:r,destroyFn:i,onFsChange:a}=this.options;this.vars={},this.aliases={},this.fs=new n(t,{},{},a||null),this._clearFn=r,this._destroyFn=i}setVar(e,t){t?this.vars[e]=t:delete this.vars[e]}unsetVar(e){this.setVar(e)}getVar(e){return this.vars[e]||``}setAlias(e,t){t?this.aliases[e]=t:delete this.aliases[e]}unsetAlias(e){this.setAlias(e)}getAlias(e){return this.aliases[e]||null}setCommand(e){let t=`${this.getVar(`PATH`)}/${e.name.toLowerCase()}`;this.fs.addFiles({[t]:e}),this.fs.setMode(t,365)}getCommand(e){let t=`${this.getVar(`PATH`)}/${e}`;return this.fs.getFileByPath(t)||null}setNodeFilesystem(e){let t=D(),n=this.fs._onChange;this.fs=new t(e,n)}setFilesystem(e,t={}){let r=this.fs.getFileByPath(this.getVar(`PATH`))||{},i=this.fs.getRawPermissions(),a=this.fs._onChange;this.fs=new n(this.fs.cwd,e,Object.assign({},i,t),a),this.fs.addFiles(r)}setCwd(e){this.fs.setCwd(e)}source(e){this.vars=Object.assign({},this.vars,e.vars),this.aliases=Object.assign({},this.aliases,e.aliases)}clear(){typeof this._clearFn==`function`&&this._clearFn()}destroy(e=0){typeof this._destroyFn==`function`&&this._destroyFn(e)}}})),k=t(((e,t)=>{var n=typeof Reflect==`object`?Reflect:null,r=n&&typeof n.apply==`function`?n.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)},i=n&&typeof n.ownKeys==`function`?n.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};function a(e){console&&console.warn&&console.warn(e)}var o=Number.isNaN||function(e){return e!==e};function s(){s.init.call(this)}t.exports=s,t.exports.once=y,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var c=10;function l(e){if(typeof e!=`function`)throw TypeError(`The "listener" argument must be of type Function. Received type `+typeof e)}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return c},set:function(e){if(typeof e!=`number`||e<0||o(e))throw RangeError(`The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received `+e+`.`);c=e}}),s.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(e){if(typeof e!=`number`||e<0||o(e))throw RangeError(`The value of "n" is out of range. It must be a non-negative number. Received `+e+`.`);return this._maxListeners=e,this};function u(e){return e._maxListeners===void 0?s.defaultMaxListeners:e._maxListeners}s.prototype.getMaxListeners=function(){return u(this)},s.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var i=e===`error`,a=this._events;if(a!==void 0)i&&=a.error===void 0;else if(!i)return!1;if(i){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var s=Error(`Unhandled error.`+(o?` (`+o.message+`)`:``));throw s.context=o,s}var c=a[e];if(c===void 0)return!1;if(typeof c==`function`)r(c,this,t);else for(var l=c.length,u=g(c,l),n=0;n<l;++n)r(u[n],this,t);return!0};function d(e,t,n,r){var i,o,s;if(l(n),o=e._events,o===void 0?(o=e._events=Object.create(null),e._eventsCount=0):(o.newListener!==void 0&&(e.emit(`newListener`,t,n.listener?n.listener:n),o=e._events),s=o[t]),s===void 0)s=o[t]=n,++e._eventsCount;else if(typeof s==`function`?s=o[t]=r?[n,s]:[s,n]:r?s.unshift(n):s.push(n),i=u(e),i>0&&s.length>i&&!s.warned){s.warned=!0;var c=Error(`Possible EventEmitter memory leak detected. `+s.length+` `+String(t)+` listeners added. Use emitter.setMaxListeners() to increase limit`);c.name=`MaxListenersExceededWarning`,c.emitter=e,c.type=t,c.count=s.length,a(c)}return e}s.prototype.addListener=function(e,t){return d(this,e,t,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(e,t){return d(this,e,t,!0)};function f(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=f.bind(r);return i.listener=n,r.wrapFn=i,i}s.prototype.once=function(e,t){return l(t),this.on(e,p(this,e,t)),this},s.prototype.prependOnceListener=function(e,t){return l(t),this.prependListener(e,p(this,e,t)),this},s.prototype.removeListener=function(e,t){var n,r,i,a,o;if(l(t),r=this._events,r===void 0||(n=r[e],n===void 0))return this;if(n===t||n.listener===t)--this._eventsCount===0?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit(`removeListener`,e,n.listener||t));else if(typeof n!=`function`){for(i=-1,a=n.length-1;a>=0;a--)if(n[a]===t||n[a].listener===t){o=n[a].listener,i=a;break}if(i<0)return this;i===0?n.shift():_(n,i),n.length===1&&(r[e]=n[0]),r.removeListener!==void 0&&this.emit(`removeListener`,e,o||t)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(e){var t,n=this._events,r;if(n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]),this;if(arguments.length===0){var i=Object.keys(n),a;for(r=0;r<i.length;++r)a=i[r],a!==`removeListener`&&this.removeAllListeners(a);return this.removeAllListeners(`removeListener`),this._events=Object.create(null),this._eventsCount=0,this}if(t=n[e],typeof t==`function`)this.removeListener(e,t);else if(t!==void 0)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this};function m(e,t,n){var r=e._events;if(r===void 0)return[];var i=r[t];return i===void 0?[]:typeof i==`function`?n?[i.listener||i]:[i]:n?v(i):g(i,i.length)}s.prototype.listeners=function(e){return m(this,e,!0)},s.prototype.rawListeners=function(e){return m(this,e,!1)},s.listenerCount=function(e,t){return typeof e.listenerCount==`function`?e.listenerCount(t):h.call(e,t)},s.prototype.listenerCount=h;function h(e){var t=this._events;if(t!==void 0){var n=t[e];if(typeof n==`function`)return 1;if(n!==void 0)return n.length}return 0}s.prototype.eventNames=function(){return this._eventsCount>0?i(this._events):[]};function g(e,t){for(var n=Array(t),r=0;r<t;++r)n[r]=e[r];return n}function _(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}function v(e){for(var t=Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}function y(e,t){return new Promise(function(n,r){function i(n){e.removeListener(t,a),r(n)}function a(){typeof e.removeListener==`function`&&e.removeListener(`error`,i),n([].slice.call(arguments))}x(e,t,a,{once:!0}),t!==`error`&&b(e,i,{once:!0})})}function b(e,t,n){typeof e.on==`function`&&x(e,`error`,t,n)}function x(e,t,n,r){if(typeof e.on==`function`)r.once?e.once(t,n):e.on(t,n);else if(typeof e.addEventListener==`function`)e.addEventListener(t,function i(a){r.once&&e.removeEventListener(t,i),n(a)});else throw TypeError(`The "emitter" argument must be of type EventEmitter. Received type `+typeof e)}})),A=t(((e,t)=>{var n=[`out`,`err`];t.exports=class{constructor(e,t){if(!n.includes(e))throw Error(`incorrect std output type`);this.type=e,this.string=t}}})),j=t(((e,t)=>{var n=A();t.exports=class{constructor(e=[],t=0){if(typeof t!=`number`)throw Error(`Command Result ExitCode must be a number`);if(!Array.isArray(e))throw Error(`Command Result be array`);this.std=e,this.exitCode=t}addStdOutLine(e){this.std.push(new n(`out`,e))}addStdErrLine(e){this.std.push(new n(`err`,e))}getStdOutput(){return this.std}getExitCode(){return this.exitCode}flush(){let e=this.std;return this.std=[],e}}})),M=t(((e,t)=>{var n=k(),r=j(),i=n.EventEmitter||n.default||n;t.exports=class extends i{constructor(e){super(),this.arguments=e,this.result=new r}get name(){return`unnamed`}run(){return Promise.reject(`Command not implemented...`)}runCommand(){return this.run().then(e=>(e&&e.split(/\r?\n/).forEach(e=>this.stdOut=e),this.result)).catch(e=>(e&&(this.stdErr=e.message||e),this.exitCode=127,this.result))}onInput(e){}set exitCode(e){this.result.exitCode=e}set stdOut(e){this.result.addStdOutLine(e)}set stdErr(e){this.result.addStdErrLine(e)}flush(){console.log(`flush now`),this.emit(`flush`,this.result.flush())}}})),N=t(((e,t)=>{var n=M();t.exports=class extends n{constructor(e,t){super(e),this.context=t}}})),P=t(((e,t)=>{r();var i=N();t.exports=class extends i{constructor(e,t,n,r=!1){super(t,n),this.script=e,this.source=r}run(){let e=this.context.fs.isRealFilesystem?{useRealFilesystem:!0}:{filesystem:this.context.fs.getRaw(),permissions:this.context.fs.getRawPermissions()};this.sandbox=new n.shell({cwd:this.context.fs.cwd,...e}),this.sandbox.context.source(this.context),this.sandbox.on(`stdOut`,e=>this.stdOut=e),this.sandbox.on(`stdErr`,e=>this.stdErr=e);let t=this.script.split(/\r?\n/);if(!t[0].startsWith(`#!`))return Promise.reject(`no interpreter set`);let r=this._parseLines(t.slice(1));return this._executeNodes(r).then(()=>{this.exitCode=this.sandbox.lastCode,this.source&&this.context.source(this.sandbox.context)})}_parseLines(e){let t=[],n=0;for(;n<e.length;){let r=e[n].trim();if(!r||r.startsWith(`#`)){n++;continue}if(r.startsWith(`if `)||r===`if`){let r=this._parseIf(e,n);t.push(r.node),n+=r.consumed;continue}if(r.startsWith(`while `)){let r=this._parseWhile(e,n);t.push(r.node),n+=r.consumed;continue}if(r.startsWith(`for `)){let r=this._parseFor(e,n);t.push(r.node),n+=r.consumed;continue}t.push({type:`command`,line:r}),n++}return t}_parseIf(e,t){let n=e[t].trim().replace(/^if\s+/,``).replace(/\s*;\s*then\s*$/,``).replace(/\s+then\s*$/,``).trim(),r=t+1;r<e.length&&e[r].trim()===`then`&&r++;let i=[],a=[],o=!1,s=!1,c=1;for(;r<e.length;){let t=e[r].trim();if(t.startsWith(`if `)&&c++,t===`fi`&&(c--,c===0)){s&&a.push(`fi`),r++;break}if(c===1&&(t===`else`||t.startsWith(`elif `))){o||=!0,t.startsWith(`elif `)?(s=!0,a.push(t.replace(/^elif/,`if`))):s&&a.push(e[r]),r++;continue}o?a.push(e[r]):i.push(e[r]),r++}return{node:{type:`if`,condition:n,thenLines:i,elseLines:a},consumed:r-t}}_parseWhile(e,t){let n=e[t].trim().replace(/^while\s+/,``).replace(/\s*;\s*do\s*$/,``).replace(/\s+do\s*$/,``).trim(),r=t+1;r<e.length&&e[r].trim()===`do`&&r++;let i=[],a=1;for(;r<e.length;){let t=e[r].trim();if((t.startsWith(`while `)||t.startsWith(`for `))&&a++,t===`done`&&(a--,a===0)){r++;break}i.push(e[r]),r++}return{node:{type:`while`,condition:n,bodyLines:i},consumed:r-t}}_parseFor(e,t){let n=e[t].trim().replace(/\s*;\s*do\s*$/,``).replace(/\s+do\s*$/,``).match(/^for\s+(\w+)\s+in\s+(.+)$/),r=n?n[1]:``,i=n?n[2].trim():``,a=t+1;a<e.length&&e[a].trim()===`do`&&a++;let o=[],s=1;for(;a<e.length;){let t=e[a].trim();if((t.startsWith(`while `)||t.startsWith(`for `))&&s++,t===`done`&&(s--,s===0)){a++;break}o.push(e[a]),a++}return{node:{type:`for`,variable:r,list:i,bodyLines:o},consumed:a-t}}_executeNodes(e){return e.reduce((e,t)=>e.then(()=>this._executeNode(t)),Promise.resolve())}_executeNode(e){return e.type===`command`?this.sandbox.onCommand(e.line,!1):e.type===`if`?this._executeIf(e):e.type===`while`?this._executeWhile(e):e.type===`for`?this._executeFor(e):Promise.resolve()}_executeIf(e){return this.sandbox.onCommand(e.condition,!1).then(()=>{if(this.sandbox.lastCode===0)return this._executeNodes(this._parseLines(e.thenLines));if(e.elseLines.length>0)return this._executeNodes(this._parseLines(e.elseLines))})}_executeWhile(e){let t=()=>this.sandbox.onCommand(e.condition,!1).then(()=>{if(this.sandbox.lastCode===0)return this._executeNodes(this._parseLines(e.bodyLines)).then(t)});return t()}_executeFor(e){return e.list.replace(/\${?([\w\d]+)}?/g,(e,t)=>this.sandbox.context.getVar(t)||``).split(/\s+/).filter(Boolean).reduce((t,n)=>t.then(()=>(this.sandbox.context.setVar(e.variable,n),this._executeNodes(this._parseLines(e.bodyLines)))),Promise.resolve())}}}));function F(e){var t=e.length;if(t%4>0)throw Error(`Invalid string. Length must be a multiple of 4`);var n=e.indexOf(`=`);n===-1&&(n=t);var r=n===t?0:4-n%4;return[n,r]}function I(e){var t=F(e),n=t[0],r=t[1];return(n+r)*3/4-r}function L(e,t,n){return(t+n)*3/4-n}function ee(e){var t,n=F(e),r=n[0],i=n[1],a=new te(L(e,r,i)),o=0,s=i>0?r-4:r,c;for(c=0;c<s;c+=4)t=W[e.charCodeAt(c)]<<18|W[e.charCodeAt(c+1)]<<12|W[e.charCodeAt(c+2)]<<6|W[e.charCodeAt(c+3)],a[o++]=t>>16&255,a[o++]=t>>8&255,a[o++]=t&255;return i===2&&(t=W[e.charCodeAt(c)]<<2|W[e.charCodeAt(c+1)]>>4,a[o++]=t&255),i===1&&(t=W[e.charCodeAt(c)]<<10|W[e.charCodeAt(c+1)]<<4|W[e.charCodeAt(c+2)]>>2,a[o++]=t>>8&255,a[o++]=t&255),a}function R(e){return U[e>>18&63]+U[e>>12&63]+U[e>>6&63]+U[e&63]}function z(e,t,n){for(var r,i=[],a=t;a<n;a+=3)r=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(e[a+2]&255),i.push(R(r));return i.join(``)}function B(e){for(var t,n=e.length,r=n%3,i=[],a=16383,o=0,s=n-r;o<s;o+=a)i.push(z(e,o,o+a>s?s:o+a));return r===1?(t=e[n-1],i.push(U[t>>2]+U[t<<4&63]+`==`)):r===2&&(t=(e[n-2]<<8)+e[n-1],i.push(U[t>>10]+U[t>>4&63]+U[t<<2&63]+`=`)),i.join(``)}var V,H,U,W,te,ne,G,re,ie,ae,oe=e((()=>{for(V={},H={},H.byteLength=I,H.toByteArray=ee,H.fromByteArray=B,U=[],W=[],te=typeof Uint8Array<`u`?Uint8Array:Array,ne=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,G=0,re=ne.length;G<re;++G)U[G]=ne[G],W[ne.charCodeAt(G)]=G;W[45]=62,W[95]=63,ie={},ie.read=function(e,t,n,r,i){var a,o,s=i*8-r-1,c=(1<<s)-1,l=c>>1,u=-7,d=n?i-1:0,f=n?-1:1,p=e[t+d];for(d+=f,a=p&(1<<-u)-1,p>>=-u,u+=s;u>0;a=a*256+e[t+d],d+=f,u-=8);for(o=a&(1<<-u)-1,a>>=-u,u+=r;u>0;o=o*256+e[t+d],d+=f,u-=8);if(a===0)a=1-l;else if(a===c)return o?NaN:(p?-1:1)*(1/0);else o+=2**r,a-=l;return(p?-1:1)*o*2**(a-r)},ie.write=function(e,t,n,r,i,a){var o,s,c,l=a*8-i-1,u=(1<<l)-1,d=u>>1,f=i===23?2**-24-2**-77:0,p=r?0:a-1,m=r?1:-1,h=+(t<0||t===0&&1/t<0);for(t=Math.abs(t),isNaN(t)||t===1/0?(s=+!!isNaN(t),o=u):(o=Math.floor(Math.log(t)/Math.LN2),t*(c=2**-o)<1&&(o--,c*=2),o+d>=1?t+=f/c:t+=f*2**(1-d),t*c>=2&&(o++,c/=2),o+d>=u?(s=0,o=u):o+d>=1?(s=(t*c-1)*2**i,o+=d):(s=t*2**(d-1)*2**i,o=0));i>=8;e[n+p]=s&255,p+=m,s/=256,i-=8);for(o=o<<i|s,l+=i;l>0;e[n+p]=o&255,p+=m,o/=256,l-=8);e[n+p-m]|=h*128},(function(e){let t=H,n=ie,r=typeof Symbol==`function`&&typeof Symbol.for==`function`?Symbol.for(`nodejs.util.inspect.custom`):null;e.Buffer=u,e.SlowBuffer=x,e.INSPECT_MAX_BYTES=50;let i=2147483647;e.kMaxLength=i;let{Uint8Array:a,ArrayBuffer:o,SharedArrayBuffer:s}=globalThis;u.TYPED_ARRAY_SUPPORT=c(),!u.TYPED_ARRAY_SUPPORT&&typeof console<`u`&&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 c(){try{let e=new a(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,a.prototype),Object.setPrototypeOf(e,t),e.foo()===42}catch{return!1}}Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}});function l(e){if(e>i)throw RangeError(`The value "`+e+`" is invalid for option "size"`);let t=new a(e);return Object.setPrototypeOf(t,u.prototype),t}function u(e,t,n){if(typeof e==`number`){if(typeof t==`string`)throw TypeError(`The "string" argument must be of type string. Received type number`);return m(e)}return d(e,t,n)}u.poolSize=8192;function d(e,t,n){if(typeof e==`string`)return h(e,t);if(o.isView(e))return _(e);if(e==null)throw TypeError(`The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type `+typeof e);if(J(e,o)||e&&J(e.buffer,o)||s!==void 0&&(J(e,s)||e&&J(e.buffer,s)))return v(e,t,n);if(typeof e==`number`)throw TypeError(`The "value" argument must not be of type number. Received type number`);let r=e.valueOf&&e.valueOf();if(r!=null&&r!==e)return u.from(r,t,n);let i=y(e);if(i)return i;if(typeof Symbol<`u`&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]==`function`)return u.from(e[Symbol.toPrimitive](`string`),t,n);throw TypeError(`The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type `+typeof e)}u.from=function(e,t,n){return d(e,t,n)},Object.setPrototypeOf(u.prototype,a.prototype),Object.setPrototypeOf(u,a);function f(e){if(typeof e!=`number`)throw TypeError(`"size" argument must be of type number`);if(e<0)throw RangeError(`The value "`+e+`" is invalid for option "size"`)}function p(e,t,n){return f(e),e<=0||t===void 0?l(e):typeof n==`string`?l(e).fill(t,n):l(e).fill(t)}u.alloc=function(e,t,n){return p(e,t,n)};function m(e){return f(e),l(e<0?0:b(e)|0)}u.allocUnsafe=function(e){return m(e)},u.allocUnsafeSlow=function(e){return m(e)};function h(e,t){if((typeof t!=`string`||t===``)&&(t=`utf8`),!u.isEncoding(t))throw TypeError(`Unknown encoding: `+t);let n=S(e,t)|0,r=l(n),i=r.write(e,t);return i!==n&&(r=r.slice(0,i)),r}function g(e){let t=e.length<0?0:b(e.length)|0,n=l(t);for(let r=0;r<t;r+=1)n[r]=e[r]&255;return n}function _(e){if(J(e,a)){let t=new a(e);return v(t.buffer,t.byteOffset,t.byteLength)}return g(e)}function v(e,t,n){if(t<0||e.byteLength<t)throw RangeError(`"offset" is outside of buffer bounds`);if(e.byteLength<t+(n||0))throw RangeError(`"length" is outside of buffer bounds`);let r;return r=t===void 0&&n===void 0?new a(e):n===void 0?new a(e,t):new a(e,t,n),Object.setPrototypeOf(r,u.prototype),r}function y(e){if(u.isBuffer(e)){let t=b(e.length)|0,n=l(t);return n.length===0||e.copy(n,0,0,t),n}if(e.length!==void 0)return typeof e.length!=`number`||he(e.length)?l(0):g(e);if(e.type===`Buffer`&&Array.isArray(e.data))return g(e.data)}function b(e){if(e>=i)throw RangeError(`Attempt to allocate Buffer larger than maximum size: 0x`+i.toString(16)+` bytes`);return e|0}function x(e){return+e!=e&&(e=0),u.alloc(+e)}u.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==u.prototype},u.compare=function(e,t){if(J(e,a)&&(e=u.from(e,e.offset,e.byteLength)),J(t,a)&&(t=u.from(t,t.offset,t.byteLength)),!u.isBuffer(e)||!u.isBuffer(t))throw TypeError(`The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array`);if(e===t)return 0;let n=e.length,r=t.length;for(let i=0,a=Math.min(n,r);i<a;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:+(r<n)},u.isEncoding=function(e){switch(String(e).toLowerCase()){case`hex`:case`utf8`:case`utf-8`:case`ascii`:case`latin1`:case`binary`:case`base64`:case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return!0;default:return!1}},u.concat=function(e,t){if(!Array.isArray(e))throw TypeError(`"list" argument must be an Array of Buffers`);if(e.length===0)return u.alloc(0);let n;if(t===void 0)for(t=0,n=0;n<e.length;++n)t+=e[n].length;let r=u.allocUnsafe(t),i=0;for(n=0;n<e.length;++n){let t=e[n];if(J(t,a))i+t.length>r.length?(u.isBuffer(t)||(t=u.from(t)),t.copy(r,i)):a.prototype.set.call(r,t,i);else if(u.isBuffer(t))t.copy(r,i);else throw TypeError(`"list" argument must be an Array of Buffers`);i+=t.length}return r};function S(e,t){if(u.isBuffer(e))return e.length;if(o.isView(e)||J(e,o))return e.byteLength;if(typeof e!=`string`)throw TypeError(`The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type `+typeof e);let n=e.length,r=arguments.length>2&&arguments[2]===!0;if(!r&&n===0)return 0;let i=!1;for(;;)switch(t){case`ascii`:case`latin1`:case`binary`:return n;case`utf8`:case`utf-8`:return ue(e).length;case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return n*2;case`hex`:return n>>>1;case`base64`:return pe(e).length;default:if(i)return r?-1:ue(e).length;t=(``+t).toLowerCase(),i=!0}}u.byteLength=S;function C(e,t,n){let r=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((n===void 0||n>this.length)&&(n=this.length),n<=0)||(n>>>=0,t>>>=0,n<=t))return``;for(e||=`utf8`;;)switch(e){case`hex`:return ee(this,t,n);case`utf8`:case`utf-8`:return N(this,t,n);case`ascii`:return I(this,t,n);case`latin1`:case`binary`:return L(this,t,n);case`base64`:return M(this,t,n);case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return R(this,t,n);default:if(r)throw TypeError(`Unknown encoding: `+e);e=(e+``).toLowerCase(),r=!0}}u.prototype._isBuffer=!0;function w(e,t,n){let r=e[t];e[t]=e[n],e[n]=r}u.prototype.swap16=function(){let e=this.length;if(e%2!=0)throw RangeError(`Buffer size must be a multiple of 16-bits`);for(let t=0;t<e;t+=2)w(this,t,t+1);return this},u.prototype.swap32=function(){let e=this.length;if(e%4!=0)throw RangeError(`Buffer size must be a multiple of 32-bits`);for(let t=0;t<e;t+=4)w(this,t,t+3),w(this,t+1,t+2);return this},u.prototype.swap64=function(){let e=this.length;if(e%8!=0)throw RangeError(`Buffer size must be a multiple of 64-bits`);for(let t=0;t<e;t+=8)w(this,t,t+7),w(this,t+1,t+6),w(this,t+2,t+5),w(this,t+3,t+4);return this},u.prototype.toString=function(){let e=this.length;return e===0?``:arguments.length===0?N(this,0,e):C.apply(this,arguments)},u.prototype.toLocaleString=u.prototype.toString,u.prototype.equals=function(e){if(!u.isBuffer(e))throw TypeError(`Argument must be a Buffer`);return this===e?!0:u.compare(this,e)===0},u.prototype.inspect=function(){let t=``,n=e.INSPECT_MAX_BYTES;return t=this.toString(`hex`,0,n).replace(/(.{2})/g,`$1 `).trim(),this.length>n&&(t+=` ... `),`<Buffer `+t+`>`},r&&(u.prototype[r]=u.prototype.inspect),u.prototype.compare=function(e,t,n,r,i){if(J(e,a)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(e))throw TypeError(`The "target" argument must be one of type Buffer or Uint8Array. Received type `+typeof e);if(t===void 0&&(t=0),n===void 0&&(n=e?e.length:0),r===void 0&&(r=0),i===void 0&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw RangeError(`out of range index`);if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,r>>>=0,i>>>=0,this===e)return 0;let o=i-r,s=n-t,c=Math.min(o,s),l=this.slice(r,i),d=e.slice(t,n);for(let e=0;e<c;++e)if(l[e]!==d[e]){o=l[e],s=d[e];break}return o<s?-1:+(s<o)};function T(e,t,n,r,i){if(e.length===0)return-1;if(typeof n==`string`?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,he(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0)if(i)n=0;else return-1;if(typeof t==`string`&&(t=u.from(t,r)),u.isBuffer(t))return t.length===0?-1:E(e,t,n,r,i);if(typeof t==`number`)return t&=255,typeof a.prototype.indexOf==`function`?i?a.prototype.indexOf.call(e,t,n):a.prototype.lastIndexOf.call(e,t,n):E(e,[t],n,r,i);throw TypeError(`val must be string, number or Buffer`)}function E(e,t,n,r,i){let a=1,o=e.length,s=t.length;if(r!==void 0&&(r=String(r).toLowerCase(),r===`ucs2`||r===`ucs-2`||r===`utf16le`||r===`utf-16le`)){if(e.length<2||t.length<2)return-1;a=2,o/=2,s/=2,n/=2}function c(e,t){return a===1?e[t]:e.readUInt16BE(t*a)}let l;if(i){let r=-1;for(l=n;l<o;l++)if(c(e,l)===c(t,r===-1?0:l-r)){if(r===-1&&(r=l),l-r+1===s)return r*a}else r!==-1&&(l-=l-r),r=-1}else for(n+s>o&&(n=o-s),l=n;l>=0;l--){let n=!0;for(let r=0;r<s;r++)if(c(e,l+r)!==c(t,r)){n=!1;break}if(n)return l}return-1}u.prototype.includes=function(e,t,n){return this.indexOf(e,t,n)!==-1},u.prototype.indexOf=function(e,t,n){return T(this,e,t,n,!0)},u.prototype.lastIndexOf=function(e,t,n){return T(this,e,t,n,!1)};function D(e,t,n,r){n=Number(n)||0;let i=e.length-n;r?(r=Number(r),r>i&&(r=i)):r=i;let a=t.length;r>a/2&&(r=a/2);let o;for(o=0;o<r;++o){let r=parseInt(t.substr(o*2,2),16);if(he(r))return o;e[n+o]=r}return o}function O(e,t,n,r){return me(ue(t,e.length-n),e,n,r)}function k(e,t,n,r){return me(de(t),e,n,r)}function A(e,t,n,r){return me(pe(t),e,n,r)}function j(e,t,n,r){return me(fe(t,e.length-n),e,n,r)}u.prototype.write=function(e,t,n,r){if(t===void 0)r=`utf8`,n=this.length,t=0;else if(n===void 0&&typeof t==`string`)r=t,n=this.length,t=0;else if(isFinite(t))t>>>=0,isFinite(n)?(n>>>=0,r===void 0&&(r=`utf8`)):(r=n,n=void 0);else throw Error(`Buffer.write(string, encoding, offset[, length]) is no longer supported`);let i=this.length-t;if((n===void 0||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw RangeError(`Attempt to write outside buffer bounds`);r||=`utf8`;let a=!1;for(;;)switch(r){case`hex`:return D(this,e,t,n);case`utf8`:case`utf-8`:return O(this,e,t,n);case`ascii`:case`latin1`:case`binary`:return k(this,e,t,n);case`base64`:return A(this,e,t,n);case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return j(this,e,t,n);default:if(a)throw TypeError(`Unknown encoding: `+r);r=(``+r).toLowerCase(),a=!0}},u.prototype.toJSON=function(){return{type:`Buffer`,data:Array.prototype.slice.call(this._arr||this,0)}};function M(e,n,r){return n===0&&r===e.length?t.fromByteArray(e):t.fromByteArray(e.slice(n,r))}function N(e,t,n){n=Math.min(e.length,n);let r=[],i=t;for(;i<n;){let t=e[i],a=null,o=t>239?4:t>223?3:t>191?2:1;if(i+o<=n){let n,r,s,c;switch(o){case 1:t<128&&(a=t);break;case 2:n=e[i+1],(n&192)==128&&(c=(t&31)<<6|n&63,c>127&&(a=c));break;case 3:n=e[i+1],r=e[i+2],(n&192)==128&&(r&192)==128&&(c=(t&15)<<12|(n&63)<<6|r&63,c>2047&&(c<55296||c>57343)&&(a=c));break;case 4:n=e[i+1],r=e[i+2],s=e[i+3],(n&192)==128&&(r&192)==128&&(s&192)==128&&(c=(t&15)<<18|(n&63)<<12|(r&63)<<6|s&63,c>65535&&c<1114112&&(a=c))}}a===null?(a=65533,o=1):a>65535&&(a-=65536,r.push(a>>>10&1023|55296),a=56320|a&1023),r.push(a),i+=o}return F(r)}let P=4096;function F(e){let t=e.length;if(t<=P)return String.fromCharCode.apply(String,e);let n=``,r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=P));return n}function I(e,t,n){let r=``;n=Math.min(e.length,n);for(let i=t;i<n;++i)r+=String.fromCharCode(e[i]&127);return r}function L(e,t,n){let r=``;n=Math.min(e.length,n);for(let i=t;i<n;++i)r+=String.fromCharCode(e[i]);return r}function ee(e,t,n){let r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);let i=``;for(let r=t;r<n;++r)i+=ge[e[r]];return i}function R(e,t,n){let r=e.slice(t,n),i=``;for(let e=0;e<r.length-1;e+=2)i+=String.fromCharCode(r[e]+r[e+1]*256);return i}u.prototype.slice=function(e,t){let n=this.length;e=~~e,t=t===void 0?n:~~t,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),t<e&&(t=e);let r=this.subarray(e,t);return Object.setPrototypeOf(r,u.prototype),r};function z(e,t,n){if(e%1!=0||e<0)throw RangeError(`offset is not uint`);if(e+t>n)throw RangeError(`Trying to access beyond buffer length`)}u.prototype.readUintLE=u.prototype.readUIntLE=function(e,t,n){e>>>=0,t>>>=0,n||z(e,t,this.length);let r=this[e],i=1,a=0;for(;++a<t&&(i*=256);)r+=this[e+a]*i;return r},u.prototype.readUintBE=u.prototype.readUIntBE=function(e,t,n){e>>>=0,t>>>=0,n||z(e,t,this.length);let r=this[e+--t],i=1;for(;t>0&&(i*=256);)r+=this[e+--t]*i;return r},u.prototype.readUint8=u.prototype.readUInt8=function(e,t){return e>>>=0,t||z(e,1,this.length),this[e]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(e,t){return e>>>=0,t||z(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(e,t){return e>>>=0,t||z(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(e,t){return e>>>=0,t||z(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(e,t){return e>>>=0,t||z(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readBigUInt64LE=Y(function(e){e>>>=0,K(e,`offset`);let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&q(e,this.length-8);let r=t+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,i=this[++e]+this[++e]*2**8+this[++e]*2**16+n*2**24;return BigInt(r)+(BigInt(i)<<BigInt(32))}),u.prototype.readBigUInt64BE=Y(function(e){e>>>=0,K(e,`offset`);let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&q(e,this.length-8);let r=t*2**24+this[++e]*2**16+this[++e]*2**8+this[++e],i=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n;return(BigInt(r)<<BigInt(32))+BigInt(i)}),u.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||z(e,t,this.length);let r=this[e],i=1,a=0;for(;++a<t&&(i*=256);)r+=this[e+a]*i;return i*=128,r>=i&&(r-=2**(8*t)),r},u.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||z(e,t,this.length);let r=t,i=1,a=this[e+--r];for(;r>0&&(i*=256);)a+=this[e+--r]*i;return i*=128,a>=i&&(a-=2**(8*t)),a},u.prototype.readInt8=function(e,t){return e>>>=0,t||z(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]},u.prototype.readInt16LE=function(e,t){e>>>=0,t||z(e,2,this.length);let n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n},u.prototype.readInt16BE=function(e,t){e>>>=0,t||z(e,2,this.length);let n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n},u.prototype.readInt32LE=function(e,t){return e>>>=0,t||z(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return e>>>=0,t||z(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readBigInt64LE=Y(function(e){e>>>=0,K(e,`offset`);let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&q(e,this.length-8);let r=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(n<<24);return(BigInt(r)<<BigInt(32))+BigInt(t+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24)}),u.prototype.readBigInt64BE=Y(function(e){e>>>=0,K(e,`offset`);let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&q(e,this.length-8);let r=(t<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(r)<<BigInt(32))+BigInt(this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n)}),u.prototype.readFloatLE=function(e,t){return e>>>=0,t||z(e,4,this.length),n.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return e>>>=0,t||z(e,4,this.length),n.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return e>>>=0,t||z(e,8,this.length),n.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return e>>>=0,t||z(e,8,this.length),n.read(this,e,!1,52,8)};function B(e,t,n,r,i,a){if(!u.isBuffer(e))throw TypeError(`"buffer" argument must be a Buffer instance`);if(t>i||t<a)throw RangeError(`"value" argument is out of bounds`);if(n+r>e.length)throw RangeError(`Index out of range`)}u.prototype.writeUintLE=u.prototype.writeUIntLE=function(e,t,n,r){if(e=+e,t>>>=0,n>>>=0,!r){let r=2**(8*n)-1;B(this,e,t,n,r,0)}let i=1,a=0;for(this[t]=e&255;++a<n&&(i*=256);)this[t+a]=e/i&255;return t+n},u.prototype.writeUintBE=u.prototype.writeUIntBE=function(e,t,n,r){if(e=+e,t>>>=0,n>>>=0,!r){let r=2**(8*n)-1;B(this,e,t,n,r,0)}let i=n-1,a=1;for(this[t+i]=e&255;--i>=0&&(a*=256);)this[t+i]=e/a&255;return t+n},u.prototype.writeUint8=u.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||B(this,e,t,1,255,0),this[t]=e&255,t+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||B(this,e,t,2,65535,0),this[t]=e&255,this[t+1]=e>>>8,t+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||B(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=e&255,t+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||B(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e&255,t+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||B(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4};function V(e,t,n,r,i){se(t,r,i,e,n,7);let a=Number(t&BigInt(4294967295));e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a;let o=Number(t>>BigInt(32)&BigInt(4294967295));return e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o,n}function U(e,t,n,r,i){se(t,r,i,e,n,7);let a=Number(t&BigInt(4294967295));e[n+7]=a,a>>=8,e[n+6]=a,a>>=8,e[n+5]=a,a>>=8,e[n+4]=a;let o=Number(t>>BigInt(32)&BigInt(4294967295));return e[n+3]=o,o>>=8,e[n+2]=o,o>>=8,e[n+1]=o,o>>=8,e[n]=o,n+8}u.prototype.writeBigUInt64LE=Y(function(e,t=0){return V(this,e,t,BigInt(0),BigInt(`0xffffffffffffffff`))}),u.prototype.writeBigUInt64BE=Y(function(e,t=0){return U(this,e,t,BigInt(0),BigInt(`0xffffffffffffffff`))}),u.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){let r=2**(8*n-1);B(this,e,t,n,r-1,-r)}let i=0,a=1,o=0;for(this[t]=e&255;++i<n&&(a*=256);)e<0&&o===0&&this[t+i-1]!==0&&(o=1),this[t+i]=(e/a>>0)-o&255;return t+n},u.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){let r=2**(8*n-1);B(this,e,t,n,r-1,-r)}let i=n-1,a=1,o=0;for(this[t+i]=e&255;--i>=0&&(a*=256);)e<0&&o===0&&this[t+i+1]!==0&&(o=1),this[t+i]=(e/a>>0)-o&255;return t+n},u.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||B(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=e&255,t+1},u.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||B(this,e,t,2,32767,-32768),this[t]=e&255,this[t+1]=e>>>8,t+2},u.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||B(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=e&255,t+2},u.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||B(this,e,t,4,2147483647,-2147483648),this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},u.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||B(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4},u.prototype.writeBigInt64LE=Y(function(e,t=0){return V(this,e,t,-BigInt(`0x8000000000000000`),BigInt(`0x7fffffffffffffff`))}),u.prototype.writeBigInt64BE=Y(function(e,t=0){return U(this,e,t,-BigInt(`0x8000000000000000`),BigInt(`0x7fffffffffffffff`))});function W(e,t,n,r,i,a){if(n+r>e.length||n<0)throw RangeError(`Index out of range`)}function te(e,t,r,i,a){return t=+t,r>>>=0,a||W(e,t,r,4),n.write(e,t,r,i,23,4),r+4}u.prototype.writeFloatLE=function(e,t,n){return te(this,e,t,!0,n)},u.prototype.writeFloatBE=function(e,t,n){return te(this,e,t,!1,n)};function ne(e,t,r,i,a){return t=+t,r>>>=0,a||W(e,t,r,8),n.write(e,t,r,i,52,8),r+8}u.prototype.writeDoubleLE=function(e,t,n){return ne(this,e,t,!0,n)},u.prototype.writeDoubleBE=function(e,t,n){return ne(this,e,t,!1,n)},u.prototype.copy=function(e,t,n,r){if(!u.isBuffer(e))throw TypeError(`argument should be a Buffer`);if(n||=0,!r&&r!==0&&(r=this.length),t>=e.length&&(t=e.length),t||=0,r>0&&r<n&&(r=n),r===n||e.length===0||this.length===0)return 0;if(t<0)throw RangeError(`targetStart out of bounds`);if(n<0||n>=this.length)throw RangeError(`Index out of range`);if(r<0)throw RangeError(`sourceEnd out of bounds`);r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);let i=r-n;return this===e&&typeof a.prototype.copyWithin==`function`?this.copyWithin(t,n,r):a.prototype.set.call(e,this.subarray(n,r),t),i},u.prototype.fill=function(e,t,n,r){if(typeof e==`string`){if(typeof t==`string`?(r=t,t=0,n=this.length):typeof n==`string`&&(r=n,n=this.length),r!==void 0&&typeof r!=`string`)throw TypeError(`encoding must be a string`);if(typeof r==`string`&&!u.isEncoding(r))throw TypeError(`Unknown encoding: `+r);if(e.length===1){let t=e.charCodeAt(0);(r===`utf8`&&t<128||r===`latin1`)&&(e=t)}}else typeof e==`number`?e&=255:typeof e==`boolean`&&(e=Number(e));if(t<0||this.length<t||this.length<n)throw RangeError(`Out of range index`);if(n<=t)return this;t>>>=0,n=n===void 0?this.length:n>>>0,e||=0;let i;if(typeof e==`number`)for(i=t;i<n;++i)this[i]=e;else{let a=u.isBuffer(e)?e:u.from(e,r),o=a.length;if(o===0)throw TypeError(`The value "`+e+`" is invalid for argument "value"`);for(i=0;i<n-t;++i)this[i+t]=a[i%o]}return this};let G={};function re(e,t,n){G[e]=class extends n{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}re(`ERR_BUFFER_OUT_OF_BOUNDS`,function(e){return e?`${e} is outside of buffer bounds`:`Attempt to access memory outside buffer bounds`},RangeError),re(`ERR_INVALID_ARG_TYPE`,function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),re(`ERR_OUT_OF_RANGE`,function(e,t,n){let r=`The value of "${e}" is out of range.`,i=n;return Number.isInteger(n)&&Math.abs(n)>2**32?i=ae(String(n)):typeof n==`bigint`&&(i=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(i=ae(i)),i+=`n`),r+=` It must be ${t}. Received ${i}`,r},RangeError);function ae(e){let t=``,n=e.length,r=+(e[0]===`-`);for(;n>=r+4;n-=3)t=`_${e.slice(n-3,n)}${t}`;return`${e.slice(0,n)}${t}`}function oe(e,t,n){K(t,`offset`),(e[t]===void 0||e[t+n]===void 0)&&q(t,e.length-(n+1))}function se(e,t,n,r,i,a){if(e>n||e<t){let r=typeof t==`bigint`?`n`:``,i;throw i=a>3?t===0||t===BigInt(0)?`>= 0${r} and < 2${r} ** ${(a+1)*8}${r}`:`>= -(2${r} ** ${(a+1)*8-1}${r}) and < 2 ** ${(a+1)*8-1}${r}`:`>= ${t}${r} and <= ${n}${r}`,new G.ERR_OUT_OF_RANGE(`value`,i,e)}oe(r,i,a)}function K(e,t){if(typeof e!=`number`)throw new G.ERR_INVALID_ARG_TYPE(t,`number`,e)}function q(e,t,n){throw Math.floor(e)===e?t<0?new G.ERR_BUFFER_OUT_OF_BOUNDS:new G.ERR_OUT_OF_RANGE(n||`offset`,`>= ${+!!n} and <= ${t}`,e):(K(e,n),new G.ERR_OUT_OF_RANGE(n||`offset`,`an integer`,e))}let ce=/[^+/0-9A-Za-z-_]/g;function le(e){if(e=e.split(`=`)[0],e=e.trim().replace(ce,``),e.length<2)return``;for(;e.length%4!=0;)e+=`=`;return e}function ue(e,t){t||=1/0;let n,r=e.length,i=null,a=[];for(let o=0;o<r;++o){if(n=e.charCodeAt(o),n>55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&a.push(239,191,189);continue}else if(o+1===r){(t-=3)>-1&&a.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&a.push(239,191,189),i=n;continue}n=(i-55296<<10|n-56320)+65536}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,n<128){if(--t<0)break;a.push(n)}else if(n<2048){if((t-=2)<0)break;a.push(n>>6|192,n&63|128)}else if(n<65536){if((t-=3)<0)break;a.push(n>>12|224,n>>6&63|128,n&63|128)}else if(n<1114112){if((t-=4)<0)break;a.push(n>>18|240,n>>12&63|128,n>>6&63|128,n&63|128)}else throw Error(`Invalid code point`)}return a}function de(e){let t=[];for(let n=0;n<e.length;++n)t.push(e.charCodeAt(n)&255);return t}function fe(e,t){let n,r,i,a=[];for(let o=0;o<e.length&&!((t-=2)<0);++o)n=e.charCodeAt(o),r=n>>8,i=n%256,a.push(i),a.push(r);return a}function pe(e){return t.toByteArray(le(e))}function me(e,t,n,r){let i;for(i=0;i<r&&!(i+n>=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function J(e,t){return e instanceof t||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===t.name}function he(e){return e!==e}let ge=(function(){let e=`0123456789abcdef`,t=Array(256);for(let n=0;n<16;++n){let r=n*16;for(let i=0;i<16;++i)t[r+i]=e[n]+e[i]}return t})();function Y(e){return typeof BigInt>`u`?_e:e}function _e(){throw Error(`BigInt not supported`)}})(V),ae=V.Buffer,V.Blob,V.BlobOptions,V.Buffer,V.File,V.FileOptions,V.INSPECT_MAX_BYTES,V.SlowBuffer,V.TranscodeEncoding,V.atob,V.btoa,V.constants,V.isAscii,V.isUtf8,V.kMaxLength,V.kStringMaxLength,V.resolveObjectURL,V.transcode})),se=t(((e,t)=>{oe();var n=P();t.exports=class extends n{get name(){return`wasm`}get requiresFilesystem(){return!0}run(){let e=this.script,t=(()=>{try{return T()}catch{return null}})();return this._loadBytes(e,t).then(({bytes:e,isWat:t})=>t?this._runWat(e):this._runWasm(e)).catch(e=>{this.stdErr=e.message||String(e),this.exitCode=1})}_loadBytes(e,t){if(this.context.fs.isRealFilesystem&&t)try{let n=t.readFileSync(this.context.fs.absolutePath(e)),r=new Uint8Array(n);return Promise.resolve({bytes:r,isWat:this._isWat(e,r)})}catch(t){return Promise.reject(Error(`${e}: ${t.message}`))}let n=this.context.fs.getFileByPath(e);if(n==null)return Promise.reject(Error(`${e}: No such file or directory`));let r=this._contentToBytes(n);return Promise.resolve({bytes:r,isWat:this._isWat(e,r)})}_isWat(e,t){return e.endsWith(`.wat`)?!0:t.length>0&&t[0]===40}_contentToBytes(e){if(e instanceof Uint8Array)return e;if(ae!==void 0&&ae.isBuffer(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);if(e instanceof ArrayBuffer)return new Uint8Array(e);let t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n)&255;return t}async _runWat(e){let t=new TextDecoder().decode(e),n,r;try{r=await import(`wabt`)}catch{this.stdErr=`${this.script}: WAT execution requires the 'wabt' package\nInstall it with: npm install wabt`,this.exitCode=1;return}try{let e=r.default??r,{buffer:i}=(typeof e==`function`?await e():e).parseWat(this.script,t,{mutable_globals:!0}).toBinary({});n=new Uint8Array(i)}catch(e){this.stdErr=`${this.script}: WAT compilation error: ${e.message}`,this.exitCode=1;return}return this._runWasm(n)}async _runWasm(e){if(typeof WebAssembly>`u`){this.stdErr=`${this.script}: WebAssembly is not available in this environment`,this.exitCode=1;return}let t={1:``,2:``},n=new TextDecoder,r=null,i=(e,n)=>{t[e]=(t[e]||``)+n;let r=t[e].split(`
|
|
2
|
+
`);t[e]=r.pop();for(let t of r)e===1?this.stdOut=t:this.stdErr=t},a=()=>{t[1]&&=(this.stdOut=t[1],``),t[2]&&=(this.stdErr=t[2],``)},o=new TextEncoder().encode(this.stdin||``),s=0,c=new Proxy({fd_write:(e,t,a,o)=>{if(!r)return 8;let s=new DataView(r.buffer),c=0;for(let o=0;o<a;o++){let a=s.getUint32(t+o*8,!0),l=s.getUint32(t+o*8+4,!0);l>0&&i(e,n.decode(new Uint8Array(r.buffer,a,l))),c+=l}return s.setUint32(o,c,!0),0},fd_read:(e,t,n,i)=>{if(e!==0||!r)return 8;let a=new DataView(r.buffer),c=0;for(let e=0;e<n&&s<o.length;e++){let n=a.getUint32(t+e*8,!0),i=a.getUint32(t+e*8+4,!0),l=Math.min(i,o.length-s);new Uint8Array(r.buffer).set(o.slice(s,s+l),n),s+=l,c+=l}return a.setUint32(i,c,!0),0},proc_exit:e=>{throw e!==0&&(this.exitCode=e),{_wasmExit:!0,code:e}},args_sizes_get:(e,t)=>{if(!r)return 28;let n=[this.script,...this.arguments||[]],i=new DataView(r.buffer);return i.setUint32(e,n.length,!0),i.setUint32(t,n.reduce((e,t)=>e+t.length+1,0),!0),0},args_get:(e,t)=>{if(!r)return 28;let n=[this.script,...this.arguments||[]],i=new DataView(r.buffer),a=new TextEncoder,o=t;for(let t=0;t<n.length;t++){i.setUint32(e+t*4,o,!0);let s=a.encode(n[t]+`\0`);new Uint8Array(r.buffer).set(s,o),o+=s.length}return 0},environ_sizes_get:(e,t)=>{if(r){let n=new DataView(r.buffer);n.setUint32(e,0,!0),n.setUint32(t,0,!0)}return 0},environ_get:()=>0,clock_time_get:(e,t,n)=>{if(r){let e=BigInt(Date.now())*1000000n;new DataView(r.buffer).setBigUint64(n,e,!0)}return 0},fd_close:()=>0,fd_seek:()=>70,fd_prestat_get:()=>8,fd_prestat_dir_name:()=>8,path_open:()=>76,random_get:(e,t)=>{if(r){let n=new Uint8Array(r.buffer,e,t);for(let e=0;e<t;e++)n[e]=Math.random()*256|0}return 0}},{get(e,t){return t in e?e[t]:()=>0}}),l={wasi_snapshot_preview1:c,wasi_unstable:c,env:new Proxy({print:(e,t)=>{r&&i(1,n.decode(new Uint8Array(r.buffer,e,t)))},eprint:(e,t)=>{r&&i(2,n.decode(new Uint8Array(r.buffer,e,t)))},abort:()=>{throw this.exitCode=134,{_wasmExit:!0,code:134}}},{get(e,t){return t in e?e[t]:()=>0}})};try{let t=await WebAssembly.compile(e);for(let e of WebAssembly.Module.imports(t))if(e.kind===`memory`){let t=new WebAssembly.Memory({initial:1,maximum:256});r=t,l[e.module]||(l[e.module]={}),l[e.module][e.name]=t}let n=await WebAssembly.instantiate(t,l);n.exports.memory&&(r=n.exports.memory);let i=n.exports._start||n.exports.__wasi_command||n.exports.main||n.exports.run;if(!i)this.stdErr=`${this.script}: no entry point found (export _start, main, or run)`,this.exitCode=1;else try{await i()}catch(e){(!e||!e._wasmExit)&&(this.stdErr=`${this.script}: runtime error: ${e?.message||String(e)}`,this.exitCode=1)}}catch(e){(!e||!e._wasmExit)&&(this.stdErr=`${this.script}: ${e?.message||String(e)}`,this.exitCode=1)}a()}}})),K=t(((e,t)=>{var n=M(),r=class extends n{get name(){return`test`}get requiresFilesystem(){return!0}run(){let e=[...this.arguments];return e[e.length-1]===`]`&&e.pop(),this._evaluate(e)||(this.exitCode=1),Promise.resolve()}_evaluate(e){if(e.length===0)return!1;let t=e.indexOf(`-o`);if(t!==-1)return this._evaluate(e.slice(0,t))||this._evaluate(e.slice(t+1));let n=e.indexOf(`-a`);if(n!==-1)return this._evaluate(e.slice(0,n))&&this._evaluate(e.slice(n+1));if(e[0]===`!`)return!this._evaluate(e.slice(1));if(e.length===1)return e[0].length>0;if(e.length===2){let[t,n]=e;switch(t){case`-n`:return n.length>0;case`-z`:return n.length===0;case`-e`:return this.fs?this.fs.getFileByPath(n)!=null:!1;case`-f`:{if(!this.fs)return!1;let e=this.fs.getFileByPath(n);return e!=null&&e.constructor!==Object}case`-d`:{if(!this.fs)return!1;let e=this.fs.getFileByPath(n);return e!=null&&e.constructor===Object}case`-r`:{if(!this.fs)return!1;let e=this.fs.getMode(n);return e!==null&&(e&292)!=0}case`-w`:{if(!this.fs)return!1;let e=this.fs.getMode(n);return e!==null&&(e&146)!=0}case`-x`:{if(!this.fs)return!1;let e=this.fs.getMode(n);return e!==null&&(e&73)!=0}case`-s`:{if(!this.fs)return!1;let e=this.fs.getFileByPath(n);return e==null||e.constructor===Object?!1:e.toString().length>0}default:return!1}}if(e.length===3){let[t,n,r]=e;switch(n){case`=`:case`==`:return t===r;case`!=`:return t!==r;case`-eq`:return parseInt(t)===parseInt(r);case`-ne`:return parseInt(t)!==parseInt(r);case`-lt`:return parseInt(t)<parseInt(r);case`-le`:return parseInt(t)<=parseInt(r);case`-gt`:return parseInt(t)>parseInt(r);case`-ge`:return parseInt(t)>=parseInt(r);default:return!1}}return!1}},i=class extends r{get name(){return`[`}};Object.defineProperty(i,"name",{value:`[`}),t.exports={Test:r,TestBracket:i}})),q=t(((e,t)=>{var n=M();t.exports=class extends n{get requiresFilesystem(){return!0}run(){let e=!1,t=!1,n=!1,r=[];for(let i of this.arguments)if(i.startsWith(`-`)&&i.length>1)for(let r of i.slice(1))r===`n`?e=!0:r===`b`?(t=!0,e=!1):r===`s`&&(n=!0);else r.push(i);let i=[];if(r.length===0){let e=this.stdin;if(e==null)return this.stdErr=`cat: no file specified`,this.exitCode=1,Promise.resolve();i.push(e)}else for(let e of r){if(e===`-`){i.push(this.stdin||``);continue}let t=this.fs.getFileByPath(e);if(t==null)return this.stdErr=`${e}: No such file or directory`,this.exitCode=1,Promise.resolve();if(t.constructor===Object)return this.stdErr=`${e}: Is a directory`,this.exitCode=1,Promise.resolve();i.push(t.toString())}let a=i.join(``);a.endsWith(`
|
|
3
3
|
`)&&(a=a.slice(0,-1));let o=a.split(`
|
|
4
|
-
`);if(n&&(o=o.reduce((e,t)=>(t===``&&e.length>0&&e[e.length-1]===``||e.push(t),e),[])),t||e){let e=0;o=o.map(n=>t&&n===``?n:(e++,`${String(e).padStart(6)}\t${n}`))}return o.forEach(e=>this.stdOut=e),Promise.resolve()}}})),ce=t(((e,t)=>{function n(e){return typeof e==`object`&&!!e}function r(e){return n(e)&&typeof e.length==`number`}function i(e){return Array.isArray(e)?e:e===void 0?[]:r(e)||e instanceof Set?Array.from(e):[e]}t.exports=i})),le=t(((e,t)=>{function n(e,t,...n){let r=[];if(!Array.isArray(e))throw Error(`Input must be an array`);for(let[i,a]of e.entries()){let e=[];n.forEach(t=>{typeof t==`function`?e=e.concat(t(a)):e.push(t)}),t(a)&&r.push({index:i,replaceWithValue:e})}for(let t of r.reverse()){let n=[t.index,1].concat(t.replaceWithValue);e.splice.apply(e,n)}return e}t.exports=n})),ue=t((e=>{Object.defineProperty(e,`__esModule`,{value:!0});function t(e){return!isNaN(parseFloat(e))}function n(e){return!isNaN(parseFloat(e))&&isFinite(e)}function r(e){return typeof e==`object`&&!!e&&e.constructor===Object}function i(e){return a(e)&&typeof e.length==`number`}function a(e){return typeof e==`object`&&!!e}function o(e){return e!==void 0}function s(e){return!o(e)}function c(e){return e===null}function l(e){return o(e)&&!c(e)&&!Number.isNaN(e)}function u(e){return typeof e==`function`?/^class /.test(Function.prototype.toString.call(e)):!1}function d(e){if(e===null)return!0;switch(typeof e){case`string`:case`number`:case`symbol`:case`undefined`:case`boolean`:return!0;default:return!1}}function f(e){if(e){let t=o(Promise)&&e instanceof Promise,n=e.then&&typeof e.then==`function`;return!!(t||n)}else return!1}function p(e){return e===null||!o(e)?!1:typeof e[Symbol.iterator]==`function`||typeof e[Symbol.asyncIterator]==`function`}function m(e){return typeof e==`string`}function h(e){return typeof e==`function`}function g(e){return typeof e==`function`&&e.constructor.name===`AsyncFunction`}e.default={isNumber:t,isFiniteNumber:n,isPlainObject:r,isArrayLike:i,isObject:a,isDefined:o,isUndefined:s,isNull:c,isDefinedValue:l,isClass:u,isPrimitive:d,isPromise:f,isIterable:p,isString:m,isFunction:h,isAsyncFunction:g},e.isArrayLike=i,e.isAsyncFunction=g,e.isClass=u,e.isDefined=o,e.isDefinedValue=l,e.isFiniteNumber=n,e.isFunction=h,e.isIterable=p,e.isNull=c,e.isNumber=t,e.isObject=a,e.isPlainObject=r,e.isPrimitive=d,e.isPromise=f,e.isString=m,e.isUndefined=s})),de=t(((e,t)=>{r();var i=1/0,a=`[object Symbol]`,o=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,s=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,c=`\\ud800-\\udfff`,l=`\\u0300-\\u036f\\ufe20-\\ufe23`,u=`\\u20d0-\\u20f0`,d=`\\u2700-\\u27bf`,f=`a-z\\xdf-\\xf6\\xf8-\\xff`,p=`\\xac\\xb1\\xd7\\xf7`,m=`\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf`,h=`\\u2000-\\u206f`,g=` \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000`,_=`A-Z\\xc0-\\xd6\\xd8-\\xde`,v=`\\ufe0e\\ufe0f`,y=p+m+h+g,b=`['’]`,x=`[`+c+`]`,S=`[`+y+`]`,C=`[`+l+u+`]`,w=`\\d+`,T=`[`+d+`]`,E=`[`+f+`]`,D=`[^`+c+y+w+d+f+_+`]`,O=`\\ud83c[\\udffb-\\udfff]`,k=`(?:`+C+`|`+O+`)`,A=`[^`+c+`]`,j=`(?:\\ud83c[\\udde6-\\uddff]){2}`,M=`[\\ud800-\\udbff][\\udc00-\\udfff]`,N=`[`+_+`]`,P=`\\u200d`,F=`(?:`+E+`|`+D+`)`,I=`(?:`+N+`|`+D+`)`,L=`(?:`+b+`(?:d|ll|m|re|s|t|ve))?`,ee=`(?:`+b+`(?:D|LL|M|RE|S|T|VE))?`,R=k+`?`,z=`[`+v+`]?`,B=`(?:`+P+`(?:`+[A,j,M].join(`|`)+`)`+z+R+`)*`,V=z+R+B,H=`(?:`+[T,j,M].join(`|`)+`)`+V,U=`(?:`+[A+C+`?`,C,j,M,x].join(`|`)+`)`,W=RegExp(b,`g`),te=RegExp(C,`g`),ne=RegExp(O+`(?=`+O+`)|`+U+V,`g`),G=RegExp([N+`?`+E+`+`+L+`(?=`+[S,N,`$`].join(`|`)+`)`,I+`+`+ee+`(?=`+[S,N+F,`$`].join(`|`)+`)`,N+`?`+F+`+`+L,N+`+`+ee,w,H].join(`|`),`g`),re=RegExp(`[`+P+c+l+u+v+`]`),ie=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ae={À:`A`,Á:`A`,Â:`A`,Ã:`A`,Ä:`A`,Å:`A`,à:`a`,á:`a`,â:`a`,ã:`a`,ä:`a`,å:`a`,Ç:`C`,ç:`c`,Ð:`D`,ð:`d`,È:`E`,É:`E`,Ê:`E`,Ë:`E`,è:`e`,é:`e`,ê:`e`,ë:`e`,Ì:`I`,Í:`I`,Î:`I`,Ï:`I`,ì:`i`,í:`i`,î:`i`,ï:`i`,Ñ:`N`,ñ:`n`,Ò:`O`,Ó:`O`,Ô:`O`,Õ:`O`,Ö:`O`,Ø:`O`,ò:`o`,ó:`o`,ô:`o`,õ:`o`,ö:`o`,ø:`o`,Ù:`U`,Ú:`U`,Û:`U`,Ü:`U`,ù:`u`,ú:`u`,û:`u`,ü:`u`,Ý:`Y`,ý:`y`,ÿ:`y`,Æ:`Ae`,æ:`ae`,Þ:`Th`,þ:`th`,ß:`ss`,Ā:`A`,Ă:`A`,Ą:`A`,ā:`a`,ă:`a`,ą:`a`,Ć:`C`,Ĉ:`C`,Ċ:`C`,Č:`C`,ć:`c`,ĉ:`c`,ċ:`c`,č:`c`,Ď:`D`,Đ:`D`,ď:`d`,đ:`d`,Ē:`E`,Ĕ:`E`,Ė:`E`,Ę:`E`,Ě:`E`,ē:`e`,ĕ:`e`,ė:`e`,ę:`e`,ě:`e`,Ĝ:`G`,Ğ:`G`,Ġ:`G`,Ģ:`G`,ĝ:`g`,ğ:`g`,ġ:`g`,ģ:`g`,Ĥ:`H`,Ħ:`H`,ĥ:`h`,ħ:`h`,Ĩ:`I`,Ī:`I`,Ĭ:`I`,Į:`I`,İ:`I`,ĩ:`i`,ī:`i`,ĭ:`i`,į:`i`,ı:`i`,Ĵ:`J`,ĵ:`j`,Ķ:`K`,ķ:`k`,ĸ:`k`,Ĺ:`L`,Ļ:`L`,Ľ:`L`,Ŀ:`L`,Ł:`L`,ĺ:`l`,ļ:`l`,ľ:`l`,ŀ:`l`,ł:`l`,Ń:`N`,Ņ:`N`,Ň:`N`,Ŋ:`N`,ń:`n`,ņ:`n`,ň:`n`,ŋ:`n`,Ō:`O`,Ŏ:`O`,Ő:`O`,ō:`o`,ŏ:`o`,ő:`o`,Ŕ:`R`,Ŗ:`R`,Ř:`R`,ŕ:`r`,ŗ:`r`,ř:`r`,Ś:`S`,Ŝ:`S`,Ş:`S`,Š:`S`,ś:`s`,ŝ:`s`,ş:`s`,š:`s`,Ţ:`T`,Ť:`T`,Ŧ:`T`,ţ:`t`,ť:`t`,ŧ:`t`,Ũ:`U`,Ū:`U`,Ŭ:`U`,Ů:`U`,Ű:`U`,Ų:`U`,ũ:`u`,ū:`u`,ŭ:`u`,ů:`u`,ű:`u`,ų:`u`,Ŵ:`W`,ŵ:`w`,Ŷ:`Y`,ŷ:`y`,Ÿ:`Y`,Ź:`Z`,Ż:`Z`,Ž:`Z`,ź:`z`,ż:`z`,ž:`z`,IJ:`IJ`,ij:`ij`,Œ:`Oe`,œ:`oe`,ʼn:`'n`,ſ:`ss`},oe=typeof n==`object`&&n&&n.Object===Object&&n,se=typeof self==`object`&&self&&self.Object===Object&&self,K=oe||se||Function(`return this`)();function q(e,t,n,r){var i=-1,a=e?e.length:0;for(r&&a&&(n=e[++i]);++i<a;)n=t(n,e[i],i,e);return n}function ce(e){return e.split(``)}function le(e){return e.match(o)||[]}function ue(e){return function(t){return e?.[t]}}var de=ue(ae);function fe(e){return re.test(e)}function pe(e){return ie.test(e)}function me(e){return fe(e)?J(e):ce(e)}function J(e){return e.match(ne)||[]}function he(e){return e.match(G)||[]}var ge=Object.prototype.toString,Y=K.Symbol,_e=Y?Y.prototype:void 0,ve=_e?_e.toString:void 0;function ye(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),n=n>i?i:n,n<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var a=Array(i);++r<i;)a[r]=e[r+t];return a}function be(e){if(typeof e==`string`)return e;if(Te(e))return ve?ve.call(e):``;var t=e+``;return t==`0`&&1/e==-i?`-0`:t}function xe(e,t,n){var r=e.length;return n=n===void 0?r:n,!t&&n>=r?e:ye(e,t,n)}function Se(e){return function(t){t=Ee(t);var n=fe(t)?me(t):void 0,r=n?n[0]:t.charAt(0),i=n?xe(n,1).join(``):t.slice(1);return r[e]()+i}}function Ce(e){return function(t){return q(je(ke(t).replace(W,``)),e,``)}}function we(e){return!!e&&typeof e==`object`}function Te(e){return typeof e==`symbol`||we(e)&&ge.call(e)==a}function Ee(e){return e==null?``:be(e)}var De=Ce(function(e,t,n){return t=t.toLowerCase(),e+(n?Oe(t):t)});function Oe(e){return Ae(Ee(e).toLowerCase())}function ke(e){return e=Ee(e),e&&e.replace(s,de).replace(te,``)}var Ae=Se(`toUpperCase`);function je(e,t,n){return e=Ee(e),t=n?void 0:t,t===void 0?pe(e)?he(e):le(e):e.match(t)||[]}t.exports=De})),fe=t(((e,t)=>{T();var n=ce(),r=le(),i=ue(),a=de(),o={short:/^-([^\d-])$/,long:/^--(\S+)/,combinedShort:/^-[^\d-]{2,}$/,optEquals:/^(--\S+?)=(.*)/},s=class extends Array{load(e){if(this.clear(),e&&e!==w.argv)e=n(e);else{e=w.argv.slice(0);let t=w.execArgv.some(m)?1:2;e.splice(0,t)}e.forEach(e=>this.push(String(e)))}clear(){this.length=0}expandOptionEqualsNotation(){if(this.some(e=>o.optEquals.test(e))){let e=[];this.forEach(t=>{let n=t.match(o.optEquals);n?e.push(n[1],n[2]):e.push(t)}),this.clear(),this.load(e)}}expandGetoptNotation(){this.hasCombinedShortOptions()&&r(this,o.combinedShort,c)}hasCombinedShortOptions(){return this.some(e=>o.combinedShort.test(e))}static from(e){let t=new this;return t.load(e),t}};function c(e){return e=e.slice(1),e.split(``).map(e=>`-`+e)}function l(e){return o.optEquals.test(e)}function u(e){return(o.short.test(e)||o.long.test(e))&&!o.optEquals.test(e)}function d(e){return o.long.test(e)&&!l(e)}function f(e){return o.short.test(e)?e.match(o.short)[1]:d(e)?e.match(o.long)[1]:l(e)?e.match(o.optEquals)[1].replace(/^--/,``):null}function p(e){return!(u(e)||o.combinedShort.test(e)||o.optEquals.test(e))}function m(e){return[`--eval`,`-e`].indexOf(e)>-1||e.startsWith(`--eval=`)}var h=class{constructor(e){this.name=e.name,this.type=e.type||String,this.alias=e.alias,this.multiple=e.multiple,this.lazyMultiple=e.lazyMultiple,this.defaultOption=e.defaultOption,this.defaultValue=e.defaultValue,this.group=e.group;for(let t in e)this[t]||(this[t]=e[t])}isBoolean(){return this.type===Boolean||i.isFunction(this.type)&&this.type.name===`Boolean`}isMultiple(){return this.multiple||this.lazyMultiple}static create(e){return new this(e)}},g=class extends Array{validate(e){this.some(e=>!e.name)&&_(`INVALID_DEFINITIONS`,"Invalid option definitions: the `name` property is required on each definition"),this.some(e=>e.type&&typeof e.type!=`function`)&&_(`INVALID_DEFINITIONS`,"Invalid option definitions: the `type` property must be a setter fuction (default: `Boolean`)");let t;this.some(e=>(t=e,i.isDefined(e.alias)&&i.isNumber(e.alias)))&&_(`INVALID_DEFINITIONS`,`Invalid option definition: to avoid ambiguity an alias cannot be numeric [--`+t.name+` alias is -`+t.alias+`]`),this.some(e=>(t=e,i.isDefined(e.alias)&&e.alias.length!==1))&&_(`INVALID_DEFINITIONS`,`Invalid option definition: an alias must be a single character`),this.some(e=>(t=e,e.alias===`-`))&&_(`INVALID_DEFINITIONS`,`Invalid option definition: an alias cannot be "-"`),y(this.map(t=>e?t.name.toLowerCase():t.name))&&_(`INVALID_DEFINITIONS`,`Two or more option definitions have the same name`),y(this.map(t=>e&&i.isDefined(t.alias)?t.alias.toLowerCase():t.alias))&&_(`INVALID_DEFINITIONS`,`Two or more option definitions have the same alias`),this.filter(e=>e.defaultOption===!0).length>1&&_(`INVALID_DEFINITIONS`,`Only one option definition can be the defaultOption`),this.some(e=>(t=e,e.isBoolean()&&e.defaultOption))&&_(`INVALID_DEFINITIONS`,`A boolean option ["${t.name}"] can not also be the defaultOption.`)}get(e,t){if(u(e))if(o.short.test(e)){let n=f(e);if(t){let e=n.toLowerCase();return this.find(t=>i.isDefined(t.alias)&&t.alias.toLowerCase()===e)}else return this.find(e=>e.alias===n)}else{let n=f(e);if(t){let e=n.toLowerCase();return this.find(t=>t.name.toLowerCase()===e)}else return this.find(e=>e.name===n)}else return this.find(t=>t.name===e)}getDefault(){return this.find(e=>e.defaultOption===!0)}isGrouped(){return this.some(e=>e.group)}whereGrouped(){return this.filter(v)}whereNotGrouped(){return this.filter(e=>!v(e))}whereDefaultValueSet(){return this.filter(e=>i.isDefined(e.defaultValue))}static from(e,t){if(e instanceof this)return e;let r=super.from(n(e),e=>h.create(e));return r.validate(t),r}};function _(e,t){let n=Error(t);throw n.name=e,n}function v(e){return n(e.group).some(e=>e)}function y(e){let t={};for(let n=0;n<e.length;n++){let r=e[n];if(t[r])return!0;i.isDefined(r)&&(t[r]=!0)}}var b=class{constructor(e,t){this.options=Object.assign({},t),this.definitions=g.from(e,this.options.caseInsensitive),this.argv=s.from(this.options.argv),this.argv.hasCombinedShortOptions()&&r(this.argv,o.combinedShort.test.bind(o.combinedShort),e=>(e=e.slice(1),e.split(``).map(t=>({origArg:`-${e}`,arg:`-`+t}))))}*[Symbol.iterator](){let e=this.definitions,t,n,r,a,s=!1,c=!1,d;for(let f of this.argv){if(i.isPlainObject(f)&&(d=f.origArg,f=f.arg),c&&this.options.stopAtFirstUnknown){yield{event:`unknown_value`,arg:f,name:`_unknown`,value:void 0};continue}if(u(f))t=e.get(f,this.options.caseInsensitive),n=void 0,t?(n=t.isBoolean()?!0:null,a=`set`):a=`unknown_option`;else if(l(f)){let r=f.match(o.optEquals);t=e.get(r[1],this.options.caseInsensitive),t?t.isBoolean()?(yield{event:`unknown_value`,arg:f,name:`_unknown`,value:n,def:t},a=`set`,n=!0):(a=`set`,n=r[2]):a=`unknown_option`}else p(f)&&(t?(n=f,a=`set`):(t=this.definitions.getDefault(),t&&!s?(n=f,a=`set`):(a=`unknown_value`,t=void 0)));r=t?t.name:`_unknown`;let m={event:a,arg:f,name:r,value:n,def:t};d&&(m.subArg=f,m.arg=d),yield m,r===`_unknown`&&(c=!0),t&&t.defaultOption&&!t.isMultiple()&&a===`set`&&(s=!0),t&&t.isBoolean()&&(t=void 0),t&&!t.multiple&&i.isDefined(n)&&n!==null&&(t=void 0),n=void 0,a=void 0,r=void 0,d=void 0}}},x=new WeakMap,S=class{constructor(e){this.definition=new h(e),this.state=null,this.resetToDefault()}get(){return x.get(this)}set(e){this._set(e,`set`)}_set(e,t){let n=this.definition;if(n.isMultiple()){if(e!=null){let r=this.get();this.state===`default`&&(r.length=0),r.push(n.type(e)),this.state=t}}else if(!n.isMultiple()&&this.state===`set`){let t=Error(`Singular option already set [${this.definition.name}=${this.get()}]`);throw t.name=`ALREADY_SET`,t.value=e,t.optionName=n.name,t}else e==null?x.set(this,e):(x.set(this,n.type(e)),this.state=t)}resetToDefault(){i.isDefined(this.definition.defaultValue)?this.definition.isMultiple()?x.set(this,n(this.definition.defaultValue).slice()):x.set(this,this.definition.defaultValue):this.definition.isMultiple()?x.set(this,[]):x.set(this,null),this.state=`default`}static create(e){return e=new h(e),e.isBoolean()?C.create(e):new this(e)}},C=class extends S{set(e){super.set(!0)}static create(e){return new this(e)}},E=class extends Map{constructor(e){super(),this.definitions=g.from(e),this.set(`_unknown`,S.create({name:`_unknown`,multiple:!0}));for(let e of this.definitions.whereDefaultValueSet())this.set(e.name,S.create(e))}toObject(e){e||={};let t={};for(let n of this){let r=e.camelCase&&n[0]!==`_unknown`?a(n[0]):n[0],i=n[1];r===`_unknown`&&!i.get().length||(t[r]=i.get())}return e.skipUnknown&&delete t._unknown,t}},D=class extends E{toObject(e){let t=super.toObject({skipUnknown:e.skipUnknown}),r=super.toObject(e),o=r._unknown;delete r._unknown;let s={_all:r};return o&&o.length&&(s._unknown=o),this.definitions.whereGrouped().forEach(r=>{let o=e.camelCase?a(r.name):r.name,c=t[r.name];for(let e of n(r.group))s[e]=s[e]||{},i.isDefined(c)&&(s[e][o]=c)}),this.definitions.whereNotGrouped().forEach(n=>{let r=e.camelCase?a(n.name):n.name,o=t[n.name];i.isDefined(o)&&(s._none||={},s._none[r]=o)}),s}};function O(e,t){t||={},t.stopAtFirstUnknown&&(t.partial=!0),e=g.from(e,t.caseInsensitive);let n=new b(e,{argv:t.argv,stopAtFirstUnknown:t.stopAtFirstUnknown,caseInsensitive:t.caseInsensitive}),r=new(e.isGrouped()?D:E)(e);for(let e of n){let n=e.subArg||e.arg;if(!t.partial){if(e.event===`unknown_value`){let e=Error(`Unknown value: ${n}`);throw e.name=`UNKNOWN_VALUE`,e.value=n,e}else if(e.event===`unknown_option`){let e=Error(`Unknown option: ${n}`);throw e.name=`UNKNOWN_OPTION`,e.optionName=n,e}}let i;r.has(e.name)?i=r.get(e.name):(i=S.create(e.def),r.set(e.name,i)),e.name===`_unknown`?i.set(n):i.set(e.value)}return r.toObject({skipUnknown:!t.partial,camelCase:t.camelCase})}t.exports=O})),pe=t(((e,t)=>{var n=M(),r=fe();t.exports=class extends n{get requiresFilesystem(){return!0}run(){let e=this.arguments.filter(e=>e!==`-1`),t=e.length!==this.arguments.length,n;try{n=this.parseArgs(e)}catch(e){return this.printHelp(e),Promise.reject()}if(n.one=n.one||t,n.help)return this.printHelp(),Promise.resolve();let r=this.fs.getFileByPath(n.path);if(!r)return Promise.reject(`${n.path}: No such file or directory`);if(r.constructor===Object){let e=r;n.all||(e=Object.entries(e).reduce((e,[t,n])=>(t.startsWith(`.`)||(e[t]=n),e),{}));let t=this.fs.absolutePath(n.path);return n.long?this.printLong(e,t):n.one?Object.entries(e).forEach(([e,t])=>{this.stdOut=this._applyIndicator(e,t,n.classify)}):this.printSimple(e,n.classify),n.recursive&&Object.entries(e).forEach(([e,r])=>{if(r&&r.constructor===Object){let r=t.endsWith(`/`)?t+e:t+`/`+e;this.stdOut=``,this.stdOut=r+`:`,this.run.call(Object.create(this,{arguments:{value:[...this.arguments.filter(e=>e!==n.path&&e!==`./`),r]}}))}}),Promise.resolve()}return Promise.resolve(n.path)}printHelp(e){e&&(this.stdOut=e.message),this.stdOut=`usage: ls [-alRF1h] [file ...]`}printSimple(e,t){this.stdOut=Object.entries(e).reduce((e,[n,r])=>e+this.padString(this._applyIndicator(n,r,t)),``)}printLong(e,t){Object.entries(e).forEach(([e,n])=>{let r=t+`/`+e,i=n!=null&&n.constructor===Object,a=this.fs.getMode(r),o=a===null?i?493:420:a,s=this._modeToString(o,i),c=this.fs.getSize(r);return this.stdOut=`${s} root users ${this.padString(c,10)} ${e}`})}_applyIndicator(e,t,n){return n?t&&t.constructor===Object?e+`/`:typeof t==`function`||this.fs.isExecutable(e)?e+`*`:e:e}_modeToString(e,t){return(t?`d`:`-`)+(e&256?`r`:`-`)+(e&128?`w`:`-`)+(e&64?`x`:`-`)+(e&32?`r`:`-`)+(e&16?`w`:`-`)+(e&8?`x`:`-`)+(e&4?`r`:`-`)+(e&2?`w`:`-`)+(e&1?`x`:`-`)}padString(e,t=16){let n=t-e.toString().length,r=``;for(let e=0;e<n;e++)r+=` `;return e.toString()+r}parseArgs(e=this.arguments){return r([{name:`path`,defaultOption:!0,defaultValue:`./`,type:String},{name:`all`,alias:`a`,type:Boolean},{name:`long`,alias:`l`,type:Boolean},{name:`recursive`,alias:`R`,type:Boolean},{name:`one`,type:Boolean},{name:`classify`,alias:`F`,type:Boolean},{name:`help`,alias:`h`,type:Boolean}],{argv:e})}}})),me=t(((e,t)=>{var n=M();t.exports=class extends n{run(){let e=[...this.arguments],t=!1,n=!1;for(;e.length>0&&/^-[neE]+$/.test(e[0]);){let r=e.shift();r.includes(`n`)&&(t=!0),r.includes(`e`)&&(n=!0),r===`-E`&&(n=!1)}let r=e.join(` `);return n&&(r=r.replace(/\\c.*$/s,()=>(t=!0,``)).replace(/\\0([0-7]{1,3})/g,(e,t)=>String.fromCharCode(parseInt(t,8))).replace(/\\x([0-9a-fA-F]{1,2})/g,(e,t)=>String.fromCharCode(parseInt(t,16))).replace(/\\n/g,`
|
|
4
|
+
`);if(n&&(o=o.reduce((e,t)=>(t===``&&e.length>0&&e[e.length-1]===``||e.push(t),e),[])),t||e){let e=0;o=o.map(n=>t&&n===``?n:(e++,`${String(e).padStart(6)}\t${n}`))}return o.forEach(e=>this.stdOut=e),Promise.resolve()}}})),ce=t(((e,t)=>{function n(e){return typeof e==`object`&&!!e}function r(e){return n(e)&&typeof e.length==`number`}function i(e){return Array.isArray(e)?e:e===void 0?[]:r(e)||e instanceof Set?Array.from(e):[e]}t.exports=i})),le=t(((e,t)=>{function n(e,t,...n){let r=[];if(!Array.isArray(e))throw Error(`Input must be an array`);for(let[i,a]of e.entries()){let e=[];n.forEach(t=>{typeof t==`function`?e=e.concat(t(a)):e.push(t)}),t(a)&&r.push({index:i,replaceWithValue:e})}for(let t of r.reverse()){let n=[t.index,1].concat(t.replaceWithValue);e.splice.apply(e,n)}return e}t.exports=n})),ue=t((e=>{Object.defineProperty(e,"__esModule",{value:!0});function t(e){return!isNaN(parseFloat(e))}function n(e){return!isNaN(parseFloat(e))&&isFinite(e)}function r(e){return typeof e==`object`&&!!e&&e.constructor===Object}function i(e){return a(e)&&typeof e.length==`number`}function a(e){return typeof e==`object`&&!!e}function o(e){return e!==void 0}function s(e){return!o(e)}function c(e){return e===null}function l(e){return o(e)&&!c(e)&&!Number.isNaN(e)}function u(e){return typeof e==`function`?/^class /.test(Function.prototype.toString.call(e)):!1}function d(e){if(e===null)return!0;switch(typeof e){case`string`:case`number`:case`symbol`:case`undefined`:case`boolean`:return!0;default:return!1}}function f(e){if(e){let t=o(Promise)&&e instanceof Promise,n=e.then&&typeof e.then==`function`;return!!(t||n)}else return!1}function p(e){return e===null||!o(e)?!1:typeof e[Symbol.iterator]==`function`||typeof e[Symbol.asyncIterator]==`function`}function m(e){return typeof e==`string`}function h(e){return typeof e==`function`}function g(e){return typeof e==`function`&&e.constructor.name===`AsyncFunction`}e.default={isNumber:t,isFiniteNumber:n,isPlainObject:r,isArrayLike:i,isObject:a,isDefined:o,isUndefined:s,isNull:c,isDefinedValue:l,isClass:u,isPrimitive:d,isPromise:f,isIterable:p,isString:m,isFunction:h,isAsyncFunction:g},e.isArrayLike=i,e.isAsyncFunction=g,e.isClass=u,e.isDefined=o,e.isDefinedValue=l,e.isFiniteNumber=n,e.isFunction=h,e.isIterable=p,e.isNull=c,e.isNumber=t,e.isObject=a,e.isPlainObject=r,e.isPrimitive=d,e.isPromise=f,e.isString=m,e.isUndefined=s})),de=t(((e,t)=>{r();var i=1/0,a=`[object Symbol]`,o=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,s=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,c=`\\ud800-\\udfff`,l=`\\u0300-\\u036f\\ufe20-\\ufe23`,u=`\\u20d0-\\u20f0`,d=`\\u2700-\\u27bf`,f=`a-z\\xdf-\\xf6\\xf8-\\xff`,p=`\\xac\\xb1\\xd7\\xf7`,m=`\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf`,h=`\\u2000-\\u206f`,g=` \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000`,_=`A-Z\\xc0-\\xd6\\xd8-\\xde`,v=`\\ufe0e\\ufe0f`,y=p+m+h+g,b=`['’]`,x=`[`+c+`]`,S=`[`+y+`]`,C=`[`+l+u+`]`,w=`\\d+`,T=`[`+d+`]`,E=`[`+f+`]`,D=`[^`+c+y+w+d+f+_+`]`,O=`\\ud83c[\\udffb-\\udfff]`,k=`(?:`+C+`|`+O+`)`,A=`[^`+c+`]`,j=`(?:\\ud83c[\\udde6-\\uddff]){2}`,M=`[\\ud800-\\udbff][\\udc00-\\udfff]`,N=`[`+_+`]`,P=`\\u200d`,F=`(?:`+E+`|`+D+`)`,I=`(?:`+N+`|`+D+`)`,L=`(?:`+b+`(?:d|ll|m|re|s|t|ve))?`,ee=`(?:`+b+`(?:D|LL|M|RE|S|T|VE))?`,R=k+`?`,z=`[`+v+`]?`,B=`(?:`+P+`(?:`+[A,j,M].join(`|`)+`)`+z+R+`)*`,V=z+R+B,H=`(?:`+[T,j,M].join(`|`)+`)`+V,U=`(?:`+[A+C+`?`,C,j,M,x].join(`|`)+`)`,W=RegExp(b,`g`),te=RegExp(C,`g`),ne=RegExp(O+`(?=`+O+`)|`+U+V,`g`),G=RegExp([N+`?`+E+`+`+L+`(?=`+[S,N,`$`].join(`|`)+`)`,I+`+`+ee+`(?=`+[S,N+F,`$`].join(`|`)+`)`,N+`?`+F+`+`+L,N+`+`+ee,w,H].join(`|`),`g`),re=RegExp(`[`+P+c+l+u+v+`]`),ie=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ae={À:`A`,Á:`A`,Â:`A`,Ã:`A`,Ä:`A`,Å:`A`,à:`a`,á:`a`,â:`a`,ã:`a`,ä:`a`,å:`a`,Ç:`C`,ç:`c`,Ð:`D`,ð:`d`,È:`E`,É:`E`,Ê:`E`,Ë:`E`,è:`e`,é:`e`,ê:`e`,ë:`e`,Ì:`I`,Í:`I`,Î:`I`,Ï:`I`,ì:`i`,í:`i`,î:`i`,ï:`i`,Ñ:`N`,ñ:`n`,Ò:`O`,Ó:`O`,Ô:`O`,Õ:`O`,Ö:`O`,Ø:`O`,ò:`o`,ó:`o`,ô:`o`,õ:`o`,ö:`o`,ø:`o`,Ù:`U`,Ú:`U`,Û:`U`,Ü:`U`,ù:`u`,ú:`u`,û:`u`,ü:`u`,Ý:`Y`,ý:`y`,ÿ:`y`,Æ:`Ae`,æ:`ae`,Þ:`Th`,þ:`th`,ß:`ss`,Ā:`A`,Ă:`A`,Ą:`A`,ā:`a`,ă:`a`,ą:`a`,Ć:`C`,Ĉ:`C`,Ċ:`C`,Č:`C`,ć:`c`,ĉ:`c`,ċ:`c`,č:`c`,Ď:`D`,Đ:`D`,ď:`d`,đ:`d`,Ē:`E`,Ĕ:`E`,Ė:`E`,Ę:`E`,Ě:`E`,ē:`e`,ĕ:`e`,ė:`e`,ę:`e`,ě:`e`,Ĝ:`G`,Ğ:`G`,Ġ:`G`,Ģ:`G`,ĝ:`g`,ğ:`g`,ġ:`g`,ģ:`g`,Ĥ:`H`,Ħ:`H`,ĥ:`h`,ħ:`h`,Ĩ:`I`,Ī:`I`,Ĭ:`I`,Į:`I`,İ:`I`,ĩ:`i`,ī:`i`,ĭ:`i`,į:`i`,ı:`i`,Ĵ:`J`,ĵ:`j`,Ķ:`K`,ķ:`k`,ĸ:`k`,Ĺ:`L`,Ļ:`L`,Ľ:`L`,Ŀ:`L`,Ł:`L`,ĺ:`l`,ļ:`l`,ľ:`l`,ŀ:`l`,ł:`l`,Ń:`N`,Ņ:`N`,Ň:`N`,Ŋ:`N`,ń:`n`,ņ:`n`,ň:`n`,ŋ:`n`,Ō:`O`,Ŏ:`O`,Ő:`O`,ō:`o`,ŏ:`o`,ő:`o`,Ŕ:`R`,Ŗ:`R`,Ř:`R`,ŕ:`r`,ŗ:`r`,ř:`r`,Ś:`S`,Ŝ:`S`,Ş:`S`,Š:`S`,ś:`s`,ŝ:`s`,ş:`s`,š:`s`,Ţ:`T`,Ť:`T`,Ŧ:`T`,ţ:`t`,ť:`t`,ŧ:`t`,Ũ:`U`,Ū:`U`,Ŭ:`U`,Ů:`U`,Ű:`U`,Ų:`U`,ũ:`u`,ū:`u`,ŭ:`u`,ů:`u`,ű:`u`,ų:`u`,Ŵ:`W`,ŵ:`w`,Ŷ:`Y`,ŷ:`y`,Ÿ:`Y`,Ź:`Z`,Ż:`Z`,Ž:`Z`,ź:`z`,ż:`z`,ž:`z`,IJ:`IJ`,ij:`ij`,Œ:`Oe`,œ:`oe`,ʼn:`'n`,ſ:`ss`},oe=typeof n==`object`&&n&&n.Object===Object&&n,se=typeof self==`object`&&self&&self.Object===Object&&self,K=oe||se||Function(`return this`)();function q(e,t,n,r){var i=-1,a=e?e.length:0;for(r&&a&&(n=e[++i]);++i<a;)n=t(n,e[i],i,e);return n}function ce(e){return e.split(``)}function le(e){return e.match(o)||[]}function ue(e){return function(t){return e?.[t]}}var de=ue(ae);function fe(e){return re.test(e)}function pe(e){return ie.test(e)}function me(e){return fe(e)?J(e):ce(e)}function J(e){return e.match(ne)||[]}function he(e){return e.match(G)||[]}var ge=Object.prototype.toString,Y=K.Symbol,_e=Y?Y.prototype:void 0,ve=_e?_e.toString:void 0;function ye(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),n=n>i?i:n,n<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var a=Array(i);++r<i;)a[r]=e[r+t];return a}function be(e){if(typeof e==`string`)return e;if(Te(e))return ve?ve.call(e):``;var t=e+``;return t==`0`&&1/e==-i?`-0`:t}function xe(e,t,n){var r=e.length;return n=n===void 0?r:n,!t&&n>=r?e:ye(e,t,n)}function Se(e){return function(t){t=Ee(t);var n=fe(t)?me(t):void 0,r=n?n[0]:t.charAt(0),i=n?xe(n,1).join(``):t.slice(1);return r[e]()+i}}function Ce(e){return function(t){return q(je(ke(t).replace(W,``)),e,``)}}function we(e){return!!e&&typeof e==`object`}function Te(e){return typeof e==`symbol`||we(e)&&ge.call(e)==a}function Ee(e){return e==null?``:be(e)}var De=Ce(function(e,t,n){return t=t.toLowerCase(),e+(n?Oe(t):t)});function Oe(e){return Ae(Ee(e).toLowerCase())}function ke(e){return e=Ee(e),e&&e.replace(s,de).replace(te,``)}var Ae=Se(`toUpperCase`);function je(e,t,n){return e=Ee(e),t=n?void 0:t,t===void 0?pe(e)?he(e):le(e):e.match(t)||[]}t.exports=De})),fe=t(((e,t)=>{w();var n=ce(),r=le(),i=ue(),a=de(),o={short:/^-([^\d-])$/,long:/^--(\S+)/,combinedShort:/^-[^\d-]{2,}$/,optEquals:/^(--\S+?)=(.*)/},s=class extends Array{load(e){if(this.clear(),e&&e!==C.argv)e=n(e);else{e=C.argv.slice(0);let t=C.execArgv.some(m)?1:2;e.splice(0,t)}e.forEach(e=>this.push(String(e)))}clear(){this.length=0}expandOptionEqualsNotation(){if(this.some(e=>o.optEquals.test(e))){let e=[];this.forEach(t=>{let n=t.match(o.optEquals);n?e.push(n[1],n[2]):e.push(t)}),this.clear(),this.load(e)}}expandGetoptNotation(){this.hasCombinedShortOptions()&&r(this,o.combinedShort,c)}hasCombinedShortOptions(){return this.some(e=>o.combinedShort.test(e))}static from(e){let t=new this;return t.load(e),t}};function c(e){return e=e.slice(1),e.split(``).map(e=>`-`+e)}function l(e){return o.optEquals.test(e)}function u(e){return(o.short.test(e)||o.long.test(e))&&!o.optEquals.test(e)}function d(e){return o.long.test(e)&&!l(e)}function f(e){return o.short.test(e)?e.match(o.short)[1]:d(e)?e.match(o.long)[1]:l(e)?e.match(o.optEquals)[1].replace(/^--/,``):null}function p(e){return!(u(e)||o.combinedShort.test(e)||o.optEquals.test(e))}function m(e){return[`--eval`,`-e`].indexOf(e)>-1||e.startsWith(`--eval=`)}var h=class{constructor(e){this.name=e.name,this.type=e.type||String,this.alias=e.alias,this.multiple=e.multiple,this.lazyMultiple=e.lazyMultiple,this.defaultOption=e.defaultOption,this.defaultValue=e.defaultValue,this.group=e.group;for(let t in e)this[t]||(this[t]=e[t])}isBoolean(){return this.type===Boolean||i.isFunction(this.type)&&this.type.name===`Boolean`}isMultiple(){return this.multiple||this.lazyMultiple}static create(e){return new this(e)}},g=class extends Array{validate(e){this.some(e=>!e.name)&&_(`INVALID_DEFINITIONS`,"Invalid option definitions: the `name` property is required on each definition"),this.some(e=>e.type&&typeof e.type!=`function`)&&_(`INVALID_DEFINITIONS`,"Invalid option definitions: the `type` property must be a setter fuction (default: `Boolean`)");let t;this.some(e=>(t=e,i.isDefined(e.alias)&&i.isNumber(e.alias)))&&_(`INVALID_DEFINITIONS`,`Invalid option definition: to avoid ambiguity an alias cannot be numeric [--`+t.name+` alias is -`+t.alias+`]`),this.some(e=>(t=e,i.isDefined(e.alias)&&e.alias.length!==1))&&_(`INVALID_DEFINITIONS`,`Invalid option definition: an alias must be a single character`),this.some(e=>(t=e,e.alias===`-`))&&_(`INVALID_DEFINITIONS`,`Invalid option definition: an alias cannot be "-"`),y(this.map(t=>e?t.name.toLowerCase():t.name))&&_(`INVALID_DEFINITIONS`,`Two or more option definitions have the same name`),y(this.map(t=>e&&i.isDefined(t.alias)?t.alias.toLowerCase():t.alias))&&_(`INVALID_DEFINITIONS`,`Two or more option definitions have the same alias`),this.filter(e=>e.defaultOption===!0).length>1&&_(`INVALID_DEFINITIONS`,`Only one option definition can be the defaultOption`),this.some(e=>(t=e,e.isBoolean()&&e.defaultOption))&&_(`INVALID_DEFINITIONS`,`A boolean option ["${t.name}"] can not also be the defaultOption.`)}get(e,t){if(u(e))if(o.short.test(e)){let n=f(e);if(t){let e=n.toLowerCase();return this.find(t=>i.isDefined(t.alias)&&t.alias.toLowerCase()===e)}else return this.find(e=>e.alias===n)}else{let n=f(e);if(t){let e=n.toLowerCase();return this.find(t=>t.name.toLowerCase()===e)}else return this.find(e=>e.name===n)}else return this.find(t=>t.name===e)}getDefault(){return this.find(e=>e.defaultOption===!0)}isGrouped(){return this.some(e=>e.group)}whereGrouped(){return this.filter(v)}whereNotGrouped(){return this.filter(e=>!v(e))}whereDefaultValueSet(){return this.filter(e=>i.isDefined(e.defaultValue))}static from(e,t){if(e instanceof this)return e;let r=super.from(n(e),e=>h.create(e));return r.validate(t),r}};function _(e,t){let n=Error(t);throw n.name=e,n}function v(e){return n(e.group).some(e=>e)}function y(e){let t={};for(let n=0;n<e.length;n++){let r=e[n];if(t[r])return!0;i.isDefined(r)&&(t[r]=!0)}}var b=class{constructor(e,t){this.options=Object.assign({},t),this.definitions=g.from(e,this.options.caseInsensitive),this.argv=s.from(this.options.argv),this.argv.hasCombinedShortOptions()&&r(this.argv,o.combinedShort.test.bind(o.combinedShort),e=>(e=e.slice(1),e.split(``).map(t=>({origArg:`-${e}`,arg:`-`+t}))))}*[Symbol.iterator](){let e=this.definitions,t,n,r,a,s=!1,c=!1,d;for(let f of this.argv){if(i.isPlainObject(f)&&(d=f.origArg,f=f.arg),c&&this.options.stopAtFirstUnknown){yield{event:`unknown_value`,arg:f,name:`_unknown`,value:void 0};continue}if(u(f))t=e.get(f,this.options.caseInsensitive),n=void 0,t?(n=t.isBoolean()?!0:null,a=`set`):a=`unknown_option`;else if(l(f)){let r=f.match(o.optEquals);t=e.get(r[1],this.options.caseInsensitive),t?t.isBoolean()?(yield{event:`unknown_value`,arg:f,name:`_unknown`,value:n,def:t},a=`set`,n=!0):(a=`set`,n=r[2]):a=`unknown_option`}else p(f)&&(t?(n=f,a=`set`):(t=this.definitions.getDefault(),t&&!s?(n=f,a=`set`):(a=`unknown_value`,t=void 0)));r=t?t.name:`_unknown`;let m={event:a,arg:f,name:r,value:n,def:t};d&&(m.subArg=f,m.arg=d),yield m,r===`_unknown`&&(c=!0),t&&t.defaultOption&&!t.isMultiple()&&a===`set`&&(s=!0),t&&t.isBoolean()&&(t=void 0),t&&!t.multiple&&i.isDefined(n)&&n!==null&&(t=void 0),n=void 0,a=void 0,r=void 0,d=void 0}}},x=new WeakMap,S=class{constructor(e){this.definition=new h(e),this.state=null,this.resetToDefault()}get(){return x.get(this)}set(e){this._set(e,`set`)}_set(e,t){let n=this.definition;if(n.isMultiple()){if(e!=null){let r=this.get();this.state===`default`&&(r.length=0),r.push(n.type(e)),this.state=t}}else if(!n.isMultiple()&&this.state===`set`){let t=Error(`Singular option already set [${this.definition.name}=${this.get()}]`);throw t.name=`ALREADY_SET`,t.value=e,t.optionName=n.name,t}else e==null?x.set(this,e):(x.set(this,n.type(e)),this.state=t)}resetToDefault(){i.isDefined(this.definition.defaultValue)?this.definition.isMultiple()?x.set(this,n(this.definition.defaultValue).slice()):x.set(this,this.definition.defaultValue):this.definition.isMultiple()?x.set(this,[]):x.set(this,null),this.state=`default`}static create(e){return e=new h(e),e.isBoolean()?T.create(e):new this(e)}},T=class extends S{set(e){super.set(!0)}static create(e){return new this(e)}},E=class extends Map{constructor(e){super(),this.definitions=g.from(e),this.set(`_unknown`,S.create({name:`_unknown`,multiple:!0}));for(let e of this.definitions.whereDefaultValueSet())this.set(e.name,S.create(e))}toObject(e){e||={};let t={};for(let n of this){let r=e.camelCase&&n[0]!==`_unknown`?a(n[0]):n[0],i=n[1];r===`_unknown`&&!i.get().length||(t[r]=i.get())}return e.skipUnknown&&delete t._unknown,t}},D=class extends E{toObject(e){let t=super.toObject({skipUnknown:e.skipUnknown}),r=super.toObject(e),o=r._unknown;delete r._unknown;let s={_all:r};return o&&o.length&&(s._unknown=o),this.definitions.whereGrouped().forEach(r=>{let o=e.camelCase?a(r.name):r.name,c=t[r.name];for(let e of n(r.group))s[e]=s[e]||{},i.isDefined(c)&&(s[e][o]=c)}),this.definitions.whereNotGrouped().forEach(n=>{let r=e.camelCase?a(n.name):n.name,o=t[n.name];i.isDefined(o)&&(s._none||={},s._none[r]=o)}),s}};function O(e,t){t||={},t.stopAtFirstUnknown&&(t.partial=!0),e=g.from(e,t.caseInsensitive);let n=new b(e,{argv:t.argv,stopAtFirstUnknown:t.stopAtFirstUnknown,caseInsensitive:t.caseInsensitive}),r=new(e.isGrouped()?D:E)(e);for(let e of n){let n=e.subArg||e.arg;if(!t.partial){if(e.event===`unknown_value`){let e=Error(`Unknown value: ${n}`);throw e.name=`UNKNOWN_VALUE`,e.value=n,e}else if(e.event===`unknown_option`){let e=Error(`Unknown option: ${n}`);throw e.name=`UNKNOWN_OPTION`,e.optionName=n,e}}let i;r.has(e.name)?i=r.get(e.name):(i=S.create(e.def),r.set(e.name,i)),e.name===`_unknown`?i.set(n):i.set(e.value)}return r.toObject({skipUnknown:!t.partial,camelCase:t.camelCase})}t.exports=O})),pe=t(((e,t)=>{var n=M(),r=fe();t.exports=class extends n{get requiresFilesystem(){return!0}run(){let e=this.arguments.filter(e=>e!==`-1`),t=e.length!==this.arguments.length,n;try{n=this.parseArgs(e)}catch(e){return this.printHelp(e),Promise.reject()}if(n.one=n.one||t,n.help)return this.printHelp(),Promise.resolve();let r=this.fs.getFileByPath(n.path);if(!r)return Promise.reject(`${n.path}: No such file or directory`);if(r.constructor===Object){let e=r;n.all||(e=Object.entries(e).reduce((e,[t,n])=>(t.startsWith(`.`)||(e[t]=n),e),{}));let t=this.fs.absolutePath(n.path);return n.long?this.printLong(e,t):n.one?Object.entries(e).forEach(([e,t])=>{this.stdOut=this._applyIndicator(e,t,n.classify)}):this.printSimple(e,n.classify),n.recursive&&Object.entries(e).forEach(([e,r])=>{if(r&&r.constructor===Object){let r=t.endsWith(`/`)?t+e:t+`/`+e;this.stdOut=``,this.stdOut=r+`:`,this.run.call(Object.create(this,{arguments:{value:[...this.arguments.filter(e=>e!==n.path&&e!==`./`),r]}}))}}),Promise.resolve()}return Promise.resolve(n.path)}printHelp(e){e&&(this.stdOut=e.message),this.stdOut=`usage: ls [-alRF1h] [file ...]`}printSimple(e,t){this.stdOut=Object.entries(e).reduce((e,[n,r])=>e+this.padString(this._applyIndicator(n,r,t)),``)}printLong(e,t){Object.entries(e).forEach(([e,n])=>{let r=t+`/`+e,i=n!=null&&n.constructor===Object,a=this.fs.getMode(r),o=a===null?i?493:420:a,s=this._modeToString(o,i),c=this.fs.getSize(r);return this.stdOut=`${s} root users ${this.padString(c,10)} ${e}`})}_applyIndicator(e,t,n){return n?t&&t.constructor===Object?e+`/`:typeof t==`function`||this.fs.isExecutable(e)?e+`*`:e:e}_modeToString(e,t){return(t?`d`:`-`)+(e&256?`r`:`-`)+(e&128?`w`:`-`)+(e&64?`x`:`-`)+(e&32?`r`:`-`)+(e&16?`w`:`-`)+(e&8?`x`:`-`)+(e&4?`r`:`-`)+(e&2?`w`:`-`)+(e&1?`x`:`-`)}padString(e,t=16){let n=t-e.toString().length,r=``;for(let e=0;e<n;e++)r+=` `;return e.toString()+r}parseArgs(e=this.arguments){return r([{name:`path`,defaultOption:!0,defaultValue:`./`,type:String},{name:`all`,alias:`a`,type:Boolean},{name:`long`,alias:`l`,type:Boolean},{name:`recursive`,alias:`R`,type:Boolean},{name:`one`,type:Boolean},{name:`classify`,alias:`F`,type:Boolean},{name:`help`,alias:`h`,type:Boolean}],{argv:e})}}})),me=t(((e,t)=>{var n=M();t.exports=class extends n{run(){let e=[...this.arguments],t=!1,n=!1;for(;e.length>0&&/^-[neE]+$/.test(e[0]);){let r=e.shift();r.includes(`n`)&&(t=!0),r.includes(`e`)&&(n=!0),r===`-E`&&(n=!1)}let r=e.join(` `);return n&&(r=r.replace(/\\c.*$/s,()=>(t=!0,``)).replace(/\\0([0-7]{1,3})/g,(e,t)=>String.fromCharCode(parseInt(t,8))).replace(/\\x([0-9a-fA-F]{1,2})/g,(e,t)=>String.fromCharCode(parseInt(t,16))).replace(/\\n/g,`
|
|
5
5
|
`).replace(/\\t/g,` `).replace(/\\r/g,`\r`).replace(/\\a/g,`\x07`).replace(/\\b/g,`\b`).replace(/\\e/g,`\x1B`).replace(/\\f/g,`\f`).replace(/\\v/g,`\v`).replace(/\\\\/g,`\\`)),t?(r.split(/\r?\n/).forEach(e=>this.stdOut=e),Promise.resolve()):Promise.resolve(r)}}})),J=t(((e,t)=>{var n=M();t.exports=class extends n{get requiresFilesystem(){return!0}run(){let e=!1,t=!1,n=!1,r=!1,i=!1,a=!1,o=!1,s=!1,c=!1,l=!1,u=!1,d=!1,f=!1,p=null,m=!1,h=[],g=[],_=[...this.arguments],v=0;for(;v<_.length;){let y=_[v];if(y===`--`){v++;break}if(y.startsWith(`-`)&&y.length>1){let g=y.slice(1),b=!1;for(let y=0;y<g.length&&!b;y++)switch(g[y]){case`i`:e=!0;break;case`v`:t=!0;break;case`n`:n=!0;break;case`c`:r=!0;break;case`l`:i=!0;break;case`L`:a=!0;break;case`q`:o=!0;break;case`r`:case`R`:s=!0;break;case`F`:c=!0;break;case`E`:break;case`o`:l=!0;break;case`w`:u=!0;break;case`x`:d=!0;break;case`s`:f=!0;break;case`a`:break;case`e`:{let e=g.slice(y+1),t=e.length>0?e:_[++v];for(let e of t.split(`
|
|
6
6
|
`))e.length>0&&h.push(e);m=!0,b=!0;break}case`f`:{let e=g.slice(y+1);p=e.length>0?e:_[++v],m=!0,b=!0;break}default:return f||(this.stdErr=`grep: invalid option -- '${g[y]}'`),this.exitCode=2,Promise.resolve()}}else g.push(y);v++}for(;v<_.length;)g.push(_[v++]);if(p!==null){let e=``;if(p===`-`)e=this.stdin||``;else{let t=this.fs.getFileByPath(p);if(t==null)return f||(this.stdErr=`grep: ${p}: No such file or directory`),this.exitCode=2,Promise.resolve();e=t.toString()}for(let t of e.split(`
|
|
7
7
|
`))t.length>0&&h.push(t)}if(h.length===0&&!m){if(g.length===0)return this.stdErr=`grep: no pattern given`,this.exitCode=2,Promise.resolve();let e=g.shift();for(let t of e.split(`
|
|
8
8
|
`))t.length>0&&h.push(t);h.length===0&&h.push(e)}let y=e?`gi`:`g`,b=[];for(let e of h){let t=c?e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`):e;u&&(t=`(?:^|\\W)(?:${t})(?:\\W|$)`),d&&(t=`^(?:${t})$`);try{b.push(new RegExp(t,y))}catch(e){return this.stdErr=`grep: invalid regex: ${e.message}`,this.exitCode=2,Promise.resolve()}}let x=[],S=!1,C=this.stdin||``,w=(e,t=!1)=>{let n=this.fs.getFileByPath(e);if(n==null){f||(this.stdErr=`grep: ${e}: No such file or directory`),S=!0;return}if(n.constructor===Object){if(!s){f||(this.stdErr=`grep: ${e}: Is a directory`),S=!0;return}if(!t&&this.fs.isSymlink&&this.fs.isSymlink(e))return;for(let t of Object.keys(n))w(e.replace(/\/$/,``)+`/`+t,!1);return}x.push({label:e,content:n.toString()})};if(g.length===0)x.push({label:null,content:C});else for(let e of g)e===`-`?x.push({label:`(standard input)`,content:C}):w(e,!0);let T=s||x.length+ +!!S>1,E=!1,D=e=>{if(b.length===0)return!1;for(let t of b)if(t.lastIndex=0,t.test(e))return!0;return!1},O=e=>{let t=[];for(let n of b){n.lastIndex=0;let r;for(;(r=n.exec(e))!==null;){if(r[0].length===0){n.lastIndex++;continue}if(t.push(r[0]),!n.global)break}}return t};for(let{label:e,content:s}of x){let c=s.split(`
|
|
9
|
-
`);c.length>0&&c[c.length-1]===``&&c.pop();let u=0,d=[];for(let e=0;e<c.length;e++){let n=c[e],r,i=[];l&&!t?(i=O(n),r=i.length>0):r=D(n),r!==t&&(u++,d.push({text:n,num:e+1,segments:i}))}if(a){u===0&&(this.stdOut=e||`(standard input)`,E=!0);continue}if(u>0&&(E=!0),!o){if(i){u>0&&(this.stdOut=e||`(standard input)`);continue}if(r){let t=T&&e?`${e}:`:``;this.stdOut=`${t}${u}`;continue}for(let{text:t,num:r,segments:i}of d){let a=T&&e?`${e}:`:``,o=n?`${r}:`:``;if(l)for(let e of i)this.stdOut=`${a}${o}${e}`;else this.stdOut=`${a}${o}${t}`}}}return S&&!(o&&E)?this.exitCode=2:E||(this.exitCode=1),Promise.resolve()}}})),he=t(((e,t)=>{var n=M();t.exports=class extends n{get name(){return`true`}run(){return Promise.resolve()}}})),ge=t(((e,t)=>{var n=M();t.exports=class extends n{get name(){return`false`}run(){return this.exitCode=1,Promise.resolve()}}})),Y=t(((e,t)=>{var{Test:n,TestBracket:r}=K();t.exports=[q(),pe(),me(),J(),he(),ge(),n,r]})),_e=t(((e,t)=>{var n=N();t.exports=class extends n{run(){if(this.arguments.length!==1)return Promise.reject(`alias requires a single argument`);let e=this.arguments[0].split(`=`);return e.length===2?(this.context.setAlias(e[0],e[1]),Promise.resolve()):Promise.reject(`alias requires a key and value delimited by '=' ie: key=value`)}}})),ve=t(((e,t)=>{var n=N();t.exports=class extends n{run(){if(this.arguments.length!==1)return Promise.reject(`export requires a single argument`);let e=this.arguments[0].split(`=`);return e.length!==2&&Promise.reject(`export requires a key and value delimited by '=' ie: key=value`),this.context.setVar(e[0],e[1]),Promise.resolve()}}})),ye=t(((e,t)=>{var n=N();t.exports=class extends n{run(){if(this.arguments.length!==1)return Promise.reject(`cd requires a single argument`);let e=this.context.fs.getFileByPath(this.arguments[0]);return e?e.constructor===Object?(this.context.setCwd(this.arguments[0]),Promise.resolve()):Promise.reject(`${this.arguments[0]}: Not a directory`):Promise.reject(`file or directory not found`)}}})),be=t(((e,t)=>{var n=N();t.exports=class extends n{get name(){return`chmod`}get requiresFilesystem(){return!0}run(){let e=this.arguments;if(e.length<2)return this.stdErr=`chmod: usage: chmod MODE FILE...`,this.exitCode=1,Promise.resolve();let t=e[0],n=e.slice(1);for(let e of n){if(this.fs.getFileByPath(e)==null){this.stdErr=`chmod: cannot access '${e}': No such file or directory`,this.exitCode=1;continue}let n=this.fs.getMode(e),r=this._parseMode(t,n===null?420:n);if(r===null)return this.stdErr=`chmod: invalid mode: '${t}'`,this.exitCode=1,Promise.resolve();this.fs.setMode(e,r)}return Promise.resolve()}_parseMode(e,t){if(/^0?[0-7]{3,4}$/.test(e))return parseInt(e,8);let n=e.match(/^([ugoa]*)([+\-=])([rwx]+)$/);if(!n)return null;let[,r,i,a]=n,o=!r||r===`a`?[`u`,`g`,`o`]:r.split(``),s={u:256,g:32,o:4},c={u:128,g:16,o:2},l={u:64,g:8,o:1},u=0;for(let e of o)a.includes(`r`)&&(u|=s[e]),a.includes(`w`)&&(u|=c[e]),a.includes(`x`)&&(u|=l[e]);if(i===`+`)return t|u;if(i===`-`)return t&~u;if(i===`=`){let e=0;for(let t of o)e|=s[t]|c[t]|l[t];return t&~e|u}return null}}})),xe=t(((e,t)=>{var n=N(),r=E();t.exports=class extends n{get name(){return`cp`}get requiresFilesystem(){return!0}run(){let e=!1,t=null,n=!1,r=!1,i=null,a=[],o=[...this.arguments],s=0;for(;s<o.length;){let c=o[s];if(c===`--`){s++;break}if(c.startsWith(`-`)&&c.length>1)for(let a of c.slice(1))switch(a){case`r`:case`R`:e=!0,n=!0;break;case`a`:e=!0,n=!0,t=`preserve`,i=`preserve`;break;case`d`:case`P`:t=`preserve`,i=`preserve`;break;case`L`:t=`follow`,i=`follow`;break;case`H`:t=`follow_cl`,r=!0;break;case`f`:break}else a.push(c);s++}for(;s<o.length;)a.push(o[s++]);let c=t===null?n?`preserve`:`follow`:t;if(a.length<2)return this.stdErr=`cp: missing destination file operand${a.length?` after '${a[0]}'`:``}`,this.exitCode=1,Promise.resolve();let l=a[a.length-1],u=a.slice(0,-1),d=this.fs.getFileByPath(l),f=d!=null&&d.constructor===Object,p=r||c===`follow_cl`?`follow`:c,m=r||c===`follow_cl`?i===null?`preserve`:i:c;for(let t of u){let n=this.fs.isSymlink?this.fs.isSymlink(t):!1,r=this.fs.getFileByPath(t);if(r==null){this.stdErr=`cp: cannot stat '${t}': No such file or directory`,this.exitCode=1;continue}if(!(n&&p===`preserve`)&&r.constructor===Object&&!e){this.stdErr=`cp: omitting directory '${t}'`,this.exitCode=1;continue}let i=f?l.replace(/\/$/,``)+`/`+t.split(`/`).pop():l,a=this._copy(t,i,p,n,m);a&&(this.stdErr=a,this.exitCode=1)}return Promise.resolve()}_copy(e,t,n,i,a){if(i&&n===`preserve`&&this.fs.readSymlink){let n=this.fs.readSymlink(e);if(n===null)return`cp: cannot read symlink '${e}'`;try{this.fs.createSymlink(n,t)}catch(e){return`cp: cannot create symlink '${t}': ${e.message}`}return null}let o=this.fs.getFileByPath(e);if(o==null)return`cp: cannot stat '${e}': No such file or directory`;if(o.constructor===Object){try{this.fs.setFileByPath(t,{},!0)}catch(e){return`cp: cannot create directory '${t}': ${e.message}`}let n=this.fs.absolutePath(e),i;try{i=r.readdirSync(n)}catch{i=Object.keys(o)}for(let n of i){let r=e.replace(/\/$/,``)+`/`+n,i=t.replace(/\/$/,``)+`/`+n,o=this.fs.isSymlink?this.fs.isSymlink(r):!1,s=this._copy(r,i,a,o,a);s&&(this.stdErr=s,this.exitCode=1)}}else this.fs.setFileByPath(t,o,!0);return null}}})),Se=t(((e,t)=>{var n=N();t.exports=class extends n{get name(){return`mkdir`}get requiresFilesystem(){return!0}run(){let e=!1,t=[];for(let n of this.arguments)n===`-p`||n===`--parents`?e=!0:t.push(n);if(t.length===0)return this.stdErr=`mkdir: missing operand`,this.exitCode=1,Promise.resolve();for(let n of t){if(this.fs.getFileByPath(n)!=null){e||(this.stdErr=`mkdir: cannot create directory '${n}': File exists`,this.exitCode=1);continue}try{this.fs.setFileByPath(n,{},e)}catch(e){this.stdErr=`mkdir: cannot create directory '${n}': ${e.message}`,this.exitCode=1}}return Promise.resolve()}}})),Ce=t(((e,t)=>{var n=N(),r=E();t.exports=class extends n{get name(){return`mv`}get requiresFilesystem(){return!0}run(){let e=null,t=[],n=[...this.arguments],i=0;for(;i<n.length;){let r=n[i];if(r===`--`){i++;break}if(r.startsWith(`-`)&&r.length>1)for(let t=1;t<r.length;t++)switch(r[t]){case`f`:case`i`:case`n`:break;case`t`:{let a=r.slice(t+1);e=a.length>0?a:n[++i],t=r.length;break}}else t.push(r);i++}for(;i<n.length;)t.push(n[i++]);let a=e===null?t[t.length-1]:e,o=e===null?t.slice(0,-1):t;if(!a||o.length===0)return this.stdErr=`mv: missing destination file operand${o.length?` after '${o[0]}'`:``}`,this.exitCode=1,Promise.resolve();let s=this.fs.getFileByPath(a),c=s!=null&&s.constructor===Object;for(let e of o){let t=c?a.replace(/\/$/,``)+`/`+e.split(`/`).pop():a;if(this.fs.isRealFilesystem){let n=this.fs.absolutePath(e),i=this.fs.absolutePath(t);try{r.lstatSync(n)}catch{this.stdErr=`mv: cannot stat '${e}': No such file or directory`,this.exitCode=1;continue}try{let e=D();r.mkdirSync(e.dirname(i),{recursive:!0}),r.renameSync(n,i)}catch(n){this.stdErr=`mv: cannot move '${e}' to '${t}': ${n.message}`,this.exitCode=1}}else{let n=this.fs.getFileByPath(e);if(n==null){this.stdErr=`mv: cannot stat '${e}': No such file or directory`,this.exitCode=1;continue}this.fs.setFileByPath(t,this._deepCopy(n),!0),this.fs.deleteFileByPath(e)}}return Promise.resolve()}_deepCopy(e){if(e==null||typeof e==`function`||typeof e!=`object`)return e;let t={};for(let[n,r]of Object.entries(e))t[n]=this._deepCopy(r);return t}}})),we=t(((e,t)=>{var n=N();t.exports=class extends n{run(){let e=this.context.fs.cwd;return this.stdOut=e.endsWith(`/`)&&e!==`/`?e.slice(0,-1):e,Promise.resolve()}}})),Te=t(((e,t)=>{var n=N(),r=E();t.exports=class extends n{get name(){return`rm`}get requiresFilesystem(){return!0}run(){let e=!1,t=!1,n=[];for(let r of this.arguments)/^-[rRf]+$/.test(r)?((r.includes(`r`)||r.includes(`R`))&&(e=!0),r.includes(`f`)&&(t=!0)):n.push(r);if(n.length===0)return t||(this.stdErr=`rm: missing operand`,this.exitCode=1),Promise.resolve();for(let r of n)try{this._remove(r,e,t)}catch(e){this.stdErr=e.message,this.exitCode=1}return Promise.resolve()}_remove(e,t,n){if(!(this.fs.isSymlink&&this.fs.isSymlink(e))){let i=this.fs.getFileByPath(e);if(i==null){if(!n)throw Error(`rm: cannot remove '${e}': No such file or directory`);return}if(i.constructor===Object){if(!t)throw Error(`rm: cannot remove '${e}': Is a directory`);let a;if(this.fs.isRealFilesystem)try{a=r.readdirSync(this.fs.absolutePath(e))}catch{a=[]}else a=Object.keys(i);for(let r of a){let i=e.replace(/\/$/,``)+`/`+r;this._remove(i,t,n)}}}this.fs.deleteFileByPath(e)}}})),Ee=t(((e,t)=>{var n=N();t.exports=class extends n{run(){if(this.arguments.length!==1)return Promise.reject(`which requires a single argument`);let e=this.context.fs.getFileByPath(`${this.context.getVar(`PATH`)}/${this.arguments[0]}`);return!e||e.constructor===Object||e.constructor===String?Promise.reject():Promise.resolve(`${this.context.getVar(`PATH`)}/${this.arguments[0]}`)}}})),De=t(((e,t)=>{var n=P(),r=N();Yn(),t.exports=class extends r{constructor(e,t){if(super(e,t),this.arguments.length!==1)return Promise.reject(`source requires a single argument`);let r=this.arguments[0];if(r.startsWith(`./`)||r.startsWith(`/`)){let i=this.context.fs.getFileByPath(r);if(i&&i.constructor===String&&i.startsWith(`#!`))return new n(i,e,t,!0)}}run(){let e=this.arguments[0];if(e.startsWith(`./`)||e.startsWith(`/`)){let t=this.context.fs.getFileByPath(e);if(!t)return Promise.reject(`${e}: No such file or directory`);if(t.constructor===Object)return Promise.reject(`${e}: is a directory`);if(t.prototype&&t.prototype instanceof Command)return Promise.reject(`${e}: command not found`);if(t.constructor===String&&t.startsWith(`#!`))return Promise.reject(`FATAL: should not get here`)}return Promise.reject(`${e}: permission denied`)}}})),Oe=t(((e,t)=>{var n=N();t.exports=class extends n{run(){return this.arguments.length>0?Promise.reject(`clear does not require arguments`):(this.context.clear(),Promise.resolve())}}})),ke=t(((e,t)=>{var n=N();t.exports=class extends n{run(){let e=parseInt(this.arguments[0])||0;return this.exitCode=e,this.context.destroy(e),Promise.resolve()}}})),Ae=t(((e,t)=>{var n=N(),r=fe();t.exports=class extends n{get requiresFilesystem(){return!1}get captureInput(){return!0}run(){let e;try{e=this.parseArgs()}catch(e){return this.printHelp(e),Promise.reject()}return e.help?(this.printHelp(),Promise.resolve()):(this.nchars=e.nchars,this.var=e.name,new Promise(t=>{let n=setTimeout(()=>{t(),this.exitCode=1},e.timeout?e.timeout*1e3:864e5);this.completionCallback=e=>{clearTimeout(n),t(e)},this.stdErr=e.prompt||``,this.flush()}))}onInput(e){if(this.inputBuffer||=``,e.length===1&&(this.inputBuffer+=e),this.inputBuffer.length===this.nchars){if(this.var){this.context.setVar(this.var,this.inputBuffer),this.completionCallback();return}this.completionCallback(this.inputBuffer)}}printHelp(e){e&&(this.stdOut=e.message),this.stdOut=`usage: read [-n nchars] [-p prompt] [-t timeout] [name ...]`}parseArgs(){return r([{name:`prompt`,alias:`p`,type:String},{name:`nchars`,alias:`n`,type:Number},{name:`timeout`,alias:`t`,type:Number},{name:`help`,alias:`h`,type:Boolean},{defaultOption:!0,name:`name`,type:String}],{argv:this.arguments})}}})),je=t(((e,t)=>{var n=N(),r=M();t.exports=class extends n{get name(){return`jsfunction`}run(){let[e,...t]=this.arguments;if(!e||t.length===0)return this.stdErr=`usage: jsfunction <name> <function-body>`,this.exitCode=1,Promise.resolve();let n=t.join(` `),i;try{if(i=Function(`return (`+n+`)`)(),typeof i!=`function`)throw Error(`expression is not a function`)}catch(e){return this.stdErr=`jsfunction: ${e.message}`,this.exitCode=1,Promise.resolve()}class a extends r{run(){let e;try{e=i(this.arguments)}catch(e){return this.stdErr=e.message||String(e),this.exitCode=1,Promise.resolve()}return e&&typeof e.then==`function`?e.then(e=>{e!=null&&(this.stdOut=String(e))}).catch(e=>{this.stdErr=e.message||String(e),this.exitCode=1}):(e!=null&&(this.stdOut=String(e)),Promise.resolve())}}return Object.defineProperty(a,`name`,{value:e,configurable:!0}),this.context.setCommand(a),Promise.resolve()}}})),Me=t(((e,t)=>{t.exports=[_e(),ve(),ye(),be(),xe(),Se(),Ce(),we(),Te(),Ee(),De(),Oe(),ke(),Ae(),je()]})),Ne=t(((e,t)=>{t.exports=Object})),Pe=t(((e,t)=>{t.exports=Error})),Fe=t(((e,t)=>{t.exports=EvalError})),Ie=t(((e,t)=>{t.exports=RangeError})),Le=t(((e,t)=>{t.exports=ReferenceError})),Re=t(((e,t)=>{t.exports=SyntaxError})),X=t(((e,t)=>{t.exports=TypeError})),ze=t(((e,t)=>{t.exports=URIError})),Be=t(((e,t)=>{t.exports=Math.abs})),Ve=t(((e,t)=>{t.exports=Math.floor})),He=t(((e,t)=>{t.exports=Math.max})),Ue=t(((e,t)=>{t.exports=Math.min})),We=t(((e,t)=>{t.exports=Math.pow})),Ge=t(((e,t)=>{t.exports=Math.round})),Ke=t(((e,t)=>{t.exports=Number.isNaN||function(e){return e!==e}})),qe=t(((e,t)=>{var n=Ke();t.exports=function(e){return n(e)||e===0?e:e<0?-1:1}})),Je=t(((e,t)=>{t.exports=Object.getOwnPropertyDescriptor})),Ye=t(((e,t)=>{var n=Je();if(n)try{n([],`length`)}catch{n=null}t.exports=n})),Xe=t(((e,t)=>{var n=Object.defineProperty||!1;if(n)try{n({},`a`,{value:1})}catch{n=!1}t.exports=n})),Ze=t(((e,t)=>{t.exports=function(){if(typeof Symbol!=`function`||typeof Object.getOwnPropertySymbols!=`function`)return!1;if(typeof Symbol.iterator==`symbol`)return!0;var e={},t=Symbol(`test`),n=Object(t);if(typeof t==`string`||Object.prototype.toString.call(t)!==`[object Symbol]`||Object.prototype.toString.call(n)!==`[object Symbol]`)return!1;var r=42;for(var i in e[t]=r,e)return!1;if(typeof Object.keys==`function`&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames==`function`&&Object.getOwnPropertyNames(e).length!==0)return!1;var a=Object.getOwnPropertySymbols(e);if(a.length!==1||a[0]!==t||!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if(typeof Object.getOwnPropertyDescriptor==`function`){var o=Object.getOwnPropertyDescriptor(e,t);if(o.value!==r||o.enumerable!==!0)return!1}return!0}})),Qe=t(((e,t)=>{var n=typeof Symbol<`u`&&Symbol,r=Ze();t.exports=function(){return typeof n!=`function`||typeof Symbol!=`function`||typeof n(`foo`)!=`symbol`||typeof Symbol(`bar`)!=`symbol`?!1:r()}})),$e=t(((e,t)=>{t.exports=typeof Reflect<`u`&&Reflect.getPrototypeOf||null})),et=t(((e,t)=>{t.exports=Ne().getPrototypeOf||null})),tt=t(((e,t)=>{var n=`Function.prototype.bind called on incompatible `,r=Object.prototype.toString,i=Math.max,a=`[object Function]`,o=function(e,t){for(var n=[],r=0;r<e.length;r+=1)n[r]=e[r];for(var i=0;i<t.length;i+=1)n[i+e.length]=t[i];return n},s=function(e,t){for(var n=[],r=t||0,i=0;r<e.length;r+=1,i+=1)n[i]=e[r];return n},c=function(e,t){for(var n=``,r=0;r<e.length;r+=1)n+=e[r],r+1<e.length&&(n+=t);return n};t.exports=function(e){var t=this;if(typeof t!=`function`||r.apply(t)!==a)throw TypeError(n+t);for(var l=s(arguments,1),u,d=function(){if(this instanceof u){var n=t.apply(this,o(l,arguments));return Object(n)===n?n:this}return t.apply(e,o(l,arguments))},f=i(0,t.length-l.length),p=[],m=0;m<f;m++)p[m]=`$`+m;if(u=Function(`binder`,`return function (`+c(p,`,`)+`){ return binder.apply(this,arguments); }`)(d),t.prototype){var h=function(){};h.prototype=t.prototype,u.prototype=new h,h.prototype=null}return u}})),nt=t(((e,t)=>{var n=tt();t.exports=Function.prototype.bind||n})),rt=t(((e,t)=>{t.exports=Function.prototype.call})),it=t(((e,t)=>{t.exports=Function.prototype.apply})),at=t(((e,t)=>{t.exports=typeof Reflect<`u`&&Reflect&&Reflect.apply})),ot=t(((e,t)=>{var n=nt(),r=it(),i=rt();t.exports=at()||n.call(i,r)})),st=t(((e,t)=>{var n=nt(),r=X(),i=rt(),a=ot();t.exports=function(e){if(e.length<1||typeof e[0]!=`function`)throw new r(`a function is required`);return a(n,i,e)}})),ct=t(((e,t)=>{var n=st(),r=Ye(),i;try{i=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!=`object`||!(`code`in e)||e.code!==`ERR_PROTO_ACCESS`)throw e}var a=!!i&&r&&r(Object.prototype,`__proto__`),o=Object,s=o.getPrototypeOf;t.exports=a&&typeof a.get==`function`?n([a.get]):typeof s==`function`?function(e){return s(e==null?e:o(e))}:!1})),lt=t(((e,t)=>{var n=$e(),r=et(),i=ct();t.exports=n?function(e){return n(e)}:r?function(e){if(!e||typeof e!=`object`&&typeof e!=`function`)throw TypeError(`getProto: not an object`);return r(e)}:i?function(e){return i(e)}:null})),ut=t(((e,t)=>{var n=Function.prototype.call,r=Object.prototype.hasOwnProperty;t.exports=nt().call(n,r)})),Z=t(((e,t)=>{var n,r=Ne(),i=Pe(),a=Fe(),o=Ie(),s=Le(),c=Re(),l=X(),u=ze(),d=Be(),f=Ve(),p=He(),m=Ue(),h=We(),g=Ge(),_=qe(),v=Function,y=function(e){try{return v(`"use strict"; return (`+e+`).constructor;`)()}catch{}},b=Ye(),x=Xe(),S=function(){throw new l},C=b?function(){try{return arguments.callee,S}catch{try{return b(arguments,`callee`).get}catch{return S}}}():S,w=Qe()(),T=lt(),E=et(),D=$e(),O=it(),k=rt(),A={},j=typeof Uint8Array>`u`||!T?n:T(Uint8Array),M={__proto__:null,"%AggregateError%":typeof AggregateError>`u`?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>`u`?n:ArrayBuffer,"%ArrayIteratorPrototype%":w&&T?T([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":A,"%AsyncGenerator%":A,"%AsyncGeneratorFunction%":A,"%AsyncIteratorPrototype%":A,"%Atomics%":typeof Atomics>`u`?n:Atomics,"%BigInt%":typeof BigInt>`u`?n:BigInt,"%BigInt64Array%":typeof BigInt64Array>`u`?n:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>`u`?n:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>`u`?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":i,"%eval%":eval,"%EvalError%":a,"%Float16Array%":typeof Float16Array>`u`?n:Float16Array,"%Float32Array%":typeof Float32Array>`u`?n:Float32Array,"%Float64Array%":typeof Float64Array>`u`?n:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>`u`?n:FinalizationRegistry,"%Function%":v,"%GeneratorFunction%":A,"%Int8Array%":typeof Int8Array>`u`?n:Int8Array,"%Int16Array%":typeof Int16Array>`u`?n:Int16Array,"%Int32Array%":typeof Int32Array>`u`?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":w&&T?T(T([][Symbol.iterator]())):n,"%JSON%":typeof JSON==`object`?JSON:n,"%Map%":typeof Map>`u`?n:Map,"%MapIteratorPrototype%":typeof Map>`u`||!w||!T?n:T(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":r,"%Object.getOwnPropertyDescriptor%":b,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>`u`?n:Promise,"%Proxy%":typeof Proxy>`u`?n:Proxy,"%RangeError%":o,"%ReferenceError%":s,"%Reflect%":typeof Reflect>`u`?n:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>`u`?n:Set,"%SetIteratorPrototype%":typeof Set>`u`||!w||!T?n:T(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>`u`?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":w&&T?T(``[Symbol.iterator]()):n,"%Symbol%":w?Symbol:n,"%SyntaxError%":c,"%ThrowTypeError%":C,"%TypedArray%":j,"%TypeError%":l,"%Uint8Array%":typeof Uint8Array>`u`?n:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>`u`?n:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>`u`?n:Uint16Array,"%Uint32Array%":typeof Uint32Array>`u`?n:Uint32Array,"%URIError%":u,"%WeakMap%":typeof WeakMap>`u`?n:WeakMap,"%WeakRef%":typeof WeakRef>`u`?n:WeakRef,"%WeakSet%":typeof WeakSet>`u`?n:WeakSet,"%Function.prototype.call%":k,"%Function.prototype.apply%":O,"%Object.defineProperty%":x,"%Object.getPrototypeOf%":E,"%Math.abs%":d,"%Math.floor%":f,"%Math.max%":p,"%Math.min%":m,"%Math.pow%":h,"%Math.round%":g,"%Math.sign%":_,"%Reflect.getPrototypeOf%":D};if(T)try{null.error}catch(e){M[`%Error.prototype%`]=T(T(e))}var N=function e(t){var n;if(t===`%AsyncFunction%`)n=y(`async function () {}`);else if(t===`%GeneratorFunction%`)n=y(`function* () {}`);else if(t===`%AsyncGeneratorFunction%`)n=y(`async function* () {}`);else if(t===`%AsyncGenerator%`){var r=e(`%AsyncGeneratorFunction%`);r&&(n=r.prototype)}else if(t===`%AsyncIteratorPrototype%`){var i=e(`%AsyncGenerator%`);i&&T&&(n=T(i.prototype))}return M[t]=n,n},P={__proto__:null,"%ArrayBufferPrototype%":[`ArrayBuffer`,`prototype`],"%ArrayPrototype%":[`Array`,`prototype`],"%ArrayProto_entries%":[`Array`,`prototype`,`entries`],"%ArrayProto_forEach%":[`Array`,`prototype`,`forEach`],"%ArrayProto_keys%":[`Array`,`prototype`,`keys`],"%ArrayProto_values%":[`Array`,`prototype`,`values`],"%AsyncFunctionPrototype%":[`AsyncFunction`,`prototype`],"%AsyncGenerator%":[`AsyncGeneratorFunction`,`prototype`],"%AsyncGeneratorPrototype%":[`AsyncGeneratorFunction`,`prototype`,`prototype`],"%BooleanPrototype%":[`Boolean`,`prototype`],"%DataViewPrototype%":[`DataView`,`prototype`],"%DatePrototype%":[`Date`,`prototype`],"%ErrorPrototype%":[`Error`,`prototype`],"%EvalErrorPrototype%":[`EvalError`,`prototype`],"%Float32ArrayPrototype%":[`Float32Array`,`prototype`],"%Float64ArrayPrototype%":[`Float64Array`,`prototype`],"%FunctionPrototype%":[`Function`,`prototype`],"%Generator%":[`GeneratorFunction`,`prototype`],"%GeneratorPrototype%":[`GeneratorFunction`,`prototype`,`prototype`],"%Int8ArrayPrototype%":[`Int8Array`,`prototype`],"%Int16ArrayPrototype%":[`Int16Array`,`prototype`],"%Int32ArrayPrototype%":[`Int32Array`,`prototype`],"%JSONParse%":[`JSON`,`parse`],"%JSONStringify%":[`JSON`,`stringify`],"%MapPrototype%":[`Map`,`prototype`],"%NumberPrototype%":[`Number`,`prototype`],"%ObjectPrototype%":[`Object`,`prototype`],"%ObjProto_toString%":[`Object`,`prototype`,`toString`],"%ObjProto_valueOf%":[`Object`,`prototype`,`valueOf`],"%PromisePrototype%":[`Promise`,`prototype`],"%PromiseProto_then%":[`Promise`,`prototype`,`then`],"%Promise_all%":[`Promise`,`all`],"%Promise_reject%":[`Promise`,`reject`],"%Promise_resolve%":[`Promise`,`resolve`],"%RangeErrorPrototype%":[`RangeError`,`prototype`],"%ReferenceErrorPrototype%":[`ReferenceError`,`prototype`],"%RegExpPrototype%":[`RegExp`,`prototype`],"%SetPrototype%":[`Set`,`prototype`],"%SharedArrayBufferPrototype%":[`SharedArrayBuffer`,`prototype`],"%StringPrototype%":[`String`,`prototype`],"%SymbolPrototype%":[`Symbol`,`prototype`],"%SyntaxErrorPrototype%":[`SyntaxError`,`prototype`],"%TypedArrayPrototype%":[`TypedArray`,`prototype`],"%TypeErrorPrototype%":[`TypeError`,`prototype`],"%Uint8ArrayPrototype%":[`Uint8Array`,`prototype`],"%Uint8ClampedArrayPrototype%":[`Uint8ClampedArray`,`prototype`],"%Uint16ArrayPrototype%":[`Uint16Array`,`prototype`],"%Uint32ArrayPrototype%":[`Uint32Array`,`prototype`],"%URIErrorPrototype%":[`URIError`,`prototype`],"%WeakMapPrototype%":[`WeakMap`,`prototype`],"%WeakSetPrototype%":[`WeakSet`,`prototype`]},F=nt(),I=ut(),L=F.call(k,Array.prototype.concat),ee=F.call(O,Array.prototype.splice),R=F.call(k,String.prototype.replace),z=F.call(k,String.prototype.slice),B=F.call(k,RegExp.prototype.exec),V=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,H=/\\(\\)?/g,U=function(e){var t=z(e,0,1),n=z(e,-1);if(t===`%`&&n!==`%`)throw new c("invalid intrinsic syntax, expected closing `%`");if(n===`%`&&t!==`%`)throw new c("invalid intrinsic syntax, expected opening `%`");var r=[];return R(e,V,function(e,t,n,i){r[r.length]=n?R(i,H,`$1`):t||e}),r},W=function(e,t){var n=e,r;if(I(P,n)&&(r=P[n],n=`%`+r[0]+`%`),I(M,n)){var i=M[n];if(i===A&&(i=N(n)),i===void 0&&!t)throw new l(`intrinsic `+e+` exists, but is not available. Please file an issue!`);return{alias:r,name:n,value:i}}throw new c(`intrinsic `+e+` does not exist!`)};t.exports=function(e,t){if(typeof e!=`string`||e.length===0)throw new l(`intrinsic name must be a non-empty string`);if(arguments.length>1&&typeof t!=`boolean`)throw new l(`"allowMissing" argument must be a boolean`);if(B(/^%?[^%]*%?$/,e)===null)throw new c("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=U(e),r=n.length>0?n[0]:``,i=W(`%`+r+`%`,t),a=i.name,o=i.value,s=!1,u=i.alias;u&&(r=u[0],ee(n,L([0,1],u)));for(var d=1,f=!0;d<n.length;d+=1){var p=n[d],m=z(p,0,1),h=z(p,-1);if((m===`"`||m===`'`||m==="`"||h===`"`||h===`'`||h==="`")&&m!==h)throw new c(`property names with quotes must have matching quotes`);if((p===`constructor`||!f)&&(s=!0),r+=`.`+p,a=`%`+r+`%`,I(M,a))o=M[a];else if(o!=null){if(!(p in o)){if(!t)throw new l(`base intrinsic for `+e+` exists, but the property is not available.`);return}if(b&&d+1>=n.length){var g=b(o,p);f=!!g,o=f&&`get`in g&&!(`originalValue`in g.get)?g.get:o[p]}else f=I(o,p),o=o[p];f&&!s&&(M[a]=o)}}return o}})),dt=t(((e,t)=>{var n=Xe(),r=Re(),i=X(),a=Ye();t.exports=function(e,t,o){if(!e||typeof e!=`object`&&typeof e!=`function`)throw new i("`obj` must be an object or a function`");if(typeof t!=`string`&&typeof t!=`symbol`)throw new i("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!=`boolean`&&arguments[3]!==null)throw new i("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!=`boolean`&&arguments[4]!==null)throw new i("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!=`boolean`&&arguments[5]!==null)throw new i("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!=`boolean`)throw new i("`loose`, if provided, must be a boolean");var s=arguments.length>3?arguments[3]:null,c=arguments.length>4?arguments[4]:null,l=arguments.length>5?arguments[5]:null,u=arguments.length>6?arguments[6]:!1,d=!!a&&a(e,t);if(n)n(e,t,{configurable:l===null&&d?d.configurable:!l,enumerable:s===null&&d?d.enumerable:!s,value:o,writable:c===null&&d?d.writable:!c});else if(u||!s&&!c&&!l)e[t]=o;else throw new r(`This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.`)}})),ft=t(((e,t)=>{var n=Xe(),r=function(){return!!n};r.hasArrayLengthDefineBug=function(){if(!n)return null;try{return n([],`length`,{value:1}).length!==1}catch{return!0}},t.exports=r})),pt=t(((e,t)=>{var n=Z(),r=dt(),i=ft()(),a=Ye(),o=X(),s=n(`%Math.floor%`);t.exports=function(e,t){if(typeof e!=`function`)throw new o("`fn` is not a function");if(typeof t!=`number`||t<0||t>4294967295||s(t)!==t)throw new o("`length` must be a positive 32-bit integer");var n=arguments.length>2&&!!arguments[2],c=!0,l=!0;if(`length`in e&&a){var u=a(e,`length`);u&&!u.configurable&&(c=!1),u&&!u.writable&&(l=!1)}return(c||l||!n)&&(i?r(e,`length`,t,!0,!0):r(e,`length`,t)),e}})),mt=t(((e,t)=>{var n=nt(),r=it(),i=ot();t.exports=function(){return i(n,r,arguments)}})),ht=t(((e,t)=>{var n=pt(),r=Xe(),i=st(),a=mt();t.exports=function(e){var t=i(arguments),r=e.length-(arguments.length-1);return n(t,1+(r>0?r:0),!0)},r?r(t.exports,`apply`,{value:a}):t.exports.apply=a})),gt=t(((e,t)=>{var n=Object.prototype.toString;t.exports=function(e){var t=n.call(e),r=t===`[object Arguments]`;return r||=t!==`[object Array]`&&typeof e==`object`&&!!e&&typeof e.length==`number`&&e.length>=0&&n.call(e.callee)===`[object Function]`,r}})),_t=t(((e,t)=>{var n;if(!Object.keys){var r=Object.prototype.hasOwnProperty,i=Object.prototype.toString,a=gt(),o=Object.prototype.propertyIsEnumerable,s=!o.call({toString:null},`toString`),c=o.call(function(){},`prototype`),l=[`toString`,`toLocaleString`,`valueOf`,`hasOwnProperty`,`isPrototypeOf`,`propertyIsEnumerable`,`constructor`],u=function(e){var t=e.constructor;return t&&t.prototype===e},d={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},f=function(){if(typeof window>`u`)return!1;for(var e in window)try{if(!d[`$`+e]&&r.call(window,e)&&window[e]!==null&&typeof window[e]==`object`)try{u(window[e])}catch{return!0}}catch{return!0}return!1}(),p=function(e){if(typeof window>`u`||!f)return u(e);try{return u(e)}catch{return!1}};n=function(e){var t=typeof e==`object`&&!!e,n=i.call(e)===`[object Function]`,o=a(e),u=t&&i.call(e)===`[object String]`,d=[];if(!t&&!n&&!o)throw TypeError(`Object.keys called on a non-object`);var f=c&&n;if(u&&e.length>0&&!r.call(e,0))for(var m=0;m<e.length;++m)d.push(String(m));if(o&&e.length>0)for(var h=0;h<e.length;++h)d.push(String(h));else for(var g in e)!(f&&g===`prototype`)&&r.call(e,g)&&d.push(String(g));if(s)for(var _=p(e),v=0;v<l.length;++v)!(_&&l[v]===`constructor`)&&r.call(e,l[v])&&d.push(l[v]);return d}}t.exports=n})),vt=t(((e,t)=>{var n=Array.prototype.slice,r=gt(),i=Object.keys,a=i?function(e){return i(e)}:_t(),o=Object.keys;a.shim=function(){return Object.keys?function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2)||(Object.keys=function(e){return r(e)?o(n.call(e)):o(e)}):Object.keys=a,Object.keys||a},t.exports=a})),yt=t(((e,t)=>{var n=vt(),r=typeof Symbol==`function`&&typeof Symbol(`foo`)==`symbol`,i=Object.prototype.toString,a=Array.prototype.concat,o=dt(),s=function(e){return typeof e==`function`&&i.call(e)===`[object Function]`},c=ft()(),l=function(e,t,n,r){if(t in e){if(r===!0){if(e[t]===n)return}else if(!s(r)||!r())return}c?o(e,t,n,!0):o(e,t,n)},u=function(e,t){var i=arguments.length>2?arguments[2]:{},o=n(t);r&&(o=a.call(o,Object.getOwnPropertySymbols(t)));for(var s=0;s<o.length;s+=1)l(e,o[s],t[o[s]],i[o[s]])};u.supportsDescriptors=!!c,t.exports=u})),Q=t(((e,t)=>{var n=Z(),r=st(),i=r([n(`%String.prototype.indexOf%`)]);t.exports=function(e,t){var a=n(e,!!t);return typeof a==`function`&&i(e,`.prototype.`)>-1?r([a]):a}})),bt=t(((e,t)=>{var n=Z()(`%Array%`),r=!n.isArray&&Q()(`Object.prototype.toString`);t.exports=n.isArray||function(e){return r(e)===`[object Array]`}})),xt=t(((e,t)=>{t.exports=bt()})),St=t(((e,t)=>{var n=Z(),r=Q(),i=X(),a=xt(),o=n(`%Reflect.apply%`,!0)||r(`Function.prototype.apply`);t.exports=function(e,t){var n=arguments.length>2?arguments[2]:[];if(!a(n))throw new i("Assertion failed: optional `argumentsList`, if provided, must be a List");return o(e,t,n)}})),Ct=t(((e,t)=>{t.exports={}})),wt=t(((e,t)=>{r();var i=typeof Map==`function`&&Map.prototype,a=Object.getOwnPropertyDescriptor&&i?Object.getOwnPropertyDescriptor(Map.prototype,`size`):null,o=i&&a&&typeof a.get==`function`?a.get:null,s=i&&Map.prototype.forEach,c=typeof Set==`function`&&Set.prototype,l=Object.getOwnPropertyDescriptor&&c?Object.getOwnPropertyDescriptor(Set.prototype,`size`):null,u=c&&l&&typeof l.get==`function`?l.get:null,d=c&&Set.prototype.forEach,f=typeof WeakMap==`function`&&WeakMap.prototype?WeakMap.prototype.has:null,p=typeof WeakSet==`function`&&WeakSet.prototype?WeakSet.prototype.has:null,m=typeof WeakRef==`function`&&WeakRef.prototype?WeakRef.prototype.deref:null,h=Boolean.prototype.valueOf,g=Object.prototype.toString,_=Function.prototype.toString,v=String.prototype.match,y=String.prototype.slice,b=String.prototype.replace,x=String.prototype.toUpperCase,S=String.prototype.toLowerCase,C=RegExp.prototype.test,w=Array.prototype.concat,T=Array.prototype.join,E=Array.prototype.slice,D=Math.floor,O=typeof BigInt==`function`?BigInt.prototype.valueOf:null,k=Object.getOwnPropertySymbols,A=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?Symbol.prototype.toString:null,j=typeof Symbol==`function`&&typeof Symbol.iterator==`object`,M=typeof Symbol==`function`&&Symbol.toStringTag?Symbol.toStringTag:null,N=Object.prototype.propertyIsEnumerable,P=(typeof Reflect==`function`?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function F(e,t){if(e===1/0||e===-1/0||e!==e||e&&e>-1e3&&e<1e3||C.call(/e/,t))return t;var n=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof e==`number`){var r=e<0?-D(-e):D(e);if(r!==e){var i=String(r),a=y.call(t,i.length+1);return b.call(i,n,`$&_`)+`.`+b.call(b.call(a,/([0-9]{3})/g,`$&_`),/_$/,``)}}return b.call(t,n,`$&_`)}var I=Ct(),L=I.custom,ee=ae(L)?L:null,R={__proto__:null,double:`"`,single:`'`},z={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};t.exports=function e(t,r,i,a){var c=r||{};if(K(c,`quoteStyle`)&&!K(R,c.quoteStyle))throw TypeError(`option "quoteStyle" must be "single" or "double"`);if(K(c,`maxStringLength`)&&(typeof c.maxStringLength==`number`?c.maxStringLength<0&&c.maxStringLength!==1/0:c.maxStringLength!==null))throw TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var l=K(c,`customInspect`)?c.customInspect:!0;if(typeof l!=`boolean`&&l!==`symbol`)throw TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(K(c,`indent`)&&c.indent!==null&&c.indent!==` `&&!(parseInt(c.indent,10)===c.indent&&c.indent>0))throw TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(K(c,`numericSeparator`)&&typeof c.numericSeparator!=`boolean`)throw TypeError('option "numericSeparator", if provided, must be `true` or `false`');var f=c.numericSeparator;if(t===void 0)return`undefined`;if(t===null)return`null`;if(typeof t==`boolean`)return t?`true`:`false`;if(typeof t==`string`)return he(t,c);if(typeof t==`number`){if(t===0)return 1/0/t>0?`0`:`-0`;var p=String(t);return f?F(t,p):p}if(typeof t==`bigint`){var m=String(t)+`n`;return f?F(t,m):m}var g=c.depth===void 0?5:c.depth;if(i===void 0&&(i=0),i>=g&&g>0&&typeof t==`object`)return U(t)?`[Array]`:`[Object]`;var _=be(c,i);if(a===void 0)a=[];else if(le(a,t)>=0)return`[Circular]`;function v(t,n,r){if(n&&(a=E.call(a),a.push(n)),r){var o={depth:c.depth};return K(c,`quoteStyle`)&&(o.quoteStyle=c.quoteStyle),e(t,o,i+1,a)}return e(t,c,i+1,a)}if(typeof t==`function`&&!te(t)){var x=ce(t),C=Se(t,v);return`[Function`+(x?`: `+x:` (anonymous)`)+`]`+(C.length>0?` { `+T.call(C,`, `)+` }`:``)}if(ae(t)){var D=j?b.call(String(t),/^(Symbol\(.*\))_[^)]*$/,`$1`):A.call(t);return typeof t==`object`&&!j?Y(D):D}if(J(t)){for(var k=`<`+S.call(String(t.nodeName)),L=t.attributes||[],z=0;z<L.length;z++)k+=` `+L[z].name+`=`+B(V(L[z].value),`double`,c);return k+=`>`,t.childNodes&&t.childNodes.length&&(k+=`...`),k+=`</`+S.call(String(t.nodeName))+`>`,k}if(U(t)){if(t.length===0)return`[]`;var H=Se(t,v);return _&&!ye(H)?`[`+xe(H,_)+`]`:`[ `+T.call(H,`, `)+` ]`}if(ne(t)){var se=Se(t,v);return!(`cause`in Error.prototype)&&`cause`in t&&!N.call(t,`cause`)?`{ [`+String(t)+`] `+T.call(w.call(`[cause]: `+v(t.cause),se),`, `)+` }`:se.length===0?`[`+String(t)+`]`:`{ [`+String(t)+`] `+T.call(se,`, `)+` }`}if(typeof t==`object`&&l){if(ee&&typeof t[ee]==`function`&&I)return I(t,{depth:g-i});if(l!==`symbol`&&typeof t.inspect==`function`)return t.inspect()}if(ue(t)){var ge=[];return s&&s.call(t,function(e,n){ge.push(v(n,t,!0)+` => `+v(e,t))}),ve(`Map`,o.call(t),ge,_)}if(pe(t)){var Ce=[];return d&&d.call(t,function(e){Ce.push(v(e,t))}),ve(`Set`,u.call(t),Ce,_)}if(de(t))return _e(`WeakMap`);if(me(t))return _e(`WeakSet`);if(fe(t))return _e(`WeakRef`);if(re(t))return Y(v(Number(t)));if(oe(t))return Y(v(O.call(t)));if(ie(t))return Y(h.call(t));if(G(t))return Y(v(String(t)));if(typeof window<`u`&&t===window)return`{ [object Window] }`;if(typeof globalThis<`u`&&t===globalThis||n!==void 0&&t===n)return`{ [object globalThis] }`;if(!W(t)&&!te(t)){var we=Se(t,v),Te=P?P(t)===Object.prototype:t instanceof Object||t.constructor===Object,Ee=t instanceof Object?``:`null prototype`,De=!Te&&M&&Object(t)===t&&M in t?y.call(q(t),8,-1):Ee?`Object`:``,Oe=(Te||typeof t.constructor!=`function`?``:t.constructor.name?t.constructor.name+` `:``)+(De||Ee?`[`+T.call(w.call([],De||[],Ee||[]),`: `)+`] `:``);return we.length===0?Oe+`{}`:_?Oe+`{`+xe(we,_)+`}`:Oe+`{ `+T.call(we,`, `)+` }`}return String(t)};function B(e,t,n){var r=R[n.quoteStyle||t];return r+e+r}function V(e){return b.call(String(e),/"/g,`"`)}function H(e){return!M||!(typeof e==`object`&&(M in e||e[M]!==void 0))}function U(e){return q(e)===`[object Array]`&&H(e)}function W(e){return q(e)===`[object Date]`&&H(e)}function te(e){return q(e)===`[object RegExp]`&&H(e)}function ne(e){return q(e)===`[object Error]`&&H(e)}function G(e){return q(e)===`[object String]`&&H(e)}function re(e){return q(e)===`[object Number]`&&H(e)}function ie(e){return q(e)===`[object Boolean]`&&H(e)}function ae(e){if(j)return e&&typeof e==`object`&&e instanceof Symbol;if(typeof e==`symbol`)return!0;if(!e||typeof e!=`object`||!A)return!1;try{return A.call(e),!0}catch{}return!1}function oe(e){if(!e||typeof e!=`object`||!O)return!1;try{return O.call(e),!0}catch{}return!1}var se=Object.prototype.hasOwnProperty||function(e){return e in this};function K(e,t){return se.call(e,t)}function q(e){return g.call(e)}function ce(e){if(e.name)return e.name;var t=v.call(_.call(e),/^function\s*([\w$]+)/);return t?t[1]:null}function le(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}function ue(e){if(!o||!e||typeof e!=`object`)return!1;try{o.call(e);try{u.call(e)}catch{return!0}return e instanceof Map}catch{}return!1}function de(e){if(!f||!e||typeof e!=`object`)return!1;try{f.call(e,f);try{p.call(e,p)}catch{return!0}return e instanceof WeakMap}catch{}return!1}function fe(e){if(!m||!e||typeof e!=`object`)return!1;try{return m.call(e),!0}catch{}return!1}function pe(e){if(!u||!e||typeof e!=`object`)return!1;try{u.call(e);try{o.call(e)}catch{return!0}return e instanceof Set}catch{}return!1}function me(e){if(!p||!e||typeof e!=`object`)return!1;try{p.call(e,p);try{f.call(e,f)}catch{return!0}return e instanceof WeakSet}catch{}return!1}function J(e){return!e||typeof e!=`object`?!1:typeof HTMLElement<`u`&&e instanceof HTMLElement?!0:typeof e.nodeName==`string`&&typeof e.getAttribute==`function`}function he(e,t){if(e.length>t.maxStringLength){var n=e.length-t.maxStringLength,r=`... `+n+` more character`+(n>1?`s`:``);return he(y.call(e,0,t.maxStringLength),t)+r}var i=z[t.quoteStyle||`single`];return i.lastIndex=0,B(b.call(b.call(e,i,`\\$1`),/[\x00-\x1f]/g,ge),`single`,t)}function ge(e){var t=e.charCodeAt(0),n={8:`b`,9:`t`,10:`n`,12:`f`,13:`r`}[t];return n?`\\`+n:`\\x`+(t<16?`0`:``)+x.call(t.toString(16))}function Y(e){return`Object(`+e+`)`}function _e(e){return e+` { ? }`}function ve(e,t,n,r){var i=r?xe(n,r):T.call(n,`, `);return e+` (`+t+`) {`+i+`}`}function ye(e){for(var t=0;t<e.length;t++)if(le(e[t],`
|
|
9
|
+
`);c.length>0&&c[c.length-1]===``&&c.pop();let u=0,d=[];for(let e=0;e<c.length;e++){let n=c[e],r,i=[];l&&!t?(i=O(n),r=i.length>0):r=D(n),r!==t&&(u++,d.push({text:n,num:e+1,segments:i}))}if(a){u===0&&(this.stdOut=e||`(standard input)`,E=!0);continue}if(u>0&&(E=!0),!o){if(i){u>0&&(this.stdOut=e||`(standard input)`);continue}if(r){let t=T&&e?`${e}:`:``;this.stdOut=`${t}${u}`;continue}for(let{text:t,num:r,segments:i}of d){let a=T&&e?`${e}:`:``,o=n?`${r}:`:``;if(l)for(let e of i)this.stdOut=`${a}${o}${e}`;else this.stdOut=`${a}${o}${t}`}}}return S&&!(o&&E)?this.exitCode=2:E||(this.exitCode=1),Promise.resolve()}}})),he=t(((e,t)=>{var n=M();t.exports=class extends n{get name(){return`true`}run(){return Promise.resolve()}}})),ge=t(((e,t)=>{var n=M();t.exports=class extends n{get name(){return`false`}run(){return this.exitCode=1,Promise.resolve()}}})),Y=t(((e,t)=>{var{Test:n,TestBracket:r}=K();t.exports=[q(),pe(),me(),J(),he(),ge(),n,r]})),_e=t(((e,t)=>{var n=N();t.exports=class extends n{run(){if(this.arguments.length!==1)return Promise.reject(`alias requires a single argument`);let e=this.arguments[0].split(`=`);return e.length===2?(this.context.setAlias(e[0],e[1]),Promise.resolve()):Promise.reject(`alias requires a key and value delimited by '=' ie: key=value`)}}})),ve=t(((e,t)=>{var n=N();t.exports=class extends n{run(){if(this.arguments.length!==1)return Promise.reject(`export requires a single argument`);let e=this.arguments[0].split(`=`);return e.length!==2&&Promise.reject(`export requires a key and value delimited by '=' ie: key=value`),this.context.setVar(e[0],e[1]),Promise.resolve()}}})),ye=t(((e,t)=>{var n=N();t.exports=class extends n{run(){if(this.arguments.length!==1)return Promise.reject(`cd requires a single argument`);let e=this.context.fs.getFileByPath(this.arguments[0]);return e?e.constructor===Object?(this.context.setCwd(this.arguments[0]),Promise.resolve()):Promise.reject(`${this.arguments[0]}: Not a directory`):Promise.reject(`file or directory not found`)}}})),be=t(((e,t)=>{var n=N();t.exports=class extends n{get name(){return`chmod`}get requiresFilesystem(){return!0}run(){let e=this.arguments;if(e.length<2)return this.stdErr=`chmod: usage: chmod MODE FILE...`,this.exitCode=1,Promise.resolve();let t=e[0],n=e.slice(1);for(let e of n){if(this.fs.getFileByPath(e)==null){this.stdErr=`chmod: cannot access '${e}': No such file or directory`,this.exitCode=1;continue}let n=this.fs.getMode(e),r=this._parseMode(t,n===null?420:n);if(r===null)return this.stdErr=`chmod: invalid mode: '${t}'`,this.exitCode=1,Promise.resolve();this.fs.setMode(e,r)}return Promise.resolve()}_parseMode(e,t){if(/^0?[0-7]{3,4}$/.test(e))return parseInt(e,8);let n=e.match(/^([ugoa]*)([+\-=])([rwx]+)$/);if(!n)return null;let[,r,i,a]=n,o=!r||r===`a`?[`u`,`g`,`o`]:r.split(``),s={u:256,g:32,o:4},c={u:128,g:16,o:2},l={u:64,g:8,o:1},u=0;for(let e of o)a.includes(`r`)&&(u|=s[e]),a.includes(`w`)&&(u|=c[e]),a.includes(`x`)&&(u|=l[e]);if(i===`+`)return t|u;if(i===`-`)return t&~u;if(i===`=`){let e=0;for(let t of o)e|=s[t]|c[t]|l[t];return t&~e|u}return null}}})),xe=t(((e,t)=>{var n=N(),r=T();t.exports=class extends n{get name(){return`cp`}get requiresFilesystem(){return!0}run(){let e=!1,t=null,n=!1,r=!1,i=null,a=[],o=[...this.arguments],s=0;for(;s<o.length;){let c=o[s];if(c===`--`){s++;break}if(c.startsWith(`-`)&&c.length>1)for(let a of c.slice(1))switch(a){case`r`:case`R`:e=!0,n=!0;break;case`a`:e=!0,n=!0,t=`preserve`,i=`preserve`;break;case`d`:case`P`:t=`preserve`,i=`preserve`;break;case`L`:t=`follow`,i=`follow`;break;case`H`:t=`follow_cl`,r=!0;break;case`f`:break}else a.push(c);s++}for(;s<o.length;)a.push(o[s++]);let c=t===null?n?`preserve`:`follow`:t;if(a.length<2)return this.stdErr=`cp: missing destination file operand${a.length?` after '${a[0]}'`:``}`,this.exitCode=1,Promise.resolve();let l=a[a.length-1],u=a.slice(0,-1),d=this.fs.getFileByPath(l),f=d!=null&&d.constructor===Object,p=r||c===`follow_cl`?`follow`:c,m=r||c===`follow_cl`?i===null?`preserve`:i:c;for(let t of u){let n=this.fs.isSymlink?this.fs.isSymlink(t):!1,r=this.fs.getFileByPath(t);if(r==null){this.stdErr=`cp: cannot stat '${t}': No such file or directory`,this.exitCode=1;continue}if(!(n&&p===`preserve`)&&r.constructor===Object&&!e){this.stdErr=`cp: omitting directory '${t}'`,this.exitCode=1;continue}let i=f?l.replace(/\/$/,``)+`/`+t.split(`/`).pop():l,a=this._copy(t,i,p,n,m);a&&(this.stdErr=a,this.exitCode=1)}return Promise.resolve()}_copy(e,t,n,i,a){if(i&&n===`preserve`&&this.fs.readSymlink){let n=this.fs.readSymlink(e);if(n===null)return`cp: cannot read symlink '${e}'`;try{this.fs.createSymlink(n,t)}catch(e){return`cp: cannot create symlink '${t}': ${e.message}`}return null}let o=this.fs.getFileByPath(e);if(o==null)return`cp: cannot stat '${e}': No such file or directory`;if(o.constructor===Object){try{this.fs.setFileByPath(t,{},!0)}catch(e){return`cp: cannot create directory '${t}': ${e.message}`}let n=this.fs.absolutePath(e),i;try{i=r.readdirSync(n)}catch{i=Object.keys(o)}for(let n of i){let r=e.replace(/\/$/,``)+`/`+n,i=t.replace(/\/$/,``)+`/`+n,o=this.fs.isSymlink?this.fs.isSymlink(r):!1,s=this._copy(r,i,a,o,a);s&&(this.stdErr=s,this.exitCode=1)}}else this.fs.setFileByPath(t,o,!0);return null}}})),Se=t(((e,t)=>{var n=N();t.exports=class extends n{get name(){return`mkdir`}get requiresFilesystem(){return!0}run(){let e=!1,t=[];for(let n of this.arguments)n===`-p`||n===`--parents`?e=!0:t.push(n);if(t.length===0)return this.stdErr=`mkdir: missing operand`,this.exitCode=1,Promise.resolve();for(let n of t){if(this.fs.getFileByPath(n)!=null){e||(this.stdErr=`mkdir: cannot create directory '${n}': File exists`,this.exitCode=1);continue}try{this.fs.setFileByPath(n,{},e)}catch(e){this.stdErr=`mkdir: cannot create directory '${n}': ${e.message}`,this.exitCode=1}}return Promise.resolve()}}})),Ce=t(((e,t)=>{var n=N(),r=T();t.exports=class extends n{get name(){return`mv`}get requiresFilesystem(){return!0}run(){let e=null,t=[],n=[...this.arguments],i=0;for(;i<n.length;){let r=n[i];if(r===`--`){i++;break}if(r.startsWith(`-`)&&r.length>1)for(let t=1;t<r.length;t++)switch(r[t]){case`f`:case`i`:case`n`:break;case`t`:{let a=r.slice(t+1);e=a.length>0?a:n[++i],t=r.length;break}}else t.push(r);i++}for(;i<n.length;)t.push(n[i++]);let a=e===null?t[t.length-1]:e,o=e===null?t.slice(0,-1):t;if(!a||o.length===0)return this.stdErr=`mv: missing destination file operand${o.length?` after '${o[0]}'`:``}`,this.exitCode=1,Promise.resolve();let s=this.fs.getFileByPath(a),c=s!=null&&s.constructor===Object;for(let e of o){let t=c?a.replace(/\/$/,``)+`/`+e.split(`/`).pop():a;if(this.fs.isRealFilesystem){let n=this.fs.absolutePath(e),i=this.fs.absolutePath(t);try{r.lstatSync(n)}catch{this.stdErr=`mv: cannot stat '${e}': No such file or directory`,this.exitCode=1;continue}try{let e=E();r.mkdirSync(e.dirname(i),{recursive:!0}),r.renameSync(n,i)}catch(n){this.stdErr=`mv: cannot move '${e}' to '${t}': ${n.message}`,this.exitCode=1}}else{let n=this.fs.getFileByPath(e);if(n==null){this.stdErr=`mv: cannot stat '${e}': No such file or directory`,this.exitCode=1;continue}this.fs.setFileByPath(t,this._deepCopy(n),!0),this.fs.deleteFileByPath(e)}}return Promise.resolve()}_deepCopy(e){if(e==null||typeof e==`function`||typeof e!=`object`)return e;let t={};for(let[n,r]of Object.entries(e))t[n]=this._deepCopy(r);return t}}})),we=t(((e,t)=>{var n=N();t.exports=class extends n{run(){let e=this.context.fs.cwd;return this.stdOut=e.endsWith(`/`)&&e!==`/`?e.slice(0,-1):e,Promise.resolve()}}})),Te=t(((e,t)=>{var n=N(),r=T();t.exports=class extends n{get name(){return`rm`}get requiresFilesystem(){return!0}run(){let e=!1,t=!1,n=[];for(let r of this.arguments)/^-[rRf]+$/.test(r)?((r.includes(`r`)||r.includes(`R`))&&(e=!0),r.includes(`f`)&&(t=!0)):n.push(r);if(n.length===0)return t||(this.stdErr=`rm: missing operand`,this.exitCode=1),Promise.resolve();for(let r of n)try{this._remove(r,e,t)}catch(e){this.stdErr=e.message,this.exitCode=1}return Promise.resolve()}_remove(e,t,n){if(!(this.fs.isSymlink&&this.fs.isSymlink(e))){let i=this.fs.getFileByPath(e);if(i==null){if(!n)throw Error(`rm: cannot remove '${e}': No such file or directory`);return}if(i.constructor===Object){if(!t)throw Error(`rm: cannot remove '${e}': Is a directory`);let a;if(this.fs.isRealFilesystem)try{a=r.readdirSync(this.fs.absolutePath(e))}catch{a=[]}else a=Object.keys(i);for(let r of a){let i=e.replace(/\/$/,``)+`/`+r;this._remove(i,t,n)}}}this.fs.deleteFileByPath(e)}}})),Ee=t(((e,t)=>{var n=N();t.exports=class extends n{run(){if(this.arguments.length!==1)return Promise.reject(`which requires a single argument`);let e=this.context.fs.getFileByPath(`${this.context.getVar(`PATH`)}/${this.arguments[0]}`);return!e||e.constructor===Object||e.constructor===String?Promise.reject():Promise.resolve(`${this.context.getVar(`PATH`)}/${this.arguments[0]}`)}}})),De=t(((e,t)=>{var n=P(),r=N();t.exports=class extends r{constructor(e,t){if(super(e,t),this.arguments.length!==1)return Promise.reject(`source requires a single argument`);let r=this.arguments[0];if(r.startsWith(`./`)||r.startsWith(`/`)){let i=this.context.fs.getFileByPath(r);if(i&&i.constructor===String&&i.startsWith(`#!`))return new n(i,e,t,!0)}}run(){let e=this.arguments[0];if(e.startsWith(`./`)||e.startsWith(`/`)){let t=this.context.fs.getFileByPath(e);if(!t)return Promise.reject(`${e}: No such file or directory`);if(t.constructor===Object)return Promise.reject(`${e}: is a directory`);if(t.prototype&&typeof t.prototype.run==`function`&&typeof t.prototype.runCommand==`function`)return Promise.reject(`${e}: command not found`);if(t.constructor===String&&t.startsWith(`#!`))return Promise.reject(`FATAL: should not get here`)}return Promise.reject(`${e}: permission denied`)}}})),Oe=t(((e,t)=>{var n=N();t.exports=class extends n{run(){return this.arguments.length>0?Promise.reject(`clear does not require arguments`):(this.context.clear(),Promise.resolve())}}})),ke=t(((e,t)=>{var n=N();t.exports=class extends n{run(){let e=parseInt(this.arguments[0])||0;return this.exitCode=e,this.context.destroy(e),Promise.resolve()}}})),Ae=t(((e,t)=>{var n=N(),r=fe();t.exports=class extends n{get requiresFilesystem(){return!1}get captureInput(){return!0}run(){let e;try{e=this.parseArgs()}catch(e){return this.printHelp(e),Promise.reject()}return e.help?(this.printHelp(),Promise.resolve()):(this.nchars=e.nchars,this.var=e.name,new Promise(t=>{let n=setTimeout(()=>{t(),this.exitCode=1},e.timeout?e.timeout*1e3:864e5);this.completionCallback=e=>{clearTimeout(n),t(e)},this.stdErr=e.prompt||``,this.flush()}))}onInput(e){if(this.inputBuffer||=``,e.length===1&&(this.inputBuffer+=e),this.inputBuffer.length===this.nchars){if(this.var){this.context.setVar(this.var,this.inputBuffer),this.completionCallback();return}this.completionCallback(this.inputBuffer)}}printHelp(e){e&&(this.stdOut=e.message),this.stdOut=`usage: read [-n nchars] [-p prompt] [-t timeout] [name ...]`}parseArgs(){return r([{name:`prompt`,alias:`p`,type:String},{name:`nchars`,alias:`n`,type:Number},{name:`timeout`,alias:`t`,type:Number},{name:`help`,alias:`h`,type:Boolean},{defaultOption:!0,name:`name`,type:String}],{argv:this.arguments})}}})),je=t(((e,t)=>{var n=N(),r=M();t.exports=class extends n{get name(){return`jsfunction`}run(){let[e,...t]=this.arguments;if(!e||t.length===0)return this.stdErr=`usage: jsfunction <name> <function-body>`,this.exitCode=1,Promise.resolve();let n=t.join(` `),i;try{if(i=Function(`return (`+n+`)`)(),typeof i!=`function`)throw Error(`expression is not a function`)}catch(e){return this.stdErr=`jsfunction: ${e.message}`,this.exitCode=1,Promise.resolve()}class a extends r{run(){let e;try{e=i(this.arguments)}catch(e){return this.stdErr=e.message||String(e),this.exitCode=1,Promise.resolve()}return e&&typeof e.then==`function`?e.then(e=>{e!=null&&(this.stdOut=String(e))}).catch(e=>{this.stdErr=e.message||String(e),this.exitCode=1}):(e!=null&&(this.stdOut=String(e)),Promise.resolve())}}return Object.defineProperty(a,"name",{value:e,configurable:!0}),this.context.setCommand(a),Promise.resolve()}}})),Me=t(((e,t)=>{var n=N();t.exports=class extends n{get name(){return`curl`}get requiresFilesystem(){return!0}run(){let e=[...this.arguments],t=null,n={},r=null,i=!1,a=!1,o=null,s=null,c=0;for(;c<e.length;){let l=e[c];switch(l){case`-X`:case`--request`:t=e[++c];break;case`-H`:case`--header`:{let t=e[++c]||``,r=t.indexOf(`:`);r>0&&(n[t.slice(0,r).trim()]=t.slice(r+1).trim());break}case`-d`:case`--data`:case`--data-raw`:r=e[++c],t||=`POST`;break;case`-u`:case`--user`:{let t=e[++c]||``;n.Authorization=`Basic `+btoa(t);break}case`-o`:case`--output`:o=e[++c];break;case`-i`:case`--include`:i=!0;break;case`-s`:case`--silent`:a=!0;break;case`-L`:case`--location`:break;default:l.startsWith(`-`)?a||(this.stdErr=`curl: unknown option '${l}'`):s=l}c++}if(!s)return this.stdErr=`curl: no URL specified`,this.exitCode=1,Promise.resolve();if(!/^https?:\/\//i.test(s))return this.stdErr=`curl: unsupported protocol in URL: ${s}`,this.exitCode=1,Promise.resolve();let l={method:t||`GET`,headers:n};return r!==null&&(l.body=r),fetch(s,l).then(async e=>{i&&(this.stdOut=`HTTP/1.1 ${e.status} ${e.statusText}`,e.headers.forEach((e,t)=>{this.stdOut=`${t}: ${e}`}),this.stdOut=``);let t=await e.text();o?this.fs.setFileByPath(o,t,!1):t.split(/\r?\n/).forEach(e=>{this.stdOut=e}),e.ok||(this.exitCode=22)}).catch(e=>{if(!a){let t=e&&e.message?e.message:String(e);if(e instanceof TypeError&&/failed to fetch|networkerror|load failed|fetch is aborted/i.test(t)){let e=/^https:\/\//i.test(s),t=typeof location<`u`&&location.protocol===`https:`;!e&&t?this.stdErr=`curl: (35) Mixed content blocked — the page is served over HTTPS but the target URL is HTTP. Browsers block insecure requests from secure pages.`:(this.stdErr=`curl: (6) Network request failed — this is likely a CORS error. The server at ${s} did not include the required 'Access-Control-Allow-Origin' response header. You can only fetch cross-origin resources that explicitly allow it.`,this.stdErr=` Hint: try a public CORS proxy, or ensure the server sends 'Access-Control-Allow-Origin: *'.`)}else this.stdErr=`curl: (6) Could not connect: ${t}`}this.exitCode=6})}}})),Ne=t(((e,t)=>{t.exports=[_e(),ve(),ye(),be(),xe(),Se(),Ce(),we(),Te(),Ee(),De(),Oe(),ke(),Ae(),je(),Me()]})),Pe=t(((e,t)=>{t.exports=Object})),Fe=t(((e,t)=>{t.exports=Error})),Ie=t(((e,t)=>{t.exports=EvalError})),Le=t(((e,t)=>{t.exports=RangeError})),Re=t(((e,t)=>{t.exports=ReferenceError})),ze=t(((e,t)=>{t.exports=SyntaxError})),X=t(((e,t)=>{t.exports=TypeError})),Be=t(((e,t)=>{t.exports=URIError})),Ve=t(((e,t)=>{t.exports=Math.abs})),He=t(((e,t)=>{t.exports=Math.floor})),Ue=t(((e,t)=>{t.exports=Math.max})),We=t(((e,t)=>{t.exports=Math.min})),Ge=t(((e,t)=>{t.exports=Math.pow})),Ke=t(((e,t)=>{t.exports=Math.round})),qe=t(((e,t)=>{t.exports=Number.isNaN||function(e){return e!==e}})),Je=t(((e,t)=>{var n=qe();t.exports=function(e){return n(e)||e===0?e:e<0?-1:1}})),Ye=t(((e,t)=>{t.exports=Object.getOwnPropertyDescriptor})),Xe=t(((e,t)=>{var n=Ye();if(n)try{n([],`length`)}catch{n=null}t.exports=n})),Ze=t(((e,t)=>{var n=Object.defineProperty||!1;if(n)try{n({},`a`,{value:1})}catch{n=!1}t.exports=n})),Qe=t(((e,t)=>{t.exports=function(){if(typeof Symbol!=`function`||typeof Object.getOwnPropertySymbols!=`function`)return!1;if(typeof Symbol.iterator==`symbol`)return!0;var e={},t=Symbol(`test`),n=Object(t);if(typeof t==`string`||Object.prototype.toString.call(t)!==`[object Symbol]`||Object.prototype.toString.call(n)!==`[object Symbol]`)return!1;var r=42;for(var i in e[t]=r,e)return!1;if(typeof Object.keys==`function`&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames==`function`&&Object.getOwnPropertyNames(e).length!==0)return!1;var a=Object.getOwnPropertySymbols(e);if(a.length!==1||a[0]!==t||!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if(typeof Object.getOwnPropertyDescriptor==`function`){var o=Object.getOwnPropertyDescriptor(e,t);if(o.value!==r||o.enumerable!==!0)return!1}return!0}})),$e=t(((e,t)=>{var n=typeof Symbol<`u`&&Symbol,r=Qe();t.exports=function(){return typeof n!=`function`||typeof Symbol!=`function`||typeof n(`foo`)!=`symbol`||typeof Symbol(`bar`)!=`symbol`?!1:r()}})),et=t(((e,t)=>{t.exports=typeof Reflect<`u`&&Reflect.getPrototypeOf||null})),tt=t(((e,t)=>{t.exports=Pe().getPrototypeOf||null})),nt=t(((e,t)=>{var n=`Function.prototype.bind called on incompatible `,r=Object.prototype.toString,i=Math.max,a=`[object Function]`,o=function(e,t){for(var n=[],r=0;r<e.length;r+=1)n[r]=e[r];for(var i=0;i<t.length;i+=1)n[i+e.length]=t[i];return n},s=function(e,t){for(var n=[],r=t||0,i=0;r<e.length;r+=1,i+=1)n[i]=e[r];return n},c=function(e,t){for(var n=``,r=0;r<e.length;r+=1)n+=e[r],r+1<e.length&&(n+=t);return n};t.exports=function(e){var t=this;if(typeof t!=`function`||r.apply(t)!==a)throw TypeError(n+t);for(var l=s(arguments,1),u,d=function(){if(this instanceof u){var n=t.apply(this,o(l,arguments));return Object(n)===n?n:this}return t.apply(e,o(l,arguments))},f=i(0,t.length-l.length),p=[],m=0;m<f;m++)p[m]=`$`+m;if(u=Function(`binder`,`return function (`+c(p,`,`)+`){ return binder.apply(this,arguments); }`)(d),t.prototype){var h=function(){};h.prototype=t.prototype,u.prototype=new h,h.prototype=null}return u}})),rt=t(((e,t)=>{var n=nt();t.exports=Function.prototype.bind||n})),it=t(((e,t)=>{t.exports=Function.prototype.call})),at=t(((e,t)=>{t.exports=Function.prototype.apply})),ot=t(((e,t)=>{t.exports=typeof Reflect<`u`&&Reflect&&Reflect.apply})),st=t(((e,t)=>{var n=rt(),r=at(),i=it();t.exports=ot()||n.call(i,r)})),ct=t(((e,t)=>{var n=rt(),r=X(),i=it(),a=st();t.exports=function(e){if(e.length<1||typeof e[0]!=`function`)throw new r(`a function is required`);return a(n,i,e)}})),lt=t(((e,t)=>{var n=ct(),r=Xe(),i;try{i=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!=`object`||!(`code`in e)||e.code!==`ERR_PROTO_ACCESS`)throw e}var a=!!i&&r&&r(Object.prototype,`__proto__`),o=Object,s=o.getPrototypeOf;t.exports=a&&typeof a.get==`function`?n([a.get]):typeof s==`function`?function(e){return s(e==null?e:o(e))}:!1})),ut=t(((e,t)=>{var n=et(),r=tt(),i=lt();t.exports=n?function(e){return n(e)}:r?function(e){if(!e||typeof e!=`object`&&typeof e!=`function`)throw TypeError(`getProto: not an object`);return r(e)}:i?function(e){return i(e)}:null})),dt=t(((e,t)=>{var n=Function.prototype.call,r=Object.prototype.hasOwnProperty;t.exports=rt().call(n,r)})),Z=t(((e,t)=>{var n,r=Pe(),i=Fe(),a=Ie(),o=Le(),s=Re(),c=ze(),l=X(),u=Be(),d=Ve(),f=He(),p=Ue(),m=We(),h=Ge(),g=Ke(),_=Je(),v=Function,y=function(e){try{return v(`"use strict"; return (`+e+`).constructor;`)()}catch{}},b=Xe(),x=Ze(),S=function(){throw new l},C=b?function(){try{return arguments.callee,S}catch{try{return b(arguments,`callee`).get}catch{return S}}}():S,w=$e()(),T=ut(),E=tt(),D=et(),O=at(),k=it(),A={},j=typeof Uint8Array>`u`||!T?n:T(Uint8Array),M={__proto__:null,"%AggregateError%":typeof AggregateError>`u`?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>`u`?n:ArrayBuffer,"%ArrayIteratorPrototype%":w&&T?T([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":A,"%AsyncGenerator%":A,"%AsyncGeneratorFunction%":A,"%AsyncIteratorPrototype%":A,"%Atomics%":typeof Atomics>`u`?n:Atomics,"%BigInt%":typeof BigInt>`u`?n:BigInt,"%BigInt64Array%":typeof BigInt64Array>`u`?n:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>`u`?n:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>`u`?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":i,"%eval%":eval,"%EvalError%":a,"%Float16Array%":typeof Float16Array>`u`?n:Float16Array,"%Float32Array%":typeof Float32Array>`u`?n:Float32Array,"%Float64Array%":typeof Float64Array>`u`?n:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>`u`?n:FinalizationRegistry,"%Function%":v,"%GeneratorFunction%":A,"%Int8Array%":typeof Int8Array>`u`?n:Int8Array,"%Int16Array%":typeof Int16Array>`u`?n:Int16Array,"%Int32Array%":typeof Int32Array>`u`?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":w&&T?T(T([][Symbol.iterator]())):n,"%JSON%":typeof JSON==`object`?JSON:n,"%Map%":typeof Map>`u`?n:Map,"%MapIteratorPrototype%":typeof Map>`u`||!w||!T?n:T(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":r,"%Object.getOwnPropertyDescriptor%":b,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>`u`?n:Promise,"%Proxy%":typeof Proxy>`u`?n:Proxy,"%RangeError%":o,"%ReferenceError%":s,"%Reflect%":typeof Reflect>`u`?n:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>`u`?n:Set,"%SetIteratorPrototype%":typeof Set>`u`||!w||!T?n:T(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>`u`?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":w&&T?T(``[Symbol.iterator]()):n,"%Symbol%":w?Symbol:n,"%SyntaxError%":c,"%ThrowTypeError%":C,"%TypedArray%":j,"%TypeError%":l,"%Uint8Array%":typeof Uint8Array>`u`?n:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>`u`?n:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>`u`?n:Uint16Array,"%Uint32Array%":typeof Uint32Array>`u`?n:Uint32Array,"%URIError%":u,"%WeakMap%":typeof WeakMap>`u`?n:WeakMap,"%WeakRef%":typeof WeakRef>`u`?n:WeakRef,"%WeakSet%":typeof WeakSet>`u`?n:WeakSet,"%Function.prototype.call%":k,"%Function.prototype.apply%":O,"%Object.defineProperty%":x,"%Object.getPrototypeOf%":E,"%Math.abs%":d,"%Math.floor%":f,"%Math.max%":p,"%Math.min%":m,"%Math.pow%":h,"%Math.round%":g,"%Math.sign%":_,"%Reflect.getPrototypeOf%":D};if(T)try{null.error}catch(e){M[`%Error.prototype%`]=T(T(e))}var N=function e(t){var n;if(t===`%AsyncFunction%`)n=y(`async function () {}`);else if(t===`%GeneratorFunction%`)n=y(`function* () {}`);else if(t===`%AsyncGeneratorFunction%`)n=y(`async function* () {}`);else if(t===`%AsyncGenerator%`){var r=e(`%AsyncGeneratorFunction%`);r&&(n=r.prototype)}else if(t===`%AsyncIteratorPrototype%`){var i=e(`%AsyncGenerator%`);i&&T&&(n=T(i.prototype))}return M[t]=n,n},P={__proto__:null,"%ArrayBufferPrototype%":[`ArrayBuffer`,`prototype`],"%ArrayPrototype%":[`Array`,`prototype`],"%ArrayProto_entries%":[`Array`,`prototype`,`entries`],"%ArrayProto_forEach%":[`Array`,`prototype`,`forEach`],"%ArrayProto_keys%":[`Array`,`prototype`,`keys`],"%ArrayProto_values%":[`Array`,`prototype`,`values`],"%AsyncFunctionPrototype%":[`AsyncFunction`,`prototype`],"%AsyncGenerator%":[`AsyncGeneratorFunction`,`prototype`],"%AsyncGeneratorPrototype%":[`AsyncGeneratorFunction`,`prototype`,`prototype`],"%BooleanPrototype%":[`Boolean`,`prototype`],"%DataViewPrototype%":[`DataView`,`prototype`],"%DatePrototype%":[`Date`,`prototype`],"%ErrorPrototype%":[`Error`,`prototype`],"%EvalErrorPrototype%":[`EvalError`,`prototype`],"%Float32ArrayPrototype%":[`Float32Array`,`prototype`],"%Float64ArrayPrototype%":[`Float64Array`,`prototype`],"%FunctionPrototype%":[`Function`,`prototype`],"%Generator%":[`GeneratorFunction`,`prototype`],"%GeneratorPrototype%":[`GeneratorFunction`,`prototype`,`prototype`],"%Int8ArrayPrototype%":[`Int8Array`,`prototype`],"%Int16ArrayPrototype%":[`Int16Array`,`prototype`],"%Int32ArrayPrototype%":[`Int32Array`,`prototype`],"%JSONParse%":[`JSON`,`parse`],"%JSONStringify%":[`JSON`,`stringify`],"%MapPrototype%":[`Map`,`prototype`],"%NumberPrototype%":[`Number`,`prototype`],"%ObjectPrototype%":[`Object`,`prototype`],"%ObjProto_toString%":[`Object`,`prototype`,`toString`],"%ObjProto_valueOf%":[`Object`,`prototype`,`valueOf`],"%PromisePrototype%":[`Promise`,`prototype`],"%PromiseProto_then%":[`Promise`,`prototype`,`then`],"%Promise_all%":[`Promise`,`all`],"%Promise_reject%":[`Promise`,`reject`],"%Promise_resolve%":[`Promise`,`resolve`],"%RangeErrorPrototype%":[`RangeError`,`prototype`],"%ReferenceErrorPrototype%":[`ReferenceError`,`prototype`],"%RegExpPrototype%":[`RegExp`,`prototype`],"%SetPrototype%":[`Set`,`prototype`],"%SharedArrayBufferPrototype%":[`SharedArrayBuffer`,`prototype`],"%StringPrototype%":[`String`,`prototype`],"%SymbolPrototype%":[`Symbol`,`prototype`],"%SyntaxErrorPrototype%":[`SyntaxError`,`prototype`],"%TypedArrayPrototype%":[`TypedArray`,`prototype`],"%TypeErrorPrototype%":[`TypeError`,`prototype`],"%Uint8ArrayPrototype%":[`Uint8Array`,`prototype`],"%Uint8ClampedArrayPrototype%":[`Uint8ClampedArray`,`prototype`],"%Uint16ArrayPrototype%":[`Uint16Array`,`prototype`],"%Uint32ArrayPrototype%":[`Uint32Array`,`prototype`],"%URIErrorPrototype%":[`URIError`,`prototype`],"%WeakMapPrototype%":[`WeakMap`,`prototype`],"%WeakSetPrototype%":[`WeakSet`,`prototype`]},F=rt(),I=dt(),L=F.call(k,Array.prototype.concat),ee=F.call(O,Array.prototype.splice),R=F.call(k,String.prototype.replace),z=F.call(k,String.prototype.slice),B=F.call(k,RegExp.prototype.exec),V=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,H=/\\(\\)?/g,U=function(e){var t=z(e,0,1),n=z(e,-1);if(t===`%`&&n!==`%`)throw new c("invalid intrinsic syntax, expected closing `%`");if(n===`%`&&t!==`%`)throw new c("invalid intrinsic syntax, expected opening `%`");var r=[];return R(e,V,function(e,t,n,i){r[r.length]=n?R(i,H,`$1`):t||e}),r},W=function(e,t){var n=e,r;if(I(P,n)&&(r=P[n],n=`%`+r[0]+`%`),I(M,n)){var i=M[n];if(i===A&&(i=N(n)),i===void 0&&!t)throw new l(`intrinsic `+e+` exists, but is not available. Please file an issue!`);return{alias:r,name:n,value:i}}throw new c(`intrinsic `+e+` does not exist!`)};t.exports=function(e,t){if(typeof e!=`string`||e.length===0)throw new l(`intrinsic name must be a non-empty string`);if(arguments.length>1&&typeof t!=`boolean`)throw new l(`"allowMissing" argument must be a boolean`);if(B(/^%?[^%]*%?$/,e)===null)throw new c("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=U(e),r=n.length>0?n[0]:``,i=W(`%`+r+`%`,t),a=i.name,o=i.value,s=!1,u=i.alias;u&&(r=u[0],ee(n,L([0,1],u)));for(var d=1,f=!0;d<n.length;d+=1){var p=n[d],m=z(p,0,1),h=z(p,-1);if((m===`"`||m===`'`||m==="`"||h===`"`||h===`'`||h==="`")&&m!==h)throw new c(`property names with quotes must have matching quotes`);if((p===`constructor`||!f)&&(s=!0),r+=`.`+p,a=`%`+r+`%`,I(M,a))o=M[a];else if(o!=null){if(!(p in o)){if(!t)throw new l(`base intrinsic for `+e+` exists, but the property is not available.`);return}if(b&&d+1>=n.length){var g=b(o,p);f=!!g,o=f&&`get`in g&&!(`originalValue`in g.get)?g.get:o[p]}else f=I(o,p),o=o[p];f&&!s&&(M[a]=o)}}return o}})),ft=t(((e,t)=>{var n=Ze(),r=ze(),i=X(),a=Xe();t.exports=function(e,t,o){if(!e||typeof e!=`object`&&typeof e!=`function`)throw new i("`obj` must be an object or a function`");if(typeof t!=`string`&&typeof t!=`symbol`)throw new i("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!=`boolean`&&arguments[3]!==null)throw new i("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!=`boolean`&&arguments[4]!==null)throw new i("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!=`boolean`&&arguments[5]!==null)throw new i("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!=`boolean`)throw new i("`loose`, if provided, must be a boolean");var s=arguments.length>3?arguments[3]:null,c=arguments.length>4?arguments[4]:null,l=arguments.length>5?arguments[5]:null,u=arguments.length>6?arguments[6]:!1,d=!!a&&a(e,t);if(n)n(e,t,{configurable:l===null&&d?d.configurable:!l,enumerable:s===null&&d?d.enumerable:!s,value:o,writable:c===null&&d?d.writable:!c});else if(u||!s&&!c&&!l)e[t]=o;else throw new r(`This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.`)}})),pt=t(((e,t)=>{var n=Ze(),r=function(){return!!n};r.hasArrayLengthDefineBug=function(){if(!n)return null;try{return n([],`length`,{value:1}).length!==1}catch{return!0}},t.exports=r})),mt=t(((e,t)=>{var n=Z(),r=ft(),i=pt()(),a=Xe(),o=X(),s=n(`%Math.floor%`);t.exports=function(e,t){if(typeof e!=`function`)throw new o("`fn` is not a function");if(typeof t!=`number`||t<0||t>4294967295||s(t)!==t)throw new o("`length` must be a positive 32-bit integer");var n=arguments.length>2&&!!arguments[2],c=!0,l=!0;if(`length`in e&&a){var u=a(e,`length`);u&&!u.configurable&&(c=!1),u&&!u.writable&&(l=!1)}return(c||l||!n)&&(i?r(e,`length`,t,!0,!0):r(e,`length`,t)),e}})),ht=t(((e,t)=>{var n=rt(),r=at(),i=st();t.exports=function(){return i(n,r,arguments)}})),gt=t(((e,t)=>{var n=mt(),r=Ze(),i=ct(),a=ht();t.exports=function(e){var t=i(arguments),r=1+e.length-(arguments.length-1);return n(t,r>0?r:0,!0)},r?r(t.exports,`apply`,{value:a}):t.exports.apply=a})),_t=t(((e,t)=>{var n=Object.prototype.toString;t.exports=function(e){var t=n.call(e),r=t===`[object Arguments]`;return r||=t!==`[object Array]`&&typeof e==`object`&&!!e&&typeof e.length==`number`&&e.length>=0&&n.call(e.callee)===`[object Function]`,r}})),vt=t(((e,t)=>{var n;if(!Object.keys){var r=Object.prototype.hasOwnProperty,i=Object.prototype.toString,a=_t(),o=Object.prototype.propertyIsEnumerable,s=!o.call({toString:null},`toString`),c=o.call(function(){},`prototype`),l=[`toString`,`toLocaleString`,`valueOf`,`hasOwnProperty`,`isPrototypeOf`,`propertyIsEnumerable`,`constructor`],u=function(e){var t=e.constructor;return t&&t.prototype===e},d={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},f=function(){if(typeof window>`u`)return!1;for(var e in window)try{if(!d[`$`+e]&&r.call(window,e)&&window[e]!==null&&typeof window[e]==`object`)try{u(window[e])}catch{return!0}}catch{return!0}return!1}(),p=function(e){if(typeof window>`u`||!f)return u(e);try{return u(e)}catch{return!1}};n=function(e){var t=typeof e==`object`&&!!e,n=i.call(e)===`[object Function]`,o=a(e),u=t&&i.call(e)===`[object String]`,d=[];if(!t&&!n&&!o)throw TypeError(`Object.keys called on a non-object`);var f=c&&n;if(u&&e.length>0&&!r.call(e,0))for(var m=0;m<e.length;++m)d.push(String(m));if(o&&e.length>0)for(var h=0;h<e.length;++h)d.push(String(h));else for(var g in e)!(f&&g===`prototype`)&&r.call(e,g)&&d.push(String(g));if(s)for(var _=p(e),v=0;v<l.length;++v)!(_&&l[v]===`constructor`)&&r.call(e,l[v])&&d.push(l[v]);return d}}t.exports=n})),yt=t(((e,t)=>{var n=Array.prototype.slice,r=_t(),i=Object.keys,a=i?function(e){return i(e)}:vt(),o=Object.keys;a.shim=function(){return Object.keys?function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2)||(Object.keys=function(e){return r(e)?o(n.call(e)):o(e)}):Object.keys=a,Object.keys||a},t.exports=a})),bt=t(((e,t)=>{var n=yt(),r=typeof Symbol==`function`&&typeof Symbol(`foo`)==`symbol`,i=Object.prototype.toString,a=Array.prototype.concat,o=ft(),s=function(e){return typeof e==`function`&&i.call(e)===`[object Function]`},c=pt()(),l=function(e,t,n,r){if(t in e){if(r===!0){if(e[t]===n)return}else if(!s(r)||!r())return}c?o(e,t,n,!0):o(e,t,n)},u=function(e,t){var i=arguments.length>2?arguments[2]:{},o=n(t);r&&(o=a.call(o,Object.getOwnPropertySymbols(t)));for(var s=0;s<o.length;s+=1)l(e,o[s],t[o[s]],i[o[s]])};u.supportsDescriptors=!!c,t.exports=u})),Q=t(((e,t)=>{var n=Z(),r=ct(),i=r([n(`%String.prototype.indexOf%`)]);t.exports=function(e,t){var a=n(e,!!t);return typeof a==`function`&&i(e,`.prototype.`)>-1?r([a]):a}})),xt=t(((e,t)=>{var n=Z()(`%Array%`),r=!n.isArray&&Q()(`Object.prototype.toString`);t.exports=n.isArray||function(e){return r(e)===`[object Array]`}})),St=t(((e,t)=>{t.exports=xt()})),Ct=t(((e,t)=>{var n=Z(),r=Q(),i=X(),a=St(),o=n(`%Reflect.apply%`,!0)||r(`Function.prototype.apply`);t.exports=function(e,t){var n=arguments.length>2?arguments[2]:[];if(!a(n))throw new i("Assertion failed: optional `argumentsList`, if provided, must be a List");return o(e,t,n)}})),wt=t(((e,t)=>{t.exports={}})),Tt=t(((e,t)=>{r();var i=typeof Map==`function`&&Map.prototype,a=Object.getOwnPropertyDescriptor&&i?Object.getOwnPropertyDescriptor(Map.prototype,`size`):null,o=i&&a&&typeof a.get==`function`?a.get:null,s=i&&Map.prototype.forEach,c=typeof Set==`function`&&Set.prototype,l=Object.getOwnPropertyDescriptor&&c?Object.getOwnPropertyDescriptor(Set.prototype,`size`):null,u=c&&l&&typeof l.get==`function`?l.get:null,d=c&&Set.prototype.forEach,f=typeof WeakMap==`function`&&WeakMap.prototype?WeakMap.prototype.has:null,p=typeof WeakSet==`function`&&WeakSet.prototype?WeakSet.prototype.has:null,m=typeof WeakRef==`function`&&WeakRef.prototype?WeakRef.prototype.deref:null,h=Boolean.prototype.valueOf,g=Object.prototype.toString,_=Function.prototype.toString,v=String.prototype.match,y=String.prototype.slice,b=String.prototype.replace,x=String.prototype.toUpperCase,S=String.prototype.toLowerCase,C=RegExp.prototype.test,w=Array.prototype.concat,T=Array.prototype.join,E=Array.prototype.slice,D=Math.floor,O=typeof BigInt==`function`?BigInt.prototype.valueOf:null,k=Object.getOwnPropertySymbols,A=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?Symbol.prototype.toString:null,j=typeof Symbol==`function`&&typeof Symbol.iterator==`object`,M=typeof Symbol==`function`&&Symbol.toStringTag?Symbol.toStringTag:null,N=Object.prototype.propertyIsEnumerable,P=(typeof Reflect==`function`?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function F(e,t){if(e===1/0||e===-1/0||e!==e||e&&e>-1e3&&e<1e3||C.call(/e/,t))return t;var n=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof e==`number`){var r=e<0?-D(-e):D(e);if(r!==e){var i=String(r),a=y.call(t,i.length+1);return b.call(i,n,`$&_`)+`.`+b.call(b.call(a,/([0-9]{3})/g,`$&_`),/_$/,``)}}return b.call(t,n,`$&_`)}var I=wt(),L=I.custom,ee=ae(L)?L:null,R={__proto__:null,double:`"`,single:`'`},z={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};t.exports=function e(t,r,i,a){var c=r||{};if(K(c,`quoteStyle`)&&!K(R,c.quoteStyle))throw TypeError(`option "quoteStyle" must be "single" or "double"`);if(K(c,`maxStringLength`)&&(typeof c.maxStringLength==`number`?c.maxStringLength<0&&c.maxStringLength!==1/0:c.maxStringLength!==null))throw TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var l=K(c,`customInspect`)?c.customInspect:!0;if(typeof l!=`boolean`&&l!==`symbol`)throw TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(K(c,`indent`)&&c.indent!==null&&c.indent!==` `&&!(parseInt(c.indent,10)===c.indent&&c.indent>0))throw TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(K(c,`numericSeparator`)&&typeof c.numericSeparator!=`boolean`)throw TypeError('option "numericSeparator", if provided, must be `true` or `false`');var f=c.numericSeparator;if(t===void 0)return`undefined`;if(t===null)return`null`;if(typeof t==`boolean`)return t?`true`:`false`;if(typeof t==`string`)return he(t,c);if(typeof t==`number`){if(t===0)return 1/0/t>0?`0`:`-0`;var p=String(t);return f?F(t,p):p}if(typeof t==`bigint`){var m=String(t)+`n`;return f?F(t,m):m}var g=c.depth===void 0?5:c.depth;if(i===void 0&&(i=0),i>=g&&g>0&&typeof t==`object`)return U(t)?`[Array]`:`[Object]`;var _=be(c,i);if(a===void 0)a=[];else if(le(a,t)>=0)return`[Circular]`;function v(t,n,r){if(n&&(a=E.call(a),a.push(n)),r){var o={depth:c.depth};return K(c,`quoteStyle`)&&(o.quoteStyle=c.quoteStyle),e(t,o,i+1,a)}return e(t,c,i+1,a)}if(typeof t==`function`&&!te(t)){var x=ce(t),C=Se(t,v);return`[Function`+(x?`: `+x:` (anonymous)`)+`]`+(C.length>0?` { `+T.call(C,`, `)+` }`:``)}if(ae(t)){var D=j?b.call(String(t),/^(Symbol\(.*\))_[^)]*$/,`$1`):A.call(t);return typeof t==`object`&&!j?Y(D):D}if(J(t)){for(var k=`<`+S.call(String(t.nodeName)),L=t.attributes||[],z=0;z<L.length;z++)k+=` `+L[z].name+`=`+B(V(L[z].value),`double`,c);return k+=`>`,t.childNodes&&t.childNodes.length&&(k+=`...`),k+=`</`+S.call(String(t.nodeName))+`>`,k}if(U(t)){if(t.length===0)return`[]`;var H=Se(t,v);return _&&!ye(H)?`[`+xe(H,_)+`]`:`[ `+T.call(H,`, `)+` ]`}if(ne(t)){var se=Se(t,v);return!(`cause`in Error.prototype)&&`cause`in t&&!N.call(t,`cause`)?`{ [`+String(t)+`] `+T.call(w.call(`[cause]: `+v(t.cause),se),`, `)+` }`:se.length===0?`[`+String(t)+`]`:`{ [`+String(t)+`] `+T.call(se,`, `)+` }`}if(typeof t==`object`&&l){if(ee&&typeof t[ee]==`function`&&I)return I(t,{depth:g-i});if(l!==`symbol`&&typeof t.inspect==`function`)return t.inspect()}if(ue(t)){var ge=[];return s&&s.call(t,function(e,n){ge.push(v(n,t,!0)+` => `+v(e,t))}),ve(`Map`,o.call(t),ge,_)}if(pe(t)){var Ce=[];return d&&d.call(t,function(e){Ce.push(v(e,t))}),ve(`Set`,u.call(t),Ce,_)}if(de(t))return _e(`WeakMap`);if(me(t))return _e(`WeakSet`);if(fe(t))return _e(`WeakRef`);if(re(t))return Y(v(Number(t)));if(oe(t))return Y(v(O.call(t)));if(ie(t))return Y(h.call(t));if(G(t))return Y(v(String(t)));if(typeof window<`u`&&t===window)return`{ [object Window] }`;if(typeof globalThis<`u`&&t===globalThis||n!==void 0&&t===n)return`{ [object globalThis] }`;if(!W(t)&&!te(t)){var we=Se(t,v),Te=P?P(t)===Object.prototype:t instanceof Object||t.constructor===Object,Ee=t instanceof Object?``:`null prototype`,De=!Te&&M&&Object(t)===t&&M in t?y.call(q(t),8,-1):Ee?`Object`:``,Oe=(Te||typeof t.constructor!=`function`?``:t.constructor.name?t.constructor.name+` `:``)+(De||Ee?`[`+T.call(w.call([],De||[],Ee||[]),`: `)+`] `:``);return we.length===0?Oe+`{}`:_?Oe+`{`+xe(we,_)+`}`:Oe+`{ `+T.call(we,`, `)+` }`}return String(t)};function B(e,t,n){var r=R[n.quoteStyle||t];return r+e+r}function V(e){return b.call(String(e),/"/g,`"`)}function H(e){return!M||!(typeof e==`object`&&(M in e||e[M]!==void 0))}function U(e){return q(e)===`[object Array]`&&H(e)}function W(e){return q(e)===`[object Date]`&&H(e)}function te(e){return q(e)===`[object RegExp]`&&H(e)}function ne(e){return q(e)===`[object Error]`&&H(e)}function G(e){return q(e)===`[object String]`&&H(e)}function re(e){return q(e)===`[object Number]`&&H(e)}function ie(e){return q(e)===`[object Boolean]`&&H(e)}function ae(e){if(j)return e&&typeof e==`object`&&e instanceof Symbol;if(typeof e==`symbol`)return!0;if(!e||typeof e!=`object`||!A)return!1;try{return A.call(e),!0}catch{}return!1}function oe(e){if(!e||typeof e!=`object`||!O)return!1;try{return O.call(e),!0}catch{}return!1}var se=Object.prototype.hasOwnProperty||function(e){return e in this};function K(e,t){return se.call(e,t)}function q(e){return g.call(e)}function ce(e){if(e.name)return e.name;var t=v.call(_.call(e),/^function\s*([\w$]+)/);return t?t[1]:null}function le(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}function ue(e){if(!o||!e||typeof e!=`object`)return!1;try{o.call(e);try{u.call(e)}catch{return!0}return e instanceof Map}catch{}return!1}function de(e){if(!f||!e||typeof e!=`object`)return!1;try{f.call(e,f);try{p.call(e,p)}catch{return!0}return e instanceof WeakMap}catch{}return!1}function fe(e){if(!m||!e||typeof e!=`object`)return!1;try{return m.call(e),!0}catch{}return!1}function pe(e){if(!u||!e||typeof e!=`object`)return!1;try{u.call(e);try{o.call(e)}catch{return!0}return e instanceof Set}catch{}return!1}function me(e){if(!p||!e||typeof e!=`object`)return!1;try{p.call(e,p);try{f.call(e,f)}catch{return!0}return e instanceof WeakSet}catch{}return!1}function J(e){return!e||typeof e!=`object`?!1:typeof HTMLElement<`u`&&e instanceof HTMLElement?!0:typeof e.nodeName==`string`&&typeof e.getAttribute==`function`}function he(e,t){if(e.length>t.maxStringLength){var n=e.length-t.maxStringLength,r=`... `+n+` more character`+(n>1?`s`:``);return he(y.call(e,0,t.maxStringLength),t)+r}var i=z[t.quoteStyle||`single`];return i.lastIndex=0,B(b.call(b.call(e,i,`\\$1`),/[\x00-\x1f]/g,ge),`single`,t)}function ge(e){var t=e.charCodeAt(0),n={8:`b`,9:`t`,10:`n`,12:`f`,13:`r`}[t];return n?`\\`+n:`\\x`+(t<16?`0`:``)+x.call(t.toString(16))}function Y(e){return`Object(`+e+`)`}function _e(e){return e+` { ? }`}function ve(e,t,n,r){var i=r?xe(n,r):T.call(n,`, `);return e+` (`+t+`) {`+i+`}`}function ye(e){for(var t=0;t<e.length;t++)if(le(e[t],`
|
|
10
10
|
`)>=0)return!1;return!0}function be(e,t){var n;if(e.indent===` `)n=` `;else if(typeof e.indent==`number`&&e.indent>0)n=T.call(Array(e.indent+1),` `);else return null;return{base:n,prev:T.call(Array(t+1),n)}}function xe(e,t){if(e.length===0)return``;var n=`
|
|
11
11
|
`+t.prev+t.base;return n+T.call(e,`,`+n)+`
|
|
12
|
-
`+t.prev}function Se(e,t){var n=U(e),r=[];if(n){r.length=e.length;for(var i=0;i<e.length;i++)r[i]=K(e,i)?t(e[i],e):``}var a=typeof k==`function`?k(e):[],o;if(j){o={};for(var s=0;s<a.length;s++)o[`$`+a[s]]=a[s]}for(var c in e)K(e,c)&&(n&&String(Number(c))===c&&c<e.length||j&&o[`$`+c]instanceof Symbol||(C.call(/[^\w$]/,c)?r.push(t(c,e)+`: `+t(e[c],e)):r.push(c+`: `+t(e[c],e))));if(typeof k==`function`)for(var l=0;l<a.length;l++)N.call(e,a[l])&&r.push(`[`+t(a[l])+`]: `+t(e[a[l]],e));return r}})),Tt=t(((e,t)=>{t.exports=function(e){return typeof e==`string`||typeof e==`symbol`}})),$=t(((e,t)=>{t.exports=function(e){return!!e&&(typeof e==`function`||typeof e==`object`)}})),Et=t(((e,t)=>{var n=X(),r=wt(),i=Tt(),a=$();t.exports=function(e,t){if(!a(e))throw new n(`Assertion failed: Type(O) is not Object`);if(!i(t))throw new n(`Assertion failed: P is not a Property Key, got `+r(t));return e[t]}})),Dt=t(((e,t)=>{var n=X(),r=wt(),i=Tt();t.exports=function(e,t){if(!i(t))throw new n(`Assertion failed: P is not a Property Key, got `+r(t));return e[t]}})),Ot=t(((e,t)=>{var n=Function.prototype.toString,r=typeof Reflect==`object`&&Reflect!==null&&Reflect.apply,i,a;if(typeof r==`function`&&typeof Object.defineProperty==`function`)try{i=Object.defineProperty({},`length`,{get:function(){throw a}}),a={},r(function(){throw 42},null,i)}catch(e){e!==a&&(r=null)}else r=null;var o=/^\s*class\b/,s=function(e){try{var t=n.call(e);return o.test(t)}catch{return!1}},c=function(e){try{return s(e)?!1:(n.call(e),!0)}catch{return!1}},l=Object.prototype.toString,u=`[object Object]`,d=`[object Function]`,f=`[object GeneratorFunction]`,p=`[object HTMLAllCollection]`,m=`[object HTML document.all class]`,h=`[object HTMLCollection]`,g=typeof Symbol==`function`&&!!Symbol.toStringTag,_=!(0 in[,]),v=function(){return!1};if(typeof document==`object`){var y=document.all;l.call(y)===l.call(document.all)&&(v=function(e){if((_||!e)&&(e===void 0||typeof e==`object`))try{var t=l.call(e);return(t===p||t===m||t===h||t===u)&&e(``)==null}catch{}return!1})}t.exports=r?function(e){if(v(e))return!0;if(!e||typeof e!=`function`&&typeof e!=`object`)return!1;try{r(e,null,i)}catch(e){if(e!==a)return!1}return!s(e)&&c(e)}:function(e){if(v(e))return!0;if(!e||typeof e!=`function`&&typeof e!=`object`)return!1;if(g)return c(e);if(s(e))return!1;var t=l.call(e);return t!==d&&t!==f&&!/^\[object HTML/.test(t)?!1:c(e)}})),kt=t(((e,t)=>{t.exports=Ot()})),At=t(((e,t)=>{var n=X(),r=Dt(),i=kt(),a=Tt(),o=wt();t.exports=function(e,t){if(!a(t))throw new n(`Assertion failed: P is not a Property Key`);var s=r(e,t);if(s!=null){if(!i(s))throw new n(o(t)+` is not a function: `+o(s));return s}}})),jt=t(((e,t)=>{var n=Ze();t.exports=function(){return n()&&!!Symbol.toStringTag}})),Mt=t(((e,t)=>{var n=Q(),r=jt()(),i=ut(),a=Ye(),o;if(r){var s=n(`RegExp.prototype.exec`),c={},l=function(){throw c},u={toString:l,valueOf:l};typeof Symbol.toPrimitive==`symbol`&&(u[Symbol.toPrimitive]=l),o=function(e){if(!e||typeof e!=`object`)return!1;var t=a(e,`lastIndex`);if(!(t&&i(t,`value`)))return!1;try{s(e,u)}catch(e){return e===c}}}else{var d=n(`Object.prototype.toString`),f=`[object RegExp]`;o=function(e){return!e||typeof e!=`object`&&typeof e!=`function`?!1:d(e)===f}}t.exports=o})),Nt=t(((e,t)=>{t.exports=function(e){return!!e}})),Pt=t(((e,t)=>{var n=Z()(`%Symbol.match%`,!0),r=Mt(),i=$(),a=Nt();t.exports=function(e){if(!i(e))return!1;if(n){var t=e[n];if(t!==void 0)return a(t)}return r(e)}})),Ft=t(((e,t)=>{var n=Z()(`%String%`),r=X();t.exports=function(e){if(typeof e==`symbol`)throw new r(`Cannot convert a Symbol value to a string`);return n(e)}})),It=t(((e,t)=>{var n=X();t.exports=function(e){if(e==null)throw new n(arguments.length>0&&arguments[1]||`Cannot call method on `+e);return e}})),Lt=t(((e,t)=>{var n=function(){return typeof function(){}.name==`string`},r=Object.getOwnPropertyDescriptor;if(r)try{r([],`length`)}catch{r=null}n.functionsHaveConfigurableNames=function(){if(!n()||!r)return!1;var e=r(function(){},`name`);return!!e&&!!e.configurable};var i=Function.prototype.bind;n.boundFunctionsHaveNames=function(){return n()&&typeof i==`function`&&function(){}.bind().name!==``},t.exports=n})),Rt=t(((e,t)=>{var n=dt(),r=ft()(),i=Lt().functionsHaveConfigurableNames(),a=X();t.exports=function(e,t){if(typeof e!=`function`)throw new a("`fn` is not a function");return(!(arguments.length>2&&arguments[2])||i)&&(r?n(e,`name`,t,!0,!0):n(e,`name`,t)),e}})),zt=t(((e,t)=>{var n=Rt(),r=X(),i=Object;t.exports=n(function(){if(this==null||this!==i(this))throw new r(`RegExp.prototype.flags getter called on non-object`);var e=``;return this.hasIndices&&(e+=`d`),this.global&&(e+=`g`),this.ignoreCase&&(e+=`i`),this.multiline&&(e+=`m`),this.dotAll&&(e+=`s`),this.unicode&&(e+=`u`),this.unicodeSets&&(e+=`v`),this.sticky&&(e+=`y`),e},`get flags`,!0)})),Bt=t(((e,t)=>{var n=zt(),r=yt().supportsDescriptors,i=Object.getOwnPropertyDescriptor;t.exports=function(){if(r&&/a/gim.flags===`gim`){var e=i(RegExp.prototype,`flags`);if(e&&typeof e.get==`function`&&`dotAll`in RegExp.prototype&&`hasIndices`in RegExp.prototype){var t=``,a={};if(Object.defineProperty(a,`hasIndices`,{get:function(){t+=`d`}}),Object.defineProperty(a,`sticky`,{get:function(){t+=`y`}}),e.get.call(a),t===`dy`)return e.get}}return n}})),Vt=t(((e,t)=>{var n=yt().supportsDescriptors,r=Bt(),i=Ye(),a=Object.defineProperty,o=Pe(),s=lt(),c=/a/;t.exports=function(){if(!n||!s)throw new o(`RegExp.prototype.flags requires a true ES5 environment that supports property descriptors`);var e=r(),t=s(c),l=i(t,`flags`);return(!l||l.get!==e)&&a(t,`flags`,{configurable:!0,enumerable:!1,get:e}),e}})),Ht=t(((e,t)=>{var n=yt(),r=ht(),i=zt(),a=Bt(),o=Vt(),s=r(a());n(s,{getPolyfill:a,implementation:i,shim:o}),t.exports=s})),Ut=t(((e,t)=>{t.exports=function(e){return typeof e==`number`&&e>=55296&&e<=56319}})),Wt=t(((e,t)=>{t.exports=function(e){return typeof e==`number`&&e>=56320&&e<=57343}})),Gt=t(((e,t)=>{var n=Z(),r=X(),i=n(`%String.fromCharCode%`),a=Ut(),o=Wt();t.exports=function(e,t){if(!a(e)||!o(t))throw new r("Assertion failed: `lead` must be a leading surrogate char code, and `trail` must be a trailing surrogate char code");return i(e)+i(t)}})),Kt=t(((e,t)=>{var n=X(),r=Q(),i=Ut(),a=Wt(),o=Gt(),s=r(`String.prototype.charAt`),c=r(`String.prototype.charCodeAt`);t.exports=function(e,t){if(typeof e!=`string`)throw new n("Assertion failed: `string` must be a String");var r=e.length;if(t<0||t>=r)throw new n("Assertion failed: `position` must be >= 0, and < the length of `string`");var l=c(e,t),u=s(e,t),d=i(l),f=a(l);if(!d&&!f)return{"[[CodePoint]]":u,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!1};if(f||t+1===r)return{"[[CodePoint]]":u,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!0};var p=c(e,t+1);return a(p)?{"[[CodePoint]]":o(l,p),"[[CodeUnitCount]]":2,"[[IsUnpairedSurrogate]]":!1}:{"[[CodePoint]]":u,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!0}}})),qt=t(((e,t)=>{var n=Ke();t.exports=function(e){return(typeof e==`number`||typeof e==`bigint`)&&!n(e)&&e!==1/0&&e!==-1/0}})),Jt=t(((e,t)=>{var n=Be(),r=Ve(),i=Ke(),a=qt();t.exports=function(e){if(typeof e!=`number`||i(e)||!a(e))return!1;var t=n(e);return r(t)===t}})),Yt=t(((e,t)=>{t.exports=2**53-1||9007199254740991})),Xt=t(((e,t)=>{var n=Kt(),r=X(),i=Jt(),a=Yt();t.exports=function(e,t,o){if(typeof e!=`string`)throw new r("Assertion failed: `S` must be a String");if(!i(t)||t<0||t>a)throw new r("Assertion failed: `length` must be an integer >= 0 and <= 2**53");if(typeof o!=`boolean`)throw new r("Assertion failed: `unicode` must be a Boolean");if(!o)return t+1;var s=e.length;return t+1>=s?t+1:t+n(e,t)[`[[CodeUnitCount]]`]}})),Zt=t(((e,t)=>{var n=X();t.exports=function(e,t){if(typeof t!=`boolean`)throw new n(`Assertion failed: Type(done) is not Boolean`);return{value:e,done:t}}})),Qt=t(((e,t)=>{var n=X(),r=ut(),i={__proto__:null,"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};t.exports=function(e){if(!e||typeof e!=`object`)return!1;for(var t in e)if(r(e,t)&&!i[t])return!1;var a=r(e,`[[Value]]`)||r(e,`[[Writable]]`),o=r(e,`[[Get]]`)||r(e,`[[Set]]`);if(a&&o)throw new n(`Property Descriptors may not be both accessor and data descriptors`);return!0}})),$t=t(((e,t)=>{var n=ft(),r=Xe(),i=n.hasArrayLengthDefineBug(),a=i&&bt(),o=Q()(`Object.prototype.propertyIsEnumerable`);t.exports=function(e,t,n,s,c,l){if(!r){if(!e(l)||!l[`[[Configurable]]`]||!l[`[[Writable]]`]||c in s&&o(s,c)!==!!l[`[[Enumerable]]`])return!1;var u=l[`[[Value]]`];return s[c]=u,t(s[c],u)}return i&&c===`length`&&`[[Value]]`in l&&a(s)&&s.length!==l[`[[Value]]`]?(s.length=l[`[[Value]]`],s.length===l[`[[Value]]`]):(r(s,c,n(l)),!0)}})),en=t(((e,t)=>{t.exports=function(e){if(e===void 0)return e;var t={};return`[[Value]]`in e&&(t.value=e[`[[Value]]`]),`[[Writable]]`in e&&(t.writable=!!e[`[[Writable]]`]),`[[Get]]`in e&&(t.get=e[`[[Get]]`]),`[[Set]]`in e&&(t.set=e[`[[Set]]`]),`[[Enumerable]]`in e&&(t.enumerable=!!e[`[[Enumerable]]`]),`[[Configurable]]`in e&&(t.configurable=!!e[`[[Configurable]]`]),t}})),tn=t(((e,t)=>{var n=X(),r=Qt(),i=en();t.exports=function(e){if(e!==void 0&&!r(e))throw new n("Assertion failed: `Desc` must be a Property Descriptor");return i(e)}})),nn=t(((e,t)=>{var n=X(),r=ut(),i=Qt();t.exports=function(e){if(e===void 0)return!1;if(!i(e))throw new n("Assertion failed: `Desc` must be a Property Descriptor");return!(!r(e,`[[Value]]`)&&!r(e,`[[Writable]]`))}})),rn=t(((e,t)=>{var n=Ke();t.exports=function(e,t){return e===t?e===0?1/e==1/t:!0:n(e)&&n(t)}})),an=t(((e,t)=>{var n=ut(),r=X(),i=$(),a=kt(),o=Nt();t.exports=function(e){if(!i(e))throw new r(`ToPropertyDescriptor requires an object`);var t={};if(n(e,`enumerable`)&&(t[`[[Enumerable]]`]=o(e.enumerable)),n(e,`configurable`)&&(t[`[[Configurable]]`]=o(e.configurable)),n(e,`value`)&&(t[`[[Value]]`]=e.value),n(e,`writable`)&&(t[`[[Writable]]`]=o(e.writable)),n(e,`get`)){var s=e.get;if(s!==void 0&&!a(s))throw new r(`getter must be a function`);t[`[[Get]]`]=s}if(n(e,`set`)){var c=e.set;if(c!==void 0&&!a(c))throw new r(`setter must be a function`);t[`[[Set]]`]=c}if((n(t,`[[Get]]`)||n(t,`[[Set]]`))&&(n(t,`[[Value]]`)||n(t,`[[Writable]]`)))throw new r(`Invalid property descriptor. Cannot both specify accessors and a value or writable attribute`);return t}})),on=t(((e,t)=>{var n=X(),r=$(),i=Qt(),a=$t(),o=tn(),s=nn(),c=Tt(),l=rn(),u=an();t.exports=function(e,t,d){if(!r(e))throw new n(`Assertion failed: Type(O) is not Object`);if(!c(t))throw new n(`Assertion failed: P is not a Property Key`);var f=i(d)?d:u(d);if(!i(f))throw new n(`Assertion failed: Desc is not a valid Property Descriptor`);return a(s,l,o,e,t,f)}})),sn=t(((e,t)=>{t.exports=function(e){return e===null||typeof e!=`function`&&typeof e!=`object`}})),cn=t(((e,t)=>{var n=Z(),r=n(`%Object.preventExtensions%`,!0),i=n(`%Object.isExtensible%`,!0),a=sn();t.exports=r?function(e){return!a(e)&&i(e)}:function(e){return!a(e)}})),ln=t(((e,t)=>{var n=X(),r=$(),i=on(),a=cn(),o=Tt();t.exports=function(e,t,s,c){if(!r(e))throw new n("Assertion failed: `homeObject` is not an Object");if(!o(t))throw new n("Assertion failed: `key` is not a Property Key or a Private Name");if(typeof s!=`function`)throw new n("Assertion failed: `closure` is not a function");if(typeof c!=`boolean`)throw new n("Assertion failed: `enumerable` is not a Boolean");if(!a(e))throw new n("Assertion failed: `homeObject` is not an ordinary, extensible object, with no non-configurable properties");i(e,t,{"[[Value]]":s,"[[Writable]]":!0,"[[Enumerable]]":c,"[[Configurable]]":!0})}})),un=t(((e,t)=>{t.exports=function(e,t){for(var n=0;n<e.length;n+=1)t(e[n],n,e)}})),dn=t(((e,t)=>{var n=wt(),r=X(),i=function(e,t,n){for(var r=e,i;(i=r.next)!=null;r=i)if(i.key===t)return r.next=i.next,n||(i.next=e.next,e.next=i),i},a=function(e,t){if(e){var n=i(e,t);return n&&n.value}},o=function(e,t,n){var r=i(e,t);r?r.value=n:e.next={key:t,next:e.next,value:n}},s=function(e,t){return e?!!i(e,t):!1},c=function(e,t){if(e)return i(e,t,!0)};t.exports=function(){var e,t={assert:function(e){if(!t.has(e))throw new r(`Side channel does not contain `+n(e))},delete:function(t){var n=e&&e.next,r=c(e,t);return r&&n&&n===r&&(e=void 0),!!r},get:function(t){return a(e,t)},has:function(t){return s(e,t)},set:function(t,n){e||={next:void 0},o(e,t,n)}};return t}})),fn=t(((e,t)=>{var n=Z(),r=Q(),i=wt(),a=X(),o=n(`%Map%`,!0),s=r(`Map.prototype.get`,!0),c=r(`Map.prototype.set`,!0),l=r(`Map.prototype.has`,!0),u=r(`Map.prototype.delete`,!0),d=r(`Map.prototype.size`,!0);t.exports=!!o&&function(){var e,t={assert:function(e){if(!t.has(e))throw new a(`Side channel does not contain `+i(e))},delete:function(t){if(e){var n=u(e,t);return d(e)===0&&(e=void 0),n}return!1},get:function(t){if(e)return s(e,t)},has:function(t){return e?l(e,t):!1},set:function(t,n){e||=new o,c(e,t,n)}};return t}})),pn=t(((e,t)=>{var n=Z(),r=Q(),i=wt(),a=fn(),o=X(),s=n(`%WeakMap%`,!0),c=r(`WeakMap.prototype.get`,!0),l=r(`WeakMap.prototype.set`,!0),u=r(`WeakMap.prototype.has`,!0),d=r(`WeakMap.prototype.delete`,!0);t.exports=s?function(){var e,t,n={assert:function(e){if(!n.has(e))throw new o(`Side channel does not contain `+i(e))},delete:function(n){if(s&&n&&(typeof n==`object`||typeof n==`function`)){if(e)return d(e,n)}else if(a&&t)return t.delete(n);return!1},get:function(n){return s&&n&&(typeof n==`object`||typeof n==`function`)&&e?c(e,n):t&&t.get(n)},has:function(n){return s&&n&&(typeof n==`object`||typeof n==`function`)&&e?u(e,n):!!t&&t.has(n)},set:function(n,r){s&&n&&(typeof n==`object`||typeof n==`function`)?(e||=new s,l(e,n,r)):a&&(t||=a(),t.set(n,r))}};return n}:a})),mn=t(((e,t)=>{var n=X(),r=wt(),i=dn(),a=fn(),o=pn()||a||i;t.exports=function(){var e,t={assert:function(e){if(!t.has(e))throw new n(`Side channel does not contain `+r(e))},delete:function(t){return!!e&&e.delete(t)},get:function(t){return e&&e.get(t)},has:function(t){return!!e&&e.has(t)},set:function(t,n){e||=o(),e.set(t,n)}};return t}})),hn=t(((e,t)=>{var n=ut(),r=mn()(),i=X(),a={assert:function(e,t){if(!e||typeof e!=`object`&&typeof e!=`function`)throw new i("`O` is not an object");if(typeof t!=`string`)throw new i("`slot` must be a string");if(r.assert(e),!a.has(e,t))throw new i("`"+t+"` is not present on `O`")},get:function(e,t){if(!e||typeof e!=`object`&&typeof e!=`function`)throw new i("`O` is not an object");if(typeof t!=`string`)throw new i("`slot` must be a string");var n=r.get(e);return n&&n[`$`+t]},has:function(e,t){if(!e||typeof e!=`object`&&typeof e!=`function`)throw new i("`O` is not an object");if(typeof t!=`string`)throw new i("`slot` must be a string");var a=r.get(e);return!!a&&n(a,`$`+t)},set:function(e,t,n){if(!e||typeof e!=`object`&&typeof e!=`function`)throw new i("`O` is not an object");if(typeof t!=`string`)throw new i("`slot` must be a string");var a=r.get(e);a||(a={},r.set(e,a)),a[`$`+t]=n}};Object.freeze&&Object.freeze(a),t.exports=a})),gn=t(((e,t)=>{var n={__proto__:null,foo:{}},r={__proto__:n}.foo===n.foo&&!(n instanceof Object);t.exports=function(){return r}})),_n=t(((e,t)=>{var n=Z()(`%Object.create%`,!0),r=X(),i=Re(),a=$(),o=xt(),s=un(),c=hn(),l=gn()();t.exports=function(e){if(e!==null&&!a(e))throw new r("Assertion failed: `proto` must be null or an object");var t=arguments.length<2?[]:arguments[1];if(!o(t))throw new r("Assertion failed: `additionalInternalSlotsList` must be an Array");var u;if(l)u={__proto__:e};else if(n)u=n(e);else{if(e===null)throw new i(`native Object.create support is required to create null objects`);var d=function(){};d.prototype=e,u=new d}return t.length>0&&s(t,function(e){c.set(u,e,void 0)}),u}})),vn=t(((e,t)=>{var n=X(),r=$(),i=Q()(`RegExp.prototype.exec`),a=St(),o=Et(),s=kt();t.exports=function(e,t){if(!r(e))throw new n("Assertion failed: `R` must be an Object");if(typeof t!=`string`)throw new n("Assertion failed: `S` must be a String");var c=o(e,`exec`);if(s(c)){var l=a(c,e,[t]);if(l===null||r(l))return l;throw new n('"exec" method must return `null` or an Object')}return i(e,t)}})),yn=t(((e,t)=>{var n=X(),r=$(),i=Tt(),a=rn(),o=function(){try{return delete 0,!0}catch{return!1}}();t.exports=function(e,t,s,c){if(!r(e))throw new n("Assertion failed: `O` must be an Object");if(!i(t))throw new n("Assertion failed: `P` must be a Property Key");if(typeof c!=`boolean`)throw new n("Assertion failed: `Throw` must be a Boolean");if(c){if(e[t]=s,o&&!a(e[t],s))throw new n(`Attempted to assign to readonly property.`);return!0}try{return e[t]=s,o?a(e[t],s):!0}catch{return!1}}})),bn=t(((e,t)=>{t.exports=function(e){return e===null||typeof e!=`function`&&typeof e!=`object`}})),xn=t(((e,t)=>{var n=Q(),r=n(`Date.prototype.getDay`),i=function(e){try{return r(e),!0}catch{return!1}},a=n(`Object.prototype.toString`),o=`[object Date]`,s=jt()();t.exports=function(e){return typeof e!=`object`||!e?!1:s?i(e):a(e)===o}})),Sn=t(((e,t)=>{var n=Q(),r=Mt(),i=n(`RegExp.prototype.exec`),a=X();t.exports=function(e){if(!r(e))throw new a("`regex` must be a RegExp");return function(t){return i(e,t)!==null}}})),Cn=t(((e,t)=>{var n=Q(),r=n(`Object.prototype.toString`),i=Qe()(),a=Sn();if(i){var o=n(`Symbol.prototype.toString`),s=a(/^Symbol\(.*\)$/),c=function(e){return typeof e.valueOf()==`symbol`?s(o(e)):!1};t.exports=function(e){if(typeof e==`symbol`)return!0;if(!e||typeof e!=`object`||r(e)!==`[object Symbol]`)return!1;try{return c(e)}catch{return!1}}}else t.exports=function(e){return!1}})),wn=t(((e,t)=>{var n=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`,r=bn(),i=Ot(),a=xn(),o=Cn(),s=function(e,t){if(e==null)throw TypeError(`Cannot call method on `+e);if(typeof t!=`string`||t!==`number`&&t!==`string`)throw TypeError(`hint must be "string" or "number"`);var n=t===`string`?[`toString`,`valueOf`]:[`valueOf`,`toString`],a,o,s;for(s=0;s<n.length;++s)if(a=e[n[s]],i(a)&&(o=a.call(e),r(o)))return o;throw TypeError(`No default value`)},c=function(e,t){var n=e[t];if(n!=null){if(!i(n))throw TypeError(n+` returned for property `+String(t)+` of object `+e+` is not a function`);return n}};t.exports=function(e){if(r(e))return e;var t=`default`;arguments.length>1&&(arguments[1]===String?t=`string`:arguments[1]===Number&&(t=`number`));var i;if(n&&(Symbol.toPrimitive?i=c(e,Symbol.toPrimitive):o(e)&&(i=Symbol.prototype.valueOf)),i!==void 0){var l=i.call(e,t);if(r(l))return l;throw TypeError(`unable to convert exotic object to primitive`)}return t===`default`&&(a(e)||o(e))&&(t=`string`),s(e,t===`default`?`number`:t)}})),Tn=t(((e,t)=>{var n=wn();t.exports=function(e){return arguments.length>1?n(e,arguments[1]):n(e)}})),En=t(((e,t)=>{var n=It(),r=Ft(),i=Q()(`String.prototype.replace`),a=/^\s$/.test(``),o=a?/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/:/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/,s=a?/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/:/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/;t.exports=function(){return i(i(r(n(this)),o,``),s,``)}})),Dn=t(((e,t)=>{var n=En(),r=``,i=``;t.exports=function(){return String.prototype.trim&&r.trim()===r&&i.trim()===i&&(`_`+i).trim()===`_`+i&&(i+`_`).trim()===i+`_`?String.prototype.trim:n}})),On=t(((e,t)=>{var n=ft()(),r=dt(),i=Dn();t.exports=function(){var e=i();return String.prototype.trim!==e&&(n?r(String.prototype,`trim`,e,!0):r(String.prototype,`trim`,e)),e}})),kn=t(((e,t)=>{var n=ht(),r=yt(),i=It(),a=En(),o=Dn(),s=On(),c=n(o()),l=function(e){return i(e),c(e)};r(l,{getPolyfill:o,implementation:a,shim:s}),t.exports=l})),An=t(((e,t)=>{var n=Z(),r=n(`%RegExp%`),i=X(),a=n(`%parseInt%`),o=Q(),s=Sn(),c=o(`String.prototype.slice`),l=s(/^0b[01]+$/i),u=s(/^0o[0-7]+$/i),d=s(/^[-+]0x[0-9a-f]+$/i),f=s(new r(`[`+[`
`,``,``].join(``)+`]`,`g`)),p=kn();t.exports=function e(t){if(typeof t!=`string`)throw new i("Assertion failed: `argument` is not a String");if(l(t))return+a(c(t,2),2);if(u(t))return+a(c(t,2),8);if(f(t)||d(t))return NaN;var n=p(t);return n===t?+t:e(n)}})),jn=t(((e,t)=>{var n=Z(),r=X(),i=n(`%Number%`),a=sn(),o=Tn(),s=An();t.exports=function(e){var t=a(e)?e:o(e,i);if(typeof t==`symbol`)throw new r(`Cannot convert a Symbol value to a number`);if(typeof t==`bigint`)throw new r(`Conversion from 'BigInt' to 'number' is not allowed.`);return typeof t==`string`?s(t):+t}})),Mn=t(((e,t)=>{var n=Ve();t.exports=function(e){return typeof e==`bigint`?e:n(e)}})),Nn=t(((e,t)=>{var n=Mn(),r=X();t.exports=function(e){if(typeof e!=`number`&&typeof e!=`bigint`)throw new r(`argument must be a Number or a BigInt`);var t=e<0?-n(-e):n(e);return t===0?0:t}})),Pn=t(((e,t)=>{var n=jn(),r=Nn(),i=Ke(),a=qt();t.exports=function(e){var t=n(e);return i(t)||t===0?0:a(t)?r(t):t}})),Fn=t(((e,t)=>{var n=Yt(),r=Pn();t.exports=function(e){var t=r(e);return t<=0?0:t>n?n:t}})),In=t(((e,t)=>{var n=Z()(`%Object.defineProperty%`,!0),r=jt()(),i=ut(),a=X(),o=r?Symbol.toStringTag:null;t.exports=function(e,t){var r=arguments.length>2&&!!arguments[2]&&arguments[2].force,s=arguments.length>2&&!!arguments[2]&&arguments[2].nonConfigurable;if(r!==void 0&&typeof r!=`boolean`||s!==void 0&&typeof s!=`boolean`)throw new a("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");o&&(r||!i(e,o))&&(n?n(e,o,{configurable:!s,enumerable:!1,value:t,writable:!1}):e[o]=t)}})),Ln=t(((e,t)=>{var n=Z(),r=Qe()(),i=X(),a=$(),o=n(`%IteratorPrototype%`,!0),s=Xt(),c=Zt(),l=ln(),u=Et(),d=_n(),f=vn(),p=yn(),m=Fn(),h=Ft(),g=hn(),_=In(),v=function(e,t,n,r){if(typeof t!=`string`)throw new i("`S` must be a string");if(typeof n!=`boolean`)throw new i("`global` must be a boolean");if(typeof r!=`boolean`)throw new i("`fullUnicode` must be a boolean");g.set(this,`[[IteratingRegExp]]`,e),g.set(this,`[[IteratedString]]`,t),g.set(this,`[[Global]]`,n),g.set(this,`[[Unicode]]`,r),g.set(this,`[[Done]]`,!1)};o&&(v.prototype=d(o)),l(v.prototype,`next`,function(){var e=this;if(!a(e))throw new i(`receiver must be an object`);if(!(e instanceof v)||!g.has(e,`[[IteratingRegExp]]`)||!g.has(e,`[[IteratedString]]`)||!g.has(e,`[[Global]]`)||!g.has(e,`[[Unicode]]`)||!g.has(e,`[[Done]]`))throw new i(`"this" value must be a RegExpStringIterator instance`);if(g.get(e,`[[Done]]`))return c(void 0,!0);var t=g.get(e,`[[IteratingRegExp]]`),n=g.get(e,`[[IteratedString]]`),r=g.get(e,`[[Global]]`),o=g.get(e,`[[Unicode]]`),l=f(t,n);return l===null?(g.set(e,`[[Done]]`,!0),c(void 0,!0)):r?(h(u(l,`0`))===``&&p(t,`lastIndex`,s(n,m(u(t,`lastIndex`)),o),!0),c(l,!1)):(g.set(e,`[[Done]]`,!0),c(l,!1))},!1),r&&(_(v.prototype,`RegExp String Iterator`),Symbol.iterator&&typeof v.prototype[Symbol.iterator]!=`function`&&l(v.prototype,Symbol.iterator,function(){return this},!1)),t.exports=function(e,t,n,r){return new v(e,t,n,r)}})),Rn=t(((e,t)=>{t.exports=Z()})),zn=t(((e,t)=>{var n=Rn()(`%Reflect.construct%`,!0),r=on();try{r({},``,{"[[Get]]":function(){}})}catch{r=null}if(r&&n){var i={},a={};r(a,`length`,{"[[Get]]":function(){throw i},"[[Enumerable]]":!0}),t.exports=function(e){try{n(e,a)}catch(e){return e===i}}}else t.exports=function(e){return typeof e==`function`&&!!e.prototype}})),Bn=t(((e,t)=>{var n=Z()(`%Symbol.species%`,!0),r=X(),i=$(),a=zn();t.exports=function(e,t){if(!i(e))throw new r(`Assertion failed: Type(O) is not Object`);var o=e.constructor;if(o===void 0)return t;if(!i(o))throw new r(`O.constructor is not an Object`);var s=n?o[n]:void 0;if(s==null)return t;if(a(s))return s;throw new r(`no constructor found`)}})),Vn=t(((e,t)=>{var n=$();t.exports=function(e){if(e===null)return`Null`;if(e===void 0)return`Undefined`;if(n(e))return`Object`;if(typeof e==`number`)return`Number`;if(typeof e==`boolean`)return`Boolean`;if(typeof e==`string`)return`String`}})),Hn=t(((e,t)=>{var n=Vn();t.exports=function(e){return typeof e==`symbol`?`Symbol`:typeof e==`bigint`?`BigInt`:n(e)}})),Un=t(((e,t)=>{var n=Ln(),r=Et(),i=yn(),a=Bn(),o=Fn(),s=Ft(),c=Hn(),l=Ht(),u=Rt(),d=Q(),f=Z(),p=X(),m=d(`String.prototype.indexOf`),h=f(`%RegExp%`),g=`flags`in h.prototype,_=function(e,t){var n,i=`flags`in t?r(t,`flags`):s(l(t));return n=g&&typeof i==`string`?new e(t,i):e===h?new e(t.source,i):new e(t,i),{flags:i,matcher:n}};t.exports=u(function(e){var t=this;if(c(t)!==`Object`)throw new p(`"this" value must be an Object`);var l=s(e),u=_(a(t,h),t),d=u.flags,f=u.matcher;return i(f,`lastIndex`,o(r(t,`lastIndex`)),!0),n(f,l,m(d,`g`)>-1,m(d,`u`)>-1)},`[Symbol.matchAll]`,!0)})),Wn=t(((e,t)=>{var n=Qe()(),r=Un();t.exports=function(){return!n||typeof Symbol.matchAll!=`symbol`||typeof RegExp.prototype[Symbol.matchAll]!=`function`?r:RegExp.prototype[Symbol.matchAll]}})),Gn=t(((e,t)=>{var n=St(),r=Et(),i=At(),a=Pt(),o=Ft(),s=It(),c=Q(),l=Qe()(),u=Ht(),d=Z(),f=X(),p=d(`%RegExp%`),m=c(`String.prototype.indexOf`),h=Wn(),g=function(e){var t=h();if(l&&typeof Symbol.matchAll==`symbol`){var n=i(e,Symbol.matchAll);return n===p.prototype[Symbol.matchAll]&&n!==t?t:n}if(a(e))return t};t.exports=function(e){var t=s(this);if(e!=null){if(a(e)){var i=`flags`in e?r(e,`flags`):u(e);if(s(i),m(o(i),`g`)<0)throw new f(`matchAll requires a global regular expression`)}var c=g(e);if(c!==void 0)return n(c,e,[t])}var l=o(t),d=new p(e,`g`);return n(g(d),d,[l])}})),Kn=t(((e,t)=>{var n=Gn();t.exports=function(){if(String.prototype.matchAll)try{``.matchAll(RegExp.prototype)}catch{return String.prototype.matchAll}return n}})),qn=t(((e,t)=>{var n=yt(),r=Qe()(),i=Ye(),a=Kn(),o=Wn(),s=Object.defineProperty;t.exports=function(){var e=a();if(n(String.prototype,{matchAll:e},{matchAll:function(){return String.prototype.matchAll!==e}}),r){var t=Symbol.matchAll||(Symbol.for?Symbol.for(`Symbol.matchAll`):Symbol(`Symbol.matchAll`));if(n(Symbol,{matchAll:t},{matchAll:function(){return Symbol.matchAll!==t}}),s&&i){var c=i(Symbol,t);(!c||c.configurable)&&s(Symbol,t,{configurable:!1,enumerable:!1,value:t,writable:!1})}var l=o(),u={};u[t]=l;var d={};d[t]=function(){return RegExp.prototype[t]!==l},n(RegExp.prototype,u,d)}return e}})),Jn=t(((e,t)=>{var n=ht(),r=yt(),i=Gn(),a=Kn(),o=qn(),s=n(i);r(s,{getPolyfill:a,implementation:i,shim:o}),t.exports=s})),Yn=t(((e,t)=>{r();var a=i(),o=k(),s=N(),c=P(),l=se(),u=M(),d=Y(),f=Me(),p=/\${?([\w\d]+)}?/g;String.prototype.regexIndexOf=function(e,t){let n=this.substring(t||0).search(e);return n>=0?n+(t||0):n},Jn().shim();var m=class e extends a{constructor(t){super();let{path:n=`/bin`,profile:r,hostname:i=`browser`,filesystem:a={},permissions:s={},cwd:c=`/`,onFsChange:l,useRealFilesystem:u=!1}=t;this.context=new o(Object.assign({},t,{clearFn:this.clear.bind(this),destroyFn:this.destroy.bind(this),onFsChange:typeof l==`function`?l:null})),this.context.setVar(`PATH`,n),this.context.setVar(`HOST`,i),u?this.context.setNodeFilesystem(c):this.context.setFilesystem(a,s),this.context.setCwd(c),this._loadDefaultCommands(),this._loadBuiltinCommands(),this._lastCode=0,r?this._loadProfile(r):setTimeout(()=>this.emit(`status`,e.STATUS_READY),0)}get path(){return this.context.getVar(`PATH`)}set lastCode(e){this.context.setVar(`?`,e),this._lastCode=e}get lastCode(){return this._lastCode}set stdin(e){this._stdin=e}onInput(e){if(this.runningCommand&&this.runningCommand.onInput&&this.runningCommand.captureInput)return this.runningCommand.onInput(e),!0}_loadDefaultCommands(){f.forEach(e=>{this.context.setCommand(e)})}_loadBuiltinCommands(){d.forEach(e=>{this.context.setCommand(e)})}_loadProfile(e){this.onCommand(`source ${e}`)}onCommand(t,n=!0){let r=this._splitInput(t),i=!0,a=r.reduce((e,{command:t,op:n})=>e.then(()=>{if(!i){n===`&&`?i=this._lastCode===0:n===`||`?i=this._lastCode!==0:n===`;`&&(i=!0);return}return this._runCommand(t).then(()=>{n===`&&`?i=this._lastCode===0:n===`||`?i=this._lastCode!==0:n===`;`&&(i=!0)})}),Promise.resolve());return n?a.then(()=>{this.destroyed||this.emit(`status`,e.STATUS_READY)}).catch(()=>this.emit(`status`,e.STATUS_READY)):a}tabCompletion(e){return this.context.fs.autoComplete(e,this.path)}async _runCommand(t){if(!t||t.length<1)return;this.emit(`status`,e.STATUS_WORKING);let n;try{n=await this._parseCommandLine(t)}catch(e){this.emit(`stdErr`,e.message||String(e)),this.lastCode=1,this.emit(`exitCode`,this.lastCode);return}if(!n.length)return;let r=n.shift(),i=this.context.getAlias(r);if(i)return this.onCommand(i,!1);let a;try{a=this._parseCommand(r.startsWith(`/`)||r.startsWith(`./`)?r:r.toLowerCase())}catch(e){this.emit(`stdErr`,e.message),this.lastCode=1,this.emit(`exitCode`,this.lastCode);return}let o;if(a.prototype instanceof s||new a instanceof c)o=new a(n,this.context);else if(a.prototype instanceof u)o=new a(n);else{this.emit(`stdErr`,`${r}: Command not found`),this.lastCode=1,this.emit(`exitCode`,this.lastCode);return}return o.requiresFilesystem&&(o.fs=this.context.fs),this._stdin!==void 0&&(o.stdin=this._stdin),this.runningCommand=o,this.runningCommand.on&&this.runningCommand.on(`flush`,e=>{this._emitOutput(e)}),o.runCommand().then(e=>{this._emitOutput(e.getStdOutput()),this.lastCode=e.getExitCode(),this.emit(`exitCode`,this.lastCode),delete this.runningCommand})}_emitOutput(e){e.forEach(({type:e,string:t})=>{e===`out`?this.emit(`stdOut`,t):e===`err`&&this.emit(`stdErr`,t)})}getPrompt(){let e=this.context.fs.cwd.split(`/`);return`${this.context.getVar(`HOST`)}:${e[e.length-2]}$`}destroy(t=0){this.destroyed||(this.destroyed=!0,this.emit(`status`,e.STATUS_DESTROYED),this.emit(`exit`,t))}clear(){this.emit(`clear`)}_splitInput(e){let t=e.split(`#`)[0];return this._parseOperators(t)}_parseOperators(e){let t=[],n=``,r=0,i=!1,a=!1;for(;r<e.length;){let o=e[r];if(o===`'`&&!a){i=!i,n+=o,r++;continue}if(o===`"`&&!i){a=!a,n+=o,r++;continue}if(!i&&!a){if(o===`&`&&e[r+1]===`&`){t.push({command:n.trim(),op:`&&`}),n=``,r+=2;continue}if(o===`|`&&e[r+1]===`|`){t.push({command:n.trim(),op:`||`}),n=``,r+=2;continue}if(o===`;`){t.push({command:n.trim(),op:`;`}),n=``,r++;continue}}n+=o,r++}return n.trim()&&t.push({command:n.trim(),op:null}),t}_parseCommand(e){if(e.startsWith(`./`)||e.startsWith(`/`)){let t=this.context.fs.getFileByPath(e);if(!t)throw Error(`${e}: No such file or directory`);if(t.constructor===Object)throw Error(`${e}: is a directory`);if(t.prototype&&t.prototype instanceof u)return t;if(t.constructor===String&&t.startsWith(`#!`)){if(!this.context.fs.isExecutable(e))throw Error(`${e}: permission denied`);return c.bind(this,t)}if(this._isWasmFile(e,t)){if(!this.context.fs.isExecutable(e))throw Error(`${e}: permission denied`);return l.bind(null,e)}throw Error(`${e}: permission denied`)}let t=this.context.getCommand(e);if(!t)throw Error(`${e}: Command not found`);return t}async _parseCommandLine(t){let n=e._splitCommand(t);return(await Promise.all(n.map(({value:e,hasQuote:t})=>this._replaceVariables(e).then(e=>({value:e,hasQuote:t}))))).filter(({value:e,hasQuote:t})=>e.length>0||t).map(({value:e})=>e)}static _sanitiseCommandPart(e){return e.startsWith(`"`)&&e.endsWith(`"`)||e.startsWith(`'`)&&e.endsWith(`'`)?e.substring(1,e.length-1):e}static _sanitiseArray(e){return e.filter(e=>e.length>0)}async _replaceVariables(t){let n=[...t.matchAll(/\$\(\(([^)]+)\)\)/g)];for(let e of n)t=t.replace(e[0],String(this._evalArithmetic(e[1])));let r=[...t.matchAll(/\$\((?!\()([^)]+)\)/g)];for(let e of r){let n=await this._runAndCapture(e[1]);t=t.replace(e[0],n)}let i=t.matchAll(p),a=i.next();for(;!a.done;){let n=this.context.getVar(a.value[1]);t=t.replace(new RegExp(e._escapeRegExp(a.value[0]),`g`),String(n)),a=i.next()}return t}_evalArithmetic(e){let t=e.replace(/\${?([\w\d]+)}?/g,(e,t)=>String(parseInt(this.context.getVar(t))||0));if(!/^[\d\s+\-*/%()]+$/.test(t.trim()))return 0;try{return Function(`return (`+t+`)`)()}catch{return 0}}async _runAndCapture(e){let t=new n.shell({cwd:this.context.fs.cwd,filesystem:this.context.fs.getRaw(),permissions:this.context.fs.getRawPermissions()});t.context.source(this.context);let r=[];return t.on(`stdOut`,e=>r.push(e)),await t.onCommand(e,!1),r.join(`
|
|
13
|
-
`).trimEnd()}static _splitCommand(e){let t=/\s/g,n=!1,r=!1,i=0,a=[],o=!1,s=[];for(let c=0;c<e.length;c++){let l=e[c];if(i>0){a.push(l),l===`(`?i++:l===`)`&&i--;continue}if(l===`'`&&!r){n=!n,o=!0;continue}if(l===`"`&&!n){r=!r,o=!0;continue}if(!n&&!r){if(l===`$`&&c+1<e.length&&e[c+1]===`(`){i=1,a.push(`$`),a.push(`(`),c++;continue}if(l.match(t)){(a.length>0||o)&&(s.push({value:a.join(``),hasQuote:o}),a=[],o=!1);continue}}a.push(l)}if((a.length>0||o)&&s.push({value:a.join(``),hasQuote:o}),n||r)throw Error(`quote expression not closed`);return s}_isWasmFile(e,t){return e.endsWith(`.wasm`)||e.endsWith(`.wat`)?!0:typeof t==`string`?t.charCodeAt(0)===0&&t.slice(1,4)===`asm`?!0:t.trimStart().startsWith(`(module`):!1}static _escapeRegExp(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}};m.STATUS_READY=`READY`,m.STATUS_WORKING=`WORKING`,m.STATUS_DESTROYED=`DESTROYED`,m.Command=
|
|
12
|
+
`+t.prev}function Se(e,t){var n=U(e),r=[];if(n){r.length=e.length;for(var i=0;i<e.length;i++)r[i]=K(e,i)?t(e[i],e):``}var a=typeof k==`function`?k(e):[],o;if(j){o={};for(var s=0;s<a.length;s++)o[`$`+a[s]]=a[s]}for(var c in e)K(e,c)&&(n&&String(Number(c))===c&&c<e.length||j&&o[`$`+c]instanceof Symbol||(C.call(/[^\w$]/,c)?r.push(t(c,e)+`: `+t(e[c],e)):r.push(c+`: `+t(e[c],e))));if(typeof k==`function`)for(var l=0;l<a.length;l++)N.call(e,a[l])&&r.push(`[`+t(a[l])+`]: `+t(e[a[l]],e));return r}})),Et=t(((e,t)=>{t.exports=function(e){return typeof e==`string`||typeof e==`symbol`}})),$=t(((e,t)=>{t.exports=function(e){return!!e&&(typeof e==`function`||typeof e==`object`)}})),Dt=t(((e,t)=>{var n=X(),r=Tt(),i=Et(),a=$();t.exports=function(e,t){if(!a(e))throw new n(`Assertion failed: Type(O) is not Object`);if(!i(t))throw new n(`Assertion failed: P is not a Property Key, got `+r(t));return e[t]}})),Ot=t(((e,t)=>{var n=X(),r=Tt(),i=Et();t.exports=function(e,t){if(!i(t))throw new n(`Assertion failed: P is not a Property Key, got `+r(t));return e[t]}})),kt=t(((e,t)=>{var n=Function.prototype.toString,r=typeof Reflect==`object`&&Reflect!==null&&Reflect.apply,i,a;if(typeof r==`function`&&typeof Object.defineProperty==`function`)try{i=Object.defineProperty({},"length",{get:function(){throw a}}),a={},r(function(){throw 42},null,i)}catch(e){e!==a&&(r=null)}else r=null;var o=/^\s*class\b/,s=function(e){try{var t=n.call(e);return o.test(t)}catch{return!1}},c=function(e){try{return s(e)?!1:(n.call(e),!0)}catch{return!1}},l=Object.prototype.toString,u=`[object Object]`,d=`[object Function]`,f=`[object GeneratorFunction]`,p=`[object HTMLAllCollection]`,m=`[object HTML document.all class]`,h=`[object HTMLCollection]`,g=typeof Symbol==`function`&&!!Symbol.toStringTag,_=!(0 in[,]),v=function(){return!1};if(typeof document==`object`){var y=document.all;l.call(y)===l.call(document.all)&&(v=function(e){if((_||!e)&&(e===void 0||typeof e==`object`))try{var t=l.call(e);return(t===p||t===m||t===h||t===u)&&e(``)==null}catch{}return!1})}t.exports=r?function(e){if(v(e))return!0;if(!e||typeof e!=`function`&&typeof e!=`object`)return!1;try{r(e,null,i)}catch(e){if(e!==a)return!1}return!s(e)&&c(e)}:function(e){if(v(e))return!0;if(!e||typeof e!=`function`&&typeof e!=`object`)return!1;if(g)return c(e);if(s(e))return!1;var t=l.call(e);return t!==d&&t!==f&&!/^\[object HTML/.test(t)?!1:c(e)}})),At=t(((e,t)=>{t.exports=kt()})),jt=t(((e,t)=>{var n=X(),r=Ot(),i=At(),a=Et(),o=Tt();t.exports=function(e,t){if(!a(t))throw new n(`Assertion failed: P is not a Property Key`);var s=r(e,t);if(s!=null){if(!i(s))throw new n(o(t)+` is not a function: `+o(s));return s}}})),Mt=t(((e,t)=>{var n=Qe();t.exports=function(){return n()&&!!Symbol.toStringTag}})),Nt=t(((e,t)=>{var n=Q(),r=Mt()(),i=dt(),a=Xe(),o;if(r){var s=n(`RegExp.prototype.exec`),c={},l=function(){throw c},u={toString:l,valueOf:l};typeof Symbol.toPrimitive==`symbol`&&(u[Symbol.toPrimitive]=l),o=function(e){if(!e||typeof e!=`object`)return!1;var t=a(e,`lastIndex`);if(!(t&&i(t,`value`)))return!1;try{s(e,u)}catch(e){return e===c}}}else{var d=n(`Object.prototype.toString`),f=`[object RegExp]`;o=function(e){return!e||typeof e!=`object`&&typeof e!=`function`?!1:d(e)===f}}t.exports=o})),Pt=t(((e,t)=>{t.exports=function(e){return!!e}})),Ft=t(((e,t)=>{var n=Z()(`%Symbol.match%`,!0),r=Nt(),i=$(),a=Pt();t.exports=function(e){if(!i(e))return!1;if(n){var t=e[n];if(t!==void 0)return a(t)}return r(e)}})),It=t(((e,t)=>{var n=Z()(`%String%`),r=X();t.exports=function(e){if(typeof e==`symbol`)throw new r(`Cannot convert a Symbol value to a string`);return n(e)}})),Lt=t(((e,t)=>{var n=X();t.exports=function(e){if(e==null)throw new n(arguments.length>0&&arguments[1]||`Cannot call method on `+e);return e}})),Rt=t(((e,t)=>{var n=function(){return typeof function(){}.name==`string`},r=Object.getOwnPropertyDescriptor;if(r)try{r([],`length`)}catch{r=null}n.functionsHaveConfigurableNames=function(){if(!n()||!r)return!1;var e=r(function(){},`name`);return!!e&&!!e.configurable};var i=Function.prototype.bind;n.boundFunctionsHaveNames=function(){return n()&&typeof i==`function`&&function(){}.bind().name!==``},t.exports=n})),zt=t(((e,t)=>{var n=ft(),r=pt()(),i=Rt().functionsHaveConfigurableNames(),a=X();t.exports=function(e,t){if(typeof e!=`function`)throw new a("`fn` is not a function");return(!(arguments.length>2&&arguments[2])||i)&&(r?n(e,`name`,t,!0,!0):n(e,`name`,t)),e}})),Bt=t(((e,t)=>{var n=zt(),r=X(),i=Object;t.exports=n(function(){if(this==null||this!==i(this))throw new r(`RegExp.prototype.flags getter called on non-object`);var e=``;return this.hasIndices&&(e+=`d`),this.global&&(e+=`g`),this.ignoreCase&&(e+=`i`),this.multiline&&(e+=`m`),this.dotAll&&(e+=`s`),this.unicode&&(e+=`u`),this.unicodeSets&&(e+=`v`),this.sticky&&(e+=`y`),e},`get flags`,!0)})),Vt=t(((e,t)=>{var n=Bt(),r=bt().supportsDescriptors,i=Object.getOwnPropertyDescriptor;t.exports=function(){if(r&&/a/gim.flags===`gim`){var e=i(RegExp.prototype,`flags`);if(e&&typeof e.get==`function`&&`dotAll`in RegExp.prototype&&`hasIndices`in RegExp.prototype){var t=``,a={};if(Object.defineProperty(a,"hasIndices",{get:function(){t+=`d`}}),Object.defineProperty(a,"sticky",{get:function(){t+=`y`}}),e.get.call(a),t===`dy`)return e.get}}return n}})),Ht=t(((e,t)=>{var n=bt().supportsDescriptors,r=Vt(),i=Xe(),a=Object.defineProperty,o=Fe(),s=ut(),c=/a/;t.exports=function(){if(!n||!s)throw new o(`RegExp.prototype.flags requires a true ES5 environment that supports property descriptors`);var e=r(),t=s(c),l=i(t,`flags`);return(!l||l.get!==e)&&a(t,`flags`,{configurable:!0,enumerable:!1,get:e}),e}})),Ut=t(((e,t)=>{var n=bt(),r=gt(),i=Bt(),a=Vt(),o=Ht(),s=r(a());n(s,{getPolyfill:a,implementation:i,shim:o}),t.exports=s})),Wt=t(((e,t)=>{t.exports=function(e){return typeof e==`number`&&e>=55296&&e<=56319}})),Gt=t(((e,t)=>{t.exports=function(e){return typeof e==`number`&&e>=56320&&e<=57343}})),Kt=t(((e,t)=>{var n=Z(),r=X(),i=n(`%String.fromCharCode%`),a=Wt(),o=Gt();t.exports=function(e,t){if(!a(e)||!o(t))throw new r("Assertion failed: `lead` must be a leading surrogate char code, and `trail` must be a trailing surrogate char code");return i(e)+i(t)}})),qt=t(((e,t)=>{var n=X(),r=Q(),i=Wt(),a=Gt(),o=Kt(),s=r(`String.prototype.charAt`),c=r(`String.prototype.charCodeAt`);t.exports=function(e,t){if(typeof e!=`string`)throw new n("Assertion failed: `string` must be a String");var r=e.length;if(t<0||t>=r)throw new n("Assertion failed: `position` must be >= 0, and < the length of `string`");var l=c(e,t),u=s(e,t),d=i(l),f=a(l);if(!d&&!f)return{"[[CodePoint]]":u,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!1};if(f||t+1===r)return{"[[CodePoint]]":u,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!0};var p=c(e,t+1);return a(p)?{"[[CodePoint]]":o(l,p),"[[CodeUnitCount]]":2,"[[IsUnpairedSurrogate]]":!1}:{"[[CodePoint]]":u,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!0}}})),Jt=t(((e,t)=>{var n=qe();t.exports=function(e){return(typeof e==`number`||typeof e==`bigint`)&&!n(e)&&e!==1/0&&e!==-1/0}})),Yt=t(((e,t)=>{var n=Ve(),r=He(),i=qe(),a=Jt();t.exports=function(e){if(typeof e!=`number`||i(e)||!a(e))return!1;var t=n(e);return r(t)===t}})),Xt=t(((e,t)=>{t.exports=2**53-1||9007199254740991})),Zt=t(((e,t)=>{var n=qt(),r=X(),i=Yt(),a=Xt();t.exports=function(e,t,o){if(typeof e!=`string`)throw new r("Assertion failed: `S` must be a String");if(!i(t)||t<0||t>a)throw new r("Assertion failed: `length` must be an integer >= 0 and <= 2**53");if(typeof o!=`boolean`)throw new r("Assertion failed: `unicode` must be a Boolean");if(!o)return t+1;var s=e.length;return t+1>=s?t+1:t+n(e,t)[`[[CodeUnitCount]]`]}})),Qt=t(((e,t)=>{var n=X();t.exports=function(e,t){if(typeof t!=`boolean`)throw new n(`Assertion failed: Type(done) is not Boolean`);return{value:e,done:t}}})),$t=t(((e,t)=>{var n=X(),r=dt(),i={__proto__:null,"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};t.exports=function(e){if(!e||typeof e!=`object`)return!1;for(var t in e)if(r(e,t)&&!i[t])return!1;var a=r(e,`[[Value]]`)||r(e,`[[Writable]]`),o=r(e,`[[Get]]`)||r(e,`[[Set]]`);if(a&&o)throw new n(`Property Descriptors may not be both accessor and data descriptors`);return!0}})),en=t(((e,t)=>{var n=pt(),r=Ze(),i=n.hasArrayLengthDefineBug(),a=i&&xt(),o=Q()(`Object.prototype.propertyIsEnumerable`);t.exports=function(e,t,n,s,c,l){if(!r){if(!e(l)||!l[`[[Configurable]]`]||!l[`[[Writable]]`]||c in s&&o(s,c)!==!!l[`[[Enumerable]]`])return!1;var u=l[`[[Value]]`];return s[c]=u,t(s[c],u)}return i&&c===`length`&&`[[Value]]`in l&&a(s)&&s.length!==l[`[[Value]]`]?(s.length=l[`[[Value]]`],s.length===l[`[[Value]]`]):(r(s,c,n(l)),!0)}})),tn=t(((e,t)=>{t.exports=function(e){if(e===void 0)return e;var t={};return`[[Value]]`in e&&(t.value=e[`[[Value]]`]),`[[Writable]]`in e&&(t.writable=!!e[`[[Writable]]`]),`[[Get]]`in e&&(t.get=e[`[[Get]]`]),`[[Set]]`in e&&(t.set=e[`[[Set]]`]),`[[Enumerable]]`in e&&(t.enumerable=!!e[`[[Enumerable]]`]),`[[Configurable]]`in e&&(t.configurable=!!e[`[[Configurable]]`]),t}})),nn=t(((e,t)=>{var n=X(),r=$t(),i=tn();t.exports=function(e){if(e!==void 0&&!r(e))throw new n("Assertion failed: `Desc` must be a Property Descriptor");return i(e)}})),rn=t(((e,t)=>{var n=X(),r=dt(),i=$t();t.exports=function(e){if(e===void 0)return!1;if(!i(e))throw new n("Assertion failed: `Desc` must be a Property Descriptor");return!(!r(e,`[[Value]]`)&&!r(e,`[[Writable]]`))}})),an=t(((e,t)=>{var n=qe();t.exports=function(e,t){return e===t?e===0?1/e==1/t:!0:n(e)&&n(t)}})),on=t(((e,t)=>{var n=dt(),r=X(),i=$(),a=At(),o=Pt();t.exports=function(e){if(!i(e))throw new r(`ToPropertyDescriptor requires an object`);var t={};if(n(e,`enumerable`)&&(t[`[[Enumerable]]`]=o(e.enumerable)),n(e,`configurable`)&&(t[`[[Configurable]]`]=o(e.configurable)),n(e,`value`)&&(t[`[[Value]]`]=e.value),n(e,`writable`)&&(t[`[[Writable]]`]=o(e.writable)),n(e,`get`)){var s=e.get;if(s!==void 0&&!a(s))throw new r(`getter must be a function`);t[`[[Get]]`]=s}if(n(e,`set`)){var c=e.set;if(c!==void 0&&!a(c))throw new r(`setter must be a function`);t[`[[Set]]`]=c}if((n(t,`[[Get]]`)||n(t,`[[Set]]`))&&(n(t,`[[Value]]`)||n(t,`[[Writable]]`)))throw new r(`Invalid property descriptor. Cannot both specify accessors and a value or writable attribute`);return t}})),sn=t(((e,t)=>{var n=X(),r=$(),i=$t(),a=en(),o=nn(),s=rn(),c=Et(),l=an(),u=on();t.exports=function(e,t,d){if(!r(e))throw new n(`Assertion failed: Type(O) is not Object`);if(!c(t))throw new n(`Assertion failed: P is not a Property Key`);var f=i(d)?d:u(d);if(!i(f))throw new n(`Assertion failed: Desc is not a valid Property Descriptor`);return a(s,l,o,e,t,f)}})),cn=t(((e,t)=>{t.exports=function(e){return e===null||typeof e!=`function`&&typeof e!=`object`}})),ln=t(((e,t)=>{var n=Z(),r=n(`%Object.preventExtensions%`,!0),i=n(`%Object.isExtensible%`,!0),a=cn();t.exports=r?function(e){return!a(e)&&i(e)}:function(e){return!a(e)}})),un=t(((e,t)=>{var n=X(),r=$(),i=sn(),a=ln(),o=Et();t.exports=function(e,t,s,c){if(!r(e))throw new n("Assertion failed: `homeObject` is not an Object");if(!o(t))throw new n("Assertion failed: `key` is not a Property Key or a Private Name");if(typeof s!=`function`)throw new n("Assertion failed: `closure` is not a function");if(typeof c!=`boolean`)throw new n("Assertion failed: `enumerable` is not a Boolean");if(!a(e))throw new n("Assertion failed: `homeObject` is not an ordinary, extensible object, with no non-configurable properties");i(e,t,{"[[Value]]":s,"[[Writable]]":!0,"[[Enumerable]]":c,"[[Configurable]]":!0})}})),dn=t(((e,t)=>{t.exports=function(e,t){for(var n=0;n<e.length;n+=1)t(e[n],n,e)}})),fn=t(((e,t)=>{var n=Tt(),r=X(),i=function(e,t,n){for(var r=e,i;(i=r.next)!=null;r=i)if(i.key===t)return r.next=i.next,n||(i.next=e.next,e.next=i),i},a=function(e,t){if(e){var n=i(e,t);return n&&n.value}},o=function(e,t,n){var r=i(e,t);r?r.value=n:e.next={key:t,next:e.next,value:n}},s=function(e,t){return e?!!i(e,t):!1},c=function(e,t){if(e)return i(e,t,!0)};t.exports=function(){var e,t={assert:function(e){if(!t.has(e))throw new r(`Side channel does not contain `+n(e))},delete:function(t){var n=c(e,t);return n&&e&&!e.next&&(e=void 0),!!n},get:function(t){return a(e,t)},has:function(t){return s(e,t)},set:function(t,n){e||={next:void 0},o(e,t,n)}};return t}})),pn=t(((e,t)=>{var n=Z(),r=Q(),i=Tt(),a=X(),o=n(`%Map%`,!0),s=r(`Map.prototype.get`,!0),c=r(`Map.prototype.set`,!0),l=r(`Map.prototype.has`,!0),u=r(`Map.prototype.delete`,!0),d=r(`Map.prototype.size`,!0);t.exports=!!o&&function(){var e,t={assert:function(e){if(!t.has(e))throw new a(`Side channel does not contain `+i(e))},delete:function(t){if(e){var n=u(e,t);return d(e)===0&&(e=void 0),n}return!1},get:function(t){if(e)return s(e,t)},has:function(t){return e?l(e,t):!1},set:function(t,n){e||=new o,c(e,t,n)}};return t}})),mn=t(((e,t)=>{var n=Z(),r=Q(),i=Tt(),a=pn(),o=X(),s=n(`%WeakMap%`,!0),c=r(`WeakMap.prototype.get`,!0),l=r(`WeakMap.prototype.set`,!0),u=r(`WeakMap.prototype.has`,!0),d=r(`WeakMap.prototype.delete`,!0);t.exports=s?function(){var e,t,n={assert:function(e){if(!n.has(e))throw new o(`Side channel does not contain `+i(e))},delete:function(n){if(s&&n&&(typeof n==`object`||typeof n==`function`)){if(e)return d(e,n)}else if(a&&t)return t.delete(n);return!1},get:function(n){return s&&n&&(typeof n==`object`||typeof n==`function`)&&e?c(e,n):t&&t.get(n)},has:function(n){return s&&n&&(typeof n==`object`||typeof n==`function`)&&e?u(e,n):!!t&&t.has(n)},set:function(n,r){s&&n&&(typeof n==`object`||typeof n==`function`)?(e||=new s,l(e,n,r)):a&&(t||=a(),t.set(n,r))}};return n}:a})),hn=t(((e,t)=>{var n=X(),r=Tt(),i=fn(),a=pn(),o=mn()||a||i;t.exports=function(){var e,t={assert:function(e){if(!t.has(e))throw new n(`Side channel does not contain `+r(e))},delete:function(t){return!!e&&e.delete(t)},get:function(t){return e&&e.get(t)},has:function(t){return!!e&&e.has(t)},set:function(t,n){e||=o(),e.set(t,n)}};return t}})),gn=t(((e,t)=>{var n=dt(),r=hn()(),i=X(),a={assert:function(e,t){if(!e||typeof e!=`object`&&typeof e!=`function`)throw new i("`O` is not an object");if(typeof t!=`string`)throw new i("`slot` must be a string");if(r.assert(e),!a.has(e,t))throw new i("`"+t+"` is not present on `O`")},get:function(e,t){if(!e||typeof e!=`object`&&typeof e!=`function`)throw new i("`O` is not an object");if(typeof t!=`string`)throw new i("`slot` must be a string");var n=r.get(e);return n&&n[`$`+t]},has:function(e,t){if(!e||typeof e!=`object`&&typeof e!=`function`)throw new i("`O` is not an object");if(typeof t!=`string`)throw new i("`slot` must be a string");var a=r.get(e);return!!a&&n(a,`$`+t)},set:function(e,t,n){if(!e||typeof e!=`object`&&typeof e!=`function`)throw new i("`O` is not an object");if(typeof t!=`string`)throw new i("`slot` must be a string");var a=r.get(e);a||(a={},r.set(e,a)),a[`$`+t]=n}};Object.freeze&&Object.freeze(a),t.exports=a})),_n=t(((e,t)=>{var n={__proto__:null,foo:{}},r={__proto__:n}.foo===n.foo&&!(n instanceof Object);t.exports=function(){return r}})),vn=t(((e,t)=>{var n=Z()(`%Object.create%`,!0),r=X(),i=ze(),a=$(),o=St(),s=dn(),c=gn(),l=_n()();t.exports=function(e){if(e!==null&&!a(e))throw new r("Assertion failed: `proto` must be null or an object");var t=arguments.length<2?[]:arguments[1];if(!o(t))throw new r("Assertion failed: `additionalInternalSlotsList` must be an Array");var u;if(l)u={__proto__:e};else if(n)u=n(e);else{if(e===null)throw new i(`native Object.create support is required to create null objects`);var d=function(){};d.prototype=e,u=new d}return t.length>0&&s(t,function(e){c.set(u,e,void 0)}),u}})),yn=t(((e,t)=>{var n=X(),r=$(),i=Q()(`RegExp.prototype.exec`),a=Ct(),o=Dt(),s=At();t.exports=function(e,t){if(!r(e))throw new n("Assertion failed: `R` must be an Object");if(typeof t!=`string`)throw new n("Assertion failed: `S` must be a String");var c=o(e,`exec`);if(s(c)){var l=a(c,e,[t]);if(l===null||r(l))return l;throw new n('"exec" method must return `null` or an Object')}return i(e,t)}})),bn=t(((e,t)=>{var n=X(),r=$(),i=Et(),a=an(),o=function(){try{return delete 0,!0}catch{return!1}}();t.exports=function(e,t,s,c){if(!r(e))throw new n("Assertion failed: `O` must be an Object");if(!i(t))throw new n("Assertion failed: `P` must be a Property Key");if(typeof c!=`boolean`)throw new n("Assertion failed: `Throw` must be a Boolean");if(c){if(e[t]=s,o&&!a(e[t],s))throw new n(`Attempted to assign to readonly property.`);return!0}try{return e[t]=s,o?a(e[t],s):!0}catch{return!1}}})),xn=t(((e,t)=>{t.exports=function(e){return e===null||typeof e!=`function`&&typeof e!=`object`}})),Sn=t(((e,t)=>{var n=Q(),r=n(`Date.prototype.getDay`),i=function(e){try{return r(e),!0}catch{return!1}},a=n(`Object.prototype.toString`),o=`[object Date]`,s=Mt()();t.exports=function(e){return typeof e!=`object`||!e?!1:s?i(e):a(e)===o}})),Cn=t(((e,t)=>{var n=Q(),r=Nt(),i=n(`RegExp.prototype.exec`),a=X();t.exports=function(e){if(!r(e))throw new a("`regex` must be a RegExp");return function(t){return i(e,t)!==null}}})),wn=t(((e,t)=>{var n=Q(),r=n(`Object.prototype.toString`),i=$e()(),a=Cn();if(i){var o=n(`Symbol.prototype.toString`),s=a(/^Symbol\(.*\)$/),c=function(e){return typeof e.valueOf()==`symbol`?s(o(e)):!1};t.exports=function(e){if(typeof e==`symbol`)return!0;if(!e||typeof e!=`object`||r(e)!==`[object Symbol]`)return!1;try{return c(e)}catch{return!1}}}else t.exports=function(e){return!1}})),Tn=t(((e,t)=>{var n=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`,r=xn(),i=kt(),a=Sn(),o=wn(),s=function(e,t){if(e==null)throw TypeError(`Cannot call method on `+e);if(typeof t!=`string`||t!==`number`&&t!==`string`)throw TypeError(`hint must be "string" or "number"`);var n=t===`string`?[`toString`,`valueOf`]:[`valueOf`,`toString`],a,o,s;for(s=0;s<n.length;++s)if(a=e[n[s]],i(a)&&(o=a.call(e),r(o)))return o;throw TypeError(`No default value`)},c=function(e,t){var n=e[t];if(n!=null){if(!i(n))throw TypeError(n+` returned for property `+String(t)+` of object `+e+` is not a function`);return n}};t.exports=function(e){if(r(e))return e;var t=`default`;arguments.length>1&&(arguments[1]===String?t=`string`:arguments[1]===Number&&(t=`number`));var i;if(n&&(Symbol.toPrimitive?i=c(e,Symbol.toPrimitive):o(e)&&(i=Symbol.prototype.valueOf)),i!==void 0){var l=i.call(e,t);if(r(l))return l;throw TypeError(`unable to convert exotic object to primitive`)}return t===`default`&&(a(e)||o(e))&&(t=`string`),s(e,t===`default`?`number`:t)}})),En=t(((e,t)=>{var n=Tn();t.exports=function(e){return arguments.length>1?n(e,arguments[1]):n(e)}})),Dn=t(((e,t)=>{var n=Lt(),r=It(),i=Q()(`String.prototype.replace`),a=/^\s$/.test(``),o=a?/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/:/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/,s=a?/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/:/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/;t.exports=function(){return i(i(r(n(this)),o,``),s,``)}})),On=t(((e,t)=>{var n=Dn(),r=``,i=``;t.exports=function(){return String.prototype.trim&&r.trim()===r&&i.trim()===i&&(`_`+i).trim()===`_`+i&&(i+`_`).trim()===i+`_`?String.prototype.trim:n}})),kn=t(((e,t)=>{var n=pt()(),r=ft(),i=On();t.exports=function(){var e=i();return String.prototype.trim!==e&&(n?r(String.prototype,`trim`,e,!0):r(String.prototype,`trim`,e)),e}})),An=t(((e,t)=>{var n=gt(),r=bt(),i=Lt(),a=Dn(),o=On(),s=kn(),c=n(o()),l=function(e){return i(e),c(e)};r(l,{getPolyfill:o,implementation:a,shim:s}),t.exports=l})),jn=t(((e,t)=>{var n=Z(),r=n(`%RegExp%`),i=X(),a=n(`%parseInt%`),o=Q(),s=Cn(),c=o(`String.prototype.slice`),l=s(/^0b[01]+$/i),u=s(/^0o[0-7]+$/i),d=s(/^[-+]0x[0-9a-f]+$/i),f=s(new r(`[`+[`
`,``,``].join(``)+`]`,`g`)),p=An();t.exports=function e(t){if(typeof t!=`string`)throw new i("Assertion failed: `argument` is not a String");if(l(t))return+a(c(t,2),2);if(u(t))return+a(c(t,2),8);if(f(t)||d(t))return NaN;var n=p(t);return n===t?+t:e(n)}})),Mn=t(((e,t)=>{var n=Z(),r=X(),i=n(`%Number%`),a=cn(),o=En(),s=jn();t.exports=function(e){var t=a(e)?e:o(e,i);if(typeof t==`symbol`)throw new r(`Cannot convert a Symbol value to a number`);if(typeof t==`bigint`)throw new r(`Conversion from 'BigInt' to 'number' is not allowed.`);return typeof t==`string`?s(t):+t}})),Nn=t(((e,t)=>{var n=He();t.exports=function(e){return typeof e==`bigint`?e:n(e)}})),Pn=t(((e,t)=>{var n=Nn(),r=X();t.exports=function(e){if(typeof e!=`number`&&typeof e!=`bigint`)throw new r(`argument must be a Number or a BigInt`);var t=e<0?-n(-e):n(e);return t===0?0:t}})),Fn=t(((e,t)=>{var n=Mn(),r=Pn(),i=qe(),a=Jt();t.exports=function(e){var t=n(e);return i(t)||t===0?0:a(t)?r(t):t}})),In=t(((e,t)=>{var n=Xt(),r=Fn();t.exports=function(e){var t=r(e);return t<=0?0:t>n?n:t}})),Ln=t(((e,t)=>{var n=Z()(`%Object.defineProperty%`,!0),r=Mt()(),i=dt(),a=X(),o=r?Symbol.toStringTag:null;t.exports=function(e,t){var r=arguments.length>2&&!!arguments[2]&&arguments[2].force,s=arguments.length>2&&!!arguments[2]&&arguments[2].nonConfigurable;if(r!==void 0&&typeof r!=`boolean`||s!==void 0&&typeof s!=`boolean`)throw new a("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");o&&(r||!i(e,o))&&(n?n(e,o,{configurable:!s,enumerable:!1,value:t,writable:!1}):e[o]=t)}})),Rn=t(((e,t)=>{var n=Z(),r=$e()(),i=X(),a=$(),o=n(`%IteratorPrototype%`,!0),s=Zt(),c=Qt(),l=un(),u=Dt(),d=vn(),f=yn(),p=bn(),m=In(),h=It(),g=gn(),_=Ln(),v=function(e,t,n,r){if(typeof t!=`string`)throw new i("`S` must be a string");if(typeof n!=`boolean`)throw new i("`global` must be a boolean");if(typeof r!=`boolean`)throw new i("`fullUnicode` must be a boolean");g.set(this,`[[IteratingRegExp]]`,e),g.set(this,`[[IteratedString]]`,t),g.set(this,`[[Global]]`,n),g.set(this,`[[Unicode]]`,r),g.set(this,`[[Done]]`,!1)};o&&(v.prototype=d(o)),l(v.prototype,`next`,function(){var e=this;if(!a(e))throw new i(`receiver must be an object`);if(!(e instanceof v)||!g.has(e,`[[IteratingRegExp]]`)||!g.has(e,`[[IteratedString]]`)||!g.has(e,`[[Global]]`)||!g.has(e,`[[Unicode]]`)||!g.has(e,`[[Done]]`))throw new i(`"this" value must be a RegExpStringIterator instance`);if(g.get(e,`[[Done]]`))return c(void 0,!0);var t=g.get(e,`[[IteratingRegExp]]`),n=g.get(e,`[[IteratedString]]`),r=g.get(e,`[[Global]]`),o=g.get(e,`[[Unicode]]`),l=f(t,n);return l===null?(g.set(e,`[[Done]]`,!0),c(void 0,!0)):r?(h(u(l,`0`))===``&&p(t,`lastIndex`,s(n,m(u(t,`lastIndex`)),o),!0),c(l,!1)):(g.set(e,`[[Done]]`,!0),c(l,!1))},!1),r&&(_(v.prototype,`RegExp String Iterator`),Symbol.iterator&&typeof v.prototype[Symbol.iterator]!=`function`&&l(v.prototype,Symbol.iterator,function(){return this},!1)),t.exports=function(e,t,n,r){return new v(e,t,n,r)}})),zn=t(((e,t)=>{t.exports=Z()})),Bn=t(((e,t)=>{var n=zn()(`%Reflect.construct%`,!0),r=sn();try{r({},``,{"[[Get]]":function(){}})}catch{r=null}if(r&&n){var i={},a={};r(a,`length`,{"[[Get]]":function(){throw i},"[[Enumerable]]":!0}),t.exports=function(e){try{n(e,a)}catch(e){return e===i}}}else t.exports=function(e){return typeof e==`function`&&!!e.prototype}})),Vn=t(((e,t)=>{var n=Z()(`%Symbol.species%`,!0),r=X(),i=$(),a=Bn();t.exports=function(e,t){if(!i(e))throw new r(`Assertion failed: Type(O) is not Object`);var o=e.constructor;if(o===void 0)return t;if(!i(o))throw new r(`O.constructor is not an Object`);var s=n?o[n]:void 0;if(s==null)return t;if(a(s))return s;throw new r(`no constructor found`)}})),Hn=t(((e,t)=>{var n=$();t.exports=function(e){if(e===null)return`Null`;if(e===void 0)return`Undefined`;if(n(e))return`Object`;if(typeof e==`number`)return`Number`;if(typeof e==`boolean`)return`Boolean`;if(typeof e==`string`)return`String`}})),Un=t(((e,t)=>{var n=Hn();t.exports=function(e){return typeof e==`symbol`?`Symbol`:typeof e==`bigint`?`BigInt`:n(e)}})),Wn=t(((e,t)=>{var n=Rn(),r=Dt(),i=bn(),a=Vn(),o=In(),s=It(),c=Un(),l=Ut(),u=zt(),d=Q(),f=Z(),p=X(),m=d(`String.prototype.indexOf`),h=f(`%RegExp%`),g=`flags`in h.prototype,_=function(e,t){var n,i=`flags`in t?r(t,`flags`):s(l(t));return n=g&&typeof i==`string`?new e(t,i):e===h?new e(t.source,i):new e(t,i),{flags:i,matcher:n}};t.exports=u(function(e){var t=this;if(c(t)!==`Object`)throw new p(`"this" value must be an Object`);var l=s(e),u=_(a(t,h),t),d=u.flags,f=u.matcher;return i(f,`lastIndex`,o(r(t,`lastIndex`)),!0),n(f,l,m(d,`g`)>-1,m(d,`u`)>-1)},`[Symbol.matchAll]`,!0)})),Gn=t(((e,t)=>{var n=$e()(),r=Wn();t.exports=function(){return!n||typeof Symbol.matchAll!=`symbol`||typeof RegExp.prototype[Symbol.matchAll]!=`function`?r:RegExp.prototype[Symbol.matchAll]}})),Kn=t(((e,t)=>{var n=Ct(),r=Dt(),i=jt(),a=Ft(),o=It(),s=Lt(),c=Q(),l=$e()(),u=Ut(),d=Z(),f=X(),p=d(`%RegExp%`),m=c(`String.prototype.indexOf`),h=Gn(),g=function(e){var t=h();if(l&&typeof Symbol.matchAll==`symbol`){var n=i(e,Symbol.matchAll);return n===p.prototype[Symbol.matchAll]&&n!==t?t:n}if(a(e))return t};t.exports=function(e){var t=s(this);if(e!=null){if(a(e)){var i=`flags`in e?r(e,`flags`):u(e);if(s(i),m(o(i),`g`)<0)throw new f(`matchAll requires a global regular expression`)}var c=g(e);if(c!==void 0)return n(c,e,[t])}var l=o(t),d=new p(e,`g`);return n(g(d),d,[l])}})),qn=t(((e,t)=>{var n=Kn();t.exports=function(){if(String.prototype.matchAll)try{``.matchAll(RegExp.prototype)}catch{return String.prototype.matchAll}return n}})),Jn=t(((e,t)=>{var n=bt(),r=$e()(),i=Xe(),a=qn(),o=Gn(),s=Object.defineProperty;t.exports=function(){var e=a();if(n(String.prototype,{matchAll:e},{matchAll:function(){return String.prototype.matchAll!==e}}),r){var t=Symbol.matchAll||(Symbol.for?Symbol.for(`Symbol.matchAll`):Symbol(`Symbol.matchAll`));if(n(Symbol,{matchAll:t},{matchAll:function(){return Symbol.matchAll!==t}}),s&&i){var c=i(Symbol,t);(!c||c.configurable)&&s(Symbol,t,{configurable:!1,enumerable:!1,value:t,writable:!1})}var l=o(),u={};u[t]=l;var d={};d[t]=function(){return RegExp.prototype[t]!==l},n(RegExp.prototype,u,d)}return e}})),Yn=t(((e,t)=>{var n=gt(),r=bt(),i=Kn(),a=qn(),o=Jn(),s=n(i);r(s,{getPolyfill:a,implementation:i,shim:o}),t.exports=s}));return t(((e,t)=>{r();var i=O(),a=N(),o=P(),s=se(),c=M(),l=Y(),u=Ne(),d=k(),f=/\${?([\w\d]+)}?/g,p=d.EventEmitter||d.default||d;String.prototype.regexIndexOf=function(e,t){let n=this.substring(t||0).search(e);return n>=0?n+(t||0):n},Yn().shim();var m=class e extends p{constructor(t){super();let{path:n=`/bin`,profile:r,hostname:a=`browser`,filesystem:o={},permissions:s={},cwd:c=`/`,onFsChange:l,useRealFilesystem:u=!1}=t;this.context=new i(Object.assign({},t,{clearFn:this.clear.bind(this),destroyFn:this.destroy.bind(this),onFsChange:typeof l==`function`?l:null})),this.context.setVar(`PATH`,n),this.context.setVar(`HOST`,a),u?this.context.setNodeFilesystem(c):this.context.setFilesystem(o,s),this.context.setCwd(c),this._loadDefaultCommands(),this._loadBuiltinCommands(),this._lastCode=0,r?this._loadProfile(r):setTimeout(()=>this.emit(`status`,e.STATUS_READY),0)}get path(){return this.context.getVar(`PATH`)}set lastCode(e){this.context.setVar(`?`,e),this._lastCode=e}get lastCode(){return this._lastCode}set stdin(e){this._stdin=e}onInput(e){if(this.runningCommand&&this.runningCommand.onInput&&this.runningCommand.captureInput)return this.runningCommand.onInput(e),!0}_loadDefaultCommands(){u.forEach(e=>{this.context.setCommand(e)})}_loadBuiltinCommands(){l.forEach(e=>{this.context.setCommand(e)})}_loadProfile(e){this.onCommand(`source ${e}`)}onCommand(t,n=!0){let r=this._splitInput(t),i=!0,a=r.reduce((e,{command:t,op:n})=>e.then(()=>{if(!i){n===`&&`?i=this._lastCode===0:n===`||`?i=this._lastCode!==0:n===`;`&&(i=!0);return}return this._runCommand(t).then(()=>{n===`&&`?i=this._lastCode===0:n===`||`?i=this._lastCode!==0:n===`;`&&(i=!0)})}),Promise.resolve());return n?a.then(()=>{this.destroyed||this.emit(`status`,e.STATUS_READY)}).catch(()=>this.emit(`status`,e.STATUS_READY)):a}tabCompletion(e){return this.context.fs.autoComplete(e,this.path)}async _runCommand(t){if(!t||t.length<1)return;this.emit(`status`,e.STATUS_WORKING);let n;try{n=await this._parseCommandLine(t)}catch(e){this.emit(`stdErr`,e.message||String(e)),this.lastCode=1,this.emit(`exitCode`,this.lastCode);return}if(!n.length)return;let r=n.shift(),i=this.context.getAlias(r);if(i)return this.onCommand(i,!1);let s;try{s=this._parseCommand(r.startsWith(`/`)||r.startsWith(`./`)?r:r.toLowerCase())}catch(e){this.emit(`stdErr`,e.message),this.lastCode=1,this.emit(`exitCode`,this.lastCode);return}let c=e=>typeof e==`function`&&typeof e.prototype.run==`function`&&typeof e.prototype.runCommand==`function`,l;if(s.prototype instanceof a||new s instanceof o)l=new s(n,this.context);else if(c(s))l=new s(n);else{this.emit(`stdErr`,`${r}: Command not found`),this.lastCode=1,this.emit(`exitCode`,this.lastCode);return}return l.requiresFilesystem&&(l.fs=this.context.fs),this._stdin!==void 0&&(l.stdin=this._stdin),this.runningCommand=l,this.runningCommand.on&&this.runningCommand.on(`flush`,e=>{this._emitOutput(e)}),l.runCommand().then(e=>{this._emitOutput(e.getStdOutput()),this.lastCode=e.getExitCode(),this.emit(`exitCode`,this.lastCode),delete this.runningCommand})}_emitOutput(e){e.forEach(({type:e,string:t})=>{e===`out`?this.emit(`stdOut`,t):e===`err`&&this.emit(`stdErr`,t)})}getPrompt(){let e=this.context.fs.cwd.split(`/`);return`${this.context.getVar(`HOST`)}:${e[e.length-2]}$`}destroy(t=0){this.destroyed||(this.destroyed=!0,this.emit(`status`,e.STATUS_DESTROYED),this.emit(`exit`,t))}clear(){this.emit(`clear`)}_splitInput(e){let t=e.split(`#`)[0];return this._parseOperators(t)}_parseOperators(e){let t=[],n=``,r=0,i=!1,a=!1;for(;r<e.length;){let o=e[r];if(o===`'`&&!a){i=!i,n+=o,r++;continue}if(o===`"`&&!i){a=!a,n+=o,r++;continue}if(!i&&!a){if(o===`&`&&e[r+1]===`&`){t.push({command:n.trim(),op:`&&`}),n=``,r+=2;continue}if(o===`|`&&e[r+1]===`|`){t.push({command:n.trim(),op:`||`}),n=``,r+=2;continue}if(o===`;`){t.push({command:n.trim(),op:`;`}),n=``,r++;continue}}n+=o,r++}return n.trim()&&t.push({command:n.trim(),op:null}),t}_parseCommand(e){if(e.startsWith(`./`)||e.startsWith(`/`)){let t=this.context.fs.getFileByPath(e);if(!t)throw Error(`${e}: No such file or directory`);if(t.constructor===Object)throw Error(`${e}: is a directory`);if(t.prototype&&typeof t.prototype.run==`function`&&typeof t.prototype.runCommand==`function`){if(!this.context.fs.isExecutable(e))throw Error(`${e}: permission denied`);return t}if(t.constructor===String&&t.startsWith(`#!`)){if(!this.context.fs.isExecutable(e))throw Error(`${e}: permission denied`);return o.bind(this,t)}if(this._isWasmFile(e,t)){if(!this.context.fs.isExecutable(e))throw Error(`${e}: permission denied`);return s.bind(null,e)}throw Error(`${e}: permission denied`)}let t=this.context.getCommand(e);if(!t)throw Error(`${e}: Command not found`);return t}async _parseCommandLine(t){let n=e._splitCommand(t);return(await Promise.all(n.map(({value:e,hasQuote:t})=>this._replaceVariables(e).then(e=>({value:e,hasQuote:t}))))).filter(({value:e,hasQuote:t})=>e.length>0||t).map(({value:e})=>e)}static _sanitiseCommandPart(e){return e.startsWith(`"`)&&e.endsWith(`"`)||e.startsWith(`'`)&&e.endsWith(`'`)?e.substring(1,e.length-1):e}static _sanitiseArray(e){return e.filter(e=>e.length>0)}async _replaceVariables(t){let n=[...t.matchAll(/\$\(\(([^)]+)\)\)/g)];for(let e of n)t=t.replace(e[0],String(this._evalArithmetic(e[1])));let r=[...t.matchAll(/\$\((?!\()([^)]+)\)/g)];for(let e of r){let n=await this._runAndCapture(e[1]);t=t.replace(e[0],n)}let i=t.matchAll(f),a=i.next();for(;!a.done;){let n=this.context.getVar(a.value[1]);t=t.replace(new RegExp(e._escapeRegExp(a.value[0]),`g`),String(n)),a=i.next()}return t}_evalArithmetic(e){let t=e.replace(/\${?([\w\d]+)}?/g,(e,t)=>String(parseInt(this.context.getVar(t))||0));if(!/^[\d\s+\-*/%()]+$/.test(t.trim()))return 0;try{return Function(`return (`+t+`)`)()}catch{return 0}}async _runAndCapture(e){let t=new n.shell({cwd:this.context.fs.cwd,filesystem:this.context.fs.getRaw(),permissions:this.context.fs.getRawPermissions()});t.context.source(this.context);let r=[];return t.on(`stdOut`,e=>r.push(e)),await t.onCommand(e,!1),r.join(`
|
|
13
|
+
`).trimEnd()}static _splitCommand(e){let t=/\s/g,n=!1,r=!1,i=0,a=[],o=!1,s=[];for(let c=0;c<e.length;c++){let l=e[c];if(i>0){a.push(l),l===`(`?i++:l===`)`&&i--;continue}if(l===`'`&&!r){n=!n,o=!0;continue}if(l===`"`&&!n){r=!r,o=!0;continue}if(!n&&!r){if(l===`$`&&c+1<e.length&&e[c+1]===`(`){i=1,a.push(`$`),a.push(`(`),c++;continue}if(l.match(t)){(a.length>0||o)&&(s.push({value:a.join(``),hasQuote:o}),a=[],o=!1);continue}}a.push(l)}if((a.length>0||o)&&s.push({value:a.join(``),hasQuote:o}),n||r)throw Error(`quote expression not closed`);return s}_isWasmFile(e,t){return e.endsWith(`.wasm`)||e.endsWith(`.wat`)?!0:typeof t==`string`?t.charCodeAt(0)===0&&t.slice(1,4)===`asm`?!0:t.trimStart().startsWith(`(module`):!1}static _escapeRegExp(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}};m.STATUS_READY=`READY`,m.STATUS_WORKING=`WORKING`,m.STATUS_DESTROYED=`DESTROYED`,m.Command=c,n.shell=m,t.exports=m}))()})();
|
|
14
14
|
//# sourceMappingURL=shell.min.js.map
|