(function webpackUniversalModuleDefinition(root, factory) {
	if(typeof exports === 'object' && typeof module === 'object')
		module.exports = factory(require("@angular/core"), require("@angular/common"), require("@angular/forms"), require("@ng-bootstrap/ng-bootstrap"), require("ngx-toastr"), require("tabby-core"), require("tabby-terminal"), require("tabby-settings"), require("any-promise"), require("fs"), require("stream"), require("rxjs"), require("path"));
	else if(typeof define === 'function' && define.amd)
		define(["@angular/core", "@angular/common", "@angular/forms", "@ng-bootstrap/ng-bootstrap", "ngx-toastr", "tabby-core", "tabby-terminal", "tabby-settings", "any-promise", "fs", "stream", "rxjs", "path"], factory);
	else {
		var a = typeof exports === 'object' ? factory(require("@angular/core"), require("@angular/common"), require("@angular/forms"), require("@ng-bootstrap/ng-bootstrap"), require("ngx-toastr"), require("tabby-core"), require("tabby-terminal"), require("tabby-settings"), require("any-promise"), require("fs"), require("stream"), require("rxjs"), require("path")) : factory(root["@angular/core"], root["@angular/common"], root["@angular/forms"], root["@ng-bootstrap/ng-bootstrap"], root["ngx-toastr"], root["tabby-core"], root["tabby-terminal"], root["tabby-settings"], root["any-promise"], root["fs"], root["stream"], root["rxjs"], root["path"]);
		for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
	}
})(global, (__WEBPACK_EXTERNAL_MODULE__900__, __WEBPACK_EXTERNAL_MODULE__848__, __WEBPACK_EXTERNAL_MODULE__161__, __WEBPACK_EXTERNAL_MODULE__571__, __WEBPACK_EXTERNAL_MODULE__170__, __WEBPACK_EXTERNAL_MODULE__315__, __WEBPACK_EXTERNAL_MODULE__316__, __WEBPACK_EXTERNAL_MODULE__663__, __WEBPACK_EXTERNAL_MODULE__154__, __WEBPACK_EXTERNAL_MODULE__89__, __WEBPACK_EXTERNAL_MODULE__978__, __WEBPACK_EXTERNAL_MODULE__832__, __WEBPACK_EXTERNAL_MODULE__56__) => {
return /******/ (() => { // webpackBootstrap
/******/ 	var __webpack_modules__ = ({

/***/ 291:
/*!********************************************************************!*\
  !*** ./src/components/environmentEditor.component.scss?ngResource ***!
  \********************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {


        var result = __webpack_require__(/*! !!../../../node_modules/css-loader/dist/cjs.js!../../../node_modules/sass-loader/dist/cjs.js!./environmentEditor.component.scss?ngResource */ 518);

        if (result && result.__esModule) {
            result = result.default;
        }

        if (typeof result === "string") {
            module.exports = result;
        } else {
            module.exports = result.toString();
        }
    

/***/ }),

/***/ 150:
/*!*******************************************************************!*\
  !*** ./src/components/commandLineEditor.component.pug?ngResource ***!
  \*******************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var req = __webpack_require__(/*! !!../node_modules/pug-loader/index.js??ruleSet[1].rules[3].use[1]!./src/components/commandLineEditor.component.pug?ngResource */ 926);
module.exports = (req['default'] || req).apply(req, [])

/***/ }),

/***/ 759:
/*!*******************************************************************!*\
  !*** ./src/components/environmentEditor.component.pug?ngResource ***!
  \*******************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var req = __webpack_require__(/*! !!../node_modules/pug-loader/index.js??ruleSet[1].rules[3].use[1]!./src/components/environmentEditor.component.pug?ngResource */ 569);
module.exports = (req['default'] || req).apply(req, [])

/***/ }),

/***/ 189:
/*!**********************************************************************!*\
  !*** ./src/components/localProfileSettings.component.pug?ngResource ***!
  \**********************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var req = __webpack_require__(/*! !!../node_modules/pug-loader/index.js??ruleSet[1].rules[3].use[1]!./src/components/localProfileSettings.component.pug?ngResource */ 697);
module.exports = (req['default'] || req).apply(req, [])

/***/ }),

/***/ 213:
/*!******************************************************************!*\
  !*** ./src/components/shellSettingsTab.component.pug?ngResource ***!
  \******************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var req = __webpack_require__(/*! !!../node_modules/pug-loader/index.js??ruleSet[1].rules[3].use[1]!./src/components/shellSettingsTab.component.pug?ngResource */ 558);
module.exports = (req['default'] || req).apply(req, [])

/***/ }),

/***/ 410:
/*!************************************************!*\
  !*** ../app/node_modules/graceful-fs/clone.js ***!
  \************************************************/
/***/ ((module) => {

"use strict";


module.exports = clone;
function clone(obj) {
  if (obj === null || typeof obj !== 'object') return obj;
  if (obj instanceof Object) var copy = {
    __proto__: obj.__proto__
  };else var copy = Object.create(null);
  Object.getOwnPropertyNames(obj).forEach(function (key) {
    Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key));
  });
  return copy;
}

/***/ }),

/***/ 389:
/*!******************************************************!*\
  !*** ../app/node_modules/graceful-fs/graceful-fs.js ***!
  \******************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var fs = __webpack_require__(/*! fs */ 89);
var polyfills = __webpack_require__(/*! ./polyfills.js */ 581);
var legacy = __webpack_require__(/*! ./legacy-streams.js */ 599);
var clone = __webpack_require__(/*! ./clone.js */ 410);
var util = __webpack_require__(/*! util */ 837);

/* istanbul ignore next - node 0.x polyfill */
var gracefulQueue;
var previousSymbol;

/* istanbul ignore else - node 0.x polyfill */
if (typeof Symbol === 'function' && typeof Symbol.for === 'function') {
  gracefulQueue = Symbol.for('graceful-fs.queue');
  // This is used in testing by future versions
  previousSymbol = Symbol.for('graceful-fs.previous');
} else {
  gracefulQueue = '___graceful-fs.queue';
  previousSymbol = '___graceful-fs.previous';
}
function noop() {}
function publishQueue(context, queue) {
  Object.defineProperty(context, gracefulQueue, {
    get: function () {
      return queue;
    }
  });
}
var debug = noop;
if (util.debuglog) debug = util.debuglog('gfs4');else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) debug = function () {
  var m = util.format.apply(util, arguments);
  m = 'GFS4: ' + m.split(/\n/).join('\nGFS4: ');
  console.error(m);
};

// Once time initialization
if (!fs[gracefulQueue]) {
  // This queue can be shared by multiple loaded instances
  var queue = global[gracefulQueue] || [];
  publishQueue(fs, queue);

  // Patch fs.close/closeSync to shared queue version, because we need
  // to retry() whenever a close happens *anywhere* in the program.
  // This is essential when multiple graceful-fs instances are
  // in play at the same time.
  fs.close = function (fs$close) {
    function close(fd, cb) {
      return fs$close.call(fs, fd, function (err) {
        // This function uses the graceful-fs shared queue
        if (!err) {
          retry();
        }
        if (typeof cb === 'function') cb.apply(this, arguments);
      });
    }
    Object.defineProperty(close, previousSymbol, {
      value: fs$close
    });
    return close;
  }(fs.close);
  fs.closeSync = function (fs$closeSync) {
    function closeSync(fd) {
      // This function uses the graceful-fs shared queue
      fs$closeSync.apply(fs, arguments);
      retry();
    }
    Object.defineProperty(closeSync, previousSymbol, {
      value: fs$closeSync
    });
    return closeSync;
  }(fs.closeSync);
  if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) {
    process.on('exit', function () {
      debug(fs[gracefulQueue]);
      (__webpack_require__(/*! assert */ 491).equal)(fs[gracefulQueue].length, 0);
    });
  }
}
if (!global[gracefulQueue]) {
  publishQueue(global, fs[gracefulQueue]);
}
module.exports = patch(clone(fs));
if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs.__patched) {
  module.exports = patch(fs);
  fs.__patched = true;
}
function patch(fs) {
  // Everything that references the open() function needs to be in here
  polyfills(fs);
  fs.gracefulify = patch;
  fs.createReadStream = createReadStream;
  fs.createWriteStream = createWriteStream;
  var fs$readFile = fs.readFile;
  fs.readFile = readFile;
  function readFile(path, options, cb) {
    if (typeof options === 'function') cb = options, options = null;
    return go$readFile(path, options, cb);
    function go$readFile(path, options, cb) {
      return fs$readFile(path, options, function (err) {
        if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) enqueue([go$readFile, [path, options, cb]]);else {
          if (typeof cb === 'function') cb.apply(this, arguments);
          retry();
        }
      });
    }
  }
  var fs$writeFile = fs.writeFile;
  fs.writeFile = writeFile;
  function writeFile(path, data, options, cb) {
    if (typeof options === 'function') cb = options, options = null;
    return go$writeFile(path, data, options, cb);
    function go$writeFile(path, data, options, cb) {
      return fs$writeFile(path, data, options, function (err) {
        if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) enqueue([go$writeFile, [path, data, options, cb]]);else {
          if (typeof cb === 'function') cb.apply(this, arguments);
          retry();
        }
      });
    }
  }
  var fs$appendFile = fs.appendFile;
  if (fs$appendFile) fs.appendFile = appendFile;
  function appendFile(path, data, options, cb) {
    if (typeof options === 'function') cb = options, options = null;
    return go$appendFile(path, data, options, cb);
    function go$appendFile(path, data, options, cb) {
      return fs$appendFile(path, data, options, function (err) {
        if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) enqueue([go$appendFile, [path, data, options, cb]]);else {
          if (typeof cb === 'function') cb.apply(this, arguments);
          retry();
        }
      });
    }
  }
  var fs$readdir = fs.readdir;
  fs.readdir = readdir;
  function readdir(path, options, cb) {
    var args = [path];
    if (typeof options !== 'function') {
      args.push(options);
    } else {
      cb = options;
    }
    args.push(go$readdir$cb);
    return go$readdir(args);
    function go$readdir$cb(err, files) {
      if (files && files.sort) files.sort();
      if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) enqueue([go$readdir, [args]]);else {
        if (typeof cb === 'function') cb.apply(this, arguments);
        retry();
      }
    }
  }
  function go$readdir(args) {
    return fs$readdir.apply(fs, args);
  }
  if (process.version.substr(0, 4) === 'v0.8') {
    var legStreams = legacy(fs);
    ReadStream = legStreams.ReadStream;
    WriteStream = legStreams.WriteStream;
  }
  var fs$ReadStream = fs.ReadStream;
  if (fs$ReadStream) {
    ReadStream.prototype = Object.create(fs$ReadStream.prototype);
    ReadStream.prototype.open = ReadStream$open;
  }
  var fs$WriteStream = fs.WriteStream;
  if (fs$WriteStream) {
    WriteStream.prototype = Object.create(fs$WriteStream.prototype);
    WriteStream.prototype.open = WriteStream$open;
  }
  Object.defineProperty(fs, 'ReadStream', {
    get: function () {
      return ReadStream;
    },
    set: function (val) {
      ReadStream = val;
    },
    enumerable: true,
    configurable: true
  });
  Object.defineProperty(fs, 'WriteStream', {
    get: function () {
      return WriteStream;
    },
    set: function (val) {
      WriteStream = val;
    },
    enumerable: true,
    configurable: true
  });

  // legacy names
  var FileReadStream = ReadStream;
  Object.defineProperty(fs, 'FileReadStream', {
    get: function () {
      return FileReadStream;
    },
    set: function (val) {
      FileReadStream = val;
    },
    enumerable: true,
    configurable: true
  });
  var FileWriteStream = WriteStream;
  Object.defineProperty(fs, 'FileWriteStream', {
    get: function () {
      return FileWriteStream;
    },
    set: function (val) {
      FileWriteStream = val;
    },
    enumerable: true,
    configurable: true
  });
  function ReadStream(path, options) {
    if (this instanceof ReadStream) return fs$ReadStream.apply(this, arguments), this;else return ReadStream.apply(Object.create(ReadStream.prototype), arguments);
  }
  function ReadStream$open() {
    var that = this;
    open(that.path, that.flags, that.mode, function (err, fd) {
      if (err) {
        if (that.autoClose) that.destroy();
        that.emit('error', err);
      } else {
        that.fd = fd;
        that.emit('open', fd);
        that.read();
      }
    });
  }
  function WriteStream(path, options) {
    if (this instanceof WriteStream) return fs$WriteStream.apply(this, arguments), this;else return WriteStream.apply(Object.create(WriteStream.prototype), arguments);
  }
  function WriteStream$open() {
    var that = this;
    open(that.path, that.flags, that.mode, function (err, fd) {
      if (err) {
        that.destroy();
        that.emit('error', err);
      } else {
        that.fd = fd;
        that.emit('open', fd);
      }
    });
  }
  function createReadStream(path, options) {
    return new fs.ReadStream(path, options);
  }
  function createWriteStream(path, options) {
    return new fs.WriteStream(path, options);
  }
  var fs$open = fs.open;
  fs.open = open;
  function open(path, flags, mode, cb) {
    if (typeof mode === 'function') cb = mode, mode = null;
    return go$open(path, flags, mode, cb);
    function go$open(path, flags, mode, cb) {
      return fs$open(path, flags, mode, function (err, fd) {
        if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) enqueue([go$open, [path, flags, mode, cb]]);else {
          if (typeof cb === 'function') cb.apply(this, arguments);
          retry();
        }
      });
    }
  }
  return fs;
}
function enqueue(elem) {
  debug('ENQUEUE', elem[0].name, elem[1]);
  fs[gracefulQueue].push(elem);
}
function retry() {
  var elem = fs[gracefulQueue].shift();
  if (elem) {
    debug('RETRY', elem[0].name, elem[1]);
    elem[0].apply(null, elem[1]);
  }
}

/***/ }),

/***/ 599:
/*!*********************************************************!*\
  !*** ../app/node_modules/graceful-fs/legacy-streams.js ***!
  \*********************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var Stream = (__webpack_require__(/*! stream */ 978).Stream);
module.exports = legacy;
function legacy(fs) {
  return {
    ReadStream: ReadStream,
    WriteStream: WriteStream
  };
  function ReadStream(path, options) {
    if (!(this instanceof ReadStream)) return new ReadStream(path, options);
    Stream.call(this);
    var self = this;
    this.path = path;
    this.fd = null;
    this.readable = true;
    this.paused = false;
    this.flags = 'r';
    this.mode = 438; /*=0666*/
    this.bufferSize = 64 * 1024;
    options = options || {};

    // Mixin options into this
    var keys = Object.keys(options);
    for (var index = 0, length = keys.length; index < length; index++) {
      var key = keys[index];
      this[key] = options[key];
    }
    if (this.encoding) this.setEncoding(this.encoding);
    if (this.start !== undefined) {
      if ('number' !== typeof this.start) {
        throw TypeError('start must be a Number');
      }
      if (this.end === undefined) {
        this.end = Infinity;
      } else if ('number' !== typeof this.end) {
        throw TypeError('end must be a Number');
      }
      if (this.start > this.end) {
        throw new Error('start must be <= end');
      }
      this.pos = this.start;
    }
    if (this.fd !== null) {
      process.nextTick(function () {
        self._read();
      });
      return;
    }
    fs.open(this.path, this.flags, this.mode, function (err, fd) {
      if (err) {
        self.emit('error', err);
        self.readable = false;
        return;
      }
      self.fd = fd;
      self.emit('open', fd);
      self._read();
    });
  }
  function WriteStream(path, options) {
    if (!(this instanceof WriteStream)) return new WriteStream(path, options);
    Stream.call(this);
    this.path = path;
    this.fd = null;
    this.writable = true;
    this.flags = 'w';
    this.encoding = 'binary';
    this.mode = 438; /*=0666*/
    this.bytesWritten = 0;
    options = options || {};

    // Mixin options into this
    var keys = Object.keys(options);
    for (var index = 0, length = keys.length; index < length; index++) {
      var key = keys[index];
      this[key] = options[key];
    }
    if (this.start !== undefined) {
      if ('number' !== typeof this.start) {
        throw TypeError('start must be a Number');
      }
      if (this.start < 0) {
        throw new Error('start must be >= zero');
      }
      this.pos = this.start;
    }
    this.busy = false;
    this._queue = [];
    if (this.fd === null) {
      this._open = fs.open;
      this._queue.push([this._open, this.path, this.flags, this.mode, undefined]);
      this.flush();
    }
  }
}

/***/ }),

