filecat 7.9.0 → 7.10.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 (125) hide show
  1. package/LICENSE +201 -201
  2. package/README.md +182 -182
  3. package/build/dist/{4967.3fd3bd40a2b5a3b52428.js → 1060.198d91e2dfc174317c3a.js} +1 -1
  4. package/build/dist/1075.05eed88707339ca32044.js +1 -0
  5. package/build/dist/{1142.121454b1de53689b7367.js → 1142.bc43fae2e5e38d9359df.js} +1 -1
  6. package/build/dist/1384.edbad9c24d883a59724d.js +1 -0
  7. package/build/dist/1417.d390b18dd58ff5c28160.js +1 -0
  8. package/build/dist/1448.4db495e1389c0c8445b3.js +1 -0
  9. package/build/dist/{3324.22efcb1c431177b1cf5f.js → 1455.26a021eb94e5bdd5bec2.js} +1 -1
  10. package/build/dist/{1636.b6a17252dfd0d22f09a7.js → 1636.b80b1883358e132d3424.js} +1 -1
  11. package/build/dist/{1832.8ea5c3e8288df0b7fd5c.js → 1832.a01933ba5df99576ecc2.js} +1 -1
  12. package/build/dist/2300.c99b1dd4e752cdfd5e32.js +2 -0
  13. package/build/dist/{2300.9e1baa1c0368abe53d96.js.LICENSE.txt → 2300.c99b1dd4e752cdfd5e32.js.LICENSE.txt} +1 -1
  14. package/build/dist/239.f570f06d4b9c020f1013.js +1 -0
  15. package/build/dist/{2479.dcc88b3370f0f1d66e02.js → 2479.294792ef5d360ad64abc.js} +1 -1
  16. package/build/dist/2542.26cb302b60de23166227.js +1 -0
  17. package/build/dist/{259.81bb9e049e5ef587a96f.js → 259.3c0eb22e9b43ffb63c9c.js} +1 -1
  18. package/build/dist/2626.3bcfe1f26d9cb796a925.js +1 -0
  19. package/build/dist/{2674.7fd28dae86ccdb247851.js → 2674.15ca3c6ac911cf6e6e2f.js} +1 -1
  20. package/build/dist/3233.43bdd7c12ca829d56116.js +1 -0
  21. package/build/dist/3299.6ab0d94f02171cd762cc.js +1 -0
  22. package/build/dist/{6992.f6a07311a638794c24f7.js → 3471.ef3b5dcfe37963034187.js} +1 -1
  23. package/build/dist/{3528.56eeefab6fca5884e2a6.js → 3528.0f8f34028d92fa87c518.js} +1 -1
  24. package/build/dist/{3659.8a31495bb8f38c0ffa7c.js → 3659.dd03dc2ac52a3ff19105.js} +1 -1
  25. package/build/dist/4004.f0193c43fb891fdfb0e4.js +1 -0
  26. package/build/dist/{4560.8ef2e4b60cc86d019dd6.js → 4560.fd9f8cf2d6022b1d3a94.js} +1 -1
  27. package/build/dist/{4903.b5451ed0802b3f7c07b2.js → 4903.070aaa53a243baf05133.js} +1 -1
  28. package/build/dist/{4946.c95d4f426146e0180172.js → 4946.d578f6ba367a742d80bf.js} +2 -2
  29. package/build/dist/4986.f244efce9cf6be21f846.js +1 -0
  30. package/build/dist/5272.1f0dfac07ba202e7d323.js +1 -0
  31. package/build/dist/{5308.052f45c15785487b3766.js → 5308.d1e5ccb49396fc1b026d.js} +1 -1
  32. package/build/dist/{5516.645e4a900df9bdc1806c.js → 5516.88521f3a3c7101c46df3.js} +1 -1
  33. package/build/dist/5614.43bdd7c12ca829d56116.js +1 -0
  34. package/build/dist/{5139.adf9574d9b54a216e041.js → 5709.81f43e3c021fafdfe36f.js} +1 -1
  35. package/build/dist/{5744.e9f1efb88a617b05b709.js → 5744.0f8a0432b73b2eb0a7ff.js} +1 -1
  36. package/build/dist/{5877.ca081c4798194230243c.js → 5877.98d0475aaf4058b9a715.js} +1 -1
  37. package/build/dist/{6247.917e3fbef5dc5fbaf937.js → 6247.525b0b68872036ac2fa6.js} +1 -1
  38. package/build/dist/{7520.fbb0bc2a05cf94e15418.js → 6322.552511b5cb12cd0c821c.js} +1 -1
  39. package/build/dist/6492.17ecd8515fa512ce9306.js +1 -0
  40. package/build/dist/{676.a75318a8b598d8daadf0.js → 676.356039ef6f28f96b8c8b.js} +1 -1
  41. package/build/dist/{6805.bf0c964ab84f0fcc78be.js → 6805.373ac0e7d6555e4a6459.js} +1 -1
  42. package/build/dist/{6919.8cf13c01184b7148b28e.js → 6919.c7cc8617b658198d4924.js} +1 -1
  43. package/build/dist/{7038.4e4fc8e405c56d3080e2.js → 7038.166f915547d27e4dc5e4.js} +1 -1
  44. package/build/dist/{7759.0b68912ff9ef10869f59.js → 7759.7cd3fe8e5d37df25804c.js} +1 -1
  45. package/build/dist/7873.e3098bc6f510e5bea55f.js +1 -0
  46. package/build/dist/7923.d44556578af4d3d7cea3.js +2 -0
  47. package/build/dist/{7943.19d2de387eeb7f513d8e.js → 7943.acf25a5e98dd13290985.js} +1 -1
  48. package/build/dist/8090.8977224618a14ae42159.js +2 -0
  49. package/build/dist/8302.ce97557b7cf7c8387942.js +1 -0
  50. package/build/dist/8319.6a6b9651c87a1bb4cbb9.js +1 -0
  51. package/build/dist/{8603.4142ce42c1635f493eca.js → 8603.f1cbcfd64cde885f9809.js} +1 -1
  52. package/build/dist/8649.d6055ad75975b803bbc1.js +1 -0
  53. package/build/dist/{8727.3628c746061aed7a4077.js → 8727.8658835acb7e0b6e5acc.js} +1 -1
  54. package/build/dist/{8765.a5633d054abb67142fc3.js → 8765.8758c290a6b132f2ce7f.js} +1 -1
  55. package/build/dist/8772.2c35012c25ac9eb5f74d.js +2 -0
  56. package/build/dist/{8772.e8f9731c1c061f1cdf56.js.LICENSE.txt → 8772.2c35012c25ac9eb5f74d.js.LICENSE.txt} +1 -1
  57. package/build/dist/8781.6bd14487d172e004e3d3.js +1 -0
  58. package/build/dist/{9299.6c06dad1abe098b61766.js → 9299.7358ccf05b1415ed7959.js} +1 -1
  59. package/build/dist/9334.a25983aafdcbde63ae5e.js +1 -0
  60. package/build/dist/{9546.e7206c968e92371ae2b1.js → 9546.2cecad04cf676a6616cd.js} +1 -1
  61. package/build/dist/dark.css +839 -839
  62. package/build/dist/filerobot-image-editor.min.js +42445 -42445
  63. package/build/dist/google-dark.css +2032 -2032
  64. package/build/dist/google.css +1719 -1719
  65. package/build/dist/index.html +1 -1
  66. package/build/dist/main.ab3398f34c41e61310ae.js +2 -0
  67. package/build/dist/{main.3a12152528aff6ae213a.js.LICENSE.txt → main.ab3398f34c41e61310ae.js.LICENSE.txt} +1 -1
  68. package/build/dist/rle.js +17867 -17867
  69. package/build/main.js +1 -1
  70. package/build/plugin/core.type.d.ts +62 -0
  71. package/build/threads.work.filecat.js +1 -1
  72. package/env +26 -26
  73. package/package.json +211 -211
  74. package/shell/build.js +161 -161
  75. package/shell/config/.babelrc +14 -14
  76. package/shell/config/base.webpack.config.js +78 -78
  77. package/shell/config/common-bin.config.js +44 -44
  78. package/shell/config/env.js +10 -10
  79. package/shell/config/prebuild-file-path.js +17 -17
  80. package/shell/config/webpack.exe.config.js +36 -36
  81. package/shell/config/webpack.npm.config.js +44 -44
  82. package/shell/config/webpack.web.config.js +152 -152
  83. package/shell/dev.js +51 -51
  84. package/shell/docker-build.sh +2 -2
  85. package/shell/filecat +1 -1
  86. package/shell/filecat-watch +1 -1
  87. package/shell/install.js +48 -48
  88. package/shell/net-agent/git-clone.bat +23 -23
  89. package/shell/net-agent/git-pull.bat +17 -17
  90. package/shell/net-agent/git-push.bat +17 -17
  91. package/shell/pkg.ts +50 -50
  92. package/shell/postinstall-optional.js +29 -29
  93. package/shell/start/filecat-install.sh +22 -22
  94. package/shell/start/filecat-run.sh +2 -2
  95. package/shell/start/windows-install.js +178 -178
  96. package/shell/start/windows-uninstall.js +131 -131
  97. package/shell/util/file.js +46 -46
  98. package/build/dist/1075.40103ec059c6b23b056e.js +0 -1
  99. package/build/dist/1384.0d0fc5faa899c9eddcbe.js +0 -1
  100. package/build/dist/1417.7e511043474084a2a65b.js +0 -1
  101. package/build/dist/1448.0710f04bed1c52e6a5db.js +0 -1
  102. package/build/dist/2300.9e1baa1c0368abe53d96.js +0 -2
  103. package/build/dist/2542.23fb13b1623c9f7c3fc1.js +0 -1
  104. package/build/dist/2626.05d1faa293e0a3318b9b.js +0 -1
  105. package/build/dist/2851.2195b5906b2c224c7bf7.js +0 -1
  106. package/build/dist/3140.794a212da633caf38b3a.js +0 -2
  107. package/build/dist/3233.fb6bffd5e097e4ac9423.js +0 -1
  108. package/build/dist/3299.f37767d30b6999df4014.js +0 -1
  109. package/build/dist/4004.5d68418ad5c2321cb11f.js +0 -1
  110. package/build/dist/4986.78047106f3a0d2d71199.js +0 -1
  111. package/build/dist/5272.0b70ee8ec5f083fb9f5b.js +0 -1
  112. package/build/dist/5614.fb6bffd5e097e4ac9423.js +0 -1
  113. package/build/dist/6492.3ee4060598de873d8e8f.js +0 -1
  114. package/build/dist/7756.2f851693ba030c42dde8.js +0 -1
  115. package/build/dist/7873.11d04b741d2b499d9cb9.js +0 -1
  116. package/build/dist/7923.861345fd55941e8089a1.js +0 -2
  117. package/build/dist/8014.28b5cf8c3787dc829aa4.js +0 -1
  118. package/build/dist/8302.5ae5bfe8baa0084204bb.js +0 -1
  119. package/build/dist/8319.c15a3674ec7abc493595.js +0 -1
  120. package/build/dist/8772.e8f9731c1c061f1cdf56.js +0 -2
  121. package/build/dist/8781.58f0c51870d3dd2689d7.js +0 -1
  122. package/build/dist/main.3a12152528aff6ae213a.js +0 -2
  123. /package/build/dist/{4946.c95d4f426146e0180172.js.LICENSE.txt → 4946.d578f6ba367a742d80bf.js.LICENSE.txt} +0 -0
  124. /package/build/dist/{7923.861345fd55941e8089a1.js.LICENSE.txt → 7923.d44556578af4d3d7cea3.js.LICENSE.txt} +0 -0
  125. /package/build/dist/{3140.794a212da633caf38b3a.js.LICENSE.txt → 8090.8977224618a14ae42159.js.LICENSE.txt} +0 -0
@@ -1,3 +1,3 @@
1
- /*! @license DOMPurify 3.4.16 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.16/LICENSE */
1
+ /*! @license DOMPurify 3.4.17 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.17/LICENSE */
2
2
 
3
3
  /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[239],{239(e,t,a){a.r(t),a.d(t,{default:()=>i});var i=async(e,t=[{}],a=null,i=!1,s=null)=>{Array.isArray(t)||(t=[t]),t[0].fileName=t[0].fileName||"Untitled";const c=[];let n=null;if(e instanceof Blob&&e.type?n=e.type:e.headers&&e.headers.get("content-type")&&(n=e.headers.get("content-type")),t.forEach((e,t)=>{c[t]={description:e.description||"",accept:{}},e.mimeTypes?(0===t&&n&&e.mimeTypes.push(n),e.mimeTypes.map(a=>{c[t].accept[a]=e.extensions||[]})):n&&(c[t].accept[n]=e.extensions||[])}),a)try{await a.getFile()}catch(e){if(a=null,i)throw e}const l=a||await window.showSaveFilePicker({suggestedName:t[0].fileName,id:t[0].id,startIn:t[0].startIn,types:c,excludeAcceptAllOption:t[0].excludeAcceptAllOption||!1});!a&&s&&s();const r=await l.createWritable();if("stream"in e){const t=e.stream();return await t.pipeTo(r),l}return"body"in e?(await e.body.pipeTo(r),l):(await r.write(await e),await r.close(),l)}}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[2479],{12479(e,t,n){n.r(t),n.d(t,{default:()=>d});var r=n(96540),a=n(57889),s=(n(14284),n(62042)),o=n(22022),c=n(21417),i=(n(88781),n(86063)),l=n(74848);function d(e){const{t}=(0,o.Bd)(),[n,d]=(0,r.useState)(!0),[m,p]=(0,r.useState)(""),[f,h]=(0,r.useState)(100),y=(0,r.useRef)(null),w=(0,r.useRef)(null),b=(0,r.useRef)(!1),x=(0,r.useRef)({props:e});x.current={props:e};const v=async()=>{if(!w.current)return(0,s.zN)(t("编辑器尚未就绪")),!1;const e=await x.current.props.on_save((()=>{const e=w.current;return e?JSON.stringify(e.getData(!0)):""})());return e&&(b.current=!1,x.current.props.on_dirty?.(!1),x.current.props.on_saved?.()),e};(0,r.useEffect)(()=>{e.register?.({save:v,is_dirty:()=>b.current})},[e.register]),(0,r.useEffect)(()=>{if(!y.current)return;if(!e.url&&void 0===e.data)return;let n=!1;const r=[];w.current?.destroy?.(),w.current=null,b.current=!1,d(!0),p("");const o=async e=>{if(n||!y.current)return;const a=new c.default({el:y.current,data:e??{data:{text:t("中心主题")}},fit:!0,...i.k$});w.current=a,d(!1);const s=()=>{let e=!1;const t=window.setTimeout(()=>{n||(e=!0)},400);r.push(t),a.on("data_change",()=>{e&&(b.current||(b.current=!0,x.current.props.on_dirty?.(!0)),h(u(a)))}),a.on("view_data_change",()=>{h(u(a))}),a.on("error",(e,t)=>{console.error("[mind]",e,t)}),h(u(a))};window.requestAnimationFrame(()=>{n||s()})};return(async()=>{try{let t=null;if(void 0!==e.data)t=e.data;else{const r=await a.l.get(e.url);if(n)return;t=r}let r=null;if("string"==typeof t&&t.trim())try{r=JSON.parse(t)}catch{r=null}else t&&"object"==typeof t&&(r=t);r=(0,i.tW)(r),await o(r)}catch(e){n||(d(!1),p(t("加载思维导图失败")),(0,s.zN)(t("加载思维导图失败")))}})(),()=>{n=!0,r.forEach(e=>window.clearTimeout(e)),w.current?.destroy?.(),w.current=null}},[e.url,e.data]),(0,r.useEffect)(()=>{const e=e=>{(e.ctrlKey||e.metaKey)&&("s"===e.key||"S"===e.key||83===e.keyCode)&&(e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),v())};return window.addEventListener("keydown",e,!0),document.addEventListener("keydown",e,!0),()=>{window.removeEventListener("keydown",e,!0),document.removeEventListener("keydown",e,!0)}},[]);const N=e=>{const t=w.current;if(!t)return;const n=Math.min(4,Math.max(.25,e));t.view.setScale(n),h(Math.round(100*n))};return(0,l.jsxs)("div",{className:"mind-wrap"+(e.fullscreen?" mind-wrap--full":""),children:[e.header,(0,l.jsxs)("div",{className:"mind-toolbar",children:[(0,l.jsx)("button",{type:"button",className:"mind-btn",title:t("添加子节点")+" (Tab)",onClick:()=>w.current?.execCommand?.("INSERT_CHILD_NODE"),children:(0,l.jsx)("span",{className:"material-icons",children:"account_tree"})}),(0,l.jsx)("button",{type:"button",className:"mind-btn",title:t("添加同级节点")+" (Enter)",onClick:()=>w.current?.execCommand?.("INSERT_NODE"),children:(0,l.jsx)("span",{className:"material-icons",children:"subdirectory_arrow_right"})}),(0,l.jsx)("button",{type:"button",className:"mind-btn",title:t("删除节点")+" (Delete)",onClick:()=>w.current?.execCommand?.("REMOVE_NODE"),children:(0,l.jsx)("span",{className:"material-icons",children:"delete"})}),(0,l.jsx)("span",{className:"mind-toolbar__gap"}),(0,l.jsxs)("span",{className:"mind-toolbar__zoom",children:[f,"%"]}),(0,l.jsx)("button",{type:"button",className:"mind-btn",title:t("缩小"),onClick:()=>N(u(w.current)/100-.2),children:(0,l.jsx)("span",{className:"material-icons",children:"remove"})}),(0,l.jsx)("button",{type:"button",className:"mind-btn",title:t("放大"),onClick:()=>N(u(w.current)/100+.2),children:(0,l.jsx)("span",{className:"material-icons",children:"add"})}),(0,l.jsx)("button",{type:"button",className:"mind-btn",title:t("适应窗口"),onClick:()=>w.current?.view?.fit?.(),children:(0,l.jsx)("span",{className:"material-icons",children:"fit_screen"})})]}),(0,l.jsxs)("div",{className:"mind-canvas",children:[(0,l.jsx)("div",{className:"mind-mount",ref:y}),n&&(0,l.jsx)("div",{className:"mind-mask",children:"Loading..."}),m&&(0,l.jsx)("div",{className:"mind-mask",children:m})]})]})}function u(e){const t=e?.view?.getTransformData?.()?.state?.scale;return"number"==typeof t&&t>0?Math.round(100*t):100}},86063(e,t,n){function r(e){return"smm-mind"===e}n.d(t,{Hn:()=>d,hj:()=>r,k$:()=>a,tW:()=>o});const a={mousewheelMoveStep:35,scaleRatio:.08};let s=null;function o(e){return e&&"object"==typeof e?e.data?.nodeData?c(e.data.nodeData):e.root&&"object"==typeof e.root?e.root.data?e.root:i(e.root):e.data&&"object"==typeof e.data?e:i(e):null}function c(e){return{data:{text:"string"==typeof e?.topic?e.topic:"string"==typeof e?.data?.text?e.data.text:""},children:Array.isArray(e?.children)?e.children.map(c):[]}}function i(e){return{data:{text:"string"==typeof e?.text?e.text:"",...e?.note?{note:e.note}:{}},children:Array.isArray(e?.children)?e.children.map(i):[]}}function l(e){e.stopPropagation()}async function d(e){const t=function(e){const t=e.trim();if(!t)return null;let n=null;try{n=JSON.parse(t)}catch{return null}return o(n)}(e),r=await(s||(s=Promise.all([n.e(1417).then(n.bind(n,21417)),n.e(8781).then(n.bind(n,88781))]).then(([e])=>e.default)),s);return{data:t,async mount(e,n){let s=!1;const o=await function(e,t){return new Promise(n=>{const r=()=>{t()?n(!1):e.isConnected&&e.clientWidth&&e.clientHeight?n(!0):window.setTimeout(r,16)};r()})}(e,()=>s);if(!o)return{destroy:()=>{},get_data:()=>null};const c=document.createElement("div");c.className="md-graph__mind-host",!1!==n?.release_wheel&&e.addEventListener("wheel",l,{capture:!0,passive:!0}),e.append(c);const i=new r({el:c,data:t??{data:{text:""}},readonly:!n?.editable,fit:!0,...a});return{destroy:()=>{s=!0,e.removeEventListener("wheel",l,{capture:!0}),i?.destroy?.()},get_data:()=>i?.getData?.(!1)}}}}}}]);
