cloudcmd 17.1.2 → 17.1.4
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/ChangeLog +10 -0
- package/HELP.md +3 -1
- package/README.md +1 -1
- package/dist/cloudcmd.common.js +3 -3
- package/dist/cloudcmd.common.js.map +1 -1
- package/dist/cloudcmd.js +1 -1
- package/dist/cloudcmd.js.map +1 -1
- package/dist/modules/cloud.js +1 -1
- package/dist/modules/cloud.js.map +1 -1
- package/dist/modules/command-line.js +1 -1
- package/dist/modules/command-line.js.map +1 -1
- package/dist/modules/config.js +1 -1
- package/dist/modules/config.js.map +1 -1
- package/dist/modules/contact.js +1 -1
- package/dist/modules/contact.js.map +1 -1
- package/dist/modules/edit-file-vim.js +1 -1
- package/dist/modules/edit-file-vim.js.map +1 -1
- package/dist/modules/edit-file.js +1 -1
- package/dist/modules/edit-file.js.map +1 -1
- package/dist/modules/edit-names-vim.js +1 -1
- package/dist/modules/edit-names-vim.js.map +1 -1
- package/dist/modules/edit-names.js +1 -1
- package/dist/modules/edit-names.js.map +1 -1
- package/dist/modules/edit.js +1 -1
- package/dist/modules/edit.js.map +1 -1
- package/dist/modules/help.js +1 -1
- package/dist/modules/help.js.map +1 -1
- package/dist/modules/konsole.js +1 -1
- package/dist/modules/konsole.js.map +1 -1
- package/dist/modules/markdown.js +1 -1
- package/dist/modules/markdown.js.map +1 -1
- package/dist/modules/menu.js +1 -1
- package/dist/modules/menu.js.map +1 -1
- package/dist/modules/operation.js +1 -1
- package/dist/modules/operation.js.map +1 -1
- package/dist/modules/polyfill.js +1 -1
- package/dist/modules/polyfill.js.map +1 -1
- package/dist/modules/terminal-run.js +1 -1
- package/dist/modules/terminal-run.js.map +1 -1
- package/dist/modules/terminal.js +1 -1
- package/dist/modules/terminal.js.map +1 -1
- package/dist/modules/upload.js +1 -1
- package/dist/modules/upload.js.map +1 -1
- package/dist/modules/user-menu.js +1 -1
- package/dist/modules/user-menu.js.map +1 -1
- package/dist/modules/view.js +1 -1
- package/dist/modules/view.js.map +1 -1
- package/dist/sw.js +1 -1
- package/dist/sw.js.map +1 -1
- package/dist-dev/cloudcmd.common.js +13 -50
- package/dist-dev/cloudcmd.js +2 -2
- package/dist-dev/modules/view.js +1 -1
- package/dist-dev/sw.js +1 -1
- package/package.json +3 -2
- package/server/cloudcmd.js +9 -6
- package/server/columns.js +26 -15
- package/server/config.js +4 -4
- package/server/env.js +1 -1
- package/server/exit.js +1 -1
- package/server/markdown/index.js +2 -2
- package/server/repl.js +3 -3
- package/server/rest/index.js +3 -3
- package/server/rest/info.js +1 -1
- package/server/route.js +9 -11
- package/server/template.js +1 -1
- package/server/user-menu.js +3 -3
- package/server/validate.js +3 -3
package/dist/modules/view.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["file://cloudcmd/modules/view.js"],"names":["modules","webpackJsonpCallback","data","moduleId","chunkId","chunkIds","moreModules","executeModules","i","resolves","length","Object","prototype","hasOwnProperty","call","installedChunks","push","parentJsonpFunction","shift","deferredModules","apply","checkDeferredModules","result","deferredModule","fulfilled","j","depId","splice","__webpack_require__","s","installedModules","20","exports","module","l","m","c","d","name","getter","o","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","p","jsonpArray","window","oldJsonpFunction","slice","
|
|
1
|
+
{"version":3,"sources":["file://cloudcmd/modules/view.js"],"names":["modules","webpackJsonpCallback","data","moduleId","chunkId","chunkIds","moreModules","executeModules","i","resolves","length","Object","prototype","hasOwnProperty","call","installedChunks","push","parentJsonpFunction","shift","deferredModules","apply","checkDeferredModules","result","deferredModule","fulfilled","j","depId","splice","__webpack_require__","s","installedModules","20","exports","module","l","m","c","d","name","getter","o","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","p","jsonpArray","window","oldJsonpFunction","slice","175","94","rendy","currify","wraptile","tryToCatch","load","modal","createElement","time","FS","isImage","isAudio","getType","Files","Events","Images","encode","assign","isArray","Array","lifo","fn","el","cb","series","a","f","isFn","addEvent","add","loadCSS","css","show","async","options","prefixURL","CloudCmd","Loading","bindKeys","addKey","listener","El","className","notAppend","tabIndex","append","open","initConfig","path","Info","raw","error","getData","hide","element","document","createTextNode","Config","config","title","viewFile","Markdown","viewHtml","names","files","map","DOM","getCurrentPath","filter","titles","href","split","pop","imageConfig","index","indexOf","autoSize","arrows","keys","helpers","viewImage","e","src","Error","check","template","TemplateAudio","is","innerHTML","type","getMediaElement","alert","allConfig","afterShow","querySelector","focus","viewMedia","createIframe","viewPDF","CurrentInfo","Key","beforeShow","unsetBind","beforeClose","rmKey","setBind","onOverlayClick","afterClose","width","height","addEventListener","contentWindow","_Config","init","DIR_DIST","loadAll","forEach","Overlay","_createIframe","_viewHtml","isConfig","Boolean","item","close","event","position","getCurrentByPosition","filesPassive","isFiles","includes","isFilesPassive","isCurrentFile","setCurrentFile","setCurrentByPosition","x","clientX","y","clientY","keyCode","ESC","_initConfig","98","extname","testRegExp","reg","test","getRegExp","ext","RegExp","some","detectType","headers","fetch","method","isVideo","isHTML","isMarkdown","_detectType"],"mappings":"CAAS,SAAUA,GAET,SAASC,EAAqBC,GAQ7B,IAPA,IAMIC,EAAUC,EANVC,EAAWH,EAAK,GAChBI,EAAcJ,EAAK,GACnBK,EAAiBL,EAAK,GAIHM,EAAI,EAAGC,EAAW,GACpCD,EAAIH,EAASK,OAAQF,IACzBJ,EAAUC,EAASG,GAChBG,OAAOC,UAAUC,eAAeC,KAAKC,EAAiBX,IAAYW,EAAgBX,IACpFK,EAASO,KAAKD,EAAgBX,GAAS,IAExCW,EAAgBX,GAAW,EAE5B,IAAID,KAAYG,EACZK,OAAOC,UAAUC,eAAeC,KAAKR,EAAaH,KACpDH,EAAQG,GAAYG,EAAYH,IAKlC,IAFGc,GAAqBA,EAAoBf,GAEtCO,EAASC,QACdD,EAASS,OAATT,GAOD,OAHAU,EAAgBH,KAAKI,MAA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AUqB,UAGvB,OAFY6G,EAAQ9F,KACVA,QAAasG,EAAWtG,IALjB,UAAUiG,KAMjBjG,GAAc,MACpBtC,EAAQsC,GAAc,QAWnBrC,EADQrC,EATH0E,IAgBd,SAAiB1E,GACf,MAAO,qBAAqB2K,KAAK3K,GAPToL,CAAQpL,GAVN,QAPbmD,IAAK,UAAUwH,KAAKxH,GAQ7BkI,CAAO3G,GAAc,OAPRvB,IAAK,SAASwH,KAAKxH,GAQhCmI,CAAW5G,GAAc,gBAA7B,EAVYvB,IAiBGnD,GALjBL,EAAOD,QAAQ0C,QAAUA,EAQzBzC,EAAOD,QAAQ2C,QAAUA,EAOzB1C,EAAOD,QAAQ6L,YAAcP","file":"./modules/view.js","sourceRoot":""}
|
package/dist/sw.js
CHANGED
|
@@ -5,5 +5,5 @@ var serviceWorkerOption = {
|
|
|
5
5
|
]
|
|
6
6
|
};
|
|
7
7
|
|
|
8
|
-
!function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/dist/",n(n.s=0)}([function(t,e,n){"use strict";const r=n(1),o=n(2),i=n(3),u="development"===r.env.NODE_ENV,c=i((t,e)=>e.waitUntil(t())),s=i((t,e)=>{const{request:n}=e,{url:r}=n,o=a(r);r.endsWith("/")||/\^\/fs/.test(o)||"GET"===n.method&&(t=>"basic"===t.type)(n)&&(o.startsWith("/api")||/^socket.io/.test(o)||e.respondWith(t(e)))}),a=t=>new URL(t).pathname,f="cloudcmd:
|
|
8
|
+
!function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/dist/",n(n.s=0)}([function(t,e,n){"use strict";const r=n(1),o=n(2),i=n(3),u="development"===r.env.NODE_ENV,c=i((t,e)=>e.waitUntil(t())),s=i((t,e)=>{const{request:n}=e,{url:r}=n,o=a(r);r.endsWith("/")||/\^\/fs/.test(o)||"GET"===n.method&&(t=>"basic"===t.type)(n)&&(o.startsWith("/api")||/^socket.io/.test(o)||e.respondWith(t(e)))}),a=t=>new URL(t).pathname,f="cloudcmd: Wed Mar 20 2024 13:13:15 GMT+0200 (Eastern European Standard Time)",l=(t,e)=>"/"!==t?e:(t=>new Request(t,{credentials:"same-origin"}))("/");self.addEventListener("install",c((async function(){console.info("cloudcmd: sw: install: "+f),await self.skipWaiting()}))),self.addEventListener("fetch",s((async function(t){const{request:e}=t,{url:n}=e,r=a(n),i=l(r,t.request),c=await caches.open(f),s=await c.match(e);if(!u&&s)return s;const[d,h]=await o(fetch,i,{credentials:"same-origin"});return d?new Response(d.message):(await async function(t,e){return(await caches.open(f)).put(t,e)}(e,h.clone()),h)}))),self.addEventListener("activate",c((async function(){console.info("cloudcmd: sw: activate: "+f),await self.clients.claim();const t=await caches.keys(),e=caches.delete.bind(caches);await Promise.all(t.map(e))})))},function(t,e){var n,r,o=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function u(){throw new Error("clearTimeout has not been defined")}function c(t){if(n===setTimeout)return setTimeout(t,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(t){n=i}try{r="function"==typeof clearTimeout?clearTimeout:u}catch(t){r=u}}();var s,a=[],f=!1,l=-1;function d(){f&&s&&(f=!1,s.length?a=s.concat(a):l=-1,a.length&&h())}function h(){if(!f){var t=c(d);f=!0;for(var e=a.length;e;){for(s=a,a=[];++l<e;)s&&s[l].run();l=-1,e=a.length}s=null,f=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===u||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(t)}}function p(t,e){this.fun=t,this.array=e}function m(){}o.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 p(t,e)),1!==a.length||f||c(h)},p.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=m,o.addListener=m,o.once=m,o.off=m,o.removeListener=m,o.removeAllListeners=m,o.emit=m,o.prependListener=m,o.prependOnceListener=m,o.listeners=function(t){return[]},o.binding=function(t){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(t){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(t,e,n){"use strict";t.exports=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]}}},function(t,e,n){"use strict";const r=(t,...e)=>{if(function(t){if("function"!=typeof t)throw Error("fn should be function!")}(t),e.length>=t.length)return t(...e);const n=(...n)=>r(t,...e,...n),o=t.length-e.length-1;return(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)}])(n)[o]||n};t.exports=r}]);
|
|
9
9
|
//# sourceMappingURL=sw.js.map
|
package/dist/sw.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["file://cloudcmd/webpack/bootstrap","file://cloudcmd/client/sw/sw.js","file://cloudcmd/node_modules/process/browser.js","file://cloudcmd/node_modules/try-to-catch/lib/try-to-catch.js","file://cloudcmd/node_modules/currify/lib/currify.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","process","require","tryToCatch","currify","isDev","env","NODE_ENV","wait","f","e","waitUntil","respondWith","request","url","pathname","getPathName","endsWith","test","method","a","type","isBasic","startsWith","URL","NAME","getRequest","Request","credentials","createRequest","self","addEventListener","async","console","info","skipWaiting","event","newRequest","cache","caches","open","response","match","resp","fetch","Response","message","put","addToCache","clone","clients","claim","keys","deleteCache","delete","Promise","all","map","cachedSetTimeout","cachedClearTimeout","defaultSetTimout","Error","defaultClearTimeout","runTimeout","fun","setTimeout","this","clearTimeout","currentQueue","queue","draining","queueIndex","cleanUpNextTick","length","concat","drainQueue","timeout","len","run","marker","runClearTimeout","Item","array","noop","nextTick","args","Array","arguments","push","apply","title","browser","argv","version","versions","on","addListener","once","off","removeListener","removeAllListeners","emit","prependListener","prependOnceListener","listeners","binding","cwd","chdir","dir","umask","fn","check","again","args2","count","b"],"mappings":"aACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QAKfF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEZ,EAAoBkB,EAAI,SAAShB,GACX,oBAAXiB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAeb,EAASiB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAeb,EAAS,aAAc,CAAEmB,OAAO,KAQvDrB,EAAoBsB,EAAI,SAASD,EAAOE,GAEvC,GADU,EAAPA,IAAUF,EAAQrB,EAAoBqB,IAC/B,EAAPE,EAAU,OAAOF,EACpB,GAAW,EAAPE,GAA8B,iBAAVF,GAAsBA,GAASA,EAAMG,WAAY,OAAOH,EAChF,IAAII,EAAKX,OAAOY,OAAO,MAGvB,GAFA1B,EAAoBkB,EAAEO,GACtBX,OAAOC,eAAeU,EAAI,UAAW,CAAET,YAAY,EAAMK,MAAOA,IACtD,EAAPE,GAA4B,iBAATF,EAAmB,IAAI,IAAIM,KAAON,EAAOrB,EAAoBU,EAAEe,EAAIE,EAAK,SAASA,GAAO,OAAON,EAAMM,IAAQC,KAAK,KAAMD,IAC9I,OAAOF,GAIRzB,EAAo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,QAAUqC","file":"sw.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/dist/\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n","'use strict';\n\nconst process = require('process');\nconst codegen = require('codegen.macro');\nconst tryToCatch = require('try-to-catch');\nconst currify = require('currify');\n\nconst isDev = process.env.NODE_ENV === 'development';\n\nconst isGet = (a) => a.method === 'GET';\nconst isBasic = (a) => a.type === 'basic';\n\nconst wait = currify((f, e) => e.waitUntil(f()));\nconst respondWith = currify((f, e) => {\n const {request} = e;\n const {url} = request;\n const pathname = getPathName(url);\n \n if (url.endsWith('/') || /\\^\\/fs/.test(pathname))\n return;\n \n if (!isGet(request))\n return;\n \n if (!isBasic(request))\n return;\n \n if (pathname.startsWith('/api'))\n return;\n \n if (/^socket.io/.test(pathname))\n return;\n \n e.respondWith(f(e));\n});\n\nconst getPathName = (url) => new URL(url).pathname;\n\nconst date = codegen`module.exports = '\"' + Date() + '\"'`;\nconst NAME = `cloudcmd: ${date}`;\n\nconst createRequest = (a) => new Request(a, {\n credentials: 'same-origin',\n});\n\nconst getRequest = (a, request) => {\n if (a !== '/')\n return request;\n \n return createRequest('/');\n};\n\nself.addEventListener('install', wait(onInstall));\nself.addEventListener('fetch', respondWith(onFetch));\nself.addEventListener('activate', wait(onActivate));\n\nasync function onActivate() {\n console.info(`cloudcmd: sw: activate: ${NAME}`);\n \n await self.clients.claim();\n const keys = await caches.keys();\n const deleteCache = caches.delete.bind(caches);\n \n await Promise.all(keys.map(deleteCache));\n}\n\nasync function onInstall() {\n console.info(`cloudcmd: sw: install: ${NAME}`);\n \n await self.skipWaiting();\n}\n\nasync function onFetch(event) {\n const {request} = event;\n const {url} = request;\n const pathname = getPathName(url);\n const newRequest = getRequest(pathname, event.request);\n \n const cache = await caches.open(NAME);\n const response = await cache.match(request);\n \n if (!isDev && response)\n return response;\n \n const [e, resp] = await tryToCatch(fetch, newRequest, {\n credentials: 'same-origin',\n });\n \n if (e)\n return new Response(e.message);\n \n await addToCache(request, resp.clone());\n \n return resp;\n}\n\nasync function addToCache(request, response) {\n const cache = await caches.open(NAME);\n return cache.put(request, response);\n}\n","// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n","'use strict';\n\nmodule.exports = async (fn, ...args) => {\n check(fn);\n \n try {\n return [null, await fn(...args)];\n } catch(e) {\n return [e];\n }\n};\n\nfunction check(fn) {\n if (typeof fn !== 'function')\n throw Error('fn should be a function!');\n}\n\n","'use strict';\n\nconst f = (fn) => [\n /*eslint no-unused-vars: 0*/\n function (a) {return fn(...arguments);},\n function (a, b) {return fn(...arguments);},\n function (a, b, c) {return fn(...arguments);},\n function (a, b, c, d) {return fn(...arguments);},\n function (a, b, c, d, e) {return fn(...arguments);},\n];\n\nconst currify = (fn, ...args) => {\n check(fn);\n \n if (args.length >= fn.length)\n return fn(...args);\n \n const again = (...args2) => {\n return currify(fn, ...[...args, ...args2]);\n };\n \n const count = fn.length - args.length - 1;\n const func = f(again)[count];\n \n return func || again;\n};\n\nmodule.exports = currify;\n\nfunction check(fn) {\n if (typeof fn !== 'function')\n throw Error('fn should be function!');\n}\n\n"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"sources":["file://cloudcmd/webpack/bootstrap","file://cloudcmd/client/sw/sw.js","file://cloudcmd/node_modules/process/browser.js","file://cloudcmd/node_modules/try-to-catch/lib/try-to-catch.js","file://cloudcmd/node_modules/currify/lib/currify.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","process","require","tryToCatch","currify","isDev","env","NODE_ENV","wait","f","e","waitUntil","respondWith","request","url","pathname","getPathName","endsWith","test","method","a","type","isBasic","startsWith","URL","NAME","getRequest","Request","credentials","createRequest","self","addEventListener","async","console","info","skipWaiting","event","newRequest","cache","caches","open","response","match","resp","fetch","Response","message","put","addToCache","clone","clients","claim","keys","deleteCache","delete","Promise","all","map","cachedSetTimeout","cachedClearTimeout","defaultSetTimout","Error","defaultClearTimeout","runTimeout","fun","setTimeout","this","clearTimeout","currentQueue","queue","draining","queueIndex","cleanUpNextTick","length","concat","drainQueue","timeout","len","run","marker","runClearTimeout","Item","array","noop","nextTick","args","Array","arguments","push","apply","title","browser","argv","version","versions","on","addListener","once","off","removeListener","removeAllListeners","emit","prependListener","prependOnceListener","listeners","binding","cwd","chdir","dir","umask","fn","check","again","args2","count","b"],"mappings":"aACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QAKfF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEZ,EAAoBkB,EAAI,SAAShB,GACX,oBAAXiB,QAA0B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AeJ,SAAeyB,GACX,GAAkB,mBAAPA,EACP,MAAMjD,MAAM,0BAnBhBkD,CAAMD,GAEFzB,EAAKZ,QAAUqC,EAAGrC,OAClB,OAAOqC,KAAMzB,GAEjB,MAAM2B,EAAQ,IAAIC,IACP7G,EAAQ0G,KAAWzB,KAAS4B,GAGjCC,EAAQJ,EAAGrC,OAASY,EAAKZ,OAAS,EAGxC,MAtBM,CAACqC,GAAO,CAEd,SAAU1F,GAAI,OAAO0F,KAAMvB,YAC3B,SAAUnE,EAAG+F,GAAI,OAAOL,KAAMvB,YAC9B,SAAUnE,EAAG+F,EAAG7I,GAAI,OAAOwI,KAAMvB,YACjC,SAAUnE,EAAG+F,EAAG7I,EAAGC,GAAI,OAAOuI,KAAMvB,YACpC,SAAUnE,EAAG+F,EAAG7I,EAAGC,EAAGmC,GAAI,OAAOoG,KAAMvB,aAc1B9E,CAAEuG,GAAOE,IAEPF,GAGnBhJ,EAAOD,QAAUqC","file":"sw.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/dist/\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n","'use strict';\n\nconst process = require('node:process');\nconst codegen = require('codegen.macro');\nconst tryToCatch = require('try-to-catch');\nconst currify = require('currify');\n\nconst isDev = process.env.NODE_ENV === 'development';\n\nconst isGet = (a) => a.method === 'GET';\nconst isBasic = (a) => a.type === 'basic';\n\nconst wait = currify((f, e) => e.waitUntil(f()));\nconst respondWith = currify((f, e) => {\n const {request} = e;\n const {url} = request;\n const pathname = getPathName(url);\n \n if (url.endsWith('/') || /\\^\\/fs/.test(pathname))\n return;\n \n if (!isGet(request))\n return;\n \n if (!isBasic(request))\n return;\n \n if (pathname.startsWith('/api'))\n return;\n \n if (/^socket.io/.test(pathname))\n return;\n \n e.respondWith(f(e));\n});\n\nconst getPathName = (url) => new URL(url).pathname;\n\nconst date = codegen`module.exports = '\"' + Date() + '\"'`;\nconst NAME = `cloudcmd: ${date}`;\n\nconst createRequest = (a) => new Request(a, {\n credentials: 'same-origin',\n});\n\nconst getRequest = (a, request) => {\n if (a !== '/')\n return request;\n \n return createRequest('/');\n};\n\nself.addEventListener('install', wait(onInstall));\nself.addEventListener('fetch', respondWith(onFetch));\nself.addEventListener('activate', wait(onActivate));\n\nasync function onActivate() {\n console.info(`cloudcmd: sw: activate: ${NAME}`);\n \n await self.clients.claim();\n const keys = await caches.keys();\n const deleteCache = caches.delete.bind(caches);\n \n await Promise.all(keys.map(deleteCache));\n}\n\nasync function onInstall() {\n console.info(`cloudcmd: sw: install: ${NAME}`);\n \n await self.skipWaiting();\n}\n\nasync function onFetch(event) {\n const {request} = event;\n const {url} = request;\n const pathname = getPathName(url);\n const newRequest = getRequest(pathname, event.request);\n \n const cache = await caches.open(NAME);\n const response = await cache.match(request);\n \n if (!isDev && response)\n return response;\n \n const [e, resp] = await tryToCatch(fetch, newRequest, {\n credentials: 'same-origin',\n });\n \n if (e)\n return new Response(e.message);\n \n await addToCache(request, resp.clone());\n \n return resp;\n}\n\nasync function addToCache(request, response) {\n const cache = await caches.open(NAME);\n return cache.put(request, response);\n}\n","// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n","'use strict';\n\nmodule.exports = async (fn, ...args) => {\n check(fn);\n \n try {\n return [null, await fn(...args)];\n } catch(e) {\n return [e];\n }\n};\n\nfunction check(fn) {\n if (typeof fn !== 'function')\n throw Error('fn should be a function!');\n}\n\n","'use strict';\n\nconst f = (fn) => [\n /*eslint no-unused-vars: 0*/\n function (a) {return fn(...arguments);},\n function (a, b) {return fn(...arguments);},\n function (a, b, c) {return fn(...arguments);},\n function (a, b, c, d) {return fn(...arguments);},\n function (a, b, c, d, e) {return fn(...arguments);},\n];\n\nconst currify = (fn, ...args) => {\n check(fn);\n \n if (args.length >= fn.length)\n return fn(...args);\n \n const again = (...args2) => {\n return currify(fn, ...[...args, ...args2]);\n };\n \n const count = fn.length - args.length - 1;\n const func = f(again)[count];\n \n return func || again;\n};\n\nmodule.exports = currify;\n\nfunction check(fn) {\n if (typeof fn !== 'function')\n throw Error('fn should be function!');\n}\n\n"],"sourceRoot":""}
|
|
@@ -319,55 +319,7 @@ eval("// removed by extract-text-webpack-plugin\n\n//# sourceURL=file://cloudcmd
|
|
|
319
319
|
/***/ (function(module, exports, __webpack_require__) {
|
|
320
320
|
|
|
321
321
|
"use strict";
|
|
322
|
-
eval("/* WEBPACK VAR INJECTION */(function(process) {\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.codeFrameColumns = codeFrameColumns;\nexports.default = _default;\nvar _highlight = __webpack_require__(/*! @babel/highlight */ \"./node_modules/@babel/highlight/lib/index.js\");\nvar
|
|
323
|
-
|
|
324
|
-
/***/ }),
|
|
325
|
-
|
|
326
|
-
/***/ "./node_modules/@babel/code-frame/node_modules/ansi-styles/index.js":
|
|
327
|
-
/*!**************************************************************************!*\
|
|
328
|
-
!*** ./node_modules/@babel/code-frame/node_modules/ansi-styles/index.js ***!
|
|
329
|
-
\**************************************************************************/
|
|
330
|
-
/*! no static exports found */
|
|
331
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
332
|
-
|
|
333
|
-
"use strict";
|
|
334
|
-
eval("/* WEBPACK VAR INJECTION */(function(module) {\nconst colorConvert = __webpack_require__(/*! color-convert */ \"./node_modules/color-convert/index.js\");\n\nconst wrapAnsi16 = (fn, offset) => function () {\n\tconst code = fn.apply(colorConvert, arguments);\n\treturn `\\u001B[${code + offset}m`;\n};\n\nconst wrapAnsi256 = (fn, offset) => function () {\n\tconst code = fn.apply(colorConvert, arguments);\n\treturn `\\u001B[${38 + offset};5;${code}m`;\n};\n\nconst wrapAnsi16m = (fn, offset) => function () {\n\tconst rgb = fn.apply(colorConvert, arguments);\n\treturn `\\u001B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`;\n};\n\nfunction assembleStyles() {\n\tconst codes = new Map();\n\tconst styles = {\n\t\tmodifier: {\n\t\t\treset: [0, 0],\n\t\t\t// 21 isn't widely supported and 22 does the same thing\n\t\t\tbold: [1, 22],\n\t\t\tdim: [2, 22],\n\t\t\titalic: [3, 23],\n\t\t\tunderline: [4, 24],\n\t\t\tinverse: [7, 27],\n\t\t\thidden: [8, 28],\n\t\t\tstrikethrough: [9, 29]\n\t\t},\n\t\tcolor: {\n\t\t\tblack: [30, 39],\n\t\t\tred: [31, 39],\n\t\t\tgreen: [32, 39],\n\t\t\tyellow: [33, 39],\n\t\t\tblue: [34, 39],\n\t\t\tmagenta: [35, 39],\n\t\t\tcyan: [36, 39],\n\t\t\twhite: [37, 39],\n\t\t\tgray: [90, 39],\n\n\t\t\t// Bright color\n\t\t\tredBright: [91, 39],\n\t\t\tgreenBright: [92, 39],\n\t\t\tyellowBright: [93, 39],\n\t\t\tblueBright: [94, 39],\n\t\t\tmagentaBright: [95, 39],\n\t\t\tcyanBright: [96, 39],\n\t\t\twhiteBright: [97, 39]\n\t\t},\n\t\tbgColor: {\n\t\t\tbgBlack: [40, 49],\n\t\t\tbgRed: [41, 49],\n\t\t\tbgGreen: [42, 49],\n\t\t\tbgYellow: [43, 49],\n\t\t\tbgBlue: [44, 49],\n\t\t\tbgMagenta: [45, 49],\n\t\t\tbgCyan: [46, 49],\n\t\t\tbgWhite: [47, 49],\n\n\t\t\t// Bright color\n\t\t\tbgBlackBright: [100, 49],\n\t\t\tbgRedBright: [101, 49],\n\t\t\tbgGreenBright: [102, 49],\n\t\t\tbgYellowBright: [103, 49],\n\t\t\tbgBlueBright: [104, 49],\n\t\t\tbgMagentaBright: [105, 49],\n\t\t\tbgCyanBright: [106, 49],\n\t\t\tbgWhiteBright: [107, 49]\n\t\t}\n\t};\n\n\t// Fix humans\n\tstyles.color.grey = styles.color.gray;\n\n\tfor (const groupName of Object.keys(styles)) {\n\t\tconst group = styles[groupName];\n\n\t\tfor (const styleName of Object.keys(group)) {\n\t\t\tconst style = group[styleName];\n\n\t\t\tstyles[styleName] = {\n\t\t\t\topen: `\\u001B[${style[0]}m`,\n\t\t\t\tclose: `\\u001B[${style[1]}m`\n\t\t\t};\n\n\t\t\tgroup[styleName] = styles[styleName];\n\n\t\t\tcodes.set(style[0], style[1]);\n\t\t}\n\n\t\tObject.defineProperty(styles, groupName, {\n\t\t\tvalue: group,\n\t\t\tenumerable: false\n\t\t});\n\n\t\tObject.defineProperty(styles, 'codes', {\n\t\t\tvalue: codes,\n\t\t\tenumerable: false\n\t\t});\n\t}\n\n\tconst ansi2ansi = n => n;\n\tconst rgb2rgb = (r, g, b) => [r, g, b];\n\n\tstyles.color.close = '\\u001B[39m';\n\tstyles.bgColor.close = '\\u001B[49m';\n\n\tstyles.color.ansi = {\n\t\tansi: wrapAnsi16(ansi2ansi, 0)\n\t};\n\tstyles.color.ansi256 = {\n\t\tansi256: wrapAnsi256(ansi2ansi, 0)\n\t};\n\tstyles.color.ansi16m = {\n\t\trgb: wrapAnsi16m(rgb2rgb, 0)\n\t};\n\n\tstyles.bgColor.ansi = {\n\t\tansi: wrapAnsi16(ansi2ansi, 10)\n\t};\n\tstyles.bgColor.ansi256 = {\n\t\tansi256: wrapAnsi256(ansi2ansi, 10)\n\t};\n\tstyles.bgColor.ansi16m = {\n\t\trgb: wrapAnsi16m(rgb2rgb, 10)\n\t};\n\n\tfor (let key of Object.keys(colorConvert)) {\n\t\tif (typeof colorConvert[key] !== 'object') {\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst suite = colorConvert[key];\n\n\t\tif (key === 'ansi16') {\n\t\t\tkey = 'ansi';\n\t\t}\n\n\t\tif ('ansi16' in suite) {\n\t\t\tstyles.color.ansi[key] = wrapAnsi16(suite.ansi16, 0);\n\t\t\tstyles.bgColor.ansi[key] = wrapAnsi16(suite.ansi16, 10);\n\t\t}\n\n\t\tif ('ansi256' in suite) {\n\t\t\tstyles.color.ansi256[key] = wrapAnsi256(suite.ansi256, 0);\n\t\t\tstyles.bgColor.ansi256[key] = wrapAnsi256(suite.ansi256, 10);\n\t\t}\n\n\t\tif ('rgb' in suite) {\n\t\t\tstyles.color.ansi16m[key] = wrapAnsi16m(suite.rgb, 0);\n\t\t\tstyles.bgColor.ansi16m[key] = wrapAnsi16m(suite.rgb, 10);\n\t\t}\n\t}\n\n\treturn styles;\n}\n\n// Make the export immutable\nObject.defineProperty(module, 'exports', {\n\tenumerable: true,\n\tget: assembleStyles\n});\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../webpack/buildin/module.js */ \"./node_modules/webpack/buildin/module.js\")(module)))\n\n//# sourceURL=file://cloudcmd/node_modules/@babel/code-frame/node_modules/ansi-styles/index.js");
|
|
335
|
-
|
|
336
|
-
/***/ }),
|
|
337
|
-
|
|
338
|
-
/***/ "./node_modules/@babel/code-frame/node_modules/chalk/index.js":
|
|
339
|
-
/*!********************************************************************!*\
|
|
340
|
-
!*** ./node_modules/@babel/code-frame/node_modules/chalk/index.js ***!
|
|
341
|
-
\********************************************************************/
|
|
342
|
-
/*! no static exports found */
|
|
343
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
344
|
-
|
|
345
|
-
"use strict";
|
|
346
|
-
eval("/* WEBPACK VAR INJECTION */(function(process) {\nconst escapeStringRegexp = __webpack_require__(/*! escape-string-regexp */ \"./node_modules/@babel/code-frame/node_modules/escape-string-regexp/index.js\");\nconst ansiStyles = __webpack_require__(/*! ansi-styles */ \"./node_modules/@babel/code-frame/node_modules/ansi-styles/index.js\");\nconst stdoutColor = __webpack_require__(/*! supports-color */ \"./node_modules/supports-color/browser.js\").stdout;\n\nconst template = __webpack_require__(/*! ./templates.js */ \"./node_modules/@babel/code-frame/node_modules/chalk/templates.js\");\n\nconst isSimpleWindowsTerm = process.platform === 'win32' && !(process.env.TERM || '').toLowerCase().startsWith('xterm');\n\n// `supportsColor.level` → `ansiStyles.color[name]` mapping\nconst levelMapping = ['ansi', 'ansi', 'ansi256', 'ansi16m'];\n\n// `color-convert` models to exclude from the Chalk API due to conflicts and such\nconst skipModels = new Set(['gray']);\n\nconst styles = Object.create(null);\n\nfunction applyOptions(obj, options) {\n\toptions = options || {};\n\n\t// Detect level if not set manually\n\tconst scLevel = stdoutColor ? stdoutColor.level : 0;\n\tobj.level = options.level === undefined ? scLevel : options.level;\n\tobj.enabled = 'enabled' in options ? options.enabled : obj.level > 0;\n}\n\nfunction Chalk(options) {\n\t// We check for this.template here since calling `chalk.constructor()`\n\t// by itself will have a `this` of a previously constructed chalk object\n\tif (!this || !(this instanceof Chalk) || this.template) {\n\t\tconst chalk = {};\n\t\tapplyOptions(chalk, options);\n\n\t\tchalk.template = function () {\n\t\t\tconst args = [].slice.call(arguments);\n\t\t\treturn chalkTag.apply(null, [chalk.template].concat(args));\n\t\t};\n\n\t\tObject.setPrototypeOf(chalk, Chalk.prototype);\n\t\tObject.setPrototypeOf(chalk.template, chalk);\n\n\t\tchalk.template.constructor = Chalk;\n\n\t\treturn chalk.template;\n\t}\n\n\tapplyOptions(this, options);\n}\n\n// Use bright blue on Windows as the normal blue color is illegible\nif (isSimpleWindowsTerm) {\n\tansiStyles.blue.open = '\\u001B[94m';\n}\n\nfor (const key of Object.keys(ansiStyles)) {\n\tansiStyles[key].closeRe = new RegExp(escapeStringRegexp(ansiStyles[key].close), 'g');\n\n\tstyles[key] = {\n\t\tget() {\n\t\t\tconst codes = ansiStyles[key];\n\t\t\treturn build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, key);\n\t\t}\n\t};\n}\n\nstyles.visible = {\n\tget() {\n\t\treturn build.call(this, this._styles || [], true, 'visible');\n\t}\n};\n\nansiStyles.color.closeRe = new RegExp(escapeStringRegexp(ansiStyles.color.close), 'g');\nfor (const model of Object.keys(ansiStyles.color.ansi)) {\n\tif (skipModels.has(model)) {\n\t\tcontinue;\n\t}\n\n\tstyles[model] = {\n\t\tget() {\n\t\t\tconst level = this.level;\n\t\t\treturn function () {\n\t\t\t\tconst open = ansiStyles.color[levelMapping[level]][model].apply(null, arguments);\n\t\t\t\tconst codes = {\n\t\t\t\t\topen,\n\t\t\t\t\tclose: ansiStyles.color.close,\n\t\t\t\t\tcloseRe: ansiStyles.color.closeRe\n\t\t\t\t};\n\t\t\t\treturn build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, model);\n\t\t\t};\n\t\t}\n\t};\n}\n\nansiStyles.bgColor.closeRe = new RegExp(escapeStringRegexp(ansiStyles.bgColor.close), 'g');\nfor (const model of Object.keys(ansiStyles.bgColor.ansi)) {\n\tif (skipModels.has(model)) {\n\t\tcontinue;\n\t}\n\n\tconst bgModel = 'bg' + model[0].toUpperCase() + model.slice(1);\n\tstyles[bgModel] = {\n\t\tget() {\n\t\t\tconst level = this.level;\n\t\t\treturn function () {\n\t\t\t\tconst open = ansiStyles.bgColor[levelMapping[level]][model].apply(null, arguments);\n\t\t\t\tconst codes = {\n\t\t\t\t\topen,\n\t\t\t\t\tclose: ansiStyles.bgColor.close,\n\t\t\t\t\tcloseRe: ansiStyles.bgColor.closeRe\n\t\t\t\t};\n\t\t\t\treturn build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, model);\n\t\t\t};\n\t\t}\n\t};\n}\n\nconst proto = Object.defineProperties(() => {}, styles);\n\nfunction build(_styles, _empty, key) {\n\tconst builder = function () {\n\t\treturn applyStyle.apply(builder, arguments);\n\t};\n\n\tbuilder._styles = _styles;\n\tbuilder._empty = _empty;\n\n\tconst self = this;\n\n\tObject.defineProperty(builder, 'level', {\n\t\tenumerable: true,\n\t\tget() {\n\t\t\treturn self.level;\n\t\t},\n\t\tset(level) {\n\t\t\tself.level = level;\n\t\t}\n\t});\n\n\tObject.defineProperty(builder, 'enabled', {\n\t\tenumerable: true,\n\t\tget() {\n\t\t\treturn self.enabled;\n\t\t},\n\t\tset(enabled) {\n\t\t\tself.enabled = enabled;\n\t\t}\n\t});\n\n\t// See below for fix regarding invisible grey/dim combination on Windows\n\tbuilder.hasGrey = this.hasGrey || key === 'gray' || key === 'grey';\n\n\t// `__proto__` is used because we must return a function, but there is\n\t// no way to create a function with a different prototype\n\tbuilder.__proto__ = proto; // eslint-disable-line no-proto\n\n\treturn builder;\n}\n\nfunction applyStyle() {\n\t// Support varags, but simply cast to string in case there's only one arg\n\tconst args = arguments;\n\tconst argsLen = args.length;\n\tlet str = String(arguments[0]);\n\n\tif (argsLen === 0) {\n\t\treturn '';\n\t}\n\n\tif (argsLen > 1) {\n\t\t// Don't slice `arguments`, it prevents V8 optimizations\n\t\tfor (let a = 1; a < argsLen; a++) {\n\t\t\tstr += ' ' + args[a];\n\t\t}\n\t}\n\n\tif (!this.enabled || this.level <= 0 || !str) {\n\t\treturn this._empty ? '' : str;\n\t}\n\n\t// Turns out that on Windows dimmed gray text becomes invisible in cmd.exe,\n\t// see https://github.com/chalk/chalk/issues/58\n\t// If we're on Windows and we're dealing with a gray color, temporarily make 'dim' a noop.\n\tconst originalDim = ansiStyles.dim.open;\n\tif (isSimpleWindowsTerm && this.hasGrey) {\n\t\tansiStyles.dim.open = '';\n\t}\n\n\tfor (const code of this._styles.slice().reverse()) {\n\t\t// Replace any instances already present with a re-opening code\n\t\t// otherwise only the part of the string until said closing code\n\t\t// will be colored, and the rest will simply be 'plain'.\n\t\tstr = code.open + str.replace(code.closeRe, code.open) + code.close;\n\n\t\t// Close the styling before a linebreak and reopen\n\t\t// after next line to fix a bleed issue on macOS\n\t\t// https://github.com/chalk/chalk/pull/92\n\t\tstr = str.replace(/\\r?\\n/g, `${code.close}$&${code.open}`);\n\t}\n\n\t// Reset the original `dim` if we changed it to work around the Windows dimmed gray issue\n\tansiStyles.dim.open = originalDim;\n\n\treturn str;\n}\n\nfunction chalkTag(chalk, strings) {\n\tif (!Array.isArray(strings)) {\n\t\t// If chalk() was called by itself or with a string,\n\t\t// return the string itself as a string.\n\t\treturn [].slice.call(arguments, 1).join(' ');\n\t}\n\n\tconst args = [].slice.call(arguments, 2);\n\tconst parts = [strings.raw[0]];\n\n\tfor (let i = 1; i < strings.length; i++) {\n\t\tparts.push(String(args[i - 1]).replace(/[{}\\\\]/g, '\\\\$&'));\n\t\tparts.push(String(strings.raw[i]));\n\t}\n\n\treturn template(chalk, parts.join(''));\n}\n\nObject.defineProperties(Chalk.prototype, styles);\n\nmodule.exports = Chalk(); // eslint-disable-line new-cap\nmodule.exports.supportsColor = stdoutColor;\nmodule.exports.default = module.exports; // For TypeScript\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../process/browser.js */ \"./node_modules/process/browser.js\")))\n\n//# sourceURL=file://cloudcmd/node_modules/@babel/code-frame/node_modules/chalk/index.js");
|
|
347
|
-
|
|
348
|
-
/***/ }),
|
|
349
|
-
|
|
350
|
-
/***/ "./node_modules/@babel/code-frame/node_modules/chalk/templates.js":
|
|
351
|
-
/*!************************************************************************!*\
|
|
352
|
-
!*** ./node_modules/@babel/code-frame/node_modules/chalk/templates.js ***!
|
|
353
|
-
\************************************************************************/
|
|
354
|
-
/*! no static exports found */
|
|
355
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
356
|
-
|
|
357
|
-
"use strict";
|
|
358
|
-
eval("\nconst TEMPLATE_REGEX = /(?:\\\\(u[a-f\\d]{4}|x[a-f\\d]{2}|.))|(?:\\{(~)?(\\w+(?:\\([^)]*\\))?(?:\\.\\w+(?:\\([^)]*\\))?)*)(?:[ \\t]|(?=\\r?\\n)))|(\\})|((?:.|[\\r\\n\\f])+?)/gi;\nconst STYLE_REGEX = /(?:^|\\.)(\\w+)(?:\\(([^)]*)\\))?/g;\nconst STRING_REGEX = /^(['\"])((?:\\\\.|(?!\\1)[^\\\\])*)\\1$/;\nconst ESCAPE_REGEX = /\\\\(u[a-f\\d]{4}|x[a-f\\d]{2}|.)|([^\\\\])/gi;\n\nconst ESCAPES = new Map([\n\t['n', '\\n'],\n\t['r', '\\r'],\n\t['t', '\\t'],\n\t['b', '\\b'],\n\t['f', '\\f'],\n\t['v', '\\v'],\n\t['0', '\\0'],\n\t['\\\\', '\\\\'],\n\t['e', '\\u001B'],\n\t['a', '\\u0007']\n]);\n\nfunction unescape(c) {\n\tif ((c[0] === 'u' && c.length === 5) || (c[0] === 'x' && c.length === 3)) {\n\t\treturn String.fromCharCode(parseInt(c.slice(1), 16));\n\t}\n\n\treturn ESCAPES.get(c) || c;\n}\n\nfunction parseArguments(name, args) {\n\tconst results = [];\n\tconst chunks = args.trim().split(/\\s*,\\s*/g);\n\tlet matches;\n\n\tfor (const chunk of chunks) {\n\t\tif (!isNaN(chunk)) {\n\t\t\tresults.push(Number(chunk));\n\t\t} else if ((matches = chunk.match(STRING_REGEX))) {\n\t\t\tresults.push(matches[2].replace(ESCAPE_REGEX, (m, escape, chr) => escape ? unescape(escape) : chr));\n\t\t} else {\n\t\t\tthrow new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name}')`);\n\t\t}\n\t}\n\n\treturn results;\n}\n\nfunction parseStyle(style) {\n\tSTYLE_REGEX.lastIndex = 0;\n\n\tconst results = [];\n\tlet matches;\n\n\twhile ((matches = STYLE_REGEX.exec(style)) !== null) {\n\t\tconst name = matches[1];\n\n\t\tif (matches[2]) {\n\t\t\tconst args = parseArguments(name, matches[2]);\n\t\t\tresults.push([name].concat(args));\n\t\t} else {\n\t\t\tresults.push([name]);\n\t\t}\n\t}\n\n\treturn results;\n}\n\nfunction buildStyle(chalk, styles) {\n\tconst enabled = {};\n\n\tfor (const layer of styles) {\n\t\tfor (const style of layer.styles) {\n\t\t\tenabled[style[0]] = layer.inverse ? null : style.slice(1);\n\t\t}\n\t}\n\n\tlet current = chalk;\n\tfor (const styleName of Object.keys(enabled)) {\n\t\tif (Array.isArray(enabled[styleName])) {\n\t\t\tif (!(styleName in current)) {\n\t\t\t\tthrow new Error(`Unknown Chalk style: ${styleName}`);\n\t\t\t}\n\n\t\t\tif (enabled[styleName].length > 0) {\n\t\t\t\tcurrent = current[styleName].apply(current, enabled[styleName]);\n\t\t\t} else {\n\t\t\t\tcurrent = current[styleName];\n\t\t\t}\n\t\t}\n\t}\n\n\treturn current;\n}\n\nmodule.exports = (chalk, tmp) => {\n\tconst styles = [];\n\tconst chunks = [];\n\tlet chunk = [];\n\n\t// eslint-disable-next-line max-params\n\ttmp.replace(TEMPLATE_REGEX, (m, escapeChar, inverse, style, close, chr) => {\n\t\tif (escapeChar) {\n\t\t\tchunk.push(unescape(escapeChar));\n\t\t} else if (style) {\n\t\t\tconst str = chunk.join('');\n\t\t\tchunk = [];\n\t\t\tchunks.push(styles.length === 0 ? str : buildStyle(chalk, styles)(str));\n\t\t\tstyles.push({inverse, styles: parseStyle(style)});\n\t\t} else if (close) {\n\t\t\tif (styles.length === 0) {\n\t\t\t\tthrow new Error('Found extraneous } in Chalk template literal');\n\t\t\t}\n\n\t\t\tchunks.push(buildStyle(chalk, styles)(chunk.join('')));\n\t\t\tchunk = [];\n\t\t\tstyles.pop();\n\t\t} else {\n\t\t\tchunk.push(chr);\n\t\t}\n\t});\n\n\tchunks.push(chunk.join(''));\n\n\tif (styles.length > 0) {\n\t\tconst errMsg = `Chalk template literal is missing ${styles.length} closing bracket${styles.length === 1 ? '' : 's'} (\\`}\\`)`;\n\t\tthrow new Error(errMsg);\n\t}\n\n\treturn chunks.join('');\n};\n\n\n//# sourceURL=file://cloudcmd/node_modules/@babel/code-frame/node_modules/chalk/templates.js");
|
|
359
|
-
|
|
360
|
-
/***/ }),
|
|
361
|
-
|
|
362
|
-
/***/ "./node_modules/@babel/code-frame/node_modules/escape-string-regexp/index.js":
|
|
363
|
-
/*!***********************************************************************************!*\
|
|
364
|
-
!*** ./node_modules/@babel/code-frame/node_modules/escape-string-regexp/index.js ***!
|
|
365
|
-
\***********************************************************************************/
|
|
366
|
-
/*! no static exports found */
|
|
367
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
368
|
-
|
|
369
|
-
"use strict";
|
|
370
|
-
eval("\n\nvar matchOperatorsRe = /[|\\\\{}()[\\]^$+*?.]/g;\n\nmodule.exports = function (str) {\n\tif (typeof str !== 'string') {\n\t\tthrow new TypeError('Expected a string');\n\t}\n\n\treturn str.replace(matchOperatorsRe, '\\\\$&');\n};\n\n\n//# sourceURL=file://cloudcmd/node_modules/@babel/code-frame/node_modules/escape-string-regexp/index.js");
|
|
322
|
+
eval("/* WEBPACK VAR INJECTION */(function(process) {\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.codeFrameColumns = codeFrameColumns;\nexports.default = _default;\nvar _highlight = __webpack_require__(/*! @babel/highlight */ \"./node_modules/@babel/highlight/lib/index.js\");\nvar _picocolors = _interopRequireWildcard(__webpack_require__(/*! picocolors */ \"./node_modules/picocolors/picocolors.browser.js\"), true);\nfunction _getRequireWildcardCache(e) { if (\"function\" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }\nfunction _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || \"object\" != typeof e && \"function\" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if (\"default\" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }\nconst colors = typeof process === \"object\" && (process.env.FORCE_COLOR === \"0\" || process.env.FORCE_COLOR === \"false\") ? (0, _picocolors.createColors)(false) : _picocolors.default;\nconst compose = (f, g) => v => f(g(v));\nlet pcWithForcedColor = undefined;\nfunction getColors(forceColor) {\n if (forceColor) {\n var _pcWithForcedColor;\n (_pcWithForcedColor = pcWithForcedColor) != null ? _pcWithForcedColor : pcWithForcedColor = (0, _picocolors.createColors)(true);\n return pcWithForcedColor;\n }\n return colors;\n}\nlet deprecationWarningShown = false;\nfunction getDefs(colors) {\n return {\n gutter: colors.gray,\n marker: compose(colors.red, colors.bold),\n message: compose(colors.red, colors.bold)\n };\n}\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 highlighted = (opts.highlightCode || opts.forceColor) && (0, _highlight.shouldHighlight)(opts);\n const colors = getColors(opts.forceColor);\n const defs = getDefs(colors);\n const maybeHighlight = (fmt, string) => {\n return highlighted ? fmt(string) : string;\n };\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 = highlighted ? (0, _highlight.default)(rawLines, opts) : 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 \", maybeHighlight(defs.gutter, gutter.replace(/\\d/g, \" \")), \" \", markerSpacing, maybeHighlight(defs.marker, \"^\").repeat(numberOfMarkers)].join(\"\");\n if (lastMarkerLine && opts.message) {\n markerLine += \" \" + maybeHighlight(defs.message, opts.message);\n }\n }\n return [maybeHighlight(defs.marker, \">\"), maybeHighlight(defs.gutter, gutter), line.length > 0 ? ` ${line}` : \"\", markerLine].join(\"\");\n } else {\n return ` ${maybeHighlight(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 (highlighted) {\n return colors.reset(frame);\n } else {\n return frame;\n }\n}\nfunction _default(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\n//# sourceMappingURL=index.js.map\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../process/browser.js */ \"./node_modules/process/browser.js\")))\n\n//# sourceURL=file://cloudcmd/node_modules/@babel/code-frame/lib/index.js");
|
|
371
323
|
|
|
372
324
|
/***/ }),
|
|
373
325
|
|
|
@@ -415,7 +367,7 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n
|
|
|
415
367
|
/***/ (function(module, exports, __webpack_require__) {
|
|
416
368
|
|
|
417
369
|
"use strict";
|
|
418
|
-
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = highlight;\nexports.shouldHighlight = shouldHighlight;\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\");\nvar
|
|
370
|
+
eval("/* WEBPACK VAR INJECTION */(function(process) {\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = highlight;\nexports.shouldHighlight = shouldHighlight;\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\");\nvar _picocolors = _interopRequireWildcard(__webpack_require__(/*! picocolors */ \"./node_modules/picocolors/picocolors.browser.js\"), true);\nfunction _getRequireWildcardCache(e) { if (\"function\" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }\nfunction _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || \"object\" != typeof e && \"function\" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if (\"default\" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }\nconst colors = typeof process === \"object\" && (process.env.FORCE_COLOR === \"0\" || process.env.FORCE_COLOR === \"false\") ? (0, _picocolors.createColors)(false) : _picocolors.default;\nconst compose = (f, g) => v => f(g(v));\nconst sometimesKeywords = new Set([\"as\", \"async\", \"from\", \"get\", \"of\", \"set\"]);\nfunction getDefs(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 };\n}\nconst NEWLINE = /\\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 ((0, _helperValidatorIdentifier.isKeyword)(token.value) || (0, _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 highlightTokens(defs, text) {\n let highlighted = \"\";\n for (const {\n type,\n value\n } of tokenize(text)) {\n const colorize = defs[type];\n if (colorize) {\n highlighted += value.split(NEWLINE).map(str => colorize(str)).join(\"\\n\");\n } else {\n highlighted += value;\n }\n }\n return highlighted;\n}\nfunction shouldHighlight(options) {\n return colors.isColorSupported || options.forceColor;\n}\nlet pcWithForcedColor = undefined;\nfunction getColors(forceColor) {\n if (forceColor) {\n var _pcWithForcedColor;\n (_pcWithForcedColor = pcWithForcedColor) != null ? _pcWithForcedColor : pcWithForcedColor = (0, _picocolors.createColors)(true);\n return pcWithForcedColor;\n }\n return colors;\n}\nfunction highlight(code, options = {}) {\n if (code !== \"\" && shouldHighlight(options)) {\n const defs = getDefs(getColors(options.forceColor));\n return highlightTokens(defs, code);\n } else {\n return code;\n }\n}\n{\n let chalk, chalkWithForcedColor;\n exports.getChalk = ({\n forceColor\n }) => {\n var _chalk;\n (_chalk = chalk) != null ? _chalk : chalk = __webpack_require__(/*! chalk */ \"./node_modules/@babel/highlight/node_modules/chalk/index.js\");\n if (forceColor) {\n var _chalkWithForcedColor;\n (_chalkWithForcedColor = chalkWithForcedColor) != null ? _chalkWithForcedColor : chalkWithForcedColor = new chalk.constructor({\n enabled: true,\n level: 1\n });\n return chalkWithForcedColor;\n }\n return chalk;\n };\n}\n\n//# sourceMappingURL=index.js.map\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../process/browser.js */ \"./node_modules/process/browser.js\")))\n\n//# sourceURL=file://cloudcmd/node_modules/@babel/highlight/lib/index.js");
|
|
419
371
|
|
|
420
372
|
/***/ }),
|
|
421
373
|
|
|
@@ -993,6 +945,17 @@ eval("\n\nconst findit = __webpack_require__(/*! domfs-findit */ \"./node_module
|
|
|
993
945
|
|
|
994
946
|
/***/ }),
|
|
995
947
|
|
|
948
|
+
/***/ "./node_modules/picocolors/picocolors.browser.js":
|
|
949
|
+
/*!*******************************************************!*\
|
|
950
|
+
!*** ./node_modules/picocolors/picocolors.browser.js ***!
|
|
951
|
+
\*******************************************************/
|
|
952
|
+
/*! no static exports found */
|
|
953
|
+
/***/ (function(module, exports) {
|
|
954
|
+
|
|
955
|
+
eval("var x=String;\nvar create=function() {return {isColorSupported:false,reset:x,bold:x,dim:x,italic:x,underline:x,inverse:x,hidden:x,strikethrough:x,black:x,red:x,green:x,yellow:x,blue:x,magenta:x,cyan:x,white:x,gray:x,bgBlack:x,bgRed:x,bgGreen:x,bgYellow:x,bgBlue:x,bgMagenta:x,bgCyan:x,bgWhite:x}};\nmodule.exports=create();\nmodule.exports.createColors = create;\n\n\n//# sourceURL=file://cloudcmd/node_modules/picocolors/picocolors.browser.js");
|
|
956
|
+
|
|
957
|
+
/***/ }),
|
|
958
|
+
|
|
996
959
|
/***/ "./node_modules/process/browser.js":
|
|
997
960
|
/*!*****************************************!*\
|
|
998
961
|
!*** ./node_modules/process/browser.js ***!
|
package/dist-dev/cloudcmd.js
CHANGED
|
@@ -163,7 +163,7 @@
|
|
|
163
163
|
/***/ (function(module, exports, __webpack_require__) {
|
|
164
164
|
|
|
165
165
|
"use strict";
|
|
166
|
-
eval("\n\nconst process = __webpack_require__(/*! process */ \"./node_modules/process/browser.js\");\n\n/* global DOM */\nconst Emitify = __webpack_require__(/*! emitify */ \"./node_modules/emitify/lib/emitify.js\");\nconst inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\nconst rendy = __webpack_require__(/*! rendy */ \"./node_modules/rendy/lib/rendy.js\");\nconst load = __webpack_require__(/*! load.js */ \"./node_modules/load.js/lib/load.js\");\nconst tryToCatch = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.js\");\nconst {\n addSlashToEnd\n} = __webpack_require__(/*! format-io */ \"./node_modules/format-io/lib/format.js\");\nconst pascalCase = __webpack_require__(/*! just-pascal-case */ \"./node_modules/just-pascal-case/index.js\");\nconst currify = __webpack_require__(/*! currify */ \"./node_modules/currify/lib/currify.js\");\nconst Images = __webpack_require__(/*! ./dom/images */ \"./client/dom/images.js\");\nconst {\n unregisterSW\n} = __webpack_require__(/*! ./sw/register */ \"./client/sw/register.js\");\nconst getJsonFromFileTable = __webpack_require__(/*! ./get-json-from-file-table */ \"./client/get-json-from-file-table.js\");\nconst Key = __webpack_require__(/*! ./key */ \"./client/key/index.js\");\nconst {\n apiURL,\n formatMsg,\n buildFromJSON\n} = __webpack_require__(/*! ../common/cloudfunc */ \"./common/cloudfunc.js\");\nconst loadModule = __webpack_require__(/*! ./load-module */ \"./client/load-module.js\");\nconst noJS = a => a.replace(/.js$/, '');\nconst isDev = process.env.NODE_ENV === 'development';\ninherits(CloudCmdProto, Emitify);\nmodule.exports = new CloudCmdProto(DOM);\nload.addErrorListener((e, src) => {\n const msg = `file ${src} could not be loaded`;\n Images.show.error(msg);\n});\nfunction CloudCmdProto(DOM) {\n let Listeners;\n Emitify.call(this);\n const CloudCmd = this;\n const Info = DOM.CurrentInfo;\n const {\n Storage,\n Files\n } = DOM;\n this.log = (...a) => {\n if (!isDev) return;\n console.log(...a);\n };\n this.prefix = '';\n this.prefixSocket = '';\n this.prefixURL = '';\n this.MIN_ONE_PANEL_WIDTH = 1155;\n this.HOST = location.origin || location.protocol + '//' + location.host;\n this.TITLE = 'Cloud Commander';\n this.sort = {\n left: 'name',\n right: 'name'\n };\n this.order = {\n left: 'asc',\n right: 'asc'\n };\n this.changeDir = async (path, {\n isRefresh,\n panel,\n history = true,\n noCurrent,\n currentName\n } = {}) => {\n const refresh = isRefresh;\n let panelChanged;\n if (!noCurrent && panel && panel !== Info.panel) {\n DOM.changePanel();\n panelChanged = true;\n }\n let imgPosition;\n if (panelChanged || refresh || !history) imgPosition = 'top';\n Images.show.load(imgPosition, panel);\n /* загружаем содержимое каталога */\n await ajaxLoad(addSlashToEnd(path), {\n refresh,\n history,\n noCurrent,\n currentName\n }, panel);\n };\n\n /**\n * Конструктор CloudClient, который\n * выполняет весь функционал по\n * инициализации\n */\n this.init = async (prefix, config) => {\n CloudCmd.prefix = prefix;\n CloudCmd.prefixURL = `${prefix}${apiURL}`;\n CloudCmd.prefixSocket = config.prefixSocket;\n CloudCmd.DIR_DIST = `${prefix}/dist`;\n CloudCmd.DIR_MODULES = `${this.DIR_DIST}/modules`;\n CloudCmd.config = key => config[key];\n CloudCmd.config.if = currify((key, fn, a) => config[key] && fn(a));\n CloudCmd._config = (key, value) => {\n /*\n * should be called from config.js only\n * after successful update on server\n */\n if (key === 'password') return;\n config[key] = value;\n };\n if (config.oneFilePanel) CloudCmd.MIN_ONE_PANEL_WIDTH = Infinity;\n if (!document.body.scrollIntoViewIfNeeded) await load.js(`${CloudCmd.DIR_MODULES}/polyfill.js`);\n await initModules();\n await baseInit();\n await loadStyle();\n CloudCmd.route(location.hash);\n };\n async function loadStyle() {\n const {\n prefix\n } = CloudCmd;\n const name = `${prefix}/dist/cloudcmd.common.css`;\n await load.css(name);\n }\n this.route = path => {\n const query = path.split('/');\n if (!path) return;\n const [kebabModule] = query;\n const module = noJS(pascalCase(kebabModule.slice(1)));\n const file = query[1];\n const current = DOM.getCurrentByName(file);\n if (file && !current) {\n const msg = formatMsg('set current file', file, 'error');\n CloudCmd.log(msg);\n return;\n }\n DOM.setCurrentFile(current);\n CloudCmd.execFromModule(module, 'show');\n };\n this.logOut = async () => {\n const url = CloudCmd.prefix + '/logout';\n const error = () => document.location.reload();\n const {\n prefix\n } = CloudCmd;\n await DOM.Storage.clear();\n unregisterSW(prefix);\n DOM.load.ajax({\n url,\n error\n });\n };\n const initModules = async () => {\n CloudCmd.Key = Key;\n CloudCmd.Key.bind();\n const [, modules] = await tryToCatch(Files.get, 'modules');\n const showLoad = Images.show.load;\n const doBefore = {\n edit: showLoad,\n menu: showLoad\n };\n const load = (name, path, dobefore) => {\n loadModule({\n name,\n path,\n dobefore\n });\n };\n if (!modules) return;\n for (const module of modules.local) {\n load(null, module, doBefore[module]);\n }\n };\n async function saveCurrentName(currentName) {\n await Storage.set('current-name', currentName);\n }\n async function baseInit() {\n const files = DOM.getFiles();\n CloudCmd.on('current-file', DOM.updateCurrentInfo);\n CloudCmd.on('current-name', saveCurrentName);\n const name = await Storage.get('current-name');\n const currentFile = name && DOM.getCurrentByName(name) || files[0];\n\n /* выделяем строку с первым файлом */\n if (files) DOM.setCurrentFile(currentFile, {\n // when hash is present\n // it should be handled with this.route\n // overwre otherwise\n history: !location.hash\n });\n const dirPath = DOM.getCurrentDirPath();\n Listeners = CloudCmd.Listeners;\n Listeners.init();\n const panels = getPanels();\n panels.forEach(Listeners.setOnPanel);\n Listeners.initKeysPanel();\n if (!CloudCmd.config('dirStorage')) return;\n const data = await Storage.get(dirPath);\n if (!data) await Storage.setJson(dirPath, getJsonFromFileTable());\n }\n function getPanels() {\n const panels = ['left'];\n if (CloudCmd.config('oneFilePanel')) return panels;\n return [...panels, 'right'];\n }\n this.execFromModule = async (moduleName, funcName, ...args) => {\n await CloudCmd[moduleName]();\n const func = CloudCmd[moduleName][funcName];\n func(...args);\n };\n this.refresh = async (options = {}) => {\n const {\n panel = Info.panel,\n currentName\n } = options;\n const path = DOM.getCurrentDirPath(panel);\n const isRefresh = true;\n const history = false;\n const noCurrent = options === null || options === void 0 ? void 0 : options.noCurrent;\n await CloudCmd.changeDir(path, {\n isRefresh,\n history,\n panel,\n noCurrent,\n currentName\n });\n };\n\n /**\n * Функция загружает json-данные о Файловой Системе\n * через ajax-запрос.\n * @param path - каталог для чтения\n * @param options\n * { refresh, history } - необходимость обновить данные о каталоге\n * @param panel\n * @param callback\n *\n */\n async function ajaxLoad(path, options = {}, panel) {\n const {\n RESTful\n } = DOM;\n CloudCmd.log(`reading dir: \"${path}\";`);\n const dirStorage = CloudCmd.config('dirStorage');\n const json = dirStorage && (await Storage.getJson(path));\n const name = options.currentName || Info.name;\n const {\n noCurrent,\n refresh\n } = options;\n if (!refresh && json) return await createFileTable(json, panel, options);\n const position = DOM.getPanelPosition(panel);\n const sort = CloudCmd.sort[position];\n const order = CloudCmd.order[position];\n const query = rendy('?sort={{ sort }}&order={{ order }}', {\n sort,\n order\n });\n const [, newObj] = await RESTful.read(path + query, 'json');\n if (!newObj)\n // that's OK, error handled by RESTful\n return;\n options.sort = sort;\n options.order = order;\n await createFileTable(newObj, panel, options);\n if (refresh && !noCurrent) DOM.setCurrentByName(name);\n if (!CloudCmd.config('dirStorage')) return;\n Storage.setJson(path, newObj);\n }\n\n /**\n * Функция строит файловую таблицу\n * @param json - данные о файлах\n * @param panelParam\n * @param history\n * @param callback\n */\n async function createFileTable(data, panelParam, options) {\n const {\n history,\n noCurrent\n } = options;\n const names = ['file', 'path', 'link', 'pathLink'];\n const [error, [file, path, link, pathLink]] = await tryToCatch(Files.get, names);\n if (error) return DOM.Dialog.alert(error.responseText);\n const panel = panelParam || DOM.getPanel();\n const {\n prefix\n } = CloudCmd;\n const {\n dir,\n name\n } = Info;\n const {\n childNodes\n } = panel;\n let i = childNodes.length;\n while (i--) panel.removeChild(panel.lastChild);\n panel.innerHTML = buildFromJSON({\n sort: options.sort,\n order: options.order,\n data,\n id: panel.id,\n prefix,\n template: {\n file,\n path,\n pathLink,\n link\n }\n });\n Listeners.setOnPanel(panel);\n if (!noCurrent) {\n let current;\n if (name === '..' && dir !== '/') current = DOM.getCurrentByName(dir);\n if (!current) [current] = DOM.getFiles(panel);\n DOM.setCurrentFile(current, {\n history\n });\n CloudCmd.emit('active-dir', Info.dirPath);\n }\n }\n this.goToParentDir = async () => {\n const {\n dir,\n dirPath,\n parentDirPath,\n panel\n } = Info;\n if (dirPath === parentDirPath) return;\n const path = parentDirPath;\n await CloudCmd.changeDir(path);\n const current = DOM.getCurrentByName(dir);\n const [first] = DOM.getFiles(panel);\n DOM.setCurrentFile(current || first, {\n history\n });\n };\n}\n\n//# sourceURL=file://cloudcmd/client/client.js");
|
|
166
|
+
eval("\n\nconst process = __webpack_require__(/*! node:process */ \"./node_modules/process/browser.js\");\n\n/* global DOM */\nconst Emitify = __webpack_require__(/*! emitify */ \"./node_modules/emitify/lib/emitify.js\");\nconst inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\nconst rendy = __webpack_require__(/*! rendy */ \"./node_modules/rendy/lib/rendy.js\");\nconst load = __webpack_require__(/*! load.js */ \"./node_modules/load.js/lib/load.js\");\nconst tryToCatch = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.js\");\nconst {\n addSlashToEnd\n} = __webpack_require__(/*! format-io */ \"./node_modules/format-io/lib/format.js\");\nconst pascalCase = __webpack_require__(/*! just-pascal-case */ \"./node_modules/just-pascal-case/index.js\");\nconst currify = __webpack_require__(/*! currify */ \"./node_modules/currify/lib/currify.js\");\nconst Images = __webpack_require__(/*! ./dom/images */ \"./client/dom/images.js\");\nconst {\n unregisterSW\n} = __webpack_require__(/*! ./sw/register */ \"./client/sw/register.js\");\nconst getJsonFromFileTable = __webpack_require__(/*! ./get-json-from-file-table */ \"./client/get-json-from-file-table.js\");\nconst Key = __webpack_require__(/*! ./key */ \"./client/key/index.js\");\nconst {\n apiURL,\n formatMsg,\n buildFromJSON\n} = __webpack_require__(/*! ../common/cloudfunc */ \"./common/cloudfunc.js\");\nconst loadModule = __webpack_require__(/*! ./load-module */ \"./client/load-module.js\");\nconst noJS = a => a.replace(/.js$/, '');\nconst isDev = process.env.NODE_ENV === 'development';\ninherits(CloudCmdProto, Emitify);\nmodule.exports = new CloudCmdProto(DOM);\nload.addErrorListener((e, src) => {\n const msg = `file ${src} could not be loaded`;\n Images.show.error(msg);\n});\nfunction CloudCmdProto(DOM) {\n let Listeners;\n Emitify.call(this);\n const CloudCmd = this;\n const Info = DOM.CurrentInfo;\n const {\n Storage,\n Files\n } = DOM;\n this.log = (...a) => {\n if (!isDev) return;\n console.log(...a);\n };\n this.prefix = '';\n this.prefixSocket = '';\n this.prefixURL = '';\n this.MIN_ONE_PANEL_WIDTH = 1155;\n this.HOST = location.origin || location.protocol + '//' + location.host;\n this.TITLE = 'Cloud Commander';\n this.sort = {\n left: 'name',\n right: 'name'\n };\n this.order = {\n left: 'asc',\n right: 'asc'\n };\n this.changeDir = async (path, {\n isRefresh,\n panel,\n history = true,\n noCurrent,\n currentName\n } = {}) => {\n const refresh = isRefresh;\n let panelChanged;\n if (!noCurrent && panel && panel !== Info.panel) {\n DOM.changePanel();\n panelChanged = true;\n }\n let imgPosition;\n if (panelChanged || refresh || !history) imgPosition = 'top';\n Images.show.load(imgPosition, panel);\n /* загружаем содержимое каталога */\n await ajaxLoad(addSlashToEnd(path), {\n refresh,\n history,\n noCurrent,\n currentName\n }, panel);\n };\n\n /**\n * Конструктор CloudClient, который\n * выполняет весь функционал по\n * инициализации\n */\n this.init = async (prefix, config) => {\n CloudCmd.prefix = prefix;\n CloudCmd.prefixURL = `${prefix}${apiURL}`;\n CloudCmd.prefixSocket = config.prefixSocket;\n CloudCmd.DIR_DIST = `${prefix}/dist`;\n CloudCmd.DIR_MODULES = `${this.DIR_DIST}/modules`;\n CloudCmd.config = key => config[key];\n CloudCmd.config.if = currify((key, fn, a) => config[key] && fn(a));\n CloudCmd._config = (key, value) => {\n /*\n * should be called from config.js only\n * after successful update on server\n */\n if (key === 'password') return;\n config[key] = value;\n };\n if (config.oneFilePanel) CloudCmd.MIN_ONE_PANEL_WIDTH = Infinity;\n if (!document.body.scrollIntoViewIfNeeded) await load.js(`${CloudCmd.DIR_MODULES}/polyfill.js`);\n await initModules();\n await baseInit();\n await loadStyle();\n CloudCmd.route(location.hash);\n };\n async function loadStyle() {\n const {\n prefix\n } = CloudCmd;\n const name = `${prefix}/dist/cloudcmd.common.css`;\n await load.css(name);\n }\n this.route = path => {\n const query = path.split('/');\n if (!path) return;\n const [kebabModule] = query;\n const module = noJS(pascalCase(kebabModule.slice(1)));\n const file = query[1];\n const current = DOM.getCurrentByName(file);\n if (file && !current) {\n const msg = formatMsg('set current file', file, 'error');\n CloudCmd.log(msg);\n return;\n }\n DOM.setCurrentFile(current);\n CloudCmd.execFromModule(module, 'show');\n };\n this.logOut = async () => {\n const url = CloudCmd.prefix + '/logout';\n const error = () => document.location.reload();\n const {\n prefix\n } = CloudCmd;\n await DOM.Storage.clear();\n unregisterSW(prefix);\n DOM.load.ajax({\n url,\n error\n });\n };\n const initModules = async () => {\n CloudCmd.Key = Key;\n CloudCmd.Key.bind();\n const [, modules] = await tryToCatch(Files.get, 'modules');\n const showLoad = Images.show.load;\n const doBefore = {\n edit: showLoad,\n menu: showLoad\n };\n const load = (name, path, dobefore) => {\n loadModule({\n name,\n path,\n dobefore\n });\n };\n if (!modules) return;\n for (const module of modules.local) {\n load(null, module, doBefore[module]);\n }\n };\n async function saveCurrentName(currentName) {\n await Storage.set('current-name', currentName);\n }\n async function baseInit() {\n const files = DOM.getFiles();\n CloudCmd.on('current-file', DOM.updateCurrentInfo);\n CloudCmd.on('current-name', saveCurrentName);\n const name = await Storage.get('current-name');\n const currentFile = name && DOM.getCurrentByName(name) || files[0];\n\n /* выделяем строку с первым файлом */\n if (files) DOM.setCurrentFile(currentFile, {\n // when hash is present\n // it should be handled with this.route\n // overwre otherwise\n history: !location.hash\n });\n const dirPath = DOM.getCurrentDirPath();\n Listeners = CloudCmd.Listeners;\n Listeners.init();\n const panels = getPanels();\n panels.forEach(Listeners.setOnPanel);\n Listeners.initKeysPanel();\n if (!CloudCmd.config('dirStorage')) return;\n const data = await Storage.get(dirPath);\n if (!data) await Storage.setJson(dirPath, getJsonFromFileTable());\n }\n function getPanels() {\n const panels = ['left'];\n if (CloudCmd.config('oneFilePanel')) return panels;\n return [...panels, 'right'];\n }\n this.execFromModule = async (moduleName, funcName, ...args) => {\n await CloudCmd[moduleName]();\n const func = CloudCmd[moduleName][funcName];\n func(...args);\n };\n this.refresh = async (options = {}) => {\n const {\n panel = Info.panel,\n currentName\n } = options;\n const path = DOM.getCurrentDirPath(panel);\n const isRefresh = true;\n const history = false;\n const noCurrent = options === null || options === void 0 ? void 0 : options.noCurrent;\n await CloudCmd.changeDir(path, {\n isRefresh,\n history,\n panel,\n noCurrent,\n currentName\n });\n };\n\n /**\n * Функция загружает json-данные о Файловой Системе\n * через ajax-запрос.\n * @param path - каталог для чтения\n * @param options\n * { refresh, history } - необходимость обновить данные о каталоге\n * @param panel\n * @param callback\n *\n */\n async function ajaxLoad(path, options = {}, panel) {\n const {\n RESTful\n } = DOM;\n CloudCmd.log(`reading dir: \"${path}\";`);\n const dirStorage = CloudCmd.config('dirStorage');\n const json = dirStorage && (await Storage.getJson(path));\n const name = options.currentName || Info.name;\n const {\n noCurrent,\n refresh\n } = options;\n if (!refresh && json) return await createFileTable(json, panel, options);\n const position = DOM.getPanelPosition(panel);\n const sort = CloudCmd.sort[position];\n const order = CloudCmd.order[position];\n const query = rendy('?sort={{ sort }}&order={{ order }}', {\n sort,\n order\n });\n const [, newObj] = await RESTful.read(path + query, 'json');\n if (!newObj)\n // that's OK, error handled by RESTful\n return;\n options.sort = sort;\n options.order = order;\n await createFileTable(newObj, panel, options);\n if (refresh && !noCurrent) DOM.setCurrentByName(name);\n if (!CloudCmd.config('dirStorage')) return;\n Storage.setJson(path, newObj);\n }\n\n /**\n * Функция строит файловую таблицу\n * @param json - данные о файлах\n * @param panelParam\n * @param history\n * @param callback\n */\n async function createFileTable(data, panelParam, options) {\n const {\n history,\n noCurrent\n } = options;\n const names = ['file', 'path', 'link', 'pathLink'];\n const [error, [file, path, link, pathLink]] = await tryToCatch(Files.get, names);\n if (error) return DOM.Dialog.alert(error.responseText);\n const panel = panelParam || DOM.getPanel();\n const {\n prefix\n } = CloudCmd;\n const {\n dir,\n name\n } = Info;\n const {\n childNodes\n } = panel;\n let i = childNodes.length;\n while (i--) panel.removeChild(panel.lastChild);\n panel.innerHTML = buildFromJSON({\n sort: options.sort,\n order: options.order,\n data,\n id: panel.id,\n prefix,\n template: {\n file,\n path,\n pathLink,\n link\n }\n });\n Listeners.setOnPanel(panel);\n if (!noCurrent) {\n let current;\n if (name === '..' && dir !== '/') current = DOM.getCurrentByName(dir);\n if (!current) [current] = DOM.getFiles(panel);\n DOM.setCurrentFile(current, {\n history\n });\n CloudCmd.emit('active-dir', Info.dirPath);\n }\n }\n this.goToParentDir = async () => {\n const {\n dir,\n dirPath,\n parentDirPath,\n panel\n } = Info;\n if (dirPath === parentDirPath) return;\n const path = parentDirPath;\n await CloudCmd.changeDir(path);\n const current = DOM.getCurrentByName(dir);\n const [first] = DOM.getFiles(panel);\n DOM.setCurrentFile(current || first, {\n history\n });\n };\n}\n\n//# sourceURL=file://cloudcmd/client/client.js");
|
|
167
167
|
|
|
168
168
|
/***/ }),
|
|
169
169
|
|
|
@@ -175,7 +175,7 @@ eval("\n\nconst process = __webpack_require__(/*! process */ \"./node_modules/pr
|
|
|
175
175
|
/***/ (function(module, exports, __webpack_require__) {
|
|
176
176
|
|
|
177
177
|
"use strict";
|
|
178
|
-
eval("\n\nconst process = __webpack_require__(/*! process */ \"./node_modules/process/browser.js\");\n__webpack_require__(/*! ../css/main.css */ \"./css/main.css\");\n__webpack_require__(/*! ../css/nojs.css */ \"./css/nojs.css\");\n__webpack_require__(/*! ../css/columns/name-size-date.css */ \"./css/columns/name-size-date.css\");\n__webpack_require__(/*! ../css/columns/name-size.css */ \"./css/columns/name-size.css\");\nconst wraptile = __webpack_require__(/*! wraptile */ \"./node_modules/wraptile/lib/wraptile.js\");\nconst load = __webpack_require__(/*! load.js */ \"./node_modules/load.js/lib/load.js\");\nconst {\n registerSW,\n listenSW\n} = __webpack_require__(/*! ./sw/register */ \"./client/sw/register.js\");\nconst isDev = process.env.NODE_ENV === 'development';\nmodule.exports = window.CloudCmd = async config => {\n window.Util = __webpack_require__(/*! ../common/util */ \"./common/util.js\");\n window.CloudFunc = __webpack_require__(/*! ../common/cloudfunc */ \"./common/cloudfunc.js\");\n window.DOM = __webpack_require__(/*! ./dom */ \"./client/dom/index.js\");\n window.CloudCmd = __webpack_require__(/*! ./client */ \"./client/client.js\");\n await register(config);\n __webpack_require__(/*! ./listeners */ \"./client/listeners/index.js\");\n __webpack_require__(/*! ./key */ \"./client/key/index.js\");\n __webpack_require__(/*! ./sort */ \"./client/sort.js\");\n const prefix = getPrefix(config.prefix);\n window.CloudCmd.init(prefix, config);\n};\nfunction getPrefix(prefix) {\n if (!prefix) return '';\n if (!prefix.indexOf('/')) return prefix;\n return `/${prefix}`;\n}\nconst onUpdateFound = wraptile(async config => {\n if (isDev) return;\n const {\n DOM\n } = window;\n const prefix = getPrefix(config.prefix);\n await load.js(`${prefix}/dist/cloudcmd.common.js`);\n await load.js(`${prefix}/dist/cloudcmd.js`);\n console.log('cloudcmd: sw: updated');\n DOM.Events.removeAll();\n window.CloudCmd(config);\n});\nasync function register(config) {\n const {\n prefix\n } = config;\n const sw = await registerSW(prefix);\n listenSW(sw, 'updatefound', onUpdateFound(config));\n}\n\n//# sourceURL=file://cloudcmd/client/cloudcmd.js");
|
|
178
|
+
eval("\n\nconst process = __webpack_require__(/*! node:process */ \"./node_modules/process/browser.js\");\n__webpack_require__(/*! ../css/main.css */ \"./css/main.css\");\n__webpack_require__(/*! ../css/nojs.css */ \"./css/nojs.css\");\n__webpack_require__(/*! ../css/columns/name-size-date.css */ \"./css/columns/name-size-date.css\");\n__webpack_require__(/*! ../css/columns/name-size.css */ \"./css/columns/name-size.css\");\nconst wraptile = __webpack_require__(/*! wraptile */ \"./node_modules/wraptile/lib/wraptile.js\");\nconst load = __webpack_require__(/*! load.js */ \"./node_modules/load.js/lib/load.js\");\nconst {\n registerSW,\n listenSW\n} = __webpack_require__(/*! ./sw/register */ \"./client/sw/register.js\");\nconst isDev = process.env.NODE_ENV === 'development';\nmodule.exports = window.CloudCmd = async config => {\n window.Util = __webpack_require__(/*! ../common/util */ \"./common/util.js\");\n window.CloudFunc = __webpack_require__(/*! ../common/cloudfunc */ \"./common/cloudfunc.js\");\n window.DOM = __webpack_require__(/*! ./dom */ \"./client/dom/index.js\");\n window.CloudCmd = __webpack_require__(/*! ./client */ \"./client/client.js\");\n await register(config);\n __webpack_require__(/*! ./listeners */ \"./client/listeners/index.js\");\n __webpack_require__(/*! ./key */ \"./client/key/index.js\");\n __webpack_require__(/*! ./sort */ \"./client/sort.js\");\n const prefix = getPrefix(config.prefix);\n window.CloudCmd.init(prefix, config);\n};\nfunction getPrefix(prefix) {\n if (!prefix) return '';\n if (!prefix.indexOf('/')) return prefix;\n return `/${prefix}`;\n}\nconst onUpdateFound = wraptile(async config => {\n if (isDev) return;\n const {\n DOM\n } = window;\n const prefix = getPrefix(config.prefix);\n await load.js(`${prefix}/dist/cloudcmd.common.js`);\n await load.js(`${prefix}/dist/cloudcmd.js`);\n console.log('cloudcmd: sw: updated');\n DOM.Events.removeAll();\n window.CloudCmd(config);\n});\nasync function register(config) {\n const {\n prefix\n } = config;\n const sw = await registerSW(prefix);\n listenSW(sw, 'updatefound', onUpdateFound(config));\n}\n\n//# sourceURL=file://cloudcmd/client/cloudcmd.js");
|
|
179
179
|
|
|
180
180
|
/***/ }),
|
|
181
181
|
|
package/dist-dev/modules/view.js
CHANGED
|
@@ -175,7 +175,7 @@ eval("/* global CloudCmd, DOM */\n\n\n\n__webpack_require__(/*! ../../../css/vie
|
|
|
175
175
|
/***/ (function(module, exports, __webpack_require__) {
|
|
176
176
|
|
|
177
177
|
"use strict";
|
|
178
|
-
eval("\n\nconst {\n extname\n} = __webpack_require__(/*! path */ \"./node_modules/path-browserify/index.js\");\nconst currify = __webpack_require__(/*! currify */ \"./node_modules/currify/lib/currify.js\");\nconst testRegExp = currify((name, reg) => reg.test(name));\nconst getRegExp = ext => RegExp(`\\\\.${ext}$`, 'i');\nconst isPDF = a => /\\.pdf$/i.test(a);\nconst isHTML = a => /\\.html$/.test(a);\nconst isMarkdown = a => /.\\.md$/.test(a);\nmodule.exports.getType = async path => {\n const ext = extname(path);\n if (!ext) path = await detectType(path);\n if (isPDF(path)) return 'pdf';\n if (isImage(path)) return 'image';\n if (isMedia(path)) return 'media';\n if (isHTML(path)) return 'html';\n if (isMarkdown(path)) return 'markdown';\n};\nmodule.exports.isImage = isImage;\nfunction isImage(name) {\n const images = ['jp(e|g|eg)', 'gif', 'png', 'bmp', 'webp', 'svg', 'ico'];\n return images.map(getRegExp).some(testRegExp(name));\n}\nfunction isMedia(name) {\n return isAudio(name) || isVideo(name);\n}\nmodule.exports.isAudio = isAudio;\nfunction isAudio(name) {\n return /\\.(mp3|ogg|m4a)$/i.test(name);\n}\nfunction isVideo(name) {\n return /\\.(mp4|avi|webm)$/i.test(name);\n}\nmodule.exports._detectType = detectType;\nasync function detectType(path) {\n const {\n headers\n } = await fetch(path, {\n method: 'HEAD'\n });\n for (const [name, value] of headers) {\n if (name === 'content-type') return `.${value.split('/').pop()}`;\n }\n return '';\n}\n\n//# sourceURL=file://cloudcmd/client/modules/view/types.js");
|
|
178
|
+
eval("\n\nconst {\n extname\n} = __webpack_require__(/*! node:path */ \"./node_modules/path-browserify/index.js\");\nconst currify = __webpack_require__(/*! currify */ \"./node_modules/currify/lib/currify.js\");\nconst testRegExp = currify((name, reg) => reg.test(name));\nconst getRegExp = ext => RegExp(`\\\\.${ext}$`, 'i');\nconst isPDF = a => /\\.pdf$/i.test(a);\nconst isHTML = a => /\\.html$/.test(a);\nconst isMarkdown = a => /.\\.md$/.test(a);\nmodule.exports.getType = async path => {\n const ext = extname(path);\n if (!ext) path = await detectType(path);\n if (isPDF(path)) return 'pdf';\n if (isImage(path)) return 'image';\n if (isMedia(path)) return 'media';\n if (isHTML(path)) return 'html';\n if (isMarkdown(path)) return 'markdown';\n};\nmodule.exports.isImage = isImage;\nfunction isImage(name) {\n const images = ['jp(e|g|eg)', 'gif', 'png', 'bmp', 'webp', 'svg', 'ico'];\n return images.map(getRegExp).some(testRegExp(name));\n}\nfunction isMedia(name) {\n return isAudio(name) || isVideo(name);\n}\nmodule.exports.isAudio = isAudio;\nfunction isAudio(name) {\n return /\\.(mp3|ogg|m4a)$/i.test(name);\n}\nfunction isVideo(name) {\n return /\\.(mp4|avi|webm)$/i.test(name);\n}\nmodule.exports._detectType = detectType;\nasync function detectType(path) {\n const {\n headers\n } = await fetch(path, {\n method: 'HEAD'\n });\n for (const [name, value] of headers) {\n if (name === 'content-type') return `.${value.split('/').pop()}`;\n }\n return '';\n}\n\n//# sourceURL=file://cloudcmd/client/modules/view/types.js");
|
|
179
179
|
|
|
180
180
|
/***/ }),
|
|
181
181
|
|
package/dist-dev/sw.js
CHANGED
|
@@ -101,7 +101,7 @@ var serviceWorkerOption = {
|
|
|
101
101
|
/***/ (function(module, exports, __webpack_require__) {
|
|
102
102
|
|
|
103
103
|
"use strict";
|
|
104
|
-
eval("\n\nconst process = __webpack_require__(/*! process */ \"./node_modules/process/browser.js\");\nconst tryToCatch = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.js\");\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 = \"
|
|
104
|
+
eval("\n\nconst process = __webpack_require__(/*! node:process */ \"./node_modules/process/browser.js\");\nconst tryToCatch = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.js\");\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 Mar 20 2024 13:13:23 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");
|
|
105
105
|
|
|
106
106
|
/***/ }),
|
|
107
107
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cloudcmd",
|
|
3
|
-
"version": "17.1.
|
|
3
|
+
"version": "17.1.4",
|
|
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",
|
|
@@ -121,6 +121,7 @@
|
|
|
121
121
|
"just-snake-case": "^1.1.0",
|
|
122
122
|
"markdown-it": "^14.0.0",
|
|
123
123
|
"mellow": "^3.0.0",
|
|
124
|
+
"nano-memoize": "^3.0.16",
|
|
124
125
|
"nomine": "^4.0.0",
|
|
125
126
|
"object.omit": "^3.0.0",
|
|
126
127
|
"once": "^1.4.0",
|
|
@@ -171,7 +172,7 @@
|
|
|
171
172
|
"domtokenlist-shim": "^1.2.0",
|
|
172
173
|
"emitify": "^4.0.1",
|
|
173
174
|
"eslint": "^8.0.1",
|
|
174
|
-
"eslint-plugin-n": "^
|
|
175
|
+
"eslint-plugin-n": "^17.0.0-4",
|
|
175
176
|
"eslint-plugin-putout": "^22.0.0",
|
|
176
177
|
"extract-text-webpack-plugin": "^4.0.0-alpha.0",
|
|
177
178
|
"gritty": "^8.0.0",
|
package/server/cloudcmd.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const
|
|
3
|
+
const fullstore = require('fullstore');
|
|
4
|
+
const process = require('node:process');
|
|
4
5
|
const DIR = `${__dirname}/`;
|
|
5
6
|
const DIR_COMMON = `${DIR}../common/`;
|
|
6
|
-
const path = require('path');
|
|
7
|
+
const path = require('node:path');
|
|
7
8
|
|
|
8
|
-
const fs = require('fs');
|
|
9
|
+
const fs = require('node:fs');
|
|
9
10
|
const cloudfunc = require(`${DIR_COMMON}cloudfunc`);
|
|
10
11
|
|
|
11
12
|
const authentication = require(`${DIR}auth`);
|
|
@@ -34,11 +35,12 @@ const nomine = require('nomine');
|
|
|
34
35
|
const fileop = require('@cloudcmd/fileop');
|
|
35
36
|
const DIR_ROOT = `${DIR}../`;
|
|
36
37
|
|
|
37
|
-
const isDev = process.env.NODE_ENV === 'development';
|
|
38
38
|
const getDist = (isDev) => isDev ? 'dist-dev' : 'dist';
|
|
39
39
|
|
|
40
|
+
const isDev = fullstore(process.env.NODE_ENV === 'development');
|
|
41
|
+
|
|
40
42
|
const getIndexPath = (isDev) => path.join(DIR, '..', `${getDist(isDev)}/index.html`);
|
|
41
|
-
const html = fs.readFileSync(getIndexPath(isDev), 'utf8');
|
|
43
|
+
const html = fs.readFileSync(getIndexPath(isDev()), 'utf8');
|
|
42
44
|
|
|
43
45
|
const initAuth = currify(_initAuth);
|
|
44
46
|
const notEmpty = (a) => a;
|
|
@@ -255,9 +257,10 @@ function logout(req, res, next) {
|
|
|
255
257
|
res.sendStatus(401);
|
|
256
258
|
}
|
|
257
259
|
|
|
260
|
+
module.exports._isDev = isDev;
|
|
258
261
|
module.exports._replaceDist = replaceDist;
|
|
259
262
|
function replaceDist(url) {
|
|
260
|
-
if (!isDev)
|
|
263
|
+
if (!isDev())
|
|
261
264
|
return url;
|
|
262
265
|
|
|
263
266
|
return url.replace(/^\/dist\//, '/dist-dev/');
|