/***/ 581:
/*!****************************************************!*\
  !*** ../app/node_modules/graceful-fs/polyfills.js ***!
  \****************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var constants = __webpack_require__(/*! constants */ 57);
var origCwd = process.cwd;
var cwd = null;
var platform = process.env.GRACEFUL_FS_PLATFORM || process.platform;
process.cwd = function () {
  if (!cwd) cwd = origCwd.call(process);
  return cwd;
};
try {
  process.cwd();
} catch (er) {}
var chdir = process.chdir;
process.chdir = function (d) {
  cwd = null;
  chdir.call(process, d);
};
module.exports = patch;
function patch(fs) {
  // (re-)implement some things that are known busted or missing.

  // lchmod, broken prior to 0.6.2
  // back-port the fix here.
  if (constants.hasOwnProperty('O_SYMLINK') && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) {
    patchLchmod(fs);
  }

  // lutimes implementation, or no-op
  if (!fs.lutimes) {
    patchLutimes(fs);
  }

  // https://github.com/isaacs/node-graceful-fs/issues/4
  // Chown should not fail on einval or eperm if non-root.
  // It should not fail on enosys ever, as this just indicates
  // that a fs doesn't support the intended operation.

  fs.chown = chownFix(fs.chown);
  fs.fchown = chownFix(fs.fchown);
  fs.lchown = chownFix(fs.lchown);
  fs.chmod = chmodFix(fs.chmod);
  fs.fchmod = chmodFix(fs.fchmod);
  fs.lchmod = chmodFix(fs.lchmod);
  fs.chownSync = chownFixSync(fs.chownSync);
  fs.fchownSync = chownFixSync(fs.fchownSync);
  fs.lchownSync = chownFixSync(fs.lchownSync);
  fs.chmodSync = chmodFixSync(fs.chmodSync);
  fs.fchmodSync = chmodFixSync(fs.fchmodSync);
  fs.lchmodSync = chmodFixSync(fs.lchmodSync);
  fs.stat = statFix(fs.stat);
  fs.fstat = statFix(fs.fstat);
  fs.lstat = statFix(fs.lstat);
  fs.statSync = statFixSync(fs.statSync);
  fs.fstatSync = statFixSync(fs.fstatSync);
  fs.lstatSync = statFixSync(fs.lstatSync);

  // if lchmod/lchown do not exist, then make them no-ops
  if (!fs.lchmod) {
    fs.lchmod = function (path, mode, cb) {
      if (cb) process.nextTick(cb);
    };
    fs.lchmodSync = function () {};
  }
  if (!fs.lchown) {
    fs.lchown = function (path, uid, gid, cb) {
      if (cb) process.nextTick(cb);
    };
    fs.lchownSync = function () {};
  }

  // on Windows, A/V software can lock the directory, causing this
  // to fail with an EACCES or EPERM if the directory contains newly
  // created files.  Try again on failure, for up to 60 seconds.

  // Set the timeout this long because some Windows Anti-Virus, such as Parity
  // bit9, may lock files for up to a minute, causing npm package install
  // failures. Also, take care to yield the scheduler. Windows scheduling gives
  // CPU to a busy looping process, which can cause the program causing the lock
  // contention to be starved of CPU by node, so the contention doesn't resolve.
  if (platform === "win32") {
    fs.rename = function (fs$rename) {
      return function (from, to, cb) {
        var start = Date.now();
        var backoff = 0;
        fs$rename(from, to, function CB(er) {
          if (er && (er.code === "EACCES" || er.code === "EPERM") && Date.now() - start < 60000) {
            setTimeout(function () {
              fs.stat(to, function (stater, st) {
                if (stater && stater.code === "ENOENT") fs$rename(from, to, CB);else cb(er);
              });
            }, backoff);
            if (backoff < 100) backoff += 10;
            return;
          }
          if (cb) cb(er);
        });
      };
    }(fs.rename);
  }

  // if read() returns EAGAIN, then just try it again.
  fs.read = function (fs$read) {
    function read(fd, buffer, offset, length, position, callback_) {
      var callback;
      if (callback_ && typeof callback_ === 'function') {
        var eagCounter = 0;
        callback = function (er, _, __) {
          if (er && er.code === 'EAGAIN' && eagCounter < 10) {
            eagCounter++;
            return fs$read.call(fs, fd, buffer, offset, length, position, callback);
          }
          callback_.apply(this, arguments);
        };
      }
      return fs$read.call(fs, fd, buffer, offset, length, position, callback);
    }

    // This ensures `util.promisify` works as it does for native `fs.read`.
    read.__proto__ = fs$read;
    return read;
  }(fs.read);
  fs.readSync = function (fs$readSync) {
    return function (fd, buffer, offset, length, position) {
      var eagCounter = 0;
      while (true) {
        try {
          return fs$readSync.call(fs, fd, buffer, offset, length, position);
        } catch (er) {
          if (er.code === 'EAGAIN' && eagCounter < 10) {
            eagCounter++;
            continue;
          }
          throw er;
        }
      }
    };
  }(fs.readSync);
  function patchLchmod(fs) {
    fs.lchmod = function (path, mode, callback) {
      fs.open(path, constants.O_WRONLY | constants.O_SYMLINK, mode, function (err, fd) {
        if (err) {
          if (callback) callback(err);
          return;
        }
        // prefer to return the chmod error, if one occurs,
        // but still try to close, and report closing errors if they occur.
        fs.fchmod(fd, mode, function (err) {
          fs.close(fd, function (err2) {
            if (callback) callback(err || err2);
          });
        });
      });
    };
    fs.lchmodSync = function (path, mode) {
      var fd = fs.openSync(path, constants.O_WRONLY | constants.O_SYMLINK, mode);

      // prefer to return the chmod error, if one occurs,
      // but still try to close, and report closing errors if they occur.
      var threw = true;
      var ret;
      try {
        ret = fs.fchmodSync(fd, mode);
        threw = false;
      } finally {
        if (threw) {
          try {
            fs.closeSync(fd);
          } catch (er) {}
        } else {
          fs.closeSync(fd);
        }
      }
      return ret;
    };
  }
  function patchLutimes(fs) {
    if (constants.hasOwnProperty("O_SYMLINK")) {
      fs.lutimes = function (path, at, mt, cb) {
        fs.open(path, constants.O_SYMLINK, function (er, fd) {
          if (er) {
            if (cb) cb(er);
            return;
          }
          fs.futimes(fd, at, mt, function (er) {
            fs.close(fd, function (er2) {
              if (cb) cb(er || er2);
            });
          });
        });
      };
      fs.lutimesSync = function (path, at, mt) {
        var fd = fs.openSync(path, constants.O_SYMLINK);
        var ret;
        var threw = true;
        try {
          ret = fs.futimesSync(fd, at, mt);
          threw = false;
        } finally {
          if (threw) {
            try {
              fs.closeSync(fd);
            } catch (er) {}
          } else {
            fs.closeSync(fd);
          }
        }
        return ret;
      };
    } else {
      fs.lutimes = function (_a, _b, _c, cb) {
        if (cb) process.nextTick(cb);
      };
      fs.lutimesSync = function () {};
    }
  }
  function chmodFix(orig) {
    if (!orig) return orig;
    return function (target, mode, cb) {
      return orig.call(fs, target, mode, function (er) {
        if (chownErOk(er)) er = null;
        if (cb) cb.apply(this, arguments);
      });
    };
  }
  function chmodFixSync(orig) {
    if (!orig) return orig;
    return function (target, mode) {
      try {
        return orig.call(fs, target, mode);
      } catch (er) {
        if (!chownErOk(er)) throw er;
      }
    };
  }
  function chownFix(orig) {
    if (!orig) return orig;
    return function (target, uid, gid, cb) {
      return orig.call(fs, target, uid, gid, function (er) {
        if (chownErOk(er)) er = null;
        if (cb) cb.apply(this, arguments);
      });
    };
  }
  function chownFixSync(orig) {
    if (!orig) return orig;
    return function (target, uid, gid) {
      try {
        return orig.call(fs, target, uid, gid);
      } catch (er) {
        if (!chownErOk(er)) throw er;
      }
    };
  }
  function statFix(orig) {
    if (!orig) return orig;
    // Older versions of Node erroneously returned signed integers for
    // uid + gid.
    return function (target, options, cb) {
      if (typeof options === 'function') {
        cb = options;
        options = null;
      }
      function callback(er, stats) {
        if (stats) {
          if (stats.uid < 0) stats.uid += 0x100000000;
          if (stats.gid < 0) stats.gid += 0x100000000;
        }
        if (cb) cb.apply(this, arguments);
      }
      return options ? orig.call(fs, target, options, callback) : orig.call(fs, target, callback);
    };
  }
  function statFixSync(orig) {
    if (!orig) return orig;
    // Older versions of Node erroneously returned signed integers for
    // uid + gid.
    return function (target, options) {
      var stats = options ? orig.call(fs, target, options) : orig.call(fs, target);
      if (stats.uid < 0) stats.uid += 0x100000000;
      if (stats.gid < 0) stats.gid += 0x100000000;
      return stats;
    };
  }

  // ENOSYS means that the fs doesn't support the op. Just ignore
  // that, because it doesn't matter.
  //
  // if there's no getuid, or if getuid() is something other
  // than 0, and the error is EINVAL or EPERM, then just ignore
  // it.
  //
  // This specific case is a silent failure in cp, install, tar,
  // and most other unix tools that manage permissions.
  //
  // When running as root, or if other types of errors are
  // encountered, then it's strict.
  function chownErOk(er) {
    if (!er) return true;
    if (er.code === "ENOSYS") return true;
    var nonroot = !process.getuid || process.getuid() !== 0;
    if (nonroot) {
      if (er.code === "EINVAL" || er.code === "EPERM") return true;
    }
    return false;
  }
}

/***/ }),

/***/ 461:
/*!************************************!*\
  !*** ../app/node_modules/mz/fs.js ***!
  \************************************/
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

var Promise = __webpack_require__(/*! any-promise */ 154);
var fs;
try {
  fs = __webpack_require__(/*! graceful-fs */ 389);
} catch (err) {
  fs = __webpack_require__(/*! fs */ 89);
}
var api = ['appendFile', 'chmod', 'chown', 'close', 'fchmod', 'fchown', 'fdatasync', 'fstat', 'fsync', 'ftruncate', 'futimes', 'lchown', 'link', 'lstat', 'mkdir', 'open', 'read', 'readFile', 'readdir', 'readlink', 'realpath', 'rename', 'rmdir', 'stat', 'symlink', 'truncate', 'unlink', 'utimes', 'write', 'writeFile'];
typeof fs.access === 'function' && api.push('access');
typeof fs.copyFile === 'function' && api.push('copyFile');
typeof fs.mkdtemp === 'function' && api.push('mkdtemp');
(__webpack_require__(/*! thenify-all */ 547).withCallback)(fs, exports, api);
exports.exists = function (filename, callback) {
  // callback
  if (typeof callback === 'function') {
    return fs.stat(filename, function (err) {
      callback(null, !err);
    });
  }
  // or promise
  return new Promise(function (resolve) {
    fs.stat(filename, function (err) {
      resolve(!err);
    });
  });
};

/***/ }),

/***/ 547:
/*!************************************************!*\
  !*** ../app/node_modules/thenify-all/index.js ***!
  \************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var thenify = __webpack_require__(/*! thenify */ 504);
module.exports = thenifyAll;
thenifyAll.withCallback = withCallback;
thenifyAll.thenify = thenify;

/**
 * Promisifies all the selected functions in an object.
 *
 * @param {Object} source the source object for the async functions
 * @param {Object} [destination] the destination to set all the promisified methods
 * @param {Array} [methods] an array of method names of `source`
 * @return {Object}
 * @api public
 */

function thenifyAll(source, destination, methods) {
  return promisifyAll(source, destination, methods, thenify);
}

/**
 * Promisifies all the selected functions in an object and backward compatible with callback.
 *
 * @param {Object} source the source object for the async functions
 * @param {Object} [destination] the destination to set all the promisified methods
 * @param {Array} [methods] an array of method names of `source`
 * @return {Object}
 * @api public
 */

function withCallback(source, destination, methods) {
  return promisifyAll(source, destination, methods, thenify.withCallback);
}
function promisifyAll(source, destination, methods, promisify) {
  if (!destination) {
    destination = {};
    methods = Object.keys(source);
  }
  if (Array.isArray(destination)) {
    methods = destination;
    destination = {};
  }
  if (!methods) {
    methods = Object.keys(source);
  }
  if (typeof source === 'function') destination = promisify(source);
  methods.forEach(function (name) {
    // promisify only if it's a function
    if (typeof source[name] === 'function') destination[name] = promisify(source[name]);
  });

  // proxy the rest
  Object.keys(source).forEach(function (name) {
    if (deprecated(source, name)) return;
    if (destination[name]) return;
    destination[name] = source[name];
  });
  return destination;
}
function deprecated(source, name) {
  var desc = Object.getOwnPropertyDescriptor(source, name);
  if (!desc || !desc.get) return false;
  if (desc.get.name === 'deprecated') return true;
  return false;
}

/***/ }),

/***/ 504:
/*!********************************************!*\
  !*** ../app/node_modules/thenify/index.js ***!
  \********************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var Promise = __webpack_require__(/*! any-promise */ 154);
var assert = __webpack_require__(/*! assert */ 491);
module.exports = thenify;

/**
 * Turn async functions into promises
 *
 * @param {Function} fn
 * @return {Function}
 * @api public
 */

function thenify(fn, options) {
  assert(typeof fn === 'function');
  return createWrapper(fn, options);
}

/**
 * Turn async functions into promises and backward compatible with callback
 *
 * @param {Function} fn
 * @return {Function}
 * @api public
 */

thenify.withCallback = function (fn, options) {
  assert(typeof fn === 'function');
  options = options || {};
  options.withCallback = true;
  return createWrapper(fn, options);
};
function createCallback(resolve, reject, multiArgs) {
  // default to true
  if (multiArgs === undefined) multiArgs = true;
  return function (err, value) {
    if (err) return reject(err);
    var length = arguments.length;
    if (length <= 2 || !multiArgs) return resolve(value);
    if (Array.isArray(multiArgs)) {
      var values = {};
      for (var i = 1; i < length; i++) values[multiArgs[i - 1]] = arguments[i];
      return resolve(values);
    }
    var values = new Array(length - 1);
    for (var i = 1; i < length; ++i) values[i - 1] = arguments[i];
    resolve(values);
  };
}
function createWrapper(fn, options) {
  options = options || {};
  var name = fn.name;
  name = (name || '').replace(/\s|bound(?!$)/g, '');
  var newFn = function () {
    var self = this;
    var len = arguments.length;
    if (options.withCallback) {
      var lastType = typeof arguments[len - 1];
      if (lastType === 'function') return fn.apply(self, arguments);
    }
    var args = new Array(len + 1);
    for (var i = 0; i < len; ++i) args[i] = arguments[i];
    var lastIndex = i;
    return new Promise(function (resolve, reject) {
      args[lastIndex] = createCallback(resolve, reject, options.multiArgs);
      fn.apply(self, args);
    });
  };
  Object.defineProperty(newFn, 'name', {
    value: name
  });
  return newFn;
}

/***/ }),

/***/ 842:
/*!*******************************************!*\
  !*** ../node_modules/clone-deep/index.js ***!
  \*******************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";


/**
 * Module dependenices
 */
const clone = __webpack_require__(/*! shallow-clone */ 99);
const typeOf = __webpack_require__(/*! kind-of */ 373);
const isPlainObject = __webpack_require__(/*! is-plain-object */ 427);
function cloneDeep(val, instanceClone) {
  switch (typeOf(val)) {
    case 'object':
      return cloneObjectDeep(val, instanceClone);
    case 'array':
      return cloneArrayDeep(val, instanceClone);
    default:
      {
        return clone(val);
      }
  }
}
function cloneObjectDeep(val, instanceClone) {
  if (typeof instanceClone === 'function') {
    return instanceClone(val);
  }
  if (instanceClone || isPlainObject(val)) {
    const res = new val.constructor();
    for (let key in val) {
      res[key] = cloneDeep(val[key], instanceClone);
    }
    return res;
  }
  return val;
}
function cloneArrayDeep(val, instanceClone) {
  const res = new val.constructor(val.length);
  for (let i = 0; i < val.length; i++) {
    res[i] = cloneDeep(val[i], instanceClone);
  }
  return res;
}

/**
 * Expose `cloneDeep`
 */

module.exports = cloneDeep;

