!function(n){function t(t){for(var r,u,a=t[0],c=t[1],l=t[2],s=0,d=[];s<a.length;s++)u=a[s],Object.prototype.hasOwnProperty.call(o,u)&&o[u]&&d.push(o[u][0]),o[u]=0;for(r in c)Object.prototype.hasOwnProperty.call(c,r)&&(n[r]=c[r]);for(f&&f(t);d.length;)d.shift()();return i.push.apply(i,l||[]),e()}function e(){for(var n,t=0;t<i.length;t++){for(var e=i[t],r=!0,a=1;a<e.length;a++){var c=e[a];0!==o[c]&&(r=!1)}r&&(i.splice(t--,1),n=u(u.s=e[0]))}return n}var r={},o={10:0},i=[];function u(t){if(r[t])return r[t].exports;var e=r[t]={i:t,l:!1,exports:{}};return n[t].call(e.exports,e,e.exports,u),e.l=!0,e.exports}u.m=n,u.c=r,u.d=function(n,t,e){u.o(n,t)||Object.defineProperty(n,t,{enumerable:!0,get:e})},u.r=function(n){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},u.t=function(n,t){if(1&t&&(n=u(n)),8&t)return n;if(4&t&&"object"==typeof n&&n&&n.__esModule)return n;var e=Object.create(null);if(u.r(e),Object.defineProperty(e,"default",{enumerable:!0,value:n}),2&t&&"string"!=typeof n)for(var r in n)u.d(e,r,function(t){return n[t]}.bind(null,r));return e},u.n=function(n){var t=n&&n.__esModule?function(){return n.default}:function(){return n};return u.d(t,"a",t),t},u.o=function(n,t){return Object.prototype.hasOwnProperty.call(n,t)},u.p="/dist/";var a=window.webpackJsonp=window.webpackJsonp||[],c=a.push.bind(a);a.push=t,a=a.slice();for(var l=0;l<a.length;l++)t(a[l]);var f=c;i.push([113,0]),e()}({113:function(n,t,e){"use strict";function r(n,t){return function(n){if(Array.isArray(n))return n}(n)||function(n,t){var e=[],r=!0,o=!1,i=void 0;try{for(var u,a=n[Symbol.iterator]();!(r=(u=a.next()).done)&&(e.push(u.value),!t||e.length!==t);r=!0);}catch(n){o=!0,i=n}finally{try{r||null==a.return||a.return()}finally{if(o)throw i}}return e}(n,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function o(n,t,e,r,o,i,u){try{var a=n[i](u),c=a.value}catch(n){return void e(n)}a.done?t(c):Promise.resolve(c).then(r,o)}function i(n){return function(){var t=this,e=arguments;return new Promise(function(r,i){var u=n.apply(t,e);function a(n){o(u,r,i,a,c,"next",n)}function c(n){o(u,r,i,a,c,"throw",n)}a(void 0)})}}CloudCmd.Konsole=t;var u,a,c,l=e(2),f=e(4).promisify,s=e(0),d=e(6),p=f(e(5).js),h=e(3),v=e(1),y=DOM,C=y.Dialog,m=y.CurrentInfo,w=CloudCmd.config,b=s(function(n,t){return n("cd ".concat(t.replace(/\/$/,"")||"/"))});function P(){return CloudCmd.prefix+"/console"}function g(n){m.dirPath!==n&&CloudCmd.loadDir({path:n})}n.exports.init=i(function*(){w("console")&&(v.show.load("top"),yield CloudCmd.View(),yield M(),yield x())}),n.exports.hide=function(){CloudCmd.View.hide()},n.exports.clear=function(){u.clear()};var O=function(){if(w("syncConsolePath"))return m.dirPath},x=function(){var n=i(function*(){var n={cwd:O(),env:{ACTIVE_DIR:DOM.getCurrentDirPath.bind(DOM),PASSIVE_DIR:DOM.getNotCurrentDirPath.bind(DOM),CURRENT_NAME:DOM.getCurrentName.bind(DOM),CURRENT_PATH:function(){return m.path}},prefix:P(),prefixSocket:CloudCmd.prefixSocket+"/console",socketPath:CloudCmd.prefix};a=h("div",{className:"console"}),(u=yield Console(a,n)).on("connect",l.with(D,u)),u.on("path",w.if("syncConsolePath",g)),CloudCmd.on("active-dir",w.if("syncConsolePath",b(u.handler))),u.addShortCuts({P:function(){var n=u.getPromptText(),t=DOM.getCurrentDirPath();u.setPromptText(n+t)}})});return function(){return n.apply(this,arguments)}}();function D(n){n.emit("auth",w("username"),w("password")),n.on("reject",function(){C.alert("Wrong credentials!")})}n.exports.show=function(n){c&&w("console")&&CloudCmd.View.show(a,{afterShow:function(){u.focus(),l(n)}})};var M=function(){var n=i(function*(){Util.time("Konsole load");var n=P()+"/console.js",t=r(yield d(p,n),1)[0];if(c=!0,Util.timeEnd("Konsole load"),t)return C.alert(t.message,{cancel:!1})});return function(){return n.apply(this,arguments)}}()}});
//# sourceMappingURL=konsole.js.map