filecat 2.1.0 → 2.2.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/README.md +1 -0
- package/build/dist/181.bundle.js +1 -1
- package/build/dist/432.bundle.js +1 -1
- package/build/dist/441.bundle.js +2 -0
- package/build/dist/450.bundle.js +2 -0
- package/build/dist/502.bundle.js +1 -1
- package/build/dist/523.bundle.js +1 -1
- package/build/dist/663.bundle.js +2 -0
- package/build/dist/674.bundle.js +1 -1
- package/build/dist/869.bundle.js +1 -1
- package/build/dist/943.bundle.js +1 -1
- package/build/dist/bundle.js +1 -1
- package/build/file.search.worker.js +1 -0
- package/build/main.js +1 -1
- package/build/main.js.LICENSE.txt +5 -0
- package/package.json +3 -1
- package/shell/build.js +25 -1
- package/shell/config/webpack.worker.get.js +79 -0
- package/build/dist/34.bundle.js +0 -2
- package/build/dist/623.bundle.js +0 -2
- package/build/dist/734.bundle.js +0 -2
- package/build/file.worker.js +0 -100
- /package/build/dist/{34.bundle.js.LICENSE.txt → 441.bundle.js.LICENSE.txt} +0 -0
- /package/build/dist/{623.bundle.js.LICENSE.txt → 450.bundle.js.LICENSE.txt} +0 -0
- /package/build/dist/{734.bundle.js.LICENSE.txt → 663.bundle.js.LICENSE.txt} +0 -0
package/build/dist/734.bundle.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/*! For license information please see 734.bundle.js.LICENSE.txt */
|
|
2
|
-
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[734],{4734:(t,e,r)=>{r.r(e),r.d(e,{FileListShowTypeEmum:()=>st,default:()=>yt});var n=r(6540),o=r(7022),i=r(7444),a=r(6417),c=r(7767),u=r(4694),l=r(4289),f=r(8844),s=r(2869),h=r(4251),p=r(2389),y=r(8247);function v(t){return v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},v(t)}function d(){d=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function f(t,e,r,n){var i=e&&e.prototype instanceof w?e:w,a=Object.create(i.prototype),c=new I(n||[]);return o(a,"_invoke",{value:O(t,r,c)}),a}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=f;var h="suspendedStart",p="suspendedYield",y="executing",m="completed",g={};function w(){}function b(){}function E(){}var L={};l(L,a,(function(){return this}));var x=Object.getPrototypeOf,k=x&&x(x(N([])));k&&k!==r&&n.call(k,a)&&(L=k);var _=E.prototype=w.prototype=Object.create(L);function S(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function A(t,e){function r(o,i,a,c){var u=s(t[o],t,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==v(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(f).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function O(e,r,n){var o=h;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=j(c,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var l=s(e,r,n);if("normal"===l.type){if(o=n.done?m:p,l.arg===g)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=m,n.method="throw",n.arg=l.arg)}}}function j(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,j(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var i=s(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,g;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function P(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function F(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function I(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function N(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(v(e)+" is not iterable")}return b.prototype=E,o(_,"constructor",{value:E,configurable:!0}),o(E,"constructor",{value:b,configurable:!0}),b.displayName=l(E,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,E):(t.__proto__=E,l(t,u,"GeneratorFunction")),t.prototype=Object.create(_),t},e.awrap=function(t){return{__await:t}},S(A.prototype),l(A.prototype,c,(function(){return this})),e.AsyncIterator=A,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new A(f(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},S(_),l(_,u,"Generator"),l(_,a,(function(){return this})),l(_,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=N,I.prototype={constructor:I,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(F),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,g):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),F(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;F(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:N(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function m(t){return function(t){if(Array.isArray(t))return E(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||b(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function g(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function w(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(t,e)||b(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function b(t,e){if(t){if("string"==typeof t)return E(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?E(t,e):void 0}}function E(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function L(t){var e=w((0,i.L4)(a.A.selectedFileList),2),r=e[0],v=e[1],b=w((0,i.L4)(a.A.clickFileList),2),E=b[0],L=b[1],x=w((0,i.L4)(a.A.enterKey),2),k=x[0],_=(x[1],(0,y.kZ)().click_file),S=((0,p.Bd)().t,(0,c.Zp)()),A=((0,c.zy)(),function(){var e,n=(e=d().mark((function e(n,i){var a,c,f,s,h,p;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==(0,u.kW)(r,n))v((0,u.P1)(r,n));else if("ctrl"===k)v([].concat(m(r),[n]));else if("shift"===k){if(a=(0,u.a7)(r),c=a.max,f=a.min,s=[],n>=c)for(h=c;h<=n;h++)s.push(h);else for(p=f;p>=n;p--)s.push(p);v(s)}else v([n]);if(L([].concat(m(E),[n])),setTimeout((function(){L((0,u.P1)(E,n))}),300),t.type!==o.Iw.folder){e.next=13;break}if(void 0===E.find((function(t){return t===n}))){e.next=11;break}return S((0,u.IO)((0,l.vX)(),i)),v([]),L([]),e.abrupt("return");case 11:e.next=15;break;case 13:void 0!==E.find((function(t){return t===n}))&&_({name:i,size:t.origin_size});case 15:case"end":return e.stop()}}),e)})),function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(t){g(i,n,o,a,c,"next",t)}function c(t){g(i,n,o,a,c,"throw",t)}a(void 0)}))});return function(t,e){return n.apply(this,arguments)}}()),O=w((0,i.L4)(a.A.showPrompt),2),j=(O[0],O[1]);return n.createElement(f.B,{extraAttr:{onContextMenu:function(e){!function(t,e,r,n){t.preventDefault();var i=new h.i;i.path=(0,u.IO)((0,l.vX)(),e),i.filename=e,i.x=t.clientX,i.y=t.clientY,i.type=r?o.Iw.folder:(0,h.u)(e),i.size=n,j({show:!0,type:s.PromptEnum.FileMenu,overlay:!1,data:i})}(e,t.name,t.type===o.Iw.folder,t.origin_size)}},name:t.name,index:t.index,mtime:t.mtime,size:t.size,type:t.type,isLink:t.isLink,path:t.path,click:A,itemWidth:t.itemWidth})}var x=r(4976);function k(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return _(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function S(t){var e=(0,c.zy)(),r=k((0,n.useState)([]),2),o=r[0],i=r[1],a=k((0,n.useState)("/"),2),f=a[0],s=a[1];return n.useEffect((function(){var e="",r=(0,l.vX)().split("/");r=r.filter((function(t){return t}));var n=r.indexOf(t.baseRoute),o=[];if(-1!=n){e=(0,u.IO)(r.slice(0,n),t.baseRoute);for(var a=r.slice(n+1),c=0;c<a.length;c++){var f=a[c];o.push({value:f,href:0===c?"".concat(e).concat(f,"/"):(0,u.IO)(o[c-1].href,f)})}s(e),i(o)}}),[e]),n.createElement("div",{className:"breadcrumbs"},n.createElement("span",null,n.createElement("span",{className:"chevron"},n.createElement(x.N_,{to:f,onClick:t.clickFun},n.createElement("i",{className:"material-icons"},"home"))),o.map((function(e,r){return n.createElement("span",{className:"chevron",key:r},n.createElement("i",{className:"material-icons"},"keyboard_arrow_right"),n.createElement(x.N_,{to:e.href,onClick:t.clickFun},decodeURIComponent(e.value)))}))))}var A=r(6007),O=r(5997),j=r(7952),P=r(5726),F=r(3459),I=r(7856),N=r(4238),C=r(4944),G=r(7704),T=r(4405),z=r(505);function M(t){return M="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},M(t)}function Y(){Y=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function f(t,e,r,n){var i=e&&e.prototype instanceof m?e:m,a=Object.create(i.prototype),c=new P(n||[]);return o(a,"_invoke",{value:S(t,r,c)}),a}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=f;var h="suspendedStart",p="suspendedYield",y="executing",v="completed",d={};function m(){}function g(){}function w(){}var b={};l(b,a,(function(){return this}));var E=Object.getPrototypeOf,L=E&&E(E(F([])));L&&L!==r&&n.call(L,a)&&(b=L);var x=w.prototype=m.prototype=Object.create(b);function k(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function _(t,e){function r(o,i,a,c){var u=s(t[o],t,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==M(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(f).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function S(e,r,n){var o=h;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=A(c,n);if(u){if(u===d)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var l=s(e,r,n);if("normal"===l.type){if(o=n.done?v:p,l.arg===d)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=v,n.method="throw",n.arg=l.arg)}}}function A(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,A(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),d;var i=s(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,d;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,d):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,d)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function j(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function F(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(M(e)+" is not iterable")}return g.prototype=w,o(x,"constructor",{value:w,configurable:!0}),o(w,"constructor",{value:g,configurable:!0}),g.displayName=l(w,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,l(t,u,"GeneratorFunction")),t.prototype=Object.create(x),t},e.awrap=function(t){return{__await:t}},k(_.prototype),l(_.prototype,c,(function(){return this})),e.AsyncIterator=_,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new _(f(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},k(x),l(x,u,"Generator"),l(x,a,(function(){return this})),l(x,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=F,P.prototype={constructor:P,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(j),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,d):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),d},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),j(r),d}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;j(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:F(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),d}},e}function U(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function R(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){U(i,n,o,a,c,"next",t)}function c(t){U(i,n,o,a,c,"throw",t)}a(void 0)}))}}function $(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return D(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?D(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function D(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function K(t){var e=$((0,n.useState)(null),2),r=e[0],o=e[1],c=$((0,i.L4)(a.A.fileShellShow),2),u=c[0],l=(c[1],$((0,i.L4)(a.A.file_shell_hidden),2)),f=l[0],s=(l[1],$((0,n.useState)(!1),2)),h=s[0],p=s[1],y=function(){var t=R(Y().mark((function t(){var e,r,n;return Y().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e=new I.Terminal({fontFamily:"Monaco, Menlo, Consolas, 'Courier New', monospace",theme:{background:"#FFFFFF",foreground:"#000000",cursor:"#000000",selectionBackground:"#a6d2ff"},cursorBlink:!0,cursorStyle:"bar",scrollback:1e3,scrollSensitivity:1,tabStopWidth:4}),n=function(t){e.write(t)},r=function(t){e.clear(),e.write(t),r=n},C.ws.addMsg(N.HK.shell_getting,(function(t){r(t.context)})),C.ws.addMsg(N.HK.shell_copy,(function(t){t.context&&(0,z.l)(t.context),e.focus()})),e.onData(function(){var t=R(Y().mark((function t(e){var r;return Y().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return(r=new N.hf(N.HK.shell_send)).context=e,t.next=4,C.ws.send(r);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),o(e);case 7:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),v=function(){R(Y().mark((function t(){return Y().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r&&(r.dispose(),o(null)),C.ws.isAilive()&&C.ws.setPromise(function(){var t=R(Y().mark((function t(e){return Y().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,C.ws.unConnect();case 2:e();case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}());case 2:case"end":return t.stop()}}),t)})))()};return(0,n.useEffect)((function(){return function(){v()}}),[]),(0,n.useEffect)((function(){if(u.show)if(r){if(h){var t=new N.hf(N.HK.shell_cd),e=new T.n;e.init_path=u.path,e.http_token=localStorage.getItem("token"),t.context=e,C.ws.send(t)}}else y(),p(!0);else v()}),[u]),n.createElement(G.$,{show:u.show,file_shell_hidden:f,terminal:r,init:function(t,e){r.writeln("[38;2;29;153;243mopen shell...[0m ");var n=new N.hf(N.HK.shell_open),o=new T.n;o.init_path=u.path,o.rows=t,o.cols=e,o.http_token=localStorage.getItem("token"),n.context=o,C.ws.send(n)}})}var X=r(9214),W=r(3413),H=r.n(W),B=r(5725),Z=r(3033),q=r(2042),J=r(7523),Q=r(8815),V=r(2730),tt=r(447);function et(t){return et="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},et(t)}function rt(){return rt=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)({}).hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},rt.apply(null,arguments)}function nt(){nt=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function f(t,e,r,n){var i=e&&e.prototype instanceof m?e:m,a=Object.create(i.prototype),c=new P(n||[]);return o(a,"_invoke",{value:S(t,r,c)}),a}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=f;var h="suspendedStart",p="suspendedYield",y="executing",v="completed",d={};function m(){}function g(){}function w(){}var b={};l(b,a,(function(){return this}));var E=Object.getPrototypeOf,L=E&&E(E(F([])));L&&L!==r&&n.call(L,a)&&(b=L);var x=w.prototype=m.prototype=Object.create(b);function k(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function _(t,e){function r(o,i,a,c){var u=s(t[o],t,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==et(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(f).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function S(e,r,n){var o=h;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=A(c,n);if(u){if(u===d)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var l=s(e,r,n);if("normal"===l.type){if(o=n.done?v:p,l.arg===d)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=v,n.method="throw",n.arg=l.arg)}}}function A(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,A(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),d;var i=s(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,d;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,d):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,d)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function j(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function F(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(et(e)+" is not iterable")}return g.prototype=w,o(x,"constructor",{value:w,configurable:!0}),o(w,"constructor",{value:g,configurable:!0}),g.displayName=l(w,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,l(t,u,"GeneratorFunction")),t.prototype=Object.create(x),t},e.awrap=function(t){return{__await:t}},k(_.prototype),l(_.prototype,c,(function(){return this})),e.AsyncIterator=_,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new _(f(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},k(x),l(x,u,"Generator"),l(x,a,(function(){return this})),l(x,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=F,P.prototype={constructor:P,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(j),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,d):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),d},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),j(r),d}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;j(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:F(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),d}},e}function ot(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=ut(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,c=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){c=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(c)throw i}}}}function it(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function at(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){it(i,n,o,a,c,"next",t)}function c(t){it(i,n,o,a,c,"throw",t)}a(void 0)}))}}function ct(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(t,e)||ut(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ut(t,e){if(t){if("string"==typeof t)return lt(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?lt(t,e):void 0}}function lt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var ft,st=function(t){return t.block="",t.gallery="gallery",t.list="list",t}({}),ht=Object.values(st),pt=280;function yt(){var t=ct((0,i.L4)(a.A.editorSetting),2),e=(t[0],t[1]),r=ct((0,i.L4)(a.A.file_preview),2),f=(r[0],r[1]),h=(0,p.Bd)().t,v=(0,n.useRef)(null),d=(0,c.zy)(),m=(0,c.Zp)(),g=ct((0,i.L4)(a.A.nowFileList),2),w=g[0],b=g[1],E=ct((0,i.L4)(a.A.fileShowType),2),x=E[0],k=E[1],_=ct((0,i.L4)(a.A.uploadFiles),2),I=(_[0],_[1]),N=ct((0,i.L4)(a.A.showPrompt),2),C=(N[0],N[1]),G=ct((0,i.L4)(a.A.selectedFileList),2),T=G[0],z=(G[1],ct((0,i.L4)(a.A.copyedFileList),2)),M=z[0],Y=z[1],U=ct((0,i.L4)(a.A.enterKey),2),R=(U[0],U[1]),$=ct((0,i.L4)(a.A.cutedFileList),2),D=$[0],W=$[1],et=ct((0,i.L4)(a.A.selectedFileList),2),it=(et[0],et[1]),ut=ct((0,i.L4)(a.A.clickFileList),2),lt=(ut[0],ut[1]),st=ct((0,i.L4)(a.A.fileShellShow),2),yt=st[0],vt=st[1],dt=ct((0,i.L4)(a.A.file_root_list),2),mt=dt[0],gt=(dt[1],ct((0,i.L4)(a.A.file_root_index),2)),wt=gt[0],bt=gt[1],Et=ct((0,n.useState)(void 0),2),Lt=Et[0],xt=Et[1],kt=ct((0,n.useState)(""),2),_t=kt[0],St=kt[1],At=(0,n.useContext)(J.F).reloadUserInfo,Ot=(0,y.kZ)().click_file,jt=ct((0,i.L4)(a.A.prompt_card),2),Pt=(jt[0],jt[1]),Ft=function(){var t=at(nt().mark((function t(){var e,r,n,o,i,a;return nt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,A.$M.get(encodeURIComponent((0,l.GG)("file",(0,l.vX)())));case 2:if((r=t.sent).code!==F.m.PreFile){t.next=6;break}return Ot({name:r.message,context:r.data}),t.abrupt("return");case 6:if(r.code===F.m.Sucess){t.next=9;break}return r.message&&(0,q.zN)(r.message),t.abrupt("return");case 9:n=r.data,o=ot(null!==(e=n.files)&&void 0!==e?e:[]);try{for(o.s();!(i=o.n()).done;)(a=i.value).origin_size=a.size,a.size=(0,Q.v7)(a.size)}catch(t){o.e(t)}finally{o.f()}b(r.data),ft=r.data;case 14:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),It=function(){var t=Math.floor(document.querySelector("main").offsetWidth/pt);0===t&&(t=1),xt("calc(".concat(100/t,"% - 1em)"))};(0,n.useEffect)((function(){var t=function(){var t=at(nt().mark((function t(){return nt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Ft();case 2:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();t(),e({open:!1}),f({open:!1})}),[d]);var Nt=function(){var t=at(nt().mark((function t(e){var r,n,o,i;return nt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e.preventDefault(),r=e.dataTransfer,n=e.target,!(r.files.length<=0)){t.next=5;break}return t.abrupt("return");case 5:for(o=0;o<5;o++)null===n||n.classList.contains("item")||(n=n.parentElement);return t.next=8,(0,P.T)(r);case 8:i=t.sent,I(i),C({show:!0,type:s.PromptEnum.FilesUpload,overlay:!1,data:{}});case 11:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),Ct=function(t){t.preventDefault()};function Gt(t){new(H())({type:"success",text:t,timeout:1e3,layout:"bottomLeft"}).show()}(0,n.useEffect)((function(){var t=v.current.ownerDocument;return t.addEventListener("dragover",Ct),t.addEventListener("drop",Nt),It(),window.addEventListener("resize",It),function(){t.removeEventListener("dragover",Ct),t.removeEventListener("drop",Nt),window.removeEventListener("resize",It),yt.show&&vt({show:!1,path:""})}}),[]);var Tt=function(){var t=at(nt().mark((function t(e){return nt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return bt(e),t.next=3,A.$M.post("base_switch",{root_index:e});case 3:return t.next=5,At();case 5:m("/file/"),it([]),lt([]);case 8:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),zt=function(){var t=at(nt().mark((function t(){var e,r;return nt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,A.$M.post("file/info",{type:o.Iw.folder,path:(0,l.GG)("file",(0,l.vX)())});case 2:(e=t.sent).code===F.m.Sucess&&Pt({open:!0,title:"信息",context_div:n.createElement("div",null,n.createElement(B.Yh,{left:h("挂载位置磁盘"),right:e.data&&e.data.total_size}),n.createElement(B.Yh,{left:"".concat(h("磁盘剩余")),right:e.data&&e.data.left_size}),n.createElement(B.Yh,{left:"".concat(h("文件系统")),right:e.data&&e.data.fs_type}),n.createElement(B.Yh,{left:"".concat(h("文件夹数")),right:w.folders.length}),n.createElement(B.Yh,{left:"".concat(h("文件数")),right:w.files.length}),n.createElement(B.Yh,{left:"".concat(h("当前位置")),right:n.createElement(tt.xP,{context:null==e||null===(r=e.data)||void 0===r?void 0:r.now_absolute_path})}))});case 4:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),Mt=ct((0,n.useState)(!1),2),Yt=Mt[0],Ut=Mt[1];(0,n.useEffect)((function(){var t=function(t){if(Yt)if(t.ctrlKey)if("a"===t.key||"A"===t.key){for(var e=w.files.length,r=w.folders.length,n=[],o=0;o<e+r;o++)n.push(o);it(n)}else R("ctrl");else"Escape"===t.key?it([]):"Shift"===t.key&&R("shift")},e=function(t){t.ctrlKey||R("")};return window.addEventListener("keydown",t),window.addEventListener("keyup",e),function(){window.removeEventListener("keydown",t),window.removeEventListener("keyup",e)}}),[w,Yt]);var Rt=function(t){t.target===t.currentTarget&&it([])};return n.createElement("div",{className:"not-select-div"},n.createElement(j.A,{left_children:n.createElement(Z.$Z,{handleEnterPress:function(){var t,e;if(ft){it([]),lt([]);var r,n=[],o=[],i=ot(null!==(t=ft.files)&&void 0!==t?t:[]);try{for(i.s();!(r=i.n()).done;){var a=r.value;a.name.includes(_t)&&n.push(a)}}catch(t){i.e(t)}finally{i.f()}var c,u=ot(null!==(e=ft.folders)&&void 0!==e?e:[]);try{for(u.s();!(c=u.n()).done;){var l=c.value;l.name.includes(_t)&&o.push(l)}}catch(t){u.e(t)}finally{u.f()}b({files:n,folders:o})}},placeholder:h("搜索当前目录"),icon:"search",value:"",handleInputChange:function(t){St(t)},max_width:"25em"})},T.length>0&&n.createElement(O.rA,{icon:"delete",title:h("删除"),onClick:function(){C({show:!0,type:s.PromptEnum.FilesDelete,overlay:!0,data:{}})}}),T.length>0&&n.createElement(O.rA,{icon:"content_copy",title:h("复制"),onClick:function(){var t=(0,X.i)(w,T);Y(t.map((function(t){return(0,X.O)(t.name)}))),W([]),Gt("已复制")}}),T.length>0&&n.createElement(O.rA,{icon:"content_cut",title:h("剪切"),onClick:function(){var t=(0,X.i)(w,T);W(t.map((function(t){return(0,X.O)(t.name)}))),Y([]),Gt("已剪切")}}),(M.length>0||D.length>0)&&n.createElement(O.rA,{onClick:function(){C({show:!0,type:s.PromptEnum.Confirm,overlay:!0,data:{}})},icon:"content_paste",title:h("粘贴到此处"),tip:M.length+D.length}),T.length>0&&n.createElement(O.rA,{icon:"download",title:h("下载"),onClick:function(){for(var t=(0,X.i)(w,T),e=0;e<t.length;e++){var r=t[e];t[e]=encodeURIComponent((0,X.O)(r.name))}var n=A.$M.getDownloadUrl(t);window.open(n)}}),T.length>0&&n.createElement(O.rA,{icon:"compress",title:h("压缩"),onClick:function(){for(var t=(0,X.i)(w,T),e=0;e<t.length;e++){var r=t[e];t[e]=(0,X.O)(r.name)}t&&0!==t.length?C({show:!0,type:s.PromptEnum.Compress,overlay:!0,data:{files:t}}):(0,q.zN)("没有选中")}}),1===T.length&&n.createElement(O.rA,{icon:"edit_attributes",title:h("重命名"),onClick:function(){C({show:!0,type:s.PromptEnum.FileRename,overlay:!0,data:{}})}}),n.createElement(O.rA,{icon:"terminal",title:"shell",onClick:function(){yt.show?vt({show:!1,path:""}):vt({show:!0,path:(0,l.GG)("file",(0,l.vX)())})}}),n.createElement(O.rA,{icon:"grid_view",title:h("切换样式"),onClick:function(){k((0,u.jH)(ht,x))}}),n.createElement(O.rA,{icon:"create_new_folder",title:h("创建文件夹"),onClick:function(){C({show:!0,type:s.PromptEnum.DirNew,overlay:!0,data:{dir:(0,l.GG)("file",(0,l.vX)())}})}}),n.createElement(O.rA,{icon:"note_add",title:h("创建文本文件"),onClick:function(){C({show:!0,type:s.PromptEnum.FileNew,overlay:!0,data:{dir:(0,l.GG)("file",(0,l.vX)())}})}}),n.createElement(O.rA,{icon:"upload_file",title:"上传",onClick:function(){C({show:!0,type:s.PromptEnum.UploadFile,overlay:!0,data:{call:function(t){var e,r=null===(e=t.currentTarget)||void 0===e?void 0:e.files;if(r){for(var n=!!r[0].webkitRelativePath,o=[],i=new Set,a=0;a<r.length;a++){var c=r[a],u=n?c.webkitRelativePath:"".concat(c.webkitRelativePath).concat(c.name);c.fullPath=u,n&&i.add((0,V.S)(u)),o.push(c)}var l=[];if(n){var f,h=ot(i);try{for(h.s();!(f=h.n()).done;){var p=f.value;l.push({isDir:!0,fullPath:p,name:p})}}catch(t){h.e(t)}finally{h.f()}}l.push.apply(l,o),I(l),C({show:!0,type:s.PromptEnum.FilesUpload,overlay:!1,data:{}})}}}})}}),n.createElement(O.rA,{icon:"info",title:h("信息"),onClick:zt}),n.createElement(B.EF,{title:h("切换目录"),items:mt,click:function(t){Tt(t)},pre_value:wt})),n.createElement("div",{id:"listing",className:"mosaic file-icons ".concat(x),ref:v,onMouseEnter:function(){Ut(!0)},onMouseLeave:function(){Ut(!1)}},n.createElement(S,{baseRoute:"file",clickFun:function(){it([]),lt([])}}),w.folders&&w.folders.length>0&&n.createElement("h2",null,h("文件夹")),w.folders&&n.createElement("div",{onClick:Rt},w.folders.map((function(t,e){return n.createElement(L,rt({itemWidth:Lt,index:e,key:e},t))}))),w.files&&w.files.length>0&&n.createElement("h2",{onClick:Rt},h("文件")),w.files&&n.createElement("div",{onClick:Rt},w.files.map((function(t,e){return n.createElement(L,rt({itemWidth:Lt,index:e+w.folders.length,key:e},t))})))),n.createElement(K,null))}}}]);
|
package/build/file.worker.js
DELETED
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
const worker_threads_1 = require("worker_threads");
|
|
13
|
-
const fs = require("fs");
|
|
14
|
-
function copySubarray(buffer, start, end) {
|
|
15
|
-
const length = end - start;
|
|
16
|
-
const newBuffer = Buffer.alloc(length);
|
|
17
|
-
buffer.copy(newBuffer, 0, start, end);
|
|
18
|
-
return newBuffer;
|
|
19
|
-
}
|
|
20
|
-
function buildBadCharTable(pattern) {
|
|
21
|
-
const table = {};
|
|
22
|
-
const m = pattern.length;
|
|
23
|
-
for (let i = 0; i < m; i++) {
|
|
24
|
-
table[pattern[i]] = i;
|
|
25
|
-
}
|
|
26
|
-
return table;
|
|
27
|
-
}
|
|
28
|
-
function boyerMooreSearch(text, pattern, list) {
|
|
29
|
-
const badCharTable = buildBadCharTable(pattern);
|
|
30
|
-
const text_len = text.length;
|
|
31
|
-
const pattern_len = pattern.length;
|
|
32
|
-
const text_len_pattern_len = text_len - pattern_len;
|
|
33
|
-
let i = 0;
|
|
34
|
-
while (i <= text_len_pattern_len) {
|
|
35
|
-
let last_p_i = pattern_len - 1;
|
|
36
|
-
while (last_p_i >= 0 && text[i + last_p_i] === pattern[last_p_i]) {
|
|
37
|
-
last_p_i--;
|
|
38
|
-
}
|
|
39
|
-
if (last_p_i < 0) {
|
|
40
|
-
list.push(i);
|
|
41
|
-
i += (i + pattern_len < text_len) ?
|
|
42
|
-
pattern_len - badCharTable[text[i + pattern_len]] || pattern_len
|
|
43
|
-
: 1;
|
|
44
|
-
}
|
|
45
|
-
else {
|
|
46
|
-
const badCharLast = badCharTable[text[i + last_p_i]];
|
|
47
|
-
const badCharShift = badCharLast !== undefined
|
|
48
|
-
? last_p_i - badCharLast
|
|
49
|
-
: last_p_i + 1;
|
|
50
|
-
i += Math.max(badCharShift, 1);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
let done = false;
|
|
55
|
-
worker_threads_1.parentPort.on("message", (message) => __awaiter(void 0, void 0, void 0, function* () {
|
|
56
|
-
try {
|
|
57
|
-
switch (message.type) {
|
|
58
|
-
case 1:
|
|
59
|
-
{
|
|
60
|
-
const { start, end, file_path, query_text_buffer } = message;
|
|
61
|
-
let haveReadSize = 0;
|
|
62
|
-
let bufferContent = Buffer.alloc(0);
|
|
63
|
-
const fd = fs.openSync(file_path, "r");
|
|
64
|
-
const read_len = 1024 * 1024 * 2;
|
|
65
|
-
let text_start_index = 0;
|
|
66
|
-
while (haveReadSize < end) {
|
|
67
|
-
if (done)
|
|
68
|
-
break;
|
|
69
|
-
const buffer = Buffer.alloc(read_len);
|
|
70
|
-
let bytesRead = fs.readSync(fd, buffer, 0, buffer.length, haveReadSize);
|
|
71
|
-
if (bytesRead === 0)
|
|
72
|
-
break;
|
|
73
|
-
haveReadSize += bytesRead;
|
|
74
|
-
bufferContent = Buffer.concat([bufferContent, buffer.subarray(0, bytesRead)]);
|
|
75
|
-
worker_threads_1.parentPort.postMessage({ type: 5, progress: (haveReadSize * 100 / end).toFixed(0) });
|
|
76
|
-
const r_list = [];
|
|
77
|
-
boyerMooreSearch(bufferContent, query_text_buffer, r_list);
|
|
78
|
-
if (r_list.length > 0) {
|
|
79
|
-
for (let i = 0; i < r_list.length; i++) {
|
|
80
|
-
r_list[i] += text_start_index;
|
|
81
|
-
}
|
|
82
|
-
worker_threads_1.parentPort.postMessage({ type: 2, find_index: r_list });
|
|
83
|
-
}
|
|
84
|
-
text_start_index += (bufferContent.length - query_text_buffer.length);
|
|
85
|
-
bufferContent = copySubarray(bufferContent, bufferContent.length - query_text_buffer.length, bufferContent.length);
|
|
86
|
-
}
|
|
87
|
-
worker_threads_1.parentPort.postMessage({ type: 3 });
|
|
88
|
-
fs.closeSync(fd);
|
|
89
|
-
}
|
|
90
|
-
break;
|
|
91
|
-
case 4:
|
|
92
|
-
done = true;
|
|
93
|
-
break;
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
catch (e) {
|
|
97
|
-
console.log(e);
|
|
98
|
-
}
|
|
99
|
-
}));
|
|
100
|
-
//# sourceMappingURL=file.worker.js.map
|
|
File without changes
|
|
File without changes
|
|
File without changes
|