/***/ }),

/***/ 529:
/*!******************************************************!*\
  !*** ../node_modules/css-loader/dist/runtime/api.js ***!
  \******************************************************/
/***/ ((module) => {

"use strict";


/*
  MIT License http://www.opensource.org/licenses/mit-license.php
  Author Tobias Koppers @sokra
*/
module.exports = function (cssWithMappingToString) {
  var list = [];

  // return the list of modules as css string
  list.toString = function toString() {
    return this.map(function (item) {
      var content = "";
      var needLayer = typeof item[5] !== "undefined";
      if (item[4]) {
        content += "@supports (".concat(item[4], ") {");
      }
      if (item[2]) {
        content += "@media ".concat(item[2], " {");
      }
      if (needLayer) {
        content += "@layer".concat(item[5].length > 0 ? " ".concat(item[5]) : "", " {");
      }
      content += cssWithMappingToString(item);
      if (needLayer) {
        content += "}";
      }
      if (item[2]) {
        content += "}";
      }
      if (item[4]) {
        content += "}";
      }
      return content;
    }).join("");
  };

  // import a list of modules into the list
  list.i = function i(modules, media, dedupe, supports, layer) {
    if (typeof modules === "string") {
      modules = [[null, modules, undefined]];
    }
    var alreadyImportedModules = {};
    if (dedupe) {
      for (var k = 0; k < this.length; k++) {
        var id = this[k][0];
        if (id != null) {
          alreadyImportedModules[id] = true;
        }
      }
    }
    for (var _k = 0; _k < modules.length; _k++) {
      var item = [].concat(modules[_k]);
      if (dedupe && alreadyImportedModules[item[0]]) {
        continue;
      }
      if (typeof layer !== "undefined") {
        if (typeof item[5] === "undefined") {
          item[5] = layer;
        } else {
          item[1] = "@layer".concat(item[5].length > 0 ? " ".concat(item[5]) : "", " {").concat(item[1], "}");
          item[5] = layer;
        }
      }
      if (media) {
        if (!item[2]) {
          item[2] = media;
        } else {
          item[1] = "@media ".concat(item[2], " {").concat(item[1], "}");
          item[2] = media;
        }
      }
      if (supports) {
        if (!item[4]) {
          item[4] = "".concat(supports);
        } else {
          item[1] = "@supports (".concat(item[4], ") {").concat(item[1], "}");
          item[4] = supports;
        }
      }
      list.push(item);
    }
  };
  return list;
};

/***/ }),

/***/ 230:
/*!*************************************************************!*\
  !*** ../node_modules/css-loader/dist/runtime/sourceMaps.js ***!
  \*************************************************************/
/***/ ((module) => {

"use strict";


module.exports = function (item) {
  var content = item[1];
  var cssMapping = item[3];
  if (!cssMapping) {
    return content;
  }
  if (typeof btoa === "function") {
    var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(cssMapping))));
    var data = "sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(base64);
    var sourceMapping = "/*# ".concat(data, " */");
    return [content].concat([sourceMapping]).join("\n");
  }
  return [content].join("\n");
};

/***/ }),

/***/ 427:
/*!************************************************!*\
  !*** ../node_modules/is-plain-object/index.js ***!
  \************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";
/*!
 * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
 *
 * Copyright (c) 2014-2017, Jon Schlinkert.
 * Released under the MIT License.
 */



var isObject = __webpack_require__(/*! isobject */ 918);
function isObjectObject(o) {
  return isObject(o) === true && Object.prototype.toString.call(o) === '[object Object]';
}
module.exports = function isPlainObject(o) {
  var ctor, prot;
  if (isObjectObject(o) === false) return false;

  // If has modified constructor
  ctor = o.constructor;
  if (typeof ctor !== 'function') return false;

  // If has modified prototype
  prot = ctor.prototype;
  if (isObjectObject(prot) === false) return false;

  // If constructor does not have an Object-specific method
  if (prot.hasOwnProperty('isPrototypeOf') === false) {
    return false;
  }

  // Most likely a plain Object
  return true;
};

/***/ }),

/***/ 918:
/*!*****************************************!*\
  !*** ../node_modules/isobject/index.js ***!
  \*****************************************/
/***/ ((module) => {

"use strict";
/*!
 * isobject <https://github.com/jonschlinkert/isobject>
 *
 * Copyright (c) 2014-2017, Jon Schlinkert.
 * Released under the MIT License.
 */



module.exports = function isObject(val) {
  return val != null && typeof val === 'object' && Array.isArray(val) === false;
};

/***/ }),

/***/ 373:
/*!****************************************!*\
  !*** ../node_modules/kind-of/index.js ***!
  \****************************************/
/***/ ((module) => {

var toString = Object.prototype.toString;
module.exports = function kindOf(val) {
  if (val === void 0) return 'undefined';
  if (val === null) return 'null';
  var type = typeof val;
  if (type === 'boolean') return 'boolean';
  if (type === 'string') return 'string';
  if (type === 'number') return 'number';
  if (type === 'symbol') return 'symbol';
  if (type === 'function') {
    return isGeneratorFn(val) ? 'generatorfunction' : 'function';
  }
  if (isArray(val)) return 'array';
  if (isBuffer(val)) return 'buffer';
  if (isArguments(val)) return 'arguments';
  if (isDate(val)) return 'date';
  if (isError(val)) return 'error';
  if (isRegexp(val)) return 'regexp';
  switch (ctorName(val)) {
    case 'Symbol':
      return 'symbol';
    case 'Promise':
      return 'promise';

    // Set, Map, WeakSet, WeakMap
    case 'WeakMap':
      return 'weakmap';
    case 'WeakSet':
      return 'weakset';
    case 'Map':
      return 'map';
    case 'Set':
      return 'set';

    // 8-bit typed arrays
    case 'Int8Array':
      return 'int8array';
    case 'Uint8Array':
      return 'uint8array';
    case 'Uint8ClampedArray':
      return 'uint8clampedarray';

    // 16-bit typed arrays
    case 'Int16Array':
      return 'int16array';
    case 'Uint16Array':
      return 'uint16array';

    // 32-bit typed arrays
    case 'Int32Array':
      return 'int32array';
    case 'Uint32Array':
      return 'uint32array';
    case 'Float32Array':
      return 'float32array';
    case 'Float64Array':
      return 'float64array';
  }
  if (isGeneratorObj(val)) {
    return 'generator';
  }

  // Non-plain objects
  type = toString.call(val);
  switch (type) {
    case '[object Object]':
      return 'object';
    // iterators
    case '[object Map Iterator]':
      return 'mapiterator';
    case '[object Set Iterator]':
      return 'setiterator';
    case '[object String Iterator]':
      return 'stringiterator';
    case '[object Array Iterator]':
      return 'arrayiterator';
  }

  // other
  return type.slice(8, -1).toLowerCase().replace(/\s/g, '');
};
function ctorName(val) {
  return typeof val.constructor === 'function' ? val.constructor.name : null;
}
function isArray(val) {
  if (Array.isArray) return Array.isArray(val);
  return val instanceof Array;
}
function isError(val) {
  return val instanceof Error || typeof val.message === 'string' && val.constructor && typeof val.constructor.stackTraceLimit === 'number';
}
function isDate(val) {
  if (val instanceof Date) return true;
  return typeof val.toDateString === 'function' && typeof val.getDate === 'function' && typeof val.setDate === 'function';
}
function isRegexp(val) {
  if (val instanceof RegExp) return true;
  return typeof val.flags === 'string' && typeof val.ignoreCase === 'boolean' && typeof val.multiline === 'boolean' && typeof val.global === 'boolean';
}
function isGeneratorFn(name, val) {
  return ctorName(name) === 'GeneratorFunction';
}
function isGeneratorObj(val) {
  return typeof val.throw === 'function' && typeof val.return === 'function' && typeof val.next === 'function';
}
function isArguments(val) {
  try {
    if (typeof val.length === 'number' && typeof val.callee === 'function') {
      return true;
    }
  } catch (err) {
    if (err.message.indexOf('callee') !== -1) {
      return true;
    }
  }
  return false;
}

/**
 * If you need to support Safari 5-7 (8-10 yr-old browser),
 * take a look at https://github.com/feross/is-buffer
 */

function isBuffer(val) {
  if (val.constructor && typeof val.constructor.isBuffer === 'function') {
    return val.constructor.isBuffer(val);
  }
  return false;
}

/***/ }),

/***/ 99:
/*!**********************************************!*\
  !*** ../node_modules/shallow-clone/index.js ***!
  \**********************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";
/*!
 * shallow-clone <https://github.com/jonschlinkert/shallow-clone>
 *
 * Copyright (c) 2015-present, Jon Schlinkert.
 * Released under the MIT License.
 */



const valueOf = Symbol.prototype.valueOf;
const typeOf = __webpack_require__(/*! kind-of */ 373);
function clone(val, deep) {
  switch (typeOf(val)) {
    case 'array':
      return val.slice();
    case 'object':
      return Object.assign({}, val);
    case 'date':
      return new val.constructor(Number(val));
    case 'map':
      return new Map(val);
    case 'set':
      return new Set(val);
    case 'buffer':
      return cloneBuffer(val);
    case 'symbol':
      return cloneSymbol(val);
    case 'arraybuffer':
      return cloneArrayBuffer(val);
    case 'float32array':
    case 'float64array':
    case 'int16array':
    case 'int32array':
    case 'int8array':
    case 'uint16array':
    case 'uint32array':
    case 'uint8clampedarray':
    case 'uint8array':
      return cloneTypedArray(val);
    case 'regexp':
      return cloneRegExp(val);
    case 'error':
      return Object.create(val);
    default:
      {
        return val;
      }
  }
}
function cloneRegExp(val) {
  const flags = val.flags !== void 0 ? val.flags : /\w+$/.exec(val) || void 0;
  const re = new val.constructor(val.source, flags);
  re.lastIndex = val.lastIndex;
  return re;
}
function cloneArrayBuffer(val) {
  const res = new val.constructor(val.byteLength);
  new Uint8Array(res).set(new Uint8Array(val));
  return res;
}
function cloneTypedArray(val, deep) {
  return new val.constructor(val.buffer, val.byteOffset, val.length);
}
function cloneBuffer(val) {
  const len = val.length;
  const buf = Buffer.allocUnsafe ? Buffer.allocUnsafe(len) : Buffer.from(len);
  val.copy(buf);
  return buf;
}
function cloneSymbol(val) {
  return valueOf ? Object(valueOf.call(val)) : {};
}

/**
 * Expose `clone`
 */

module.exports = clone;

/***/ }),

/***/ 830:
/*!********************************************!*\
  !*** ../node_modules/shell-quote/index.js ***!
  \********************************************/