1
+ "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[2479],{12479(e,t,n){n.r(t),n.d(t,{default:()=>d});var r=n(96540),a=n(57889),s=(n(14284),n(62042)),o=n(22022),c=n(21417),i=(n(88781),n(86063)),l=n(74848);function d(e){const{t}=(0,o.Bd)(),[n,d]=(0,r.useState)(!0),[m,p]=(0,r.useState)(""),[f,h]=(0,r.useState)(100),y=(0,r.useRef)(null),w=(0,r.useRef)(null),b=(0,r.useRef)(!1),x=(0,r.useRef)({props:e});x.current={props:e};const v=async()=>{if(!w.current)return(0,s.zN)(t("编辑器尚未就绪")),!1;const e=await x.current.props.on_save((()=>{const e=w.current;return e?JSON.stringify(e.getData(!0)):""})());return e&&(b.current=!1,x.current.props.on_dirty?.(!1),x.current.props.on_saved?.()),e};(0,r.useEffect)(()=>{e.register?.({save:v,is_dirty:()=>b.current})},[e.register]),(0,r.useEffect)(()=>{if(!y.current)return;if(!e.url&&void 0===e.data)return;let n=!1;const r=[];w.current?.destroy?.(),w.current=null,b.current=!1,d(!0),p("");const o=async e=>{if(n||!y.current)return;const a=new c.default({el:y.current,data:e??{data:{text:t("中心主题")}},fit:!0,...i.k$});w.current=a,d(!1);const s=()=>{let e=!1;const t=window.setTimeout(()=>{n||(e=!0)},400);r.push(t),a.on("data_change",()=>{e&&(b.current||(b.current=!0,x.current.props.on_dirty?.(!0)),h(u(a)))}),a.on("view_data_change",()=>{h(u(a))}),a.on("error",(e,t)=>{console.error("[mind]",e,t)}),h(u(a))};window.requestAnimationFrame(()=>{n||s()})};return(async()=>{try{let t=null;if(void 0!==e.data)t=e.data;else{const r=await a.l.get(e.url);if(n)return;t=r}let r=null;if("string"==typeof t&&t.trim())try{r=JSON.parse(t)}catch{r=null}else t&&"object"==typeof t&&(r=t);r=(0,i.tW)(r),await o(r)}catch(e){n||(d(!1),p(t("加载思维导图失败")),(0,s.zN)(t("加载思维导图失败")))}})(),()=>{n=!0,r.forEach(e=>window.clearTimeout(e)),w.current?.destroy?.(),w.current=null}},[e.url,e.data]),(0,r.useEffect)(()=>{const e=e=>{(e.ctrlKey||e.metaKey)&&("s"===e.key||"S"===e.key||83===e.keyCode)&&(e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),v())};return window.addEventListener("keydown",e,!0),document.addEventListener("keydown",e,!0),()=>{window.removeEventListener("keydown",e,!0),document.removeEventListener("keydown",e,!0)}},[]);const N=e=>{const t=w.current;if(!t)return;const n=Math.min(4,Math.max(.25,e));t.view.setScale(n),h(Math.round(100*n))};return(0,l.jsxs)("div",{className:"mind-wrap"+(e.fullscreen?" mind-wrap--full":""),children:[e.header,(0,l.jsxs)("div",{className:"mind-toolbar",children:[(0,l.jsx)("button",{type:"button",className:"mind-btn",title:t("添加子节点")+" (Tab)",onClick:()=>w.current?.execCommand?.("INSERT_CHILD_NODE"),children:(0,l.jsx)("span",{className:"material-icons",children:"account_tree"})}),(0,l.jsx)("button",{type:"button",className:"mind-btn",title:t("添加同级节点")+" (Enter)",onClick:()=>w.current?.execCommand?.("INSERT_NODE"),children:(0,l.jsx)("span",{className:"material-icons",children:"subdirectory_arrow_right"})}),(0,l.jsx)("button",{type:"button",className:"mind-btn",title:t("删除节点")+" (Delete)",onClick:()=>w.current?.execCommand?.("REMOVE_NODE"),children:(0,l.jsx)("span",{className:"material-icons",children:"delete"})}),(0,l.jsx)("span",{className:"mind-toolbar__gap"}),(0,l.jsxs)("span",{className:"mind-toolbar__zoom",children:[f,"%"]}),(0,l.jsx)("button",{type:"button",className:"mind-btn",title:t("缩小"),onClick:()=>N(u(w.current)/100-.2),children:(0,l.jsx)("span",{className:"material-icons",children:"remove"})}),(0,l.jsx)("button",{type:"button",className:"mind-btn",title:t("放大"),onClick:()=>N(u(w.current)/100+.2),children:(0,l.jsx)("span",{className:"material-icons",children:"add"})}),(0,l.jsx)("button",{type:"button",className:"mind-btn",title:t("适应窗口"),onClick:()=>w.current?.view?.fit?.(),children:(0,l.jsx)("span",{className:"material-icons",children:"fit_screen"})})]}),(0,l.jsxs)("div",{className:"mind-canvas",children:[(0,l.jsx)("div",{className:"mind-mount",ref:y}),n&&(0,l.jsx)("div",{className:"mind-mask",children:"Loading..."}),m&&(0,l.jsx)("div",{className:"mind-mask",children:m})]})]})}function u(e){const t=e?.view?.getTransformData?.()?.state?.scale;return"number"==typeof t&&t>0?Math.round(100*t):100}},86063(e,t,n){function r(e){return"smm-mind"===e}n.d(t,{Hn:()=>d,hj:()=>r,tW:()=>o});const a={mousewheelMoveStep:35,scaleRatio:.08};let s=null;function o(e){return e&&"object"==typeof e?e.data?.nodeData?c(e.data.nodeData):e.root&&"object"==typeof e.root?e.root.data?e.root:i(e.root):e.data&&"object"==typeof e.data?e:i(e):null}function c(e){return{data:{text:"string"==typeof e?.topic?e.topic:"string"==typeof e?.data?.text?e.data.text:""},children:Array.isArray(e?.children)?e.children.map(c):[]}}function i(e){return{data:{text:"string"==typeof e?.text?e.text:"",...e?.note?{note:e.note}:{}},children:Array.isArray(e?.children)?e.children.map(i):[]}}function l(e){e.stopPropagation()}async function d(e){const t=function(e){const t=e.trim();if(!t)return null;let n=null;try{n=JSON.parse(t)}catch{return null}return o(n)}(e),r=await(s||(s=Promise.all([n.e(1417).then(n.bind(n,21417)),n.e(8781).then(n.bind(n,88781))]).then(([e])=>e.default)),s);return{data:t,async mount(e,n){let s=!1;const o=await function(e,t){return new Promise(n=>{const r=()=>{t()?n(!1):e.isConnected&&e.clientWidth&&e.clientHeight?n(!0):window.setTimeout(r,16)};r()})}(e,()=>s);if(!o)return{destroy:()=>{},get_data:()=>null};const c=document.createElement("div");c.className="md-graph__mind-host",!1!==n?.release_wheel&&e.addEventListener("wheel",l,{capture:!0,passive:!0}),e.append(c);const i=new r({el:c,data:t??{data:{text:""}},readonly:!n?.editable,fit:!0,...a});return{destroy:()=>{s=!0,e.removeEventListener("wheel",l,{capture:!0}),i?.destroy?.()},get_data:()=>i?.getData?.(!1)}}}}n.d(t,["k$",0,a])}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[2542],{72542(e,t,n){n.r(t);var s=n(1728),c=n(96540),a=n(34843),l=n(61443),i=n(85997),o=n(61973),u=n(14284),d=(n(23430),n(82893)),r=n(75725),f=n(22022),h=n(7523),p=n(62042),_=n(21469),m=n(74848);_.m.init();const x=function(){const e=(0,o.Zp)(),[t,n]=(0,c.useState)(""),[x,w]=(0,c.useState)(""),{initUserInfo:k}=(0,c.useContext)(h.F),[g,j]=(0,a.fp)(d.AG.custom_fun_opt),{t:C}=(0,f.Bd)();async function I(){const n={username:t,password:x},s=await u.wm.post("login",n,!1);0===s.code?(localStorage.setItem("token",s.data),k(),j(""),e("/file")):(0,p.zN)(s.message)}return(0,c.useEffect)(()=>{localStorage.getItem("token")&&e("/file")},[]),(0,m.jsxs)(r.Y5,{children:[(0,m.jsx)("h1",{children:_.m.web_site_title??"FileCat"}),(0,m.jsxs)("div",{className:"self_win_center_content",children:[(0,m.jsx)(l.Sm,{placeholder:C("账号"),handleInputChange:e=>{n(e)}}),(0,m.jsx)(l.cA,{placeholder:C("密码"),handleInputChange:e=>{w(e)},handleEnterPress:I}),(0,m.jsx)(i.$n,{text:C("登录"),clickFun:I}),s.A.has("tcp_client_num_id")&&(0,m.jsx)(i.$n,{text:C("代理退出"),clickFun:()=>{s.A.delete("tcp_client_num_id"),window.location.reload()}})]})]})};n.d(t,["default",0,x])}}]);
@@ -1 +1 @@
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(52671),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(52671),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(52671),M=a(99214),I=a(47022),B=a(88815),P=a(6960),R=a(79240),E=a(83529),$=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(67331);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
+ "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})}}}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[2626],{62718(n,o,e){"use strict";var t=e(31601),r=e.n(t),a=e(76314),l=e.n(a),i=e(4417),s=e.n(i),d=new URL(e(60840),e.b),c=l()(r()),m=s()(d);c.push([n.id,`.markdown-body {\n --base-size-16: 1rem;\n --base-size-24: 1.5rem;\n --base-size-4: 0.25rem;\n --base-size-40: 2.5rem;\n --base-size-8: 0.5rem;\n --base-text-weight-medium: 500;\n --base-text-weight-normal: 400;\n --base-text-weight-semibold: 600;\n --fontStack-monospace: ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace;\n --fontStack-sansSerif: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";\n --fgColor-accent: Highlight;\n}\n@media (prefers-color-scheme: dark) {\n .markdown-body, [data-theme="dark"] {\n /*dark */\n color-scheme: dark;\n --fgColor-accent: #4493f8;\n --bgColor-attention-muted: #bb800926;\n --bgColor-default: #0d1117;\n --bgColor-muted: #151b23;\n --bgColor-neutral-muted: #656c7633;\n --borderColor-accent-emphasis: #1f6feb;\n --borderColor-attention-emphasis: #9e6a03;\n --borderColor-danger-emphasis: #da3633;\n --borderColor-default: #3d444d;\n --borderColor-done-emphasis: #8957e5;\n --borderColor-success-emphasis: #238636;\n --color-prettylights-syntax-brackethighlighter-angle: #9198a1;\n --color-prettylights-syntax-brackethighlighter-unmatched: #f85149;\n --color-prettylights-syntax-carriage-return-bg: #b62324;\n --color-prettylights-syntax-carriage-return-text: #f0f6fc;\n --color-prettylights-syntax-comment: #9198a1;\n --color-prettylights-syntax-constant: #79c0ff;\n --color-prettylights-syntax-constant-other-reference-link: #a5d6ff;\n --color-prettylights-syntax-entity: #d2a8ff;\n --color-prettylights-syntax-entity-tag: #7ee787;\n --color-prettylights-syntax-keyword: #ff7b72;\n --color-prettylights-syntax-markup-bold: #f0f6fc;\n --color-prettylights-syntax-markup-changed-bg: #5a1e02;\n --color-prettylights-syntax-markup-changed-text: #ffdfb6;\n --color-prettylights-syntax-markup-deleted-bg: #67060c;\n --color-prettylights-syntax-markup-deleted-text: #ffdcd7;\n --color-prettylights-syntax-markup-heading: #1f6feb;\n --color-prettylights-syntax-markup-ignored-bg: #1158c7;\n --color-prettylights-syntax-markup-ignored-text: #f0f6fc;\n --color-prettylights-syntax-markup-inserted-bg: #033a16;\n --color-prettylights-syntax-markup-inserted-text: #aff5b4;\n --color-prettylights-syntax-markup-italic: #f0f6fc;\n --color-prettylights-syntax-markup-list: #f2cc60;\n --color-prettylights-syntax-meta-diff-range: #d2a8ff;\n --color-prettylights-syntax-storage-modifier-import: #f0f6fc;\n --color-prettylights-syntax-string: #a5d6ff;\n --color-prettylights-syntax-string-regexp: #7ee787;\n --color-prettylights-syntax-sublimelinter-gutter-mark: #3d444d;\n --color-prettylights-syntax-variable: #ffa657;\n --fgColor-attention: #d29922;\n --fgColor-danger: #f85149;\n --fgColor-default: #f0f6fc;\n --fgColor-done: #ab7df8;\n --fgColor-muted: #9198a1;\n --fgColor-success: #3fb950;\n --borderColor-muted: #3d444db3;\n --color-prettylights-syntax-invalid-illegal-bg: var(--bgColor-danger-muted);\n --color-prettylights-syntax-invalid-illegal-text: var(--fgColor-danger);\n --focus-outlineColor: var(--borderColor-accent-emphasis);\n --borderColor-neutral-muted: var(--borderColor-muted);\n }\n}\n@media (prefers-color-scheme: light) {\n .markdown-body, [data-theme="light"] {\n /*light */\n color-scheme: light;\n --fgColor-danger: #d1242f;\n --bgColor-attention-muted: #fff8c5;\n --bgColor-muted: #f6f8fa;\n --bgColor-neutral-muted: #818b981f;\n --borderColor-accent-emphasis: #0969da;\n --borderColor-attention-emphasis: #9a6700;\n --borderColor-danger-emphasis: #cf222e;\n --borderColor-default: #d1d9e0;\n --borderColor-done-emphasis: #8250df;\n --borderColor-success-emphasis: #1a7f37;\n --color-prettylights-syntax-brackethighlighter-angle: #59636e;\n --color-prettylights-syntax-brackethighlighter-unmatched: #82071e;\n --color-prettylights-syntax-carriage-return-bg: #cf222e;\n --color-prettylights-syntax-carriage-return-text: #f6f8fa;\n --color-prettylights-syntax-comment: #59636e;\n --color-prettylights-syntax-constant: #0550ae;\n --color-prettylights-syntax-constant-other-reference-link: #0a3069;\n --color-prettylights-syntax-entity: #6639ba;\n --color-prettylights-syntax-entity-tag: #0550ae;\n --color-prettylights-syntax-invalid-illegal-text: var(--fgColor-danger);\n --color-prettylights-syntax-keyword: #cf222e;\n --color-prettylights-syntax-markup-changed-bg: #ffd8b5;\n --color-prettylights-syntax-markup-changed-text: #953800;\n --color-prettylights-syntax-markup-deleted-bg: #ffebe9;\n --color-prettylights-syntax-markup-deleted-text: #82071e;\n --color-prettylights-syntax-markup-heading: #0550ae;\n --color-prettylights-syntax-markup-ignored-bg: #0550ae;\n --color-prettylights-syntax-markup-ignored-text: #d1d9e0;\n --color-prettylights-syntax-markup-inserted-bg: #dafbe1;\n --color-prettylights-syntax-markup-inserted-text: #116329;\n --color-prettylights-syntax-markup-list: #3b2300;\n --color-prettylights-syntax-meta-diff-range: #8250df;\n --color-prettylights-syntax-string: #0a3069;\n --color-prettylights-syntax-string-regexp: #116329;\n --color-prettylights-syntax-sublimelinter-gutter-mark: #818b98;\n --color-prettylights-syntax-variable: #953800;\n --fgColor-accent: #0969da;\n --fgColor-attention: #9a6700;\n --fgColor-done: #8250df;\n --fgColor-muted: #59636e;\n --fgColor-success: #1a7f37;\n --bgColor-default: #ffffff;\n --borderColor-muted: #d1d9e0b3;\n --color-prettylights-syntax-invalid-illegal-bg: var(--bgColor-danger-muted);\n --color-prettylights-syntax-markup-bold: #1f2328;\n --color-prettylights-syntax-markup-italic: #1f2328;\n --color-prettylights-syntax-storage-modifier-import: #1f2328;\n --fgColor-default: #1f2328;\n --focus-outlineColor: var(--borderColor-accent-emphasis);\n --borderColor-neutral-muted: var(--borderColor-muted);\n }\n}\n\n.markdown-body {\n /** CSS default easing. Use for hover state changes and micro-interactions. */\n /** Accelerating motion. Use for elements exiting the viewport (moving off-screen). */\n /** Smooth acceleration and deceleration. Use for elements moving or morphing within the viewport. */\n /** Decelerating motion. Use for elements entering the viewport or appearing on screen. */\n /** Constant motion with no acceleration. Use for continuous animations like progress bars or loaders. */\n -ms-text-size-adjust: 100%;\n -webkit-text-size-adjust: 100%;\n margin: 0;\n font-weight: var(--base-text-weight-normal, 400);\n color: var(--fgColor-default);\n background-color: var(--bgColor-default);\n font-family: var(--fontStack-sansSerif, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji");\n font-size: 16px;\n line-height: 1.5;\n word-wrap: break-word;\n}\n\n.markdown-body a {\n text-decoration: underline;\n text-underline-offset: .2rem;\n}\n\n.markdown-body .octicon {\n display: inline-block;\n fill: currentColor;\n vertical-align: text-bottom;\n}\n\n.markdown-body h1:hover .anchor .octicon-link:before,\n.markdown-body h2:hover .anchor .octicon-link:before,\n.markdown-body h3:hover .anchor .octicon-link:before,\n.markdown-body h4:hover .anchor .octicon-link:before,\n.markdown-body h5:hover .anchor .octicon-link:before,\n.markdown-body h6:hover .anchor .octicon-link:before {\n width: 16px;\n height: 16px;\n content: ' ';\n display: inline-block;\n background-color: currentColor;\n -webkit-mask-image: url(${m});\n mask-image: url(${m});\n}\n\n.markdown-body details,\n.markdown-body figcaption,\n.markdown-body figure {\n display: block;\n}\n\n.markdown-body summary {\n display: list-item;\n}\n\n.markdown-body [hidden] {\n display: none !important;\n}\n\n.markdown-body a {\n background-color: rgba(0,0,0,0);\n color: var(--fgColor-accent);\n text-decoration: none;\n}\n\n.markdown-body abbr[title] {\n border-bottom: none;\n -webkit-text-decoration: underline dotted;\n text-decoration: underline dotted;\n}\n\n.markdown-body b,\n.markdown-body strong {\n font-weight: var(--base-text-weight-semibold, 600);\n}\n\n.markdown-body dfn {\n font-style: italic;\n}\n\n.markdown-body h1 {\n margin: .67em 0;\n font-weight: var(--base-text-weight-semibold, 600);\n padding-bottom: .3em;\n font-size: 2em;\n border-bottom: 1px solid var(--borderColor-muted);\n}\n\n.markdown-body mark {\n background-color: var(--bgColor-attention-muted);\n color: var(--fgColor-default);\n}\n\n.markdown-body small {\n font-size: 90%;\n}\n\n.markdown-body sub,\n.markdown-body sup {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline;\n}\n\n.markdown-body sub {\n bottom: -0.25em;\n}\n\n.markdown-body sup {\n top: -0.5em;\n}\n\n.markdown-body img {\n border-style: none;\n max-width: 100%;\n box-sizing: content-box;\n}\n\n.markdown-body code,\n.markdown-body kbd,\n.markdown-body pre,\n.markdown-body samp {\n font-family: monospace;\n font-size: 1em;\n}\n\n.markdown-body figure {\n margin: 1em var(--base-size-40);\n}\n\n.markdown-body hr {\n box-sizing: content-box;\n overflow: hidden;\n background: rgba(0,0,0,0);\n border-bottom: 1px solid var(--borderColor-muted);\n height: .25em;\n padding: 0;\n margin: var(--base-size-24) 0;\n background-color: var(--borderColor-default);\n border: 0;\n}\n\n.markdown-body input {\n font: inherit;\n margin: 0;\n overflow: visible;\n font-family: inherit;\n font-size: inherit;\n line-height: inherit;\n}\n\n.markdown-body [type=button],\n.markdown-body [type=reset],\n.markdown-body [type=submit] {\n -webkit-appearance: button;\n appearance: button;\n}\n\n.markdown-body [type=checkbox],\n.markdown-body [type=radio] {\n box-sizing: border-box;\n padding: 0;\n}\n\n.markdown-body [type=number]::-webkit-inner-spin-button,\n.markdown-body [type=number]::-webkit-outer-spin-button {\n height: auto;\n}\n\n.markdown-body [type=search]::-webkit-search-cancel-button,\n.markdown-body [type=search]::-webkit-search-decoration {\n -webkit-appearance: none;\n appearance: none;\n}\n\n.markdown-body ::-webkit-input-placeholder {\n color: inherit;\n opacity: .54;\n}\n\n.markdown-body ::-webkit-file-upload-button {\n -webkit-appearance: button;\n appearance: button;\n font: inherit;\n}\n\n.markdown-body a:hover {\n text-decoration: underline;\n}\n\n.markdown-body ::placeholder {\n color: var(--fgColor-muted);\n opacity: 1;\n}\n\n.markdown-body hr::before {\n display: table;\n content: "";\n}\n\n.markdown-body hr::after {\n display: table;\n clear: both;\n content: "";\n}\n\n.markdown-body table {\n border-spacing: 0;\n border-collapse: collapse;\n display: block;\n width: max-content;\n max-width: 100%;\n overflow: auto;\n font-variant: tabular-nums;\n}\n\n.markdown-body td,\n.markdown-body th {\n padding: 0;\n}\n\n.markdown-body details summary {\n cursor: pointer;\n}\n\n.markdown-body a:focus,\n.markdown-body [role=button]:focus,\n.markdown-body input[type=radio]:focus,\n.markdown-body input[type=checkbox]:focus {\n outline: 2px solid var(--focus-outlineColor);\n outline-offset: -2px;\n box-shadow: none;\n}\n\n.markdown-body a:focus:not(:focus-visible),\n.markdown-body [role=button]:focus:not(:focus-visible),\n.markdown-body input[type=radio]:focus:not(:focus-visible),\n.markdown-body input[type=checkbox]:focus:not(:focus-visible) {\n outline: solid 1px rgba(0,0,0,0);\n}\n\n.markdown-body a:focus-visible,\n.markdown-body [role=button]:focus-visible,\n.markdown-body input[type=radio]:focus-visible,\n.markdown-body input[type=checkbox]:focus-visible {\n outline: 2px solid var(--focus-outlineColor);\n outline-offset: -2px;\n box-shadow: none;\n}\n\n.markdown-body a:not([class]):focus,\n.markdown-body a:not([class]):focus-visible,\n.markdown-body input[type=radio]:focus,\n.markdown-body input[type=radio]:focus-visible,\n.markdown-body input[type=checkbox]:focus,\n.markdown-body input[type=checkbox]:focus-visible {\n outline-offset: 0;\n}\n\n.markdown-body kbd {\n display: inline-block;\n padding: var(--base-size-4);\n font: 11px var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace);\n line-height: 10px;\n color: var(--fgColor-default);\n vertical-align: middle;\n background-color: var(--bgColor-muted);\n border: solid 1px var(--borderColor-neutral-muted);\n border-bottom-color: var(--borderColor-neutral-muted);\n border-radius: 6px;\n box-shadow: inset 0 -1px 0 var(--borderColor-neutral-muted);\n}\n\n.markdown-body h1,\n.markdown-body h2,\n.markdown-body h3,\n.markdown-body h4,\n.markdown-body h5,\n.markdown-body h6 {\n margin-top: var(--base-size-24);\n margin-bottom: var(--base-size-16);\n font-weight: var(--base-text-weight-semibold, 600);\n line-height: 1.25;\n}\n\n.markdown-body h2 {\n font-weight: var(--base-text-weight-semibold, 600);\n padding-bottom: .3em;\n font-size: 1.5em;\n border-bottom: 1px solid var(--borderColor-muted);\n}\n\n.markdown-body h3 {\n font-weight: var(--base-text-weight-semibold, 600);\n font-size: 1.25em;\n}\n\n.markdown-body h4 {\n font-weight: var(--base-text-weight-semibold, 600);\n font-size: 1em;\n}\n\n.markdown-body h5 {\n font-weight: var(--base-text-weight-semibold, 600);\n font-size: .875em;\n}\n\n.markdown-body h6 {\n font-weight: var(--base-text-weight-semibold, 600);\n font-size: .85em;\n color: var(--fgColor-muted);\n}\n\n.markdown-body p {\n margin-top: 0;\n margin-bottom: 10px;\n}\n\n.markdown-body blockquote {\n margin: 0;\n padding: 0 1em;\n color: var(--fgColor-muted);\n border-left: .25em solid var(--borderColor-default);\n}\n\n.markdown-body ul,\n.markdown-body ol {\n margin-top: 0;\n margin-bottom: 0;\n padding-left: 2em;\n}\n\n.markdown-body ol ol,\n.markdown-body ul ol {\n list-style-type: lower-roman;\n}\n\n.markdown-body ul ul ol,\n.markdown-body ul ol ol,\n.markdown-body ol ul ol,\n.markdown-body ol ol ol {\n list-style-type: lower-alpha;\n}\n\n.markdown-body dd {\n margin-left: 0;\n}\n\n.markdown-body tt,\n.markdown-body code,\n.markdown-body samp {\n font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace);\n font-size: 12px;\n}\n\n.markdown-body pre {\n margin-top: 0;\n margin-bottom: 0;\n font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace);\n font-size: 12px;\n word-wrap: normal;\n}\n\n.markdown-body .octicon {\n display: inline-block;\n overflow: visible !important;\n vertical-align: text-bottom;\n fill: currentColor;\n}\n\n.markdown-body input::-webkit-outer-spin-button,\n.markdown-body input::-webkit-inner-spin-button {\n margin: 0;\n appearance: none;\n}\n\n.markdown-body .mr-2 {\n margin-right: var(--base-size-8, 8px) !important;\n}\n\n.markdown-body::before {\n display: table;\n content: "";\n}\n\n.markdown-body::after {\n display: table;\n clear: both;\n content: "";\n}\n\n.markdown-body>*:first-child {\n margin-top: 0 !important;\n}\n\n.markdown-body>*:last-child {\n margin-bottom: 0 !important;\n}\n\n.markdown-body a:not([href]) {\n color: inherit;\n text-decoration: none;\n}\n\n.markdown-body .absent {\n color: var(--fgColor-danger);\n}\n\n.markdown-body .anchor {\n float: left;\n padding-right: var(--base-size-4);\n margin-left: -20px;\n line-height: 1;\n}\n\n.markdown-body .anchor:focus {\n outline: none;\n}\n\n.markdown-body p,\n.markdown-body blockquote,\n.markdown-body ul,\n.markdown-body ol,\n.markdown-body dl,\n.markdown-body table,\n.markdown-body pre,\n.markdown-body details {\n margin-top: 0;\n margin-bottom: var(--base-size-16);\n}\n\n.markdown-body blockquote>:first-child {\n margin-top: 0;\n}\n\n.markdown-body blockquote>:last-child {\n margin-bottom: 0;\n}\n\n.markdown-body h1 .octicon-link,\n.markdown-body h2 .octicon-link,\n.markdown-body h3 .octicon-link,\n.markdown-body h4 .octicon-link,\n.markdown-body h5 .octicon-link,\n.markdown-body h6 .octicon-link {\n color: var(--fgColor-default);\n vertical-align: middle;\n visibility: hidden;\n}\n\n.markdown-body h1:hover .anchor,\n.markdown-body h2:hover .anchor,\n.markdown-body h3:hover .anchor,\n.markdown-body h4:hover .anchor,\n.markdown-body h5:hover .anchor,\n.markdown-body h6:hover .anchor {\n text-decoration: none;\n}\n\n.markdown-body h1:hover .anchor .octicon-link,\n.markdown-body h2:hover .anchor .octicon-link,\n.markdown-body h3:hover .anchor .octicon-link,\n.markdown-body h4:hover .anchor .octicon-link,\n.markdown-body h5:hover .anchor .octicon-link,\n.markdown-body h6:hover .anchor .octicon-link {\n visibility: visible;\n}\n\n.markdown-body h1 tt,\n.markdown-body h1 code,\n.markdown-body h2 tt,\n.markdown-body h2 code,\n.markdown-body h3 tt,\n.markdown-body h3 code,\n.markdown-body h4 tt,\n.markdown-body h4 code,\n.markdown-body h5 tt,\n.markdown-body h5 code,\n.markdown-body h6 tt,\n.markdown-body h6 code {\n padding: 0 .2em;\n font-size: inherit;\n}\n\n.markdown-body summary h1,\n.markdown-body summary h2,\n.markdown-body summary h3,\n.markdown-body summary h4,\n.markdown-body summary h5,\n.markdown-body summary h6 {\n display: inline-block;\n}\n\n.markdown-body summary h1 .anchor,\n.markdown-body summary h2 .anchor,\n.markdown-body summary h3 .anchor,\n.markdown-body summary h4 .anchor,\n.markdown-body summary h5 .anchor,\n.markdown-body summary h6 .anchor {\n margin-left: -40px;\n}\n\n.markdown-body summary h1,\n.markdown-body summary h2 {\n padding-bottom: 0;\n border-bottom: 0;\n}\n\n.markdown-body ul.no-list,\n.markdown-body ol.no-list {\n padding: 0;\n list-style-type: none;\n}\n\n.markdown-body ol[type="a s"] {\n list-style-type: lower-alpha;\n}\n\n.markdown-body ol[type="A s"] {\n list-style-type: upper-alpha;\n}\n\n.markdown-body ol[type="i s"] {\n list-style-type: lower-roman;\n}\n\n.markdown-body ol[type="I s"] {\n list-style-type: upper-roman;\n}\n\n.markdown-body ol[type="1"] {\n list-style-type: decimal;\n}\n\n.markdown-body div>ol:not([type]) {\n list-style-type: decimal;\n}\n\n.markdown-body ul ul,\n.markdown-body ul ol,\n.markdown-body ol ol,\n.markdown-body ol ul {\n margin-top: 0;\n margin-bottom: 0;\n}\n\n.markdown-body li>p {\n margin-top: var(--base-size-16);\n}\n\n.markdown-body li+li {\n margin-top: .25em;\n}\n\n.markdown-body dl {\n padding: 0;\n}\n\n.markdown-body dl dt {\n padding: 0;\n margin-top: var(--base-size-16);\n font-size: 1em;\n font-style: italic;\n font-weight: var(--base-text-weight-semibold, 600);\n}\n\n.markdown-body dl dd {\n padding: 0 var(--base-size-16);\n margin-bottom: var(--base-size-16);\n}\n\n.markdown-body table th {\n font-weight: var(--base-text-weight-semibold, 600);\n}\n\n.markdown-body table th,\n.markdown-body table td {\n padding: 6px 13px;\n border: 1px solid var(--borderColor-default);\n}\n\n.markdown-body table td>:last-child {\n margin-bottom: 0;\n}\n\n.markdown-body table tr {\n background-color: var(--bgColor-default);\n border-top: 1px solid var(--borderColor-muted);\n}\n\n.markdown-body table tr:nth-child(2n) {\n background-color: var(--bgColor-muted);\n}\n\n.markdown-body table img {\n background-color: rgba(0,0,0,0);\n}\n\n.markdown-body img[align=right] {\n padding-left: 20px;\n}\n\n.markdown-body img[align=left] {\n padding-right: 20px;\n}\n\n.markdown-body .emoji {\n max-width: none;\n vertical-align: text-top;\n background-color: rgba(0,0,0,0);\n}\n\n.markdown-body span.frame {\n display: block;\n overflow: hidden;\n}\n\n.markdown-body span.frame>span {\n display: block;\n float: left;\n width: auto;\n padding: 7px;\n margin: 13px 0 0;\n overflow: hidden;\n border: 1px solid var(--borderColor-default);\n}\n\n.markdown-body span.frame span img {\n display: block;\n float: left;\n}\n\n.markdown-body span.frame span span {\n display: block;\n padding: 5px 0 0;\n clear: both;\n color: var(--fgColor-default);\n}\n\n.markdown-body span.align-center {\n display: block;\n overflow: hidden;\n clear: both;\n}\n\n.markdown-body span.align-center>span {\n display: block;\n margin: 13px auto 0;\n overflow: hidden;\n text-align: center;\n}\n\n.markdown-body span.align-center span img {\n margin: 0 auto;\n text-align: center;\n}\n\n.markdown-body span.align-right {\n display: block;\n overflow: hidden;\n clear: both;\n}\n\n.markdown-body span.align-right>span {\n display: block;\n margin: 13px 0 0;\n overflow: hidden;\n text-align: right;\n}\n\n.markdown-body span.align-right span img {\n margin: 0;\n text-align: right;\n}\n\n.markdown-body span.float-left {\n display: block;\n float: left;\n margin-right: 13px;\n overflow: hidden;\n}\n\n.markdown-body span.float-left span {\n margin: 13px 0 0;\n}\n\n.markdown-body span.float-right {\n display: block;\n float: right;\n margin-left: 13px;\n overflow: hidden;\n}\n\n.markdown-body span.float-right>span {\n display: block;\n margin: 13px auto 0;\n overflow: hidden;\n text-align: right;\n}\n\n.markdown-body code,\n.markdown-body tt {\n padding: .2em .4em;\n margin: 0;\n font-size: 85%;\n white-space: break-spaces;\n background-color: var(--bgColor-neutral-muted);\n border-radius: 6px;\n}\n\n.markdown-body code br,\n.markdown-body tt br {\n display: none;\n}\n\n.markdown-body del code {\n text-decoration: inherit;\n}\n\n.markdown-body samp {\n font-size: 85%;\n}\n\n.markdown-body pre code {\n font-size: 100%;\n}\n\n.markdown-body pre>code {\n padding: 0;\n margin: 0;\n word-break: normal;\n white-space: pre;\n background: rgba(0,0,0,0);\n border: 0;\n}\n\n.markdown-body .highlight {\n margin-bottom: var(--base-size-16);\n}\n\n.markdown-body .highlight pre {\n margin-bottom: 0;\n word-break: normal;\n}\n\n.markdown-body .highlight pre,\n.markdown-body pre {\n padding: var(--base-size-16);\n overflow: auto;\n font-size: 85%;\n line-height: 1.45;\n color: var(--fgColor-default);\n background-color: var(--bgColor-muted);\n border-radius: 6px;\n}\n\n.markdown-body pre code,\n.markdown-body pre tt {\n display: inline;\n padding: 0;\n margin: 0;\n overflow: visible;\n line-height: inherit;\n word-wrap: normal;\n background-color: rgba(0,0,0,0);\n border: 0;\n}\n\n.markdown-body .csv-data td,\n.markdown-body .csv-data th {\n padding: 5px;\n overflow: hidden;\n font-size: 12px;\n line-height: 1;\n text-align: left;\n white-space: nowrap;\n}\n\n.markdown-body .csv-data .blob-num {\n padding: 10px var(--base-size-8) 9px;\n text-align: right;\n background: var(--bgColor-default);\n border: 0;\n}\n\n.markdown-body .csv-data tr {\n border-top: 0;\n}\n\n.markdown-body .csv-data th {\n font-weight: var(--base-text-weight-semibold, 600);\n background: var(--bgColor-muted);\n border-top: 0;\n}\n\n.markdown-body [data-footnote-ref]::before {\n content: "[";\n}\n\n.markdown-body [data-footnote-ref]::after {\n content: "]";\n}\n\n.markdown-body .footnotes {\n font-size: 12px;\n color: var(--fgColor-muted);\n border-top: 1px solid var(--borderColor-default);\n}\n\n.markdown-body .footnotes ol {\n padding-left: var(--base-size-16);\n}\n\n.markdown-body .footnotes ol ul {\n display: inline-block;\n padding-left: var(--base-size-16);\n margin-top: var(--base-size-16);\n}\n\n.markdown-body .footnotes li {\n position: relative;\n}\n\n.markdown-body .footnotes li:target::before {\n position: absolute;\n top: calc(var(--base-size-8)*-1);\n right: calc(var(--base-size-8)*-1);\n bottom: calc(var(--base-size-8)*-1);\n left: calc(var(--base-size-24)*-1);\n pointer-events: none;\n content: "";\n border: 2px solid var(--borderColor-accent-emphasis);\n border-radius: 6px;\n}\n\n.markdown-body .footnotes li:target {\n color: var(--fgColor-default);\n}\n\n.markdown-body .footnotes .data-footnote-backref g-emoji {\n font-family: monospace;\n}\n\n.markdown-body .pl-c {\n color: var(--color-prettylights-syntax-comment);\n}\n\n.markdown-body .pl-c1,\n.markdown-body .pl-s .pl-v {\n color: var(--color-prettylights-syntax-constant);\n}\n\n.markdown-body .pl-e,\n.markdown-body .pl-en {\n color: var(--color-prettylights-syntax-entity);\n}\n\n.markdown-body .pl-smi,\n.markdown-body .pl-s .pl-s1 {\n color: var(--color-prettylights-syntax-storage-modifier-import);\n}\n\n.markdown-body .pl-ent {\n color: var(--color-prettylights-syntax-entity-tag);\n}\n\n.markdown-body .pl-k {\n color: var(--color-prettylights-syntax-keyword);\n}\n\n.markdown-body .pl-s,\n.markdown-body .pl-pds,\n.markdown-body .pl-s .pl-pse .pl-s1,\n.markdown-body .pl-sr,\n.markdown-body .pl-sr .pl-cce,\n.markdown-body .pl-sr .pl-sre,\n.markdown-body .pl-sr .pl-sra {\n color: var(--color-prettylights-syntax-string);\n}\n\n.markdown-body .pl-v,\n.markdown-body .pl-smw {\n color: var(--color-prettylights-syntax-variable);\n}\n\n.markdown-body .pl-bu {\n color: var(--color-prettylights-syntax-brackethighlighter-unmatched);\n}\n\n.markdown-body .pl-ii {\n color: var(--color-prettylights-syntax-invalid-illegal-text);\n background-color: var(--color-prettylights-syntax-invalid-illegal-bg);\n}\n\n.markdown-body .pl-c2 {\n color: var(--color-prettylights-syntax-carriage-return-text);\n background-color: var(--color-prettylights-syntax-carriage-return-bg);\n}\n\n.markdown-body .pl-sr .pl-cce {\n font-weight: bold;\n color: var(--color-prettylights-syntax-string-regexp);\n}\n\n.markdown-body .pl-ml {\n color: var(--color-prettylights-syntax-markup-list);\n}\n\n.markdown-body .pl-mh,\n.markdown-body .pl-mh .pl-en,\n.markdown-body .pl-ms {\n font-weight: bold;\n color: var(--color-prettylights-syntax-markup-heading);\n}\n\n.markdown-body .pl-mi {\n font-style: italic;\n color: var(--color-prettylights-syntax-markup-italic);\n}\n\n.markdown-body .pl-mb {\n font-weight: bold;\n color: var(--color-prettylights-syntax-markup-bold);\n}\n\n.markdown-body .pl-md {\n color: var(--color-prettylights-syntax-markup-deleted-text);\n background-color: var(--color-prettylights-syntax-markup-deleted-bg);\n}\n\n.markdown-body .pl-mi1 {\n color: var(--color-prettylights-syntax-markup-inserted-text);\n background-color: var(--color-prettylights-syntax-markup-inserted-bg);\n}\n\n.markdown-body .pl-mc {\n color: var(--color-prettylights-syntax-markup-changed-text);\n background-color: var(--color-prettylights-syntax-markup-changed-bg);\n}\n\n.markdown-body .pl-mi2 {\n color: var(--color-prettylights-syntax-markup-ignored-text);\n background-color: var(--color-prettylights-syntax-markup-ignored-bg);\n}\n\n.markdown-body .pl-mdr {\n font-weight: bold;\n color: var(--color-prettylights-syntax-meta-diff-range);\n}\n\n.markdown-body .pl-ba {\n color: var(--color-prettylights-syntax-brackethighlighter-angle);\n}\n\n.markdown-body .pl-sg {\n color: var(--color-prettylights-syntax-sublimelinter-gutter-mark);\n}\n\n.markdown-body .pl-corl {\n text-decoration: underline;\n color: var(--color-prettylights-syntax-constant-other-reference-link);\n}\n\n.markdown-body [role=button]:focus:not(:focus-visible),\n.markdown-body [role=tabpanel][tabindex="0"]:focus:not(:focus-visible),\n.markdown-body button:focus:not(:focus-visible),\n.markdown-body summary:focus:not(:focus-visible),\n.markdown-body a:focus:not(:focus-visible) {\n outline: none;\n box-shadow: none;\n}\n\n.markdown-body [tabindex="0"]:focus:not(:focus-visible),\n.markdown-body details-dialog:focus:not(:focus-visible) {\n outline: none;\n}\n\n.markdown-body g-emoji {\n display: inline-block;\n min-width: 1ch;\n font-family: "Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";\n font-size: 1em;\n font-style: normal !important;\n font-weight: var(--base-text-weight-normal, 400);\n line-height: 1;\n vertical-align: -0.075em;\n}\n\n.markdown-body g-emoji img {\n width: 1em;\n height: 1em;\n}\n\n.markdown-body a:has(>p,>div,>pre,>blockquote) {\n display: block;\n}\n\n.markdown-body a:has(>p,>div,>pre,>blockquote):not(:has(.snippet-clipboard-content,>pre)) {\n width: fit-content;\n}\n\n.markdown-body a:has(>p,>div,>pre,>blockquote):has(.snippet-clipboard-content,>pre):focus-visible {\n outline: 2px solid var(--focus-outlineColor);\n outline-offset: 2px;\n}\n\n.markdown-body .task-list-item {\n list-style-type: none;\n}\n\n.markdown-body .task-list-item label {\n font-weight: var(--base-text-weight-normal, 400);\n}\n\n.markdown-body .task-list-item.enabled label {\n cursor: pointer;\n}\n\n.markdown-body .task-list-item+.task-list-item {\n margin-top: var(--base-size-4);\n}\n\n.markdown-body .task-list-item .handle {\n display: none;\n}\n\n.markdown-body .task-list-item-checkbox {\n margin: 0 .2em .25em -1.4em;\n vertical-align: middle;\n}\n\n.markdown-body ul:dir(rtl) .task-list-item-checkbox {\n margin: 0 -1.6em .25em .2em;\n}\n\n.markdown-body ol:dir(rtl) .task-list-item-checkbox {\n margin: 0 -1.6em .25em .2em;\n}\n\n.markdown-body .contains-task-list:hover .task-list-item-convert-container,\n.markdown-body .contains-task-list:focus-within .task-list-item-convert-container {\n display: block;\n width: auto;\n height: 24px;\n overflow: visible;\n clip-path: none;\n}\n\n.markdown-body ::-webkit-calendar-picker-indicator {\n filter: invert(50%);\n}\n\n.markdown-body .markdown-alert {\n padding: var(--base-size-8) var(--base-size-16);\n margin-bottom: var(--base-size-16);\n color: inherit;\n border-left: .25em solid var(--borderColor-default);\n}\n\n.markdown-body .markdown-alert>:first-child {\n margin-top: 0;\n}\n\n.markdown-body .markdown-alert>:last-child {\n margin-bottom: 0;\n}\n\n.markdown-body .markdown-alert .markdown-alert-title {\n display: flex;\n font-weight: var(--base-text-weight-medium, 500);\n align-items: center;\n line-height: 1;\n}\n\n.markdown-body .markdown-alert.markdown-alert-note {\n border-left-color: var(--borderColor-accent-emphasis);\n}\n\n.markdown-body .markdown-alert.markdown-alert-note .markdown-alert-title {\n color: var(--fgColor-accent);\n}\n\n.markdown-body .markdown-alert.markdown-alert-important {\n border-left-color: var(--borderColor-done-emphasis);\n}\n\n.markdown-body .markdown-alert.markdown-alert-important .markdown-alert-title {\n color: var(--fgColor-done);\n}\n\n.markdown-body .markdown-alert.markdown-alert-warning {\n border-left-color: var(--borderColor-attention-emphasis);\n}\n\n.markdown-body .markdown-alert.markdown-alert-warning .markdown-alert-title {\n color: var(--fgColor-attention);\n}\n\n.markdown-body .markdown-alert.markdown-alert-tip {\n border-left-color: var(--borderColor-success-emphasis);\n}\n\n.markdown-body .markdown-alert.markdown-alert-tip .markdown-alert-title {\n color: var(--fgColor-success);\n}\n\n.markdown-body .markdown-alert.markdown-alert-caution {\n border-left-color: var(--borderColor-danger-emphasis);\n}\n\n.markdown-body .markdown-alert.markdown-alert-caution .markdown-alert-title {\n color: var(--fgColor-danger);\n}\n\n.markdown-body>*:first-child>.heading-element:first-child {\n margin-top: 0 !important;\n}\n\n.markdown-body .highlight pre:has(+.zeroclipboard-container) {\n min-height: 52px;\n}\n\n`,""]);const b=c;e.d(o,["A",0,b])},32046(n,o,e){"use strict";var t=e(31601),r=e.n(t),a=e(76314),l=e.n(a)()(r());l.push([n.id,"pre code.hljs {\n display: block;\n overflow-x: auto;\n padding: 1em\n}\ncode.hljs {\n padding: 3px 5px\n}\n/*!\n Theme: GitHub Dark\n Description: Dark theme as seen on github.com\n Author: github.com\n Maintainer: @Hirse\n Updated: 2021-05-15\n\n Outdated base version: https://github.com/primer/github-syntax-dark\n Current colors taken from GitHub's CSS\n*/\n.hljs {\n color: #c9d1d9;\n background: #0d1117\n}\n.hljs-doctag,\n.hljs-keyword,\n.hljs-meta .hljs-keyword,\n.hljs-template-tag,\n.hljs-template-variable,\n.hljs-type,\n.hljs-variable.language_ {\n /* prettylights-syntax-keyword */\n color: #ff7b72\n}\n.hljs-title,\n.hljs-title.class_,\n.hljs-title.class_.inherited__,\n.hljs-title.function_ {\n /* prettylights-syntax-entity */\n color: #d2a8ff\n}\n.hljs-attr,\n.hljs-attribute,\n.hljs-literal,\n.hljs-meta,\n.hljs-number,\n.hljs-operator,\n.hljs-variable,\n.hljs-selector-attr,\n.hljs-selector-class,\n.hljs-selector-id {\n /* prettylights-syntax-constant */\n color: #79c0ff\n}\n.hljs-regexp,\n.hljs-string,\n.hljs-meta .hljs-string {\n /* prettylights-syntax-string */\n color: #a5d6ff\n}\n.hljs-built_in,\n.hljs-symbol {\n /* prettylights-syntax-variable */\n color: #ffa657\n}\n.hljs-comment,\n.hljs-code,\n.hljs-formula {\n /* prettylights-syntax-comment */\n color: #8b949e\n}\n.hljs-name,\n.hljs-quote,\n.hljs-selector-tag,\n.hljs-selector-pseudo {\n /* prettylights-syntax-entity-tag */\n color: #7ee787\n}\n.hljs-subst {\n /* prettylights-syntax-storage-modifier-import */\n color: #c9d1d9\n}\n.hljs-section {\n /* prettylights-syntax-markup-heading */\n color: #1f6feb;\n font-weight: bold\n}\n.hljs-bullet {\n /* prettylights-syntax-markup-list */\n color: #f2cc60\n}\n.hljs-emphasis {\n /* prettylights-syntax-markup-italic */\n color: #c9d1d9;\n font-style: italic\n}\n.hljs-strong {\n /* prettylights-syntax-markup-bold */\n color: #c9d1d9;\n font-weight: bold\n}\n.hljs-addition {\n /* prettylights-syntax-markup-inserted */\n color: #aff5b4;\n background-color: #033a16\n}\n.hljs-deletion {\n /* prettylights-syntax-markup-deleted */\n color: #ffdcd7;\n background-color: #67060c\n}\n.hljs-char.escape_,\n.hljs-link,\n.hljs-params,\n.hljs-property,\n.hljs-punctuation,\n.hljs-tag {\n /* purposely ignored */\n \n}",""]);const i=l;e.d(o,["A",0,i])},69428(n){var o=!0,e=!1,t=!1;function r(n,o,e){var t=n.attrIndex(o),r=[o,e];t<0?n.attrPush(r):n.attrs[t]=r}function a(n,o){for(var e=n[o].level-1,t=o-1;t>=0;t--)if(n[t].level===e)return t;return-1}function l(n,o){return"inline"===n[o].type&&function(n){return"paragraph_open"===n.type}(n[o-1])&&function(n){return"list_item_open"===n.type}(n[o-2])&&function(n){return 0===n.content.indexOf("[ ] ")||0===n.content.indexOf("[x] ")||0===n.content.indexOf("[X] ")}(n[o])}function i(n,r){if(n.children.unshift(function(n,e){var t=new e("html_inline","",0),r=o?' disabled="" ':"";0===n.content.indexOf("[ ] ")?t.content='<input class="task-list-item-checkbox"'+r+'type="checkbox">':0!==n.content.indexOf("[x] ")&&0!==n.content.indexOf("[X] ")||(t.content='<input class="task-list-item-checkbox" checked=""'+r+'type="checkbox">');return t}(n,r)),n.children[1].content=n.children[1].content.slice(3),n.content=n.content.slice(3),e)if(t){n.children.pop();var a="task-item-"+Math.ceil(1e7*Math.random()-1e3);n.children[0].content=n.children[0].content.slice(0,-1)+' id="'+a+'">',n.children.push(function(n,o,e){var t=new e("html_inline","",0);return t.content='<label class="task-list-item-label" for="'+o+'">'+n+"</label>",t.attrs=[{for:o}],t}(n.content,a,r))}else n.children.unshift(function(n){var o=new n("html_inline","",0);return o.content="<label>",o}(r)),n.children.push(function(n){var o=new n("html_inline","",0);return o.content="</label>",o}(r))}n.exports=function(n,s){s&&(o=!s.enabled,e=!!s.label,t=!!s.labelAfter),n.core.ruler.after("inline","github-task-lists",function(n){for(var e=n.tokens,t=2;t<e.length;t++)l(e,t)&&(i(e[t],n.Token),r(e[t-2],"class","task-list-item"+(o?"":" enabled")),r(e[a(e,t-2)],"class","contains-task-list"))})}},3775(n,o,e){"use strict";var t=e(85072),r=e.n(t),a=e(97825),l=e.n(a),i=e(77659),s=e.n(i),d=e(55056),c=e.n(d),m=e(10540),b=e.n(m),p=e(41113),h=e.n(p),y=e(62718),k={};k.styleTagTransform=h(),k.setAttributes=c(),k.insert=s().bind(null,"head"),k.domAPI=l(),k.insertStyleElement=b();r()(y.A,k),y.A&&y.A.locals&&y.A.locals},72411(n,o,e){"use strict";var t=e(85072),r=e.n(t),a=e(97825),l=e.n(a),i=e(77659),s=e.n(i),d=e(55056),c=e.n(d),m=e(10540),b=e.n(m),p=e(41113),h=e.n(p),y=e(32046),k={};k.styleTagTransform=h(),k.setAttributes=c(),k.insert=s().bind(null,"head"),k.domAPI=l(),k.insertStyleElement=b();r()(y.A,k),y.A&&y.A.locals&&y.A.locals},53995(n,o,e){"use strict";e.d(o,{A:()=>i});const t={grinning:"😀",smiley:"😃",smile:"😄",grin:"😁",laughing:"😆",satisfied:"😆",sweat_smile:"😅",joy:"😂",wink:"😉",blush:"😊",innocent:"😇",heart_eyes:"😍",kissing_heart:"😘",kissing:"😗",kissing_closed_eyes:"😚",kissing_smiling_eyes:"😙",yum:"😋",stuck_out_tongue:"😛",stuck_out_tongue_winking_eye:"😜",stuck_out_tongue_closed_eyes:"😝",neutral_face:"😐",expressionless:"😑",no_mouth:"😶",smirk:"😏",unamused:"😒",relieved:"😌",pensive:"😔",sleepy:"😪",sleeping:"😴",mask:"😷",dizzy_face:"😵",sunglasses:"😎",confused:"😕",worried:"😟",open_mouth:"😮",hushed:"😯",astonished:"😲",flushed:"😳",frowning:"😦",anguished:"😧",fearful:"😨",cold_sweat:"😰",disappointed_relieved:"😥",cry:"😢",sob:"😭",scream:"😱",confounded:"😖",persevere:"😣",disappointed:"😞",sweat:"😓",weary:"😩",tired_face:"😫",rage:"😡",pout:"😡",angry:"😠",smiling_imp:"😈",smiley_cat:"😺",smile_cat:"😸",joy_cat:"😹",heart_eyes_cat:"😻",smirk_cat:"😼",kissing_cat:"😽",scream_cat:"🙀",crying_cat_face:"😿",pouting_cat:"😾",heart:"❤️",hand:"✋",raised_hand:"✋",v:"✌️",point_up:"☝️",fist_raised:"✊",fist:"✊",monkey_face:"🐵",cat:"🐱",cow:"🐮",mouse:"🐭",coffee:"☕",hotsprings:"♨️",anchor:"⚓",airplane:"✈️",hourglass:"⌛",watch:"⌚",sunny:"☀️",star:"⭐",cloud:"☁️",umbrella:"☔",zap:"⚡",snowflake:"❄️",sparkles:"✨",black_joker:"🃏",mahjong:"🀄",phone:"☎️",telephone:"☎️",envelope:"✉️",pencil2:"✏️",black_nib:"✒️",scissors:"✂️",wheelchair:"♿",warning:"⚠️",aries:"♈",taurus:"♉",gemini:"♊",cancer:"♋",leo:"♌",virgo:"♍",libra:"♎",scorpius:"♏",sagittarius:"♐",capricorn:"♑",aquarius:"♒",pisces:"♓",heavy_multiplication_x:"✖️",heavy_plus_sign:"➕",heavy_minus_sign:"➖",heavy_division_sign:"➗",bangbang:"‼️",interrobang:"⁉️",question:"❓",grey_question:"❔",grey_exclamation:"❕",exclamation:"❗",heavy_exclamation_mark:"❗",wavy_dash:"〰️",recycle:"♻️",white_check_mark:"✅",ballot_box_with_check:"☑️",heavy_check_mark:"✔️",x:"❌",negative_squared_cross_mark:"❎",curly_loop:"➰",loop:"➿",part_alternation_mark:"〽️",eight_spoked_asterisk:"✳️",eight_pointed_black_star:"✴️",sparkle:"❇️",copyright:"©️",registered:"®️",tm:"™️",information_source:"ℹ️",m:"Ⓜ️",black_circle:"⚫",white_circle:"⚪",black_large_square:"⬛",white_large_square:"⬜",black_medium_square:"◼️",white_medium_square:"◻️",black_medium_small_square:"◾",white_medium_small_square:"◽",black_small_square:"▪️",white_small_square:"▫️"},r={angry:[">:(",">:-("],blush:[':")',':-")'],broken_heart:["</3","<\\3"],confused:[":/",":-/"],cry:[":'(",":'-(",":,(",":,-("],frowning:[":(",":-("],heart:["<3"],imp:["]:(","]:-("],innocent:["o:)","O:)","o:-)","O:-)","0:)","0:-)"],joy:[":')",":'-)",":,)",":,-)",":'D",":'-D",":,D",":,-D"],kissing:[":*",":-*"],laughing:["x-)","X-)"],neutral_face:[":|",":-|"],open_mouth:[":o",":-o",":O",":-O"],rage:[":@",":-@"],smile:[":D",":-D"],smiley:[":)",":-)"],smiling_imp:["]:)","]:-)"],sob:[":,'(",":,'-(",";(",";-("],stuck_out_tongue:[":P",":-P"],sunglasses:["8-)","B-)"],sweat:[",:(",",:-("],sweat_smile:[",:)",",:-)"],unamused:[":s",":-S",":z",":-Z",":$",":-$"],wink:[";)",";-)"]};function a(n,o){return n[o].content}function l(n,o){const e=function(n){let o=n.defs;n.enabled.length&&(o=Object.keys(o).reduce((e,t)=>(n.enabled.indexOf(t)>=0&&(e[t]=o[t]),e),{}));const e=Object.keys(n.shortcuts).reduce((e,t)=>o[t]?Array.isArray(n.shortcuts[t])?(n.shortcuts[t].forEach(n=>{e[n]=t}),e):(e[n.shortcuts[t]]=t,e):e,{}),t=Object.keys(o);let r;r=0===t.length?"^$":t.map(n=>`:${n}:`).concat(Object.keys(e)).sort().reverse().map(n=>n.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")).join("|");const a=RegExp(r),l=RegExp(r,"g");return{defs:o,shortcuts:e,scanRE:a,replaceRE:l}}(Object.assign({},{defs:{},shortcuts:{},enabled:[]},o||{}));n.renderer.rules.emoji=a,n.core.ruler.after("linkify","emoji",function(n,o,e,t,r){const a=n.utils.arrayReplaceAt,l=n.utils.lib.ucmicro,i=new RegExp([l.Z.source,l.P.source,l.Cc.source].join("|"));function s(n,t,a){let l=0;const s=[];if(n.replace(r,function(t,r,d){let c;if(Object.prototype.hasOwnProperty.call(e,t)){if(c=e[t],r>0&&!i.test(d[r-1]))return;if(r+t.length<d.length&&!i.test(d[r+t.length]))return}else c=t.slice(1,-1);if(r>l){const o=new a("text","",0);o.content=n.slice(l,r),s.push(o)}const m=new a("emoji","",0);m.markup=c,m.content=o[c],s.push(m),l=r+t.length}),l<n.length){const o=new a("text","",0);o.content=n.slice(l),s.push(o)}return s}return function(n){let o;const e=n.tokens;let r=0;for(let l=0,i=e.length;l<i;l++){if("inline"!==e[l].type)continue;let i=e[l].children;for(let d=i.length-1;d>=0;d--)o=i[d],"link_open"!==o.type&&"link_close"!==o.type||"auto"===o.info&&(r-=o.nesting),"text"===o.type&&0===r&&t.test(o.content)&&(e[l].children=i=a(i,d,s(o.content,o.level,n.Token)))}}}(n,e.defs,e.shortcuts,e.scanRE,e.replaceRE))}function i(n,o){const e={defs:t,shortcuts:r,enabled:[]};l(n,Object.assign({},e,o||{}))}},8263(n,o,e){"use strict";function t(n,o,e,t){const r=Number(n[o].meta.id+1).toString();let a="";return"string"==typeof t.docId&&(a=`-${t.docId}-`),a+r}function r(n,o){let e=Number(n[o].meta.id+1).toString();return n[o].meta.subId>0&&(e+=`:${n[o].meta.subId}`),`[${e}]`}function a(n,o,e,t,r){const a=r.rules.footnote_anchor_name(n,o,e,t,r),l=r.rules.footnote_caption(n,o,e,t,r);let i=a;return n[o].meta.subId>0&&(i+=`:${n[o].meta.subId}`),`<sup class="footnote-ref"><a href="#fn${a}" id="fnref${i}">${l}</a></sup>`}function l(n,o,e){return(e.xhtmlOut?'<hr class="footnotes-sep" />\n':'<hr class="footnotes-sep">\n')+'<section class="footnotes">\n<ol class="footnotes-list">\n'}function i(){return"</ol>\n</section>\n"}function s(n,o,e,t,r){let a=r.rules.footnote_anchor_name(n,o,e,t,r);return n[o].meta.subId>0&&(a+=`:${n[o].meta.subId}`),`<li id="fn${a}" class="footnote-item">`}function d(){return"</li>\n"}function c(n,o,e,t,r){let a=r.rules.footnote_anchor_name(n,o,e,t,r);return n[o].meta.subId>0&&(a+=`:${n[o].meta.subId}`),` <a href="#fnref${a}" class="footnote-backref">↩︎</a>`}function m(n){const o=n.helpers.parseLinkLabel,e=n.utils.isSpace;n.renderer.rules.footnote_ref=a,n.renderer.rules.footnote_block_open=l,n.renderer.rules.footnote_block_close=i,n.renderer.rules.footnote_open=s,n.renderer.rules.footnote_close=d,n.renderer.rules.footnote_anchor=c,n.renderer.rules.footnote_caption=r,n.renderer.rules.footnote_anchor_name=t,n.block.ruler.before("reference","footnote_def",function(n,o,t,r){const a=n.bMarks[o]+n.tShift[o],l=n.eMarks[o];if(a+4>l)return!1;if(91!==n.src.charCodeAt(a))return!1;if(94!==n.src.charCodeAt(a+1))return!1;let i;for(i=a+2;i<l;i++){if(32===n.src.charCodeAt(i))return!1;if(93===n.src.charCodeAt(i))break}if(i===a+2)return!1;if(i+1>=l||58!==n.src.charCodeAt(++i))return!1;if(r)return!0;i++,n.env.footnotes||(n.env.footnotes={}),n.env.footnotes.refs||(n.env.footnotes.refs={});const s=n.src.slice(a+2,i-2);n.env.footnotes.refs[`:${s}`]=-1;const d=new n.Token("footnote_reference_open","",1);d.meta={label:s},d.level=n.level++,n.tokens.push(d);const c=n.bMarks[o],m=n.tShift[o],b=n.sCount[o],p=n.parentType,h=i,y=n.sCount[o]+i-(n.bMarks[o]+n.tShift[o]);let k=y;for(;i<l;){const o=n.src.charCodeAt(i);if(!e(o))break;9===o?k+=4-k%4:k++,i++}n.tShift[o]=i-h,n.sCount[o]=k-y,n.bMarks[o]=h,n.blkIndent+=4,n.parentType="footnote",n.sCount[o]<n.blkIndent&&(n.sCount[o]+=n.blkIndent),n.md.block.tokenize(n,o,t,!0),n.parentType=p,n.blkIndent-=4,n.tShift[o]=m,n.sCount[o]=b,n.bMarks[o]=c;const u=new n.Token("footnote_reference_close","",-1);return u.level=--n.level,n.tokens.push(u),!0},{alt:["paragraph","reference"]}),n.inline.ruler.after("image","footnote_inline",function(n,e){const t=n.posMax,r=n.pos;if(r+2>=t)return!1;if(94!==n.src.charCodeAt(r))return!1;if(91!==n.src.charCodeAt(r+1))return!1;const a=r+2,l=o(n,r+1);if(l<0)return!1;if(!e){n.env.footnotes||(n.env.footnotes={}),n.env.footnotes.list||(n.env.footnotes.list=[]);const o=n.env.footnotes.list.length,e=[];n.md.inline.parse(n.src.slice(a,l),n.md,n.env,e);n.push("footnote_ref","",0).meta={id:o},n.env.footnotes.list[o]={content:n.src.slice(a,l),tokens:e}}return n.pos=l+1,n.posMax=t,!0}),n.inline.ruler.after("footnote_inline","footnote_ref",function(n,o){const e=n.posMax,t=n.pos;if(t+3>e)return!1;if(!n.env.footnotes||!n.env.footnotes.refs)return!1;if(91!==n.src.charCodeAt(t))return!1;if(94!==n.src.charCodeAt(t+1))return!1;let r;for(r=t+2;r<e;r++){if(32===n.src.charCodeAt(r))return!1;if(10===n.src.charCodeAt(r))return!1;if(93===n.src.charCodeAt(r))break}if(r===t+2)return!1;if(r>=e)return!1;r++;const a=n.src.slice(t+2,r-1);if(void 0===n.env.footnotes.refs[`:${a}`])return!1;if(!o){let o;n.env.footnotes.list||(n.env.footnotes.list=[]),n.env.footnotes.refs[`:${a}`]<0?(o=n.env.footnotes.list.length,n.env.footnotes.list[o]={label:a,count:0},n.env.footnotes.refs[`:${a}`]=o):o=n.env.footnotes.refs[`:${a}`];const e=n.env.footnotes.list[o].count;n.env.footnotes.list[o].count++;n.push("footnote_ref","",0).meta={id:o,subId:e,label:a}}return n.pos=r,n.posMax=e,!0}),n.core.ruler.after("inline","footnote_tail",function(n){let o,e,t,r=!1;const a={};if(!n.env.footnotes)return;if(n.tokens=n.tokens.filter(function(n){return"footnote_reference_open"===n.type?(r=!0,e=[],t=n.meta.label,!1):"footnote_reference_close"===n.type?(r=!1,a[":"+t]=e,!1):(r&&e.push(n),!r)}),!n.env.footnotes.list)return;const l=n.env.footnotes.list;n.tokens.push(new n.Token("footnote_block_open","",1));for(let e=0,t=l.length;e<t;e++){const t=new n.Token("footnote_open","",1);if(t.meta={id:e,label:l[e].label},n.tokens.push(t),l[e].tokens){o=[];const t=new n.Token("paragraph_open","p",1);t.block=!0,o.push(t);const r=new n.Token("inline","",0);r.children=l[e].tokens,r.content=l[e].content,o.push(r);const a=new n.Token("paragraph_close","p",-1);a.block=!0,o.push(a)}else l[e].label&&(o=a[`:${l[e].label}`]);let r;o&&(n.tokens=n.tokens.concat(o)),r="paragraph_close"===n.tokens[n.tokens.length-1].type?n.tokens.pop():null;const i=l[e].count>0?l[e].count:1;for(let o=0;o<i;o++){const t=new n.Token("footnote_anchor","",0);t.meta={id:e,subId:o,label:l[e].label},n.tokens.push(t)}r&&n.tokens.push(r),n.tokens.push(new n.Token("footnote_close","",-1))}n.tokens.push(new n.Token("footnote_block_close","",-1))})}e.d(o,{A:()=>m})},18569(n,o,e){"use strict";e.d(o,{A:()=>a});const t=/\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g;function r(n,o){const e=n.posMax,r=n.pos;if(126!==n.src.charCodeAt(r))return!1;if(o)return!1;if(r+2>=e)return!1;n.pos=r+1;let a=!1;for(;n.pos<e;){if(126===n.src.charCodeAt(n.pos)){a=!0;break}n.md.inline.skipToken(n)}if(!a||r+1===n.pos)return n.pos=r,!1;const l=n.src.slice(r+1,n.pos);if(l.match(/(^|[^\\])(\\\\)*\s/))return n.pos=r,!1;n.posMax=n.pos,n.pos=r+1;n.push("sub_open","sub",1).markup="~";n.push("text","",0).content=l.replace(t,"$1");return n.push("sub_close","sub",-1).markup="~",n.pos=n.posMax+1,n.posMax=e,!0}function a(n){n.inline.ruler.after("emphasis","sub",r)}},77979(n,o,e){"use strict";e.d(o,{A:()=>a});const t=/\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g;function r(n,o){const e=n.posMax,r=n.pos;if(94!==n.src.charCodeAt(r))return!1;if(o)return!1;if(r+2>=e)return!1;n.pos=r+1;let a=!1;for(;n.pos<e;){if(94===n.src.charCodeAt(n.pos)){a=!0;break}n.md.inline.skipToken(n)}if(!a||r+1===n.pos)return n.pos=r,!1;const l=n.src.slice(r+1,n.pos);if(l.match(/(^|[^\\])(\\\\)*\s/))return n.pos=r,!1;n.posMax=n.pos,n.pos=r+1;n.push("sup_open","sup",1).markup="^";n.push("text","",0).content=l.replace(t,"$1");return n.push("sup_close","sup",-1).markup="^",n.pos=n.posMax+1,n.posMax=e,!0}function a(n){n.inline.ruler.after("emphasis","sup",r)}}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[2674],{92674(e,t,n){n.r(t),n.d(t,{default:()=>A});var a=n(96540),i=n(82893),s=n(34843),o=n(85997),l=n(57952),r=n(47022),c=n(34251),d=n(74848);function u(e){{const[t,n]=(0,a.useState)(!1),[i,s]=(0,a.useState)([]),l=e=>{s(e)},p=async()=>{"folder"===e.type?(t||!e.click||i||await e.click(e,l,e.pre_path),n(!t)):e.click&&await e.click(e,l,e.pre_path)},h=async(t=!1)=>{"folder"!==e.type||t?e.fatherNowToggleExpansion&&e.fatherNowToggleExpansion():await e.click(e,l,e.pre_path)};return(0,a.useEffect)(()=>{s(e.children)},[e.children]),(0,d.jsxs)("div",{className:"studio-item",children:[(0,d.jsxs)("div",{onClick:p,onContextMenu:t=>{t.stopPropagation(),t.nativeEvent.stopImmediatePropagation(),e.handleContextMenu&&e.handleContextMenu(t,e.name,e.pre_path,e.type===r.Iw.folder,h)},className:"studio-item-title"+(e.active_path===e.pre_path?" studio-item-title--active":""),children:[(0,d.jsx)("i",{className:"material-icons studio-item-title-tag","data-icon":t?"arrow_drop_down":"arrow_right",children:"file"==e.type?"":t?"arrow_drop_down":"arrow_right"}),(0,d.jsx)("span",{className:"file-icons",children:(0,d.jsx)("span",{"data-type":(0,c.uL)(e.name),"data-dir":"folder"===e.type,"aria-label":e.name,children:(0,d.jsx)(o.In,{icon:"",aria_label:e.name})})}),(0,d.jsx)("span",{className:"studio-item-name",children:e.name})]}),t&&i&&(0,d.jsx)("div",{style:{marginLeft:20},children:i.map((t,n)=>(0,d.jsx)(a.Fragment,{children:(0,d.jsx)(u,{type:t.type,size:t.size,click:e.click,name:t.name,children:t.children,pre_path:`${e.pre_path}${t.name}${t.type===r.Iw.folder?"/":""}`,handleContextMenu:e.handleContextMenu,active_path:e.active_path,fatherNowToggleExpansion:h},n)},n))})]})}}n(61443);function p(e){return(0,d.jsx)("div",{children:e.list.map((t,n)=>(0,d.jsx)(u,{pre_path:`${e.pre_path}${t.name}${t.type===r.Iw.folder?"/":""}`,name:t.name,type:t.type,handleContextMenu:e.handleContextMenu,fatherNowToggleExpansion:e.fatherNowToggleExpansion,active_path:e.active_path,children:t.children,click:e.click,size:t.size},n))})}var h=n(14284),m=n(34289),f=n(53459),v=n(78247),_=(n(62042),n(2543)),x=n(83529),y=n(22022),w=n(88815),g=n(52671),j=n(23430),k=n(99214);const C=a.lazy(()=>Promise.all([n.e(2543),n.e(4091)]).then(n.bind(n,84091))),S=a.lazy(()=>Promise.all([n.e(4946),n.e(1384),n.e(8014),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(8014),n.e(4004)]).then(n.bind(n,95733))),b=a.lazy(()=>Promise.all([n.e(3140),n.e(5744)]).then(n.bind(n,16575))),M=a.lazy(()=>Promise.all([n.e(1417),n.e(8781),n.e(2479)]).then(n.bind(n,12479)));function A(e){const[t,n]=(0,a.useState)([]),[u,A]=(0,a.useState)(""),[I,P]=(0,a.useState)(""),[$,R]=(0,a.useState)(!1),[z,F]=(0,a.useState)({path:"",name:""}),[G,D]=(0,a.useState)(""),[L,U]=(0,s.fp)(i.AG.confirm),[T,B]=(0,a.useState)(!1),[K,J]=(0,s.fp)(i.AG.fileShellShow),[O,X]=(0,s.fp)(i.AG.file_shell_hidden),H=(0,a.useRef)(null),V=(0,a.useRef)(null),[W,Y]=(0,a.useState)(!1),[Z,q]=(0,a.useState)(16),[Q,ee]=(0,s.fp)(i.AG.showPrompt),{t:te}=(0,y.Bd)(),ne=(0,g.Zp)(),ae=(ie=z.name,(0,c.uL)(ie)===r.Iw.md);var ie;const se=function(e){return(0,c.uL)(e)===r.Iw.excalidraw}(z.name),oe=function(e){return(0,c.uL)(e)===r.Iw.mind}(z.name),le=(0,a.useRef)(null),re=(0,a.useRef)(null),ce=(0,a.useRef)(null),[de,ue]=(0,a.useState)([]),[pe,he]=(0,a.useState)(-1),[me,fe]=(0,a.useState)("folder"),[ve,_e]=(0,a.useState)(!0),[xe,ye]=(0,a.useState)(!1),we=(0,k.oT)(),[ge]=(0,g.ok)(),je="1"===ge.get("chat_open"),[ke,Ce]=(0,s.fp)(i.AG.studio_chat_width),Se=(0,a.useRef)(null),[Ne,Ee]=(0,a.useState)(!1),[be,Me]=(0,a.useState)(void 0),Ae="studio_chat_session";let Ie=(0,g.zy)().pathname.split("/").filter(Boolean).pop();Ie=decodeURIComponent(Ie);const{check_user_auth:Pe}=(0,v.MH)(),[$e]=(0,s.fp)(i.AG.user_base_info),Re=Pe(j.oV.ai_agent_page);(0,a.useEffect)(()=>{$e?.user_data&&je&&!Re&&we("chat_open",null)},[je,Re,$e]);const ze=(0,m.GG)("file",Ie);const Fe=async()=>{const e=(0,m.GG)("file",Ie);A(e),F({path:e,name:(0,m.mH)(e)});const t=await h.$M.post("studio/get/item",{path:e});if(t.code===f.m.Success){const e=[],a=[];for(const n of t.data.list)"folder"===n.type?e.push(n):"file"===n.type&&a.push(n);n([...e,...a])}};(0,a.useEffect)(()=>{P(""),B(!1),Fe()},[]);const Ge=async(e,t)=>{const n=await h.$M.get(`${encodeURIComponent(t)}`);P(n.data),v.xK.set_value_temp(n.data),F({path:t,name:e}),D(t),fe("folder"),ye(!1)},De=(e,t)=>{e.size>w.o5?U({open:!0,handle:()=>{Ge(e.name,t),U({open:!1,handle:null}),B(!1)},title:"超过20MB了还要打开吗?"}):Ge(e.name,t)};async function Le(){if(!T)return;const e={context:v.xK.get_editor_value()};0===(await h.$M.post(`save/${encodeURIComponent(G)}`,e)).code&&B(!1)}const Ue=e=>{e.ctrlKey&&"s"===e.key&&(e.preventDefault(),T&&Le())};(0,a.useEffect)(()=>(document.addEventListener("keydown",Ue),()=>{document.removeEventListener("keydown",Ue)}),[T]);const Te=(0,a.useCallback)(_.throttle(e=>{const t=parseFloat(getComputedStyle(V.current).fontSize),n=window.innerWidth/t-4,a=e.clientX/t,i=2.25+H.current.offsetWidth/t;a<=n&&a>=i&&q(parseFloat(a.toFixed(2)))},32),[]),Be=()=>{Y(!1),V.current.removeEventListener("pointermove",Te)},Ke=(0,a.useCallback)(_.throttle(e=>{const t=Se.current;if(!t)return;const n=parseFloat(getComputedStyle(t).fontSize),a=t.parentElement.getBoundingClientRect().right-e.clientX,i=.7*t.parentElement.getBoundingClientRect().width,s=Math.min(Math.max(a,320),i);Ce(parseFloat((s/n).toFixed(2)))},32),[]),Je=()=>{Ee(!1),document.removeEventListener("pointermove",Ke)},Oe=[{r:te("创建文件"),v:"创建文件"},{r:te("创建目录"),v:"创建目录"},{r:te("重命名"),v:"重命名"},{r:te("删除"),v:"删除"}],Xe=[{r:te("重命名"),v:"重命名"},{r:te("删除"),v:"删除"}],He=(e,t,n,a,i)=>{e.preventDefault();const s=new c.ik;s.path=n,s.filename=t,s.x=e.clientX,s.y=e.clientY,s.items=a?Oe:Xe,i===Fe&&(s.items=s.items.slice(0,2)),s.type=a?r.Iw.studio_folder:r.Iw.studio_file;const o=e=>{i(e)};s.textClick=e=>{switch(e){case"创建文件":ee({show:!0,type:x.PromptEnum.FileNew,overlay:!0,data:{dir:n,call:o}});break;case"创建目录":ee({show:!0,type:x.PromptEnum.DirNew,overlay:!0,data:{dir:n,call:o}});break;case"删除":if(T&&(z.path===n||z.path.includes(n))){const e=()=>{o(a),B(!1),F({}),P(""),v.xK.set_value_temp("")};ee({show:!0,type:x.PromptEnum.FilesDelete,overlay:!0,data:{path:n,call:e,filename:t}});break}ee({show:!0,type:x.PromptEnum.FilesDelete,overlay:!0,data:{path:n,filename:t,call:a?()=>{o(!0)}:o}});break;case"重命名":ee({show:!0,type:x.PromptEnum.FileRename,overlay:!0,data:{path:n,dir:(0,m.Yp)(n),call:()=>{o(!0)},filename:t}})}},ee({show:!0,type:x.PromptEnum.FileMenu,overlay:!1,data:s})};const Ve=ae&&"outline"===me;return(0,d.jsxs)("div",{className:"studio studio--file",children:[(0,d.jsxs)(l.A,{ignore_tags:!0,left_children:[(0,d.jsx)(o.rA,{title:"取消",icon:"close",onClick:()=>{J({show:!1,path:""}),X(void 0),ne(-1)}},1),(0,d.jsx)("div",{children:z.name},2)],children:[(0,d.jsx)("title",{children:z.name}),(0,d.jsx)(o.rA,{title:"侧边栏",icon:"list",onClick:()=>_e(e=>!e),selected:ve}),ae&&[xe?(0,d.jsx)(o.rA,{title:te("保存"),icon:"save",onClick:()=>le.current?.save()},"save"):null,(0,d.jsx)(o.rA,{icon:"source"===le.current?.mode()?"edit":"code",title:"source"===le.current?.mode()?te("实时编辑模式"):te("源码模式"),onClick:()=>le.current?.toggle_mode()},"mode"),(0,d.jsx)(o.rA,{title:te("导出PDF"),icon:"print",onClick:()=>le.current?.export_pdf()},"pdf")],!ae&&(0,c.zr)(z.name)&&(0,d.jsx)(o.rA,{title:"格式化",icon:"data_object",onClick:function(){v.xK.get_editor()?.formatCode()}}),(0,d.jsx)(o.rA,{icon:"terminal",title:"shell",onClick:function(){!0!==O&&!1!==O?K.show?J({show:!1,path:""}):(J({show:!0,path:(0,m.GG)("file",Ie)}),X(!1)):X(!O)}}),Pe(j.oV.ai_agent_page)&&(0,d.jsx)(o.rA,{title:te("AI 聊天"),icon:"smart_toy",selected:je,onClick:()=>we("chat_open",!je?"1":null)}),ae?xe?(0,d.jsx)(o.rA,{title:te("保存"),icon:"save",onClick:()=>le.current?.save()}):null:se?(0,d.jsx)(o.rA,{title:te("保存"),icon:"save",onClick:()=>re.current?.save()}):oe?(0,d.jsx)(o.rA,{title:te("保存"),icon:"save",onClick:()=>ce.current?.save()}):T?(0,d.jsx)(o.rA,{title:"保存",icon:"save",onClick:Le}):null]}),(0,d.jsxs)("div",{className:"studio-body",ref:V,children:[(0,d.jsxs)("div",{className:"studio-nav",style:{display:ve?void 0:"none",width:Z-1+"em"},onContextMenu:e=>{He(e,z.name,(0,m.GG)("file",Ie),!0,Fe)},children:[(0,d.jsx)("div",{className:"studio-nav-outline",style:{display:Ve?void 0:"none"},children:(0,d.jsx)(N,{items:de,active_pos:pe,on_click:e=>le.current?.goto_heading(e)})}),(0,d.jsx)("div",{className:"studio-nav-folder",style:{display:Ve?"none":void 0},children:(0,d.jsx)(p,{pre_path:u,list:t,click:async(e,t,n)=>{if("folder"===e.type){const e=await h.$M.post("studio/get/item",{path:`${n}`});if(e.code===f.m.Success){const n=[],a=[];for(const t of e.data.list)"folder"===t.type?n.push(t):"file"===t.type&&a.push(t);t([...n,...a])}}else{if(T)return void U({open:!0,handle:()=>{U({open:!1,handle:null}),B(!1),De(e,n)},title:"确定不保存就切换吗?"});De(e,n)}},active_path:G,handleContextMenu:He,fatherNowToggleExpansion:Fe})}),ae&&(0,d.jsx)("div",{className:"studio-nav-switch",children:(0,d.jsx)(o.rA,{icon:Ve?"folder":"list",title:te(Ve?"文件目录":"大纲"),onClick:()=>fe(Ve?"folder":"outline")})})]}),ve&&(0,d.jsx)("div",{className:"studio__divider",ref:H,onPointerDown:()=>{Y(!0),V.current.addEventListener("pointermove",Te)},onPointerUp:Be}),W&&(0,d.jsx)("div",{className:"shell__overlay",onPointerUp:Be}),ae?(0,d.jsx)("div",{className:"studio-editor studio-editor--md",children:(0,d.jsx)(a.Suspense,{fallback:null,children:(0,d.jsx)(S,{pane:{path:G,url:h.$M.getDownloadUrl(encodeURIComponent(G)),name:z.name,on_dirty:ye,on_outline:(e,t)=>{ue(e),he(t)},register:e=>{le.current=e}}})})},G):se?(0,d.jsx)("div",{className:"studio-editor studio-editor--draw",children:(0,d.jsx)(a.Suspense,{fallback:null,children:(0,d.jsx)(b,{reset_key:G,url:h.$M.getDownloadUrl(encodeURIComponent(G)),save_path:G,on_dirty:B,on_saved:()=>B(!1),register:e=>{re.current=e}})})},G):oe?(0,d.jsx)("div",{className:"studio-editor studio-editor--mind",children:(0,d.jsx)(a.Suspense,{fallback:null,children:(0,d.jsx)(M,{reset_key:G,url:h.$M.getDownloadUrl(encodeURIComponent(G)),on_dirty:B,on_saved:()=>B(!1),register:e=>{ce.current=e},on_save:async e=>(await h.$M.post(`save/${encodeURIComponent(G)}`,{context:e})).code===f.m.Success})})},G):(0,d.jsx)("div",{className:"studio-editor",children:z.name&&(0,d.jsx)(a.Suspense,{fallback:null,children:(0,d.jsx)(C,{name:z.name,on_change:()=>{T||B(!0)}})})},G),je&&(0,d.jsxs)(a.Fragment,{children:[(0,d.jsx)("div",{className:"studio__divider studio__divider--chat",ref:Se,onPointerDown:e=>{e.preventDefault(),Ee(!0),document.addEventListener("pointermove",Ke),document.addEventListener("pointerup",Je,{once:!0})}}),(0,d.jsx)("div",{className:"studio-chat-panel",style:{width:`${ke}em`},children:(0,d.jsx)(a.Suspense,{fallback:null,children:(0,d.jsx)(E,{inline_header:!0,sync_url:!1,file_cwd_path:ze,session_id:be??(e=>{try{const t=sessionStorage.getItem(Ae);if(!t)return;const n=JSON.parse(t);return n?.[e]||void 0}catch{return}})(ze),on_session_change:e=>{Me(e),((e,t)=>{try{const n=sessionStorage.getItem(Ae),a=n?JSON.parse(n):{};a[e]=t,sessionStorage.setItem(Ae,JSON.stringify(a))}catch{}})(ze,e)}})})})]})]})]})}}}]);
1
+ "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[2674],{92674(e,t,n){n.r(t),n.d(t,{default:()=>A});var a=n(96540),i=n(82893),s=n(34843),o=n(85997),l=n(57952),r=n(47022),c=n(34251),d=n(74848);function u(e){{const[t,n]=(0,a.useState)(!1),[i,s]=(0,a.useState)([]),l=e=>{s(e)},p=async()=>{"folder"===e.type?(t||!e.click||i||await e.click(e,l,e.pre_path),n(!t)):e.click&&await e.click(e,l,e.pre_path)},h=async(t=!1)=>{"folder"!==e.type||t?e.fatherNowToggleExpansion&&e.fatherNowToggleExpansion():await e.click(e,l,e.pre_path)};return(0,a.useEffect)(()=>{s(e.children)},[e.children]),(0,d.jsxs)("div",{className:"studio-item",children:[(0,d.jsxs)("div",{onClick:p,onContextMenu:t=>{t.stopPropagation(),t.nativeEvent.stopImmediatePropagation(),e.handleContextMenu&&e.handleContextMenu(t,e.name,e.pre_path,e.type===r.Iw.folder,h)},className:"studio-item-title"+(e.active_path===e.pre_path?" studio-item-title--active":""),children:[(0,d.jsx)("i",{className:"material-icons studio-item-title-tag","data-icon":t?"arrow_drop_down":"arrow_right",children:"file"==e.type?"":t?"arrow_drop_down":"arrow_right"}),(0,d.jsx)("span",{className:"file-icons",children:(0,d.jsx)("span",{"data-type":(0,c.uL)(e.name),"data-dir":"folder"===e.type,"aria-label":e.name,children:(0,d.jsx)(o.In,{icon:"",aria_label:e.name})})}),(0,d.jsx)("span",{className:"studio-item-name",children:e.name})]}),t&&i&&(0,d.jsx)("div",{style:{marginLeft:20},children:i.map((t,n)=>(0,d.jsx)(a.Fragment,{children:(0,d.jsx)(u,{type:t.type,size:t.size,click:e.click,name:t.name,children:t.children,pre_path:`${e.pre_path}${t.name}${t.type===r.Iw.folder?"/":""}`,handleContextMenu:e.handleContextMenu,active_path:e.active_path,fatherNowToggleExpansion:h},n)},n))})]})}}n(61443);function p(e){return(0,d.jsx)("div",{children:e.list.map((t,n)=>(0,d.jsx)(u,{pre_path:`${e.pre_path}${t.name}${t.type===r.Iw.folder?"/":""}`,name:t.name,type:t.type,handleContextMenu:e.handleContextMenu,fatherNowToggleExpansion:e.fatherNowToggleExpansion,active_path:e.active_path,children:t.children,click:e.click,size:t.size},n))})}var h=n(14284),m=n(34289),f=n(53459),v=n(78247),_=(n(62042),n(2543)),x=n(89824),y=n(22022),w=n(88815),g=n(61973),j=n(23430),k=n(99214);const C=a.lazy(()=>Promise.all([n.e(2543),n.e(4091)]).then(n.bind(n,84091))),S=a.lazy(()=>Promise.all([n.e(4946),n.e(1384),n.e(9334),n.e(1075),n.e(1142)]).then(n.bind(n,71142))),N=a.lazy(()=>n.e(4877).then(n.bind(n,64877))),E=a.lazy(()=>Promise.all([n.e(4946),n.e(2626),n.e(9334),n.e(4004)]).then(n.bind(n,95733))),b=a.lazy(()=>Promise.all([n.e(8090),n.e(5744)]).then(n.bind(n,16575))),M=a.lazy(()=>Promise.all([n.e(1417),n.e(8781),n.e(2479)]).then(n.bind(n,12479)));function A(e){const[t,n]=(0,a.useState)([]),[u,A]=(0,a.useState)(""),[I,P]=(0,a.useState)(""),[$,R]=(0,a.useState)(!1),[z,F]=(0,a.useState)({path:"",name:""}),[G,D]=(0,a.useState)(""),[L,U]=(0,s.fp)(i.AG.confirm),[T,B]=(0,a.useState)(!1),[K,J]=(0,s.fp)(i.AG.fileShellShow),[O,X]=(0,s.fp)(i.AG.file_shell_hidden),H=(0,a.useRef)(null),V=(0,a.useRef)(null),[W,Y]=(0,a.useState)(!1),[Z,q]=(0,a.useState)(16),[Q,ee]=(0,s.fp)(i.AG.showPrompt),{t:te}=(0,y.Bd)(),ne=(0,g.Zp)(),ae=(ie=z.name,(0,c.uL)(ie)===r.Iw.md);var ie;const se=function(e){return(0,c.uL)(e)===r.Iw.excalidraw}(z.name),oe=function(e){return(0,c.uL)(e)===r.Iw.mind}(z.name),le=(0,a.useRef)(null),re=(0,a.useRef)(null),ce=(0,a.useRef)(null),[de,ue]=(0,a.useState)([]),[pe,he]=(0,a.useState)(-1),[me,fe]=(0,a.useState)("folder"),[ve,_e]=(0,a.useState)(!0),[xe,ye]=(0,a.useState)(!1),we=(0,k.oT)(),[ge]=(0,g.ok)(),je="1"===ge.get("chat_open"),[ke,Ce]=(0,s.fp)(i.AG.studio_chat_width),Se=(0,a.useRef)(null),[Ne,Ee]=(0,a.useState)(!1),[be,Me]=(0,a.useState)(void 0),Ae="studio_chat_session";let Ie=(0,g.zy)().pathname.split("/").filter(Boolean).pop();Ie=decodeURIComponent(Ie);const{check_user_auth:Pe}=(0,v.MH)(),[$e]=(0,s.fp)(i.AG.user_base_info),Re=Pe(j.oV.ai_agent_page);(0,a.useEffect)(()=>{$e?.user_data&&je&&!Re&&we("chat_open",null)},[je,Re,$e]);const ze=(0,m.GG)("file",Ie);const Fe=async()=>{const e=(0,m.GG)("file",Ie);A(e),F({path:e,name:(0,m.mH)(e)});const t=await h.$M.post("studio/get/item",{path:e});if(t.code===f.m.Success){const e=[],a=[];for(const n of t.data.list)"folder"===n.type?e.push(n):"file"===n.type&&a.push(n);n([...e,...a])}};(0,a.useEffect)(()=>{P(""),B(!1),Fe()},[]);const Ge=async(e,t)=>{const n=await h.$M.get(`${encodeURIComponent(t)}`);P(n.data),v.xK.set_value_temp(n.data),F({path:t,name:e}),D(t),fe("folder"),ye(!1)},De=(e,t)=>{e.size>w.o5?U({open:!0,handle:()=>{Ge(e.name,t),U({open:!1,handle:null}),B(!1)},title:"超过20MB了还要打开吗?"}):Ge(e.name,t)};async function Le(){if(!T)return;const e={context:v.xK.get_editor_value()};0===(await h.$M.post(`save/${encodeURIComponent(G)}`,e)).code&&B(!1)}const Ue=e=>{e.ctrlKey&&"s"===e.key&&(e.preventDefault(),T&&Le())};(0,a.useEffect)(()=>(document.addEventListener("keydown",Ue),()=>{document.removeEventListener("keydown",Ue)}),[T]);const Te=(0,a.useCallback)(_.throttle(e=>{const t=parseFloat(getComputedStyle(V.current).fontSize),n=window.innerWidth/t-4,a=e.clientX/t,i=2.25+H.current.offsetWidth/t;a<=n&&a>=i&&q(parseFloat(a.toFixed(2)))},32),[]),Be=()=>{Y(!1),V.current.removeEventListener("pointermove",Te)},Ke=(0,a.useCallback)(_.throttle(e=>{const t=Se.current;if(!t)return;const n=parseFloat(getComputedStyle(t).fontSize),a=t.parentElement.getBoundingClientRect().right-e.clientX,i=.7*t.parentElement.getBoundingClientRect().width,s=Math.min(Math.max(a,320),i);Ce(parseFloat((s/n).toFixed(2)))},32),[]),Je=()=>{Ee(!1),document.removeEventListener("pointermove",Ke)},Oe=[{r:te("创建文件"),v:"创建文件"},{r:te("创建目录"),v:"创建目录"},{r:te("重命名"),v:"重命名"},{r:te("删除"),v:"删除"}],Xe=[{r:te("重命名"),v:"重命名"},{r:te("删除"),v:"删除"}],He=(e,t,n,a,i)=>{e.preventDefault();const s=new c.ik;s.path=n,s.filename=t,s.x=e.clientX,s.y=e.clientY,s.items=a?Oe:Xe,i===Fe&&(s.items=s.items.slice(0,2)),s.type=a?r.Iw.studio_folder:r.Iw.studio_file;const o=e=>{i(e)};s.textClick=e=>{switch(e){case"创建文件":ee({show:!0,type:x.PromptEnum.FileNew,overlay:!0,data:{dir:n,call:o}});break;case"创建目录":ee({show:!0,type:x.PromptEnum.DirNew,overlay:!0,data:{dir:n,call:o}});break;case"删除":if(T&&(z.path===n||z.path.includes(n))){const e=()=>{o(a),B(!1),F({}),P(""),v.xK.set_value_temp("")};ee({show:!0,type:x.PromptEnum.FilesDelete,overlay:!0,data:{path:n,call:e,filename:t}});break}ee({show:!0,type:x.PromptEnum.FilesDelete,overlay:!0,data:{path:n,filename:t,call:a?()=>{o(!0)}:o}});break;case"重命名":ee({show:!0,type:x.PromptEnum.FileRename,overlay:!0,data:{path:n,dir:(0,m.Yp)(n),call:()=>{o(!0)},filename:t}})}},ee({show:!0,type:x.PromptEnum.FileMenu,overlay:!1,data:s})};const Ve=ae&&"outline"===me;return(0,d.jsxs)("div",{className:"studio studio--file",children:[(0,d.jsxs)(l.A,{ignore_tags:!0,left_children:[(0,d.jsx)(o.rA,{title:"取消",icon:"close",onClick:()=>{J({show:!1,path:""}),X(void 0),ne(-1)}},1),(0,d.jsx)("div",{children:z.name},2)],children:[(0,d.jsx)("title",{children:z.name}),(0,d.jsx)(o.rA,{title:"侧边栏",icon:"list",onClick:()=>_e(e=>!e),selected:ve}),ae&&[xe?(0,d.jsx)(o.rA,{title:te("保存"),icon:"save",onClick:()=>le.current?.save()},"save"):null,(0,d.jsx)(o.rA,{icon:"source"===le.current?.mode()?"edit":"code",title:"source"===le.current?.mode()?te("实时编辑模式"):te("源码模式"),onClick:()=>le.current?.toggle_mode()},"mode"),(0,d.jsx)(o.rA,{title:te("导出PDF"),icon:"print",onClick:()=>le.current?.export_pdf()},"pdf")],!ae&&(0,c.zr)(z.name)&&(0,d.jsx)(o.rA,{title:"格式化",icon:"data_object",onClick:function(){v.xK.get_editor()?.formatCode()}}),(0,d.jsx)(o.rA,{icon:"terminal",title:"shell",onClick:function(){!0!==O&&!1!==O?K.show?J({show:!1,path:""}):(J({show:!0,path:(0,m.GG)("file",Ie)}),X(!1)):X(!O)}}),Pe(j.oV.ai_agent_page)&&(0,d.jsx)(o.rA,{title:te("AI 聊天"),icon:"smart_toy",selected:je,onClick:()=>we("chat_open",!je?"1":null)}),ae?xe?(0,d.jsx)(o.rA,{title:te("保存"),icon:"save",onClick:()=>le.current?.save()}):null:se?(0,d.jsx)(o.rA,{title:te("保存"),icon:"save",onClick:()=>re.current?.save()}):oe?(0,d.jsx)(o.rA,{title:te("保存"),icon:"save",onClick:()=>ce.current?.save()}):T?(0,d.jsx)(o.rA,{title:"保存",icon:"save",onClick:Le}):null]}),(0,d.jsxs)("div",{className:"studio-body",ref:V,children:[(0,d.jsxs)("div",{className:"studio-nav",style:{display:ve?void 0:"none",width:Z-1+"em"},onContextMenu:e=>{He(e,z.name,(0,m.GG)("file",Ie),!0,Fe)},children:[(0,d.jsx)("div",{className:"studio-nav-outline",style:{display:Ve?void 0:"none"},children:(0,d.jsx)(N,{items:de,active_pos:pe,on_click:e=>le.current?.goto_heading(e)})}),(0,d.jsx)("div",{className:"studio-nav-folder",style:{display:Ve?"none":void 0},children:(0,d.jsx)(p,{pre_path:u,list:t,click:async(e,t,n)=>{if("folder"===e.type){const e=await h.$M.post("studio/get/item",{path:`${n}`});if(e.code===f.m.Success){const n=[],a=[];for(const t of e.data.list)"folder"===t.type?n.push(t):"file"===t.type&&a.push(t);t([...n,...a])}}else{if(T)return void U({open:!0,handle:()=>{U({open:!1,handle:null}),B(!1),De(e,n)},title:"确定不保存就切换吗?"});De(e,n)}},active_path:G,handleContextMenu:He,fatherNowToggleExpansion:Fe})}),ae&&(0,d.jsx)("div",{className:"studio-nav-switch",children:(0,d.jsx)(o.rA,{icon:Ve?"folder":"list",title:te(Ve?"文件目录":"大纲"),onClick:()=>fe(Ve?"folder":"outline")})})]}),ve&&(0,d.jsx)("div",{className:"studio__divider",ref:H,onPointerDown:()=>{Y(!0),V.current.addEventListener("pointermove",Te)},onPointerUp:Be}),W&&(0,d.jsx)("div",{className:"shell__overlay",onPointerUp:Be}),ae?(0,d.jsx)("div",{className:"studio-editor studio-editor--md",children:(0,d.jsx)(a.Suspense,{fallback:null,children:(0,d.jsx)(S,{pane:{path:G,url:h.$M.getDownloadUrl(encodeURIComponent(G)),name:z.name,on_dirty:ye,on_outline:(e,t)=>{ue(e),he(t)},register:e=>{le.current=e}}})})},G):se?(0,d.jsx)("div",{className:"studio-editor studio-editor--draw",children:(0,d.jsx)(a.Suspense,{fallback:null,children:(0,d.jsx)(b,{reset_key:G,url:h.$M.getDownloadUrl(encodeURIComponent(G)),save_path:G,on_dirty:B,on_saved:()=>B(!1),register:e=>{re.current=e}})})},G):oe?(0,d.jsx)("div",{className:"studio-editor studio-editor--mind",children:(0,d.jsx)(a.Suspense,{fallback:null,children:(0,d.jsx)(M,{reset_key:G,url:h.$M.getDownloadUrl(encodeURIComponent(G)),on_dirty:B,on_saved:()=>B(!1),register:e=>{ce.current=e},on_save:async e=>(await h.$M.post(`save/${encodeURIComponent(G)}`,{context:e})).code===f.m.Success})})},G):(0,d.jsx)("div",{className:"studio-editor",children:z.name&&(0,d.jsx)(a.Suspense,{fallback:null,children:(0,d.jsx)(C,{name:z.name,on_change:()=>{T||B(!0)}})})},G),je&&(0,d.jsxs)(a.Fragment,{children:[(0,d.jsx)("div",{className:"studio__divider studio__divider--chat",ref:Se,onPointerDown:e=>{e.preventDefault(),Ee(!0),document.addEventListener("pointermove",Ke),document.addEventListener("pointerup",Je,{once:!0})}}),(0,d.jsx)("div",{className:"studio-chat-panel",style:{width:`${ke}em`},children:(0,d.jsx)(a.Suspense,{fallback:null,children:(0,d.jsx)(E,{inline_header:!0,sync_url:!1,file_cwd_path:ze,session_id:be??(e=>{try{const t=sessionStorage.getItem(Ae);if(!t)return;const n=JSON.parse(t);return n?.[e]||void 0}catch{return}})(ze),on_session_change:e=>{Me(e),((e,t)=>{try{const n=sessionStorage.getItem(Ae),a=n?JSON.parse(n):{};a[e]=t,sessionStorage.setItem(Ae,JSON.stringify(a))}catch{}})(ze,e)}})})})]})]})]})}}}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[3233,5614],{33616(e){var n;self,n=()=>(()=>{"use strict";var e,n={};return e=n,Object.defineProperty(e,"__esModule",{value:!0}),e.FitAddon=void 0,e.FitAddon=class{activate(e){this._terminal=e}dispose(){}fit(){const e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;const n=this._terminal._core;this._terminal.rows===e.rows&&this._terminal.cols===e.cols||(n._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal)return;if(!this._terminal.element||!this._terminal.element.parentElement)return;const e=this._terminal._core,n=e._renderService.dimensions;if(0===n.css.cell.width||0===n.css.cell.height)return;const t=0===this._terminal.options.scrollback?0:e.viewport.scrollBarWidth,r=window.getComputedStyle(this._terminal.element.parentElement),o=parseInt(r.getPropertyValue("height")),i=Math.max(0,parseInt(r.getPropertyValue("width"))),s=window.getComputedStyle(this._terminal.element),l=o-(parseInt(s.getPropertyValue("padding-top"))+parseInt(s.getPropertyValue("padding-bottom"))),a=i-(parseInt(s.getPropertyValue("padding-right"))+parseInt(s.getPropertyValue("padding-left")))-t;return{cols:Math.max(2,Math.floor(a/n.css.cell.width)),rows:Math.max(1,Math.floor(l/n.css.cell.height))}}},n})(),e.exports=n()},40654(e,n,t){"use strict";t.r(n),t.d(n,{default:()=>E});var r=t(96540),o=t(33616),i=(t(97856),t(85072)),s=t.n(i),l=t(97825),a=t.n(l),c=t(77659),d=t.n(c),u=t(55056),m=t.n(u),p=t(10540),h=t.n(p),x=t(41113),f=t.n(x),g=t(86739),v={};v.styleTagTransform=f(),v.setAttributes=m(),v.insert=d().bind(null,"head"),v.domAPI=a(),v.insertStyleElement=h();s()(g.A,v);g.A&&g.A.locals&&g.A.locals;var y=t(40505),_=t(62042),b=t(84369),w=t(74848);function E(e){const[n,t]=(0,r.useState)(25),i=(0,r.useRef)(null),s=(0,r.useCallback)(new o.FitAddon,[]),l=(0,r.useRef)(null),a=(0,r.useRef)(null),{dragging:c,on_pointer_down:d,on_pointer_up:u}=(0,b.y)({direction:"vertical",target_ref:l,get_start_size:()=>n,px_to_unit:e=>e/parseFloat(getComputedStyle(l.current).fontSize),min:()=>{const e=parseFloat(getComputedStyle(l.current).fontSize);return 2.25+i.current.offsetHeight/e},max:()=>{const e=parseFloat(getComputedStyle(l.current).fontSize);return window.innerHeight/e-4},throttle:32,on_change:e=>{s.fit(),t(parseFloat(e.toFixed(2)))}});if((0,r.useEffect)(()=>{e.terminal&&(e.terminal.options.convertEol=!0,e.terminal.open(a.current),e.terminal.loadAddon(s),s.fit(),e.init&&e.init(e.terminal.rows,e.terminal.cols),e.terminal.attachCustomKeyEventHandler(n=>{if(n.ctrlKey&&"c"===n.key){const t=e.terminal.getSelection();if(t)return(0,y.lW)(t),(0,_.SK)("已复制"),n.preventDefault(),e.terminal.focus(),!1}else if("keydown"===n.type&&"v"===n.key&&n.ctrlKey)return!1;return!0}))},[e.terminal]),(0,r.useEffect)(()=>()=>{e.terminal&&e.terminal.dispose()},[]),e.show)return e.get_simple?(0,w.jsx)("div",{className:"pty",style:{height:"100%"},ref:a}):(0,w.jsxs)("div",{className:"shell",style:{height:`${n}em`,display:""+(e.file_shell_hidden?"none":"block")},ref:l,children:[(0,w.jsx)("div",{className:"shell__divider",ref:i,onPointerDown:d,onPointerUp:u}),(0,w.jsx)("div",{className:"pty",style:{height:n-1+"em"},ref:a}),c&&(0,w.jsx)("div",{className:"shell__overlay",onPointerUp:u})]})}},85614(e,n,t){"use strict";t.r(n),t.d(n,{default:()=>s});var r=t(96540),o=(t(40654),t(74848));const i=r.lazy(()=>Promise.resolve().then(t.bind(t,40654)));function s(e){return(0,o.jsx)(r.Fragment,{children:(0,o.jsx)(i,{...e})})}},84369(e,n,t){"use strict";t.d(n,{y:()=>s});var r=t(96540),o=t(2543);function i(e){if(void 0!==e)return"function"==typeof e?e():e}function s(e){const{direction:n="vertical",target_ref:t,get_start_size:s,px_to_unit:l,min:a,max:c,throttle:d,on_change:u,on_drag_end:m}=e,[p,h]=(0,r.useState)(!1),x=(0,r.useRef)(null),f=(0,r.useRef)(u);f.current=u;const g=e=>"vertical"===n?e.clientY:e.clientX,v=(0,r.useRef)({direction:n,get_start_size:s,px_to_unit:l,min:a,max:c,get_pos:g});v.current={direction:n,get_start_size:s,px_to_unit:l,min:a,max:c,get_pos:g};const y=(0,r.useCallback)(e=>{const n=x.current;if(!n)return;const{px_to_unit:t,min:r,max:o,get_pos:s}=v.current,l=n.pos-s(e);let a=n.size+t(l);const c=i(r),d=i(o);void 0!==c&&(a=Math.max(c,a)),void 0!==d&&(a=Math.min(d,a)),f.current(a)},[]),_=r.useMemo(()=>void 0===d?y:o.throttle(e=>y(e),d),[d,y]),b=(0,r.useCallback)(()=>{x.current=null,h(!1);const e=_;"function"==typeof e.cancel&&e.cancel(),m?.()},[_,m]),w=(0,r.useCallback)(e=>{const{get_start_size:n,get_pos:t}=v.current;x.current={pos:t(e),size:n()},h(!0)},[]);return(0,r.useEffect)(()=>{if(!p)return;const e=t?.current??window;return e.addEventListener("pointermove",_),e.addEventListener("pointerup",b),()=>{e.removeEventListener("pointermove",_),e.removeEventListener("pointerup",b)}},[p,_,b,t]),(0,r.useEffect)(()=>{const e=_;return()=>{"function"==typeof e.cancel&&e.cancel()}},[_]),{dragging:p,on_pointer_down:w,on_pointer_up:b}}},86739(e,n,t){"use strict";var r=t(31601),o=t.n(r),i=t(76314),s=t.n(i)()(o());s.push([e.id,'/**\n * Copyright (c) 2014 The xterm.js authors. All rights reserved.\n * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)\n * https://github.com/chjj/term.js\n * @license MIT\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the "Software"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n *\n * Originally forked from (with the author\'s permission):\n * Fabrice Bellard\'s javascript vt100 for jslinux:\n * http://bellard.org/jslinux/\n * Copyright (c) 2011 Fabrice Bellard\n * The original design remains. The terminal itself\n * has been extended to include xterm CSI codes, among\n * other features.\n */\n\n/**\n * Default styles for xterm.js\n */\n\n.xterm {\n cursor: text;\n position: relative;\n user-select: none;\n -ms-user-select: none;\n -webkit-user-select: none;\n}\n\n.xterm.focus,\n.xterm:focus {\n outline: none;\n}\n\n.xterm .xterm-helpers {\n position: absolute;\n top: 0;\n /**\n * The z-index of the helpers must be higher than the canvases in order for\n * IMEs to appear on top.\n */\n z-index: 5;\n}\n\n.xterm .xterm-helper-textarea {\n padding: 0;\n border: 0;\n margin: 0;\n /* Move textarea out of the screen to the far left, so that the cursor is not visible */\n position: absolute;\n opacity: 0;\n left: -9999em;\n top: 0;\n width: 0;\n height: 0;\n z-index: -5;\n /** Prevent wrapping so the IME appears against the textarea at the correct position */\n white-space: nowrap;\n overflow: hidden;\n resize: none;\n}\n\n.xterm .composition-view {\n /* TODO: Composition position got messed up somewhere */\n background: #000;\n color: #FFF;\n display: none;\n position: absolute;\n white-space: nowrap;\n z-index: 1;\n}\n\n.xterm .composition-view.active {\n display: block;\n}\n\n.xterm .xterm-viewport {\n /* On OS X this is required in order for the scroll bar to appear fully opaque */\n background-color: #000;\n overflow-y: scroll;\n cursor: default;\n position: absolute;\n right: 0;\n left: 0;\n top: 0;\n bottom: 0;\n}\n\n.xterm .xterm-screen {\n position: relative;\n}\n\n.xterm .xterm-screen canvas {\n position: absolute;\n left: 0;\n top: 0;\n}\n\n.xterm .xterm-scroll-area {\n visibility: hidden;\n}\n\n.xterm-char-measure-element {\n display: inline-block;\n visibility: hidden;\n position: absolute;\n top: 0;\n left: -9999em;\n line-height: normal;\n}\n\n.xterm.enable-mouse-events {\n /* When mouse events are enabled (eg. tmux), revert to the standard pointer cursor */\n cursor: default;\n}\n\n.xterm.xterm-cursor-pointer,\n.xterm .xterm-cursor-pointer {\n cursor: pointer;\n}\n\n.xterm.column-select.focus {\n /* Column selection mode */\n cursor: crosshair;\n}\n\n.xterm .xterm-accessibility:not(.debug),\n.xterm .xterm-message {\n position: absolute;\n left: 0;\n top: 0;\n bottom: 0;\n right: 0;\n z-index: 10;\n color: transparent;\n pointer-events: none;\n}\n\n.xterm .xterm-accessibility-tree:not(.debug) *::selection {\n color: transparent;\n}\n\n.xterm .xterm-accessibility-tree {\n user-select: text;\n white-space: pre;\n}\n\n.xterm .live-region {\n position: absolute;\n left: -9999px;\n width: 1px;\n height: 1px;\n overflow: hidden;\n}\n\n.xterm-dim {\n /* Dim should not apply to background, so the opacity of the foreground color is applied\n * explicitly in the generated class and reset to 1 here */\n opacity: 1 !important;\n}\n\n.xterm-underline-1 { text-decoration: underline; }\n.xterm-underline-2 { text-decoration: double underline; }\n.xterm-underline-3 { text-decoration: wavy underline; }\n.xterm-underline-4 { text-decoration: dotted underline; }\n.xterm-underline-5 { text-decoration: dashed underline; }\n\n.xterm-overline {\n text-decoration: overline;\n}\n\n.xterm-overline.xterm-underline-1 { text-decoration: overline underline; }\n.xterm-overline.xterm-underline-2 { text-decoration: overline double underline; }\n.xterm-overline.xterm-underline-3 { text-decoration: overline wavy underline; }\n.xterm-overline.xterm-underline-4 { text-decoration: overline dotted underline; }\n.xterm-overline.xterm-underline-5 { text-decoration: overline dashed underline; }\n\n.xterm-strikethrough {\n text-decoration: line-through;\n}\n\n.xterm-screen .xterm-decoration-container .xterm-decoration {\n\tz-index: 6;\n\tposition: absolute;\n}\n\n.xterm-screen .xterm-decoration-container .xterm-decoration.xterm-decoration-top-layer {\n\tz-index: 7;\n}\n\n.xterm-decoration-overview-ruler {\n z-index: 8;\n position: absolute;\n top: 0;\n right: 0;\n pointer-events: none;\n}\n\n.xterm-decoration-top {\n z-index: 2;\n position: relative;\n}\n',""]);const l=s;t.d(n,["A",0,l])}}]);