cloudcmd 16.16.2 → 16.17.0
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 +11 -0
- package/HELP.md +5 -3
- package/README.md +2 -2
- package/bin/cloudcmd.mjs +3 -2
- package/bin/release.mjs +2 -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/config.js +1 -1
- package/dist/modules/edit-file-vim.js +1 -1
- package/dist/modules/edit-names-vim.js +1 -1
- package/dist/modules/edit.js +1 -1
- package/dist/modules/markdown.js +1 -1
- package/dist/modules/menu.js +1 -1
- package/dist/modules/operation.js +1 -1
- package/dist/modules/terminal-run.js +1 -1
- package/dist/modules/upload.js +1 -1
- package/dist/modules/view.js +1 -1
- package/dist/sw.js +1 -1
- package/dist/sw.js.map +1 -1
- package/dist-dev/cloudcmd.common.js +15 -15
- package/dist-dev/cloudcmd.js +2 -2
- package/dist-dev/sw.js +12 -1
- package/package.json +3 -3
- package/server/cloudcmd.js +1 -0
- package/server/columns.js +1 -0
- package/server/env.js +1 -1
- package/server/exit.js +1 -0
- package/server/repl.js +1 -0
- package/server/rest/index.js +1 -0
- package/server/rest/info.js +1 -0
- package/server/server.mjs +3 -2
package/dist/modules/cloud.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e){function r(r){for(var n,l,u=r[0],p=r[1],a=r[2],f=0,s=[];f<u.length;f++)l=u[f],Object.prototype.hasOwnProperty.call(o,l)&&o[l]&&s.push(o[l][0]),o[l]=0;for(n in p)Object.prototype.hasOwnProperty.call(p,n)&&(e[n]=p[n]);for(c&&c(r);s.length;)s.shift()();return i.push.apply(i,a||[]),t()}function t(){for(var e,r=0;r<i.length;r++){for(var t=i[r],n=!0,u=1;u<t.length;u++){var p=t[u];0!==o[p]&&(n=!1)}n&&(i.splice(r--,1),e=l(l.s=t[0]))}return e}var n={},o={1:0},i=[];function l(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,l),t.l=!0,t.exports}l.m=e,l.c=n,l.d=function(e,r,t){l.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},l.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.t=function(e,r){if(1&r&&(e=l(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(l.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)l.d(t,n,function(r){return e[r]}.bind(null,n));return t},l.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return l.d(r,"a",r),r},l.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},l.p="/dist/";var u=window.webpackJsonp=window.webpackJsonp||[],p=u.push.bind(u);u.push=r,u=u.slice();for(var a=0;a<u.length;a++)r(u[a]);var c=p;i.push([120,0]),t()}({120:function(e,r,t){"use strict";const n=t(5),o=t(0),i=t(4),{ajax:l}=t(
|
|
1
|
+
!function(e){function r(r){for(var n,l,u=r[0],p=r[1],a=r[2],f=0,s=[];f<u.length;f++)l=u[f],Object.prototype.hasOwnProperty.call(o,l)&&o[l]&&s.push(o[l][0]),o[l]=0;for(n in p)Object.prototype.hasOwnProperty.call(p,n)&&(e[n]=p[n]);for(c&&c(r);s.length;)s.shift()();return i.push.apply(i,a||[]),t()}function t(){for(var e,r=0;r<i.length;r++){for(var t=i[r],n=!0,u=1;u<t.length;u++){var p=t[u];0!==o[p]&&(n=!1)}n&&(i.splice(r--,1),e=l(l.s=t[0]))}return e}var n={},o={1:0},i=[];function l(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,l),t.l=!0,t.exports}l.m=e,l.c=n,l.d=function(e,r,t){l.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},l.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.t=function(e,r){if(1&r&&(e=l(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(l.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)l.d(t,n,function(r){return e[r]}.bind(null,n));return t},l.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return l.d(r,"a",r),r},l.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},l.p="/dist/";var u=window.webpackJsonp=window.webpackJsonp||[],p=u.push.bind(u);u.push=r,u=u.slice();for(var a=0;a<u.length;a++)r(u[a]);var c=p;i.push([120,0]),t()}({120:function(e,r,t){"use strict";const n=t(5),o=t(0),i=t(4),{ajax:l}=t(15),u=t(16),p=t(1),{log:a}=CloudCmd,c=o((function(e,r){const{url:t,filename:o}=r,i=n.with(e,o);l({url:t,responseType:"arraybuffer",success:i})}));CloudCmd.Cloud=e.exports,e.exports.init=async()=>{const[e]=await Promise.all([u.get("modules"),i.js("//api.filepicker.io/v2/filepicker.js")]),{key:r}=e.data.FilePicker;filepicker.setKey(r),p.hide()},e.exports.uploadFile=(e,r)=>{filepicker.store(r,{mimetype:"",filename:e},e=>{filepicker.exportFile(e,a,a)})},e.exports.saveFile=e=>{filepicker.pick(c(e))}}});
|
|
2
2
|
//# sourceMappingURL=cloud.js.map
|
package/dist/modules/config.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e){function t(t){for(var o,s,i=t[0],a=t[1],u=t[2],f=0,d=[];f<i.length;f++)s=i[f],Object.prototype.hasOwnProperty.call(r,s)&&r[s]&&d.push(r[s][0]),r[s]=0;for(o in a)Object.prototype.hasOwnProperty.call(a,o)&&(e[o]=a[o]);for(l&&l(t);d.length;)d.shift()();return c.push.apply(c,u||[]),n()}function n(){for(var e,t=0;t<c.length;t++){for(var n=c[t],o=!0,i=1;i<n.length;i++){var a=n[i];0!==r[a]&&(o=!1)}o&&(c.splice(t--,1),e=s(s.s=n[0]))}return e}var o={},r={3:0},c=[];function s(t){if(o[t])return o[t].exports;var n=o[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,s),n.l=!0,n.exports}s.m=e,s.c=o,s.d=function(e,t,n){s.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},s.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.t=function(e,t){if(1&t&&(e=s(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(s.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)s.d(n,o,function(t){return e[t]}.bind(null,o));return n},s.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return s.d(t,"a",t),t},s.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},s.p="/dist/";var i=window.webpackJsonp=window.webpackJsonp||[],a=i.push.bind(i);i.push=t,i=i.slice();for(var u=0;u<i.length;u++)t(i[u]);var l=a;c.push([106,0]),n()}({106:function(e,t,n){"use strict";n(185);const o=n(
|
|
1
|
+
!function(e){function t(t){for(var o,s,i=t[0],a=t[1],u=t[2],f=0,d=[];f<i.length;f++)s=i[f],Object.prototype.hasOwnProperty.call(r,s)&&r[s]&&d.push(r[s][0]),r[s]=0;for(o in a)Object.prototype.hasOwnProperty.call(a,o)&&(e[o]=a[o]);for(l&&l(t);d.length;)d.shift()();return c.push.apply(c,u||[]),n()}function n(){for(var e,t=0;t<c.length;t++){for(var n=c[t],o=!0,i=1;i<n.length;i++){var a=n[i];0!==r[a]&&(o=!1)}o&&(c.splice(t--,1),e=s(s.s=n[0]))}return e}var o={},r={3:0},c=[];function s(t){if(o[t])return o[t].exports;var n=o[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,s),n.l=!0,n.exports}s.m=e,s.c=o,s.d=function(e,t,n){s.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},s.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.t=function(e,t){if(1&t&&(e=s(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(s.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)s.d(n,o,function(t){return e[t]}.bind(null,o));return n},s.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return s.d(t,"a",t),t},s.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},s.p="/dist/";var i=window.webpackJsonp=window.webpackJsonp||[],a=i.push.bind(i);i.push=t,i=i.slice();for(var u=0;u<i.length;u++)t(i[u]);var l=a;c.push([106,0]),n()}({106:function(e,t,n){"use strict";n(185);const o=n(13),r=n(0),c=n(8),s=n(37),{promisify:i}=n(14),a=n(3),u=n(4),l=n(2),f=n(107),d=n(1),p=n(17),g=n(16),{getTitle:m}=n(6),{Dialog:y,setTitle:h}=DOM;CloudCmd.Config=e.exports;const b=i(DOM.loadSocket),w=r((e,t)=>(p.addKey(t,e),t)),C=r((e,t)=>(p.add("change",t,e),t)),v={};let x;const k=u.css;e.exports.init=async()=>{if(!CloudCmd.config("configDialog"))return;d.show.load("top");const{prefix:e}=CloudCmd;[x]=await Promise.all([g.get("config-tmpl"),b(),k(e+"/dist/config.css"),CloudCmd.View()]),function(){const e=function(){const{host:e,origin:t,protocol:n}=location;return t||`${n}//${e}`}(),{prefixSocket:t,prefix:n}=CloudCmd,o=io.connect(e+t+"/config",{reconnectionAttempts:1/0,reconnectionDelay:6e4,path:n+"/socket.io"}),r=e=>{P(e),o.send(e)};(function(e){e.emit("auth",O("username"),O("password")),e.on("reject",c(y.alert,"Wrong credentials!"))})(o),o.on("connect",()=>{v.save=r}),o.on("message",P),o.on("log",CloudCmd.log),o.on("disconnect",()=>{v.save=D}),o.on("err",y.alert)}()};const{config:O,Key:j}=CloudCmd;let S;function M(){CloudCmd.View.hide()}async function N(e){const t={},n=f.getName(e),o=f.getValue(n,S);"name"===n?function(e){h(m({name:e}))}(o):"auth"===n&&E(o),t[n]=o,await v.save(t)}function P(e){for(const t of Object.keys(e)){const n=e[t];CloudCmd._config(t,n),f.setValue(t,n,S)}}async function D(e){const{RESTful:t}=DOM,[n]=await t.Config.write(e);n||P(e)}function E(e){const t=f.getElementByName("username",S),n=f.getElementByName("password",S);t.disabled=n.disabled=!e}async function T({keyCode:e,target:t}){switch(e){case j.ESC:return M();case j.ENTER:return await N(t)}}v.save=D,e.exports.show=async function(){if(!CloudCmd.config("configDialog"))return;await async function(){const[e,t]=await a(g.get,"config");if(e)return y.alert("Could not load config!");const{editor:n,packer:r,columns:c,configAuth:i,...u}=f.convert(t);u[n+"-selected"]="selected",u[r+"-selected"]="selected",u[c+"-selected"]="selected",u.configAuth=i?"":"hidden";const d=o(x,u);S=l("form",{className:"config",innerHTML:d});const p=document.querySelectorAll("input, select",S),[m]=p;let h;m&&(E(m.checked),h=m.focus.bind(m));const b=s(N,({target:e})=>e);Array.from(p).map(w(T)).map(C(b));CloudCmd.View.show(S,{autoSize:!0,afterShow:h})}()},e.exports.hide=M},107:function(e,t,n){"use strict";const o=n(0)((e,t,n)=>e===typeof t[n])("boolean");function r(e,t){const n=`[data-name="js-${e}"]`;return t.querySelector(n)}function c(e){return e?" checked":""}e.exports.getElementByName=r,e.exports.getName=e=>e.getAttribute("data-name").replace(/^js-/,""),e.exports.convert=e=>{const t=e,n=Object.keys(e).filter(o(e));for(const o of n){const n=e[o];t[o]=c(n)}return t},e.exports.getValue=(e,t)=>{const n=r(e,t),{type:o}=n;switch(o){case"checkbox":return n.checked;case"number":return Number(n.value);default:return n.value}},e.exports.setValue=(e,t,n)=>{const o=r(e,n),{type:c}=o;switch(c){case"checkbox":o.checked=t;break;default:o.value=t}}},185:function(e,t){}});
|
|
2
2
|
//# sourceMappingURL=config.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e){function t(t){for(var n,u,l=t[0],d=t[1],a=t[2],s=0,c=[];s<l.length;s++)u=l[s],Object.prototype.hasOwnProperty.call(o,u)&&o[u]&&c.push(o[u][0]),o[u]=0;for(n in d)Object.prototype.hasOwnProperty.call(d,n)&&(e[n]=d[n]);for(f&&f(t);c.length;)c.shift()();return i.push.apply(i,a||[]),r()}function r(){for(var e,t=0;t<i.length;t++){for(var r=i[t],n=!0,l=1;l<r.length;l++){var d=r[l];0!==o[d]&&(n=!1)}n&&(i.splice(t--,1),e=u(u.s=r[0]))}return e}var n={},o={7:0},i=[];function u(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,u),r.l=!0,r.exports}u.m=e,u.c=n,u.d=function(e,t,r){u.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},u.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},u.t=function(e,t){if(1&t&&(e=u(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(u.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)u.d(r,n,function(t){return e[t]}.bind(null,n));return r},u.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return u.d(t,"a",t),t},u.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},u.p="/dist/";var l=window.webpackJsonp=window.webpackJsonp||[],d=l.push.bind(l);l.push=t,l=l.slice();for(var a=0;a<l.length;a++)t(l[a]);var f=d;i.push([92,0]),r()}({92:function(e,t,r){"use strict";CloudCmd.EditFileVim=t;const n=r(
|
|
1
|
+
!function(e){function t(t){for(var n,u,l=t[0],d=t[1],a=t[2],s=0,c=[];s<l.length;s++)u=l[s],Object.prototype.hasOwnProperty.call(o,u)&&o[u]&&c.push(o[u][0]),o[u]=0;for(n in d)Object.prototype.hasOwnProperty.call(d,n)&&(e[n]=d[n]);for(f&&f(t);c.length;)c.shift()();return i.push.apply(i,a||[]),r()}function r(){for(var e,t=0;t<i.length;t++){for(var r=i[t],n=!0,l=1;l<r.length;l++){var d=r[l];0!==o[d]&&(n=!1)}n&&(i.splice(t--,1),e=u(u.s=r[0]))}return e}var n={},o={7:0},i=[];function u(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,u),r.l=!0,r.exports}u.m=e,u.c=n,u.d=function(e,t,r){u.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},u.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},u.t=function(e,t){if(1&t&&(e=u(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(u.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)u.d(r,n,function(t){return e[t]}.bind(null,n));return r},u.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return u.d(t,"a",t),t},u.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},u.p="/dist/";var l=window.webpackJsonp=window.webpackJsonp||[],d=l.push.bind(l);l.push=t,l=l.slice();for(var a=0;a<l.length;a++)t(l[a]);var f=d;i.push([92,0]),r()}({92:function(e,t,r){"use strict";CloudCmd.EditFileVim=t;const n=r(17),{Key:o}=CloudCmd,i={bindKeys:!1,beforeClose:()=>{n.rmKey(l),CloudCmd.EditFile.isChanged()}};function u(){CloudCmd.Edit.hide()}function l(e){const{keyCode:t,shiftKey:r}=e;r&&t===o.ESC&&(e.preventDefault(),u())}e.exports.init=async()=>{await CloudCmd.EditFile()},e.exports.show=async()=>{n.addKey(l);(await CloudCmd.EditFile.show(i)).getEditor().setKeyMap("vim")},e.exports.hide=u}});
|
|
2
2
|
//# sourceMappingURL=edit-file-vim.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e){function t(t){for(var n,u,d=t[0],a=t[1],l=t[2],f=0,p=[];f<d.length;f++)u=d[f],Object.prototype.hasOwnProperty.call(o,u)&&o[u]&&p.push(o[u][0]),o[u]=0;for(n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n]);for(s&&s(t);p.length;)p.shift()();return i.push.apply(i,l||[]),r()}function r(){for(var e,t=0;t<i.length;t++){for(var r=i[t],n=!0,d=1;d<r.length;d++){var a=r[d];0!==o[a]&&(n=!1)}n&&(i.splice(t--,1),e=u(u.s=r[0]))}return e}var n={},o={9:0},i=[];function u(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,u),r.l=!0,r.exports}u.m=e,u.c=n,u.d=function(e,t,r){u.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},u.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},u.t=function(e,t){if(1&t&&(e=u(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(u.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)u.d(r,n,function(t){return e[t]}.bind(null,n));return r},u.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return u.d(t,"a",t),t},u.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},u.p="/dist/";var d=window.webpackJsonp=window.webpackJsonp||[],a=d.push.bind(d);d.push=t,d=d.slice();for(var l=0;l<d.length;l++)t(d[l]);var s=a;i.push([96,0]),r()}({96:function(e,t,r){"use strict";CloudCmd.EditNamesVim=t;const n=r(
|
|
1
|
+
!function(e){function t(t){for(var n,u,d=t[0],a=t[1],l=t[2],f=0,p=[];f<d.length;f++)u=d[f],Object.prototype.hasOwnProperty.call(o,u)&&o[u]&&p.push(o[u][0]),o[u]=0;for(n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n]);for(s&&s(t);p.length;)p.shift()();return i.push.apply(i,l||[]),r()}function r(){for(var e,t=0;t<i.length;t++){for(var r=i[t],n=!0,d=1;d<r.length;d++){var a=r[d];0!==o[a]&&(n=!1)}n&&(i.splice(t--,1),e=u(u.s=r[0]))}return e}var n={},o={9:0},i=[];function u(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,u),r.l=!0,r.exports}u.m=e,u.c=n,u.d=function(e,t,r){u.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},u.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},u.t=function(e,t){if(1&t&&(e=u(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(u.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)u.d(r,n,function(t){return e[t]}.bind(null,n));return r},u.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return u.d(t,"a",t),t},u.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},u.p="/dist/";var d=window.webpackJsonp=window.webpackJsonp||[],a=d.push.bind(d);d.push=t,d=d.slice();for(var l=0;l<d.length;l++)t(d[l]);var s=a;i.push([96,0]),r()}({96:function(e,t,r){"use strict";CloudCmd.EditNamesVim=t;const n=r(17),{Key:o}=CloudCmd,i={bindKeys:!1,beforeClose:()=>{n.rmKey(d),CloudCmd.EditNames.isChanged()}};function u(){CloudCmd.Edit.hide()}function d(e){const{keyCode:t,shiftKey:r}=e;r&&t===o.ESC&&(e.preventDefault(),u())}e.exports.init=async()=>{await CloudCmd.EditNames()},e.exports.show=()=>{n.addKey(d),CloudCmd.EditNames.show(i).getEditor().setKeyMap("vim")},e.exports.hide=u}});
|
|
2
2
|
//# sourceMappingURL=edit-names-vim.js.map
|
package/dist/modules/edit.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
!function(t){function e(e){for(var n,u,f=e[0],a=e[1],s=e[2],d=0,l=[];d<f.length;d++)u=f[d],Object.prototype.hasOwnProperty.call(r,u)&&r[u]&&l.push(r[u][0]),r[u]=0;for(n in a)Object.prototype.hasOwnProperty.call(a,n)&&(t[n]=a[n]);for(c&&c(e);l.length;)l.shift()();return i.push.apply(i,s||[]),o()}function o(){for(var t,e=0;e<i.length;e++){for(var o=i[e],n=!0,f=1;f<o.length;f++){var a=o[f];0!==r[a]&&(n=!1)}n&&(i.splice(e--,1),t=u(u.s=o[0]))}return t}var n={},r={5:0},i=[];function u(e){if(n[e])return n[e].exports;var o=n[e]={i:e,l:!1,exports:{}};return t[e].call(o.exports,o,o.exports,u),o.l=!0,o.exports}u.m=t,u.c=n,u.d=function(t,e,o){u.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},u.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},u.t=function(t,e){if(1&e&&(t=u(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(u.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)u.d(o,n,function(e){return t[e]}.bind(null,n));return o},u.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return u.d(e,"a",e),e},u.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},u.p="/dist/";var f=window.webpackJsonp=window.webpackJsonp||[],a=f.push.bind(f);f.push=e,f=f.slice();for(var s=0;s<f.length;s++)e(f[s]);var c=a;i.push([86,0]),o()}({86:function(t,e,o){"use strict";const n=o(87),{promisify:r}=o(
|
|
1
|
+
!function(t){function e(e){for(var n,u,f=e[0],a=e[1],s=e[2],d=0,l=[];d<f.length;d++)u=f[d],Object.prototype.hasOwnProperty.call(r,u)&&r[u]&&l.push(r[u][0]),r[u]=0;for(n in a)Object.prototype.hasOwnProperty.call(a,n)&&(t[n]=a[n]);for(c&&c(e);l.length;)l.shift()();return i.push.apply(i,s||[]),o()}function o(){for(var t,e=0;e<i.length;e++){for(var o=i[e],n=!0,f=1;f<o.length;f++){var a=o[f];0!==r[a]&&(n=!1)}n&&(i.splice(e--,1),t=u(u.s=o[0]))}return t}var n={},r={5:0},i=[];function u(e){if(n[e])return n[e].exports;var o=n[e]={i:e,l:!1,exports:{}};return t[e].call(o.exports,o,o.exports,u),o.l=!0,o.exports}u.m=t,u.c=n,u.d=function(t,e,o){u.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},u.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},u.t=function(t,e){if(1&e&&(t=u(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(u.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)u.d(o,n,function(e){return t[e]}.bind(null,n));return o},u.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return u.d(e,"a",e),e},u.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},u.p="/dist/";var f=window.webpackJsonp=window.webpackJsonp||[],a=f.push.bind(f);f.push=e,f=f.slice();for(var s=0;s<f.length;s++)e(f[s]);var c=a;i.push([86,0]),o()}({86:function(t,e,o){"use strict";const n=o(87),{promisify:r}=o(14),i=o(3),u=o(2),f=o(4),{MAX_FILE_SIZE:a}=o(6),{time:s,timeEnd:c}=o(10),d=f.js;CloudCmd.Edit=e;const l=CloudCmd.config("editor");let p,h,w=!0;const y={afterShow:()=>{h.moveCursorTo(0,0).focus()}};function m(t={}){const e={...t,...y};return t.afterShow?(function(t,e){if("function"!=typeof e)throw Error(t+" should be a function!")}("options.afterShow",t.afterShow),e.afterShow=()=>{y.afterShow(),t.afterShow()},e):e}function b(){return h}t.exports.init=async()=>{const t=function(){const t=u("div",{style:n`
|
|
2
2
|
width: 100%;
|
|
3
3
|
height: 100%;
|
|
4
4
|
font-family: "Droid Sans Mono";
|
package/dist/modules/markdown.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e){function t(t){for(var n,a,u=t[0],l=t[1],s=t[2],p=0,d=[];p<u.length;p++)a=u[p],Object.prototype.hasOwnProperty.call(o,a)&&o[a]&&d.push(o[a][0]),o[a]=0;for(n in l)Object.prototype.hasOwnProperty.call(l,n)&&(e[n]=l[n]);for(c&&c(t);d.length;)d.shift()();return i.push.apply(i,s||[]),r()}function r(){for(var e,t=0;t<i.length;t++){for(var r=i[t],n=!0,u=1;u<r.length;u++){var l=r[u];0!==o[l]&&(n=!1)}n&&(i.splice(t--,1),e=a(a.s=r[0]))}return e}var n={},o={12:0},i=[];function a(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,a),r.l=!0,r.exports}a.m=e,a.c=n,a.d=function(e,t,r){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(a.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)a.d(r,n,function(t){return e[t]}.bind(null,n));return r},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="/dist/";var u=window.webpackJsonp=window.webpackJsonp||[],l=u.push.bind(u);u.push=t,u=u.slice();for(var s=0;s<u.length;s++)t(u[s]);var c=l;i.push([105,0]),r()}({105:function(e,t,r){"use strict";CloudCmd.Markdown=t;const n=r(2),o=r(1),{Markdown:i}=r(
|
|
1
|
+
!function(e){function t(t){for(var n,a,u=t[0],l=t[1],s=t[2],p=0,d=[];p<u.length;p++)a=u[p],Object.prototype.hasOwnProperty.call(o,a)&&o[a]&&d.push(o[a][0]),o[a]=0;for(n in l)Object.prototype.hasOwnProperty.call(l,n)&&(e[n]=l[n]);for(c&&c(t);d.length;)d.shift()();return i.push.apply(i,s||[]),r()}function r(){for(var e,t=0;t<i.length;t++){for(var r=i[t],n=!0,u=1;u<r.length;u++){var l=r[u];0!==o[l]&&(n=!1)}n&&(i.splice(t--,1),e=a(a.s=r[0]))}return e}var n={},o={12:0},i=[];function a(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,a),r.l=!0,r.exports}a.m=e,a.c=n,a.d=function(e,t,r){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(a.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)a.d(r,n,function(t){return e[t]}.bind(null,n));return r},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="/dist/";var u=window.webpackJsonp=window.webpackJsonp||[],l=u.push.bind(u);u.push=t,u=u.slice();for(var s=0;s<u.length;s++)t(u[s]);var c=l;i.push([105,0]),r()}({105:function(e,t,r){"use strict";CloudCmd.Markdown=t;const n=r(2),o=r(1),{Markdown:i}=r(19),{alert:a}=r(9);e.exports.init=async()=>{o.show.load("top"),await CloudCmd.View()},e.exports.show=async function(e,t={}){const{positionLoad:r,relative:u}=t;o.show.load(r),u&&(e+="?relative");const[l,s]=await i.read(e);if(o.hide(),l)return a(l.message,{cancel:!1});const c=n("div",{className:"help",innerHTML:s});CloudCmd.View.show(c)},e.exports.hide=()=>{CloudCmd.View.hide()}}});
|
|
2
2
|
//# sourceMappingURL=markdown.js.map
|
package/dist/modules/menu.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e){function t(t){for(var o,u,l=t[0],c=t[1],d=t[2],s=0,f=[];s<l.length;s++)u=l[s],Object.prototype.hasOwnProperty.call(r,u)&&r[u]&&f.push(r[u][0]),r[u]=0;for(o in c)Object.prototype.hasOwnProperty.call(c,o)&&(e[o]=c[o]);for(a&&a(t);f.length;)f.shift()();return i.push.apply(i,d||[]),n()}function n(){for(var e,t=0;t<i.length;t++){for(var n=i[t],o=!0,l=1;l<n.length;l++){var c=n[l];0!==r[c]&&(o=!1)}o&&(i.splice(t--,1),e=u(u.s=n[0]))}return e}var o={},r={13:0},i=[];function u(t){if(o[t])return o[t].exports;var n=o[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,u),n.l=!0,n.exports}u.m=e,u.c=o,u.d=function(e,t,n){u.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},u.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},u.t=function(e,t){if(1&t&&(e=u(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(u.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)u.d(n,o,function(t){return e[t]}.bind(null,o));return n},u.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return u.d(t,"a",t),t},u.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},u.p="/dist/";var l=window.webpackJsonp=window.webpackJsonp||[],c=l.push.bind(l);l.push=t,l=l.slice();for(var d=0;d<l.length;d++)t(l[d]);var a=c;i.push([97,0]),n()}({97:function(e,t,n){"use strict";const o=n(5),r=n(8),i=n(22),u=n(2),{FS:l}=n(6),{getIdBySrc:c}=n(
|
|
1
|
+
!function(e){function t(t){for(var o,u,l=t[0],c=t[1],d=t[2],s=0,f=[];s<l.length;s++)u=l[s],Object.prototype.hasOwnProperty.call(r,u)&&r[u]&&f.push(r[u][0]),r[u]=0;for(o in c)Object.prototype.hasOwnProperty.call(c,o)&&(e[o]=c[o]);for(a&&a(t);f.length;)f.shift()();return i.push.apply(i,d||[]),n()}function n(){for(var e,t=0;t<i.length;t++){for(var n=i[t],o=!0,l=1;l<n.length;l++){var c=n[l];0!==r[c]&&(o=!1)}o&&(i.splice(t--,1),e=u(u.s=n[0]))}return e}var o={},r={13:0},i=[];function u(t){if(o[t])return o[t].exports;var n=o[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,u),n.l=!0,n.exports}u.m=e,u.c=o,u.d=function(e,t,n){u.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},u.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},u.t=function(e,t){if(1&t&&(e=u(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(u.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)u.d(n,o,function(t){return e[t]}.bind(null,o));return n},u.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return u.d(t,"a",t),t},u.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},u.p="/dist/";var l=window.webpackJsonp=window.webpackJsonp||[],c=l.push.bind(l);l.push=t,l=l.slice();for(var d=0;d<l.length;d++)t(l[d]);var a=c;i.push([97,0]),n()}({97:function(e,t,n){"use strict";const o=n(5),r=n(8),i=n(22),u=n(2),{FS:l}=n(6),{getIdBySrc:c}=n(15),d=n(19),{config:a,Key:s}=CloudCmd,{Buffer:f,Events:p,Dialog:C,Images:m}=DOM,h=DOM.CurrentInfo,y=C.alert.noFiles,g=r((async function(e){const[t,n]=await h.getData();if(t)return;const{name:o}=h;CloudCmd.execFromModule(e,"uploadFile",o,n),CloudCmd.log(`Uploading to ${o}...`)}));let w,x,O;function D(){x.hide(),O.hide()}function M({type:e}){let t,n;"context"===e?(t="context",n=s.unsetBind):"file"===e&&(t="contextFile");return{icon:!0,beforeClose:s.setBind,beforeShow:o.with(v,n),beforeClick:P,name:t}}function b(e){const t={Paste:f.paste,New:{File:DOM.promptNewFile,Directory:DOM.promptNewDir},Upload:()=>{CloudCmd.Upload.show()},"Upload From Cloud":S,"(Un)Select All":DOM.toggleAllSelectedFiles};return e&&(t["Log Out"]=CloudCmd.logOut),t}function F(e,t){if(".."!==h.name)return e();t()}function v(e,t){const{name:n}=t;let r="contextFile"!==function(e){return e?".."===DOM.getCurrentName(e)?"context":"contextFile":"context"}(DOM.getCurrentByPosition({x:t.x,y:t.y}));return"contextFile"===t.name&&(r=!r),r&&(w=n),o(e),r&&(r=function(e,t){const{panel:n}=h;if(!n)return!1;const o=document.elementFromPoint(e,t),r=n.querySelectorAll('[data-name="js-path"] *');return~[].indexOf.call(r,o)}(t.x,t.y)),r}function P(e){return w!==e}function S(){m.show.load("top"),CloudCmd.execFromModule("Cloud","saveFile",async(e,t)=>{const n=DOM.getCurrentDirPath()+e,[o]=await d.write(n,t);o||await CloudCmd.refresh({currentName:e})})}function j(){!function(e){const{prefixURL:t}=CloudCmd,n=Date.now(),o=DOM.getActiveFiles();if(!o.length)return y();for(const r of o){const o=DOM.isSelected(r),i=DOM.isCurrentIsDir(r),d=DOM.getCurrentPath(r);CloudCmd.log(`downloading file ${d}...`);const a=encodeURI(d).replace(/#/g,"%23"),s=c(d);let f;f=i?t+"/pack"+a+DOM.getPackerExt(e):t+l+a+"?download";const p=u("iframe",{id:s+"-"+n,async:!1,className:"hidden",src:f}),{body:C}=document,m=C.removeChild.bind(C,p);setTimeout(m,3e4),o&&DOM.toggleSelectedFile(r)}}(a("packer"))}function k(){const e=h.element.getBoundingClientRect();return{x:Math.round(e.left+e.width/3),y:Math.round(e.top)}}function E(e){const{F9:t,ESC:n}=s,o=e.keyCode;if(s.isBind()){if(o===n)return D();if(o===t){const t=k();x.show(t.x,t.y),e.preventDefault()}}}e.exports.ENABLED=!1,CloudCmd.Menu=t,e.exports.init=()=>{const{isAuth:e,menuDataFile:t}=function(){const e=CloudCmd.config("auth"),t=b(e),n={View:()=>{CloudCmd.View.show()},Edit:()=>{const e=a("vim")?"EditFileVim":"EditFile";CloudCmd[e].show()},Rename:()=>{setTimeout(DOM.renameCurrent,100)},Delete:()=>{CloudCmd.Operation.show("delete")},Pack:()=>{CloudCmd.Operation.show("pack")},Extract:()=>{CloudCmd.Operation.show("extract")},Download:j,"Upload To Cloud":g("Cloud"),Cut:()=>{F(f.cut,y)},Copy:()=>{F(f.copy,y)},...t};return{isAuth:e,menuDataFile:n}}(),n=DOM.getFM(),o=b(e),r=M({type:"context"}),u=M({type:"file"});x=i(n,r,o),O=i(n,u,t),x.addContextMenuListener(),O.addContextMenuListener(),p.addKey(E)},e.exports.hide=D,e.exports.show=e=>{const{x:t,y:n}=function(e){return e?{x:e.x,y:e.y}:k()}(e);x.show(t,n),O.show(t,n),m.hide()}}});
|
|
2
2
|
//# sourceMappingURL=menu.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e){function t(t){for(var o,a,c=t[0],s=t[1],l=t[2],f=0,p=[];f<c.length;f++)a=c[f],Object.prototype.hasOwnProperty.call(r,a)&&r[a]&&p.push(r[a][0]),r[a]=0;for(o in s)Object.prototype.hasOwnProperty.call(s,o)&&(e[o]=s[o]);for(u&&u(t);p.length;)p.shift()();return i.push.apply(i,l||[]),n()}function n(){for(var e,t=0;t<i.length;t++){for(var n=i[t],o=!0,c=1;c<n.length;c++){var s=n[c];0!==r[s]&&(o=!1)}o&&(i.splice(t--,1),e=a(a.s=n[0]))}return e}var o={},r={14:0},i=[];function a(t){if(o[t])return o[t].exports;var n=o[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,a),n.l=!0,n.exports}a.m=e,a.c=o,a.d=function(e,t,n){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(a.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)a.d(n,o,function(t){return e[t]}.bind(null,o));return n},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="/dist/";var c=window.webpackJsonp=window.webpackJsonp||[],s=c.push.bind(c);c.push=t,c=c.slice();for(var l=0;l<c.length;l++)t(c[l]);var u=s;i.push([111,0]),n()}({111:function(e,t,n){"use strict";const o=n(0),r=n(8),{promisify:i}=n(
|
|
1
|
+
!function(e){function t(t){for(var o,a,c=t[0],s=t[1],l=t[2],f=0,p=[];f<c.length;f++)a=c[f],Object.prototype.hasOwnProperty.call(r,a)&&r[a]&&p.push(r[a][0]),r[a]=0;for(o in s)Object.prototype.hasOwnProperty.call(s,o)&&(e[o]=s[o]);for(u&&u(t);p.length;)p.shift()();return i.push.apply(i,l||[]),n()}function n(){for(var e,t=0;t<i.length;t++){for(var n=i[t],o=!0,c=1;c<n.length;c++){var s=n[c];0!==r[s]&&(o=!1)}o&&(i.splice(t--,1),e=a(a.s=n[0]))}return e}var o={},r={14:0},i=[];function a(t){if(o[t])return o[t].exports;var n=o[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,a),n.l=!0,n.exports}a.m=e,a.c=o,a.d=function(e,t,n){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(a.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)a.d(n,o,function(t){return e[t]}.bind(null,o));return n},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="/dist/";var c=window.webpackJsonp=window.webpackJsonp||[],s=c.push.bind(c);c.push=t,c=c.slice();for(var l=0;l<c.length;l++)t(c[l]);var u=s;i.push([111,0]),n()}({111:function(e,t,n){"use strict";const o=n(0),r=n(8),{promisify:i}=n(14),a=n(5),c=n(4),s=n(3),{encode:l}=n(18),u=n(112),f=n(113),p=n(116);CloudCmd.Operation=t;const{config:m}=CloudCmd,{Dialog:d,Images:g}=DOM,h=r((function(e,t){const n=r(t),o=r(d.alert);e.on("accept",n(e)),e.on("reject",o("Wrong credentials!")),e.emit("auth",m("username"),m("password"))})),y={};let O,v,C,b,M,D,x;const w=DOM.CurrentInfo,k=g.show.load.bind(null,"top"),P=o((async function(e,t){let n,o,r,i,a,c="",s="",u=[];t?(c=t.from,s=t.to,u=t.names,r=w.panel):(c=w.dirPath,s=DOM.getNotCurrentDirPath(),n=DOM.getSelectedFiles(),u=DOM.getFilenames(n),t={},i=!0,r=w.panelPassive);u.length||u.push(DOM.getCurrentName());const[f]=u,p=DOM.getCurrentByName(f,r);if(!t&&j())return;const{type:g}=e,h="copy"===g,y=h?"confirmCopy":"confirmMove",O=h?"Copy":"Rename/Move",b=h?v:C;if(i&&m(y)){const[e,t]=await async function(e,t,n){const o=n.length,[r]=n;e+=" ",n.length>1?e+=o+" file(s)":e+=`"${r}"`;return e+=" to",await d.prompt(e,t)}(O,s,u.map(l));return void(e||M(t))}function M(e){if(a=c!==e&&e,a&&!i||!p)return n();const t=`"${f}" already exist. Overwrite?`;function n(){k(),o={from:c,to:e,names:u},b(o,async()=>{await DOM.Storage.remove(c);const{panel:e,panelPassive:t}=w;w.isOnePanel||CloudCmd.refresh({panel:t,noCurrent:!0}),CloudCmd.refresh({panel:e})})}d.confirm(t,{cancel:!1}).then(n)}M(s)})),j=()=>{const{length:e}=DOM.getActiveFiles(),t=Boolean(!e);return t?d.alert.noFiles():t};e.exports.init=i(e=>{k(),a.series([DOM.loadSocket,async e=>{if(m("dropbox"))return e();const{prefix:t,prefixSocket:n}=CloudCmd;await async function(){const{prefix:e}=CloudCmd,t=e+"/fileop/fileop.js",[n]=await s(c.js,t);n&&d.alert(n.message);O=!0}(),await async function(e,t,n){t+="/fileop";const o=await fileop({prefix:e,socketPrefix:t});o.on("connect",h(o,F(n)))}(t,n,e)},e=>{O=!0,g.hide(),e()}],e)});const F=o((e,t)=>{!function(e){x=({from:t,to:n,names:o},r)=>{const i=f({operation:"Tar",callback:r,noContinue:!0,from:t,to:n});e.tar(t,n,o).then(i)},D=({from:t,to:n,names:o},r)=>{const i=f({operation:"Zip",callback:r,noContinue:!0,from:t,to:n});e.zip(t,n,o).then(i)},b=(t,n,o)=>{t=t.replace(/\?.*/,"");const r=f({operation:"Delete",callback:o,from:t});e.remove(t,n).then(r)},v=({from:t,to:n,names:o},r)=>{const i=f({operation:"Copy",callback:r,from:t,to:n,names:o});e.copy(t,n,o).then(i)},C=({from:t,to:n,names:o},r)=>{const i=f({operation:"Move",callback:r,from:t,to:n});e.move(t,n,o).then(i)},M=({from:t,to:n},o)=>{const r=f({operation:"Extract",callback:o,noContinue:!0,from:t,to:n});e.extract(t,n).then(r)}}(t),e()});function S(e=DOM.getActiveFiles()){const t=w.dirPath;if(j())return;k();const n=DOM.getFilenames(e),o=DOM.CurrentInfo.files.map(DOM.getCurrentName),r=DOM.getCurrentName(),i=p(r,o,n);b(t+"?files",n,async()=>{await CloudCmd.refresh();const e=w.files.map(DOM.getCurrentName).includes(r)?r:i;DOM.setCurrentByName(e)})}function N(e,t){let n,o,r=w.name;const{path:i,dirPath:a}=w,c=DOM.getActiveFiles(),s=DOM.getFilenames(c);if(function(e,t){if(!t)throw Error(e+" could not be empty!")}("operation",e),!s.length)return d.alert.noFiles();switch(e){case"extract":n=M,o={from:i,to:a},r=u(r);break;case"pack":n=function(e){return"zip"===e?D:x}(t),s.length>1&&(r=w.dir),r+=DOM.getPackerExt(t),o={from:a,to:a+r,names:s}}k(),n(o,e=>{!e&&CloudCmd.refresh({currentName:r})})}e.exports.hide=()=>{CloudCmd.View.hide()},e.exports.show=(e,t)=>{if(O)return"copy"===e?y.copy(t):"move"===e?y.move(t):"delete"===e?y.delete():"delete:silent"===e?y.deleteSilent():"pack"===e?y.pack():"extract"===e?y.extract():void 0},y.copy=P({type:"copy"}),y.move=P({type:"move"}),y.delete=async function(){if(j())return;const e="Do you really want to delete the ",t=DOM.getActiveFiles(),n=DOM.getFilenames(t),o=n.length;let r;if(o){let t="";for(let e=0;e<5&&e<o;e++)t+="\n"+n[e];o>=5&&(t+="\n..."),r=e+"selected "+o+" files/directories?\n"+l(t)}else{const t=DOM.getCurrentFile(),n=DOM.isCurrentIsDir(t),o=(e=>e?"directory":"file")(n)+" ",i=DOM.getCurrentName(t);r=e+"selected "+o+i+"?"}const[i]=await d.confirm(r);if(i)return;S(t)},y.deleteSilent=S,y.pack=()=>{N("pack","zip"===m("packer")?"zip":"tar")},y.extract=()=>{N("extract")}},112:function(e,t,n){"use strict";const{getExt:o}=n(10);e.exports=e=>{const t=function(e){return/\.tar\.gz$/.test(e)?".tar.gz":/\.tar\.bz2$/.test(e)?".tar.bz2":o(e)}(e);return e.replace(t,"")}},113:function(e,t,n){"use strict";const o=n(114),r=n(8),i=n(115),{Dialog:a,Images:c}=DOM;e.exports=e=>t=>{const{operation:n,callback:s,noContinue:l,from:u,to:f}=e;let p,m;const d=r(({emitter:e,operation:t})=>{e.abort();const n=t+" aborted";m=!0,a.alert(n,{cancel:!1})}),g=t.removeListener.bind(t),h=t.on.bind(t),y=i(n,u,f),O=a.progress(y);O.catch(d({emitter:t,operation:n}));const v={progress:e=>{p=100===e,O.setProgress(e)},end:()=>{c.hide(),o(g,v),O.remove(),(m||p)&&s()},error:async e=>{if(m=e,l)return v.end(e),a.alert(e),void O.remove();const[n]=await a.confirm(e+"\n Continue?");if(!p&&!n)return t.continue();t.abort(),O.remove()}};o(h,v)}},115:function(e,t,n){"use strict";e.exports=(e,t,n)=>n?`${e} ${t} -> ${n}`:`${e} ${t}`},116:function(e,t,n){"use strict";const o=n(0),r=o((e,t)=>!e.includes(t)),i=o((e,t)=>e.filter(r(t)));e.exports=(e,t,n)=>{const o=t.indexOf(e),r=i(t,n),{length:a}=r;return r[o]?r[o]:r[a-1]}}});
|
|
2
2
|
//# sourceMappingURL=operation.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e){function t(t){for(var n,a,l=t[0],u=t[1],c=t[2],d=0,f=[];d<l.length;d++)a=l[d],Object.prototype.hasOwnProperty.call(o,a)&&o[a]&&f.push(o[a][0]),o[a]=0;for(n in u)Object.prototype.hasOwnProperty.call(u,n)&&(e[n]=u[n]);for(s&&s(t);f.length;)f.shift()();return i.push.apply(i,c||[]),r()}function r(){for(var e,t=0;t<i.length;t++){for(var r=i[t],n=!0,l=1;l<r.length;l++){var u=r[l];0!==o[u]&&(n=!1)}n&&(i.splice(t--,1),e=a(a.s=r[0]))}return e}var n={},o={17:0},i=[];function a(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,a),r.l=!0,r.exports}a.m=e,a.c=n,a.d=function(e,t,r){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(a.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)a.d(r,n,function(t){return e[t]}.bind(null,n));return r},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="/dist/";var l=window.webpackJsonp=window.webpackJsonp||[],u=l.push.bind(l);l.push=t,l=l.slice();for(var c=0;c<l.length;c++)t(l[c]);var s=u;i.push([119,0]),r()}({119:function(e,t,r){"use strict";const{promisify:n}=r(
|
|
1
|
+
!function(e){function t(t){for(var n,a,l=t[0],u=t[1],c=t[2],d=0,f=[];d<l.length;d++)a=l[d],Object.prototype.hasOwnProperty.call(o,a)&&o[a]&&f.push(o[a][0]),o[a]=0;for(n in u)Object.prototype.hasOwnProperty.call(u,n)&&(e[n]=u[n]);for(s&&s(t);f.length;)f.shift()();return i.push.apply(i,c||[]),r()}function r(){for(var e,t=0;t<i.length;t++){for(var r=i[t],n=!0,l=1;l<r.length;l++){var u=r[l];0!==o[u]&&(n=!1)}n&&(i.splice(t--,1),e=a(a.s=r[0]))}return e}var n={},o={17:0},i=[];function a(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,a),r.l=!0,r.exports}a.m=e,a.c=n,a.d=function(e,t,r){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(a.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)a.d(r,n,function(t){return e[t]}.bind(null,n));return r},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="/dist/";var l=window.webpackJsonp=window.webpackJsonp||[],u=l.push.bind(l);l.push=t,l=l.slice();for(var c=0;c<l.length;c++)t(l[c]);var s=u;i.push([119,0]),r()}({119:function(e,t,r){"use strict";const{promisify:n}=r(14),o=r(3),i=r(7);r(186);const a=r(5),l=r(4),u=r(11),c=r(1),{Dialog:s}=u,{Key:d,config:f}=CloudCmd;let p,m,y;CloudCmd.TerminalRun=t;const C=i(),h=async()=>{const{prefix:e}=CloudCmd,t=CloudCmd.prefix+"/gritty"+"/gritty.js",r=e+"/dist/terminal.css",[n]=await o(l.parallel,[t,r]);if(n){const e=n.target.src.replace(window.location.href,"");return s.alert(`file ${e} could not be loaded`)}p=!0};function w(){CloudCmd.View.hide()}function g(e){e.emit("auth",f("username"),f("password")),e.on("reject",()=>{s.alert("Wrong credentials!")})}e.exports.init=async()=>{f("terminal")&&(c.show.load("top"),await CloudCmd.View(),await h())},e.exports.show=n((e={},t)=>{if(!p)return t(null,-1);f("terminal")&&(!function(e){const{cwd:t=u.getCurrentDirPath(),command:r,autoClose:n,closeMessage:o="Press any key to close Terminal..."}=e,i={cwd:t,env:{ACTIVE_DIR:u.getCurrentDirPath,PASSIVE_DIR:u.getNotCurrentDirPath,CURRENT_NAME:u.getCurrentName,CURRENT_PATH:u.getCurrentPath},prefix:CloudCmd.prefixSocket+"/gritty",socketPath:CloudCmd.prefix,fontFamily:"Droid Sans Mono",command:r,autoRestart:!1};let l=!1;const{socket:c,terminal:s}=gritty(document.body,i);y=c,m=s,m.onKey(({domEvent:e})=>{const{keyCode:t,shiftKey:r}=e;l&&w(),r&&t===d.ESC&&w()}),y.on("exit",e=>{if(C(e),n)return w();s.write("\n"+o),l=!0}),y.on("connect",a.with(g,c))}(e),CloudCmd.View.show(m.element,{afterShow:()=>{m.focus()},afterClose:()=>{t(null,C())}}))}),e.exports.hide=w}});
|
|
2
2
|
//# sourceMappingURL=terminal-run.js.map
|
package/dist/modules/upload.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(t){function e(e){for(var o,i,u=e[0],l=e[1],s=e[2],c=0,f=[];c<u.length;c++)i=u[c],Object.prototype.hasOwnProperty.call(r,i)&&r[i]&&f.push(r[i][0]),r[i]=0;for(o in l)Object.prototype.hasOwnProperty.call(l,o)&&(t[o]=l[o]);for(p&&p(e);f.length;)f.shift()();return a.push.apply(a,s||[]),n()}function n(){for(var t,e=0;e<a.length;e++){for(var n=a[e],o=!0,u=1;u<n.length;u++){var l=n[u];0!==r[l]&&(o=!1)}o&&(a.splice(e--,1),t=i(i.s=n[0]))}return t}var o={},r={18:0},a=[];function i(e){if(o[e])return o[e].exports;var n=o[e]={i:e,l:!1,exports:{}};return t[e].call(n.exports,n,n.exports,i),n.l=!0,n.exports}i.m=t,i.c=o,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)i.d(n,o,function(e){return t[e]}.bind(null,o));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="/dist/";var u=window.webpackJsonp=window.webpackJsonp||[],l=u.push.bind(u);u.push=e,u=u.slice();for(var s=0;s<u.length;s++)e(u[s]);var p=l;a.push([110,0]),n()}({110:function(t,e,n){"use strict";CloudCmd.Upload=e;const o=n(
|
|
1
|
+
!function(t){function e(e){for(var o,i,u=e[0],l=e[1],s=e[2],c=0,f=[];c<u.length;c++)i=u[c],Object.prototype.hasOwnProperty.call(r,i)&&r[i]&&f.push(r[i][0]),r[i]=0;for(o in l)Object.prototype.hasOwnProperty.call(l,o)&&(t[o]=l[o]);for(p&&p(e);f.length;)f.shift()();return a.push.apply(a,s||[]),n()}function n(){for(var t,e=0;e<a.length;e++){for(var n=a[e],o=!0,u=1;u<n.length;u++){var l=n[u];0!==r[l]&&(o=!1)}o&&(a.splice(e--,1),t=i(i.s=n[0]))}return t}var o={},r={18:0},a=[];function i(e){if(o[e])return o[e].exports;var n=o[e]={i:e,l:!1,exports:{}};return t[e].call(n.exports,n,n.exports,i),n.l=!0,n.exports}i.m=t,i.c=o,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)i.d(n,o,function(e){return t[e]}.bind(null,o));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="/dist/";var u=window.webpackJsonp=window.webpackJsonp||[],l=u.push.bind(u);u.push=e,u=u.slice();for(var s=0;s<u.length;s++)e(u[s]);var p=l;a.push([110,0]),n()}({110:function(t,e,n){"use strict";CloudCmd.Upload=e;const o=n(16),r=n(1),a=n(38),i=n(2);function u(){CloudCmd.View.hide()}function l(){const t=DOM.getByDataName("js-upload-file-button");r.hide(),DOM.Events.add("change",t,({target:t})=>{const{files:e}=t;u(),a(e)})}t.exports.init=async()=>{r.show.load("top"),await CloudCmd.View()},t.exports.show=async function(){r.show.load("top");const t=await o.get("upload"),e=i("div",{innerHTML:t});CloudCmd.View.show(e,{autoSize:!0,afterShow:l});const n=['"Droid Sans Mono"','"Ubuntu Mono"','"Consolas"',"monospace"].join(", ");i("style",{dataName:"upload-css",innerText:`[data-name=js-upload-file-button] {\n font-family: ${n};\n font-size: 16px;\n margin: 10px 0 10px 0;\n }`})},t.exports.hide=u}});
|
|
2
2
|
//# sourceMappingURL=upload.js.map
|
package/dist/modules/view.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e){function t(t){for(var o,s,a=t[0],c=t[1],u=t[2],p=0,d=[];p<a.length;p++)s=a[p],Object.prototype.hasOwnProperty.call(r,s)&&r[s]&&d.push(r[s][0]),r[s]=0;for(o in c)Object.prototype.hasOwnProperty.call(c,o)&&(e[o]=c[o]);for(f&&f(t);d.length;)d.shift()();return i.push.apply(i,u||[]),n()}function n(){for(var e,t=0;t<i.length;t++){for(var n=i[t],o=!0,a=1;a<n.length;a++){var c=n[a];0!==r[c]&&(o=!1)}o&&(i.splice(t--,1),e=s(s.s=n[0]))}return e}var o={},r={20:0},i=[];function s(t){if(o[t])return o[t].exports;var n=o[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,s),n.l=!0,n.exports}s.m=e,s.c=o,s.d=function(e,t,n){s.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},s.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.t=function(e,t){if(1&t&&(e=s(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(s.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)s.d(n,o,function(t){return e[t]}.bind(null,o));return n},s.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return s.d(t,"a",t),t},s.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},s.p="/dist/";var a=window.webpackJsonp=window.webpackJsonp||[],c=a.push.bind(a);a.push=t,a=a.slice();for(var u=0;u<a.length;u++)t(a[u]);var f=c;i.push([98,0]),n()}({102:function(e,t,n){"use strict";const{extname:o}=n(103),r=n(0)((e,t)=>t.test(e)),i=e=>RegExp(`\\.${e}$`,"i");function s(e){return["jp(e|g|eg)","gif","png","bmp","webp","svg","ico"].map(i).some(r(e))}function a(e){return/\.(mp3|ogg|m4a)$/i.test(e)}async function c(e){const{headers:t}=await fetch(e,{method:"HEAD"});for(const[e,n]of t)if("content-type"===e)return"."+n.split("/").pop();return""}e.exports.getType=async e=>{return o(e)||(e=await c(e)),/\.pdf$/i.test(e)?"pdf":s(e)?"image":a(t=e)||function(e){return/\.(mp4|avi|webm)$/i.test(e)}(t)?"media":(e=>/\.html$/.test(e))(e)?"html":(e=>/.\.md$/.test(e))(e)?"markdown":void 0;var t},e.exports.isImage=s,e.exports.isAudio=a,e.exports._detectType=c},180:function(e,t){},98:function(e,t,n){"use strict";n(180);const o=n(
|
|
1
|
+
!function(e){function t(t){for(var o,s,a=t[0],c=t[1],u=t[2],p=0,d=[];p<a.length;p++)s=a[p],Object.prototype.hasOwnProperty.call(r,s)&&r[s]&&d.push(r[s][0]),r[s]=0;for(o in c)Object.prototype.hasOwnProperty.call(c,o)&&(e[o]=c[o]);for(f&&f(t);d.length;)d.shift()();return i.push.apply(i,u||[]),n()}function n(){for(var e,t=0;t<i.length;t++){for(var n=i[t],o=!0,a=1;a<n.length;a++){var c=n[a];0!==r[c]&&(o=!1)}o&&(i.splice(t--,1),e=s(s.s=n[0]))}return e}var o={},r={20:0},i=[];function s(t){if(o[t])return o[t].exports;var n=o[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,s),n.l=!0,n.exports}s.m=e,s.c=o,s.d=function(e,t,n){s.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},s.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.t=function(e,t){if(1&t&&(e=s(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(s.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)s.d(n,o,function(t){return e[t]}.bind(null,o));return n},s.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return s.d(t,"a",t),t},s.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},s.p="/dist/";var a=window.webpackJsonp=window.webpackJsonp||[],c=a.push.bind(a);a.push=t,a=a.slice();for(var u=0;u<a.length;u++)t(a[u]);var f=c;i.push([98,0]),n()}({102:function(e,t,n){"use strict";const{extname:o}=n(103),r=n(0)((e,t)=>t.test(e)),i=e=>RegExp(`\\.${e}$`,"i");function s(e){return["jp(e|g|eg)","gif","png","bmp","webp","svg","ico"].map(i).some(r(e))}function a(e){return/\.(mp3|ogg|m4a)$/i.test(e)}async function c(e){const{headers:t}=await fetch(e,{method:"HEAD"});for(const[e,n]of t)if("content-type"===e)return"."+n.split("/").pop();return""}e.exports.getType=async e=>{return o(e)||(e=await c(e)),/\.pdf$/i.test(e)?"pdf":s(e)?"image":a(t=e)||function(e){return/\.(mp4|avi|webm)$/i.test(e)}(t)?"media":(e=>/\.html$/.test(e))(e)?"html":(e=>/.\.md$/.test(e))(e)?"markdown":void 0;var t},e.exports.isImage=s,e.exports.isAudio=a,e.exports._detectType=c},180:function(e,t){},98:function(e,t,n){"use strict";n(180);const o=n(13),r=n(0),i=n(8),s=n(3),a=n(4),c=n(99),u=n(2),{time:f}=n(10),{FS:p}=n(6),{isImage:d,isAudio:l,getType:m}=n(102),h=n(16),w=n(17),y=n(1),{encode:g}=n(18),{assign:v}=Object,{isArray:b}=Array,x=r((e,t,n,o)=>e(o,t,n)),C=i((...e)=>{for(const t of e)t()}),O=e=>"function"==typeof e,S=x(w.add),j=a.css;e.exports.show=async function(e,t={}){const n=CloudCmd.prefixURL+p;if(_)return;t&&!1===t.bindKeys||w.addKey(B);if(P=u("div",{className:"view",notAppend:!0}),P.tabIndex=0,e)return b(e)?P.append(...e):P.append(e),void c.open(P,I(t));y.show.load();const r=n+k.path;switch(t.raw?"":await m(r)){default:return await async function(){const[e,t]=await k.getData();if(e)return y.hide();const n=document.createTextNode(t),o=$;CloudCmd.config("showFileName")&&(o.title=k.name);P.append(n),c.open(P,o)}();case"markdown":return await CloudCmd.Markdown.show(k.path);case"html":return E(r);case"image":return function(e,t){const n=k.files.map(DOM.getCurrentPath).filter(t=>d(t)||t===e),o=n.map(e=>{return{href:`${t}${e}`,title:g((n=e,n.split("/").pop()))};var n}),r={index:n.indexOf(k.path),autoSize:!0,arrows:!0,keys:!0,helpers:{title:{}}},i={...$,...r};c.open(o,i)}(k.path,n);case"media":return await async function(e){const[t,n]=await async function(e){!function(e){if(t=e,"string"!=typeof t)throw Error("src should be a string!");var t}(e);const[t,n]=await s(h.get,"view/media-tmpl");if(t)return[t];const{name:r}=k;D||(D=n);const i=l(r),a=o(D,{src:e,type:i?"audio":"video",name:r});return[null,u("div",{innerHTML:a})]}(e);if(t)return alert(t);const r={...$,autoSize:!0,afterShow:()=>{n.querySelector("audio, video").focus()}};c.open(n,r)}(r);case"pdf":return function(e){const t=T(e),n=v({},$);CloudCmd.config("showFileName")&&(n.title=k.name);c.open(t,n)}(r)}},e.exports.hide=A;let _=!1;CloudCmd.View=e.exports;const k=DOM.CurrentInfo,{Key:M}=CloudCmd;let P,D;const $={beforeShow:()=>{y.hide(),M.unsetBind()},beforeClose:()=>{w.rmKey(B),M.setBind()},afterShow:()=>{P.focus()},onOverlayClick:F,afterClose:()=>{},autoSize:!1,helpers:{title:{}}};function T(e){const t=u("iframe",{src:e,width:"100%",height:"100%"});return t.addEventListener("load",()=>{t.contentWindow.addEventListener("keydown",B)}),t}function E(e){c.open(T(e),$)}e.exports._Config=$,e.exports.init=async()=>{await async function(){const{DIR_DIST:e}=CloudCmd;f("View load"),_=!0,await j(e+"/view.css"),_=!1}();["click","contextmenu"].forEach(S(void 0,F))},e.exports._createIframe=T,e.exports._viewHtml=E;function I(e){const t=v({},$);if(!e)return t;const n=Object.keys(e);for(const o of n){const n=Boolean(t[o]),r=e[o];if(!O(r)||!n){t[o]=e[o];continue}const i=t[o];t[o]=C(i,r)}return t}function A(){c.close()}function F(e){!function(e){const t=DOM.getCurrentByPosition(e);if(!t)return;const{files:n,filesPassive:o}=k,r=n.includes(t),i=o.includes(t);if(!r&&!i)return;if(DOM.isCurrentFile(t))return;DOM.setCurrentFile(t)}({x:e.clientX,y:e.clientY})}function B({keyCode:e}){e===M.ESC&&A()}e.exports._initConfig=I}});
|
|
2
2
|
//# sourceMappingURL=view.js.map
|
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=
|
|
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: Mon Sep 04 2023 15:56:22 GMT+0300 (Eastern European Summer 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/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","tryToCatch","require","currify","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","fn","args","Error","check","length","again","args2","count","arguments","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,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AAG+C,GAAI,OAAOT,KAAMQ,YAC9B,SAAU9C,EAAG+C,EAAGzF,GAAI,OAAOgF,KAAMQ,YACjC,SAAU9C,EAAG+C,EAAGzF,EAAGC,GAAI,OAAO+E,KAAMQ,YACpC,SAAU9C,EAAG+C,EAAGzF,EAAGC,EAAG+B,GAAI,OAAOgD,KAAMQ,aAc1BzD,CAAEsD,GAAOE,IAEPF,GAGnB3F,EAAOD,QAAUoC","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 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","'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,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C,WAAYA,KAAMzB,IAC5B,MAAM3E,GACJ,MAAO,CAACA,M,6BCNhB,MASMN,EAAU,CAAC0G,KAAOzB,KAGpB,GAeJ,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('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":""}
|