/***/ ((__unused_webpack_module, exports) => {

"use strict";


exports.m = function (xs) {
  return xs.map(function (s) {
    if (s && typeof s === 'object') {
      return s.op.replace(/(.)/g, '\\$1');
    } else if (/["\s]/.test(s) && !/'/.test(s)) {
      return "'" + s.replace(/(['\\])/g, '\\$1') + "'";
    } else if (/["'\s]/.test(s)) {
      return '"' + s.replace(/(["\\$`!])/g, '\\$1') + '"';
    }
    return String(s).replace(/([A-Za-z]:)?([#!"$&'()*,:;<=>?@[\\\]^`{|}])/g, '$1\\$2');
  }).join(' ');
};

// '<(' is process substitution operator and
// can be parsed the same as control operator
var CONTROL = '(?:' + ['\\|\\|', '\\&\\&', ';;', '\\|\\&', '\\<\\(', '>>', '>\\&', '[&;()|<>]'].join('|') + ')';
var META = '|&;()<> \\t';
var BAREWORD = '(\\\\[\'"' + META + ']|[^\\s\'"' + META + '])+';
var SINGLE_QUOTE = '"((\\\\"|[^"])*?)"';
var DOUBLE_QUOTE = '\'((\\\\\'|[^\'])*?)\'';
var TOKEN = '';
for (var i = 0; i < 4; i++) {
  TOKEN += (Math.pow(16, 8) * Math.random()).toString(16);
}
function parse(s, env, opts) {
  var chunker = new RegExp(['(' + CONTROL + ')',
  // control chars
  '(' + BAREWORD + '|' + SINGLE_QUOTE + '|' + DOUBLE_QUOTE + ')*'].join('|'), 'g');
  var match = s.match(chunker).filter(Boolean);
  if (!match) {
    return [];
  }
  if (!env) {
    env = {};
  }
  if (!opts) {
    opts = {};
  }
  var commented = false;
  function getVar(_, pre, key) {
    var r = typeof env === 'function' ? env(key) : env[key];
    if (r === undefined && key != '') {
      r = '';
    } else if (r === undefined) {
      r = '$';
    }
    if (typeof r === 'object') {
      return pre + TOKEN + JSON.stringify(r) + TOKEN;
    }
    return pre + r;
  }
  return match.map(function (s, j) {
    if (commented) {
      return void undefined;
    }
    if (RegExp('^' + CONTROL + '$').test(s)) {
      return {
        op: s
      };
    }

    // Hand-written scanner/parser for Bash quoting rules:
    //
    // 1. inside single quotes, all characters are printed literally.
    // 2. inside double quotes, all characters are printed literally
    //    except variables prefixed by '$' and backslashes followed by
    //    either a double quote or another backslash.
    // 3. outside of any quotes, backslashes are treated as escape
    //    characters and not printed (unless they are themselves escaped)
    // 4. quote context can switch mid-token if there is no whitespace
    //     between the two quote contexts (e.g. all'one'"token" parses as
    //     "allonetoken")
    var SQ = "'";
    var DQ = '"';
    var DS = '$';
    var BS = opts.escape || '\\';
    var quote = false;
    var esc = false;
    var out = '';
    var isGlob = false;
    var i;
    function parseEnvVar() {
      i += 1;
      var varend;
      var varname;
      // debugger
      if (s.charAt(i) === '{') {
        i += 1;
        if (s.charAt(i) === '}') {
          throw new Error('Bad substitution: ' + s.substr(i - 2, 3));
        }
        varend = s.indexOf('}', i);
        if (varend < 0) {
          throw new Error('Bad substitution: ' + s.substr(i));
        }
        varname = s.substr(i, varend - i);
        i = varend;
      } else if (/[*@#?$!_-]/.test(s.charAt(i))) {
        varname = s.charAt(i);
        i += 1;
      } else {
        varend = s.substr(i).match(/[^\w\d_]/);
        if (!varend) {
          varname = s.substr(i);
          i = s.length;
        } else {
          varname = s.substr(i, varend.index);
          i += varend.index - 1;
        }
      }
      return getVar(null, '', varname);
    }
    for (i = 0; i < s.length; i++) {
      var c = s.charAt(i);
      isGlob = isGlob || !quote && (c === '*' || c === '?');
      if (esc) {
        out += c;
        esc = false;
      } else if (quote) {
        if (c === quote) {
          quote = false;
        } else if (quote == SQ) {
          out += c;
        } else {
          // Double quote
          if (c === BS) {
            i += 1;
            c = s.charAt(i);
            if (c === DQ || c === BS || c === DS) {
              out += c;
            } else {
              out += BS + c;
            }
          } else if (c === DS) {
            out += parseEnvVar();
          } else {
            out += c;
          }
        }
      } else if (c === DQ || c === SQ) {
        quote = c;
      } else if (RegExp('^' + CONTROL + '$').test(c)) {
        return {
          op: s
        };
      } else if (/^#$/.test(c)) {
        commented = true;
        if (out.length) {
          return [out, {
            comment: s.slice(i + 1) + match.slice(j + 1).join(' ')
          }];
        }
        return [{
          comment: s.slice(i + 1) + match.slice(j + 1).join(' ')
        }];
      } else if (c === BS) {
        esc = true;
      } else if (c === DS) {
        out += parseEnvVar();
      } else {
        out += c;
      }
    }
    if (isGlob) {
      return {
        op: 'glob',
        pattern: out
      };
    }
    return out;
  }).reduce(function (prev, arg) {
    // finalize parsed aruments
    if (arg === undefined) {
      return prev;
    }
    return prev.concat(arg);
  }, []);
}
exports.Q = function (s, env, opts) {
  var mapped = parse(s, env, opts);
  if (typeof env !== 'function') {
    return mapped;
  }
  return mapped.reduce(function (acc, s) {
    if (typeof s === 'object') {
      return acc.concat(s);
    }
    var xs = s.split(RegExp('(' + TOKEN + '.*?' + TOKEN + ')', 'g'));
    if (xs.length === 1) {
      return acc.concat(xs[0]);
    }
    return acc.concat(xs.filter(Boolean).map(function (x) {
      if (RegExp('^' + TOKEN).test(x)) {
        return JSON.parse(x.split(TOKEN)[1]);
      }
      return x;
    }));
  }, []);
};

/***/ }),

/***/ 518:
/*!***************************************************************************************************************************************************!*\
  !*** ../node_modules/css-loader/dist/cjs.js!../node_modules/sass-loader/dist/cjs.js!./src/components/environmentEditor.component.scss?ngResource ***!
  \***************************************************************************************************************************************************/
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ 230);
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../node_modules/css-loader/dist/runtime/api.js */ 529);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, ":host{display:block}", "",{"version":3,"sources":["webpack://./src/components/environmentEditor.component.scss"],"names":[],"mappings":"AAAA,MACI,aAAA","sourcesContent":[":host {\r\n    display: block;\r\n}\r\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 926:
/*!***********************************************************************************************************************************!*\
  !*** ../node_modules/pug-loader/index.js??ruleSet[1].rules[3].use[1]!./src/components/commandLineEditor.component.pug?ngResource ***!
  \***********************************************************************************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var pug = __webpack_require__(/*! !../../../node_modules/pug-runtime/index.js */ 757);

function template(locals) {var pug_html = "", pug_mixins = {}, pug_interp;var pug_indent = [];
pug_html = pug_html + "\n\u003Cng-container *ngIf=\"!argvMode\"\u003E\n  \u003Cdiv class=\"mb-3\"\u003E\n    \u003Clabel translate\u003ECommand line\u003C\u002Flabel\u003E\n    \u003Cdiv class=\"input-group\"\u003E\u003Ca class=\"input-group-text text-decoration-none\" (click)=\"switchToArgv()\" ngbTooltip=\"Split into unescaped arguments\" href=\"#\"\u003E\u003Ci class=\"fas fa-fw fa-caret-right\"\u003E\u003C\u002Fi\u003E\u003C\u002Fa\u003E\n      \u003Cinput class=\"form-control text-monospace\" [(ngModel)]=\"command\" (ngModelChange)=\"parseCommand()\"\u003E\n    \u003C\u002Fdiv\u003E\n  \u003C\u002Fdiv\u003E\n\u003C\u002Fng-container\u003E\n\u003Cng-container *ngIf=\"argvMode &amp;&amp; _model\"\u003E\n  \u003Cdiv class=\"mb-3\"\u003E\n    \u003Clabel translate\u003EProgram\u003C\u002Flabel\u003E\n    \u003Cdiv class=\"input-group\"\u003E\u003Ca class=\"input-group-text text-decoration-none\" (click)=\"switchToCommand()\" ngbTooltip=\"Combine into a single escaped command\" href=\"#\"\u003E\u003Ci class=\"fas fa-fw fa-caret-down\"\u003E\u003C\u002Fi\u003E\u003C\u002Fa\u003E\n      \u003Cinput class=\"form-control text-monospace\" type=\"text\" [(ngModel)]=\"_model.command\"\u003E\n    \u003C\u002Fdiv\u003E\n  \u003C\u002Fdiv\u003E\n  \u003Cdiv class=\"mb-3\" *ngIf=\"_model.args\"\u003E\n    \u003Clabel translate\u003EArguments\u003C\u002Flabel\u003E\n    \u003Cdiv class=\"input-group\" *ngFor=\"let arg of _model.args; index as i; trackBy: trackByIndex\"\u003E\n      \u003Cinput class=\"form-control text-monospace\" type=\"text\" [(ngModel)]=\"_model.args[i]\"\u003E\n      \u003Cbutton class=\"btn btn-secondary\" (click)=\"_model.args.splice(i, 1)\"\u003E\u003Ci class=\"fas fa-fw fa-trash\"\u003E\u003C\u002Fi\u003E\u003C\u002Fbutton\u003E\n    \u003C\u002Fdiv\u003E\n    \u003Cdiv class=\"mt-2\"\u003E\n      \u003Cbutton class=\"btn btn-secondary\" (click)=\"_model.args.push(&quot;&quot;)\"\u003E\u003Ci class=\"fas fa-plus me-2\"\u003E\u003C\u002Fi\u003E\u003Cspan translate\u003EAdd\u003C\u002Fspan\u003E\u003C\u002Fbutton\u003E\n    \u003C\u002Fdiv\u003E\n  \u003C\u002Fdiv\u003E\n\u003C\u002Fng-container\u003E";;return pug_html;};
module.exports = template;

/***/ }),

/***/ 569:
/*!***********************************************************************************************************************************!*\
  !*** ../node_modules/pug-loader/index.js??ruleSet[1].rules[3].use[1]!./src/components/environmentEditor.component.pug?ngResource ***!
  \***********************************************************************************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var pug = __webpack_require__(/*! !../../../node_modules/pug-runtime/index.js */ 757);

function template(locals) {var pug_html = "", pug_mixins = {}, pug_interp;var pug_indent = [];
pug_html = pug_html + "\n\u003Cdiv class=\"mb-2 d-flex align-items-center\" *ngFor=\"let pair of vars\"\u003E\n  \u003Cdiv class=\"input-group\"\u003E\n    \u003Cinput class=\"form-control w-25 text-monospace\" [(ngModel)]=\"pair.key\" (blur)=\"emitUpdate()\" placeholder=\"Variable name\"\u003E\n    \u003Cdiv class=\"input-group-text\"\u003E=\u003C\u002Fdiv\u003E\n    \u003Cinput class=\"form-control w-50 text-monospace\" [(ngModel)]=\"pair.value\" (blur)=\"emitUpdate()\" placeholder=\"Value\"\u003E\n    \u003Cbutton class=\"btn btn-secondary\" (click)=\"removeEnvironmentVar(pair.key)\"\u003E\u003Ci class=\"fas fa-fw fa-trash\"\u003E\u003C\u002Fi\u003E\u003C\u002Fbutton\u003E\n  \u003C\u002Fdiv\u003E\n\u003C\u002Fdiv\u003E\n\u003Cdiv class=\"d-flex\"\u003E\n  \u003Cbutton class=\"btn btn-secondary\" (click)=\"addEnvironmentVar()\"\u003E\u003Ci class=\"fas fa-plus me-2\"\u003E\u003C\u002Fi\u003E\u003Cspan translate\u003EAdd\u003C\u002Fspan\u003E\u003C\u002Fbutton\u003E\n  \u003Cdiv class=\"ms-auto\"\u003E\u003C\u002Fdiv\u003E\n  \u003Cdiv class=\"text-muted\" translate\u003ESubstitutions allowed.\u003C\u002Fdiv\u003E\n  \u003Cdiv class=\"d-flex ms-1\" *ngIf=\"shouldShowExample()\"\u003E\n    \u003Cdiv class=\"text-muted\" translate\u003EExample:\u003C\u002Fdiv\u003E\u003Ca class=\"ms-1\" (click)=\"addExample()\" href=\"#\"\u003Eextend PATH\u003C\u002Fa\u003E\n  \u003C\u002Fdiv\u003E\n\u003C\u002Fdiv\u003E";;return pug_html;};
module.exports = template;

/***/ }),

/***/ 697:
/*!**************************************************************************************************************************************!*\
  !*** ../node_modules/pug-loader/index.js??ruleSet[1].rules[3].use[1]!./src/components/localProfileSettings.component.pug?ngResource ***!
  \**************************************************************************************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var pug = __webpack_require__(/*! !../../../node_modules/pug-runtime/index.js */ 757);

function template(locals) {var pug_html = "", pug_mixins = {}, pug_interp;var pug_indent = [];
pug_html = pug_html + "\n\u003Ccommand-line-editor [model]=\"profile.options\"\u003E\u003C\u002Fcommand-line-editor\u003E\n\u003Cdiv class=\"form-line\" *ngIf=\"uac?.isAvailable\"\u003E\n  \u003Cdiv class=\"header\"\u003E\n    \u003Cdiv class=\"title\" translate\u003ERun as administrator\u003C\u002Fdiv\u003E\n  \u003C\u002Fdiv\u003E\n  \u003Ctoggle [(ngModel)]=\"profile.options.runAsAdministrator\"\u003E\u003C\u002Ftoggle\u003E\n\u003C\u002Fdiv\u003E\n\u003Cdiv class=\"mb-3\"\u003E\n  \u003Clabel translate\u003EWorking directory\u003C\u002Flabel\u003E\n  \u003Cdiv class=\"input-group\"\u003E\n    \u003Cinput class=\"form-control\" type=\"text\" placeholder=\"Home directory\" [(ngModel)]=\"profile.options.cwd\"\u003E\n    \u003Cbutton class=\"btn btn-secondary\" (click)=\"pickWorkingDirectory()\"\u003E\u003Ci class=\"fas fa-folder-open\"\u003E\u003C\u002Fi\u003E\u003C\u002Fbutton\u003E\n  \u003C\u002Fdiv\u003E\n\u003C\u002Fdiv\u003E\n\u003Cdiv class=\"mb-3\"\u003E\n  \u003Clabel translate\u003EEnvironment\u003C\u002Flabel\u003E\n  \u003Cenvironment-editor type=\"text\" [(model)]=\"profile.options.env\"\u003E\u003C\u002Fenvironment-editor\u003E\n\u003C\u002Fdiv\u003E";;return pug_html;};
module.exports = template;

/***/ }),

/***/ 558:
/*!**********************************************************************************************************************************!*\
  !*** ../node_modules/pug-loader/index.js??ruleSet[1].rules[3].use[1]!./src/components/shellSettingsTab.component.pug?ngResource ***!
  \**********************************************************************************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var pug = __webpack_require__(/*! !../../../node_modules/pug-runtime/index.js */ 757);

function template(locals) {var pug_html = "", pug_mixins = {}, pug_interp;var pug_indent = [];
pug_html = pug_html + "\n\u003Ch3 class=\"mb-3\" translate\u003EShell\u003C\u002Fh3\u003E\n\u003Cdiv class=\"form-line\" *ngIf=\"isConPTYAvailable\"\u003E\n  \u003Cdiv class=\"header\"\u003E\n    \u003Cdiv class=\"title\" translate\u003EUse ConPTY\u003C\u002Fdiv\u003E\n    \u003Cdiv class=\"description\" translate\u003EEnables the experimental Windows ConPTY API\u003C\u002Fdiv\u003E\n  \u003C\u002Fdiv\u003E\n  \u003Ctoggle [(ngModel)]=\"config.store.terminal.useConPTY\" (ngModelChange)=\"config.save()\"\u003E\u003C\u002Ftoggle\u003E\n\u003C\u002Fdiv\u003E\n\u003Cdiv class=\"alert alert-info d-flex align-items-center\" *ngIf=\"config.store.terminal.useConPTY &amp;&amp; isConPTYAvailable &amp;&amp; !isConPTYStable\"\u003E\n  \u003Cdiv class=\"me-auto\" translate\u003EWindows 10 build 18309 or above is recommended for ConPTY\u003C\u002Fdiv\u003E\n\u003C\u002Fdiv\u003E\n\u003Cdiv class=\"alert alert-info d-flex align-items-center\" *ngIf=\"config.store.terminal.profile.startsWith(&quot;WSL&quot;) &amp;&amp; (!config.store.terminal.useConPTY)\"\u003E\n  \u003Cdiv class=\"me-auto\" translate\u003EWSL terminal only supports TrueColor with ConPTY\u003C\u002Fdiv\u003E\n\u003C\u002Fdiv\u003E";;return pug_html;};
module.exports = template;

/***/ }),

/***/ 757:
/*!********************************************!*\
  !*** ../node_modules/pug-runtime/index.js ***!
  \********************************************/
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";


var pug_has_own_property = Object.prototype.hasOwnProperty;

/**
 * Merge two attribute objects giving precedence
 * to values in object `b`. Classes are special-cased
 * allowing for arrays and merging/joining appropriately
 * resulting in a string.
 *
 * @param {Object} a
 * @param {Object} b
 * @return {Object} a
 * @api private
 */

exports.merge = pug_merge;
function pug_merge(a, b) {
  if (arguments.length === 1) {
    var attrs = a[0];
    for (var i = 1; i < a.length; i++) {
      attrs = pug_merge(attrs, a[i]);
    }
    return attrs;
  }

  for (var key in b) {
    if (key === 'class') {
      var valA = a[key] || [];
      a[key] = (Array.isArray(valA) ? valA : [valA]).concat(b[key] || []);
    } else if (key === 'style') {
      var valA = pug_style(a[key]);
      valA = valA && valA[valA.length - 1] !== ';' ? valA + ';' : valA;
      var valB = pug_style(b[key]);
      valB = valB && valB[valB.length - 1] !== ';' ? valB + ';' : valB;
      a[key] = valA + valB;
    } else {
      a[key] = b[key];
    }
  }

  return a;
}

/**
 * Process array, object, or string as a string of classes delimited by a space.
 *
 * If `val` is an array, all members of it and its subarrays are counted as
 * classes. If `escaping` is an array, then whether or not the item in `val` is
 * escaped depends on the corresponding item in `escaping`. If `escaping` is
 * not an array, no escaping is done.
 *
 * If `val` is an object, all the keys whose value is truthy are counted as
 * classes. No escaping is done.
 *
 * If `val` is a string, it is counted as a class. No escaping is done.
 *
 * @param {(Array.<string>|Object.<string, boolean>|string)} val
 * @param {?Array.<string>} escaping
 * @return {String}
 */
exports.classes = pug_classes;
function pug_classes_array(val, escaping) {
  var classString = '',
    className,
    padding = '',
    escapeEnabled = Array.isArray(escaping);
  for (var i = 0; i < val.length; i++) {
    className = pug_classes(val[i]);
    if (!className) continue;
    escapeEnabled && escaping[i] && (className = pug_escape(className));
    classString = classString + padding + className;
    padding = ' ';
  }
  return classString;
}
function pug_classes_object(val) {
  var classString = '',
    padding = '';
  for (var key in val) {
    if (key && val[key] && pug_has_own_property.call(val, key)) {
      classString = classString + padding + key;
      padding = ' ';
    }
  }
  return classString;
}
function pug_classes(val, escaping) {
  if (Array.isArray(val)) {
    return pug_classes_array(val, escaping);
  } else if (val && typeof val === 'object') {
    return pug_classes_object(val);
  } else {
    return val || '';
  }
}

/**
 * Convert object or string to a string of CSS styles delimited by a semicolon.
 *
 * @param {(Object.<string, string>|string)} val
 * @return {String}
 */

exports.style = pug_style;
function pug_style(val) {
  if (!val) return '';
  if (typeof val === 'object') {
    var out = '';
    for (var style in val) {
      /* istanbul ignore else */
      if (pug_has_own_property.call(val, style)) {
        out = out + style + ':' + val[style] + ';';
      }
    }
    return out;
  } else {
    return val + '';
  }
}

/**
 * Render the given attribute.
 *
 * @param {String} key
 * @param {String} val
 * @param {Boolean} escaped
 * @param {Boolean} terse
 * @return {String}
 */
