!function(t){function e(e){for(var r,u,l=e[0],c=e[1],a=e[2],d=0,s=[];d<l.length;d++)u=l[d],Object.prototype.hasOwnProperty.call(o,u)&&o[u]&&s.push(o[u][0]),o[u]=0;for(r in c)Object.prototype.hasOwnProperty.call(c,r)&&(t[r]=c[r]);for(f&&f(e);s.length;)s.shift()();return i.push.apply(i,a||[]),n()}function n(){for(var t,e=0;e<i.length;e++){for(var n=i[e],r=!0,l=1;l<n.length;l++){var c=n[l];0!==o[c]&&(r=!1)}r&&(i.splice(e--,1),t=u(u.s=n[0]))}return t}var r={},o={5:0},i=[];function u(e){if(r[e])return r[e].exports;var n=r[e]={i:e,l:!1,exports:{}};return t[e].call(n.exports,n,n.exports,u),n.l=!0,n.exports}u.m=t,u.c=r,u.d=function(t,e,n){u.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},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 n=Object.create(null);if(u.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)u.d(n,r,function(e){return t[e]}.bind(null,r));return n},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 l=window.webpackJsonp=window.webpackJsonp||[],c=l.push.bind(l);l.push=e,l=l.slice();for(var a=0;a<l.length;a++)e(l[a]);var f=c;i.push([85,0]),n()}({85:function(t,e,n){"use strict";function r(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var u,l=t[Symbol.iterator]();!(r=(u=l.next()).done)&&(n.push(u.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{r||null==l.return||l.return()}finally{if(o)throw i}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function o(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function i(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function u(t,e,n,r,o,i,u){try{var l=t[i](u),c=l.value}catch(t){return void n(t)}l.done?e(c):Promise.resolve(c).then(r,o)}function l(t){return function(){var e=this,n=arguments;return new Promise(function(r,o){var i=t.apply(e,n);function l(t){u(i,r,o,l,c,"next",t)}function c(t){u(i,r,o,l,c,"throw",t)}l(void 0)})}}CloudCmd.EditFile=e;var c,a,f=n(86),d=n(8),s=n(2),p=n(23),y=DOM.CurrentInfo,v=DOM,C=v.Dialog,h=v.Images,b=CloudCmd.config,m=d(),g={beforeClose:function(){s.ifExist(c,"hide"),E()}};function O(){CloudCmd.Edit.hide()}function w(t){var e={x:t.clientX,y:t.clientY};if(t.preventDefault(),!c){var n,r={beforeShow:function(t){t.x-=18,t.y-=27},afterClick:function(){CloudCmd.Edit.getEditor().focus()}},o=CloudCmd.Edit.getElement();(c=p(o,r,(n=CloudCmd.Edit.getEditor(),{"Save           Ctrl+S":function(){n.save()},"Go To Line     Ctrl+G":function(){n.goToLine()},"Cut            Ctrl+X":function(){n.cutToClipboard()},"Copy           Ctrl+C":function(){n.copyToClipboard()},"Paste          Ctrl+V":function(){n.pasteFromClipboard()},"Delete         Del":function(){n.remove("right")},"Select All     Ctrl+A":function(){n.selectAll()},"Close          Esc":function(){O()}}))).show(e.x,e.y)}}function E(){return j.apply(this,arguments)}function j(){return(j=l(function*(){var t=CloudCmd.Edit.getEditor();t.isChanged()&&(r(yield C.confirm(a),1)[0]||t.save())})).apply(this,arguments)}t.exports.init=l(function*(){m(!0),yield CloudCmd.Edit();var t,e=CloudCmd.Edit.getEditor();(t=e).emit("auth",b("username"),b("password")),t.on("reject",function(){C.alert("Wrong credentials!")}),function(t){var e=CloudCmd.Edit.getElement();DOM.Events.addOnce("contextmenu",e,w),t.on("save",function(t){DOM.setCurrentSize(f.size(t))})}(e),m(!1)}),t.exports.show=function(t){if(!m()){var e=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?o(n,!0).forEach(function(e){i(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):o(n).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({},g,{},t);return CloudCmd.config("showFileName")&&(e.title=y.name),h.show.load(),CloudCmd.Edit.getEditor().setOption("keyMap","default"),y.getData(function(t,n){var r=y.path,o=function(){var t=y.name;return y.isDir?"".concat(t,".json"):t}();if(t)return h.hide();!function(t){a="Do you want to save changes to "+t+"?"}(o),CloudCmd.Edit.getEditor().setValueFirst(r,n).setModeForPath(o).enableKey(),CloudCmd.Edit.show(e)}),CloudCmd.Edit}},t.exports.hide=O,t.exports.isChanged=E}});
//# sourceMappingURL=edit-file.js.map