zcloudcmd
Version:
### [Main][MainURL] [Blog][BlogURL] Live([Heroku][HerokuURL], [Now][NowURL])
8 lines • 100 kB
JavaScript
(window.webpackJsonp=window.webpackJsonp||[]).push([[0],[function(t,e,r){!function(e){"use strict";function r(){var t=Array.prototype.slice,e=function(e){var r,n="function"==typeof e,o=t.call(arguments,1);return n&&(r=e.apply(null,o)),r};return e.with=function(t){var e=Array.prototype.slice,r=e.call(arguments,1);return function(){var n=e.call(arguments),o=r.concat(n);return t.apply(null,o)}},e.ret=function(){var r=t.call(arguments);return r.unshift(e),e.with.apply(null,r)},e.if=function(t,r,n){t?e(r):e(n,r)},e.ifExist=function(t,e,r){var n=t&&t[e];n&&(n=n.apply(t,r))},e.parallel=function(r,n){var o,i,a="could not be empty!",u=[],s=!1,c=[],f=0,l=0,h=(o=r,i=new RegExp("\\s([a-zA-Z]+)"),{}.toString.call(o).match(i)[1].toLowerCase());if(!r)throw Error("funcs "+a);if(!n)throw Error("callback "+a);switch(h){case"array":l=r.length,r.forEach(function(t,r){e(t,function(){p(r,arguments)})});break;case"object":u=Object.keys(r),l=u.length,u.forEach(function(t){var n=r[t];e(n,function(){p(t,arguments)})})}function p(e,r){var o,i=t.call(r,1),a=r[0],u=i.length;o=++f===l,a||(c[e]=u>=2?i:i[0]),s||!a&&!o||(s=!0,"array"===h?n.apply(null,[a].concat(c)):n(a,c))}},e.series=function(t,r){var n,o=t.length;if(!Array.isArray(t))throw Error("funcs should be array!");n=t.shift(),e(n,function(n){(function(t){var n;return--o&&!t||(n=!0,e(r,t)),n})(n)||e.series(t,r)})},e.each=function(t,r,n){var o=t.map(function(t){return r.bind(null,t)});o.length?e.parallel(o,n):n()},e.eachSeries=function(t,r,n){var o=t.map(function(t){return r.bind(null,t)});if("function"!=typeof n)throw Error("callback should be function");o.length?e.series(o,n):n()},e.try=function(t){var e;try{e=t()}catch(t){e=t}return e},e}t.exports?t.exports=new r:e.exec=new r}(this)},function(t,e,r){t.exports=r(40)},function(t,e,r){"use strict";function n(t,e){if(null==t)return{};var r,n,o=function(t,e){if(null==t)return{};var r,n,o={},i=Object.keys(t);for(n=0;n<i.length;n++)r=i[n],e.indexOf(r)>=0||(o[r]=t[r]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n<i.length;n++)r=i[n],e.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}var o=r(1),i=function(t){return document.querySelector('[data-name="'.concat(t,'"]'))},a=o(function(t,e,r){return t.setAttribute(r,e[r])}),u=o(function(t,e,r){return t[r]=e[r]}),s=o(function(t,e){return!t(e)}),c=function(t){return t!=t.toLowerCase()};function f(t){if(t)return i(t)}t.exports=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.dataName,o=e.notAppend,i=e.parent,l=void 0===i?document.body:i,h=e.uniq,p=void 0===h||h,d=n(e,["dataName","notAppend","parent","uniq"]),g=f(r);if(p&&g)return g;var v=document.createElement(t);return r&&(v.dataset.name=r),Object.keys(d).filter(c).map(u(v,e)),Object.keys(d).filter(s(c)).map(a(v,e)),o||l.appendChild(v),v},t.exports.isElementPresent=f},function(t,e,r){"use strict";var n=r(2),o=t.exports;function i(){return function(){var t=document.createElementNS;if(!t)return!1;var e=t.bind(document)("http://www.w3.org/2000/svg","animate").toString();return/SVGAnimate/.test(e)}()?"-svg":"-gif"}function a(){return n("span",{id:"js-status-image",className:"icon",dataName:"progress",notAppend:!0})}function u(t,e){var r,n=o.loading(),i=n.parentElement,a=DOM.getRefreshButton(e);return r="top"===t?a.parentElement:(r=DOM.getCurrentFile())?DOM.getByDataName("js-name",r):a.parentElement,(!i||i&&i!==r)&&r.appendChild(n),DOM.show(n),n}t.exports.get=a,t.exports.loading=function(){var t=a(),e=t.classList,r="loading"+i();return e.add("loading",r),e.remove("error","hidden"),t},t.exports.error=function(){var t=a(),e=t.classList,r="loading"+i();return e.add("error"),e.remove("hidden","loading",r),t},t.exports.show=u,t.exports.show.load=u,t.exports.show.error=function(t){var e=o.error();return DOM.show(e),e.title=t,e},t.exports.hide=function(){var t=o.get();return DOM.hide(t),o},t.exports.setProgress=function(t,e){var r=o.get();return r?(r.setAttribute("data-progress",t+"%"),e&&(r.title=e),o):o},t.exports.clearProgress=function(){var t=o.get();return t?(t.setAttribute("data-progress",""),t.title="",o):o}},function(t,e,r){"use strict";var n=r(2),o=function(){};a.addLoadListener=function(t){a.onload=t},a.addErrorListener=function(t){a.onerror=t};var i=function(t,e,r){t.addEventListener(e,function(n){r(n),t.removeEventListener(e,r)})};function a(t,e){switch(function(t){var e,r="";"string"==typeof t&&~(e=t.lastIndexOf("."))&&(r=t.substr(e));return r}(t)){case".js":return a.js(t,e);case".css":return a.css(t,e);case".json":return a.json(t,e);default:return a.ajax(t,e)}}function u(t){var e,r;return"string"==typeof t?(~t.indexOf(":")&&(t+="-join"),e=t.lastIndexOf("/")+1,r=t.substr(t,e),t.replace(r,"").replace(/\./g,"-")):""}a.onerror=o,a.onload=o,t.exports=a,a.js=function(t,e){var r=u(t),o=document.getElementById(r);if(o)return e();o=n("script",{id:r,src:t}),i(o,"load",function(t){e(null,t),a.onload()}),i(o,"error",function(r){e(r),document.body.removeChild(o),a.onerror(r,t)})},a.css=function(t,e){var r=u(t),o=document.getElementById(r);if(o)return e();(o=n("link",{id:u(t),rel:"stylesheet",href:t,parent:document.head})).addEventListener("load",function(t){e(null,t),a.onload()}),o.addEventListener("error",function(r){e(r),document.head.removeChild(o),a.onerror(r,t)})},a.ajax=function(t,e){var r=new XMLHttpRequest;r.open("GET",t,!0),r.addEventListener("load",function(){if(r.status>=200&&r.status<400){var t=r.responseText;e(null,t),a.onload()}}),r.addEventListener("error",function(t){a.onerror(t),e(t)}),r.send()},a.json=function(t,e){a.ajax(t,function(t,r){var n;t||(n=JSON.parse(r)),e(t,n)})},a.series=function(t,e){var r=t.shift();if(!r)return e();a(r,function(r){if(r)return e(r);a.series(t,e)})},a.parallel=function(t,e){var r,n=t.length,o=function(t){(!--n&&!r||t)&&(r=!0,e(t))};t.forEach(function(t){a(t,o)})},a.getIdBySrc=u},function(t,e,r){"use strict";function n(t){return function(t){if(Array.isArray(t)){for(var e=0,r=new Array(t.length);e<t.length;e++)r[e]=t[e];return r}}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}var o=r(11),i=r(1),a=r(10),u=r(17).encode,s=r(27),c=i(function(t,e,r){var n="asc"===e?"↑":"↓";return t!==r?r:"name"===t&&"asc"===e?r:"".concat(r).concat(n)}),f="/fs",l=a();function h(t,e,r){if(!t)throw Error("url could not be empty!");if(!r)throw Error("template could not be empty!");var i=t.split("/").slice(1,-1),a=["/"].concat(n(i)),u=a.length-1,s="/";return a.map(function(t,n){return n&&(s+=t+"/"),n&&n===u?t+"/":o(r,{path:s,name:t,slash:n?"/":"",prefix:e})}).join("")}l("/"),t.exports.FS=f,t.exports.apiURL="/api/v1",t.exports.MAX_FILE_SIZE=512e3,t.exports.getHeaderField=c,t.exports.getPathLink=h,t.exports.getDotDot=g,t.exports.formatMsg=function(t,e,r){return(e=e||"")&&(e='("'+e+'")'),t+": "+(r=r||"ok")+e},t.exports.getTitle=function(t){var e=(t=t||{}).path||l();return[t.name||"Cloud Commander",e].filter(Boolean).join(" - ")};function p(t){return"directory"===t?"":'target="_blank" '}function d(t){var e=t.size,r=t.type;return"directory"===r?"<dir>":/link/.test(r)?"<link>":e}function g(t){var e=t.substr(t,t.lastIndexOf("/")),r=e.substr(e,e.lastIndexOf("/"));return r||"/"}t.exports.buildFromJSON=function(t){var e=t.prefix,r=t.template,n=r.file,i=r.link,a=t.data,v=u(a.path),m=a.files,y=t.sort||"name",w=t.order||"asc",b=h(v,e,r.pathLink),E=o(r.path,{link:e+f+v,fullPath:v,path:b}),x=c(y,w),C=x("name"),A=x("size"),_=x("date"),S=o(n,{tag:"div",attribute:'data-name="js-fm-header" ',className:"fm-header",type:"",name:C,size:A,date:_,owner:"owner",mode:"mode"});if(l(v),E+=S+'<ul data-name="js-files" class="files">',"/"!==v){var P=g(v),T=e+f+P,O=o(r.link,{link:T,title:"..",name:".."});E+=o(r.file,{tag:"li",attribute:'draggable="true" data-name="js-file-.." ',className:"",type:"directory",name:O,size:"<dir>",date:"--.--.----",owner:".",mode:"--- --- ---"})}return E+=m.map(function(t){var r=u(t.name),a=e+f+v+r,c=t.type,l=t.mode,h=d(t),g=t.date||"--.--.----",m=t.owner||"root",y=o(i,{link:a,title:r,name:r,attribute:p(t.type)}),w=function(t){var e=s(encodeURI(t));return'data-name="js-file-'.concat(e,'" ')}(t.name),b='draggable="true" '.concat(w);return o(n,{tag:"li",attribute:b,className:"",type:c,name:y,size:h,date:g,owner:m,mode:l})}).join(""),E+="</ul>"},t.exports._getSize=d},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n="__ES6-PROMISIFY--CUSTOM-ARGUMENTS__";function o(t){if("function"!=typeof t)throw new TypeError("Argument to promisify must be a function");var e=t[n],r=o.Promise||Promise;if("function"!=typeof r)throw new Error("No Promise implementation found; do you need a polyfill?");return function(){for(var n=this,o=arguments.length,i=Array(o),a=0;a<o;a++)i[a]=arguments[a];return new r(function(r,o){i.push(function(t){if(t)return o(t);for(var n=arguments.length,i=Array(n>1?n-1:0),a=1;a<n;a++)i[a-1]=arguments[a];if(1===i.length||!e)return r(i[0]);var u={};i.forEach(function(t,r){var n=e[r];n&&(u[n]=t)}),r(u)}),t.call.apply(t,[n].concat(i))})}}o.argumentNames=n,o.Promise=void 0,e.promisify=o},function(t,e,r){t.exports=r(39)},function(t,e,r){t.exports=r(50)},function(t,e,r){"use strict";var n=r(0);t.exports.escapeRegExp=function(t){return"string"==typeof t&&(t=t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")),t},t.exports.getRegExp=function(t){var e="^"+(t=t||"*").replace(".","\\.").replace("*",".*").replace("?",".?")+"$";return RegExp(e)},t.exports.exec=n,t.exports.getExt=function(t){if(!("string"==typeof t))return"";var e=t.lastIndexOf(".");return~e?t.substr(e):""},t.exports.findObjByNameInArr=function(t,e){var r;if(!Array.isArray(t))throw Error("array should be array!");if("string"!=typeof e)throw Error("name should be string!");return t.some(function(t){var n=t.name===e,o=Array.isArray(t);return n?(r=t,n):o?t.some(function(t){var n=t.name===e;return n&&(r=t.data),n}):n}),r},t.exports.time=function(t){n.ifExist(console,"time",[t])},t.exports.timeEnd=function(t){n.ifExist(console,"timeEnd",[t])}},function(t,e,r){t.exports=r(45)},function(t,e,r){t.exports=r(44)},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 a,u=t[Symbol.iterator]();!(n=(a=u.next()).done)&&(r.push(a.value),!e||r.length!==e);n=!0);}catch(t){o=!0,i=t}finally{try{n||null==u.return||u.return()}finally{if(o)throw i}}return r}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function o(t){return function(t){if(Array.isArray(t)){for(var e=0,r=new Array(t.length);e<t.length;e++)r[e]=t[e];return r}}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function i(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var a=r(8),u=r(0),s=r(18),c=r(9),f=r(3),l=r(13),h=r(14),p=r(19),d=r(29),g=r(21),v=r(52),m=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable}))),n.forEach(function(e){i(t,e,r[e])})}return t}({},r(53),v,new function(){var t={},e=this,r="Cloud Commander",i={"js-left":null,"js-right":null};function l(t,e){var n=m.Dialog,o=m.getCurrentDirPath(),i="New "+t||!1,a=function(){var t=m.getCurrentName();return".."===t?"":t}();n.prompt(r,i,a,{cancel:!1}).then(function(t){if(t){p.write(function(e){var r=o+t;return e?r+e:r}(e),function(e){if(!e){var r=t;CloudCmd.refresh({currentName:r})}})}})}this.loadRemote=function(t,e,r){return y(t,e,r),m},this.loadSocket=function(t){return m.loadRemote("socket",{name:"io"},t),m},this.promptNewDir=function(){l("directory","?dir")},this.promptNewFile=function(){l("file")},this.getCurrentDirName=function(){var t=m.getCurrentDirPath().replace(/\/$/,""),e=t.substr(t,t.lastIndexOf("/")),r=t.replace(e+"/","")||"/";return r},this.getParentDirPath=function(t){var e=m.getCurrentDirPath(t),r=m.getCurrentDirName()+"/",n=e.lastIndexOf(r);return"/"!==e?e.slice(0,n):e},this.getNotCurrentDirPath=function(){var t=m.getPanel({active:!1}),e=m.getCurrentDirPath(t);return e},this.getCurrentByName=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.panel,n="js-file-"+btoa(encodeURI(e)),o=m.getByDataName(n,r);return o},this.getSelectedFiles=function(){var t=m.getPanel(),e=m.getByClassAll("selected-file",t);return o(e)},this.unselectFiles=function(t){o(t=t||m.getSelectedFiles()).forEach(m.toggleSelectedFile)},this.getActiveFiles=function(){var t=m.getCurrentFile(),e=m.getSelectedFiles(),r=m.getCurrentName(t);return e.length||".."===r?e:[t]},this.getCurrentDate=function(t){var e=t||m.getCurrentFile(),r=m.getByDataName("js-date",e).textContent;return r},this.getCurrentSize=function(t){var e=t||m.getCurrentFile(),r=m.getByDataName("js-size",e).textContent.replace(/^<|>$/g,"");return r},this.loadCurrentSize=function(t,e){var r=e||m.getCurrentFile(),n=m.getCurrentPath(r);f.show.load(),".."!==name&&p.read(n+"?size",function(e,n){e||(m.setCurrentSize(n,r),u(t,r),f.hide())})},this.loadCurrentHash=function(t,e){var r=e||m.getCurrentFile(),n=m.getCurrentPath(r);p.read(n+"?hash",t)},this.loadCurrentTime=function(t,e){var r=e||m.getCurrentFile(),n=m.getCurrentPath(r);p.read(n+"?time",t)},this.setCurrentSize=function(t,e){var r=e||m.getCurrentFile(),n=m.getByDataName("js-size",r);n.textContent=t},this.getCurrentMode=function(t){var e=t||m.getCurrentFile(),r=m.getByDataName("js-mode",e);return r.textContent},this.getCurrentOwner=function(t){var e=t||m.getCurrentFile(),r=m.getByDataName("js-owner",e);return r.textContent},this.getCurrentData=function(t,e){var n,o=m.Dialog,i=m.CurrentInfo,u=e||m.getCurrentFile(),c=m.getCurrentPath(u),f=m.isCurrentIsDir(u),l=function(e,r){if(!e){a.object(r)&&(r=s.stringify(r));var o=r,i=o.length;n&&i<1073741824&&m.saveDataToStorage(c,r,n)}t(e,r)};return".."===i.name?(o.alert.noFiles(r),t(Error("No files selected!"))):f?p.read(c,l):void m.checkStorageHash(c,function(e,r,o){return e?t(e):r?m.getDataFromStorage(c,t):(n=o,void p.read(c,l))})},this.saveCurrentData=function(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";m.RESTful.write(t+n,e,function(r){!r&&m.saveDataToStorage(t,e)})},this.getRefreshButton=function(t){var e=t||m.getPanel(),r=m.getByDataName("js-refresh",e);return r},this.setCurrentByName=function(t){var e=m.getCurrentByName(t);return m.setCurrentFile(e)},this.selectFile=function(t){var r=t||m.getCurrentFile();return r.classList.add("selected-file"),e},this.unselectFile=function(t){var r=t||m.getCurrentFile();return r.classList.remove("selected-file"),e},this.toggleSelectedFile=function(t){var r=t||m.getCurrentFile(),n=m.getCurrentName(r);return".."===n?e:(r.classList.toggle("selected-file"),e)},this.toggleAllSelectedFiles=function(){return m.getAllFiles().map(m.toggleSelectedFile),e},this.selectAllFiles=function(){return m.getAllFiles().map(m.selectFile),e},this.getAllFiles=function(){var t=m.getPanel(),e=m.getFiles(t),r=m.getCurrentName(e[0]),n=".."===r?1:0;return o(e).slice(n)},this.expandSelection=function(){var e=t.files;w("expand",e)},this.shrinkSelection=function(){var e=t.files;w("shrink",e)},this.setHistory=function(t,e,r){var n=window.history,o=CloudCmd,i=o.prefix;return r=i+r,n&&history.pushState(t,e,r),n},this.isSelected=function(t){return!!t&&m.isContainClass(t,"selected-file")},this.isCurrentIsDir=function(t){var e=t||m.getCurrentFile(),r=m.getByDataName("js-type",e);return m.isContainClass(r,["directory","directory-link"])},this.getCurrentLink=function(t){var e=t||m.getCurrentFile(),r=m.getByTag("a",e);return r[0]},this.getFilenames=function(t){if(!t)throw Error("AllFiles could not be empty");var e=t[0]||m.getCurrentFile(),r=m.getCurrentName(e),n=o(t);".."===r&&n.shift();var i=n.map(function(t){return m.getCurrentName(t)});return i},this.checkStorageHash=function(t,e){var r=u.parallel,n=m.loadCurrentHash,o=t+"-hash",i=u.with(d.get,o);if("string"!=typeof t)throw Error("name should be a string!");if("function"!=typeof e)throw Error("callback should be a function!");r([n,i],function(t,r,n){var o,i=/error/.test(r);i?t=r:r===n&&(o=!0),e(t,o,r)})},this.saveDataToStorage=function(t,e,r,n){var o=m.isCurrentIsDir(),i=t+"-hash",a=t+"-data";if(o)return u(n);u.if(r,function(){d.set(i,r),d.set(a,e),u(n,r)},function(t){m.loadCurrentHash(function(e,n){r=n,t()})})},this.getDataFromStorage=function(t,e){var r=t+"-hash",n=t+"-data",o=m.isCurrentIsDir();if(o)return u(e);u.parallel([u.with(d.get,n),u.with(d.get,r)],e)},this.getFM=function(){return m.getPanel().parentElement},this.getPanelPosition=function(t){return(t=t||m.getPanel()).dataset.name.replace("js-","")},this.getPanel=function(t){var e,r,n,o="js-",i=m.getCurrentFile();if(i?(e=i.parentElement,r=e.parentElement,n="js-left"===r.getAttribute("data-name")):r=m.getByDataName("js-left"),t&&!t.active&&(o+=n?"right":"left",r=m.getByDataName(o)),window.innerWidth<CloudCmd.MIN_ONE_PANEL_WIDTH&&(r=m.getByDataName("js-left")),!r)throw Error("can not find Active Panel!");return r},this.getFiles=function(t){var e=m.getByDataName("js-files",t);return e.children||[]},this.showPanel=function(t){var e=m.getPanel({active:t});return!!e&&(m.show(e),!0)},this.hidePanel=function(t){var e=m.getPanel({active:t});return!!e&&m.hide(e)},this.remove=function(t,e){var r=e||document.body;return r.removeChild(t),m},this.deleteCurrent=function(t){t||m.getCurrentFile();var e=t&&t.parentElement,r=m.getCurrentName(t);if(t&&".."!==r){var n=t.nextSibling,o=t.previousSibling;m.setCurrentFile(n||o),e.removeChild(t)}},this.deleteSelected=function(t){(t=t||m.getSelectedFiles())&&t.map(m.deleteCurrent)},this.renameCurrent=function(t){var e=m.Dialog;m.isCurrentFile(t)||(t=m.getCurrentFile());var n=m.getCurrentName(t);if(".."===n)return e.alert.noFiles(r);e.prompt(r,"Rename",n,{cancel:!1}).then(function(e){var r=!!m.getCurrentByName(e),o=m.getCurrentDirPath();if(n!==e){var i={from:o+n,to:o+e};p.mv(i,function(n){n||(m.setCurrentName(e,t),d.remove(o),r&&CloudCmd.refresh())})}})},this.scrollIntoViewIfNeeded=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];t&&t.scrollIntoViewIfNeeded&&t.scrollIntoViewIfNeeded(e)},this.scrollByPages=function(t,e){var r=t&&t.scrollByPages&&e;return r&&t.scrollByPages(e),r},this.changePanel=function(){var e=t,r=m.getPanel();CloudCmd.emit("passive-dir",e.dirPath);var o,a,u=m.getPanel({active:!1}),s=m.getCurrentName(),c=m.getFiles(u),f=r.getAttribute("data-name");if(i[f]=s,f=(r=u).getAttribute("data-name"),(s=i[f])&&(a=m.getCurrentByName(s,r))&&(o=a.parentElement),!(o&&o.parentElement||(a=m.getCurrentByName(s,r)))){var l=n(c,1);a=l[0]}return m.setCurrentFile(a,{history:!0}),CloudCmd.emit("active-dir",e.dirPath),m},this.getPackerExt=function(t){return"zip"===t?".zip":".tar.gz"},this.goToDirectory=function(){var e=t.dirPath,n=m.Dialog;n.prompt(r,"Go to directory:",e,{cancel:!1}).then(function(t){return{path:t}}).then(CloudCmd.loadDir)},this.duplicatePanel=function(){var e=t,r=e.isDir,n=e.panelPassive,o=!e.isOnePanel,i=function(t){return t?e.path:e.dirPath}(r);CloudCmd.loadDir({path:i,panel:n,noCurrent:o})},this.swapPanels=function(){var e=t,r=e.panel,n=e.files,o=e.element,i=e.panelPassive,a=m.getCurrentDirPath(),u=m.getNotCurrentDirPath(),s=n.indexOf(o);CloudCmd.loadDir({path:a,panel:i,noCurrent:!0}),CloudCmd.loadDir({path:u,panel:r},function(){var t=e.files,r=t.length-1;s>r&&(s=r);var n=t[s];m.setCurrentFile(n)})},this.CurrentInfo=t,this.updateCurrentInfo=function(t){var e=m.CurrentInfo,r=t||m.getCurrentFile(),n=r.parentElement,i=n.parentElement,a=m.getPanel({active:!1}),u=m.getFiles(a),s=m.getCurrentName(r);e.dir=m.getCurrentDirName(),e.dirPath=m.getCurrentDirPath(),e.parentDirPath=m.getParentDirPath(),e.element=r,e.ext=c.getExt(s),e.files=o(n.children),e.filesPassive=o(u),e.first=n.firstChild,e.getData=m.getCurrentData,e.last=n.lastChild,e.link=m.getCurrentLink(r),e.mode=m.getCurrentMode(r),e.name=s,e.path=m.getCurrentPath(r),e.panel=i,e.panelPassive=a,e.size=m.getCurrentSize(r),e.isDir=m.isCurrentIsDir(),e.isSelected=m.isSelected(r),e.panelPosition=m.getPanel().dataset.name.replace("js-",""),e.isOnePanel=e.panel.getAttribute("data-name")===e.panelPassive.getAttribute("data-name")}});m.Images=f,m.load=l,m.Files=h,m.RESTful=p,m.Storage=d,m.Dialog=g,t.exports=m,m.uploadDirectory=r(54),m.Buffer=r(31),m.Events=r(15);var y=r(60),w=r(61)},function(t,e,r){"use strict";var n=r(8),o=r(18),i=r(16),a=r(0),u=r(3);t.exports.getIdBySrc=function(t){if(!n.string(t))return;~t.indexOf(":")&&(t+="-join");var e=t.lastIndexOf("/")+1,r=t.substr(t,e);return t.replace(r,"").replace(/\./g,"-")},t.exports.ajax=function(t){var e,r=t,i=n.object(r.data),s=n.array(r.data),c="arraybuffer"===n(r.data),f=r.type||r.method||"GET",l=r.headers||{},h=new XMLHttpRequest;h.open(f,r.url,!0),Object.keys(l).forEach(function(t){var e=l[t];h.setRequestHeader(t,e)}),r.responseType&&(h.responseType=r.responseType),e=!c&&i||s?o.stringify(r.data):r.data,h.onreadystatechange=function(t){var e=t.target;if(e.readyState===e.DONE){u.clearProgress();var n=e.getResponseHeader("content-type");if(200!==e.status)return a(r.error,e);var i="text"!==r.dataType,s=~n.indexOf("application/json"),c=e.response;n&&s&&i&&(c=o.parse(e.response)||e.response),a(r.success,c,e.statusText,e)}},h.send(e)},t.exports.put=function(t,e){var r=i(),n=new XMLHttpRequest;return t=encodeURI(t).replace("#","%23"),n.open("put",t,!0),n.upload.onprogress=function(t){if(t.lengthComputable){var e=t.loaded/t.total*100,n=Math.round(e);r.emit("progress",n)}},n.onreadystatechange=function(){if(n.readyState===n.DONE){if(200===n.status)return r.emit("end");var t=Error(n.responseText);r.emit("error",t)}},n.send(e),r}},function(t,e,r){"use strict";var n,o,i=r(8),a=r(1),u=r(0),s=r(13),c=r(19),f={},l="config|modules",h="file|path|link|pathLink|media",p="view/media-tmpl|config-tmpl|upload",d="/tmpl/",g=d+"fs/",v="/json/",m=(n=2e3,function(t){o||(o=!0,setTimeout(function(){o=!1,t()},n))}),y=a(function(t,e){var r,n=i(t);switch(function(t,e){if(!t)throw Error("name could not be empty!");if("function"!=typeof e)throw Error("callback should be a function")}(t,e),n){case"string":!function(t,e){var r=new RegExp(h+"|"+p),n=new RegExp(l),o=r.test(t),i=n.test(t);o||i?"config"===t?function(t){var e;f.config||(f.config=new Promise(function(t,r){e=!0,c.Config.read(function(e,n){if(e)return r(e);t(n)})}));f.config.then(function(r){e=!1,t(null,r),m(function(){e||(f.config=null)})},function(){e||(f.config=null)})}(e):function(t,e){var r=CloudCmd.prefix;f[t]||(f[t]=new Promise(function(e,n){var o=r+t;s.ajax({url:o,success:e,error:n})}));f[t].then(function(t){e(null,t)},function(r){f[t]=null,e(r)})}(function(t,e,r){var n,o=new RegExp(p).test(t);e?(n=o?d+t.replace("-tmpl",""):g+t,n+=".hbs"):r&&(n=v+t+".json");return n}(t,o,i),e):function(t){throw new Error("Wrong file name: "+t)}(t)}(t,e);break;case"array":r=w(t,y),u.parallel(r,e)}}),w=function(t,e){return t.map(function(t){return e(t)})};t.exports.get=y},function(t,e,r){"use strict";function n(t){return function(t){if(Array.isArray(t)){for(var e=0,r=new Array(t.length);e<t.length;e++)r[e]=t[e];return r}}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function o(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 a,u=t[Symbol.iterator]();!(n=(a=u.next()).done)&&(r.push(a.value),!e||r.length!==e);n=!0);}catch(t){o=!0,i=t}finally{try{n||null==u.return||u.return()}finally{if(o)throw i}}return r}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var i=r(8),a=r(59);t.exports=new function(){var t=this,e=this,r=function(t){return"touchstart"===t&&{passive:!0}};function u(t,e,n,o){var a=[t,e,n,o],s=i(t);switch(s){default:if(!/element$/.test(s))throw Error("unknown eventName: "+s);u(a[1],a[0],n,o);break;case"string":i.function(e)&&(n=e,e=null),e||(e=window),o(e,[t,n,r(t)]);break;case"array":t.forEach(function(t){u(t,e,n,o)});break;case"object":Object.keys(t).forEach(function(r){var n=t[r];u(r,e,n,o)})}}function s(t){if(!t)throw Error("type could not be empty!")}this.add=function(t,r,n){return s(t),u(t,r,n,function(t,e){var r=o(e,3),n=r[0],i=r[1],u=r[2];t.addEventListener(n,i,u),a.add(t,n,i)}),e},this.addOnce=function(r,n,o){return o||(o=n,n=null),t.add(r,n,function t(i){e.remove(r,n,t),o(i)}),e},this.remove=function(t,r,o){return s(t),u(t,r,o,function(t,e){t.removeEventListener.apply(t,n(e))}),e},this.removeAll=function(){var t=a.get(),e=!0,r=!1,n=void 0;try{for(var i,u=t[Symbol.iterator]();!(e=(i=u.next()).done);e=!0){var s=o(i.value,3),c=s[0],f=s[1],l=s[2];c.removeEventListener(f,l)}}catch(t){r=!0,n=t}finally{try{e||null==u.return||u.return()}finally{if(r)throw n}}a.clear()},this.addKey=function(){for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];var i=["keydown"].concat(r);return e.add.apply(e,n(i))},this.rmKey=function(){for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];var i=["keydown"].concat(r);return e.remove.apply(e,n(i))},this.addClick=function(){for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];var i=["click"].concat(r);return e.add.apply(e,n(i))},this.rmClick=function(){for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];var i=["click"].concat(r);return e.remove.apply(e,n(i))},this.addContextMenu=function(){for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];var i=["contextmenu"].concat(r);return e.add.apply(e,n(i))},this.addError=function(){for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];var i=["error"].concat(r);return e.add.apply(e,n(i))},this.addLoad=function(){for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];var i=["load"].concat(r);return e.add.apply(e,n(i))}}},function(t,e,r){t.exports=r(41)},function(t,e,r){"use strict";var n={" ":" ","<":"<",">":">",""":'"'},o=Object.keys(n);t.exports.encode=function(t){return o.forEach(function(e){var r=RegExp(n[e],"g");t=t.replace(r,e)}),t},t.exports.decode=function(t){return o.forEach(function(e){var r=n[e],o=RegExp(e,"g");t=t.replace(o,r)}),t}},function(t,e,r){t.exports=r(51)},function(t,e,r){"use strict";var n=r(8),o=r(5).FS,i=r(17).encode;t.exports=new function(){function t(t){var e=t,r=CloudCmd,n=r.prefixURL;e.url=n+e.url,e.url=encodeURI(e.url),e.url=s(e.url),u.ajax({method:e.method,url:e.url,data:e.data,dataType:e.dataType,error:function(t){var r=t.responseText,n=t.statusText,o=t.status,u=404===o?r:n,s=i(u);a.show.error(s),setTimeout(function(){DOM.Dialog.alert(CloudCmd.TITLE,s)},100),e.callback(Error(u))},success:function(t){a.hide(),e.notLog||CloudCmd.log(t),e.callback(null,t)}})}this.delete=function(e,r,i){var a=n.function(r);!i&&a&&(i=r,r=null),t({method:"DELETE",url:o+e,data:r,callback:i,imgPosition:{top:!!r}})},this.patch=function(e,r,i){var a=n.function(r);!i&&a&&(i=r,r=null);t({method:"PATCH",url:o+e,data:r,callback:i,imgPosition:{top:!0}})},this.write=function(e,r,i){var a=n.function(r);!i&&a&&(i=r,r=null),t({method:"PUT",url:o+e,data:r,callback:i,imgPosition:{top:!0}})},this.read=function(e,r,i){var a=!e.includes("?"),u=n.function(r);!i&&u&&(i=r,r="text"),t({method:"GET",url:o+e,callback:i,notLog:a,dataType:r})},this.cp=function(e,r){t({method:"PUT",url:"/cp",data:e,callback:r,imgPosition:{top:!0}})},this.pack=function(e,r){t({method:"PUT",url:"/pack",data:e,callback:r})},this.extract=function(e,r){t({method:"PUT",url:"/extract",data:e,callback:r})},this.mv=function(e,r){t({method:"PUT",url:"/mv",data:e,callback:r,imgPosition:{top:!0}})},this.Config={read:function(e){t({method:"GET",url:"/config",callback:e,imgPosition:{top:!0},notLog:!0})},write:function(e,r){t({method:"PATCH",url:"/config",data:e,callback:r,imgPosition:{top:!0}})}},this.Markdown={read:function(e,r){t({method:"GET",url:"/markdown"+e,callback:r,imgPosition:{top:!0},notLog:!0})},render:function(e,r){t({method:"PUT",url:"/markdown",data:e,callback:r,imgPosition:{top:!0},notLog:!0})}}};var a=r(3),u=r(13);function s(t){return t.replace(/#/g,"%23")}t.exports._replaceHash=s},function(t,e,r){t.exports=r(64)},function(t,e,r){"use strict";var n=r(22),o=n.alert,i=n.prompt,a=n.confirm;t.exports={alert:o,prompt:i,confirm:a},t.exports.alert.noFiles=function(t){return o(t,"No files selected!",{cancel:!1})}},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 a,u=t[Symbol.iterator]();!(n=(a=u.next()).done)&&(r.push(a.value),!e||r.length!==e);n=!0);}catch(t){o=!0,i=t}finally{try{n||null==u.return||u.return()}finally{if(o)throw i}}return r}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}r(142);var o=r(1),i=r(10),a=r(2),u=o(function(t,e,r,n){var o={ENTER:13,ESC:27,TAB:9,LEFT:37,UP:38,RIGHT:39,DOWN:40},i=n.keyCode,a=n.target,u=y(t,["ok","cancel","input"]).map(d);switch(i){case o.ENTER:m(a,t,e,r),n.preventDefault();break;case o.ESC:s(),r();break;case o.TAB:n.shiftKey&&v(t,u),v(t,u),n.preventDefault();break;default:["left","right","up","down"].filter(function(t){return i===o[t.toUpperCase()]}).forEach(function(){!function(t,e){var r=d(document.activeElement),n=/ok|cancel/.test(r),o=e.length-1;if("input"===r||!o||!n)return;var i=function(t){return"cancel"===t?"ok":"cancel"}(r);y(t,[i]).forEach(function(t){t.focus()})}(t,u)})}n.stopPropagation()}),s=function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];return function(){return t.apply(void 0,r)}}(function(t){var e=document.querySelector(t);e.parentElement.removeChild(e)},".smalltalk"),c={ok:"OK"},f={ok:"OK",cancel:"Cancel"};function l(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).buttons;return t||null}function h(t,e,r,n){var i=e.replace(/\n/g,"<br>");return'<div class="page">\n <div data-name="js-close" class="close-button"></div>\n <header>'.concat(t,'</header>\n <div class="content-area">').concat(i).concat(r,'</div>\n <div class="action-area">\n <div class="button-strip">\n ').concat(function(t){var e=Object.keys(t),r=o(function(t,e,r){return"<button\n tabindex=".concat(r,'\n data-name="js-').concat(e.toLowerCase(),'">\n ').concat(t[e],"\n </button>")});return e.map(r(t)).join("")}(n),"\n </div>\n </div>\n </div>")}function p(t,e,r,n,o){var s,c,f=i(),l=i(),p=new Promise(function(t,e){var r=o&&!1===o.cancel;f(t),l(r?function(){}:e)}),d=h(t,e,r,n),g=a("div",{innerHTML:d,className:"smalltalk"});return y(g,["ok","input"]).forEach(function(t){return t.focus()}),y(g,["input"]).forEach(function(t){t.setSelectionRange(0,r.length)}),s="click",c=function(t){m(t.target,g,f(),l())},y(g,["cancel","close","ok"]).forEach(function(t){t.addEventListener(s,c)}),["click","contextmenu"].forEach(function(t){return g.addEventListener(t,function(t){t.stopPropagation(),y(g,["ok","input"]).forEach(function(t){return t.focus()})})}),g.addEventListener("keydown",u(g,f(),l())),Object.assign(p,{dialog:g,ok:f})}function d(t){return t.getAttribute("data-name").replace("js-","")}e.alert=function(t,e,r){return p(t,e,"",l(r)||c,r)},e.prompt=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",n=arguments.length>3?arguments[3]:void 0,o=function(){return"password"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).type?"password":"text"}(n),i=String(r).replace(/"/g,""");return p(t,e,'<input type="'.concat(o,'" value="').concat(i,'" data-name="js-input">'),l(n)||f,n)},e.confirm=function(t,e,r){return p(t,e,"",l(r)||f,r)},e.progress=function(t,e,r){var o=p(t,e,'\n <progress value="0" data-name="js-progress" class="progress" max="100"></progress>\n <span data-name="js-counter">0%</span>\n ',{cancel:"Abort"},r),i=o.ok,a=o.dialog,u=i();return y(a,["cancel"]).map(function(t){t.focus()}),Object.assign(o,{setProgress:function(t){var e=n(y(a,["progress"]),1)[0],r=n(y(a,["counter"]),1)[0];e.value=t,r.textContent="".concat(t,"%"),100===t&&(s(),u())}}),o};var g=function(t,e){return e===t?0:e+1};function v(t,e){var r=d(document.activeElement),n=e.length-1,o=e.indexOf(r);y(t,[e[g(n,o)]]).forEach(function(t){return t.focus()})}function m(t,e,r,n){var o=t.getAttribute("data-name").replace("js-","");if(/close|cancel/.test(o))return n(),void s();r(y(e,["input"]).reduce(function(t,e){return e.value},null)),s()}function y(t,e){return e.map(function(e){return t.querySelector('[data-name="js-'.concat(e,'"]'))}).filter(Boolean)}},function(t,e,r){"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}r(145);var o=r(11),i=r(2);function a(){function t(t){return t&&e(t)&&(t=t.parentElement),t}function e(t){if(t)return t.hasAttribute("data-menu-path")}function r(t,e,r){var n;(r||(r="data-name"),t)&&(t.getAttribute(r)===e&&(n=!0));return n}this.getItem=t,this.getName=function(t){if(t){var r=e(t);r||(t=t.querySelector("[data-menu-path]"))}return t},this.isName=e,this.isItem=function(t){return r(t,"js-menu-item")},this.isMenu=function(t){return r(t,"js-menu")},this.isSubMenu=function(e){return r(t(e),"js-submenu","data-menu")}}function u(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];if("function"==typeof t)return t.apply(void 0,r)}t.exports=function t(e,r,s){if(!(this instanceof t))return new t(e,r,s);var c=new a;var f={};var l;var h;var p;var d;var g;var v={};var m={MAIN:'<ul data-name="js-menu" class="menu menu-hidden">{{ items }}</ul>',ITEM:'<li data-name="js-menu-item" class="menu-item{{ className }}"{{ attribute }}><label data-menu-path="{{ path }}">{{ name }}</label>{{ subitems }}</li>'};s?(h=g=e,f=r):r?(h=g=e,s=r):(h=document.body,g=window,s=e);this.show=x;this.hide=C;function y(t,e){var r=c.getItem(t),n=c.isName(r),o=c.isItem(r),i=c.isSubMenu(r);return n&&o||(r=document.elementFromPoint(e.x,e.y),i=c.isSubMenu(r),n=c.isName(r),o=c.isItem(r)),{name:n,item:o,sub:i}}function w(t,e){t.stopPropagation();var r=f.afterClick,n=f.beforeClick,o=f.name,i=t.target,a=e||y(i,{x:t.clientX,y:t.clientY}),s=u(n,o);if(a.sub)return t.preventDefault();if(C(),!s&&(a.name||a.item)){var l=function(t){var e;(t=c.getName(t))&&(e=t.getAttribute("data-menu-path"));return v[e]}(i);u(l),u(r)}}function b(t){t.preventDefault();var e=t.target,r=t.clientX,n=t.clientY,o=y(e,{x:r,y:n});if(o.name||o.item||o.sub)return w(t,o);C(),x(r,n)}function E(t,e){var r="number"==typeof t,n="number"==typeof e,o=function(){if(!p){var t=getComputedStyle(l),e=t.height;p=parseInt(e,10)}return p}(),i=function(){var t,e;d||(t=getComputedStyle(l),e=t.width,d=parseInt(e,10));return d}(),a=window.innerHeight,u=window.innerWidth;u<i+t&&(t-=i)<0&&(t=0),a<o+e&&(e-=o)<0&&(e=0),r&&(l.style.left=t+"px"),n&&(l.style.top=e-14+"px")}function x(t,e){var r=f,n=r.name,o=r.beforeShow,i={x:t,y:e,name:n},a=u(o,i);a||(l.classList.remove("menu-hidden"),E(i.x,i.y))}function C(){var t=u(f.beforeClose);t||l.classList.add("menu-hidden")}!function(){if("object"!==n(s)){var t=s;(s={})[t]=null}l=function(t){var e="";return e=function t(e,r){var i="";return r?r+=".":r="",Object.keys(e).forEach(function(a){var u="",s="",c="",l="",h=r+a,p=e[a];"object"===n(p)?(s=o(m.MAIN,{items:t(p,h)}),c=" menu-submenu",l=' data-menu="js-submenu"'):v[h]=p,f.icon&&(c+=" icon icon-"+a.replace(/\(|\)/g,"").replace(/\s/g,"-").toLowerCase()),f.keys&&(u=f.keys[a])&&(l=" data-key="+u),i+=o(m.ITEM,{name:a,subitems:s,className:c,attribute:l,path:h})}),i}(t),i("ul",{dataName:"js-menu",className:"menu menu-hidden",innerHTML:e,parent:h,uniq:!1})}(s),g.addEventListener("click",w),g.addEventListener("contextmenu",b)}()}},function(t,e,r){"use strict";t.exports=function(t){return document.querySelector('[data-name="modal-'.concat(t,'"]'))}},,function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){"use strict";(function(e){t.exports=function(t){return"function"==typeof btoa?btoa(t):e.from(t).toString("base64")}}).call(this,r(46).Buffer)},function(t,e,r){"use strict";t.exports=function(t){var e=[].slice.call(arguments,1);try{return[null,t.apply(null,e)]}catch(t){return[t]}}},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 a,u=t[Symbol.iterator]();!(n=(a=u.next()).done)&&(r.push(a.value),!e||r.length!==e);n=!0);}catch(t){o=!0,i=t}finally{try{n||null==u.return||u.return()}finally{if(o)throw i}}return r}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var o=r(8),i=r(18),a=r(0),u=r(28),s=localStorage.setItem.bind(localStorage);t.exports.remove=function(e,r){return localStorage.removeItem(e),a(r,null),t.exports},t.exports.removeMatch=function(e,r){var n=RegExp("^"+e+".*$");return Object.keys(localStorage).filter(function(t){return n.test(t)}).forEach(function(t){return localStorage.removeItem(t)}),a(r),t.exports},t.exports.set=function(e,r,c){var f,l;(o.object(r)&&(f=i.stringify(r)),e)&&(l=n(u(s,e,f||r),1)[0]);return a(c,l),t.exports},t.exports.get=function(e,r){var n=localStorage.getItem(e);return a(r,null,n),t.exports},t.exports.clear=function(e){return localStorage.clear(),a(e),t.exports}},function(t,e){"function"==typeof Object.create?t.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}},function(t,e,r){"use strict";function n(t){return function(t){if(Array.isArray(t)){for(var e=0,r=new Array(t.length);e<t.length;e++)r[e]=t[e];return r}}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}var o=r(18),i=r(0),a=r(29),u=r(12);t.exports=new function(){var t=u.CurrentInfo,e="cut-file",r="copy",s="cut",c="Buffer";function f(t){u.Dialog.alert(c,t)}function l(){var t=u.getActiveFiles(),e=u.getFilenames(t);return e}function h(t){var e=CloudCmd.config("buffer");if(e)return t();f("Buffer disabled in config!")}function p(){a.remove(r).remove(s),n(u.getByClassAll(e)).forEach(function(t){t.classList.remove(e)})}return{cut:h.bind(null,function(){var r=l(),n=t.dirPath;if(p(),!r.length)return;u.getActiveFiles().forEach(function(t){t.classList.add(e)}),a.set(s,{from:n,names:r})}),copy:h.bind(null,function(){var e=l(),n=t.dirPath;if(p(),!e.length)return;a.remove(s).set(r,{from:n,names:e})}),clear:h.bind(null,p),paste:h.bind(null,function(){var e=a.get.bind(a,r),n=a.get.bind(a,s);i.parallel([e,n],function(e,r,n){var i=r?"copy":"move",a=r||n,u=CloudCmd,s=u.Operation,c=t.dirPath;if(e||r||n||(e="Buffer is empty!"),e)return f(e);var l=o.parse(a);if(l.to=c,l.from===c)return f("Path is same!");s.show(i,l),p()})})}}},function(t,e){t.exports=function(t){for(var e=t.split(r),n=e.length,o=new Array(n),i=0;i<n;i++){var a=e[i];""!==a&&(o[i]=a[0].toUpperCase()+a.slice(1))}return o.join("")};var r=/[\s\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,\-.\/:;<=>?@\[\]^_`{|}~]+/},function(t,e,r){"use strict";t.exports=navigator.clipboard||{readText:function(){return Promise.reject()},writeText:function(t){var e=document.createElement("textarea");e.value=t,document.body.appendChild(e),e.select();var r=document.execCommand("copy");return document.body.removeChild(e),r?Promise.resolve():Promise.reject()}}},function(t,e,r){"use strict";function n(t){return function(t){if(Array.isArray(t)){for(var e=0,r=new Array(t.length);e<t.length;e++)r[e]=t[e];return r}}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}var o=r(0).eachSeries,i=r(7),a=r(12),u=r(13),s=r(3),c=r(21).alert,f=r(5).FS,l=CloudCmd.TITLE,h=i(function(t){CloudCmd.refresh({currentName:t})}),p=i(function(t,e,r,n){var o=r.name,i=t+o,a=CloudCmd.prefixURL+f;0,u.put(a+i,r).on("error",g).on("end",n).on("progress",function(t){var r=function(t){return 100/t}(e),n=0*r+function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:100;return Math.round(t*r/e)}(t,100,r);s.show.load("top"),s.setProgress(Math.round(n))})}),d=a.getCurrentDirPath;function g(t){var e=t.message;c(l,e)}t.exports=function(t,e){e||(e=t,t=d());var r=e.length;if(r){var i=n(e),a=e[0].name;o(i,p(t,r),h(a))}}},,function(t,e,r){t.exports=r(75)},function(t,e,r){"use strict";var n=r(2),o=r(24);t.exports=function(t,e){if(o("title"))o("title-text").textContent=t;else{var r=n("div",{className:"modal-title",dataName:"modal-title",parent:e});n("span",{parent:r,textContent:t,className:"modal-title-text",dataName:"modal-title-text"})}}},,function(t,e,r){"use strict";var n=function(t){return function(){for(var e=arguments.length,r=Array(e),n=0;n<e;n++)r[n]=arguments[n];return function(){for(var e=arguments.length,n=Array(e),o=0;o<e;o++)n[o]=arguments[o];return t.apply(void 0,r.concat(n))}}};t.exports=function(t){for(var e=arguments.length,r=Array(e>1?e-1:0),o=1;o<e;o++)r[o-1]=arguments[o];return function(t){if("function"!=typeof t)throw Error("fn should be a function!")}(t),r.length?n(t).apply(void 0,r):n(t)}},function(t,e,r){"use strict";t.exports=function t(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];if(function(t){if("function"!=typeof t)throw Error("fn should be function!")}(e),n.length>=e.length)return e.apply(void 0,n);var i=function(){for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return t.apply(void 0,[e].concat(n.concat(o)))},a=e.length-n.length-1;return function(t){return[function(e){return t.apply(void 0,arguments)},function(e,r){return t.apply(void 0,arguments)},function(e,r,n){return t.apply(void 0,arguments)},function(e,r,n,o){return t.apply(void 0,arguments)},function(e,r,n,o,i){return t.apply(void 0,arguments)}]}(i)[a]||i}},function(t,e,r){"use strict";function n(){if(!(this instanceof n))return new n;this._all={}}function o(t){if("string"!=typeof t)throw Error("event should be string!")}function i(t,e){o(t),function(t){if("function"!=typeof t)throw Error("callback should be function!")}(e)}t.exports=n,n.prototype.on=function(t,e){var r=this._all[t];return i(t,e),r?r.push(e):this._all[t]=[e],this},n.prototype.addListener=n.prototype.on,n.prototype.once=function(t,e){var r=this;return i(t,e),r.on(t,function n(){e.apply(null,arguments),r.off(t,n)}),this},n.prototype.off=function(t,e){var r=this._all[t]||[],n=r.indexOf(e);for(i(t,e);~n;)r.splice(n,1),n=r.indexOf(e);return this},n.prototype.removeListener=n.prototype.off,n.prototype.emit=function(t){var e=[].slice.call(arguments,1),r=this._all[t];if(o(t),!r&&"error"===t)throw e[0];return r?(r.forEach(function(t){t.apply(null,e)}),this):this},n.prototype.removeAllListeners=function(t){return o(t),this._all[t]=[],this}},function(t,e,r){(function(e,r){
/*!
* @overview es6-promise - a tiny implementation of Promises/A+.
* @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
* @license Licensed under MIT license
* See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE
* @version v4.2.6+9869a4bc
*/var n;n=function(){"use strict";function t(t){return"function"==typeof t}var n=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},o=0,i=void 0,a=void 0,u=function(t,e){d[o]=t,d[o+1]=e,2===(o+=2)&&(a?a(g):b())},s="undefined"!=typeof window?window:void 0,c=s||{},f=c.MutationObserver||c.WebKitMutationObserver,l="undefined"==typeof self&&void 0!==e&&"[object process]"==={}.toString.call(e),h="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function p(){var t=setTimeout;return function(){return t(g,1)}}var d=new Array(1e3);function g(){for(var t=0;t<o;t+=2){(0,d[t])(d[t+1]),d[t]=void 0,d[t+1]=void 0}o=0}var v,m,y,w,b=void 0;function E(t,e){var r=this,n=new this.constructor(A);void 0===n[C]&&F(n);var o=r._state;if(o){var i=arguments[o-1];u(function(){return M(o,n,i,r._result)})}else I(r,n,t,e);return n}function x(t){if(t&&"object"==typeof t&&t.constructor===this)return t;var e=new this(A);return j(e,t),e}l?b=function(){return e.nextTick(g)}:f?(m=0,y=new f(g),w=document.createTextNode(""),y.observe(w,{characterData:!0}),b=function(){w.data=m=++m%2}):h?((v=new MessageChannel).port1.onmessage=g,b=function(){return v.port2.postMessage(0)}):b=void 0===s?function(){try{var t=Function("return this")().require("vertx");return void 0!==(i=t.runOnLoop||t.runOnContext)?function(){i(g)}:p()}catch(t){return p()}}():p();var C=Math.random().toString(36).substring(2);function A(){}var _=void 0,S=1,P=2,T={error:null};function O(t){try{return t.then}catch(t){return T.error=t,T}}function D(e,r,n){r.constructor===e.constructor&&n===E&&r.constructor.resolve===x?function(t,e){e._state===S?L(t,e._result):e._state===P?N(t,e._result):I(e,void 0,function(e){return j(t,e)},function(e){return N(t,e)})}(e,r):n===T?(N(e,T.error),T.error=null):void 0===n?L(e,r):t(n)?function(t,e,r){u(function(t){var n=!1,o=function(t,e,r,n){try{t.call(e,r,n)}catch(t){return t}}(r,e,function(r){n||(n=!0,e!==r?j(t,r):L(t,r))},function(e){n||(n=!0,N(t,e))},t._label);!n&&o&&(n=!0,N(t,o))},t)}(e,r,n):L(e,r)}function j(t,e){var r,n;t===e?N(t,new TypeError("You cannot resolve a promise with itself")):(n=typeof(r=e),null===r||"object"!==n&&"function"!==n?L(t,e):D(t,e,O(e)))}function k(t){t._onerror&&t._onerror(t._result),R(t)}function L(t,e){t._state===_&&(t._result=e,t._state=S,0!==t._subscribers.length&&u(R,t))}function N(t,e){t._state===_&&(t._state=P,t._result=e,u(k,t))}function I(t,e,r,n){var o=t._subscribers,i=o.length;t._onerror=null,o[i]=e,o[i+S]=r,o[i+P]=n,0===i&&t._state&&u(R,t)}function R(t){var e=t._subscribers,r=t._state;if(0!==e.length){for(var n=void 0,o=void 0,i=t._result,a=0;a<e.length;a+=3)n=e[a],o=e[a+r],n?M(r,n,o,i):o(i);t._subscribers.length=0}}function M(e,r,n,o){var i=t(n),a=void 0,u=void 0,s=void 0,c=void 0;if(i){if((a=function(t,e){try{return t(e)}catch(t){return T.error=t,T}}(n,o))===T?(c=!0,u=a.error,a.error=null):s=!0,r===a)return void N(r,new TypeError("A promises callback cannot return that same promise."))}else a=o,s=!0;r._state!==_||(i&&s?j(r,a):c?N(r,u):e===S?L(r,a):e===P&&N(r,a))}var B=0;function F(t){t[C]=B++,t._state=void 0,t._result=void 0,t._subscribers=[]}var U=function(){function t(t,e){this._instanceConstructor=t,this.promise=new t(A),this.promise[C]||F(this.promise),n(e)?(this.length=e.length,this._remaining=e.length,this._result=new Array(this.length),0===this.length?L(this.promise,this._result):(this.length=this.length||0,this._enumerate(e),0===this._remaining&&L(this.promise,this._result))):N(this.promise,new Error("Array Methods must be provided an Array"))}return t.prototype._enumerate=function(t){for(var e=0;this._state===_&&e<t.length;e++)this._eachEntry(t[e],e)},t.prototype._eachEntry=function(t,e){var r=this._instanceConstructor,n=r.resolve;if(n===x){var o=O(t);if(o===E&&t._state!==_)this._settledAt(t._state,e,t._result);else if("function"!=typeof o)this._remaining--,this._result[e]=t;else if(r===Y){var i=new r(A);D(i,t,o),this._willSettleAt(i,e)}else this._willSettleAt(new r(function(e){return e(t)}),e)}else this._willSettleAt(n(t),e)},t.prototype._settledAt=function(t,e,r){var n=this.promise;n._state===_&&(this._remaining--,t===P?N(n,r):this._result[e]=r),0===this._remaining&&L(n,this._result)},t.prototype._willSettleAt=function(t,e){var r=this;I(t,void 0,function(t){return r._settledAt(S,e,t)},function(t){return r._settledAt(P,e,t)})},t}(),Y=function(){function e(t){this[C]=B++,this._result=this._state=void 0,this._subscribers=[],A!==t&&("function"!=typeof t&&function(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}(),this instanceof e?function(t,e){try{e(function(e){j(t,e)},function(e){N(t,e)})}catch(e){N(t,e)}}(this,t):function(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}())}return e.prototype.catch=function(t){return this.then(null,t)},e.prototype.finally=function(e){var r=this.constructor;return t(e)?this.then(function(t){return r.resolve(e()).then(function(){return t})},function(t){return r.resolve(e()).then(function(){throw t})}):this.then(e,e)},e}();return Y.prototype.then=E,Y.all=function(t){return new U(this,t).promise},Y.race=function(t){var e=this;return n(t)?new e(function(r,n){for(var o=t.length,i=0;i<o;i++)e.resolve(t[i]).then(r,n)}):new e(function(t,e){return e(new TypeError("You must pass an array to race."))})},Y.resolve=x,Y.reject=function(t){var e=new this(A);return N(e,t),e},Y._setScheduler=function(t){a=t},Y._setAsap=function(t){u=t},Y._asap=u,Y.polyfill=function(){var t=void 0;if(void 0!==r)t=r;else if("undefined"!=typeof self)t=self;else try