exports.attr = pug_attr;
function pug_attr(key, val, escaped, terse) {
  if (
    val === false ||
    val == null ||
    (!val && (key === 'class' || key === 'style'))
  ) {
    return '';
  }
  if (val === true) {
    return ' ' + (terse ? key : key + '="' + key + '"');
  }
  var type = typeof val;
  if (
    (type === 'object' || type === 'function') &&
    typeof val.toJSON === 'function'
  ) {
    val = val.toJSON();
  }
  if (typeof val !== 'string') {
    val = JSON.stringify(val);
    if (!escaped && val.indexOf('"') !== -1) {
      return ' ' + key + "='" + val.replace(/'/g, '&#39;') + "'";
    }
  }
  if (escaped) val = pug_escape(val);
  return ' ' + key + '="' + val + '"';
}

/**
 * Render the given attributes object.
 *
 * @param {Object} obj
 * @param {Object} terse whether to use HTML5 terse boolean attributes
 * @return {String}
 */
exports.attrs = pug_attrs;
function pug_attrs(obj, terse) {
  var attrs = '';

  for (var key in obj) {
    if (pug_has_own_property.call(obj, key)) {
      var val = obj[key];

      if ('class' === key) {
        val = pug_classes(val);
        attrs = pug_attr(key, val, false, terse) + attrs;
        continue;
      }
      if ('style' === key) {
        val = pug_style(val);
      }
      attrs += pug_attr(key, val, false, terse);
    }
  }

  return attrs;
}

/**
 * Escape the given string of `html`.
 *
 * @param {String} html
 * @return {String}
 * @api private
 */

var pug_match_html = /["&<>]/;
exports.escape = pug_escape;
function pug_escape(_html) {
  var html = '' + _html;
  var regexResult = pug_match_html.exec(html);
  if (!regexResult) return _html;

  var result = '';
  var i, lastIndex, escape;
  for (i = regexResult.index, lastIndex = 0; i < html.length; i++) {
    switch (html.charCodeAt(i)) {
      case 34:
        escape = '&quot;';
        break;
      case 38:
        escape = '&amp;';
        break;
      case 60:
        escape = '&lt;';
        break;
      case 62:
        escape = '&gt;';
        break;
      default:
        continue;
    }
    if (lastIndex !== i) result += html.substring(lastIndex, i);
    lastIndex = i + 1;
    result += escape;
  }
  if (lastIndex !== i) return result + html.substring(lastIndex, i);
  else return result;
}

/**
 * Re-throw the given `err` in context to the
 * the pug in `filename` at the given `lineno`.
 *
 * @param {Error} err
 * @param {String} filename
 * @param {String} lineno
 * @param {String} str original source
 * @api private
 */

exports.rethrow = pug_rethrow;
function pug_rethrow(err, filename, lineno, str) {
  if (!(err instanceof Error)) throw err;
  if ((typeof window != 'undefined' || !filename) && !str) {
    err.message += ' on line ' + lineno;
    throw err;
  }
  var context, lines, start, end;
  try {
    str = str || (__webpack_require__(/*! fs */ 89).readFileSync)(filename, {encoding: 'utf8'});
    context = 3;
    lines = str.split('\n');
    start = Math.max(lineno - context, 0);
    end = Math.min(lines.length, lineno + context);
  } catch (ex) {
    err.message +=
      ' - could not read from ' + filename + ' (' + ex.message + ')';
    pug_rethrow(err, null, lineno);
    return;
  }

  // Error context
  context = lines
    .slice(start, end)
    .map(function(line, i) {
      var curr = i + start + 1;
      return (curr == lineno ? '  > ' : '    ') + curr + '| ' + line;
    })
    .join('\n');

  // Alter exception message
  err.path = filename;
  try {
    err.message =
      (filename || 'Pug') +
      ':' +
      lineno +
      '\n' +
      context +
      '\n\n' +
      err.message;
  } catch (e) {}
  throw err;
}


/***/ }),

/***/ 792:
/*!****************************!*\
  !*** ./src/icons/plus.svg ***!
  \****************************/
/***/ ((module) => {

module.exports = "<svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"fal\" data-icon=\"plus\" class=\"svg-inline--fa fa-plus\" role=\"img\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 448 512\"><path fill=\"currentColor\" d=\"M432 256C432 264.8 424.8 272 416 272h-176V448c0 8.844-7.156 16.01-16 16.01S208 456.8 208 448V272H32c-8.844 0-16-7.15-16-15.99C16 247.2 23.16 240 32 240h176V64c0-8.844 7.156-15.99 16-15.99S240 55.16 240 64v176H416C424.8 240 432 247.2 432 256z\"></path></svg>"

/***/ }),

/***/ 491:
/*!*************************!*\
  !*** external "assert" ***!
  \*************************/
/***/ ((module) => {

"use strict";
module.exports = require("assert");

/***/ }),

/***/ 57:
/*!****************************!*\
  !*** external "constants" ***!
  \****************************/
/***/ ((module) => {

"use strict";
module.exports = require("constants");

/***/ }),

/***/ 837:
/*!***********************!*\
  !*** external "util" ***!
  \***********************/
/***/ ((module) => {

"use strict";
module.exports = require("util");

/***/ }),

/***/ 848:
/*!**********************************!*\
  !*** external "@angular/common" ***!
  \**********************************/
/***/ ((module) => {

"use strict";
module.exports = __WEBPACK_EXTERNAL_MODULE__848__;

/***/ }),

/***/ 900:
/*!********************************!*\
  !*** external "@angular/core" ***!
  \********************************/
/***/ ((module) => {

"use strict";
module.exports = __WEBPACK_EXTERNAL_MODULE__900__;

/***/ }),

/***/ 161:
/*!*********************************!*\
  !*** external "@angular/forms" ***!
  \*********************************/
/***/ ((module) => {

"use strict";
module.exports = __WEBPACK_EXTERNAL_MODULE__161__;

/***/ }),

/***/ 571:
/*!*********************************************!*\
  !*** external "@ng-bootstrap/ng-bootstrap" ***!
  \*********************************************/
/***/ ((module) => {

"use strict";
module.exports = __WEBPACK_EXTERNAL_MODULE__571__;

/***/ }),

/***/ 154:
/*!******************************!*\
  !*** external "any-promise" ***!
  \******************************/
/***/ ((module) => {

"use strict";
module.exports = __WEBPACK_EXTERNAL_MODULE__154__;

/***/ }),

/***/ 89:
/*!*********************!*\
  !*** external "fs" ***!
  \*********************/
/***/ ((module) => {

"use strict";
module.exports = __WEBPACK_EXTERNAL_MODULE__89__;

/***/ }),

/***/ 170:
/*!*****************************!*\
  !*** external "ngx-toastr" ***!
  \*****************************/
/***/ ((module) => {

"use strict";
module.exports = __WEBPACK_EXTERNAL_MODULE__170__;

/***/ }),

/***/ 56:
/*!***********************!*\
  !*** external "path" ***!
  \***********************/
/***/ ((module) => {

"use strict";
module.exports = __WEBPACK_EXTERNAL_MODULE__56__;

/***/ }),

/***/ 832:
/*!***********************!*\
  !*** external "rxjs" ***!
  \***********************/
/***/ ((module) => {

"use strict";
module.exports = __WEBPACK_EXTERNAL_MODULE__832__;

/***/ }),

/***/ 978:
/*!*************************!*\
  !*** external "stream" ***!
  \*************************/
/***/ ((module) => {

"use strict";
module.exports = __WEBPACK_EXTERNAL_MODULE__978__;

/***/ }),

/***/ 315:
/*!*****************************!*\
  !*** external "tabby-core" ***!
  \*****************************/
/***/ ((module) => {

"use strict";
module.exports = __WEBPACK_EXTERNAL_MODULE__315__;

/***/ }),

/***/ 663:
/*!*********************************!*\
  !*** external "tabby-settings" ***!
  \*********************************/
/***/ ((module) => {

"use strict";
module.exports = __WEBPACK_EXTERNAL_MODULE__663__;

/***/ }),

/***/ 316:
/*!*********************************!*\
  !*** external "tabby-terminal" ***!
  \*********************************/
/***/ ((module) => {

"use strict";
module.exports = __WEBPACK_EXTERNAL_MODULE__316__;

/***/ })

/******/ 	});
/************************************************************************/
/******/ 	// The module cache
/******/ 	var __webpack_module_cache__ = {};
/******/ 	
/******/ 	// The require function
/******/ 	function __webpack_require__(moduleId) {
/******/ 		// Check if module is in cache
/******/ 		var cachedModule = __webpack_module_cache__[moduleId];
/******/ 		if (cachedModule !== undefined) {
/******/ 			return cachedModule.exports;
/******/ 		}
/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = __webpack_module_cache__[moduleId] = {
/******/ 			id: moduleId,
/******/ 			// no module.loaded needed
/******/ 			exports: {}
/******/ 		};
/******/ 	
/******/ 		// Execute the module function
/******/ 		__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/ 	
/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}
/******/ 	
/************************************************************************/
/******/ 	/* webpack/runtime/compat get default export */
/******/ 	(() => {
/******/ 		// getDefaultExport function for compatibility with non-harmony modules
/******/ 		__webpack_require__.n = (module) => {
/******/ 			var getter = module && module.__esModule ?
/******/ 				() => (module['default']) :
/******/ 				() => (module);
/******/ 			__webpack_require__.d(getter, { a: getter });
/******/ 			return getter;
/******/ 		};
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/define property getters */
/******/ 	(() => {
/******/ 		// define getter functions for harmony exports
/******/ 		__webpack_require__.d = (exports, definition) => {
/******/ 			for(var key in definition) {
/******/ 				if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ 					Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ 				}
/******/ 			}
/******/ 		};
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/hasOwnProperty shorthand */
/******/ 	(() => {
/******/ 		__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/make namespace object */
/******/ 	(() => {
/******/ 		// define __esModule on exports
/******/ 		__webpack_require__.r = (exports) => {
/******/ 			if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ 				Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ 			}
/******/ 			Object.defineProperty(exports, '__esModule', { value: true });
/******/ 		};
/******/ 	})();
/******/ 	
/************************************************************************/
var __webpack_exports__ = {};
// This entry need to be wrapped in an IIFE because it need to be in strict mode.
(() => {
"use strict";
/*!***********************************!*\
  !*** ./src/index.ts + 18 modules ***!
  \***********************************/
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  "PTYInterface": () => (/* reexport */ PTYInterface),
  "PTYProxy": () => (/* reexport */ PTYProxy),
  "ShellProvider": () => (/* reexport */ ShellProvider),
  "TerminalService": () => (/* reexport */ TerminalService),
  "TerminalTabComponent": () => (/* reexport */ TerminalTabComponent),
  "UACService": () => (/* reexport */ UACService),
  "default": () => (/* binding */ src)
});

;// CONCATENATED MODULE: ../app/node_modules/tslib/tslib.es6.js
/******************************************************************************
Copyright (c) Microsoft Corporation.

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
/* global Reflect, Promise */

var extendStatics = function (d, b) {
  extendStatics = Object.setPrototypeOf || {
    __proto__: []
  } instanceof Array && function (d, b) {
    d.__proto__ = b;
  } || function (d, b) {
    for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
  };
  return extendStatics(d, b);
};
function __extends(d, b) {
  if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
  extendStatics(d, b);
  function __() {
    this.constructor = d;
  }
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
}
var __assign = function () {
  __assign = Object.assign || function __assign(t) {
    for (var s, i = 1, n = arguments.length; i < n; i++) {
      s = arguments[i];
      for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
    }
    return t;
  };
  return __assign.apply(this, arguments);
};
function __rest(s, e) {
  var t = {};
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
  if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
    if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
  }
  return t;
}
function __decorate(decorators, target, key, desc) {
  var c = arguments.length,
    r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,
    d;
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  return c > 3 && r && Object.defineProperty(target, key, r), r;
}
function __param(paramIndex, decorator) {
  return function (target, key) {
    decorator(target, key, paramIndex);
  };
}
function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
  function accept(f) {
    if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected");
    return f;
  }
  var kind = contextIn.kind,
    key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
  var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
  var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
  var _,
    done = false;
  for (var i = decorators.length - 1; i >= 0; i--) {
    var context = {};
    for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
    for (var p in contextIn.access) context.access[p] = contextIn.access[p];
    context.addInitializer = function (f) {
      if (done) throw new TypeError("Cannot add initializers after decoration has completed");
      extraInitializers.push(accept(f || null));
    };
    var result = (0, decorators[i])(kind === "accessor" ? {
      get: descriptor.get,
      set: descriptor.set
    } : descriptor[key], context);
    if (kind === "accessor") {
      if (result === void 0) continue;
      if (result === null || typeof result !== "object") throw new TypeError("Object expected");
      if (_ = accept(result.get)) descriptor.get = _;
      if (_ = accept(result.set)) descriptor.set = _;
      if (_ = accept(result.init)) initializers.push(_);
    } else if (_ = accept(result)) {
      if (kind === "field") initializers.push(_);else descriptor[key] = _;
    }
  }
  if (target) Object.defineProperty(target, contextIn.name, descriptor);
  done = true;
}
;
function __runInitializers(thisArg, initializers, value) {
  var useValue = arguments.length > 2;
  for (var i = 0; i < initializers.length; i++) {
    value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
  }
  return useValue ? value : void 0;
}
;
function __propKey(x) {
  return typeof x === "symbol" ? x : "".concat(x);
}
;
function __setFunctionName(f, name, prefix) {
  if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
  return Object.defineProperty(f, "name", {
    configurable: true,
    value: prefix ? "".concat(prefix, " ", name) : name
  });
}
;
function __metadata(metadataKey, metadataValue) {
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
}
function __awaiter(thisArg, _arguments, P, generator) {
  function adopt(value) {
    return value instanceof P ? value : new P(function (resolve) {
      resolve(value);
    });
  }
  return new (P || (P = Promise))(function (resolve, reject) {
    function fulfilled(value) {
      try {
        step(generator.next(value));
      } catch (e) {
        reject(e);
      }
    }
    function rejected(value) {
      try {
        step(generator["throw"](value));
      } catch (e) {
        reject(e);
      }
    }
    function step(result) {
      result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
    }
    step((generator = generator.apply(thisArg, _arguments || [])).next());
  });
}
function __generator(thisArg, body) {
  var _ = {
      label: 0,
      sent: function () {
        if (t[0] & 1) throw t[1];
        return t[1];
      },
      trys: [],
      ops: []
    },
    f,
    y,
    t,
    g;
  return g = {
    next: verb(0),
    "throw": verb(1),
    "return": verb(2)
  }, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
    return this;
  }), g;
  function verb(n) {
    return function (v) {
      return step([n, v]);
    };
  }
  function step(op) {
    if (f) throw new TypeError("Generator is already executing.");
    while (g && (g = 0, op[0] && (_ = 0)), _) try {
      if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
      if (y = 0, t) op = [op[0] & 2, t.value];
      switch (op[0]) {
        case 0:
        case 1:
          t = op;
          break;
        case 4:
          _.label++;
          return {
            value: op[1],
            done: false
          };
        case 5:
          _.label++;
          y = op[1];
          op = [0];
          continue;
        case 7:
          op = _.ops.pop();
          _.trys.pop();
          continue;
        default:
          if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
            _ = 0;
            continue;
          }
          if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
            _.label = op[1];
            break;
          }
          if (op[0] === 6 && _.label < t[1]) {
            _.label = t[1];
            t = op;
            break;
          }
          if (t && _.label < t[2]) {
            _.label = t[2];
            _.ops.push(op);
            break;
          }
          if (t[2]) _.ops.pop();
          _.trys.pop();
          continue;
      }
      op = body.call(thisArg, _);
    } catch (e) {
      op = [6, e];
      y = 0;
    } finally {
      f = t = 0;
    }
    if (op[0] & 5) throw op[1];
    return {
      value: op[0] ? op[1] : void 0,
      done: true
    };
  }
}
var __createBinding = Object.create ? function (o, m, k, k2) {
  if (k2 === undefined) k2 = k;
  var desc = Object.getOwnPropertyDescriptor(m, k);
  if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
    desc = {
      enumerable: true,
      get: function () {
        return m[k];
      }
    };
  }
  Object.defineProperty(o, k2, desc);
} : function (o, m, k, k2) {
  if (k2 === undefined) k2 = k;
  o[k2] = m[k];
};
function __exportStar(m, o) {
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);
}
function __values(o) {
  var s = typeof Symbol === "function" && Symbol.iterator,
    m = s && o[s],
    i = 0;
  if (m) return m.call(o);
  if (o && typeof o.length === "number") return {
    next: function () {
      if (o && i >= o.length) o = void 0;
      return {
        value: o && o[i++],
        done: !o
      };
    }
  };
  throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
}
function __read(o, n) {
  var m = typeof Symbol === "function" && o[Symbol.iterator];
  if (!m) return o;
  var i = m.call(o),
    r,
    ar = [],
    e;
  try {
    while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
  } catch (error) {
    e = {
      error: error
    };
  } finally {
    try {
      if (r && !r.done && (m = i["return"])) m.call(i);
    } finally {
      if (e) throw e.error;
    }
  }
  return ar;
}

/** @deprecated */
function __spread() {
  for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));
  return ar;
}

