File: /www/server/panel/BTPanel/static/js/files-path-legacy.js
!function(){function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function n(t){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?e(Object(o),!0).forEach(function(e){r(t,e,o[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):e(Object(o)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))})}return t}function r(e,n,r){return(n=function(e){var n=function(e,n){if("object"!=t(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,n||"default");if("object"!=t(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}(e,"string");return"symbol"==t(n)?n:n+""}(n))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function o(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var t,e,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function u(n,r,o,a){var u=r&&r.prototype instanceof c?r:c,s=Object.create(u.prototype);return i(s,"_invoke",function(n,r,o){var i,a,u,c=0,s=o||[],f=!1,v={p:0,n:0,v:t,a:p,f:p.bind(t,4),d:function(e,n){return i=e,a=0,u=t,v.n=n,l}};function p(n,r){for(a=n,u=r,e=0;!f&&c&&!o&&e<s.length;e++){var o,i=s[e],p=v.p,h=i[2];n>3?(o=h===r)&&(u=i[(a=i[4])?5:(a=3,3)],i[4]=i[5]=t):i[0]<=p&&((o=n<2&&p<i[1])?(a=0,v.v=r,v.n=i[1]):p<h&&(o=n<3||i[0]>r||r>h)&&(i[4]=n,i[5]=r,v.n=h,a=0))}if(o||n>1)return l;throw f=!0,r}return function(o,s,h){if(c>1)throw TypeError("Generator is already running");for(f&&1===s&&p(s,h),a=s,u=h;(e=a<2?t:u)||!f;){i||(a?a<3?(a>1&&(v.n=-1),p(a,u)):v.n=u:v.v=u);try{if(c=2,i){if(a||(o="next"),e=i[o]){if(!(e=e.call(i,u)))throw TypeError("iterator result is not an object");if(!e.done)return e;u=e.value,a<2&&(a=0)}else 1===a&&(e=i.return)&&e.call(i),a<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),a=1);i=t}else if((e=(f=v.n<0)?u:n.call(r,v))!==l)break}catch(e){i=t,a=1,u=e}finally{c=1}}return{value:e,done:f}}}(n,o,a),!0),s}var l={};function c(){}function s(){}function f(){}e=Object.getPrototypeOf;var v=[][r]?e(e([][r]())):(i(e={},r,function(){return this}),e),p=f.prototype=c.prototype=Object.create(v);function h(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,f):(t.__proto__=f,i(t,a,"GeneratorFunction")),t.prototype=Object.create(p),t}return s.prototype=f,i(p,"constructor",f),i(f,"constructor",s),s.displayName="GeneratorFunction",i(f,a,"GeneratorFunction"),i(p),i(p,a,"Generator"),i(p,r,function(){return this}),i(p,"toString",function(){return"[object Generator]"}),(o=function(){return{w:u,m:h}})()}function i(t,e,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}i=function(t,e,n,r){function a(e,n){i(t,e,function(t){return this._invoke(e,n,t)})}e?o?o(t,e,{value:n,enumerable:!r,configurable:!r,writable:!r}):t[e]=n:(a("next",0),a("throw",1),a("return",2))},i(t,e,n,r)}function a(t,e,n,r,o,i,a){try{var u=t[i](a),l=u.value}catch(t){return void n(t)}u.done?e(l):Promise.resolve(l).then(r,o)}function u(t){return function(){var e=this,n=arguments;return new Promise(function(r,o){var i=t.apply(e,n);function u(t){a(i,r,o,u,l,"next",t)}function l(t){a(i,r,o,u,l,"throw",t)}u(void 0)})}}System.register(["./base-lib-legacy.js?v=1777008528","./index-legacy3.js?v=1777008528","./utils-lib-legacy.js?v=1777008528"],function(t,e){"use strict";var r,i,a,l,c,s,f,v,p,h,d,b,m,y,w,g,k,j,O,P,S,_,C,x,T,F,E,G,D;return{setters:[function(t){r=t.c,i=t.r,a=t.H,l=t.w,c=t.o,s=t.a8,f=t.j,v=t.k,p=t.q,h=t.L,d=t.J,b=t.bu,m=t.K,y=t.R,w=t.P,g=t.F,k=t.B,j=t.e,O=t.v,P=t.s,S=t.n,_=t.aW,C=t.az,x=t.b7},function(t){T=t.a9},function(t){F=t.du,E=t.ds,G=t.f,D=t.cZ}],execute:function(){var e=["id"],L={class:"path-input"},M={class:"fold-dir-list"},R=["onClick"],U=["onClick"],W={class:"path-name"},B=["onClick"],q={class:"fold-dir-list"},K=["onClick"],z=r({__name:"files-path",props:{initialPath:{default:"/www/wwwroot"}},emits:["pathChange","refresh"],setup:function(t,r){var D=r.expose,z=r.emit,A=t,I=z,N=G(),H=i(F(10,"letter")),J=i(A.initialPath),V=i(),Z=i(!0),$=i([]),Q=i(0),X=i(!1),Y=a({showMore:!1,showUl:!1,list:[]}),tt=function(){var t=u(o().m(function t(e){var n,r;return o().w(function(t){for(;;)switch(t.p=t.n){case 0:if(Z.value=e,!e){t.n=7;break}if(J.value!==A.initialPath){t.n=1;break}return t.a(2);case 1:if(!((n=J.value).length>0)||n.includes("/")){t.n=2;break}return N.error("路径输入不符合规则"),J.value=A.initialPath,t.a(2);case 2:if(0!==n.length){t.n=3;break}return J.value=A.initialPath,t.a(2);case 3:return t.p=3,t.n=4,nt(n);case 4:r=t.v,J.value=r||n,t.n=6;break;case 5:t.p=5,t.v,J.value=A.initialPath;case 6:t.n=8;break;case 7:E(V.value);case 8:return t.a(2)}},t,null,[[3,5]])}));return function(e){return t.apply(this,arguments)}}(),et=function(t,e){var n;""===t&&(J.value="/"),null===(n=V.value)||void 0===n||n.blur(),e||nt(t)},nt=function(){var t=u(o().m(function t(e){var n,r;return o().w(function(t){for(;;)switch(t.n){case 0:if(n=e.replace(/\/+$/,"")||"/",r=rt(n),"/.Recycle_bin"!==e&&"/www/.Recycle_bin"!==e){t.n=1;break}return N.error("此为回收站目录,请在右上角按【回收站】按钮打开"),t.a(2,!1);case 1:return J.value=r,I("pathChange",r),t.a(2,r)}},t)}));return function(e){return t.apply(this,arguments)}}(),rt=function(t){var e=t;return e=(e=(e=e.replace(/(\\\/|\/\\)/g,"/")).replace(/\\\\+/g,"/")).replace(/\/+/g,"/")},ot=function(t){if(t){var e=t.split("/");"/"!==t?($.value=e.map(function(t,n){return{name:""===t?"根目录":t,path:""===t?"/":e.slice(0,n+1).join("/"),show:!0,showFold:!1,loading:!1,list:[]}}),ut(),S(function(){Y.list=[],Y.showMore=!1;var t=document.querySelectorAll("#".concat(H.value," .path-group-item")),e=document.querySelector("#".concat(H.value," .path-list-group")),n=Array.from(t).reduce(function(t,e){return t+e.clientWidth+4},0);setTimeout(function(){if(n>((null==e?void 0:e.clientWidth)||400)){for(var r=20,o=t.length-1;o>=0;o--)(r+=t[o].clientWidth)>((null==e?void 0:e.clientWidth)||0)&&($.value[o].show=!1,Y.showMore=!0,Y.list=$.value.slice(o+1));Y.showMore&&($.value[0].show=!1,Y.list=$.value.slice(1))}},100)})):$.value=[{name:"根目录",path:"/",show:!0,list:[]}]}},it=function(){if(!X.value){if(X.value=!0,"/"===J.value)return X.value=!1,N.error("当前目录为根目录");var t=J.value.split("/");t.pop();var e=t.join("/");""===e&&(e="/"),nt(e),setTimeout(function(){X.value=!1},500)}},at=function(){var t=u(o().m(function t(e,n){var r,i;return o().w(function(t){for(;;)switch(t.p=t.n){case 0:return t.p=0,ut(),$.value[n].showFold=!0,$.value[n].loading=!0,t.n=1,T({path:e,p:1,showRow:2e3});case 1:r=t.v,i=r.data.dir,$.value[n].loading=!1,$.value[n].list=i.map(function(t){return{name:t.nm,path:"".concat(e,"/").concat(t.nm).replace(/\/+/g,"/")}}),Q.value=n,window.addEventListener("click",ut),t.n=3;break;case 2:t.p=2,t.v,$.value[n].loading=!1;case 3:return t.a(2)}},t,null,[[0,2]])}));return function(e,n){return t.apply(this,arguments)}}(),ut=function(){Y.showUl=!1,$.value[Q.value]&&($.value=$.value.map(function(t){return n(n({},t),{},{showFold:!1})})),window.removeEventListener("click",ut)},lt=function(){var t=u(o().m(function t(){return o().w(function(t){for(;;)switch(t.n){case 0:if(!X.value){t.n=1;break}return t.a(2);case 1:X.value=!0;try{I("refresh")}catch(e){N.error("刷新失败")}finally{setTimeout(function(){X.value=!1},500)}case 2:return t.a(2)}},t)}));return function(){return t.apply(this,arguments)}}();return l(function(){return J.value},function(t){ot(t)},{immediate:!0}),l(function(){return Z.value},function(){Z.value||S(function(){var t;null===(t=V.value)||void 0===t||t.select()})}),l(function(){return A.initialPath},function(t){J.value=t}),c(function(){ot(J.value)}),s(function(){ut()}),D({dirPath:J,refreshList:lt,goBack:it,cutDirPath:et,getPathListGroup:ot}),function(t,n){var r=_,o=C,i=x;return f(),v("div",{class:"nav-path",id:H.value},[p("div",{class:"back rounded-l-large relative",onClick:it},[p("i",{class:h(["svgtofont-el-back",{disabledBack:X.value}])},null,2)]),p("div",L,[d(p("input",{"onUpdate:modelValue":n[0]||(n[0]=function(t){return J.value=t}),ref_key:"pathInputRef",ref:V,type:"text",class:"h-full w-full pl-8px",onBlur:n[1]||(n[1]=function(t){return tt(!0)}),onKeydown:n[2]||(n[2]=y(function(){},["stop"])),onKeyup:n[3]||(n[3]=w(function(t){return et(J.value,!0)},["enter"]))},null,544),[[b,J.value],[m,!Z.value]]),d(p("div",{class:"path-list-group",onClick:n[5]||(n[5]=function(t){return tt(!1)})},[d(p("div",{class:"svgtofont-el-arrow-left font-bold px-[.2rem] h-full leading-[2.9rem] cursor-pointer border-l border-r border-lighter relative hover:border-darker hover:bg-light",onClick:n[4]||(n[4]=y(function(t){return Y.showUl=!0},["stop"]))},[d(p("ul",M,[(f(!0),v(g,null,k(Y.list,function(t,e){return f(),v("li",{class:"fold-dir-item",key:e},[j(r,{effect:"dark",content:t.path,placement:"right","show-after":500},{default:O(function(){return[p("div",{class:"w-full flex items-center",onClick:y(function(e){return et(t.path)},["stop"])},[n[6]||(n[6]=p("span",{class:"dir-icon flex-shrink-0 !h-[1.6rem]"},null,-1)),p("span",null,P(t.name),1)],8,R)]}),_:2},1032,["content"])])}),128))],512),[[m,Y.showUl]])],512),[[m,Y.showMore]]),(f(!0),v(g,null,k($.value,function(t,e){return d((f(),v("div",{key:e,class:"path-group-item",onClick:y(function(e){return et(t.path)},["stop"])},[j(r,{effect:"dark",content:t.name,placement:"bottom","show-after":500},{default:O(function(){return[p("span",W,P(t.name),1)]}),_:2},1032,["content"]),p("div",{class:"svgtofont-el-arrow-right path-name-icon",onClick:y(function(n){return at(t.path,e)},["stop"])},[d((f(),v("ul",q,[(f(!0),v(g,null,k(t.list,function(t,e){return f(),v("li",{class:"fold-dir-item",key:e},[j(r,{effect:"dark",content:t.path,placement:"right","show-after":500},{default:O(function(){return[p("div",{class:"w-full flex items-center",onClick:y(function(e){return et(t.path)},["stop"])},[n[7]||(n[7]=p("span",{class:"dir-icon flex-shrink-0 !h-[1.6rem]"},null,-1)),p("span",null,P(t.name),1)],8,K)]}),_:2},1032,["content"])])}),128)),d(j(o,{"image-size":60,description:"暂无数据"},null,512),[[m,!t.list.length]])])),[[m,t.showFold],[i,t.loading]])],8,B)],8,U)),[[m,t.show]])}),128))],512),[[m,Z.value]])]),p("span",{class:"refresh rounded-r-large",onClick:lt},[p("i",{class:h({"svgtofont-el-refresh-right":!X.value,"svgtofont-el-loading cursor-not-allowed animate-spin":X.value})},null,2)])],8,e)}}});t("F",D(z,[["__scopeId","data-v-bad05061"]]))}}})}();