cloudcmd 19.1.1 → 19.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/sw.js CHANGED
@@ -1,2 +1,2 @@
1
- (()=>{var t={980(t,e,n){"use strict";n.r(e),n.d(e,{default:()=>o,tryToCatch:()=>r});const r=async(t,...e)=>{!function(t){if("function"!=typeof t)throw Error("fn should be a function!")}(t);try{return[null,await t(...e)]}catch(t){return[t]}},o=r},4299(t){"use strict";const e=(t,...n)=>{if(function(t){if("function"!=typeof t)throw Error("fn should be function!")}(t),n.length>=t.length)return t(...n);const r=(...r)=>e(t,...n,...r),o=t.length-n.length-1,i=(t=>[function(e){return t(...arguments)},function(e,n){return t(...arguments)},function(e,n,r){return t(...arguments)},function(e,n,r,o){return t(...arguments)},function(e,n,r,o,i){return t(...arguments)}])(r)[o];return i||r};t.exports=e},5606(t){var e,n,r=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function c(t){if(e===setTimeout)return setTimeout(t,0);if((e===o||!e)&&setTimeout)return e=setTimeout,setTimeout(t,0);try{return e(t,0)}catch(n){try{return e.call(null,t,0)}catch(n){return e.call(this,t,0)}}}!function(){try{e="function"==typeof setTimeout?setTimeout:o}catch(t){e=o}try{n="function"==typeof clearTimeout?clearTimeout:i}catch(t){n=i}}();var s,a=[],u=!1,l=-1;function f(){u&&s&&(u=!1,s.length?a=s.concat(a):l=-1,a.length&&h())}function h(){if(!u){var t=c(f);u=!0;for(var e=a.length;e;){for(s=a,a=[];++l<e;)s&&s[l].run();l=-1,e=a.length}s=null,u=!1,function(t){if(n===clearTimeout)return clearTimeout(t);if((n===i||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(t);try{return n(t)}catch(e){try{return n.call(null,t)}catch(e){return n.call(this,t)}}}(t)}}function d(t,e){this.fun=t,this.array=e}function p(){}r.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];a.push(new d(t,e)),1!==a.length||u||c(h)},d.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={},r.on=p,r.addListener=p,r.once=p,r.off=p,r.removeListener=p,r.removeAllListeners=p,r.emit=p,r.prependListener=p,r.prependOnceListener=p,r.listeners=function(t){return[]},r.binding=function(t){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(t){throw new Error("process.chdir is not supported")},r.umask=function(){return 0}},8011(t,e,n){"use strict";const{tryToCatch:r}=n(980);t.exports=r,t.exports.tryToCatch=r}},e={};function n(r){var o=e[r];if(void 0!==o)return o.exports;var i=e[r]={exports:{}};return t[r](i,i.exports,n),i.exports}n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},(()=>{"use strict";const t=n(5606),{tryToCatch:e}=n(8011),r=n(4299),o="development"===t.env.NODE_ENV,i=r((t,e)=>e.waitUntil(t())),c=r((t,e)=>{const{request:n}=e,{url:r}=n,o=s(r);r.endsWith("/")||/\^\/fs/.test(o)||"GET"===n.method&&"basic"===n.type&&(o.startsWith("/api")||/^socket.io/.test(o)||e.respondWith(t(e)))}),s=t=>new URL(t).pathname,a="cloudcmd: Mon Jan 12 2026 13:33:12 GMT+0200 (Eastern European Standard Time)";self.addEventListener("install",i(async function(){console.info(`cloudcmd: sw: install: ${a}`),await self.skipWaiting()})),self.addEventListener("fetch",c(async function(t){const{request:n}=t,{url:r}=n,i=((t,e)=>"/"!==t?e:new Request("/",{credentials:"same-origin"}))(s(r),t.request),c=await caches.open(a),u=await c.match(n);if(!o&&u)return u;const[l,f]=await e(fetch,i,{credentials:"same-origin"});return l?new Response(l.message):(await async function(t,e){return(await caches.open(a)).put(t,e)}(n,f.clone()),f)})),self.addEventListener("activate",i(async function(){console.info(`cloudcmd: sw: activate: ${a}`),await self.clients.claim();const t=await caches.keys(),e=caches.delete.bind(caches);await Promise.all(t.map(e))}))})()})();
1
+ (()=>{var t={980(t,e,n){"use strict";n.r(e),n.d(e,{default:()=>o,tryToCatch:()=>r});const r=async(t,...e)=>{!function(t){if("function"!=typeof t)throw Error("fn should be a function!")}(t);try{return[null,await t(...e)]}catch(t){return[t]}},o=r},4299(t){"use strict";const e=(t,...n)=>{if(function(t){if("function"!=typeof t)throw Error("fn should be function!")}(t),n.length>=t.length)return t(...n);const r=(...r)=>e(t,...n,...r),o=t.length-n.length-1,i=(t=>[function(e){return t(...arguments)},function(e,n){return t(...arguments)},function(e,n,r){return t(...arguments)},function(e,n,r,o){return t(...arguments)},function(e,n,r,o,i){return t(...arguments)}])(r)[o];return i||r};t.exports=e},5606(t){var e,n,r=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function c(t){if(e===setTimeout)return setTimeout(t,0);if((e===o||!e)&&setTimeout)return e=setTimeout,setTimeout(t,0);try{return e(t,0)}catch(n){try{return e.call(null,t,0)}catch(n){return e.call(this,t,0)}}}!function(){try{e="function"==typeof setTimeout?setTimeout:o}catch(t){e=o}try{n="function"==typeof clearTimeout?clearTimeout:i}catch(t){n=i}}();var s,a=[],u=!1,l=-1;function f(){u&&s&&(u=!1,s.length?a=s.concat(a):l=-1,a.length&&h())}function h(){if(!u){var t=c(f);u=!0;for(var e=a.length;e;){for(s=a,a=[];++l<e;)s&&s[l].run();l=-1,e=a.length}s=null,u=!1,function(t){if(n===clearTimeout)return clearTimeout(t);if((n===i||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(t);try{return n(t)}catch(e){try{return n.call(null,t)}catch(e){return n.call(this,t)}}}(t)}}function d(t,e){this.fun=t,this.array=e}function p(){}r.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];a.push(new d(t,e)),1!==a.length||u||c(h)},d.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={},r.on=p,r.addListener=p,r.once=p,r.off=p,r.removeListener=p,r.removeAllListeners=p,r.emit=p,r.prependListener=p,r.prependOnceListener=p,r.listeners=function(t){return[]},r.binding=function(t){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(t){throw new Error("process.chdir is not supported")},r.umask=function(){return 0}},8011(t,e,n){"use strict";const{tryToCatch:r}=n(980);t.exports=r,t.exports.tryToCatch=r}},e={};function n(r){var o=e[r];if(void 0!==o)return o.exports;var i=e[r]={exports:{}};return t[r](i,i.exports,n),i.exports}n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},(()=>{"use strict";const t=n(5606),{tryToCatch:e}=n(8011),r=n(4299),o="development"===t.env.NODE_ENV,i=r((t,e)=>e.waitUntil(t())),c=r((t,e)=>{const{request:n}=e,{url:r}=n,o=s(r);r.endsWith("/")||/\^\/fs/.test(o)||"GET"===n.method&&"basic"===n.type&&(o.startsWith("/api")||/^socket.io/.test(o)||e.respondWith(t(e)))}),s=t=>new URL(t).pathname,a="cloudcmd: Wed Jan 14 2026 14:38:31 GMT+0200 (Eastern European Standard Time)";self.addEventListener("install",i(async function(){console.info(`cloudcmd: sw: install: ${a}`),await self.skipWaiting()})),self.addEventListener("fetch",c(async function(t){const{request:n}=t,{url:r}=n,i=((t,e)=>"/"!==t?e:new Request("/",{credentials:"same-origin"}))(s(r),t.request),c=await caches.open(a),u=await c.match(n);if(!o&&u)return u;const[l,f]=await e(fetch,i,{credentials:"same-origin"});return l?new Response(l.message):(await async function(t,e){return(await caches.open(a)).put(t,e)}(n,f.clone()),f)})),self.addEventListener("activate",i(async function(){console.info(`cloudcmd: sw: activate: ${a}`),await self.clients.claim();const t=await caches.keys(),e=caches.delete.bind(caches);await Promise.all(t.map(e))}))})()})();
2
2
  //# sourceMappingURL=sw.js.map