/** @deprecated */
function __spreadArrays() {
  for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
  for (var r = Array(s), k = 0, i = 0; i < il; i++) for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) r[k] = a[j];
  return r;
}
function __spreadArray(to, from, pack) {
  if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
    if (ar || !(i in from)) {
      if (!ar) ar = Array.prototype.slice.call(from, 0, i);
      ar[i] = from[i];
    }
  }
  return to.concat(ar || Array.prototype.slice.call(from));
}
function __await(v) {
  return this instanceof __await ? (this.v = v, this) : new __await(v);
}
function __asyncGenerator(thisArg, _arguments, generator) {
  if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  var g = generator.apply(thisArg, _arguments || []),
    i,
    q = [];
  return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () {
    return this;
  }, i;
  function verb(n) {
    if (g[n]) i[n] = function (v) {
      return new Promise(function (a, b) {
        q.push([n, v, a, b]) > 1 || resume(n, v);
      });
    };
  }
  function resume(n, v) {
    try {
      step(g[n](v));
    } catch (e) {
      settle(q[0][3], e);
    }
  }
  function step(r) {
    r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r);
  }
  function fulfill(value) {
    resume("next", value);
  }
  function reject(value) {
    resume("throw", value);
  }
  function settle(f, v) {
    if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]);
  }
}
function __asyncDelegator(o) {
  var i, p;
  return i = {}, verb("next"), verb("throw", function (e) {
    throw e;
  }), verb("return"), i[Symbol.iterator] = function () {
    return this;
  }, i;
  function verb(n, f) {
    i[n] = o[n] ? function (v) {
      return (p = !p) ? {
        value: __await(o[n](v)),
        done: false
      } : f ? f(v) : v;
    } : f;
  }
}
function __asyncValues(o) {
  if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  var m = o[Symbol.asyncIterator],
    i;
  return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () {
    return this;
  }, i);
  function verb(n) {
    i[n] = o[n] && function (v) {
      return new Promise(function (resolve, reject) {
        v = o[n](v), settle(resolve, reject, v.done, v.value);
      });
    };
  }
  function settle(resolve, reject, d, v) {
    Promise.resolve(v).then(function (v) {
      resolve({
        value: v,
        done: d
      });
    }, reject);
  }
}
function __makeTemplateObject(cooked, raw) {
  if (Object.defineProperty) {
    Object.defineProperty(cooked, "raw", {
      value: raw
    });
  } else {
    cooked.raw = raw;
  }
  return cooked;
}
;
var __setModuleDefault = Object.create ? function (o, v) {
  Object.defineProperty(o, "default", {
    enumerable: true,
    value: v
  });
} : function (o, v) {
  o["default"] = v;
};
function __importStar(mod) {
  if (mod && mod.__esModule) return mod;
  var result = {};
  if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  __setModuleDefault(result, mod);
  return result;
}
function __importDefault(mod) {
  return mod && mod.__esModule ? mod : {
    default: mod
  };
}
function __classPrivateFieldGet(receiver, state, kind, f) {
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
}
function __classPrivateFieldSet(receiver, state, value, kind, f) {
  if (kind === "m") throw new TypeError("Private method is not writable");
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
  return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value;
}
function __classPrivateFieldIn(state, receiver) {
  if (receiver === null || typeof receiver !== "object" && typeof receiver !== "function") throw new TypeError("Cannot use 'in' operator on non-object");
  return typeof state === "function" ? receiver === state : state.has(receiver);
}
// EXTERNAL MODULE: external "@angular/core"
var core_ = __webpack_require__(900);
// EXTERNAL MODULE: external "@angular/common"
var common_ = __webpack_require__(848);
// EXTERNAL MODULE: external "@angular/forms"
var forms_ = __webpack_require__(161);
// EXTERNAL MODULE: external "@ng-bootstrap/ng-bootstrap"
var ng_bootstrap_ = __webpack_require__(571);
// EXTERNAL MODULE: external "ngx-toastr"
var external_ngx_toastr_ = __webpack_require__(170);
// EXTERNAL MODULE: external "tabby-core"
var external_tabby_core_ = __webpack_require__(315);
var external_tabby_core_default = /*#__PURE__*/__webpack_require__.n(external_tabby_core_);
// EXTERNAL MODULE: external "tabby-terminal"
var external_tabby_terminal_ = __webpack_require__(316);
var external_tabby_terminal_default = /*#__PURE__*/__webpack_require__.n(external_tabby_terminal_);
// EXTERNAL MODULE: external "tabby-settings"
var external_tabby_settings_ = __webpack_require__(663);
;// CONCATENATED MODULE: ../node_modules/@biesbjerg/ngx-translate-extract-marker/__ivy_ngcc__/esm2015/lib/ngx-translate-extract-marker.js
/**
 * @fileoverview added by tsickle
 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
 */
/**
 * @template T
 * @param {?} key
 * @return {?}
 */
function marker(key) {
  return key;
}
;// CONCATENATED MODULE: ./src/api.ts
/**
 * Extend to add support for more shells
 */
class ShellProvider {
}
class UACService {
    constructor() {
        this.isAvailable = false;
    }
}
class PTYProxy {
}
class PTYInterface {
}

// EXTERNAL MODULE: ../app/node_modules/mz/fs.js
var fs = __webpack_require__(461);
// EXTERNAL MODULE: external "fs"
var external_fs_ = __webpack_require__(89);
;// CONCATENATED MODULE: ./src/session.ts






