filecat 7.8.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 (130) 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.294792ef5d360ad64abc.js +1 -0
  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.15ca3c6ac911cf6e6e2f.js +1 -0
  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.407cafe944a297471f5a.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/6010.5400c344149450c83284.js +1 -0
  38. package/build/dist/{6247.917e3fbef5dc5fbaf937.js → 6247.525b0b68872036ac2fa6.js} +1 -1
  39. package/build/dist/{7520.fbb0bc2a05cf94e15418.js → 6322.552511b5cb12cd0c821c.js} +1 -1
  40. package/build/dist/6492.17ecd8515fa512ce9306.js +1 -0
  41. package/build/dist/{676.a75318a8b598d8daadf0.js → 676.356039ef6f28f96b8c8b.js} +1 -1
  42. package/build/dist/{6805.bf0c964ab84f0fcc78be.js → 6805.373ac0e7d6555e4a6459.js} +1 -1
  43. package/build/dist/{6919.8cf13c01184b7148b28e.js → 6919.c7cc8617b658198d4924.js} +1 -1
  44. package/build/dist/{7038.4e4fc8e405c56d3080e2.js → 7038.166f915547d27e4dc5e4.js} +1 -1
  45. package/build/dist/{7759.0b68912ff9ef10869f59.js → 7759.7cd3fe8e5d37df25804c.js} +1 -1
  46. package/build/dist/7873.e3098bc6f510e5bea55f.js +1 -0
  47. package/build/dist/7923.d44556578af4d3d7cea3.js +2 -0
  48. package/build/dist/7943.acf25a5e98dd13290985.js +1 -0
  49. package/build/dist/8090.8977224618a14ae42159.js +2 -0
  50. package/build/dist/8302.ce97557b7cf7c8387942.js +1 -0
  51. package/build/dist/8319.6a6b9651c87a1bb4cbb9.js +1 -0
  52. package/build/dist/{8603.4142ce42c1635f493eca.js → 8603.f1cbcfd64cde885f9809.js} +1 -1
  53. package/build/dist/8649.d6055ad75975b803bbc1.js +1 -0
  54. package/build/dist/{8727.3628c746061aed7a4077.js → 8727.8658835acb7e0b6e5acc.js} +1 -1
  55. package/build/dist/{8765.a5633d054abb67142fc3.js → 8765.8758c290a6b132f2ce7f.js} +1 -1
  56. package/build/dist/8772.2c35012c25ac9eb5f74d.js +2 -0
  57. package/build/dist/{8772.e8f9731c1c061f1cdf56.js.LICENSE.txt → 8772.2c35012c25ac9eb5f74d.js.LICENSE.txt} +1 -1
  58. package/build/dist/8781.6bd14487d172e004e3d3.js +1 -0
  59. package/build/dist/9299.7358ccf05b1415ed7959.js +1 -0
  60. package/build/dist/9334.a25983aafdcbde63ae5e.js +1 -0
  61. package/build/dist/{9546.e7206c968e92371ae2b1.js → 9546.2cecad04cf676a6616cd.js} +1 -1
  62. package/build/dist/dark.css +839 -839
  63. package/build/dist/filerobot-image-editor.min.js +42445 -42445
  64. package/build/dist/google-dark.css +2032 -2032
  65. package/build/dist/google.css +1719 -1719
  66. package/build/dist/index.html +1 -1
  67. package/build/dist/main.ab3398f34c41e61310ae.js +2 -0
  68. package/build/dist/{main.98bb29605335d9b2219f.js.LICENSE.txt → main.ab3398f34c41e61310ae.js.LICENSE.txt} +1 -1
  69. package/build/dist/rle.js +17867 -17867
  70. package/build/main.js +1 -1
  71. package/build/plugin/core.type.d.ts +62 -0
  72. package/build/threads.work.filecat.js +1 -1
  73. package/env +26 -26
  74. package/package.json +211 -211
  75. package/shell/build.js +161 -161
  76. package/shell/config/.babelrc +14 -14
  77. package/shell/config/base.webpack.config.js +78 -78
  78. package/shell/config/common-bin.config.js +44 -44
  79. package/shell/config/env.js +10 -10
  80. package/shell/config/prebuild-file-path.js +17 -17
  81. package/shell/config/webpack.exe.config.js +36 -36
  82. package/shell/config/webpack.npm.config.js +44 -44
  83. package/shell/config/webpack.web.config.js +152 -152
  84. package/shell/dev.js +51 -51
  85. package/shell/docker-build.sh +2 -2
  86. package/shell/filecat +1 -1
  87. package/shell/filecat-watch +1 -1
  88. package/shell/install.js +48 -48
  89. package/shell/net-agent/git-clone.bat +23 -23
  90. package/shell/net-agent/git-pull.bat +17 -17
  91. package/shell/net-agent/git-push.bat +17 -17
  92. package/shell/pkg.ts +50 -50
  93. package/shell/postinstall-optional.js +29 -29
  94. package/shell/start/filecat-install.sh +22 -22
  95. package/shell/start/filecat-run.sh +2 -2
  96. package/shell/start/windows-install.js +178 -178
  97. package/shell/start/windows-uninstall.js +131 -131
  98. package/shell/util/file.js +46 -46
  99. package/build/dist/1075.493acb74297c1e753de2.js +0 -1
  100. package/build/dist/1384.0d0fc5faa899c9eddcbe.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/2479.15722ac55b05c521f4f7.js +0 -1
  104. package/build/dist/2542.23fb13b1623c9f7c3fc1.js +0 -1
  105. package/build/dist/2626.05d1faa293e0a3318b9b.js +0 -1
  106. package/build/dist/2674.0c822a9c458f923a4eff.js +0 -1
  107. package/build/dist/2851.2195b5906b2c224c7bf7.js +0 -1
  108. package/build/dist/3140.794a212da633caf38b3a.js +0 -2
  109. package/build/dist/3233.fb6bffd5e097e4ac9423.js +0 -1
  110. package/build/dist/3299.d01f5a742d80f4e6e25b.js +0 -1
  111. package/build/dist/4004.de90f1192487a24a0a9a.js +0 -1
  112. package/build/dist/4437.4d5a0965043471411a00.js +0 -1
  113. package/build/dist/4986.78047106f3a0d2d71199.js +0 -1
  114. package/build/dist/5272.0b70ee8ec5f083fb9f5b.js +0 -1
  115. package/build/dist/5614.fb6bffd5e097e4ac9423.js +0 -1
  116. package/build/dist/6010.2da6f8c2fce5292557cb.js +0 -1
  117. package/build/dist/6492.3ee4060598de873d8e8f.js +0 -1
  118. package/build/dist/7756.2f851693ba030c42dde8.js +0 -1
  119. package/build/dist/7873.11d04b741d2b499d9cb9.js +0 -1
  120. package/build/dist/7923.861345fd55941e8089a1.js +0 -2
  121. package/build/dist/7943.54c702542d55f576a576.js +0 -1
  122. package/build/dist/7954.6ce241a8ed27cb26efc6.js +0 -1
  123. package/build/dist/8302.c1c381630b4ec76bf8ab.js +0 -1
  124. package/build/dist/8319.c15a3674ec7abc493595.js +0 -1
  125. package/build/dist/8772.e8f9731c1c061f1cdf56.js +0 -2
  126. package/build/dist/9299.ed4de6cd4f4bfa0a966a.js +0 -1
  127. package/build/dist/main.98bb29605335d9b2219f.js +0 -2
  128. /package/build/dist/{4946.c95d4f426146e0180172.js.LICENSE.txt → 4946.d578f6ba367a742d80bf.js.LICENSE.txt} +0 -0
  129. /package/build/dist/{7923.861345fd55941e8089a1.js.LICENSE.txt → 7923.d44556578af4d3d7cea3.js.LICENSE.txt} +0 -0
  130. /package/build/dist/{3140.794a212da633caf38b3a.js.LICENSE.txt → 8090.8977224618a14ae42159.js.LICENSE.txt} +0 -0
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[4004,6010],{83277(e,s,t){t.d(s,{$j:()=>i,Lv:()=>n});class n{token;open=!1;note;index;url;model;request_type;json_params;sys_prompt;dotenv="";tool_mode=!1;show_options;static get_label_by_v(e,s){if(!e||!s?.length)return e;for(const t of s)if(t.value===e)return t.label;return e}static have_label_by_v(e,s){if(!e||!s?.length)return!1;for(const t of s)if(t.value===e)return!0;return!1}}const a=JSON.stringify({stream:!0,thinking:{type:"disabled"}});function i(e){return"string"==typeof e?e:Array.isArray(e)?e.map(e=>"text"===e.type?e.text:"[图片]").join("\n"):""}t.d(s,["CP",0,'\n\n\n\n# 聊天循环最大次数\ntool_call_max=500\n# 是否允许AI直接执行命令而不需要用户确认,默认为false,需要用户手动确认,如果使用 workflow 这里等价于为 true\nallow_exec_cmd_directly=false\n\n# 可选的代理 url,如果指定了所有访问大模型的请求将会走代理\n#proxy_url=\n\n# 可选的多个url 以数组分割\n# options_agent_url_list=[{"value":"http://..","label":"openai"}]\n\n# 可选的多个 key\n# options_agent_key_list=[{"value":"sh-aaa","label":"option1"}]\n\n# 可选的多个 model\n# options_agent_model_list=[{"value":"gpt-5.5","label":"gpt"}]\n\n# 存放本地的 prompt 文件 用于每次聊天的时候自动读取并加载\n# options_local_file_path_prompt_list=["/prompt/a.txt"]\n\n# 开启切换模型 ,开启以后,你可以自己写 prompt 提供多个模型让 ai 自己根据每次聊天切换下一步调用其他模型的次数\n# open_pick_model=false\n\n# 压缩后仍然完整保留的最近消息数\nmax_recent_messages=12\n# 当单个会话累计消息条数超过该值时,触发历史消息裁剪\ncompress_message_count=16\n# 历史消息中 tool 输出的最大字符数,只保留调用形式让 AI 知道调用了就行\nmax_tool_content_chars=200\n\n# ===== 模型类型(request_type)=====\n# 必填项,不同类型的 model 接口格式不同,默认 completions。\n# 可选值:\n# completions 标准对话/聊天补全 (chat/completions)\n# images 图片生成 (images/generations)\n# audio_speech 文本转语音 (audio/speech)\n# audio_transcription 语音转文字 (audio/transcriptions)\n# audio_translation 语音翻译 (audio/translations)\n# embeddings 向量嵌入 (embeddings)\n#request_type=completions\n\n# ===== 成为 tool(tool_mode)=====\n# 开启后该模型会作为一个工具被加载,可实现不同模型担任不同角色/能力,供 AI agent 在对话中动态调用。\n# 注意:不能与「是否开启」(open) 同时为 true。\n#tool_mode=false\n\n# ===== 是否支持图片(support_image)=====\n# 开启后:1) 注册 read_image 工具,让 AI 能读取本地图片;\n# 2) 工具读到的图片会以 OpenAI 多模态格式 image_url 随消息发给模型,模型就能真正"看图"。\n# 关闭后:AI 看不到图片,read_image 只会返回一句文字说明。\n# 主流模型(gpt-4o、豆包、qwen-vl、deepseek-vl 等)都支持,默认开启。\nsupport_image=true\n',"cL",0,a])},95733(e,s,t){t.r(s),t.d(s,{default:()=>ne});var n=t(96540),a=t(34843),i=t(22022),o=t(61973),c=t(92275),r=t(14284),l=t(7463),d=t(21499),u=t(64694),m=t(78247),h=t(40505),g=t(62042),p=t(45907),_=t(53459),f=t(72693),x=t(82893),j=t(61443),v=t(83277);function b(e){return null==e||e<0?"0":e.toLocaleString()}function w(e){const s=[];if(e.attachments?.length&&s.push(e.attachments.map(e=>`[附件] ${e.name}`).join("\n")),e.content_list?.length)for(const t of e.content_list){const e=(0,v.$j)(t.content);if(e&&s.push(e),t.tool_call_ends?.length){const e=t.tool_call_ends.map(e=>{const s=e.tool_display_name||e.tool_name;return e.success?`[工具] ${s} 成功`:`[工具] ${s} 失败`});s.push(e.join("\n"))}}return e.text&&!s.length&&s.push(e.text),e.images?.length&&s.push(`[生成图片 ${e.images.length} 张]`),e.audio&&s.push("[音频]"),s.join("\n\n")}function y(e){const s=(0,v.$j)(e.content);if(s)return s;const t=e.content_list??[];return t.length?t.map(e=>(0,v.$j)(e.content)).filter(Boolean).join("\n\n"):""}function S(e=[]){return e.filter(e=>"user"===e.role||"assistant"===e.role).map((e,s)=>({id:Date.now()+s,sender:"assistant"===e.role?"bot":"user",text:y(e),attachments:e.attachments??[],content_list:e.content_list,images:e.images,audio:e.audio,embeddings:e.embeddings,elapsed_ms:e.elapsed_ms}))}const N=/\.(md|txt|json|js|jsx|ts|tsx|css|html?|xml|ya?ml|py|java|go|rs|c|cpp|h|hpp|sh|bat|cmd|ini|toml|csv|log|sql|env|gitignore|dockerfile)$/i;function k(e){return e.type?.startsWith("image/")?"image":e.type?.startsWith("text/")||N.test(e.name)?"text":"binary"}function C(e){return e.text()}function A(e){return new Promise((s,t)=>{const n=new FileReader;n.onload=()=>s(n.result),n.onerror=t,n.readAsDataURL(e)})}async function $(e){const s=[];for(const t of e){const e=k(t);let n="";if("text"===e)try{const e=await C(t),s=12e4;n=e.length>s?`${e.slice(0,s)}\n\n[内容已截断,原始长度 ${e.length} 字符]`:e}catch{n="[文本读取失败]"}else if("image"===e)try{n=await A(t)}catch{n=`[图片文件: ${t.name}]`}else n=`[二进制文件: ${t.name}]`;s.push({name:t.name,mime_type:t.type,size:t.size,kind:e,content:n})}return s}var I=t(14944);var M=t(85997),R=t(34299),D=t(74848);function H(e){const s=e.attachments&&e.attachments.length>0?(0,D.jsx)("div",{className:"chat-message-attachments",children:e.attachments.map((e,s)=>(0,D.jsxs)("div",{className:"chat-message-attachment",children:[(0,D.jsx)(M.In,{icon:"attach_file"}),(0,D.jsx)("span",{children:e.name}),(0,D.jsxs)("small",{children:[e.size," B"]})]},`${e.name}_${s}`))}):null,t=[];e.images&&"bot"===e.sender&&t.push((0,D.jsx)(n.Fragment,{children:(0,D.jsx)(E,{images:e.images,text:e.text})},"images")),e.audio&&"bot"===e.sender&&t.push((0,D.jsx)(n.Fragment,{children:(0,D.jsx)(T,{audio:e.audio,text:e.text})},"audio")),e.embeddings&&"bot"===e.sender&&t.push((0,D.jsx)(n.Fragment,{children:(0,D.jsx)(B,{embeddings:e.embeddings,text:e.text})},"embeddings"));const a=function(e){if("bot"!==e.sender||!e.content_list?.length)return e.text?(0,D.jsx)(R.default,{context:e.text}):null;return(0,D.jsxs)(D.Fragment,{children:[e.content_list.map((e,s)=>{const t=[],a=(0,v.$j)(e.content);return a&&t.push((0,D.jsx)(n.Fragment,{children:(0,D.jsx)(R.default,{context:a})},`content-${s}`)),e.tool_call_ends?.length&&t.push((0,D.jsx)(n.Fragment,{children:(0,D.jsx)(V,{callList:e.tool_call_ends})},`tool-${s}`)),(0,D.jsx)(n.Fragment,{children:t},`part-${s}`)}),!e.content_list.some(e=>e.content)&&e.text?(0,D.jsx)(R.default,{context:e.text}):null]})}(e);return 0===t.length?(0,D.jsxs)(D.Fragment,{children:[s,a]}):(0,D.jsxs)(D.Fragment,{children:[t,s,a]})}function V({callList:e}){const[s,t]=n.useState(!1);if(!e?.length)return null;e.filter(e=>e.success).length;const a=e.filter(e=>!e.success).length;return(0,D.jsxs)("div",{className:"chat-message-call-list",children:[(0,D.jsxs)("div",{className:"call-list-header",onClick:()=>t(!s),children:[(0,D.jsx)(M.In,{icon:s?"expand_less":"expand_more"}),(0,D.jsxs)("span",{className:"call-list-summary",children:["工具调用 (",e.length,")",a>0&&(0,D.jsx)("span",{className:"call-list-fail",children:" 失败 "})]})]}),s&&(0,D.jsx)("div",{className:"call-list-body",children:e.map((e,s)=>(0,D.jsxs)("div",{className:"call-list-item "+(e.success?"call-success":"call-fail"),children:[(0,D.jsxs)("div",{className:"call-list-item-header",children:[(0,D.jsx)(M.In,{icon:e.success?"check_circle":"error"}),(0,D.jsx)("span",{className:"call-list-tool-name",children:e.tool_display_name||e.tool_name}),(0,D.jsxs)("span",{className:"call-list-duration",children:[e.duration_ms,"ms"]})]}),e.tool_args&&(0,D.jsxs)("details",{className:"call-list-details",children:[(0,D.jsx)("summary",{children:"参数"}),(0,D.jsx)("pre",{className:"call-list-pre",children:JSON.stringify(e.tool_args,null,2)})]}),!e.success&&e.error&&(0,D.jsxs)("details",{className:"call-list-details",children:[(0,D.jsx)("summary",{children:"错误"}),(0,D.jsx)("pre",{className:"call-list-pre call-list-error-text",children:e.error})]}),e.success&&e.tool_result&&(0,D.jsxs)("details",{className:"call-list-details",children:[(0,D.jsx)("summary",{children:"结果"}),(0,D.jsx)("pre",{className:"call-list-pre",children:e.tool_result.length>500?e.tool_result.slice(0,500)+"...":e.tool_result})]})]},s))})]})}function E({images:e,text:s}){let t=e||[];if(!t.length&&s)try{t=JSON.parse(s).data||[]}catch{}return t.length?(0,D.jsxs)("div",{className:"image-generation-result",children:[t.map((e,s)=>(0,D.jsxs)("div",{className:"image-generation-item",children:[e.url&&(0,D.jsx)("div",{className:"image-generation-image-wrapper",children:(0,D.jsx)("img",{src:e.url,alt:e.revised_prompt||`生成的图片 ${s+1}`,loading:"lazy"})}),e.b64_json&&(0,D.jsx)("div",{className:"image-generation-image-wrapper",children:(0,D.jsx)("img",{src:`data:image/png;base64,${e.b64_json}`,alt:`生成的图片 ${s+1}`})}),e.revised_prompt&&(0,D.jsx)("p",{className:"image-generation-prompt",children:(0,D.jsx)("small",{children:e.revised_prompt})})]},s)),s&&!e&&(0,D.jsx)(R.default,{context:s})]}):(0,D.jsx)(R.default,{context:s||""})}function T({audio:e,text:s}){if(e){if(e.url)return(0,D.jsx)("div",{className:"audio-result",children:(0,D.jsx)("audio",{controls:!0,src:e.url,children:"您的浏览器不支持音频播放"})});if(e.data){const s=e.mime_type||"audio/mpeg";return(0,D.jsx)("div",{className:"audio-result",children:(0,D.jsx)("audio",{controls:!0,src:`data:${s};base64,${e.data}`,children:"您的浏览器不支持音频播放"})})}}const t=s||"";if(t.startsWith("http://")||t.startsWith("https://"))return(0,D.jsx)("div",{className:"audio-result",children:(0,D.jsx)("audio",{controls:!0,src:t,children:"您的浏览器不支持音频播放"})});try{const e=JSON.parse(t);if(e?.data||e?.audio_data){const s=e.data||e.audio_data;return(0,D.jsx)("div",{className:"audio-result",children:(0,D.jsx)("audio",{controls:!0,src:`data:audio/mpeg;base64,${s}`,children:"您的浏览器不支持音频播放"})})}}catch{}return(0,D.jsx)(R.default,{context:t})}function K({content:e,label:s}){const[t,a]=n.useState(!1);return(0,D.jsxs)("button",{className:"embeddings-copy-btn",onClick:()=>{(0,h.lW)(e),a(!0),setTimeout(()=>a(!1),1500)},children:[(0,D.jsx)(M.In,{icon:t?"check":"content_copy"}),t?"已复制":s||"复制"]})}function B({embeddings:e,text:s}){let t=e||null;if(!t&&s)try{t=JSON.parse(s)}catch{return(0,D.jsx)(R.default,{context:s})}if(!t)return(0,D.jsx)(R.default,{context:s||""});const n=t?.data||[],a=t?.usage,i=JSON.stringify(t,null,2);return(0,D.jsxs)("div",{className:"embeddings-result",children:[(0,D.jsxs)("div",{className:"embeddings-summary",children:[(0,D.jsx)("strong",{children:"向量嵌入结果"}),(0,D.jsxs)("span",{children:["维度: ",n[0]?.embedding?.length??"N/A"]}),(0,D.jsxs)("span",{children:["数量: ",n.length]}),a&&(0,D.jsxs)("span",{children:["使用 tokens: ",a.total_tokens??"N/A"]})]}),(0,D.jsxs)("div",{className:"embeddings-toolbar",children:[(0,D.jsx)(K,{content:i,label:"复制全部结果"}),n.length>0&&n[0]?.embedding&&(0,D.jsx)(K,{content:JSON.stringify(n[0].embedding,null,2),label:"复制第一条向量"}),n.length>0&&(0,D.jsx)(K,{content:JSON.stringify(n.map(e=>e.embedding),null,2),label:"复制所有向量数据"})]}),n.length>0&&n[0]?.embedding&&(0,D.jsx)("div",{className:"embeddings-preview",children:(0,D.jsxs)("span",{children:["向量预览: [",n[0].embedding.slice(0,5).join(", "),n[0].embedding.length>5?", ...":"","]"]})}),n.length>0&&(0,D.jsxs)("details",{children:[(0,D.jsx)("summary",{children:"查看详细数据"}),(0,D.jsx)("pre",{className:"embeddings-raw",children:i})]})]})}async function z(e,s,t,n){try{switch(e){case"images":{const e=await async function(e,s){const t={prompt:e,session_id:s},n=await r.jV.post("images/generations",t);if(0!==n.code)throw new Error(n.message||"图片生成失败");const a=n.data||{},i=(a.data||[]).map(e=>({url:e.url,b64_json:e.b64_json,revised_prompt:e.revised_prompt})),o=i.map((e,s)=>`![生成图片${s+1}](${e.url||`data:image/png;base64,${e.b64_json}`})${e.revised_prompt?`\n> ${e.revised_prompt}`:""}`).join("\n\n");return{session_id:a.session_id||s,images:i,text:o||`生成了 ${i.length} 张图片`}}(s,t);return e&&n(e.text,{images:e.images}),!0}case"audio_speech":{const e=await async function(e,s){const t={input:e,session_id:s};try{const e=localStorage.getItem("ai_audio_extra_params");if(e){const s=JSON.parse(e);s.voice&&(t.voice=s.voice),s.speed&&(t.speed=parseFloat(s.speed))}}catch{}const n=localStorage.getItem("token")||"",a=await fetch("/api/ai_agent/audio/speech",{method:"POST",headers:{"Content-Type":"application/json",Authorization:n},body:JSON.stringify(t)});if(!a.ok)throw new Error(`语音合成失败: ${a.statusText}`);const i=a.headers.get("X-Session-Id")||s,o=await a.arrayBuffer();return{session_id:i,audio:{data:btoa(String.fromCharCode(...Array.from(new Uint8Array(o)))),mime_type:a.headers.get("content-type")||"audio/mpeg"},text:`[音频文件: ${e.slice(0,50)}...]`}}(s,t);return e&&n(e.text,{audio:e.audio}),!0}case"embeddings":{const e=await async function(e,s){const t=await r.jV.post("embeddings",{input:e,session_id:s});if(0!==t.code)throw new Error(t.message||"Embeddings 请求失败");const n=t.data||{},a=n?.data??[],i=`向量维度: ${a[0]?.embedding?.length??0}, 数量: ${a.length}`;return{session_id:n.session_id||s,embeddings:n,text:`✅ Embeddings 结果 - ${i}\n\`\`\`json\n${JSON.stringify(n,null,2).slice(0,2e3)}\n\`\`\``}}(s,t);return e&&n(e.text,{embeddings:e.embeddings}),!0}default:return!1}}catch(e){return n(`请求失败: ${e?.message||JSON.stringify(e)}`),!0}}var P=t(4412),L=t(23430),F=t(87361),O=t(80389),q=t(7523),G=t(23496);const U=({currentModelName:e,setCurrentModelName:s,modelGroups:t,onModelChanged:c,sysPromptList:l,batchMode:d,selectedMsgCount:u,sessionVisible:h,onToggleSessionPanel:p,onCreateSession:f,onToggleBatchMode:v,onBatchDeleteMessages:b,bgProcessVisible:w,bgProcessCount:y,onToggleBgProcess:S,selectedSysPromptId:N,setSelectedSysPromptId:k,inline:C})=>{const{t:A}=(0,i.Bd)(),$=(0,o.Zp)(),{check_user_auth:I}=(0,m.MH)(),[,R]=(0,a.fp)(x.AG.ai_session_collapsed),{open:H}=function(){const{t:e}=(0,i.Bd)(),[,s]=(0,a.fp)(x.AG.prompt_card),[t,o]=(0,a.fp)(x.AG.ai_chat_zoom),{initUserInfo:c}=(0,n.useContext)(q.F);return{open:()=>{const n=t,a=()=>s({open:!1});s({open:!0,title:e("缩放调整"),context_div:(0,D.jsx)(O.p,{defaultValue:t,onChange:o,min:30,max:200}),cancel:()=>{o(n),a()},confirm:async()=>{let s=100;o(e=>(s=e<30||e>200?100:e,s)),await r.wm.post(G.s.user_save_private_attr,{is_ai_chat_zoom:!0,ai_chat_zoom:s}),(0,g.SK)(e("缩放调整成功")),c(),a()}})}}}(),V=I(L.oV.ai_model_switch)||I(L.oV.ai_agent_setting),E=[];for(const e of t)for(const s of e.models)E.push({title:s.label||s.value,value:`${e.index}::${s.value}`,group:e.note});const T=t.find(e=>e.active),K=T?`${T.index}::${e}`:"",B=(0,D.jsxs)(n.Fragment,{children:[(0,D.jsx)(M.rA,{icon:"menu",title:A("会话"),onClick:p,selected:h}),(0,D.jsx)(M.rA,{icon:"add",title:A("新会话"),onClick:()=>f()}),l.length>0&&(0,D.jsx)(j.l6,{value:N,options:[{title:A("选择系统提示词"),value:""},...l.map(e=>({title:e.note||e.prompt.slice(0,30),value:String(e.index)}))],onChange:e=>{k(e)},no_border:!0,width:"auto"}),V&&E.length>0&&(0,D.jsx)(j.l6,{value:K,options:[{title:A("选择模型"),value:""},...E],margin:"0 0 0 1em",onChange:e=>{const t=String(e??"");if(!t.includes("::"))return;const[n,...a]=t.split("::"),i=a.join("::");i&&(s(i),r.jV.post("set_active_model",{index:Number(n),model_name:i}).then(e=>{e?.code===_.m.Success?((0,g.SK)("success"),c()):(0,g.zN)(e?.message||"fail")}).catch(console.error))},no_border:!0,width:"auto"}),d&&u>0&&(0,D.jsx)(M.rA,{icon:"delete",title:A("删除选中消息"),onClick:b}),(0,D.jsx)(M.rA,{icon:"zoom_in",title:A("缩放调整"),onClick:H}),(0,D.jsx)(M.rA,{icon:"terminal",title:A("后台进程"),onClick:S,selected:w,tip:y||null}),I(L.oV.ai_agent_setting)&&(0,D.jsx)(M.rA,{icon:"smart_toy",title:"机器人配置",onClick:()=>{$(F.o.ai_rebot_setting_page)}}),I(L.oV.ai_agent_setting)&&(0,D.jsx)(M.rA,{icon:"settings",title:"ai setting",onClick:()=>{$(F.o.ai_agent_setting_page)}})]});return C?(0,D.jsx)("div",{className:"chat-inline-header",children:B}):(0,D.jsx)(P.aZ,{position:"right",children:B})};var J=t(89824);function W({sessions:e,activeSessionId:s,onSelectSession:t,onReorderSessions:a,onRenameSession:o,onDeleteSession:c,onToggleCmdAuto:r,onShowUsageStats:l,onShowSessionSetting:d,batchMode:u,selectedSessionIds:m,onToggleSessionSelect:h,onToggleBatchMode:g,onBatchDeleteSessions:p,onClearAllSessions:_,allUsersMode:f,onToggleAllUsersMode:x,showAllUsersEntry:j}){const{t:v}=(0,i.Bd)(),[b,w]=(0,n.useState)(""),[y,S]=(0,n.useState)(null),[N,k]=(0,n.useState)(null),C=!!a&&!f,A=b.trim()?e.filter(e=>(e.title||"").toLowerCase().includes(b.toLowerCase())||(e.summary||"").toLowerCase().includes(b.toLowerCase())||(e.long_term_memory||"").toLowerCase().includes(b.toLowerCase())||f&&(e.owner_name||"").toLowerCase().includes(b.toLowerCase())):e;return(0,D.jsxs)("aside",{className:"chat-session-list",children:[(0,D.jsx)("div",{className:"chat-session-search",children:(0,D.jsx)("input",{type:"text",className:"chat-session-search-input",placeholder:v("搜索会话"),value:b,onChange:e=>w(e.target.value)})}),(0,D.jsx)("div",{className:"chat-session-items-wrap",children:A.map((e,n)=>{return(0,D.jsx)("div",{children:(0,D.jsxs)("button",{className:`chat-session-item ${s===e.id?"active":""} ${u?"batch-mode":""} ${e.running?"is-running":""} ${y===n?"row-dragging":""} ${N===n&&null!==y&&y!==n?"row-drop-target":""}`,draggable:C,onDragStart:()=>S(n),onDragOver:e=>{null!==y&&(e.preventDefault(),N!==n&&k(n))},onDragEnd:()=>{S(null),k(null)},onDrop:e=>{e.preventDefault(),(e=>{const s=y;if(S(null),k(null),null===s||s===e||!a)return;const t=A[s]?.id,n=A[e]?.id;t&&n&&a(t,n)})(n)},onClick:()=>{u&&h?h(e.id):t(e.id)},title:e.summary||e.long_term_memory||e.title,children:[u&&(0,D.jsx)("input",{type:"checkbox",className:"chat-session-checkbox",checked:m?.has(e.id)??!1,onChange:()=>h?.(e.id),onClick:e=>e.stopPropagation()}),(0,D.jsx)("span",{children:(i=e.title,i||"新会话")}),f&&e.owner_name&&(0,D.jsx)("em",{className:"chat-session-owner",title:e.owner_name,children:e.owner_name}),e.running&&(0,D.jsx)("span",{className:"chat-session-running",title:v("正在执行中")}),(0,D.jsx)("small",{children:e.message_count}),"web"!==e.source&&(0,D.jsx)("em",{className:"chat-session-source",children:e.source}),!u&&(0,D.jsx)(J.MenuSelect,{list:[{name:v("重命名"),click:()=>o(e.id,e.title)},...f?[]:[{name:v("移动到最上"),click:()=>{const s=A[0];s&&s.id!==e.id&&a?.(e.id,s.id)}},{name:v("移动到最下"),click:()=>{const s=A[A.length-1];s&&s.id!==e.id&&a?.(e.id,s.id)}}],{name:e.cmd_auto_allow?v("命令检测关闭"):v("命令检测开启"),click:()=>r?.(e.id,!e.cmd_auto_allow)},{name:v("字符消耗统计"),click:()=>l(e.id)},{name:v("设置"),click:()=>d?.(e.id)},{name:v("删除"),click:()=>c(e.id)}],children:(0,D.jsx)(M.In,{icon:"more_horiz"})})]})},e.id);var i})}),(0,D.jsxs)("div",{className:"chat-session-actions",children:[(0,D.jsx)(M.rA,{icon:u?"check_circle":"checklist",title:v(u?"取消批量选择":"批量选择"),onClick:g}),j&&!u&&(0,D.jsx)(M.rA,{icon:f?"person":"groups",title:v(f?"仅看我的会话":"查看所有用户会话"),onClick:x}),u&&(m?.size??0)>0&&(0,D.jsx)(M.rA,{icon:"delete",title:v("删除选中会话"),onClick:p}),!u&&_&&(0,D.jsx)(M.rA,{icon:"delete_sweep",title:v("删除全部会话"),onClick:_})]})]})}function Q(e){const s=(e.text||"").split("\n").map(e=>e.trim()).find(Boolean)||"";return s.length>80?s.slice(0,80)+"…":s}const X=({messages:e,batchMode:s,selectedMsgIds:t,sending:a,chatContainerRef:i,messagesEndRef:o,onToggleMsgSelect:c,onDelete:r,onCopy:l,onCopyAll:u,onToggleBatchMode:m,onBatchCopy:h,onBatchDelete:g,showBatchBar:p,t:_})=>{const[f,x]=(0,n.useState)(new Set),j=(0,n.useMemo)(()=>e.filter(e=>!e.is_loading).map(e=>e.id),[e]),v=e=>{x(s=>{const t=new Set(s);return t.has(e)?t.delete(e):t.add(e),t})},b=()=>{x(e=>e.size>0&&j.every(s=>e.has(s))?new Set:new Set(j))};return(0,D.jsxs)("div",{className:"chat-messages",ref:i,"data-sending":a?"true":"false",children:[p&&(0,D.jsxs)("div",{className:"chat-message-batch-bar",children:[(0,D.jsxs)("span",{className:"batch-bar-count",children:[_("已选")," ",t.size]}),(0,D.jsx)("button",{onClick:h,children:_("复制所选")}),(0,D.jsx)("button",{onClick:g,className:"danger",children:_("删除所选")}),(0,D.jsx)("button",{onClick:m,children:_("取消")})]}),e.map(e=>{const n=f.has(e.id);return(0,D.jsxs)("div",{className:`chat-message ${e.sender} ${s?"batch-mode":""} ${e.is_loading?"is-loading":""} ${n?"collapsed":""}`,children:[s&&(0,D.jsx)("input",{type:"checkbox",className:"chat-message-checkbox",checked:t.has(e.id),onChange:()=>c(e.id)}),e.is_loading?(0,D.jsxs)("div",{className:"ai-loading-bubble",children:[(0,D.jsxs)("div",{className:"ai-loading-dots",children:[(0,D.jsx)("span",{className:"ai-loading-dot"}),(0,D.jsx)("span",{className:"ai-loading-dot"}),(0,D.jsx)("span",{className:"ai-loading-dot"})]}),(0,D.jsx)("span",{className:"ai-loading-text",children:e.text})]}):(0,D.jsxs)(D.Fragment,{children:[n?(0,D.jsxs)("div",{className:"chat-message-summary",title:e.text,onClick:()=>v(e.id),children:[(0,D.jsx)("span",{className:"chat-message-summary-icon",children:"▸"}),(0,D.jsx)("span",{className:"chat-message-summary-text",children:Q(e)||_("(无内容)")})]}):(0,D.jsx)("div",{className:"chat-message-body",children:H(e)}),(0,D.jsxs)("div",{className:"message-collapse-bar",children:[(0,D.jsx)("button",{onClick:()=>v(e.id),children:_(n?"展开":"折叠")}),(0,D.jsx)("button",{onClick:b,children:_("全部折叠")}),"bot"===e.sender&&null!=e.elapsed_ms&&(0,D.jsx)("span",{className:"message-elapsed",children:(0,d.kf)(e.elapsed_ms)})]}),(0,D.jsx)("div",{className:"message-actions",children:s?(0,D.jsx)("button",{onClick:()=>c(e.id),children:t.has(e.id)?_("取消选择"):_("选择")}):(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)("button",{onClick:()=>r(e.id),children:_("删除")}),(0,D.jsx)("button",{onClick:()=>l(e),children:_("复制")}),(0,D.jsx)("button",{onClick:u,children:_("全部复制")}),(0,D.jsx)("button",{onClick:m,children:_("多选")})]})})]})]},e.id)}),(0,D.jsx)("div",{ref:o})]})},Z=(0,n.forwardRef)(function({placeholder:e="",disabled:s=!1,className:t,style:a,onEnter:i,onPaste:o,onChange:c},r){const l=(0,n.useRef)(null),[d,u]=(0,n.useState)(!0),[m,h]=(0,n.useState)(!1),g=(0,n.useCallback)(()=>{const e=l.current;return e?(e.textContent??"").replace(/\u00A0/g," ").trimEnd():""},[]);(0,n.useImperativeHandle)(r,()=>({getValue:()=>g(),setValue:e=>{const s=l.current;if(!s)return;s.textContent=e,u(!e);const t=document.createRange();t.selectNodeContents(s),t.collapse(!1);const n=window.getSelection();n?.removeAllRanges(),n?.addRange(t)},clear:()=>{const e=l.current;e&&(e.textContent="",u(!0))},focus:()=>l.current?.focus()})),(0,n.useEffect)(()=>{const e=l.current;if(!e)return;const s=()=>u(!e.textContent);return e.addEventListener("input",s),()=>e.removeEventListener("input",s)},[]);return(0,D.jsx)("div",{ref:l,contentEditable:!s,suppressContentEditableWarning:!0,className:"rich-textarea"+(t?" "+t:""),style:a,onKeyDown:e=>{m||"Enter"!==e.key||e.shiftKey||e.ctrlKey||e.metaKey||e.altKey||(e.preventDefault(),i?.())},onPaste:o,onInput:()=>c?.(g()),onCompositionStart:()=>h(!0),onCompositionEnd:()=>h(!1),"data-placeholder":d?e:void 0})});var Y=t(84369);function ee({pendingAttachments:e,onRemove:s}){return 0===e.length?null:(0,D.jsx)("div",{className:"chat-attachment-strip",children:e.map((e,t)=>(0,D.jsxs)("div",{className:"chat-attachment-chip",children:[(0,D.jsx)(M.In,{icon:"attach_file"}),(0,D.jsx)("span",{title:e.name,children:e.name}),(0,D.jsx)("button",{type:"button",onClick:()=>s(t),children:(0,D.jsx)(M.In,{icon:"close"})})]},`${e.name}_${t}`))})}const se=(0,n.forwardRef)(({onSend:e,sending:s,onAbort:t,pendingAttachments:o,onRemoveAttachment:c,onOpenFilePicker:r,onAddFiles:l,onDrop:d,onDragOver:u,fileInputRef:m,readonly:h=!1},g)=>{const{t:p}=(0,i.Bd)(),_=(0,n.useRef)(null),f=(0,n.useRef)(null),[j,v]=(0,a.fp)(x.AG.ai_chat_input_height);(0,n.useImperativeHandle)(g,()=>({getValue:()=>_.current?.getValue()??"",setValue:e=>_.current?.setValue(e),clear:()=>_.current?.clear()}));const{dragging:b,on_pointer_down:w,on_pointer_up:y}=(0,Y.y)({direction:"vertical",get_start_size:()=>j,px_to_unit:e=>e/(()=>{const e=f.current;return e&&parseFloat(getComputedStyle(e).fontSize)||16})(),min:2,on_change:e=>v(e)}),S={minHeight:`${j}em`,maxHeight:`${j}em`};return(0,D.jsxs)("div",{ref:f,className:"chat-input-area"+(h?" readonly":""),onDrop:h?void 0:d,onDragOver:h?void 0:u,children:[!h&&(0,D.jsx)("div",{className:"chat-input-resize-handle"+(b?" dragging":""),onPointerDown:w}),(0,D.jsx)("input",{ref:m,type:"file",multiple:!0,style:{display:"none"},onChange:e=>{e.target.files?.length&&(l(e.target.files),e.currentTarget.value="")}}),(0,D.jsxs)("div",{className:"chat-input-shell",children:[(0,D.jsx)(ee,{pendingAttachments:o,onRemove:c}),(0,D.jsx)(Z,{ref:_,placeholder:p(h?"查看全部会话时不可发送消息":"输入消息"),disabled:h,onEnter:()=>e(),onPaste:e=>{const s=e.clipboardData?.files;s&&s.length>0&&(e.preventDefault(),l(s))},className:"chat-input",style:S})]}),!h&&(0,D.jsx)(M.rA,{title:p("添加文件"),icon:"attach_file",onClick:r}),h?(0,D.jsx)("button",{className:"little-button button",disabled:!0,children:p("发送")}):s?(0,D.jsx)(M.Vi,{color:"var( --icon-red)",text:p("暂停"),clickFun:t}):(0,D.jsx)(M.Vi,{text:p("发送"),clickFun:e}),b&&(0,D.jsx)("div",{className:"chat-input-overlay",onPointerUp:y})]})}),te=function(e){const{t:s}=(0,i.Bd)(),[t,o]=(0,n.useState)([]),[r,l]=(0,n.useState)(!1),[d,u]=(0,n.useState)(null),[m,h]=(0,n.useState)(null),[p,_]=(0,n.useState)(!1),[f,j]=(0,a.fp)(x.AG.ai_bg_expanded),[,v]=(0,a.fp)(x.AG.ai_session_collapsed),b=()=>{j(!1)},w=(0,n.useCallback)(async()=>{l(!0);try{const s=new c.hf(c.HK.ai_bg_process_list_req);s.context={};const t=await I.ws.send(s);t?.context?.processes&&(o(t.context.processes),e.panelRef?.current?.onCountChange?.(t.context.processes.length))}catch(e){console.error("获取后台进程列表失败",e)}finally{l(!1)}},[]);e.panelRef&&(e.panelRef.current.refresh=w);const y=(0,n.useCallback)(async e=>{_(!0),u(e);try{const s=new c.hf(c.HK.ai_bg_process_output_req);s.context={pid:e};const t=await I.ws.send(s);h(t.context)}catch(e){console.error("获取进程输出失败",e),(0,g.zN)("获取进程输出失败")}finally{_(!1)}},[]),S=(0,n.useCallback)(async e=>{try{const s=new c.hf(c.HK.ai_bg_process_kill_req);s.context={pid:e};const t=await I.ws.send(s);t?.context?.success?((0,g.SK)("进程已终止"),w(),d===e&&(u(null),h(null))):(0,g.zN)(t?.context?.message||"终止失败")}catch(e){console.error("终止进程失败",e),(0,g.zN)("终止进程失败")}},[w,d]);(0,n.useEffect)(()=>{w();const e=setInterval(w,5e3);return()=>clearInterval(e)},[w]);const N=t.filter(e=>e.running),k=t.filter(e=>!e.running);return(0,D.jsxs)(D.Fragment,{children:[f&&(0,D.jsx)("div",{className:"chat-session-overlay",onClick:b}),(0,D.jsxs)("aside",{className:"chat-bg-process-panel "+(f?"expanded":""),children:[(0,D.jsxs)("div",{className:"chat-bg-process-header",children:[(0,D.jsx)("span",{className:"chat-bg-process-title",children:s("后台进程")}),(0,D.jsx)(M.rA,{icon:"close",title:s("关闭"),onClick:b})]}),(0,D.jsxs)("div",{className:"chat-bg-process-toolbar",children:[(0,D.jsx)(M.rA,{icon:"refresh",title:s("刷新"),onClick:w}),(0,D.jsxs)("span",{className:"chat-bg-process-count",children:[N.length," ",s("个运行中"),k.length>0&&` / ${k.length} ${s("个已退出")}`]})]}),(0,D.jsxs)("div",{className:"chat-bg-process-list",children:[r&&0===t.length&&(0,D.jsx)("div",{className:"chat-bg-process-empty",children:s("加载中...")}),!r&&0===t.length&&(0,D.jsx)("div",{className:"chat-bg-process-empty",children:s("暂无后台进程")}),N.map(e=>(0,D.jsxs)("div",{className:`chat-bg-process-item ${d===e.pid?"active":""} running`,children:[(0,D.jsxs)("div",{className:"chat-bg-process-item-main",onClick:()=>y(e.pid),children:[(0,D.jsxs)("span",{className:"chat-bg-process-pid",children:["PID: ",e.pid]}),(0,D.jsx)("span",{className:"chat-bg-process-cmd",title:e.cmd,children:e.cmd.length>40?e.cmd.slice(0,40)+"...":e.cmd}),(0,D.jsx)("span",{className:"chat-bg-process-time",children:new Date(e.start_time).toLocaleTimeString()}),(0,D.jsx)("span",{className:"chat-bg-process-status running-dot",title:s("运行中"),children:"●"})]}),(0,D.jsxs)("div",{className:"chat-bg-process-item-actions",children:[(0,D.jsx)(M.rA,{icon:"terminal",title:s("查看输出"),onClick:()=>y(e.pid)}),(0,D.jsx)(M.rA,{icon:"stop",title:s("终止进程"),onClick:()=>S(e.pid)})]})]},e.pid)),k.map(e=>(0,D.jsx)("div",{className:`chat-bg-process-item ${d===e.pid?"active":""} finished`,children:(0,D.jsxs)("div",{className:"chat-bg-process-item-main",onClick:()=>y(e.pid),children:[(0,D.jsxs)("span",{className:"chat-bg-process-pid",children:["PID: ",e.pid]}),(0,D.jsx)("span",{className:"chat-bg-process-cmd",title:e.cmd,children:e.cmd.length>30?e.cmd.slice(0,30)+"...":e.cmd}),(0,D.jsx)("span",{className:"chat-bg-process-time",children:new Date(e.start_time).toLocaleTimeString()}),(0,D.jsxs)("span",{className:"chat-bg-process-exit-code",children:["exit: ",e.exit_code]})]})},e.pid))]}),null!==d&&(0,D.jsxs)("div",{className:"chat-bg-process-output",children:[(0,D.jsxs)("div",{className:"chat-bg-process-output-header",children:[(0,D.jsxs)("span",{children:["PID: ",d," ",s("输出")]}),(0,D.jsx)(M.rA,{icon:"close",title:s("关闭"),onClick:()=>{u(null),h(null)}})]}),(0,D.jsx)("div",{className:"chat-bg-process-output-content",children:p?(0,D.jsx)("div",{className:"chat-bg-process-empty",children:s("加载中...")}):m?(0,D.jsx)("pre",{className:"chat-bg-process-output-pre",children:m.output||s("(无输出)")}):null})]})]})]})};function ne(e={}){const{inline_header:s=!1,session_id:t,file_cwd_path:v,sync_url:y=!0,on_session_change:N}=e,{t:k}=(0,i.Bd)(),[C,A]=(0,o.ok)(),M=y&&C.get("session")||"",R=e=>{y&&A(s=>{const t=new URLSearchParams(s);return e?t.set("session",e):t.delete("session"),t},{replace:!0})},H=(0,p.y)(),{check_user_auth:V}=(0,m.MH)();(0,f.w)();const[E,T]=(0,n.useState)([]),[K,B]=(0,n.useState)([]),[P,L]=(0,n.useState)(!1),[F,O]=(0,n.useState)(""),[q,G]=(0,n.useState)(null),[J,Q]=(0,n.useState)(!1),Z=(0,n.useRef)(null),[Y,ee]=(0,n.useState)([]),[ne]=(0,a.fp)(x.AG.user_base_info),ae=!!ne?.user_data?.is_root,[ie,oe]=(0,a.fp)(x.AG.ai_session_collapsed),[ce,re]=(0,a.fp)(x.AG.ai_bg_expanded),[le,de]=(0,a.fp)(x.AG.prompt_card),[ue]=(0,a.fp)(x.AG.ai_chat_zoom),[me,he]=(0,n.useState)(!1),[ge,pe]=(0,n.useState)(new Set),[_e,fe]=(0,n.useState)(new Set),[xe,je]=(0,n.useState)(""),ve=(0,n.useRef)(null),be=(0,n.useRef)(null),we=(0,n.useRef)(null),ye=(0,n.useRef)(!0),Se=(0,n.useRef)(null),Ne=(0,n.useRef)(0),ke=(0,n.useRef)(null),Ce=(0,n.useRef)({}),Ae=(0,n.useRef)(F),$e=(0,n.useRef)(q);(0,n.useEffect)(()=>{Ae.current=F},[F]),(0,n.useEffect)(()=>{$e.current=q},[q]);const Ie=(0,n.useRef)({}),[Me,Re]=(0,n.useState)([]),[De,He]=(0,n.useState)(""),[Ve,Ee]=(0,n.useState)([]),Te=async()=>{try{const e=await r.jV.get("public_models");e.code===_.m.Success&&Ee(e.data?.groups??[])}catch{Ee([])}},Ke=e=>{He(e?.ai_config?.model??"")},[Be,ze]=(0,n.useState)(0),Pe=(0,n.useRef)((0,l.sg)(e=>{T(e),ye.current&&Le(!1)},50)).current,Le=(e=!1)=>{const s=we.current;s&&s.scrollTo({top:s.scrollHeight,behavior:e?"smooth":"auto"})},Fe=(0,n.useRef)(!1);(0,n.useEffect)(()=>{Fe.current=P},[P]);const Oe=(e,s={})=>r.jV.post("admin/session",{action:e,...s}),qe=async()=>{const e=Fe.current?await Oe("list_all_sessions"):await r.jV.get("sessions");e.code===_.m.Success&&B(e.data??[])},Ge=function(e){const{getMessages:s,setMessages:t,setMessagesDebounced:a,setSending:i,getActiveSessionId:o,setActiveSessionId:r,refreshSessions:l,scrollToBottom:d,buildRequestMessages:u,getSelectedSysPromptId:m}=e,h=(0,n.useRef)([]),g=(0,n.useRef)(null),p=(e,n,r)=>{const h=[...s(),n];t(h),i(e),g.current={abort:()=>{}};const p={id:n.id+1,sender:"bot",text:"AI思考中...",is_loading:!0};h.push(p),t([...h]);const _=new Map;let f=!0,x=p;const j=s=>{const t=s.context||{};if(t.session_id!==e)return;const n=t.text||"",i=t.tool_call_ends,c=t.chunk_index??0;if("[DONE]"!==n)if(f)f=!1,x.text=n,i&&(x.content_list=[{tool_call_ends:i,content:x.text,role:"assistant"}]),x.is_loading=!1,x.chunk_index=c,_.set(c,x),o()===e&&a([...h]);else{const s=_.get(c);if(s)s.text+=n,i&&(s.content_list=[{tool_call_ends:i,content:s.text,role:"assistant"}]),o()===e&&a([...h]);else{const s={id:Date.now()+Math.random(),sender:"bot",text:n,chunk_index:c};i&&(s.content_list=[{tool_call_ends:i,content:s.text,role:"assistant"}]),h.push(s),_.set(c,s),o()===e&&a([...h])}}},v=s=>{const n=s.context||{};if(n.session_id===e){if(w(),g.current=null,i(s=>s===e?null:s),x.is_loading=!1,o()===e)if(n.once_messages_list?.length){const e=S(n.once_messages_list);t(s=>{const t=s[s.length-1];return"bot"===t?.sender?[...s.slice(0,-1),...e]:[...s,...e]})}else t([...h]);l(),d(!0),r()}},b=s=>{const n=s.context||{};n.session_id===e&&(w(),g.current=null,i(s=>s===e?null:s),x.text="AI请求出错: "+(n.message||"未知错误"),x.is_loading=!1,o()===e&&t([...h]),r())},w=()=>{I.ws.off_message(`message_${c.HK.ai_chat_msg}`,j),I.ws.off_message(`message_${c.HK.ai_chat_end}`,v),I.ws.off_message(`message_${c.HK.ai_chat_error}`,b)};I.ws.addMsg(c.HK.ai_chat_msg,j),I.ws.addMsg(c.HK.ai_chat_end,v),I.ws.addMsg(c.HK.ai_chat_error,b),I.ws.sendData(c.HK.ai_chat_req,{messages:u(n),session_id:e,sys_prompt_id:m()})},_=()=>{const e=h.current;if(0===e.length)return;const s=e.shift();if(!s)return;t(e=>e.map(e=>"user"===e.sender&&e.text.includes("⏳(排队中...)")?{...e,text:e.text.replace(" ⏳(排队中...)","")}:e));const n={id:Date.now(),sender:"user",text:s.text,attachments:s.attachments};p(o(),n,_)};return{startChatStream:p,processPendingQueue:_,enqueueMessage:(e,s)=>{h.current.push({text:e,attachments:s})},getQueueLength:()=>h.current.length,abort:()=>{const e=o();e&&(I.ws.sendData(c.HK.ai_chat_abort,{session_id:e}),g.current&&(g.current=null,i(s=>s===e?null:s)))}}}({getMessages:()=>E,setMessages:T,setMessagesDebounced:Pe,setSending:G,getActiveSessionId:()=>Ae.current,setActiveSessionId:O,refreshSessions:qe,scrollToBottom:Le,buildRequestMessages:e=>{const s=(e.attachments??[]).filter(e=>"image"===e.kind);if(s.length>0){const t=[];e.text&&t.push({type:"text",text:e.text});for(const e of s)t.push({type:"image_url",image_url:{url:e.content}});return[{content:t,role:"user",attachments:e.attachments??[]}]}return[{content:e.text,role:"bot"===e.sender?"assistant":"user",attachments:e.attachments??[]}]},getSelectedSysPromptId:()=>xe}),Ue=async e=>{const s=Fe.current?await Oe("list_all_sessions"):await r.jV.get("sessions");if(s.code!==_.m.Success)return!1;const t=s.data??[];B(t);const n=null===e?t[0]?.id??"":e||F||t[0]?.id||"";if(n){const e=t.find(e=>e.id===n)?.user_id;return await Je(n,!1,e)}return T([]),O(""),R(null),!1},Je=async(e,s=!1,t)=>{const n=t??K.find(s=>s.id===e)?.user_id,a=Fe.current&&n?await Oe("get",{session_id:e,user_id:n}):await r.jV.post("session/get",{session_id:e});if(a.code!==_.m.Success||!a.data)return!1;const i=a.data;O(i.id),y&&M!==i.id&&R(i.id),N?.(i.id),Q(!!i.running),ke.current&&ke.current!==i.id&&I.ws.sendData(c.HK.ai_chat_subscribe,{session_id:ke.current,subscribe:!1}),ke.current=i.running?i.id:null,ke.current&&I.ws.sendData(c.HK.ai_chat_subscribe,{session_id:ke.current,subscribe:!0});const o=S(i.messages);return i.running&&i.live_messages?.length?T([...o,...S(i.live_messages)]):T(o),je(i.sys_prompt_id??""),s&&oe(!1),Ce.current.refresh?.(),requestAnimationFrame(()=>Le(!1)),!0},We=e=>{if(Fe.current)return K.find(s=>s.id===e)?.user_id},Qe=e=>{const s=Array.from(e??[]).filter(Boolean);s.length&&ee(e=>[...e,...s])},Xe=()=>{me&&(pe(new Set),fe(new Set)),he(e=>!e)},Ze=()=>{0!==ge.size&&H({sub_title:k("cf_msgs"),confirm_fun:async()=>{const e=[];if(E.forEach((s,t)=>{ge.has(s.id)&&e.push(t)}),T(E.filter(e=>!ge.has(e.id))),pe(new Set),he(!1),F&&e.length>0){const s=We(F);s?Oe("message_delete",{session_id:F,user_id:s,indices:e}).catch(console.error):r.jV.post("session/message/delete",{session_id:F,indices:e}).catch(console.error)}}})},Ye=async()=>{const e=await r.XO.get("ai_agent_setting/env");if(e.code===_.m.Success&&(Ie.current=e.data,Ke(e.data)),await Te(),v){const e=await(async e=>{if(!e)return null;const s=await r.jV.get("sessions");if(s.code!==_.m.Success)return null;const t=s.data??[],n=(0,d.ed)(e);if(!n)return null;const a=t.find(e=>(0,d.ed)(e.file_cwd_path)===n);if(a)return a.id;const i=await r.jV.post("session",{title:"新会话",file_cwd_path:e});return i.code!==_.m.Success?null:i.data.id})(v);!!e&&await Ue(e)||await Ue()}else if(t){await Ue(t)||await Ue()}else if(M){await Ue(M)||await Ue()}else await Ue();const s=await r.jV.get("system_prompts");s.code===_.m.Success&&Re(s.data??[])};(0,n.useEffect)(()=>{Ye(),requestAnimationFrame(()=>Le(!1)),Ce.current.onCountChange=ze,Ce.current.refresh?.();const e=e=>{const s=e?.context?.count;"number"==typeof s&&ze(s)};return I.ws.addMsg(c.HK.ai_bg_process_count_notify,e),()=>{I.ws.off_message(`message_${c.HK.ai_bg_process_count_notify}`,e)}},[]),(0,n.useEffect)(()=>{const e=we.current;if(!e)return;const s=()=>{ye.current=((e,s=120)=>{const{scrollTop:t,scrollHeight:n,clientHeight:a}=e;return n-(t+a)<s})(e)};return e.addEventListener("scroll",s),()=>e.removeEventListener("scroll",s)},[]),(0,n.useEffect)(()=>{const e=()=>Ae.current,s=()=>$e.current,t=(t,n)=>{if(e()&&e()===t){if(Se.current=null,Q(!1),ke.current===t&&(I.ws.sendData(c.HK.ai_chat_subscribe,{session_id:t,subscribe:!1}),ke.current=null),s()===t)return;n?.length?T(e=>{const s=S(n),t=e[e.length-1];return"bot"===t?.sender?[...e.slice(0,-1),...s]:[...e,...s]}):Je(t).catch(()=>{}),qe()}},n=t=>{const n=t?.context||{};if(!n.session_id)return;var a,i,o;a=n.session_id,i=n.text||"",o=n.tool_call_ends,e()&&e()===a&&s()!==a&&T(e=>{const s=e[e.length-1];if(s&&"bot"===s.sender){const t=[...e],n={...s};return n.text+=i,o&&(n.content_list=[{tool_call_ends:o,content:n.text,role:"assistant"}]),t[t.length-1]=n,Se.current=n.id,ye.current&&requestAnimationFrame(()=>Le(!1)),t}const t={id:Date.now()+Math.random(),sender:"bot",text:i};return o&&(t.content_list=[{tool_call_ends:o,content:i,role:"assistant"}]),Se.current=t.id,ye.current&&requestAnimationFrame(()=>Le(!1)),[...e,t]});const c=Date.now();c-Ne.current>1500&&(Ne.current=c,qe())},a=e=>{const s=e?.context||{};s.session_id&&t(s.session_id,s.once_messages_list)},i=e=>{const s=e?.context||{};s.session_id&&t(s.session_id)};return I.ws.addMsg(c.HK.ai_chat_msg,n),I.ws.addMsg(c.HK.ai_chat_end,a),I.ws.addMsg(c.HK.ai_chat_error,i),()=>{I.ws.off_message(`message_${c.HK.ai_chat_msg}`,n),I.ws.off_message(`message_${c.HK.ai_chat_end}`,a),I.ws.off_message(`message_${c.HK.ai_chat_error}`,i),ke.current&&(I.ws.sendData(c.HK.ai_chat_subscribe,{session_id:ke.current,subscribe:!1}),ke.current=null)}},[]),(0,n.useLayoutEffect)(()=>{ye.current&&Le(!1)},[E]);return(0,D.jsxs)(n.Fragment,{children:[(0,D.jsx)(U,{inline:s,currentModelName:De,setCurrentModelName:He,modelGroups:Ve,onModelChanged:async()=>{await Te();const e=await r.XO.get("ai_agent_setting/env");e.code===_.m.Success&&(Ie.current=e.data,Ke(e.data))},sysPromptList:Me,batchMode:me,selectedMsgCount:ge.size,sessionVisible:!ie,onToggleSessionPanel:()=>{oe(e=>!e)},onCreateSession:async e=>{const s=e??"",t=await r.jV.post("session",{title:"新会话",sys_prompt_id:s||void 0,file_cwd_path:v||void 0});if(t.code!==_.m.Success)return;const n=t.data;O(n.id),T([]),je(n.sys_prompt_id??""),oe(!1),await Ue(n.id),requestAnimationFrame(()=>{const e=document.querySelector(".chat-input");e&&(e.style.height="auto",e.style.height=Math.min(e.scrollHeight,200)+"px")})},onBatchDeleteMessages:Ze,bgProcessVisible:ce,bgProcessCount:Be,onToggleBgProcess:()=>re(e=>!e),selectedSysPromptId:xe,setSelectedSysPromptId:e=>{if(je(e),F){const s=We(F);s?Oe("sys_prompt",{session_id:F,user_id:s,sys_prompt_id:e||void 0}).catch(console.error):r.jV.post("session/sys_prompt",{session_id:F,sys_prompt_id:e||void 0}).catch(console.error)}}}),(0,D.jsxs)("div",{className:"chat-page"+(s?" chat-page--embedded":" chat-page-with-sessions"),style:{"--ai-chat-zoom":ue},children:[!ie&&(0,D.jsx)("div",{className:"chat-session-overlay",onClick:()=>oe(!0)}),!ie&&(0,D.jsx)(W,{sessions:K,activeSessionId:F,onSelectSession:e=>Je(e,!1),onReorderSessions:(e,s)=>{if(Fe.current)return;const t=K.findIndex(s=>s.id===e),n=K.findIndex(e=>e.id===s);if(t<0||n<0||t===n)return;const a=(0,u.TI)(K,t,n);B(a),r.jV.post("sessions/update/sort",{session_ids:a.map(e=>e.id)}).catch(()=>{})},onRenameSession:(e,s)=>{let t=s;H({confirm_fun:async()=>{const s=We(e);s?await Oe("rename",{session_id:e,user_id:s,title:t}):await r.jV.post("sessions/update/meta",{id:e,title:t}),await Ue(F)},context_div:(0,D.jsx)("div",{className:"card-content",children:(0,D.jsx)(j.Sm,{value:t,handleInputChange:e=>{t=e}})})})},onDeleteSession:e=>{H({sub_title:"确认删除这个会话吗?",confirm_fun:async()=>{const s=We(e);s?await Oe("delete",{session_id:e,user_id:s}):await r.jV.post("session/delete",{session_id:e}),F===e?(O(""),await Ue(null)):await Ue(F)}})},onToggleCmdAuto:async(e,s)=>{const t=We(e);t?await Oe("cmd_auto",{session_id:e,user_id:t,allow:s}):await r.jV.post("session/cmd_auto_allow",{session_id:e,allow:s}),(0,g.SK)(k(s?"命令检测已开启":"命令检测已关闭")),await Ue(F)},onShowUsageStats:async e=>{de({open:!0,title:k("Token消耗统计"),context_div:(0,D.jsx)("div",{className:"usage-stats-loading",children:k("加载中...")}),cancel:()=>de({open:!1})});try{const s=We(e),t=s?await Oe("usage_stats",{session_id:e,user_id:s}):await r.jV.post("session/usage_stats",{session_id:e});if(t.code===_.m.Success&&t.data){const e=t.data;de({open:!0,title:k("Token消耗统计"),context_div:(0,D.jsxs)("div",{className:"usage-stats-panel",children:[[{l:k("对话轮次"),v:(e.turns??0).toString()},{l:k("AI输入Token"),v:b(e.input_tokens)},{l:k("AI输出Token"),v:b(e.output_tokens)},{l:k("AI输入Token(最近一轮)"),v:b(e.recent_input_tokens)},{l:k("AI输出Token(最近一轮)"),v:b(e.recent_output_tokens)}].map((e,s)=>(0,D.jsxs)("div",{className:"usage-stats-row",children:[(0,D.jsx)("span",{className:"usage-stats-label",children:e.l}),(0,D.jsx)("span",{className:"usage-stats-value",children:e.v})]},s)),(0,D.jsxs)("div",{className:"usage-stats-row usage-stats-total",children:[(0,D.jsx)("span",{className:"usage-stats-label",children:k("AI Token总计消耗")}),(0,D.jsx)("span",{className:"usage-stats-value",children:b((e.input_tokens||0)+(e.output_tokens||0))})]})]}),cancel:()=>de({open:!1})})}else de({open:!0,title:k("Token消耗统计"),context_div:(0,D.jsx)("div",{className:"usage-stats-empty",children:k("暂无统计数据")}),cancel:()=>de({open:!1})})}catch{de({open:!0,title:k("Token消耗统计"),context_div:(0,D.jsx)("div",{className:"usage-stats-empty",children:k("暂无统计数据")}),cancel:()=>de({open:!1})})}},onShowSessionSetting:e=>{let s=K.find(s=>s.id===e)?.file_cwd_path??"";de({open:!0,title:k("会话设置"),context_div:(0,D.jsxs)("div",{className:"session-setting",children:[(0,D.jsx)("div",{className:"session-setting__label",children:k("服务器工作目录")}),(0,D.jsx)(j.Sm,{value:s,placeholder:k("服务器工作目录提示"),handleInputChange:e=>{s=e}})]}),confirm:async()=>{try{const t=We(e);(t?await Oe("setting",{session_id:e,user_id:t,file_cwd_path:s.trim()}):await r.jV.post("session/setting",{session_id:e,file_cwd_path:s.trim()})).code===_.m.Success&&(0,g.SK)(k("保存成功"))}catch{}de({open:!1}),await Ue(F)},cancel:()=>de({open:!1})})},batchMode:me,selectedSessionIds:_e,onToggleSessionSelect:e=>{fe(s=>{const t=new Set(s);return t.has(e)?t.delete(e):t.add(e),t})},onToggleBatchMode:Xe,onBatchDeleteSessions:()=>{0!==_e.size&&H({sub_title:k("cf_ses"),confirm_fun:async()=>{if(Fe.current)await Oe("batch_delete",{session_ids:Array.from(_e)});else for(const e of _e)await r.jV.post("session/delete",{session_id:e});fe(new Set),he(!1),_e.has(F)?(O(""),await Ue(null)):await Ue(F)}})},onClearAllSessions:P?void 0:()=>{H({sub_title:k("cf_all"),confirm_fun:async()=>{await r.jV.post("sessions/clear",{}),O(""),T([]),await Ue(null)}})},allUsersMode:P,onToggleAllUsersMode:async()=>{const e=!P;L(e),Fe.current=e,O(""),T([]);const s=e?await Oe("list_all_sessions"):await r.jV.get("sessions"),t=s.code===_.m.Success?s.data??[]:[];B(t),t[0]?.id&&await Je(t[0].id,!1,t[0].user_id)},showAllUsersEntry:ae}),(0,D.jsx)(te,{panelRef:Ce}),(0,D.jsxs)("section",{className:"chat-main",children:[0===E?.length&&(0,D.jsx)("div",{className:"chat-header",children:(0,D.jsx)("div",{children:k("ai_ask")})}),(0,D.jsx)(X,{messages:E,batchMode:me,selectedMsgIds:ge,sending:q===F||J,chatContainerRef:we,messagesEndRef:be,onToggleMsgSelect:e=>{pe(s=>{const t=new Set(s);return t.has(e)?t.delete(e):t.add(e),t})},onDelete:e=>{H({sub_title:k("cf_one"),confirm_fun:async()=>{const s=E.findIndex(s=>s.id===e);if(s<0)return;const t=E.filter(s=>s.id!==e);if(T(t),F){const e=We(F);e?Oe("message_delete",{session_id:F,user_id:e,indices:[s]}).catch(console.error):r.jV.post("session/message/delete",{session_id:F,indices:[s]}).catch(console.error)}}})},onCopy:async e=>{(0,h.lW)(w(e)),(0,g.SK)("复制成功")},onCopyAll:async()=>{if(!K.length)return void(0,g.SK)("暂无聊天记录");const e=[];for(const s of K){const t=s.user_id?await Oe("get",{session_id:s.id,user_id:s.user_id}):await r.jV.post("session/get",{session_id:s.id});if(t.code!==_.m.Success||!t.data)continue;const n=t.data,a=S([...n.messages??[],...n.live_messages??[]]).map(w).filter(Boolean).join("\n\n\n");a&&e.push(a)}e.length?((0,h.lW)(e.join("\n\n\n")),(0,g.SK)("复制成功")):(0,g.SK)("暂无聊天记录")},onToggleBatchMode:Xe,onBatchCopy:()=>{const e=E.filter(e=>ge.has(e.id)).map(w).filter(Boolean).join("\n\n\n");e?((0,h.lW)(e),(0,g.SK)("复制成功")):(0,g.SK)("暂无内容")},onBatchDelete:Ze,showBatchBar:me&&ge.size>0&&0===_e.size,t:k}),(0,D.jsx)(se,{ref:Z,onSend:async()=>{if(Fe.current)return;const e=(Z.current?.getValue()??"").trim();if(!e&&0===Y.length)return;if(q===F){const s=await $(Y);Ge.enqueueMessage(e,s),Z.current?.clear(),ee([]);const t={id:Date.now(),sender:"user",text:e+(Ge.getQueueLength()>1?" ⏳(排队中...)":""),attachments:s};return void T(e=>[...e,t])}let s=F;if(!s){const t=await r.jV.post("session",{title:(e||Y[0]?.name||"新会话").slice(0,28),sys_prompt_id:void 0,file_cwd_path:v||void 0});if(t.code!==_.m.Success)return;s=t.data.id,O(s),N?.(s),await Ue(s)}const t=await $(Y),n={id:Date.now(),sender:"user",text:e,attachments:t};Z.current?.clear(),ee([]);const a=Ie?.current?.ai_config?.request_type||"completions";if("completions"!==a){const t={id:n.id+1,sender:"bot",text:"处理中...",is_loading:!0},i=[...E,n,t];T(i),G(s);return void(await z(a,e,s,async(e,s)=>{t.text=e,t.is_loading=!1,s?.images&&(t.images=s.images),s?.audio&&(t.audio=s.audio),s?.embeddings&&(t.embeddings=s.embeddings),T([...i]),G(null),qe(),Le(!0),Ge.processPendingQueue()})||(t.text=`请求类型 "${a}" 的专用处理器尚未实现,请使用 completions 类型。`,t.is_loading=!1,T([...i]),G(null),Ge.processPendingQueue()))}Ge.startChatStream(s,n,()=>Ge.processPendingQueue())},readonly:P,sending:q===F||J,onAbort:Ge.abort,pendingAttachments:Y,onRemoveAttachment:e=>{ee(s=>s.filter((s,t)=>t!==e))},onOpenFilePicker:()=>{ve.current?.click()},onAddFiles:Qe,onDrop:e=>{const s=e.dataTransfer?.files;s&&s.length>0&&(e.preventDefault(),Qe(s))},onDragOver:e=>{e.dataTransfer?.types?.includes("Files")&&e.preventDefault()},fileInputRef:ve})]})]})]})}},72693(e,s,t){t.d(s,{w:()=>h});var n=t(96540),a=t(22022),i=t(14944),o=t(92275),c=t(34843),r=t(82893),l=t(85997),d=t(14284),u=t(74848);function m(e){const{t:s}=(0,a.Bd)(),[t,i]=(0,n.useState)(!1),o=!!e.sessionId;return(0,u.jsxs)("div",{children:[(0,u.jsx)("div",{style:{maxHeight:"60vh",overflow:"auto",whiteSpace:"pre-wrap",wordBreak:"break-all",background:"var(--surfaceSecondary)",padding:"0.75em",borderRadius:"0.5em",marginBottom:"0.75em",fontFamily:"monospace",fontSize:"0.9em",lineHeight:"1.5"},children:e.cmd}),o&&(0,u.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"0.5em",marginBottom:"0.75em",color:t?"var(--icon-blue)":"var(--textSecondary)"},children:[(0,u.jsx)(l.Ay,{checked:t,onChange:s=>{i(s),s&&e.onAutoAllow()},title:s("此会话不再询问")}),(0,u.jsx)("span",{children:s("此会话不再询问")})]}),(0,u.jsxs)("div",{style:{display:"flex",gap:"0.5em",justifyContent:"flex-end"},children:[(0,u.jsx)(l.$n,{text:s("拒绝"),color:"var(--red)",clickFun:e.onDeny}),(0,u.jsx)(l.$n,{text:s("允许"),clickFun:e.onAllow})]})]})}function h(){const[e,s]=(0,c.fp)(r.AG.prompt_card),{t}=(0,a.Bd)(),l=(0,n.useRef)([]),h=(0,n.useRef)(!1),g=(0,n.useRef)(null),p=(0,n.useRef)(void 0),_=(0,n.useRef)(()=>{}),f=(0,n.useCallback)(e=>{s({open:!1}),h.current=!1,g.current&&(i.ws.sendData(o.HK.ai_confirm_cmd,{askId:g.current,approved:e}),g.current=null),_.current()},[s]),x=(0,n.useCallback)(()=>{if(h.current)return;if(0===l.current.length)return h.current=!1,void s({open:!1});h.current=!0;const e=l.current.shift();e?(g.current=e.askId,p.current=e.session_id,s({open:!0,title:t("命令确认"),cancel:()=>f(!1),context_div:(0,u.jsx)(m,{cmd:e.cmd,sessionId:e.session_id,onDeny:()=>f(!1),onAllow:()=>f(!0),onAutoAllow:async()=>{if(p.current)try{await d.jV.post("session/cmd_auto_allow",{session_id:p.current,allow:!0})}catch(e){console.error("设置会话命令免确认失败",e)}f(!0)}})})):h.current=!1},[t,f,s]);_.current=x;const j=(0,n.useCallback)(e=>{l.current.push(e),x()},[x]);(0,n.useEffect)(()=>{const e=e=>{const t=e.context||{};if(t.dismiss&&t.askId)return l.current=l.current.filter(e=>e.askId!==t.askId),void(h.current&&g.current===t.askId&&(g.current=null,h.current=!1,s({open:!1}),x()));t.askId&&t.cmd&&j({askId:t.askId,cmd:t.cmd,session_id:t.session_id})};return i.ws.addMsg(o.HK.ai_confirm_cmd,e),()=>{i.ws.off_message(`message_${o.HK.ai_confirm_cmd}`,e)}},[j]),(0,n.useEffect)(()=>()=>{l.current=[],h.current=!1,g.current=null},[])}},34299(e,s,t){t.r(s),t.d(s,{default:()=>y});var n=t(96540),a=t(23802),i=t(53995),o=t(18569),c=t(77979),r=t(8263),l=t(69428),d=t.n(l),u=(t(3775),t(21499)),m=t(99214),h=t(89117),g=t(86063),p=t(89334),_=t(41105),f=t(52388),x=t(19878),j=(t(72411),t(74848));const v=new a.A({html:!0,highlight:function(e,s){if(s&&x.A.getLanguage(s))try{return`<pre class="hljs code-block-with-copy"><code class="hljs language-${s}">${x.A.highlight(e,{language:s}).value}</code></pre>`}catch(e){}try{return`<pre class="hljs code-block-with-copy"><code class="hljs">${x.A.highlightAuto(e).value}</code></pre>`}catch(e){}return`<pre class="hljs code-block-with-copy"><code>${v.utils.escapeHtml(e)}</code></pre>`}});async function b(e,s){e.className="md-graph md-graph--mind md-graph--loading",e.textContent=f.A.t("rendering");const t=await(0,g.Hn)(s);e.isConnected&&(e.className="md-graph md-graph--mind",e.textContent="",await t.mount(e))}function w(e){const s=e.className.match(/language-([\w-]+)/);return s?s[1]:""}function y(e){const s=(0,n.useRef)(null);return(0,m.VD)(),(0,n.useEffect)(()=>{s.current&&(s.current.innerHTML=v.render(e.context??""),async function(e){const s=e.querySelectorAll("pre > code[class*='language-']");for(const e of Array.from(s)){const s=w(e),t=(0,h.Hm)(s),n=(0,g.hj)(s);if(!t&&!n)continue;const a=e.closest(".code-block-with-copy")??e.parentElement;if(!a)continue;const i=e.textContent??"",o=document.createElement("div");if(a.replaceWith(o),n){try{await b(o,i)}catch(e){console.error("[mind] render failed",e),o.className="md-graph md-graph--mind",o.textContent=String(e)}continue}o.className="md-graph md-graph--loading",o.textContent=f.A.t("rendering");const c=await(0,h.U6)(s,i);o.isConnected&&(c.error?(o.className="md-graph md-graph--error",o.textContent=c.error):(o.className="md-graph",o.innerHTML=c.svg))}}(s.current),(0,p.rg)(s.current))},[e.context]),(0,j.jsx)("div",{ref:s})}v.use(i.A).use(o.A).use(c.A).use(r.A).use(d()).use(e=>{e.renderer.rules.fence;e.renderer.rules.fence=(s,t,n,a,i)=>{const o=s[t],c=o.content.trim(),r=o.info.trim();let l="";if(r&&x.A.getLanguage(r))try{l=x.A.highlight(c,{language:r}).value}catch(s){l=e.utils.escapeHtml(c)}else try{l=x.A.highlightAuto(c).value}catch(s){l=e.utils.escapeHtml(c)}return`\n <div class="code-block-with-copy">\n <div class="code-header">\n <span class="code-language">${r||"code"}</span>\n <button class="copy-btn" data-code="${e.utils.escapeHtml(c)}">复制</button>\n </div>\n <pre><code class="hljs ${r?`language-${r}`:""}">${l}</code></pre>\n </div>`}}).use(e=>{const s=e.renderer.rules.link_open||function(e,s,t,n,a){return a.renderToken(e,s,t)};e.renderer.rules.link_open=(e,t,n,a,i)=>{const o=e[t],c=o.attrIndex("href");if(c>=0){const e=o.attrs[c][1];o.attrs[c][1]=(0,u.bi)(window.location.href,e)}return s(e,t,n,a,i)}}),(0,p.Rh)(v,_.pC)},84369(e,s,t){t.d(s,{y:()=>o});var n=t(96540),a=t(2543);function i(e){if(void 0!==e)return"function"==typeof e?e():e}function o(e){const{direction:s="vertical",target_ref:t,get_start_size:o,px_to_unit:c,min:r,max:l,throttle:d,on_change:u,on_drag_end:m}=e,[h,g]=(0,n.useState)(!1),p=(0,n.useRef)(null),_=(0,n.useRef)(u);_.current=u;const f=e=>"vertical"===s?e.clientY:e.clientX,x=(0,n.useRef)({direction:s,get_start_size:o,px_to_unit:c,min:r,max:l,get_pos:f});x.current={direction:s,get_start_size:o,px_to_unit:c,min:r,max:l,get_pos:f};const j=(0,n.useCallback)(e=>{const s=p.current;if(!s)return;const{px_to_unit:t,min:n,max:a,get_pos:o}=x.current,c=s.pos-o(e);let r=s.size+t(c);const l=i(n),d=i(a);void 0!==l&&(r=Math.max(l,r)),void 0!==d&&(r=Math.min(d,r)),_.current(r)},[]),v=n.useMemo(()=>void 0===d?j:a.throttle(e=>j(e),d),[d,j]),b=(0,n.useCallback)(()=>{p.current=null,g(!1);const e=v;"function"==typeof e.cancel&&e.cancel(),m?.()},[v,m]),w=(0,n.useCallback)(e=>{const{get_start_size:s,get_pos:t}=x.current;p.current={pos:t(e),size:s()},g(!0)},[]);return(0,n.useEffect)(()=>{if(!h)return;const e=t?.current??window;return e.addEventListener("pointermove",v),e.addEventListener("pointerup",b),()=>{e.removeEventListener("pointermove",v),e.removeEventListener("pointerup",b)}},[h,v,b,t]),(0,n.useEffect)(()=>{const e=v;return()=>{"function"==typeof e.cancel&&e.cancel()}},[v]),{dragging:h,on_pointer_down:w,on_pointer_up:b}}},60840(e){e.exports="data:image/svg+xml,<svg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 16 16%27 version=%271.1%27 aria-hidden=%27true%27><path fill-rule=%27evenodd%27 d=%27M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z%27></path></svg>"}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[4560],{75937(t,e,s){s.d(e,{A:()=>r});var i=s(86309),n=s(51931);const r=(t,e)=>i.A.lang.round(n.A.parse(t)[e])},1672(t,e,s){s.d(e,{P:()=>a});var i=s(86535),n=s(31293),r=s(86827),a=(0,r.K)((t,e,s,r)=>{t.attr("class",s);const{width:a,height:l,x:h,y:u}=o(t,e);(0,i.a$)(t,l,a,r);const d=c(h,u,a,l,e);t.attr("viewBox",d),n.R.debug(`viewBox configured: ${d} with padding: ${e}`)},"setupViewPortForSVG"),o=(0,r.K)((t,e)=>{const s=t.node()?.getBBox()||{width:0,height:0,x:0,y:0};return{width:s.width+2*e,height:s.height+2*e,x:s.x,y:s.y}},"calculateDimensionsWithPadding"),c=(0,r.K)((t,e,s,i,n)=>`${t-n} ${e-n} ${s} ${i}`,"createViewBox")},96755(t,e,s){s.d(e,{A:()=>r});var i=s(86827),n=s(51444),r=(0,i.K)((t,e)=>{let s;"sandbox"===e&&(s=(0,n.Ltv)("#i"+t));return("sandbox"===e?(0,n.Ltv)(s.nodes()[0].contentDocument.body):(0,n.Ltv)("body")).select(`[id="${t}"]`)},"getDiagramElement")},94560(t,e,s){s.d(e,{diagram:()=>S});var i=s(96755),n=s(1672),r=s(10561),a=(s(24980),s(27838),s(96865),s(48159),s(44505),s(69793),s(43287),s(12505)),o=s(86535),c=s(31293),l=s(86827),h=s(51444),u=s(25582),d=s(75937),y=function(){var t=(0,l.K)(function(t,e,s,i){for(s=s||{},i=t.length;i--;s[t[i]]=e);return s},"o"),e=[6,9,21,23,25,27,34,37,38,39,40,41,43,46,47,51,53,54,55],s=[2,2],i=[1,7],n=[1,9],r=[1,10],a=[1,11],o=[1,12],c=[1,30],h=[1,23],u=[1,24],d=[1,25],y=[1,26],p=[1,27],b=[1,19],g=[1,28],_=[1,29],f=[1,20],m=[1,18],k=[1,21],E=[1,22],S=[2,6],$=[6,9,21,23,25,27,33,34,37,38,39,40,41,43,46,47,51,53,54,55],T=[1,36],O=[1,37],x=[1,38],N=[1,39],C=[1,40],A=[6,9,12,14,16,19,20,21,23,25,27,33,34,37,38,39,40,41,43,46,47,50,51,53,54,55,69,70,71,72,73],R=[1,46],I=[1,47],D=[1,57],w=[43,51,53,54,55,74,75],v=[1,70],L=[1,68],K=[1,65],M=[1,69],B=[1,71],G=[6,9,12,16,21,23,25,27,33,34,37,38,39,40,41,43,44,45,46,47,51,52,53,54,55,69,70,71,72,73],F=[1,78],Y=[1,77],P=[1,76],z=[69,70,71,72,73],U=[1,91],Z=[6,9,45,50],j=[6,9,12,44,45,50,51,52],W=[1,101],q=[1,100],X=[1,99],V=[18,61],H=[1,110],Q=[1,109],J=[20,43,51,53,54,55],tt=[18,61,64,66],et={trace:(0,l.K)(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,line:7,statement:8,NEWLINE:9,entityName:10,relSpec:11,COLON:12,role:13,STYLE_SEPARATOR:14,idList:15,BLOCK_START:16,attributes:17,BLOCK_STOP:18,SQS:19,SQE:20,title:21,title_value:22,acc_title:23,acc_title_value:24,acc_descr:25,acc_descr_value:26,acc_descr_multiline_value:27,direction:28,classDefStatement:29,classStatement:30,styleStatement:31,subgraphHeader:32,END:33,SUBGRAPH:34,separator:35,subgraphTitle:36,direction_tb:37,direction_bt:38,direction_rl:39,direction_lr:40,CLASSDEF:41,stylesOpt:42,UNICODE_TEXT:43,STYLE_TEXT:44,COMMA:45,CLASS:46,STYLE:47,style:48,styleComponent:49,SEMI:50,NUM:51,BRKT:52,ENTITY_NAME:53,DECIMAL_NUM:54,ENTITY_ONE:55,attribute:56,attributeType:57,attributeName:58,attributeKeyTypeList:59,attributeComment:60,ATTRIBUTE_WORD:61,"?":62,attributeKeyType:63,",":64,ATTRIBUTE_KEY:65,COMMENT:66,cardinality:67,relType:68,ZERO_OR_ONE:69,ZERO_OR_MORE:70,ONE_OR_MORE:71,ONLY_ONE:72,MD_PARENT:73,NON_IDENTIFYING:74,IDENTIFYING:75,WORD:76,$accept:0,$end:1},terminals_:{2:"error",4:"ER_DIAGRAM",6:"EOF",9:"NEWLINE",12:"COLON",14:"STYLE_SEPARATOR",16:"BLOCK_START",18:"BLOCK_STOP",19:"SQS",20:"SQE",21:"title",22:"title_value",23:"acc_title",24:"acc_title_value",25:"acc_descr",26:"acc_descr_value",27:"acc_descr_multiline_value",33:"END",34:"SUBGRAPH",37:"direction_tb",38:"direction_bt",39:"direction_rl",40:"direction_lr",41:"CLASSDEF",43:"UNICODE_TEXT",44:"STYLE_TEXT",45:"COMMA",46:"CLASS",47:"STYLE",50:"SEMI",51:"NUM",52:"BRKT",53:"ENTITY_NAME",54:"DECIMAL_NUM",55:"ENTITY_ONE",61:"ATTRIBUTE_WORD",62:"?",64:",",65:"ATTRIBUTE_KEY",66:"COMMENT",69:"ZERO_OR_ONE",70:"ZERO_OR_MORE",71:"ONE_OR_MORE",72:"ONLY_ONE",73:"MD_PARENT",74:"NON_IDENTIFYING",75:"IDENTIFYING",76:"WORD"},productions_:[0,[3,3],[5,0],[5,2],[7,1],[7,1],[7,1],[8,5],[8,9],[8,7],[8,7],[8,4],[8,6],[8,3],[8,5],[8,1],[8,3],[8,7],[8,9],[8,6],[8,8],[8,4],[8,6],[8,2],[8,2],[8,2],[8,1],[8,1],[8,1],[8,1],[8,1],[8,3],[32,3],[32,6],[36,1],[36,2],[28,1],[28,1],[28,1],[28,1],[29,4],[15,1],[15,1],[15,3],[15,3],[30,3],[31,4],[42,1],[42,3],[48,1],[48,2],[35,1],[35,1],[35,1],[49,1],[49,1],[49,1],[49,1],[10,1],[10,1],[10,1],[10,1],[10,1],[17,1],[17,2],[56,2],[56,3],[56,3],[56,4],[57,1],[57,2],[58,1],[59,1],[59,3],[63,1],[60,1],[11,3],[67,1],[67,1],[67,1],[67,1],[67,1],[68,1],[68,1],[13,1],[13,1],[13,1]],performAction:(0,l.K)(function(t,e,s,i,n,r,a){var o=r.length-1;switch(n){case 1:break;case 2:case 5:case 6:this.$=[];break;case 3:this.$=r[o-1].concat(r[o]);break;case 4:case 34:case 59:case 60:case 61:case 62:case 86:case 69:case 71:case 74:this.$=r[o];break;case 7:i.addEntity(r[o-4]),i.addEntity(r[o-2]),i.addRelationship(r[o-4],r[o],r[o-2],r[o-3]),this.$=[r[o-4],r[o-2]];break;case 8:i.addEntity(r[o-8]),i.addEntity(r[o-4]),i.addRelationship(r[o-8],r[o],r[o-4],r[o-5]),i.setClass([r[o-8]],r[o-6]),i.setClass([r[o-4]],r[o-2]),this.$=[r[o-8],r[o-4]];break;case 9:i.addEntity(r[o-6]),i.addEntity(r[o-2]),i.addRelationship(r[o-6],r[o],r[o-2],r[o-3]),i.setClass([r[o-6]],r[o-4]),this.$=[r[o-6],r[o-2]];break;case 10:i.addEntity(r[o-6]),i.addEntity(r[o-4]),i.addRelationship(r[o-6],r[o],r[o-4],r[o-5]),i.setClass([r[o-4]],r[o-2]),this.$=[r[o-6],r[o-4]];break;case 11:i.addEntity(r[o-3]),i.addAttributes(r[o-3],r[o-1]),this.$=[r[o-3]];break;case 12:i.addEntity(r[o-5]),i.addAttributes(r[o-5],r[o-1]),i.setClass([r[o-5]],r[o-3]),this.$=[r[o-5]];break;case 13:i.addEntity(r[o-2]),this.$=[r[o-2]];break;case 14:i.addEntity(r[o-4]),i.setClass([r[o-4]],r[o-2]),this.$=[r[o-4]];break;case 15:i.addEntity(r[o]),this.$=[r[o]];break;case 16:i.addEntity(r[o-2]),i.setClass([r[o-2]],r[o]),this.$=[r[o-2]];break;case 17:i.addEntity(r[o-6],r[o-4]),i.addAttributes(r[o-6],r[o-1]),this.$=[r[o-6]];break;case 18:i.addEntity(r[o-8],r[o-6]),i.addAttributes(r[o-8],r[o-1]),i.setClass([r[o-8]],r[o-3]),this.$=[r[o-8]];break;case 19:i.addEntity(r[o-5],r[o-3]),this.$=[r[o-5]];break;case 20:i.addEntity(r[o-7],r[o-5]),i.setClass([r[o-7]],r[o-2]),this.$=[r[o-7]];break;case 21:i.addEntity(r[o-3],r[o-1]);break;case 22:i.addEntity(r[o-5],r[o-3]),i.setClass([r[o-5]],r[o]);break;case 23:case 24:this.$=r[o].trim(),i.setAccTitle(this.$);break;case 25:case 26:this.$=r[o].trim(),i.setAccDescription(this.$);break;case 27:i.subgraphDepth?this.$=r[o]:(i.setDirection(r[o].value),this.$=[]);break;case 31:i.subgraphDepth=(i.subgraphDepth||1)-1,this.$=i.addSubGraph({text:r[o-2].id},r[o-1],{text:r[o-2].text});break;case 32:i.subgraphDepth=(i.subgraphDepth||0)+1,this.$={id:r[o-1],text:r[o-1]};break;case 33:i.subgraphDepth=(i.subgraphDepth||0)+1,this.$={id:r[o-4],text:r[o-2]};break;case 35:this.$=r[o-1]+" "+r[o];break;case 36:this.$={stmt:"dir",value:"TB"};break;case 37:this.$={stmt:"dir",value:"BT"};break;case 38:this.$={stmt:"dir",value:"RL"};break;case 39:this.$={stmt:"dir",value:"LR"};break;case 40:this.$=r[o-3],i.addClass(r[o-2],r[o-1]);break;case 41:case 42:case 63:case 72:case 47:this.$=[r[o]];break;case 43:case 44:this.$=r[o-2].concat([r[o]]);break;case 45:this.$=r[o-2],i.setClass(r[o-1],r[o]);break;case 46:this.$=r[o-3],i.addCssStyles(r[o-2],r[o-1]);break;case 48:case 73:r[o-2].push(r[o]),this.$=r[o-2];break;case 50:case 70:this.$=r[o-1]+r[o];break;case 58:case 84:case 85:case 75:this.$=r[o].replace(/"/g,"");break;case 64:r[o].push(r[o-1]),this.$=r[o];break;case 65:this.$={type:r[o-1],name:r[o]};break;case 66:this.$={type:r[o-2],name:r[o-1],keys:r[o]};break;case 67:this.$={type:r[o-2],name:r[o-1],comment:r[o]};break;case 68:this.$={type:r[o-3],name:r[o-2],keys:r[o-1],comment:r[o]};break;case 76:this.$={cardA:r[o],relType:r[o-1],cardB:r[o-2]};break;case 77:this.$=i.Cardinality.ZERO_OR_ONE;break;case 78:this.$=i.Cardinality.ZERO_OR_MORE;break;case 79:this.$=i.Cardinality.ONE_OR_MORE;break;case 80:this.$=i.Cardinality.ONLY_ONE;break;case 81:this.$=i.Cardinality.MD_PARENT;break;case 82:this.$=i.Identification.NON_IDENTIFYING;break;case 83:this.$=i.Identification.IDENTIFYING}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,s,{5:3}),{6:[1,4],7:5,8:6,9:i,10:8,21:n,23:r,25:a,27:o,28:13,29:14,30:15,31:16,32:17,34:c,37:h,38:u,39:d,40:y,41:p,43:b,46:g,47:_,51:f,53:m,54:k,55:E},t(e,S,{1:[2,1]}),t($,[2,3]),t($,[2,4]),t($,[2,5]),t($,[2,15],{11:31,67:35,14:[1,32],16:[1,33],19:[1,34],69:T,70:O,71:x,72:N,73:C}),{22:[1,41]},{24:[1,42]},{26:[1,43]},t($,[2,26]),t($,[2,27]),t($,[2,28]),t($,[2,29]),t($,[2,30]),t($,s,{5:44}),t(A,[2,58]),t(A,[2,59]),t(A,[2,60]),t(A,[2,61]),t(A,[2,62]),t($,[2,36]),t($,[2,37]),t($,[2,38]),t($,[2,39]),{15:45,43:R,44:I},{15:48,43:R,44:I},{15:49,43:R,44:I},{10:50,43:b,51:f,53:m,54:k,55:E},{10:51,43:b,51:f,53:m,54:k,55:E},{15:52,43:R,44:I},{17:53,18:[1,54],56:55,57:56,61:D},{10:58,43:b,51:f,53:m,54:k,55:E},{68:59,74:[1,60],75:[1,61]},t(w,[2,77]),t(w,[2,78]),t(w,[2,79]),t(w,[2,80]),t(w,[2,81]),t($,[2,23]),t($,[2,24]),t($,[2,25]),{6:[1,63],7:5,8:6,9:i,10:8,21:n,23:r,25:a,27:o,28:13,29:14,30:15,31:16,32:17,33:[1,62],34:c,37:h,38:u,39:d,40:y,41:p,43:b,46:g,47:_,51:f,53:m,54:k,55:E},{12:v,42:64,44:L,45:K,48:66,49:67,51:M,52:B},t(G,[2,41]),t(G,[2,42]),{15:72,43:R,44:I,45:K},{12:v,42:73,44:L,45:K,48:66,49:67,51:M,52:B},{6:F,9:Y,19:[1,75],35:74,50:P},{12:[1,79],14:[1,80]},t($,[2,16],{67:35,11:81,16:[1,82],45:K,69:T,70:O,71:x,72:N,73:C}),{18:[1,83]},t($,[2,13]),{17:84,18:[2,63],56:55,57:56,61:D},{58:85,61:[1,86]},{61:[2,69],62:[1,87]},{20:[1,88]},{67:89,69:T,70:O,71:x,72:N,73:C},t(z,[2,82]),t(z,[2,83]),t($,[2,31]),t($,S),{6:F,9:Y,35:90,45:U,50:P},{43:[1,92],44:[1,93]},t(Z,[2,47],{49:94,12:v,44:L,51:M,52:B}),t(j,[2,49]),t(j,[2,54]),t(j,[2,55]),t(j,[2,56]),t(j,[2,57]),t($,[2,45],{45:K}),{6:F,9:Y,35:95,45:U,50:P},t($,[2,32]),{10:97,36:96,43:b,51:f,53:m,54:k,55:E},t($,[2,51]),t($,[2,52]),t($,[2,53]),{13:98,43:W,53:q,76:X},{15:102,43:R,44:I},{10:103,43:b,51:f,53:m,54:k,55:E},{17:104,18:[1,105],56:55,57:56,61:D},t($,[2,11]),{18:[2,64]},t(V,[2,65],{59:106,60:107,63:108,65:H,66:Q}),t([18,61,65,66],[2,71]),{61:[2,70]},t($,[2,21],{14:[1,112],16:[1,111]}),t([43,51,53,54,55],[2,76]),t($,[2,40]),{12:v,44:L,48:113,49:67,51:M,52:B},t(G,[2,43]),t(G,[2,44]),t(j,[2,50]),t($,[2,46]),{10:115,20:[1,114],43:b,51:f,53:m,54:k,55:E},t(J,[2,34]),t($,[2,7]),t($,[2,84]),t($,[2,85]),t($,[2,86]),{12:[1,116],45:K},{12:[1,118],14:[1,117]},{18:[1,119]},t($,[2,14]),t(V,[2,66],{60:120,64:[1,121],66:Q}),t(V,[2,67]),t(tt,[2,72]),t(V,[2,75]),t(tt,[2,74]),{17:122,18:[1,123],56:55,57:56,61:D},{15:124,43:R,44:I},t(Z,[2,48],{49:94,12:v,44:L,51:M,52:B}),{6:F,9:Y,35:125,50:P},t(J,[2,35]),{13:126,43:W,53:q,76:X},{15:127,43:R,44:I},{13:128,43:W,53:q,76:X},t($,[2,12]),t(V,[2,68]),{63:129,65:H},{18:[1,130]},t($,[2,19]),t($,[2,22],{16:[1,131],45:K}),t($,[2,33]),t($,[2,10]),{12:[1,132],45:K},t($,[2,9]),t(tt,[2,73]),t($,[2,17]),{17:133,18:[1,134],56:55,57:56,61:D},{13:135,43:W,53:q,76:X},{18:[1,136]},t($,[2,20]),t($,[2,8]),t($,[2,18])],defaultActions:{84:[2,64],87:[2,70]},parseError:(0,l.K)(function(t,e){if(!e.recoverable){var s=new Error(t);throw s.hash=e,s}this.trace(t)},"parseError"),parse:(0,l.K)(function(t){var e=this,s=[0],i=[],n=[null],r=[],a=this.table,o="",c=0,h=0,u=0,d=r.slice.call(arguments,1),y=Object.create(this.lexer),p={yy:{}};for(var b in this.yy)Object.prototype.hasOwnProperty.call(this.yy,b)&&(p.yy[b]=this.yy[b]);y.setInput(t,p.yy),p.yy.lexer=y,p.yy.parser=this,void 0===y.yylloc&&(y.yylloc={});var g=y.yylloc;r.push(g);var _=y.options&&y.options.ranges;function f(){var t;return"number"!=typeof(t=i.pop()||y.lex()||1)&&(t instanceof Array&&(t=(i=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof p.yy.parseError?this.parseError=p.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,(0,l.K)(function(t){s.length=s.length-2*t,n.length=n.length-t,r.length=r.length-t},"popStack"),(0,l.K)(f,"lex");for(var m,k,E,S,$,T,O,x,N,C={};;){if(E=s[s.length-1],this.defaultActions[E]?S=this.defaultActions[E]:(null==m&&(m=f()),S=a[E]&&a[E][m]),void 0===S||!S.length||!S[0]){var A="";for(T in N=[],a[E])this.terminals_[T]&&T>2&&N.push("'"+this.terminals_[T]+"'");A=y.showPosition?"Parse error on line "+(c+1)+":\n"+y.showPosition()+"\nExpecting "+N.join(", ")+", got '"+(this.terminals_[m]||m)+"'":"Parse error on line "+(c+1)+": Unexpected "+(1==m?"end of input":"'"+(this.terminals_[m]||m)+"'"),this.parseError(A,{text:y.match,token:this.terminals_[m]||m,line:y.yylineno,loc:g,expected:N})}if(S[0]instanceof Array&&S.length>1)throw new Error("Parse Error: multiple actions possible at state: "+E+", token: "+m);switch(S[0]){case 1:s.push(m),n.push(y.yytext),r.push(y.yylloc),s.push(S[1]),m=null,k?(m=k,k=null):(h=y.yyleng,o=y.yytext,c=y.yylineno,g=y.yylloc,u>0&&u--);break;case 2:if(O=this.productions_[S[1]][1],C.$=n[n.length-O],C._$={first_line:r[r.length-(O||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(O||1)].first_column,last_column:r[r.length-1].last_column},_&&(C._$.range=[r[r.length-(O||1)].range[0],r[r.length-1].range[1]]),void 0!==($=this.performAction.apply(C,[o,h,c,p.yy,S[1],n,r].concat(d))))return $;O&&(s=s.slice(0,-1*O*2),n=n.slice(0,-1*O),r=r.slice(0,-1*O)),s.push(this.productions_[S[1]][0]),n.push(C.$),r.push(C._$),x=a[s[s.length-2]][s[s.length-1]],s.push(x);break;case 3:return!0}}return!0},"parse")},st=function(){return{EOF:1,parseError:(0,l.K)(function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},"parseError"),setInput:(0,l.K)(function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:(0,l.K)(function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},"input"),unput:(0,l.K)(function(t){var e=t.length,s=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var i=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),s.length-1&&(this.yylineno-=s.length-1);var n=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:s?(s.length===i.length?this.yylloc.first_column:0)+i[i.length-s.length].length-s[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[n[0],n[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},"unput"),more:(0,l.K)(function(){return this._more=!0,this},"more"),reject:(0,l.K)(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:(0,l.K)(function(t){this.unput(this.match.slice(t))},"less"),pastInput:(0,l.K)(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:(0,l.K)(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:(0,l.K)(function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},"showPosition"),test_match:(0,l.K)(function(t,e){var s,i,n;if(this.options.backtrack_lexer&&(n={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(n.yylloc.range=this.yylloc.range.slice(0))),(i=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],s=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),s)return s;if(this._backtrack){for(var r in n)this[r]=n[r];return!1}return!1},"test_match"),next:(0,l.K)(function(){if(this.done)return this.EOF;var t,e,s,i;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var n=this._currentRules(),r=0;r<n.length;r++)if((s=this._input.match(this.rules[n[r]]))&&(!e||s[0].length>e[0].length)){if(e=s,i=r,this.options.backtrack_lexer){if(!1!==(t=this.test_match(s,n[r])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,n[i]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:(0,l.K)(function(){var t=this.next();return t||this.lex()},"lex"),begin:(0,l.K)(function(t){this.conditionStack.push(t)},"begin"),popState:(0,l.K)(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:(0,l.K)(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:(0,l.K)(function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},"topState"),pushState:(0,l.K)(function(t){this.begin(t)},"pushState"),stateStackSize:(0,l.K)(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:(0,l.K)(function(t,e,s,i){switch(s){case 0:return this.begin("acc_title"),23;case 1:return this.popState(),"acc_title_value";case 2:return this.begin("acc_descr"),25;case 3:return this.popState(),"acc_descr_value";case 4:this.begin("acc_descr_multiline");break;case 5:case 28:this.popState();break;case 6:return"acc_descr_multiline_value";case 7:return 37;case 8:return 38;case 9:return 39;case 10:return 40;case 11:case 22:case 30:case 37:break;case 12:return 9;case 13:return 53;case 14:return 76;case 15:return 4;case 16:return this.begin("block"),16;case 17:case 18:case 40:return 52;case 19:case 39:return 45;case 20:return 14;case 21:case 38:return 12;case 23:return 65;case 24:case 25:case 27:return 61;case 26:this.begin("block_bq");break;case 29:return 66;case 31:return this.popState(),18;case 32:case 81:return e.yytext[0];case 33:return 19;case 34:return 20;case 35:return this.begin("style"),47;case 36:return this.popState(),9;case 41:return this.begin("style"),41;case 42:return 46;case 43:return 34;case 44:return 33;case 45:case 49:case 50:case 68:return 69;case 46:case 47:case 48:case 56:case 58:case 70:return 71;case 51:case 52:case 53:case 54:case 55:case 57:case 69:return 70;case 59:case 60:case 62:case 63:case 64:case 67:return 72;case 61:return 54;case 65:return 55;case 66:return 51;case 71:return 73;case 72:case 75:case 76:case 77:return 74;case 73:case 74:return 75;case 78:return 44;case 79:return 50;case 80:return 43;case 82:return 6}},"anonymous"),rules:[/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[ \t\r]+)/i,/^(?:[\n]+)/i,/^(?:"[^"%\r\n\v\b\\]+")/i,/^(?:"[^"]*")/i,/^(?:erDiagram\b)/i,/^(?:\{)/i,/^(?:#)/i,/^(?:#)/i,/^(?:,)/i,/^(?::::)/i,/^(?::)/i,/^(?:\s+)/i,/^(?:\b((?:PK)|(?:FK)|(?:UK))\b)/i,/^(?:([^\s]*)[~].*[~]([^\s]*))/i,/^(?:([\*A-Za-z_\u00C0-\uFFFF][A-Za-z0-9\-\_\[\]\(\)\.,\u00C0-\uFFFF\*]*))/i,/^(?:[`])/i,/^(?:[^`]+)/i,/^(?:[`])/i,/^(?:"[^"]*")/i,/^(?:[\n]+)/i,/^(?:\})/i,/^(?:.)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:style\b)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?::)/i,/^(?:,)/i,/^(?:#)/i,/^(?:classDef\b)/i,/^(?:class\b)/i,/^(?:subgraph\b)/i,/^(?:end\b\s*)/i,/^(?:one or zero\b)/i,/^(?:one or more\b)/i,/^(?:one or many\b)/i,/^(?:1\+)/i,/^(?:\|o\b)/i,/^(?:zero or one\b)/i,/^(?:zero or more\b)/i,/^(?:zero or many\b)/i,/^(?:0\+)/i,/^(?:\}o\b)/i,/^(?:many\(0\))/i,/^(?:many\(1\))/i,/^(?:many\b)/i,/^(?:\}\|)/i,/^(?:one\b)/i,/^(?:only one\b)/i,/^(?:[0-9]+\.[0-9]+)/i,/^(?:1(?=\s+[A-Za-z_"']))/i,/^(?:1(?=\s+[0-9]))/i,/^(?:1(?=(--|\.\.|\.-|-\.)))/i,/^(?:1\b)/i,/^(?:[0-9]+)/i,/^(?:\|\|)/i,/^(?:o\|)/i,/^(?:o\{)/i,/^(?:\|\{)/i,/^(?:u(?=[\.\-\|]))/i,/^(?:\.\.)/i,/^(?:--)/i,/^(?:to\b)/i,/^(?:optionally to\b)/i,/^(?:\.-)/i,/^(?:-\.)/i,/^(?:([^\x00-\x7F]|\w|-|\*)+)/i,/^(?:;)/i,/^(?:([^\x00-\x7F]|\w|-|\*|\.)+)/i,/^(?:.)/i,/^(?:$)/i],conditions:{style:{rules:[36,37,38,39,40,78,79],inclusive:!1},acc_descr_multiline:{rules:[5,6],inclusive:!1},acc_descr:{rules:[3],inclusive:!1},acc_title:{rules:[1],inclusive:!1},block_bq:{rules:[27,28],inclusive:!1},block:{rules:[22,23,24,25,26,29,30,31,32],inclusive:!1},INITIAL:{rules:[0,2,4,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,33,34,35,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,80,81,82],inclusive:!0}}}}();function it(){this.yy={}}return et.lexer=st,(0,l.K)(it,"Parser"),it.prototype=et,et.Parser=it,new it}();y.parser=y;var p=y,b=class{constructor(){this.entities=new Map,this.relationships=[],this.classes=new Map,this.subgraphDepth=0,this.subGraphs=[],this.subGraphLookup=new Map,this.subCount=0,this.direction="TB",this.Cardinality={ZERO_OR_ONE:"ZERO_OR_ONE",ZERO_OR_MORE:"ZERO_OR_MORE",ONE_OR_MORE:"ONE_OR_MORE",ONLY_ONE:"ONLY_ONE",MD_PARENT:"MD_PARENT"},this.Identification={NON_IDENTIFYING:"NON_IDENTIFYING",IDENTIFYING:"IDENTIFYING"},this.setAccTitle=o.SV,this.getAccTitle=o.iN,this.setAccDescription=o.EI,this.getAccDescription=o.m7,this.setDiagramTitle=o.ke,this.getDiagramTitle=o.ab,this.getConfig=(0,l.K)(()=>(0,o.D7)().er,"getConfig"),this.clear(),this.addEntity=this.addEntity.bind(this),this.addAttributes=this.addAttributes.bind(this),this.addRelationship=this.addRelationship.bind(this),this.setDirection=this.setDirection.bind(this),this.addCssStyles=this.addCssStyles.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.setAccTitle=this.setAccTitle.bind(this),this.setAccDescription=this.setAccDescription.bind(this),this.addSubGraph=this.addSubGraph.bind(this)}static{(0,l.K)(this,"ErDB")}addEntity(t,e=""){return this.entities.has(t)?!this.entities.get(t)?.alias&&e&&(this.entities.get(t).alias=e,c.R.info(`Add alias '${e}' to entity '${t}'`)):(this.entities.set(t,{id:`entity-${t}-${this.entities.size}`,label:t,attributes:[],alias:e,shape:"erBox",look:(0,o.D7)().look??"default",cssClasses:"default",cssStyles:[],labelType:"markdown"}),c.R.info("Added new entity :",t)),this.entities.get(t)}getEntity(t){return this.entities.get(t)}getEntities(){return this.entities}getClasses(){return this.classes}addAttributes(t,e){const s=this.addEntity(t);let i;for(i=e.length-1;i>=0;i--)e[i].keys||(e[i].keys=[]),e[i].comment||(e[i].comment=""),s.attributes.push(e[i]),c.R.debug("Added attribute ",e[i].name)}addRelationship(t,e,s,i){let n,r;if(this.subGraphLookup.has(t))n=t;else{const e=this.addEntity(t);if(!e)return;n=e.id}if(this.subGraphLookup.has(s))r=s;else{const t=this.addEntity(s);if(!t)return;r=t.id}const a={entityA:n,roleA:e,entityB:r,relSpec:i};this.relationships.push(a),c.R.debug("Added new relationship :",a)}getRelationships(){return this.relationships}getDirection(){return this.direction}setDirection(t){this.direction=t}getCompiledStyles(t){let e=[];for(const s of t){const t=this.classes.get(s);t?.styles&&(e=[...e,...t.styles??[]].map(t=>t.trim())),t?.textStyles&&(e=[...e,...t.textStyles??[]].map(t=>t.trim()))}return e}addCssStyles(t,e){for(const s of t){const t=this.entities.get(s),i=this.subGraphLookup.get(s);if(e){if(t)for(const s of e)t.cssStyles.push(s);if(i){i.cssStyles||(i.cssStyles=[]);for(const t of e)i.cssStyles.push(t)}}}}addClass(t,e){t.forEach(t=>{let s=this.classes.get(t);void 0===s&&(s={id:t,styles:[],textStyles:[]},this.classes.set(t,s)),e&&e.forEach(function(t){if(/color/.exec(t)){const e=t.replace("fill","bgFill");s.textStyles.push(e)}s.styles.push(t)})})}addSubGraph(t,e,s){let i=t.text.trim(),n=s.text;const r=(0,l.K)(t=>{const e=new Set;let s;return{nodeList:t.filter(t=>{if(t?.stmt)return"dir"===t.stmt&&(s=t.value),!1;if("string"!=typeof t)return!1;const i=t.trim();return!!i&&(!e.has(i)&&(e.add(i),!0))}),dir:s}},"uniq")(e.flat()),a=r.nodeList,o=r.dir;i=i??"subGraph"+this.subCount,n=n||"",n=this.sanitizeText(n),this.subCount=this.subCount+1;const h={id:i,nodes:a,title:n.trim(),classes:[],cssStyles:[],dir:o,labelType:this.sanitizeNodeLabelType(s?.type)};return c.R.info("Adding",h.id,h.nodes,h.dir),h.nodes=this.makeUniq(h,this.subGraphs).nodes,this.subGraphs.push(h),this.subGraphLookup.set(i,h),i}getSubGraphs(){return this.subGraphs}setClass(t,e){for(const s of t){const t=this.entities.get(s);if(t)for(const s of e)t.cssClasses+=" "+s;const i=this.subGraphLookup.get(s);if(i)for(const t of e)i.classes.push(t)}}subgraphNodeCache(t){const e=new Set;for(const s of t)for(const t of s.nodes)e.add(t);return e}makeUniq(t,e){const s=this.subgraphNodeCache(e),i=[];return t.nodes.forEach((e,n)=>{s.has(e)?c.R.warn(`Entity '${e}' already belongs to another subgraph and will be ignored`):i.push(t.nodes[n])}),{nodes:i}}sanitizeText(t){return o.Y2.sanitizeText(t,(0,o.D7)())}sanitizeNodeLabelType(t){switch(t){case"markdown":case"string":case"text":return t;default:return"markdown"}}clear(){this.entities=new Map,this.classes=new Map,this.relationships=[],this.subGraphs=[],this.subGraphLookup=new Map,this.subCount=0,this.subgraphDepth=0,(0,o.IU)()}getData(){const t=[],e=[],s=(0,o.D7)(),i=this.getSubGraphs(),n=new Map,r=new Map;for(let t=i.length-1;t>=0;t--){const e=i[t];e.nodes.length>0&&r.set(e.id,!0);for(const t of e.nodes)n.set(t,e.id)}for(let e=i.length-1;e>=0;e--){const r=i[e];t.push({id:r.id,label:r.title,labelStyle:"",labelType:r.labelType,parentId:n.get(r.id),padding:8,cssCompiledStyles:this.getCompiledStyles(r.classes),cssStyles:r.cssStyles,cssClasses:r.classes.join(" "),shape:"rect",dir:r.dir,isGroup:!0,look:s.look})}const c=new Set(i.map(t=>t.id));let l=0;for(const e of this.entities.keys()){if(c.has(e))continue;const s=this.entities.get(e);s&&(s.cssCompiledStyles=this.getCompiledStyles(s.cssClasses.split(" ")),s.colorIndex=l++,t.push({...s,parentId:n.get(e),isGroup:!1}))}let h=0;for(const t of this.relationships){const i={id:(0,a.rY)(t.entityA,t.entityB,{prefix:"id",counter:h++}),type:"normal",curve:"basis",start:t.entityA,end:t.entityB,label:t.roleA,labelpos:"c",thickness:"normal",classes:"relationshipLine",arrowTypeStart:t.relSpec.cardB.toLowerCase(),arrowTypeEnd:t.relSpec.cardA.toLowerCase(),pattern:"IDENTIFYING"==t.relSpec.relType?"solid":"dashed",look:s.look,labelType:"markdown"};e.push(i)}return{nodes:t,edges:e,other:{},config:s,direction:this.direction}}},g={};(0,l.V)(g,{draw:()=>_});var _=(0,l.K)(async function(t,e,s,l){c.R.info("REF0:"),c.R.info("Drawing er diagram (unified)",e);const{securityLevel:u,er:d,layout:y}=(0,o.D7)(),p=l.db.getData(),b=(0,i.A)(e,u);p.type=l.type,p.layoutAlgorithm=(0,r.q7)(y),p.config.flowchart.nodeSpacing=d?.nodeSpacing||140,p.config.flowchart.rankSpacing=d?.rankSpacing||80,p.direction=l.db.getDirection();const{config:g}=p,{look:_}=g;p.markers="neo"===_?["only_one_neo","zero_or_one_neo","one_or_more_neo","zero_or_more_neo"]:["only_one","zero_or_one","one_or_more","zero_or_more"],p.diagramId=e,await(0,r.XX)(p,b),"elk"===p.layoutAlgorithm&&b.select(".edges").lower();const f=b.selectAll('[id*="-background"]');Array.from(f).length>0&&f.each(function(){const t=(0,h.Ltv)(this),e=t.attr("id").replace("-background",""),s=b.select(`#${CSS.escape(e)}`);if(!s.empty()){const e=s.attr("transform");t.attr("transform",e)}});a._K.insertTitle(b,"erDiagramTitleText",d?.titleTopMargin??25,l.db.getDiagramTitle()),(0,n.P)(b,8,"erDiagram",d?.useMaxWidth??!0)},"draw"),f=(0,l.K)((t,e)=>{const s=d.A,i=s(t,"r"),n=s(t,"g"),r=s(t,"b");return u.A(i,n,r,e)},"fade"),m=new Set(["redux-color","redux-dark-color"]),k=(0,l.K)(t=>{const{theme:e,look:s,bkgColorArray:i,borderColorArray:n}=t;if(!m.has(e))return"";const r=i?.length>0;let a="";for(let e=0;e<t.THEME_COLOR_LIMIT;e++)a+=`\n\n [data-look="${s}"][data-color-id="color-${e}"].node path {\n stroke: ${n[e]};\n ${r?`fill: ${i[e]};`:""}\n }\n\n [data-look="${s}"][data-color-id="color-${e}"].node rect {\n stroke: ${n[e]};\n ${r?`fill: ${i[e]};`:""}\n }\n `;return a},"genColor"),E=(0,l.K)(t=>{const{look:e,theme:s,erEdgeLabelBackground:i,strokeWidth:n}=t;return`\n ${k(t)}\n .entityBox {\n fill: ${t.mainBkg};\n stroke: ${t.nodeBorder};\n }\n\n .relationshipLabelBox {\n fill: ${t.tertiaryColor};\n opacity: 0.7;\n background-color: ${t.tertiaryColor};\n rect {\n opacity: 0.5;\n }\n }\n\n .labelBkg {\n background-color: ${m.has(s)&&i?i:f(t.tertiaryColor,.5)};\n }\n\n .edgeLabel {\n background-color: ${m.has(s)&&i?i:t.edgeLabelBackground};\n }\n .edgeLabel .label rect {\n fill: ${m.has(s)&&i?i:t.edgeLabelBackground};\n }\n .edgeLabel .label text {\n fill: ${t.textColor};\n }\n\n .edgeLabel .label {\n fill: ${t.nodeBorder};\n font-size: 14px;\n }\n\n .label {\n font-family: ${t.fontFamily};\n color: ${t.nodeTextColor||t.textColor};\n }\n\n .edge-pattern-dashed {\n stroke-dasharray: 8,8;\n }\n\n .node rect,\n .node circle,\n .node ellipse,\n .node polygon\n {\n fill: ${t.mainBkg};\n stroke: ${t.nodeBorder};\n stroke-width: ${"neo"===e?n:"1px"};\n }\n\n .relationshipLine {\n stroke: ${t.lineColor};\n stroke-width: ${"neo"===e?n:"1px"};\n fill: none;\n }\n\n .marker {\n fill: none !important;\n stroke: ${t.lineColor} !important;\n stroke-width: 1;\n }\n [data-look=neo].labelBkg {\n background-color: ${f(t.tertiaryColor,.5)};\n }\n\n .cluster rect {\n fill: ${t.clusterBkg??t.mainBkg};\n stroke: ${t.clusterBorder??t.nodeBorder};\n stroke-width: 1px;\n }\n\n .cluster text {\n fill: ${t.titleColor??t.textColor};\n }\n\n .cluster-label text {\n fill: ${t.titleColor??t.textColor};\n }\n`},"getStyles"),S={parser:p,get db(){return new b},renderer:g,styles:E}}}]);
1
+ "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[4560],{75937(t,e,s){var i=s(86309),n=s(51931);const r=(t,e)=>i.A.lang.round(n.A.parse(t)[e]);s.d(e,["A",0,r])},1672(t,e,s){s.d(e,{P:()=>a});var i=s(86535),n=s(31293),r=s(86827),a=(0,r.K)((t,e,s,r)=>{t.attr("class",s);const{width:a,height:l,x:h,y:u}=o(t,e);(0,i.a$)(t,l,a,r);const d=c(h,u,a,l,e);t.attr("viewBox",d),n.R.debug(`viewBox configured: ${d} with padding: ${e}`)},"setupViewPortForSVG"),o=(0,r.K)((t,e)=>{const s=t.node()?.getBBox()||{width:0,height:0,x:0,y:0};return{width:s.width+2*e,height:s.height+2*e,x:s.x,y:s.y}},"calculateDimensionsWithPadding"),c=(0,r.K)((t,e,s,i,n)=>`${t-n} ${e-n} ${s} ${i}`,"createViewBox")},96755(t,e,s){s.d(e,{A:()=>r});var i=s(86827),n=s(51444),r=(0,i.K)((t,e)=>{let s;"sandbox"===e&&(s=(0,n.Ltv)("#i"+t));return("sandbox"===e?(0,n.Ltv)(s.nodes()[0].contentDocument.body):(0,n.Ltv)("body")).select(`[id="${t}"]`)},"getDiagramElement")},94560(t,e,s){s.d(e,{diagram:()=>S});var i=s(96755),n=s(1672),r=s(10561),a=(s(24980),s(27838),s(96865),s(48159),s(44505),s(69793),s(43287),s(12505)),o=s(86535),c=s(31293),l=s(86827),h=s(51444),u=s(25582),d=s(75937),y=function(){var t=(0,l.K)(function(t,e,s,i){for(s=s||{},i=t.length;i--;s[t[i]]=e);return s},"o"),e=[6,9,21,23,25,27,34,37,38,39,40,41,43,46,47,51,53,54,55],s=[2,2],i=[1,7],n=[1,9],r=[1,10],a=[1,11],o=[1,12],c=[1,30],h=[1,23],u=[1,24],d=[1,25],y=[1,26],p=[1,27],b=[1,19],g=[1,28],_=[1,29],f=[1,20],m=[1,18],k=[1,21],E=[1,22],S=[2,6],$=[6,9,21,23,25,27,33,34,37,38,39,40,41,43,46,47,51,53,54,55],T=[1,36],O=[1,37],x=[1,38],N=[1,39],C=[1,40],A=[6,9,12,14,16,19,20,21,23,25,27,33,34,37,38,39,40,41,43,46,47,50,51,53,54,55,69,70,71,72,73],R=[1,46],I=[1,47],D=[1,57],w=[43,51,53,54,55,74,75],v=[1,70],L=[1,68],K=[1,65],M=[1,69],B=[1,71],G=[6,9,12,16,21,23,25,27,33,34,37,38,39,40,41,43,44,45,46,47,51,52,53,54,55,69,70,71,72,73],F=[1,78],Y=[1,77],P=[1,76],z=[69,70,71,72,73],U=[1,91],Z=[6,9,45,50],j=[6,9,12,44,45,50,51,52],W=[1,101],q=[1,100],X=[1,99],V=[18,61],H=[1,110],Q=[1,109],J=[20,43,51,53,54,55],tt=[18,61,64,66],et={trace:(0,l.K)(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,line:7,statement:8,NEWLINE:9,entityName:10,relSpec:11,COLON:12,role:13,STYLE_SEPARATOR:14,idList:15,BLOCK_START:16,attributes:17,BLOCK_STOP:18,SQS:19,SQE:20,title:21,title_value:22,acc_title:23,acc_title_value:24,acc_descr:25,acc_descr_value:26,acc_descr_multiline_value:27,direction:28,classDefStatement:29,classStatement:30,styleStatement:31,subgraphHeader:32,END:33,SUBGRAPH:34,separator:35,subgraphTitle:36,direction_tb:37,direction_bt:38,direction_rl:39,direction_lr:40,CLASSDEF:41,stylesOpt:42,UNICODE_TEXT:43,STYLE_TEXT:44,COMMA:45,CLASS:46,STYLE:47,style:48,styleComponent:49,SEMI:50,NUM:51,BRKT:52,ENTITY_NAME:53,DECIMAL_NUM:54,ENTITY_ONE:55,attribute:56,attributeType:57,attributeName:58,attributeKeyTypeList:59,attributeComment:60,ATTRIBUTE_WORD:61,"?":62,attributeKeyType:63,",":64,ATTRIBUTE_KEY:65,COMMENT:66,cardinality:67,relType:68,ZERO_OR_ONE:69,ZERO_OR_MORE:70,ONE_OR_MORE:71,ONLY_ONE:72,MD_PARENT:73,NON_IDENTIFYING:74,IDENTIFYING:75,WORD:76,$accept:0,$end:1},terminals_:{2:"error",4:"ER_DIAGRAM",6:"EOF",9:"NEWLINE",12:"COLON",14:"STYLE_SEPARATOR",16:"BLOCK_START",18:"BLOCK_STOP",19:"SQS",20:"SQE",21:"title",22:"title_value",23:"acc_title",24:"acc_title_value",25:"acc_descr",26:"acc_descr_value",27:"acc_descr_multiline_value",33:"END",34:"SUBGRAPH",37:"direction_tb",38:"direction_bt",39:"direction_rl",40:"direction_lr",41:"CLASSDEF",43:"UNICODE_TEXT",44:"STYLE_TEXT",45:"COMMA",46:"CLASS",47:"STYLE",50:"SEMI",51:"NUM",52:"BRKT",53:"ENTITY_NAME",54:"DECIMAL_NUM",55:"ENTITY_ONE",61:"ATTRIBUTE_WORD",62:"?",64:",",65:"ATTRIBUTE_KEY",66:"COMMENT",69:"ZERO_OR_ONE",70:"ZERO_OR_MORE",71:"ONE_OR_MORE",72:"ONLY_ONE",73:"MD_PARENT",74:"NON_IDENTIFYING",75:"IDENTIFYING",76:"WORD"},productions_:[0,[3,3],[5,0],[5,2],[7,1],[7,1],[7,1],[8,5],[8,9],[8,7],[8,7],[8,4],[8,6],[8,3],[8,5],[8,1],[8,3],[8,7],[8,9],[8,6],[8,8],[8,4],[8,6],[8,2],[8,2],[8,2],[8,1],[8,1],[8,1],[8,1],[8,1],[8,3],[32,3],[32,6],[36,1],[36,2],[28,1],[28,1],[28,1],[28,1],[29,4],[15,1],[15,1],[15,3],[15,3],[30,3],[31,4],[42,1],[42,3],[48,1],[48,2],[35,1],[35,1],[35,1],[49,1],[49,1],[49,1],[49,1],[10,1],[10,1],[10,1],[10,1],[10,1],[17,1],[17,2],[56,2],[56,3],[56,3],[56,4],[57,1],[57,2],[58,1],[59,1],[59,3],[63,1],[60,1],[11,3],[67,1],[67,1],[67,1],[67,1],[67,1],[68,1],[68,1],[13,1],[13,1],[13,1]],performAction:(0,l.K)(function(t,e,s,i,n,r,a){var o=r.length-1;switch(n){case 1:break;case 2:case 5:case 6:this.$=[];break;case 3:this.$=r[o-1].concat(r[o]);break;case 4:case 34:case 59:case 60:case 61:case 62:case 86:case 69:case 71:case 74:this.$=r[o];break;case 7:i.addEntity(r[o-4]),i.addEntity(r[o-2]),i.addRelationship(r[o-4],r[o],r[o-2],r[o-3]),this.$=[r[o-4],r[o-2]];break;case 8:i.addEntity(r[o-8]),i.addEntity(r[o-4]),i.addRelationship(r[o-8],r[o],r[o-4],r[o-5]),i.setClass([r[o-8]],r[o-6]),i.setClass([r[o-4]],r[o-2]),this.$=[r[o-8],r[o-4]];break;case 9:i.addEntity(r[o-6]),i.addEntity(r[o-2]),i.addRelationship(r[o-6],r[o],r[o-2],r[o-3]),i.setClass([r[o-6]],r[o-4]),this.$=[r[o-6],r[o-2]];break;case 10:i.addEntity(r[o-6]),i.addEntity(r[o-4]),i.addRelationship(r[o-6],r[o],r[o-4],r[o-5]),i.setClass([r[o-4]],r[o-2]),this.$=[r[o-6],r[o-4]];break;case 11:i.addEntity(r[o-3]),i.addAttributes(r[o-3],r[o-1]),this.$=[r[o-3]];break;case 12:i.addEntity(r[o-5]),i.addAttributes(r[o-5],r[o-1]),i.setClass([r[o-5]],r[o-3]),this.$=[r[o-5]];break;case 13:i.addEntity(r[o-2]),this.$=[r[o-2]];break;case 14:i.addEntity(r[o-4]),i.setClass([r[o-4]],r[o-2]),this.$=[r[o-4]];break;case 15:i.addEntity(r[o]),this.$=[r[o]];break;case 16:i.addEntity(r[o-2]),i.setClass([r[o-2]],r[o]),this.$=[r[o-2]];break;case 17:i.addEntity(r[o-6],r[o-4]),i.addAttributes(r[o-6],r[o-1]),this.$=[r[o-6]];break;case 18:i.addEntity(r[o-8],r[o-6]),i.addAttributes(r[o-8],r[o-1]),i.setClass([r[o-8]],r[o-3]),this.$=[r[o-8]];break;case 19:i.addEntity(r[o-5],r[o-3]),this.$=[r[o-5]];break;case 20:i.addEntity(r[o-7],r[o-5]),i.setClass([r[o-7]],r[o-2]),this.$=[r[o-7]];break;case 21:i.addEntity(r[o-3],r[o-1]);break;case 22:i.addEntity(r[o-5],r[o-3]),i.setClass([r[o-5]],r[o]);break;case 23:case 24:this.$=r[o].trim(),i.setAccTitle(this.$);break;case 25:case 26:this.$=r[o].trim(),i.setAccDescription(this.$);break;case 27:i.subgraphDepth?this.$=r[o]:(i.setDirection(r[o].value),this.$=[]);break;case 31:i.subgraphDepth=(i.subgraphDepth||1)-1,this.$=i.addSubGraph({text:r[o-2].id},r[o-1],{text:r[o-2].text});break;case 32:i.subgraphDepth=(i.subgraphDepth||0)+1,this.$={id:r[o-1],text:r[o-1]};break;case 33:i.subgraphDepth=(i.subgraphDepth||0)+1,this.$={id:r[o-4],text:r[o-2]};break;case 35:this.$=r[o-1]+" "+r[o];break;case 36:this.$={stmt:"dir",value:"TB"};break;case 37:this.$={stmt:"dir",value:"BT"};break;case 38:this.$={stmt:"dir",value:"RL"};break;case 39:this.$={stmt:"dir",value:"LR"};break;case 40:this.$=r[o-3],i.addClass(r[o-2],r[o-1]);break;case 41:case 42:case 63:case 72:case 47:this.$=[r[o]];break;case 43:case 44:this.$=r[o-2].concat([r[o]]);break;case 45:this.$=r[o-2],i.setClass(r[o-1],r[o]);break;case 46:this.$=r[o-3],i.addCssStyles(r[o-2],r[o-1]);break;case 48:case 73:r[o-2].push(r[o]),this.$=r[o-2];break;case 50:case 70:this.$=r[o-1]+r[o];break;case 58:case 84:case 85:case 75:this.$=r[o].replace(/"/g,"");break;case 64:r[o].push(r[o-1]),this.$=r[o];break;case 65:this.$={type:r[o-1],name:r[o]};break;case 66:this.$={type:r[o-2],name:r[o-1],keys:r[o]};break;case 67:this.$={type:r[o-2],name:r[o-1],comment:r[o]};break;case 68:this.$={type:r[o-3],name:r[o-2],keys:r[o-1],comment:r[o]};break;case 76:this.$={cardA:r[o],relType:r[o-1],cardB:r[o-2]};break;case 77:this.$=i.Cardinality.ZERO_OR_ONE;break;case 78:this.$=i.Cardinality.ZERO_OR_MORE;break;case 79:this.$=i.Cardinality.ONE_OR_MORE;break;case 80:this.$=i.Cardinality.ONLY_ONE;break;case 81:this.$=i.Cardinality.MD_PARENT;break;case 82:this.$=i.Identification.NON_IDENTIFYING;break;case 83:this.$=i.Identification.IDENTIFYING}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,s,{5:3}),{6:[1,4],7:5,8:6,9:i,10:8,21:n,23:r,25:a,27:o,28:13,29:14,30:15,31:16,32:17,34:c,37:h,38:u,39:d,40:y,41:p,43:b,46:g,47:_,51:f,53:m,54:k,55:E},t(e,S,{1:[2,1]}),t($,[2,3]),t($,[2,4]),t($,[2,5]),t($,[2,15],{11:31,67:35,14:[1,32],16:[1,33],19:[1,34],69:T,70:O,71:x,72:N,73:C}),{22:[1,41]},{24:[1,42]},{26:[1,43]},t($,[2,26]),t($,[2,27]),t($,[2,28]),t($,[2,29]),t($,[2,30]),t($,s,{5:44}),t(A,[2,58]),t(A,[2,59]),t(A,[2,60]),t(A,[2,61]),t(A,[2,62]),t($,[2,36]),t($,[2,37]),t($,[2,38]),t($,[2,39]),{15:45,43:R,44:I},{15:48,43:R,44:I},{15:49,43:R,44:I},{10:50,43:b,51:f,53:m,54:k,55:E},{10:51,43:b,51:f,53:m,54:k,55:E},{15:52,43:R,44:I},{17:53,18:[1,54],56:55,57:56,61:D},{10:58,43:b,51:f,53:m,54:k,55:E},{68:59,74:[1,60],75:[1,61]},t(w,[2,77]),t(w,[2,78]),t(w,[2,79]),t(w,[2,80]),t(w,[2,81]),t($,[2,23]),t($,[2,24]),t($,[2,25]),{6:[1,63],7:5,8:6,9:i,10:8,21:n,23:r,25:a,27:o,28:13,29:14,30:15,31:16,32:17,33:[1,62],34:c,37:h,38:u,39:d,40:y,41:p,43:b,46:g,47:_,51:f,53:m,54:k,55:E},{12:v,42:64,44:L,45:K,48:66,49:67,51:M,52:B},t(G,[2,41]),t(G,[2,42]),{15:72,43:R,44:I,45:K},{12:v,42:73,44:L,45:K,48:66,49:67,51:M,52:B},{6:F,9:Y,19:[1,75],35:74,50:P},{12:[1,79],14:[1,80]},t($,[2,16],{67:35,11:81,16:[1,82],45:K,69:T,70:O,71:x,72:N,73:C}),{18:[1,83]},t($,[2,13]),{17:84,18:[2,63],56:55,57:56,61:D},{58:85,61:[1,86]},{61:[2,69],62:[1,87]},{20:[1,88]},{67:89,69:T,70:O,71:x,72:N,73:C},t(z,[2,82]),t(z,[2,83]),t($,[2,31]),t($,S),{6:F,9:Y,35:90,45:U,50:P},{43:[1,92],44:[1,93]},t(Z,[2,47],{49:94,12:v,44:L,51:M,52:B}),t(j,[2,49]),t(j,[2,54]),t(j,[2,55]),t(j,[2,56]),t(j,[2,57]),t($,[2,45],{45:K}),{6:F,9:Y,35:95,45:U,50:P},t($,[2,32]),{10:97,36:96,43:b,51:f,53:m,54:k,55:E},t($,[2,51]),t($,[2,52]),t($,[2,53]),{13:98,43:W,53:q,76:X},{15:102,43:R,44:I},{10:103,43:b,51:f,53:m,54:k,55:E},{17:104,18:[1,105],56:55,57:56,61:D},t($,[2,11]),{18:[2,64]},t(V,[2,65],{59:106,60:107,63:108,65:H,66:Q}),t([18,61,65,66],[2,71]),{61:[2,70]},t($,[2,21],{14:[1,112],16:[1,111]}),t([43,51,53,54,55],[2,76]),t($,[2,40]),{12:v,44:L,48:113,49:67,51:M,52:B},t(G,[2,43]),t(G,[2,44]),t(j,[2,50]),t($,[2,46]),{10:115,20:[1,114],43:b,51:f,53:m,54:k,55:E},t(J,[2,34]),t($,[2,7]),t($,[2,84]),t($,[2,85]),t($,[2,86]),{12:[1,116],45:K},{12:[1,118],14:[1,117]},{18:[1,119]},t($,[2,14]),t(V,[2,66],{60:120,64:[1,121],66:Q}),t(V,[2,67]),t(tt,[2,72]),t(V,[2,75]),t(tt,[2,74]),{17:122,18:[1,123],56:55,57:56,61:D},{15:124,43:R,44:I},t(Z,[2,48],{49:94,12:v,44:L,51:M,52:B}),{6:F,9:Y,35:125,50:P},t(J,[2,35]),{13:126,43:W,53:q,76:X},{15:127,43:R,44:I},{13:128,43:W,53:q,76:X},t($,[2,12]),t(V,[2,68]),{63:129,65:H},{18:[1,130]},t($,[2,19]),t($,[2,22],{16:[1,131],45:K}),t($,[2,33]),t($,[2,10]),{12:[1,132],45:K},t($,[2,9]),t(tt,[2,73]),t($,[2,17]),{17:133,18:[1,134],56:55,57:56,61:D},{13:135,43:W,53:q,76:X},{18:[1,136]},t($,[2,20]),t($,[2,8]),t($,[2,18])],defaultActions:{84:[2,64],87:[2,70]},parseError:(0,l.K)(function(t,e){if(!e.recoverable){var s=new Error(t);throw s.hash=e,s}this.trace(t)},"parseError"),parse:(0,l.K)(function(t){var e=this,s=[0],i=[],n=[null],r=[],a=this.table,o="",c=0,h=0,u=0,d=r.slice.call(arguments,1),y=Object.create(this.lexer),p={yy:{}};for(var b in this.yy)Object.prototype.hasOwnProperty.call(this.yy,b)&&(p.yy[b]=this.yy[b]);y.setInput(t,p.yy),p.yy.lexer=y,p.yy.parser=this,void 0===y.yylloc&&(y.yylloc={});var g=y.yylloc;r.push(g);var _=y.options&&y.options.ranges;function f(){var t;return"number"!=typeof(t=i.pop()||y.lex()||1)&&(t instanceof Array&&(t=(i=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof p.yy.parseError?this.parseError=p.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,(0,l.K)(function(t){s.length=s.length-2*t,n.length=n.length-t,r.length=r.length-t},"popStack"),(0,l.K)(f,"lex");for(var m,k,E,S,$,T,O,x,N,C={};;){if(E=s[s.length-1],this.defaultActions[E]?S=this.defaultActions[E]:(null==m&&(m=f()),S=a[E]&&a[E][m]),void 0===S||!S.length||!S[0]){var A="";for(T in N=[],a[E])this.terminals_[T]&&T>2&&N.push("'"+this.terminals_[T]+"'");A=y.showPosition?"Parse error on line "+(c+1)+":\n"+y.showPosition()+"\nExpecting "+N.join(", ")+", got '"+(this.terminals_[m]||m)+"'":"Parse error on line "+(c+1)+": Unexpected "+(1==m?"end of input":"'"+(this.terminals_[m]||m)+"'"),this.parseError(A,{text:y.match,token:this.terminals_[m]||m,line:y.yylineno,loc:g,expected:N})}if(S[0]instanceof Array&&S.length>1)throw new Error("Parse Error: multiple actions possible at state: "+E+", token: "+m);switch(S[0]){case 1:s.push(m),n.push(y.yytext),r.push(y.yylloc),s.push(S[1]),m=null,k?(m=k,k=null):(h=y.yyleng,o=y.yytext,c=y.yylineno,g=y.yylloc,u>0&&u--);break;case 2:if(O=this.productions_[S[1]][1],C.$=n[n.length-O],C._$={first_line:r[r.length-(O||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(O||1)].first_column,last_column:r[r.length-1].last_column},_&&(C._$.range=[r[r.length-(O||1)].range[0],r[r.length-1].range[1]]),void 0!==($=this.performAction.apply(C,[o,h,c,p.yy,S[1],n,r].concat(d))))return $;O&&(s=s.slice(0,-1*O*2),n=n.slice(0,-1*O),r=r.slice(0,-1*O)),s.push(this.productions_[S[1]][0]),n.push(C.$),r.push(C._$),x=a[s[s.length-2]][s[s.length-1]],s.push(x);break;case 3:return!0}}return!0},"parse")},st=function(){return{EOF:1,parseError:(0,l.K)(function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},"parseError"),setInput:(0,l.K)(function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:(0,l.K)(function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},"input"),unput:(0,l.K)(function(t){var e=t.length,s=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var i=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),s.length-1&&(this.yylineno-=s.length-1);var n=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:s?(s.length===i.length?this.yylloc.first_column:0)+i[i.length-s.length].length-s[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[n[0],n[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},"unput"),more:(0,l.K)(function(){return this._more=!0,this},"more"),reject:(0,l.K)(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:(0,l.K)(function(t){this.unput(this.match.slice(t))},"less"),pastInput:(0,l.K)(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:(0,l.K)(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:(0,l.K)(function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},"showPosition"),test_match:(0,l.K)(function(t,e){var s,i,n;if(this.options.backtrack_lexer&&(n={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(n.yylloc.range=this.yylloc.range.slice(0))),(i=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],s=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),s)return s;if(this._backtrack){for(var r in n)this[r]=n[r];return!1}return!1},"test_match"),next:(0,l.K)(function(){if(this.done)return this.EOF;var t,e,s,i;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var n=this._currentRules(),r=0;r<n.length;r++)if((s=this._input.match(this.rules[n[r]]))&&(!e||s[0].length>e[0].length)){if(e=s,i=r,this.options.backtrack_lexer){if(!1!==(t=this.test_match(s,n[r])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,n[i]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:(0,l.K)(function(){var t=this.next();return t||this.lex()},"lex"),begin:(0,l.K)(function(t){this.conditionStack.push(t)},"begin"),popState:(0,l.K)(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:(0,l.K)(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:(0,l.K)(function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},"topState"),pushState:(0,l.K)(function(t){this.begin(t)},"pushState"),stateStackSize:(0,l.K)(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:(0,l.K)(function(t,e,s,i){switch(s){case 0:return this.begin("acc_title"),23;case 1:return this.popState(),"acc_title_value";case 2:return this.begin("acc_descr"),25;case 3:return this.popState(),"acc_descr_value";case 4:this.begin("acc_descr_multiline");break;case 5:case 28:this.popState();break;case 6:return"acc_descr_multiline_value";case 7:return 37;case 8:return 38;case 9:return 39;case 10:return 40;case 11:case 22:case 30:case 37:break;case 12:return 9;case 13:return 53;case 14:return 76;case 15:return 4;case 16:return this.begin("block"),16;case 17:case 18:case 40:return 52;case 19:case 39:return 45;case 20:return 14;case 21:case 38:return 12;case 23:return 65;case 24:case 25:case 27:return 61;case 26:this.begin("block_bq");break;case 29:return 66;case 31:return this.popState(),18;case 32:case 81:return e.yytext[0];case 33:return 19;case 34:return 20;case 35:return this.begin("style"),47;case 36:return this.popState(),9;case 41:return this.begin("style"),41;case 42:return 46;case 43:return 34;case 44:return 33;case 45:case 49:case 50:case 68:return 69;case 46:case 47:case 48:case 56:case 58:case 70:return 71;case 51:case 52:case 53:case 54:case 55:case 57:case 69:return 70;case 59:case 60:case 62:case 63:case 64:case 67:return 72;case 61:return 54;case 65:return 55;case 66:return 51;case 71:return 73;case 72:case 75:case 76:case 77:return 74;case 73:case 74:return 75;case 78:return 44;case 79:return 50;case 80:return 43;case 82:return 6}},"anonymous"),rules:[/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[ \t\r]+)/i,/^(?:[\n]+)/i,/^(?:"[^"%\r\n\v\b\\]+")/i,/^(?:"[^"]*")/i,/^(?:erDiagram\b)/i,/^(?:\{)/i,/^(?:#)/i,/^(?:#)/i,/^(?:,)/i,/^(?::::)/i,/^(?::)/i,/^(?:\s+)/i,/^(?:\b((?:PK)|(?:FK)|(?:UK))\b)/i,/^(?:([^\s]*)[~].*[~]([^\s]*))/i,/^(?:([\*A-Za-z_\u00C0-\uFFFF][A-Za-z0-9\-\_\[\]\(\)\.,\u00C0-\uFFFF\*]*))/i,/^(?:[`])/i,/^(?:[^`]+)/i,/^(?:[`])/i,/^(?:"[^"]*")/i,/^(?:[\n]+)/i,/^(?:\})/i,/^(?:.)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:style\b)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?::)/i,/^(?:,)/i,/^(?:#)/i,/^(?:classDef\b)/i,/^(?:class\b)/i,/^(?:subgraph\b)/i,/^(?:end\b\s*)/i,/^(?:one or zero\b)/i,/^(?:one or more\b)/i,/^(?:one or many\b)/i,/^(?:1\+)/i,/^(?:\|o\b)/i,/^(?:zero or one\b)/i,/^(?:zero or more\b)/i,/^(?:zero or many\b)/i,/^(?:0\+)/i,/^(?:\}o\b)/i,/^(?:many\(0\))/i,/^(?:many\(1\))/i,/^(?:many\b)/i,/^(?:\}\|)/i,/^(?:one\b)/i,/^(?:only one\b)/i,/^(?:[0-9]+\.[0-9]+)/i,/^(?:1(?=\s+[A-Za-z_"']))/i,/^(?:1(?=\s+[0-9]))/i,/^(?:1(?=(--|\.\.|\.-|-\.)))/i,/^(?:1\b)/i,/^(?:[0-9]+)/i,/^(?:\|\|)/i,/^(?:o\|)/i,/^(?:o\{)/i,/^(?:\|\{)/i,/^(?:u(?=[\.\-\|]))/i,/^(?:\.\.)/i,/^(?:--)/i,/^(?:to\b)/i,/^(?:optionally to\b)/i,/^(?:\.-)/i,/^(?:-\.)/i,/^(?:([^\x00-\x7F]|\w|-|\*)+)/i,/^(?:;)/i,/^(?:([^\x00-\x7F]|\w|-|\*|\.)+)/i,/^(?:.)/i,/^(?:$)/i],conditions:{style:{rules:[36,37,38,39,40,78,79],inclusive:!1},acc_descr_multiline:{rules:[5,6],inclusive:!1},acc_descr:{rules:[3],inclusive:!1},acc_title:{rules:[1],inclusive:!1},block_bq:{rules:[27,28],inclusive:!1},block:{rules:[22,23,24,25,26,29,30,31,32],inclusive:!1},INITIAL:{rules:[0,2,4,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,33,34,35,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,80,81,82],inclusive:!0}}}}();function it(){this.yy={}}return et.lexer=st,(0,l.K)(it,"Parser"),it.prototype=et,et.Parser=it,new it}();y.parser=y;var p=y,b=class{constructor(){this.entities=new Map,this.relationships=[],this.classes=new Map,this.subgraphDepth=0,this.subGraphs=[],this.subGraphLookup=new Map,this.subCount=0,this.direction="TB",this.Cardinality={ZERO_OR_ONE:"ZERO_OR_ONE",ZERO_OR_MORE:"ZERO_OR_MORE",ONE_OR_MORE:"ONE_OR_MORE",ONLY_ONE:"ONLY_ONE",MD_PARENT:"MD_PARENT"},this.Identification={NON_IDENTIFYING:"NON_IDENTIFYING",IDENTIFYING:"IDENTIFYING"},this.setAccTitle=o.SV,this.getAccTitle=o.iN,this.setAccDescription=o.EI,this.getAccDescription=o.m7,this.setDiagramTitle=o.ke,this.getDiagramTitle=o.ab,this.getConfig=(0,l.K)(()=>(0,o.D7)().er,"getConfig"),this.clear(),this.addEntity=this.addEntity.bind(this),this.addAttributes=this.addAttributes.bind(this),this.addRelationship=this.addRelationship.bind(this),this.setDirection=this.setDirection.bind(this),this.addCssStyles=this.addCssStyles.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.setAccTitle=this.setAccTitle.bind(this),this.setAccDescription=this.setAccDescription.bind(this),this.addSubGraph=this.addSubGraph.bind(this)}static{(0,l.K)(this,"ErDB")}addEntity(t,e=""){return this.entities.has(t)?!this.entities.get(t)?.alias&&e&&(this.entities.get(t).alias=e,c.R.info(`Add alias '${e}' to entity '${t}'`)):(this.entities.set(t,{id:`entity-${t}-${this.entities.size}`,label:t,attributes:[],alias:e,shape:"erBox",look:(0,o.D7)().look??"default",cssClasses:"default",cssStyles:[],labelType:"markdown"}),c.R.info("Added new entity :",t)),this.entities.get(t)}getEntity(t){return this.entities.get(t)}getEntities(){return this.entities}getClasses(){return this.classes}addAttributes(t,e){const s=this.addEntity(t);let i;for(i=e.length-1;i>=0;i--)e[i].keys||(e[i].keys=[]),e[i].comment||(e[i].comment=""),s.attributes.push(e[i]),c.R.debug("Added attribute ",e[i].name)}addRelationship(t,e,s,i){let n,r;if(this.subGraphLookup.has(t))n=t;else{const e=this.addEntity(t);if(!e)return;n=e.id}if(this.subGraphLookup.has(s))r=s;else{const t=this.addEntity(s);if(!t)return;r=t.id}const a={entityA:n,roleA:e,entityB:r,relSpec:i};this.relationships.push(a),c.R.debug("Added new relationship :",a)}getRelationships(){return this.relationships}getDirection(){return this.direction}setDirection(t){this.direction=t}getCompiledStyles(t){let e=[];for(const s of t){const t=this.classes.get(s);t?.styles&&(e=[...e,...t.styles??[]].map(t=>t.trim())),t?.textStyles&&(e=[...e,...t.textStyles??[]].map(t=>t.trim()))}return e}addCssStyles(t,e){for(const s of t){const t=this.entities.get(s),i=this.subGraphLookup.get(s);if(e){if(t)for(const s of e)t.cssStyles.push(s);if(i){i.cssStyles||(i.cssStyles=[]);for(const t of e)i.cssStyles.push(t)}}}}addClass(t,e){t.forEach(t=>{let s=this.classes.get(t);void 0===s&&(s={id:t,styles:[],textStyles:[]},this.classes.set(t,s)),e&&e.forEach(function(t){if(/color/.exec(t)){const e=t.replace("fill","bgFill");s.textStyles.push(e)}s.styles.push(t)})})}addSubGraph(t,e,s){let i=t.text.trim(),n=s.text;const r=(0,l.K)(t=>{const e=new Set;let s;return{nodeList:t.filter(t=>{if(t?.stmt)return"dir"===t.stmt&&(s=t.value),!1;if("string"!=typeof t)return!1;const i=t.trim();return!!i&&(!e.has(i)&&(e.add(i),!0))}),dir:s}},"uniq")(e.flat()),a=r.nodeList,o=r.dir;i=i??"subGraph"+this.subCount,n=n||"",n=this.sanitizeText(n),this.subCount=this.subCount+1;const h={id:i,nodes:a,title:n.trim(),classes:[],cssStyles:[],dir:o,labelType:this.sanitizeNodeLabelType(s?.type)};return c.R.info("Adding",h.id,h.nodes,h.dir),h.nodes=this.makeUniq(h,this.subGraphs).nodes,this.subGraphs.push(h),this.subGraphLookup.set(i,h),i}getSubGraphs(){return this.subGraphs}setClass(t,e){for(const s of t){const t=this.entities.get(s);if(t)for(const s of e)t.cssClasses+=" "+s;const i=this.subGraphLookup.get(s);if(i)for(const t of e)i.classes.push(t)}}subgraphNodeCache(t){const e=new Set;for(const s of t)for(const t of s.nodes)e.add(t);return e}makeUniq(t,e){const s=this.subgraphNodeCache(e),i=[];return t.nodes.forEach((e,n)=>{s.has(e)?c.R.warn(`Entity '${e}' already belongs to another subgraph and will be ignored`):i.push(t.nodes[n])}),{nodes:i}}sanitizeText(t){return o.Y2.sanitizeText(t,(0,o.D7)())}sanitizeNodeLabelType(t){switch(t){case"markdown":case"string":case"text":return t;default:return"markdown"}}clear(){this.entities=new Map,this.classes=new Map,this.relationships=[],this.subGraphs=[],this.subGraphLookup=new Map,this.subCount=0,this.subgraphDepth=0,(0,o.IU)()}getData(){const t=[],e=[],s=(0,o.D7)(),i=this.getSubGraphs(),n=new Map,r=new Map;for(let t=i.length-1;t>=0;t--){const e=i[t];e.nodes.length>0&&r.set(e.id,!0);for(const t of e.nodes)n.set(t,e.id)}for(let e=i.length-1;e>=0;e--){const r=i[e];t.push({id:r.id,label:r.title,labelStyle:"",labelType:r.labelType,parentId:n.get(r.id),padding:8,cssCompiledStyles:this.getCompiledStyles(r.classes),cssStyles:r.cssStyles,cssClasses:r.classes.join(" "),shape:"rect",dir:r.dir,isGroup:!0,look:s.look})}const c=new Set(i.map(t=>t.id));let l=0;for(const e of this.entities.keys()){if(c.has(e))continue;const s=this.entities.get(e);s&&(s.cssCompiledStyles=this.getCompiledStyles(s.cssClasses.split(" ")),s.colorIndex=l++,t.push({...s,parentId:n.get(e),isGroup:!1}))}let h=0;for(const t of this.relationships){const i={id:(0,a.rY)(t.entityA,t.entityB,{prefix:"id",counter:h++}),type:"normal",curve:"basis",start:t.entityA,end:t.entityB,label:t.roleA,labelpos:"c",thickness:"normal",classes:"relationshipLine",arrowTypeStart:t.relSpec.cardB.toLowerCase(),arrowTypeEnd:t.relSpec.cardA.toLowerCase(),pattern:"IDENTIFYING"==t.relSpec.relType?"solid":"dashed",look:s.look,labelType:"markdown"};e.push(i)}return{nodes:t,edges:e,other:{},config:s,direction:this.direction}}},g={};(0,l.V)(g,{draw:()=>_});var _=(0,l.K)(async function(t,e,s,l){c.R.info("REF0:"),c.R.info("Drawing er diagram (unified)",e);const{securityLevel:u,er:d,layout:y}=(0,o.D7)(),p=l.db.getData(),b=(0,i.A)(e,u);p.type=l.type,p.layoutAlgorithm=(0,r.q7)(y),p.config.flowchart.nodeSpacing=d?.nodeSpacing||140,p.config.flowchart.rankSpacing=d?.rankSpacing||80,p.direction=l.db.getDirection();const{config:g}=p,{look:_}=g;p.markers="neo"===_?["only_one_neo","zero_or_one_neo","one_or_more_neo","zero_or_more_neo"]:["only_one","zero_or_one","one_or_more","zero_or_more"],p.diagramId=e,await(0,r.XX)(p,b),"elk"===p.layoutAlgorithm&&b.select(".edges").lower();const f=b.selectAll('[id*="-background"]');Array.from(f).length>0&&f.each(function(){const t=(0,h.Ltv)(this),e=t.attr("id").replace("-background",""),s=b.select(`#${CSS.escape(e)}`);if(!s.empty()){const e=s.attr("transform");t.attr("transform",e)}});a._K.insertTitle(b,"erDiagramTitleText",d?.titleTopMargin??25,l.db.getDiagramTitle()),(0,n.P)(b,8,"erDiagram",d?.useMaxWidth??!0)},"draw"),f=(0,l.K)((t,e)=>{const s=d.A,i=s(t,"r"),n=s(t,"g"),r=s(t,"b");return u.A(i,n,r,e)},"fade"),m=new Set(["redux-color","redux-dark-color"]),k=(0,l.K)(t=>{const{theme:e,look:s,bkgColorArray:i,borderColorArray:n}=t;if(!m.has(e))return"";const r=i?.length>0;let a="";for(let e=0;e<t.THEME_COLOR_LIMIT;e++)a+=`\n\n [data-look="${s}"][data-color-id="color-${e}"].node path {\n stroke: ${n[e]};\n ${r?`fill: ${i[e]};`:""}\n }\n\n [data-look="${s}"][data-color-id="color-${e}"].node rect {\n stroke: ${n[e]};\n ${r?`fill: ${i[e]};`:""}\n }\n `;return a},"genColor"),E=(0,l.K)(t=>{const{look:e,theme:s,erEdgeLabelBackground:i,strokeWidth:n}=t;return`\n ${k(t)}\n .entityBox {\n fill: ${t.mainBkg};\n stroke: ${t.nodeBorder};\n }\n\n .relationshipLabelBox {\n fill: ${t.tertiaryColor};\n opacity: 0.7;\n background-color: ${t.tertiaryColor};\n rect {\n opacity: 0.5;\n }\n }\n\n .labelBkg {\n background-color: ${m.has(s)&&i?i:f(t.tertiaryColor,.5)};\n }\n\n .edgeLabel {\n background-color: ${m.has(s)&&i?i:t.edgeLabelBackground};\n }\n .edgeLabel .label rect {\n fill: ${m.has(s)&&i?i:t.edgeLabelBackground};\n }\n .edgeLabel .label text {\n fill: ${t.textColor};\n }\n\n .edgeLabel .label {\n fill: ${t.nodeBorder};\n font-size: 14px;\n }\n\n .label {\n font-family: ${t.fontFamily};\n color: ${t.nodeTextColor||t.textColor};\n }\n\n .edge-pattern-dashed {\n stroke-dasharray: 8,8;\n }\n\n .node rect,\n .node circle,\n .node ellipse,\n .node polygon\n {\n fill: ${t.mainBkg};\n stroke: ${t.nodeBorder};\n stroke-width: ${"neo"===e?n:"1px"};\n }\n\n .relationshipLine {\n stroke: ${t.lineColor};\n stroke-width: ${"neo"===e?n:"1px"};\n fill: none;\n }\n\n .marker {\n fill: none !important;\n stroke: ${t.lineColor} !important;\n stroke-width: 1;\n }\n [data-look=neo].labelBkg {\n background-color: ${f(t.tertiaryColor,.5)};\n }\n\n .cluster rect {\n fill: ${t.clusterBkg??t.mainBkg};\n stroke: ${t.clusterBorder??t.nodeBorder};\n stroke-width: 1px;\n }\n\n .cluster text {\n fill: ${t.titleColor??t.textColor};\n }\n\n .cluster-label text {\n fill: ${t.titleColor??t.textColor};\n }\n`},"getStyles"),S={parser:p,get db(){return new b},renderer:g,styles:E}}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[4903],{64903(e,t,n){n.r(t),n.d(t,{default:()=>f});var c=n(96540),i=n(34843),l=n(82893),s=n(85997),o=n(57952),a=(n(62042),n(21499),n(40505),n(22022)),d=(n(99214),n(74848));const r=c.lazy(()=>Promise.all([n.e(4946),n.e(2626),n.e(7954),n.e(6010)]).then(n.bind(n,34299)));function f(e){const{t}=(0,a.Bd)(),[n,c]=(0,i.fp)(l.AG.markdown);if(n.context)return(0,d.jsxs)("div",{id:"md-container",children:[(0,d.jsx)(o.A,{ignore_tags:!0,left_children:[(0,d.jsx)(s.rA,{title:t("取消"),icon:"close",onClick:function(){c({context:"",filename:""}),n?.close?.()}},1),(0,d.jsx)("title",{children:n.filename},2)]}),(0,d.jsx)("div",{className:"md-context ",children:(0,d.jsx)(r,{context:n.context})})]})}}}]);
1
+ "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[4903],{64903(e,t,n){n.r(t),n.d(t,{default:()=>f});var c=n(96540),i=n(34843),l=n(82893),s=n(85997),o=n(57952),a=(n(62042),n(21499),n(40505),n(22022)),d=(n(99214),n(74848));const r=c.lazy(()=>Promise.all([n.e(4946),n.e(2626),n.e(9334),n.e(6010)]).then(n.bind(n,34299)));function f(e){const{t}=(0,a.Bd)(),[n,c]=(0,i.fp)(l.AG.markdown);if(n.context)return(0,d.jsxs)("div",{id:"md-container",children:[(0,d.jsx)(o.A,{ignore_tags:!0,left_children:[(0,d.jsx)(s.rA,{title:t("取消"),icon:"close",onClick:function(){c({context:"",filename:""}),n?.close?.()}},1),(0,d.jsx)("title",{children:n.filename},2)]}),(0,d.jsx)("div",{className:"md-context ",children:(0,d.jsx)(r,{context:n.context})})]})}}}]);