filecat 7.10.1 → 7.10.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -11
- package/build/dist/2674.d1bf937289c51ddeceac.js +1 -0
- package/build/dist/{3299.6ab0d94f02171cd762cc.js → 3299.de79d172b41af93a8716.js} +1 -1
- package/build/dist/{4004.f0193c43fb891fdfb0e4.js → 4004.f4c06b50348214eb2962.js} +1 -1
- package/build/dist/9299.76095cb6629c36ca3343.js +1 -0
- package/build/dist/index.html +1 -1
- package/build/dist/main.26c2c54f6ab534513ebd.js +2 -0
- package/build/main.js +1 -1
- package/package.json +2 -2
- package/build/dist/2674.15ca3c6ac911cf6e6e2f.js +0 -1
- package/build/dist/9299.7358ccf05b1415ed7959.js +0 -1
- package/build/dist/main.ab3398f34c41e61310ae.js +0 -2
- /package/build/dist/{main.ab3398f34c41e61310ae.js.LICENSE.txt → main.26c2c54f6ab534513ebd.js.LICENSE.txt} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "filecat",
|
|
3
|
-
"version": "7.10.
|
|
3
|
+
"version": "7.10.2",
|
|
4
4
|
"description": "File browser and server manager",
|
|
5
5
|
"author": "xiaobaidadada",
|
|
6
6
|
"repository": {
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"@xiaobaidadada/node-tuntap2-wintun": "^3.0.2",
|
|
44
44
|
"@xiaobaidadada/ssh2-prebuilt": "^1.16.0",
|
|
45
45
|
"better-sqlite3": "^12.6.2",
|
|
46
|
-
"node-libsmb2": "^1.1.
|
|
46
|
+
"node-libsmb2": "^1.1.1",
|
|
47
47
|
"node-process-watcher": "^1.6.6"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[2674],{92674(e,t,n){n.r(t),n.d(t,{default:()=>A});var a=n(96540),i=n(82893),s=n(34843),o=n(85997),l=n(57952),r=n(47022),c=n(34251),d=n(74848);function u(e){{const[t,n]=(0,a.useState)(!1),[i,s]=(0,a.useState)([]),l=e=>{s(e)},p=async()=>{"folder"===e.type?(t||!e.click||i||await e.click(e,l,e.pre_path),n(!t)):e.click&&await e.click(e,l,e.pre_path)},h=async(t=!1)=>{"folder"!==e.type||t?e.fatherNowToggleExpansion&&e.fatherNowToggleExpansion():await e.click(e,l,e.pre_path)};return(0,a.useEffect)(()=>{s(e.children)},[e.children]),(0,d.jsxs)("div",{className:"studio-item",children:[(0,d.jsxs)("div",{onClick:p,onContextMenu:t=>{t.stopPropagation(),t.nativeEvent.stopImmediatePropagation(),e.handleContextMenu&&e.handleContextMenu(t,e.name,e.pre_path,e.type===r.Iw.folder,h)},className:"studio-item-title"+(e.active_path===e.pre_path?" studio-item-title--active":""),children:[(0,d.jsx)("i",{className:"material-icons studio-item-title-tag","data-icon":t?"arrow_drop_down":"arrow_right",children:"file"==e.type?"":t?"arrow_drop_down":"arrow_right"}),(0,d.jsx)("span",{className:"file-icons",children:(0,d.jsx)("span",{"data-type":(0,c.uL)(e.name),"data-dir":"folder"===e.type,"aria-label":e.name,children:(0,d.jsx)(o.In,{icon:"",aria_label:e.name})})}),(0,d.jsx)("span",{className:"studio-item-name",children:e.name})]}),t&&i&&(0,d.jsx)("div",{style:{marginLeft:20},children:i.map((t,n)=>(0,d.jsx)(a.Fragment,{children:(0,d.jsx)(u,{type:t.type,size:t.size,click:e.click,name:t.name,children:t.children,pre_path:`${e.pre_path}${t.name}${t.type===r.Iw.folder?"/":""}`,handleContextMenu:e.handleContextMenu,active_path:e.active_path,fatherNowToggleExpansion:h},n)},n))})]})}}n(61443);function p(e){return(0,d.jsx)("div",{children:e.list.map((t,n)=>(0,d.jsx)(u,{pre_path:`${e.pre_path}${t.name}${t.type===r.Iw.folder?"/":""}`,name:t.name,type:t.type,handleContextMenu:e.handleContextMenu,fatherNowToggleExpansion:e.fatherNowToggleExpansion,active_path:e.active_path,children:t.children,click:e.click,size:t.size},n))})}var h=n(14284),m=n(34289),f=n(53459),v=n(78247),_=(n(62042),n(2543)),x=n(89824),y=n(22022),w=n(88815),g=n(61973),j=n(23430),k=n(99214);const C=a.lazy(()=>Promise.all([n.e(2543),n.e(4091)]).then(n.bind(n,84091))),S=a.lazy(()=>Promise.all([n.e(4946),n.e(1384),n.e(9334),n.e(1075),n.e(1142)]).then(n.bind(n,71142))),N=a.lazy(()=>n.e(4877).then(n.bind(n,64877))),E=a.lazy(()=>Promise.all([n.e(4946),n.e(2626),n.e(9334),n.e(4004)]).then(n.bind(n,95733))),b=a.lazy(()=>Promise.all([n.e(8090),n.e(5744)]).then(n.bind(n,16575))),M=a.lazy(()=>Promise.all([n.e(1417),n.e(8781),n.e(2479)]).then(n.bind(n,12479)));function A(e){const[t,n]=(0,a.useState)([]),[u,A]=(0,a.useState)(""),[I,P]=(0,a.useState)(""),[$,R]=(0,a.useState)(!1),[z,F]=(0,a.useState)({path:"",name:""}),[G,D]=(0,a.useState)(""),[L,U]=(0,s.fp)(i.AG.confirm),[T,B]=(0,a.useState)(!1),[K,J]=(0,s.fp)(i.AG.fileShellShow),[O,X]=(0,s.fp)(i.AG.file_shell_hidden),H=(0,a.useRef)(null),V=(0,a.useRef)(null),[W,Y]=(0,a.useState)(!1),[Z,q]=(0,a.useState)(16),[Q,ee]=(0,s.fp)(i.AG.showPrompt),{t:te}=(0,y.Bd)(),ne=(0,g.Zp)(),ae=(ie=z.name,(0,c.uL)(ie)===r.Iw.md);var ie;const se=function(e){return(0,c.uL)(e)===r.Iw.excalidraw}(z.name),oe=function(e){return(0,c.uL)(e)===r.Iw.mind}(z.name),le=(0,a.useRef)(null),re=(0,a.useRef)(null),ce=(0,a.useRef)(null),[de,ue]=(0,a.useState)([]),[pe,he]=(0,a.useState)(-1),[me,fe]=(0,a.useState)("folder"),[ve,_e]=(0,a.useState)(!0),[xe,ye]=(0,a.useState)(!1),we=(0,k.oT)(),[ge]=(0,g.ok)(),je="1"===ge.get("chat_open"),[ke,Ce]=(0,s.fp)(i.AG.studio_chat_width),Se=(0,a.useRef)(null),[Ne,Ee]=(0,a.useState)(!1),[be,Me]=(0,a.useState)(void 0),Ae="studio_chat_session";let Ie=(0,g.zy)().pathname.split("/").filter(Boolean).pop();Ie=decodeURIComponent(Ie);const{check_user_auth:Pe}=(0,v.MH)(),[$e]=(0,s.fp)(i.AG.user_base_info),Re=Pe(j.oV.ai_agent_page);(0,a.useEffect)(()=>{$e?.user_data&&je&&!Re&&we("chat_open",null)},[je,Re,$e]);const ze=(0,m.GG)("file",Ie);const Fe=async()=>{const e=(0,m.GG)("file",Ie);A(e),F({path:e,name:(0,m.mH)(e)});const t=await h.$M.post("studio/get/item",{path:e});if(t.code===f.m.Success){const e=[],a=[];for(const n of t.data.list)"folder"===n.type?e.push(n):"file"===n.type&&a.push(n);n([...e,...a])}};(0,a.useEffect)(()=>{P(""),B(!1),Fe()},[]);const Ge=async(e,t)=>{const n=await h.$M.get(`${encodeURIComponent(t)}`);P(n.data),v.xK.set_value_temp(n.data),F({path:t,name:e}),D(t),fe("folder"),ye(!1)},De=(e,t)=>{e.size>w.o5?U({open:!0,handle:()=>{Ge(e.name,t),U({open:!1,handle:null}),B(!1)},title:"超过20MB了还要打开吗?"}):Ge(e.name,t)};async function Le(){if(!T)return;const e={context:v.xK.get_editor_value()};0===(await h.$M.post(`save/${encodeURIComponent(G)}`,e)).code&&B(!1)}const Ue=e=>{e.ctrlKey&&"s"===e.key&&(e.preventDefault(),T&&Le())};(0,a.useEffect)(()=>(document.addEventListener("keydown",Ue),()=>{document.removeEventListener("keydown",Ue)}),[T]);const Te=(0,a.useCallback)(_.throttle(e=>{const t=parseFloat(getComputedStyle(V.current).fontSize),n=window.innerWidth/t-4,a=e.clientX/t,i=2.25+H.current.offsetWidth/t;a<=n&&a>=i&&q(parseFloat(a.toFixed(2)))},32),[]),Be=()=>{Y(!1),V.current.removeEventListener("pointermove",Te)},Ke=(0,a.useCallback)(_.throttle(e=>{const t=Se.current;if(!t)return;const n=parseFloat(getComputedStyle(t).fontSize),a=t.parentElement.getBoundingClientRect().right-e.clientX,i=.7*t.parentElement.getBoundingClientRect().width,s=Math.min(Math.max(a,320),i);Ce(parseFloat((s/n).toFixed(2)))},32),[]),Je=()=>{Ee(!1),document.removeEventListener("pointermove",Ke)},Oe=[{r:te("创建文件"),v:"创建文件"},{r:te("创建目录"),v:"创建目录"},{r:te("重命名"),v:"重命名"},{r:te("删除"),v:"删除"}],Xe=[{r:te("重命名"),v:"重命名"},{r:te("删除"),v:"删除"}],He=(e,t,n,a,i)=>{e.preventDefault();const s=new c.ik;s.path=n,s.filename=t,s.x=e.clientX,s.y=e.clientY,s.items=a?Oe:Xe,i===Fe&&(s.items=s.items.slice(0,2)),s.type=a?r.Iw.studio_folder:r.Iw.studio_file;const o=e=>{i(e)};s.textClick=e=>{switch(e){case"创建文件":ee({show:!0,type:x.PromptEnum.FileNew,overlay:!0,data:{dir:n,call:o}});break;case"创建目录":ee({show:!0,type:x.PromptEnum.DirNew,overlay:!0,data:{dir:n,call:o}});break;case"删除":if(T&&(z.path===n||z.path.includes(n))){const e=()=>{o(a),B(!1),F({}),P(""),v.xK.set_value_temp("")};ee({show:!0,type:x.PromptEnum.FilesDelete,overlay:!0,data:{path:n,call:e,filename:t}});break}ee({show:!0,type:x.PromptEnum.FilesDelete,overlay:!0,data:{path:n,filename:t,call:a?()=>{o(!0)}:o}});break;case"重命名":ee({show:!0,type:x.PromptEnum.FileRename,overlay:!0,data:{path:n,dir:(0,m.Yp)(n),call:()=>{o(!0)},filename:t}})}},ee({show:!0,type:x.PromptEnum.FileMenu,overlay:!1,data:s})};const Ve=ae&&"outline"===me;return(0,d.jsxs)("div",{className:"studio studio--file",children:[(0,d.jsxs)(l.A,{ignore_tags:!0,left_children:[(0,d.jsx)(o.rA,{title:"取消",icon:"close",onClick:()=>{J({show:!1,path:""}),X(void 0),ne(-1)}},1),(0,d.jsx)("div",{children:z.name},2)],children:[(0,d.jsx)("title",{children:z.name}),(0,d.jsx)(o.rA,{title:"侧边栏",icon:"list",onClick:()=>_e(e=>!e),selected:ve}),ae&&[xe?(0,d.jsx)(o.rA,{title:te("保存"),icon:"save",onClick:()=>le.current?.save()},"save"):null,(0,d.jsx)(o.rA,{icon:"source"===le.current?.mode()?"edit":"code",title:"source"===le.current?.mode()?te("实时编辑模式"):te("源码模式"),onClick:()=>le.current?.toggle_mode()},"mode"),(0,d.jsx)(o.rA,{title:te("导出PDF"),icon:"print",onClick:()=>le.current?.export_pdf()},"pdf")],!ae&&(0,c.zr)(z.name)&&(0,d.jsx)(o.rA,{title:"格式化",icon:"data_object",onClick:function(){v.xK.get_editor()?.formatCode()}}),(0,d.jsx)(o.rA,{icon:"terminal",title:"shell",onClick:function(){!0!==O&&!1!==O?K.show?J({show:!1,path:""}):(J({show:!0,path:(0,m.GG)("file",Ie)}),X(!1)):X(!O)}}),Pe(j.oV.ai_agent_page)&&(0,d.jsx)(o.rA,{title:te("AI 聊天"),icon:"smart_toy",selected:je,onClick:()=>we("chat_open",!je?"1":null)}),ae?xe?(0,d.jsx)(o.rA,{title:te("保存"),icon:"save",onClick:()=>le.current?.save()}):null:se?(0,d.jsx)(o.rA,{title:te("保存"),icon:"save",onClick:()=>re.current?.save()}):oe?(0,d.jsx)(o.rA,{title:te("保存"),icon:"save",onClick:()=>ce.current?.save()}):T?(0,d.jsx)(o.rA,{title:"保存",icon:"save",onClick:Le}):null]}),(0,d.jsxs)("div",{className:"studio-body",ref:V,children:[(0,d.jsxs)("div",{className:"studio-nav",style:{display:ve?void 0:"none",width:Z-1+"em"},onContextMenu:e=>{He(e,z.name,(0,m.GG)("file",Ie),!0,Fe)},children:[(0,d.jsx)("div",{className:"studio-nav-outline",style:{display:Ve?void 0:"none"},children:(0,d.jsx)(N,{items:de,active_pos:pe,on_click:e=>le.current?.goto_heading(e)})}),(0,d.jsx)("div",{className:"studio-nav-folder",style:{display:Ve?"none":void 0},children:(0,d.jsx)(p,{pre_path:u,list:t,click:async(e,t,n)=>{if("folder"===e.type){const e=await h.$M.post("studio/get/item",{path:`${n}`});if(e.code===f.m.Success){const n=[],a=[];for(const t of e.data.list)"folder"===t.type?n.push(t):"file"===t.type&&a.push(t);t([...n,...a])}}else{if(T)return void U({open:!0,handle:()=>{U({open:!1,handle:null}),B(!1),De(e,n)},title:"确定不保存就切换吗?"});De(e,n)}},active_path:G,handleContextMenu:He,fatherNowToggleExpansion:Fe})}),ae&&(0,d.jsx)("div",{className:"studio-nav-switch",children:(0,d.jsx)(o.rA,{icon:Ve?"folder":"list",title:te(Ve?"文件目录":"大纲"),onClick:()=>fe(Ve?"folder":"outline")})})]}),ve&&(0,d.jsx)("div",{className:"studio__divider",ref:H,onPointerDown:()=>{Y(!0),V.current.addEventListener("pointermove",Te)},onPointerUp:Be}),W&&(0,d.jsx)("div",{className:"shell__overlay",onPointerUp:Be}),ae?(0,d.jsx)("div",{className:"studio-editor studio-editor--md",children:(0,d.jsx)(a.Suspense,{fallback:null,children:(0,d.jsx)(S,{pane:{path:G,url:h.$M.getDownloadUrl(encodeURIComponent(G)),name:z.name,on_dirty:ye,on_outline:(e,t)=>{ue(e),he(t)},register:e=>{le.current=e}}})})},G):se?(0,d.jsx)("div",{className:"studio-editor studio-editor--draw",children:(0,d.jsx)(a.Suspense,{fallback:null,children:(0,d.jsx)(b,{reset_key:G,url:h.$M.getDownloadUrl(encodeURIComponent(G)),save_path:G,on_dirty:B,on_saved:()=>B(!1),register:e=>{re.current=e}})})},G):oe?(0,d.jsx)("div",{className:"studio-editor studio-editor--mind",children:(0,d.jsx)(a.Suspense,{fallback:null,children:(0,d.jsx)(M,{reset_key:G,url:h.$M.getDownloadUrl(encodeURIComponent(G)),on_dirty:B,on_saved:()=>B(!1),register:e=>{ce.current=e},on_save:async e=>(await h.$M.post(`save/${encodeURIComponent(G)}`,{context:e})).code===f.m.Success})})},G):(0,d.jsx)("div",{className:"studio-editor",children:z.name&&(0,d.jsx)(a.Suspense,{fallback:null,children:(0,d.jsx)(C,{name:z.name,on_change:()=>{T||B(!0)}})})},G),je&&(0,d.jsxs)(a.Fragment,{children:[(0,d.jsx)("div",{className:"studio__divider studio__divider--chat",ref:Se,onPointerDown:e=>{e.preventDefault(),Ee(!0),document.addEventListener("pointermove",Ke),document.addEventListener("pointerup",Je,{once:!0})}}),(0,d.jsx)("div",{className:"studio-chat-panel",style:{width:`${ke}em`},children:(0,d.jsx)(a.Suspense,{fallback:null,children:(0,d.jsx)(E,{inline_header:!0,sync_url:!1,file_cwd_path:ze,session_id:be??(e=>{try{const t=sessionStorage.getItem(Ae);if(!t)return;const n=JSON.parse(t);return n?.[e]||void 0}catch{return}})(ze),on_session_change:e=>{Me(e),((e,t)=>{try{const n=sessionStorage.getItem(Ae),a=n?JSON.parse(n):{};a[e]=t,sessionStorage.setItem(Ae,JSON.stringify(a))}catch{}})(ze,e)}})})})]})]})]})}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[9299],{47374(e,t,n){n.d(t,{e:()=>p});var i=n(96540),s=n(61973),o=n(64694),a=n(34289),l=n(61443),r=n(75725),c=n(22022),d=n(85997),_=n(74848);function p(e){let t=(0,s.zy)();const[n,p]=(0,i.useState)([]),[f,h]=(0,i.useState)("/"),[u,m]=(0,i.useState)(void 0),{t:w,i18n:v}=(0,c.Bd)();i.useEffect(()=>{let t="",n=(0,a.vX)().split("/");n=n.filter(e=>e);const i=n.indexOf(e.baseRoute),s=[];if(-1!=i){t=(0,o.IO)(n.slice(0,i),e.baseRoute);const a=n.slice(i+1);for(let e=0;e<a.length;e++){const n=a[e];s.push({value:n,href:0===e?`${t}${n}/`:(0,o.IO)(s[e-1].href,n)})}h(t),p(s)}},[t]);const g=t=>{t.stopPropagation(),e.clickFun(t)};return(0,_.jsx)("div",{className:"breadcrumbs",onClick:e=>{m(void 0!==u?void 0:"")},children:(0,_.jsx)(i.Fragment,{children:void 0===u?(0,_.jsxs)(i.Fragment,{children:[(0,_.jsx)("span",{className:"chevron",children:(0,_.jsx)(s.N_,{to:f,onClick:g,children:(0,_.jsx)(d.In,{icon:"home"})})}),n.map((e,t)=>(0,_.jsxs)("span",{className:"chevron",children:[(0,_.jsx)(d.In,{icon:"keyboard_arrow_right"}),(0,_.jsx)(s.N_,{to:e.href,onClick:g,children:decodeURIComponent(e.value)})]},t))]}):(0,_.jsx)(r.QM,{click:()=>{m(void 0)},children:(0,_.jsx)(l.Sm,{width:"100%",placeholder:w("输入跳转的目录"),handlerEnter:t=>{e.input_path_enter&&e.input_path_enter(t),m(void 0)}})})})})}},77481(e,t,n){n.d(t,{S:()=>l,X:()=>a});var i=n(96540),s=n(61443),o=n(74848);function a(e){const[t,n]=i.useState([]),a=(0,i.useRef)(-1),[l,r]=(0,i.useState)(-1),[c,d]=(0,i.useState)(-1);(0,i.useEffect)(()=>{e.children?n(Array.isArray(e.children)?e.children:[e.children]):n(e.rows)},[e.rows,e.children]);const _=()=>{a.current=-1,r(-1),d(-1)};return(0,o.jsxs)("table",{children:[(0,o.jsx)("thead",{children:(0,o.jsx)("tr",{children:e.headers?.map((t,n)=>{const i=!!e.filter&&(e.filter.column??0)===n;let a=t;if(i){const n=e.filter,i=n.options.find(e=>e.value===n.value);null!=n.value&&i&&(a=`${t} (${i.label})`)}return(0,o.jsx)("th",{className:i?"table-filter-col":"",children:i?(0,o.jsx)(s.l6,{value:e.filter.value,options:e.filter.options,onChange:e.filter.onChange,bare:!0,trigger_label:a}):t},n)})})}),(0,o.jsx)("tbody",{children:t.map((t,n)=>{const i=!!e.onRowDrag;return(0,o.jsx)("tr",{className:i?(l===n?"row-dragging":"")+(c===n?" row-drop-target":""):"",draggable:i,onContextMenu:()=>{e.handleContextMenu&&e.handleContextMenu(t)},onDragStart:e=>{i&&(a.current=n,r(n),e.dataTransfer.effectAllowed="move")},onDragOver:e=>{!i||a.current<0||(e.preventDefault(),e.dataTransfer.dropEffect="move",d(n))},onDrop:t=>{i&&(t.preventDefault(),(()=>{const t=a.current,n=c;_(),t<0||n<0||t===n||e.onRowDrag?.(t,n)})())},onDragEnd:_,children:t.map((n,i)=>{const s=i===t.length-1?"small":"";return(0,o.jsx)("td",{className:s,style:{width:e.width??"auto"},children:n},i)})},n)})})]})}function l(e){return(0,o.jsx)("div",{style:{display:e.isFlex?"flex":"block"},children:e.columns.map((e,t)=>(0,o.jsx)("div",{children:e},t))})}},19299(e,t,n){n.r(t),n.d(t,{default:()=>q});var i=n(96540),s=n(47374),o=n(34843),a=n(82893),l=n(14284),r=n(61973),c=n(4412),d=n(89824),_=n(34289),p=n(53459),f=n(99214),h=n(61443),u=n(47022),m=n(62042),w=n(22022),v=n(7523),g=n(78247),x=n(88815),y=n(6960),j=n(47071),k=n(14944),G=n(92275),A=n(23430);var b=n(34251),C=n(60096),S=n(87361),M=n(76559),$=n(85997),z=n(77481),N=n(70447),D=n(74848);const I=500;function P(e){const{t}=(0,w.Bd)(),n=(0,r.Zp)(),[,s]=(0,o.fp)(a.AG.prompt_card),[l,c]=(0,i.useState)(""),[d,_]=(0,i.useState)(!1),[p,f]=(0,i.useState)([]),[u,m]=(0,i.useState)(0),[v,g]=(0,i.useState)(!1),x=(0,i.useMemo)(()=>new M.I(window.location.host,"file_deep_search"),[]),y=(0,i.useRef)(!1),j=decodeURIComponent(e.base_path);(0,i.useEffect)(()=>{let e=[],t=null;const n=()=>{if(t=null,y.current||!e.length)return;const n=e;e=[],m(e=>e+n.length),f(e=>e.length>=I?e:[...e,...n].slice(0,I))},i=()=>{y.current||_(!1)};return x.addMsg(G.HK.file_deep_search_data,i=>{y.current||(e.push(...i.context??[]),null===t&&(t=setTimeout(n,100)))}),x.addMsg(G.HK.file_deep_search_end,()=>{y.current||(n(),_(!1))}),x.on_message("close",i),()=>{y.current=!0,clearTimeout(t),x.sendData(G.HK.file_deep_search_cancel,{}).catch(()=>{}),x.off_message("close",i),x.close()}},[]);const k=()=>{const t=l.trim();if(!t||d)return;f([]),m(0),g(!0),_(!0);const n={param_path:e.base_path,keyword:t};x.sendData(G.HK.file_deep_search,n).catch(()=>{})},A=e=>{let t=e.is_dir?e.path:e.path.slice(0,e.path.lastIndexOf("/")+1);t.endsWith("/")||(t+="/"),s({open:!1}),n(S.o.file+t.split("/").map(encodeURIComponent).join("/"))};return(0,D.jsxs)("div",{className:"file-deep-search",children:[(0,D.jsxs)("div",{className:"file-deep-search__bar",children:[(0,D.jsx)(h.$Z,{icon:"search",value:l,placeholder:t("搜文件名"),handleInputChange:e=>c(e),handleEnterPress:k}),(0,D.jsx)("button",{className:"button button--flat",onClick:d?()=>{x.sendData(G.HK.file_deep_search_cancel,{}).catch(()=>{}),_(!1)}:k,children:t(d?"取消":"搜索")})]}),(0,D.jsxs)("div",{className:"file-deep-search__hint",children:[(0,D.jsxs)("span",{children:[t("范围"),":",j]}),u>0&&(0,D.jsx)("span",{className:"file-deep-search__count",children:u>I?`${t("已显示")} 500 / ${u}`:`${u}`})]}),(0,D.jsxs)("div",{className:"file-deep-search__body",children:[p.length>0&&(0,D.jsx)(z.X,{headers:[t("名称"),t("路径"),""],rows:p.map(e=>{const n=e.path.slice(0,e.path.lastIndexOf("/")+1);return[e.is_dir?(0,D.jsx)("span",{className:"file-deep-search__dir",children:e.name}):e.name,(0,D.jsx)(N.xP,{context:n}),(0,D.jsx)($.rA,{icon:"folder_open",title:t("打开所在目录"),onClick:()=>A(e)})]})}),d&&(0,D.jsxs)("div",{className:"file-deep-search__empty",children:[(0,D.jsx)("span",{className:"chat-session-running",title:t("搜索中")}),t("搜索中")]}),!d&&u>I&&(0,D.jsx)("div",{className:"file-deep-search__more",children:t("结果过多")}),!d&&0===p.length&&(0,D.jsx)("div",{className:"file-deep-search__empty",children:t(v?"无匹配":"输入后搜")})]})]})}var E=n(23496),F=n(12730),X=n(75725),R=n(40505);let K={};function H(){const{t:e}=(0,w.Bd)();let t=(0,r.zy)();const n=(0,r.Zp)(),{check_user_auth:s}=(0,g.MH)(),[c,p]=(0,o.fp)(a.AG.nowFileList),[h,x]=(0,o.fp)(a.AG.uploadFiles),[y,j]=(0,o.fp)(a.AG.showPrompt),[C,M]=(0,o.fp)(a.AG.selectedFileList),[z,I]=(0,o.fp)(a.AG.copyedFileList),[P,E]=(0,o.fp)(a.AG.cutedFileList),[R,H]=(0,o.fp)(a.AG.selectedFileList),[L,O]=(0,o.fp)(a.AG.clickFileList),[U,Y]=(0,o.fp)(a.AG.fileShellShow),[B]=(0,o.fp)(a.AG.current_mount),[Z,W]=(0,o.fp)(a.AG.file_root_list),[T,V]=(0,o.fp)(a.AG.file_root_index),[q,J]=(0,i.useState)(void 0),[Q,ee]=(0,i.useState)(""),[te,ne]=(0,o.fp)(a.AG.workflow_show),[ie,se]=(0,o.fp)(a.AG.workflow_realtime_show),[oe,ae]=(0,o.fp)(a.AG.work_flow_show),{initUserInfo:le}=(0,i.useContext)(v.F),[re,ce]=(0,o.fp)(a.AG.user_base_info),{click_file:de}=(0,f.kZ)(),[_e,pe]=(0,o.fp)(a.AG.prompt_card),fe=(0,i.useMemo)(()=>c.files.reduce((e,t)=>e+(t.type!==u.Iw.folder?1:0),0),[c]),he=(0,i.useMemo)(()=>c.files.reduce((e,t)=>e+(t.type===u.Iw.folder?1:0),0)+(c.folders?.length??0),[c]);function ue(e){(0,m.SK)(e)}(0,i.useEffect)(()=>{K={}},[t]),(0,i.useEffect)(()=>()=>{Y({show:!1,path:""})},[]);const me=(0,f.Vs)(),we=t=>{pe({open:!0,title:e("信息"),context_div:(0,D.jsxs)("div",{style:{maxWidth:"25rem"},children:[(0,D.jsx)(X.Yh,{left:e("挂载位置磁盘"),right:t?.total_size}),(0,D.jsx)(X.Yh,{left:`${e("磁盘剩余")}`,right:t?.left_size}),(0,D.jsx)(X.Yh,{left:`${e("文件系统")}`,right:t?.fs_type}),(0,D.jsx)(X.Yh,{left:`${e("文件夹数")}`,right:he}),(0,D.jsx)(X.Yh,{left:`${e("文件数")}`,right:fe}),(0,D.jsx)(X.Yh,{left:`${e("当前位置")}`,right:(0,D.jsx)(N.xP,{context:t?.now_absolute_path})})]}),cancel:()=>{k.ws.removeMsg(G.HK.file_info)}})};return(0,D.jsxs)(i.Fragment,{children:[C.length>0&&(0,D.jsx)($.rA,{icon:"delete",title:e("删除"),onClick:()=>{j({show:!0,type:d.PromptEnum.FilesDelete,overlay:!0,data:{}})}}),C.length>0&&(0,D.jsx)($.rA,{icon:"content_copy",title:e("复制"),onClick:function(){const e=(0,f.ib)(c,C);I(e.map(e=>(0,f.Ok)(e.name))),E([]),ue("已复制")}}),C.length>0&&(0,D.jsx)($.rA,{icon:"content_cut",title:e("剪切"),onClick:function(){const e=(0,f.ib)(c,C);E(e.map(e=>(0,f.Ok)(e.name))),I([]),ue("已剪切")}}),(z.length>0||P.length>0)&&(0,D.jsx)($.rA,{onClick:function(){j({show:!0,type:d.PromptEnum.Confirm,overlay:!0,data:{}})},icon:"content_paste",title:e("粘贴到此处"),tip:z.length+P.length}),C.length>0&&(0,D.jsx)($.rA,{icon:"download",title:e("下载"),onClick:function(){const e=(0,f.ib)(c,C);for(let t=0;t<e.length;t++){const n=e[t];e[t]=encodeURIComponent((0,f.Ok)(n.name))}const t=l.$M.getDownloadUrl(e);window.open(t)}}),C.length>0&&(0,D.jsx)($.rA,{icon:"compress",title:e("压缩"),onClick:function(){const e=(0,f.ib)(c,C);for(let t=0;t<e.length;t++){const n=e[t];e[t]=(0,f.Ok)(n.name)}e&&0!==e.length?j({show:!0,type:d.PromptEnum.Compress,overlay:!0,data:{files:e}}):(0,m.zN)("没有选中")}}),1===C.length&&(0,D.jsx)($.rA,{icon:"edit_attributes",title:e("重命名"),onClick:function(){j({show:!0,type:d.PromptEnum.FileRename,overlay:!0,data:{}})}}),oe&&(0,D.jsx)($.rA,{icon:"api",title:"workflow",onClick:()=>{ne(!te)}}),!B&&(0,D.jsx)($.rA,{icon:"terminal",title:"shell",onClick:function(){U.show?Y({show:!1,path:""}):Y({show:!0,path:(0,_.GG)("file",(0,_.vX)())})}}),s(A.oV.share_file)&&(0,D.jsx)($.rA,{icon:"share",title:e("文件分享"),onClick:()=>{n(`${S.o.share_list_setting_page}`)}}),(0,D.jsx)($.rA,{icon:"grid_view",title:e("切换样式"),onClick:me}),(0,D.jsx)($.rA,{icon:"create_new_folder",title:e("创建文件夹"),onClick:function(){j({show:!0,type:d.PromptEnum.DirNew,overlay:!0,data:{dir:(0,_.GG)("file",(0,_.vX)())}})}}),(0,D.jsx)($.rA,{icon:"note_add",title:e("创建文本文件"),onClick:function(){j({show:!0,type:d.PromptEnum.FileNew,overlay:!0,data:{dir:(0,_.GG)("file",(0,_.vX)())}})}}),(0,D.jsx)($.rA,{icon:"upload_file",title:e("上传"),onClick:()=>{j({show:!0,type:d.PromptEnum.UploadFile,overlay:!0,data:{call:e=>{let t=e.currentTarget?.files;if(!t)return;let n=!!t[0].webkitRelativePath;const i=[],s=new Set;for(let e=0;e<t.length;e++){const o=t[e],a=n?o.webkitRelativePath:`${o.webkitRelativePath}${o.name}`;o.fullPath=a,n&&s.add((0,F.S)(a)),i.push(o)}const o=[];if(n)for(const e of s)o.push({isDir:!0,fullPath:e,name:e});o.push(...i),x(o),j({show:!0,type:d.PromptEnum.FilesUpload,overlay:!1,data:{}})}}})}}),(0,D.jsx)($.rA,{icon:"info",title:e("信息"),onClick:async()=>{let e;if(!K.now_absolute_path){k.ws.addMsg(G.HK.file_info,t=>{const n=t.context;e&&(K={...K,...n},k.ws.removeMsg(G.HK.file_info),we(K))});const t=await k.ws.sendData(G.HK.file_info,{type:u.Iw.folder,path:(0,_.GG)("file",(0,_.vX)())});e=t.context,K=e,we(K)}we(K)}}),(0,D.jsx)($.rA,{icon:"more_vert",title:e("切换目录"),onClick:t=>{const i=new b.ik;i.x=t.clientX,i.y=t.clientY,i.type=u.Iw.directory,i.items=Z,i.item_pre_value=T,i.textClick=async t=>{if(-1===t)return n(`${S.o.setting_private_env_setting}`),j({data:void 0,overlay:!1,type:"",show:!1}),void(0,m.N9)(e("请配置 文件夹路径"));(async e=>{V(e),await l.$M.post("base_switch",{root_index:e}),await le(),n("/file/"),H([]),O([])})(t),j({data:void 0,overlay:!1,type:"",show:!1})},j({show:!0,type:d.PromptEnum.FileMenu,overlay:!1,data:i})}})]})}var L=n(2543),O=n(21499),U=n(64694),Y=n(17903);const B=i.lazy(()=>Promise.all([n.e(7856),n.e(6349),n.e(3659)]).then(n.bind(n,63659))),Z=i.lazy(()=>Promise.all([n.e(7856),n.e(1636)]).then(n.bind(n,81636))),W=i.lazy(()=>Promise.all([n.e(4946),n.e(2626),n.e(9334),n.e(4004)]).then(n.bind(n,95733)));let T,V="";function q(){const[e,t]=(0,o.fp)(a.AG.editorSetting),[,n]=(0,o.fp)(a.AG.md_editor),[,m]=(0,o.fp)(a.AG.log_viewer),[,M]=(0,o.fp)(a.AG.image_editor),[,z]=(0,o.fp)(a.AG.markdown),[,N]=(0,o.fp)(a.AG.excalidraw_editor),[,I]=(0,o.fp)(a.AG.mind_editor),[F,X]=(0,o.fp)(a.AG.file_preview),{t:K}=(0,w.Bd)();let q=(0,r.zy)();const J=(0,r.Zp)(),[Q,ee]=(0,o.fp)(a.AG.nowFileList),[te]=(0,o.fp)(a.AG.file_list_refresh),[ne]=(0,o.fp)(a.AG.mount_enabled),[ie,se]=(0,o.fp)(a.AG.current_mount),[oe,ae]=(0,o.fp)(a.AG.showPrompt),[le,re]=(0,o.fp)(a.AG.selectedFileList),[ce,de]=(0,o.fp)(a.AG.clickFileList),[_e,pe]=(0,o.fp)(a.AG.fileShellShow),[fe,he]=(0,i.useState)(""),[ue,me]=(0,o.fp)(a.AG.workflow_show),[we,ve]=(0,o.fp)(a.AG.workflow_realtime_show),[ge,xe]=(0,o.fp)(a.AG.work_flow_show),{initUserInfo:ye}=(0,i.useContext)(v.F),[je,ke]=(0,o.fp)(a.AG.user_base_info),{check_user_auth:Ge}=(0,g.MH)(),{click_file:Ae}=(0,f.kZ)(),[be]=(0,r.ok)(),Ce=(0,f._A)(),Se=i.useRef(null),[Me,$e]=(0,o.fp)(a.AG.to_running_files),[ze,Ne]=(0,o.fp)(a.AG.file_page),[De]=(0,o.fp)(a.AG.blank_search_mode),[,Ie]=(0,o.fp)(a.AG.prompt_card),[Pe,Ee]=(0,o.fp)(a.AG.blank_search_mode_for_temp),Fe=(0,f.oT)(),Xe="1"===be.get("chat_open"),Re=Ge(A.oV.ai_agent_page);(0,i.useEffect)(()=>{je?.user_data&&Xe&&!Re&&Fe("chat_open",null)},[Xe,Re,je]);const[Ke,He]=(0,o.fp)(a.AG.studio_chat_width),Le=i.useRef(null),[Oe,Ue]=(0,i.useState)(!1),[Ye,Be]=(0,i.useState)(void 0),Ze=(0,_.GG)("file",(0,_.vX)()),We="file_list_chat_session",Te=function(){const[e,t]=(0,o.fp)(a.AG.user_base_info),{t:n}=(0,w.Bd)(),{check_user_auth:s}=(0,g.MH)(),[c,p]=(0,o.fp)(a.AG.router_jump),h=(0,r.Zp)(),{initUserInfo:m}=(0,i.useContext)(v.F),[x,y]=(0,o.fp)(a.AG.nowFileList),[j,C]=(0,o.fp)(a.AG.showPrompt),[M,$]=(0,o.fp)(a.AG.fileShellShow),[z,N]=(0,o.fp)(a.AG.blank_search_mode);return t=>{t.preventDefault(),t.stopPropagation();const i=new b.ik;i.x=t.clientX,i.y=t.clientY,i.type=u.Iw.directory;const o=[{r:(0,D.jsx)("span",{style:(0,R.ok)(e.user_data.dir_show_type===A.t8.time_minx_max),children:n("时间逆序")}),v:A.t8.time_minx_max},{r:(0,D.jsx)("span",{style:(0,R.ok)(e.user_data.dir_show_type===A.t8.time_max_min),children:n("时间顺序")}),v:A.t8.time_max_min}],a=[{r:(0,D.jsx)("span",{style:(0,R.ok)(e.user_data.dir_show_type===A.t8.size_min_max),children:n("大小顺序")}),v:A.t8.size_min_max},{r:(0,D.jsx)("span",{style:(0,R.ok)(e.user_data.dir_show_type===A.t8.size_max_min),children:n("大小逆序")}),v:A.t8.size_max_min}],r=[{r:(0,D.jsx)("span",{style:(0,R.ok)(!e.user_data.file_list_pagination_mode||e.user_data.file_list_pagination_mode===A.yM.all),children:n("全部加载文件")}),v:A.yM.all},{r:(0,D.jsx)("span",{style:(0,R.ok)(e.user_data.file_list_pagination_mode===A.yM.pagination),children:n("scrll_l")}),v:A.yM.pagination}],c=[{r:(0,D.jsx)("span",{style:(0,R.ok)(!e.user_data.file_time_show_type||e.user_data.file_time_show_type===A.KD.current),children:n("最近时间")}),v:A.KD.current},{r:(0,D.jsx)("span",{style:(0,R.ok)(e.user_data.file_time_show_type===A.KD.time),children:n("准确时间")}),v:A.KD.time}],w=[{r:n("文件列表展示"),items:[{r:n("文件排序"),v:"",items:[{r:(0,D.jsx)("span",{style:(0,R.ok)(!e.user_data.dir_show_type),children:n("系统默认")}),v:A.t8.defualt},{r:(0,D.jsx)("span",{style:(0,R.ok)(e.user_data.dir_show_type===A.t8.name),children:n("名字")}),v:A.t8.name},{r:(0,D.jsx)("span",{style:(0,R.ok)(e.user_data.dir_show_type===A.t8.time_minx_max||e.user_data.dir_show_type===A.t8.time_max_min),children:n("修改时间")}),v:!1,items:o},{r:(0,D.jsx)("span",{style:(0,R.ok)(e.user_data.dir_show_type===A.t8.size_min_max||e.user_data.dir_show_type===A.t8.size_max_min),children:n("文件大小")}),v:!1,items:a}]},{r:n("文件加载方式"),v:"",items:r},{r:n("时间展示"),v:"",items:c},{r:n("缩放调整"),v:"zoom_adjust"},{r:(0,D.jsx)("span",{style:(0,R.ok)(z),children:n("srchbln")}),v:"blank_search_mode"}]}];x?.folders?.find(e=>".git"===e.name)&&w.push({r:n("查看Git提交"),v:"git_page"}),s(A.oV.code_resource)&&w.push({r:n("add_rot"),v:"code_resource"}),s(A.oV.http_proxy)&&w.push({r:n("dl_here"),v:"http_resource"}),e?.user_data?.quick_cmd&&(0,f.LL)([...e.user_data.quick_cmd],w),i.items=w,i.textClick=async e=>{if(console.log(e),!1===e)return;const t={};if("gcfg_dir_config"===e){const e=(0,_.GG)("file",(0,_.vX)());return C({data:void 0,overlay:!1,type:"",show:!1}),void h(`${S.o.gcfg_page}/${encodeURIComponent(e)}`)}if("git_page"===e){const e=(0,_.GG)("file",(0,_.vX)());return C({data:void 0,overlay:!1,type:"",show:!1}),void h(`${S.o.git_page}/${encodeURIComponent(e)}`)}if("code_resource"===e){const e=await k.ws.sendData(G.HK.file_info,{path:(0,_.GG)("file",(0,_.vX)())});return p({page_self_router_api_data:[`/api/${Date.now()}`,e.context.now_absolute_path]}),C({data:void 0,overlay:!1,type:"",show:!1}),void h("/setting/customer_router/")}if("http_resource"===e){const e=await k.ws.sendData(G.HK.file_info,{path:(0,_.GG)("file",(0,_.vX)())});return p({http_download_map_path:e.context.now_absolute_path}),C({data:void 0,overlay:!1,type:"",show:!1}),void h("/proxy/http/")}if("zoom_adjust"===e)return C({data:void 0,overlay:!1,type:"",show:!1}),void setTimeout(()=>{C({show:!0,type:d.PromptEnum.ZoomAdjust,overlay:!1,data:{}})},0);if("object"==typeof e&&"quick_cmd"===e.tag){let t=e.cmd;t&&(t.endsWith("\r")||(t+="\r",$({show:!0,path:(0,_.GG)("file",(0,_.vX)()),cmd:t})))}else{if("blank_search_mode"===e)return N(!z),void C({data:void 0,overlay:!1,type:"",show:!1});if(e===A.yM.all||e===A.yM.pagination)t.is_pagination_mode=!0;else if(e===A.KD.current||e===A.KD.time)t.is_file_show_type=!0;else{if(e!==A.t8.defualt&&e!==A.t8.name&&e!==A.t8.size_max_min&&e!==A.t8.size_min_max&&e!==A.t8.time_max_min&&e!==A.t8.time_minx_max)return;t.is_dir_list_type=!0}}await l.wm.post(E.s.user_save_private_attr,{type:e,...t}),await m(),C({data:void 0,overlay:!1,type:"",show:!1}),h((0,_.vX)())},C({show:!0,type:d.PromptEnum.FileMenu,overlay:!1,data:i})}}(),Ve=async()=>{const e=new j.Nd;e.dir_path=`${(0,_.GG)("file",(0,_.vX)())}`,k.ws.addMsg(G.HK.workflow_realtime,e=>{const t=e.context;if(e.context){for(const e of t.sucess_file_list)(0,f.Ys)(e);for(const e of t.failed_file_list)(0,f.V$)(e);$e(new Set(t.running_file_list))}}),await k.ws.sendData(G.HK.workflow_realtime,e)},qe=async e=>{let t=!1;for(const n of e.files??[])n.origin_size=n.size,n.size=(0,x.v7)(n.size),je.user_data.file_time_show_type===A.KD.time?n.show_mtime=n.mtime?(0,O.Yq)(n.mtime):"":n.show_mtime=n.mtime?(0,y.s)(n.mtime):"",t||!n.name.endsWith(".workflow.yml")&&!n.name.endsWith(".act")||(t=!0,Promise.resolve().then(()=>{Ve()})),n.name===j.SB&&(t=!0);for(const n of e.folders??[])je.user_data.file_time_show_type===A.KD.time?n.show_mtime=n.mtime?(0,O.Yq)(n.mtime):"":n.show_mtime=n.mtime?(0,y.s)(n.mtime):"",n.name===j.SB&&(t=!0);xe(t)},Je=i.useRef(null),Qe=async e=>{if(!0===ne){if(Je.current!==e){Je.current=e;try{const t=await l.$M.post("file/mount_info",{param_path:e});se(t?.data??null)}catch(e){se(null)}}}else se(null)},et=async()=>{const e=(0,_.GG)("file",(0,_.vX)());if(De||Pe)return;let t;if(Qe(e),je.user_data.file_list_pagination_mode===A.yM.pagination){if(V!==e){if(V=e,1!==ze.page_num)return void Ne({page_size:ze.page_size,page_num:1})}else if(ze.page_num<0)return;if(t=await l.$M.post("file_get_page",{param_path:e,page_num:ze.page_num,page_size:ze.page_size}),t.code!==p.m.Success)return;const n=t.data;return qe(n),n.files?.length?(ee(e=>{const t=(0,L.cloneDeep)(1===ze.page_num?n.files:[...e?.files??[],...n.files]),i={...e,files:t};return(0,f.yC)(i,je.user_data.dir_show_type),i}),void(T=t.data)):void Ne({page_size:ze.page_size,page_num:-1})}if(t=await l.$M.get(e),t.code!==p.m.Success)return;const n=t.data;(0,f.yC)(n,je.user_data.dir_show_type),qe(t.data),ee(t.data),T=t.data};(0,i.useEffect)(()=>async()=>{$e(new Set)},[]);const tt=()=>{xe(!1),(()=>{const e=be.get("preview_file_name"),t=be.get("preview_mode");if(!e||!t)return!1;const i=(0,_.GG)("file",(0,_.vX)());if(Se.current===i+e)return!0;Se.current=i+e;const s=()=>Ce(null);return"md"===t?(n({url:l.$M.getDownloadUrl(`${encodeURIComponent(i)}${e}`),path:`${i}${e}`,name:e,close:s}),!0):"log"===t?(m({show:!0,fileName:e,encoding:be.get("preview_log_enc")??"utf8",wrap:be.get("preview_log_wrap")??"wrap",close:s}),!0):"image_edit"===t?(M({path:(0,U.IO)((0,_.vX)(),e),name:e,close:s}),!0):(Ae({name:e,opt_shell:!0,..."text"===t?{model:"text"}:{},close:s}),!0)})()||(t({open:!1}),X({open:!1}),n({}),m({show:!1}),M({}),z({}),N({}),I({}),et())};(0,i.useEffect)(()=>{tt()},[q,ze]),(0,i.useEffect)(()=>{te>0&&et()},[te]);const nt=i.useRef(!1);(0,i.useEffect)(()=>{if(null!==ne)return nt.current?void(!0===ne?Qe((0,_.GG)("file",(0,_.vX)())):se(null)):(nt.current=!0,void(!0===ne&&null===ie&&Qe((0,_.GG)("file",(0,_.vX)()))))},[ne]);const it=e=>{e.target===e.currentTarget&&(re([]),de([]))},st=i.useCallback((0,L.throttle)(e=>{const t=Le.current;if(!t||!t.parentElement)return;const n=parseFloat(getComputedStyle(t).fontSize),i=t.parentElement.getBoundingClientRect(),s=i.right-e.clientX,o=Math.min(Math.max(s,320),.7*i.width);He(parseFloat((o/n).toFixed(2)))},32),[]),ot=()=>{Ue(!1),document.removeEventListener("pointermove",st)},at=(0,D.jsxs)("div",{className:"file-list-main",children:[(0,D.jsx)(s.e,{baseRoute:"file",clickFun:function(){if(re([]),de([]),je.user_data.file_list_pagination_mode===A.yM.pagination){const e=document.getElementById("listing");e&&(e.scrollTop=0),Ne({page_size:ze.page_size,page_num:1})}},input_path_enter:e=>{var t;re([]),de([]),ee({files:[],folders:[]}),!function(e){return"string"==typeof e&&0!==e.length&&(/^[a-zA-Z]:[\\\/]/.test(e)||/^\\\\[^\\/]+[\\/]/.test(e)||/^\//.test(e))}(e)?J(function(e,t){let n=function(e){let t="\\";for(const n of e)if("/"===n||"\\"===n){t=n;break}return t}(e);if("."===t)return e;if(".."===t){if(e.length>1){let t=e[e.length-1]===n?1:0;for(let i=e.length-1-t;i>=0;i--)if(e[i]===n)return e.substring(0,i+1)}return e}return e.endsWith(n)&&t.startsWith(n)?e.slice(0,-1)+t:e.endsWith(n)||t.startsWith(n)?e+t:e+n+t}((0,_.vX)(),e)):(e=e.replace(0===(t=je.user_data).folder_item_now||void 0===t.folder_item_now?t.cwd:t.folder_items[t.folder_item_now-1].path,""),J(e))}}),ie&&(0,D.jsxs)("div",{className:"mount-tip-bar",style:{borderLeftColor:ie.color},children:[(0,D.jsx)("span",{className:"material-icons",style:{color:ie.color},children:"cloud"}),(0,D.jsx)("span",{children:[ie.credential_note,ie.account_note||(Y.C1.find(e=>e.value===ie.driver)?.title??ie.driver),ie.name].filter(Boolean).join(" - ")}),ie.readonly&&(0,D.jsx)("span",{className:"mount-readonly-tag",children:K("只读")})]}),je.user_data.file_list_pagination_mode===A.yM.pagination?(0,D.jsx)(C.$J,{handleContextMenu:Te,clickBlank:it,list:Q.files}):(0,D.jsx)(C.t$,{handleContextMenu:Te,file_list:Q.files,folder_list:Q.folders,clickBlank:it})]});return(0,D.jsxs)(i.Fragment,{children:[(0,D.jsx)(c.aZ,{children:(0,D.jsx)(h.$Z,{handleEnterPress:async()=>{if(De||Pe){if(re([]),de([]),!fe||!fe.trim())return void ee({files:[],folders:[]});const e=(0,_.GG)("file",(0,_.vX)()),t=await l.$M.post("file_get_page",{param_path:e,page_num:1,page_size:1e4,search:fe.trim()});if(t.code!==p.m.Success)return;const n=t.data;return(0,f.yC)(n,je.user_data.dir_show_type),qe(n),ee(n),void(T=n)}if(!T)return;re([]),de([]);const e=[],t=[];for(const t of T.files??[])t.name.includes(fe)&&e.push(t);for(const e of T.folders??[])e.name.includes(fe)&&t.push(e);ee({files:e,folders:t})},placeholder:K("搜索当前目录"),icon:"search",value:"",mobile_hidden:!0,handleIconClick:()=>{const e=(0,_.GG)("file",(0,_.vX)());Ie({open:!0,title:K("深搜"),context_div:(0,D.jsx)(P,{base_path:e})})},handleInputChange:e=>{he(e)},max_width:"25em"})}),(0,D.jsxs)(c.aZ,{position:"right",children:[Ge(A.oV.ai_agent_page)&&(0,D.jsx)($.rA,{icon:"smart_toy",title:K("AI 聊天"),selected:Xe,onClick:()=>Fe("chat_open",!Xe?"1":null)}),(0,D.jsx)("div",{className:"mobile-context-btn",children:(0,D.jsx)($.rA,{icon:"more_horiz",title:K("右键"),onClick:()=>{const e=le[le.length-1];if(void 0!==e){const t=[...Q.folders??[],...Q.files??[]][e];if(t){const n=document.querySelectorAll(".item")[e],i=n?n.getBoundingClientRect():{left:window.innerWidth/2,bottom:100},s={preventDefault:()=>{},stopPropagation:()=>{},clientX:i.left+10,clientY:i.bottom??100},o=new b.ik;o.path=(0,U.IO)((0,_.vX)(),t.name),o.filename=t.name,o.x=s.clientX,o.y=s.clientY,o.type=t.type===u.Iw.folder?u.Iw.folder:(0,b.uL)(t.name),o.size=t.origin_size,ae({show:!0,type:d.PromptEnum.FileMenu,overlay:!1,data:o})}}else{const e={preventDefault:()=>{},stopPropagation:()=>{},clientX:window.innerWidth/2,clientY:window.innerHeight/2};Te(e)}}})}),(0,D.jsx)(H,{})]}),(0,D.jsxs)("div",{className:"file-list-split"+(Xe?" file-list-split--chat":""),children:[at,Xe&&(0,D.jsxs)(i.Fragment,{children:[(0,D.jsx)("div",{className:"studio__divider studio__divider--chat",ref:Le,onPointerDown:e=>{e.preventDefault(),Ue(!0),document.addEventListener("pointermove",st),document.addEventListener("pointerup",ot,{once:!0})}}),(0,D.jsx)("div",{className:"studio-chat-panel",style:{width:`${Ke}em`},children:(0,D.jsx)(i.Suspense,{fallback:null,children:(0,D.jsx)(W,{inline_header:!0,sync_url:!1,file_cwd_path:Ze,session_id:Ye??(e=>{try{const t=sessionStorage.getItem(We);if(!t)return;return JSON.parse(t)?.[e]||void 0}catch{return}})(Ze),on_session_change:e=>{Be(e),((e,t)=>{try{const n=sessionStorage.getItem(We),i=n?JSON.parse(n):{};i[e]=t,sessionStorage.setItem(We,JSON.stringify(i))}catch{}})(Ze,e)}})})})]})]}),Oe&&(0,D.jsx)("div",{className:"shell__overlay",onPointerUp:ot}),ue&&(0,D.jsx)(B,{}),we.open&&(0,D.jsx)(Z,{})]})}}}]);
|