const windowsDirectoryRegex = /([a-zA-Z]:[^\:\[\]\?\"\<\>\|]+)/mi;
function mergeEnv(...envs) {
    var _a;
    const result = {};
    const keyMap = {};
    for (const env of envs) {
        for (const [key, value] of Object.entries(env)) {
            // const lookup = process.platform === 'win32' ? key.toLowerCase() : key
            const lookup = key.toLowerCase();
            (_a = keyMap[lookup]) !== null && _a !== void 0 ? _a : (keyMap[lookup] = key);
            result[keyMap[lookup]] = value;
        }
    }
    return result;
}
function substituteEnv(env) {
    env = Object.assign({}, env);
    const pattern = process.platform === 'win32' ? /%(\w+)%/g : /\$(\w+)\b/g;
    for (const [key, value] of Object.entries(env)) {
        env[key] = value.toString().replace(pattern, function (substring, p1) {
            var _a, _b, _c;
            if (process.platform === 'win32') {
                return (_b = (_a = Object.entries(process.env).find(x => x[0].toLowerCase() === p1.toLowerCase())) === null || _a === void 0 ? void 0 : _a[1]) !== null && _b !== void 0 ? _b : '';
            }
            else {
                return (_c = process.env[p1]) !== null && _c !== void 0 ? _c : '';
            }
        });
    }
    return env;
}
/** @hidden */
class Session extends external_tabby_terminal_.BaseSession {
    constructor(injector) {
        super(injector.get(external_tabby_core_.LogService).create('local'));
        this.pty = null;
        this.ptyClosed = false;
        this.pauseAfterExit = false;
        this.guessedCWD = null;
        this.initialCWD = null;
        this.config = injector.get(external_tabby_core_.ConfigService);
        this.hostApp = injector.get(external_tabby_core_.HostAppService);
        this.ptyInterface = injector.get(PTYInterface);
        this.bootstrapData = injector.get(external_tabby_core_.BOOTSTRAP_DATA);
    }
    start(options) {
        var _a, _b, _c, _d, _e, _f;
        return __awaiter(this, void 0, void 0, function* () {
            let pty = null;
            if (options.restoreFromPTYID) {
                pty = yield this.ptyInterface.restore(options.restoreFromPTYID);
                options.restoreFromPTYID = undefined;
            }
            if (!pty) {
                let env = mergeEnv(process.env, {
                    COLORTERM: 'truecolor',
                    TERM: 'xterm-256color',
                    TERM_PROGRAM: 'Tabby',
                }, substituteEnv((_a = options.env) !== null && _a !== void 0 ? _a : {}), this.config.store.terminal.environment || {});
                if (this.hostApp.platform === external_tabby_core_.Platform.Windows && this.config.store.terminal.setComSpec) {
                    env = mergeEnv(env, { COMSPEC: this.bootstrapData.executable });
                }
                delete env[''];
                if (this.hostApp.platform === external_tabby_core_.Platform.macOS && !process.env.LC_ALL) {
                    const locale = (_b = process.env.LC_CTYPE) !== null && _b !== void 0 ? _b : 'en_US.UTF-8';
                    Object.assign(env, {
                        LANG: locale,
                        LC_ALL: locale,
                        LC_MESSAGES: locale,
                        LC_NUMERIC: locale,
                        LC_COLLATE: locale,
                        LC_MONETARY: locale,
                    });
                }
                // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
                let cwd = options.cwd || process.env.HOME;
                if (!external_fs_.existsSync(cwd)) {
                    console.warn('Ignoring non-existent CWD:', cwd);
                    cwd = undefined;
                }
                pty = yield this.ptyInterface.spawn(options.command, (_c = options.args) !== null && _c !== void 0 ? _c : [], {
                    name: 'xterm-256color',
                    cols: (_d = options.width) !== null && _d !== void 0 ? _d : 80,
                    rows: (_e = options.height) !== null && _e !== void 0 ? _e : 30,
                    encoding: null,
                    cwd,
                    env: env,
                    // `1` instead of `true` forces ConPTY even if unstable
                    useConpty: (0,external_tabby_core_.isWindowsBuild)(external_tabby_core_.WIN_BUILD_CONPTY_SUPPORTED) && this.config.store.terminal.useConPTY ? 1 : false,
                });
                this.guessedCWD = cwd !== null && cwd !== void 0 ? cwd : null;
            }
            this.pty = pty;
            pty.getTruePID().then(() => __awaiter(this, void 0, void 0, function* () {
                this.initialCWD = yield this.getWorkingDirectory();
            }));
            this.open = true;
            this.pty.subscribe('data', (array) => {
                this.pty.ackData(array.length);
                const data = Buffer.from(array);
                this.emitOutput(data);
                if (this.hostApp.platform === external_tabby_core_.Platform.Windows) {
                    this.guessWindowsCWD(data.toString());
                }
            });
            this.pty.subscribe('exit', () => {
                if (this.pauseAfterExit) {
                    return;
                }
                else if (this.open) {
                    this.destroy();
                }
            });
            this.pty.subscribe('close', () => {
                this.ptyClosed = true;
                if (this.pauseAfterExit) {
                    this.emitOutput(Buffer.from('\r\nPress any key to close\r\n'));
                }
                else if (this.open) {
                    this.destroy();
                }
            });
            this.pauseAfterExit = (_f = options.pauseAfterExit) !== null && _f !== void 0 ? _f : false;
            this.destroyed$.subscribe(() => this.pty.unsubscribeAll());
        });
    }
    getID() {
        var _a, _b;
        return (_b = (_a = this.pty) === null || _a === void 0 ? void 0 : _a.getID()) !== null && _b !== void 0 ? _b : null;
    }
    resize(columns, rows) {
        var _a;
        (_a = this.pty) === null || _a === void 0 ? void 0 : _a.resize(columns, rows);
    }
    write(data) {
        var _a;
        if (this.ptyClosed) {
            this.destroy();
        }
        if (this.open) {
            (_a = this.pty) === null || _a === void 0 ? void 0 : _a.write(data);
        }
    }
    kill(signal) {
        var _a;
        (_a = this.pty) === null || _a === void 0 ? void 0 : _a.kill(signal);
    }
    getChildProcesses() {
        var _a, _b;
        return __awaiter(this, void 0, void 0, function* () {
            return (_b = (_a = this.pty) === null || _a === void 0 ? void 0 : _a.getChildProcesses()) !== null && _b !== void 0 ? _b : [];
        });
    }
    gracefullyKillProcess() {
        return __awaiter(this, void 0, void 0, function* () {
            if (this.hostApp.platform === external_tabby_core_.Platform.Windows) {
                this.kill();
            }
            else {
                yield new Promise((resolve) => {
                    this.kill('SIGTERM');
                    setTimeout(() => __awaiter(this, void 0, void 0, function* () {
                        try {
                            process.kill(yield this.pty.getPID(), 0);
                            // still alive
                            this.kill('SIGKILL');
                            resolve();
                        }
                        catch (_a) {
                            resolve();
                        }
                    }), 500);
                });
            }
        });
    }
    supportsWorkingDirectory() {
        var _a, _b;
        return !!((_b = (_a = this.initialCWD) !== null && _a !== void 0 ? _a : this.reportedCWD) !== null && _b !== void 0 ? _b : this.guessedCWD);
    }
    getWorkingDirectory() {
        var _a, _b;
        return __awaiter(this, void 0, void 0, function* () {
            if (this.reportedCWD) {
                return this.reportedCWD;
            }
            let cwd = null;
            try {
                cwd = (_b = yield ((_a = this.pty) === null || _a === void 0 ? void 0 : _a.getWorkingDirectory())) !== null && _b !== void 0 ? _b : null;
            }
            catch (exc) {
                console.info('Could not read working directory:', exc);
            }
            try {
                cwd = yield fs.realpath(cwd);
            }
            catch (_c) { }
            if (this.hostApp.platform === external_tabby_core_.Platform.Windows && (cwd === this.initialCWD || cwd === process.env.WINDIR)) {
                // shell doesn't truly change its process' CWD
                cwd = null;
            }
            // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
            cwd = cwd || this.guessedCWD;
            try {
                yield fs.access(cwd);
            }
            catch (_d) {
                return null;
            }
            return cwd;
        });
    }
    guessWindowsCWD(data) {
        const match = windowsDirectoryRegex.exec(data);
        if (match) {
            this.guessedCWD = match[0];
        }
    }
}

;// CONCATENATED MODULE: ./src/components/terminalTab.component.ts







/** @hidden */
let TerminalTabComponent = class TerminalTabComponent extends external_tabby_terminal_.BaseTerminalTabComponent {
    // eslint-disable-next-line @typescript-eslint/no-useless-constructor
    constructor(injector, uac) {
        super(injector);
        this.uac = uac;
        this.session = null;
    }
    ngOnInit() {
        this.sessionOptions = this.profile.options;
        this.logger = this.log.create('terminalTab');
        const isConPTY = (0,external_tabby_core_.isWindowsBuild)(external_tabby_core_.WIN_BUILD_CONPTY_SUPPORTED) && this.config.store.terminal.useConPTY;
        this.subscribeUntilDestroyed(this.hotkeys.hotkey$, hotkey => {
            if (!this.hasFocus) {
                return;
            }
            switch (hotkey) {
                case 'home':
                    this.sendInput(isConPTY ? '\x1b[H' : '\x1bOH');
                    break;
                case 'end':
                    this.sendInput(isConPTY ? '\x1b[F' : '\x1bOF');
                    break;
            }
        });
        super.ngOnInit();
    }
    onFrontendReady() {
        var _a;
        this.initializeSession(this.size.columns, this.size.rows);
        this.savedStateIsLive = this.profile.options.restoreFromPTYID === ((_a = this.session) === null || _a === void 0 ? void 0 : _a.getID());
        super.onFrontendReady();
    }
    initializeSession(columns, rows) {
        var _a;
        const session = new Session(this.injector);
        if (this.profile.options.runAsAdministrator && ((_a = this.uac) === null || _a === void 0 ? void 0 : _a.isAvailable)) {
            this.profile = Object.assign(Object.assign({}, this.profile), { options: this.uac.patchSessionOptionsForUAC(this.profile.options) });
        }
        session.start(Object.assign(Object.assign({}, this.profile.options), { width: columns, height: rows }));
        this.setSession(session);
        this.recoveryStateChangedHint.next();
    }
    getRecoveryToken(options) {
        var _a, _b;
        return __awaiter(this, void 0, void 0, function* () {
            const cwd = this.session ? yield this.session.getWorkingDirectory() : null;
            return {
                type: 'app:local-tab',
                profile: Object.assign(Object.assign({}, this.profile), { options: Object.assign(Object.assign({}, this.profile.options), { cwd: cwd !== null && cwd !== void 0 ? cwd : this.profile.options.cwd, restoreFromPTYID: (options === null || options === void 0 ? void 0 : options.includeState) && ((_a = this.session) === null || _a === void 0 ? void 0 : _a.getID()) }) }),
                savedState: (options === null || options === void 0 ? void 0 : options.includeState) && ((_b = this.frontend) === null || _b === void 0 ? void 0 : _b.saveState()),
            };
        });
    }
    getCurrentProcess() {
        var _a;
        return __awaiter(this, void 0, void 0, function* () {
            const children = yield ((_a = this.session) === null || _a === void 0 ? void 0 : _a.getChildProcesses());
            if (!(children === null || children === void 0 ? void 0 : children.length)) {
                return null;
            }
            return {
                name: children[0].command,
            };
        });
    }
    canClose() {
        var _a;
        return __awaiter(this, void 0, void 0, function* () {
            const children = yield ((_a = this.session) === null || _a === void 0 ? void 0 : _a.getChildProcesses());
            if (!(children === null || children === void 0 ? void 0 : children.length)) {
                return true;
            }
            return (yield this.platform.showMessageBox({
                type: 'warning',
                message: this.translate.instant(marker('"{command}" is still running. Close?'), children[0]),
                buttons: [
                    this.translate.instant(marker('Kill')),
                    this.translate.instant(marker('Cancel')),
                ],
                defaultId: 0,
                cancelId: 1,
            })).response === 0;
        });
    }
    ngOnDestroy() {
        var _a;
        super.ngOnDestroy();
        (_a = this.session) === null || _a === void 0 ? void 0 : _a.destroy();
    }
    /**
     * Return true if the user explicitly exit the session.
     * Always return true for terminalTab as the session can only be ended by the user
     */
    isSessionExplicitlyTerminated() {
        return true;
    }
};
TerminalTabComponent.ctorParameters = () => [
    { type: core_.Injector },
    { type: undefined, decorators: [{ type: core_.Optional }, { type: core_.Inject, args: [UACService,] }] }
];
TerminalTabComponent.propDecorators = {
    sessionOptions: [{ type: core_.Input }]
};
TerminalTabComponent = __decorate([
    (0,core_.Component)({
        selector: 'terminalTab',
        template: external_tabby_terminal_.BaseTerminalTabComponent.template,
        styles: external_tabby_terminal_.BaseTerminalTabComponent.styles,
        animations: external_tabby_terminal_.BaseTerminalTabComponent.animations,
    }),
    __metadata("design:paramtypes", [core_.Injector, Object])
], TerminalTabComponent);


// EXTERNAL MODULE: ./src/components/shellSettingsTab.component.pug?ngResource
var shellSettingsTab_componentngResource = __webpack_require__(213);
var shellSettingsTab_componentngResource_default = /*#__PURE__*/__webpack_require__.n(shellSettingsTab_componentngResource);
;// CONCATENATED MODULE: ./src/components/shellSettingsTab.component.ts




/** @hidden */
let ShellSettingsTabComponent = class ShellSettingsTabComponent {
    constructor(config) {
        this.config = config;
        this.isConPTYAvailable = (0,external_tabby_core_.isWindowsBuild)(external_tabby_core_.WIN_BUILD_CONPTY_SUPPORTED);
        this.isConPTYStable = (0,external_tabby_core_.isWindowsBuild)(external_tabby_core_.WIN_BUILD_CONPTY_STABLE);
    }
};
ShellSettingsTabComponent.ctorParameters = () => [
    { type: external_tabby_core_.ConfigService }
];
ShellSettingsTabComponent.propDecorators = {
    true: [{ type: core_.HostBinding, args: ['class.content-box',] }]
};
ShellSettingsTabComponent = __decorate([
    (0,core_.Component)({
        template: (shellSettingsTab_componentngResource_default()),
    }),
    __metadata("design:paramtypes", [external_tabby_core_.ConfigService])
], ShellSettingsTabComponent);


// EXTERNAL MODULE: ./src/components/environmentEditor.component.pug?ngResource
var environmentEditor_componentngResource = __webpack_require__(759);
var environmentEditor_componentngResource_default = /*#__PURE__*/__webpack_require__.n(environmentEditor_componentngResource);
// EXTERNAL MODULE: ./src/components/environmentEditor.component.scss?ngResource
var components_environmentEditor_componentngResource = __webpack_require__(291);
var components_environmentEditor_componentngResource_default = /*#__PURE__*/__webpack_require__.n(components_environmentEditor_componentngResource);
// EXTERNAL MODULE: external "rxjs"
var external_rxjs_ = __webpack_require__(832);
;// CONCATENATED MODULE: ./src/components/environmentEditor.component.ts



/* eslint-disable @typescript-eslint/explicit-module-boundary-types */


/** @hidden */
let EnvironmentEditorComponent = class EnvironmentEditorComponent {
    constructor() {
        this.modelChange = new external_rxjs_.Subject();
        this.vars = [];
    }
    get model() {
        return this.cachedModel;
    }
    set model(value) {
        this.vars = Object.entries(value).map(([k, v]) => ({ key: k, value: v }));
        this.cachedModel = this.getModel();
    }
    getModel() {
        const model = {};
        for (const pair of this.vars) {
            model[pair.key] = pair.value;
        }
        return model;
    }
    emitUpdate() {
        this.cachedModel = this.getModel();
        this.modelChange.next(this.cachedModel);
    }
    addEnvironmentVar() {
        this.vars.push({ key: '', value: '' });
    }
    removeEnvironmentVar(key) {
        this.vars = this.vars.filter(x => x.key !== key);
        this.emitUpdate();
    }
    shouldShowExample() {
        return !this.vars.find(v => v.key.toLowerCase() === 'path');
    }
    addExample() {
        const value = process.platform === 'win32' ? 'C:\\Program Files\\Custom:%PATH%' : '/opt/custom:$PATH';
        this.vars.push({ key: 'PATH', value });
        this.emitUpdate();
    }
};
EnvironmentEditorComponent.propDecorators = {
    modelChange: [{ type: core_.Output }],
    model: [{ type: core_.Input }]
};
EnvironmentEditorComponent = __decorate([
    (0,core_.Component)({
        selector: 'environment-editor',
        template: (environmentEditor_componentngResource_default()),
        styles: [(components_environmentEditor_componentngResource_default())]
    })
], EnvironmentEditorComponent);


// EXTERNAL MODULE: ./src/components/localProfileSettings.component.pug?ngResource
var localProfileSettings_componentngResource = __webpack_require__(189);
var localProfileSettings_componentngResource_default = /*#__PURE__*/__webpack_require__.n(localProfileSettings_componentngResource);
;// CONCATENATED MODULE: ./src/components/localProfileSettings.component.ts


/* eslint-disable @typescript-eslint/explicit-module-boundary-types */



/** @hidden */
let LocalProfileSettingsComponent = class LocalProfileSettingsComponent {
    constructor(uac, platform) {
        this.uac = uac;
        this.platform = platform;
    }
    ngOnInit() {
        var _a, _b;
        this.profile.options.env = (_a = this.profile.options.env) !== null && _a !== void 0 ? _a : {};
        this.profile.options.args = (_b = this.profile.options.args) !== null && _b !== void 0 ? _b : [];
    }
    pickWorkingDirectory() {
        return __awaiter(this, void 0, void 0, function* () {
            // const profile = await this.terminal.getProfileByID(this.config.store.terminal.profile)
            // const shell = this.shells.find(x => x.id === profile?.shell)
            // if (!shell) {
            //     return
            // }
            this.profile.options.cwd = yield this.platform.pickDirectory();
        });
    }
};
LocalProfileSettingsComponent.ctorParameters = () => [
    { type: undefined, decorators: [{ type: core_.Optional }, { type: core_.Inject, args: [UACService,] }] },
    { type: external_tabby_core_.PlatformService }
];
LocalProfileSettingsComponent = __decorate([
    (0,core_.Component)({
        template: (localProfileSettings_componentngResource_default()),
    }),
    __metadata("design:paramtypes", [Object, external_tabby_core_.PlatformService])
], LocalProfileSettingsComponent);


// EXTERNAL MODULE: ./src/components/commandLineEditor.component.pug?ngResource
var commandLineEditor_componentngResource = __webpack_require__(150);
var commandLineEditor_componentngResource_default = /*#__PURE__*/__webpack_require__.n(commandLineEditor_componentngResource);
// EXTERNAL MODULE: ../node_modules/shell-quote/index.js
var shell_quote = __webpack_require__(830);
;// CONCATENATED MODULE: ./src/components/commandLineEditor.component.ts


/* eslint-disable @typescript-eslint/explicit-module-boundary-types */


/** @hidden */
let CommandLineEditorComponent = class CommandLineEditorComponent {
    constructor() {
        this.argvMode = false;
        this.command = '';
    }
    get model() {
        return this._model;
    }
    set model(value) {
        this._model = value;
        this.updateCommand();
    }
    switchToCommand() {
        this.updateCommand();
        this.argvMode = false;
    }
    switchToArgv() {
        this.argvMode = true;
    }
    parseCommand() {
        var _a;
        const args = shell_quote/* parse */.Q(this.command);
        this.model.command = (_a = args[0]) !== null && _a !== void 0 ? _a : '';
        this.model.args = args.slice(1);
    }
    updateCommand() {
        var _a;
        this.command = shell_quote/* quote */.m([
            this.model.command,
            ...(_a = this.model.args) !== null && _a !== void 0 ? _a : [],
        ]);
    }
    trackByIndex(index) {
        return index;
    }
};
CommandLineEditorComponent.propDecorators = {
    argvMode: [{ type: core_.Input }],
    _model: [{ type: core_.Input }],
    model: [{ type: core_.Input }]
};
CommandLineEditorComponent = __decorate([
    (0,core_.Component)({
        selector: 'command-line-editor',
        template: (commandLineEditor_componentngResource_default()),
    })
], CommandLineEditorComponent);


;// CONCATENATED MODULE: ./src/services/terminal.service.ts




let TerminalService = class TerminalService {
    /** @hidden */
    constructor(profilesService, config, log) {
        this.profilesService = profilesService;
        this.config = config;
        this.logger = log.create('terminal');
    }
    getDefaultProfile() {
        return __awaiter(this, void 0, void 0, function* () {
            const profiles = yield this.profilesService.getProfiles();
            let profile = profiles.find(x => x.id === this.config.store.terminal.profile);
            if (!profile) {
                profile = profiles.filter(x => x.type === 'local' && x.isBuiltin)[0];
            }
            return profile;
        });
    }
    /**
     * Launches a new terminal with a specific shell and CWD
     * @param pause Wait for a keypress when the shell exits
     */
    openTab(profile, cwd, pause) {
        return __awaiter(this, void 0, void 0, function* () {
            if (!profile) {
                profile = yield this.getDefaultProfile();
            }
            const fullProfile = this.profilesService.getConfigProxyForProfile(profile);
            cwd = cwd !== null && cwd !== void 0 ? cwd : fullProfile.options.cwd;
            if (cwd && !external_fs_.existsSync(cwd)) {
                console.warn('Ignoring non-existent CWD:', cwd);
                cwd = null;
            }
            this.logger.info(`Starting profile ${fullProfile.name}`, fullProfile);
            const options = Object.assign(Object.assign({}, fullProfile.options), { 
                // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
                pauseAfterExit: fullProfile.options.pauseAfterExit || pause, cwd: cwd !== null && cwd !== void 0 ? cwd : undefined });
            return (yield this.profilesService.openNewTabForProfile(Object.assign(Object.assign({}, fullProfile), { options })));
        });
    }
};
TerminalService.ctorParameters = () => [
    { type: external_tabby_core_.ProfilesService },
    { type: external_tabby_core_.ConfigService },
    { type: external_tabby_core_.LogService }
];
TerminalService = __decorate([
    (0,core_.Injectable)({ providedIn: 'root' }),
    __metadata("design:paramtypes", [external_tabby_core_.ProfilesService,
        external_tabby_core_.ConfigService,
        external_tabby_core_.LogService])
], TerminalService);


;// CONCATENATED MODULE: ./src/buttonProvider.ts

/* eslint-disable @typescript-eslint/explicit-module-boundary-types */



/** @hidden */
let ButtonProvider = class ButtonProvider extends external_tabby_core_.ToolbarButtonProvider {
    constructor(terminal, translate) {
        super();
        this.terminal = terminal;
        this.translate = translate;
    }
    provide() {
        return [
            {
                icon: __webpack_require__(/*! ./icons/plus.svg */ 792),
                title: this.translate.instant('New terminal'),
                touchBarNSImage: 'NSTouchBarAddDetailTemplate',
                click: () => {
                    this.terminal.openTab();
                },
            },
        ];
    }
};
ButtonProvider.ctorParameters = () => [
    { type: TerminalService },
    { type: external_tabby_core_.TranslateService }
];
ButtonProvider = __decorate([
    (0,core_.Injectable)(),
    __metadata("design:paramtypes", [TerminalService,
        external_tabby_core_.TranslateService])
], ButtonProvider);


;// CONCATENATED MODULE: ./src/recoveryProvider.ts




/** @hidden */
let RecoveryProvider = class RecoveryProvider extends external_tabby_core_.TabRecoveryProvider {
    applicableTo(recoveryToken) {
        return __awaiter(this, void 0, void 0, function* () {
            return recoveryToken.type === 'app:local-tab';
        });
    }
    recover(recoveryToken) {
        return __awaiter(this, void 0, void 0, function* () {
            return {
                type: TerminalTabComponent,
                inputs: {
                    profile: recoveryToken.profile,
                    savedState: recoveryToken.savedState,
                },
            };
        });
    }
};
RecoveryProvider = __decorate([
    (0,core_.Injectable)()
], RecoveryProvider);


;// CONCATENATED MODULE: ./src/settings.ts





/** @hidden */
let ShellSettingsTabProvider = class ShellSettingsTabProvider extends external_tabby_settings_.SettingsTabProvider {
    constructor(hostApp) {
        super();
        this.hostApp = hostApp;
        this.id = 'terminal-shell';
        this.icon = 'list-ul';
        this.title = 'Shell';
    }
    getComponentType() {
        if (this.hostApp.platform === external_tabby_core_.Platform.Windows) {
            return ShellSettingsTabComponent;
        }
    }
};
ShellSettingsTabProvider.ctorParameters = () => [
    { type: external_tabby_core_.HostAppService }
];
ShellSettingsTabProvider = __decorate([
    (0,core_.Injectable)(),
    __metadata("design:paramtypes", [external_tabby_core_.HostAppService])
], ShellSettingsTabProvider);


;// CONCATENATED MODULE: ./src/config.ts

/** @hidden */
class TerminalConfigProvider extends external_tabby_core_.ConfigProvider {
    constructor() {
        super(...arguments);
        this.defaults = {
            terminal: {
                autoOpen: false,
                useConPTY: true,
                environment: {},
                setComSpec: false,
            },
        };
        this.platformDefaults = {
            [external_tabby_core_.Platform.macOS]: {
                terminal: {
                    profile: 'local:default',
                },
                hotkeys: {
                    'new-tab': [
                        '⌘-T',
                    ],
                },
            },
            [external_tabby_core_.Platform.Windows]: {
                terminal: {
                    profile: 'local:cmd-clink',
                },
                hotkeys: {
                    'new-tab': [
                        'Ctrl-Shift-T',
                    ],
                },
            },
            [external_tabby_core_.Platform.Linux]: {
                terminal: {
                    profile: 'local:default',
                },
                hotkeys: {
                    'new-tab': [
                        'Ctrl-Shift-T',
                    ],
                },
            },
        };
    }
}

;// CONCATENATED MODULE: ./src/hotkeys.ts



/** @hidden */
let LocalTerminalHotkeyProvider = class LocalTerminalHotkeyProvider extends external_tabby_core_.HotkeyProvider {
    constructor(translate) {
        super();
        this.translate = translate;
        this.hotkeys = [
            {
                id: 'new-tab',
                name: this.translate.instant('New tab'),
            },
        ];
    }
    provide() {
        return __awaiter(this, void 0, void 0, function* () {
            return this.hotkeys;
        });
    }
};
LocalTerminalHotkeyProvider.ctorParameters = () => [
    { type: external_tabby_core_.TranslateService }
];
LocalTerminalHotkeyProvider = __decorate([
    (0,core_.Injectable)(),
    __metadata("design:paramtypes", [external_tabby_core_.TranslateService])
], LocalTerminalHotkeyProvider);


;// CONCATENATED MODULE: ./src/tabContextMenu.ts







/** @hidden */
let SaveAsProfileContextMenu = class SaveAsProfileContextMenu extends external_tabby_core_.TabContextMenuItemProvider {
    constructor(config, ngbModal, notifications, translate) {
        super();
        this.config = config;
        this.ngbModal = ngbModal;
        this.notifications = notifications;
        this.translate = translate;
    }
    getItems(tab) {
        return __awaiter(this, void 0, void 0, function* () {
            if (!(tab instanceof TerminalTabComponent)) {
                return [];
            }
            const terminalTab = tab;
            const items = [
                {
                    label: this.translate.instant('Save as profile'),
                    click: () => __awaiter(this, void 0, void 0, function* () {
                        var _a, _b, _c;
                        const modal = this.ngbModal.open(external_tabby_core_.PromptModalComponent);
                        modal.componentInstance.prompt = this.translate.instant('New profile name');
                        const name = (_a = (yield modal.result)) === null || _a === void 0 ? void 0 : _a.value;
                        if (!name) {
                            return;
                        }
                        const profile = {
                            options: Object.assign(Object.assign({}, terminalTab.profile.options), { cwd: (_c = yield ((_b = terminalTab.session) === null || _b === void 0 ? void 0 : _b.getWorkingDirectory())) !== null && _c !== void 0 ? _c : terminalTab.profile.options.cwd }),
                            name,
                            type: 'local',
                        };
                        this.config.store.profiles = [
                            ...this.config.store.profiles,
                            profile,
                        ];
                        this.config.save();
                        this.notifications.info(this.translate.instant('Saved'));
                    }),
                },
            ];
            return items;
        });
    }
};
SaveAsProfileContextMenu.ctorParameters = () => [
    { type: external_tabby_core_.ConfigService },
    { type: ng_bootstrap_.NgbModal },
    { type: external_tabby_core_.NotificationsService },
    { type: external_tabby_core_.TranslateService }
];
SaveAsProfileContextMenu = __decorate([
    (0,core_.Injectable)(),
    __metadata("design:paramtypes", [external_tabby_core_.ConfigService,
        ng_bootstrap_.NgbModal,
        external_tabby_core_.NotificationsService,
        external_tabby_core_.TranslateService])
], SaveAsProfileContextMenu);

/** @hidden */
let NewTabContextMenu = class NewTabContextMenu extends external_tabby_core_.TabContextMenuItemProvider {
    constructor(config, profilesService, terminalService, uac, translate) {
        super();
        this.config = config;
        this.profilesService = profilesService;
        this.terminalService = terminalService;
        this.uac = uac;
        this.translate = translate;
        this.weight = 10;
    }
    getItems(tab, tabHeader) {
        var _a, _b;
        return __awaiter(this, void 0, void 0, function* () {
            const profiles = (yield this.profilesService.getProfiles()).filter(x => x.type === 'local');
            const items = [
                {
                    label: this.translate.instant('New terminal'),
                    click: () => {
                        if (tab instanceof TerminalTabComponent) {
                            this.profilesService.openNewTabForProfile(tab.profile);
                        }
                        else {
                            this.terminalService.openTab();
                        }
                    },
                },
                {
                    label: this.translate.instant('New with profile'),
                    submenu: profiles.map(profile => ({
                        label: profile.name,
                        click: () => __awaiter(this, void 0, void 0, function* () {
                            var _c, _d;
                            let workingDirectory = profile.options.cwd;
                            if (!workingDirectory && tab instanceof TerminalTabComponent) {
                                workingDirectory = (_d = yield ((_c = tab.session) === null || _c === void 0 ? void 0 : _c.getWorkingDirectory())) !== null && _d !== void 0 ? _d : undefined;
                            }
                            yield this.terminalService.openTab(profile, workingDirectory);
                        }),
                    })),
                },
            ];
            if ((_a = this.uac) === null || _a === void 0 ? void 0 : _a.isAvailable) {
                items.push({
                    label: this.translate.instant('New admin tab'),
                    submenu: profiles.map(profile => ({
                        label: profile.name,
                        click: () => {
                            this.profilesService.openNewTabForProfile(Object.assign(Object.assign({}, profile), { options: Object.assign(Object.assign({}, profile.options), { runAsAdministrator: true }) }));
                        },
                    })),
                });
            }
            if (tab instanceof TerminalTabComponent && tabHeader && ((_b = this.uac) === null || _b === void 0 ? void 0 : _b.isAvailable)) {
                const terminalTab = tab;
                items.push({
                    label: this.translate.instant('Duplicate as administrator'),
                    click: () => {
                        this.profilesService.openNewTabForProfile(Object.assign(Object.assign({}, terminalTab.profile), { options: Object.assign(Object.assign({}, terminalTab.profile.options), { runAsAdministrator: true }) }));
                    },
                });
            }
            return items;
        });
    }
};
NewTabContextMenu.ctorParameters = () => [
    { type: external_tabby_core_.ConfigService },
    { type: external_tabby_core_.ProfilesService },
    { type: TerminalService },
    { type: undefined, decorators: [{ type: core_.Optional }, { type: core_.Inject, args: [UACService,] }] },
    { type: external_tabby_core_.TranslateService }
];
NewTabContextMenu = __decorate([
    (0,core_.Injectable)(),
    __metadata("design:paramtypes", [external_tabby_core_.ConfigService,
        external_tabby_core_.ProfilesService,
        TerminalService, Object, external_tabby_core_.TranslateService])
], NewTabContextMenu);


// EXTERNAL MODULE: external "path"
var external_path_ = __webpack_require__(56);
;// CONCATENATED MODULE: ./src/cli.ts






let TerminalCLIHandler = class TerminalCLIHandler extends external_tabby_core_.CLIHandler {
    constructor(hostWindow, terminal) {
        super();
        this.hostWindow = hostWindow;
        this.terminal = terminal;
        this.firstMatchOnly = true;
        this.priority = 0;
    }
    handle(event) {
        return __awaiter(this, void 0, void 0, function* () {
            const op = event.argv._[0];
            if (op === 'open') {
                this.handleOpenDirectory(external_path_.resolve(event.cwd, event.argv.directory));
            }
            else if (op === 'run') {
                this.handleRunCommand(event.argv.command);
            }
            else {
                return false;
            }
            return true;
        });
    }
    handleOpenDirectory(directory) {
        return __awaiter(this, void 0, void 0, function* () {
            if (directory.length > 1 && (directory.endsWith('/') || directory.endsWith('\\'))) {
                directory = directory.substring(0, directory.length - 1);
            }
            if (yield fs.exists(directory)) {
                if ((yield fs.stat(directory)).isDirectory()) {
                    this.terminal.openTab(undefined, directory);
                    this.hostWindow.bringToFront();
                }
            }
        });
    }
    handleRunCommand(command) {
        this.terminal.openTab({
            type: 'local',
            name: '',
            options: {
                command: command[0],
                args: command.slice(1),
            },
        }, null, true);
        this.hostWindow.bringToFront();
    }
};
TerminalCLIHandler.ctorParameters = () => [
    { type: external_tabby_core_.HostWindowService },
    { type: TerminalService }
];
TerminalCLIHandler = __decorate([
    (0,core_.Injectable)(),
    __metadata("design:paramtypes", [external_tabby_core_.HostWindowService,
        TerminalService])
], TerminalCLIHandler);

let OpenPathCLIHandler = class OpenPathCLIHandler extends external_tabby_core_.CLIHandler {
    constructor(terminal, profiles, hostWindow, notifications) {
        super();
        this.terminal = terminal;
        this.profiles = profiles;
        this.hostWindow = hostWindow;
        this.notifications = notifications;
        this.firstMatchOnly = true;
        this.priority = -100;
    }
    handle(event) {
        var _a, _b, _c, _d, _e, _f;
        return __awaiter(this, void 0, void 0, function* () {
            const op = event.argv._[0];
            const opAsPath = op ? external_path_.resolve(event.cwd, op) : null;
            const profile = yield this.terminal.getDefaultProfile();
            if (opAsPath && (yield fs.lstat(opAsPath)).isDirectory()) {
                this.terminal.openTab(profile, opAsPath);
                this.hostWindow.bringToFront();
                return true;
            }
            if (opAsPath && (yield fs.exists(opAsPath))) {
                if (opAsPath.endsWith('.sh') || opAsPath.endsWith('.command')) {
                    profile.options.pauseAfterExit = true;
                    (_b = (_a = profile.options) === null || _a === void 0 ? void 0 : _a.args) === null || _b === void 0 ? void 0 : _b.push(opAsPath);
                    this.terminal.openTab(profile);
                    this.hostWindow.bringToFront();
                    return true;
                }
                else if (opAsPath.endsWith('.bat')) {
                    const psProfile = (yield this.profiles.getProfiles()).find(x => x.id === 'cmd');
                    if (psProfile) {
                        psProfile.options.pauseAfterExit = true;
                        (_d = (_c = psProfile.options) === null || _c === void 0 ? void 0 : _c.args) === null || _d === void 0 ? void 0 : _d.push(opAsPath);
                        this.terminal.openTab(psProfile);
                        this.hostWindow.bringToFront();
                        return true;
                    }
                }
                else if (opAsPath.endsWith('.ps1')) {
                    const cmdProfile = (yield this.profiles.getProfiles()).find(x => x.id === 'powershell');
                    if (cmdProfile) {
                        cmdProfile.options.pauseAfterExit = true;
                        (_f = (_e = cmdProfile.options) === null || _e === void 0 ? void 0 : _e.args) === null || _f === void 0 ? void 0 : _f.push(opAsPath);
                        this.terminal.openTab(cmdProfile);
                        this.hostWindow.bringToFront();
                        return true;
                    }
                }
                else {
                    this.notifications.error('Cannot handle scripts of this type');
                }
            }
            return false;
        });
    }
};
OpenPathCLIHandler.ctorParameters = () => [
    { type: TerminalService },
    { type: external_tabby_core_.ProfilesService },
    { type: external_tabby_core_.HostWindowService },
    { type: external_tabby_core_.NotificationsService }
];
OpenPathCLIHandler = __decorate([
    (0,core_.Injectable)(),
    __metadata("design:paramtypes", [TerminalService,
        external_tabby_core_.ProfilesService,
        external_tabby_core_.HostWindowService,
        external_tabby_core_.NotificationsService])
], OpenPathCLIHandler);

let AutoOpenTabCLIHandler = class AutoOpenTabCLIHandler extends external_tabby_core_.CLIHandler {
    constructor(app, config, terminal) {
        super();
        this.app = app;
        this.config = config;
        this.terminal = terminal;
        this.firstMatchOnly = true;
        this.priority = -1000;
    }
    handle(event) {
        return __awaiter(this, void 0, void 0, function* () {
            if (!event.secondInstance && this.config.store.terminal.autoOpen) {
                this.app.ready$.subscribe(() => {
                    this.terminal.openTab();
                });
                return true;
            }
            return false;
        });
    }
};
AutoOpenTabCLIHandler.ctorParameters = () => [
    { type: external_tabby_core_.AppService },
    { type: external_tabby_core_.ConfigService },
    { type: TerminalService }
];
AutoOpenTabCLIHandler = __decorate([
    (0,core_.Injectable)(),
    __metadata("design:paramtypes", [external_tabby_core_.AppService,
        external_tabby_core_.ConfigService,
        TerminalService])
], AutoOpenTabCLIHandler);


// EXTERNAL MODULE: ../node_modules/clone-deep/index.js
var clone_deep = __webpack_require__(842);
var clone_deep_default = /*#__PURE__*/__webpack_require__.n(clone_deep);
;// CONCATENATED MODULE: ./src/profiles.ts








let LocalProfilesService = class LocalProfilesService extends external_tabby_core_.ProfileProvider {
    constructor(app, config, shellProviders) {
        super();
        this.app = app;
        this.config = config;
        this.shellProviders = shellProviders;
        this.id = 'local';
        this.name = marker('Local terminal');
        this.settingsComponent = LocalProfileSettingsComponent;
        this.configDefaults = {
            options: {
                restoreFromPTYID: null,
                command: '',
                args: [],
                cwd: null,
                env: {
                    __nonStructural: true,
                },
                width: null,
                height: null,
                pauseAfterExit: false,
                runAsAdministrator: false,
            },
        };
    }
    getBuiltinProfiles() {
        return __awaiter(this, void 0, void 0, function* () {
            return (yield this.getShells()).map(shell => ({
                id: `local:${shell.id}`,
                type: 'local',
                name: shell.name,
                icon: shell.icon,
                options: this.optionsFromShell(shell),
                isBuiltin: true,
            }));
        });
    }
    getNewTabParameters(profile) {
        var _a, _b;
        return __awaiter(this, void 0, void 0, function* () {
            profile = clone_deep_default()(profile);
            if (!profile.options.cwd) {
                if (this.app.activeTab instanceof TerminalTabComponent && this.app.activeTab.session) {
                    profile.options.cwd = (_a = yield this.app.activeTab.session.getWorkingDirectory()) !== null && _a !== void 0 ? _a : undefined;
                }
                if (this.app.activeTab instanceof external_tabby_core_.SplitTabComponent) {
                    const focusedTab = this.app.activeTab.getFocusedTab();
                    if (focusedTab instanceof TerminalTabComponent && focusedTab.session) {
                        profile.options.cwd = (_b = yield focusedTab.session.getWorkingDirectory()) !== null && _b !== void 0 ? _b : undefined;
                    }
                }
            }
            return {
                type: TerminalTabComponent,
                inputs: {
                    profile,
                },
            };
        });
    }
    getShells() {
        return __awaiter(this, void 0, void 0, function* () {
            const shellLists = yield Promise.all(this.config.enabledServices(this.shellProviders).map(x => x.provide()));
            return shellLists.reduce((a, b) => a.concat(b), []);
        });
    }
    optionsFromShell(shell) {
        var _a;
        return {
            command: shell.command,
            args: (_a = shell.args) !== null && _a !== void 0 ? _a : [],
            env: shell.env,
            cwd: shell.cwd,
        };
    }
    getSuggestedName(profile) {
        return this.getDescription(profile);
    }
    getDescription(profile) {
        var _a, _b;
        return (_b = (_a = profile.options) === null || _a === void 0 ? void 0 : _a.command) !== null && _b !== void 0 ? _b : '';
    }
};
LocalProfilesService.ctorParameters = () => [
    { type: external_tabby_core_.AppService },
    { type: external_tabby_core_.ConfigService },
    { type: Array, decorators: [{ type: core_.Inject, args: [ShellProvider,] }] }
];
LocalProfilesService = __decorate([
    (0,core_.Injectable)({ providedIn: 'root' }),
    __metadata("design:paramtypes", [external_tabby_core_.AppService,
        external_tabby_core_.ConfigService, Array])
], LocalProfilesService);


;// CONCATENATED MODULE: ./src/index.ts























/** @hidden */
let LocalTerminalModule = class LocalTerminalModule {
    constructor(hotkeys, terminal, hostApp) {
        hotkeys.hotkey$.subscribe((hotkey) => __awaiter(this, void 0, void 0, function* () {
            if (hotkey === 'new-tab') {
                terminal.openTab();
            }
            if (hotkey === 'new-window') {
                hostApp.newWindow();
            }
        }));
    }
};
LocalTerminalModule.ctorParameters = () => [
    { type: external_tabby_core_.HotkeysService },
    { type: TerminalService },
    { type: external_tabby_core_.HostAppService }
];
LocalTerminalModule = __decorate([
    (0,core_.NgModule)({
        imports: [
            common_.CommonModule,
            forms_.FormsModule,
            ng_bootstrap_.NgbModule,
            external_ngx_toastr_.ToastrModule,
            (external_tabby_core_default()),
            (external_tabby_terminal_default()),
        ],
        providers: [
            { provide: external_tabby_settings_.SettingsTabProvider, useClass: ShellSettingsTabProvider, multi: true },
            { provide: external_tabby_core_.ToolbarButtonProvider, useClass: ButtonProvider, multi: true },
            { provide: external_tabby_core_.TabRecoveryProvider, useClass: RecoveryProvider, multi: true },
            { provide: external_tabby_core_.ConfigProvider, useClass: TerminalConfigProvider, multi: true },
            { provide: external_tabby_core_.HotkeyProvider, useClass: LocalTerminalHotkeyProvider, multi: true },
            { provide: external_tabby_core_.ProfileProvider, useClass: LocalProfilesService, multi: true },
            { provide: external_tabby_core_.TabContextMenuItemProvider, useClass: NewTabContextMenu, multi: true },
            { provide: external_tabby_core_.TabContextMenuItemProvider, useClass: SaveAsProfileContextMenu, multi: true },
            { provide: external_tabby_core_.CLIHandler, useClass: TerminalCLIHandler, multi: true },
            { provide: external_tabby_core_.CLIHandler, useClass: OpenPathCLIHandler, multi: true },
            { provide: external_tabby_core_.CLIHandler, useClass: AutoOpenTabCLIHandler, multi: true },
        ],
        declarations: [
            TerminalTabComponent,
            ShellSettingsTabComponent,
            EnvironmentEditorComponent,
            CommandLineEditorComponent,
            LocalProfileSettingsComponent,
        ],
        exports: [
            TerminalTabComponent,
            EnvironmentEditorComponent,
            CommandLineEditorComponent,
        ],
    }),
    __metadata("design:paramtypes", [external_tabby_core_.HotkeysService,
        TerminalService,
        external_tabby_core_.HostAppService])
], LocalTerminalModule);
/* harmony default export */ const src = (LocalTerminalModule);




})();

/******/ 	return __webpack_exports__;
/******/ })()
;
});
//# sourceMappingURL=../../../app.asar.unpacked/assets/webpack/index.js.map