@@ -147,7 +147,7 @@ eval("{\n\n/* global CloudCmd */\nconst Util = __webpack_require__(/*! ../../com
147
147
  (module, __unused_webpack_exports, __webpack_require__) {
148
148
 
149
149
  "use strict";
150
- eval("{\n\nconst {\n FS\n} = __webpack_require__(/*! ../../../common/cloudfunc */ \"./common/cloudfunc.js\");\nconst sendRequest = __webpack_require__(/*! ./send-request */ \"./client/dom/io/send-request.js\");\nconst imgPosition = {\n top: true\n};\nmodule.exports[\"delete\"] = async (url, data) => {\n return await sendRequest({\n method: 'DELETE',\n url: FS + url,\n data,\n imgPosition: {\n top: Boolean(data)\n }\n });\n};\nmodule.exports.patch = async (url, data) => {\n return await sendRequest({\n method: 'PATCH',\n url: FS + url,\n data,\n imgPosition\n });\n};\nmodule.exports.write = async (url, data) => {\n return await sendRequest({\n method: 'PUT',\n url: FS + url,\n data,\n imgPosition\n });\n};\nmodule.exports.createDirectory = async url => {\n return await sendRequest({\n method: 'PUT',\n url: `${FS}${url}?dir`,\n imgPosition\n });\n};\nmodule.exports.read = async (url, dataType = 'text') => {\n const notLog = !url.includes('?');\n return await sendRequest({\n method: 'GET',\n url: FS + url,\n notLog,\n dataType\n });\n};\nmodule.exports.copy = async (from, to, names) => {\n return await sendRequest({\n method: 'PUT',\n url: '/copy',\n data: {\n from,\n to,\n names\n },\n imgPosition\n });\n};\nmodule.exports.pack = async data => {\n return await sendRequest({\n method: 'PUT',\n url: '/pack',\n data\n });\n};\nmodule.exports.extract = async data => {\n return await sendRequest({\n method: 'PUT',\n url: '/extract',\n data\n });\n};\nmodule.exports.move = async (from, to, names) => {\n return await sendRequest({\n method: 'PUT',\n url: '/move',\n data: {\n from,\n to,\n names\n },\n imgPosition\n });\n};\nmodule.exports.rename = async (from, to) => {\n return await sendRequest({\n method: 'PUT',\n url: '/rename',\n data: {\n from,\n to\n },\n imgPosition\n });\n};\nmodule.exports.Config = {\n read: async () => {\n return await sendRequest({\n method: 'GET',\n url: '/config',\n imgPosition,\n notLog: true\n });\n },\n write: async data => {\n return await sendRequest({\n method: 'PATCH',\n url: '/config',\n data,\n imgPosition\n });\n }\n};\nmodule.exports.Markdown = {\n read: async url => {\n return await sendRequest({\n method: 'GET',\n url: `/markdown${url}`,\n imgPosition,\n notLog: true\n });\n },\n render: async data => {\n return await sendRequest({\n method: 'PUT',\n url: '/markdown',\n data,\n imgPosition,\n notLog: true\n });\n }\n};\n\n//# sourceURL=file://cloudcmd/client/dom/io/index.js\n}");
150
+ eval("{\n\nconst {\n FS\n} = __webpack_require__(/*! ../../../common/cloudfunc */ \"./common/cloudfunc.js\");\nconst _sendRequest = __webpack_require__(/*! ./send-request */ \"./client/dom/io/send-request.js\");\nconst imgPosition = {\n top: true\n};\nmodule.exports[\"delete\"] = async (url, data) => {\n return await _sendRequest({\n method: 'DELETE',\n url: FS + url,\n data,\n imgPosition: {\n top: Boolean(data)\n }\n });\n};\nmodule.exports.patch = async (url, data) => {\n return await _sendRequest({\n method: 'PATCH',\n url: FS + url,\n data,\n imgPosition\n });\n};\nmodule.exports.write = async (url, data) => {\n return await _sendRequest({\n method: 'PUT',\n url: FS + url,\n data,\n imgPosition\n });\n};\nmodule.exports.createDirectory = async (url, overrides = {}) => {\n const {\n sendRequest = _sendRequest\n } = overrides;\n return await sendRequest({\n method: 'PUT',\n url: `${FS}${url}?dir`,\n imgPosition\n });\n};\nmodule.exports.read = async (url, dataType = 'text') => {\n const notLog = !url.includes('?');\n return await _sendRequest({\n method: 'GET',\n url: FS + url,\n notLog,\n dataType\n });\n};\nmodule.exports.copy = async (from, to, names) => {\n return await _sendRequest({\n method: 'PUT',\n url: '/copy',\n data: {\n from,\n to,\n names\n },\n imgPosition\n });\n};\nmodule.exports.pack = async data => {\n return await _sendRequest({\n method: 'PUT',\n url: '/pack',\n data\n });\n};\nmodule.exports.extract = async data => {\n return await _sendRequest({\n method: 'PUT',\n url: '/extract',\n data\n });\n};\nmodule.exports.move = async (from, to, names) => {\n return await _sendRequest({\n method: 'PUT',\n url: '/move',\n data: {\n from,\n to,\n names\n },\n imgPosition\n });\n};\nmodule.exports.rename = async (from, to) => {\n return await _sendRequest({\n method: 'PUT',\n url: '/rename',\n data: {\n from,\n to\n },\n imgPosition\n });\n};\nmodule.exports.Config = {\n read: async () => {\n return await _sendRequest({\n method: 'GET',\n url: '/config',\n imgPosition,\n notLog: true\n });\n },\n write: async data => {\n return await _sendRequest({\n method: 'PATCH',\n url: '/config',\n data,\n imgPosition\n });\n }\n};\nmodule.exports.Markdown = {\n read: async url => {\n return await _sendRequest({\n method: 'GET',\n url: `/markdown${url}`,\n imgPosition,\n notLog: true\n });\n },\n render: async data => {\n return await _sendRequest({\n method: 'PUT',\n url: '/markdown',\n data,\n imgPosition,\n notLog: true\n });\n }\n};\n\n//# sourceURL=file://cloudcmd/client/dom/io/index.js\n}");
151
151
 
152
152
  /***/ },
153
153
 
@@ -191,7 +191,7 @@ eval("{\n\nconst itype = __webpack_require__(/*! itype */ \"./node_modules/itype
191
191
  (module, __unused_webpack_exports, __webpack_require__) {
192
192
 
193
193
  "use strict";
194
- eval("{\n\n/* global CloudCmd */\nconst capitalize = __webpack_require__(/*! just-capitalize */ \"./node_modules/just-capitalize/index.cjs\");\nconst Dialog = __webpack_require__(/*! ../dialog */ \"./client/dom/dialog.js\");\nconst Storage = __webpack_require__(/*! ../storage */ \"./client/dom/storage.js\");\nconst RESTful = __webpack_require__(/*! ../rest */ \"./client/dom/rest.js\");\nconst {\n isCurrentFile,\n getCurrentName,\n getCurrentFile,\n getCurrentByName,\n getCurrentType,\n getCurrentDirPath,\n setCurrentName\n} = __webpack_require__(/*! ../current-file */ \"./client/dom/current-file.js\");\nmodule.exports = async current => {\n if (!isCurrentFile(current)) current = getCurrentFile();\n const from = getCurrentName(current);\n if (from === '..') return Dialog.alert.noFiles();\n const [cancel, to] = await Dialog.prompt('Rename', from);\n if (cancel) return;\n const nextFile = getCurrentByName(to);\n if (nextFile) {\n const type = getCurrentType(nextFile);\n const msg = `${capitalize(type)} \"${to}\" already exists. Proceed?`;\n const [cancel] = await Dialog.confirm(msg);\n if (cancel) return;\n }\n if (from === to) return;\n const dirPath = getCurrentDirPath();\n const fromFull = `${dirPath}${from}`;\n const toFull = `${dirPath}${to}`;\n const [e] = await RESTful.rename(fromFull, toFull);\n if (e) return;\n setCurrentName(to, current);\n Storage.remove(dirPath);\n CloudCmd.refresh();\n};\n\n//# sourceURL=file://cloudcmd/client/dom/operations/rename-current.js\n}");
194
+ eval("{\n\n/* global CloudCmd */\nconst capitalize = __webpack_require__(/*! just-capitalize */ \"./node_modules/just-capitalize/index.cjs\");\nconst _Dialog = __webpack_require__(/*! ../dialog */ \"./client/dom/dialog.js\");\nconst Storage = __webpack_require__(/*! ../storage */ \"./client/dom/storage.js\");\nconst RESTful = __webpack_require__(/*! ../rest */ \"./client/dom/rest.js\");\nconst _currentFile = __webpack_require__(/*! ../current-file */ \"./client/dom/current-file.js\");\nmodule.exports = async (current, overrides = {}) => {\n const {\n refresh = CloudCmd.refresh,\n Dialog = _Dialog,\n currentFile = _currentFile\n } = overrides;\n const {\n isCurrentFile,\n getCurrentName,\n getCurrentFile,\n getCurrentByName,\n getCurrentType,\n getCurrentDirPath,\n setCurrentName\n } = currentFile;\n if (!isCurrentFile(current)) current = getCurrentFile();\n const from = getCurrentName(current);\n if (from === '..') return Dialog.alert.noFiles();\n const [cancel, to] = await Dialog.prompt('Rename', from);\n if (cancel) return;\n const nextFile = getCurrentByName(to);\n if (nextFile) {\n const type = getCurrentType(nextFile);\n const msg = `${capitalize(type)} \"${to}\" already exists. Proceed?`;\n const [cancel] = await Dialog.confirm(msg);\n if (cancel) return;\n }\n if (from === to) return;\n const dirPath = getCurrentDirPath();\n const fromFull = `${dirPath}${from}`;\n const toFull = `${dirPath}${to}`;\n const [e] = await RESTful.rename(fromFull, toFull);\n if (e) return;\n setCurrentName(to, current);\n Storage.remove(dirPath);\n refresh();\n};\n\n//# sourceURL=file://cloudcmd/client/dom/operations/rename-current.js\n}");
195
195
 
196
196
  /***/ },
197
197
 
@@ -268,7 +268,7 @@ eval("{\n\nmodule.exports.createBinder = () => {\n let binded = false;\n retur
268
268
  (module, __unused_webpack_exports, __webpack_require__) {
269
269
 
270
270
  "use strict";
271
- eval("{\n\n/* global CloudCmd, DOM */\nconst clipboard = __webpack_require__(/*! @cloudcmd/clipboard */ \"./node_modules/@cloudcmd/clipboard/lib/clipboard.js\");\nconst {\n fullstore\n} = __webpack_require__(/*! fullstore */ \"./node_modules/fullstore/lib/fullstore.cjs\");\nconst Buffer = __webpack_require__(/*! ../dom/buffer */ \"./client/dom/buffer.js\");\nconst Events = __webpack_require__(/*! ../dom/events */ \"./client/dom/events/index.js\");\nconst KEY = __webpack_require__(/*! ./key */ \"./client/key/key.js\");\nconst vim = __webpack_require__(/*! ./vim */ \"./client/key/vim/index.js\");\nconst setCurrentByChar = __webpack_require__(/*! ./set-current-by-char */ \"./client/key/set-current-by-char.js\");\nconst {\n createBinder\n} = __webpack_require__(/*! ./binder */ \"./client/key/binder.js\");\nconst Info = DOM.CurrentInfo;\nconst Chars = fullstore();\nconst toggleVim = keyCode => {\n const {\n _config,\n config\n } = CloudCmd;\n if (keyCode === KEY.ESC) _config('vim', !config('vim'));\n};\nconst isUndefined = a => typeof a === 'undefined';\nChars([]);\nconst {\n assign\n} = Object;\nconst binder = createBinder();\nmodule.exports = assign(binder, KEY);\nmodule.exports.bind = () => {\n Events.addKey(listener, true);\n binder.setBind();\n};\nmodule.exports._listener = listener;\nfunction getChar(event) {\n /*\n * event.keyIdentifier deprecated in chrome v51\n * but event.key is absent in chrome <= v51\n */\n const {\n key,\n shift,\n keyCode,\n keyIdentifier\n } = event;\n const char = key || fromCharCode(keyIdentifier);\n const symbol = getSymbol(shift, keyCode);\n return [symbol, char];\n}\nasync function listener(event) {\n const {\n keyCode\n } = event;\n\n // strange chrome bug calles listener twice\n // in second time event misses a lot fields\n if (isUndefined(event.altKey)) return;\n const alt = event.altKey;\n const ctrl = event.ctrlKey;\n const meta = event.metaKey;\n const isBetween = keyCode >= KEY.ZERO && keyCode <= KEY.Z;\n const isNumpad = /Numpad/.test(event.code);\n const [symbol, char] = getChar(event);\n if (!binder.isBind()) return;\n toggleVim(keyCode);\n const isVim = CloudCmd.config('vim');\n if (!isVim && !isNumpad && !alt && !ctrl && !meta && (isBetween || symbol)) return setCurrentByChar(char, Chars);\n Chars([]);\n await switchKey(event);\n if (keyCode >= KEY.F1 && keyCode <= KEY.F10) return;\n if (isVim) vim(char, event);\n}\nfunction getSymbol(shift, keyCode) {\n switch (keyCode) {\n case KEY.DOT:\n return '.';\n case KEY.HYPHEN:\n return shift ? '_' : '-';\n case KEY.EQUAL:\n return shift ? '+' : '=';\n }\n return '';\n}\nfunction fromCharCode(keyIdentifier) {\n const code = keyIdentifier.substring(2);\n const hex = parseInt(code, 16);\n return String.fromCharCode(hex);\n}\nasync function switchKey(event) {\n let i;\n let isSelected;\n let prev;\n let next;\n let current = Info.element;\n let dataName;\n const {\n name,\n panel,\n path,\n isDir\n } = Info;\n const {\n Operation,\n changeDir,\n config\n } = CloudCmd;\n const {\n keyCode\n } = event;\n const alt = event.altKey;\n const shift = event.shiftKey;\n const ctrl = event.ctrlKey;\n const meta = event.metaKey;\n const ctrlMeta = ctrl || meta;\n if (current) {\n prev = current.previousSibling;\n next = current.nextSibling;\n }\n switch (keyCode) {\n case KEY.TAB:\n DOM.changePanel();\n event.preventDefault();\n break;\n case KEY.INSERT:\n DOM.toggleSelectedFile(current).setCurrentFile(next);\n break;\n case KEY.INSERT_MAC:\n DOM.toggleSelectedFile(current).setCurrentFile(next);\n break;\n case KEY.DELETE:\n if (shift) Operation.show('delete:silent');else Operation.show('delete');\n break;\n case KEY.ASTERISK:\n DOM.toggleAllSelectedFiles(current);\n break;\n case KEY.PLUS:\n DOM.expandSelection();\n event.preventDefault();\n break;\n case KEY.MINUS:\n DOM.shrinkSelection();\n event.preventDefault();\n break;\n case KEY.F1:\n CloudCmd.Help.show();\n event.preventDefault();\n break;\n case KEY.F2:\n CloudCmd.UserMenu.show();\n break;\n case KEY.F3:\n event.preventDefault();\n if (Info.isDir) await changeDir(path);else if (shift) CloudCmd.View.show(null, {\n raw: true\n });else if (ctrlMeta) CloudCmd.sortPanel('name');else CloudCmd.View.show();\n break;\n case KEY.F4:\n if (config('vim')) CloudCmd.EditFileVim.show();else CloudCmd.EditFile.show();\n event.preventDefault();\n break;\n case KEY.F5:\n if (ctrlMeta) CloudCmd.sortPanel('date');else if (alt) Operation.show('pack');else Operation.show('copy');\n event.preventDefault();\n break;\n case KEY.F6:\n if (ctrlMeta) CloudCmd.sortPanel('size');else if (shift) DOM.renameCurrent(current);else Operation.show('move');\n event.preventDefault();\n break;\n case KEY.F7:\n if (shift) DOM.promptNewFile();else DOM.promptNewDir();\n event.preventDefault();\n break;\n case KEY.F8:\n Operation.show('delete');\n event.preventDefault();\n break;\n case KEY.F9:\n if (alt) Operation.show('extract');else CloudCmd.Menu.show();\n event.preventDefault();\n break;\n case KEY.F10:\n CloudCmd.Config.show();\n event.preventDefault();\n break;\n case KEY.TRA:\n event.preventDefault();\n if (shift) return CloudCmd.Terminal.show();\n CloudCmd.Konsole.show();\n break;\n case KEY.BRACKET_CLOSE:\n CloudCmd.Konsole.show();\n event.preventDefault();\n break;\n case KEY.SPACE:\n event.preventDefault();\n if (!isDir || name === '..') isSelected = true;else isSelected = DOM.isSelected(current);\n if (!isSelected) await DOM.loadCurrentSize(current);\n DOM.toggleSelectedFile(current);\n break;\n case KEY.U:\n if (ctrlMeta) {\n DOM.swapPanels();\n event.preventDefault();\n }\n break;\n\n /* navigation on file table: *\n * in case of pressing button 'up', *\n * select previous row */\n case KEY.UP:\n if (shift) DOM.toggleSelectedFile(current);\n DOM.setCurrentFile(prev);\n event.preventDefault();\n break;\n\n /* in case of pressing button 'down', *\n * select next row */\n case KEY.DOWN:\n if (shift) DOM.toggleSelectedFile(current);\n DOM.setCurrentFile(next);\n event.preventDefault();\n break;\n case KEY.LEFT:\n if (!alt) return;\n event.preventDefault();\n dataName = Info.panel.getAttribute('data-name');\n if (dataName === 'js-right') DOM.duplicatePanel();\n break;\n case KEY.RIGHT:\n if (!alt) return;\n event.preventDefault();\n dataName = Info.panel.getAttribute('data-name');\n if (dataName === 'js-left') DOM.duplicatePanel();\n break;\n\n /* in case of pressing button 'Home', *\n * go to top element */\n case KEY.HOME:\n DOM.setCurrentFile(Info.first);\n event.preventDefault();\n break;\n\n /* in case of pressing button 'End', select last element */\n case KEY.END:\n DOM.setCurrentFile(Info.last);\n event.preventDefault();\n break;\n\n /* если нажали клавишу page down проматываем экран */\n case KEY.PAGE_DOWN:\n DOM.scrollByPages(panel, 1);\n for (i = 0; i < 30; i++) {\n if (!current.nextSibling) break;\n current = current.nextSibling;\n }\n DOM.setCurrentFile(current);\n event.preventDefault();\n break;\n\n /* если нажали клавишу page up проматываем экран */\n case KEY.PAGE_UP:\n DOM.scrollByPages(panel, -1);\n for (i = 0; i < 30; i++) {\n if (!current.previousSibling) break;\n current = current.previousSibling;\n }\n DOM.setCurrentFile(current);\n event.preventDefault();\n break;\n case KEY.ENTER:\n if (Info.isDir) await changeDir(path);else CloudCmd.View.show();\n break;\n case KEY.BACKSPACE:\n CloudCmd.goToParentDir();\n event.preventDefault();\n break;\n case KEY.BACKSLASH:\n if (ctrlMeta) await changeDir('/');\n break;\n case KEY.A:\n if (ctrlMeta) {\n DOM.selectAllFiles();\n event.preventDefault();\n }\n break;\n case KEY.G:\n if (alt) {\n DOM.goToDirectory();\n event.preventDefault();\n }\n break;\n case KEY.M:\n if (ctrlMeta) {\n if (config('vim')) CloudCmd.EditNamesVim.show();else CloudCmd.EditNames.show();\n event.preventDefault();\n }\n break;\n case KEY.P:\n if (!ctrlMeta) return;\n event.preventDefault();\n clipboard.writeText(Info.dirPath).catch(CloudCmd.log);\n break;\n\n /**\n * обновляем страницу,\n * загружаем содержимое каталога\n * при этом данные берём всегда с\n * сервера, а не из кэша\n * (обновляем кэш)\n */\n case KEY.R:\n if (ctrlMeta) {\n CloudCmd.log('reloading page...\\n');\n CloudCmd.refresh();\n event.preventDefault();\n }\n break;\n case KEY.C:\n if (ctrlMeta) Buffer.copy();\n break;\n case KEY.X:\n if (ctrlMeta) Buffer.cut();\n break;\n case KEY.V:\n if (ctrlMeta) Buffer.paste();\n break;\n case KEY.Z:\n if (ctrlMeta) Buffer.clear();\n break;\n case KEY.COLON:\n CloudCmd.CommandLine.show();\n event.preventDefault();\n break;\n\n /* чистим хранилище */\n case KEY.D:\n if (ctrlMeta) {\n CloudCmd.log('clearing storage...');\n await DOM.Storage.clear();\n CloudCmd.log('storage cleared');\n event.preventDefault();\n }\n break;\n case KEY.DOT:\n if (meta && shift) {\n const showDotFiles = !CloudCmd.config('showDotFiles');\n CloudCmd._config('showDotFiles', showDotFiles);\n CloudCmd.refresh();\n await DOM.RESTful.Config.write({\n showDotFiles\n });\n }\n break;\n }\n}\n\n//# sourceURL=file://cloudcmd/client/key/index.js\n}");
271
+ eval("{\n\n/* global CloudCmd, DOM */\nconst clipboard = __webpack_require__(/*! @cloudcmd/clipboard */ \"./node_modules/@cloudcmd/clipboard/lib/clipboard.js\");\nconst {\n fullstore\n} = __webpack_require__(/*! fullstore */ \"./node_modules/fullstore/lib/fullstore.cjs\");\nconst Buffer = __webpack_require__(/*! ../dom/buffer */ \"./client/dom/buffer.js\");\nconst Events = __webpack_require__(/*! ../dom/events */ \"./client/dom/events/index.js\");\nconst KEY = __webpack_require__(/*! ./key */ \"./client/key/key.js\");\nconst vim = __webpack_require__(/*! ./vim */ \"./client/key/vim/index.js\");\nconst setCurrentByChar = __webpack_require__(/*! ./set-current-by-char */ \"./client/key/set-current-by-char.js\");\nconst {\n createBinder\n} = __webpack_require__(/*! ./binder */ \"./client/key/binder.js\");\nconst Info = DOM.CurrentInfo;\nconst Chars = fullstore();\nconst toggleVim = (keyCode, overrides = {}) => {\n const {\n _config,\n config\n } = overrides;\n if (keyCode === KEY.ESC) _config('vim', !config('vim'));\n};\nconst isUndefined = a => typeof a === 'undefined';\nChars([]);\nconst {\n assign\n} = Object;\nconst binder = createBinder();\nmodule.exports = assign(binder, KEY);\nmodule.exports.bind = () => {\n Events.addKey(listener, true);\n binder.setBind();\n};\nmodule.exports._listener = listener;\nfunction getChar(event) {\n /*\n * event.keyIdentifier deprecated in chrome v51\n * but event.key is absent in chrome <= v51\n */\n const {\n key,\n shift,\n keyCode,\n keyIdentifier\n } = event;\n const char = key || fromCharCode(keyIdentifier);\n const symbol = getSymbol(shift, keyCode);\n return [symbol, char];\n}\nasync function listener(event, overrides = {}) {\n const {\n config = CloudCmd.config,\n _config = CloudCmd._config,\n switchKey = _switchKey\n } = overrides;\n const {\n keyCode\n } = event;\n\n // strange chrome bug calles listener twice\n // in second time event misses a lot fields\n if (isUndefined(event.altKey)) return;\n const alt = event.altKey;\n const ctrl = event.ctrlKey;\n const meta = event.metaKey;\n const isBetween = keyCode >= KEY.ZERO && keyCode <= KEY.Z;\n const isNumpad = /Numpad/.test(event.code);\n const [symbol, char] = getChar(event);\n if (!binder.isBind()) return;\n toggleVim(keyCode, {\n config,\n _config\n });\n const isVim = config('vim');\n if (!isVim && !isNumpad && !alt && !ctrl && !meta && (isBetween || symbol)) return setCurrentByChar(char, Chars);\n Chars([]);\n await switchKey(event);\n if (keyCode >= KEY.F1 && keyCode <= KEY.F10) return;\n if (isVim) vim(char, event);\n}\nfunction getSymbol(shift, keyCode) {\n switch (keyCode) {\n case KEY.DOT:\n return '.';\n case KEY.HYPHEN:\n return shift ? '_' : '-';\n case KEY.EQUAL:\n return shift ? '+' : '=';\n }\n return '';\n}\nfunction fromCharCode(keyIdentifier) {\n const code = keyIdentifier.substring(2);\n const hex = parseInt(code, 16);\n return String.fromCharCode(hex);\n}\nasync function _switchKey(event) {\n let i;\n let isSelected;\n let prev;\n let next;\n let current = Info.element;\n let dataName;\n const {\n name,\n panel,\n path,\n isDir\n } = Info;\n const {\n Operation,\n changeDir,\n config\n } = CloudCmd;\n const {\n keyCode\n } = event;\n const alt = event.altKey;\n const shift = event.shiftKey;\n const ctrl = event.ctrlKey;\n const meta = event.metaKey;\n const ctrlMeta = ctrl || meta;\n if (current) {\n prev = current.previousSibling;\n next = current.nextSibling;\n }\n switch (keyCode) {\n case KEY.TAB:\n DOM.changePanel();\n event.preventDefault();\n break;\n case KEY.INSERT:\n DOM.toggleSelectedFile(current).setCurrentFile(next);\n break;\n case KEY.INSERT_MAC:\n DOM.toggleSelectedFile(current).setCurrentFile(next);\n break;\n case KEY.DELETE:\n if (shift) Operation.show('delete:silent');else Operation.show('delete');\n break;\n case KEY.ASTERISK:\n DOM.toggleAllSelectedFiles(current);\n break;\n case KEY.PLUS:\n DOM.expandSelection();\n event.preventDefault();\n break;\n case KEY.MINUS:\n DOM.shrinkSelection();\n event.preventDefault();\n break;\n case KEY.F1:\n CloudCmd.Help.show();\n event.preventDefault();\n break;\n case KEY.F2:\n CloudCmd.UserMenu.show();\n break;\n case KEY.F3:\n event.preventDefault();\n if (Info.isDir) await changeDir(path);else if (shift) CloudCmd.View.show(null, {\n raw: true\n });else if (ctrlMeta) CloudCmd.sortPanel('name');else CloudCmd.View.show();\n break;\n case KEY.F4:\n if (config('vim')) CloudCmd.EditFileVim.show();else CloudCmd.EditFile.show();\n event.preventDefault();\n break;\n case KEY.F5:\n if (ctrlMeta) CloudCmd.sortPanel('date');else if (alt) Operation.show('pack');else Operation.show('copy');\n event.preventDefault();\n break;\n case KEY.F6:\n if (ctrlMeta) CloudCmd.sortPanel('size');else if (shift) DOM.renameCurrent(current);else Operation.show('move');\n event.preventDefault();\n break;\n case KEY.F7:\n if (shift) DOM.promptNewFile();else DOM.promptNewDir();\n event.preventDefault();\n break;\n case KEY.F8:\n Operation.show('delete');\n event.preventDefault();\n break;\n case KEY.F9:\n if (alt) Operation.show('extract');else CloudCmd.Menu.show();\n event.preventDefault();\n break;\n case KEY.F10:\n CloudCmd.Config.show();\n event.preventDefault();\n break;\n case KEY.TRA:\n event.preventDefault();\n if (shift) return CloudCmd.Terminal.show();\n CloudCmd.Konsole.show();\n break;\n case KEY.BRACKET_CLOSE:\n CloudCmd.Konsole.show();\n event.preventDefault();\n break;\n case KEY.SPACE:\n event.preventDefault();\n if (!isDir || name === '..') isSelected = true;else isSelected = DOM.isSelected(current);\n if (!isSelected) await DOM.loadCurrentSize(current);\n DOM.toggleSelectedFile(current);\n break;\n case KEY.U:\n if (ctrlMeta) {\n DOM.swapPanels();\n event.preventDefault();\n }\n break;\n\n /* navigation on file table: *\n * in case of pressing button 'up', *\n * select previous row */\n case KEY.UP:\n if (shift) DOM.toggleSelectedFile(current);\n DOM.setCurrentFile(prev);\n event.preventDefault();\n break;\n\n /* in case of pressing button 'down', *\n * select next row */\n case KEY.DOWN:\n if (shift) DOM.toggleSelectedFile(current);\n DOM.setCurrentFile(next);\n event.preventDefault();\n break;\n case KEY.LEFT:\n if (!alt) return;\n event.preventDefault();\n dataName = Info.panel.getAttribute('data-name');\n if (dataName === 'js-right') DOM.duplicatePanel();\n break;\n case KEY.RIGHT:\n if (!alt) return;\n event.preventDefault();\n dataName = Info.panel.getAttribute('data-name');\n if (dataName === 'js-left') DOM.duplicatePanel();\n break;\n\n /* in case of pressing button 'Home', *\n * go to top element */\n case KEY.HOME:\n DOM.setCurrentFile(Info.first);\n event.preventDefault();\n break;\n\n /* in case of pressing button 'End', select last element */\n case KEY.END:\n DOM.setCurrentFile(Info.last);\n event.preventDefault();\n break;\n\n /* если нажали клавишу page down проматываем экран */\n case KEY.PAGE_DOWN:\n DOM.scrollByPages(panel, 1);\n for (i = 0; i < 30; i++) {\n if (!current.nextSibling) break;\n current = current.nextSibling;\n }\n DOM.setCurrentFile(current);\n event.preventDefault();\n break;\n\n /* если нажали клавишу page up проматываем экран */\n case KEY.PAGE_UP:\n DOM.scrollByPages(panel, -1);\n for (i = 0; i < 30; i++) {\n if (!current.previousSibling) break;\n current = current.previousSibling;\n }\n DOM.setCurrentFile(current);\n event.preventDefault();\n break;\n case KEY.ENTER:\n if (Info.isDir) await changeDir(path);else CloudCmd.View.show();\n break;\n case KEY.BACKSPACE:\n CloudCmd.goToParentDir();\n event.preventDefault();\n break;\n case KEY.BACKSLASH:\n if (ctrlMeta) await changeDir('/');\n break;\n case KEY.A:\n if (ctrlMeta) {\n DOM.selectAllFiles();\n event.preventDefault();\n }\n break;\n case KEY.G:\n if (alt) {\n DOM.goToDirectory();\n event.preventDefault();\n }\n break;\n case KEY.M:\n if (ctrlMeta) {\n if (config('vim')) CloudCmd.EditNamesVim.show();else CloudCmd.EditNames.show();\n event.preventDefault();\n }\n break;\n case KEY.P:\n if (!ctrlMeta) return;\n event.preventDefault();\n clipboard.writeText(Info.dirPath).catch(CloudCmd.log);\n break;\n\n /**\n * обновляем страницу,\n * загружаем содержимое каталога\n * при этом данные берём всегда с\n * сервера, а не из кэша\n * (обновляем кэш)\n */\n case KEY.R:\n if (ctrlMeta) {\n CloudCmd.log('reloading page...\\n');\n CloudCmd.refresh();\n event.preventDefault();\n }\n break;\n case KEY.C:\n if (ctrlMeta) Buffer.copy();\n break;\n case KEY.X:\n if (ctrlMeta) Buffer.cut();\n break;\n case KEY.V:\n if (ctrlMeta) Buffer.paste();\n break;\n case KEY.Z:\n if (ctrlMeta) Buffer.clear();\n break;\n case KEY.COLON:\n CloudCmd.CommandLine.show();\n event.preventDefault();\n break;\n\n /* чистим хранилище */\n case KEY.D:\n if (ctrlMeta) {\n CloudCmd.log('clearing storage...');\n await DOM.Storage.clear();\n CloudCmd.log('storage cleared');\n event.preventDefault();\n }\n break;\n case KEY.DOT:\n if (meta && shift) {\n const showDotFiles = !CloudCmd.config('showDotFiles');\n CloudCmd._config('showDotFiles', showDotFiles);\n CloudCmd.refresh();\n await DOM.RESTful.Config.write({\n showDotFiles\n });\n }\n break;\n }\n}\n\n//# sourceURL=file://cloudcmd/client/key/index.js\n}");
272
272
 
273
273
  /***/ },
274
274
 
@@ -312,7 +312,7 @@ eval("{\n\nconst {\n fullstore\n} = __webpack_require__(/*! fullstore */ \"./no
312
312
  (module, __unused_webpack_exports, __webpack_require__) {
313
313
 
314
314
  "use strict";
315
- eval("{\n\n/* global CloudCmd */\n/* global DOM */\nconst vim = __webpack_require__(/*! ./vim */ \"./client/key/vim/vim.js\");\nconst finder = __webpack_require__(/*! ./find */ \"./client/key/vim/find.js\");\nconst {\n setCurrent,\n selectFileNotParent\n} = __webpack_require__(/*! ./set-current */ \"./client/key/vim/set-current.js\");\nconst {\n Dialog\n} = DOM;\nconst DEPS = {\n ...DOM,\n ...CloudCmd\n};\nmodule.exports = async (key, event, deps = DEPS) => {\n const operations = getOperations(event, deps);\n await vim(key, operations);\n};\nconst getOperations = (event, deps) => {\n const {\n Info = DOM.CurrentInfo,\n Operation,\n unselectFiles,\n setCurrentFile,\n setCurrentByName,\n getCurrentName,\n toggleSelectedFile,\n Buffer = {}\n } = deps;\n return {\n escape: unselectFiles,\n remove: () => {\n Operation.show('delete');\n },\n makeDirectory: () => {\n event.stopImmediatePropagation();\n event.preventDefault();\n DOM.promptNewDir();\n },\n makeFile: () => {\n event.stopImmediatePropagation();\n event.preventDefault();\n DOM.promptNewFile();\n },\n terminal: () => {\n CloudCmd.Terminal.show();\n },\n edit: () => {\n CloudCmd.EditFileVim.show();\n },\n copy: () => {\n Buffer.copy();\n unselectFiles();\n },\n select: () => {\n const current = Info.element;\n toggleSelectedFile(current);\n },\n paste: Buffer.paste,\n moveNext: ({\n count,\n isVisual,\n isDelete\n }) => {\n setCurrent('next', {\n count,\n isVisual,\n isDelete\n }, {\n Info,\n setCurrentFile,\n unselectFiles,\n Operation\n });\n },\n movePrevious: ({\n count,\n isVisual,\n isDelete\n }) => {\n setCurrent('previous', {\n count,\n isVisual,\n isDelete\n }, {\n Info,\n setCurrentFile,\n unselectFiles,\n Operation\n });\n },\n find: async () => {\n event.preventDefault();\n const [, value] = await Dialog.prompt('Find', '');\n if (!value) return;\n const names = Info.files.map(getCurrentName);\n const [result] = finder.find(value, names);\n setCurrentByName(result);\n },\n findNext: () => {\n const name = finder.findNext();\n setCurrentByName(name);\n },\n findPrevious: () => {\n const name = finder.findPrevious();\n setCurrentByName(name);\n }\n };\n};\nmodule.exports.selectFile = selectFileNotParent;\n\n//# sourceURL=file://cloudcmd/client/key/vim/index.js\n}");
315
+ eval("{\n\n/* global CloudCmd */\n/* global DOM */\nconst vim = __webpack_require__(/*! ./vim */ \"./client/key/vim/vim.js\");\nconst finder = __webpack_require__(/*! ./find */ \"./client/key/vim/find.js\");\nconst {\n setCurrent,\n selectFileNotParent\n} = __webpack_require__(/*! ./set-current */ \"./client/key/vim/set-current.js\");\nconst {\n DOM = {},\n CloudCmd = {}\n} = globalThis;\nconst {\n Dialog\n} = DOM;\nconst DEPS = {\n ...DOM,\n ...CloudCmd\n};\nmodule.exports = async (key, event, deps = DEPS) => {\n const operations = getOperations(event, deps);\n await vim(key, operations);\n};\nconst getOperations = (event, deps) => {\n const {\n Info = DOM.CurrentInfo,\n Operation,\n unselectFiles,\n setCurrentFile,\n setCurrentByName,\n getCurrentName,\n toggleSelectedFile,\n Buffer = {}\n } = deps;\n return {\n escape: unselectFiles,\n remove: () => {\n Operation.show('delete');\n },\n makeDirectory: () => {\n event.stopImmediatePropagation();\n event.preventDefault();\n DOM.promptNewDir();\n },\n makeFile: () => {\n event.stopImmediatePropagation();\n event.preventDefault();\n DOM.promptNewFile();\n },\n terminal: () => {\n CloudCmd.Terminal.show();\n },\n edit: () => {\n CloudCmd.EditFileVim.show();\n },\n copy: () => {\n Buffer.copy();\n unselectFiles();\n },\n select: () => {\n const current = Info.element;\n toggleSelectedFile(current);\n },\n paste: Buffer.paste,\n moveNext: ({\n count,\n isVisual,\n isDelete\n }) => {\n setCurrent('next', {\n count,\n isVisual,\n isDelete\n }, {\n Info,\n setCurrentFile,\n unselectFiles,\n Operation\n });\n },\n movePrevious: ({\n count,\n isVisual,\n isDelete\n }) => {\n setCurrent('previous', {\n count,\n isVisual,\n isDelete\n }, {\n Info,\n setCurrentFile,\n unselectFiles,\n Operation\n });\n },\n find: async () => {\n event.preventDefault();\n const [, value] = await Dialog.prompt('Find', '');\n if (!value) return;\n const names = Info.files.map(getCurrentName);\n const [result] = finder.find(value, names);\n setCurrentByName(result);\n },\n findNext: () => {\n const name = finder.findNext();\n setCurrentByName(name);\n },\n findPrevious: () => {\n const name = finder.findPrevious();\n setCurrentByName(name);\n }\n };\n};\nmodule.exports.selectFile = selectFileNotParent;\n\n//# sourceURL=file://cloudcmd/client/key/vim/index.js\n}");
316
316
 
317
317
  /***/ },
318
318
 
@@ -477,7 +477,7 @@ eval("{\n\n/* global CloudCmd */\nCloudCmd.EditNamesVim = exports;\nconst Events
477
477
  (module, exports, __webpack_require__) {
478
478
 
479
479
  "use strict";
480
- eval("{\n\n/* global CloudCmd, DOM */\nCloudCmd.EditNames = exports;\nconst currify = __webpack_require__(/*! currify */ \"./node_modules/currify/lib/currify.js\");\nconst exec = __webpack_require__(/*! execon */ \"./node_modules/execon/lib/exec.js\");\nconst supermenu = __webpack_require__(/*! supermenu */ \"./node_modules/supermenu/lib/supermenu.js\");\nconst multiRename = __webpack_require__(/*! multi-rename */ \"./node_modules/multi-rename/lib/multi-rename.js\");\nconst reject = Promise.reject.bind(Promise);\nconst Info = DOM.CurrentInfo;\nconst {\n Dialog\n} = DOM;\nconst refresh = currify(_refresh);\nconst rename = currify(_rename);\nlet Menu;\nconst ConfigView = {\n beforeClose: async () => {\n exec.ifExist(Menu, 'hide');\n DOM.Events.remove('keydown', keyListener);\n await isChanged();\n }\n};\nmodule.exports.init = async () => {\n await CloudCmd.Edit();\n setListeners();\n};\nmodule.exports.show = options => {\n const names = getActiveNames().join('\\n');\n const config = {\n ...ConfigView,\n ...options\n };\n if (Info.name === '..' && names.length === 1) return Dialog.alert.noFiles();\n DOM.Events.addKey(keyListener);\n CloudCmd.Edit.getEditor().setValueFirst('edit-names', names).setMode().setOption('keyMap', 'default').disableKey();\n CloudCmd.Edit.show(config);\n return CloudCmd.Edit;\n};\nasync function keyListener(event) {\n const ctrl = event.ctrlKey;\n const meta = event.metaKey;\n const ctrlMeta = ctrl || meta;\n const {\n Key\n } = CloudCmd;\n if (ctrlMeta && event.keyCode === Key.S) {\n hide();\n } else if (ctrlMeta && event.keyCode === Key.P) {\n const [, pattern] = await Dialog.prompt('Apply pattern:', '[n][e]');\n pattern && applyPattern(pattern);\n }\n}\nfunction applyPattern(pattern) {\n const newNames = multiRename(pattern, getActiveNames());\n const editor = CloudCmd.Edit.getEditor();\n editor.setValue(newNames.join('\\n'));\n}\nfunction getActiveNames() {\n return DOM.getFilenames(DOM.getActiveFiles());\n}\nmodule.exports.hide = hide;\nfunction hide() {\n CloudCmd.Edit.hide();\n}\nfunction setListeners() {\n const element = CloudCmd.Edit.getElement();\n DOM.Events.addOnce('contextmenu', element, setMenu);\n}\nfunction applyNames() {\n const dir = Info.dirPath;\n const from = getActiveNames();\n const nameIndex = from.indexOf(Info.name);\n const editor = CloudCmd.Edit.getEditor();\n const to = editor.getValue().split('\\n');\n const root = CloudCmd.config('root');\n Promise.resolve(root).then(rename(dir, from, to)).then(refresh(to, nameIndex)).catch(alert);\n}\nfunction _refresh(to, nameIndex, res) {\n if (res.status === 404) return res.text().then(reject);\n const currentName = to[nameIndex];\n CloudCmd.refresh({\n currentName\n });\n}\nfunction getDir(root, dir) {\n if (root === '/') return dir;\n return root + dir;\n}\nfunction _rename(path, from, to, root) {\n const dir = getDir(root, path);\n const {\n prefix\n } = CloudCmd;\n return fetch(`${prefix}/rename`, {\n method: 'put',\n credentials: 'include',\n body: JSON.stringify({\n from,\n to,\n dir\n })\n });\n}\nfunction setMenu(event) {\n const position = {\n x: event.clientX,\n y: event.clientY\n };\n event.preventDefault();\n if (Menu) return;\n const editor = CloudCmd.Edit.getEditor();\n const options = {\n beforeShow: params => {\n params.x -= 18;\n params.y -= 27;\n },\n afterClick: () => {\n editor.focus();\n }\n };\n const menuData = {\n 'Save Ctrl+S': () => {\n applyNames();\n hide();\n },\n 'Go To Line Ctrl+G': () => {\n editor.goToLine();\n },\n 'Cut Ctrl+X': () => {\n editor.cutToClipboard();\n },\n 'Copy Ctrl+C': () => {\n editor.copyToClipboard();\n },\n 'Paste Ctrl+V': () => {\n editor.pasteFromClipboard();\n },\n 'Delete Del': () => {\n editor.remove('right');\n },\n 'Select All Ctrl+A': () => {\n editor.selectAll();\n },\n 'Close Esc': hide\n };\n const element = CloudCmd.Edit.getElement();\n Menu = supermenu(element, options, menuData);\n Menu.addContextMenuListener();\n Menu.show(position.x, position.y);\n}\nmodule.exports.isChanged = isChanged;\nasync function isChanged() {\n const editor = CloudCmd.Edit.getEditor();\n const msg = 'Apply new names?';\n if (!editor.isChanged()) return;\n const [, names] = await Dialog.confirm(msg);\n names && applyNames();\n}\n\n//# sourceURL=file://cloudcmd/client/modules/edit-names.js\n}");
480
+ eval("{\n\nconst {\n tryToCatch\n} = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.cjs\");\n\n/* global CloudCmd, DOM */\nCloudCmd.EditNames = exports;\nconst exec = __webpack_require__(/*! execon */ \"./node_modules/execon/lib/exec.js\");\nconst supermenu = __webpack_require__(/*! supermenu */ \"./node_modules/supermenu/lib/supermenu.js\");\nconst multiRename = __webpack_require__(/*! multi-rename */ \"./node_modules/multi-rename/lib/multi-rename.js\");\nconst Info = DOM.CurrentInfo;\nconst {\n Dialog\n} = DOM;\nlet Menu;\nconst ConfigView = {\n beforeClose: async () => {\n exec.ifExist(Menu, 'hide');\n DOM.Events.remove('keydown', keyListener);\n await isChanged();\n }\n};\nmodule.exports.init = async () => {\n await CloudCmd.Edit();\n setListeners();\n};\nmodule.exports.show = options => {\n const names = getActiveNames().join('\\n');\n const config = {\n ...ConfigView,\n ...options\n };\n if (Info.name === '..' && names.length === 1) return Dialog.alert.noFiles();\n DOM.Events.addKey(keyListener);\n CloudCmd.Edit.getEditor().setValueFirst('edit-names', names).setMode().setOption('keyMap', 'default').disableKey();\n CloudCmd.Edit.show(config);\n return CloudCmd.Edit;\n};\nasync function keyListener(event) {\n const ctrl = event.ctrlKey;\n const meta = event.metaKey;\n const ctrlMeta = ctrl || meta;\n const {\n Key\n } = CloudCmd;\n if (ctrlMeta && event.keyCode === Key.S) {\n hide();\n } else if (ctrlMeta && event.keyCode === Key.P) {\n const [, pattern] = await Dialog.prompt('Apply pattern:', '[n][e]');\n pattern && applyPattern(pattern);\n }\n}\nfunction applyPattern(pattern) {\n const newNames = multiRename(pattern, getActiveNames());\n const editor = CloudCmd.Edit.getEditor();\n editor.setValue(newNames.join('\\n'));\n}\nfunction getActiveNames() {\n return DOM.getFilenames(DOM.getActiveFiles());\n}\nmodule.exports.hide = hide;\nfunction hide() {\n CloudCmd.Edit.hide();\n}\nfunction setListeners() {\n const element = CloudCmd.Edit.getElement();\n DOM.Events.addOnce('contextmenu', element, setMenu);\n}\nasync function applyNames() {\n const dir = Info.dirPath;\n const from = getActiveNames();\n const nameIndex = from.indexOf(Info.name);\n const editor = CloudCmd.Edit.getEditor();\n const to = editor.getValue().split('\\n');\n const root = CloudCmd.config('root');\n const response = rename(dir, from, to, root);\n const [error] = await tryToCatch(refresh, to, nameIndex, response);\n if (error) alert(error);\n}\nfunction refresh(to, nameIndex, res) {\n if (res.status === 404) {\n const error = res.text();\n throw error;\n }\n const currentName = to[nameIndex];\n CloudCmd.refresh({\n currentName\n });\n}\nfunction getDir(root, dir) {\n if (root === '/') return dir;\n return root + dir;\n}\nfunction rename(path, from, to, root) {\n const dir = getDir(root, path);\n const {\n prefix\n } = CloudCmd;\n return fetch(`${prefix}/rename`, {\n method: 'put',\n credentials: 'include',\n body: JSON.stringify({\n from,\n to,\n dir\n })\n });\n}\nfunction setMenu(event) {\n const position = {\n x: event.clientX,\n y: event.clientY\n };\n event.preventDefault();\n if (Menu) return;\n const editor = CloudCmd.Edit.getEditor();\n const options = {\n beforeShow: params => {\n params.x -= 18;\n params.y -= 27;\n },\n afterClick: () => {\n editor.focus();\n }\n };\n const menuData = {\n 'Save Ctrl+S': async () => {\n await applyNames();\n hide();\n },\n 'Go To Line Ctrl+G': () => {\n editor.goToLine();\n },\n 'Cut Ctrl+X': () => {\n editor.cutToClipboard();\n },\n 'Copy Ctrl+C': () => {\n editor.copyToClipboard();\n },\n 'Paste Ctrl+V': () => {\n editor.pasteFromClipboard();\n },\n 'Delete Del': () => {\n editor.remove('right');\n },\n 'Select All Ctrl+A': () => {\n editor.selectAll();\n },\n 'Close Esc': hide\n };\n const element = CloudCmd.Edit.getElement();\n Menu = supermenu(element, options, menuData);\n Menu.addContextMenuListener();\n Menu.show(position.x, position.y);\n}\nmodule.exports.isChanged = isChanged;\nasync function isChanged() {\n const editor = CloudCmd.Edit.getEditor();\n const msg = 'Apply new names?';\n if (!editor.isChanged()) return;\n const [cancel] = await Dialog.confirm(msg);\n !cancel && (await applyNames());\n}\n\n//# sourceURL=file://cloudcmd/client/modules/edit-names.js\n}");
481
481
 
482
482
  /***/ },
483
483
 
@@ -606,10 +606,10 @@ eval("{\n\n/* global DOM */\nconst forEachKey = __webpack_require__(/*! for-each
606
606
  /*!************************************!*\
607
607
  !*** ./client/modules/polyfill.js ***!
608
608
  \************************************/
609
- (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
609
+ (module, __unused_webpack_exports, __webpack_require__) {
610
610
 
611
611
  "use strict";
612
- eval("{\n\n/* global DOM */\n__webpack_require__(/*! domtokenlist-shim */ \"./node_modules/domtokenlist-shim/dist/domtokenlist.js\");\nconst scrollIntoViewIfNeeded = __webpack_require__(/*! scroll-into-view-if-needed */ \"./node_modules/scroll-into-view-if-needed/dist/index.cjs\");\nDOM.scrollIntoViewIfNeeded = el => scrollIntoViewIfNeeded(el, {\n block: 'nearest'\n});\n\n//# sourceURL=file://cloudcmd/client/modules/polyfill.js\n}");
612
+ eval("{\n\n__webpack_require__(/*! domtokenlist-shim */ \"./node_modules/domtokenlist-shim/dist/domtokenlist.js\");\nconst _scrollIntoViewIfNeeded = __webpack_require__(/*! scroll-into-view-if-needed */ \"./node_modules/scroll-into-view-if-needed/dist/index.cjs\");\nglobalThis.DOM = globalThis.DOM || {};\nconst scrollIntoViewIfNeeded = (el, overrides = {}) => {\n const {\n scroll = _scrollIntoViewIfNeeded\n } = overrides;\n return scroll(el, {\n block: 'nearest'\n });\n};\nglobalThis.DOM.scrollIntoViewIfNeeded = scrollIntoViewIfNeeded;\nmodule.exports.scrollIntoViewIfNeeded = scrollIntoViewIfNeeded;\n\n//# sourceURL=file://cloudcmd/client/modules/polyfill.js\n}");
613
613
 
614
614
  /***/ },
615
615
 
@@ -719,7 +719,7 @@ eval("{\n\nmodule.exports.runSelected = async (selectedItems, items, runUserMenu
719
719
  (module, __unused_webpack_exports, __webpack_require__) {
720
720
 
721
721
  "use strict";
722
- eval("{/* global CloudCmd, DOM */\n\n\n\n__webpack_require__(/*! ../../../css/view.css */ \"./css/view.css\");\nconst rendy = __webpack_require__(/*! rendy */ \"./node_modules/rendy/lib/rendy.js\");\nconst currify = __webpack_require__(/*! currify */ \"./node_modules/currify/lib/currify.js\");\nconst wraptile = __webpack_require__(/*! wraptile */ \"./node_modules/wraptile/lib/wraptile.js\");\nconst {\n tryToCatch\n} = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.cjs\");\nconst load = __webpack_require__(/*! load.js */ \"./node_modules/load.js/lib/load.js\");\nconst modal = __webpack_require__(/*! @cloudcmd/modal */ \"./node_modules/@cloudcmd/modal/lib/modal.js\");\nconst createElement = __webpack_require__(/*! @cloudcmd/create-element */ \"./node_modules/@cloudcmd/create-element/lib/create-element.js\");\nconst {\n time\n} = __webpack_require__(/*! ../../../common/util */ \"./common/util.js\");\nconst {\n FS\n} = __webpack_require__(/*! ../../../common/cloudfunc */ \"./common/cloudfunc.js\");\nconst {\n isImage,\n isAudio,\n getType\n} = __webpack_require__(/*! ./types */ \"./client/modules/view/types.js\");\nconst Files = __webpack_require__(/*! ../../dom/files */ \"./client/dom/files.js\");\nconst Events = __webpack_require__(/*! ../../dom/events */ \"./client/dom/events/index.js\");\nconst Images = __webpack_require__(/*! ../../dom/images */ \"./client/dom/images.js\");\nconst {\n encode\n} = __webpack_require__(/*! ../../../common/entity */ \"./common/entity.js\");\nconst isString = a => typeof a === 'string';\nconst {\n assign\n} = Object;\nconst {\n isArray\n} = Array;\nconst lifo = currify((fn, el, cb, name) => fn(name, el, cb));\nconst series = wraptile((...a) => {\n for (const f of a) f();\n});\nconst isFn = a => typeof a === 'function';\nconst noop = () => {};\nconst addEvent = lifo(Events.add);\nconst loadCSS = load.css;\nmodule.exports.show = show;\nmodule.exports.hide = hide;\nlet Loading = false;\nconst Name = 'View';\nCloudCmd[Name] = module.exports;\nconst Info = DOM.CurrentInfo;\nconst {\n Key\n} = CloudCmd;\nconst basename = a => a.split('/').pop();\nlet El;\nlet TemplateAudio;\nlet Overlay;\nconst Config = {\n beforeShow: () => {\n Images.hide();\n Key.unsetBind();\n },\n beforeClose: () => {\n Events.rmKey(listener);\n Key.setBind();\n },\n afterShow: () => {\n El.focus();\n },\n onOverlayClick,\n afterClose: noop,\n autoSize: false,\n helpers: {\n title: {}\n }\n};\nmodule.exports._Config = Config;\nmodule.exports.init = async () => {\n await loadAll();\n const events = ['click', 'contextmenu'];\n events.forEach(addEvent(Overlay, onOverlayClick));\n};\nasync function show(data, options = {}) {\n const prefixURL = CloudCmd.prefixURL + FS;\n if (Loading) return;\n if (!options || options.bindKeys !== false) Events.addKey(listener);\n El = createElement('div', {\n className: 'view',\n notAppend: true\n });\n El.tabIndex = 0;\n if (data) {\n if (isArray(data)) El.append(...data);else El.append(data);\n modal.open(El, initConfig(options));\n return;\n }\n Images.show.load();\n const path = prefixURL + Info.path;\n const type = options.raw ? '' : await getType(path);\n switch (type) {\n default:\n return await viewFile();\n case 'markdown':\n return await CloudCmd.Markdown.show(Info.path);\n case 'html':\n return viewHtml(path);\n case 'image':\n return viewImage(Info.path, prefixURL);\n case 'media':\n return await viewMedia(path);\n case 'pdf':\n return viewPDF(path);\n }\n}\nmodule.exports._createIframe = createIframe;\nfunction createIframe(src) {\n const element = createElement('iframe', {\n src,\n width: '100%',\n height: '100%'\n });\n element.addEventListener('load', () => {\n element.contentWindow.addEventListener('keydown', listener);\n });\n return element;\n}\nmodule.exports._viewHtml = viewHtml;\nfunction viewHtml(src) {\n modal.open(createIframe(src), Config);\n}\nfunction viewPDF(src) {\n const element = createIframe(src);\n const options = assign({}, Config);\n if (CloudCmd.config('showFileName')) options.title = Info.name;\n modal.open(element, options);\n}\nasync function viewMedia(path) {\n const [e, element] = await getMediaElement(path);\n if (e) return alert(e);\n const allConfig = {\n ...Config,\n ...{\n autoSize: true,\n afterShow: () => {\n element.querySelector('audio, video').focus();\n }\n }\n };\n modal.open(element, allConfig);\n}\nasync function viewFile() {\n const [error, data] = await Info.getData();\n if (error) return Images.hide();\n const element = document.createTextNode(data);\n const options = Config;\n if (CloudCmd.config('showFileName')) options.title = Info.name;\n El.append(element);\n modal.open(El, options);\n}\nconst copy = a => assign({}, a);\nmodule.exports._initConfig = initConfig;\nfunction initConfig(options) {\n const config = copy(Config);\n if (!options) return config;\n const names = Object.keys(options);\n for (const name of names) {\n const isConfig = Boolean(config[name]);\n const item = options[name];\n if (!isFn(item) || !isConfig) {\n config[name] = options[name];\n continue;\n }\n const fn = config[name];\n config[name] = series(fn, item);\n }\n return config;\n}\nfunction hide() {\n modal.close();\n}\nfunction viewImage(path, prefixURL) {\n const isSupportedImage = a => isImage(a) || a === path;\n const makeTitle = path => ({\n href: `${prefixURL}${path}`,\n title: encode(basename(path))\n });\n const names = Info.files.map(DOM.getCurrentPath).filter(isSupportedImage);\n const titles = names.map(makeTitle);\n const index = names.indexOf(Info.path);\n const imageConfig = {\n index,\n autoSize: true,\n arrows: true,\n keys: true,\n helpers: {\n title: {}\n }\n };\n const config = {\n ...Config,\n ...imageConfig\n };\n modal.open(titles, config);\n}\nasync function getMediaElement(src) {\n check(src);\n const [error, template] = await tryToCatch(Files.get, 'view/media-tmpl');\n if (error) return [error];\n const {\n name\n } = Info;\n if (!TemplateAudio) TemplateAudio = template;\n const is = isAudio(name);\n const type = is ? 'audio' : 'video';\n const innerHTML = rendy(TemplateAudio, {\n src,\n type,\n name\n });\n const element = createElement('div', {\n innerHTML\n });\n return [null, element];\n}\nfunction check(src) {\n if (!isString(src)) throw Error('src should be a string!');\n}\nasync function loadAll() {\n const {\n DIR_DIST\n } = CloudCmd;\n time(`${Name} load`);\n Loading = true;\n await loadCSS(`${DIR_DIST}/view.css`);\n Loading = false;\n}\nfunction onOverlayClick(event) {\n const position = {\n x: event.clientX,\n y: event.clientY\n };\n setCurrentByPosition(position);\n}\nfunction setCurrentByPosition(position) {\n const element = DOM.getCurrentByPosition(position);\n if (!element) return;\n const {\n files,\n filesPassive\n } = Info;\n const isFiles = files.includes(element);\n const isFilesPassive = filesPassive.includes(element);\n if (!isFiles && !isFilesPassive) return;\n const isCurrent = DOM.isCurrentFile(element);\n if (isCurrent) return;\n DOM.setCurrentFile(element);\n}\nfunction listener({\n keyCode\n}) {\n if (keyCode === Key.ESC) hide();\n}\n\n//# sourceURL=file://cloudcmd/client/modules/view/index.js\n}");
722
+ eval("{/* global CloudCmd, DOM */\n\n\n\nconst CloudCmd = globalThis.CloudCmd || {};\nconst DOM = globalThis.DOM || {};\n__webpack_require__(/*! ../../../css/view.css */ \"./css/view.css\");\nconst rendy = __webpack_require__(/*! rendy */ \"./node_modules/rendy/lib/rendy.js\");\nconst currify = __webpack_require__(/*! currify */ \"./node_modules/currify/lib/currify.js\");\nconst wraptile = __webpack_require__(/*! wraptile */ \"./node_modules/wraptile/lib/wraptile.js\");\nconst {\n tryToCatch\n} = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.cjs\");\nconst load = __webpack_require__(/*! load.js */ \"./node_modules/load.js/lib/load.js\");\nconst _modal = __webpack_require__(/*! @cloudcmd/modal */ \"./node_modules/@cloudcmd/modal/lib/modal.js\");\nconst _createElement = __webpack_require__(/*! @cloudcmd/create-element */ \"./node_modules/@cloudcmd/create-element/lib/create-element.js\");\nconst {\n time\n} = __webpack_require__(/*! ../../../common/util */ \"./common/util.js\");\nconst {\n FS\n} = __webpack_require__(/*! ../../../common/cloudfunc */ \"./common/cloudfunc.js\");\nconst {\n isImage,\n isAudio,\n getType\n} = __webpack_require__(/*! ./types */ \"./client/modules/view/types.js\");\nconst Files = __webpack_require__(/*! ../../dom/files */ \"./client/dom/files.js\");\nconst Events = __webpack_require__(/*! ../../dom/events */ \"./client/dom/events/index.js\");\nconst Images = __webpack_require__(/*! ../../dom/images */ \"./client/dom/images.js\");\nconst {\n encode\n} = __webpack_require__(/*! ../../../common/entity */ \"./common/entity.js\");\nconst isString = a => typeof a === 'string';\nconst {\n assign\n} = Object;\nconst {\n isArray\n} = Array;\nconst lifo = currify((fn, el, cb, name) => fn(name, el, cb));\nconst series = wraptile((...a) => {\n for (const f of a) f();\n});\nconst isFn = a => typeof a === 'function';\nconst noop = () => {};\nconst addEvent = lifo(Events.add);\nconst loadCSS = load.css;\nmodule.exports.show = show;\nmodule.exports.hide = hide;\nlet Loading = false;\nconst Name = 'View';\nCloudCmd[Name] = module.exports;\nconst Info = DOM.CurrentInfo;\nconst {\n Key\n} = CloudCmd;\nconst basename = a => a.split('/').pop();\nlet El;\nlet TemplateAudio;\nlet Overlay;\nconst Config = {\n beforeShow: () => {\n Images.hide();\n Key.unsetBind();\n },\n beforeClose: () => {\n Events.rmKey(listener);\n Key.setBind();\n },\n afterShow: () => {\n El.focus();\n },\n onOverlayClick,\n afterClose: noop,\n autoSize: false,\n helpers: {\n title: {}\n }\n};\nmodule.exports._Config = Config;\nmodule.exports.init = async () => {\n await loadAll();\n const events = ['click', 'contextmenu'];\n events.forEach(addEvent(Overlay, onOverlayClick));\n};\nasync function show(data, options = {}) {\n const prefixURL = CloudCmd.prefixURL + FS;\n if (Loading) return;\n if (!options || options.bindKeys !== false) Events.addKey(listener);\n El = _createElement('div', {\n className: 'view',\n notAppend: true\n });\n El.tabIndex = 0;\n if (data) {\n if (isArray(data)) El.append(...data);else El.append(data);\n _modal.open(El, initConfig(options));\n return;\n }\n Images.show.load();\n const path = prefixURL + Info.path;\n const type = options.raw ? '' : await getType(path);\n switch (type) {\n default:\n return await viewFile();\n case 'markdown':\n return await CloudCmd.Markdown.show(Info.path);\n case 'html':\n return viewHtml(path);\n case 'image':\n return viewImage(Info.path, prefixURL);\n case 'media':\n return await viewMedia(path);\n case 'pdf':\n return viewPDF(path);\n }\n}\nmodule.exports._createIframe = createIframe;\nfunction createIframe(src, overrides = {}) {\n const {\n createElement = _createElement\n } = overrides;\n const element = createElement('iframe', {\n src,\n width: '100%',\n height: '100%'\n });\n element.addEventListener('load', () => {\n element.contentWindow.addEventListener('keydown', listener);\n });\n return element;\n}\nmodule.exports._viewHtml = viewHtml;\nfunction viewHtml(src, overrides = {}) {\n const {\n modal = _modal\n } = overrides;\n modal.open(createIframe(src), Config);\n}\nfunction viewPDF(src) {\n const element = createIframe(src);\n const options = assign({}, Config);\n if (CloudCmd.config('showFileName')) options.title = Info.name;\n _modal.open(element, options);\n}\nasync function viewMedia(path) {\n const [e, element] = await getMediaElement(path);\n if (e) return alert(e);\n const allConfig = {\n ...Config,\n ...{\n autoSize: true,\n afterShow: () => {\n element.querySelector('audio, video').focus();\n }\n }\n };\n _modal.open(element, allConfig);\n}\nasync function viewFile() {\n const [error, data] = await Info.getData();\n if (error) return Images.hide();\n const element = document.createTextNode(data);\n const options = Config;\n if (CloudCmd.config('showFileName')) options.title = Info.name;\n El.append(element);\n _modal.open(El, options);\n}\nconst copy = a => assign({}, a);\nmodule.exports._initConfig = initConfig;\nfunction initConfig(options) {\n const config = copy(Config);\n if (!options) return config;\n const names = Object.keys(options);\n for (const name of names) {\n const isConfig = Boolean(config[name]);\n const item = options[name];\n if (!isFn(item) || !isConfig) {\n config[name] = options[name];\n continue;\n }\n const fn = config[name];\n config[name] = series(fn, item);\n }\n return config;\n}\nfunction hide() {\n _modal.close();\n}\nfunction viewImage(path, prefixURL) {\n const isSupportedImage = a => isImage(a) || a === path;\n const makeTitle = path => ({\n href: `${prefixURL}${path}`,\n title: encode(basename(path))\n });\n const names = Info.files.map(DOM.getCurrentPath).filter(isSupportedImage);\n const titles = names.map(makeTitle);\n const index = names.indexOf(Info.path);\n const imageConfig = {\n index,\n autoSize: true,\n arrows: true,\n keys: true,\n helpers: {\n title: {}\n }\n };\n const config = {\n ...Config,\n ...imageConfig\n };\n _modal.open(titles, config);\n}\nasync function getMediaElement(src) {\n check(src);\n const [error, template] = await tryToCatch(Files.get, 'view/media-tmpl');\n if (error) return [error];\n const {\n name\n } = Info;\n if (!TemplateAudio) TemplateAudio = template;\n const is = isAudio(name);\n const type = is ? 'audio' : 'video';\n const innerHTML = rendy(TemplateAudio, {\n src,\n type,\n name\n });\n const element = _createElement('div', {\n innerHTML\n });\n return [null, element];\n}\nfunction check(src) {\n if (!isString(src)) throw Error('src should be a string!');\n}\nasync function loadAll() {\n const {\n DIR_DIST\n } = CloudCmd;\n time(`${Name} load`);\n Loading = true;\n await loadCSS(`${DIR_DIST}/view.css`);\n Loading = false;\n}\nfunction onOverlayClick(event) {\n const position = {\n x: event.clientX,\n y: event.clientY\n };\n setCurrentByPosition(position);\n}\nfunction setCurrentByPosition(position) {\n const element = DOM.getCurrentByPosition(position);\n if (!element) return;\n const {\n files,\n filesPassive\n } = Info;\n const isFiles = files.includes(element);\n const isFilesPassive = filesPassive.includes(element);\n if (!isFiles && !isFilesPassive) return;\n const isCurrent = DOM.isCurrentFile(element);\n if (isCurrent) return;\n DOM.setCurrentFile(element);\n}\nfunction listener({\n keyCode\n}) {\n if (keyCode === Key.ESC) hide();\n}\n\n//# sourceURL=file://cloudcmd/client/modules/view/index.js\n}");
723
723
 
724
724
  /***/ },
725
725
 
@@ -873,7 +873,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-ext
873
873
  (__unused_webpack_module, exports, __webpack_require__) {
874
874
 
875
875
  "use strict";
876
- eval("{\n\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\n\nvar picocolors = __webpack_require__(/*! picocolors */ \"./node_modules/picocolors/picocolors.browser.js\");\nvar jsTokens = __webpack_require__(/*! js-tokens */ \"./node_modules/js-tokens/index.js\");\nvar helperValidatorIdentifier = __webpack_require__(/*! @babel/helper-validator-identifier */ \"./node_modules/@babel/helper-validator-identifier/lib/index.js\");\n\nfunction isColorSupported() {\n return (typeof process === \"object\" && (process.env.FORCE_COLOR === \"0\" || process.env.FORCE_COLOR === \"false\") ? false : picocolors.isColorSupported\n );\n}\nconst compose = (f, g) => v => f(g(v));\nfunction buildDefs(colors) {\n return {\n keyword: colors.cyan,\n capitalized: colors.yellow,\n jsxIdentifier: colors.yellow,\n punctuator: colors.yellow,\n number: colors.magenta,\n string: colors.green,\n regex: colors.magenta,\n comment: colors.gray,\n invalid: compose(compose(colors.white, colors.bgRed), colors.bold),\n gutter: colors.gray,\n marker: compose(colors.red, colors.bold),\n message: compose(colors.red, colors.bold),\n reset: colors.reset\n };\n}\nconst defsOn = buildDefs(picocolors.createColors(true));\nconst defsOff = buildDefs(picocolors.createColors(false));\nfunction getDefs(enabled) {\n return enabled ? defsOn : defsOff;\n}\n\nconst sometimesKeywords = new Set([\"as\", \"async\", \"from\", \"get\", \"of\", \"set\"]);\nconst NEWLINE$1 = /\\r\\n|[\\n\\r\\u2028\\u2029]/;\nconst BRACKET = /^[()[\\]{}]$/;\nlet tokenize;\n{\n const JSX_TAG = /^[a-z][\\w-]*$/i;\n const getTokenType = function (token, offset, text) {\n if (token.type === \"name\") {\n if (helperValidatorIdentifier.isKeyword(token.value) || helperValidatorIdentifier.isStrictReservedWord(token.value, true) || sometimesKeywords.has(token.value)) {\n return \"keyword\";\n }\n if (JSX_TAG.test(token.value) && (text[offset - 1] === \"<\" || text.slice(offset - 2, offset) === \"</\")) {\n return \"jsxIdentifier\";\n }\n if (token.value[0] !== token.value[0].toLowerCase()) {\n return \"capitalized\";\n }\n }\n if (token.type === \"punctuator\" && BRACKET.test(token.value)) {\n return \"bracket\";\n }\n if (token.type === \"invalid\" && (token.value === \"@\" || token.value === \"#\")) {\n return \"punctuator\";\n }\n return token.type;\n };\n tokenize = function* (text) {\n let match;\n while (match = jsTokens.default.exec(text)) {\n const token = jsTokens.matchToToken(match);\n yield {\n type: getTokenType(token, match.index, text),\n value: token.value\n };\n }\n };\n}\nfunction highlight(text) {\n if (text === \"\") return \"\";\n const defs = getDefs(true);\n let highlighted = \"\";\n for (const {\n type,\n value\n } of tokenize(text)) {\n if (type in defs) {\n highlighted += value.split(NEWLINE$1).map(str => defs[type](str)).join(\"\\n\");\n } else {\n highlighted += value;\n }\n }\n return highlighted;\n}\n\nlet deprecationWarningShown = false;\nconst NEWLINE = /\\r\\n|[\\n\\r\\u2028\\u2029]/;\nfunction getMarkerLines(loc, source, opts) {\n const startLoc = Object.assign({\n column: 0,\n line: -1\n }, loc.start);\n const endLoc = Object.assign({}, startLoc, loc.end);\n const {\n linesAbove = 2,\n linesBelow = 3\n } = opts || {};\n const startLine = startLoc.line;\n const startColumn = startLoc.column;\n const endLine = endLoc.line;\n const endColumn = endLoc.column;\n let start = Math.max(startLine - (linesAbove + 1), 0);\n let end = Math.min(source.length, endLine + linesBelow);\n if (startLine === -1) {\n start = 0;\n }\n if (endLine === -1) {\n end = source.length;\n }\n const lineDiff = endLine - startLine;\n const markerLines = {};\n if (lineDiff) {\n for (let i = 0; i <= lineDiff; i++) {\n const lineNumber = i + startLine;\n if (!startColumn) {\n markerLines[lineNumber] = true;\n } else if (i === 0) {\n const sourceLength = source[lineNumber - 1].length;\n markerLines[lineNumber] = [startColumn, sourceLength - startColumn + 1];\n } else if (i === lineDiff) {\n markerLines[lineNumber] = [0, endColumn];\n } else {\n const sourceLength = source[lineNumber - i].length;\n markerLines[lineNumber] = [0, sourceLength];\n }\n }\n } else {\n if (startColumn === endColumn) {\n if (startColumn) {\n markerLines[startLine] = [startColumn, 0];\n } else {\n markerLines[startLine] = true;\n }\n } else {\n markerLines[startLine] = [startColumn, endColumn - startColumn];\n }\n }\n return {\n start,\n end,\n markerLines\n };\n}\nfunction codeFrameColumns(rawLines, loc, opts = {}) {\n const shouldHighlight = opts.forceColor || isColorSupported() && opts.highlightCode;\n const defs = getDefs(shouldHighlight);\n const lines = rawLines.split(NEWLINE);\n const {\n start,\n end,\n markerLines\n } = getMarkerLines(loc, lines, opts);\n const hasColumns = loc.start && typeof loc.start.column === \"number\";\n const numberMaxWidth = String(end).length;\n const highlightedLines = shouldHighlight ? highlight(rawLines) : rawLines;\n let frame = highlightedLines.split(NEWLINE, end).slice(start, end).map((line, index) => {\n const number = start + 1 + index;\n const paddedNumber = ` ${number}`.slice(-numberMaxWidth);\n const gutter = ` ${paddedNumber} |`;\n const hasMarker = markerLines[number];\n const lastMarkerLine = !markerLines[number + 1];\n if (hasMarker) {\n let markerLine = \"\";\n if (Array.isArray(hasMarker)) {\n const markerSpacing = line.slice(0, Math.max(hasMarker[0] - 1, 0)).replace(/[^\\t]/g, \" \");\n const numberOfMarkers = hasMarker[1] || 1;\n markerLine = [\"\\n \", defs.gutter(gutter.replace(/\\d/g, \" \")), \" \", markerSpacing, defs.marker(\"^\").repeat(numberOfMarkers)].join(\"\");\n if (lastMarkerLine && opts.message) {\n markerLine += \" \" + defs.message(opts.message);\n }\n }\n return [defs.marker(\">\"), defs.gutter(gutter), line.length > 0 ? ` ${line}` : \"\", markerLine].join(\"\");\n } else {\n return ` ${defs.gutter(gutter)}${line.length > 0 ? ` ${line}` : \"\"}`;\n }\n }).join(\"\\n\");\n if (opts.message && !hasColumns) {\n frame = `${\" \".repeat(numberMaxWidth + 1)}${opts.message}\\n${frame}`;\n }\n if (shouldHighlight) {\n return defs.reset(frame);\n } else {\n return frame;\n }\n}\nfunction index (rawLines, lineNumber, colNumber, opts = {}) {\n if (!deprecationWarningShown) {\n deprecationWarningShown = true;\n const message = \"Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`.\";\n if (process.emitWarning) {\n process.emitWarning(message, \"DeprecationWarning\");\n } else {\n const deprecationError = new Error(message);\n deprecationError.name = \"DeprecationWarning\";\n console.warn(new Error(message));\n }\n }\n colNumber = Math.max(colNumber, 0);\n const location = {\n start: {\n column: colNumber,\n line: lineNumber\n }\n };\n return codeFrameColumns(rawLines, location, opts);\n}\n\nexports.codeFrameColumns = codeFrameColumns;\nexports[\"default\"] = index;\nexports.highlight = highlight;\n//# sourceMappingURL=index.js.map\n\n\n//# sourceURL=file://cloudcmd/node_modules/@babel/code-frame/lib/index.js\n}");
876
+ eval("{\n\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\n\nvar picocolors = __webpack_require__(/*! picocolors */ \"./node_modules/picocolors/picocolors.browser.js\");\nvar jsTokens = __webpack_require__(/*! js-tokens */ \"./node_modules/js-tokens/index.js\");\nvar helperValidatorIdentifier = __webpack_require__(/*! @babel/helper-validator-identifier */ \"./node_modules/@babel/helper-validator-identifier/lib/index.js\");\n\nfunction isColorSupported() {\n return (typeof process === \"object\" && (process.env.FORCE_COLOR === \"0\" || process.env.FORCE_COLOR === \"false\") ? false : picocolors.isColorSupported\n );\n}\nconst compose = (f, g) => v => f(g(v));\nfunction buildDefs(colors) {\n return {\n keyword: colors.cyan,\n capitalized: colors.yellow,\n jsxIdentifier: colors.yellow,\n punctuator: colors.yellow,\n number: colors.magenta,\n string: colors.green,\n regex: colors.magenta,\n comment: colors.gray,\n invalid: compose(compose(colors.white, colors.bgRed), colors.bold),\n gutter: colors.gray,\n marker: compose(colors.red, colors.bold),\n message: compose(colors.red, colors.bold),\n reset: colors.reset\n };\n}\nconst defsOn = buildDefs(picocolors.createColors(true));\nconst defsOff = buildDefs(picocolors.createColors(false));\nfunction getDefs(enabled) {\n return enabled ? defsOn : defsOff;\n}\n\nconst sometimesKeywords = new Set([\"as\", \"async\", \"from\", \"get\", \"of\", \"set\"]);\nconst NEWLINE$1 = /\\r\\n|[\\n\\r\\u2028\\u2029]/;\nconst BRACKET = /^[()[\\]{}]$/;\nlet tokenize;\nconst JSX_TAG = /^[a-z][\\w-]*$/i;\nconst getTokenType = function (token, offset, text) {\n if (token.type === \"name\") {\n const tokenValue = token.value;\n if (helperValidatorIdentifier.isKeyword(tokenValue) || helperValidatorIdentifier.isStrictReservedWord(tokenValue, true) || sometimesKeywords.has(tokenValue)) {\n return \"keyword\";\n }\n if (JSX_TAG.test(tokenValue) && (text[offset - 1] === \"<\" || text.slice(offset - 2, offset) === \"</\")) {\n return \"jsxIdentifier\";\n }\n const firstChar = String.fromCodePoint(tokenValue.codePointAt(0));\n if (firstChar !== firstChar.toLowerCase()) {\n return \"capitalized\";\n }\n }\n if (token.type === \"punctuator\" && BRACKET.test(token.value)) {\n return \"bracket\";\n }\n if (token.type === \"invalid\" && (token.value === \"@\" || token.value === \"#\")) {\n return \"punctuator\";\n }\n return token.type;\n};\ntokenize = function* (text) {\n let match;\n while (match = jsTokens.default.exec(text)) {\n const token = jsTokens.matchToToken(match);\n yield {\n type: getTokenType(token, match.index, text),\n value: token.value\n };\n }\n};\nfunction highlight(text) {\n if (text === \"\") return \"\";\n const defs = getDefs(true);\n let highlighted = \"\";\n for (const {\n type,\n value\n } of tokenize(text)) {\n if (type in defs) {\n highlighted += value.split(NEWLINE$1).map(str => defs[type](str)).join(\"\\n\");\n } else {\n highlighted += value;\n }\n }\n return highlighted;\n}\n\nlet deprecationWarningShown = false;\nconst NEWLINE = /\\r\\n|[\\n\\r\\u2028\\u2029]/;\nfunction getMarkerLines(loc, source, opts) {\n const startLoc = Object.assign({\n column: 0,\n line: -1\n }, loc.start);\n const endLoc = Object.assign({}, startLoc, loc.end);\n const {\n linesAbove = 2,\n linesBelow = 3\n } = opts || {};\n const startLine = startLoc.line;\n const startColumn = startLoc.column;\n const endLine = endLoc.line;\n const endColumn = endLoc.column;\n let start = Math.max(startLine - (linesAbove + 1), 0);\n let end = Math.min(source.length, endLine + linesBelow);\n if (startLine === -1) {\n start = 0;\n }\n if (endLine === -1) {\n end = source.length;\n }\n const lineDiff = endLine - startLine;\n const markerLines = {};\n if (lineDiff) {\n for (let i = 0; i <= lineDiff; i++) {\n const lineNumber = i + startLine;\n if (!startColumn) {\n markerLines[lineNumber] = true;\n } else if (i === 0) {\n const sourceLength = source[lineNumber - 1].length;\n markerLines[lineNumber] = [startColumn, sourceLength - startColumn + 1];\n } else if (i === lineDiff) {\n markerLines[lineNumber] = [0, endColumn];\n } else {\n const sourceLength = source[lineNumber - i].length;\n markerLines[lineNumber] = [0, sourceLength];\n }\n }\n } else {\n if (startColumn === endColumn) {\n if (startColumn) {\n markerLines[startLine] = [startColumn, 0];\n } else {\n markerLines[startLine] = true;\n }\n } else {\n markerLines[startLine] = [startColumn, endColumn - startColumn];\n }\n }\n return {\n start,\n end,\n markerLines\n };\n}\nfunction codeFrameColumns(rawLines, loc, opts = {}) {\n const shouldHighlight = opts.forceColor || isColorSupported() && opts.highlightCode;\n const defs = getDefs(shouldHighlight);\n const lines = rawLines.split(NEWLINE);\n const {\n start,\n end,\n markerLines\n } = getMarkerLines(loc, lines, opts);\n const hasColumns = loc.start && typeof loc.start.column === \"number\";\n const numberMaxWidth = String(end).length;\n const highlightedLines = shouldHighlight ? highlight(rawLines) : rawLines;\n let frame = highlightedLines.split(NEWLINE, end).slice(start, end).map((line, index) => {\n const number = start + 1 + index;\n const paddedNumber = ` ${number}`.slice(-numberMaxWidth);\n const gutter = ` ${paddedNumber} |`;\n const hasMarker = markerLines[number];\n const lastMarkerLine = !markerLines[number + 1];\n if (hasMarker) {\n let markerLine = \"\";\n if (Array.isArray(hasMarker)) {\n const markerSpacing = line.slice(0, Math.max(hasMarker[0] - 1, 0)).replace(/[^\\t]/g, \" \");\n const numberOfMarkers = hasMarker[1] || 1;\n markerLine = [\"\\n \", defs.gutter(gutter.replace(/\\d/g, \" \")), \" \", markerSpacing, defs.marker(\"^\").repeat(numberOfMarkers)].join(\"\");\n if (lastMarkerLine && opts.message) {\n markerLine += \" \" + defs.message(opts.message);\n }\n }\n return [defs.marker(\">\"), defs.gutter(gutter), line.length > 0 ? ` ${line}` : \"\", markerLine].join(\"\");\n } else {\n return ` ${defs.gutter(gutter)}${line.length > 0 ? ` ${line}` : \"\"}`;\n }\n }).join(\"\\n\");\n if (opts.message && !hasColumns) {\n frame = `${\" \".repeat(numberMaxWidth + 1)}${opts.message}\\n${frame}`;\n }\n if (shouldHighlight) {\n return defs.reset(frame);\n } else {\n return frame;\n }\n}\nfunction index (rawLines, lineNumber, colNumber, opts = {}) {\n if (!deprecationWarningShown) {\n deprecationWarningShown = true;\n const message = \"Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`.\";\n if (process.emitWarning) {\n process.emitWarning(message, \"DeprecationWarning\");\n } else {\n const deprecationError = new Error(message);\n deprecationError.name = \"DeprecationWarning\";\n console.warn(new Error(message));\n }\n }\n colNumber = Math.max(colNumber, 0);\n const location = {\n start: {\n column: colNumber,\n line: lineNumber\n }\n };\n return codeFrameColumns(rawLines, location, opts);\n}\n\nexports.codeFrameColumns = codeFrameColumns;\nexports[\"default\"] = index;\nexports.highlight = highlight;\n//# sourceMappingURL=index.js.map\n\n\n//# sourceURL=file://cloudcmd/node_modules/@babel/code-frame/lib/index.js\n}");
877
877
 
878
878
  /***/ },
879
879
 
package/dist-dev/sw.js CHANGED
@@ -16,7 +16,7 @@
16
16
  (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
17
17
 
18
18
  "use strict";
19
- eval("{\n\nconst process = __webpack_require__(/*! node:process */ \"./node_modules/process/browser.js\");\nconst {\n tryToCatch\n} = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.cjs\");\nconst currify = __webpack_require__(/*! currify */ \"./node_modules/currify/lib/currify.js\");\nconst isDev = process.env.NODE_ENV === 'development';\nconst isGet = a => a.method === 'GET';\nconst isBasic = a => a.type === 'basic';\nconst wait = currify((f, e) => e.waitUntil(f()));\nconst respondWith = currify((f, e) => {\n const {\n request\n } = e;\n const {\n url\n } = request;\n const pathname = getPathName(url);\n if (url.endsWith('/') || /\\^\\/fs/.test(pathname)) return;\n if (!isGet(request)) return;\n if (!isBasic(request)) return;\n if (pathname.startsWith('/api')) return;\n if (/^socket.io/.test(pathname)) return;\n e.respondWith(f(e));\n});\nconst getPathName = url => new URL(url).pathname;\nconst date = \"Mon Jan 12 2026 13:33:14 GMT+0200 (Eastern European Standard Time)\";\nconst NAME = `cloudcmd: ${date}`;\nconst createRequest = a => new Request(a, {\n credentials: 'same-origin'\n});\nconst getRequest = (a, request) => {\n if (a !== '/') return request;\n return createRequest('/');\n};\nself.addEventListener('install', wait(onInstall));\nself.addEventListener('fetch', respondWith(onFetch));\nself.addEventListener('activate', wait(onActivate));\nasync function onActivate() {\n console.info(`cloudcmd: sw: activate: ${NAME}`);\n await self.clients.claim();\n const keys = await caches.keys();\n const deleteCache = caches.delete.bind(caches);\n await Promise.all(keys.map(deleteCache));\n}\nasync function onInstall() {\n console.info(`cloudcmd: sw: install: ${NAME}`);\n await self.skipWaiting();\n}\nasync function onFetch(event) {\n const {\n request\n } = event;\n const {\n url\n } = request;\n const pathname = getPathName(url);\n const newRequest = getRequest(pathname, event.request);\n const cache = await caches.open(NAME);\n const response = await cache.match(request);\n if (!isDev && response) return response;\n const [e, resp] = await tryToCatch(fetch, newRequest, {\n credentials: 'same-origin'\n });\n if (e) return new Response(e.message);\n await addToCache(request, resp.clone());\n return resp;\n}\nasync function addToCache(request, response) {\n const cache = await caches.open(NAME);\n return cache.put(request, response);\n}\n\n//# sourceURL=file://cloudcmd/client/sw/sw.js\n}");
19
+ eval("{\n\nconst process = __webpack_require__(/*! node:process */ \"./node_modules/process/browser.js\");\nconst {\n tryToCatch\n} = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.cjs\");\nconst currify = __webpack_require__(/*! currify */ \"./node_modules/currify/lib/currify.js\");\nconst isDev = process.env.NODE_ENV === 'development';\nconst isGet = a => a.method === 'GET';\nconst isBasic = a => a.type === 'basic';\nconst wait = currify((f, e) => e.waitUntil(f()));\nconst respondWith = currify((f, e) => {\n const {\n request\n } = e;\n const {\n url\n } = request;\n const pathname = getPathName(url);\n if (url.endsWith('/') || /\\^\\/fs/.test(pathname)) return;\n if (!isGet(request)) return;\n if (!isBasic(request)) return;\n if (pathname.startsWith('/api')) return;\n if (/^socket.io/.test(pathname)) return;\n e.respondWith(f(e));\n});\nconst getPathName = url => new URL(url).pathname;\nconst date = \"Wed Jan 14 2026 14:38:37 GMT+0200 (Eastern European Standard Time)\";\nconst NAME = `cloudcmd: ${date}`;\nconst createRequest = a => new Request(a, {\n credentials: 'same-origin'\n});\nconst getRequest = (a, request) => {\n if (a !== '/') return request;\n return createRequest('/');\n};\nself.addEventListener('install', wait(onInstall));\nself.addEventListener('fetch', respondWith(onFetch));\nself.addEventListener('activate', wait(onActivate));\nasync function onActivate() {\n console.info(`cloudcmd: sw: activate: ${NAME}`);\n await self.clients.claim();\n const keys = await caches.keys();\n const deleteCache = caches.delete.bind(caches);\n await Promise.all(keys.map(deleteCache));\n}\nasync function onInstall() {\n console.info(`cloudcmd: sw: install: ${NAME}`);\n await self.skipWaiting();\n}\nasync function onFetch(event) {\n const {\n request\n } = event;\n const {\n url\n } = request;\n const pathname = getPathName(url);\n const newRequest = getRequest(pathname, event.request);\n const cache = await caches.open(NAME);\n const response = await cache.match(request);\n if (!isDev && response) return response;\n const [e, resp] = await tryToCatch(fetch, newRequest, {\n credentials: 'same-origin'\n });\n if (e) return new Response(e.message);\n await addToCache(request, resp.clone());\n return resp;\n}\nasync function addToCache(request, response) {\n const cache = await caches.open(NAME);\n return cache.put(request, response);\n}\n\n//# sourceURL=file://cloudcmd/client/sw/sw.js\n}");
20
20
 
21
21
  /***/ },
22
22
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cloudcmd",
3
- "version": "19.1.1",
3
+ "version": "19.1.2",
4
4
  "type": "commonjs",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "File manager for the web with console and editor",
@@ -58,7 +58,7 @@ const emitAuth = wraptile((importUrl, config, socket) => {
58
58
 
59
59
  const updateConfig = currify((config, data) => {
60
60
  for (const [key, value] of entries(data)) {
61
- if (typeof env(key) !== 'undefined')
61
+ if (typeof env.parse(key) !== 'undefined')
62
62
  continue;
63
63
 
64
64
  config(key, value);
package/server/env.js CHANGED
@@ -5,7 +5,7 @@ const snake = require('just-snake-case');
5
5
 
6
6
  const up = (a) => a.toUpperCase();
7
7
 
8
- module.exports = parse;
8
+ module.exports.parse = parse;
9
9
  module.exports.bool = (name) => {
10
10
  const value = parse(name);
11
11