filecat 7.10.2 → 7.12.1

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.
Files changed (30) hide show
  1. package/build/dist/1075.68438aa42e20e5b2d39b.js +1 -0
  2. package/build/dist/1922.77cdb5e5f50b344fcf32.js +2 -0
  3. package/build/dist/1922.77cdb5e5f50b344fcf32.js.LICENSE.txt +23 -0
  4. package/build/dist/259.1c05c3135a8291823002.js +1 -0
  5. package/build/dist/2674.46c009a7ec426b7d8828.js +1 -0
  6. package/build/dist/{3299.de79d172b41af93a8716.js → 3299.5c01eebc0f62cdc7bb39.js} +1 -1
  7. package/build/dist/394.a8337677ef993b923783.js +1 -0
  8. package/build/dist/{4004.f4c06b50348214eb2962.js → 4004.916c0413a6db61a54e11.js} +1 -1
  9. package/build/dist/4903.cac82807407e7342b5ad.js +1 -0
  10. package/build/dist/4935.fe24d47c4075780c9c11.js +1 -0
  11. package/build/dist/5877.e2316c84a95490f77439.js +1 -0
  12. package/build/dist/621.28f07b5c059e80331746.js +1 -0
  13. package/build/dist/{6247.525b0b68872036ac2fa6.js → 6247.6ce123e9fc8b8be16c10.js} +1 -1
  14. package/build/dist/{8302.ce97557b7cf7c8387942.js → 8302.894efa465f6037f9f5a8.js} +1 -1
  15. package/build/dist/892.a62727e6df6e80655ca7.js +1 -0
  16. package/build/dist/9299.4c39ae6b03d41c516b1f.js +1 -0
  17. package/build/dist/9334.f04716a7e41f783abc47.js +1 -0
  18. package/build/dist/index.html +1 -1
  19. package/build/dist/main.65dcea654963fc771a86.js +2 -0
  20. package/build/main.js +1 -1
  21. package/package.json +23 -31
  22. package/build/dist/1075.05eed88707339ca32044.js +0 -1
  23. package/build/dist/259.3c0eb22e9b43ffb63c9c.js +0 -1
  24. package/build/dist/2674.d1bf937289c51ddeceac.js +0 -1
  25. package/build/dist/4903.070aaa53a243baf05133.js +0 -1
  26. package/build/dist/5877.98d0475aaf4058b9a715.js +0 -1
  27. package/build/dist/9299.76095cb6629c36ca3343.js +0 -1
  28. package/build/dist/9334.a25983aafdcbde63ae5e.js +0 -1
  29. package/build/dist/main.26c2c54f6ab534513ebd.js +0 -2
  30. /package/build/dist/{main.26c2c54f6ab534513ebd.js.LICENSE.txt → main.65dcea654963fc771a86.js.LICENSE.txt} +0 -0
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "filecat",
3
- "version": "7.10.2",
4
- "description": "File browser and server manager",
3
+ "version": "7.12.1",
4
+ "description": "A self-hosted Web File browser and lightweight server management tool.",
5
5
  "author": "xiaobaidadada",
6
6
  "repository": {
7
7
  "type": "git",
@@ -56,6 +56,7 @@
56
56
  "@excalidraw/excalidraw": "^0.18.1",
57
57
  "@larksuiteoapi/node-sdk": "^1.68.0",
58
58
  "@microsoft/fetch-event-source": "^2.0.1",
59
+ "@office-kit/xlsx": "^0.24.2",
59
60
  "@types/better-sqlite3": "^7.6.13",
60
61
  "@types/markdown-it": "^14.1.2",
61
62
  "@types/node": "^26.0.0",
@@ -156,39 +157,30 @@
156
157
  "xxhashjs": "^0.2.2"
157
158
  },
158
159
  "keywords": [
159
- "文件服务器",
160
- "linux管理",
161
- "Ai Agent",
162
- "知识库",
163
- "智能体",
164
- "运维面板",
165
- "远程桌面",
166
- "浏览器代理",
167
- "简洁",
168
- "日志",
169
- "http代理工具",
170
- "终端权限",
171
- "持续集成",
172
- "CD/CI",
173
- "http",
174
- "post",
175
- "log",
176
- "filebrowser",
177
- "administrator",
178
- "filemanager",
179
- "cpu",
180
- "docker",
181
- "linux",
182
- "rdp",
183
- "rtsp",
184
- "react",
160
+ "file-server",
161
+ "file-manager",
162
+ "file-browser",
163
+ "web-terminal",
185
164
  "ssh",
165
+ "sftp",
186
166
  "ftp",
187
- "systeminfo",
188
- "vpn",
167
+ "rdp",
168
+ "vnc",
169
+ "rtsp",
170
+ "http-proxy",
171
+ "browser-proxy",
189
172
  "p2p",
173
+ "ddns",
190
174
  "docker",
191
- "ddns"
175
+ "linux",
176
+ "system-monitor",
177
+ "log-viewer",
178
+ "ai-agent",
179
+ "knowledge-base",
180
+ "ci-cd",
181
+ "文件服务器",
182
+ "运维面板",
183
+ "内网传图"
192
184
  ],
