!function(t){function e(e){for(var n,u,a=e[0],l=e[1],c=e[2],d=0,s=[];d<a.length;d++)u=a[d],Object.prototype.hasOwnProperty.call(o,u)&&o[u]&&s.push(o[u][0]),o[u]=0;for(n in l)Object.prototype.hasOwnProperty.call(l,n)&&(t[n]=l[n]);for(f&&f(e);s.length;)s.shift()();return i.push.apply(i,c||[]),r()}function r(){for(var t,e=0;e<i.length;e++){for(var r=i[e],n=!0,a=1;a<r.length;a++){var l=r[a];0!==o[l]&&(n=!1)}n&&(i.splice(e--,1),t=u(u.s=r[0]))}return t}var n={},o={15:0},i=[];function u(e){if(n[e])return n[e].exports;var r=n[e]={i:e,l:!1,exports:{}};return t[e].call(r.exports,r,r.exports,u),r.l=!0,r.exports}u.m=t,u.c=n,u.d=function(t,e,r){u.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},u.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},u.t=function(t,e){if(1&e&&(t=u(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(u.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)u.d(r,n,function(e){return t[e]}.bind(null,n));return r},u.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return u.d(e,"a",e),e},u.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},u.p="/dist/";var a=window.webpackJsonp=window.webpackJsonp||[],l=a.push.bind(a);a.push=e,a=a.slice();for(var c=0;c<a.length;c++)e(a[c]);var f=l;i.push([114,0]),r()}({114:function(t,e,r){"use strict";function n(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=[],n=!0,o=!1,i=void 0;try{for(var u,a=t[Symbol.iterator]();!(n=(u=a.next()).done)&&(r.push(u.value),!e||r.length!==e);n=!0);}catch(t){o=!0,i=t}finally{try{n||null==a.return||a.return()}finally{if(o)throw i}}return r}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function o(t,e,r,n,o,i,u){try{var a=t[i](u),l=a.value}catch(t){return void r(t)}a.done?e(l):Promise.resolve(l).then(n,o)}function i(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var u=t.apply(e,r);function a(t){o(u,n,i,a,l,"next",t)}function l(t){o(u,n,i,a,l,"throw",t)}a(void 0)})}}var u=r(4).promisify,a=r(6);r(176);var l,c,f,d=r(2),s=r(5),p=r(11),y=r(1),h=u(s.parallel),v=p.Dialog,m=CloudCmd,C=m.Key,w=m.config;CloudCmd.Terminal=e;var g=function(){var t=i(function*(){var t=CloudCmd.prefix,e=CloudCmd.prefix+"/gritty",r="".concat(e,"/gritty.js"),o="".concat(t,"/dist/terminal.css"),i=n(yield a(h,[r,o]),1)[0];if(i){var u=i.target.src.replace(window.location.href,"");return v.alert("file ".concat(u," could not be loaded"))}l=!0});return function(){return t.apply(this,arguments)}}();function b(){CloudCmd.View.hide()}function x(t){t.emit("auth",w("username"),w("password")),t.on("reject",function(){v.alert("Wrong credentials!")})}t.exports.init=i(function*(){var t,e,r,n;w("terminal")&&(y.show.load("top"),yield CloudCmd.View(),yield g(),yield(t={env:{ACTIVE_DIR:p.getCurrentDirPath,PASSIVE_DIR:p.getNotCurrentDirPath,CURRENT_NAME:p.getCurrentName,CURRENT_PATH:p.getCurrentPath},prefix:CloudCmd.prefixSocket+"/gritty",socketPath:CloudCmd.prefix,fontFamily:"Droid Sans Mono"},e=gritty(document.body,t),r=e.socket,n=e.terminal,f=r,(c=n).on("key",function(t,e){var r=e.keyCode;e.shiftKey&&r===C.ESC&&b()}),void f.on("connect",d.with(x,r))))}),t.exports.show=function(){if(!l)return;if(!w("terminal"))return;CloudCmd.View.show(c.element,{afterShow:function(){c.focus()}})},t.exports.hide=b}});
//# sourceMappingURL=terminal.js.map