193
185
  "bin": {
194
186
  "filecat": "shell/filecat"
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[1075,4877],{69918(t,e,n){n.d(e,{Ce:()=>i,FG:()=>r.FG,fy:()=>c,gC:()=>a});var r=n(18840),o=n(14284),s=n(53459);async function a(){try{const t=await o.XO.get("md_editor_setting/get");return{...r.FG,...t?.data??{}}}catch(t){return{...r.FG}}}async function c(t){const e=await o.XO.post("md_editor_setting/save",t);return e?.code!==s.m.Success?null:{...r.FG,...e.data??t}}function i(t,e){t&&(t.style.setProperty("--md-editor-max-width",e.content_max_width),t.style.setProperty("--md-editor-padding",e.content_padding),t.style.setProperty("--md-editor-font-size",e.font_size),t.style.setProperty("--md-editor-line-height",e.line_height))}},64877(t,e,n){n.r(e),n.d(e,{default:()=>a});var r=n(96540),o=n(22022),s=n(74848);function a(t){const{t:e}=(0,o.Bd)(),[n,a]=(0,r.useState)(new Set),c=(0,r.useMemo)(()=>function(t){const e=[],n=[];for(const r of t){const t={...r,children:[]};for(;n.length>0&&n[n.length-1].level>=t.level;)n.pop();0===n.length?e.push(t):n[n.length-1].children.push(t),n.push(t)}return e}(t.items),[t.items]),i=(r,o)=>r.map(r=>{const c=r.children.length>0,l=n.has(r.pos),d=r.pos===t.active_pos;return(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:`md-outline-item md-outline-item--h${r.level}${d?" md-outline-item--active":""}`,style:{paddingLeft:.4+.75*o+"em"},title:r.text,onClick:()=>t.on_click(r),children:[(0,s.jsx)("i",{className:"material-icons md-outline-arrow"+(c?"":" md-outline-arrow--empty"),onClick:c?t=>{return e=r.pos,t.stopPropagation(),void a(t=>{const n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n});var e}:void 0,children:c?l?"arrow_right":"arrow_drop_down":""}),(0,s.jsx)("span",{className:"md-outline-text",children:r.text||e("未命名标题")})]}),c&&!l&&i(r.children,o+1)]},r.pos)});return 0===t.items.length?(0,s.jsx)("div",{className:"md-outline md-outline--empty",children:(0,s.jsx)("div",{className:"md-outline-tip",children:e("no_head")})}):(0,s.jsx)("div",{className:"md-outline",children:(0,s.jsx)("div",{className:"md-outline-list",children:i(c,0)})})}},76118(t,e,n){n.d(e,{A:()=>dt});var r=n(96540),o=n(22022),s=n(34843),a=n(82893),c=n(42845),i=n(1575),l=n(58903),d=n(89781),u=n(61396),h=n(46762),m=n(73337),p=n(89552),f=n(86059),g=n(5091),_=n(23802),b=n(41105),k=n(89334);const v=new _.A({html:!0,linkify:!0,breaks:!1,typographer:!1});v.renderer.rules.html_block=(t,e)=>`<div data-html-block="${(0,b.pC)(t[e].content)}"></div>`,v.renderer.rules.html_inline=(t,e)=>`<span data-html-inline="${(0,b.pC)(t[e].content)}"></span>`,v.inline.ruler.before("escape","math_inline",function(t,e){const n=t.pos,r=t.src,o=[{open:"\\(",close:"\\)"},{open:"$",close:"$"}];if(r.startsWith("$$",n))return!1;for(const s of o){if(!r.startsWith(s.open,n))continue;const o=n+s.open.length,a=r.indexOf(s.close,o);if(a<0)continue;const c=r.slice(o,a);if(c.trim()){if("$"===s.open){const t=r[a+1];if(void 0!==t&&/\d/.test(t))continue}if(!e){const e=t.push("math_inline","span",0);e.content=c,e.markup=s.open,e.meta={raw:r.slice(n,a+s.close.length)}}return t.pos=a+s.close.length,!0}}return!1}),v.block.ruler.before("fence","math_block",function(t,e,n,r){const o=t.bMarks[e]+t.tShift[e],s=t.eMarks[e],a=t.src.slice(o,s).trim(),c=[{open:"\\[",close:"\\]"},{open:"$$",close:"$$"}];for(const s of c){if(!a.startsWith(s.open))continue;if(a.endsWith(s.close)&&a.length>s.open.length+s.close.length){if(r)return!0;const n=a.slice(s.open.length,a.length-s.close.length),o=t.push("math_block","div",0);return o.content=n,o.markup=s.open,o.meta={raw:a},o.map=[e,e+1],t.line=e+1,!0}const c=a.slice(s.open.length);for(let a=e+1;a<n;a++){const n=t.bMarks[a]+t.tShift[a],i=t.eMarks[a],l=t.src.slice(n,i);if(!l.trimEnd().endsWith(s.close))continue;if(r)return!0;const d=[c,...t.getLines(e+1,a,t.tShift[e],!1).split("\n")].filter((t,e)=>!(0===e&&!t.trim())),u=l.trimEnd().slice(0,-s.close.length);d.push(u);const h=t.push("math_block","div",0);return h.content=d.join("\n").trim(),h.markup=s.open,h.map=[e,a+1],h.meta={raw:t.src.slice(o,t.eMarks[a]).trimEnd()},t.line=a+1,!0}}return!1},{alt:["paragraph","reference","blockquote","list"]}),v.renderer.rules.math_inline=(t,e)=>`<span data-math-inline="${(0,b.pC)(t[e].meta.raw)}"></span>`,v.renderer.rules.math_block=(t,e)=>`<div data-math-block="${(0,b.pC)(t[e].meta.raw)}"></div>`;const y=v.renderer.rules.fence;function w(t){const e=v.render(t??""),n=(new DOMParser).parseFromString(e,"text/html");return l.S4.fromSchema(g.Y).parse(n.body)}function M(t){let e="";return t.forEach(t=>{if(t.isText){let n=t.marks.some(t=>"code"===t.type.name)?t.text??"":function(t){return t.replace(/([\\`*_[\]<>])/g,"\\$1")}(t.text??"");for(const e of t.marks)switch(e.type.name){case"code":n=`\`${t.text??""}\``;break;case"strong":n=`**${n}**`;break;case"em":n=`*${n}*`;break;case"strike":n=`~~${n}~~`;break;case"link":n=`[${n}](${e.attrs.href}${e.attrs.title?` "${e.attrs.title}"`:""})`}e+=n}else if("image"===t.type.name){const{src:n,alt:r,title:o}=t.attrs;e+=`![${r??""}](${n}${o?` "${o}"`:""})`}else"hard_break"===t.type.name?e+=" \n":"html_inline"===t.type.name?e+=t.attrs.value:"math_inline"===t.type.name&&(e+=t.attrs.raw)}),e}function $(t){const e=[];if(t.forEach(t=>{const n=[],r=[];t.forEach(t=>{var e;n.push((e=t.textContent,e.replace(/\|/g,"\\|").replace(/\n/g," ")).trim()),r.push("table_header"===t.type.name)}),e.push({cells:n,header_flags:r})}),0===e.length)return"";const n=Math.max(...e.map(t=>t.cells.length)),r=e[0].header_flags.some(t=>t),o=Array.from({length:n},(t,n)=>Math.max(3,...e.map(t=>x(t.cells[n]??"")))),s=t=>`| ${Array.from({length:n},(e,n)=>{return r=t[n]??"",s=o[n],r+" ".repeat(Math.max(0,s-x(r)));var r,s}).join(" | ")} |`,a=[];if(r){a.push(s(e[0].cells)),a.push(`| ${o.map(t=>"-".repeat(t)).join(" | ")} |`);for(let t=1;t<e.length;t++)a.push(s(e[t].cells))}else{a.push(s(new Array(n).fill(""))),a.push(`| ${o.map(t=>"-".repeat(t)).join(" | ")} |`);for(const t of e)a.push(s(t.cells))}return a.join("\n")}function x(t){let e=0;for(const n of t){const t=n.codePointAt(0)??0;e+=t>=4352&&t<=4447||t>=11904&&t<=42191||t>=44032&&t<=55203||t>=63744&&t<=64255||t>=65072&&t<=65135||t>=65280&&t<=65376||t>=65504&&t<=65510?2:1}return e}function A(t,e=""){switch(t.type.name){case"paragraph":default:return e+M(t);case"heading":return`${e}${"#".repeat(t.attrs.level)} ${M(t)}`;case"blockquote":return O(t,"").split("\n").map(t=>`${e}> ${t}`).join("\n");case"code_block":{const n=t.attrs.language??"",r=t.textContent;let o=3;for(const t of r.match(/`+/g)??[])o=Math.max(o,t.length+1);const s="`".repeat(o),a=r.split("\n").map(t=>e+t).join("\n");return`${e}${s}${n}\n${a}\n${e}${s}`}case"horizontal_rule":return`${e}---`;case"html_block":return t.attrs.value.replace(/\n+$/,"").split("\n").map(t=>e+t).join("\n");case"math_block":return t.attrs.raw.replace(/\n+$/,"").split("\n").map(t=>e+t).join("\n");case"bullet_list":{const n=[];return t.forEach((t,r,o)=>{n.push(E(t,e,`${e}- `,`${e} `,o))}),n.join("\n")}case"ordered_list":{const n=[],r=t.attrs.order??1;return t.forEach((t,o,s)=>{n.push(E(t,e,`${e}${r+s}. `,`${e} `,s))}),n.join("\n")}case"table":return $(t).split("\n").map(t=>e+t).join("\n")}}function E(t,e,n,r,o){const s=t.attrs.checked,a=null===s?"":s?"[x] ":"[ ] ",c=[];t.forEach((t,e,n)=>{c.push(A(t,0===n?"":r))});const i=c.join("\n").split("\n");return n+a+i[0]+(i.length>1?"\n"+i.slice(1).join("\n"):"")}function O(t,e=""){const n=[];return t.forEach(t=>{n.push(A(t,e))}),n.join("\n\n")}function S(t){return O(t).trim()+"\n"}v.renderer.rules.fence=(t,e,n,r,o)=>{const s=t[e],a=s.info.trim().toLowerCase();return(0,k.lG)(a)?`<div data-math-block="${(0,b.pC)(`$$\n${s.content.trim()}\n$$`)}"></div>`:y(t,e,n,r,o)};n(64877);var D=n(19878);const C=new c.hs("md_source_highlight");function N(t,e,n){let r=e;for(const e of t){if("string"==typeof e){r+=e.length;continue}const t=r;Array.isArray(e.children)&&(r=N(e.children,r,n)),e.scope&&n.push({from:t,to:r,cls:`hljs-${e.scope}`})}return r}function L(t,e){const n=t.textContent;if(!n)return[];const r=t.attrs.language??"";if(!r||!D.A.getLanguage(r))return[];let o;try{o=D.A.highlight(n,{language:r,ignoreIllegals:!0})}catch{return[]}const s=[],a=o._emitter?.rootNode;a?.children&&N(a.children,0,s);const c=e+1,l=[];for(const t of s){const e=Math.min(t.from,n.length),r=Math.min(t.to,n.length);e>=r||l.push(i.NZ.inline(c+e,c+r,{class:t.cls}))}return l}function z(){return new c.k_({key:C,props:{decorations(t){const e=function(t){const e=[];return t.descendants((t,n)=>"code_block"!==t.type.name||(e.push(...L(t,n)),!1)),i.zF.create(t,e)}(t.doc);return e.find().length?e:null}}})}var j=n(89117),T=n(86063),R=n(52388);const P=new c.hs("md-graph"),V=new Map,G=new Map,I=new Map,F=new Map;function W(t,e){return`${t}\0${e}`}function q(t,e,n){return(r,o)=>{const s=W(r,o),a=t.get(s);if(a)return Promise.resolve(a);let c=e.get(s);return c||(c=n(r,o).then(n=>(t.set(s,n),e.delete(s),n)),e.set(s,c)),c}}const H=q(V,G,(t,e)=>(0,j.U6)(t,e)),B=q(I,F,(t,e)=>(0,T.Hn)(e));function K(t,e){const n=document.createElement("button");return n.className="md-graph__edit",n.type="button",n.textContent=R.A.t("clk_edt"),n.addEventListener("click",n=>{n.stopPropagation(),function(t,e){if(!t)return;const n=Math.min(e+1,t.state.doc.content.size);t.dispatch(t.state.tr.setSelection(c.U3.near(t.state.doc.resolve(n),1))),t.focus()}(t(),e)}),n}function U(t,e){if(e.error)return t.className="md-graph__body",void(t.textContent=e.error);t.className="md-graph__body",t.innerHTML=e.svg}function J(t,e,n,r){const o=document.createElement("div");o.className="md-graph",o.setAttribute("contenteditable","false");const s=document.createElement("div");s.className="md-graph__body",s.addEventListener("click",()=>{const n=V.get(W(e,t));n&&!n.error&&n.svg&&function(t){const e=document.createElement("div");e.className="md-graph-zoom";const n=document.createElement("div");let r;n.className="md-graph-zoom__body";const o=document.createElement("button");o.className="md-graph-zoom__close",o.type="button",o.title=R.A.t("取消"),o.innerHTML='<i class="material-icons">close</i>';const s=t=>{"Escape"===t.key&&a()};function a(){"function"==typeof r&&r(),document.removeEventListener("keydown",s),e.remove()}e.addEventListener("click",t=>{t.target===e&&a()}),o.addEventListener("click",a),document.addEventListener("keydown",s),e.append(n,o),document.body.appendChild(e),r=t(n)}(t=>{t.innerHTML=n.svg})}),o.append(s,K(r,n));const a=V.get(W(e,t));return a?(a.error&&o.classList.add("md-graph--error"),U(s,a),o):(o.classList.add("md-graph--loading"),s.textContent=R.A.t("rendering"),H(e,t).then(t=>{o.isConnected&&(o.classList.remove("md-graph--loading"),t.error&&o.classList.add("md-graph--error"),U(s,t))}),o)}function X(t,e,n){const r=[],{from:o,to:s}=t.selection;return t.doc.descendants((t,a)=>{if("code_block"!==t.type.name)return;const c=t.attrs.language,l=(0,j.Hm)(c),d=(0,T.hj)(c);if(!l&&!d)return;const u=a,h=a+t.nodeSize;if(function(t,e,n,r){return t<=r&&e>=n}(o,s,u,h))return;const m=t.textContent;if(!m.trim())return;r.push(i.NZ.node(u,h,{class:"md-graph-hidden"}));const p=`graph-${c}-${u}-${m}`;d?r.push(i.NZ.widget(h,()=>function(t,e,n,r,o){const s=document.createElement("div");s.className="md-graph md-graph--mind",s.setAttribute("contenteditable","false"),s.textContent=R.A.t("rendering");const a=K(r,n);let c=null;return s.__unmount=()=>{c?.destroy(),c=null},B(e,t).then(t=>{s.isConnected&&(s.textContent="",s.append(a),t.mount(s).then(t=>{s.isConnected?c=t:t.destroy()}).catch(t=>{console.error("[mind] mount failed",t)}))}),s.addEventListener("click",()=>{o?.(t,e=>function(t,e,n,r){if(!t||r===n)return;const o=t.state.doc;let s=null;const a=o.nodeAt(e);if(a&&"code_block"===a.type.name&&a.textContent===n?s={from:e+1,to:e+a.nodeSize-1}:o.descendants((t,e)=>!(s||"code_block"===t.type.name&&"smm-mind"===t.attrs.language&&t.textContent===n&&(s={from:e+1,to:e+t.nodeSize-1},1))),!s)return;const c=t.state.tr.replaceWith(s.from,s.to,t.state.schema.text(r));t.dispatch(c)}(r(),n,t,e))}),s}(m,c,u,e,n),{side:-1,ignoreSelection:!0,key:p,destroy:t=>t.__unmount?.()})):r.push(i.NZ.widget(h,()=>J(m,c,u,e),{side:-1,ignoreSelection:!0,key:p}))}),i.zF.create(t.doc,r)}function Y(t){let e=null;return new c.k_({key:P,props:{decorations(n){const r=X(n,()=>e,t);return r.find().length?r:null}},view:t=>(e=t,{destroy(){e=null}})})}const Z=new Map;class Q{dom;node;view;get_pos;render_box;source_input;editing=!1;draft=null;painted_raw="";constructor(t,e,n){this.node=t,this.view=e,this.get_pos=n;const r="math_block"===t.type.name;this.dom=document.createElement(r?"div":"span"),this.dom.className=r?"md-math md-math--block":"md-math md-math--inline",this.dom.setAttribute("contenteditable","false"),this.render_box=document.createElement("span"),this.render_box.className="md-math__render",this.source_input=document.createElement("textarea"),this.source_input.className="md-math__source",this.source_input.setAttribute("spellcheck","false"),this.source_input.setAttribute("wrap","off"),this.source_input.setAttribute("rows","1"),this.dom.append(this.render_box,this.source_input),function(t,e){Z.set(t,e)}(n(),this),this.source_input.addEventListener("input",()=>{this.draft=this.source_input.value,this.auto_size()}),this.source_input.addEventListener("blur",()=>this.commit()),this.source_input.addEventListener("keydown",t=>{t.stopPropagation(),"Escape"===t.key&&(t.preventDefault(),this.draft=null,this.set_editing(!1))});for(const t of["beforeinput","paste","input","keyup","keypress"])this.source_input.addEventListener(t,t=>t.stopPropagation());this.render_box.addEventListener("mousedown",t=>{t.preventDefault(),t.stopPropagation(),this.focus_source()}),this.paint(t)}paint(t){const e=t.attrs.raw;if(this.editing)return this.dom.setAttribute("data-mode","source"),null===this.draft&&(this.source_input.value=e),void this.auto_size();if(this.dom.setAttribute("data-mode","preview"),this.painted_raw===e)return;this.painted_raw=e;const n=this.render_box;n.classList.add("md-math--loading"),n.textContent="",n.textContent=e,(0,k.z$)(n,t.attrs.tex,"math_block"===t.type.name?"block":"inline",e)}auto_size(){const t=this.source_input;t.style.height="0px",t.style.height=`${t.scrollHeight}px`}focus_source(){this.editing||(this.set_editing(!0),this.source_input.focus(),this.source_input.setSelectionRange(this.source_input.value.length,this.source_input.value.length))}set_editing(t){this.editing!==t&&(this.editing=t,this.paint(this.node))}set_selected(t){t?this.focus_source():this.editing&&(this.commit(),this.set_editing(!1))}commit(){if(null===this.draft)return;const t=this.draft;if(this.draft=null,t===this.node.attrs.raw)return;const e=this.get_pos(),n=this.view.state.doc.nodeAt(e);if(!n)return;const r=(0,k.V)(t),o=r?.tex??t;this.view.dispatch(this.view.state.tr.setNodeMarkup(e,void 0,{...n.attrs,raw:t,tex:o})),this.painted_raw=""}update(t){if(t.type!==this.node.type)return!1;const e=t.attrs.raw!==this.node.attrs.raw;return this.node=t,e&&(this.draft=null,this.painted_raw=""),this.paint(t),!0}stopEvent(t){return this.dom.contains(t.target)}ignoreMutation(){return!0}destroy(){this.draft=null,function(t){for(const[e,n]of Z)if(n===t)return void Z.delete(e)}(this)}}function tt(t){const e=t.state.selection,n=e.from,r=e.to;for(const[t,e]of Z){const o=r>t&&n<=t+1;e.set_selected(o)}}var et=n(67951),nt=(n(41631),n(50576),n(70432),n(74848));function rt(t){return 0===t?(0,et.uf)("paragraph"):(0,et.uf)("heading",{level:t})}function ot(t){return!(!t.ctrlKey&&!t.metaKey)}function st(t,e){let n=null;try{const r=t.domAtPos(e).node,o=1===r.nodeType?r:r.parentElement;n=o?o.closest(".md-filecat-content > *")??o:null}catch{}if(!n)return;const r=n.closest(".md-editor-scroll");if(!r)return;const o=parseFloat(getComputedStyle(n).scrollMarginTop)||0,s=r.scrollTop+n.getBoundingClientRect().top-r.getBoundingClientRect().top-o,a=r.scrollHeight-r.clientHeight;!function(t,e){const n=t.scrollTop,r=e-n;if(Math.abs(r)<1)return;const o=performance.now(),s=e=>{const a=Math.min(1,(e-o)/500);t.scrollTop=n+r*(1-Math.pow(1-a,3)),a<1&&requestAnimationFrame(s)};requestAnimationFrame(s)}(r,Math.max(0,Math.min(s,a)))}function at(t,e){return(0,f.D8)(1)(t,e)}const ct=r.forwardRef(function(t,e){const{t:n}=(0,o.Bd)(),_=(0,r.useRef)(null),k=(0,r.useRef)(null),[,v]=(0,s.fp)(a.AG.mind_editor),y=(0,r.useRef)(t.on_change),M=(0,r.useRef)(t.on_save),$=(0,r.useRef)(t.on_selection_change),x=(0,r.useRef)(t.on_source_mode_change),A=(0,r.useRef)();return A.current=(t,e)=>{v({name:n("思维导图"),code_source:t,on_save_code:t=>e(t)})},(0,r.useEffect)(()=>{y.current=t.on_change,M.current=t.on_save,$.current=t.on_selection_change,x.current=t.on_source_mode_change}),(0,r.useEffect)(()=>{if(!_.current)return;g.Y;(0,b.sL)(t.doc_path?t.doc_path.replace(/[^/]*$/,""):"");const n=c.$t.create({doc:w(t.value??""),plugins:[(0,d.b6)(),z(),Y((t,e)=>A.current?.(t,e)),new c.k_({view:t=>(tt(t),{update:(t,e)=>{t.state.selection===e.selection&&t.state.doc===e.doc||tt(t)}})}),(0,et.k5)(),(0,u.w)({"Mod-a":et.Rx,"Mod-z":d.tN,"Mod-y":d.ZS,"Mod-Shift-z":d.ZS,"Mod-b":(0,et.NH)("strong"),"Mod-i":(0,et.NH)("em"),"Mod-Shift-x":(0,et.NH)("strike"),"Mod-`":(0,et.NH)("code"),"Mod-1":(t,e)=>rt(1)(t,e),"Mod-2":(t,e)=>rt(2)(t,e),"Mod-3":(t,e)=>rt(3)(t,e),"Mod-0":(t,e)=>rt(0)(t,e),"Mod-Shift-8":et.fK,"Mod-Shift-9":et.oB,"Mod-Shift-.":et.Vu,Tab:et.G8.sink,"Shift-Tab":et.G8.lift,"Mod-Enter":at,"Mod-s":()=>(M.current?.(),!0)}),(0,f.LF)({allowTableNodeSelection:!0}),(0,f.AL)(),(0,m.A)({color:"var(--primary, #1a73e8)",width:2}),(0,p.z)(),(0,u.w)({Enter:(0,h.st)(et.x0,h.pC,et.G8.split,h.Z1,h.iz,h.aw),"Shift-Enter":(t,e)=>{const{hard_break:n}=t.schema.nodes;return e&&e(t.tr.replaceSelectionWith(n.create()).scrollIntoView()),!0},"Mod-Enter":h.I$}),(0,u.w)(h.RV)]}),r=t=>t.setAttribute("data-img-error",""),o=t=>"IMG"===t.tagName&&!t.classList.contains("ProseMirror-separator"),s=t=>{const e=t.target;"IMG"===e?.tagName&&o(e)&&r(e)},a=t=>{const e=t.target;"IMG"===e?.tagName&&o(e)&&(t=>{t.removeAttribute("data-img-error")})(e)},v=_.current;v.addEventListener("error",s,!0),v.addEventListener("load",a,!0);const E=()=>{v.querySelectorAll("img").forEach(t=>{if(!o(t))return;const e=t;e.dataset.imgSeen||(e.dataset.imgSeen="1",e.complete?0===e.naturalWidth&&r(e):r(e))})},D=new MutationObserver(()=>{requestAnimationFrame(E)});D.observe(v,{childList:!0,subtree:!0}),E();let C=null;if(C=new i.Lz(_.current,{state:n,editable:()=>!1!==t.editable,nodeViews:{...(0,b.op)(),math_block:(t,e,n)=>new Q(t,e,n),math_inline:(t,e,n)=>new Q(t,e,n)},handleClickOn(t,e,n,r,o){if(!ot(o))return!1;const s=function(t){if(!(t instanceof Element))return null;const e=t.closest("a[href]"),n=e?.getAttribute("href");return n||null}(o.target)??function(t,e){const n=t.doc.content.size,r=Math.max(0,Math.min(e,n));let o;try{o=t.doc.resolve(r)}catch{return null}for(const e of[1,-1]){const o=1===e?r:r-1;if(!(o<0||o>=n))try{const e=t.doc.resolve(o).marks().find(t=>"link"===t.type.name);if(e?.attrs?.href)return e.attrs.href}catch{}}try{const t=o.parent.marks.find(t=>"link"===t.type.name);if(t?.attrs?.href)return t.attrs.href}catch{}return null}(t.state,e);return!!s&&(window.open(s,"_blank","noopener,noreferrer"),!0)},clipboardTextSerializer:t=>function(t){const e=[];return t.content.forEach(t=>e.push(t)),1===e.length&&"code_block"===e[0].type.name&&"markdown"===e[0].attrs.language?e[0].textContent.replace(/\n*$/,"")+"\n":O(t.content).trim()+"\n"}(t),handlePaste(t,e){const n=e.clipboardData?.getData("text/plain");if(!n)return!1;const{from:r,to:o}=t.state.selection;if(lt(t.state.doc,r)&&lt(t.state.doc,o))return t.dispatch(t.state.tr.insertText(n.replace(/\r\n?/g,"\n"),r,o).scrollIntoView()),!0;const s=e.clipboardData?.getData("text/html");if(s&&function(t){if(!t)return!1;try{const e=(new DOMParser).parseFromString(t,"text/html"),n=Array.from(e.body.children);return 1===n.length&&"PRE"===n[0].tagName}catch{return!1}}(s)){const e=w(n);return t.dispatch(t.state.tr.replaceSelection(new l.Ji(e.content,0,0)).scrollIntoView()),!0}return!1},handleDOMEvents:{keydown:(t,e)=>{if(ot(e)&&t.dom.classList.add("md-ctrl-down"),it(t.state.doc)&&"Enter"===e.key&&!e.ctrlKey&&!e.metaKey&&!e.altKey){e.preventDefault();const{from:n,to:r}=t.state.selection;return t.dispatch(t.state.tr.insertText("\n",n,r).scrollIntoView()),!0}return!1},keyup:(t,e)=>(ot(e)||t.dom.classList.remove("md-ctrl-down"),!1),blur:t=>(t.dom.classList.remove("md-ctrl-down"),!1),beforeinput:(t,e)=>{if(!it(t.state.doc))return!1;const n=e;if("insertText"!==n.inputType)return!1;const r=n.data;if(null==r)return!1;n.preventDefault();const{from:o,to:s}=t.state.selection;return t.dispatch(t.state.tr.insertText(r.replace(/\r\n?/g,"\n"),o,s).scrollIntoView()),!0}},dispatchTransaction(t){const e=C.state.apply(t);C.updateState(e);const n=it(e.doc);n?C.dom.classList.add("md-source-mode"):C.dom.classList.remove("md-source-mode"),n!==it(t.before)&&x.current?.(n),t.docChanged&&y.current?.(n?e.doc.textContent:S(e.doc)),(t.selectionSet||t.docChanged)&&$.current?.()},attributes:{class:"md-filecat-content",spellcheck:"false"}}),k.current=C,t.initial_source_mode&&!it(C.state.doc)){const t=S(C.state.doc),e=C.state.schema.nodes.code_block.create({language:"markdown"},t?C.state.schema.text(t):null),n=C.state.tr;n.replaceWith(0,C.state.doc.content.size,e),n.setMeta("addToHistory",!1),C.dispatch(n)}const N={get_markdown:()=>it(C.state.doc)?C.state.doc.textContent:S(C.state.doc),set_markdown:t=>{const e=w(t);C.dispatch(C.state.tr.replaceWith(0,C.state.doc.content.size,e.content))},focus:()=>C.focus(),get_view:()=>k.current,in_table:()=>function(t){const{$from:e}=t.selection;for(let t=e.depth;t>0;t--){if("table"===e.node(t).type.name)return!0}return!1}(C.state),active_marks:()=>(C.state.storedMarks??C.state.selection.$from.marks()).map(t=>t.type.name),active_block:()=>{const{$from:t}=C.state.selection;for(let e=t.depth;e>0;e--){const n=t.node(e);if("heading"===n.type.name)return{name:"heading",level:n.attrs.level};if("paragraph"===n.type.name)return{name:"paragraph"}}return{name:"paragraph"}},insert_table:(t=3,e=3)=>{const n=function(t,e,n){const r=(0,f.e)(t),o=r.table,s=r.row,a=r.cell,c=r.header_cell??r.cell;if(!o||!s||!a)return null;const i=t=>s.create(null,Array.from({length:e},()=>t.createAndFill())),l=i(c),d=Array.from({length:n},()=>i(a));return o.create(null,[l,...d])}(C.state.schema,t,e);if(!n)return;const{from:r}=C.state.selection,o=C.state.doc.resolve(r);let s=r;for(let t=o.depth;t>0;t--)if("table"===o.node(t).type.name){s=o.after(t);break}const a=C.state.tr;s===r?a.replaceSelectionWith(n):a.insert(s,n),C.dispatch(a.scrollIntoView());const c=C.state.doc.resolve(Math.min(s+3,C.state.doc.content.size));try{C.dispatch(C.state.tr.setSelection(C.state.selection.constructor.near(c)))}catch{}},get_headings:()=>function(t){const e=[];return t.doc.descendants((t,n)=>("heading"!==t.type.name||e.push({level:t.attrs.level,text:t.textContent,pos:n}),!0)),e}(C.state),scroll_to_pos:t=>{const e=C.state.doc.content.size,n=Math.max(0,Math.min(t,e)),r=C.state.doc.nodeAt(n);let o;try{o=r?c.U3.near(C.state.doc.resolve(n+1),1):c.U3.near(C.state.doc.resolve(n),1)}catch{o=c.U3.near(C.state.doc.resolve(0),1)}C.dispatch(C.state.tr.setSelection(o)),st(C,o.from),C.focus()},is_source_mode:()=>it(C.state.doc),enter_source_mode:()=>{if(it(C.state.doc))return;const t=S(C.state.doc),e=C.state.schema.nodes.code_block.create({language:"markdown"},t?C.state.schema.text(t):null),n=C.state.tr;n.replaceWith(0,C.state.doc.content.size,e),C.dispatch(n),C.dom.classList.add("md-source-mode")},exit_source_mode:()=>{if(!it(C.state.doc))return;const t=w(C.state.doc.textContent),e=C.state.tr;e.replaceWith(0,C.state.doc.content.size,t.content),C.dispatch(e),C.dom.classList.remove("md-source-mode")}};return"function"==typeof e?e(N):e&&(e.current=N),t.on_ready?.(N),()=>{D.disconnect(),v.removeEventListener("error",s,!0),v.removeEventListener("load",a,!0),C.destroy(),k.current=null}},[]),(0,nt.jsx)("div",{className:"md-filecat",ref:_})});function it(t){if(1!==t.childCount)return!1;const e=t.firstChild;return!!e&&"code_block"===e.type.name&&"markdown"===e.attrs.language}function lt(t,e){const n=t.resolve(e);for(let t=n.depth;t>0;t--)if("code_block"===n.node(t).type.name)return!0;return!1}const dt=ct},67951(t,e,n){n.d(e,{NH:()=>d,k5:()=>l,uf:()=>u});var r=n(38341),o=n(5091),s=n(42845),a=n(46762),c=n(3772);function i(t,e){return new r.fV(t,(t,n,r,o)=>{const s=t.schema.marks[e],a=n[1];if(!s||!a)return null;const c=n[0].indexOf(a);if(c<0)return null;const i=r+c,l=i+a.length,d=t.tr;return d.delete(l,o),d.delete(r,i),d.addMark(r,r+a.length,s.create()),d.removeStoredMark(s),d})}function l(){const t=o.Y;return(0,r.sM)({rules:[(0,r.JJ)(/^(#{1,6})\s$/,t.nodes.heading,t=>({level:t[1].length})),(0,r.JJ)(/^#([1-6])\s$/,t.nodes.heading,t=>({level:Number(t[1])})),(0,r.JJ)(/^```([\w-]*)\s$/,t.nodes.code_block,t=>({language:t[1]??""})),(0,r.tG)(/^\s*>\s$/,t.nodes.blockquote),(0,r.tG)(/^\s*([-+*])\s$/,t.nodes.bullet_list),(0,r.tG)(/^(\d+)\.\s$/,t.nodes.ordered_list,t=>({order:Number(t[1])})),i(/(?:\*\*)([^*]+)(?:\*\*)$/,"strong"),i(/(?:__)([^_]+)(?:__)$/,"strong"),i(/(?<![*])\*([^*]+)\*$/,"em"),i(/(?<![_])_([^_]+)_$/,"em"),i(/(?:~~)([^~]+)(?:~~)$/,"strike"),i(/(?:`)([^`]+)(?:`)$/,"code"),...r.Fr,r.gO]})}function d(t){return(e,n)=>{const r=e.schema.marks[t];return!!r&&(0,a.wh)(r)(e,n)}}function u(t,e={}){return(n,r)=>{const o=n.schema.nodes[t];if(!o)return!1;const{$from:s,$to:a}=n.selection,c=s.blockRange(a);if(!c)return!1;const i=s.parent,l=i.type===o&&Object.entries(e).every(([t,e])=>i.attrs[t]===e),d=l?n.schema.nodes.paragraph:o,u=l?{}:e;return r&&r(n.tr.setBlockType(c.start,c.end,d,u)),!0}}const h=(t,e)=>(0,c.Sd)(t.schema.nodes.bullet_list)(t,e),m=(t,e)=>(0,c.Sd)(t.schema.nodes.ordered_list)(t,e),p={sink:(0,c.$B)(o.Y.nodes.list_item),lift:(0,c.T2)(o.Y.nodes.list_item),split:(0,c.wn)(o.Y.nodes.list_item),wrap_bullet:h,wrap_ordered:m};n.d(e,["G8",0,p,"Rx",0,(t,e)=>{const{$from:n}=t.selection;return"code_block"===n.parent.type.name&&(e&&e(t.tr.setSelection(s.U3.create(t.doc,n.start(),n.end())).scrollIntoView()),!0)},"Vu",0,(t,e)=>{const{blockquote:n}=t.schema.nodes,{$from:r,$to:o}=t.selection,s=r.blockRange(o);if(!s)return!1;if(s.parent.type===n&&s.depth>0){const n=r.before(s.depth),o=t.tr.doc.nodeAt(n);if(o&&1===o.childCount)return e&&e(t.tr.replaceWith(n,n+o.nodeSize,o.child(0)).scrollIntoView()),!0;if(e){const n=t.tr,o=r.parent,a=r.after(s.depth);n.delete(s.start,s.end),n.insert(a,o),e(n.scrollIntoView())}return!0}return e&&e(t.tr.wrap(s,[{type:n}]).scrollIntoView()),!0},"fK",0,h,"oB",0,m,"x0",0,(t,e)=>{const{$from:n,empty:r}=t.selection;if(!r||"paragraph"!==n.parent.type.name)return!1;const o=n.parent.textContent;if(!o.trim())return!1;const a=function(t){const e=t.trim(),n=/^#([1-6])$/.exec(e);if(n)return{type:"heading",attrs:{level:Number(n[1])}};const r=/^(#{1,6})$/.exec(e);if(r)return{type:"heading",attrs:{level:r[1].length}};const o=/^```([\w-]*)$/.exec(e);return o?{type:"code_block",attrs:{language:o[1]??""}}:/^(?:-{3,}|\*{3,}|_{3,})$/.test(e.replace(/\s+/g,""))?{type:"horizontal_rule"}:/^>\s*$/.test(e)?{type:"blockquote"}:/^[-+*]\s*$/.test(e)?{type:"bullet_list"}:/^\d+[.)]$/.test(e)?{type:"ordered_list"}:null}(o);if(!a)return!1;if("blockquote"===a.type&&n.depth>1)return!1;const c=t.schema.nodes[a.type];if(!c)return!1;const i=n.before(n.depth),l=n.after(n.depth);if(e){const n=t.tr,r=c.createAndFill(a.attrs)??c.create(a.attrs);n.replaceWith(i,l,r);const o=Math.min(i+1,n.doc.content.size);try{n.setSelection(s.U3.near(n.doc.resolve(o),1))}catch{}n.scrollIntoView(),e(n)}return!0}])},96763(t,e,n){n.d(e,{Kz:()=>a,P7:()=>l,_8:()=>h,_D:()=>u,bN:()=>s,sO:()=>d});var r=n(14284),o=n(53459);function s(t,e){const n="md-theme-style-"+t,r=document.getElementById(n);if(!e)return void r?.remove();let o=r;o||(o=document.createElement("style"),o.id=n,document.head.appendChild(o)),o.textContent=e}async function a(){try{const t=await r.XO.get("md_theme/list");return t?.code===o.m.Success?t.data??[]:[]}catch(t){return[]}}const c="md-theme-change";function i(){window.dispatchEvent(new Event(c))}async function l(t){try{const e=await r.XO.get(`md_theme/get?id=${encodeURIComponent(t)}`);return e?.code===o.m.Success?e.data??"":""}catch(t){return""}}async function d(){try{const t=await r.XO.get("md_theme/active");return t?.code===o.m.Success?t.data??"":""}catch(t){return""}}async function u(t){const e=await r.XO.post("md_theme/save",t);return e?.code!==o.m.Success?null:(i(),e.data)}async function h(t){const e=await r.XO.post("md_theme/del",{id:t});return e?.code===o.m.Success&&(i(),!0)}n.d(e,["o3",0,c])},5091(t,e,n){var r=n(58903),o=n(86059),s=n(41105),a=n(89334);const c=(0,o.of)({tableGroup:"block",cellContent:"block+",cellAttributes:{}}),i={align:{default:null}},l={doc:{content:"block+"},paragraph:{content:"inline*",group:"block",attrs:i,parseDOM:[{tag:"p"}],toDOM:t=>["p",t.attrs.align?{style:`text-align:${t.attrs.align}`}:{},0]},heading:{content:"inline*",group:"block",attrs:{level:{default:1},...i},defining:!0,parseDOM:[1,2,3,4,5,6].map(t=>({tag:`h${t}`,attrs:{level:t}})),toDOM(t){const e=t.attrs.align?{style:`text-align:${t.attrs.align}`}:{};return[`h${t.attrs.level}`,e,0]}},bullet_list:{group:"block",content:"list_item+",parseDOM:[{tag:"ul"}],toDOM:()=>["ul",0]},ordered_list:{group:"block",content:"list_item+",attrs:{order:{default:1}},parseDOM:[{tag:"ol",getAttrs:t=>({order:Number(t.getAttribute("start")??1)})}],toDOM:t=>1===t.attrs.order?["ol",0]:["ol",{start:t.attrs.order},0]},list_item:{content:"paragraph block*",defining:!0,attrs:{checked:{default:null}},parseDOM:[{tag:"li",getAttrs:t=>{const e=t,n=e.querySelector("input[type=checkbox]");if(n)return{checked:n.checked};const r=e.getAttribute("data-checked");return{checked:null===r?null:"true"===r}}}],toDOM:t=>null!==t.attrs.checked?["li",{"data-checked":String(t.attrs.checked)},0]:["li",0]},blockquote:{content:"block+",group:"block",defining:!0,parseDOM:[{tag:"blockquote"}],toDOM:()=>["blockquote",0]},code_block:{content:"text*",group:"block",marks:"",defining:!0,code:!0,attrs:{language:{default:""}},parseDOM:[{tag:"pre",preserveWhitespace:"full",getAttrs:t=>{const e=t.querySelector("code"),n=/language-([\w-]+)/.exec(e?.className??"");return{language:n?n[1]:""}}}],toDOM:t=>["pre",{"data-language":t.attrs.language},["code",0]]},horizontal_rule:{group:"block",parseDOM:[{tag:"hr"}],toDOM:()=>["hr"]},html_block:{group:"block",atom:!0,code:!0,attrs:{value:{default:""}},parseDOM:[{tag:"div[data-html-block]",getAttrs:t=>({value:(0,s.Ne)(t.getAttribute("data-html-block")??"")})}],toDOM:t=>["div",{"data-html-block":t.attrs.value}]},html_inline:{inline:!0,group:"inline",atom:!0,code:!0,attrs:{value:{default:""}},parseDOM:[{tag:"span[data-html-inline]",getAttrs:t=>({value:(0,s.Ne)(t.getAttribute("data-html-inline")??"")})}],toDOM:t=>["span",{"data-html-inline":t.attrs.value}]},math_inline:{inline:!0,group:"inline",atom:!0,attrs:{raw:{default:""},tex:{default:""}},parseDOM:[{tag:"span[data-math-inline]",getAttrs:t=>{const e=t,n=(0,s.Ne)(e.getAttribute("data-math-inline")??"");return{raw:n,tex:(0,a.V)(n)?.tex??""}}}],toDOM:t=>["span",{"data-math-inline":t.attrs.raw}]},math_block:{group:"block",atom:!0,code:!0,attrs:{raw:{default:""},tex:{default:""}},parseDOM:[{tag:"div[data-math-block]",getAttrs:t=>{const e=t,n=(0,s.Ne)(e.getAttribute("data-math-block")??"");return{raw:n,tex:(0,a.V)(n)?.tex??""}}}],toDOM:t=>["div",{"data-math-block":t.attrs.raw}]},hard_break:{inline:!0,group:"inline",selectable:!1,parseDOM:[{tag:"br"}],toDOM:()=>["br"]},image:{inline:!0,group:"inline",draggable:!0,attrs:{src:{},alt:{default:null},title:{default:null}},parseDOM:[{tag:"img[src]",getAttrs:t=>{const e=t;return{src:e.getAttribute("src"),alt:e.getAttribute("alt"),title:e.getAttribute("title")}}}],toDOM(t){const{src:e,alt:n,title:r}=t.attrs,o={src:(0,s.KR)(e)};return n&&(o.alt=n),r&&(o.title=r),["img",o]}},text:{group:"inline"},...c},d={strong:{parseDOM:[{tag:"strong"},{tag:"b"},{style:"font-weight=bold"}],toDOM:()=>["strong",0]},em:{parseDOM:[{tag:"i"},{tag:"em"},{style:"font-style=italic"}],toDOM:()=>["em",0]},strike:{parseDOM:[{tag:"s"},{tag:"del"},{tag:"strike"}],toDOM:()=>["s",0]},code:{parseDOM:[{tag:"code",getAttrs:t=>"PRE"!==t.parentElement?.tagName&&null}],toDOM:()=>["code",0]},link:{attrs:{href:{},title:{default:null}},inclusive:!1,parseDOM:[{tag:"a[href]",getAttrs:t=>{const e=t;return{href:e.getAttribute("href"),title:e.getAttribute("title")}}}],toDOM(t){const{href:e,title:n}=t.attrs;return["a",{href:e,title:n,rel:"noopener noreferrer",target:"_blank"},0]}}},u=new r.Sj({nodes:l,marks:d});n.d(e,["Y",0,u])}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[259],{8694(e,t,a){a.d(t,{$K:()=>s,RB:()=>i,l5:()=>l,vo:()=>o,vr:()=>r});let n=function(e){return e[e.tcp=0]="tcp",e[e.udp=1]="udp",e}({});class s{open=!1;port;key="";async_ips=[]}class o{client_num_id;client_name;open=!1;ip;mask;serverIp;serverPort;key="";model=n.udp}let i=function(e){return e[e.row=1]="row",e[e.json=2]="json",e[e.form=3]="form",e}({});class r{body_type;header_type;url;method;headers;data;form_data_list;local_download_path}class l{enabled;ip;port;bypass;useForLocal;type}},75007(e,t,a){a.d(t,{h:()=>o});a(96540);var n=a(85997),s=a(74848);function o(e){return(0,s.jsxs)("h2",{className:"message",children:[(0,s.jsx)(n.In,{icon:"sentiment_dissatisfied"}),(0,s.jsx)("span",{children:e.context})]})}},47374(e,t,a){a.d(t,{e:()=>u});var n=a(96540),s=a(61973),o=a(64694),i=a(34289),r=a(61443),l=a(75725),d=a(22022),c=a(85997),p=a(74848);function u(e){let t=(0,s.zy)();const[a,u]=(0,n.useState)([]),[h,m]=(0,n.useState)("/"),[f,y]=(0,n.useState)(void 0),{t:_,i18n:x}=(0,d.Bd)();n.useEffect(()=>{let t="",a=(0,i.vX)().split("/");a=a.filter(e=>e);const n=a.indexOf(e.baseRoute),s=[];if(-1!=n){t=(0,o.IO)(a.slice(0,n),e.baseRoute);const i=a.slice(n+1);for(let e=0;e<i.length;e++){const a=i[e];s.push({value:a,href:0===e?`${t}${a}/`:(0,o.IO)(s[e-1].href,a)})}m(t),u(s)}},[t]);const v=t=>{t.stopPropagation(),e.clickFun(t)};return(0,p.jsx)("div",{className:"breadcrumbs",onClick:e=>{y(void 0!==f?void 0:"")},children:(0,p.jsx)(n.Fragment,{children:void 0===f?(0,p.jsxs)(n.Fragment,{children:[(0,p.jsx)("span",{className:"chevron",children:(0,p.jsx)(s.N_,{to:h,onClick:v,children:(0,p.jsx)(c.In,{icon:"home"})})}),a.map((e,t)=>(0,p.jsxs)("span",{className:"chevron",children:[(0,p.jsx)(c.In,{icon:"keyboard_arrow_right"}),(0,p.jsx)(s.N_,{to:e.href,onClick:v,children:decodeURIComponent(e.value)})]},t))]}):(0,p.jsx)(l.QM,{click:()=>{y(void 0)},children:(0,p.jsx)(r.Sm,{width:"100%",placeholder:_("输入跳转的目录"),handlerEnter:t=>{e.input_path_enter&&e.input_path_enter(t),y(void 0)}})})})})}},77481(e,t,a){a.d(t,{S:()=>r,X:()=>i});var n=a(96540),s=a(61443),o=a(74848);function i(e){const[t,a]=n.useState([]),i=(0,n.useRef)(-1),[r,l]=(0,n.useState)(-1),[d,c]=(0,n.useState)(-1);(0,n.useEffect)(()=>{e.children?a(Array.isArray(e.children)?e.children:[e.children]):a(e.rows)},[e.rows,e.children]);const p=()=>{i.current=-1,l(-1),c(-1)};return(0,o.jsxs)("table",{children:[(0,o.jsx)("thead",{children:(0,o.jsx)("tr",{children:e.headers?.map((t,a)=>{const n=!!e.filter&&(e.filter.column??0)===a;let i=t;if(n){const a=e.filter,n=a.options.find(e=>e.value===a.value);null!=a.value&&n&&(i=`${t} (${n.label})`)}return(0,o.jsx)("th",{className:n?"table-filter-col":"",children:n?(0,o.jsx)(s.l6,{value:e.filter.value,options:e.filter.options,onChange:e.filter.onChange,bare:!0,trigger_label:i}):t},a)})})}),(0,o.jsx)("tbody",{children:t.map((t,a)=>{const n=!!e.onRowDrag;return(0,o.jsx)("tr",{className:n?(r===a?"row-dragging":"")+(d===a?" row-drop-target":""):"",draggable:n,onContextMenu:()=>{e.handleContextMenu&&e.handleContextMenu(t)},onDragStart:e=>{n&&(i.current=a,l(a),e.dataTransfer.effectAllowed="move")},onDragOver:e=>{!n||i.current<0||(e.preventDefault(),e.dataTransfer.dropEffect="move",c(a))},onDrop:t=>{n&&(t.preventDefault(),(()=>{const t=i.current,a=d;p(),t<0||a<0||t===a||e.onRowDrag?.(t,a)})())},onDragEnd:p,children:t.map((a,n)=>{const s=n===t.length-1?"small":"";return(0,o.jsx)("td",{className:s,style:{width:e.width??"auto"},children:a},n)})},a)})})]})}function r(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))})}},83029(e,t,a){a.d(t,{N:()=>x});var n=a(96540),s=a(34843),o=a(82893),i=a(74848);function r(e){const[t,a]=(0,s.fp)(o.AG.user_base_info);return(0,i.jsx)("div",{children:e.div?(0,i.jsx)("div",{className:"nav_list_a",style:{background:e.color},children:e.name}):e.clickItem||"dir"===e._type?(0,i.jsx)("div",{className:"nav_list_a",style:{background:e.color},onClick:()=>{"dir"!==e._type?e.clickItem&&e.clickItem(e):e.click_dir(e.item)},children:e.name}):(0,i.jsx)("a",{href:e.url,target:e.target,className:"nav_list_a",style:{background:e.color},children:e.name})})}var l=a(64694),d=a(61443),c=a(85997),p=a(61973),u=a(22022);const h=["#ffffff","#fefff8","#fcfdf1","#d3d2dc","#f8f9fd","#ebf4fe","#ebebeb","#e8f7eb","#eaf2f9"];let m,f,y=[];const _=[];function x(e){const[t,a]=(0,n.useState)([]),[x,v]=(0,n.useState)(-1),w=(0,p.zy)(),[g,j]=(0,n.useState)(!1),[k,b]=(0,n.useState)(!1),{t:N}=(0,u.Bd)(),[K,S]=(0,n.useState)([]),[C,A]=(0,s.fp)(o.AG.nav_index_add_item_by_now_list),F=e=>{-1!==x?_[x]._children=e:y=e};(0,n.useEffect)(()=>{(async()=>{if(!e.getItems)return;const t=await e.getItems();y=t,a(y)})()},[w]);(0,n.useEffect)(()=>{if(C){const e=[...t,{name:"",color:(0,l.Lr)(h),...C}];F(e),a(e),j(!0),A(void 0)}},[C]);const D=e=>{v(x+1),a(e._children),_.push(e)};return(0,i.jsxs)("div",{className:"nav_list_div scroll-div-y",children:[-1!==x&&(0,i.jsx)(c.rA,{title:"返回",icon:"arrow_back",onClick:()=>{a(0===x?y:_[x-1]._children),v(x-1),_.pop()}}),t.map((s,o)=>(0,i.jsxs)("div",{draggable:!0,onDragOver:e=>{e.preventDefault()},onDragStart:e=>((e,t)=>{m=t})(0,o),onDrop:e=>((e,n)=>{e.preventDefault();const s=t[m],o=t[n];if(o&&"dir"===o._type){const e=[...t];return e.splice(m,1),o._children||(o._children=[]),o._children.push(s),F(e),void a(e)}const i=[...t],r=i[m];i.splice(m,1),i.splice(n,0,r),F(i),a(i)})(e,o),style:{cursor:g?"move":"pointer"},children:[(0,i.jsx)(r,{name:s.name,item:s,...s,div:g,target:"_blank",click_dir:D,clickItem:e.clickItem}),g&&(void 0!==K.find(e=>e===o)||k)&&(0,i.jsxs)("div",{className:k?"":" site_edit ",children:["dir"===s._type?(0,i.jsxs)(n.Fragment,{children:[(0,i.jsx)(d.Sm,{value:s.name,handleInputChange:e=>{s.name=e},placeholder:N("输入类目名"),no_border:!0}),(0,i.jsx)(d.Sm,{value:s.color,handleInputChange:e=>{s.color=e},placeholder:"color",no_border:!0})]}):e.items.map((e,t)=>(0,i.jsx)("div",{children:(0,i.jsx)(d.Sm,{value:s[e.key],handleInputChange:t=>{s[e.key]=t},placeholder:e.preName,no_border:!0})},t)),!k&&(0,i.jsx)(c.C3,{text:N("折叠"),clickFun:()=>{S((0,l.P1)(K,o))}})]}),g&&(0,i.jsx)("div",{style:{display:"block"},children:(0,i.jsxs)("span",{className:"div-row ",children:[(0,i.jsx)(c.C3,{text:N("删除"),clickFun:()=>{(e=>{const n=[...t];n.splice(e,1),F(n),a(n)})(o)}}),(0,i.jsx)(c.C3,{text:N("编辑"),clickFun:()=>{void 0===K.find(e=>e===o)&&S([...K,o])}})]})})]},o)),g&&(0,i.jsxs)("div",{style:{display:"block"},children:[(0,i.jsx)(c.rA,{title:N("取消"),icon:"cancel",onClick:()=>{S([]),j(!1),f&&(a(f),F(f)),b(!1)}}),(0,i.jsx)(c.rA,{title:N("添加"),icon:"add",onClick:async()=>{const n=[...t,{name:"",color:(0,l.Lr)(h),...e.get_pre_add_item&&await e.get_pre_add_item()}];F(n),a(n)}}),(0,i.jsx)(c.rA,{title:N("添加类目"),icon:"add_box",onClick:()=>{const e=[...t,{name:"",_type:"dir",_children:[],color:"#c1edfb"}];F(e),a(e)}}),(0,i.jsx)(c.rA,{title:N("全部编辑"),icon:k?"unfold_less":"unfold_more",onClick:()=>{b(!k)}})]}),(void 0===e.have_auth_edit||!0===e.have_auth_edit)&&(0,i.jsx)(c.rA,{icon:g?"save":"edit",title:N(g?"保存":"编辑"),onClick:async()=>{g?e.save&&await e.save(y):f=t,j(!g)}})]})}},259(e,t,a){a.r(t),a.d(t,{default:()=>_e});var n=a(96540),s=a(70447),o=a(75725),i=a(61443),r=a(22022),l=a(34843),d=a(82893),c=a(85997),p=a(77481),u=a(14284),h=a(62042),m=a(45907),f=a(23496),y=a(53459),_=a(78247),x=a(23430),v=a(74848);function w(){const{t:e}=(0,r.Bd)(),t=(0,m.y)(),{check_user_auth:a}=(0,_.MH)(),w=a(x.oV.browser_proxy_edit),[,g]=(0,l.fp)(d.AG.prompt_card),[j,k]=(0,n.useState)([]),[b,N]=(0,n.useState)(!1),[K,S]=(0,n.useState)(!1),[C,A]=(0,n.useState)(""),[F,D]=(0,n.useState)(""),[L,M]=(0,n.useState)(""),I=[e("状态"),e("备注"),e("目标"),e("端口"),e("访问地址"),e("操作")],B=async()=>{try{const e=await u.s2.get(f.s.browser_proxy_port_list);e.code===y.m.Success&&k(Array.isArray(e.data)?e.data:[])}catch(e){}};(0,n.useEffect)(()=>{B()},[]);const P=e=>{A(e?.id??""),D(e?`${e.proto}://${e.host}${e.root_path&&"/"!==e.root_path?e.root_path:""}`:""),M(e?.note??"")},R=()=>{N(!1),S(!1),P(void 0)},E=e=>`http://${window.location.hostname||"127.0.0.1"}:${e.port}/`,$=e=>{const t=localStorage.getItem("token")||"";return`${E(e)}${t?`?_t=${encodeURIComponent(t)}`:""}`};return(0,v.jsxs)(o.fI,{children:[(0,v.jsx)(o.VP,{widthPer:w?55:100,maxWidth:w?"90rem":void 0,children:(0,v.jsx)(o.xh,{children:(0,v.jsx)(s.uF,{self_title:(0,v.jsxs)("span",{className:" div-row ",children:[(0,v.jsx)("h2",{children:e("网页代理目标")}),(0,v.jsx)(c.rA,{icon:"info",title:e("信息"),onClick:()=>{g({open:!0,title:e("信息"),context_div:(0,v.jsx)("div",{children:(0,v.jsxs)("ul",{children:[(0,v.jsx)("li",{children:e("wbvpn_port_tip")}),(0,v.jsx)("li",{children:e("wbvpn_port_tip2")}),(0,v.jsx)("li",{children:e("wbvpn_port_tip3")})]})})})}})]}),titleCom:(0,v.jsx)("div",{children:w&&!K&&(0,v.jsx)(c.rA,{icon:"add",title:e("添加"),onClick:()=>{N(!0),S(!0),P(void 0)}})}),children:(0,v.jsx)(p.X,{headers:I,rows:j.map(a=>{const n=[(0,v.jsx)(c.Ay,{checked:!1!==a.enabled,disabled:!w,title:e("启用"),onChange:t=>(async(t,a)=>{try{await u.s2.post(f.s.browser_proxy_port_set_enabled,{id:t.id,enabled:a}),(0,h.SK)(e(a?"已启用":"已禁用")),await B()}catch(e){}})(a,t)}),(0,v.jsx)(s.xP,{children:a.note||"-"}),(0,v.jsx)(s.xP,{children:`${a.proto}://${a.host}`}),(0,v.jsx)(s.xP,{children:String(a.port)}),(0,v.jsx)(s.xP,{children:E(a)}),(0,v.jsxs)("div",{children:[(0,v.jsx)(c.rA,{icon:"open_in_new",title:e("新窗口打开"),onClick:()=>(e=>{window.open($(e),"_blank","noopener,noreferrer")})(a)}),(0,v.jsx)(c.rA,{icon:"tab",title:e("当前窗口打开"),onClick:()=>(e=>{window.location.href=$(e)})(a)}),(0,v.jsx)(c.rA,{icon:"content_copy",title:e("复制"),onClick:()=>(async t=>{const a=E(t);try{await navigator.clipboard.writeText(a),(0,h.SK)(e("已复制"))}catch(e){(0,h.zN)(a)}})(a)}),w&&(0,v.jsx)(c.rA,{icon:"edit",title:e("编辑"),onClick:()=>(e=>{N(!1),S(!0),P(e)})(a)}),w&&(0,v.jsx)(c.rA,{icon:"delete",title:e("删除"),onClick:()=>(a=>{t({title:e("确认删除"),sub_title:a.host,confirm_fun:async()=>{try{await u.s2.post(f.s.browser_proxy_port_remove,{id:a.id}),(0,h.SK)(e("已删除")),await B()}catch(e){}}})})(a)})]})];return n}),width:"10rem"})})})}),w&&K&&(0,v.jsx)(o.VP,{widthPer:45,maxWidth:"40rem",children:(0,v.jsx)(o.xh,{children:(0,v.jsxs)(s.Zp,{self_title:(0,v.jsx)("span",{className:" div-row ",children:(0,v.jsx)("h2",{children:e(""+(b?"添加":"编辑"))})}),rightBottomCom:(0,v.jsxs)("div",{children:[(0,v.jsx)(c.rA,{icon:"cancel",title:e("取消"),onClick:R}),(0,v.jsx)(c.rA,{icon:b?"add_circle":"save",title:e(b?"添加":"保存"),onClick:async()=>{if(F.trim())try{b?(await u.s2.post(f.s.browser_proxy_port_add,{address:F.trim(),note:L}),(0,h.SK)(e("添加成功"))):(await u.s2.post(f.s.browser_proxy_port_update,{id:C,address:F.trim(),note:L}),(0,h.SK)(e("修改成功"))),R(),await B()}catch(e){}else(0,h.zN)(e("目标地址不能为空"))}})]}),children:[(0,v.jsx)("label",{children:e("目标地址")}),(0,v.jsx)(i.Sm,{value:F,placeholder:e("目标地址例如"),handleInputChange:e=>D(e)}),(0,v.jsx)("label",{children:e("备注")}),(0,v.jsx)(i.Sm,{value:L,handleInputChange:e=>M(e)})]})})})]})}function g(e){return(0,v.jsx)(w,{})}var j=a(34289),k=a(4412),b=(a(75007),a(83029)),N=a(97856),K=a(92275),S=a(14944),C=a(64405);const A=n.lazy(()=>Promise.all([a.e(4924),a.e(5614)]).then(a.bind(a,85614)));function F(e){const[t,a]=(0,n.useState)(null),[s,o]=(0,l.fp)(d.AG.remoteShellShow),[i,r]=(0,n.useState)(!1),[c,p]=(0,l.fp)(d.AG.sshInfo),[u,h]=(0,l.fp)(d.AG.shellNowDir),[m,f]=(0,l.fp)(d.AG.user_base_info),y=m.user_data.theme?.includes("dark")?"#FFFFFF":"#000000",_=()=>{(async()=>{t&&(t.dispose(),a(null))})()};(0,n.useEffect)(()=>()=>{_()},[]),(0,n.useEffect)(()=>{s.show?t||((async()=>{const e=new N.Terminal({fontFamily:"Monaco, Menlo, Consolas, 'Courier New', monospace",theme:{background:"#FFFFFF",foreground:y,cursor:y,selectionBackground:"#a6d2ff"},cursorBlink:!0,cursorStyle:"bar",scrollback:1e3,scrollSensitivity:1,tabStopWidth:4});let t;const n=t=>{e.write(t)};t=a=>{e.clear(),e.write(a),t=n},S.ws.addMsg(K.HK.remote_shell_getting,e=>{t(e.context)}),e.onData(async e=>{const t=new C.x;t.key=c.key,t.cmd=e;const a=new K.hf(K.HK.remote_shell_send);a.context=t,await S.ws.send(a)}),a(e)})(),r(!0)):_()},[s]);return(0,v.jsx)(A,{show:s.show,terminal:t,init:(e,a)=>{t.writeln("open shell... ");const n=new K.hf(K.HK.remote_shell_open),o=new C.x;o.key=c.key,o.init_path=s.path,o.rows=e,o.cols=a,n.context=o,S.ws.send(n)}})}var D=a(47374),L=a(61973),M=a(99214),I=a(47022),B=a(88815),P=a(6960),R=a(79240),E=a(89824),$=a(12730);function G(e){const{t}=(0,r.Bd)();(0,L.zy)();(0,L.Zp)();const{check_user_auth:a}=(0,_.MH)(),[s,o]=(0,l.fp)(d.AG.nowFileList),[i,p]=(0,l.fp)(d.AG.uploadFiles),[u,m]=(0,l.fp)(d.AG.showPrompt),[f,y]=(0,l.fp)(d.AG.selectedFileList),[x,w]=(0,l.fp)(d.AG.enterKey),[g,k]=(0,l.fp)(d.AG.copyedFileList),[b,N]=(0,l.fp)(d.AG.cutedFileList),[K,S]=(0,l.fp)(d.AG.selectedFileList),[C,A]=(0,l.fp)(d.AG.clickFileList),[F,D]=(0,l.fp)(d.AG.remoteShellShow),[B,P]=(0,l.fp)(d.AG.sshInfo),R=(0,M.Vs)();function G(e){(0,h.SK)(e)}return(0,v.jsxs)(n.Fragment,{children:[f.length>0&&(0,v.jsx)(c.rA,{icon:"delete",title:t("删除"),onClick:()=>{m({show:!0,type:E.PromptEnum.SshDelete,overlay:!0,data:{}})}}),f.length>0&&(0,v.jsx)(c.rA,{icon:"content_copy",title:t("复制"),onClick:function(){const e=(0,M.ib)(s,f);k(e.map(e=>`/${(0,j.GG)("remoteShell",(0,j.vX)())}${e.name}`)),N([]),G("已复制")}}),f.length>0&&(0,v.jsx)(c.rA,{icon:"content_cut",title:t("剪切"),onClick:function(){const e=(0,M.ib)(s,f);N(e.map(e=>`/${(0,j.GG)("remoteShell",(0,j.vX)())}${e.name}`)),k([]),G("已剪切")}}),(g.length>0||b.length>0)&&(0,v.jsx)(c.rA,{onClick:function(){m({show:!0,type:E.PromptEnum.SshPaste,overlay:!0,data:{}})},icon:"content_paste",title:t("粘贴到此处"),tip:g.length+b.length}),1===f.length&&s.files.length>=1&&(0,M.ib)(s,f)[0].type!==I.Iw.folder&&(0,v.jsx)(c.rA,{icon:"download",title:t("下载"),onClick:function(){const e=(0,M.ib)(s,f),t=`/api/ssh/download?file=${`/${(0,j.GG)("remoteShell",(0,j.vX)())}${decodeURIComponent(e[0].name)}`}&key=${B.key}&token=${localStorage.getItem("token")}`;window.open(t)}}),1===f.length&&(0,v.jsx)(c.rA,{icon:"edit_attributes",title:t("重命名"),onClick:function(){m({show:!0,type:E.PromptEnum.SshReName,overlay:!0,data:{}})}}),(0,v.jsx)(c.rA,{icon:"terminal",title:"shell",onClick:function(){F.show?D({show:!1,path:""}):D({show:!0,path:`/${(0,j.GG)("remoteShell",(0,j.vX)())}`})}}),(0,v.jsx)(c.rA,{icon:"grid_view",title:t("切换样式"),onClick:R}),(0,v.jsx)(c.rA,{icon:"create_new_folder",title:t("创建文件夹"),onClick:function(){m({show:!0,type:E.PromptEnum.SshNewDir,overlay:!0,data:{}})}}),(0,v.jsx)(c.rA,{icon:"note_add",title:t("创建文本文件"),onClick:function(){m({show:!0,type:E.PromptEnum.SshNewFile,overlay:!0,data:{}})}}),(0,v.jsx)(c.rA,{icon:"upload_file",title:"上传",onClick:()=>{m({show:!0,type:E.PromptEnum.UploadFile,overlay:!0,data:{call:e=>{let t=e.currentTarget?.files;if(!t)return;let a=!!t[0].webkitRelativePath;const n=[],s=new Set;for(let e=0;e<t.length;e++){const o=t[e],i=a?o.webkitRelativePath:`${o.webkitRelativePath}${o.name}`;o.fullPath=i,a&&s.add((0,$.S)(i)),n.push(o)}const o=[];if(a)for(const e of Array.from(s))o.push({isDir:!0,fullPath:e,name:e});o.push(...n),p(o),m({show:!0,type:E.PromptEnum.SshUpload,overlay:!1,data:{}})}}})}}),(0,v.jsx)(c.rA,{icon:"close",title:t("关闭"),onClick:()=>{e.close()}})]})}var O=a(60096),H=a(21499);let T;function z(e){const{t}=(0,r.Bd)(),a=(0,L.zy)(),[s,o]=(0,l.fp)(d.AG.nowFileList),[c,p]=(0,l.fp)(d.AG.selectedFileList),[m,f]=(0,l.fp)(d.AG.clickFileList),[_,w]=(0,l.fp)(d.AG.sshInfo),[g,b]=(0,n.useState)(""),N=(0,L.Zp)(),[K,S]=(0,l.fp)(d.AG.user_base_info),A=async e=>{const t=new C.x;t.key=_.key,t.dir=e||`/${(0,j.GG)("remoteShell",(0,j.vX)())}`;const a=await u.Fg.post("get/dir",t);if(a.code!==y.m.Success)return void(0,h.zN)("连接失败");const{folders:n,files:s}=a.data||{};for(const e of s??[])e.origin_size=e.size,e.size=(0,B.v7)(e.size),K.user_data.file_time_show_type===x.KD.time?e.show_mtime=e.mtime?(0,H.Yq)(e.mtime):"":e.show_mtime=e.mtime?(0,P.s)(e.mtime):"";for(const e of n??[])K.user_data.file_time_show_type===x.KD.time?e.show_mtime=e.mtime?(0,H.Yq)(e.mtime):"":e.show_mtime=e.mtime?(0,P.s)(e.mtime):"";const i={folders:n||[],files:s||[]};(0,M.yC)(i,K.user_data.dir_show_type),o(i),T=i};function I(){p([]),f([])}(0,n.useEffect)(()=>{I(),(async()=>{await A()})()},[a]);return(0,v.jsxs)(n.Fragment,{children:[(0,v.jsx)(k.aZ,{children:(0,v.jsx)(i.$Z,{handleEnterPress:()=>{if(!T)return;p([]),f([]);const e=[],t=[];for(const t of T.files??[])t.name.includes(g)&&e.push(t);for(const e of T.folders??[])e.name.includes(g)&&t.push(e);o({files:e,folders:t})},placeholder:t("搜索当前目录"),icon:"search",value:"",handleInputChange:e=>{b(e)},max_width:"25em"})}),(0,v.jsx)(k.aZ,{position:"right",children:(0,v.jsx)(G,{close:e.close})}),(0,v.jsx)(D.e,{baseRoute:"remoteShell",clickFun:I,input_path_enter:e=>{(0,R.Z1)(e)?A(e):N((0,R.Jn)((0,j.vX)(),e)),p([]),f([]),o({files:[],folders:[]})}}),(0,v.jsx)(O.Ic,{handleContextMenu:()=>{},clickBlank:e=>{e.target===e.currentTarget&&p([])},file_list:s.files,folder_list:s.folders,fileHandler:A}),(0,v.jsx)(F,{})]})}function U(e){const{t}=(0,r.Bd)(),a=(0,L.Zp)(),[s,o]=(0,n.useState)(""),[p,m]=(0,n.useState)(""),[f,w]=(0,n.useState)(""),[g,j]=(0,n.useState)(""),[N,K]=(0,n.useState)(void 0),[S,A]=(0,n.useState)(""),[F,D]=(0,l.fp)(d.AG.shellNowDir),[M,I]=(0,l.fp)(d.AG.sshInfo),{check_user_auth:B}=(0,_.MH)(),P=async e=>{const t=new C.x;if(t.password=e?e.password:p,t.domain=e?e.domain:g,t.port=e?e.port:N,t.username=e?e.username:s,t.private_path=e?e.private_path:f,t.dir=e?e.dir:S,!t.dir)return void(0,h.zN)("dir not found");if(!t.username)return void(0,h.zN)("username not found");if(!t.domain)return void(0,h.zN)("domain not found");if(!t.port)return void(0,h.zN)("port not found");if(!t.private_path&&!t.password)return void(0,h.zN)("private_path password not found");const n=await u.Fg.post("start",t);n&&n.code===y.m.Success&&(a((0,R.Jn)("/proxy/remoteShell",t.dir)),D([t.dir]),I(n.data))};return(0,v.jsxs)(n.Fragment,{children:[!M.key&&(0,v.jsxs)(k.aZ,{position:"right",children:[(0,v.jsx)(i.$Z,{placeholder:t("目录"),icon:"home",value:S,handleInputChange:e=>A(e),max_width:"15rem"}),(0,v.jsx)(i.$Z,{placeholder:t("账号"),icon:"verified_user",value:s,handleInputChange:e=>o(e),max_width:"15rem"}),(0,v.jsx)(i.$Z,{type:"password",placeholder:t("密码"),icon:"password",value:p,handleInputChange:e=>m(e),max_width:"15rem"}),(0,v.jsx)(i.$Z,{placeholder:t("私钥路径"),icon:"private_connectivity",value:f,handleInputChange:e=>w(e),max_width:"15rem"}),(0,v.jsx)(i.$Z,{placeholder:t("连接地址"),icon:"location_on",value:g,handleInputChange:e=>{j(e)},max_width:"15rem"}),(0,v.jsx)(i.$Z,{placeholder:t("端口"),icon:"outlet",value:N,handleInputChange:e=>{if(!e)return;/^\d+$/.test(e)||(0,h.zN)("不是数字"),K(parseInt(e))},max_width:"7rem"}),(0,v.jsx)(c.rA,{icon:"play_arrow",title:t("连接"),onClick:()=>{P()}})]}),M.key?(0,v.jsx)(z,{close:async()=>{const e=new C.x;e.key=M.key;await u.Fg.post("close",e);I({})},data:{port:N,password:p,username:s,domain:g,dir:S}}):(0,v.jsx)(b.N,{have_auth_edit:B(x.oV.ssh_proxy_tag_update),getItems:async()=>{const e=await u.Fg.get("tag");return e.code===y.m.Success?e.data:[]},save:async e=>{await u.Fg.post("tag/save",e)},clickItem:async e=>{j(e.domain),A(e.dir),K(e.port),o(e.username),m(e.password),w(e.private_path),await P(e)},items:[{key:"name",preName:t("名字")},{key:"domain",preName:t("地址")},{key:"port",preName:t("端口")},{key:"username",preName:t("账号")},{key:"password",preName:t("密码")},{key:"private_path",preName:t("私钥路径")},{key:"dir",preName:t("访问目录")},{key:"color",preName:"color"}]})]})}function V(e){switch(e){case 0:return 1;case 2:return 2;default:return 0}}class Z{constructor(e){this.canvas=e,this.render=new Q.Canvas.create(this.canvas),this.activeSession=!1,this.install()}close(){this.activeSession=!1}install(){var e=this;return this.canvas.addEventListener("mousemove",function(t){var a=Q.elementOffset(e.canvas);return S.ws.sendData(K.HK.mouse,{x:t.clientX-a.left,y:t.clientY-a.top,button:0,isPressed:!1}),t.preventDefault||e.activeSession(),!1}),this.canvas.addEventListener("mousedown",function(t){var a=Q.elementOffset(e.canvas);return S.ws.sendData(K.HK.mouse,{x:t.clientX-a.left,y:t.clientY-a.top,button:V(t.button),isPressed:!0}),t.preventDefault(),!1}),this.canvas.addEventListener("mouseup",function(t){if(e.activeSession){var a=Q.elementOffset(e.canvas);return S.ws.sendData(K.HK.mouse,{x:t.clientX-a.left,y:t.clientY-a.top,button:V(t.button),isPressed:!1}),t.preventDefault(),!1}}),this.canvas.addEventListener("contextmenu",function(t){if(e.activeSession){var a=Q.elementOffset(e.canvas);return S.ws.sendData(K.HK.mouse,{x:t.clientX-a.left,y:t.clientY-a.top,button:V(t.button),isPressed:!1}),t.preventDefault(),!1}}),this.canvas.addEventListener("DOMMouseScroll",function(t){if(e.activeSession){var a=t.detail,n=Math.round(15*Math.abs(a)/8),s=Q.elementOffset(e.canvas);return S.ws.sendData(K.HK.wheel,{x:t.clientX-s.left,y:t.clientY-s.top,step:n,isNegative:a>0,isHorizontal:!1}),t.preventDefault(),!1}}),this.canvas.addEventListener("mousewheel",function(t){if(e.activeSession){var a=Math.abs(t.deltaX)>Math.abs(t.deltaY),n=a?t.deltaX:t.deltaY,s=Math.round(15*Math.abs(n)/8),o=Q.elementOffset(e.canvas);return S.ws.sendData(K.HK.wheel,{x:t.clientX-o.left,y:t.clientY-o.top,step:s,isNegative:n>0,isHorizontal:a}),t.preventDefault(),!1}}),window.addEventListener("keydown",function(t){if(e.activeSession)return S.ws.sendData(K.HK.scancode,{code:Q.scancode(t),isPressed:!0}),t.preventDefault(),!1}),window.addEventListener("keyup",function(t){if(e.activeSession)return S.ws.sendData(K.HK.scancode,{code:Q.scancode(t),isPressed:!1}),t.preventDefault(),!1}),this}connect(e,t,a,n,s,o){var i=this;S.ws.addMsg(K.HK.rdp_connect,e=>{console.log("[mstsc.js] connected"),i.activeSession=!0}),S.ws.addMsg(K.HK.rdp_bitmap,e=>{const t=e.context;t.data=e.bin_context,i.render.update(t)}),S.ws.addMsg(K.HK.rdp_close,e=>{o(null),console.log("[mstsc.js] close"),i.activeSession=!1}),S.ws.addMsg(K.HK.rdp_error,e=>{i.activeSession=!1});const r=new K.hf;r.cmdType=K.HK.infos,r.context={ip:e.indexOf(":")>-1?e.split(":")[0]:e,port:a,screen:{width:this.canvas.width,height:this.canvas.height},domain:t,username:n,password:s,locale:Q.locale()},S.ws.send(r)}}class J{constructor(e){this.canvas=e,this.ctx=e.getContext("2d")}update(e){var t=null;t=e.isCompress?function(e){var t=null;switch(e.bitsPerPixel){case 15:t="bitmap_decompress_15";break;case 16:t="bitmap_decompress_16";break;case 24:t="bitmap_decompress_24";break;case 32:t="bitmap_decompress_32";break;default:throw"invalid bitmap data format"}var a=new Uint8Array(e.data),n=Module._malloc(a.length),s=new Uint8Array(Module.HEAPU8.buffer,n,a.length);s.set(a);var o=e.destRight-e.destLeft+1,i=e.destBottom-e.destTop+1,r=o*i*4,l=Module._malloc(r),d=new Uint8Array(Module.HEAPU8.buffer,l,r),c=(Module.ccall(t,"number",["number","number","number","number","number","number","number","number"],[d.byteOffset,o,i,e.width,e.height,s.byteOffset,a.length]),new Uint8ClampedArray(d.buffer,d.byteOffset,r));return Module._free(n),Module._free(l),{width:o,height:i,data:c}}(e):function(e){return{width:e.width,height:e.height,data:new Uint8ClampedArray(e.data)}}(e);var a=this.ctx.createImageData(t.width,t.height);a.data.set(t.data),this.ctx.putImageData(a,e.destLeft,e.destTop)}}var X={"":0,Escape:1,Digit1:2,Digit2:3,Digit3:4,Digit4:5,Digit5:6,Digit6:7,Digit7:8,Digit8:9,Digit9:10,Digit0:11,Minus:12,Equal:13,Backspace:14,Tab:15,KeyQ:16,KeyW:17,KeyE:18,KeyR:19,KeyT:20,KeyY:21,KeyU:22,KeyI:23,KeyO:24,KeyP:25,BracketLeft:26,BracketRight:27,Enter:28,ControlLeft:29,KeyA:30,KeyS:31,KeyD:32,KeyF:33,KeyG:34,KeyH:35,KeyJ:36,KeyK:37,KeyL:38,Semicolon:39,Quote:40,Backquote:41,ShiftLeft:42,Backslash:43,KeyZ:44,KeyX:45,KeyC:46,KeyV:47,KeyB:48,KeyN:49,KeyM:50,Comma:51,Period:52,Slash:53,ShiftRight:54,NumpadMultiply:55,AltLeft:56,Space:57,CapsLock:58,F1:59,F2:60,F3:61,F4:62,F5:63,F6:64,F7:65,F8:66,F9:67,F10:68,Pause:69,ScrollLock:70,Numpad7:71,Numpad8:72,Numpad9:73,NumpadSubtract:74,Numpad4:75,Numpad5:76,Numpad6:77,NumpadAdd:78,Numpad1:79,Numpad2:80,Numpad3:81,Numpad0:82,NumpadDecimal:83,PrintScreen:84,IntlBackslash:86,F11:87,F12:88,NumpadEqual:89,F13:100,F14:101,F15:102,F16:103,F17:104,F18:105,F19:106,F20:107,F21:108,F22:109,F23:110,KanaMode:112,Lang2:113,Lang1:114,IntlRo:115,F24:118,Convert:121,NonConvert:123,IntlYen:125,NumpadComma:126,MediaTrackPrevious:57360,MediaTrackNext:57369,NumpadEnter:57372,ControlRight:57373,VolumeMute:57376,LaunchApp2:57377,MediaPlayPause:57378,MediaStop:57380,VolumeDown:57390,VolumeUp:57392,BrowserHome:57394,NumpadDivide:57397,PrintScreen:57399,AltRight:57400,NumLock:57413,Pause:57414,Home:57415,ArrowUp:57416,PageUp:57417,ArrowLeft:57419,ArrowRight:57421,End:57423,ArrowDown:57424,PageDown:57425,Insert:57426,Delete:57427,OSLeft:57435,OSRight:57436,ContextMenu:57437,Power:57438,BrowserSearch:57445,BrowserFavorites:57446,BrowserRefresh:57447,BrowserStop:57448,BrowserForward:57449,BrowserBack:57450,LaunchApp1:57451,LaunchMail:57452,MediaSelect:57453},Y={27:"Escape",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",192:"Backquote",49:"Digit1",50:"Digit2",51:"Digit3",52:"Digit4",53:"Digit5",54:"Digit6",55:"Digit7",56:"Digit8",57:"Digit9",48:"Digit0",173:"Minus",61:"Equal",8:"Backspace",9:"Tab",81:"KeyQ",87:"KeyW",69:"KeyE",82:"KeyR",84:"KeyT",89:"KeyY",85:"KeyU",73:"KeyI",79:"KeyO",80:"KeyP",219:"BracketLeft",221:"BracketRight",13:"Enter",20:"CapsLock",65:"KeyA",83:"KeyS",68:"KeyD",70:"KeyF",71:"KeyG",72:"KeyH",74:"KeyJ",75:"KeyK",76:"KeyL",59:"Semicolon",222:"Quote",220:"Backslash",16:"ShiftLeft",220:"IntlBackslash",90:"KeyZ",88:"KeyX",67:"KeyC",86:"KeyV",66:"KeyB",78:"KeyN",77:"KeyM",188:"Comma",190:"Period",191:"Slash",16:"ShiftRight",17:"ControlLeft",18:"AltLeft",91:"OSLeft",32:"Space",18:"AltRight",91:"OSRight",93:"ContextMenu",17:"ControlRight",37:"ArrowLeft",38:"ArrowUp",40:"ArrowDown",39:"ArrowRight",144:"NumLock",144:"NumLock",111:"NumpadDivide",106:"NumpadMultiply",109:"NumpadSubtract",103:"Numpad7",104:"Numpad8",105:"Numpad9",107:"NumpadAdd",100:"Numpad4",101:"Numpad5",102:"Numpad6",97:"Numpad1",98:"Numpad2",99:"Numpad3",13:"NumpadEnter",96:"Numpad0",110:"NumpadDecimal",17:"ControlLeft"},q={firefox:{fr:{27:"Escape",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",0:"Backquote",49:"Digit1",50:"Digit2",51:"Digit3",52:"Digit4",53:"Digit5",54:"Digit6",55:"Digit7",56:"Digit8",57:"Digit9",48:"Digit0",169:"Minus",61:"Equal",8:"Backspace",9:"Tab",65:"KeyQ",90:"KeyW",69:"KeyE",82:"KeyR",84:"KeyT",89:"KeyY",85:"KeyU",73:"KeyI",79:"KeyO",80:"KeyP",160:"BracketLeft",164:"BracketRight",13:"Enter",20:"CapsLock",20:"CapsLock",81:"KeyA",83:"KeyS",68:"KeyD",70:"KeyF",71:"KeyG",72:"KeyH",74:"KeyJ",75:"KeyK",76:"KeyL",77:"Semicolon",165:"Quote",170:"Backslash",16:"ShiftLeft",60:"IntlBackslash",87:"KeyZ",88:"KeyX",67:"KeyC",86:"KeyV",66:"KeyB",78:"KeyN",188:"KeyM",59:"Comma",58:"Period",161:"Slash",16:"ShiftRight",17:"ControlLeft",91:"OSLeft",18:"AltLeft",32:"Space",17:"ControlLeft",18:"AltRight",91:"OSRight",93:"ContextMenu",17:"ControlRight",37:"ArrowLeft",38:"ArrowUp",40:"ArrowDown",39:"ArrowRight",144:"NumLock",144:"NumLock",111:"NumpadDivide",106:"NumpadMultiply",109:"NumpadSubtract",103:"Numpad7",104:"Numpad8",105:"Numpad9",107:"NumpadAdd",100:"Numpad4",101:"Numpad5",102:"Numpad6",97:"Numpad1",98:"Numpad2",99:"Numpad3",96:"Numpad0",110:"NumpadDecimal",13:"NumpadEnter",17:"ControlLeft",67:"KeyC",17:"ControlLeft"},en:Y},chrome:{fr:{27:"Escape",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",0:"Backquote",49:"Digit1",50:"Digit2",51:"Digit3",52:"Digit4",53:"Digit5",54:"Digit6",55:"Digit7",56:"Digit8",57:"Digit9",48:"Digit0",219:"Minus",187:"Equal",8:"Backspace",9:"Tab",65:"KeyQ",90:"KeyW",69:"KeyE",82:"KeyR",84:"KeyT",89:"KeyY",85:"KeyU",73:"KeyI",79:"KeyO",80:"KeyP",221:"BracketLeft",186:"BracketRight",13:"Enter",20:"CapsLock",20:"CapsLock",81:"KeyA",83:"KeyS",68:"KeyD",70:"KeyF",71:"KeyG",72:"KeyH",74:"KeyJ",75:"KeyK",76:"KeyL",77:"Semicolon",192:"Quote",220:"Backslash",16:"ShiftLeft",60:"IntlBackslash",87:"KeyZ",88:"KeyX",67:"KeyC",86:"KeyV",66:"KeyB",78:"KeyN",188:"KeyM",190:"Comma",191:"Period",223:"Slash",16:"ShiftRight",17:"ControlLeft",91:"OSLeft",18:"AltLeft",32:"Space",17:"ControlLeft",18:"AltRight",91:"OSRight",93:"ContextMenu",17:"ControlRight",37:"ArrowLeft",38:"ArrowUp",40:"ArrowDown",39:"ArrowRight",144:"NumLock",144:"NumLock",111:"NumpadDivide",106:"NumpadMultiply",109:"NumpadSubtract",103:"Numpad7",104:"Numpad8",105:"Numpad9",107:"NumpadAdd",100:"Numpad4",101:"Numpad5",102:"Numpad6",97:"Numpad1",98:"Numpad2",99:"Numpad3",96:"Numpad0",110:"NumpadDecimal",13:"NumpadEnter",17:"ControlLeft",67:"KeyC",17:"ControlLeft"},en:Y}};function W(){}W.prototype={$:function(e){return document.getElementById(e)},elementOffset:function(e){for(var t=0,a=0;e&&!isNaN(e.offsetLeft)&&!isNaN(e.offsetTop);)t+=e.offsetLeft-e.scrollLeft,a+=e.offsetTop-e.scrollTop,e=e.offsetParent;return{top:a,left:t}},browser:function(){return"undefined"!=typeof InstallTrigger?"firefox":window.chrome?"chrome":document.docuemntMode?"ie":null},locale:function(){return window.navigator.userLanguage||window.navigator.language},client:{create:function(e){return new Z(e)}},Canvas:{create:function(e){return new J(e)}},scancode(e){var t=W.prototype.locale();return t=["fr","en"].indexOf(t)>0&&t||"en",X[e.code||q[W.prototype.browser()||"firefox"][t][e.keyCode]]}};let Q=new W;var ee=a(38240);let te;function ae(){const{t:e}=(0,r.Bd)(),[t,a]=(0,l.fp)(d.AG.header_min),{check_user_auth:s}=(0,_.MH)(),[p,m]=(0,n.useState)(void 0),[f,w]=(0,n.useState)(3389),[g,j]=(0,n.useState)(void 0),[N,C]=(0,n.useState)(void 0),[A,F]=(0,n.useState)(!1),[D,L]=(0,n.useState)(!1);var M=null;(0,n.useEffect)(()=>(te||(async()=>{try{await(0,ee.J)("rle.js"),te=!0}catch(e){return void(0,h.zN)("加载资源失败")}})(),()=>{M&&(M.close(),M=null)}),[]);const I=t=>{L(!0),function(n,s,o,i){if(n=n||t.address,o=o||t.username,i=i||t.password,!n||!o)return(0,h.zN)(e("ip或者账号不允许为空")),void L(!1);!function(e){M||(M=Q.client.create(Q.$(e)))}("rdpwebview");var r=Q.$("rdpwebview");r.style.display="inline",r.width=window.innerWidth,r.height=window.innerHeight,F(!0),a(!0),M.connect(n,"",s,o,i,function(e){Q.$("rdpwebview").style.display="none",a(!1),L(!1),F(!1)})}(p,f,g,N)};return(0,v.jsxs)("div",{children:[(0,v.jsxs)(k.aZ,{position:"right",children:[(0,v.jsx)(i.$Z,{placeholder:e("地址"),icon:"network_ping",value:p,max_width:"15rem",handleInputChange:e=>m(e)}),(0,v.jsx)(i.$Z,{placeholder:e("端口"),icon:"outlet",value:f,max_width:"10rem",handleInputChange:e=>{e&&w(parseInt(e))}}),(0,v.jsx)(i.$Z,{placeholder:e("账号"),icon:"manage_accounts",value:g,max_width:"15rem",handleInputChange:e=>j(e)}),(0,v.jsx)(i.$Z,{placeholder:e("密码"),icon:"password",value:N,max_width:"15rem",handleInputChange:e=>C(e)}),!D&&(0,v.jsx)(c.rA,{icon:"play_arrow",title:e("连接"),onClick:I}),D&&(0,v.jsx)(c.rA,{icon:"close",title:e("关闭"),onClick:async()=>{F(!1),await S.ws.sendData(K.HK.rdp_disconnect,"");var e=Q.$("rdpwebview");e.getContext("2d").clearRect(0,0,e.width,e.height),Q.$("rdpwebview").style.display="none",L(!1),a(!1)}})]}),(0,v.jsxs)(o.jW,{isFull:A,children:[!D&&(0,v.jsx)(b.N,{have_auth_edit:s(x.oV.rdp_proxy_tag_update),getItems:async()=>{const e=await u.J0.get("tag");return e.code===y.m.Success?e.data:[]},save:async e=>{(await u.J0.post("tag/save",e)).code!==y.m.Success&&(0,h.zN)("网络错误")},clickItem:async e=>{C(e.password),j(e.username),m(e.address),w(e.port),I(e)},items:[{key:"name",preName:e("名字")},{key:"address",preName:e("地址")},{key:"port",preName:e("端口")},{key:"username",preName:e("账号")},{key:"password",preName:e("密码")},{key:"color",preName:"color"}]}),(0,v.jsx)("canvas",{id:"rdpwebview",style:{display:"none"}})]})]})}var ne=a(40505),se=a(8694),oe=a(19324);const ie=(0,n.createContext)({activeKey:"",setActiveKey:()=>{}});function re(e){const{children:t,activeKey:a,defaultActiveKey:s,onChange:o,width:i}=e,[r,l]=(0,n.useState)(()=>a??s??"");(0,n.useEffect)(()=>{void 0!==a&&l(a)},[a]);const d=e=>{void 0===a&&l(e),o&&o(e)},c=[];return n.Children.forEach(t,e=>{n.isValidElement(e)&&e.type===le&&c.push({key:e.props.itemKey,tab:e.props.tab,disabled:e.props.disabled})}),(0,n.useEffect)(()=>{!r&&c.length>0&&l(c[0].key)},[c,r]),(0,v.jsx)(ie.Provider,{value:{activeKey:r,setActiveKey:d},children:(0,v.jsxs)("div",{className:"modern-tabs-container",style:{width:i||"100%"},children:[(0,v.jsx)("div",{className:"modern-tabs-nav",children:c.map(e=>{const t=["modern-tabs-tab",r===e.key?"active":"",e.disabled?"disabled":""].filter(Boolean).join(" ");return(0,v.jsx)("div",{className:t,onClick:()=>!e.disabled&&d(e.key),children:e.tab},e.key)})}),(0,v.jsx)("div",{className:"modern-tabs-content",children:t})]})})}function le(e){const{itemKey:t,children:a}=e,{activeKey:s}=(0,n.useContext)(ie),o=s===t;return(0,v.jsx)("div",{className:"modern-tab-panel "+(o?"active":""),children:a})}const de=n.lazy(()=>Promise.all([a.e(2543),a.e(4091)]).then(a.bind(a,84091)));let ce,pe,ue,he;function me(){const{t:e}=(0,r.Bd)(),[t,a]=(0,l.fp)(d.AG.confirm),[m,f]=(0,l.fp)(d.AG.showPrompt),{check_user_auth:w}=(0,_.MH)(),[g,j]=(0,n.useState)(""),[k,N]=(0,l.fp)(d.AG.router_jump),[C,A]=(0,n.useState)("get"),[F,D]=(0,n.useState)(""),[L,M]=(0,n.useState)(void 0),[I,P]=(0,n.useState)([]),[R,$]=(0,n.useState)([]),[G,O]=(0,n.useState)("headers"),[T,z]=(0,n.useState)(String(se.RB.row)),[U,V]=(0,n.useState)("body"),[Z,J]=(0,n.useState)(),[X,Y]=(0,l.fp)(d.AG.nav_index_add_item_by_now_list),[q,W]=(0,l.fp)(d.AG.prompt_card);_.xK.set_value_temp("{}",0),_.xK.set_value_temp("",1),(0,n.useEffect)(()=>(ce={},pe="",ue="",he="",_.xK.get_editor(0).session.setMode("ace/mode/json"),k.http_download_map_path&&(M(k.http_download_map_path),N({})),S.ws.sendData(K.HK.http_download_water,void 0).then(()=>{S.ws.addMsg(K.HK.http_download_water,e=>{const t=e.context;$(t)})}),()=>{S.ws&&"function"==typeof S.ws.removeMsg&&S.ws.removeMsg(K.HK.http_download_water)}),[]);const Q=e=>{const t=new se.vr;t.url=F,t.method=C,t.header_type="headers"===G?1:2,"headers"===G&&(ce=JSON.parse(_.xK.get_editor_value(0))),t.headers=ce;const a=Number(T);if(t.body_type=a,a===se.RB.row)pe=_.xK.get_editor_value(1),t.data=pe;else if(a===se.RB.json)ce["Content-Type"]="application/json",pe=_.xK.get_editor_value(1),t.data=pe;else if(a===se.RB.form){ce["Content-Type"]="multipart/form-data",t.form_data_list=I;for(const t of I)t.key&&t.is_file&&e&&e.append(t.fullPath,t.file_object)}return t};return(0,v.jsx)("div",{children:(0,v.jsxs)(o.xh,{children:[(0,v.jsxs)(o.fI,{children:[(0,v.jsxs)(o.VP,{children:[0!==R.length&&(0,v.jsx)(s.Zp,{title:"正在下载",children:(0,v.jsx)("div",{children:R.map((t,a)=>(0,v.jsxs)("div",{children:[(0,v.jsxs)("div",{className:"div-row",children:[(0,v.jsx)(c.rA,{icon:"cancel",title:e("取消"),onClick:()=>{S.ws.sendData(K.HK.http_download_cancel,t.local_download_path)}}),(0,v.jsx)(s.xP,{context:t.filename,tip_context:t.local_download_path}),(0,v.jsx)("span",{style:{paddingLeft:".3rem",color:"green"},children:`${t.progresses??0}% ${t.loaded?(0,B.v7)(t.loaded):""}MB / ${t.seep??""}MB/s `})]}),(0,v.jsx)("div",{style:{width:t.progresses?`${t.progresses}%`:"0",backgroundColor:"#40c4ff",height:"5px",transition:"0.2s ease width",borderRadius:"10px"}})]},a))})}),(0,v.jsxs)(s.Zp,{title:"",rightBottomCom:Number(T)===se.RB.form&&"body"===G&&(0,v.jsx)(c.rA,{icon:"add",title:e("添加"),onClick:()=>{P([{},...I])}}),children:[(0,v.jsxs)("div",{className:"http_url",children:[(0,v.jsx)(i.l6,{width:"10rem",value:C,onChange:e=>{A(e)},options:[{value:"get",color:"#28a745"},{value:"post",color:"#007bff"},{value:"put",color:"#fd7e14"},{value:"delete",color:"#dc3545"},{value:"head",color:"#6f42c1"},{value:"options",color:"#17a2b8"},{value:"connect",color:"#666666"},{value:"trace",color:"#666666"},{value:"custom",color:"#e83e8c"}]}),(0,v.jsx)(i.Sm,{width:"50rem",placeholder:e("http url"),value:F,handleInputChange:e=>{D(e)}}),(0,v.jsx)(c.rA,{icon:"send",title:e("发送"),onClick:async()=>{if(!u._U.have_http_method(C))return void(0,h.zN)("不存在的http method");if(!F)return void(0,h.zN)("url is empty");J(void 0),j("");const e=new FormData;e.append("data",JSON.stringify(Q(e)));let t="http/send";L&&(t+=`?local_download_path=${L}`),oe.A.post(u._U.getUrl(t),e,{headers:{"Content-Type":"multipart/form-data",Authorization:localStorage.getItem("token")}}).catch(e=>{(0,h.zN)(e.message)}).then(e=>{if(!e)return;let t={};try{if(e.headers.filecat_remote_raw_headers&&(t=JSON.parse(e.headers.filecat_remote_raw_headers),he=JSON.stringify(t,null,2)),e.headers.filecat_remote_code)try{const t=JSON.parse(e.headers.filecat_remote_code);J(200===t||201===t?(0,v.jsx)("span",{style:{color:"green"},children:"200"}):t)}catch(e){console.log(e)}}catch(t){he=String(e.headers.filecat_remote_raw_headers)}const a=(t["content-type"]||t["Content-Type"]||"").toLowerCase();ue="object"==typeof e.data?JSON.stringify(e.data,null,2):e.data;const n=_.xK.get_editor(2),s="body"===U?ue:he;if(n){if(a.includes("application/json")||a.includes("+json")){n.session.setMode("ace/mode/json");try{const e=JSON.parse(ue);ue=JSON.stringify(e,null,2)}catch(e){}}else a.includes("html")?n.session.setMode("ace/mode/html"):a.includes("xml")?n.session.setMode("ace/mode/xml"):a.includes("javascript")?n.session.setMode("ace/mode/javascript"):n.session.setMode("ace/mode/text");n.setValue("body"===U?ue:he,-1)}j(s)})}}),w(x.oV.http_proxy_tag_update)&&(0,v.jsx)(c.rA,{title:e("添加"),icon:"save_as",onClick:()=>{if(!w(x.oV.http_proxy_tag_update))return void(0,h.zN)("no permission");for(const t of I)if(t.is_file)return void(0,h.zN)(e("frm_lm"));let t;W({open:!0,title:e("信息"),context_div:(0,v.jsxs)("div",{children:[(0,v.jsx)("div",{className:"card-content",children:(0,v.jsx)(i.Sm,{placeholderOut:e("输入标签名"),handleInputChange:e=>t=e})}),(0,v.jsx)("div",{className:"card-action",children:(0,v.jsx)("button",{className:"button button--flat",onClick:async()=>{const e=await Q();e.local_download_path=L,e.form_data_list=JSON.stringify(I),e.headers=JSON.stringify(e.headers),"object"==typeof e.data&&(e.data=JSON.stringify(e.data)),e.name=t,Y(e),W({open:!1})},children:e("确定")})})]})})}})]}),(0,v.jsxs)(re,{activeKey:G,onChange:e=>O(e),children:[(0,v.jsx)(le,{itemKey:"headers",tab:e("请求头")+"(json)",children:(0,v.jsxs)("div",{style:{marginTop:"10px"},children:[(0,v.jsx)("div",{style:{display:"flex",justifyContent:"flex-end",marginBottom:"4px"},children:(0,v.jsx)(c.rA,{title:e("格式化"),icon:"data_object",onClick:function(){_.xK.get_editor(0)?.formatCode?.()}})}),(0,v.jsx)("div",{className:"http_ace",children:(0,v.jsx)(de,{name:"",editor_id:0})})]})}),(0,v.jsx)(le,{itemKey:"body",tab:e("请求体"),children:(0,v.jsxs)("div",{style:{marginTop:"10px"},children:[(0,v.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,v.jsxs)(re,{activeKey:T,onChange:e=>{z(e);const t=Number(e);t===se.RB.row?_.xK.get_editor(1).session.setMode("ace/mode/text"):t===se.RB.json&&_.xK.get_editor(1).session.setMode("ace/mode/json")},children:[(0,v.jsx)(le,{itemKey:String(se.RB.row),tab:e("row")}),(0,v.jsx)(le,{itemKey:String(se.RB.json),tab:e("json")}),(0,v.jsx)(le,{itemKey:String(se.RB.form),tab:e("form")})]}),Number(T)!==se.RB.form&&(0,v.jsx)(c.rA,{title:e("格式化"),icon:"data_object",onClick:function(){_.xK.get_editor(1)?.formatCode?.()}})]}),Number(T)===se.RB.form&&(0,v.jsx)("div",{style:{marginTop:"10px"},children:(0,v.jsx)(p.X,{headers:["key",e("值")],rows:I.map((t,a)=>[(0,v.jsx)(i.Sm,{value:t.key,handleInputChange:e=>{t.key=e,P([...I])},no_border:!0}),(0,v.jsx)(i.Sm,{value:t.value,handleInputChange:e=>{t.value=e,t.is_file=!1,P([...I])},no_border:!0}),(0,v.jsxs)("div",{children:[(0,v.jsx)(c.rA,{icon:"file_upload",title:e("上传文件"),onClick:()=>(e=>{f({show:!0,type:E.PromptEnum.UploadFile,overlay:!0,data:{extra_data:{only_file:!0},call:t=>{let a=t.currentTarget?.files;if(!a)return;const n=a[0];n.fullPath=(0,H.hU)()+Date.now().toString(),I[e].value=`${n}(${n.name})`,I[e].is_file=!0,I[e].fileName=n.name,I[e].fullPath=n.fullPath,P([...I]),I[e].file_object=n,f({overlay:!1,type:"",show:!1,data:{}})}}})})(a)}),(0,v.jsx)(c.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{I.splice(e,1),P([...I])})(a)})]})]),width:"10rem"})}),(0,v.jsx)("div",{className:"http_ace",style:{marginTop:"10px",display:Number(T)!==se.RB.form?"block":"none"},children:(0,v.jsx)(de,{name:"",editor_id:1})})]})})]}),(0,v.jsx)("div",{style:{paddingTop:"1rem"},children:void 0===L?(0,v.jsx)("span",{style:{cursor:"pointer",color:"#3b82f6"},onClick:()=>{M("")},children:e("下载到本地目录")}):(0,v.jsx)(i.Sm,{placeholder:e("本地地址"),value:L,handleInputChange:e=>{M(e)},handlerEnter:()=>{L||M(void 0)}})})]})]}),(0,v.jsx)(o.VP,{children:(0,v.jsxs)(s.Zp,{title:Z,titleCom:(0,v.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[(0,v.jsx)(c.rA,{title:e("格式化"),icon:"data_object",onClick:()=>{_.xK.get_editor(2)?.formatCode?.()}}),(0,v.jsx)(c.rA,{title:e("复制"),icon:"copy_all",onClick:()=>{const e=_.xK.get_editor_value(2);e&&((0,ne.lW)(e),(0,h.SK)("完成"))}})]}),children:[(0,v.jsxs)(re,{activeKey:U,onChange:e=>{V(e);const t="body"===e?ue:he;j(t);const a=_.xK.get_editor(2);if(a){try{JSON.parse(t),a.session.setMode("ace/mode/json")}catch{a.session.setMode("ace/mode/text")}a.setValue(t,-1)}},children:[(0,v.jsx)(le,{itemKey:"body",tab:e("响应体")}),(0,v.jsx)(le,{itemKey:"headers",tab:e("响应头")})]}),(0,v.jsx)("div",{className:"http_ace",style:{marginTop:"10px",height:"21rem"},children:(0,v.jsx)(de,{name:"",editor_id:2})})]})})]}),(0,v.jsx)(o.fI,{children:(0,v.jsx)(o.VP,{children:(0,v.jsx)(b.N,{getItems:async()=>{const e=await u._U.get("http/tag");return e.code===y.m.Success?e.data:[]},save:async e=>{(await u._U.post("http/tag/save",e)).code!==y.m.Success&&(0,h.zN)("网络错误")},have_auth_edit:w(x.oV.http_proxy_tag_update),clickItem:async e=>{D(e.url),A(e.method),M(e.local_download_path),e.header_type&&O(1===e.header_type?"headers":"body"),e.headers&&(ce=JSON.parse(e.headers),1===e.header_type&&(_.xK.get_editor(0).setValue(e.headers,-1),_.xK.get_editor(0).session.setMode("ace/mode/json"))),e.form_data_list&&P(JSON.parse(e.form_data_list)),e.data&&(pe=e.data),e.body_type&&(z(String(e.body_type)),e.body_type===se.RB.row?_.xK.get_editor(1).session.setMode("ace/mode/text"):e.body_type===se.RB.json&&_.xK.get_editor(1).session.setMode("ace/mode/json"),_.xK.get_editor(1).setValue(e.data,-1))},items:[{key:"name",preName:e("名字")},{key:"url",preName:"url"},{key:"method",preName:"method"},{key:"headers",preName:"headers"},{key:"data",preName:"data"},{key:"form_data_list",preName:"form_data_list"},{key:"local_download_path",preName:"local_download_path"},{key:"color",preName:"color"}]})})})]})})}var fe=a(87361);const ye=n.lazy(()=>Promise.all([a.e(8772),a.e(8257),a.e(7759)]).then(a.bind(a,45601)));function _e({}){const{check_user_auth:e}=(0,_.MH)(),{t}=(0,r.Bd)(),a=[];return e(x.oV.http_proxy)&&a.push({index:1,name:t("http代理"),rto:"http/",component:(0,v.jsx)(me,{})}),e(x.oV.ssh_proxy)&&a.push({index:1,name:`ssh${t("代理")}`,rto:"remoteShell/",component:(0,v.jsx)(U,{})}),e(x.oV.browser_proxy)&&a.push({index:1,name:`${t("浏览器")}${t("代理")}`,rto:"browserproxy/",component:(0,v.jsx)(g,{})}),e(x.oV.rdp_proxy)&&a.push({index:1,name:`rdp${t("代理")}`,rto:"rdp/",component:(0,v.jsx)(ae,{})}),e(x.oV.rtsp_proxy)&&a.push({index:1,name:t("rtsp播放器"),rto:"rtsp/",component:(0,v.jsx)(ye,{})}),(0,v.jsx)(o.W1,{optionList:a,father_route:fe.o.proxy})}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[2674],{92674(e,t,n){n.r(t),n.d(t,{default:()=>M});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),j=n(61973),g=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))),A=a.lazy(()=>Promise.all([n.e(1417),n.e(8781),n.e(2479)]).then(n.bind(n,12479)));function M(e){const[t,n]=(0,a.useState)([]),[u,M]=(0,a.useState)(""),[P,$]=(0,a.useState)(""),[I,G]=(0,a.useState)(!1),[R,z]=(0,a.useState)({path:"",name:""}),[F,D]=(0,a.useState)(""),[L,U]=(0,s.fp)(i.AG.confirm),[T,B]=(0,a.useState)(!1),[K,X]=(0,s.fp)(i.AG.fileShellShow),[H,V]=(0,s.fp)(i.AG.file_shell_hidden),W=(0,a.useRef)(null),Y=(0,a.useRef)(null),[Z,q]=(0,a.useState)(!1),[J,O]=(0,a.useState)(16),[Q,ee]=(0,s.fp)(i.AG.showPrompt),{t:te}=(0,y.Bd)(),ne=(0,j.Zp)(),ae=(ie=R.name,(0,c.uL)(ie)===r.Iw.md);var ie;const se=function(e){return(0,c.uL)(e)===r.Iw.excalidraw}(R.name),oe=function(e){return(0,c.uL)(e)===r.Iw.mind}(R.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)(),[je]=(0,j.ok)(),ge="1"===je.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,Ae]=(0,a.useState)(void 0),[Me,Pe]=(0,s.fp)(i.AG.ai_chat_session_by_cwd);let $e=(0,j.zy)().pathname.split("/").filter(Boolean).pop();$e=decodeURIComponent($e);const{check_user_auth:Ie}=(0,v.MH)(),[Ge]=(0,s.fp)(i.AG.user_base_info),Re=Ie(g.oV.ai_agent_page);(0,a.useEffect)(()=>{Ge?.user_data&&ge&&!Re&&we("chat_open",null)},[ge,Re,Ge]);const ze=(0,m.GG)("file",$e);const Fe=async()=>{const e=(0,m.GG)("file",$e);M(e),z({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)(()=>{$(""),B(!1),Fe()},[]);const De=async(e,t)=>{const n=await h.$M.get(`${encodeURIComponent(t)}`);$(n.data),v.xK.set_value_temp(n.data),z({path:t,name:e}),D(t),fe("folder"),ye(!1)},Le=(e,t)=>{e.size>w.o5?U({open:!0,handle:()=>{De(e.name,t),U({open:!1,handle:null}),B(!1)},title:"超过20MB了还要打开吗?"}):De(e.name,t)};async function Ue(){if(!T)return;const e={context:v.xK.get_editor_value()};0===(await h.$M.post(`save/${encodeURIComponent(F)}`,e)).code&&B(!1)}const Te=e=>{e.ctrlKey&&"s"===e.key&&(e.preventDefault(),T&&Ue())};(0,a.useEffect)(()=>(document.addEventListener("keydown",Te),()=>{document.removeEventListener("keydown",Te)}),[T]);const Be=(0,a.useCallback)(_.throttle(e=>{const t=parseFloat(getComputedStyle(Y.current).fontSize),n=window.innerWidth/t-4,a=e.clientX/t,i=2.25+W.current.offsetWidth/t;a<=n&&a>=i&&O(parseFloat(a.toFixed(2)))},32),[]),Ke=()=>{q(!1),Y.current.removeEventListener("pointermove",Be)},Xe=(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),[]),He=()=>{Ee(!1),document.removeEventListener("pointermove",Xe)},Ve=[{r:te("创建文件"),v:"创建文件"},{r:te("创建目录"),v:"创建目录"},{r:te("重命名"),v:"重命名"},{r:te("删除"),v:"删除"}],We=[{r:te("重命名"),v:"重命名"},{r:te("删除"),v:"删除"}],Ye=(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?Ve:We,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&&(R.path===n||R.path.includes(n))){const e=()=>{o(a),B(!1),z({}),$(""),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 Ze=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:()=>{X({show:!1,path:""}),V(void 0),ne(-1)}},1),(0,d.jsx)("div",{children:R.name},2)],children:[(0,d.jsx)("title",{children:R.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)(R.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!==H&&!1!==H?K.show?X({show:!1,path:""}):(X({show:!0,path:(0,m.GG)("file",$e)}),V(!1)):V(!H)}}),Ie(g.oV.ai_agent_page)&&(0,d.jsx)(o.rA,{title:te("AI 聊天"),icon:"smart_toy",selected:ge,onClick:()=>we("chat_open",!ge?"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:Ue}):null]}),(0,d.jsxs)("div",{className:"studio-body",ref:Y,children:[(0,d.jsxs)("div",{className:"studio-nav",style:{display:ve?void 0:"none",width:J-1+"em"},onContextMenu:e=>{Ye(e,R.name,(0,m.GG)("file",$e),!0,Fe)},children:[(0,d.jsx)("div",{className:"studio-nav-outline",style:{display:Ze?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:Ze?"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),Le(e,n)},title:"确定不保存就切换吗?"});Le(e,n)}},active_path:F,handleContextMenu:Ye,fatherNowToggleExpansion:Fe})}),ae&&(0,d.jsx)("div",{className:"studio-nav-switch",children:(0,d.jsx)(o.rA,{icon:Ze?"folder":"list",title:te(Ze?"文件目录":"大纲"),onClick:()=>fe(Ze?"folder":"outline")})})]}),ve&&(0,d.jsx)("div",{className:"studio__divider",ref:W,onPointerDown:()=>{q(!0),Y.current.addEventListener("pointermove",Be)},onPointerUp:Ke}),Z&&(0,d.jsx)("div",{className:"shell__overlay",onPointerUp:Ke}),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:F,url:h.$M.getDownloadUrl(encodeURIComponent(F)),name:R.name,on_dirty:ye,on_outline:(e,t)=>{ue(e),he(t)},register:e=>{le.current=e}}})})},F):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:F,url:h.$M.getDownloadUrl(encodeURIComponent(F)),save_path:F,on_dirty:B,on_saved:()=>B(!1),register:e=>{re.current=e}})})},F):oe?(0,d.jsx)("div",{className:"studio-editor studio-editor--mind",children:(0,d.jsx)(a.Suspense,{fallback:null,children:(0,d.jsx)(A,{reset_key:F,url:h.$M.getDownloadUrl(encodeURIComponent(F)),on_dirty:B,on_saved:()=>B(!1),register:e=>{ce.current=e},on_save:async e=>(await h.$M.post(`save/${encodeURIComponent(F)}`,{context:e})).code===f.m.Success})})},F):(0,d.jsx)("div",{className:"studio-editor",children:R.name&&(0,d.jsx)(a.Suspense,{fallback:null,children:(0,d.jsx)(C,{name:R.name,on_change:()=>{T||B(!0)}})})},F),ge&&(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",Xe),document.addEventListener("pointerup",He,{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??(qe=ze,i.AG.get_ai_chat_session(Me,qe)),on_session_change:e=>{Ae(e),((e,t)=>{Pe({...Me,[e]:t})})(ze,e)}})})})]})]})]});var qe}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[4903],{64903(e,t,n){n.r(t),n.d(t,{default:()=>f});var c=n(96540),i=n(34843),l=n(82893),s=n(85997),o=n(57952),a=(n(62042),n(21499),n(40505),n(22022)),d=(n(99214),n(74848));const r=c.lazy(()=>Promise.all([n.e(4946),n.e(2626),n.e(9334),n.e(6010)]).then(n.bind(n,34299)));function f(e){const{t}=(0,a.Bd)(),[n,c]=(0,i.fp)(l.AG.markdown);if(n.context)return(0,d.jsxs)("div",{id:"md-container",children:[(0,d.jsx)(o.A,{ignore_tags:!0,left_children:[(0,d.jsx)(s.rA,{title:t("取消"),icon:"close",onClick:function(){c({context:"",filename:""}),n?.close?.()}},1),(0,d.jsx)("title",{children:n.filename},2)]}),(0,d.jsx)("div",{className:"md-context ",children:(0,d.jsx)(r,{context:n.context})})]})}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[5877],{77481(e,t,n){n.d(t,{S:()=>c,X:()=>l});var s=n(96540),a=n(61443),r=n(74848);function l(e){const[t,n]=s.useState([]),l=(0,s.useRef)(-1),[c,o]=(0,s.useState)(-1),[i,d]=(0,s.useState)(-1);(0,s.useEffect)(()=>{e.children?n(Array.isArray(e.children)?e.children:[e.children]):n(e.rows)},[e.rows,e.children]);const u=()=>{l.current=-1,o(-1),d(-1)};return(0,r.jsxs)("table",{children:[(0,r.jsx)("thead",{children:(0,r.jsx)("tr",{children:e.headers?.map((t,n)=>{const s=!!e.filter&&(e.filter.column??0)===n;let l=t;if(s){const n=e.filter,s=n.options.find(e=>e.value===n.value);null!=n.value&&s&&(l=`${t} (${s.label})`)}return(0,r.jsx)("th",{className:s?"table-filter-col":"",children:s?(0,r.jsx)(a.l6,{value:e.filter.value,options:e.filter.options,onChange:e.filter.onChange,bare:!0,trigger_label:l}):t},n)})})}),(0,r.jsx)("tbody",{children:t.map((t,n)=>{const s=!!e.onRowDrag;return(0,r.jsx)("tr",{className:s?(c===n?"row-dragging":"")+(i===n?" row-drop-target":""):"",draggable:s,onContextMenu:()=>{e.handleContextMenu&&e.handleContextMenu(t)},onDragStart:e=>{s&&(l.current=n,o(n),e.dataTransfer.effectAllowed="move")},onDragOver:e=>{!s||l.current<0||(e.preventDefault(),e.dataTransfer.dropEffect="move",d(n))},onDrop:t=>{s&&(t.preventDefault(),(()=>{const t=l.current,n=i;u(),t<0||n<0||t===n||e.onRowDrag?.(t,n)})())},onDragEnd:u,children:t.map((n,s)=>{const a=s===t.length-1?"small":"";return(0,r.jsx)("td",{className:a,style:{width:e.width??"auto"},children:n},s)})},n)})})]})}function c(e){return(0,r.jsx)("div",{style:{display:e.isFlex?"flex":"block"},children:e.columns.map((e,t)=>(0,r.jsx)("div",{children:e},t))})}},83029(e,t,n){n.d(t,{N:()=>j});var s=n(96540),a=n(34843),r=n(82893),l=n(74848);function c(e){const[t,n]=(0,a.fp)(r.AG.user_base_info);return(0,l.jsx)("div",{children:e.div?(0,l.jsx)("div",{className:"nav_list_a",style:{background:e.color},children:e.name}):e.clickItem||"dir"===e._type?(0,l.jsx)("div",{className:"nav_list_a",style:{background:e.color},onClick:()=>{"dir"!==e._type?e.clickItem&&e.clickItem(e):e.click_dir(e.item)},children:e.name}):(0,l.jsx)("a",{href:e.url,target:e.target,className:"nav_list_a",style:{background:e.color},children:e.name})})}var o=n(64694),i=n(61443),d=n(85997),u=n(61973),h=n(22022);const p=["#ffffff","#fefff8","#fcfdf1","#d3d2dc","#f8f9fd","#ebf4fe","#ebebeb","#e8f7eb","#eaf2f9"];let m,x,_=[];const f=[];function j(e){const[t,n]=(0,s.useState)([]),[j,v]=(0,s.useState)(-1),g=(0,u.zy)(),[S,y]=(0,s.useState)(!1),[C,w]=(0,s.useState)(!1),{t:k}=(0,h.Bd)(),[b,I]=(0,s.useState)([]),[N,D]=(0,a.fp)(r.AG.nav_index_add_item_by_now_list),A=e=>{-1!==j?f[j]._children=e:_=e};(0,s.useEffect)(()=>{(async()=>{if(!e.getItems)return;const t=await e.getItems();_=t,n(_)})()},[g]);(0,s.useEffect)(()=>{if(N){const e=[...t,{name:"",color:(0,o.Lr)(p),...N}];A(e),n(e),y(!0),D(void 0)}},[N]);const K=e=>{v(j+1),n(e._children),f.push(e)};return(0,l.jsxs)("div",{className:"nav_list_div scroll-div-y",children:[-1!==j&&(0,l.jsx)(d.rA,{title:"返回",icon:"arrow_back",onClick:()=>{n(0===j?_:f[j-1]._children),v(j-1),f.pop()}}),t.map((a,r)=>(0,l.jsxs)("div",{draggable:!0,onDragOver:e=>{e.preventDefault()},onDragStart:e=>((e,t)=>{m=t})(0,r),onDrop:e=>((e,s)=>{e.preventDefault();const a=t[m],r=t[s];if(r&&"dir"===r._type){const e=[...t];return e.splice(m,1),r._children||(r._children=[]),r._children.push(a),A(e),void n(e)}const l=[...t],c=l[m];l.splice(m,1),l.splice(s,0,c),A(l),n(l)})(e,r),style:{cursor:S?"move":"pointer"},children:[(0,l.jsx)(c,{name:a.name,item:a,...a,div:S,target:"_blank",click_dir:K,clickItem:e.clickItem}),S&&(void 0!==b.find(e=>e===r)||C)&&(0,l.jsxs)("div",{className:C?"":" site_edit ",children:["dir"===a._type?(0,l.jsxs)(s.Fragment,{children:[(0,l.jsx)(i.Sm,{value:a.name,handleInputChange:e=>{a.name=e},placeholder:k("输入类目名"),no_border:!0}),(0,l.jsx)(i.Sm,{value:a.color,handleInputChange:e=>{a.color=e},placeholder:"color",no_border:!0})]}):e.items.map((e,t)=>(0,l.jsx)("div",{children:(0,l.jsx)(i.Sm,{value:a[e.key],handleInputChange:t=>{a[e.key]=t},placeholder:e.preName,no_border:!0})},t)),!C&&(0,l.jsx)(d.C3,{text:k("折叠"),clickFun:()=>{I((0,o.P1)(b,r))}})]}),S&&(0,l.jsx)("div",{style:{display:"block"},children:(0,l.jsxs)("span",{className:"div-row ",children:[(0,l.jsx)(d.C3,{text:k("删除"),clickFun:()=>{(e=>{const s=[...t];s.splice(e,1),A(s),n(s)})(r)}}),(0,l.jsx)(d.C3,{text:k("编辑"),clickFun:()=>{void 0===b.find(e=>e===r)&&I([...b,r])}})]})})]},r)),S&&(0,l.jsxs)("div",{style:{display:"block"},children:[(0,l.jsx)(d.rA,{title:k("取消"),icon:"cancel",onClick:()=>{I([]),y(!1),x&&(n(x),A(x)),w(!1)}}),(0,l.jsx)(d.rA,{title:k("添加"),icon:"add",onClick:async()=>{const s=[...t,{name:"",color:(0,o.Lr)(p),...e.get_pre_add_item&&await e.get_pre_add_item()}];A(s),n(s)}}),(0,l.jsx)(d.rA,{title:k("添加类目"),icon:"add_box",onClick:()=>{const e=[...t,{name:"",_type:"dir",_children:[],color:"#c1edfb"}];A(e),n(e)}}),(0,l.jsx)(d.rA,{title:k("全部编辑"),icon:C?"unfold_less":"unfold_more",onClick:()=>{w(!C)}})]}),(void 0===e.have_auth_edit||!0===e.have_auth_edit)&&(0,l.jsx)(d.rA,{icon:S?"save":"edit",title:k(S?"保存":"编辑"),onClick:async()=>{S?e.save&&await e.save(_):x=t,y(!S)}})]})}},65877(e,t,n){n.r(t),n.d(t,{default:()=>A});var s=n(96540),a=n(75725),r=n(61443),l=n(70447),c=n(85997),o=n(34289),i=n(22022),d=n(62042),u=n(14284),h=n(53459),p=n(74848);function m(e){const{t}=(0,i.Bd)(),[n,m]=(0,s.useState)(t("毫秒")),[x,_]=(0,s.useState)(""),[f,j]=(0,s.useState)(""),[v,g]=(0,s.useState)(null),[S,y]=(0,s.useState)(null),[C,w]=(0,s.useState)(Date.now());return(0,s.useEffect)(()=>{(async()=>{const e=await u.Yu.get("sys_time/get");if(e.code===h.m.Success){const t=await e.data;g(t.timestamp),y(t.timezone),w(t.timestamp)}})();const e=setInterval(()=>{w(e=>e+1e3)},1e3);return()=>clearInterval(e)},[]),(0,p.jsxs)(a.fI,{children:[(0,p.jsx)(a.VP,{widthPer:33,children:(0,p.jsxs)(l.Zp,{title:t("时间转换器"),rightBottomCom:(0,p.jsx)(c.C3,{text:t("确定"),clickFun:function(){if(!x&&!f)return void(0,d.zN)("不能都为空");let e=0;const t=""!==x&&0!==x;if(t){if(!(0,o.kf)(x))return void(0,d.zN)("must be number !");e=parseInt(x),"分秒"===n&&(e*=1e3)}const s=new Date(t?e:f),a=new Intl.DateTimeFormat("zh-CN",{year:"numeric",month:"short",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}).format(s);if(j(a),!x){const e=s.getTime();_("毫秒"===n?e:e/1e3)}}}),children:[(0,p.jsx)(r.l6,{value:n,options:[{title:t("毫秒"),value:"毫秒"},{title:t("分秒"),value:"分秒"}],onChange:function(e){m(e)}}),(0,p.jsx)(r.Sm,{placeholder:n,value:x,handleInputChange:e=>{_(e)}}),(0,p.jsx)(r.Sm,{placeholder:t("格式化时间"),value:f,handleInputChange:e=>{j(e)}})]})}),(0,p.jsx)(a.VP,{children:null!==v&&null!==S&&(0,p.jsxs)(l.Zp,{title:t("服务器时间"),children:[(0,p.jsxs)("h1",{children:[t("时区"),": ",S]}),(0,p.jsxs)("h1",{children:[t("时间"),": ",new Date(C).toLocaleString(navigator.language,{timeZone:S})]})]})})]})}var x=n(4412),_=n(83029),f=n(78247),j=n(23430);function v(e){const{t}=(0,i.Bd)(),{check_user_auth:n}=(0,f.MH)(),[a,l]=(0,s.useState)(""),o=async e=>{const t=e||a;if(!t)return void(0,d.zN)("mac地址不能为空");(await u._U.post("wol/exec",{mac:t})).code===h.m.Success&&(0,d.SK)("发送唤醒命令成功")};return(0,p.jsxs)("div",{children:[(0,p.jsxs)(x.aZ,{position:"right",children:[(0,p.jsx)(c.rA,{icon:"play_arrow",title:t("发送"),onClick:()=>{o()}}),(0,p.jsx)(r.$Z,{placeholder:t("mac_dst"),icon:"laptop_mac",value:a,handleInputChange:e=>l(e)})]}),(0,p.jsx)(_.N,{have_auth_edit:n(j.oV.wol_proxy_tag_update),getItems:async()=>{const e=await u._U.get("wol/tag");return e.code===h.m.Success?e.data:[]},save:async e=>{(await u._U.post("wol/tag/save",e)).code!==h.m.Success&&(0,d.zN)("网络错误")},clickItem:async e=>{l(e.mac),o(e.mac)},items:[{key:"name",preName:t("名字")},{key:"mac",preName:"mac"+t("地址")},{key:"color",preName:"color"}]})]})}var g=n(77481),S=n(34843),y=n(82893),C=n(40505);let w;function k(){const[e,t]=(0,s.useState)("rsa"),[n,o]=(0,s.useState)("pem"),{t:m,i18n:_}=(0,i.Bd)(),[f,j]=(0,S.fp)(y.AG.confirm),[v,k]=(0,s.useState)(""),[b,I]=(0,s.useState)(""),N=async t=>{if(!b||!v)return void(0,d.zN)("密钥不能为空");let n="id_"+e;"pub"===t&&(n+=".pub"),j({open:!0,title:m("将覆盖密钥文件"),sub_title:`之前的密钥将作废。 将会作为 ${n} 文件保存到系统上的"${w}"目录下,此目录会作为openssh(git)所使用的默认目录。`,handle:async()=>{(await u.cD.post("save_openssh",{name:n,context:"pub"===t?v:b})).code===h.m.Success&&((0,d.SK)("完成"),j({open:!1,handle:null}))}})};return(0,p.jsxs)(s.Fragment,{children:[(0,p.jsx)(x.aZ,{position:"right",children:(0,p.jsx)(g.S,{isFlex:!0,columns:[(0,p.jsx)(r.l6,{tip:m("加密算法"),value:e,width:"auto",onChange:e=>{t(e)},options:[{title:m("RSA"),value:"rsa"},{title:m("DSA"),value:"dsa"},{title:m("ECDSA"),value:"ecdsa"}]}),(0,p.jsx)(r.l6,{tip:m("输出格式"),value:n,width:"auto",onChange:e=>{o(e)},options:[{title:m("普通PEM"),value:"pem"},{title:m("opensshPEM"),value:"openssh_pem"}]}),(0,p.jsx)(c.rA,{icon:"play_arrow",title:m("生成"),onClick:()=>{(async()=>{const t=await u.cD.post("generate",{type:e,form:n});t.code===h.m.Success&&(k(t.data.public_key),I(t.data.private_key),w=t.data.home_path)})()}})]})}),(0,p.jsx)(a.xh,{children:(0,p.jsxs)(a.fI,{children:[(0,p.jsx)(a.VP,{children:(0,p.jsx)(l.Zp,{title:m("公钥"),titleCom:(0,p.jsx)(c.rA,{title:m("复制"),icon:"copy_all",onClick:()=>{v&&((0,C.lW)(v),(0,d.SK)("完成"))}}),rightBottomCom:"openssh_pem"===n&&(0,p.jsx)(c.C3,{text:m("ssh_dir"),clickFun:()=>{N("pub")}}),children:(0,p.jsx)("textarea",{className:"input--textarea input--no_border",style:{width:"100%",height:"270px"},onChange:e=>{k(e.target.value)},value:v})})}),(0,p.jsx)(a.VP,{children:(0,p.jsx)(l.Zp,{title:m("私钥"),titleCom:(0,p.jsx)(c.rA,{title:m("复制"),icon:"copy_all",onClick:()=>{b&&((0,C.lW)(b),(0,d.SK)("成功"))}}),rightBottomCom:"openssh_pem"===n&&(0,p.jsx)(c.C3,{text:m("ssh_dir"),clickFun:()=>{N("pri")}}),children:(0,p.jsx)("textarea",{className:"input--textarea input--no_border",style:{width:"100%",height:"270px"},value:b,onChange:e=>{I(e.target.value)}})})})]})})]})}var b=n(14944),I=n(92275);function N(){const{t:e}=(0,i.Bd)(),[t,n]=(0,s.useState)(""),[o,u]=(0,s.useState)("1"),[h,m]=(0,s.useState)("65535"),[x,_]=(0,s.useState)("100"),[f,j]=(0,s.useState)("2000"),[v,S]=(0,s.useState)(!1),[y,C]=(0,s.useState)(null),[w,k]=(0,s.useState)([]),[N,D]=(0,s.useState)(null),A=(0,s.useRef)([]),K=(0,s.useRef)(!1);(0,s.useEffect)(()=>{if(!K.current)return K.current=!0,b.ws.addMsg(I.HK.port_scan_progress,e=>{C(e.context)}),b.ws.addMsg(I.HK.port_scan_result,e=>{const t=e.context,n=[...A.current,t];A.current=n,k(n)}),b.ws.addMsg(I.HK.port_scan_end,t=>{D(t.context),S(!1),t.context.cancelled?(0,d.zN)(e("扫描已取消")):(0,d.SK)(e("扫描完成"))}),()=>{b.ws.sendData(I.HK.port_scan_cancel,{}),b.ws.removeMsg(I.HK.port_scan_progress),b.ws.removeMsg(I.HK.port_scan_result),b.ws.removeMsg(I.HK.port_scan_end),K.current=!1}},[]);return(0,p.jsx)(a.xh,{children:(0,p.jsx)(a.fI,{children:(0,p.jsx)(a.VP,{children:(0,p.jsxs)(l.Zp,{title:e("TCP ")+e("端口扫描"),titleCom:(0,p.jsxs)("span",{children:[y&&(0,p.jsxs)("span",{children:[e("已发现"),": ",y.openCount]}),N&&(0,p.jsxs)("span",{children:[e("总计扫描"),": ",N.totalScanned," | ",e("开放"),": ",N.totalOpen]})]}),rightBottomCom:v?(0,p.jsx)(c.C3,{text:e("取消"),clickFun:()=>{b.ws.sendData(I.HK.port_scan_cancel,{}).catch(()=>{})}}):(0,p.jsx)(c.C3,{text:e("扫描"),clickFun:()=>(()=>{if(!t)return void(0,d.zN)(e("hostreq"));const n=parseInt(o),s=parseInt(h);isNaN(n)||isNaN(s)||n<1||s<1||n>65535||s>65535?(0,d.zN)(e("端口范围无效")):n>s?(0,d.zN)(e("portrng")):(S(!0),C(null),k([]),A.current=[],D(null),b.ws.sendData(I.HK.port_scan_req,{host:t,startPort:n,endPort:s,concurrency:parseInt(x)||100,timeout:parseInt(f)||2e3}).catch(()=>{}))})()}),children:[(0,p.jsx)(r.Sm,{placeholder:e("目标主机"),value:t,handleInputChange:e=>n(e)}),(0,p.jsx)(r.Sm,{placeholder:e("起始端口"),value:o,handleInputChange:e=>u(e)}),(0,p.jsx)(r.Sm,{placeholder:e("结束端口"),value:h,handleInputChange:e=>m(e)}),(0,p.jsx)(r.Sm,{placeholder:e("并发数"),value:x,handleInputChange:e=>_(e)}),(0,p.jsx)(r.Sm,{placeholder:e("超时(ms)"),value:f,handleInputChange:e=>j(e)}),v&&y&&(0,p.jsxs)("div",{children:[(0,p.jsxs)("p",{children:[e("已扫描"),": ",y.scanned," / ",y.total]}),(0,p.jsx)(l.gz,{progress:y.percent})]}),w.length>0&&(0,p.jsx)(g.X,{headers:[e("端口"),e("状态")],rows:w.map(t=>[t.port,(0,p.jsx)("span",{children:e("开放")})])}),v&&0===w.length&&(0,p.jsx)("p",{children:e("正在扫描...")}),!v&&N&&0===w.length&&(0,p.jsx)("p",{children:e("未发现开放端口")}),!v&&!N&&0===w.length&&(0,p.jsx)("p",{children:e("scan_in")})]})})})})}var D=n(87361);function A(e){const{t}=(0,i.Bd)(),{check_user_auth:n}=(0,f.MH)(),s=[];return s.push({index:1,name:t("时间工具"),rto:"timeutil/",component:(0,p.jsx)(m,{})},{index:1,name:t("非对称密钥"),rto:"crypto/",component:(0,p.jsx)(k,{})}),n(j.oV.port_scan)&&s.push({index:1,name:t("端口扫描"),rto:"portscan/",component:(0,p.jsx)(N,{})}),n(j.oV.wol_proxy)&&s.push({index:1,name:t("网络唤醒"),rto:"netwol/",component:(0,p.jsx)(v,{})}),(0,p.jsx)(a.W1,{optionList:s,father_route:D.o.toolbox})}}}]);
@@ -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),D=n(70447),N=n(74848);const P=500;function E(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>=P?e:[...e,...n].slice(0,P))},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,N.jsxs)("div",{className:"file-deep-search",children:[(0,N.jsxs)("div",{className:"file-deep-search__bar",children:[(0,N.jsx)(h.$Z,{icon:"search",value:l,placeholder:t("搜文件名"),handleInputChange:e=>c(e),handleEnterPress:k}),(0,N.jsx)("button",{className:"button button--flat",onClick:d?()=>{x.sendData(G.HK.file_deep_search_cancel,{}).catch(()=>{}),_(!1)}:k,children:t(d?"取消":"搜索")})]}),(0,N.jsxs)("div",{className:"file-deep-search__hint",children:[(0,N.jsxs)("span",{children:[t("范围"),":",j]}),u>0&&(0,N.jsx)("span",{className:"file-deep-search__count",children:u>P?`${t("已显示")} 500 / ${u}`:`${u}`})]}),(0,N.jsxs)("div",{className:"file-deep-search__body",children:[p.length>0&&(0,N.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,N.jsx)("span",{className:"file-deep-search__dir",children:e.name}):e.name,(0,N.jsx)(D.xP,{context:n}),(0,N.jsx)($.rA,{icon:"folder_open",title:t("打开所在目录"),onClick:()=>A(e)})]})}),d&&(0,N.jsxs)("div",{className:"file-deep-search__empty",children:[(0,N.jsx)("span",{className:"chat-session-running",title:t("搜索中")}),t("搜索中")]}),!d&&u>P&&(0,N.jsx)("div",{className:"file-deep-search__more",children:t("结果过多")}),!d&&0===p.length&&(0,N.jsx)("div",{className:"file-deep-search__empty",children:t(v?"无匹配":"输入后搜")})]})]})}var F=n(23496),I=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,P]=(0,o.fp)(a.AG.copyedFileList),[E,F]=(0,o.fp)(a.AG.cutedFileList),[R,H]=(0,o.fp)(a.AG.selectedFileList),[L,U]=(0,o.fp)(a.AG.clickFileList),[Y,B]=(0,o.fp)(a.AG.fileShellShow),[O]=(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)(()=>()=>{B({show:!1,path:""})},[]);const me=(0,f.Vs)(),we=t=>{pe({open:!0,title:e("信息"),context_div:(0,N.jsxs)("div",{style:{maxWidth:"25rem"},children:[(0,N.jsx)(X.Yh,{left:e("挂载位置磁盘"),right:t?.total_size}),(0,N.jsx)(X.Yh,{left:`${e("磁盘剩余")}`,right:t?.left_size}),(0,N.jsx)(X.Yh,{left:`${e("文件系统")}`,right:t?.fs_type}),(0,N.jsx)(X.Yh,{left:`${e("文件夹数")}`,right:he}),(0,N.jsx)(X.Yh,{left:`${e("文件数")}`,right:fe}),(0,N.jsx)(X.Yh,{left:`${e("当前位置")}`,right:(0,N.jsx)(D.xP,{context:t?.now_absolute_path})})]}),cancel:()=>{k.ws.removeMsg(G.HK.file_info)}})};return(0,N.jsxs)(i.Fragment,{children:[C.length>0&&(0,N.jsx)($.rA,{icon:"delete",title:e("删除"),onClick:()=>{j({show:!0,type:d.PromptEnum.FilesDelete,overlay:!0,data:{}})}}),C.length>0&&(0,N.jsx)($.rA,{icon:"content_copy",title:e("复制"),onClick:function(){const e=(0,f.ib)(c,C);P(e.map(e=>(0,f.Ok)(e.name))),F([]),ue("已复制")}}),C.length>0&&(0,N.jsx)($.rA,{icon:"content_cut",title:e("剪切"),onClick:function(){const e=(0,f.ib)(c,C);F(e.map(e=>(0,f.Ok)(e.name))),P([]),ue("已剪切")}}),(z.length>0||E.length>0)&&(0,N.jsx)($.rA,{onClick:function(){j({show:!0,type:d.PromptEnum.Confirm,overlay:!0,data:{}})},icon:"content_paste",title:e("粘贴到此处"),tip:z.length+E.length}),C.length>0&&(0,N.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,N.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,N.jsx)($.rA,{icon:"edit_attributes",title:e("重命名"),onClick:function(){j({show:!0,type:d.PromptEnum.FileRename,overlay:!0,data:{}})}}),oe&&(0,N.jsx)($.rA,{icon:"api",title:"workflow",onClick:()=>{ne(!te)}}),!O&&(0,N.jsx)($.rA,{icon:"terminal",title:"shell",onClick:function(){Y.show?B({show:!1,path:""}):B({show:!0,path:(0,_.GG)("file",(0,_.vX)())})}}),s(A.oV.share_file)&&(0,N.jsx)($.rA,{icon:"share",title:e("文件分享"),onClick:()=>{n(`${S.o.share_list_setting_page}`)}}),(0,N.jsx)($.rA,{icon:"grid_view",title:e("切换样式"),onClick:me}),(0,N.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,N.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,N.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,I.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,N.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,N.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([]),U([])})(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),U=n(21499),Y=n(64694),B=n(17903);const O=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),[,D]=(0,o.fp)(a.AG.excalidraw_editor),[,P]=(0,o.fp)(a.AG.mind_editor),[I,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,De]=(0,o.fp)(a.AG.file_page),[Ne]=(0,o.fp)(a.AG.blank_search_mode),[,Pe]=(0,o.fp)(a.AG.prompt_card),[Ee,Fe]=(0,o.fp)(a.AG.blank_search_mode_for_temp),Ie=(0,f.oT)(),Xe="1"===be.get("chat_open"),Re=Ge(A.oV.ai_agent_page);(0,i.useEffect)(()=>{je?.user_data&&Xe&&!Re&&Ie("chat_open",null)},[Xe,Re,je]);const[Ke,He]=(0,o.fp)(a.AG.studio_chat_width),Le=i.useRef(null),[Ue,Ye]=(0,i.useState)(!1),[Be,Oe]=(0,i.useState)(void 0),Ze=(0,f.dN)(),[We,Te]=(0,o.fp)(a.AG.ai_chat_session_by_cwd),Ve=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,D]=(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,N.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,N.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,N.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,N.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,N.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,N.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,N.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,N.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,N.jsx)("span",{style:(0,R.ok)(!e.user_data.dir_show_type),children:n("系统默认")}),v:A.t8.defualt},{r:(0,N.jsx)("span",{style:(0,R.ok)(e.user_data.dir_show_type===A.t8.name),children:n("名字")}),v:A.t8.name},{r:(0,N.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,N.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,N.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 D(!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(F.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})}}(),qe=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)},Je=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,U.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(()=>{qe()})),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,U.Yq)(n.mtime):"":n.show_mtime=n.mtime?(0,y.s)(n.mtime):"",n.name===j.SB&&(t=!0);xe(t)},Qe=i.useRef(null),et=async e=>{if(!0===ne){if(Qe.current!==e){Qe.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)},tt=async()=>{const e=(0,_.GG)("file",(0,_.vX)());if(Ne||Ee)return;let t;if(et(e),je.user_data.file_list_pagination_mode===A.yM.pagination){if(V!==e){if(V=e,1!==ze.page_num)return void De({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 Je(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 De({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),Je(t.data),ee(t.data),T=t.data};(0,i.useEffect)(()=>async()=>{$e(new Set)},[]);const nt=()=>{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,Y.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({}),D({}),P({}),tt())};(0,i.useEffect)(()=>{nt()},[q,ze]),(0,i.useEffect)(()=>{te>0&&tt()},[te]);const it=i.useRef(!1);(0,i.useEffect)(()=>{if(null!==ne)return it.current?void(!0===ne?et((0,_.GG)("file",(0,_.vX)())):se(null)):(it.current=!0,void(!0===ne&&null===ie&&et((0,_.GG)("file",(0,_.vX)()))))},[ne]);const st=e=>{e.target===e.currentTarget&&(re([]),de([]))},ot=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),[]),at=()=>{Ye(!1),document.removeEventListener("pointermove",ot)},lt=(0,N.jsxs)("div",{className:"file-list-main",children:[(0,N.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),De({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,N.jsxs)("div",{className:"mount-tip-bar",style:{borderLeftColor:ie.color},children:[(0,N.jsx)("span",{className:"material-icons",style:{color:ie.color},children:"cloud"}),(0,N.jsx)("span",{children:[ie.credential_note,ie.account_note||(B.C1.find(e=>e.value===ie.driver)?.title??ie.driver),ie.name].filter(Boolean).join(" - ")}),ie.readonly&&(0,N.jsx)("span",{className:"mount-readonly-tag",children:K("只读")})]}),je.user_data.file_list_pagination_mode===A.yM.pagination?(0,N.jsx)(C.$J,{handleContextMenu:Ve,clickBlank:st,list:Q.files}):(0,N.jsx)(C.t$,{handleContextMenu:Ve,file_list:Q.files,folder_list:Q.folders,clickBlank:st})]});return(0,N.jsxs)(i.Fragment,{children:[(0,N.jsx)(c.aZ,{children:(0,N.jsx)(h.$Z,{handleEnterPress:async()=>{if(Ne||Ee){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),Je(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)());Pe({open:!0,title:K("深搜"),context_div:(0,N.jsx)(E,{base_path:e})})},handleInputChange:e=>{he(e)},max_width:"25em"})}),(0,N.jsxs)(c.aZ,{position:"right",children:[Ge(A.oV.ai_agent_page)&&(0,N.jsx)($.rA,{icon:"smart_toy",title:K("AI 聊天"),selected:Xe,onClick:()=>Ie("chat_open",!Xe?"1":null)}),(0,N.jsx)("div",{className:"mobile-context-btn",children:(0,N.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,Y.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};Ve(e)}}})}),(0,N.jsx)(H,{})]}),(0,N.jsxs)("div",{className:"file-list-split"+(Xe?" file-list-split--chat":""),children:[lt,Xe&&(0,N.jsxs)(i.Fragment,{children:[(0,N.jsx)("div",{className:"studio__divider studio__divider--chat",ref:Le,onPointerDown:e=>{e.preventDefault(),Ye(!0),document.addEventListener("pointermove",ot),document.addEventListener("pointerup",at,{once:!0})}}),(0,N.jsx)("div",{className:"studio-chat-panel",style:{width:`${Ke}em`},children:(0,N.jsx)(i.Suspense,{fallback:null,children:(0,N.jsx)(W,{inline_header:!0,sync_url:!1,file_cwd_path:Ze(),session_id:Be??(rt=Ze(),a.AG.get_ai_chat_session(We,rt)),on_session_change:e=>{Oe(e),((e,t)=>{Te({...We,[e]:t})})(Ze(),e)}})})})]})]}),Ue&&(0,N.jsx)("div",{className:"shell__overlay",onPointerUp:at}),ue&&(0,N.jsx)(O,{}),we.open&&(0,N.jsx)(Z,{})]});var rt}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[9334],{89117(t,e,n){n.d(e,{Hm:()=>s,U6:()=>c});const r=["mermaid","svg"];function s(t){return r.includes(t)}let o=null;let i=0;async function a(t){const e=t.trim();if(!e)return{svg:"",error:null};const r=await(o||(o=n.e(2300).then(n.bind(n,62300)).then(t=>{const e=t.default;return e.initialize({startOnLoad:!1,securityLevel:"loose",theme:"default",fontFamily:"inherit",suppressErrorRendering:!0}),e})),o),s="md-mermaid-"+ ++i;try{const{svg:t}=await r.render(s,e);return{svg:t,error:null}}catch(t){return document.getElementById(s)?.remove(),document.getElementById(`d${s}`)?.remove(),{svg:"",error:t?.message??String(t)}}}async function c(t,e){return"svg"===t?function(t){const e=t.trim();if(!e)return{svg:"",error:null};const n=(new DOMParser).parseFromString(e,"image/svg+xml").querySelector("parsererror");return n?{svg:"",error:n.textContent?.trim()||"SVG 解析失败"}:{svg:e,error:null}}(e):a(e)}},41105(t,e,n){n.d(e,{KR:()=>u,Ne:()=>c,op:()=>b,pC:()=>a,sL:()=>d});var r=n(14284),s=n(19878),o=n(89117),i=n(86063);function a(t){return btoa(unescape(encodeURIComponent(t)))}function c(t){return decodeURIComponent(escape(atob(t)))}let l="";function d(t){l=t||""}function u(t){if(/^(https?:|data:|blob:|\/\/|\/)/i.test(t))return t;const e=t.replace(/^\.\//,"");return r.$M.getDownloadUrl(l+e)}const h=new Set(["a","abbr","b","blockquote","br","code","dd","del","details","div","dl","dt","em","h1","h2","h3","h4","h5","h6","hr","i","img","ins","kbd","li","mark","ol","p","pre","q","s","samp","small","span","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","tr","u","ul","var","wbr"]),m=new Set(["align","alt","border","cellpadding","cellspacing","class","colspan","height","href","id","rowspan","src","style","target","title","valign","width"]);function p(t){const e=(new DOMParser).parseFromString(`<div>${t}</div>`,"text/html").body.firstElementChild,n=document.createDocumentFragment();if(!e)return n;const r=(t,e)=>{t.childNodes.forEach(t=>{if(t.nodeType===Node.TEXT_NODE)return void e.appendChild(document.createTextNode(t.textContent??""));if(t.nodeType!==Node.ELEMENT_NODE)return;const n=t;if(!h.has(n.tagName.toLowerCase()))return void r(n,e);const s=document.createElement(n.tagName.toLowerCase());for(const t of Array.from(n.attributes)){const e=t.name.toLowerCase();e.startsWith("on")||(m.has(e)||e.startsWith("data-"))&&("href"!==e&&"src"!==e||!/^\s*javascript:/i.test(t.value))&&("src"!==e?s.setAttribute(e,t.value):s.setAttribute(e,u(t.value)))}r(n,s),e.appendChild(s)})};return r(e,n),n}class f{dom;node;view;get_pos;render_box;source_box;source_input;source_hl;source_hl_code;mode="preview";draft=null;constructor(t,e,n){this.node=t,this.view=e,this.get_pos=n,this.dom=document.createElement("div"),this.dom.className="md-html-block",this.dom.setAttribute("data-mode","preview"),this.render_box=document.createElement("div"),this.render_box.className="md-html-block__render",this.source_box=document.createElement("div"),this.source_box.className="md-html-block__source",this.source_input=document.createElement("textarea"),this.source_input.className="md-html-block__input",this.source_input.setAttribute("spellcheck","false"),this.source_input.setAttribute("wrap","off"),this.source_hl=document.createElement("pre"),this.source_hl.className="md-html-block__highlight",this.source_hl.setAttribute("aria-hidden","true");const r=document.createElement("code");this.source_hl.appendChild(r),this.source_hl_code=r,this.source_box.append(this.source_hl,this.source_input);const s=document.createElement("span");s.className="md-html-block__toggle",s.setAttribute("contenteditable","false"),s.textContent="HTML",s.addEventListener("mousedown",t=>{t.preventDefault(),t.stopPropagation(),this.toggle_mode()}),this.source_input.addEventListener("blur",()=>this.commit()),this.source_input.addEventListener("keydown",t=>{"Escape"===t.key&&(t.preventDefault(),this.draft=null,this.toggle_mode()),t.stopPropagation()}),this.source_input.addEventListener("input",()=>{this.draft=this.source_input.value,this.paint_highlight(),this.source_hl.scrollLeft=this.source_input.scrollLeft}),this.source_hl.addEventListener("scroll",()=>{this.source_input.scrollLeft=this.source_hl.scrollLeft});for(const t of["beforeinput","paste","input","keyup","keypress"])this.source_input.addEventListener(t,t=>t.stopPropagation());this.dom.append(this.render_box,this.source_box,s),this.render_box.replaceChildren(p(t.attrs.value)),this.set_source_value(t.attrs.value)}set_source_value(t){this.source_input.value=t,this.paint_highlight()}paint_highlight(){const t=this.source_input.value;this.source_hl_code.innerHTML=s.A.highlight(t+"\n",{language:"xml",ignoreIllegals:!0}).value}toggle_mode(){if("source"===this.mode)return this.commit(),this.mode="preview",void this.dom.setAttribute("data-mode","preview");this.mode="source",this.dom.setAttribute("data-mode","source"),this.set_source_value(this.node.attrs.value),this.draft=null,this.source_input.focus()}commit(){if(null===this.draft)return;const t=this.draft;if(this.draft=null,t===this.node.attrs.value)return;const e=this.get_pos(),n=this.view.state.doc.nodeAt(e);n&&this.view.dispatch(this.view.state.tr.setNodeMarkup(e,void 0,{...n.attrs,value:t}))}update(t){return t.type===this.node.type&&(this.node=t,null===this.draft&&(this.render_box.replaceChildren(p(t.attrs.value)),"preview"===this.mode&&this.set_source_value(t.attrs.value)),!0)}stopEvent(t){return this.dom.contains(t.target)}ignoreMutation(){return!0}}class g{dom;node;view;get_pos;constructor(t,e,n){this.node=t,this.view=e,this.get_pos=n,this.dom=document.createElement("span"),this.dom.className="md-html-inline",this.dom.setAttribute("contenteditable","true"),this.dom.textContent=t.attrs.value,this.dom.addEventListener("blur",()=>this.commit());for(const t of["beforeinput","paste","input"])this.dom.addEventListener(t,t=>t.stopPropagation())}commit(){const t=this.dom.textContent??"";if(t===this.node.attrs.value)return;const e=this.get_pos(),n=this.view.state.doc.nodeAt(e);n&&this.view.dispatch(this.view.state.tr.setNodeMarkup(e,void 0,{...n.attrs,value:t}))}update(t){return t.type===this.node.type&&(this.node=t,!0)}stopEvent(t){return this.dom.contains(t.target)}ignoreMutation(){return!0}}function _(t){const e=t.split(/[?#]/)[0].toLowerCase();return e.endsWith(".mermaid")?"mermaid":e.endsWith(".mind")?"mind":null}class v{dom;node;kind;src;mind_unmount=null;constructor(t){this.node=t,this.src=t.attrs.src,this.kind=_(this.src),this.dom=this.kind?this.build_graph():this.build_image()}build_image(){const t=document.createElement("img");t.src=u(this.src),t.alt=this.node.attrs.alt??"";const e=this.node.attrs.title;return e&&(t.title=e),t}build_graph(){const t=document.createElement("span");t.className="md-graph md-graph--file",t.setAttribute("contenteditable","false");const e=document.createElement("span");return e.className="md-graph__body",t.append(e),this.render_graph_body(e),t}render_graph_body(t){const e=u(this.src);t.textContent="loading",fetch(e).then(t=>t.text()).then(async e=>{if(!this.dom.isConnected)return;if("mermaid"===this.kind){const n=await(0,o.U6)("mermaid",e);if(!t.isConnected)return;return n.error?(this.dom.classList.add("md-graph--error"),void(t.textContent=n.error)):void(t.innerHTML=n.svg)}const n=await(0,i.Hn)(e);if(!this.dom.isConnected)return;this.dom.classList.add("md-graph--mind"),t.remove(),this.dom.textContent="";const r=await n.mount(this.dom);this.mind_unmount=()=>r.destroy()}).catch(()=>{t.isConnected&&(this.dom.classList.add("md-graph--error"),t.textContent="load failed")})}update(t){if(t.type!==this.node.type)return!1;this.node=t;const e=t.attrs.src;if(e!==this.src){this.destroy_instance(),this.src=e,this.kind=_(e);const t=this.kind?this.build_graph():this.build_image();this.dom.replaceWith(t),this.dom=t}else if(!this.kind){const e=this.dom;e.alt=t.attrs.alt??"";const n=t.attrs.title;n&&(e.title=n)}return!0}destroy_instance(){this.mind_unmount?.(),this.mind_unmount=null}destroy(){this.destroy_instance()}stopEvent(t){return!!this.kind&&this.dom.contains(t.target)}ignoreMutation(){return!0}}function b(){return{html_block:(t,e,n)=>new f(t,e,n),html_inline:(t,e,n)=>new g(t,e,n),image:t=>new v(t)}}},89334(t,e,n){n.d(e,{Rh:()=>p,V:()=>a,lG:()=>o,rg:()=>f,z$:()=>u});var r=n(41105);n(6704);const s=["math","latex","katex"];function o(t){return s.includes(t.toLowerCase())}const i=[{open:"$$",close:"$$",mode:"block"},{open:"\\[",close:"\\]",mode:"block"},{open:"\\(",close:"\\)",mode:"inline"},{open:"$",close:"$",mode:"inline"}];function a(t){const e=t.trim();if(!e)return null;for(const t of i){if(e.length<=t.open.length+t.close.length)continue;if(!e.startsWith(t.open)||!e.endsWith(t.close))continue;const n=e.slice(t.open.length,e.length-t.close.length);if(("$"!==t.open||!e.startsWith("$$"))&&n.trim())return{tex:n,mode:t.mode,raw:e}}return null}let c=null;const l=new Map;async function d(t,e){const r=t.trim();if(!r)return{html:"",error:null};const s=`${e}\0${r}`,o=l.get(s);if(o)return o;let i;try{const{renderToString:t}=await(c||(c=n.e(2130).then(n.bind(n,99749))),c);i={html:t(r,{displayMode:"block"===e,throwOnError:!1,strict:!1,trust:!1,output:"html"}),error:null}}catch(t){i={html:"",error:t?.message??String(t)}}return l.size>=500&&l.clear(),l.set(s,i),i}async function u(t,e,n,r){const s=await d(e,n);if(t.isConnected){if(t.classList.remove("md-math--loading","md-math--error"),s.error)return t.classList.add("md-math--error"),t.textContent=r,void(t.title=s.error);t.innerHTML=s.html}}function h(t,e){const n=t.pos,r=t.src;if(r.startsWith("$$",n))return!1;const s=[{open:"\\(",close:"\\)"},{open:"$",close:"$"}];for(const o of s){if(!r.startsWith(o.open,n))continue;const s=n+o.open.length,i=r.indexOf(o.close,s);if(i<0)continue;const a=r.slice(s,i);if(a.trim()){if("$"===o.open){const t=r[i+1];if(void 0!==t&&/\d/.test(t))continue}if(!e){const e=t.push("math_inline","span",0);e.content=a,e.markup=o.open,e.meta={raw:r.slice(n,i+o.close.length)}}return t.pos=i+o.close.length,!0}}return!1}function m(t,e,n,r){const s=t.bMarks[e]+t.tShift[e],o=t.eMarks[e],i=t.src.slice(s,o).trim(),a=[{open:"\\[",close:"\\]"},{open:"$$",close:"$$"}];for(const o of a){if(!i.startsWith(o.open))continue;if(i.endsWith(o.close)&&i.length>o.open.length+o.close.length){if(r)return!0;const n=t.push("math_block","div",0);return n.content=i.slice(o.open.length,i.length-o.close.length),n.markup=o.open,n.meta={raw:i},n.map=[e,e+1],t.line=e+1,!0}const a=i.slice(o.open.length);for(let i=e+1;i<n;i++){const n=t.bMarks[i]+t.tShift[i],c=t.eMarks[i],l=t.src.slice(n,c);if(!l.trimEnd().endsWith(o.close))continue;if(r)return!0;const d=[];a.trim()&&d.push(a),t.getLines(e+1,i,t.tShift[e],!1).split("\n").forEach(t=>d.push(t)),d.push(l.trimEnd().slice(0,-o.close.length));const u=t.push("math_block","div",0);return u.content=d.join("\n").trim(),u.markup=o.open,u.meta={raw:t.src.slice(s,t.eMarks[i]).trimEnd()},u.map=[e,i+1],t.line=i+1,!0}}return!1}function p(t,e){t.inline.ruler.before("escape","math_inline",h),t.block.ruler.before("fence","math_block",m,{alt:["paragraph","reference","blockquote","list"]}),t.renderer.rules.math_inline=(t,n)=>`<span data-math-inline="${e(t[n].meta.raw)}"></span>`,t.renderer.rules.math_block=(t,n)=>`<div data-math-block="${e(t[n].meta.raw)}"></div>`;const n=t.renderer.rules.fence||function(t,e,n,r,s){return s.renderToken(t,e,n)};t.renderer.rules.fence=(t,r,s,i,a)=>o(t[r].info.trim())?`<div data-math-block="${e(`$$\n${t[r].content.trim()}\n$$`)}"></div>`:n(t,r,s,i,a)}async function f(t){const e=t.querySelectorAll("[data-math-inline], [data-math-block]");for(const t of Array.from(e)){const e=t.getAttribute("data-math-inline"),n=t.getAttribute("data-math-block"),s=e??n;if(null===s)continue;const o=a((0,r.Ne)(s));if(!o)continue;const i=null!==e?"inline":"block";t.classList.add("md-math","block"===i?"md-math--block":"md-math--inline"),await u(t,o.tex,i,o.raw)}}},86063(t,e,n){function r(t){return"smm-mind"===t}n.d(e,{Hn:()=>d,hj:()=>r,tW:()=>i});const s={mousewheelMoveStep:35,scaleRatio:.08};let o=null;function i(t){return t&&"object"==typeof t?t.data?.nodeData?a(t.data.nodeData):t.root&&"object"==typeof t.root?t.root.data?t.root:c(t.root):t.data&&"object"==typeof t.data?t:c(t):null}function a(t){return{data:{text:"string"==typeof t?.topic?t.topic:"string"==typeof t?.data?.text?t.data.text:""},children:Array.isArray(t?.children)?t.children.map(a):[]}}function c(t){return{data:{text:"string"==typeof t?.text?t.text:"",...t?.note?{note:t.note}:{}},children:Array.isArray(t?.children)?t.children.map(c):[]}}function l(t){t.stopPropagation()}async function d(t){const e=function(t){const e=t.trim();if(!e)return null;let n=null;try{n=JSON.parse(e)}catch{return null}return i(n)}(t),r=await(o||(o=Promise.all([n.e(1417).then(n.bind(n,21417)),n.e(8781).then(n.bind(n,88781))]).then(([t])=>t.default)),o);return{data:e,async mount(t,n){let o=!1;const i=await function(t,e){return new Promise(n=>{const r=()=>{e()?n(!1):t.isConnected&&t.clientWidth&&t.clientHeight?n(!0):window.setTimeout(r,16)};r()})}(t,()=>o);if(!i)return{destroy:()=>{},get_data:()=>null};const a=document.createElement("div");a.className="md-graph__mind-host",!1!==n?.release_wheel&&t.addEventListener("wheel",l,{capture:!0,passive:!0}),t.append(a);const c=new r({el:a,data:e??{data:{text:""}},readonly:!n?.editable,fit:!0,...s});return{destroy:()=>{o=!0,t.removeEventListener("wheel",l,{capture:!0}),c?.destroy?.()},get_data:()=>c?.getData?.(!1)}}}}n.d(e,["k$",0,s])}}]);