From 17a425adf7b4dabac4500f9432bf936beb1335e3 Mon Sep 17 00:00:00 2001 From: aries_ckt <916701291@qq.com> Date: Fri, 20 Oct 2023 15:04:40 +0800 Subject: [PATCH] fix:web knowledge upload bug --- docs/getting_started/faq/deploy/deploy_faq.md | 1 + docs/getting_started/faq/kbqa/kbqa_faq.md | 23 ++++++ .../getting_started/faq/kbqa/kbqa_faq.po | 73 ++++++++++++------- pilot/connections/rdbms/base.py | 2 +- pilot/scene/chat_db/auto_execute/chat.py | 1 + pilot/server/static/404.html | 2 +- pilot/server/static/404/index.html | 2 +- .../O5FOClC-bCYrNf6P8Va8Z/_buildManifest.js | 1 - .../static/chunks/214.42f1e2cf34f5caac.js | 1 - .../static/chunks/304.b9722ef34a01988f.js | 1 + .../static/chunks/369.867be2bc991d02f3.js | 1 - .../static/chunks/604.e31c3e76149a6ff7.js | 1 + .../static/chunks/747-6c8367d757926558.js | 1 + .../static/chunks/747-885083c9b95c17d3.js | 1 - .../static/chunks/932.56f35bb5eaee71f5.js | 1 - .../static/chunks/932.7b0affeba86ae523.js | 1 + .../static/chunks/991-686f9d35770ecb4b.js | 7 -- ...41bd65e851.js => _app-0e8330de38c03c5c.js} | 4 +- .../chunks/pages/agent-3a8d0b5a32e39e4c.js | 1 - .../chunks/pages/agent-dbb8ff019a2c71c2.js | 1 + ...cb5d09f61b.js => chat-197b88d512cc5b14.js} | 2 +- ...ba492008eb.js => [id]-ac949685f9639f4f.js} | 2 +- .../chunks/pages/index-02331aee6ba6a7fc.js | 1 + .../chunks/pages/index-ccee0d0c06e351f8.js | 1 - ...7c3be.js => knowledge-fe88b529e40b0db6.js} | 2 +- ...0c14e09e39.js => [id]-288d3a43e60ca611.js} | 2 +- .../chunks/pages/models-58b1d88132bdc672.js | 7 ++ .../chunks/pages/models-cb013d8fe1f7d0c2.js | 1 - ...560768d.js => webpack-2e50ecf954b8023b.js} | 2 +- .../s-WL9w3N8oSbGEOi5ysVt/_buildManifest.js | 1 + .../_ssgManifest.js | 0 pilot/server/static/agent/index.html | 2 +- .../static/chat/[scene]/[id]/index.html | 2 +- pilot/server/static/chat/index.html | 2 +- pilot/server/static/database/index.html | 2 +- pilot/server/static/index.html | 2 +- .../knowledge/[knowledgeName]/[id]/index.html | 2 +- pilot/server/static/knowledge/index.html | 2 +- pilot/server/static/models/index.html | 2 +- pilot/server/static/prompt/index.html | 2 +- 40 files changed, 106 insertions(+), 59 deletions(-) delete mode 100644 pilot/server/static/_next/static/O5FOClC-bCYrNf6P8Va8Z/_buildManifest.js delete mode 100644 pilot/server/static/_next/static/chunks/214.42f1e2cf34f5caac.js create mode 100644 pilot/server/static/_next/static/chunks/304.b9722ef34a01988f.js delete mode 100644 pilot/server/static/_next/static/chunks/369.867be2bc991d02f3.js create mode 100644 pilot/server/static/_next/static/chunks/604.e31c3e76149a6ff7.js create mode 100644 pilot/server/static/_next/static/chunks/747-6c8367d757926558.js delete mode 100644 pilot/server/static/_next/static/chunks/747-885083c9b95c17d3.js delete mode 100644 pilot/server/static/_next/static/chunks/932.56f35bb5eaee71f5.js create mode 100644 pilot/server/static/_next/static/chunks/932.7b0affeba86ae523.js delete mode 100644 pilot/server/static/_next/static/chunks/991-686f9d35770ecb4b.js rename pilot/server/static/_next/static/chunks/pages/{_app-afd04641bd65e851.js => _app-0e8330de38c03c5c.js} (90%) delete mode 100644 pilot/server/static/_next/static/chunks/pages/agent-3a8d0b5a32e39e4c.js create mode 100644 pilot/server/static/_next/static/chunks/pages/agent-dbb8ff019a2c71c2.js rename pilot/server/static/_next/static/chunks/pages/{chat-75cb71cb5d09f61b.js => chat-197b88d512cc5b14.js} (95%) rename pilot/server/static/_next/static/chunks/pages/chat/[scene]/{[id]-826f37ba492008eb.js => [id]-ac949685f9639f4f.js} (96%) create mode 100644 pilot/server/static/_next/static/chunks/pages/index-02331aee6ba6a7fc.js delete mode 100644 pilot/server/static/_next/static/chunks/pages/index-ccee0d0c06e351f8.js rename pilot/server/static/_next/static/chunks/pages/{knowledge-241088d0c9a7c3be.js => knowledge-fe88b529e40b0db6.js} (96%) rename pilot/server/static/_next/static/chunks/pages/knowledge/[knowledgeName]/{[id]-3ae2140c14e09e39.js => [id]-288d3a43e60ca611.js} (93%) create mode 100644 pilot/server/static/_next/static/chunks/pages/models-58b1d88132bdc672.js delete mode 100644 pilot/server/static/_next/static/chunks/pages/models-cb013d8fe1f7d0c2.js rename pilot/server/static/_next/static/chunks/{webpack-ac3f39ddc560768d.js => webpack-2e50ecf954b8023b.js} (56%) create mode 100644 pilot/server/static/_next/static/s-WL9w3N8oSbGEOi5ysVt/_buildManifest.js rename pilot/server/static/_next/static/{O5FOClC-bCYrNf6P8Va8Z => s-WL9w3N8oSbGEOi5ysVt}/_ssgManifest.js (100%) diff --git a/docs/getting_started/faq/deploy/deploy_faq.md b/docs/getting_started/faq/deploy/deploy_faq.md index c787337ed..773e99794 100644 --- a/docs/getting_started/faq/deploy/deploy_faq.md +++ b/docs/getting_started/faq/deploy/deploy_faq.md @@ -103,4 +103,5 @@ pip install --use-pep517 fschat delete files in `DB-GPT/pilot/meta_data/alembic/versions/` and reboot. ```commandline rm -rf DB-GPT/pilot/meta_data/alembic/versions/* +rm -rf DB-GPT/pilot/meta_data/alembic/dbgpt.db ``` diff --git a/docs/getting_started/faq/kbqa/kbqa_faq.md b/docs/getting_started/faq/kbqa/kbqa_faq.md index b1835d7dc..61bdf2c18 100644 --- a/docs/getting_started/faq/kbqa/kbqa_faq.md +++ b/docs/getting_started/faq/kbqa/kbqa_faq.md @@ -67,4 +67,27 @@ build Mysql KBQA system database schema. ```bash $ mysql -h127.0.0.1 -uroot -paa12345678 < ./assets/schema/knowledge_management.sql +``` + + +##### Q6:when pull from 0.4.0, I found historical knowledge document disappeared + +In version 0.4.0, the metadata module of the DB-GPT application has been refactored. All metadata tables will now be automatically saved in the 'dbgpt' database, based on the database type specified in the .env file. If you would like to retain the existing data, it is recommended to use a data migration tool to transfer the database table information to the 'dbgpt' database. + +```{tip} +old database:knowledge_management; +new database:dbgpt; +``` +```commandline +### SQLite database (Current default database) +#LOCAL_DB_PATH=data/default_sqlite.db +#LOCAL_DB_TYPE=sqlite + +### Mysql database +LOCAL_DB_TYPE=mysql +LOCAL_DB_USER=root +LOCAL_DB_PASSWORD=aa12345678 +LOCAL_DB_HOST=127.0.0.1 +LOCAL_DB_PORT=3306 + ``` \ No newline at end of file diff --git a/docs/locales/zh_CN/LC_MESSAGES/getting_started/faq/kbqa/kbqa_faq.po b/docs/locales/zh_CN/LC_MESSAGES/getting_started/faq/kbqa/kbqa_faq.po index 885826ddd..73112ba21 100644 --- a/docs/locales/zh_CN/LC_MESSAGES/getting_started/faq/kbqa/kbqa_faq.po +++ b/docs/locales/zh_CN/LC_MESSAGES/getting_started/faq/kbqa/kbqa_faq.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: DB-GPT 👏👏 0.3.5\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-18 14:11+0800\n" +"POT-Creation-Date: 2023-10-20 14:49+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language: zh_CN\n" @@ -20,34 +20,34 @@ msgstr "" "Generated-By: Babel 2.12.1\n" #: ../../getting_started/faq/kbqa/kbqa_faq.md:1 -#: 348b327c869643c8baaafaddb9e7e6d4 +#: e95c136d802f486082c47a8c017eb725 msgid "KBQA FAQ" msgstr "KBQA FAQ" #: ../../getting_started/faq/kbqa/kbqa_faq.md:4 -#: b2d05eeaec0b445ab3283e0e4eee028a +#: f19c96b7b1ec4bc7ad8c7c26582d7e59 msgid "Q1: text2vec-large-chinese not found" msgstr "Q1: text2vec-large-chinese not found" #: ../../getting_started/faq/kbqa/kbqa_faq.md:6 -#: d64bad7091de4b439ab80cd754b3e68f +#: 24a0603be39d4418909c27f9a53b51e2 msgid "" "make sure you have download text2vec-large-chinese embedding model in " "right way" msgstr "确认下载text2vec-large-chinese模型姿势以及路径正确" #: ../../getting_started/faq/kbqa/kbqa_faq.md:18 -#: 15a4987b681241cfa6dc4fc08dbebce3 +#: 356008dd415f4bdd9b0927d8ee073548 msgid "Q2:How to change Vector DB Type in DB-GPT." msgstr "怎么修改向量数据库类型" #: ../../getting_started/faq/kbqa/kbqa_faq.md:20 -#: 6566d91820334c8fac964fe7e012acc7 +#: 42013bfb02624010b668bd244b33c977 msgid "Update .env file and set VECTOR_STORE_TYPE." msgstr "怎样在.env文件设置VECTOR_STORE_TYPE" #: ../../getting_started/faq/kbqa/kbqa_faq.md:22 -#: 124dfe106c4b4afeadf0f2bc4b146f50 +#: 72b2bae15fea4e0d927bda68a8d0861d msgid "" "DB-GPT currently support Chroma(Default), Milvus(>2.1), Weaviate vector " "database. If you want to change vector db, Update your .env, set your " @@ -55,57 +55,80 @@ msgid "" "Milvus(>2.1), if you set Milvus, please set MILVUS_URL and MILVUS_PORT) " "If you want to support more vector db, you can integrate yourself.[how to" " integrate](https://db-gpt.readthedocs.io/en/latest/modules/vector.html)" -msgstr "DB-GPT当前支持向量数据库有Chroma(Default), Milvus(>2.1), Weaviate. 可以在在.env文件设置VECTOR_STORE_TYP,如果你想支持更多向量数据库, 参考[how to" -" integrate](https://db-gpt.readthedocs.io/en/latest/modules/vector.html)" - +msgstr "" +"DB-GPT当前支持向量数据库有Chroma(Default), Milvus(>2.1), Weaviate. " +"可以在在.env文件设置VECTOR_STORE_TYP,如果你想支持更多向量数据库, 参考[how to integrate](https" +"://db-gpt.readthedocs.io/en/latest/modules/vector.html)" #: ../../getting_started/faq/kbqa/kbqa_faq.md:38 -#: 5da7eb1fda5d43268eda0fab9d387dbb +#: 0a12e3a5319c4a86a1db68d615d6fb8e msgid "Q3:When I use vicuna-13b, found some illegal character like this." msgstr "当使用vicuna系列模型时出现乱码。" #: ../../getting_started/faq/kbqa/kbqa_faq.md:43 -#: 80f9785ca43f4f8a9475556bffab28a7 +#: f89ffbf4697a4ccdb8030834c52b0473 msgid "" "Set KNOWLEDGE_SEARCH_TOP_SIZE smaller or set KNOWLEDGE_CHUNK_SIZE " "smaller, and reboot server." msgstr "通过在.env文件将KNOWLEDGE_SEARCH_TOP_SIZE设置更小点或者在文档界面点击参数设置,将topk设置更小点" #: ../../getting_started/faq/kbqa/kbqa_faq.md:45 -#: 7627f9349fbb40968537866075e53541 +#: fc837488bcc7432a92b70126e80e75d7 msgid "" "Q4:space add error (pymysql.err.OperationalError) (1054, \"Unknown column" " 'knowledge_space.context' in 'field list'\")" -msgstr "space add error (pymysql.err.OperationalError) (1054, \"Unknown column" -" 'knowledge_space.context' in 'field list'\")" +msgstr "" +"space add error (pymysql.err.OperationalError) (1054, \"Unknown column " +"'knowledge_space.context' in 'field list'\")" #: ../../getting_started/faq/kbqa/kbqa_faq.md:47 -#: e4c8bc526f1744ca880fd0f5faaa18c6 +#: 30c186bae2c3489eb18c18768c11c302 msgid "1.shutdown dbgpt_server(ctrl c)" msgstr "1.终止 dbgpt_server(ctrl c)" #: ../../getting_started/faq/kbqa/kbqa_faq.md:49 -#: 25762770ad7b4e52aa60c1b8a274331b +#: 9cac5688ddb14c63905cc86e77d4567e msgid "2.add column context for table knowledge_space" msgstr "2.新增列 `context` for table knowledge_space" -#: ../../getting_started/faq/kbqa/kbqa_faq.md:53 -#: b025ea011b704eaab5413514a00ada4a +#: ../../getting_started/faq/kbqa/kbqa_faq.md:55 +#: b32219bc1c6246108f606952d8ef0132 msgid "3.execute sql ddl" msgstr "3.执行ddl" -#: ../../getting_started/faq/kbqa/kbqa_faq.md:58 -#: 2c25d510b7cc4386a962be130232f39c +#: ../../getting_started/faq/kbqa/kbqa_faq.md:62 +#: ebfd196350994c44841d5766f776905c msgid "4.restart dbgpt serve" msgstr "4.重启dbgpt server" -#: ../../getting_started/faq/kbqa/kbqa_faq.md:60 -#: 36aedd2404e84caf90fa6565fc05ee1f +#: ../../getting_started/faq/kbqa/kbqa_faq.md:64 +#: cfa083226efd4980a57ff15e86bb8480 msgid "Q5:Use Mysql, how to use DB-GPT KBQA" msgstr "Q5:当使用 Mysql数据库时, 使用DB-GPT怎么初始化 KBQA service database schema" -#: ../../getting_started/faq/kbqa/kbqa_faq.md:61 -#: bb01d8d145f64038bbacde1f05e69be1 +#: ../../getting_started/faq/kbqa/kbqa_faq.md:66 +#: 95098205d36c4ca79ad9b1b0f9b2985a msgid "build Mysql KBQA system database schema." msgstr "构建Mysql KBQA system database schema" +#: ../../getting_started/faq/kbqa/kbqa_faq.md:73 +#: efc87678042d48b38b57f700d9ff74e5 +msgid "Q6:when pull from 0.4.0, I found historical knowledge document disappeared" +msgstr "当从0.4.0版本拉取代码后,历史知识库问答信息没了" + +#: ../../getting_started/faq/kbqa/kbqa_faq.md:75 +#: 975eaff1a20a40b5b5ee18d6c6ddb9c1 +msgid "" +"In version 0.4.0, the metadata module of the DB-GPT application has been " +"refactored. All metadata tables will now be automatically saved in the " +"'dbgpt' database, based on the database type specified in the .env file. " +"If you would like to retain the existing data, it is recommended to use a" +" data migration tool to transfer the database table information to the " +"'dbgpt' database." +msgstr "v0.4.0 重构了DB-GPT应用的数据库元数据模块,所有的元数据库表都会自动保存在.env文件设置的数据库类型的`dbgpt`数据库中,如果想沿用以前的数据,建议使用数据迁移工具将数据库表信息挪到dbgpt数据库中。" + +#: ../../getting_started/faq/kbqa/kbqa_faq.md:78 +#: 815e44fef54f4807a2cf1e8d64b73a70 +msgid "old database:knowledge_management; new database:dbgpt;" +msgstr "" + diff --git a/pilot/connections/rdbms/base.py b/pilot/connections/rdbms/base.py index 82798a885..8d83d0d9a 100644 --- a/pilot/connections/rdbms/base.py +++ b/pilot/connections/rdbms/base.py @@ -349,7 +349,7 @@ class RDBMSDatabase(BaseConnect): def run(self, command: str, fetch: str = "all") -> List: """Execute a SQL command and return a string representing the results.""" print("SQL:" + command) - if not command or len(command) <0: + if not command or len(command) < 0: return [] parsed, ttype, sql_type, table_name = self.__sql_parse(command) if ttype == sqlparse.tokens.DML: diff --git a/pilot/scene/chat_db/auto_execute/chat.py b/pilot/scene/chat_db/auto_execute/chat.py index 01e04be63..b05480cdf 100644 --- a/pilot/scene/chat_db/auto_execute/chat.py +++ b/pilot/scene/chat_db/auto_execute/chat.py @@ -75,6 +75,7 @@ class ChatWithDbAutoExecute(BaseChat): text = text.replace("\n", " ") print(f"stream_plugin_call:{text}") return self.api_call.run_display_sql(text, self.database.run_to_df) + # # def do_action(self, prompt_response): # print(f"do_action:{prompt_response}") diff --git a/pilot/server/static/404.html b/pilot/server/static/404.html index 338e17434..df2d3a147 100644 --- a/pilot/server/static/404.html +++ b/pilot/server/static/404.html @@ -1 +1 @@ -404: This page could not be found

404

This page could not be found.

\ No newline at end of file +404: This page could not be found

404

This page could not be found.

\ No newline at end of file diff --git a/pilot/server/static/404/index.html b/pilot/server/static/404/index.html index 338e17434..df2d3a147 100644 --- a/pilot/server/static/404/index.html +++ b/pilot/server/static/404/index.html @@ -1 +1 @@ -404: This page could not be found

404

This page could not be found.

\ No newline at end of file +404: This page could not be found

404

This page could not be found.

\ No newline at end of file diff --git a/pilot/server/static/_next/static/O5FOClC-bCYrNf6P8Va8Z/_buildManifest.js b/pilot/server/static/_next/static/O5FOClC-bCYrNf6P8Va8Z/_buildManifest.js deleted file mode 100644 index f45012e3a..000000000 --- a/pilot/server/static/_next/static/O5FOClC-bCYrNf6P8Va8Z/_buildManifest.js +++ /dev/null @@ -1 +0,0 @@ -self.__BUILD_MANIFEST=function(s,c,e,a,t,d,n,b,i,k,f,h,u,j,g){return{__rewrites:{beforeFiles:[],afterFiles:[],fallback:[]},"/":[k,s,c,e,d,f,"static/chunks/539-dcd22f1f6b99ebee.js","static/chunks/pages/index-ccee0d0c06e351f8.js"],"/_error":["static/chunks/pages/_error-dee72aff9b2e2c12.js"],"/agent":[s,c,n,a,t,b,"static/chunks/pages/agent-3a8d0b5a32e39e4c.js"],"/chat":["static/chunks/pages/chat-75cb71cb5d09f61b.js"],"/chat/[scene]/[id]":["static/chunks/pages/chat/[scene]/[id]-826f37ba492008eb.js"],"/database":[s,c,e,a,t,d,h,"static/chunks/643-d2492f894de95084.js","static/chunks/pages/database-ee0ff45d60094b3c.js"],"/knowledge":[i,s,c,n,a,t,b,d,u,j,"static/chunks/pages/knowledge-241088d0c9a7c3be.js"],"/knowledge/[knowledgeName]/[id]":[i,s,c,n,a,t,b,u,j,"static/chunks/pages/knowledge/[knowledgeName]/[id]-3ae2140c14e09e39.js"],"/models":[i,s,c,e,g,h,"static/chunks/991-686f9d35770ecb4b.js","static/chunks/pages/models-cb013d8fe1f7d0c2.js"],"/prompt":[k,s,c,e,g,f,"static/chunks/45-9ff739c09925ea35.js","static/chunks/61-d2f6cba798a49339.js","static/chunks/367-5b7ab3e8e2777607.js","static/chunks/pages/prompt-741cf72801523b25.js"],sortedPages:["/","/_app","/_error","/agent","/chat","/chat/[scene]/[id]","/database","/knowledge","/knowledge/[knowledgeName]/[id]","/models","/prompt"]}}("static/chunks/44-941ba89e47567ba3.js","static/chunks/479-68b22ee2b7a47fb3.js","static/chunks/9-bb2c54d5c06ba4bf.js","static/chunks/442-197e6cbc1e54109a.js","static/chunks/813-cce9482e33f2430c.js","static/chunks/411-d9eba2657c72f766.js","static/chunks/365-2cad3676ccbb1b1a.js","static/chunks/924-ba8e16df4d61ff5c.js","static/chunks/75fc9c18-36ac6f5a83376cd3.js","static/chunks/29107295-90b90cb30c825230.js","static/chunks/270-2f094a936d056513.js","static/chunks/928-74244889bd7f2699.js","static/chunks/104-953a3907bb8d7bfd.js","static/chunks/747-885083c9b95c17d3.js","static/chunks/815-fa0a8da2d0a72116.js"),self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB(); \ No newline at end of file diff --git a/pilot/server/static/_next/static/chunks/214.42f1e2cf34f5caac.js b/pilot/server/static/_next/static/chunks/214.42f1e2cf34f5caac.js deleted file mode 100644 index e8b1c6f16..000000000 --- a/pilot/server/static/_next/static/chunks/214.42f1e2cf34f5caac.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[214],{41189:function(e,t,l){l.r(t),l.d(t,{default:function(){return ef}});var r=l(85893),a=l(67294),n=l(2093),s=l(1375),o=l(2453),i=l(58989),c=l(83454),d=e=>{let{queryAgentURL:t="/api/v1/chat/completions"}=e,l=(0,a.useMemo)(()=>new AbortController,[]),r=(0,a.useCallback)(async e=>{let{context:r,data:a,chatId:n,onMessage:d,onClose:u,onDone:x,onError:m}=e;if(!r){o.ZP.warning(i.Z.t("NoContextTip"));return}let h={...a,conv_uid:n,user_input:r};if(!h.conv_uid){o.ZP.error("conv_uid 不存在,请刷新后重试");return}try{var p;await (0,s.L)("".concat(null!==(p=c.env.API_BASE_URL)&&void 0!==p?p:"").concat(t),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(h),signal:l.signal,openWhenHidden:!0,async onopen(e){if(e.ok&&e.headers.get("content-type")===s.a)return},onclose(){l.abort(),null==u||u()},onerror(e){throw Error(e)},onmessage:e=>{var t;let l=null===(t=e.data)||void 0===t?void 0:t.replaceAll("\\n","\n");"[DONE]"===l?null==x||x():(null==l?void 0:l.startsWith("[ERROR]"))?null==m||m(null==l?void 0:l.replace("[ERROR]","")):null==d||d(l)}})}catch(e){l.abort(),null==m||m("Sorry, We meet some error, please try agin later.",e)}},[t]);return(0,a.useEffect)(()=>()=>{l.abort()},[]),r},u=l(39332),x=l(99513),m=l(24019),h=l(50888),p=l(97937),g=l(63606),v=l(50228),f=l(87547),b=l(89035),j=l(33035),y=l(12767),w=l(94184),Z=l.n(w),_=l(66309),N=l(48567),k=l(41468),C=l(57132),S=l(29158),P=l(98165),R=l(79166),E=l(93179),O=l(71577),D=l(38426),M=l(20640),I=l.n(M);let L={code(e){var t;let{inline:l,node:a,className:n,children:s,style:i,...c}=e,d=/language-(\w+)/.exec(n||"");return!l&&d?(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)(O.ZP,{className:"absolute right-3 top-2 text-gray-300 hover:!text-gray-200 bg-gray-700",type:"text",icon:(0,r.jsx)(C.Z,{}),onClick:()=>{let e=I()(s);o.ZP[e?"success":"error"](e?"Copy success":"Copy failed")}}),(0,r.jsx)(E.Z,{language:null!==(t=null==d?void 0:d[1])&&void 0!==t?t:"javascript",style:R.Z,children:s})]}):(0,r.jsx)("code",{...c,style:i,className:"px-[6px] py-[2px] rounded bg-gray-700 text-gray-100 dark:bg-gray-100 dark:text-gray-800 text-sm",children:s})},ul(e){let{children:t}=e;return(0,r.jsx)("ul",{className:"py-1",children:t})},ol(e){let{children:t}=e;return(0,r.jsx)("ol",{className:"py-1",children:t})},li(e){let{children:t,ordered:l}=e;return(0,r.jsx)("li",{className:"text-sm leading-7 ml-5 pl-2 text-gray-600 dark:text-gray-300 ".concat(l?"list-decimal":"list-disc"),children:t})},table(e){let{children:t}=e;return(0,r.jsx)("table",{className:"my-2 rounded-tl-md rounded-tr-md max-w-full bg-white dark:bg-gray-900 text-sm rounded-lg overflow-hidden",children:t})},thead(e){let{children:t}=e;return(0,r.jsx)("thead",{className:"bg-[#fafafa] dark:bg-black font-semibold",children:t})},th(e){let{children:t}=e;return(0,r.jsx)("th",{className:"!text-left p-4",children:t})},td(e){let{children:t}=e;return(0,r.jsx)("td",{className:"p-4 border-t border-[#f0f0f0] dark:border-gray-700",children:t})},h1(e){let{children:t}=e;return(0,r.jsx)("h3",{className:"text-2xl font-bold my-4 border-b border-slate-300 pb-4",children:t})},h2(e){let{children:t}=e;return(0,r.jsx)("h3",{className:"text-xl font-bold my-3",children:t})},h3(e){let{children:t}=e;return(0,r.jsx)("h3",{className:"text-lg font-semibold my-2",children:t})},h4(e){let{children:t}=e;return(0,r.jsx)("h3",{className:"text-base font-semibold my-1",children:t})},a(e){let{children:t,href:l}=e;return(0,r.jsxs)("div",{className:"inline-block text-blue-600 dark:text-blue-400",children:[(0,r.jsx)(S.Z,{className:"mr-1"}),(0,r.jsx)("a",{href:l,target:"_blank",children:t})]})},img(e){let{src:t,alt:l}=e;return(0,r.jsx)("div",{children:(0,r.jsx)(D.Z,{className:"min-h-[1rem] max-w-full max-h-full border rounded",src:t,alt:l,placeholder:(0,r.jsx)(_.Z,{icon:(0,r.jsx)(P.Z,{spin:!0}),color:"processing",children:"Image Loading..."}),fallback:"/images/fallback.png"})})},blockquote(e){let{children:t}=e;return(0,r.jsx)("blockquote",{className:"py-4 px-6 border-l-4 border-blue-600 rounded bg-white my-2 text-gray-500 dark:bg-slate-800 dark:text-gray-200 dark:border-white shadow-sm",children:t})}},A={todo:{bgClass:"bg-gray-500",icon:(0,r.jsx)(m.Z,{className:"ml-2"})},runing:{bgClass:"bg-blue-500",icon:(0,r.jsx)(h.Z,{className:"ml-2"})},failed:{bgClass:"bg-red-500",icon:(0,r.jsx)(p.Z,{className:"ml-2"})},completed:{bgClass:"bg-green-500",icon:(0,r.jsx)(g.Z,{className:"ml-2"})}};function T(e){return e.replaceAll("\\n","\n").replace(/]+)>/gi,"").replace(/]+)>/gi,"")}var F=(0,a.memo)(function(e){let{children:t,content:l,isChartChat:n,onLinkClick:s}=e,{scene:o}=(0,a.useContext)(k.p),{context:i,model_name:c,role:d}=l,u="view"===d,{relations:x,value:m,cachePlguinContext:h}=(0,a.useMemo)(()=>{if("string"!=typeof i)return{relations:[],value:"",cachePlguinContext:[]};let[e,t]=i.split(" relations:"),l=t?t.split(","):[],r=[],a=0,n=e.replace(/]*>[^<]*<\/dbgpt-view>/gi,e=>{try{var t;console.log(e);let l=e.replaceAll("\n","\\n").replace(/<[^>]*>|<\/[^>]*>/gm,""),n=JSON.parse(l),s="".concat(a,"");return r.push({...n,result:T(null!==(t=n.result)&&void 0!==t?t:"")}),a++,s}catch(t){return console.log(t.message,t),e}});return{relations:l,cachePlguinContext:r,value:n}},[i]),p=(0,a.useMemo)(()=>({"custom-view"(e){var t;let{children:l}=e,a=+l.toString();if(!h[a])return l;let{name:n,status:s,err_msg:o,result:i}=h[a],{bgClass:c,icon:d}=null!==(t=A[s])&&void 0!==t?t:{};return(0,r.jsxs)("div",{className:"bg-white dark:bg-[#212121] rounded-lg overflow-hidden my-2 flex flex-col lg:max-w-[80%]",children:[(0,r.jsxs)("div",{className:Z()("flex px-4 md:px-6 py-2 items-center text-white text-sm",c),children:[n,d]}),i?(0,r.jsx)("div",{className:"px-4 md:px-6 py-4 text-sm",children:(0,r.jsx)(j.D,{components:L,rehypePlugins:[y.Z],children:null!=i?i:""})}):(0,r.jsx)("div",{className:"px-4 md:px-6 py-4 text-sm",children:o})]})}}),[i,h]);return(0,r.jsxs)("div",{className:Z()("relative flex flex-wrap w-full px-2 sm:px-4 py-2 sm:py-6 rounded-xl break-words",{"bg-slate-100 dark:bg-[#353539]":u,"lg:w-full xl:w-full pl-0":["chat_with_db_execute","chat_dashboard"].includes(o)}),children:[(0,r.jsx)("div",{className:"mr-2 flex flex-shrink-0 items-center justify-center h-7 w-7 rounded-full text-lg sm:mr-4",children:u?(0,N.A)(c)||(0,r.jsx)(v.Z,{}):(0,r.jsx)(f.Z,{})}),(0,r.jsxs)("div",{className:"flex-1 overflow-hidden items-center text-md leading-8",children:[!u&&"string"==typeof i&&i,u&&n&&"object"==typeof i&&(0,r.jsxs)("div",{children:["[".concat(i.template_name,"]: "),(0,r.jsxs)("span",{className:"text-[#1677ff] cursor-pointer",onClick:s,children:[(0,r.jsx)(b.Z,{className:"mr-1"}),i.template_introduce||"More Details"]})]}),u&&"string"==typeof i&&(0,r.jsx)(j.D,{components:{...L,...p},rehypePlugins:[y.Z],children:T(m)}),!!(null==x?void 0:x.length)&&(0,r.jsx)("div",{className:"flex flex-wrap mt-2",children:null==x?void 0:x.map((e,t)=>(0,r.jsx)(_.Z,{color:"#108ee9",children:e},e+t))})]}),t]})}),H=l(59301),J=l(41132),V=l(74312),$=l(3414),q=l(72868),z=l(59562),W=l(14553),G=l(25359),B=l(7203),U=l(48665),K=l(26047),Q=l(99056),X=l(57814),Y=l(63955),ee=l(33028),et=l(40911),el=l(66478),er=l(83062),ea=l(50489),en=l(67421),es=e=>{var t;let{conv_index:l,question:n,knowledge_space:s}=e,{t:i}=(0,en.$G)(),{chatId:c}=(0,a.useContext)(k.p),[d,u]=(0,a.useState)(""),[x,m]=(0,a.useState)(4),[h,p]=(0,a.useState)(""),g=(0,a.useRef)(null),[v,f]=o.ZP.useMessage(),[b,j]=(0,a.useState)({});(0,a.useEffect)(()=>{(0,ea.Vx)((0,ea.Lu)()).then(e=>{var t;console.log(e),j(null!==(t=e[1])&&void 0!==t?t:{})}).catch(e=>{console.log(e)})},[]);let y=(0,a.useCallback)((e,t)=>{t?(0,ea.Vx)((0,ea.Eb)(c,l)).then(e=>{var t,l,r,a;let n=null!==(t=e[1])&&void 0!==t?t:{};u(null!==(l=n.ques_type)&&void 0!==l?l:""),m(parseInt(null!==(r=n.score)&&void 0!==r?r:"4")),p(null!==(a=n.messages)&&void 0!==a?a:"")}).catch(e=>{console.log(e)}):(u(""),m(4),p(""))},[c,l]),w=(0,V.Z)($.Z)(e=>{let{theme:t}=e;return{backgroundColor:"dark"===t.palette.mode?"#FBFCFD":"#0E0E10",...t.typography["body-sm"],padding:t.spacing(1),display:"flex",alignItems:"center",justifyContent:"center",borderRadius:4,width:"100%",height:"100%"}});return(0,r.jsxs)(q.L,{onOpenChange:y,children:[f,(0,r.jsx)(er.Z,{title:i("Rating"),children:(0,r.jsx)(z.Z,{slots:{root:W.ZP},slotProps:{root:{variant:"plain",color:"primary"}},sx:{borderRadius:40},children:(0,r.jsx)(H.Z,{})})}),(0,r.jsxs)(G.Z,{children:[(0,r.jsx)(B.Z,{disabled:!0,sx:{minHeight:0}}),(0,r.jsx)(U.Z,{sx:{width:"100%",maxWidth:350,display:"grid",gap:3,padding:1},children:(0,r.jsx)("form",{onSubmit:e=>{e.preventDefault();let t={conv_uid:c,conv_index:l,question:n,knowledge_space:s,score:x,ques_type:d,messages:h};console.log(t),(0,ea.Vx)((0,ea.VC)({data:t})).then(e=>{v.open({type:"success",content:"save success"})}).catch(e=>{v.open({type:"error",content:"save error"})})},children:(0,r.jsxs)(K.Z,{container:!0,spacing:.5,columns:13,sx:{flexGrow:1},children:[(0,r.jsx)(K.Z,{xs:3,children:(0,r.jsx)(w,{children:i("Q_A_Category")})}),(0,r.jsx)(K.Z,{xs:10,children:(0,r.jsx)(Q.Z,{action:g,value:d,placeholder:"Choose one…",onChange:(e,t)=>u(null!=t?t:""),...d&&{endDecorator:(0,r.jsx)(W.ZP,{size:"sm",variant:"plain",color:"neutral",onMouseDown:e=>{e.stopPropagation()},onClick:()=>{var e;u(""),null===(e=g.current)||void 0===e||e.focusVisible()},children:(0,r.jsx)(J.Z,{})}),indicator:null},sx:{width:"100%"},children:null===(t=Object.keys(b))||void 0===t?void 0:t.map(e=>(0,r.jsx)(X.Z,{value:e,children:b[e]},e))})}),(0,r.jsx)(K.Z,{xs:3,children:(0,r.jsx)(w,{children:(0,r.jsx)(er.Z,{title:(0,r.jsx)(U.Z,{children:(0,r.jsx)("div",{children:i("feed_back_desc")})}),variant:"solid",placement:"left",children:i("Q_A_Rating")})})}),(0,r.jsx)(K.Z,{xs:10,sx:{pl:0,ml:0},children:(0,r.jsx)(Y.Z,{"aria-label":"Custom",step:1,min:0,max:5,valueLabelFormat:function(e){return({0:i("Lowest"),1:i("Missed"),2:i("Lost"),3:i("Incorrect"),4:i("Verbose"),5:i("Best")})[e]},valueLabelDisplay:"on",marks:[{value:0,label:"0"},{value:1,label:"1"},{value:2,label:"2"},{value:3,label:"3"},{value:4,label:"4"},{value:5,label:"5"}],sx:{width:"90%",pt:3,m:2,ml:1},onChange:e=>{var t;return m(null===(t=e.target)||void 0===t?void 0:t.value)},value:x})}),(0,r.jsx)(K.Z,{xs:13,children:(0,r.jsx)(ee.Z,{placeholder:i("Please_input_the_text"),value:h,onChange:e=>p(e.target.value),minRows:2,maxRows:4,endDecorator:(0,r.jsx)(et.ZP,{level:"body-xs",sx:{ml:"auto"},children:i("input_count")+h.length+i("input_unit")}),sx:{width:"100%",fontSize:14}})}),(0,r.jsx)(K.Z,{xs:13,children:(0,r.jsx)(el.Z,{type:"submit",variant:"outlined",sx:{width:"100%",height:"100%"},children:i("submit")})})]})})})]})]})},eo=l(32983),ei=l(12069),ec=l(96486),ed=l.n(ec),eu=l(38954),ex=l(8937);function em(){var e;let t=null!==(e=localStorage.getItem(ex.rU))&&void 0!==e?e:"";try{let e=JSON.parse(t);return e}catch(e){return null}}var eh=e=>{var t;let{messages:l,onSubmit:s}=e,{dbParam:i,currentDialogue:c,scene:d,model:m,refreshDialogList:h,chatId:p,agentList:g}=(0,a.useContext)(k.p),{t:v}=(0,en.$G)(),f=(0,u.useSearchParams)(),b=null!==(t=f&&f.get("spaceNameOriginal"))&&void 0!==t?t:"",[j,y]=(0,a.useState)(!1),[w,_]=(0,a.useState)(!1),[S,P]=(0,a.useState)(l),[R,E]=(0,a.useState)(""),O=(0,a.useRef)(null),D=(0,a.useMemo)(()=>"chat_dashboard"===d,[d]),M=(0,a.useMemo)(()=>{switch(d){case"chat_agent":return g.join(",");case"chat_excel":return null==c?void 0:c.select_param;default:return b||i}},[d,g,c,i,b]),L=async e=>{if(!j&&e.trim())try{y(!0),await s(e,{select_param:null!=M?M:""})}finally{y(!1)}},A=e=>{try{return JSON.parse(e)}catch(t){return e}},[T,H]=o.ZP.useMessage(),J=async e=>{let t=null==e?void 0:e.replace(/\trelations:.*/g,""),l=I()(t);l?t?T.open({type:"success",content:v("Copy_success")}):T.open({type:"warning",content:v("Copy_nothing")}):T.open({type:"error",content:v("Copry_error")})};return(0,n.Z)(async()=>{let e=em();e&&e.id===p&&(await L(e.message),h(),localStorage.removeItem(ex.rU))},[p]),(0,a.useEffect)(()=>{let e=l;D&&(e=ed().cloneDeep(l).map(e=>((null==e?void 0:e.role)==="view"&&"string"==typeof(null==e?void 0:e.context)&&(e.context=A(null==e?void 0:e.context)),e))),P(e.filter(e=>["view","human"].includes(e.role)))},[D,l]),(0,a.useEffect)(()=>{setTimeout(()=>{var e;null===(e=O.current)||void 0===e||e.scrollTo(0,O.current.scrollHeight)},50)},[l]),(0,r.jsxs)(r.Fragment,{children:[H,(0,r.jsx)("div",{ref:O,className:"flex flex-1 overflow-y-auto pb-8 w-full flex-col",children:(0,r.jsx)("div",{className:"flex items-center flex-1 flex-col text-sm leading-6 text-slate-900 dark:text-slate-300 sm:text-base sm:leading-7",children:S.length?S.map((e,t)=>{var l;return(0,r.jsx)(F,{content:e,isChartChat:D,onLinkClick:()=>{_(!0),E(JSON.stringify(null==e?void 0:e.context,null,2))},children:"view"===e.role&&(0,r.jsxs)("div",{className:"flex w-full flex-row-reverse pt-2 md:pt-4 border-t border-gray-200 mt-2 md:mt-4",children:[(0,r.jsx)(es,{conv_index:Math.ceil((t+1)/2),question:null===(l=null==S?void 0:S.filter(t=>(null==t?void 0:t.role)==="human"&&(null==t?void 0:t.order)===e.order)[0])||void 0===l?void 0:l.context,knowledge_space:b||i||""}),(0,r.jsx)(er.Z,{title:v("Copy"),children:(0,r.jsx)(el.Z,{onClick:()=>J(null==e?void 0:e.context),slots:{root:W.ZP},slotProps:{root:{variant:"plain",color:"primary"}},sx:{borderRadius:40},children:(0,r.jsx)(C.Z,{})})})]})},t)}):(0,r.jsx)(eo.Z,{image:"/empty.png",imageStyle:{width:320,height:320,margin:"0 auto",maxWidth:"100%",maxHeight:"100%"},className:"flex items-center justify-center flex-col h-full w-full",description:"Start a conversation"})})}),(0,r.jsx)("div",{className:Z()("relative after:absolute after:-top-8 after:h-8 after:w-full after:bg-gradient-to-t after:from-white after:to-transparent dark:after:from-[#212121]",{"cursor-not-allowed":"chat_excel"===d&&!(null==c?void 0:c.select_param)}),children:(0,r.jsxs)("div",{className:"flex flex-wrap w-full py-2 sm:pt-6 sm:pb-10",children:[m&&(0,r.jsx)("div",{className:"mr-2 flex items-center h-10",children:(0,N.A)(m)}),(0,r.jsx)(eu.Z,{loading:j,onSubmit:L})]})}),(0,r.jsx)(ei.default,{title:"JSON Editor",open:w,width:"60%",cancelButtonProps:{hidden:!0},onOk:()=>{_(!1)},onCancel:()=>{_(!1)},children:(0,r.jsx)(x.Z,{className:"w-full h-[500px]",language:"json",value:R})})]})},ep=l(9837),eg=l(39156),ev=l(45247),ef=()=>{var e;let t=(0,u.useSearchParams)(),{scene:l,chatId:s,model:o,setModel:i}=(0,a.useContext)(k.p),c=d({}),x=null!==(e=t&&t.get("initMessage"))&&void 0!==e?e:"",[m,h]=(0,a.useState)(!1),[p,g]=(0,a.useState)(),[v,f]=(0,a.useState)([]),b=async()=>{h(!0);let[,e]=await (0,ea.Vx)((0,ea.$i)(s));f(null!=e?e:[]),h(!1)},j=e=>{var t;let l=null===(t=e[e.length-1])||void 0===t?void 0:t.context;if(l)try{let e=JSON.parse(l);g((null==e?void 0:e.template_name)==="report"?null==e?void 0:e.charts:void 0)}catch(e){g(void 0)}};(0,n.Z)(async()=>{let e=em();e&&e.id===s||await b()},[x,s]),(0,a.useEffect)(()=>{var e,t;if(!v.length)return;let l=null===(e=null===(t=v.filter(e=>"view"===e.role))||void 0===t?void 0:t.slice(-1))||void 0===e?void 0:e[0];(null==l?void 0:l.model_name)&&i(l.model_name),j(v)},[v.length]);let y=(0,a.useCallback)((e,t)=>new Promise(r=>{let a=[...v,{role:"human",context:e,model_name:o,order:0,time_stamp:0},{role:"view",context:"",model_name:o,order:0,time_stamp:0}],n=a.length-1;f([...a]),c({context:e,data:{...t,chat_mode:l||"chat_normal",model_name:o},chatId:s,onMessage:e=>{a[n].context=e,f([...a])},onDone:()=>{j(a),r()},onClose:()=>{j(a),r()},onError:e=>{a[n].context=e,f([...a]),r()}})}),[v,c]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(ev.Z,{visible:m}),(0,r.jsx)(ep.Z,{refreshHistory:b,modelChange:e=>{i(e)}}),(0,r.jsxs)("div",{className:"px-4 flex flex-1 flex-wrap overflow-hidden relative",children:[!!(null==p?void 0:p.length)&&(0,r.jsx)("div",{className:"w-full xl:w-3/4 h-3/5 xl:pr-4 xl:h-full overflow-y-auto",children:(0,r.jsx)(eg.Z,{chartsData:p})}),!(null==p?void 0:p.length)&&"chat_dashboard"===l&&(0,r.jsx)(eo.Z,{image:"/empty.png",imageStyle:{width:320,height:320,margin:"0 auto",maxWidth:"100%",maxHeight:"100%"},className:"w-full xl:w-3/4 h-3/5 xl:h-full pt-0 md:pt-10"}),(0,r.jsx)("div",{className:Z()("flex flex-1 flex-col overflow-hidden",{"px-0 xl:pl-4 h-2/5 xl:h-full border-t xl:border-t-0 xl:border-l":"chat_dashboard"===l,"h-full lg:px-8":"chat_dashboard"!==l}),children:(0,r.jsx)(eh,{messages:v,onSubmit:y})})]})]})}},38954:function(e,t,l){l.d(t,{Z:function(){return j}});var r=l(85893),a=l(27496),n=l(59566),s=l(71577),o=l(67294),i=l(2487),c=l(83062),d=l(2453),u=l(74627),x=l(39479),m=l(51009),h=l(58299),p=l(577),g=l(30119),v=l(67421);let f=e=>{let{data:t,loading:l,submit:a,close:n}=e,{t:s}=(0,v.$G)(),o=e=>()=>{a(e),n()};return(0,r.jsx)("div",{style:{maxHeight:400,overflow:"auto"},children:(0,r.jsx)(i.Z,{dataSource:null==t?void 0:t.data,loading:l,rowKey:e=>e.prompt_name,renderItem:e=>(0,r.jsx)(i.Z.Item,{onClick:o(e.content),children:(0,r.jsx)(c.Z,{title:e.content,children:(0,r.jsx)(i.Z.Item.Meta,{style:{cursor:"copy"},title:e.prompt_name,description:s("Prompt_Info_Scene")+":".concat(e.chat_scene,",")+s("Prompt_Info_Sub_Scene")+":".concat(e.sub_chat_scene)})})},e.prompt_name)})})};var b=e=>{let{submit:t}=e,{t:l}=(0,v.$G)(),[a,n]=(0,o.useState)(!1),[s,i]=(0,o.useState)("common"),{data:b,loading:j}=(0,p.Z)(()=>(0,g.PR)("/prompt/list",{prompt_type:s}),{refreshDeps:[s],onError:e=>{d.ZP.error(null==e?void 0:e.message)}});return(0,r.jsx)(u.Z,{title:(0,r.jsx)(x.Z.Item,{label:"Prompt "+l("Type"),children:(0,r.jsx)(m.default,{style:{width:130},value:s,onChange:e=>{i(e)},options:[{label:l("Public")+" Prompts",value:"common"},{label:l("Private")+" Prompts",value:"private"}]})}),content:(0,r.jsx)(f,{data:b,loading:j,submit:t,close:()=>{n(!1)}}),placement:"topRight",trigger:"click",open:a,onOpenChange:e=>{n(e)},children:(0,r.jsx)(c.Z,{title:l("Click_Select")+" Prompt",children:(0,r.jsx)(h.Z,{className:"bottom-32"})})})},j=function(e){let{children:t,loading:l,onSubmit:i,...c}=e,[d,u]=(0,o.useState)("");return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.default.TextArea,{className:"flex-1",size:"large",value:d,autoSize:{minRows:1,maxRows:4},...c,onPressEnter:e=>{if(d.trim()&&13===e.keyCode){if(e.shiftKey){u(e=>e+"\n");return}i(d),setTimeout(()=>{u("")},0)}},onChange:e=>{if("number"==typeof c.maxLength){u(e.target.value.substring(0,c.maxLength));return}u(e.target.value)}}),(0,r.jsx)(s.ZP,{className:"ml-2 flex items-center justify-center",size:"large",type:"text",loading:l,icon:(0,r.jsx)(a.Z,{}),onClick:()=>{i(d)}}),(0,r.jsx)(b,{submit:e=>{u(d+e)}}),t]})}},45247:function(e,t,l){var r=l(85893),a=l(50888);t.Z=function(e){let{visible:t}=e;return t?(0,r.jsx)("div",{className:"absolute w-full h-full top-0 left-0 flex justify-center items-center z-10 bg-white dark:bg-black bg-opacity-50 dark:bg-opacity-50 backdrop-blur-sm text-3xl animate-fade animate-duration-200",children:(0,r.jsx)(a.Z,{})}):null}}}]); \ No newline at end of file diff --git a/pilot/server/static/_next/static/chunks/304.b9722ef34a01988f.js b/pilot/server/static/_next/static/chunks/304.b9722ef34a01988f.js new file mode 100644 index 000000000..5d857c2f2 --- /dev/null +++ b/pilot/server/static/_next/static/chunks/304.b9722ef34a01988f.js @@ -0,0 +1 @@ +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[304],{39156:function(e,t,l){"use strict";l.d(t,{Z:function(){return m}});var a=l(85893),n=l(41118),r=l(30208),s=l(40911),c=l(75227),i=l(67294);function o(e){let{chart:t}=e,l=(0,i.useRef)(null),o=(0,i.useRef)({chart:null});return(0,i.useEffect)(()=>{l.current&&(o.current.chart&&o.current.chart.destroy(),o.current.chart=new c.sg(l.current,{data:t.values,xField:"name",yField:"value",seriesField:"type",legend:{position:"bottom"},animation:{appear:{animation:"wave-in",duration:3e3}}}),o.current.chart.render())},[t.values]),(0,a.jsx)("div",{className:"flex-1 min-w-0",children:(0,a.jsx)(n.Z,{className:"h-full",sx:{background:"transparent"},children:(0,a.jsxs)(r.Z,{className:"h-full",children:[(0,a.jsx)(s.ZP,{gutterBottom:!0,component:"div",children:t.chart_name}),(0,a.jsx)(s.ZP,{gutterBottom:!0,level:"body3",children:t.chart_desc}),(0,a.jsx)("div",{className:"h-[300px]",ref:l})]})})})}function u(e){let{chart:t}=e,l=(0,i.useRef)(null),o=(0,i.useRef)({chart:null});return(0,i.useEffect)(()=>{l.current&&(o.current.chart&&o.current.chart.destroy(),o.current.chart=new c.x1(l.current,{data:t.values,xField:"name",yField:"value",seriesField:"type",smooth:!0,area:{style:{fillOpacity:.15}},legend:{position:"bottom"},animation:{appear:{animation:"wave-in",duration:3e3}}}),o.current.chart.render())},[t.values]),(0,a.jsx)("div",{className:"flex-1 min-w-0",children:(0,a.jsx)(n.Z,{className:"h-full",sx:{background:"transparent"},children:(0,a.jsxs)(r.Z,{className:"h-full",children:[(0,a.jsx)(s.ZP,{gutterBottom:!0,component:"div",children:t.chart_name}),(0,a.jsx)(s.ZP,{gutterBottom:!0,level:"body3",children:t.chart_desc}),(0,a.jsx)("div",{className:"h-[300px]",ref:l})]})})})}var d=l(61685),h=l(96486);function x(e){var t,l;let{chart:c}=e,i=(0,h.groupBy)(c.values,"type");return(0,a.jsx)("div",{className:"flex-1 min-w-0",children:(0,a.jsx)(n.Z,{className:"h-full overflow-auto",sx:{background:"transparent"},children:(0,a.jsxs)(r.Z,{className:"h-full",children:[(0,a.jsx)(s.ZP,{gutterBottom:!0,component:"div",children:c.chart_name}),(0,a.jsx)(s.ZP,{gutterBottom:!0,level:"body3",children:c.chart_desc}),(0,a.jsx)("div",{className:"flex-1",children:(0,a.jsxs)(d.Z,{"aria-label":"basic table",stripe:"odd",hoverRow:!0,borderAxis:"bothBetween",children:[(0,a.jsx)("thead",{children:(0,a.jsx)("tr",{children:Object.keys(i).map(e=>(0,a.jsx)("th",{children:e},e))})}),(0,a.jsx)("tbody",{children:null===(t=Object.values(i))||void 0===t?void 0:null===(l=t[0])||void 0===l?void 0:l.map((e,t)=>{var l;return(0,a.jsx)("tr",{children:null===(l=Object.keys(i))||void 0===l?void 0:l.map(e=>{var l;return(0,a.jsx)("td",{children:(null==i?void 0:null===(l=i[e])||void 0===l?void 0:l[t].value)||""},e)})},t)})})]})})]})})})}var m=function(e){let{chartsData:t}=e,l=(0,i.useMemo)(()=>{if(t){let e=[],l=null==t?void 0:t.filter(e=>"IndicatorValue"===e.chart_type);l.length>0&&e.push({charts:l,type:"IndicatorValue"});let a=null==t?void 0:t.filter(e=>"IndicatorValue"!==e.chart_type),n=a.length,r=0;return[[0],[1],[2],[1,2],[1,3],[2,1,2],[2,1,3],[3,1,3],[3,2,3]][n].forEach(t=>{if(t>0){let l=a.slice(r,r+t);r+=t,e.push({charts:l})}}),e}},[t]);return(0,a.jsx)("div",{className:"flex flex-col gap-3",children:null==l?void 0:l.map((e,t)=>(0,a.jsx)("div",{className:"".concat((null==e?void 0:e.type)!=="IndicatorValue"?"flex gap-3":""),children:e.charts.map(e=>"IndicatorValue"===e.chart_type?(0,a.jsx)("div",{className:"flex flex-row gap-3",children:e.values.map(e=>(0,a.jsx)("div",{className:"flex-1",children:(0,a.jsx)(n.Z,{sx:{background:"transparent"},children:(0,a.jsxs)(r.Z,{className:"justify-around",children:[(0,a.jsx)(s.ZP,{gutterBottom:!0,component:"div",children:e.name}),(0,a.jsx)(s.ZP,{children:e.value})]})})},e.name))},e.chart_uid):"LineChart"===e.chart_type?(0,a.jsx)(u,{chart:e},e.chart_uid):"BarChart"===e.chart_type?(0,a.jsx)(o,{chart:e},e.chart_uid):"Table"===e.chart_type?(0,a.jsx)(x,{chart:e},e.chart_uid):void 0)},"chart_row_".concat(t)))})}},70803:function(e,t,l){"use strict";l.d(t,{Z:function(){return B}});var a=l(85893),n=l(67294),r=l(2453),s=l(83062),c=l(31365),i=l(71577),o=l(49591),u=l(88484),d=l(29158),h=l(50489),x=l(41468),m=function(e){var t;let{convUid:l,chatMode:m,onComplete:p,...f}=e,[v,j]=(0,n.useState)(!1),[g,y]=r.ZP.useMessage(),[b,w]=(0,n.useState)([]),[Z,N]=(0,n.useState)(),{model:_}=(0,n.useContext)(x.p),P=async e=>{var t;if(!e){r.ZP.error("Please select the *.(csv|xlsx|xls) file");return}if(!/\.(csv|xlsx|xls)$/.test(null!==(t=e.file.name)&&void 0!==t?t:"")){r.ZP.error("File type must be csv, xlsx or xls");return}w([e.file])},C=async()=>{j(!0);try{let e=new FormData;e.append("doc_file",b[0]),g.open({content:"Uploading ".concat(b[0].name),type:"loading",duration:0});let[t]=await (0,h.Vx)((0,h.qn)({convUid:l,chatMode:m,data:e,model:_,config:{timeout:36e5,onUploadProgress:e=>{let t=Math.ceil(e.loaded/(e.total||0)*100);N(t)}}}));if(t)return;r.ZP.success("success"),null==p||p()}catch(e){r.ZP.error((null==e?void 0:e.message)||"Upload Error")}finally{j(!1),g.destroy()}};return(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)("div",{className:"flex items-start gap-2",children:[y,(0,a.jsx)(s.Z,{placement:"bottom",title:"File cannot be changed after upload",children:(0,a.jsx)(c.default,{disabled:v,className:"mr-1",beforeUpload:()=>!1,fileList:b,name:"file",accept:".csv,.xlsx,.xls",multiple:!1,onChange:P,showUploadList:{showDownloadIcon:!1,showPreviewIcon:!1,showRemoveIcon:!1},itemRender:()=>(0,a.jsx)(a.Fragment,{}),...f,children:(0,a.jsx)(i.ZP,{className:"flex justify-center items-center",type:"primary",disabled:v,icon:(0,a.jsx)(o.Z,{}),children:"Select File"})})}),(0,a.jsx)(i.ZP,{type:"primary",loading:v,className:"flex justify-center items-center",disabled:!b.length,icon:(0,a.jsx)(u.Z,{}),onClick:C,children:v?100===Z?"Analysis":"Uploading":"Upload"}),!!b.length&&(0,a.jsxs)("div",{className:"mt-2 text-gray-500 text-sm flex items-center",children:[(0,a.jsx)(d.Z,{className:"mr-2"}),(0,a.jsx)("span",{children:null===(t=b[0])||void 0===t?void 0:t.name})]})]})})},p=function(e){let{onComplete:t}=e,{currentDialogue:l,scene:r,chatId:s}=(0,n.useContext)(x.p);return"chat_excel"!==r?null:(0,a.jsx)("div",{className:"max-w-md h-full relative",children:l?(0,a.jsxs)("div",{className:"flex h-8 overflow-hidden rounded",children:[(0,a.jsx)("div",{className:"flex items-center justify-center px-2 bg-gray-600 text-lg",children:(0,a.jsx)(d.Z,{className:"text-white"})}),(0,a.jsx)("div",{className:"flex items-center justify-center px-3 bg-gray-100 text-xs rounded-tr rounded-br dark:text-gray-800 truncate",children:l.select_param})]}):(0,a.jsx)(m,{convUid:s,chatMode:r,onComplete:t})})};l(23293);var f=l(78045),v=l(16165),j=l(96991),g=function(){return(0,a.jsx)("svg",{width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 1024 1024",version:"1.1",children:(0,a.jsx)("path",{d:"M602.24 246.72a17.28 17.28 0 0 0-11.84-16.32l-42.88-14.4A90.56 90.56 0 0 1 490.24 160l-14.4-42.88a17.28 17.28 0 0 0-32 0L428.8 160a90.56 90.56 0 0 1-57.28 57.28l-42.88 14.4a17.28 17.28 0 0 0 0 32l42.88 14.4a90.56 90.56 0 0 1 57.28 57.28l14.4 42.88a17.28 17.28 0 0 0 32 0l14.4-42.88a90.56 90.56 0 0 1 57.28-57.28l42.88-14.4a17.28 17.28 0 0 0 12.48-16.96z m301.12 221.76l-48.32-16a101.44 101.44 0 0 1-64-64l-16-48.32a19.2 19.2 0 0 0-36.8 0l-16 48.32a101.44 101.44 0 0 1-64 64l-48.32 16a19.2 19.2 0 0 0 0 36.8l48.32 16a101.44 101.44 0 0 1 64 64l16 48.32a19.2 19.2 0 0 0 36.8 0l16-48.32a101.44 101.44 0 0 1 64-64l48.32-16a19.2 19.2 0 0 0 0-36.8z m-376.64 195.52l-64-20.8a131.84 131.84 0 0 1-83.52-83.52l-20.8-64a25.28 25.28 0 0 0-47.68 0l-20.8 64a131.84 131.84 0 0 1-82.24 83.52l-64 20.8a25.28 25.28 0 0 0 0 47.68l64 20.8a131.84 131.84 0 0 1 83.52 83.84l20.8 64a25.28 25.28 0 0 0 47.68 0l20.8-64a131.84 131.84 0 0 1 83.52-83.52l64-20.8a25.28 25.28 0 0 0 0-47.68z","p-id":"3992"})})};function y(){let{isContract:e,setIsContract:t,scene:l}=(0,n.useContext)(x.p),r=l&&["chat_with_db_execute","chat_dashboard"].includes(l);return r?(0,a.jsxs)(f.ZP.Group,{value:e,defaultValue:!0,buttonStyle:"solid",onChange:()=>{t(!e)},children:[(0,a.jsxs)(f.ZP.Button,{value:!1,children:[(0,a.jsx)(v.Z,{component:g,className:"mr-1"}),"Preview"]}),(0,a.jsxs)(f.ZP.Button,{value:!0,children:[(0,a.jsx)(j.Z,{className:"mr-1"}),"Editor"]})]}):null}var b=l(81799),w=function(){return(0,a.jsx)("svg",{width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"4870",children:(0,a.jsx)("path",{d:"M511.875 128.125c-211.875 0-383.75 76.25-383.75 170.625 0 94.375 171.875 170.625 383.75 170.625 211.875 0 383.75-76.25 383.75-170.625C896.25 204.375 724.375 128.125 511.875 128.125M128.125 383.75l0 128.125c0 94.375 171.875 170.625 383.75 170.625 211.875 0 383.75-76.25 383.75-170.625l0-128.125c0 94.375-171.875 170.625-383.75 170.625C300 555 128.125 478.125 128.125 383.75M128.125 597.5l0 128.125c0 94.375 171.875 170.625 383.75 170.625 211.875 0 383.75-76.25 383.75-170.625l0-128.125c0 94.375-171.875 170.625-383.75 170.625C300 768.125 128.125 691.875 128.125 597.5z","p-id":"4871"})})},Z=l(2093),N=l(51009),_=function(){let{scene:e,dbParam:t,setDbParam:l}=(0,n.useContext)(x.p),[r,s]=(0,n.useState)({});(0,Z.Z)(async()=>{let[,t]=await (0,h.Vx)((0,h.vD)(e));s(null!=t?t:{})},[e]);let c=(0,n.useMemo)(()=>Object.entries(r).map(e=>{let[t,l]=e;return{label:t,value:l}}),[r]);return((0,n.useEffect)(()=>{c.length&&!t&&l(c[0].value)},[c,l,t]),c.length)?(0,a.jsx)(N.default,{value:t,className:"w-36",onChange:e=>{l(e)},children:c.map(e=>(0,a.jsxs)(N.default.Option,{children:[(0,a.jsx)(v.Z,{component:w,className:"mr-1"}),e.label]},e.value))}):null},P=l(577),C=l(67421),k=function(){let{t:e}=(0,C.$G)(),{agentList:t,setAgentList:l}=(0,n.useContext)(x.p),{data:r=[]}=(0,P.Z)(async()=>{let[,e]=await (0,h.Vx)((0,h.N6)());return e&&e.length&&(null==l||l([e[0].name])),null!=e?e:[]});return r.length?(0,a.jsx)(N.default,{className:"w-60",value:t,mode:"multiple",maxTagCount:1,maxTagTextLength:12,placeholder:e("Select_Plugins"),options:r.map(e=>({label:e.name,value:e.name})),allowClear:!0,onChange:e=>{null==l||l(e)}}):null},B=function(e){let{refreshHistory:t,modelChange:l}=e,{scene:r,refreshDialogList:s}=(0,n.useContext)(x.p);return(0,a.jsxs)("div",{className:"w-full py-2 px-4 md:px-4 flex flex-wrap items-center justify-center border-b border-gray-100 gap-1 md:gap-4",children:[(0,a.jsx)(b.Z,{onChange:l}),(0,a.jsx)(_,{}),"chat_excel"===r&&(0,a.jsx)(p,{onComplete:()=>{null==s||s(),null==t||t()}}),"chat_agent"===r&&(0,a.jsx)(k,{}),(0,a.jsx)(y,{})]})}},81799:function(e,t,l){"use strict";l.d(t,{A:function(){return d}});var a=l(85893),n=l(41468),r=l(51009),s=l(19284),c=l(25675),i=l.n(c),o=l(67294),u=l(67421);function d(e,t){var l;let{width:n,height:r}=t||{};return e?(0,a.jsx)(i(),{className:"rounded-full border border-gray-200 object-contain bg-white inline-block",width:n||24,height:r||24,src:(null===(l=s.F[e])||void 0===l?void 0:l.icon)||"/models/huggingface.svg",alt:"llm"}):null}t.Z=function(e){let{onChange:t}=e,{t:l}=(0,u.$G)(),{modelList:c,model:i}=(0,o.useContext)(n.p);return!c||c.length<=0?null:(0,a.jsx)(r.default,{value:i,placeholder:l("choose_model"),className:"w-52",onChange:e=>{null==t||t(e)},children:c.map(e=>{var t;return(0,a.jsx)(r.default.Option,{children:(0,a.jsxs)("div",{className:"flex items-center",children:[d(e),(0,a.jsx)("span",{className:"ml-2",children:(null===(t=s.F[e])||void 0===t?void 0:t.label)||e})]})},e)})})}},99513:function(e,t,l){"use strict";l.d(t,{Z:function(){return u}});var a=l(85893),n=l(77119),r=l(63764),s=l(94184),c=l.n(s),i=l(67294),o=l(36782);function u(e){let{className:t,value:l,language:n="mysql",onChange:s,thoughts:u}=e,d=(0,i.useMemo)(()=>"mysql"!==n?l:u&&u.length>0?(0,o.WU)("-- ".concat(u," \n").concat(l)):(0,o.WU)(l),[l,u]);return(0,a.jsx)(r.ZP,{className:c()(t),value:d,language:n,onChange:s,theme:"vs-dark",options:{minimap:{enabled:!1},wordWrap:"on"}})}r._m.config({monaco:n})},30119:function(e,t,l){"use strict";l.d(t,{Tk:function(){return i},PR:function(){return o}});var a=l(2453),n=l(6154),r=l(83454);let s=n.Z.create({baseURL:r.env.API_BASE_URL});s.defaults.timeout=1e4,s.interceptors.response.use(e=>e.data,e=>Promise.reject(e)),l(96486);let c={"content-type":"application/json"},i=(e,t)=>{if(t){let l=Object.keys(t).filter(e=>void 0!==t[e]&&""!==t[e]).map(e=>"".concat(e,"=").concat(t[e])).join("&");l&&(e+="?".concat(l))}return s.get("/api"+e,{headers:c}).then(e=>e).catch(e=>{a.ZP.error(e),Promise.reject(e)})},o=(e,t)=>s.post(e,t,{headers:c}).then(e=>e).catch(e=>{a.ZP.error(e),Promise.reject(e)})},23293:function(){}}]); \ No newline at end of file diff --git a/pilot/server/static/_next/static/chunks/369.867be2bc991d02f3.js b/pilot/server/static/_next/static/chunks/369.867be2bc991d02f3.js deleted file mode 100644 index 27f77df47..000000000 --- a/pilot/server/static/_next/static/chunks/369.867be2bc991d02f3.js +++ /dev/null @@ -1 +0,0 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[369],{39156:function(e,l,a){"use strict";a.d(l,{Z:function(){return p}});var n=a(85893),t=a(41118),c=a(30208),r=a(40911),s=a(75227),i=a(67294);function o(e){let{chart:l}=e,a=(0,i.useRef)(null),o=(0,i.useRef)({chart:null});return(0,i.useEffect)(()=>{a.current&&(o.current.chart&&o.current.chart.destroy(),o.current.chart=new s.sg(a.current,{data:l.values,xField:"name",yField:"value",seriesField:"type",legend:{position:"bottom"},animation:{appear:{animation:"wave-in",duration:3e3}}}),o.current.chart.render())},[l.values]),(0,n.jsx)("div",{className:"flex-1 min-w-0",children:(0,n.jsx)(t.Z,{className:"h-full",sx:{background:"transparent"},children:(0,n.jsxs)(c.Z,{className:"h-full",children:[(0,n.jsx)(r.ZP,{gutterBottom:!0,component:"div",children:l.chart_name}),(0,n.jsx)(r.ZP,{gutterBottom:!0,level:"body3",children:l.chart_desc}),(0,n.jsx)("div",{className:"h-[300px]",ref:a})]})})})}function d(e){let{chart:l}=e,a=(0,i.useRef)(null),o=(0,i.useRef)({chart:null});return(0,i.useEffect)(()=>{a.current&&(o.current.chart&&o.current.chart.destroy(),o.current.chart=new s.x1(a.current,{data:l.values,xField:"name",yField:"value",seriesField:"type",smooth:!0,area:{style:{fillOpacity:.15}},legend:{position:"bottom"},animation:{appear:{animation:"wave-in",duration:3e3}}}),o.current.chart.render())},[l.values]),(0,n.jsx)("div",{className:"flex-1 min-w-0",children:(0,n.jsx)(t.Z,{className:"h-full",sx:{background:"transparent"},children:(0,n.jsxs)(c.Z,{className:"h-full",children:[(0,n.jsx)(r.ZP,{gutterBottom:!0,component:"div",children:l.chart_name}),(0,n.jsx)(r.ZP,{gutterBottom:!0,level:"body3",children:l.chart_desc}),(0,n.jsx)("div",{className:"h-[300px]",ref:a})]})})})}var u=a(61685),m=a(96486);function h(e){var l,a;let{chart:s}=e,i=(0,m.groupBy)(s.values,"type");return(0,n.jsx)("div",{className:"flex-1 min-w-0",children:(0,n.jsx)(t.Z,{className:"h-full overflow-auto",sx:{background:"transparent"},children:(0,n.jsxs)(c.Z,{className:"h-full",children:[(0,n.jsx)(r.ZP,{gutterBottom:!0,component:"div",children:s.chart_name}),(0,n.jsx)(r.ZP,{gutterBottom:!0,level:"body3",children:s.chart_desc}),(0,n.jsx)("div",{className:"flex-1",children:(0,n.jsxs)(u.Z,{"aria-label":"basic table",stripe:"odd",hoverRow:!0,borderAxis:"bothBetween",children:[(0,n.jsx)("thead",{children:(0,n.jsx)("tr",{children:Object.keys(i).map(e=>(0,n.jsx)("th",{children:e},e))})}),(0,n.jsx)("tbody",{children:null===(l=Object.values(i))||void 0===l?void 0:null===(a=l[0])||void 0===a?void 0:a.map((e,l)=>{var a;return(0,n.jsx)("tr",{children:null===(a=Object.keys(i))||void 0===a?void 0:a.map(e=>{var a;return(0,n.jsx)("td",{children:(null==i?void 0:null===(a=i[e])||void 0===a?void 0:a[l].value)||""},e)})},l)})})]})})]})})})}var p=function(e){let{chartsData:l}=e,a=(0,i.useMemo)(()=>{if(l){let e=[],a=null==l?void 0:l.filter(e=>"IndicatorValue"===e.chart_type);a.length>0&&e.push({charts:a,type:"IndicatorValue"});let n=null==l?void 0:l.filter(e=>"IndicatorValue"!==e.chart_type),t=n.length,c=0;return[[0],[1],[2],[1,2],[1,3],[2,1,2],[2,1,3],[3,1,3],[3,2,3]][t].forEach(l=>{if(l>0){let a=n.slice(c,c+l);c+=l,e.push({charts:a})}}),e}},[l]);return(0,n.jsx)("div",{className:"flex flex-col gap-3",children:null==a?void 0:a.map((e,l)=>(0,n.jsx)("div",{className:"".concat((null==e?void 0:e.type)!=="IndicatorValue"?"flex gap-3":""),children:e.charts.map(e=>"IndicatorValue"===e.chart_type?(0,n.jsx)("div",{className:"flex flex-row gap-3",children:e.values.map(e=>(0,n.jsx)("div",{className:"flex-1",children:(0,n.jsx)(t.Z,{sx:{background:"transparent"},children:(0,n.jsxs)(c.Z,{className:"justify-around",children:[(0,n.jsx)(r.ZP,{gutterBottom:!0,component:"div",children:e.name}),(0,n.jsx)(r.ZP,{children:e.value})]})})},e.name))},e.chart_uid):"LineChart"===e.chart_type?(0,n.jsx)(d,{chart:e},e.chart_uid):"BarChart"===e.chart_type?(0,n.jsx)(o,{chart:e},e.chart_uid):"Table"===e.chart_type?(0,n.jsx)(h,{chart:e},e.chart_uid):void 0)},"chart_row_".concat(l)))})}},9837:function(e,l,a){"use strict";a.d(l,{Z:function(){return k}});var n=a(85893),t=a(67294),c=a(2453),r=a(83062),s=a(31365),i=a(71577),o=a(49591),d=a(88484),u=a(29158),m=a(50489),h=a(41468),p=function(e){var l;let{convUid:a,chatMode:p,onComplete:x,...g}=e,[b,v]=(0,t.useState)(!1),[f,j]=c.ZP.useMessage(),[y,w]=(0,t.useState)([]),[_,Z]=(0,t.useState)(),{model:N}=(0,t.useContext)(h.p),P=async e=>{var l;if(!e){c.ZP.error("Please select the *.(csv|xlsx|xls) file");return}if(!/\.(csv|xlsx|xls)$/.test(null!==(l=e.file.name)&&void 0!==l?l:"")){c.ZP.error("File type must be csv, xlsx or xls");return}w([e.file])},C=async()=>{v(!0);try{let e=new FormData;e.append("doc_file",y[0]),f.open({content:"Uploading ".concat(y[0].name),type:"loading",duration:0});let[l]=await (0,m.Vx)((0,m.qn)({convUid:a,chatMode:p,data:e,model:N,config:{timeout:36e5,onUploadProgress:e=>{let l=Math.ceil(e.loaded/(e.total||0)*100);Z(l)}}}));if(l)return;c.ZP.success("success"),null==x||x()}catch(e){c.ZP.error((null==e?void 0:e.message)||"Upload Error")}finally{v(!1),f.destroy()}};return(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)("div",{className:"flex items-start gap-2",children:[j,(0,n.jsx)(r.Z,{placement:"bottom",title:"File cannot be changed after upload",children:(0,n.jsx)(s.default,{disabled:b,className:"mr-1",beforeUpload:()=>!1,fileList:y,name:"file",accept:".csv,.xlsx,.xls",multiple:!1,onChange:P,showUploadList:{showDownloadIcon:!1,showPreviewIcon:!1,showRemoveIcon:!1},itemRender:()=>(0,n.jsx)(n.Fragment,{}),...g,children:(0,n.jsx)(i.ZP,{className:"flex justify-center items-center",type:"primary",disabled:b,icon:(0,n.jsx)(o.Z,{}),children:"Select File"})})}),(0,n.jsx)(i.ZP,{type:"primary",loading:b,className:"flex justify-center items-center",disabled:!y.length,icon:(0,n.jsx)(d.Z,{}),onClick:C,children:b?100===_?"Analysis":"Uploading":"Upload"}),!!y.length&&(0,n.jsxs)("div",{className:"mt-2 text-gray-500 text-sm flex items-center",children:[(0,n.jsx)(u.Z,{className:"mr-2"}),(0,n.jsx)("span",{children:null===(l=y[0])||void 0===l?void 0:l.name})]})]})})},x=function(e){let{onComplete:l}=e,{currentDialogue:a,scene:c,chatId:r}=(0,t.useContext)(h.p);return"chat_excel"!==c?null:(0,n.jsx)("div",{className:"max-w-md h-full relative",children:a?(0,n.jsxs)("div",{className:"flex h-8 overflow-hidden rounded",children:[(0,n.jsx)("div",{className:"flex items-center justify-center px-2 bg-gray-600 text-lg",children:(0,n.jsx)(u.Z,{className:"text-white"})}),(0,n.jsx)("div",{className:"flex items-center justify-center px-3 bg-gray-100 text-xs rounded-tr rounded-br dark:text-gray-800 truncate",children:a.select_param})]}):(0,n.jsx)(p,{convUid:r,chatMode:c,onComplete:l})})};a(23293);var g=a(78045),b=a(16165),v=a(96991),f=function(){return(0,n.jsx)("svg",{width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 1024 1024",version:"1.1",children:(0,n.jsx)("path",{d:"M602.24 246.72a17.28 17.28 0 0 0-11.84-16.32l-42.88-14.4A90.56 90.56 0 0 1 490.24 160l-14.4-42.88a17.28 17.28 0 0 0-32 0L428.8 160a90.56 90.56 0 0 1-57.28 57.28l-42.88 14.4a17.28 17.28 0 0 0 0 32l42.88 14.4a90.56 90.56 0 0 1 57.28 57.28l14.4 42.88a17.28 17.28 0 0 0 32 0l14.4-42.88a90.56 90.56 0 0 1 57.28-57.28l42.88-14.4a17.28 17.28 0 0 0 12.48-16.96z m301.12 221.76l-48.32-16a101.44 101.44 0 0 1-64-64l-16-48.32a19.2 19.2 0 0 0-36.8 0l-16 48.32a101.44 101.44 0 0 1-64 64l-48.32 16a19.2 19.2 0 0 0 0 36.8l48.32 16a101.44 101.44 0 0 1 64 64l16 48.32a19.2 19.2 0 0 0 36.8 0l16-48.32a101.44 101.44 0 0 1 64-64l48.32-16a19.2 19.2 0 0 0 0-36.8z m-376.64 195.52l-64-20.8a131.84 131.84 0 0 1-83.52-83.52l-20.8-64a25.28 25.28 0 0 0-47.68 0l-20.8 64a131.84 131.84 0 0 1-82.24 83.52l-64 20.8a25.28 25.28 0 0 0 0 47.68l64 20.8a131.84 131.84 0 0 1 83.52 83.84l20.8 64a25.28 25.28 0 0 0 47.68 0l20.8-64a131.84 131.84 0 0 1 83.52-83.52l64-20.8a25.28 25.28 0 0 0 0-47.68z","p-id":"3992"})})};function j(){let{isContract:e,setIsContract:l,scene:a}=(0,t.useContext)(h.p),c=a&&["chat_with_db_execute","chat_dashboard"].includes(a);return c?(0,n.jsxs)(g.ZP.Group,{value:e,defaultValue:!0,buttonStyle:"solid",onChange:()=>{l(!e)},children:[(0,n.jsxs)(g.ZP.Button,{value:!1,children:[(0,n.jsx)(b.Z,{component:f,className:"mr-1"}),"Preview"]}),(0,n.jsxs)(g.ZP.Button,{value:!0,children:[(0,n.jsx)(v.Z,{className:"mr-1"}),"Editor"]})]}):null}var y=a(48567),w=function(){return(0,n.jsx)("svg",{width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"4870",children:(0,n.jsx)("path",{d:"M511.875 128.125c-211.875 0-383.75 76.25-383.75 170.625 0 94.375 171.875 170.625 383.75 170.625 211.875 0 383.75-76.25 383.75-170.625C896.25 204.375 724.375 128.125 511.875 128.125M128.125 383.75l0 128.125c0 94.375 171.875 170.625 383.75 170.625 211.875 0 383.75-76.25 383.75-170.625l0-128.125c0 94.375-171.875 170.625-383.75 170.625C300 555 128.125 478.125 128.125 383.75M128.125 597.5l0 128.125c0 94.375 171.875 170.625 383.75 170.625 211.875 0 383.75-76.25 383.75-170.625l0-128.125c0 94.375-171.875 170.625-383.75 170.625C300 768.125 128.125 691.875 128.125 597.5z","p-id":"4871"})})},_=a(2093),Z=a(51009),N=function(){let{scene:e,dbParam:l,setDbParam:a}=(0,t.useContext)(h.p),[c,r]=(0,t.useState)({});(0,_.Z)(async()=>{let[,l]=await (0,m.Vx)((0,m.vD)(e));r(null!=l?l:{})},[e]);let s=(0,t.useMemo)(()=>Object.entries(c).map(e=>{let[l,a]=e;return{label:l,value:a}}),[c]);return((0,t.useEffect)(()=>{s.length&&!l&&a(s[0].value)},[s,a,l]),s.length)?(0,n.jsx)(Z.default,{value:l,className:"w-36",onChange:e=>{a(e)},children:s.map(e=>(0,n.jsxs)(Z.default.Option,{children:[(0,n.jsx)(b.Z,{component:w,className:"mr-1"}),e.label]},e.value))}):null},P=a(577),C=a(67421),B=function(){let{t:e}=(0,C.$G)(),{agentList:l,setAgentList:a}=(0,t.useContext)(h.p),{data:c=[]}=(0,P.Z)(async()=>{let[,e]=await (0,m.Vx)((0,m.N6)());return e&&e.length&&(null==a||a([e[0].name])),null!=e?e:[]});return c.length?(0,n.jsx)(Z.default,{className:"w-60",value:l,mode:"multiple",maxTagCount:1,maxTagTextLength:12,placeholder:e("Select_Plugins"),options:c.map(e=>({label:e.name,value:e.name})),allowClear:!0,onChange:e=>{null==a||a(e)}}):null},k=function(e){let{refreshHistory:l,modelChange:a}=e,{scene:c,refreshDialogList:r}=(0,t.useContext)(h.p);return(0,n.jsxs)("div",{className:"w-full py-2 px-4 md:px-4 flex flex-wrap items-center justify-center border-b border-gray-100 gap-1 md:gap-4",children:[(0,n.jsx)(y.Z,{onChange:a}),(0,n.jsx)(N,{}),"chat_excel"===c&&(0,n.jsx)(x,{onComplete:()=>{null==r||r(),null==l||l()}}),"chat_agent"===c&&(0,n.jsx)(B,{}),(0,n.jsx)(j,{})]})}},48567:function(e,l,a){"use strict";a.d(l,{Z:function(){return m},A:function(){return u}});var n=a(85893),t=a(41468),c=a(51009);let r={proxyllm:{label:"Proxy LLM",icon:"/models/chatgpt.png"},"flan-t5-base":{label:"flan-t5-base",icon:"/models/google.png"},"vicuna-13b":{label:"vicuna-13b",icon:"/models/vicuna.jpeg"},"vicuna-7b":{label:"vicuna-7b",icon:"/models/vicuna.jpeg"},"vicuna-13b-v1.5":{label:"vicuna-13b-v1.5",icon:"/models/vicuna.jpeg"},"vicuna-7b-v1.5":{label:"vicuna-7b-v1.5",icon:"/models/vicuna.jpeg"},"codegen2-1b":{label:"codegen2-1B",icon:"/models/vicuna.jpeg"},"codet5p-2b":{label:"codet5p-2b",icon:"/models/vicuna.jpeg"},"chatglm-6b-int4":{label:"chatglm-6b-int4",icon:"/models/chatglm.png"},"chatglm-6b":{label:"chatglm-6b",icon:"/models/chatglm.png"},"chatglm2-6b":{label:"chatglm2-6b",icon:"/models/chatglm.png"},"chatglm2-6b-int4":{label:"chatglm2-6b-int4",icon:"/models/chatglm.png"},"guanaco-33b-merged":{label:"guanaco-33b-merged",icon:"/models/huggingface.svg"},"falcon-40b":{label:"falcon-40b",icon:"/models/falcon.jpeg"},"gorilla-7b":{label:"gorilla-7b",icon:"/models/gorilla.png"},"gptj-6b":{label:"ggml-gpt4all-j-v1.3-groovy.bin",icon:""},chatgpt_proxyllm:{label:"chatgpt_proxyllm",icon:"/models/chatgpt.png"},bard_proxyllm:{label:"bard_proxyllm",icon:"/models/bard.gif"},claude_proxyllm:{label:"claude_proxyllm",icon:"/models/claude.png"},wenxin_proxyllm:{label:"wenxin_proxyllm",icon:""},tongyi_proxyllm:{label:"tongyi_proxyllm",icon:"/models/qwen2.png"},zhipu_proxyllm:{label:"zhipu_proxyllm",icon:"/models/zhipu.png"},"llama-2-7b":{label:"Llama-2-7b-chat-hf",icon:"/models/llama.jpg"},"llama-2-13b":{label:"Llama-2-13b-chat-hf",icon:"/models/llama.jpg"},"llama-2-70b":{label:"Llama-2-70b-chat-hf",icon:"/models/llama.jpg"},"baichuan-13b":{label:"Baichuan-13B-Chat",icon:"/models/baichuan.png"},"baichuan-7b":{label:"baichuan-7b",icon:"/models/baichuan.png"},"baichuan2-7b":{label:"Baichuan2-7B-Chat",icon:"/models/baichuan.png"},"baichuan2-13b":{label:"Baichuan2-13B-Chat",icon:"/models/baichuan.png"},"wizardlm-13b":{label:"WizardLM-13B-V1.2",icon:"/models/wizardlm.png"},"llama-cpp":{label:"ggml-model-q4_0.bin",icon:"/models/huggingface.svg"},"internlm-7b":{label:"internlm-chat-7b-v1_1",icon:"/models/internlm.png"},"internlm-7b-8k":{label:"internlm-chat-7b-8k",icon:"/models/internlm.png"}};var s=a(25675),i=a.n(s),o=a(67294),d=a(67421);function u(e,l){var a;let{width:t,height:c}=l||{};return e?(0,n.jsx)(i(),{className:"rounded-full border border-gray-200 object-contain bg-white inline-block",width:t||24,height:c||24,src:(null===(a=r[e])||void 0===a?void 0:a.icon)||"/models/huggingface.svg",alt:"llm"}):null}var m=function(e){let{onChange:l}=e,{t:a}=(0,d.$G)(),{modelList:s,model:i}=(0,o.useContext)(t.p);return!s||s.length<=0?null:(0,n.jsx)(c.default,{value:i,placeholder:a("choose_model"),className:"w-52",onChange:e=>{null==l||l(e)},children:s.map(e=>{var l;return(0,n.jsx)(c.default.Option,{children:(0,n.jsxs)("div",{className:"flex items-center",children:[u(e),(0,n.jsx)("span",{className:"ml-2",children:(null===(l=r[e])||void 0===l?void 0:l.label)||e})]})},e)})})}},99513:function(e,l,a){"use strict";a.d(l,{Z:function(){return d}});var n=a(85893),t=a(77119),c=a(63764),r=a(94184),s=a.n(r),i=a(67294),o=a(36782);function d(e){let{className:l,value:a,language:t="mysql",onChange:r,thoughts:d}=e,u=(0,i.useMemo)(()=>"mysql"!==t?a:d&&d.length>0?(0,o.WU)("-- ".concat(d," \n").concat(a)):(0,o.WU)(a),[a,d]);return(0,n.jsx)(c.ZP,{className:s()(l),value:u,language:t,onChange:r,theme:"vs-dark",options:{minimap:{enabled:!1},wordWrap:"on"}})}c._m.config({monaco:t})},30119:function(e,l,a){"use strict";a.d(l,{Tk:function(){return i},PR:function(){return o}});var n=a(2453),t=a(6154),c=a(83454);let r=t.Z.create({baseURL:c.env.API_BASE_URL});r.defaults.timeout=1e4,r.interceptors.response.use(e=>e.data,e=>Promise.reject(e)),a(96486);let s={"content-type":"application/json"},i=(e,l)=>{if(l){let a=Object.keys(l).filter(e=>void 0!==l[e]&&""!==l[e]).map(e=>"".concat(e,"=").concat(l[e])).join("&");a&&(e+="?".concat(a))}return r.get("/api"+e,{headers:s}).then(e=>e).catch(e=>{n.ZP.error(e),Promise.reject(e)})},o=(e,l)=>r.post(e,l,{headers:s}).then(e=>e).catch(e=>{n.ZP.error(e),Promise.reject(e)})},23293:function(){}}]); \ No newline at end of file diff --git a/pilot/server/static/_next/static/chunks/604.e31c3e76149a6ff7.js b/pilot/server/static/_next/static/chunks/604.e31c3e76149a6ff7.js new file mode 100644 index 000000000..551dde58b --- /dev/null +++ b/pilot/server/static/_next/static/chunks/604.e31c3e76149a6ff7.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[604],{24093:function(e,l,t){t.r(l),t.d(l,{default:function(){return ev}});var r=t(85893),a=t(67294),s=t(2093),n=t(1375),o=t(2453),i=t(58989),c=t(83454),d=e=>{let{queryAgentURL:l="/api/v1/chat/completions"}=e,t=(0,a.useMemo)(()=>new AbortController,[]),r=(0,a.useCallback)(async e=>{let{context:r,data:a,chatId:s,onMessage:d,onClose:u,onDone:x,onError:m}=e;if(!r){o.ZP.warning(i.Z.t("NoContextTip"));return}let h={...a,conv_uid:s,user_input:r};if(!h.conv_uid){o.ZP.error("conv_uid 不存在,请刷新后重试");return}try{var p;await (0,n.L)("".concat(null!==(p=c.env.API_BASE_URL)&&void 0!==p?p:"").concat(l),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(h),signal:t.signal,openWhenHidden:!0,async onopen(e){if(e.ok&&e.headers.get("content-type")===n.a)return},onclose(){t.abort(),null==u||u()},onerror(e){throw Error(e)},onmessage:e=>{var l;let t=null===(l=e.data)||void 0===l?void 0:l.replaceAll("\\n","\n");"[DONE]"===t?null==x||x():(null==t?void 0:t.startsWith("[ERROR]"))?null==m||m(null==t?void 0:t.replace("[ERROR]","")):null==d||d(t)}})}catch(e){t.abort(),null==m||m("Sorry, We meet some error, please try agin later.",e)}},[l]);return(0,a.useEffect)(()=>()=>{t.abort()},[]),r},u=t(39332),x=t(99513),m=t(24019),h=t(50888),p=t(97937),g=t(63606),v=t(50228),f=t(87547),b=t(89035),j=t(33035),y=t(12767),w=t(94184),Z=t.n(w),_=t(66309),N=t(81799),k=t(41468),C=t(57132),S=t(29158),P=t(98165),R=t(79166),E=t(93179),O=t(71577),D=t(38426),M=t(20640),I=t.n(M);let L={code(e){var l;let{inline:t,node:a,className:s,children:n,style:i,...c}=e,d=/language-(\w+)/.exec(s||"");return!t&&d?(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)(O.ZP,{className:"absolute right-3 top-2 text-gray-300 hover:!text-gray-200 bg-gray-700",type:"text",icon:(0,r.jsx)(C.Z,{}),onClick:()=>{let e=I()(n);o.ZP[e?"success":"error"](e?"Copy success":"Copy failed")}}),(0,r.jsx)(E.Z,{language:null!==(l=null==d?void 0:d[1])&&void 0!==l?l:"javascript",style:R.Z,children:n})]}):(0,r.jsx)("code",{...c,style:i,className:"px-[6px] py-[2px] rounded bg-gray-700 text-gray-100 dark:bg-gray-100 dark:text-gray-800 text-sm",children:n})},ul(e){let{children:l}=e;return(0,r.jsx)("ul",{className:"py-1",children:l})},ol(e){let{children:l}=e;return(0,r.jsx)("ol",{className:"py-1",children:l})},li(e){let{children:l,ordered:t}=e;return(0,r.jsx)("li",{className:"text-sm leading-7 ml-5 pl-2 text-gray-600 dark:text-gray-300 ".concat(t?"list-decimal":"list-disc"),children:l})},table(e){let{children:l}=e;return(0,r.jsx)("table",{className:"my-2 rounded-tl-md rounded-tr-md max-w-full bg-white dark:bg-gray-900 text-sm rounded-lg overflow-hidden",children:l})},thead(e){let{children:l}=e;return(0,r.jsx)("thead",{className:"bg-[#fafafa] dark:bg-black font-semibold",children:l})},th(e){let{children:l}=e;return(0,r.jsx)("th",{className:"!text-left p-4",children:l})},td(e){let{children:l}=e;return(0,r.jsx)("td",{className:"p-4 border-t border-[#f0f0f0] dark:border-gray-700",children:l})},h1(e){let{children:l}=e;return(0,r.jsx)("h3",{className:"text-2xl font-bold my-4 border-b border-slate-300 pb-4",children:l})},h2(e){let{children:l}=e;return(0,r.jsx)("h3",{className:"text-xl font-bold my-3",children:l})},h3(e){let{children:l}=e;return(0,r.jsx)("h3",{className:"text-lg font-semibold my-2",children:l})},h4(e){let{children:l}=e;return(0,r.jsx)("h3",{className:"text-base font-semibold my-1",children:l})},a(e){let{children:l,href:t}=e;return(0,r.jsxs)("div",{className:"inline-block text-blue-600 dark:text-blue-400",children:[(0,r.jsx)(S.Z,{className:"mr-1"}),(0,r.jsx)("a",{href:t,target:"_blank",children:l})]})},img(e){let{src:l,alt:t}=e;return(0,r.jsx)("div",{children:(0,r.jsx)(D.Z,{className:"min-h-[1rem] max-w-full max-h-full border rounded",src:l,alt:t,placeholder:(0,r.jsx)(_.Z,{icon:(0,r.jsx)(P.Z,{spin:!0}),color:"processing",children:"Image Loading..."}),fallback:"/images/fallback.png"})})},blockquote(e){let{children:l}=e;return(0,r.jsx)("blockquote",{className:"py-4 px-6 border-l-4 border-blue-600 rounded bg-white my-2 text-gray-500 dark:bg-slate-800 dark:text-gray-200 dark:border-white shadow-sm",children:l})}},A={todo:{bgClass:"bg-gray-500",icon:(0,r.jsx)(m.Z,{className:"ml-2"})},runing:{bgClass:"bg-blue-500",icon:(0,r.jsx)(h.Z,{className:"ml-2"})},failed:{bgClass:"bg-red-500",icon:(0,r.jsx)(p.Z,{className:"ml-2"})},completed:{bgClass:"bg-green-500",icon:(0,r.jsx)(g.Z,{className:"ml-2"})}};function T(e){return e.replaceAll("\\n","\n").replace(/]+)>/gi,"
").replace(/]+)>/gi,"")}var F=(0,a.memo)(function(e){let{children:l,content:t,isChartChat:s,onLinkClick:n}=e,{scene:o}=(0,a.useContext)(k.p),{context:i,model_name:c,role:d}=t,u="view"===d,{relations:x,value:m,cachePlguinContext:h}=(0,a.useMemo)(()=>{if("string"!=typeof i)return{relations:[],value:"",cachePlguinContext:[]};let[e,l]=i.split(" relations:"),t=l?l.split(","):[],r=[],a=0,s=e.replace(/]*>[^<]*<\/dbgpt-view>/gi,e=>{try{var l;console.log(e);let t=e.replaceAll("\n","\\n").replace(/<[^>]*>|<\/[^>]*>/gm,""),s=JSON.parse(t),n="".concat(a,"");return r.push({...s,result:T(null!==(l=s.result)&&void 0!==l?l:"")}),a++,n}catch(l){return console.log(l.message,l),e}});return{relations:t,cachePlguinContext:r,value:s}},[i]),p=(0,a.useMemo)(()=>({"custom-view"(e){var l;let{children:t}=e,a=+t.toString();if(!h[a])return t;let{name:s,status:n,err_msg:o,result:i}=h[a],{bgClass:c,icon:d}=null!==(l=A[n])&&void 0!==l?l:{};return(0,r.jsxs)("div",{className:"bg-white dark:bg-[#212121] rounded-lg overflow-hidden my-2 flex flex-col lg:max-w-[80%]",children:[(0,r.jsxs)("div",{className:Z()("flex px-4 md:px-6 py-2 items-center text-white text-sm",c),children:[s,d]}),i?(0,r.jsx)("div",{className:"px-4 md:px-6 py-4 text-sm",children:(0,r.jsx)(j.D,{components:L,rehypePlugins:[y.Z],children:null!=i?i:""})}):(0,r.jsx)("div",{className:"px-4 md:px-6 py-4 text-sm",children:o})]})}}),[i,h]);return(0,r.jsxs)("div",{className:Z()("relative flex flex-wrap w-full px-2 sm:px-4 py-2 sm:py-6 rounded-xl break-words",{"bg-slate-100 dark:bg-[#353539]":u,"lg:w-full xl:w-full pl-0":["chat_with_db_execute","chat_dashboard"].includes(o)}),children:[(0,r.jsx)("div",{className:"mr-2 flex flex-shrink-0 items-center justify-center h-7 w-7 rounded-full text-lg sm:mr-4",children:u?(0,N.A)(c)||(0,r.jsx)(v.Z,{}):(0,r.jsx)(f.Z,{})}),(0,r.jsxs)("div",{className:"flex-1 overflow-hidden items-center text-md leading-8",children:[!u&&"string"==typeof i&&i,u&&s&&"object"==typeof i&&(0,r.jsxs)("div",{children:["[".concat(i.template_name,"]: "),(0,r.jsxs)("span",{className:"text-[#1677ff] cursor-pointer",onClick:n,children:[(0,r.jsx)(b.Z,{className:"mr-1"}),i.template_introduce||"More Details"]})]}),u&&"string"==typeof i&&(0,r.jsx)(j.D,{components:{...L,...p},rehypePlugins:[y.Z],children:T(m)}),!!(null==x?void 0:x.length)&&(0,r.jsx)("div",{className:"flex flex-wrap mt-2",children:null==x?void 0:x.map((e,l)=>(0,r.jsx)(_.Z,{color:"#108ee9",children:e},e+l))})]}),l]})}),H=t(59301),V=t(41132),$=t(74312),q=t(3414),z=t(72868),J=t(59562),W=t(14553),G=t(25359),B=t(7203),K=t(48665),Q=t(26047),U=t(99056),X=t(57814),Y=t(63955),ee=t(33028),el=t(40911),et=t(66478),er=t(83062),ea=t(50489),es=t(67421),en=e=>{var l;let{conv_index:t,question:s,knowledge_space:n}=e,{t:i}=(0,es.$G)(),{chatId:c}=(0,a.useContext)(k.p),[d,u]=(0,a.useState)(""),[x,m]=(0,a.useState)(4),[h,p]=(0,a.useState)(""),g=(0,a.useRef)(null),[v,f]=o.ZP.useMessage(),[b,j]=(0,a.useState)({});(0,a.useEffect)(()=>{(0,ea.Vx)((0,ea.Lu)()).then(e=>{var l;console.log(e),j(null!==(l=e[1])&&void 0!==l?l:{})}).catch(e=>{console.log(e)})},[]);let y=(0,a.useCallback)((e,l)=>{l?(0,ea.Vx)((0,ea.Eb)(c,t)).then(e=>{var l,t,r,a;let s=null!==(l=e[1])&&void 0!==l?l:{};u(null!==(t=s.ques_type)&&void 0!==t?t:""),m(parseInt(null!==(r=s.score)&&void 0!==r?r:"4")),p(null!==(a=s.messages)&&void 0!==a?a:"")}).catch(e=>{console.log(e)}):(u(""),m(4),p(""))},[c,t]),w=(0,$.Z)(q.Z)(e=>{let{theme:l}=e;return{backgroundColor:"dark"===l.palette.mode?"#FBFCFD":"#0E0E10",...l.typography["body-sm"],padding:l.spacing(1),display:"flex",alignItems:"center",justifyContent:"center",borderRadius:4,width:"100%",height:"100%"}});return(0,r.jsxs)(z.L,{onOpenChange:y,children:[f,(0,r.jsx)(er.Z,{title:i("Rating"),children:(0,r.jsx)(J.Z,{slots:{root:W.ZP},slotProps:{root:{variant:"plain",color:"primary"}},sx:{borderRadius:40},children:(0,r.jsx)(H.Z,{})})}),(0,r.jsxs)(G.Z,{children:[(0,r.jsx)(B.Z,{disabled:!0,sx:{minHeight:0}}),(0,r.jsx)(K.Z,{sx:{width:"100%",maxWidth:350,display:"grid",gap:3,padding:1},children:(0,r.jsx)("form",{onSubmit:e=>{e.preventDefault();let l={conv_uid:c,conv_index:t,question:s,knowledge_space:n,score:x,ques_type:d,messages:h};console.log(l),(0,ea.Vx)((0,ea.VC)({data:l})).then(e=>{v.open({type:"success",content:"save success"})}).catch(e=>{v.open({type:"error",content:"save error"})})},children:(0,r.jsxs)(Q.Z,{container:!0,spacing:.5,columns:13,sx:{flexGrow:1},children:[(0,r.jsx)(Q.Z,{xs:3,children:(0,r.jsx)(w,{children:i("Q_A_Category")})}),(0,r.jsx)(Q.Z,{xs:10,children:(0,r.jsx)(U.Z,{action:g,value:d,placeholder:"Choose one…",onChange:(e,l)=>u(null!=l?l:""),...d&&{endDecorator:(0,r.jsx)(W.ZP,{size:"sm",variant:"plain",color:"neutral",onMouseDown:e=>{e.stopPropagation()},onClick:()=>{var e;u(""),null===(e=g.current)||void 0===e||e.focusVisible()},children:(0,r.jsx)(V.Z,{})}),indicator:null},sx:{width:"100%"},children:null===(l=Object.keys(b))||void 0===l?void 0:l.map(e=>(0,r.jsx)(X.Z,{value:e,children:b[e]},e))})}),(0,r.jsx)(Q.Z,{xs:3,children:(0,r.jsx)(w,{children:(0,r.jsx)(er.Z,{title:(0,r.jsx)(K.Z,{children:(0,r.jsx)("div",{children:i("feed_back_desc")})}),variant:"solid",placement:"left",children:i("Q_A_Rating")})})}),(0,r.jsx)(Q.Z,{xs:10,sx:{pl:0,ml:0},children:(0,r.jsx)(Y.Z,{"aria-label":"Custom",step:1,min:0,max:5,valueLabelFormat:function(e){return({0:i("Lowest"),1:i("Missed"),2:i("Lost"),3:i("Incorrect"),4:i("Verbose"),5:i("Best")})[e]},valueLabelDisplay:"on",marks:[{value:0,label:"0"},{value:1,label:"1"},{value:2,label:"2"},{value:3,label:"3"},{value:4,label:"4"},{value:5,label:"5"}],sx:{width:"90%",pt:3,m:2,ml:1},onChange:e=>{var l;return m(null===(l=e.target)||void 0===l?void 0:l.value)},value:x})}),(0,r.jsx)(Q.Z,{xs:13,children:(0,r.jsx)(ee.Z,{placeholder:i("Please_input_the_text"),value:h,onChange:e=>p(e.target.value),minRows:2,maxRows:4,endDecorator:(0,r.jsx)(el.ZP,{level:"body-xs",sx:{ml:"auto"},children:i("input_count")+h.length+i("input_unit")}),sx:{width:"100%",fontSize:14}})}),(0,r.jsx)(Q.Z,{xs:13,children:(0,r.jsx)(et.Z,{type:"submit",variant:"outlined",sx:{width:"100%",height:"100%"},children:i("submit")})})]})})})]})]})},eo=t(32983),ei=t(12069),ec=t(96486),ed=t.n(ec),eu=t(38954),ex=t(98399),em=e=>{var l;let{messages:t,onSubmit:n}=e,{dbParam:i,currentDialogue:c,scene:d,model:m,refreshDialogList:h,chatId:p,agentList:g}=(0,a.useContext)(k.p),{t:v}=(0,es.$G)(),f=(0,u.useSearchParams)(),b=null!==(l=f&&f.get("spaceNameOriginal"))&&void 0!==l?l:"",[j,y]=(0,a.useState)(!1),[w,_]=(0,a.useState)(!1),[S,P]=(0,a.useState)(t),[R,E]=(0,a.useState)(""),O=(0,a.useRef)(null),D=(0,a.useMemo)(()=>"chat_dashboard"===d,[d]),M=(0,a.useMemo)(()=>{switch(d){case"chat_agent":return g.join(",");case"chat_excel":return null==c?void 0:c.select_param;default:return b||i}},[d,g,c,i,b]),L=async e=>{if(!j&&e.trim())try{y(!0),await n(e,{select_param:null!=M?M:""})}finally{y(!1)}},A=e=>{try{return JSON.parse(e)}catch(l){return e}},[T,H]=o.ZP.useMessage(),V=async e=>{let l=null==e?void 0:e.replace(/\trelations:.*/g,""),t=I()(l);t?l?T.open({type:"success",content:v("Copy_success")}):T.open({type:"warning",content:v("Copy_nothing")}):T.open({type:"error",content:v("Copry_error")})};return(0,s.Z)(async()=>{let e=(0,ex.a_)();e&&e.id===p&&(await L(e.message),h(),localStorage.removeItem(ex.rU))},[p]),(0,a.useEffect)(()=>{let e=t;D&&(e=ed().cloneDeep(t).map(e=>((null==e?void 0:e.role)==="view"&&"string"==typeof(null==e?void 0:e.context)&&(e.context=A(null==e?void 0:e.context)),e))),P(e.filter(e=>["view","human"].includes(e.role)))},[D,t]),(0,a.useEffect)(()=>{setTimeout(()=>{var e;null===(e=O.current)||void 0===e||e.scrollTo(0,O.current.scrollHeight)},50)},[t]),(0,r.jsxs)(r.Fragment,{children:[H,(0,r.jsx)("div",{ref:O,className:"flex flex-1 overflow-y-auto pb-8 w-full flex-col",children:(0,r.jsx)("div",{className:"flex items-center flex-1 flex-col text-sm leading-6 text-slate-900 dark:text-slate-300 sm:text-base sm:leading-7",children:S.length?S.map((e,l)=>{var t;return(0,r.jsx)(F,{content:e,isChartChat:D,onLinkClick:()=>{_(!0),E(JSON.stringify(null==e?void 0:e.context,null,2))},children:"view"===e.role&&(0,r.jsxs)("div",{className:"flex w-full flex-row-reverse pt-2 md:pt-4 border-t border-gray-200 mt-2 md:mt-4",children:[(0,r.jsx)(en,{conv_index:Math.ceil((l+1)/2),question:null===(t=null==S?void 0:S.filter(l=>(null==l?void 0:l.role)==="human"&&(null==l?void 0:l.order)===e.order)[0])||void 0===t?void 0:t.context,knowledge_space:b||i||""}),(0,r.jsx)(er.Z,{title:v("Copy"),children:(0,r.jsx)(et.Z,{onClick:()=>V(null==e?void 0:e.context),slots:{root:W.ZP},slotProps:{root:{variant:"plain",color:"primary"}},sx:{borderRadius:40},children:(0,r.jsx)(C.Z,{})})})]})},l)}):(0,r.jsx)(eo.Z,{image:"/empty.png",imageStyle:{width:320,height:320,margin:"0 auto",maxWidth:"100%",maxHeight:"100%"},className:"flex items-center justify-center flex-col h-full w-full",description:"Start a conversation"})})}),(0,r.jsx)("div",{className:Z()("relative after:absolute after:-top-8 after:h-8 after:w-full after:bg-gradient-to-t after:from-white after:to-transparent dark:after:from-[#212121]",{"cursor-not-allowed":"chat_excel"===d&&!(null==c?void 0:c.select_param)}),children:(0,r.jsxs)("div",{className:"flex flex-wrap w-full py-2 sm:pt-6 sm:pb-10",children:[m&&(0,r.jsx)("div",{className:"mr-2 flex items-center h-10",children:(0,N.A)(m)}),(0,r.jsx)(eu.Z,{loading:j,onSubmit:L})]})}),(0,r.jsx)(ei.default,{title:"JSON Editor",open:w,width:"60%",cancelButtonProps:{hidden:!0},onOk:()=>{_(!1)},onCancel:()=>{_(!1)},children:(0,r.jsx)(x.Z,{className:"w-full h-[500px]",language:"json",value:R})})]})},eh=t(70803),ep=t(39156),eg=t(45247),ev=()=>{var e;let l=(0,u.useSearchParams)(),{scene:t,chatId:n,model:o,setModel:i}=(0,a.useContext)(k.p),c=d({}),x=null!==(e=l&&l.get("initMessage"))&&void 0!==e?e:"",[m,h]=(0,a.useState)(!1),[p,g]=(0,a.useState)(),[v,f]=(0,a.useState)([]),b=async()=>{h(!0);let[,e]=await (0,ea.Vx)((0,ea.$i)(n));f(null!=e?e:[]),h(!1)},j=e=>{var l;let t=null===(l=e[e.length-1])||void 0===l?void 0:l.context;if(t)try{let e=JSON.parse(t);g((null==e?void 0:e.template_name)==="report"?null==e?void 0:e.charts:void 0)}catch(e){g(void 0)}};(0,s.Z)(async()=>{let e=(0,ex.a_)();e&&e.id===n||await b()},[x,n]),(0,a.useEffect)(()=>{var e,l;if(!v.length)return;let t=null===(e=null===(l=v.filter(e=>"view"===e.role))||void 0===l?void 0:l.slice(-1))||void 0===e?void 0:e[0];(null==t?void 0:t.model_name)&&i(t.model_name),j(v)},[v.length]);let y=(0,a.useCallback)((e,l)=>new Promise(r=>{let a=[...v,{role:"human",context:e,model_name:o,order:0,time_stamp:0},{role:"view",context:"",model_name:o,order:0,time_stamp:0}],s=a.length-1;f([...a]),c({context:e,data:{...l,chat_mode:t||"chat_normal",model_name:o},chatId:n,onMessage:e=>{a[s].context=e,f([...a])},onDone:()=>{j(a),r()},onClose:()=>{j(a),r()},onError:e=>{a[s].context=e,f([...a]),r()}})}),[v,c]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(eg.Z,{visible:m}),(0,r.jsx)(eh.Z,{refreshHistory:b,modelChange:e=>{i(e)}}),(0,r.jsxs)("div",{className:"px-4 flex flex-1 flex-wrap overflow-hidden relative",children:[!!(null==p?void 0:p.length)&&(0,r.jsx)("div",{className:"w-full xl:w-3/4 h-3/5 xl:pr-4 xl:h-full overflow-y-auto",children:(0,r.jsx)(ep.Z,{chartsData:p})}),!(null==p?void 0:p.length)&&"chat_dashboard"===t&&(0,r.jsx)(eo.Z,{image:"/empty.png",imageStyle:{width:320,height:320,margin:"0 auto",maxWidth:"100%",maxHeight:"100%"},className:"w-full xl:w-3/4 h-3/5 xl:h-full pt-0 md:pt-10"}),(0,r.jsx)("div",{className:Z()("flex flex-1 flex-col overflow-hidden",{"px-0 xl:pl-4 h-2/5 xl:h-full border-t xl:border-t-0 xl:border-l":"chat_dashboard"===t,"h-full lg:px-8":"chat_dashboard"!==t}),children:(0,r.jsx)(em,{messages:v,onSubmit:y})})]})]})}},38954:function(e,l,t){t.d(l,{Z:function(){return j}});var r=t(85893),a=t(27496),s=t(59566),n=t(71577),o=t(67294),i=t(2487),c=t(83062),d=t(2453),u=t(74627),x=t(39479),m=t(51009),h=t(58299),p=t(577),g=t(30119),v=t(67421);let f=e=>{let{data:l,loading:t,submit:a,close:s}=e,{t:n}=(0,v.$G)(),o=e=>()=>{a(e),s()};return(0,r.jsx)("div",{style:{maxHeight:400,overflow:"auto"},children:(0,r.jsx)(i.Z,{dataSource:null==l?void 0:l.data,loading:t,rowKey:e=>e.prompt_name,renderItem:e=>(0,r.jsx)(i.Z.Item,{onClick:o(e.content),children:(0,r.jsx)(c.Z,{title:e.content,children:(0,r.jsx)(i.Z.Item.Meta,{style:{cursor:"copy"},title:e.prompt_name,description:n("Prompt_Info_Scene")+":".concat(e.chat_scene,",")+n("Prompt_Info_Sub_Scene")+":".concat(e.sub_chat_scene)})})},e.prompt_name)})})};var b=e=>{let{submit:l}=e,{t}=(0,v.$G)(),[a,s]=(0,o.useState)(!1),[n,i]=(0,o.useState)("common"),{data:b,loading:j}=(0,p.Z)(()=>(0,g.PR)("/prompt/list",{prompt_type:n}),{refreshDeps:[n],onError:e=>{d.ZP.error(null==e?void 0:e.message)}});return(0,r.jsx)(u.Z,{title:(0,r.jsx)(x.Z.Item,{label:"Prompt "+t("Type"),children:(0,r.jsx)(m.default,{style:{width:130},value:n,onChange:e=>{i(e)},options:[{label:t("Public")+" Prompts",value:"common"},{label:t("Private")+" Prompts",value:"private"}]})}),content:(0,r.jsx)(f,{data:b,loading:j,submit:l,close:()=>{s(!1)}}),placement:"topRight",trigger:"click",open:a,onOpenChange:e=>{s(e)},children:(0,r.jsx)(c.Z,{title:t("Click_Select")+" Prompt",children:(0,r.jsx)(h.Z,{className:"bottom-32"})})})},j=function(e){let{children:l,loading:t,onSubmit:i,...c}=e,[d,u]=(0,o.useState)("");return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(s.default.TextArea,{className:"flex-1",size:"large",value:d,autoSize:{minRows:1,maxRows:4},...c,onPressEnter:e=>{if(d.trim()&&13===e.keyCode){if(e.shiftKey){u(e=>e+"\n");return}i(d),setTimeout(()=>{u("")},0)}},onChange:e=>{if("number"==typeof c.maxLength){u(e.target.value.substring(0,c.maxLength));return}u(e.target.value)}}),(0,r.jsx)(n.ZP,{className:"ml-2 flex items-center justify-center",size:"large",type:"text",loading:t,icon:(0,r.jsx)(a.Z,{}),onClick:()=>{i(d)}}),(0,r.jsx)(b,{submit:e=>{u(d+e)}}),l]})}},45247:function(e,l,t){var r=t(85893),a=t(50888);l.Z=function(e){let{visible:l}=e;return l?(0,r.jsx)("div",{className:"absolute w-full h-full top-0 left-0 flex justify-center items-center z-10 bg-white dark:bg-black bg-opacity-50 dark:bg-opacity-50 backdrop-blur-sm text-3xl animate-fade animate-duration-200",children:(0,r.jsx)(a.Z,{})}):null}}}]); \ No newline at end of file diff --git a/pilot/server/static/_next/static/chunks/747-6c8367d757926558.js b/pilot/server/static/_next/static/chunks/747-6c8367d757926558.js new file mode 100644 index 000000000..537fd50b9 --- /dev/null +++ b/pilot/server/static/_next/static/chunks/747-6c8367d757926558.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[747],{78543:function(e,t,l){l.d(t,{Z:function(){return w}});var s=l(85893),a=l(67294),n=l(12069),i=l(3363),r=l(67421),c=l(50489),o=l(75081),d=l(39479),m=l(59566),u=l(71577);function h(e){let{t}=(0,r.$G)(),{handleAddKnowledge:l}=e,[n,i]=(0,a.useState)(!1),h=async e=>{let{knowledgeName:t,owner:s,description:a}=e;i(!0);let[n,r,o]=await (0,c.Vx)((0,c.U6)({name:t,vector_type:"Chroma",owner:s,desc:a}));i(!1),(null==o?void 0:o.success)&&l(t)};return(0,s.jsx)(o.Z,{spinning:n,children:(0,s.jsxs)(d.Z,{size:"large",className:"mt-4",layout:"vertical",name:"basic",initialValues:{remember:!0},autoComplete:"off",onFinish:h,children:[(0,s.jsx)(d.Z.Item,{label:t("Knowledge_Space_Name"),name:"knowledgeName",rules:[{required:!0,message:t("Please_input_the_name")},()=>({validator:(e,l)=>/[^\u4e00-\u9fa50-9a-zA-Z_-]/.test(l)?Promise.reject(Error(t("the_name_can_only_contain"))):Promise.resolve()})],children:(0,s.jsx)(m.default,{className:"mb-5 h-12",placeholder:t("Please_input_the_name")})}),(0,s.jsx)(d.Z.Item,{label:t("Owner"),name:"owner",rules:[{required:!0,message:t("Please_input_the_owner")}],children:(0,s.jsx)(m.default,{className:"mb-5 h-12",placeholder:t("Please_input_the_owner")})}),(0,s.jsx)(d.Z.Item,{label:t("Description"),name:"description",rules:[{required:!0,message:t("Please_input_the_description")}],children:(0,s.jsx)(m.default,{className:"mb-5 h-12",placeholder:t("Please_input_the_description")})}),(0,s.jsx)(d.Z.Item,{children:(0,s.jsx)(u.ZP,{type:"primary",htmlType:"submit",children:t("Next")})})]})})}var x=l(31365),p=l(2453),_=l(85813),j=l(72269),f=l(92039),g=l(64082);let b={ChooseType:1,AddDataSourceForm:2},{Dragger:Z}=x.default,{TextArea:y}=m.default;function N(e){let{handleChooseType:t,documentType:l,step:n,handleBackBtn:i,knowledgeName:h,syncDocuments:N,fetchDocuments:w,setIsAddShow:k}=e,{t:T}=(0,r.$G)(),[S]=d.Z.useForm(),[P,v]=(0,a.useState)(!1),C=async e=>{var t;let s;let{synchChecked:a,documentName:n,textSource:i,originFileObj:r,text:o,webPageUrl:d}=e;switch(v(!0),l){case"webPage":s=await (0,c.Vx)((0,c.H_)(h,{doc_name:n,content:d,doc_type:"URL"}));break;case"file":let m=new FormData;m.append("doc_name",n||r.file.name),m.append("doc_file",r.file),m.append("doc_type","DOCUMENT"),m.append("space_name",h),s=await (0,c.Vx)((0,c.iG)(h,m));break;default:s=await (0,c.Vx)((0,c.H_)(h,{doc_name:n,source:i,content:o,doc_type:"TEXT"}))}a&&(null==N||N(h,null==s?void 0:s[1])),v(!1),(null===(t=s[2])||void 0===t?void 0:t.success)&&(null==k||k(!1),null==w||w())},F=()=>{let e=S.getFieldsValue().originFileObj;return!!e&&(p.ZP.warning(T("Limit_Upload_File_Count_Tips")),x.default.LIST_IGNORE)},D=e=>{let{file:t,fileList:l}=e;S.getFieldsValue().documentName||S.setFieldValue("documentName",t.name),0===l.length&&S.setFieldValue("originFileObj",null)},I=[{type:"text",title:T("Text"),subTitle:T("Fill your raw text"),iconType:"TEXT"},{type:"webPage",title:T("URL"),subTitle:T("Fetch_the_content_of_a_URL"),iconType:"WEBPAGE"},{type:"file",title:T("Document"),subTitle:T("Upload_a_document"),iconType:"DOCUMENT"}],E=()=>(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(d.Z.Item,{label:"".concat(T("Text_Source"),":"),name:"textSource",rules:[{required:!0,message:T("Please_input_the_text_source")}],children:(0,s.jsx)(m.default,{className:"mb-5 h-12",placeholder:T("Please_input_the_text_source")})}),(0,s.jsx)(d.Z.Item,{label:"".concat(T("Text"),":"),name:"text",rules:[{required:!0,message:T("Please_input_the_description")}],children:(0,s.jsx)(y,{rows:4,maxLength:6})})]}),A=()=>(0,s.jsx)(s.Fragment,{children:(0,s.jsx)(d.Z.Item,{label:"".concat(T("Web_Page_URL"),":"),name:"webPageUrl",rules:[{required:!0,message:T("Please_input_the_owner")}],children:(0,s.jsx)(m.default,{className:"mb-5 h-12",placeholder:T("Please_input_the_Web_Page_URL")})})}),V=()=>(0,s.jsx)(s.Fragment,{children:(0,s.jsx)(d.Z.Item,{name:"originFileObj",rules:[{required:!0,message:T("Please_input_the_owner")}],children:(0,s.jsxs)(Z,{onChange:D,beforeUpload:F,multiple:!1,accept:".pdf,.ppt,.pptx,.xls,.xlsx,.doc,.docx,.txt,.md",children:[(0,s.jsx)("p",{className:"ant-upload-drag-icon",children:(0,s.jsx)(g.Z,{})}),(0,s.jsx)("p",{style:{color:"rgb(22, 108, 255)",fontSize:"20px"},children:T("Select_or_Drop_file")}),(0,s.jsx)("p",{className:"ant-upload-hint",style:{color:"rgb(22, 108, 255)"},children:"PDF, PowerPoint, Excel, Word, Text, Markdown,"})]})})});return n===b.ChooseType?(0,s.jsx)(s.Fragment,{children:I.map((e,l)=>(0,s.jsxs)(_.Z,{className:"mt-4 mb-4 cursor-pointer",onClick:()=>{t(e)},children:[(0,s.jsxs)("div",{className:"font-semibold",children:[(0,f._)(e.iconType)," ",e.title]}),(0,s.jsx)("div",{children:e.subTitle})]},l))}):(0,s.jsx)(o.Z,{spinning:P,children:(0,s.jsxs)(d.Z,{form:S,size:"large",className:"mt-4",layout:"vertical",name:"basic",initialValues:{remember:!0},autoComplete:"off",onFinish:C,children:[(0,s.jsx)(d.Z.Item,{label:"".concat(T("Name"),":"),name:"documentName",rules:[{required:!0,message:T("Please_input_the_name")}],children:(0,s.jsx)(m.default,{className:"mb-5 h-12",placeholder:T("Please_input_the_name")})}),(()=>{switch(l){case"webPage":return A();case"file":return V();default:return E()}})(),(0,s.jsx)(d.Z.Item,{label:"".concat(T("Synch"),":"),name:"synchChecked",initialValue:!0,children:(0,s.jsx)(j.Z,{className:"bg-slate-400",defaultChecked:!0})}),(0,s.jsxs)(d.Z.Item,{children:[(0,s.jsx)(u.ZP,{onClick:i,className:"mr-4",children:"".concat(T("Back"))}),(0,s.jsx)(u.ZP,{type:"primary",htmlType:"submit",children:T("Finish")})]})]})})}function w(e){let{setIsAddShow:t,isAddShow:l,type:c,knowLedge:o,fetchDocuments:d,fetchKnowledge:m,syncDocuments:u}=e,{t:x}=(0,r.$G)(),p=[{title:x("Knowledge_Space_Config")},{title:x("Choose_a_Datasource_type")},{title:x("Setup_the_Datasource")}],_=[{title:x("Choose_a_Datasource_type")},{title:x("Setup_the_Datasource")}],[j,f]=(0,a.useState)(""),[g,b]=(0,a.useState)(0),[Z,y]=(0,a.useState)(),w=async e=>{b(1),null==m||m(),y(e)},k=e=>{f(e.type),b("knowledge"===c?2:1)},T=()=>{b("knowledge"===c?1:0)};return(0,s.jsxs)(n.default,{title:"knowledge"===c?"Add Knowledge":"Add Datasource",centered:!0,open:l,destroyOnClose:!0,onCancel:()=>{t(!1)},width:1e3,afterClose:()=>{b(0)},footer:null,children:[(0,s.jsx)(i.Z,{current:g,items:"knowledge"===c?p:_}),(()=>{let t="document"===c?g+1:g;return 0===t?(0,s.jsx)(h,{handleAddKnowledge:w}):(0,s.jsx)(N,{fetchDocuments:d,knowledgeName:(null==o?void 0:o.name)||Z,step:t,documentType:j,handleChooseType:k,handleBackBtn:T,syncDocuments:u,setIsAddShow:e.setIsAddShow})})()]})}},92039:function(e,t,l){l.d(t,{Z:function(){return O},_:function(){return q}});var s=l(85893),a=l(67294),n=l(12069),i=l(83062),r=l(66309),c=l(85813),o=l(32983),d=l(71577),m=l(42075),u=l(96074),h=l(75081),x=l(27595),p=l(27329),_=l(68346),j=l(21640),f=l(31326),g=l(88008),b=l(27704),Z=l(24969),y=l(18754),N=l(50489),w=l(30381),k=l.n(w),T=l(78543),S=l(59566),P=l(71230),v=l(15746),C=l(39479),F=l(44442),D=l(67421),I=l(31545),E=l(6321);let{TextArea:A}=S.default;function V(e){let{knowledge:t,argumentsShow:l,setArgumentsShow:i}=e,{t:r}=(0,D.$G)(),[c,o]=(0,a.useState)(),[m,u]=(0,a.useState)(!1),x=async()=>{let[e,l]=await (0,N.Vx)((0,N.Tu)(t.name));o(l)};(0,a.useEffect)(()=>{x()},[]);let p=[{key:"Embedding",label:(0,s.jsxs)("div",{children:[(0,s.jsx)(I.Z,{}),r("Embedding")]}),children:(0,s.jsxs)(P.Z,{gutter:24,children:[(0,s.jsx)(v.Z,{span:12,offset:0,children:(0,s.jsx)(C.Z.Item,{tooltip:r("the_top_k_vectors"),rules:[{required:!0}],label:r("topk"),name:["embedding","topk"],children:(0,s.jsx)(S.default,{className:"mb-5 h-12"})})}),(0,s.jsx)(v.Z,{span:12,children:(0,s.jsx)(C.Z.Item,{tooltip:r("Set_a_threshold_score"),rules:[{required:!0}],label:r("recall_score"),name:["embedding","recall_score"],children:(0,s.jsx)(S.default,{className:"mb-5 h-12",placeholder:r("Please_input_the_owner")})})}),(0,s.jsx)(v.Z,{span:12,children:(0,s.jsx)(C.Z.Item,{tooltip:r("Recall_Type"),rules:[{required:!0}],label:r("recall_type"),name:["embedding","recall_type"],children:(0,s.jsx)(S.default,{className:"mb-5 h-12"})})}),(0,s.jsx)(v.Z,{span:12,children:(0,s.jsx)(C.Z.Item,{tooltip:r("A_model_used"),rules:[{required:!0}],label:r("model"),name:["embedding","model"],children:(0,s.jsx)(S.default,{className:"mb-5 h-12"})})}),(0,s.jsx)(v.Z,{span:12,children:(0,s.jsx)(C.Z.Item,{tooltip:r("The_size_of_the_data_chunks"),rules:[{required:!0}],label:r("chunk_size"),name:["embedding","chunk_size"],children:(0,s.jsx)(S.default,{className:"mb-5 h-12"})})}),(0,s.jsx)(v.Z,{span:12,children:(0,s.jsx)(C.Z.Item,{tooltip:r("The_amount_of_overlap"),rules:[{required:!0}],label:r("chunk_overlap"),name:["embedding","chunk_overlap"],children:(0,s.jsx)(S.default,{className:"mb-5 h-12",placeholder:r("Please_input_the_description")})})})]})},{key:"Prompt",label:(0,s.jsxs)("div",{children:[(0,s.jsx)(E.Z,{}),r("Embedding")]}),children:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(C.Z.Item,{tooltip:r("A_contextual_parameter"),label:r("scene"),name:["prompt","scene"],children:(0,s.jsx)(A,{rows:4,className:"mb-2"})}),(0,s.jsx)(C.Z.Item,{tooltip:r("structure_or_format"),label:r("template"),name:["prompt","template"],children:(0,s.jsx)(A,{rows:7,className:"mb-2"})}),(0,s.jsx)(C.Z.Item,{tooltip:r("The_maximum_number_of_tokens"),label:r("max_token"),name:["prompt","max_token"],children:(0,s.jsx)(S.default,{className:"mb-2"})})]})}],_=async e=>{u(!0);let[l,s,a]=await (0,N.Vx)((0,N.iH)(t.name,{argument:JSON.stringify(e)}));u(!1),(null==a?void 0:a.success)&&i(!1)};return(0,s.jsx)(n.default,{width:850,open:l,onCancel:()=>{i(!1)},footer:null,children:(0,s.jsx)(h.Z,{spinning:m,children:(0,s.jsxs)(C.Z,{size:"large",className:"mt-4",layout:"vertical",name:"basic",initialValues:{...c},autoComplete:"off",onFinish:_,children:[(0,s.jsx)(F.Z,{items:p}),(0,s.jsxs)("div",{className:"mt-3 mb-3",children:[(0,s.jsx)(d.ZP,{htmlType:"submit",type:"primary",className:"mr-6",children:r("Submit")}),(0,s.jsx)(d.ZP,{onClick:()=>{i(!1)},children:r("close")})]})]})})})}var z=l(11163);let{confirm:U}=n.default,q=e=>"TEXT"===e?(0,s.jsx)(x.Z,{className:"text-[#2AA3FF] mr-2 !text-lg"}):"DOCUMENT"===e?(0,s.jsx)(p.Z,{className:"text-[#2AA3FF] mr-2 !text-lg"}):(0,s.jsx)(_.Z,{className:"text-[#2AA3FF] mr-2 !text-lg"});function O(e){let{t}=(0,D.$G)(),l=(0,z.useRouter)(),{knowledge:n,setDocumentCount:x}=e,[p,_]=(0,a.useState)(!1),[w,S]=(0,a.useState)([]),[P,v]=(0,a.useState)(!1),[C,F]=(0,a.useState)(!1),I=e=>{U({title:t("Tips"),icon:(0,s.jsx)(j.Z,{}),content:"".concat(t("Del_Document_Tips"),"?"),okText:"Yes",okType:"danger",cancelText:"No",async onOk(){await O(e)}})};async function E(){_(!0);let[e,t]=await (0,N.Vx)((0,N._Q)(null==n?void 0:n.name,{page:1,page_size:20}));S(null==t?void 0:t.data),x(String(null==t?void 0:t.total)),_(!1)}let A=async(e,t)=>{await (0,N.Vx)((0,N.Hx)(e,{doc_ids:[t]}))},O=async e=>{await (0,N.Vx)((0,N.n3)(null==n?void 0:n.name,{doc_name:e.doc_name})),E()},L=()=>{v(!0)},G=(e,t)=>{let l;switch(e){case"TODO":l="gold";break;case"RUNNING":l="#2db7f5";break;case"FINISHED":l="#87d068";break;default:l="f50"}return(0,s.jsx)(i.Z,{title:t,children:(0,s.jsx)(r.Z,{color:l,children:e})})};return(0,a.useEffect)(()=>{E()},[n]),(0,s.jsxs)("div",{className:"collapse-container pt-2 px-4",children:[(0,s.jsxs)(m.Z,{children:[(0,s.jsx)(d.ZP,{size:"middle",type:"primary",className:"flex items-center",icon:(0,s.jsx)(Z.Z,{}),onClick:L,children:t("Add_Datasource")}),(0,s.jsx)(d.ZP,{size:"middle",className:"flex items-center mx-2",icon:(0,s.jsx)(y.Z,{}),onClick:()=>{F(!0)},children:"Arguments"})]}),(0,s.jsx)(u.Z,{}),(0,s.jsx)(h.Z,{spinning:p,children:w.length>0?(0,s.jsx)("div",{className:"max-h-96 mt-3 grid grid-cols-1 gap-x-6 gap-y-5 sm:grid-cols-2 lg:grid-cols-3 xl:gap-x-5 overflow-auto",children:w.map(e=>(0,s.jsxs)(c.Z,{className:" dark:bg-[#484848] relative shrink-0 grow-0 cursor-pointer rounded-[10px] border border-gray-200 border-solid w-full",title:(0,s.jsx)(i.Z,{title:e.doc_name,children:(0,s.jsxs)("div",{className:"truncate ",children:[q(e.doc_type),(0,s.jsx)("span",{children:e.doc_name})]})}),extra:(0,s.jsxs)("div",{className:"mx-3",children:[(0,s.jsx)(i.Z,{title:"detail",children:(0,s.jsx)(f.Z,{className:"mr-2 !text-lg",style:{color:"#1b7eff",fontSize:"20px"},onClick:()=>{l.push("/knowledge/".concat(n.name,"/").concat(e.id))}})}),(0,s.jsx)(i.Z,{title:"Sync",children:(0,s.jsx)(g.Z,{className:"mr-2 !text-lg",style:{color:"#1b7eff",fontSize:"20px"},onClick:()=>{A(n.name,e.id)}})}),(0,s.jsx)(i.Z,{title:"Delete",children:(0,s.jsx)(b.Z,{className:"text-[#ff1b2e] !text-lg",onClick:()=>{I(e)}})})]}),children:[(0,s.jsxs)("p",{className:"mt-2 font-semibold ",children:[t("Size"),":"]}),(0,s.jsxs)("p",{children:[e.chunk_size," chunks"]}),(0,s.jsxs)("p",{className:"mt-2 font-semibold ",children:[t("Last_Synch"),":"]}),(0,s.jsx)("p",{children:k()(e.last_sync).format("YYYY-MM-DD HH:MM:SS")}),(0,s.jsx)("p",{className:"mt-2 mb-2",children:G(e.status,e.result)})]},e.id))}):(0,s.jsx)(o.Z,{image:o.Z.PRESENTED_IMAGE_DEFAULT,children:(0,s.jsx)(d.ZP,{type:"primary",className:"flex items-center mx-auto",icon:(0,s.jsx)(Z.Z,{}),onClick:L,children:"Create Now"})})}),(0,s.jsx)(T.Z,{syncDocuments:A,fetchDocuments:E,setIsAddShow:v,isAddShow:P,type:"document",setDocuments:S,knowLedge:n}),(0,s.jsx)(V,{knowledge:n,argumentsShow:C,setArgumentsShow:F})]})}}}]); \ No newline at end of file diff --git a/pilot/server/static/_next/static/chunks/747-885083c9b95c17d3.js b/pilot/server/static/_next/static/chunks/747-885083c9b95c17d3.js deleted file mode 100644 index 8d06f727c..000000000 --- a/pilot/server/static/_next/static/chunks/747-885083c9b95c17d3.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[747],{78543:function(e,t,l){l.d(t,{Z:function(){return y}});var s=l(85893),a=l(67294),n=l(12069),i=l(3363),r=l(67421),c=l(50489),o=l(39479),d=l(59566),m=l(71577);function u(e){let{t}=(0,r.$G)(),{handleAddKnowledge:l}=e,a=async e=>{let{knowledgeName:t,owner:s,description:a}=e,[n,i,r]=await (0,c.Vx)((0,c.U6)({name:t,vector_type:"Chroma",owner:s,desc:a}));(null==r?void 0:r.success)&&l()};return(0,s.jsxs)(o.Z,{size:"large",className:"mt-4",layout:"vertical",name:"basic",initialValues:{remember:!0},autoComplete:"off",onFinish:a,children:[(0,s.jsx)(o.Z.Item,{label:t("Knowledge_Space_Name"),name:"knowledgeName",rules:[{required:!0,message:t("Please_input_the_name")},()=>({validator:(e,l)=>/[^\u4e00-\u9fa50-9a-zA-Z_-]/.test(l)?Promise.reject(Error(t("the_name_can_only_contain"))):Promise.resolve()})],children:(0,s.jsx)(d.default,{className:"mb-5 h-12",placeholder:t("Please_input_the_name")})}),(0,s.jsx)(o.Z.Item,{label:t("Owner"),name:"owner",rules:[{required:!0,message:t("Please_input_the_owner")}],children:(0,s.jsx)(d.default,{className:"mb-5 h-12",placeholder:t("Please_input_the_owner")})}),(0,s.jsx)(o.Z.Item,{label:t("Description"),name:"description",rules:[{required:!0,message:t("Please_input_the_description")}],children:(0,s.jsx)(d.default,{className:"mb-5 h-12",placeholder:t("Please_input_the_description")})}),(0,s.jsx)(o.Z.Item,{children:(0,s.jsx)(m.ZP,{type:"primary",htmlType:"submit",children:t("Next")})})]})}var h=l(31365),x=l(2453),p=l(85813),_=l(72269),j=l(92039),f=l(64082);let b={ChooseType:1,AddDataSourceForm:2},{Dragger:g}=h.default;function Z(e){let{handleChooseType:t,documentType:l,step:a,handleBackBtn:n,knowledgeName:i,syncDocuments:u,fetchDocuments:Z,setIsAddShow:y}=e,{t:N}=(0,r.$G)(),[w]=o.Z.useForm(),{TextArea:k}=d.default,T=async e=>{var t;let s;let{synchChecked:a,documentName:n,textSource:r,originFileObj:o,text:d,webPageUrl:m}=e;switch(l){case"webPage":s=await (0,c.Vx)((0,c.H_)(i,{doc_name:n,content:m,doc_type:"URL"}));break;case"file":let h=new FormData;h.append("doc_name",n||o.file.name),h.append("doc_file",o.file),h.append("doc_type","DOCUMENT"),s=await (0,c.Vx)((0,c.iG)(i,h));break;default:s=await (0,c.Vx)((0,c.H_)(i,{doc_name:n,source:r,content:d,doc_type:"TEXT"}))}a&&(null==u||u(i,null==s?void 0:s[1])),(null===(t=s[2])||void 0===t?void 0:t.success)&&(null==y||y(!1),null==Z||Z())},P=()=>{let e=w.getFieldsValue().originFileObj;return!!e&&(x.ZP.warning(N("Limit_Upload_File_Count_Tips")),h.default.LIST_IGNORE)},S=[{type:"text",title:N("Text"),subTitle:N("Fill your raw text"),iconType:"TEXT"},{type:"webPage",title:N("URL"),subTitle:N("Fetch_the_content_of_a_URL"),iconType:"WEBPAGE"},{type:"file",title:N("Document"),subTitle:N("Upload_a_document"),iconType:"DOCUMENT"}],v=()=>(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(o.Z.Item,{label:"".concat(N("Text_Source"),":"),name:"textSource",rules:[{required:!0,message:N("Please_input_the_text_source")}],children:(0,s.jsx)(d.default,{className:"mb-5 h-12",placeholder:N("Please_input_the_text_source")})}),(0,s.jsx)(o.Z.Item,{label:"".concat(N("Text"),":"),name:"text",rules:[{required:!0,message:N("Please_input_the_description")}],children:(0,s.jsx)(k,{rows:4,maxLength:6})})]}),C=()=>(0,s.jsx)(s.Fragment,{children:(0,s.jsx)(o.Z.Item,{label:"".concat(N("Web_Page_URL"),":"),name:"webPageUrl",rules:[{required:!0,message:N("Please_input_the_owner")}],children:(0,s.jsx)(d.default,{className:"mb-5 h-12",placeholder:N("Please_input_the_Web_Page_URL")})})}),D=()=>(0,s.jsx)(s.Fragment,{children:(0,s.jsx)(o.Z.Item,{name:"originFileObj",rules:[{required:!0,message:N("Please_input_the_owner")}],children:(0,s.jsxs)(g,{beforeUpload:P,multiple:!1,accept:".pdf,.ppt,.pptx,.xls,.xlsx,.doc,.docx,.txt,.md",children:[(0,s.jsx)("p",{className:"ant-upload-drag-icon",children:(0,s.jsx)(f.Z,{})}),(0,s.jsx)("p",{style:{color:"rgb(22, 108, 255)",fontSize:"20px"},children:N("Select_or_Drop_file")}),(0,s.jsx)("p",{className:"ant-upload-hint",style:{color:"rgb(22, 108, 255)"},children:"PDF, PowerPoint, Excel, Word, Text, Markdown,"})]})})});return a===b.ChooseType?(0,s.jsx)(s.Fragment,{children:S.map((e,l)=>(0,s.jsxs)(p.Z,{className:"mt-4 mb-4 cursor-pointer",onClick:()=>{t(e)},children:[(0,s.jsxs)("div",{className:"font-semibold",children:[(0,j._)(e.iconType)," ",e.title]}),(0,s.jsx)("div",{children:e.subTitle})]},l))}):(0,s.jsxs)(o.Z,{form:w,size:"large",className:"mt-4",layout:"vertical",name:"basic",initialValues:{remember:!0},autoComplete:"off",onFinish:T,children:[(0,s.jsx)(o.Z.Item,{label:"".concat(N("Name"),":"),name:"documentName",rules:[{required:!0,message:N("Please_input_the_name")}],children:(0,s.jsx)(d.default,{className:"mb-5 h-12",placeholder:N("Please_input_the_name")})}),(()=>{switch(l){case"webPage":return C();case"file":return D();default:return v()}})(),(0,s.jsx)(o.Z.Item,{label:"".concat(N("Synch"),":"),name:"synchChecked",initialValue:!0,children:(0,s.jsx)(_.Z,{className:"bg-slate-400",defaultChecked:!0})}),(0,s.jsxs)(o.Z.Item,{children:[(0,s.jsx)(m.ZP,{onClick:n,className:"mr-4",children:"".concat(N("Back"))}),(0,s.jsx)(m.ZP,{type:"primary",htmlType:"submit",children:N("Finish")})]})]})}function y(e){let{setIsAddShow:t,isAddShow:l,type:c,knowLedge:o,fetchDocuments:d,fetchKnowledge:m,syncDocuments:h}=e,{t:x}=(0,r.$G)(),p=[{title:x("Knowledge_Space_Config")},{title:x("Choose_a_Datasource_type")},{title:x("Setup_the_Datasource")}],_=[{title:x("Choose_a_Datasource_type")},{title:x("Setup_the_Datasource")}],[j,f]=(0,a.useState)(""),[b,g]=(0,a.useState)(0),y=async()=>{g(1),null==m||m()},N=e=>{f(e.type),g("knowledge"===c?2:1)},w=()=>{g("knowledge"===c?1:0)};return(0,s.jsxs)(n.default,{title:"knowledge"===c?"Add Knowledge":"Add Datasource",centered:!0,open:l,destroyOnClose:!0,onCancel:()=>{t(!1)},width:1e3,afterClose:()=>{g(0)},footer:null,children:[(0,s.jsx)(i.Z,{current:b,items:"knowledge"===c?p:_}),(()=>{let t="document"===c?b+1:b;return 0===t?(0,s.jsx)(u,{handleAddKnowledge:y}):(0,s.jsx)(Z,{fetchDocuments:d,knowledgeName:null==o?void 0:o.name,step:t,documentType:j,handleChooseType:N,handleBackBtn:w,syncDocuments:h,setIsAddShow:e.setIsAddShow})})()]})}},92039:function(e,t,l){l.d(t,{Z:function(){return O},_:function(){return V}});var s=l(85893),a=l(67294),n=l(12069),i=l(83062),r=l(66309),c=l(85813),o=l(32983),d=l(71577),m=l(42075),u=l(96074),h=l(75081),x=l(27595),p=l(27329),_=l(68346),j=l(21640),f=l(31326),b=l(88008),g=l(27704),Z=l(24969),y=l(18754),N=l(50489),w=l(30381),k=l.n(w),T=l(78543),P=l(59566),S=l(71230),v=l(15746),C=l(39479),D=l(44442),I=l(67421),F=l(31545),E=l(6321);let{TextArea:A}=P.default;function z(e){let{knowledge:t,argumentsShow:l,setArgumentsShow:i}=e,{t:r}=(0,I.$G)(),[c,o]=(0,a.useState)(),m=async()=>{let[e,l]=await (0,N.Vx)((0,N.Tu)(t.name));o(l)};(0,a.useEffect)(()=>{m()},[]);let u=[{key:"Embedding",label:(0,s.jsxs)("div",{children:[(0,s.jsx)(F.Z,{}),r("Embedding")]}),children:(0,s.jsxs)(S.Z,{gutter:24,children:[(0,s.jsx)(v.Z,{span:12,offset:0,children:(0,s.jsx)(C.Z.Item,{tooltip:r("the_top_k_vectors"),rules:[{required:!0}],label:r("topk"),name:["embedding","topk"],children:(0,s.jsx)(P.default,{className:"mb-5 h-12"})})}),(0,s.jsx)(v.Z,{span:12,children:(0,s.jsx)(C.Z.Item,{tooltip:r("Set_a_threshold_score"),rules:[{required:!0}],label:r("recall_score"),name:["embedding","recall_score"],children:(0,s.jsx)(P.default,{className:"mb-5 h-12",placeholder:r("Please_input_the_owner")})})}),(0,s.jsx)(v.Z,{span:12,children:(0,s.jsx)(C.Z.Item,{tooltip:r("Recall_Type"),rules:[{required:!0}],label:r("recall_type"),name:["embedding","recall_type"],children:(0,s.jsx)(P.default,{className:"mb-5 h-12"})})}),(0,s.jsx)(v.Z,{span:12,children:(0,s.jsx)(C.Z.Item,{tooltip:r("A_model_used"),rules:[{required:!0}],label:r("model"),name:["embedding","model"],children:(0,s.jsx)(P.default,{className:"mb-5 h-12"})})}),(0,s.jsx)(v.Z,{span:12,children:(0,s.jsx)(C.Z.Item,{tooltip:r("The_size_of_the_data_chunks"),rules:[{required:!0}],label:r("chunk_size"),name:["embedding","chunk_size"],children:(0,s.jsx)(P.default,{className:"mb-5 h-12"})})}),(0,s.jsx)(v.Z,{span:12,children:(0,s.jsx)(C.Z.Item,{tooltip:r("The_amount_of_overlap"),rules:[{required:!0}],label:r("chunk_overlap"),name:["embedding","chunk_overlap"],children:(0,s.jsx)(P.default,{className:"mb-5 h-12",placeholder:r("Please_input_the_description")})})})]})},{key:"Prompt",label:(0,s.jsxs)("div",{children:[(0,s.jsx)(E.Z,{}),r("Embedding")]}),children:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(C.Z.Item,{tooltip:r("A_contextual_parameter"),label:r("scene"),name:["prompt","scene"],children:(0,s.jsx)(A,{rows:4,className:"mb-2"})}),(0,s.jsx)(C.Z.Item,{tooltip:r("structure_or_format"),label:r("template"),name:["prompt","template"],children:(0,s.jsx)(A,{rows:7,className:"mb-2"})}),(0,s.jsx)(C.Z.Item,{tooltip:r("The_maximum_number_of_tokens"),label:r("max_token"),name:["prompt","max_token"],children:(0,s.jsx)(P.default,{className:"mb-2"})})]})}],h=async e=>{let[l,s,a]=await (0,N.Vx)((0,N.iH)(t.name,{argument:JSON.stringify(e)}));(null==a?void 0:a.success)&&i(!1)};return(0,s.jsx)(n.default,{width:850,open:l,onCancel:()=>{i(!1)},footer:null,children:(0,s.jsxs)(C.Z,{size:"large",className:"mt-4",layout:"vertical",name:"basic",initialValues:{...c},autoComplete:"off",onFinish:h,children:[(0,s.jsx)(D.Z,{items:u}),(0,s.jsxs)("div",{className:"mt-3 mb-3",children:[(0,s.jsx)(d.ZP,{htmlType:"submit",type:"primary",className:"mr-6",children:r("Submit")}),(0,s.jsx)(d.ZP,{onClick:()=>{i(!1)},children:r("close")})]})]})})}var U=l(11163);let{confirm:q}=n.default,V=e=>"TEXT"===e?(0,s.jsx)(x.Z,{className:"text-[#2AA3FF] mr-2 !text-lg"}):"DOCUMENT"===e?(0,s.jsx)(p.Z,{className:"text-[#2AA3FF] mr-2 !text-lg"}):(0,s.jsx)(_.Z,{className:"text-[#2AA3FF] mr-2 !text-lg"});function O(e){let{t}=(0,I.$G)(),l=(0,U.useRouter)(),{knowledge:n,setDocumentCount:x}=e,[p,_]=(0,a.useState)(!1),[w,P]=(0,a.useState)([]),[S,v]=(0,a.useState)(!1),[C,D]=(0,a.useState)(!1),F=e=>{q({title:t("Tips"),icon:(0,s.jsx)(j.Z,{}),content:"".concat(t("Del_Document_Tips"),"?"),okText:"Yes",okType:"danger",cancelText:"No",async onOk(){await O(e)}})};async function E(){_(!0);let[e,t]=await (0,N.Vx)((0,N._Q)(null==n?void 0:n.name,{page:1,page_size:20}));P(null==t?void 0:t.data),x(String(null==t?void 0:t.total)),_(!1)}let A=async(e,t)=>{await (0,N.Vx)((0,N.Hx)(e,{doc_ids:[t]}))},O=async e=>{await (0,N.Vx)((0,N.n3)(null==n?void 0:n.name,{doc_name:e.doc_name})),E()},L=()=>{v(!0)},G=(e,t)=>{let l;switch(e){case"TODO":l="gold";break;case"RUNNING":l="#2db7f5";break;case"FINISHED":l="#87d068";break;default:l="f50"}return(0,s.jsx)(i.Z,{title:t,children:(0,s.jsx)(r.Z,{color:l,children:e})})};return(0,a.useEffect)(()=>{E()},[n]),(0,s.jsxs)("div",{className:"collapse-container pt-2 px-4",children:[(0,s.jsxs)(m.Z,{children:[(0,s.jsx)(d.ZP,{size:"middle",type:"primary",className:"flex items-center",icon:(0,s.jsx)(Z.Z,{}),onClick:L,children:t("Add_Datasource")}),(0,s.jsx)(d.ZP,{size:"middle",className:"flex items-center mx-2",icon:(0,s.jsx)(y.Z,{}),onClick:()=>{D(!0)},children:"Arguments"})]}),(0,s.jsx)(u.Z,{}),(0,s.jsx)(h.Z,{spinning:p,children:w.length>0?(0,s.jsx)("div",{className:"max-h-96 mt-3 grid grid-cols-1 gap-x-6 gap-y-5 sm:grid-cols-2 lg:grid-cols-3 xl:gap-x-5 overflow-auto",children:w.map(e=>(0,s.jsxs)(c.Z,{className:" dark:bg-[#484848] relative shrink-0 grow-0 cursor-pointer rounded-[10px] border border-gray-200 border-solid w-full",title:(0,s.jsx)(i.Z,{title:e.doc_name,children:(0,s.jsxs)("div",{className:"truncate ",children:[V(e.doc_type),(0,s.jsx)("span",{children:e.doc_name})]})}),extra:(0,s.jsxs)("div",{className:"mx-3",children:[(0,s.jsx)(i.Z,{title:"detail",children:(0,s.jsx)(f.Z,{className:"mr-2 !text-lg",style:{color:"#1b7eff",fontSize:"20px"},onClick:()=>{l.push("/knowledge/".concat(n.name,"/").concat(e.id))}})}),(0,s.jsx)(i.Z,{title:"Sync",children:(0,s.jsx)(b.Z,{className:"mr-2 !text-lg",style:{color:"#1b7eff",fontSize:"20px"},onClick:()=>{A(n.name,e.id)}})}),(0,s.jsx)(i.Z,{title:"Delete",children:(0,s.jsx)(g.Z,{className:"text-[#ff1b2e] !text-lg",onClick:()=>{F(e)}})})]}),children:[(0,s.jsxs)("p",{className:"mt-2 font-semibold ",children:[t("Size"),":"]}),(0,s.jsxs)("p",{children:[e.chunk_size," chunks"]}),(0,s.jsxs)("p",{className:"mt-2 font-semibold ",children:[t("Last_Synch"),":"]}),(0,s.jsx)("p",{children:k()(e.last_sync).format("YYYY-MM-DD HH:MM:SS")}),(0,s.jsx)("p",{className:"mt-2 mb-2",children:G(e.status,e.result)})]},e.id))}):(0,s.jsx)(o.Z,{image:o.Z.PRESENTED_IMAGE_DEFAULT,children:(0,s.jsx)(d.ZP,{type:"primary",className:"flex items-center mx-auto",icon:(0,s.jsx)(Z.Z,{}),onClick:L,children:"Create Now"})})}),(0,s.jsx)(T.Z,{syncDocuments:A,fetchDocuments:E,setIsAddShow:v,isAddShow:S,type:"document",setDocuments:P,knowLedge:n}),(0,s.jsx)(z,{knowledge:n,argumentsShow:C,setArgumentsShow:D})]})}}}]); \ No newline at end of file diff --git a/pilot/server/static/_next/static/chunks/932.56f35bb5eaee71f5.js b/pilot/server/static/_next/static/chunks/932.56f35bb5eaee71f5.js deleted file mode 100644 index b594e0311..000000000 --- a/pilot/server/static/_next/static/chunks/932.56f35bb5eaee71f5.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[932],{27015:function(e,l,t){var o=t(64836);l.Z=void 0;var a=o(t(64938)),n=t(85893),r=(0,a.default)((0,n.jsx)("path",{d:"M14 2H4c-1.11 0-2 .9-2 2v10h2V4h10V2zm4 4H8c-1.11 0-2 .9-2 2v10h2V8h10V6zm2 4h-8c-1.11 0-2 .9-2 2v8c0 1.1.89 2 2 2h8c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2z"}),"AutoAwesomeMotion");l.Z=r},53913:function(e,l,t){t.r(l),t.d(l,{default:function(){return K}});var o=t(85893),a=t(67294),n=t(577),r=t(61685),i=t(63366),d=t(87462),s=t(90512),u=t(14142),c=t(19032),v=t(92996),p=t(59948),h=t(99962),m=t(33703),f=t(94780),b=t(53406),x=t(74312),y=t(20407),g=t(30220),w=t(78653),T=t(26821);function S(e){return(0,T.d6)("MuiTooltip",e)}(0,T.sI)("MuiTooltip",["root","tooltipArrow","arrow","touch","placementLeft","placementRight","placementTop","placementBottom","colorPrimary","colorDanger","colorNeutral","colorSuccess","colorWarning","colorContext","sizeSm","sizeMd","sizeLg","variantPlain","variantOutlined","variantSoft","variantSolid"]);let j=["children","className","component","arrow","describeChild","disableFocusListener","disableHoverListener","disableInteractive","disableTouchListener","enterDelay","enterNextDelay","enterTouchDelay","followCursor","id","leaveDelay","leaveTouchDelay","onClose","onOpen","open","disablePortal","direction","keepMounted","modifiers","placement","title","color","variant","size","slots","slotProps"],Z=e=>{let{arrow:l,variant:t,color:o,size:a,placement:n,touch:r}=e,i={root:["root",l&&"tooltipArrow",r&&"touch",a&&`size${(0,u.Z)(a)}`,o&&`color${(0,u.Z)(o)}`,t&&`variant${(0,u.Z)(t)}`,`tooltipPlacement${(0,u.Z)(n.split("-")[0])}`],arrow:["arrow"]};return(0,f.Z)(i,S,{})},_=(0,x.Z)("div",{name:"JoyTooltip",slot:"Root",overridesResolver:(e,l)=>l.root})(({ownerState:e,theme:l})=>{var t,o,a;let n=null==(t=l.variants[e.variant])?void 0:t[e.color];return(0,d.Z)({},"sm"===e.size&&{"--Icon-fontSize":l.vars.fontSize.md,"--Tooltip-arrowSize":"8px",padding:l.spacing(.25,.625)},"md"===e.size&&{"--Icon-fontSize":l.vars.fontSize.lg,"--Tooltip-arrowSize":"10px",padding:l.spacing(.5,.75)},"lg"===e.size&&{"--Icon-fontSize":l.vars.fontSize.xl,"--Tooltip-arrowSize":"12px",padding:l.spacing(.75,1)},{zIndex:l.vars.zIndex.tooltip,borderRadius:l.vars.radius.sm,boxShadow:l.shadow.sm,wordWrap:"break-word",position:"relative"},e.disableInteractive&&{pointerEvents:"none"},l.typography[`body-${({sm:"xs",md:"sm",lg:"md"})[e.size]}`],n,!n.backgroundColor&&{backgroundColor:l.vars.palette.background.surface},{"&::before":{content:'""',display:"block",position:"absolute",width:null!=(o=e.placement)&&o.match(/(top|bottom)/)?"100%":"calc(10px + var(--variant-borderWidth, 0px))",height:null!=(a=e.placement)&&a.match(/(top|bottom)/)?"calc(10px + var(--variant-borderWidth, 0px))":"100%"},'&[data-popper-placement*="bottom"]::before':{top:0,left:0,transform:"translateY(-100%)"},'&[data-popper-placement*="left"]::before':{top:0,right:0,transform:"translateX(100%)"},'&[data-popper-placement*="right"]::before':{top:0,left:0,transform:"translateX(-100%)"},'&[data-popper-placement*="top"]::before':{bottom:0,left:0,transform:"translateY(100%)"}})}),k=(0,x.Z)("span",{name:"JoyTooltip",slot:"Arrow",overridesResolver:(e,l)=>l.arrow})(({theme:e,ownerState:l})=>{var t,o,a;let n=null==(t=e.variants[l.variant])?void 0:t[l.color];return{"--unstable_Tooltip-arrowRotation":0,width:"var(--Tooltip-arrowSize)",height:"var(--Tooltip-arrowSize)",boxSizing:"border-box","&:before":{content:'""',display:"block",position:"absolute",width:0,height:0,border:"calc(var(--Tooltip-arrowSize) / 2) solid",borderLeftColor:"transparent",borderBottomColor:"transparent",borderTopColor:null!=(o=null==n?void 0:n.backgroundColor)?o:e.vars.palette.background.surface,borderRightColor:null!=(a=null==n?void 0:n.backgroundColor)?a:e.vars.palette.background.surface,borderRadius:"0px 2px 0px 0px",boxShadow:`var(--variant-borderWidth, 0px) calc(-1 * var(--variant-borderWidth, 0px)) 0px 0px ${n.borderColor}`,transformOrigin:"center center",transform:"rotate(calc(-45deg + 90deg * var(--unstable_Tooltip-arrowRotation)))"},'[data-popper-placement*="bottom"] &':{top:"calc(0.5px + var(--Tooltip-arrowSize) * -1 / 2)"},'[data-popper-placement*="top"] &':{"--unstable_Tooltip-arrowRotation":2,bottom:"calc(0.5px + var(--Tooltip-arrowSize) * -1 / 2)"},'[data-popper-placement*="left"] &':{"--unstable_Tooltip-arrowRotation":1,right:"calc(0.5px + var(--Tooltip-arrowSize) * -1 / 2)"},'[data-popper-placement*="right"] &':{"--unstable_Tooltip-arrowRotation":3,left:"calc(0.5px + var(--Tooltip-arrowSize) * -1 / 2)"}}}),z=!1,N=null,R={x:0,y:0};function C(e,l){return t=>{l&&l(t),e(t)}}function q(e,l){return t=>{l&&l(t),e(t)}}let E=a.forwardRef(function(e,l){var t;let n=(0,y.Z)({props:e,name:"JoyTooltip"}),{children:r,className:u,component:f,arrow:x=!1,describeChild:T=!1,disableFocusListener:S=!1,disableHoverListener:E=!1,disableInteractive:M=!1,disableTouchListener:P=!1,enterDelay:D=100,enterNextDelay:O=0,enterTouchDelay:A=700,followCursor:L=!1,id:B,leaveDelay:W=0,leaveTouchDelay:I=1500,onClose:F,onOpen:V,open:$,disablePortal:Y,direction:H,keepMounted:J,modifiers:U,placement:X="bottom",title:K,color:G="neutral",variant:Q="solid",size:ee="md",slots:el={},slotProps:et={}}=n,eo=(0,i.Z)(n,j),{getColor:ea}=(0,w.VT)(Q),en=Y?ea(e.color,G):G,[er,ei]=a.useState(),[ed,es]=a.useState(null),eu=a.useRef(!1),ec=M||L,ev=a.useRef(),ep=a.useRef(),eh=a.useRef(),em=a.useRef(),[ef,eb]=(0,c.Z)({controlled:$,default:!1,name:"Tooltip",state:"open"}),ex=ef,ey=(0,v.Z)(B),eg=a.useRef(),ew=a.useCallback(()=>{void 0!==eg.current&&(document.body.style.WebkitUserSelect=eg.current,eg.current=void 0),clearTimeout(em.current)},[]);a.useEffect(()=>()=>{clearTimeout(ev.current),clearTimeout(ep.current),clearTimeout(eh.current),ew()},[ew]);let eT=e=>{N&&clearTimeout(N),z=!0,eb(!0),V&&!ex&&V(e)},eS=(0,p.Z)(e=>{N&&clearTimeout(N),N=setTimeout(()=>{z=!1},800+W),eb(!1),F&&ex&&F(e),clearTimeout(ev.current),ev.current=setTimeout(()=>{eu.current=!1},150)}),ej=e=>{eu.current&&"touchstart"!==e.type||(er&&er.removeAttribute("title"),clearTimeout(ep.current),clearTimeout(eh.current),D||z&&O?ep.current=setTimeout(()=>{eT(e)},z?O:D):eT(e))},eZ=e=>{clearTimeout(ep.current),clearTimeout(eh.current),eh.current=setTimeout(()=>{eS(e)},W)},{isFocusVisibleRef:e_,onBlur:ek,onFocus:ez,ref:eN}=(0,h.Z)(),[,eR]=a.useState(!1),eC=e=>{ek(e),!1===e_.current&&(eR(!1),eZ(e))},eq=e=>{er||ei(e.currentTarget),ez(e),!0===e_.current&&(eR(!0),ej(e))},eE=e=>{eu.current=!0;let l=r.props;l.onTouchStart&&l.onTouchStart(e)};a.useEffect(()=>{if(ex)return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)};function e(e){("Escape"===e.key||"Esc"===e.key)&&eS(e)}},[eS,ex]);let eM=(0,m.Z)(ei,l),eP=(0,m.Z)(eN,eM),eD=(0,m.Z)(r.ref,eP);"number"==typeof K||K||(ex=!1);let eO=a.useRef(null),eA={},eL="string"==typeof K;T?(eA.title=ex||!eL||E?null:K,eA["aria-describedby"]=ex?ey:null):(eA["aria-label"]=eL?K:null,eA["aria-labelledby"]=ex&&!eL?ey:null);let eB=(0,d.Z)({},eA,eo,{component:f},r.props,{className:(0,s.Z)(u,r.props.className),onTouchStart:eE,ref:eD},L?{onMouseMove:e=>{let l=r.props;l.onMouseMove&&l.onMouseMove(e),R={x:e.clientX,y:e.clientY},eO.current&&eO.current.update()}}:{}),eW={};P||(eB.onTouchStart=e=>{eE(e),clearTimeout(eh.current),clearTimeout(ev.current),ew(),eg.current=document.body.style.WebkitUserSelect,document.body.style.WebkitUserSelect="none",em.current=setTimeout(()=>{document.body.style.WebkitUserSelect=eg.current,ej(e)},A)},eB.onTouchEnd=e=>{r.props.onTouchEnd&&r.props.onTouchEnd(e),ew(),clearTimeout(eh.current),eh.current=setTimeout(()=>{eS(e)},I)}),E||(eB.onMouseOver=C(ej,eB.onMouseOver),eB.onMouseLeave=C(eZ,eB.onMouseLeave),ec||(eW.onMouseOver=ej,eW.onMouseLeave=eZ)),S||(eB.onFocus=q(eq,eB.onFocus),eB.onBlur=q(eC,eB.onBlur),ec||(eW.onFocus=eq,eW.onBlur=eC));let eI=(0,d.Z)({},n,{arrow:x,disableInteractive:ec,placement:X,touch:eu.current,color:en,variant:Q,size:ee}),eF=Z(eI),eV=(0,d.Z)({},eo,{component:f,slots:el,slotProps:et}),e$=a.useMemo(()=>[{name:"arrow",enabled:!!ed,options:{element:ed,padding:6}},{name:"offset",options:{offset:[0,10]}},...U||[]],[ed,U]),[eY,eH]=(0,g.Z)("root",{additionalProps:(0,d.Z)({id:ey,popperRef:eO,placement:X,anchorEl:L?{getBoundingClientRect:()=>({top:R.y,left:R.x,right:R.x,bottom:R.y,width:0,height:0})}:er,open:!!er&&ex,disablePortal:Y,keepMounted:J,direction:H,modifiers:e$},eW),ref:null,className:eF.root,elementType:_,externalForwardedProps:eV,ownerState:eI}),[eJ,eU]=(0,g.Z)("arrow",{ref:es,className:eF.arrow,elementType:k,externalForwardedProps:eV,ownerState:eI}),eX=(0,o.jsxs)(eY,(0,d.Z)({},eH,!(null!=(t=n.slots)&&t.root)&&{as:b.r,slots:{root:f||"div"}},{children:[K,x?(0,o.jsx)(eJ,(0,d.Z)({},eU)):null]}));return(0,o.jsxs)(a.Fragment,{children:[a.isValidElement(r)&&a.cloneElement(r,eB),Y?eX:(0,o.jsx)(w.ZP.Provider,{value:void 0,children:eX})]})});var M=t(40911),P=t(99056),D=t(57814),O=t(48665),A=t(71577),L=t(27015),B=t(59566),W=t(32983),I=t(57346),F=t(44442),V=t(99513),$=t(30119),Y=t(39332),H=t(9837),J=t(39156);let{Search:U}=B.default;function X(e){var l,t,n;let{editorValue:i,chartData:d,tableData:s,handleChange:u}=e,c=a.useMemo(()=>d?(0,o.jsx)("div",{className:"flex-1 overflow-auto p-3",style:{flexShrink:0,overflow:"hidden"},children:(0,o.jsx)(J.Z,{chartsData:[d]})}):(0,o.jsx)("div",{}),[d]);return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)("div",{className:"flex-1 flex overflow-hidden",children:[(0,o.jsx)("div",{className:"flex-1",style:{flexShrink:0,overflow:"auto"},children:(0,o.jsx)(V.Z,{value:(null==i?void 0:i.sql)||"",language:"mysql",onChange:u,thoughts:(null==i?void 0:i.thoughts)||""})}),c]}),(0,o.jsx)("div",{className:"h-96 border-[var(--joy-palette-divider)] border-t border-solid overflow-auto",children:(null==s?void 0:null===(l=s.values)||void 0===l?void 0:l.length)>0?(0,o.jsxs)(r.Z,{"aria-label":"basic table",stickyHeader:!0,children:[(0,o.jsx)("thead",{children:(0,o.jsx)("tr",{children:null==s?void 0:null===(t=s.columns)||void 0===t?void 0:t.map((e,l)=>(0,o.jsx)("th",{children:e},e+l))})}),(0,o.jsx)("tbody",{children:null==s?void 0:null===(n=s.values)||void 0===n?void 0:n.map((e,l)=>{var t;return(0,o.jsx)("tr",{children:null===(t=Object.keys(e))||void 0===t?void 0:t.map(l=>(0,o.jsx)("td",{children:e[l]},l))},l)})})]}):(0,o.jsx)("div",{className:"h-full flex justify-center items-center",children:(0,o.jsx)(W.Z,{})})})]})}var K=function(){var e,l,t,r,i;let[d,s]=a.useState([]),[u,c]=a.useState(""),[v,p]=a.useState(),[h,m]=a.useState(!0),[f,b]=a.useState(),[x,y]=a.useState(),[g,w]=a.useState(),[T,S]=a.useState(),[j,Z]=a.useState(),_=(0,Y.useSearchParams)(),k=null==_?void 0:_.get("id"),z=null==_?void 0:_.get("scene"),{data:N,loading:R}=(0,n.Z)(async()=>await (0,$.Tk)("/v1/editor/sql/rounds",{con_uid:k}),{onSuccess:e=>{var l,t;let o=null==e?void 0:null===(l=e.data)||void 0===l?void 0:l[(null==e?void 0:null===(t=e.data)||void 0===t?void 0:t.length)-1];o&&p(null==o?void 0:o.round)}}),{run:C,loading:q}=(0,n.Z)(async()=>{var e,l;let t=null===(e=null==N?void 0:null===(l=N.data)||void 0===l?void 0:l.find(e=>e.round===v))||void 0===e?void 0:e.db_name;return await (0,$.PR)("/api/v1/editor/sql/run",{db_name:t,sql:null==g?void 0:g.sql})},{manual:!0,onSuccess:e=>{var l,t;S({columns:null==e?void 0:null===(l=e.data)||void 0===l?void 0:l.colunms,values:null==e?void 0:null===(t=e.data)||void 0===t?void 0:t.values})}}),{run:B,loading:W}=(0,n.Z)(async()=>{var e,l;let t=null===(e=null==N?void 0:null===(l=N.data)||void 0===l?void 0:l.find(e=>e.round===v))||void 0===e?void 0:e.db_name,o={db_name:t,sql:null==g?void 0:g.sql};return"chat_dashboard"===z&&(o.chart_type=null==g?void 0:g.showcase),await (0,$.PR)("/api/v1/editor/chart/run",o)},{manual:!0,ready:!!(null==g?void 0:g.sql),onSuccess:e=>{if(null==e?void 0:e.success){var l,t,o,a,n,r,i;S({columns:(null==e?void 0:null===(l=e.data)||void 0===l?void 0:null===(t=l.sql_data)||void 0===t?void 0:t.colunms)||[],values:(null==e?void 0:null===(o=e.data)||void 0===o?void 0:null===(a=o.sql_data)||void 0===a?void 0:a.values)||[]}),(null==e?void 0:null===(n=e.data)||void 0===n?void 0:n.chart_values)?b({type:null==e?void 0:null===(r=e.data)||void 0===r?void 0:r.chart_type,values:null==e?void 0:null===(i=e.data)||void 0===i?void 0:i.chart_values,title:null==g?void 0:g.title,description:null==g?void 0:g.thoughts}):b(void 0)}}}),{run:V,loading:J}=(0,n.Z)(async()=>{var e,l,t,o,a;let n=null===(e=null==N?void 0:null===(l=N.data)||void 0===l?void 0:l.find(e=>e.round===v))||void 0===e?void 0:e.db_name;return await (0,$.PR)("/api/v1/sql/editor/submit",{conv_uid:k,db_name:n,conv_round:v,old_sql:null==x?void 0:x.sql,old_speak:null==x?void 0:x.thoughts,new_sql:null==g?void 0:g.sql,new_speak:(null===(t=null==g?void 0:null===(o=g.thoughts)||void 0===o?void 0:o.match(/^\n--(.*)\n\n$/))||void 0===t?void 0:null===(a=t[1])||void 0===a?void 0:a.trim())||(null==g?void 0:g.thoughts)})},{manual:!0,onSuccess:e=>{(null==e?void 0:e.success)&&C()}}),{run:K,loading:G}=(0,n.Z)(async()=>{var e,l,t,o,a,n;let r=null===(e=null==N?void 0:null===(l=N.data)||void 0===l?void 0:l.find(e=>e.round===v))||void 0===e?void 0:e.db_name;return await (0,$.PR)("/api/v1/chart/editor/submit",{conv_uid:k,chart_title:null==g?void 0:g.title,db_name:r,old_sql:null==x?void 0:null===(t=x[j])||void 0===t?void 0:t.sql,new_chart_type:null==g?void 0:g.showcase,new_sql:null==g?void 0:g.sql,new_comment:(null===(o=null==g?void 0:null===(a=g.thoughts)||void 0===a?void 0:a.match(/^\n--(.*)\n\n$/))||void 0===o?void 0:null===(n=o[1])||void 0===n?void 0:n.trim())||(null==g?void 0:g.thoughts),gmt_create:new Date().getTime()})},{manual:!0,onSuccess:e=>{(null==e?void 0:e.success)&&B()}}),{data:Q}=(0,n.Z)(async()=>{var e,l;let t=null===(e=null==N?void 0:null===(l=N.data)||void 0===l?void 0:l.find(e=>e.round===v))||void 0===e?void 0:e.db_name;return await (0,$.Tk)("/v1/editor/db/tables",{db_name:t,page_index:1,page_size:200})},{ready:!!(null===(e=null==N?void 0:null===(l=N.data)||void 0===l?void 0:l.find(e=>e.round===v))||void 0===e?void 0:e.db_name),refreshDeps:[null===(t=null==N?void 0:null===(r=N.data)||void 0===r?void 0:r.find(e=>e.round===v))||void 0===t?void 0:t.db_name]}),{run:ee}=(0,n.Z)(async e=>await (0,$.Tk)("/v1/editor/sql",{con_uid:k,round:e}),{manual:!0,onSuccess:e=>{let l;try{if(Array.isArray(null==e?void 0:e.data))l=null==e?void 0:e.data,Z("0");else if("string"==typeof(null==e?void 0:e.data)){let t=JSON.parse(null==e?void 0:e.data);l=t}else l=null==e?void 0:e.data}catch(e){console.log(e)}finally{y(l),Array.isArray(l)?w(null==l?void 0:l[Number(j||0)]):w(l)}}}),el=a.useMemo(()=>{let e=(l,t)=>l.map(l=>{let a=l.title,n=a.indexOf(u),r=a.substring(0,n),i=a.slice(n+u.length),d=n>-1?(0,o.jsx)(E,{title:((null==l?void 0:l.comment)||(null==l?void 0:l.title))+((null==l?void 0:l.can_null)==="YES"?"(can null)":"(can't null)"),children:(0,o.jsxs)("span",{children:[r,(0,o.jsx)("span",{className:"text-[#1677ff]",children:u}),i,(null==l?void 0:l.type)&&(0,o.jsx)(M.ZP,{gutterBottom:!0,level:"body3",className:"pl-0.5",style:{display:"inline"},children:"[".concat(null==l?void 0:l.type,"]")})]})}):(0,o.jsx)(E,{title:((null==l?void 0:l.comment)||(null==l?void 0:l.title))+((null==l?void 0:l.can_null)==="YES"?"(can null)":"(can't null)"),children:(0,o.jsxs)("span",{children:[a,(null==l?void 0:l.type)&&(0,o.jsx)(M.ZP,{gutterBottom:!0,level:"body3",className:"pl-0.5",style:{display:"inline"},children:"[".concat(null==l?void 0:l.type,"]")})]})});if(l.children){let o=t?String(t)+"_"+l.key:l.key;return{title:a,showTitle:d,key:o,children:e(l.children,o)}}return{title:a,showTitle:d,key:l.key}});return(null==Q?void 0:Q.data)?(s([null==Q?void 0:Q.data.key]),e([null==Q?void 0:Q.data])):[]},[u,Q]),et=a.useMemo(()=>{let e=[],l=(t,o)=>{if(t&&!((null==t?void 0:t.length)<=0))for(let a=0;a{let t;for(let o=0;ol.key===e)?t=a.key:eo(e,a.children)&&(t=eo(e,a.children)))}return t};function ea(e){let l;if(!e)return{sql:"",thoughts:""};let t=e&&e.match(/(--.*)\n([\s\S]*)/),o="";return t&&t.length>=3&&(o=t[1],l=t[2]),{sql:l,thoughts:o}}return a.useEffect(()=>{v&&ee(v)},[ee,v]),a.useEffect(()=>{x&&"chat_dashboard"===z&&j&&B()},[j,z,x,B]),a.useEffect(()=>{x&&"chat_dashboard"!==z&&C()},[z,x,C]),(0,o.jsxs)("div",{className:"flex flex-col w-full h-full",children:[(0,o.jsx)(H.Z,{}),(0,o.jsxs)("div",{className:"relative flex flex-1 overflow-auto",children:[(0,o.jsxs)("div",{className:"text h-full border-[var(--joy-palette-divider)] border-r border-solid p-3 max-h-full overflow-auto",style:{width:"300px"},children:[(0,o.jsxs)("div",{className:"absolute right-4 top-2 z-10",children:[(0,o.jsx)(A.ZP,{className:"mr-2",type:"primary",loading:q||W,onClick:async()=>{"chat_dashboard"===z?B():C()},children:"Run"}),(0,o.jsx)(A.ZP,{loading:J||G,onClick:async()=>{"chat_dashboard"===z?await K():await V()},children:"Save"})]}),(0,o.jsxs)("div",{className:"flex items-center py-3",children:[(0,o.jsx)(P.Z,{className:"h-4 min-w-[240px]",size:"sm",value:v,onChange:(e,l)=>{p(l)},children:null==N?void 0:null===(i=N.data)||void 0===i?void 0:i.map(e=>(0,o.jsx)(D.Z,{value:null==e?void 0:e.round,children:null==e?void 0:e.round_name},null==e?void 0:e.round))}),(0,o.jsx)(L.Z,{className:"ml-2"})]}),(0,o.jsx)(U,{style:{marginBottom:8},placeholder:"Search",onChange:e=>{let{value:l}=e.target;if(null==Q?void 0:Q.data){if(l){let e=et.map(e=>e.title.indexOf(l)>-1?eo(e.key,el):null).filter((e,l,t)=>e&&t.indexOf(e)===l);s(e)}else s([]);c(l),m(!0)}}}),el&&el.length>0&&(0,o.jsx)(I.Z,{onExpand:e=>{s(e),m(!1)},expandedKeys:d,autoExpandParent:h,treeData:el,fieldNames:{title:"showTitle"}})]}),(0,o.jsx)("div",{className:"flex flex-col flex-1 max-w-full overflow-hidden",children:Array.isArray(x)?(0,o.jsx)(o.Fragment,{children:(0,o.jsx)(O.Z,{className:"h-full",sx:{".ant-tabs-content, .ant-tabs-tabpane-active":{height:"100%"},"& .ant-tabs-card.ant-tabs-top >.ant-tabs-nav .ant-tabs-tab, & .ant-tabs-card.ant-tabs-top >div>.ant-tabs-nav .ant-tabs-tab":{borderRadius:"0"}},children:(0,o.jsx)(F.Z,{className:"h-full dark:text-white px-2",activeKey:j,onChange:e=>{Z(e),w(null==x?void 0:x[Number(e)])},items:null==x?void 0:x.map((e,l)=>({key:l+"",label:null==e?void 0:e.title,children:(0,o.jsx)("div",{className:"flex flex-col h-full",children:(0,o.jsx)(X,{editorValue:e,handleChange:e=>{let{sql:l,thoughts:t}=ea(e);w(e=>Object.assign({},e,{sql:l,thoughts:t}))},tableData:T,chartData:f})})}))})})}):(0,o.jsx)(X,{editorValue:x,handleChange:e=>{let{sql:l,thoughts:t}=ea(e);w(e=>Object.assign({},e,{sql:l,thoughts:t}))},tableData:T,chartData:void 0})})]})]})}}}]); \ No newline at end of file diff --git a/pilot/server/static/_next/static/chunks/932.7b0affeba86ae523.js b/pilot/server/static/_next/static/chunks/932.7b0affeba86ae523.js new file mode 100644 index 000000000..d481a1808 --- /dev/null +++ b/pilot/server/static/_next/static/chunks/932.7b0affeba86ae523.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[932],{27015:function(e,l,t){var o=t(64836);l.Z=void 0;var a=o(t(64938)),n=t(85893),r=(0,a.default)((0,n.jsx)("path",{d:"M14 2H4c-1.11 0-2 .9-2 2v10h2V4h10V2zm4 4H8c-1.11 0-2 .9-2 2v10h2V8h10V6zm2 4h-8c-1.11 0-2 .9-2 2v8c0 1.1.89 2 2 2h8c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2z"}),"AutoAwesomeMotion");l.Z=r},53913:function(e,l,t){t.r(l),t.d(l,{default:function(){return K}});var o=t(85893),a=t(67294),n=t(577),r=t(61685),i=t(63366),d=t(87462),s=t(90512),u=t(14142),c=t(19032),v=t(92996),p=t(59948),h=t(99962),m=t(33703),f=t(94780),b=t(53406),x=t(74312),y=t(20407),g=t(30220),w=t(78653),T=t(26821);function S(e){return(0,T.d6)("MuiTooltip",e)}(0,T.sI)("MuiTooltip",["root","tooltipArrow","arrow","touch","placementLeft","placementRight","placementTop","placementBottom","colorPrimary","colorDanger","colorNeutral","colorSuccess","colorWarning","colorContext","sizeSm","sizeMd","sizeLg","variantPlain","variantOutlined","variantSoft","variantSolid"]);let j=["children","className","component","arrow","describeChild","disableFocusListener","disableHoverListener","disableInteractive","disableTouchListener","enterDelay","enterNextDelay","enterTouchDelay","followCursor","id","leaveDelay","leaveTouchDelay","onClose","onOpen","open","disablePortal","direction","keepMounted","modifiers","placement","title","color","variant","size","slots","slotProps"],Z=e=>{let{arrow:l,variant:t,color:o,size:a,placement:n,touch:r}=e,i={root:["root",l&&"tooltipArrow",r&&"touch",a&&`size${(0,u.Z)(a)}`,o&&`color${(0,u.Z)(o)}`,t&&`variant${(0,u.Z)(t)}`,`tooltipPlacement${(0,u.Z)(n.split("-")[0])}`],arrow:["arrow"]};return(0,f.Z)(i,S,{})},_=(0,x.Z)("div",{name:"JoyTooltip",slot:"Root",overridesResolver:(e,l)=>l.root})(({ownerState:e,theme:l})=>{var t,o,a;let n=null==(t=l.variants[e.variant])?void 0:t[e.color];return(0,d.Z)({},"sm"===e.size&&{"--Icon-fontSize":l.vars.fontSize.md,"--Tooltip-arrowSize":"8px",padding:l.spacing(.25,.625)},"md"===e.size&&{"--Icon-fontSize":l.vars.fontSize.lg,"--Tooltip-arrowSize":"10px",padding:l.spacing(.5,.75)},"lg"===e.size&&{"--Icon-fontSize":l.vars.fontSize.xl,"--Tooltip-arrowSize":"12px",padding:l.spacing(.75,1)},{zIndex:l.vars.zIndex.tooltip,borderRadius:l.vars.radius.sm,boxShadow:l.shadow.sm,wordWrap:"break-word",position:"relative"},e.disableInteractive&&{pointerEvents:"none"},l.typography[`body-${({sm:"xs",md:"sm",lg:"md"})[e.size]}`],n,!n.backgroundColor&&{backgroundColor:l.vars.palette.background.surface},{"&::before":{content:'""',display:"block",position:"absolute",width:null!=(o=e.placement)&&o.match(/(top|bottom)/)?"100%":"calc(10px + var(--variant-borderWidth, 0px))",height:null!=(a=e.placement)&&a.match(/(top|bottom)/)?"calc(10px + var(--variant-borderWidth, 0px))":"100%"},'&[data-popper-placement*="bottom"]::before':{top:0,left:0,transform:"translateY(-100%)"},'&[data-popper-placement*="left"]::before':{top:0,right:0,transform:"translateX(100%)"},'&[data-popper-placement*="right"]::before':{top:0,left:0,transform:"translateX(-100%)"},'&[data-popper-placement*="top"]::before':{bottom:0,left:0,transform:"translateY(100%)"}})}),k=(0,x.Z)("span",{name:"JoyTooltip",slot:"Arrow",overridesResolver:(e,l)=>l.arrow})(({theme:e,ownerState:l})=>{var t,o,a;let n=null==(t=e.variants[l.variant])?void 0:t[l.color];return{"--unstable_Tooltip-arrowRotation":0,width:"var(--Tooltip-arrowSize)",height:"var(--Tooltip-arrowSize)",boxSizing:"border-box","&:before":{content:'""',display:"block",position:"absolute",width:0,height:0,border:"calc(var(--Tooltip-arrowSize) / 2) solid",borderLeftColor:"transparent",borderBottomColor:"transparent",borderTopColor:null!=(o=null==n?void 0:n.backgroundColor)?o:e.vars.palette.background.surface,borderRightColor:null!=(a=null==n?void 0:n.backgroundColor)?a:e.vars.palette.background.surface,borderRadius:"0px 2px 0px 0px",boxShadow:`var(--variant-borderWidth, 0px) calc(-1 * var(--variant-borderWidth, 0px)) 0px 0px ${n.borderColor}`,transformOrigin:"center center",transform:"rotate(calc(-45deg + 90deg * var(--unstable_Tooltip-arrowRotation)))"},'[data-popper-placement*="bottom"] &':{top:"calc(0.5px + var(--Tooltip-arrowSize) * -1 / 2)"},'[data-popper-placement*="top"] &':{"--unstable_Tooltip-arrowRotation":2,bottom:"calc(0.5px + var(--Tooltip-arrowSize) * -1 / 2)"},'[data-popper-placement*="left"] &':{"--unstable_Tooltip-arrowRotation":1,right:"calc(0.5px + var(--Tooltip-arrowSize) * -1 / 2)"},'[data-popper-placement*="right"] &':{"--unstable_Tooltip-arrowRotation":3,left:"calc(0.5px + var(--Tooltip-arrowSize) * -1 / 2)"}}}),z=!1,N=null,R={x:0,y:0};function C(e,l){return t=>{l&&l(t),e(t)}}function q(e,l){return t=>{l&&l(t),e(t)}}let E=a.forwardRef(function(e,l){var t;let n=(0,y.Z)({props:e,name:"JoyTooltip"}),{children:r,className:u,component:f,arrow:x=!1,describeChild:T=!1,disableFocusListener:S=!1,disableHoverListener:E=!1,disableInteractive:M=!1,disableTouchListener:P=!1,enterDelay:D=100,enterNextDelay:O=0,enterTouchDelay:A=700,followCursor:L=!1,id:B,leaveDelay:W=0,leaveTouchDelay:I=1500,onClose:F,onOpen:V,open:$,disablePortal:Y,direction:H,keepMounted:J,modifiers:U,placement:X="bottom",title:K,color:G="neutral",variant:Q="solid",size:ee="md",slots:el={},slotProps:et={}}=n,eo=(0,i.Z)(n,j),{getColor:ea}=(0,w.VT)(Q),en=Y?ea(e.color,G):G,[er,ei]=a.useState(),[ed,es]=a.useState(null),eu=a.useRef(!1),ec=M||L,ev=a.useRef(),ep=a.useRef(),eh=a.useRef(),em=a.useRef(),[ef,eb]=(0,c.Z)({controlled:$,default:!1,name:"Tooltip",state:"open"}),ex=ef,ey=(0,v.Z)(B),eg=a.useRef(),ew=a.useCallback(()=>{void 0!==eg.current&&(document.body.style.WebkitUserSelect=eg.current,eg.current=void 0),clearTimeout(em.current)},[]);a.useEffect(()=>()=>{clearTimeout(ev.current),clearTimeout(ep.current),clearTimeout(eh.current),ew()},[ew]);let eT=e=>{N&&clearTimeout(N),z=!0,eb(!0),V&&!ex&&V(e)},eS=(0,p.Z)(e=>{N&&clearTimeout(N),N=setTimeout(()=>{z=!1},800+W),eb(!1),F&&ex&&F(e),clearTimeout(ev.current),ev.current=setTimeout(()=>{eu.current=!1},150)}),ej=e=>{eu.current&&"touchstart"!==e.type||(er&&er.removeAttribute("title"),clearTimeout(ep.current),clearTimeout(eh.current),D||z&&O?ep.current=setTimeout(()=>{eT(e)},z?O:D):eT(e))},eZ=e=>{clearTimeout(ep.current),clearTimeout(eh.current),eh.current=setTimeout(()=>{eS(e)},W)},{isFocusVisibleRef:e_,onBlur:ek,onFocus:ez,ref:eN}=(0,h.Z)(),[,eR]=a.useState(!1),eC=e=>{ek(e),!1===e_.current&&(eR(!1),eZ(e))},eq=e=>{er||ei(e.currentTarget),ez(e),!0===e_.current&&(eR(!0),ej(e))},eE=e=>{eu.current=!0;let l=r.props;l.onTouchStart&&l.onTouchStart(e)};a.useEffect(()=>{if(ex)return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)};function e(e){("Escape"===e.key||"Esc"===e.key)&&eS(e)}},[eS,ex]);let eM=(0,m.Z)(ei,l),eP=(0,m.Z)(eN,eM),eD=(0,m.Z)(r.ref,eP);"number"==typeof K||K||(ex=!1);let eO=a.useRef(null),eA={},eL="string"==typeof K;T?(eA.title=ex||!eL||E?null:K,eA["aria-describedby"]=ex?ey:null):(eA["aria-label"]=eL?K:null,eA["aria-labelledby"]=ex&&!eL?ey:null);let eB=(0,d.Z)({},eA,eo,{component:f},r.props,{className:(0,s.Z)(u,r.props.className),onTouchStart:eE,ref:eD},L?{onMouseMove:e=>{let l=r.props;l.onMouseMove&&l.onMouseMove(e),R={x:e.clientX,y:e.clientY},eO.current&&eO.current.update()}}:{}),eW={};P||(eB.onTouchStart=e=>{eE(e),clearTimeout(eh.current),clearTimeout(ev.current),ew(),eg.current=document.body.style.WebkitUserSelect,document.body.style.WebkitUserSelect="none",em.current=setTimeout(()=>{document.body.style.WebkitUserSelect=eg.current,ej(e)},A)},eB.onTouchEnd=e=>{r.props.onTouchEnd&&r.props.onTouchEnd(e),ew(),clearTimeout(eh.current),eh.current=setTimeout(()=>{eS(e)},I)}),E||(eB.onMouseOver=C(ej,eB.onMouseOver),eB.onMouseLeave=C(eZ,eB.onMouseLeave),ec||(eW.onMouseOver=ej,eW.onMouseLeave=eZ)),S||(eB.onFocus=q(eq,eB.onFocus),eB.onBlur=q(eC,eB.onBlur),ec||(eW.onFocus=eq,eW.onBlur=eC));let eI=(0,d.Z)({},n,{arrow:x,disableInteractive:ec,placement:X,touch:eu.current,color:en,variant:Q,size:ee}),eF=Z(eI),eV=(0,d.Z)({},eo,{component:f,slots:el,slotProps:et}),e$=a.useMemo(()=>[{name:"arrow",enabled:!!ed,options:{element:ed,padding:6}},{name:"offset",options:{offset:[0,10]}},...U||[]],[ed,U]),[eY,eH]=(0,g.Z)("root",{additionalProps:(0,d.Z)({id:ey,popperRef:eO,placement:X,anchorEl:L?{getBoundingClientRect:()=>({top:R.y,left:R.x,right:R.x,bottom:R.y,width:0,height:0})}:er,open:!!er&&ex,disablePortal:Y,keepMounted:J,direction:H,modifiers:e$},eW),ref:null,className:eF.root,elementType:_,externalForwardedProps:eV,ownerState:eI}),[eJ,eU]=(0,g.Z)("arrow",{ref:es,className:eF.arrow,elementType:k,externalForwardedProps:eV,ownerState:eI}),eX=(0,o.jsxs)(eY,(0,d.Z)({},eH,!(null!=(t=n.slots)&&t.root)&&{as:b.r,slots:{root:f||"div"}},{children:[K,x?(0,o.jsx)(eJ,(0,d.Z)({},eU)):null]}));return(0,o.jsxs)(a.Fragment,{children:[a.isValidElement(r)&&a.cloneElement(r,eB),Y?eX:(0,o.jsx)(w.ZP.Provider,{value:void 0,children:eX})]})});var M=t(40911),P=t(99056),D=t(57814),O=t(48665),A=t(71577),L=t(27015),B=t(59566),W=t(32983),I=t(57346),F=t(44442),V=t(99513),$=t(30119),Y=t(39332),H=t(70803),J=t(39156);let{Search:U}=B.default;function X(e){var l,t,n;let{editorValue:i,chartData:d,tableData:s,handleChange:u}=e,c=a.useMemo(()=>d?(0,o.jsx)("div",{className:"flex-1 overflow-auto p-3",style:{flexShrink:0,overflow:"hidden"},children:(0,o.jsx)(J.Z,{chartsData:[d]})}):(0,o.jsx)("div",{}),[d]);return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)("div",{className:"flex-1 flex overflow-hidden",children:[(0,o.jsx)("div",{className:"flex-1",style:{flexShrink:0,overflow:"auto"},children:(0,o.jsx)(V.Z,{value:(null==i?void 0:i.sql)||"",language:"mysql",onChange:u,thoughts:(null==i?void 0:i.thoughts)||""})}),c]}),(0,o.jsx)("div",{className:"h-96 border-[var(--joy-palette-divider)] border-t border-solid overflow-auto",children:(null==s?void 0:null===(l=s.values)||void 0===l?void 0:l.length)>0?(0,o.jsxs)(r.Z,{"aria-label":"basic table",stickyHeader:!0,children:[(0,o.jsx)("thead",{children:(0,o.jsx)("tr",{children:null==s?void 0:null===(t=s.columns)||void 0===t?void 0:t.map((e,l)=>(0,o.jsx)("th",{children:e},e+l))})}),(0,o.jsx)("tbody",{children:null==s?void 0:null===(n=s.values)||void 0===n?void 0:n.map((e,l)=>{var t;return(0,o.jsx)("tr",{children:null===(t=Object.keys(e))||void 0===t?void 0:t.map(l=>(0,o.jsx)("td",{children:e[l]},l))},l)})})]}):(0,o.jsx)("div",{className:"h-full flex justify-center items-center",children:(0,o.jsx)(W.Z,{})})})]})}var K=function(){var e,l,t,r,i;let[d,s]=a.useState([]),[u,c]=a.useState(""),[v,p]=a.useState(),[h,m]=a.useState(!0),[f,b]=a.useState(),[x,y]=a.useState(),[g,w]=a.useState(),[T,S]=a.useState(),[j,Z]=a.useState(),_=(0,Y.useSearchParams)(),k=null==_?void 0:_.get("id"),z=null==_?void 0:_.get("scene"),{data:N,loading:R}=(0,n.Z)(async()=>await (0,$.Tk)("/v1/editor/sql/rounds",{con_uid:k}),{onSuccess:e=>{var l,t;let o=null==e?void 0:null===(l=e.data)||void 0===l?void 0:l[(null==e?void 0:null===(t=e.data)||void 0===t?void 0:t.length)-1];o&&p(null==o?void 0:o.round)}}),{run:C,loading:q}=(0,n.Z)(async()=>{var e,l;let t=null===(e=null==N?void 0:null===(l=N.data)||void 0===l?void 0:l.find(e=>e.round===v))||void 0===e?void 0:e.db_name;return await (0,$.PR)("/api/v1/editor/sql/run",{db_name:t,sql:null==g?void 0:g.sql})},{manual:!0,onSuccess:e=>{var l,t;S({columns:null==e?void 0:null===(l=e.data)||void 0===l?void 0:l.colunms,values:null==e?void 0:null===(t=e.data)||void 0===t?void 0:t.values})}}),{run:B,loading:W}=(0,n.Z)(async()=>{var e,l;let t=null===(e=null==N?void 0:null===(l=N.data)||void 0===l?void 0:l.find(e=>e.round===v))||void 0===e?void 0:e.db_name,o={db_name:t,sql:null==g?void 0:g.sql};return"chat_dashboard"===z&&(o.chart_type=null==g?void 0:g.showcase),await (0,$.PR)("/api/v1/editor/chart/run",o)},{manual:!0,ready:!!(null==g?void 0:g.sql),onSuccess:e=>{if(null==e?void 0:e.success){var l,t,o,a,n,r,i;S({columns:(null==e?void 0:null===(l=e.data)||void 0===l?void 0:null===(t=l.sql_data)||void 0===t?void 0:t.colunms)||[],values:(null==e?void 0:null===(o=e.data)||void 0===o?void 0:null===(a=o.sql_data)||void 0===a?void 0:a.values)||[]}),(null==e?void 0:null===(n=e.data)||void 0===n?void 0:n.chart_values)?b({type:null==e?void 0:null===(r=e.data)||void 0===r?void 0:r.chart_type,values:null==e?void 0:null===(i=e.data)||void 0===i?void 0:i.chart_values,title:null==g?void 0:g.title,description:null==g?void 0:g.thoughts}):b(void 0)}}}),{run:V,loading:J}=(0,n.Z)(async()=>{var e,l,t,o,a;let n=null===(e=null==N?void 0:null===(l=N.data)||void 0===l?void 0:l.find(e=>e.round===v))||void 0===e?void 0:e.db_name;return await (0,$.PR)("/api/v1/sql/editor/submit",{conv_uid:k,db_name:n,conv_round:v,old_sql:null==x?void 0:x.sql,old_speak:null==x?void 0:x.thoughts,new_sql:null==g?void 0:g.sql,new_speak:(null===(t=null==g?void 0:null===(o=g.thoughts)||void 0===o?void 0:o.match(/^\n--(.*)\n\n$/))||void 0===t?void 0:null===(a=t[1])||void 0===a?void 0:a.trim())||(null==g?void 0:g.thoughts)})},{manual:!0,onSuccess:e=>{(null==e?void 0:e.success)&&C()}}),{run:K,loading:G}=(0,n.Z)(async()=>{var e,l,t,o,a,n;let r=null===(e=null==N?void 0:null===(l=N.data)||void 0===l?void 0:l.find(e=>e.round===v))||void 0===e?void 0:e.db_name;return await (0,$.PR)("/api/v1/chart/editor/submit",{conv_uid:k,chart_title:null==g?void 0:g.title,db_name:r,old_sql:null==x?void 0:null===(t=x[j])||void 0===t?void 0:t.sql,new_chart_type:null==g?void 0:g.showcase,new_sql:null==g?void 0:g.sql,new_comment:(null===(o=null==g?void 0:null===(a=g.thoughts)||void 0===a?void 0:a.match(/^\n--(.*)\n\n$/))||void 0===o?void 0:null===(n=o[1])||void 0===n?void 0:n.trim())||(null==g?void 0:g.thoughts),gmt_create:new Date().getTime()})},{manual:!0,onSuccess:e=>{(null==e?void 0:e.success)&&B()}}),{data:Q}=(0,n.Z)(async()=>{var e,l;let t=null===(e=null==N?void 0:null===(l=N.data)||void 0===l?void 0:l.find(e=>e.round===v))||void 0===e?void 0:e.db_name;return await (0,$.Tk)("/v1/editor/db/tables",{db_name:t,page_index:1,page_size:200})},{ready:!!(null===(e=null==N?void 0:null===(l=N.data)||void 0===l?void 0:l.find(e=>e.round===v))||void 0===e?void 0:e.db_name),refreshDeps:[null===(t=null==N?void 0:null===(r=N.data)||void 0===r?void 0:r.find(e=>e.round===v))||void 0===t?void 0:t.db_name]}),{run:ee}=(0,n.Z)(async e=>await (0,$.Tk)("/v1/editor/sql",{con_uid:k,round:e}),{manual:!0,onSuccess:e=>{let l;try{if(Array.isArray(null==e?void 0:e.data))l=null==e?void 0:e.data,Z("0");else if("string"==typeof(null==e?void 0:e.data)){let t=JSON.parse(null==e?void 0:e.data);l=t}else l=null==e?void 0:e.data}catch(e){console.log(e)}finally{y(l),Array.isArray(l)?w(null==l?void 0:l[Number(j||0)]):w(l)}}}),el=a.useMemo(()=>{let e=(l,t)=>l.map(l=>{let a=l.title,n=a.indexOf(u),r=a.substring(0,n),i=a.slice(n+u.length),d=n>-1?(0,o.jsx)(E,{title:((null==l?void 0:l.comment)||(null==l?void 0:l.title))+((null==l?void 0:l.can_null)==="YES"?"(can null)":"(can't null)"),children:(0,o.jsxs)("span",{children:[r,(0,o.jsx)("span",{className:"text-[#1677ff]",children:u}),i,(null==l?void 0:l.type)&&(0,o.jsx)(M.ZP,{gutterBottom:!0,level:"body3",className:"pl-0.5",style:{display:"inline"},children:"[".concat(null==l?void 0:l.type,"]")})]})}):(0,o.jsx)(E,{title:((null==l?void 0:l.comment)||(null==l?void 0:l.title))+((null==l?void 0:l.can_null)==="YES"?"(can null)":"(can't null)"),children:(0,o.jsxs)("span",{children:[a,(null==l?void 0:l.type)&&(0,o.jsx)(M.ZP,{gutterBottom:!0,level:"body3",className:"pl-0.5",style:{display:"inline"},children:"[".concat(null==l?void 0:l.type,"]")})]})});if(l.children){let o=t?String(t)+"_"+l.key:l.key;return{title:a,showTitle:d,key:o,children:e(l.children,o)}}return{title:a,showTitle:d,key:l.key}});return(null==Q?void 0:Q.data)?(s([null==Q?void 0:Q.data.key]),e([null==Q?void 0:Q.data])):[]},[u,Q]),et=a.useMemo(()=>{let e=[],l=(t,o)=>{if(t&&!((null==t?void 0:t.length)<=0))for(let a=0;a{let t;for(let o=0;ol.key===e)?t=a.key:eo(e,a.children)&&(t=eo(e,a.children)))}return t};function ea(e){let l;if(!e)return{sql:"",thoughts:""};let t=e&&e.match(/(--.*)\n([\s\S]*)/),o="";return t&&t.length>=3&&(o=t[1],l=t[2]),{sql:l,thoughts:o}}return a.useEffect(()=>{v&&ee(v)},[ee,v]),a.useEffect(()=>{x&&"chat_dashboard"===z&&j&&B()},[j,z,x,B]),a.useEffect(()=>{x&&"chat_dashboard"!==z&&C()},[z,x,C]),(0,o.jsxs)("div",{className:"flex flex-col w-full h-full",children:[(0,o.jsx)(H.Z,{}),(0,o.jsxs)("div",{className:"relative flex flex-1 overflow-auto",children:[(0,o.jsxs)("div",{className:"text h-full border-[var(--joy-palette-divider)] border-r border-solid p-3 max-h-full overflow-auto",style:{width:"300px"},children:[(0,o.jsxs)("div",{className:"absolute right-4 top-2 z-10",children:[(0,o.jsx)(A.ZP,{className:"mr-2",type:"primary",loading:q||W,onClick:async()=>{"chat_dashboard"===z?B():C()},children:"Run"}),(0,o.jsx)(A.ZP,{loading:J||G,onClick:async()=>{"chat_dashboard"===z?await K():await V()},children:"Save"})]}),(0,o.jsxs)("div",{className:"flex items-center py-3",children:[(0,o.jsx)(P.Z,{className:"h-4 min-w-[240px]",size:"sm",value:v,onChange:(e,l)=>{p(l)},children:null==N?void 0:null===(i=N.data)||void 0===i?void 0:i.map(e=>(0,o.jsx)(D.Z,{value:null==e?void 0:e.round,children:null==e?void 0:e.round_name},null==e?void 0:e.round))}),(0,o.jsx)(L.Z,{className:"ml-2"})]}),(0,o.jsx)(U,{style:{marginBottom:8},placeholder:"Search",onChange:e=>{let{value:l}=e.target;if(null==Q?void 0:Q.data){if(l){let e=et.map(e=>e.title.indexOf(l)>-1?eo(e.key,el):null).filter((e,l,t)=>e&&t.indexOf(e)===l);s(e)}else s([]);c(l),m(!0)}}}),el&&el.length>0&&(0,o.jsx)(I.Z,{onExpand:e=>{s(e),m(!1)},expandedKeys:d,autoExpandParent:h,treeData:el,fieldNames:{title:"showTitle"}})]}),(0,o.jsx)("div",{className:"flex flex-col flex-1 max-w-full overflow-hidden",children:Array.isArray(x)?(0,o.jsx)(o.Fragment,{children:(0,o.jsx)(O.Z,{className:"h-full",sx:{".ant-tabs-content, .ant-tabs-tabpane-active":{height:"100%"},"& .ant-tabs-card.ant-tabs-top >.ant-tabs-nav .ant-tabs-tab, & .ant-tabs-card.ant-tabs-top >div>.ant-tabs-nav .ant-tabs-tab":{borderRadius:"0"}},children:(0,o.jsx)(F.Z,{className:"h-full dark:text-white px-2",activeKey:j,onChange:e=>{Z(e),w(null==x?void 0:x[Number(e)])},items:null==x?void 0:x.map((e,l)=>({key:l+"",label:null==e?void 0:e.title,children:(0,o.jsx)("div",{className:"flex flex-col h-full",children:(0,o.jsx)(X,{editorValue:e,handleChange:e=>{let{sql:l,thoughts:t}=ea(e);w(e=>Object.assign({},e,{sql:l,thoughts:t}))},tableData:T,chartData:f})})}))})})}):(0,o.jsx)(X,{editorValue:x,handleChange:e=>{let{sql:l,thoughts:t}=ea(e);w(e=>Object.assign({},e,{sql:l,thoughts:t}))},tableData:T,chartData:void 0})})]})]})}}}]); \ No newline at end of file diff --git a/pilot/server/static/_next/static/chunks/991-686f9d35770ecb4b.js b/pilot/server/static/_next/static/chunks/991-686f9d35770ecb4b.js deleted file mode 100644 index b0268e3dc..000000000 --- a/pilot/server/static/_next/static/chunks/991-686f9d35770ecb4b.js +++ /dev/null @@ -1,7 +0,0 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[991],{22624:function(e,r,t){"use strict";var n=t(64836);r.Z=void 0;var o=n(t(64938)),i=t(85893),a=(0,o.default)([(0,i.jsx)("circle",{cx:"15.5",cy:"9.5",r:"1.5"},"0"),(0,i.jsx)("circle",{cx:"8.5",cy:"9.5",r:"1.5"},"1"),(0,i.jsx)("circle",{cx:"15.5",cy:"9.5",r:"1.5"},"2"),(0,i.jsx)("circle",{cx:"8.5",cy:"9.5",r:"1.5"},"3"),(0,i.jsx)("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8zm0-2.5c2.33 0 4.32-1.45 5.12-3.5h-1.67c-.69 1.19-1.97 2-3.45 2s-2.75-.81-3.45-2H6.88c.8 2.05 2.79 3.5 5.12 3.5z"},"4")],"SentimentSatisfiedAlt");r.Z=a},49769:function(e,r,t){"use strict";var n=t(64836);r.Z=void 0;var o=n(t(64938)),i=t(85893),a=(0,o.default)([(0,i.jsx)("circle",{cx:"15.5",cy:"9.5",r:"1.5"},"0"),(0,i.jsx)("circle",{cx:"8.5",cy:"9.5",r:"1.5"},"1"),(0,i.jsx)("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8zm0-6c-2.33 0-4.32 1.45-5.12 3.5h1.67c.69-1.19 1.97-2 3.45-2s2.75.81 3.45 2h1.67c-.8-2.05-2.79-3.5-5.12-3.5z"},"2")],"SentimentVeryDissatisfied");r.Z=a},98034:function(e,r,t){"use strict";var n=t(64836);r.Z=void 0;var o=n(t(64938)),i=t(85893),a=(0,o.default)((0,i.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm4 14H8V8h8v8z"}),"StopCircle");r.Z=a},64938:function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"default",{enumerable:!0,get:function(){return n.createSvgIcon}});var n=t(52869)},52869:function(e,r,t){"use strict";t.r(r),t.d(r,{capitalize:function(){return o.Z},createChainedFunction:function(){return i},createSvgIcon:function(){return a.Z},debounce:function(){return l},deprecatedPropType:function(){return c},isMuiElement:function(){return s},ownerDocument:function(){return u},ownerWindow:function(){return d},requirePropFactory:function(){return p},setRef:function(){return f},unstable_ClassNameGenerator:function(){return C},unstable_useEnhancedEffect:function(){return b},unstable_useId:function(){return v},unsupportedProp:function(){return m},useControlled:function(){return g},useEventCallback:function(){return h},useForkRef:function(){return x},useIsFocusVisible:function(){return y}});var n=t(37078),o=t(98216),i=function(...e){return e.reduce((e,r)=>null==r?e:function(...t){e.apply(this,t),r.apply(this,t)},()=>{})},a=t(34678),l=t(39336).Z,c=function(e,r){return()=>null},s=t(18719).Z,u=t(82690).Z,d=t(74161).Z;t(87462);var p=function(e,r){return()=>null},f=t(7960).Z,b=t(73546).Z,v=t(92996).Z,m=function(e,r,t,n,o){return null},g=t(19032).Z,h=t(59948).Z,x=t(33703).Z,y=t(99962).Z;let C={configure:e=>{n.Z.configure(e)}}},84567:function(e,r,t){"use strict";t.d(r,{Z:function(){return C}});var n=t(94184),o=t.n(n),i=t(50132),a=t(67294),l=t(53124),c=t(98866),s=t(65223);let u=a.createContext(null);var d=t(63185),p=t(45353),f=t(17415),b=function(e,r){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>r.indexOf(n)&&(t[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,n=Object.getOwnPropertySymbols(e);or.indexOf(n[o])&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(t[n[o]]=e[n[o]]);return t};let v=a.forwardRef((e,r)=>{var t;let{prefixCls:n,className:v,rootClassName:m,children:g,indeterminate:h=!1,style:x,onMouseEnter:y,onMouseLeave:C,skipGroup:$=!1,disabled:k}=e,S=b(e,["prefixCls","className","rootClassName","children","indeterminate","style","onMouseEnter","onMouseLeave","skipGroup","disabled"]),{getPrefixCls:O,direction:j,checkbox:w}=a.useContext(l.E_),Z=a.useContext(u),{isFormItemInput:E}=a.useContext(s.aM),P=a.useContext(c.Z),z=null!==(t=(null==Z?void 0:Z.disabled)||k)&&void 0!==t?t:P,I=a.useRef(S.value);a.useEffect(()=>{null==Z||Z.registerValue(S.value)},[]),a.useEffect(()=>{if(!$)return S.value!==I.current&&(null==Z||Z.cancelValue(I.current),null==Z||Z.registerValue(S.value),I.current=S.value),()=>null==Z?void 0:Z.cancelValue(S.value)},[S.value]);let M=O("checkbox",n),[_,N]=(0,d.ZP)(M),D=Object.assign({},S);Z&&!$&&(D.onChange=function(){S.onChange&&S.onChange.apply(S,arguments),Z.toggleOption&&Z.toggleOption({label:g,value:S.value})},D.name=Z.name,D.checked=Z.value.includes(S.value));let B=o()(`${M}-wrapper`,{[`${M}-rtl`]:"rtl"===j,[`${M}-wrapper-checked`]:D.checked,[`${M}-wrapper-disabled`]:z,[`${M}-wrapper-in-form-item`]:E},null==w?void 0:w.className,v,m,N),V=o()({[`${M}-indeterminate`]:h},f.A,N);return _(a.createElement(p.Z,{component:"Checkbox",disabled:z},a.createElement("label",{className:B,style:Object.assign(Object.assign({},null==w?void 0:w.style),x),onMouseEnter:y,onMouseLeave:C},a.createElement(i.Z,Object.assign({"aria-checked":h?"mixed":void 0},D,{prefixCls:M,className:V,disabled:z,ref:r})),void 0!==g&&a.createElement("span",null,g))))});var m=t(74902),g=t(98423),h=function(e,r){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>r.indexOf(n)&&(t[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,n=Object.getOwnPropertySymbols(e);or.indexOf(n[o])&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(t[n[o]]=e[n[o]]);return t};let x=a.forwardRef((e,r)=>{let{defaultValue:t,children:n,options:i=[],prefixCls:c,className:s,rootClassName:p,style:f,onChange:b}=e,x=h(e,["defaultValue","children","options","prefixCls","className","rootClassName","style","onChange"]),{getPrefixCls:y,direction:C}=a.useContext(l.E_),[$,k]=a.useState(x.value||t||[]),[S,O]=a.useState([]);a.useEffect(()=>{"value"in x&&k(x.value||[])},[x.value]);let j=a.useMemo(()=>i.map(e=>"string"==typeof e||"number"==typeof e?{label:e,value:e}:e),[i]),w=y("checkbox",c),Z=`${w}-group`,[E,P]=(0,d.ZP)(w),z=(0,g.Z)(x,["value","disabled"]),I=i.length?j.map(e=>a.createElement(v,{prefixCls:w,key:e.value.toString(),disabled:"disabled"in e?e.disabled:x.disabled,value:e.value,checked:$.includes(e.value),onChange:e.onChange,className:`${Z}-item`,style:e.style,title:e.title},e.label)):n,M={toggleOption:e=>{let r=$.indexOf(e.value),t=(0,m.Z)($);-1===r?t.push(e.value):t.splice(r,1),"value"in x||k(t),null==b||b(t.filter(e=>S.includes(e)).sort((e,r)=>{let t=j.findIndex(r=>r.value===e),n=j.findIndex(e=>e.value===r);return t-n}))},value:$,disabled:x.disabled,name:x.name,registerValue:e=>{O(r=>[].concat((0,m.Z)(r),[e]))},cancelValue:e=>{O(r=>r.filter(r=>r!==e))}},_=o()(Z,{[`${Z}-rtl`]:"rtl"===C},s,p,P);return E(a.createElement("div",Object.assign({className:_,style:f},z,{ref:r}),a.createElement(u.Provider,{value:M},I)))});var y=a.memo(x);v.Group=y,v.__ANT_CHECKBOX=!0;var C=v},63185:function(e,r,t){"use strict";t.d(r,{C2:function(){return l}});var n=t(14747),o=t(45503),i=t(67968);let a=e=>{let{checkboxCls:r}=e,t=`${r}-wrapper`;return[{[`${r}-group`]:Object.assign(Object.assign({},(0,n.Wf)(e)),{display:"inline-flex",flexWrap:"wrap",columnGap:e.marginXS,[`> ${e.antCls}-row`]:{flex:1}}),[t]:Object.assign(Object.assign({},(0,n.Wf)(e)),{display:"inline-flex",alignItems:"baseline",cursor:"pointer","&:after":{display:"inline-block",width:0,overflow:"hidden",content:"'\\a0'"},[`& + ${t}`]:{marginInlineStart:0},[`&${t}-in-form-item`]:{'input[type="checkbox"]':{width:14,height:14}}}),[r]:Object.assign(Object.assign({},(0,n.Wf)(e)),{position:"relative",whiteSpace:"nowrap",lineHeight:1,cursor:"pointer",borderRadius:e.borderRadiusSM,alignSelf:"center",[`${r}-input`]:{position:"absolute",inset:0,zIndex:1,cursor:"pointer",opacity:0,margin:0,[`&:focus-visible + ${r}-inner`]:Object.assign({},(0,n.oN)(e))},[`${r}-inner`]:{boxSizing:"border-box",position:"relative",top:0,insetInlineStart:0,display:"block",width:e.checkboxSize,height:e.checkboxSize,direction:"ltr",backgroundColor:e.colorBgContainer,border:`${e.lineWidth}px ${e.lineType} ${e.colorBorder}`,borderRadius:e.borderRadiusSM,borderCollapse:"separate",transition:`all ${e.motionDurationSlow}`,"&:after":{boxSizing:"border-box",position:"absolute",top:"50%",insetInlineStart:"21.5%",display:"table",width:e.checkboxSize/14*5,height:e.checkboxSize/14*8,border:`${e.lineWidthBold}px solid ${e.colorWhite}`,borderTop:0,borderInlineStart:0,transform:"rotate(45deg) scale(0) translate(-50%,-50%)",opacity:0,content:'""',transition:`all ${e.motionDurationFast} ${e.motionEaseInBack}, opacity ${e.motionDurationFast}`}},"& + span":{paddingInlineStart:e.paddingXS,paddingInlineEnd:e.paddingXS}})},{[` - ${t}:not(${t}-disabled), - ${r}:not(${r}-disabled) - `]:{[`&:hover ${r}-inner`]:{borderColor:e.colorPrimary}},[`${t}:not(${t}-disabled)`]:{[`&:hover ${r}-checked:not(${r}-disabled) ${r}-inner`]:{backgroundColor:e.colorPrimaryHover,borderColor:"transparent"},[`&:hover ${r}-checked:not(${r}-disabled):after`]:{borderColor:e.colorPrimaryHover}}},{[`${r}-checked`]:{[`${r}-inner`]:{backgroundColor:e.colorPrimary,borderColor:e.colorPrimary,"&:after":{opacity:1,transform:"rotate(45deg) scale(1) translate(-50%,-50%)",transition:`all ${e.motionDurationMid} ${e.motionEaseOutBack} ${e.motionDurationFast}`}}},[` - ${t}-checked:not(${t}-disabled), - ${r}-checked:not(${r}-disabled) - `]:{[`&:hover ${r}-inner`]:{backgroundColor:e.colorPrimaryHover,borderColor:"transparent"}}},{[r]:{"&-indeterminate":{[`${r}-inner`]:{backgroundColor:e.colorBgContainer,borderColor:e.colorBorder,"&:after":{top:"50%",insetInlineStart:"50%",width:e.fontSizeLG/2,height:e.fontSizeLG/2,backgroundColor:e.colorPrimary,border:0,transform:"translate(-50%, -50%) scale(1)",opacity:1,content:'""'}}}}},{[`${t}-disabled`]:{cursor:"not-allowed"},[`${r}-disabled`]:{[`&, ${r}-input`]:{cursor:"not-allowed",pointerEvents:"none"},[`${r}-inner`]:{background:e.colorBgContainerDisabled,borderColor:e.colorBorder,"&:after":{borderColor:e.colorTextDisabled}},"&:after":{display:"none"},"& + span":{color:e.colorTextDisabled},[`&${r}-indeterminate ${r}-inner::after`]:{background:e.colorTextDisabled}}}]};function l(e,r){let t=(0,o.TS)(r,{checkboxCls:`.${e}`,checkboxSize:r.controlInteractiveSize});return[a(t)]}r.ZP=(0,i.Z)("Checkbox",(e,r)=>{let{prefixCls:t}=r;return[l(t,e)]})},64836:function(e){e.exports=function(e){return e&&e.__esModule?e:{default:e}},e.exports.__esModule=!0,e.exports.default=e.exports}}]); \ No newline at end of file diff --git a/pilot/server/static/_next/static/chunks/pages/_app-afd04641bd65e851.js b/pilot/server/static/_next/static/chunks/pages/_app-0e8330de38c03c5c.js similarity index 90% rename from pilot/server/static/_next/static/chunks/pages/_app-afd04641bd65e851.js rename to pilot/server/static/_next/static/chunks/pages/_app-0e8330de38c03c5c.js index 16465f530..91bf341c4 100644 --- a/pilot/server/static/_next/static/chunks/pages/_app-afd04641bd65e851.js +++ b/pilot/server/static/_next/static/chunks/pages/_app-0e8330de38c03c5c.js @@ -134,7 +134,7 @@ * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var n="function"==typeof Symbol&&Symbol.for,r=n?Symbol.for("react.element"):60103,o=n?Symbol.for("react.portal"):60106,i=n?Symbol.for("react.fragment"):60107,a=n?Symbol.for("react.strict_mode"):60108,l=n?Symbol.for("react.profiler"):60114,s=n?Symbol.for("react.provider"):60109,c=n?Symbol.for("react.context"):60110,u=n?Symbol.for("react.async_mode"):60111,f=n?Symbol.for("react.concurrent_mode"):60111,d=n?Symbol.for("react.forward_ref"):60112,p=n?Symbol.for("react.suspense"):60113,h=n?Symbol.for("react.suspense_list"):60120,m=n?Symbol.for("react.memo"):60115,g=n?Symbol.for("react.lazy"):60116,v=n?Symbol.for("react.block"):60121,y=n?Symbol.for("react.fundamental"):60117,b=n?Symbol.for("react.responder"):60118,x=n?Symbol.for("react.scope"):60119;function w(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case u:case f:case i:case l:case a:case p:return e;default:switch(e=e&&e.$$typeof){case c:case d:case g:case m:case s:return e;default:return t}}case o:return t}}}function C(e){return w(e)===f}t.AsyncMode=u,t.ConcurrentMode=f,t.ContextConsumer=c,t.ContextProvider=s,t.Element=r,t.ForwardRef=d,t.Fragment=i,t.Lazy=g,t.Memo=m,t.Portal=o,t.Profiler=l,t.StrictMode=a,t.Suspense=p,t.isAsyncMode=function(e){return C(e)||w(e)===u},t.isConcurrentMode=C,t.isContextConsumer=function(e){return w(e)===c},t.isContextProvider=function(e){return w(e)===s},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return w(e)===d},t.isFragment=function(e){return w(e)===i},t.isLazy=function(e){return w(e)===g},t.isMemo=function(e){return w(e)===m},t.isPortal=function(e){return w(e)===o},t.isProfiler=function(e){return w(e)===l},t.isStrictMode=function(e){return w(e)===a},t.isSuspense=function(e){return w(e)===p},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===f||e===l||e===a||e===p||e===h||"object"==typeof e&&null!==e&&(e.$$typeof===g||e.$$typeof===m||e.$$typeof===s||e.$$typeof===c||e.$$typeof===d||e.$$typeof===y||e.$$typeof===b||e.$$typeof===x||e.$$typeof===v)},t.typeOf=w},21296:function(e,t,n){"use strict";e.exports=n(96103)},62705:function(e,t,n){var r=n(55639).Symbol;e.exports=r},44239:function(e,t,n){var r=n(62705),o=n(89607),i=n(2333),a=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":a&&a in Object(e)?o(e):i(e)}},27561:function(e,t,n){var r=n(67990),o=/^\s+/;e.exports=function(e){return e?e.slice(0,r(e)+1).replace(o,""):e}},31957:function(e,t,n){var r="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;e.exports=r},89607:function(e,t,n){var r=n(62705),o=Object.prototype,i=o.hasOwnProperty,a=o.toString,l=r?r.toStringTag:void 0;e.exports=function(e){var t=i.call(e,l),n=e[l];try{e[l]=void 0;var r=!0}catch(e){}var o=a.call(e);return r&&(t?e[l]=n:delete e[l]),o}},2333:function(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},55639:function(e,t,n){var r=n(31957),o="object"==typeof self&&self&&self.Object===Object&&self,i=r||o||Function("return this")();e.exports=i},67990:function(e){var t=/\s/;e.exports=function(e){for(var n=e.length;n--&&t.test(e.charAt(n)););return n}},23279:function(e,t,n){var r=n(13218),o=n(7771),i=n(14841),a=Math.max,l=Math.min;e.exports=function(e,t,n){var s,c,u,f,d,p,h=0,m=!1,g=!1,v=!0;if("function"!=typeof e)throw TypeError("Expected a function");function y(t){var n=s,r=c;return s=c=void 0,h=t,f=e.apply(r,n)}function b(e){var n=e-p,r=e-h;return void 0===p||n>=t||n<0||g&&r>=u}function x(){var e,n,r,i=o();if(b(i))return w(i);d=setTimeout(x,(e=i-p,n=i-h,r=t-e,g?l(r,u-n):r))}function w(e){return(d=void 0,v&&s)?y(e):(s=c=void 0,f)}function C(){var e,n=o(),r=b(n);if(s=arguments,c=this,p=n,r){if(void 0===d)return h=e=p,d=setTimeout(x,t),m?y(e):f;if(g)return clearTimeout(d),d=setTimeout(x,t),y(p)}return void 0===d&&(d=setTimeout(x,t)),f}return t=i(t)||0,r(n)&&(m=!!n.leading,u=(g="maxWait"in n)?a(i(n.maxWait)||0,t):u,v="trailing"in n?!!n.trailing:v),C.cancel=function(){void 0!==d&&clearTimeout(d),h=0,s=p=c=d=void 0},C.flush=function(){return void 0===d?f:w(o())},C}},13218:function(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},37005:function(e){e.exports=function(e){return null!=e&&"object"==typeof e}},33448:function(e,t,n){var r=n(44239),o=n(37005);e.exports=function(e){return"symbol"==typeof e||o(e)&&"[object Symbol]"==r(e)}},7771:function(e,t,n){var r=n(55639);e.exports=function(){return r.Date.now()}},23493:function(e,t,n){var r=n(23279),o=n(13218);e.exports=function(e,t,n){var i=!0,a=!0;if("function"!=typeof e)throw TypeError("Expected a function");return o(n)&&(i="leading"in n?!!n.leading:i,a="trailing"in n?!!n.trailing:a),r(e,t,{leading:i,maxWait:t,trailing:a})}},14841:function(e,t,n){var r=n(27561),o=n(13218),i=n(33448),a=0/0,l=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,c=/^0o[0-7]+$/i,u=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(i(e))return a;if(o(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=o(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var n=s.test(e);return n||c.test(e)?u(e.slice(2),n?2:8):l.test(e)?a:+e}},83454:function(e,t,n){"use strict";var r,o;e.exports=(null==(r=n.g.process)?void 0:r.env)&&"object"==typeof(null==(o=n.g.process)?void 0:o.env)?n.g.process:n(77663)},6840:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/_app",function(){return n(91268)}])},41468:function(e,t,n){"use strict";n.d(t,{R:function(){return c},p:function(){return s}});var r=n(85893),o=n(67294),i=n(50489),a=n(577),l=n(39332);let s=(0,o.createContext)({scene:"",chatId:"",modelList:[],model:"",dbParam:void 0,dialogueList:[],agentList:[],setAgentList:()=>{},setModel:()=>{},setIsContract:()=>{},setIsMenuExpand:()=>{},setDbParam:()=>void 0,queryDialogueList:()=>{},refreshDialogList:()=>{}}),c=e=>{var t,n,c;let{children:u}=e,f=(0,l.useSearchParams)(),d=null!==(t=null==f?void 0:f.get("id"))&&void 0!==t?t:"",p=null!==(n=null==f?void 0:f.get("scene"))&&void 0!==n?n:"",h=null!==(c=null==f?void 0:f.get("db_param"))&&void 0!==c?c:"",[m,g]=(0,o.useState)(!1),[v,y]=(0,o.useState)(""),[b,x]=(0,o.useState)("chat_dashboard"!==p),[w,C]=(0,o.useState)(h),[E,S]=(0,o.useState)([]),{run:$,data:O=[],refresh:k}=(0,a.Z)(async()=>{let[,e]=await (0,i.Vx)((0,i.iP)());return null!=e?e:[]},{manual:!0}),{data:Z=[]}=(0,a.Z)(async()=>{let[,e]=await (0,i.Vx)((0,i.Vw)());return null!=e?e:[]});(0,o.useEffect)(()=>{y(Z[0])},[Z,null==Z?void 0:Z.length]);let P=(0,o.useMemo)(()=>O.find(e=>e.conv_uid===d),[d,O]);return(0,r.jsx)(s.Provider,{value:{isContract:m,isMenuExpand:b,scene:p,chatId:d,modelList:Z,model:v,dbParam:w||h,dialogueList:O,agentList:E,setAgentList:S,setModel:y,setIsContract:g,setIsMenuExpand:x,setDbParam:C,queryDialogueList:$,refreshDialogList:k,currentDialogue:P},children:u})}},58989:function(e,t,n){"use strict";n.d(t,{Z:function(){return D}});let r={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console&&console[e]&&console[e].apply(console,t)}};class o{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.init(e,t)}init(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||r,this.options=t,this.debug=t.debug}log(){for(var e=arguments.length,t=Array(e),n=0;n{this.observers[e]=this.observers[e]||[],this.observers[e].push(t)}),this}off(e,t){if(this.observers[e]){if(!t){delete this.observers[e];return}this.observers[e]=this.observers[e].filter(e=>e!==t)}}emit(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r{e(...n)})}if(this.observers["*"]){let t=[].concat(this.observers["*"]);t.forEach(t=>{t.apply(t,[e,...n])})}}}function l(){let e,t;let n=new Promise((n,r)=>{e=n,t=r});return n.resolve=e,n.reject=t,n}function s(e){return null==e?"":""+e}function c(e,t,n){function r(e){return e&&e.indexOf("###")>-1?e.replace(/###/g,"."):e}function o(){return!e||"string"==typeof e}let i="string"!=typeof t?[].concat(t):t.split(".");for(;i.length>1;){if(o())return{};let t=r(i.shift());!e[t]&&n&&(e[t]=new n),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{}}return o()?{}:{obj:e,k:r(i.shift())}}function u(e,t,n){let{obj:r,k:o}=c(e,t,Object);r[o]=n}function f(e,t){let{obj:n,k:r}=c(e,t);if(n)return n[r]}function d(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var p={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function h(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,e=>p[e]):e}let m=[" ",",","?","!",";"];function g(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".";if(!e)return;if(e[t])return e[t];let r=t.split(n),o=e;for(let e=0;ee+i;)i++,l=o[a=r.slice(e,e+i).join(n)];if(void 0===l)return;if(null===l)return null;if(t.endsWith(a)){if("string"==typeof l)return l;if(a&&"string"==typeof l[a])return l[a]}let s=r.slice(e+i).join(n);if(s)return g(l,s,n);return}o=o[r[e]]}return o}function v(e){return e&&e.indexOf("_")>0?e.replace("_","-"):e}class y extends a{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=e||{},this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),void 0===this.options.ignoreJSONStructure&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){0>this.options.ns.indexOf(e)&&this.options.ns.push(e)}removeNamespaces(e){let t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,i=void 0!==r.ignoreJSONStructure?r.ignoreJSONStructure:this.options.ignoreJSONStructure,a=[e,t];n&&"string"!=typeof n&&(a=a.concat(n)),n&&"string"==typeof n&&(a=a.concat(o?n.split(o):n)),e.indexOf(".")>-1&&(a=e.split("."));let l=f(this.data,a);return l||!i||"string"!=typeof n?l:g(this.data&&this.data[e]&&this.data[e][t],n,o)}addResource(e,t,n,r){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},i=void 0!==o.keySeparator?o.keySeparator:this.options.keySeparator,a=[e,t];n&&(a=a.concat(i?n.split(i):n)),e.indexOf(".")>-1&&(a=e.split("."),r=t,t=a[1]),this.addNamespaces(t),u(this.data,a,r),o.silent||this.emit("added",e,t,n,r)}addResources(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(let r in n)("string"==typeof n[r]||"[object Array]"===Object.prototype.toString.apply(n[r]))&&this.addResource(e,t,r,n[r],{silent:!0});r.silent||this.emit("added",e,t,n)}addResourceBundle(e,t,n,r,o){let i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},a=[e,t];e.indexOf(".")>-1&&(a=e.split("."),r=n,n=t,t=a[1]),this.addNamespaces(t);let l=f(this.data,a)||{};r?function e(t,n,r){for(let o in n)"__proto__"!==o&&"constructor"!==o&&(o in t?"string"==typeof t[o]||t[o]instanceof String||"string"==typeof n[o]||n[o]instanceof String?r&&(t[o]=n[o]):e(t[o],n[o],r):t[o]=n[o]);return t}(l,n,o):l={...l,...n},u(this.data,a,l),i.silent||this.emit("added",e,t,n)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return void 0!==this.getResource(e,t)}getResourceBundle(e,t){return(t||(t=this.options.defaultNS),"v1"===this.options.compatibilityAPI)?{...this.getResource(e,t)}:this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){let t=this.getDataByLanguage(e),n=t&&Object.keys(t)||[];return!!n.find(e=>t[e]&&Object.keys(t[e]).length>0)}toJSON(){return this.data}}var b={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,o){return e.forEach(e=>{this.processors[e]&&(t=this.processors[e].process(t,n,r,o))}),t}};let x={};class w extends a{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(),function(e,t,n){e.forEach(e=>{t[e]&&(n[e]=t[e])})}(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=i.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};if(null==e)return!1;let n=this.resolve(e,t);return n&&void 0!==n.res}extractFromKey(e,t){let n=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");let r=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,o=t.ns||this.options.defaultNS||[],i=n&&e.indexOf(n)>-1,a=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!function(e,t,n){t=t||"",n=n||"";let r=m.filter(e=>0>t.indexOf(e)&&0>n.indexOf(e));if(0===r.length)return!0;let o=RegExp(`(${r.map(e=>"?"===e?"\\?":e).join("|")})`),i=!o.test(e);if(!i){let t=e.indexOf(n);t>0&&!o.test(e.substring(0,t))&&(i=!0)}return i}(e,n,r);if(i&&!a){let t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:o};let i=e.split(n);(n!==r||n===r&&this.options.ns.indexOf(i[0])>-1)&&(o=i.shift()),e=i.join(r)}return"string"==typeof o&&(o=[o]),{key:e,namespaces:o}}translate(e,t,n){if("object"!=typeof t&&this.options.overloadTranslationOptionHandler&&(t=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof t&&(t={...t}),t||(t={}),null==e)return"";Array.isArray(e)||(e=[String(e)]);let r=void 0!==t.returnDetails?t.returnDetails:this.options.returnDetails,o=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,{key:i,namespaces:a}=this.extractFromKey(e[e.length-1],t),l=a[a.length-1],s=t.lng||this.language,c=t.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(s&&"cimode"===s.toLowerCase()){if(c){let e=t.nsSeparator||this.options.nsSeparator;return r?{res:`${l}${e}${i}`,usedKey:i,exactUsedKey:i,usedLng:s,usedNS:l}:`${l}${e}${i}`}return r?{res:i,usedKey:i,exactUsedKey:i,usedLng:s,usedNS:l}:i}let u=this.resolve(e,t),f=u&&u.res,d=u&&u.usedKey||i,p=u&&u.exactUsedKey||i,h=Object.prototype.toString.apply(f),m=void 0!==t.joinArrays?t.joinArrays:this.options.joinArrays,g=!this.i18nFormat||this.i18nFormat.handleAsObject,v="string"!=typeof f&&"boolean"!=typeof f&&"number"!=typeof f;if(g&&f&&v&&0>["[object Number]","[object Function]","[object RegExp]"].indexOf(h)&&!("string"==typeof m&&"[object Array]"===h)){if(!t.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");let e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(d,f,{...t,ns:a}):`key '${i} (${this.language})' returned an object instead of string.`;return r?(u.res=e,u):e}if(o){let e="[object Array]"===h,n=e?[]:{},r=e?p:d;for(let e in f)if(Object.prototype.hasOwnProperty.call(f,e)){let i=`${r}${o}${e}`;n[e]=this.translate(i,{...t,joinArrays:!1,ns:a}),n[e]===i&&(n[e]=f[e])}f=n}}else if(g&&"string"==typeof m&&"[object Array]"===h)(f=f.join(m))&&(f=this.extendTranslation(f,e,t,n));else{let r=!1,a=!1,c=void 0!==t.count&&"string"!=typeof t.count,d=w.hasDefaultValue(t),p=c?this.pluralResolver.getSuffix(s,t.count,t):"",h=t.ordinal&&c?this.pluralResolver.getSuffix(s,t.count,{ordinal:!1}):"",m=t[`defaultValue${p}`]||t[`defaultValue${h}`]||t.defaultValue;!this.isValidLookup(f)&&d&&(r=!0,f=m),this.isValidLookup(f)||(a=!0,f=i);let g=t.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,v=g&&a?void 0:f,y=d&&m!==f&&this.options.updateMissing;if(a||r||y){if(this.logger.log(y?"updateKey":"missingKey",s,l,i,y?m:f),o){let e=this.resolve(i,{...t,keySeparator:!1});e&&e.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let e=[],n=this.languageUtils.getFallbackCodes(this.options.fallbackLng,t.lng||this.language);if("fallback"===this.options.saveMissingTo&&n&&n[0])for(let t=0;t{let o=d&&r!==f?r:v;this.options.missingKeyHandler?this.options.missingKeyHandler(e,l,n,o,y,t):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(e,l,n,o,y,t),this.emit("missingKey",e,l,n,f)};this.options.saveMissing&&(this.options.saveMissingPlurals&&c?e.forEach(e=>{this.pluralResolver.getSuffixes(e,t).forEach(n=>{r([e],i+n,t[`defaultValue${n}`]||m)})}):r(e,i,m))}f=this.extendTranslation(f,e,t,u,n),a&&f===i&&this.options.appendNamespaceToMissingKey&&(f=`${l}:${i}`),(a||r)&&this.options.parseMissingKeyHandler&&(f="v1"!==this.options.compatibilityAPI?this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}:${i}`:i,r?f:void 0):this.options.parseMissingKeyHandler(f))}return r?(u.res=f,u):f}extendTranslation(e,t,n,r,o){var i=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){let a;n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});let l="string"==typeof e&&(n&&n.interpolation&&void 0!==n.interpolation.skipOnVariables?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);if(l){let t=e.match(this.interpolator.nestingRegexp);a=t&&t.length}let s=n.replace&&"string"!=typeof n.replace?n.replace:n;if(this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),e=this.interpolator.interpolate(e,s,n.lng||this.language,n),l){let t=e.match(this.interpolator.nestingRegexp),r=t&&t.length;a1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof e&&(e=[e]),e.forEach(e=>{if(this.isValidLookup(t))return;let l=this.extractFromKey(e,a),s=l.key;n=s;let c=l.namespaces;this.options.fallbackNS&&(c=c.concat(this.options.fallbackNS));let u=void 0!==a.count&&"string"!=typeof a.count,f=u&&!a.ordinal&&0===a.count&&this.pluralResolver.shouldUseIntlApi(),d=void 0!==a.context&&("string"==typeof a.context||"number"==typeof a.context)&&""!==a.context,p=a.lngs?a.lngs:this.languageUtils.toResolveHierarchy(a.lng||this.language,a.fallbackLng);c.forEach(e=>{this.isValidLookup(t)||(i=e,!x[`${p[0]}-${e}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(i)&&(x[`${p[0]}-${e}`]=!0,this.logger.warn(`key "${n}" for languages "${p.join(", ")}" won't get resolved as namespace "${i}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),p.forEach(n=>{let i;if(this.isValidLookup(t))return;o=n;let l=[s];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(l,s,n,e,a);else{let e;u&&(e=this.pluralResolver.getSuffix(n,a.count,a));let t=`${this.options.pluralSeparator}zero`,r=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(u&&(l.push(s+e),a.ordinal&&0===e.indexOf(r)&&l.push(s+e.replace(r,this.options.pluralSeparator)),f&&l.push(s+t)),d){let n=`${s}${this.options.contextSeparator}${a.context}`;l.push(n),u&&(l.push(n+e),a.ordinal&&0===e.indexOf(r)&&l.push(n+e.replace(r,this.options.pluralSeparator)),f&&l.push(n+t))}}for(;i=l.pop();)this.isValidLookup(t)||(r=i,t=this.getResource(n,e,i,a))}))})}),{res:t,usedKey:n,exactUsedKey:r,usedLng:o,usedNS:i}}isValidLookup(e){return void 0!==e&&!(!this.options.returnNull&&null===e)&&!(!this.options.returnEmptyString&&""===e)}getResource(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}static hasDefaultValue(e){let t="defaultValue";for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t===n.substring(0,t.length)&&void 0!==e[n])return!0;return!1}}function C(e){return e.charAt(0).toUpperCase()+e.slice(1)}class E{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=i.create("languageUtils")}getScriptPartFromCode(e){if(!(e=v(e))||0>e.indexOf("-"))return null;let t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase())?null:this.formatLanguageCode(t.join("-"))}getLanguagePartFromCode(e){if(!(e=v(e))||0>e.indexOf("-"))return e;let t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if("string"==typeof e&&e.indexOf("-")>-1){let t=["hans","hant","latn","cyrl","cans","mong","arab"],n=e.split("-");return this.options.lowerCaseLng?n=n.map(e=>e.toLowerCase()):2===n.length?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=C(n[1].toLowerCase()))):3===n.length&&(n[0]=n[0].toLowerCase(),2===n[1].length&&(n[1]=n[1].toUpperCase()),"sgn"!==n[0]&&2===n[2].length&&(n[2]=n[2].toUpperCase()),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=C(n[1].toLowerCase())),t.indexOf(n[2].toLowerCase())>-1&&(n[2]=C(n[2].toLowerCase()))),n.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){let t;return e?(e.forEach(e=>{if(t)return;let n=this.formatLanguageCode(e);(!this.options.supportedLngs||this.isSupportedCode(n))&&(t=n)}),!t&&this.options.supportedLngs&&e.forEach(e=>{if(t)return;let n=this.getLanguagePartFromCode(e);if(this.isSupportedCode(n))return t=n;t=this.options.supportedLngs.find(e=>{if(e===n||!(0>e.indexOf("-")&&0>n.indexOf("-"))&&0===e.indexOf(n))return e})}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t):null}getFallbackCodes(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),"string"==typeof e&&(e=[e]),"[object Array]"===Object.prototype.toString.apply(e))return e;if(!t)return e.default||[];let n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}toResolveHierarchy(e,t){let n=this.getFallbackCodes(t||this.options.fallbackLng||[],e),r=[],o=e=>{e&&(this.isSupportedCode(e)?r.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return"string"==typeof e&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?("languageOnly"!==this.options.load&&o(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&o(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&o(this.getLanguagePartFromCode(e))):"string"==typeof e&&o(this.formatLanguageCode(e)),n.forEach(e=>{0>r.indexOf(e)&&o(this.formatLanguageCode(e))}),r}}let S=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],$={1:function(e){return Number(e>1)},2:function(e){return Number(1!=e)},3:function(e){return 0},4:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},5:function(e){return Number(0==e?0:1==e?1:2==e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5)},6:function(e){return Number(1==e?0:e>=2&&e<=4?1:2)},7:function(e){return Number(1==e?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},8:function(e){return Number(1==e?0:2==e?1:8!=e&&11!=e?2:3)},9:function(e){return Number(e>=2)},10:function(e){return Number(1==e?0:2==e?1:e<7?2:e<11?3:4)},11:function(e){return Number(1==e||11==e?0:2==e||12==e?1:e>2&&e<20?2:3)},12:function(e){return Number(e%10!=1||e%100==11)},13:function(e){return Number(0!==e)},14:function(e){return Number(1==e?0:2==e?1:3==e?2:3)},15:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2)},16:function(e){return Number(e%10==1&&e%100!=11?0:0!==e?1:2)},17:function(e){return Number(1==e||e%10==1&&e%100!=11?0:1)},18:function(e){return Number(0==e?0:1==e?1:2)},19:function(e){return Number(1==e?0:0==e||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3)},20:function(e){return Number(1==e?0:0==e||e%100>0&&e%100<20?1:2)},21:function(e){return Number(e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0)},22:function(e){return Number(1==e?0:2==e?1:(e<0||e>10)&&e%10==0?2:3)}},O=["v1","v2","v3"],k=["v4"],Z={zero:0,one:1,two:2,few:3,many:4,other:5};class P{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.languageUtils=e,this.options=t,this.logger=i.create("pluralResolver"),(!this.options.compatibilityJSON||k.includes(this.options.compatibilityJSON))&&("undefined"==typeof Intl||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=function(){let e={};return S.forEach(t=>{t.lngs.forEach(n=>{e[n]={numbers:t.nr,plurals:$[t.fc]}})}),e}()}addRule(e,t){this.rules[e]=t}getRule(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(v(e),{type:t.ordinal?"ordinal":"cardinal"})}catch{return}return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}needsPlural(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.getRule(e,t);return this.shouldUseIntlApi()?n&&n.resolvedOptions().pluralCategories.length>1:n&&n.numbers.length>1}getPluralFormsOfKey(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.getSuffixes(e,n).map(e=>`${t}${e}`)}getSuffixes(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.getRule(e,t);return n?this.shouldUseIntlApi()?n.resolvedOptions().pluralCategories.sort((e,t)=>Z[e]-Z[t]).map(e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${e}`):n.numbers.map(n=>this.getSuffix(e,n,t)):[]}getSuffix(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.getRule(e,n);return r?this.shouldUseIntlApi()?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${r.select(t)}`:this.getSuffixRetroCompatible(r,t):(this.logger.warn(`no plural rule found for: ${e}`),"")}getSuffixRetroCompatible(e,t){let n=e.noAbs?e.plurals(t):e.plurals(Math.abs(t)),r=e.numbers[n];this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]&&(2===r?r="plural":1===r&&(r=""));let o=()=>this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString();return"v1"===this.options.compatibilityJSON?1===r?"":"number"==typeof r?`_plural_${r.toString()}`:o():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]?o():this.options.prepend&&n.toString()?this.options.prepend+n.toString():n.toString()}shouldUseIntlApi(){return!O.includes(this.options.compatibilityJSON)}}function j(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:".",o=!(arguments.length>4)||void 0===arguments[4]||arguments[4],i=function(e,t,n){let r=f(e,n);return void 0!==r?r:f(t,n)}(e,t,n);return!i&&o&&"string"==typeof n&&void 0===(i=g(e,n,r))&&(i=g(t,n,r)),i}class _{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.logger=i.create("interpolator"),this.options=e,this.format=e.interpolation&&e.interpolation.format||(e=>e),this.init(e)}init(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});let t=e.interpolation;this.escape=void 0!==t.escape?t.escape:h,this.escapeValue=void 0===t.escapeValue||t.escapeValue,this.useRawValueToEscape=void 0!==t.useRawValueToEscape&&t.useRawValueToEscape,this.prefix=t.prefix?d(t.prefix):t.prefixEscaped||"{{",this.suffix=t.suffix?d(t.suffix):t.suffixEscaped||"}}",this.formatSeparator=t.formatSeparator?t.formatSeparator:t.formatSeparator||",",this.unescapePrefix=t.unescapeSuffix?"":t.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":t.unescapeSuffix||"",this.nestingPrefix=t.nestingPrefix?d(t.nestingPrefix):t.nestingPrefixEscaped||d("$t("),this.nestingSuffix=t.nestingSuffix?d(t.nestingSuffix):t.nestingSuffixEscaped||d(")"),this.nestingOptionsSeparator=t.nestingOptionsSeparator?t.nestingOptionsSeparator:t.nestingOptionsSeparator||",",this.maxReplaces=t.maxReplaces?t.maxReplaces:1e3,this.alwaysFormat=void 0!==t.alwaysFormat&&t.alwaysFormat,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){let e=`${this.prefix}(.+?)${this.suffix}`;this.regexp=RegExp(e,"g");let t=`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`;this.regexpUnescape=RegExp(t,"g");let n=`${this.nestingPrefix}(.+?)${this.nestingSuffix}`;this.nestingRegexp=RegExp(n,"g")}interpolate(e,t,n,r){let o,i,a;let l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function c(e){return e.replace(/\$/g,"$$$$")}let u=e=>{if(0>e.indexOf(this.formatSeparator)){let o=j(t,l,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(o,void 0,n,{...r,...t,interpolationkey:e}):o}let o=e.split(this.formatSeparator),i=o.shift().trim(),a=o.join(this.formatSeparator).trim();return this.format(j(t,l,i,this.options.keySeparator,this.options.ignoreJSONStructure),a,n,{...r,...t,interpolationkey:i})};this.resetRegExp();let f=r&&r.missingInterpolationHandler||this.options.missingInterpolationHandler,d=r&&r.interpolation&&void 0!==r.interpolation.skipOnVariables?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables,p=[{regex:this.regexpUnescape,safeValue:e=>c(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?c(this.escape(e)):c(e)}];return p.forEach(t=>{for(a=0;o=t.regex.exec(e);){let n=o[1].trim();if(void 0===(i=u(n))){if("function"==typeof f){let t=f(e,o,r);i="string"==typeof t?t:""}else if(r&&Object.prototype.hasOwnProperty.call(r,n))i="";else if(d){i=o[0];continue}else this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`),i=""}else"string"==typeof i||this.useRawValueToEscape||(i=s(i));let l=t.safeValue(i);if(e=e.replace(o[0],l),d?(t.regex.lastIndex+=i.length,t.regex.lastIndex-=o[0].length):t.regex.lastIndex=0,++a>=this.maxReplaces)break}}),e}nest(e,t){let n,r,o,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};function a(e,t){let n=this.nestingOptionsSeparator;if(0>e.indexOf(n))return e;let r=e.split(RegExp(`${n}[ ]*{`)),i=`{${r[1]}`;e=r[0],i=this.interpolate(i,o);let a=i.match(/'/g),l=i.match(/"/g);(a&&a.length%2==0&&!l||l.length%2!=0)&&(i=i.replace(/'/g,'"'));try{o=JSON.parse(i),t&&(o={...t,...o})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${n}${i}`}return delete o.defaultValue,e}for(;n=this.nestingRegexp.exec(e);){let l=[];(o=(o={...i}).replace&&"string"!=typeof o.replace?o.replace:o).applyPostProcessor=!1,delete o.defaultValue;let c=!1;if(-1!==n[0].indexOf(this.formatSeparator)&&!/{.*}/.test(n[1])){let e=n[1].split(this.formatSeparator).map(e=>e.trim());n[1]=e.shift(),l=e,c=!0}if((r=t(a.call(this,n[1].trim(),o),o))&&n[0]===e&&"string"!=typeof r)return r;"string"!=typeof r&&(r=s(r)),r||(this.logger.warn(`missed to resolve ${n[1]} for nesting ${e}`),r=""),c&&(r=l.reduce((e,t)=>this.format(e,t,i.lng,{...i,interpolationkey:n[1].trim()}),r.trim())),e=e.replace(n[0],r),this.regexp.lastIndex=0}return e}}function R(e){let t={};return function(n,r,o){let i=r+JSON.stringify(o),a=t[i];return a||(a=e(v(r),o),t[i]=a),a(n)}}class A{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.logger=i.create("formatter"),this.options=e,this.formats={number:R((e,t)=>{let n=new Intl.NumberFormat(e,{...t});return e=>n.format(e)}),currency:R((e,t)=>{let n=new Intl.NumberFormat(e,{...t,style:"currency"});return e=>n.format(e)}),datetime:R((e,t)=>{let n=new Intl.DateTimeFormat(e,{...t});return e=>n.format(e)}),relativetime:R((e,t)=>{let n=new Intl.RelativeTimeFormat(e,{...t});return e=>n.format(e,t.range||"day")}),list:R((e,t)=>{let n=new Intl.ListFormat(e,{...t});return e=>n.format(e)})},this.init(e)}init(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}},n=t.interpolation;this.formatSeparator=n.formatSeparator?n.formatSeparator:n.formatSeparator||","}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=R(t)}format(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=t.split(this.formatSeparator),i=o.reduce((e,t)=>{let{formatName:o,formatOptions:i}=function(e){let t=e.toLowerCase().trim(),n={};if(e.indexOf("(")>-1){let r=e.split("(");t=r[0].toLowerCase().trim();let o=r[1].substring(0,r[1].length-1);if("currency"===t&&0>o.indexOf(":"))n.currency||(n.currency=o.trim());else if("relativetime"===t&&0>o.indexOf(":"))n.range||(n.range=o.trim());else{let e=o.split(";");e.forEach(e=>{if(!e)return;let[t,...r]=e.split(":"),o=r.join(":").trim().replace(/^'+|'+$/g,"");n[t.trim()]||(n[t.trim()]=o),"false"===o&&(n[t.trim()]=!1),"true"===o&&(n[t.trim()]=!0),isNaN(o)||(n[t.trim()]=parseInt(o,10))})}}return{formatName:t,formatOptions:n}}(t);if(this.formats[o]){let t=e;try{let a=r&&r.formatParams&&r.formatParams[r.interpolationkey]||{},l=a.locale||a.lng||r.locale||r.lng||n;t=this.formats[o](e,l,{...i,...r,...a})}catch(e){this.logger.warn(e)}return t}return this.logger.warn(`there was no format function for ${o}`),e},e);return i}}class N extends a{constructor(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=r,this.logger=i.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=r.maxParallelReads||10,this.readingCalls=0,this.maxRetries=r.maxRetries>=0?r.maxRetries:5,this.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(n,r.backend,r)}queueLoad(e,t,n,r){let o={},i={},a={},l={};return e.forEach(e=>{let r=!0;t.forEach(t=>{let a=`${e}|${t}`;!n.reload&&this.store.hasResourceBundle(e,t)?this.state[a]=2:this.state[a]<0||(1===this.state[a]?void 0===i[a]&&(i[a]=!0):(this.state[a]=1,r=!1,void 0===i[a]&&(i[a]=!0),void 0===o[a]&&(o[a]=!0),void 0===l[t]&&(l[t]=!0)))}),r||(a[e]=!0)}),(Object.keys(o).length||Object.keys(i).length)&&this.queue.push({pending:i,pendingCount:Object.keys(i).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(o),pending:Object.keys(i),toLoadLanguages:Object.keys(a),toLoadNamespaces:Object.keys(l)}}loaded(e,t,n){let r=e.split("|"),o=r[0],i=r[1];t&&this.emit("failedLoading",o,i,t),n&&this.store.addResourceBundle(o,i,n),this.state[e]=t?-1:2;let a={};this.queue.forEach(n=>{(function(e,t,n,r){let{obj:o,k:i}=c(e,t,Object);o[i]=o[i]||[],r&&(o[i]=o[i].concat(n)),r||o[i].push(n)})(n.loaded,[o],i),void 0!==n.pending[e]&&(delete n.pending[e],n.pendingCount--),t&&n.errors.push(t),0!==n.pendingCount||n.done||(Object.keys(n.loaded).forEach(e=>{a[e]||(a[e]={});let t=n.loaded[e];t.length&&t.forEach(t=>{void 0===a[e][t]&&(a[e][t]=!0)})}),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())}),this.emit("loaded",a),this.queue=this.queue.filter(e=>!e.done)}read(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.retryTimeout,i=arguments.length>5?arguments[5]:void 0;if(!e.length)return i(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:t,fcName:n,tried:r,wait:o,callback:i});return}this.readingCalls++;let a=(a,l)=>{if(this.readingCalls--,this.waitingReads.length>0){let e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}if(a&&l&&r{this.read.call(this,e,t,n,r+1,2*o,i)},o);return}i(a,l)},l=this.backend[n].bind(this.backend);if(2===l.length){try{let n=l(e,t);n&&"function"==typeof n.then?n.then(e=>a(null,e)).catch(a):a(null,n)}catch(e){a(e)}return}return l(e,t,a)}prepareLoading(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),r&&r();"string"==typeof e&&(e=this.languageUtils.toResolveHierarchy(e)),"string"==typeof t&&(t=[t]);let o=this.queueLoad(e,t,n,r);if(!o.toLoad.length)return o.pending.length||r(),null;o.toLoad.forEach(e=>{this.loadOne(e)})}load(e,t,n){this.prepareLoading(e,t,{},n)}reload(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}loadOne(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=e.split("|"),r=n[0],o=n[1];this.read(r,o,"read",void 0,void 0,(n,i)=>{n&&this.logger.warn(`${t}loading namespace ${o} for language ${r} failed`,n),!n&&i&&this.logger.log(`${t}loaded namespace ${o} for language ${r}`,i),this.loaded(e,n,i)})}saveMissing(e,t,n,r,o){let i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(t)){this.logger.warn(`did not save key "${n}" as the namespace "${t}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(null!=n&&""!==n){if(this.backend&&this.backend.create){let l={...i,isUpdate:o},s=this.backend.create.bind(this.backend);if(s.length<6)try{let o;(o=5===s.length?s(e,t,n,r,l):s(e,t,n,r))&&"function"==typeof o.then?o.then(e=>a(null,e)).catch(a):a(null,o)}catch(e){a(e)}else s(e,t,n,r,a,l)}e&&e[0]&&this.store.addResource(e[0],t,n,r)}}}function T(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){let t={};if("object"==typeof e[1]&&(t=e[1]),"string"==typeof e[1]&&(t.defaultValue=e[1]),"string"==typeof e[2]&&(t.tDescription=e[2]),"object"==typeof e[2]||"object"==typeof e[3]){let n=e[3]||e[2];Object.keys(n).forEach(e=>{t[e]=n[e]})}return t},interpolation:{escapeValue:!0,format:(e,t,n,r)=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function M(e){return"string"==typeof e.ns&&(e.ns=[e.ns]),"string"==typeof e.fallbackLng&&(e.fallbackLng=[e.fallbackLng]),"string"==typeof e.fallbackNS&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&0>e.supportedLngs.indexOf("cimode")&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function I(){}class F extends a{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;if(super(),this.options=M(e),this.services={},this.logger=i,this.modules={external:[]},!function(e){let t=Object.getOwnPropertyNames(Object.getPrototypeOf(e));t.forEach(t=>{"function"==typeof e[t]&&(e[t]=e[t].bind(e))})}(this),t&&!this.isInitialized&&!e.isClone){if(!this.options.initImmediate)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(){var e=this;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;"function"==typeof t&&(n=t,t={}),!t.defaultNS&&!1!==t.defaultNS&&t.ns&&("string"==typeof t.ns?t.defaultNS=t.ns:0>t.ns.indexOf("translation")&&(t.defaultNS=t.ns[0]));let r=T();function o(e){return e?"function"==typeof e?new e:e:null}if(this.options={...r,...this.options,...M(t)},"v1"!==this.options.compatibilityAPI&&(this.options.interpolation={...r.interpolation,...this.options.interpolation}),void 0!==t.keySeparator&&(this.options.userDefinedKeySeparator=t.keySeparator),void 0!==t.nsSeparator&&(this.options.userDefinedNsSeparator=t.nsSeparator),!this.options.isClone){let t;this.modules.logger?i.init(o(this.modules.logger),this.options):i.init(null,this.options),this.modules.formatter?t=this.modules.formatter:"undefined"!=typeof Intl&&(t=A);let n=new E(this.options);this.store=new y(this.options.resources,this.options);let a=this.services;a.logger=i,a.resourceStore=this.store,a.languageUtils=n,a.pluralResolver=new P(n,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),t&&(!this.options.interpolation.format||this.options.interpolation.format===r.interpolation.format)&&(a.formatter=o(t),a.formatter.init(a,this.options),this.options.interpolation.format=a.formatter.format.bind(a.formatter)),a.interpolator=new _(this.options),a.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},a.backendConnector=new N(o(this.modules.backend),a.resourceStore,a,this.options),a.backendConnector.on("*",function(t){for(var n=arguments.length,r=Array(n>1?n-1:0),o=1;o1?n-1:0),o=1;o{e.init&&e.init(this)})}if(this.format=this.options.interpolation.format,n||(n=I),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){let e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&"dev"!==e[0]&&(this.options.lng=e[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(t=>{this[t]=function(){return e.store[t](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(t=>{this[t]=function(){return e.store[t](...arguments),e}});let a=l(),s=()=>{let e=(e,t)=>{this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),a.resolve(t),n(e,t)};if(this.languages&&"v1"!==this.options.compatibilityAPI&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initImmediate?s():setTimeout(s,0),a}loadResources(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:I,n=t,r="string"==typeof e?e:this.language;if("function"==typeof e&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if(r&&"cimode"===r.toLowerCase()&&(!this.options.preload||0===this.options.preload.length))return n();let e=[],t=t=>{if(!t||"cimode"===t)return;let n=this.services.languageUtils.toResolveHierarchy(t);n.forEach(t=>{"cimode"!==t&&0>e.indexOf(t)&&e.push(t)})};if(r)t(r);else{let e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.forEach(e=>t(e))}this.options.preload&&this.options.preload.forEach(e=>t(e)),this.services.backendConnector.load(e,this.options.ns,e=>{e||this.resolvedLanguage||!this.language||this.setResolvedLanguage(this.language),n(e)})}else n(null)}reloadResources(e,t,n){let r=l();return e||(e=this.languages),t||(t=this.options.ns),n||(n=I),this.services.backendConnector.reload(e,t,e=>{r.resolve(),n(e)}),r}use(e){if(!e)throw Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&b.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}setResolvedLanguage(e){if(e&&this.languages&&!(["cimode","dev"].indexOf(e)>-1))for(let e=0;e-1)&&this.store.hasLanguageSomeTranslations(t)){this.resolvedLanguage=t;break}}}changeLanguage(e,t){var n=this;this.isLanguageChangingTo=e;let r=l();this.emit("languageChanging",e);let o=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},i=(e,i)=>{i?(o(i),this.translator.changeLanguage(i),this.isLanguageChangingTo=void 0,this.emit("languageChanged",i),this.logger.log("languageChanged",i)):this.isLanguageChangingTo=void 0,r.resolve(function(){return n.t(...arguments)}),t&&t(e,function(){return n.t(...arguments)})},a=t=>{e||t||!this.services.languageDetector||(t=[]);let n="string"==typeof t?t:this.services.languageUtils.getBestMatchFromCodes(t);n&&(this.language||o(n),this.translator.language||this.translator.changeLanguage(n),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(n)),this.loadResources(n,e=>{i(e,n)})};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(e):a(this.services.languageDetector.detect()),r}getFixedT(e,t,n){var r=this;let o=function(e,t){let i,a;if("object"!=typeof t){for(var l=arguments.length,s=Array(l>2?l-2:0),c=2;c`${i.keyPrefix}${u}${e}`):i.keyPrefix?`${i.keyPrefix}${u}${e}`:e,r.t(a,i)};return"string"==typeof e?o.lng=e:o.lngs=e,o.ns=t,o.keyPrefix=n,o}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;let n=t.lng||this.resolvedLanguage||this.languages[0],r=!!this.options&&this.options.fallbackLng,o=this.languages[this.languages.length-1];if("cimode"===n.toLowerCase())return!0;let i=(e,t)=>{let n=this.services.backendConnector.state[`${e}|${t}`];return -1===n||2===n};if(t.precheck){let e=t.precheck(this,i);if(void 0!==e)return e}return!!(this.hasResourceBundle(n,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||i(n,e)&&(!r||i(o,e)))}loadNamespaces(e,t){let n=l();return this.options.ns?("string"==typeof e&&(e=[e]),e.forEach(e=>{0>this.options.ns.indexOf(e)&&this.options.ns.push(e)}),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){let n=l();"string"==typeof e&&(e=[e]);let r=this.options.preload||[],o=e.filter(e=>0>r.indexOf(e));return o.length?(this.options.preload=r.concat(o),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!e)return"rtl";let t=this.services&&this.services.languageUtils||new E(T());return["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(t.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return new F(e,t)}cloneInstance(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:I,n=e.forkResourceStore;n&&delete e.forkResourceStore;let r={...this.options,...e,isClone:!0},o=new F(r);return(void 0!==e.debug||void 0!==e.prefix)&&(o.logger=o.logger.clone(e)),["store","services","language"].forEach(e=>{o[e]=this[e]}),o.services={...this.services},o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},n&&(o.store=new y(this.store.data,r),o.services.resourceStore=o.store),o.translator=new w(o.services,r),o.translator.on("*",function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r{let{componentCls:t,width:n,notificationMarginEdge:r}=e,o=new y.E4("antNotificationTopFadeIn",{"0%":{marginTop:"-100%",opacity:0},"100%":{marginTop:0,opacity:1}}),i=new y.E4("antNotificationBottomFadeIn",{"0%":{marginBottom:"-100%",opacity:0},"100%":{marginBottom:0,opacity:1}}),a=new y.E4("antNotificationLeftFadeIn",{"0%":{right:{_skip_check_:!0,value:n},opacity:0},"100%":{right:{_skip_check_:!0,value:0},opacity:1}});return{[`&${t}-top, &${t}-bottom`]:{marginInline:0},[`&${t}-top`]:{[`${t}-fade-enter${t}-fade-enter-active, ${t}-fade-appear${t}-fade-appear-active`]:{animationName:o}},[`&${t}-bottom`]:{[`${t}-fade-enter${t}-fade-enter-active, ${t}-fade-appear${t}-fade-appear-active`]:{animationName:i}},[`&${t}-topLeft, &${t}-bottomLeft`]:{marginInlineEnd:0,marginInlineStart:r,[`${t}-fade-enter${t}-fade-enter-active, ${t}-fade-appear${t}-fade-appear-active`]:{animationName:a}}}};let E=e=>{let{iconCls:t,componentCls:n,boxShadow:r,fontSizeLG:o,notificationMarginBottom:i,borderRadiusLG:a,colorSuccess:l,colorInfo:s,colorWarning:c,colorError:u,colorTextHeading:f,notificationBg:d,notificationPadding:p,notificationMarginEdge:h,motionDurationMid:m,motionEaseInOut:g,fontSize:v,lineHeight:x,width:w,notificationIconSize:E,colorText:S}=e,$=`${n}-notice`,O=new y.E4("antNotificationFadeIn",{"0%":{left:{_skip_check_:!0,value:w},opacity:0},"100%":{left:{_skip_check_:!0,value:0},opacity:1}}),k=new y.E4("antNotificationFadeOut",{"0%":{maxHeight:e.animationMaxHeight,marginBottom:i,opacity:1},"100%":{maxHeight:0,marginBottom:0,paddingTop:0,paddingBottom:0,opacity:0}}),Z={position:"relative",width:w,maxWidth:`calc(100vw - ${2*h}px)`,marginBottom:i,marginInlineStart:"auto",padding:p,overflow:"hidden",lineHeight:x,wordWrap:"break-word",background:d,borderRadius:a,boxShadow:r,[`${n}-close-icon`]:{fontSize:v,cursor:"pointer"},[`${$}-message`]:{marginBottom:e.marginXS,color:f,fontSize:o,lineHeight:e.lineHeightLG},[`${$}-description`]:{fontSize:v,color:S},[`&${$}-closable ${$}-message`]:{paddingInlineEnd:e.paddingLG},[`${$}-with-icon ${$}-message`]:{marginBottom:e.marginXS,marginInlineStart:e.marginSM+E,fontSize:o},[`${$}-with-icon ${$}-description`]:{marginInlineStart:e.marginSM+E,fontSize:v},[`${$}-icon`]:{position:"absolute",fontSize:E,lineHeight:0,[`&-success${t}`]:{color:l},[`&-info${t}`]:{color:s},[`&-warning${t}`]:{color:c},[`&-error${t}`]:{color:u}},[`${$}-close`]:{position:"absolute",top:e.notificationPaddingVertical,insetInlineEnd:e.notificationPaddingHorizontal,color:e.colorIcon,outline:"none",width:e.notificationCloseButtonSize,height:e.notificationCloseButtonSize,borderRadius:e.borderRadiusSM,transition:`background-color ${e.motionDurationMid}, color ${e.motionDurationMid}`,display:"flex",alignItems:"center",justifyContent:"center","&:hover":{color:e.colorIconHover,backgroundColor:e.wireframe?"transparent":e.colorFillContent}},[`${$}-btn`]:{float:"right",marginTop:e.marginSM}};return[{[n]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,b.Wf)(e)),{position:"fixed",zIndex:e.zIndexPopup,marginInlineEnd:h,[`${n}-hook-holder`]:{position:"relative"},[`&${n}-top, &${n}-bottom`]:{[$]:{marginInline:"auto auto"}},[`&${n}-topLeft, &${n}-bottomLeft`]:{[$]:{marginInlineEnd:"auto",marginInlineStart:0}},[`${n}-fade-enter, ${n}-fade-appear`]:{animationDuration:e.motionDurationMid,animationTimingFunction:g,animationFillMode:"both",opacity:0,animationPlayState:"paused"},[`${n}-fade-leave`]:{animationTimingFunction:g,animationFillMode:"both",animationDuration:m,animationPlayState:"paused"},[`${n}-fade-enter${n}-fade-enter-active, ${n}-fade-appear${n}-fade-appear-active`]:{animationName:O,animationPlayState:"running"},[`${n}-fade-leave${n}-fade-leave-active`]:{animationName:k,animationPlayState:"running"}}),C(e)),{"&-rtl":{direction:"rtl",[`${$}-btn`]:{float:"left"}}})},{[n]:{[$]:Object.assign({},Z)}},{[`${$}-pure-panel`]:Object.assign(Object.assign({},Z),{margin:0})}]};var S=(0,x.Z)("Notification",e=>{let t=e.paddingMD,n=e.paddingLG,r=(0,w.TS)(e,{notificationBg:e.colorBgElevated,notificationPaddingVertical:t,notificationPaddingHorizontal:n,notificationIconSize:e.fontSizeLG*e.lineHeightLG,notificationCloseButtonSize:.55*e.controlHeightLG,notificationMarginBottom:e.margin,notificationPadding:`${e.paddingMD}px ${e.paddingContentHorizontalLG}px`,notificationMarginEdge:e.marginLG,animationMaxHeight:150});return[E(r)]},e=>({zIndexPopup:e.zIndexPopupBase+50,width:384})),$=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);ot.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};function O(e,t){return null===t||!1===t?null:t||i.createElement("span",{className:`${e}-close-x`},i.createElement(u.Z,{className:`${e}-close-icon`}))}d.Z,s.Z,c.Z,f.Z,p.Z;let k={success:s.Z,info:d.Z,error:c.Z,warning:f.Z},Z=e=>{let{prefixCls:t,icon:n,type:r,message:o,description:a,btn:l,role:s="alert"}=e,c=null;return n?c=i.createElement("span",{className:`${t}-icon`},n):r&&(c=i.createElement(k[r]||null,{className:m()(`${t}-icon`,`${t}-icon-${r}`)})),i.createElement("div",{className:m()({[`${t}-with-icon`]:c}),role:s},c,i.createElement("div",{className:`${t}-message`},o),i.createElement("div",{className:`${t}-description`},a),l&&i.createElement("div",{className:`${t}-btn`},l))};var P=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);ot.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let j=e=>{let{children:t,prefixCls:n}=e,[,r]=S(n);return i.createElement(g.JB,{classNames:{list:r,notice:r}},t)},_=(e,t)=>{let{prefixCls:n,key:r}=t;return i.createElement(j,{prefixCls:n,key:r},e)},R=i.forwardRef((e,t)=>{let{top:n,bottom:r,prefixCls:o,getContainer:a,maxCount:l,rtl:s,onAllRemoved:c}=e,{getPrefixCls:u,getPopupContainer:f,notification:d}=i.useContext(v.E_),p=o||u("notification"),[h,y]=(0,g.lm)({prefixCls:p,style:e=>(function(e,t,n){let r;switch(e){case"top":r={left:"50%",transform:"translateX(-50%)",right:"auto",top:t,bottom:"auto"};break;case"topLeft":r={left:0,top:t,bottom:"auto"};break;case"topRight":r={right:0,top:t,bottom:"auto"};break;case"bottom":r={left:"50%",transform:"translateX(-50%)",right:"auto",top:"auto",bottom:n};break;case"bottomLeft":r={left:0,top:"auto",bottom:n};break;default:r={right:0,top:"auto",bottom:n}}return r})(e,null!=n?n:24,null!=r?r:24),className:()=>m()({[`${p}-rtl`]:s}),motion:()=>({motionName:`${p}-fade`}),closable:!0,closeIcon:O(p),duration:4.5,getContainer:()=>(null==a?void 0:a())||(null==f?void 0:f())||document.body,maxCount:l,onAllRemoved:c,renderNotifications:_});return i.useImperativeHandle(t,()=>Object.assign(Object.assign({},h),{prefixCls:p,notification:d})),y});function A(e){let t=i.useRef(null),n=i.useMemo(()=>{let n=n=>{var r;if(!t.current)return;let{open:o,prefixCls:a,notification:l}=t.current,s=`${a}-notice`,{message:c,description:u,icon:f,type:d,btn:p,className:h,style:g,role:v="alert",closeIcon:y}=n,b=P(n,["message","description","icon","type","btn","className","style","role","closeIcon"]),x=O(s,y);return o(Object.assign(Object.assign({placement:null!==(r=null==e?void 0:e.placement)&&void 0!==r?r:"topRight"},b),{content:i.createElement(Z,{prefixCls:s,icon:f,type:d,message:c,description:u,btn:p,role:v}),className:m()(d&&`${s}-${d}`,h,null==l?void 0:l.className),style:Object.assign(Object.assign({},null==l?void 0:l.style),g),closeIcon:x,closable:!!x}))},r={open:n,destroy:e=>{var n,r;void 0!==e?null===(n=t.current)||void 0===n||n.close(e):null===(r=t.current)||void 0===r||r.destroy()}};return["success","info","warning","error"].forEach(e=>{r[e]=t=>n(Object.assign(Object.assign({},t),{type:e}))}),r},[]);return[n,i.createElement(R,Object.assign({key:"notification-holder"},e,{ref:t}))]}let N=null,T=e=>e(),M=[],I={};function F(){let{prefixCls:e,getContainer:t,rtl:n,maxCount:r,top:o,bottom:i}=I,a=null!=e?e:(0,l.w6)().getPrefixCls("notification"),s=(null==t?void 0:t())||document.body;return{prefixCls:a,getContainer:()=>s,rtl:n,maxCount:r,top:o,bottom:i}}let L=i.forwardRef((e,t)=>{let[n,r]=i.useState(F),[o,a]=A(n),s=(0,l.w6)(),c=s.getRootPrefixCls(),u=s.getIconPrefixCls(),f=s.getTheme(),d=()=>{r(F)};return i.useEffect(d,[]),i.useImperativeHandle(t,()=>{let e=Object.assign({},o);return Object.keys(e).forEach(t=>{e[t]=function(){return d(),o[t].apply(o,arguments)}}),{instance:e,sync:d}}),i.createElement(l.ZP,{prefixCls:c,iconPrefixCls:u,theme:f},a)});function B(){if(!N){let e=document.createDocumentFragment(),t={fragment:e};N=t,T(()=>{(0,a.s)(i.createElement(L,{ref:e=>{let{instance:n,sync:r}=e||{};Promise.resolve().then(()=>{!t.instance&&n&&(t.instance=n,t.sync=r,B())})}}),e)});return}N.instance&&(M.forEach(e=>{switch(e.type){case"open":T(()=>{N.instance.open(Object.assign(Object.assign({},I),e.config))});break;case"destroy":T(()=>{null==N||N.instance.destroy(e.key)})}}),M=[])}function D(e){M.push({type:"open",config:e}),B()}let z={open:D,destroy:function(e){M.push({type:"destroy",key:e}),B()},config:function(e){I=Object.assign(Object.assign({},I),e),T(()=>{var e;null===(e=null==N?void 0:N.sync)||void 0===e||e.call(N)})},useNotification:function(e){return A(e)},_InternalPanelDoNotUseOrYouWillBeFired:e=>{let{prefixCls:t,className:n,icon:r,type:o,message:a,description:l,btn:s,closable:c=!0,closeIcon:u}=e,f=$(e,["prefixCls","className","icon","type","message","description","btn","closable","closeIcon"]),{getPrefixCls:d}=i.useContext(v.E_),p=t||d("notification"),h=`${p}-notice`,[,y]=S(p);return i.createElement(g.qX,Object.assign({},f,{prefixCls:p,className:m()(n,y,`${h}-pure-panel`),eventKey:"pure",duration:null,closable:c,closeIcon:O(p,u),content:i.createElement(Z,{prefixCls:h,icon:r,type:o,message:a,description:l,btn:s})}))}};["success","info","warning","error"].forEach(e=>{z[e]=t=>D(Object.assign(Object.assign({},t),{type:e}))});let H=(e,t)=>e.then(e=>{let{data:n}=e;if(!n)throw Error("Network Error!");if(!n.success){if("*"===t||n.err_code&&t&&t.includes(n.err_code));else{var r;throw z.error({message:"Request error",description:null!==(r=null==n?void 0:n.err_msg)&&void 0!==r?r:"The interface is abnormal. Please try again later"}),Error((null==n?void 0:n.err_msg)||"The interface is abnormal. Please try again later")}}return[null,n.data,n,e]}).catch(e=>(z.error({message:"Request error",description:e.message}),[e,null,null,null])),V=()=>e_("/api/v1/chat/dialogue/scenes"),U=e=>e_("/api/v1/chat/dialogue/new",e),W=()=>ej("/api/v1/chat/db/list"),K=()=>ej("/api/v1/chat/db/support/type"),q=e=>e_("/chat/db/delete?db_name=".concat(e),void 0),G=e=>e_("/api/v1/chat/db/edit",e),X=e=>e_("/api/v1/chat/db/add",e),Y=e=>e_("/api/v1/chat/db/test/connect",e),J=()=>ej("/api/v1/chat/dialogue/list"),Q=()=>ej("/api/v1/model/types"),ee=e=>e_("/api/v1/chat/mode/params/list?chat_mode=".concat(e)),et=e=>ej("/api/v1/chat/dialogue/messages/history?con_uid=".concat(e)),en=e=>{let{convUid:t,chatMode:n,data:r,config:o,model:i}=e;return e_("/api/v1/chat/mode/params/file/load?conv_uid=".concat(t,"&chat_mode=").concat(n,"&model_name=").concat(i),r,{headers:{"Content-Type":"multipart/form-data"},...o})},er=e=>e_("/api/v1/chat/dialogue/delete?con_uid=".concat(e)),eo=e=>e_("/knowledge/".concat(e,"/arguments"),{}),ei=(e,t)=>e_("/knowledge/".concat(e,"/argument/save"),t),ea=()=>e_("/knowledge/space/list",{}),el=(e,t)=>e_("/knowledge/".concat(e,"/document/list"),t),es=(e,t)=>e_("/knowledge/".concat(e,"/document/add"),t),ec=e=>e_("/knowledge/space/add",e),eu=(e,t)=>e_("/knowledge/".concat(e,"/document/sync"),t),ef=(e,t)=>e_("/knowledge/".concat(e,"/document/upload"),t),ed=(e,t)=>e_("/knowledge/".concat(e,"/chunk/list"),t),ep=(e,t)=>e_("/knowledge/".concat(e,"/document/delete"),t),eh=e=>e_("/knowledge/space/delete",e),em=()=>ej("/api/v1/worker/model/list"),eg=e=>e_("/api/v1/worker/model/stop",e),ev=e=>e_("/api/v1/worker/model/start",e),ey=()=>ej("/api/v1/worker/model/params"),eb=e=>e_("/api/v1/agent/query",e),ex=e=>e_("/api/v1/agent/hub/update",null!=e?e:{channel:"",url:"",branch:"",authorization:""}),ew=e=>e_("/api/v1/agent/my",void 0,{params:{user:e}}),eC=(e,t)=>e_("/api/v1/agent/install",void 0,{params:{plugin_name:e,user:t},timeout:6e4}),eE=(e,t)=>e_("/api/v1/agent/uninstall",void 0,{params:{plugin_name:e,user:t},timeout:6e4}),eS=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;return e_("/api/v1/personal/agent/upload",t,{params:{user:e},headers:{"Content-Type":"multipart/form-data"},...n})},e$=()=>ej("/api/v1/feedback/select",void 0),eO=(e,t)=>ej("/api/v1/feedback/find?conv_uid=".concat(e,"&conv_index=").concat(t),void 0),ek=e=>{let{data:t,config:n}=e;return e_("/api/v1/feedback/commit",t,{headers:{"Content-Type":"application/json"},...n})};var eZ=n(83454);let eP=o.Z.create({baseURL:null!==(r=eZ.env.API_BASE_URL)&&void 0!==r?r:"",timeout:1e4}),ej=(e,t,n)=>eP.get(e,{params:t,...n}),e_=(e,t,n)=>eP.post(e,t,n)},8937:function(e,t,n){"use strict";n.d(t,{Yl:function(){return o},he:function(){return r},rU:function(){return i}});let r="__db_gpt_theme_key",o="__db_gpt_lng_key",i="__db_gpt_im_key"},32665:function(e,t,n){"use strict";function r(e){}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"clientHookInServerComponentError",{enumerable:!0,get:function(){return r}}),n(38754),n(67294),("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},41219:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{ReadonlyURLSearchParams:function(){return p},useSearchParams:function(){return h},usePathname:function(){return m},ServerInsertedHTMLContext:function(){return s.ServerInsertedHTMLContext},useServerInsertedHTML:function(){return s.useServerInsertedHTML},useRouter:function(){return g},useParams:function(){return v},useSelectedLayoutSegments:function(){return y},useSelectedLayoutSegment:function(){return b},redirect:function(){return c.redirect},notFound:function(){return u.notFound}});let r=n(67294),o=n(27473),i=n(35802),a=n(32665),l=n(43512),s=n(98751),c=n(96885),u=n(86323),f=Symbol("internal for urlsearchparams readonly");function d(){return Error("ReadonlyURLSearchParams cannot be modified")}class p{[Symbol.iterator](){return this[f][Symbol.iterator]()}append(){throw d()}delete(){throw d()}set(){throw d()}sort(){throw d()}constructor(e){this[f]=e,this.entries=e.entries.bind(e),this.forEach=e.forEach.bind(e),this.get=e.get.bind(e),this.getAll=e.getAll.bind(e),this.has=e.has.bind(e),this.keys=e.keys.bind(e),this.values=e.values.bind(e),this.toString=e.toString.bind(e)}}function h(){(0,a.clientHookInServerComponentError)("useSearchParams");let e=(0,r.useContext)(i.SearchParamsContext),t=(0,r.useMemo)(()=>e?new p(e):null,[e]);return t}function m(){return(0,a.clientHookInServerComponentError)("usePathname"),(0,r.useContext)(i.PathnameContext)}function g(){(0,a.clientHookInServerComponentError)("useRouter");let e=(0,r.useContext)(o.AppRouterContext);if(null===e)throw Error("invariant expected app router to be mounted");return e}function v(){(0,a.clientHookInServerComponentError)("useParams");let e=(0,r.useContext)(o.GlobalLayoutRouterContext);return e?function e(t,n){void 0===n&&(n={});let r=t[1];for(let t of Object.values(r)){let r=t[0],o=Array.isArray(r),i=o?r[1]:r;!i||i.startsWith("__PAGE__")||(o&&(n[r[0]]=r[1]),n=e(t,n))}return n}(e.tree):null}function y(e){void 0===e&&(e="children"),(0,a.clientHookInServerComponentError)("useSelectedLayoutSegments");let{tree:t}=(0,r.useContext)(o.LayoutRouterContext);return function e(t,n,r,o){let i;if(void 0===r&&(r=!0),void 0===o&&(o=[]),r)i=t[1][n];else{var a;let e=t[1];i=null!=(a=e.children)?a:Object.values(e)[0]}if(!i)return o;let s=i[0],c=(0,l.getSegmentValue)(s);return!c||c.startsWith("__PAGE__")?o:(o.push(c),e(i,n,!1,o))}(t,e)}function b(e){void 0===e&&(e="children"),(0,a.clientHookInServerComponentError)("useSelectedLayoutSegment");let t=y(e);return 0===t.length?null:t[0]}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},86323:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{notFound:function(){return r},isNotFoundError:function(){return o}});let n="NEXT_NOT_FOUND";function r(){let e=Error(n);throw e.digest=n,e}function o(e){return(null==e?void 0:e.digest)===n}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},96885:function(e,t,n){"use strict";var r,o;Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{RedirectType:function(){return r},getRedirectError:function(){return l},redirect:function(){return s},isRedirectError:function(){return c},getURLFromRedirectError:function(){return u},getRedirectTypeFromError:function(){return f}});let i=n(68214),a="NEXT_REDIRECT";function l(e,t){let n=Error(a);n.digest=a+";"+t+";"+e;let r=i.requestAsyncStorage.getStore();return r&&(n.mutableCookies=r.mutableCookies),n}function s(e,t){throw void 0===t&&(t="replace"),l(e,t)}function c(e){if("string"!=typeof(null==e?void 0:e.digest))return!1;let[t,n,r]=e.digest.split(";",3);return t===a&&("replace"===n||"push"===n)&&"string"==typeof r}function u(e){return c(e)?e.digest.split(";",3)[2]:null}function f(e){if(!c(e))throw Error("Not a redirect error");return e.digest.split(";",3)[1]}(o=r||(r={})).push="push",o.replace="replace",("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},43512:function(e,t){"use strict";function n(e){return Array.isArray(e)?e[1]:e}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getSegmentValue",{enumerable:!0,get:function(){return n}}),("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},29382:function(e,t){"use strict";var n,r;Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{PrefetchKind:function(){return n},ACTION_REFRESH:function(){return o},ACTION_NAVIGATE:function(){return i},ACTION_RESTORE:function(){return a},ACTION_SERVER_PATCH:function(){return l},ACTION_PREFETCH:function(){return s},ACTION_FAST_REFRESH:function(){return c},ACTION_SERVER_ACTION:function(){return u}});let o="refresh",i="navigate",a="restore",l="server-patch",s="prefetch",c="fast-refresh",u="server-action";(r=n||(n={})).AUTO="auto",r.FULL="full",r.TEMPORARY="temporary",("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},75476:function(e,t){"use strict";function n(e,t,n,r){return!1}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getDomainLocale",{enumerable:!0,get:function(){return n}}),("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},69873:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return y}});let r=n(38754),o=n(61757),i=o._(n(67294)),a=r._(n(68965)),l=n(38083),s=n(2478),c=n(76226);n(59941);let u=r._(n(31720)),f={deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[16,32,48,64,96,128,256,384],path:"/_next/image/",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!0};function d(e){return void 0!==e.default}function p(e){return void 0===e?e:"number"==typeof e?Number.isFinite(e)?e:NaN:"string"==typeof e&&/^[0-9]+$/.test(e)?parseInt(e,10):NaN}function h(e,t,n,r,o,i,a){if(!e||e["data-loaded-src"]===t)return;e["data-loaded-src"]=t;let l="decode"in e?e.decode():Promise.resolve();l.catch(()=>{}).then(()=>{if(e.parentElement&&e.isConnected){if("blur"===n&&i(!0),null==r?void 0:r.current){let t=new Event("load");Object.defineProperty(t,"target",{writable:!1,value:e});let n=!1,o=!1;r.current({...t,nativeEvent:t,currentTarget:e,target:e,isDefaultPrevented:()=>n,isPropagationStopped:()=>o,persist:()=>{},preventDefault:()=>{n=!0,t.preventDefault()},stopPropagation:()=>{o=!0,t.stopPropagation()}})}(null==o?void 0:o.current)&&o.current(e)}})}function m(e){let[t,n]=i.version.split("."),r=parseInt(t,10),o=parseInt(n,10);return r>18||18===r&&o>=3?{fetchPriority:e}:{fetchpriority:e}}let g=(0,i.forwardRef)((e,t)=>{let{imgAttributes:n,heightInt:r,widthInt:o,qualityInt:a,className:l,imgStyle:s,blurStyle:c,isLazy:u,fetchPriority:f,fill:d,placeholder:p,loading:g,srcString:v,config:y,unoptimized:b,loader:x,onLoadRef:w,onLoadingCompleteRef:C,setBlurComplete:E,setShowAltText:S,onLoad:$,onError:O,...k}=e;return g=u?"lazy":g,i.default.createElement("img",{...k,...m(f),loading:g,width:o,height:r,decoding:"async","data-nimg":d?"fill":"1",className:l,style:{...s,...c},...n,ref:(0,i.useCallback)(e=>{t&&("function"==typeof t?t(e):"object"==typeof t&&(t.current=e)),e&&(O&&(e.src=e.src),e.complete&&h(e,v,p,w,C,E,b))},[v,p,w,C,E,O,b,t]),onLoad:e=>{let t=e.currentTarget;h(t,v,p,w,C,E,b)},onError:e=>{S(!0),"blur"===p&&E(!0),O&&O(e)}})}),v=(0,i.forwardRef)((e,t)=>{var n;let r,o,{src:h,sizes:v,unoptimized:y=!1,priority:b=!1,loading:x,className:w,quality:C,width:E,height:S,fill:$,style:O,onLoad:k,onLoadingComplete:Z,placeholder:P="empty",blurDataURL:j,fetchPriority:_,layout:R,objectFit:A,objectPosition:N,lazyBoundary:T,lazyRoot:M,...I}=e,F=(0,i.useContext)(c.ImageConfigContext),L=(0,i.useMemo)(()=>{let e=f||F||s.imageConfigDefault,t=[...e.deviceSizes,...e.imageSizes].sort((e,t)=>e-t),n=e.deviceSizes.sort((e,t)=>e-t);return{...e,allSizes:t,deviceSizes:n}},[F]),B=I.loader||u.default;delete I.loader;let D="__next_img_default"in B;if(D){if("custom"===L.loader)throw Error('Image with src "'+h+'" is missing "loader" prop.\nRead more: https://nextjs.org/docs/messages/next-image-missing-loader')}else{let e=B;B=t=>{let{config:n,...r}=t;return e(r)}}if(R){"fill"===R&&($=!0);let e={intrinsic:{maxWidth:"100%",height:"auto"},responsive:{width:"100%",height:"auto"}}[R];e&&(O={...O,...e});let t={responsive:"100vw",fill:"100vw"}[R];t&&!v&&(v=t)}let z="",H=p(E),V=p(S);if("object"==typeof(n=h)&&(d(n)||void 0!==n.src)){let e=d(h)?h.default:h;if(!e.src)throw Error("An object should only be passed to the image component src parameter if it comes from a static image import. It must include src. Received "+JSON.stringify(e));if(!e.height||!e.width)throw Error("An object should only be passed to the image component src parameter if it comes from a static image import. It must include height and width. Received "+JSON.stringify(e));if(r=e.blurWidth,o=e.blurHeight,j=j||e.blurDataURL,z=e.src,!$){if(H||V){if(H&&!V){let t=H/e.width;V=Math.round(e.height*t)}else if(!H&&V){let t=V/e.height;H=Math.round(e.width*t)}}else H=e.width,V=e.height}}let U=!b&&("lazy"===x||void 0===x);(!(h="string"==typeof h?h:z)||h.startsWith("data:")||h.startsWith("blob:"))&&(y=!0,U=!1),L.unoptimized&&(y=!0),D&&h.endsWith(".svg")&&!L.dangerouslyAllowSVG&&(y=!0),b&&(_="high");let[W,K]=(0,i.useState)(!1),[q,G]=(0,i.useState)(!1),X=p(C),Y=Object.assign($?{position:"absolute",height:"100%",width:"100%",left:0,top:0,right:0,bottom:0,objectFit:A,objectPosition:N}:{},q?{}:{color:"transparent"},O),J="blur"===P&&j&&!W?{backgroundSize:Y.objectFit||"cover",backgroundPosition:Y.objectPosition||"50% 50%",backgroundRepeat:"no-repeat",backgroundImage:'url("data:image/svg+xml;charset=utf-8,'+(0,l.getImageBlurSvg)({widthInt:H,heightInt:V,blurWidth:r,blurHeight:o,blurDataURL:j,objectFit:Y.objectFit})+'")'}:{},Q=function(e){let{config:t,src:n,unoptimized:r,width:o,quality:i,sizes:a,loader:l}=e;if(r)return{src:n,srcSet:void 0,sizes:void 0};let{widths:s,kind:c}=function(e,t,n){let{deviceSizes:r,allSizes:o}=e;if(n){let e=/(^|\s)(1?\d?\d)vw/g,t=[];for(let r;r=e.exec(n);r)t.push(parseInt(r[2]));if(t.length){let e=.01*Math.min(...t);return{widths:o.filter(t=>t>=r[0]*e),kind:"w"}}return{widths:o,kind:"w"}}if("number"!=typeof t)return{widths:r,kind:"w"};let i=[...new Set([t,2*t].map(e=>o.find(t=>t>=e)||o[o.length-1]))];return{widths:i,kind:"x"}}(t,o,a),u=s.length-1;return{sizes:a||"w"!==c?a:"100vw",srcSet:s.map((e,r)=>l({config:t,src:n,quality:i,width:e})+" "+("w"===c?e:r+1)+c).join(", "),src:l({config:t,src:n,quality:i,width:s[u]})}}({config:L,src:h,unoptimized:y,width:H,quality:X,sizes:v,loader:B}),ee=h,et=(0,i.useRef)(k);(0,i.useEffect)(()=>{et.current=k},[k]);let en=(0,i.useRef)(Z);(0,i.useEffect)(()=>{en.current=Z},[Z]);let er={isLazy:U,imgAttributes:Q,heightInt:V,widthInt:H,qualityInt:X,className:w,imgStyle:Y,blurStyle:J,loading:x,config:L,fetchPriority:_,fill:$,unoptimized:y,placeholder:P,loader:B,srcString:ee,onLoadRef:et,onLoadingCompleteRef:en,setBlurComplete:K,setShowAltText:G,...I};return i.default.createElement(i.default.Fragment,null,i.default.createElement(g,{...er,ref:t}),b?i.default.createElement(a.default,null,i.default.createElement("link",{key:"__nimg-"+Q.src+Q.srcSet+Q.sizes,rel:"preload",as:"image",href:Q.srcSet?void 0:Q.src,imageSrcSet:Q.srcSet,imageSizes:Q.sizes,crossOrigin:I.crossOrigin,referrerPolicy:I.referrerPolicy,...m(_)})):null)}),y=v;("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},9940:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return x}});let r=n(38754),o=r._(n(67294)),i=n(65722),a=n(65723),l=n(28904),s=n(95514),c=n(27521),u=n(44293),f=n(27473),d=n(81307),p=n(75476),h=n(66318),m=n(29382),g=new Set;function v(e,t,n,r,o,i){if(!i&&!(0,a.isLocalURL)(t))return;if(!r.bypassPrefetchedCheck){let o=void 0!==r.locale?r.locale:"locale"in e?e.locale:void 0,i=t+"%"+n+"%"+o;if(g.has(i))return;g.add(i)}let l=i?e.prefetch(t,o):e.prefetch(t,n,r);Promise.resolve(l).catch(e=>{})}function y(e){return"string"==typeof e?e:(0,l.formatUrl)(e)}let b=o.default.forwardRef(function(e,t){let n,r;let{href:l,as:g,children:b,prefetch:x=null,passHref:w,replace:C,shallow:E,scroll:S,locale:$,onClick:O,onMouseEnter:k,onTouchStart:Z,legacyBehavior:P=!1,...j}=e;n=b,P&&("string"==typeof n||"number"==typeof n)&&(n=o.default.createElement("a",null,n));let _=!1!==x,R=null===x?m.PrefetchKind.AUTO:m.PrefetchKind.FULL,A=o.default.useContext(u.RouterContext),N=o.default.useContext(f.AppRouterContext),T=null!=A?A:N,M=!A,{href:I,as:F}=o.default.useMemo(()=>{if(!A){let e=y(l);return{href:e,as:g?y(g):e}}let[e,t]=(0,i.resolveHref)(A,l,!0);return{href:e,as:g?(0,i.resolveHref)(A,g):t||e}},[A,l,g]),L=o.default.useRef(I),B=o.default.useRef(F);P&&(r=o.default.Children.only(n));let D=P?r&&"object"==typeof r&&r.ref:t,[z,H,V]=(0,d.useIntersection)({rootMargin:"200px"}),U=o.default.useCallback(e=>{(B.current!==F||L.current!==I)&&(V(),B.current=F,L.current=I),z(e),D&&("function"==typeof D?D(e):"object"==typeof D&&(D.current=e))},[F,D,I,V,z]);o.default.useEffect(()=>{T&&H&&_&&v(T,I,F,{locale:$},{kind:R},M)},[F,I,H,$,_,null==A?void 0:A.locale,T,M,R]);let W={ref:U,onClick(e){P||"function"!=typeof O||O(e),P&&r.props&&"function"==typeof r.props.onClick&&r.props.onClick(e),T&&!e.defaultPrevented&&function(e,t,n,r,i,l,s,c,u,f){let{nodeName:d}=e.currentTarget,p="A"===d.toUpperCase();if(p&&(function(e){let t=e.currentTarget,n=t.getAttribute("target");return n&&"_self"!==n||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.nativeEvent&&2===e.nativeEvent.which}(e)||!u&&!(0,a.isLocalURL)(n)))return;e.preventDefault();let h=()=>{"beforePopState"in t?t[i?"replace":"push"](n,r,{shallow:l,locale:c,scroll:s}):t[i?"replace":"push"](r||n,{forceOptimisticNavigation:!f})};u?o.default.startTransition(h):h()}(e,T,I,F,C,E,S,$,M,_)},onMouseEnter(e){P||"function"!=typeof k||k(e),P&&r.props&&"function"==typeof r.props.onMouseEnter&&r.props.onMouseEnter(e),T&&(_||!M)&&v(T,I,F,{locale:$,priority:!0,bypassPrefetchedCheck:!0},{kind:R},M)},onTouchStart(e){P||"function"!=typeof Z||Z(e),P&&r.props&&"function"==typeof r.props.onTouchStart&&r.props.onTouchStart(e),T&&(_||!M)&&v(T,I,F,{locale:$,priority:!0,bypassPrefetchedCheck:!0},{kind:R},M)}};if((0,s.isAbsoluteUrl)(F))W.href=F;else if(!P||w||"a"===r.type&&!("href"in r.props)){let e=void 0!==$?$:null==A?void 0:A.locale,t=(null==A?void 0:A.isLocaleDomain)&&(0,p.getDomainLocale)(F,e,null==A?void 0:A.locales,null==A?void 0:A.domainLocales);W.href=t||(0,h.addBasePath)((0,c.addLocale)(F,e,null==A?void 0:A.defaultLocale))}return P?o.default.cloneElement(r,W):o.default.createElement("a",{...j,...W},n)}),x=b;("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},81307:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"useIntersection",{enumerable:!0,get:function(){return s}});let r=n(67294),o=n(82997),i="function"==typeof IntersectionObserver,a=new Map,l=[];function s(e){let{rootRef:t,rootMargin:n,disabled:s}=e,c=s||!i,[u,f]=(0,r.useState)(!1),d=(0,r.useRef)(null),p=(0,r.useCallback)(e=>{d.current=e},[]);(0,r.useEffect)(()=>{if(i){if(c||u)return;let e=d.current;if(e&&e.tagName){let r=function(e,t,n){let{id:r,observer:o,elements:i}=function(e){let t;let n={root:e.root||null,margin:e.rootMargin||""},r=l.find(e=>e.root===n.root&&e.margin===n.margin);if(r&&(t=a.get(r)))return t;let o=new Map,i=new IntersectionObserver(e=>{e.forEach(e=>{let t=o.get(e.target),n=e.isIntersecting||e.intersectionRatio>0;t&&n&&t(n)})},e);return t={id:n,observer:i,elements:o},l.push(n),a.set(n,t),t}(n);return i.set(e,t),o.observe(e),function(){if(i.delete(e),o.unobserve(e),0===i.size){o.disconnect(),a.delete(r);let e=l.findIndex(e=>e.root===r.root&&e.margin===r.margin);e>-1&&l.splice(e,1)}}}(e,e=>e&&f(e),{root:null==t?void 0:t.current,rootMargin:n});return r}}else if(!u){let e=(0,o.requestIdleCallback)(()=>f(!0));return()=>(0,o.cancelIdleCallback)(e)}},[c,n,t,u,d.current]);let h=(0,r.useCallback)(()=>{f(!1)},[]);return[p,u,h]}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},38083:function(e,t){"use strict";function n(e){let{widthInt:t,heightInt:n,blurWidth:r,blurHeight:o,blurDataURL:i,objectFit:a}=e,l=r||t,s=o||n,c=i.startsWith("data:image/jpeg")?"%3CfeComponentTransfer%3E%3CfeFuncA type='discrete' tableValues='1 1'/%3E%3C/feComponentTransfer%3E%":"";return l&&s?"%3Csvg xmlns='http%3A//www.w3.org/2000/svg' viewBox='0 0 "+l+" "+s+"'%3E%3Cfilter id='b' color-interpolation-filters='sRGB'%3E%3CfeGaussianBlur stdDeviation='"+(r&&o?"1":"20")+"'/%3E"+c+"%3C/filter%3E%3Cimage preserveAspectRatio='none' filter='url(%23b)' x='0' y='0' height='100%25' width='100%25' href='"+i+"'/%3E%3C/svg%3E":"%3Csvg xmlns='http%3A//www.w3.org/2000/svg'%3E%3Cimage style='filter:blur(20px)' preserveAspectRatio='"+("contain"===a?"xMidYMid":"cover"===a?"xMidYMid slice":"none")+"' x='0' y='0' height='100%25' width='100%25' href='"+i+"'/%3E%3C/svg%3E"}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getImageBlurSvg",{enumerable:!0,get:function(){return n}})},31720:function(e,t){"use strict";function n(e){let{config:t,src:n,width:r,quality:o}=e;return t.path+"?url="+encodeURIComponent(n)+"&w="+r+"&q="+(o||75)}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return r}}),n.__next_img_default=!0;let r=n},98751:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{ServerInsertedHTMLContext:function(){return i},useServerInsertedHTML:function(){return a}});let r=n(61757),o=r._(n(67294)),i=o.default.createContext(null);function a(e){let t=(0,o.useContext)(i);t&&t(e)}},91268:function(e,t,n){"use strict";let r,o;n.r(t),n.d(t,{default:function(){return eM}});var i=n(85893),a=n(67294),l=n(41468),s=n(50489),c=n(8937),u=function(){return(0,i.jsx)("svg",{width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 1024 1024",children:(0,i.jsx)("path",{d:"M593.054 120.217C483.656 148.739 402.91 248.212 402.91 366.546c0 140.582 113.962 254.544 254.544 254.544 118.334 0 217.808-80.746 246.328-190.144C909.17 457.12 912 484.23 912 512c0 220.914-179.086 400-400 400S112 732.914 112 512s179.086-400 400-400c27.77 0 54.88 2.83 81.054 8.217z","p-id":"5941"})})},f=function(){return(0,i.jsx)("svg",{width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 1024 1024",children:(0,i.jsx)("path",{d:"M554.6 64h-85.4v128h85.4V64z m258.2 87.4L736 228.2l59.8 59.8 76.8-76.8-59.8-59.8z m-601.6 0l-59.8 59.8 76.8 76.8 59.8-59.8-76.8-76.8zM512 256c-140.8 0-256 115.2-256 256s115.2 256 256 256 256-115.2 256-256-115.2-256-256-256z m448 213.4h-128v85.4h128v-85.4z m-768 0H64v85.4h128v-85.4zM795.8 736L736 795.8l76.8 76.8 59.8-59.8-76.8-76.8z m-567.6 0l-76.8 76.8 59.8 59.8 76.8-76.8-59.8-59.8z m326.4 96h-85.4v128h85.4v-128z","p-id":"7802"})})},d=n(59766),p=n(87462),h=n(63366),m=n(71387),g=n(70917);function v(e){let{styles:t,defaultTheme:n={}}=e,r="function"==typeof t?e=>t(null==e||0===Object.keys(e).length?n:e):t;return(0,i.jsx)(g.xB,{styles:r})}var y=n(56760),b=n(71927);let x="mode",w="color-scheme",C="data-color-scheme";function E(e){if("undefined"!=typeof window&&"system"===e){let e=window.matchMedia("(prefers-color-scheme: dark)");return e.matches?"dark":"light"}}function S(e,t){return"light"===e.mode||"system"===e.mode&&"light"===e.systemMode?t("light"):"dark"===e.mode||"system"===e.mode&&"dark"===e.systemMode?t("dark"):void 0}function $(e,t){let n;if("undefined"!=typeof window){try{(n=localStorage.getItem(e)||void 0)||localStorage.setItem(e,t)}catch(e){}return n||t}}let O=["colorSchemes","components","generateCssVars","cssVarPrefix"];var k=n(1812),Z=n(13951),P=n(2548);let{CssVarsProvider:j,useColorScheme:_,getInitColorSchemeScript:R}=function(e){let{themeId:t,theme:n={},attribute:r=C,modeStorageKey:o=x,colorSchemeStorageKey:l=w,defaultMode:s="light",defaultColorScheme:c,disableTransitionOnChange:u=!1,resolveTheme:f,excludeVariablesFromRoot:g}=e;n.colorSchemes&&("string"!=typeof c||n.colorSchemes[c])&&("object"!=typeof c||n.colorSchemes[null==c?void 0:c.light])&&("object"!=typeof c||n.colorSchemes[null==c?void 0:c.dark])||console.error(`MUI: \`${c}\` does not exist in \`theme.colorSchemes\`.`);let k=a.createContext(void 0),Z="string"==typeof c?c:c.light,P="string"==typeof c?c:c.dark;return{CssVarsProvider:function({children:e,theme:m=n,modeStorageKey:C=o,colorSchemeStorageKey:Z=l,attribute:P=r,defaultMode:j=s,defaultColorScheme:_=c,disableTransitionOnChange:R=u,storageWindow:A="undefined"==typeof window?void 0:window,documentNode:N="undefined"==typeof document?void 0:document,colorSchemeNode:T="undefined"==typeof document?void 0:document.documentElement,colorSchemeSelector:M=":root",disableNestedContext:I=!1,disableStyleSheetGeneration:F=!1}){let L=a.useRef(!1),B=(0,y.Z)(),D=a.useContext(k),z=!!D&&!I,H=m[t],V=H||m,{colorSchemes:U={},components:W={},generateCssVars:K=()=>({vars:{},css:{}}),cssVarPrefix:q}=V,G=(0,h.Z)(V,O),X=Object.keys(U),Y="string"==typeof _?_:_.light,J="string"==typeof _?_:_.dark,{mode:Q,setMode:ee,systemMode:et,lightColorScheme:en,darkColorScheme:er,colorScheme:eo,setColorScheme:ei}=function(e){let{defaultMode:t="light",defaultLightColorScheme:n,defaultDarkColorScheme:r,supportedColorSchemes:o=[],modeStorageKey:i=x,colorSchemeStorageKey:l=w,storageWindow:s="undefined"==typeof window?void 0:window}=e,c=o.join(","),[u,f]=a.useState(()=>{let e=$(i,t),o=$(`${l}-light`,n),a=$(`${l}-dark`,r);return{mode:e,systemMode:E(e),lightColorScheme:o,darkColorScheme:a}}),d=S(u,e=>"light"===e?u.lightColorScheme:"dark"===e?u.darkColorScheme:void 0),h=a.useCallback(e=>{f(n=>{if(e===n.mode)return n;let r=e||t;try{localStorage.setItem(i,r)}catch(e){}return(0,p.Z)({},n,{mode:r,systemMode:E(r)})})},[i,t]),m=a.useCallback(e=>{e?"string"==typeof e?e&&!c.includes(e)?console.error(`\`${e}\` does not exist in \`theme.colorSchemes\`.`):f(t=>{let n=(0,p.Z)({},t);return S(t,t=>{try{localStorage.setItem(`${l}-${t}`,e)}catch(e){}"light"===t&&(n.lightColorScheme=e),"dark"===t&&(n.darkColorScheme=e)}),n}):f(t=>{let o=(0,p.Z)({},t),i=null===e.light?n:e.light,a=null===e.dark?r:e.dark;if(i){if(c.includes(i)){o.lightColorScheme=i;try{localStorage.setItem(`${l}-light`,i)}catch(e){}}else console.error(`\`${i}\` does not exist in \`theme.colorSchemes\`.`)}if(a){if(c.includes(a)){o.darkColorScheme=a;try{localStorage.setItem(`${l}-dark`,a)}catch(e){}}else console.error(`\`${a}\` does not exist in \`theme.colorSchemes\`.`)}return o}):f(e=>{try{localStorage.setItem(`${l}-light`,n),localStorage.setItem(`${l}-dark`,r)}catch(e){}return(0,p.Z)({},e,{lightColorScheme:n,darkColorScheme:r})})},[c,l,n,r]),g=a.useCallback(e=>{"system"===u.mode&&f(t=>(0,p.Z)({},t,{systemMode:null!=e&&e.matches?"dark":"light"}))},[u.mode]),v=a.useRef(g);return v.current=g,a.useEffect(()=>{let e=(...e)=>v.current(...e),t=window.matchMedia("(prefers-color-scheme: dark)");return t.addListener(e),e(t),()=>t.removeListener(e)},[]),a.useEffect(()=>{let e=e=>{let n=e.newValue;"string"==typeof e.key&&e.key.startsWith(l)&&(!n||c.match(n))&&(e.key.endsWith("light")&&m({light:n}),e.key.endsWith("dark")&&m({dark:n})),e.key===i&&(!n||["light","dark","system"].includes(n))&&h(n||t)};if(s)return s.addEventListener("storage",e),()=>s.removeEventListener("storage",e)},[m,h,i,l,c,t,s]),(0,p.Z)({},u,{colorScheme:d,setMode:h,setColorScheme:m})}({supportedColorSchemes:X,defaultLightColorScheme:Y,defaultDarkColorScheme:J,modeStorageKey:C,colorSchemeStorageKey:Z,defaultMode:j,storageWindow:A}),ea=Q,el=eo;z&&(ea=D.mode,el=D.colorScheme);let es=ea||("system"===j?s:j),ec=el||("dark"===es?J:Y),{css:eu,vars:ef}=K(),ed=(0,p.Z)({},G,{components:W,colorSchemes:U,cssVarPrefix:q,vars:ef,getColorSchemeSelector:e=>`[${P}="${e}"] &`}),ep={},eh={};Object.entries(U).forEach(([e,t])=>{let{css:n,vars:r}=K(e);ed.vars=(0,d.Z)(ed.vars,r),e===ec&&(Object.keys(t).forEach(e=>{t[e]&&"object"==typeof t[e]?ed[e]=(0,p.Z)({},ed[e],t[e]):ed[e]=t[e]}),ed.palette&&(ed.palette.colorScheme=e));let o="string"==typeof _?_:"dark"===j?_.dark:_.light;if(e===o){if(g){let t={};g(q).forEach(e=>{t[e]=n[e],delete n[e]}),ep[`[${P}="${e}"]`]=t}ep[`${M}, [${P}="${e}"]`]=n}else eh[`${":root"===M?"":M}[${P}="${e}"]`]=n}),ed.vars=(0,d.Z)(ed.vars,ef),a.useEffect(()=>{el&&T&&T.setAttribute(P,el)},[el,P,T]),a.useEffect(()=>{let e;if(R&&L.current&&N){let t=N.createElement("style");t.appendChild(N.createTextNode("*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),N.head.appendChild(t),window.getComputedStyle(N.body),e=setTimeout(()=>{N.head.removeChild(t)},1)}return()=>{clearTimeout(e)}},[el,R,N]),a.useEffect(()=>(L.current=!0,()=>{L.current=!1}),[]);let em=a.useMemo(()=>({mode:ea,systemMode:et,setMode:ee,lightColorScheme:en,darkColorScheme:er,colorScheme:el,setColorScheme:ei,allColorSchemes:X}),[X,el,er,en,ea,ei,ee,et]),eg=!0;(F||z&&(null==B?void 0:B.cssVarPrefix)===q)&&(eg=!1);let ev=(0,i.jsxs)(a.Fragment,{children:[eg&&(0,i.jsxs)(a.Fragment,{children:[(0,i.jsx)(v,{styles:{[M]:eu}}),(0,i.jsx)(v,{styles:ep}),(0,i.jsx)(v,{styles:eh})]}),(0,i.jsx)(b.Z,{themeId:H?t:void 0,theme:f?f(ed):ed,children:e})]});return z?ev:(0,i.jsx)(k.Provider,{value:em,children:ev})},useColorScheme:()=>{let e=a.useContext(k);if(!e)throw Error((0,m.Z)(19));return e},getInitColorSchemeScript:e=>(function(e){let{defaultMode:t="light",defaultLightColorScheme:n="light",defaultDarkColorScheme:r="dark",modeStorageKey:o=x,colorSchemeStorageKey:a=w,attribute:l=C,colorSchemeNode:s="document.documentElement"}=e||{};return(0,i.jsx)("script",{dangerouslySetInnerHTML:{__html:`(function() { try { + */var n="function"==typeof Symbol&&Symbol.for,r=n?Symbol.for("react.element"):60103,o=n?Symbol.for("react.portal"):60106,i=n?Symbol.for("react.fragment"):60107,a=n?Symbol.for("react.strict_mode"):60108,l=n?Symbol.for("react.profiler"):60114,s=n?Symbol.for("react.provider"):60109,c=n?Symbol.for("react.context"):60110,u=n?Symbol.for("react.async_mode"):60111,f=n?Symbol.for("react.concurrent_mode"):60111,d=n?Symbol.for("react.forward_ref"):60112,p=n?Symbol.for("react.suspense"):60113,h=n?Symbol.for("react.suspense_list"):60120,m=n?Symbol.for("react.memo"):60115,g=n?Symbol.for("react.lazy"):60116,v=n?Symbol.for("react.block"):60121,y=n?Symbol.for("react.fundamental"):60117,b=n?Symbol.for("react.responder"):60118,x=n?Symbol.for("react.scope"):60119;function w(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case u:case f:case i:case l:case a:case p:return e;default:switch(e=e&&e.$$typeof){case c:case d:case g:case m:case s:return e;default:return t}}case o:return t}}}function C(e){return w(e)===f}t.AsyncMode=u,t.ConcurrentMode=f,t.ContextConsumer=c,t.ContextProvider=s,t.Element=r,t.ForwardRef=d,t.Fragment=i,t.Lazy=g,t.Memo=m,t.Portal=o,t.Profiler=l,t.StrictMode=a,t.Suspense=p,t.isAsyncMode=function(e){return C(e)||w(e)===u},t.isConcurrentMode=C,t.isContextConsumer=function(e){return w(e)===c},t.isContextProvider=function(e){return w(e)===s},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return w(e)===d},t.isFragment=function(e){return w(e)===i},t.isLazy=function(e){return w(e)===g},t.isMemo=function(e){return w(e)===m},t.isPortal=function(e){return w(e)===o},t.isProfiler=function(e){return w(e)===l},t.isStrictMode=function(e){return w(e)===a},t.isSuspense=function(e){return w(e)===p},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===f||e===l||e===a||e===p||e===h||"object"==typeof e&&null!==e&&(e.$$typeof===g||e.$$typeof===m||e.$$typeof===s||e.$$typeof===c||e.$$typeof===d||e.$$typeof===y||e.$$typeof===b||e.$$typeof===x||e.$$typeof===v)},t.typeOf=w},21296:function(e,t,n){"use strict";e.exports=n(96103)},62705:function(e,t,n){var r=n(55639).Symbol;e.exports=r},44239:function(e,t,n){var r=n(62705),o=n(89607),i=n(2333),a=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":a&&a in Object(e)?o(e):i(e)}},27561:function(e,t,n){var r=n(67990),o=/^\s+/;e.exports=function(e){return e?e.slice(0,r(e)+1).replace(o,""):e}},31957:function(e,t,n){var r="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;e.exports=r},89607:function(e,t,n){var r=n(62705),o=Object.prototype,i=o.hasOwnProperty,a=o.toString,l=r?r.toStringTag:void 0;e.exports=function(e){var t=i.call(e,l),n=e[l];try{e[l]=void 0;var r=!0}catch(e){}var o=a.call(e);return r&&(t?e[l]=n:delete e[l]),o}},2333:function(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},55639:function(e,t,n){var r=n(31957),o="object"==typeof self&&self&&self.Object===Object&&self,i=r||o||Function("return this")();e.exports=i},67990:function(e){var t=/\s/;e.exports=function(e){for(var n=e.length;n--&&t.test(e.charAt(n)););return n}},23279:function(e,t,n){var r=n(13218),o=n(7771),i=n(14841),a=Math.max,l=Math.min;e.exports=function(e,t,n){var s,c,u,f,d,p,h=0,m=!1,g=!1,v=!0;if("function"!=typeof e)throw TypeError("Expected a function");function y(t){var n=s,r=c;return s=c=void 0,h=t,f=e.apply(r,n)}function b(e){var n=e-p,r=e-h;return void 0===p||n>=t||n<0||g&&r>=u}function x(){var e,n,r,i=o();if(b(i))return w(i);d=setTimeout(x,(e=i-p,n=i-h,r=t-e,g?l(r,u-n):r))}function w(e){return(d=void 0,v&&s)?y(e):(s=c=void 0,f)}function C(){var e,n=o(),r=b(n);if(s=arguments,c=this,p=n,r){if(void 0===d)return h=e=p,d=setTimeout(x,t),m?y(e):f;if(g)return clearTimeout(d),d=setTimeout(x,t),y(p)}return void 0===d&&(d=setTimeout(x,t)),f}return t=i(t)||0,r(n)&&(m=!!n.leading,u=(g="maxWait"in n)?a(i(n.maxWait)||0,t):u,v="trailing"in n?!!n.trailing:v),C.cancel=function(){void 0!==d&&clearTimeout(d),h=0,s=p=c=d=void 0},C.flush=function(){return void 0===d?f:w(o())},C}},13218:function(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},37005:function(e){e.exports=function(e){return null!=e&&"object"==typeof e}},33448:function(e,t,n){var r=n(44239),o=n(37005);e.exports=function(e){return"symbol"==typeof e||o(e)&&"[object Symbol]"==r(e)}},7771:function(e,t,n){var r=n(55639);e.exports=function(){return r.Date.now()}},23493:function(e,t,n){var r=n(23279),o=n(13218);e.exports=function(e,t,n){var i=!0,a=!0;if("function"!=typeof e)throw TypeError("Expected a function");return o(n)&&(i="leading"in n?!!n.leading:i,a="trailing"in n?!!n.trailing:a),r(e,t,{leading:i,maxWait:t,trailing:a})}},14841:function(e,t,n){var r=n(27561),o=n(13218),i=n(33448),a=0/0,l=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,c=/^0o[0-7]+$/i,u=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(i(e))return a;if(o(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=o(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var n=s.test(e);return n||c.test(e)?u(e.slice(2),n?2:8):l.test(e)?a:+e}},83454:function(e,t,n){"use strict";var r,o;e.exports=(null==(r=n.g.process)?void 0:r.env)&&"object"==typeof(null==(o=n.g.process)?void 0:o.env)?n.g.process:n(77663)},6840:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/_app",function(){return n(37262)}])},41468:function(e,t,n){"use strict";n.d(t,{R:function(){return c},p:function(){return s}});var r=n(85893),o=n(67294),i=n(50489),a=n(577),l=n(39332);let s=(0,o.createContext)({scene:"",chatId:"",modelList:[],model:"",dbParam:void 0,dialogueList:[],agentList:[],setAgentList:()=>{},setModel:()=>{},setIsContract:()=>{},setIsMenuExpand:()=>{},setDbParam:()=>void 0,queryDialogueList:()=>{},refreshDialogList:()=>{}}),c=e=>{var t,n,c;let{children:u}=e,f=(0,l.useSearchParams)(),d=null!==(t=null==f?void 0:f.get("id"))&&void 0!==t?t:"",p=null!==(n=null==f?void 0:f.get("scene"))&&void 0!==n?n:"",h=null!==(c=null==f?void 0:f.get("db_param"))&&void 0!==c?c:"",[m,g]=(0,o.useState)(!1),[v,y]=(0,o.useState)(""),[b,x]=(0,o.useState)("chat_dashboard"!==p),[w,C]=(0,o.useState)(h),[E,S]=(0,o.useState)([]),{run:$,data:O=[],refresh:k}=(0,a.Z)(async()=>{let[,e]=await (0,i.Vx)((0,i.iP)());return null!=e?e:[]},{manual:!0}),{data:Z=[]}=(0,a.Z)(async()=>{let[,e]=await (0,i.Vx)((0,i.Vw)());return null!=e?e:[]});(0,o.useEffect)(()=>{y(Z[0])},[Z,null==Z?void 0:Z.length]);let P=(0,o.useMemo)(()=>O.find(e=>e.conv_uid===d),[d,O]);return(0,r.jsx)(s.Provider,{value:{isContract:m,isMenuExpand:b,scene:p,chatId:d,modelList:Z,model:v,dbParam:w||h,dialogueList:O,agentList:E,setAgentList:S,setModel:y,setIsContract:g,setIsMenuExpand:x,setDbParam:C,queryDialogueList:$,refreshDialogList:k,currentDialogue:P},children:u})}},58989:function(e,t,n){"use strict";n.d(t,{Z:function(){return D}});let r={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console&&console[e]&&console[e].apply(console,t)}};class o{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.init(e,t)}init(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||r,this.options=t,this.debug=t.debug}log(){for(var e=arguments.length,t=Array(e),n=0;n{this.observers[e]=this.observers[e]||[],this.observers[e].push(t)}),this}off(e,t){if(this.observers[e]){if(!t){delete this.observers[e];return}this.observers[e]=this.observers[e].filter(e=>e!==t)}}emit(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r{e(...n)})}if(this.observers["*"]){let t=[].concat(this.observers["*"]);t.forEach(t=>{t.apply(t,[e,...n])})}}}function l(){let e,t;let n=new Promise((n,r)=>{e=n,t=r});return n.resolve=e,n.reject=t,n}function s(e){return null==e?"":""+e}function c(e,t,n){function r(e){return e&&e.indexOf("###")>-1?e.replace(/###/g,"."):e}function o(){return!e||"string"==typeof e}let i="string"!=typeof t?[].concat(t):t.split(".");for(;i.length>1;){if(o())return{};let t=r(i.shift());!e[t]&&n&&(e[t]=new n),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{}}return o()?{}:{obj:e,k:r(i.shift())}}function u(e,t,n){let{obj:r,k:o}=c(e,t,Object);r[o]=n}function f(e,t){let{obj:n,k:r}=c(e,t);if(n)return n[r]}function d(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var p={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function h(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,e=>p[e]):e}let m=[" ",",","?","!",";"];function g(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".";if(!e)return;if(e[t])return e[t];let r=t.split(n),o=e;for(let e=0;ee+i;)i++,l=o[a=r.slice(e,e+i).join(n)];if(void 0===l)return;if(null===l)return null;if(t.endsWith(a)){if("string"==typeof l)return l;if(a&&"string"==typeof l[a])return l[a]}let s=r.slice(e+i).join(n);if(s)return g(l,s,n);return}o=o[r[e]]}return o}function v(e){return e&&e.indexOf("_")>0?e.replace("_","-"):e}class y extends a{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=e||{},this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),void 0===this.options.ignoreJSONStructure&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){0>this.options.ns.indexOf(e)&&this.options.ns.push(e)}removeNamespaces(e){let t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,i=void 0!==r.ignoreJSONStructure?r.ignoreJSONStructure:this.options.ignoreJSONStructure,a=[e,t];n&&"string"!=typeof n&&(a=a.concat(n)),n&&"string"==typeof n&&(a=a.concat(o?n.split(o):n)),e.indexOf(".")>-1&&(a=e.split("."));let l=f(this.data,a);return l||!i||"string"!=typeof n?l:g(this.data&&this.data[e]&&this.data[e][t],n,o)}addResource(e,t,n,r){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},i=void 0!==o.keySeparator?o.keySeparator:this.options.keySeparator,a=[e,t];n&&(a=a.concat(i?n.split(i):n)),e.indexOf(".")>-1&&(a=e.split("."),r=t,t=a[1]),this.addNamespaces(t),u(this.data,a,r),o.silent||this.emit("added",e,t,n,r)}addResources(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(let r in n)("string"==typeof n[r]||"[object Array]"===Object.prototype.toString.apply(n[r]))&&this.addResource(e,t,r,n[r],{silent:!0});r.silent||this.emit("added",e,t,n)}addResourceBundle(e,t,n,r,o){let i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},a=[e,t];e.indexOf(".")>-1&&(a=e.split("."),r=n,n=t,t=a[1]),this.addNamespaces(t);let l=f(this.data,a)||{};r?function e(t,n,r){for(let o in n)"__proto__"!==o&&"constructor"!==o&&(o in t?"string"==typeof t[o]||t[o]instanceof String||"string"==typeof n[o]||n[o]instanceof String?r&&(t[o]=n[o]):e(t[o],n[o],r):t[o]=n[o]);return t}(l,n,o):l={...l,...n},u(this.data,a,l),i.silent||this.emit("added",e,t,n)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return void 0!==this.getResource(e,t)}getResourceBundle(e,t){return(t||(t=this.options.defaultNS),"v1"===this.options.compatibilityAPI)?{...this.getResource(e,t)}:this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){let t=this.getDataByLanguage(e),n=t&&Object.keys(t)||[];return!!n.find(e=>t[e]&&Object.keys(t[e]).length>0)}toJSON(){return this.data}}var b={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,o){return e.forEach(e=>{this.processors[e]&&(t=this.processors[e].process(t,n,r,o))}),t}};let x={};class w extends a{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(),function(e,t,n){e.forEach(e=>{t[e]&&(n[e]=t[e])})}(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=i.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};if(null==e)return!1;let n=this.resolve(e,t);return n&&void 0!==n.res}extractFromKey(e,t){let n=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");let r=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,o=t.ns||this.options.defaultNS||[],i=n&&e.indexOf(n)>-1,a=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!function(e,t,n){t=t||"",n=n||"";let r=m.filter(e=>0>t.indexOf(e)&&0>n.indexOf(e));if(0===r.length)return!0;let o=RegExp(`(${r.map(e=>"?"===e?"\\?":e).join("|")})`),i=!o.test(e);if(!i){let t=e.indexOf(n);t>0&&!o.test(e.substring(0,t))&&(i=!0)}return i}(e,n,r);if(i&&!a){let t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:o};let i=e.split(n);(n!==r||n===r&&this.options.ns.indexOf(i[0])>-1)&&(o=i.shift()),e=i.join(r)}return"string"==typeof o&&(o=[o]),{key:e,namespaces:o}}translate(e,t,n){if("object"!=typeof t&&this.options.overloadTranslationOptionHandler&&(t=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof t&&(t={...t}),t||(t={}),null==e)return"";Array.isArray(e)||(e=[String(e)]);let r=void 0!==t.returnDetails?t.returnDetails:this.options.returnDetails,o=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,{key:i,namespaces:a}=this.extractFromKey(e[e.length-1],t),l=a[a.length-1],s=t.lng||this.language,c=t.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(s&&"cimode"===s.toLowerCase()){if(c){let e=t.nsSeparator||this.options.nsSeparator;return r?{res:`${l}${e}${i}`,usedKey:i,exactUsedKey:i,usedLng:s,usedNS:l}:`${l}${e}${i}`}return r?{res:i,usedKey:i,exactUsedKey:i,usedLng:s,usedNS:l}:i}let u=this.resolve(e,t),f=u&&u.res,d=u&&u.usedKey||i,p=u&&u.exactUsedKey||i,h=Object.prototype.toString.apply(f),m=void 0!==t.joinArrays?t.joinArrays:this.options.joinArrays,g=!this.i18nFormat||this.i18nFormat.handleAsObject,v="string"!=typeof f&&"boolean"!=typeof f&&"number"!=typeof f;if(g&&f&&v&&0>["[object Number]","[object Function]","[object RegExp]"].indexOf(h)&&!("string"==typeof m&&"[object Array]"===h)){if(!t.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");let e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(d,f,{...t,ns:a}):`key '${i} (${this.language})' returned an object instead of string.`;return r?(u.res=e,u):e}if(o){let e="[object Array]"===h,n=e?[]:{},r=e?p:d;for(let e in f)if(Object.prototype.hasOwnProperty.call(f,e)){let i=`${r}${o}${e}`;n[e]=this.translate(i,{...t,joinArrays:!1,ns:a}),n[e]===i&&(n[e]=f[e])}f=n}}else if(g&&"string"==typeof m&&"[object Array]"===h)(f=f.join(m))&&(f=this.extendTranslation(f,e,t,n));else{let r=!1,a=!1,c=void 0!==t.count&&"string"!=typeof t.count,d=w.hasDefaultValue(t),p=c?this.pluralResolver.getSuffix(s,t.count,t):"",h=t.ordinal&&c?this.pluralResolver.getSuffix(s,t.count,{ordinal:!1}):"",m=t[`defaultValue${p}`]||t[`defaultValue${h}`]||t.defaultValue;!this.isValidLookup(f)&&d&&(r=!0,f=m),this.isValidLookup(f)||(a=!0,f=i);let g=t.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,v=g&&a?void 0:f,y=d&&m!==f&&this.options.updateMissing;if(a||r||y){if(this.logger.log(y?"updateKey":"missingKey",s,l,i,y?m:f),o){let e=this.resolve(i,{...t,keySeparator:!1});e&&e.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let e=[],n=this.languageUtils.getFallbackCodes(this.options.fallbackLng,t.lng||this.language);if("fallback"===this.options.saveMissingTo&&n&&n[0])for(let t=0;t{let o=d&&r!==f?r:v;this.options.missingKeyHandler?this.options.missingKeyHandler(e,l,n,o,y,t):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(e,l,n,o,y,t),this.emit("missingKey",e,l,n,f)};this.options.saveMissing&&(this.options.saveMissingPlurals&&c?e.forEach(e=>{this.pluralResolver.getSuffixes(e,t).forEach(n=>{r([e],i+n,t[`defaultValue${n}`]||m)})}):r(e,i,m))}f=this.extendTranslation(f,e,t,u,n),a&&f===i&&this.options.appendNamespaceToMissingKey&&(f=`${l}:${i}`),(a||r)&&this.options.parseMissingKeyHandler&&(f="v1"!==this.options.compatibilityAPI?this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}:${i}`:i,r?f:void 0):this.options.parseMissingKeyHandler(f))}return r?(u.res=f,u):f}extendTranslation(e,t,n,r,o){var i=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){let a;n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});let l="string"==typeof e&&(n&&n.interpolation&&void 0!==n.interpolation.skipOnVariables?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);if(l){let t=e.match(this.interpolator.nestingRegexp);a=t&&t.length}let s=n.replace&&"string"!=typeof n.replace?n.replace:n;if(this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),e=this.interpolator.interpolate(e,s,n.lng||this.language,n),l){let t=e.match(this.interpolator.nestingRegexp),r=t&&t.length;a1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof e&&(e=[e]),e.forEach(e=>{if(this.isValidLookup(t))return;let l=this.extractFromKey(e,a),s=l.key;n=s;let c=l.namespaces;this.options.fallbackNS&&(c=c.concat(this.options.fallbackNS));let u=void 0!==a.count&&"string"!=typeof a.count,f=u&&!a.ordinal&&0===a.count&&this.pluralResolver.shouldUseIntlApi(),d=void 0!==a.context&&("string"==typeof a.context||"number"==typeof a.context)&&""!==a.context,p=a.lngs?a.lngs:this.languageUtils.toResolveHierarchy(a.lng||this.language,a.fallbackLng);c.forEach(e=>{this.isValidLookup(t)||(i=e,!x[`${p[0]}-${e}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(i)&&(x[`${p[0]}-${e}`]=!0,this.logger.warn(`key "${n}" for languages "${p.join(", ")}" won't get resolved as namespace "${i}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),p.forEach(n=>{let i;if(this.isValidLookup(t))return;o=n;let l=[s];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(l,s,n,e,a);else{let e;u&&(e=this.pluralResolver.getSuffix(n,a.count,a));let t=`${this.options.pluralSeparator}zero`,r=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(u&&(l.push(s+e),a.ordinal&&0===e.indexOf(r)&&l.push(s+e.replace(r,this.options.pluralSeparator)),f&&l.push(s+t)),d){let n=`${s}${this.options.contextSeparator}${a.context}`;l.push(n),u&&(l.push(n+e),a.ordinal&&0===e.indexOf(r)&&l.push(n+e.replace(r,this.options.pluralSeparator)),f&&l.push(n+t))}}for(;i=l.pop();)this.isValidLookup(t)||(r=i,t=this.getResource(n,e,i,a))}))})}),{res:t,usedKey:n,exactUsedKey:r,usedLng:o,usedNS:i}}isValidLookup(e){return void 0!==e&&!(!this.options.returnNull&&null===e)&&!(!this.options.returnEmptyString&&""===e)}getResource(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}static hasDefaultValue(e){let t="defaultValue";for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t===n.substring(0,t.length)&&void 0!==e[n])return!0;return!1}}function C(e){return e.charAt(0).toUpperCase()+e.slice(1)}class E{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=i.create("languageUtils")}getScriptPartFromCode(e){if(!(e=v(e))||0>e.indexOf("-"))return null;let t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase())?null:this.formatLanguageCode(t.join("-"))}getLanguagePartFromCode(e){if(!(e=v(e))||0>e.indexOf("-"))return e;let t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if("string"==typeof e&&e.indexOf("-")>-1){let t=["hans","hant","latn","cyrl","cans","mong","arab"],n=e.split("-");return this.options.lowerCaseLng?n=n.map(e=>e.toLowerCase()):2===n.length?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=C(n[1].toLowerCase()))):3===n.length&&(n[0]=n[0].toLowerCase(),2===n[1].length&&(n[1]=n[1].toUpperCase()),"sgn"!==n[0]&&2===n[2].length&&(n[2]=n[2].toUpperCase()),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=C(n[1].toLowerCase())),t.indexOf(n[2].toLowerCase())>-1&&(n[2]=C(n[2].toLowerCase()))),n.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){let t;return e?(e.forEach(e=>{if(t)return;let n=this.formatLanguageCode(e);(!this.options.supportedLngs||this.isSupportedCode(n))&&(t=n)}),!t&&this.options.supportedLngs&&e.forEach(e=>{if(t)return;let n=this.getLanguagePartFromCode(e);if(this.isSupportedCode(n))return t=n;t=this.options.supportedLngs.find(e=>{if(e===n||!(0>e.indexOf("-")&&0>n.indexOf("-"))&&0===e.indexOf(n))return e})}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t):null}getFallbackCodes(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),"string"==typeof e&&(e=[e]),"[object Array]"===Object.prototype.toString.apply(e))return e;if(!t)return e.default||[];let n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}toResolveHierarchy(e,t){let n=this.getFallbackCodes(t||this.options.fallbackLng||[],e),r=[],o=e=>{e&&(this.isSupportedCode(e)?r.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return"string"==typeof e&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?("languageOnly"!==this.options.load&&o(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&o(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&o(this.getLanguagePartFromCode(e))):"string"==typeof e&&o(this.formatLanguageCode(e)),n.forEach(e=>{0>r.indexOf(e)&&o(this.formatLanguageCode(e))}),r}}let S=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],$={1:function(e){return Number(e>1)},2:function(e){return Number(1!=e)},3:function(e){return 0},4:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},5:function(e){return Number(0==e?0:1==e?1:2==e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5)},6:function(e){return Number(1==e?0:e>=2&&e<=4?1:2)},7:function(e){return Number(1==e?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},8:function(e){return Number(1==e?0:2==e?1:8!=e&&11!=e?2:3)},9:function(e){return Number(e>=2)},10:function(e){return Number(1==e?0:2==e?1:e<7?2:e<11?3:4)},11:function(e){return Number(1==e||11==e?0:2==e||12==e?1:e>2&&e<20?2:3)},12:function(e){return Number(e%10!=1||e%100==11)},13:function(e){return Number(0!==e)},14:function(e){return Number(1==e?0:2==e?1:3==e?2:3)},15:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2)},16:function(e){return Number(e%10==1&&e%100!=11?0:0!==e?1:2)},17:function(e){return Number(1==e||e%10==1&&e%100!=11?0:1)},18:function(e){return Number(0==e?0:1==e?1:2)},19:function(e){return Number(1==e?0:0==e||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3)},20:function(e){return Number(1==e?0:0==e||e%100>0&&e%100<20?1:2)},21:function(e){return Number(e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0)},22:function(e){return Number(1==e?0:2==e?1:(e<0||e>10)&&e%10==0?2:3)}},O=["v1","v2","v3"],k=["v4"],Z={zero:0,one:1,two:2,few:3,many:4,other:5};class P{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.languageUtils=e,this.options=t,this.logger=i.create("pluralResolver"),(!this.options.compatibilityJSON||k.includes(this.options.compatibilityJSON))&&("undefined"==typeof Intl||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=function(){let e={};return S.forEach(t=>{t.lngs.forEach(n=>{e[n]={numbers:t.nr,plurals:$[t.fc]}})}),e}()}addRule(e,t){this.rules[e]=t}getRule(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(v(e),{type:t.ordinal?"ordinal":"cardinal"})}catch{return}return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}needsPlural(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.getRule(e,t);return this.shouldUseIntlApi()?n&&n.resolvedOptions().pluralCategories.length>1:n&&n.numbers.length>1}getPluralFormsOfKey(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.getSuffixes(e,n).map(e=>`${t}${e}`)}getSuffixes(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.getRule(e,t);return n?this.shouldUseIntlApi()?n.resolvedOptions().pluralCategories.sort((e,t)=>Z[e]-Z[t]).map(e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${e}`):n.numbers.map(n=>this.getSuffix(e,n,t)):[]}getSuffix(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.getRule(e,n);return r?this.shouldUseIntlApi()?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${r.select(t)}`:this.getSuffixRetroCompatible(r,t):(this.logger.warn(`no plural rule found for: ${e}`),"")}getSuffixRetroCompatible(e,t){let n=e.noAbs?e.plurals(t):e.plurals(Math.abs(t)),r=e.numbers[n];this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]&&(2===r?r="plural":1===r&&(r=""));let o=()=>this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString();return"v1"===this.options.compatibilityJSON?1===r?"":"number"==typeof r?`_plural_${r.toString()}`:o():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]?o():this.options.prepend&&n.toString()?this.options.prepend+n.toString():n.toString()}shouldUseIntlApi(){return!O.includes(this.options.compatibilityJSON)}}function j(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:".",o=!(arguments.length>4)||void 0===arguments[4]||arguments[4],i=function(e,t,n){let r=f(e,n);return void 0!==r?r:f(t,n)}(e,t,n);return!i&&o&&"string"==typeof n&&void 0===(i=g(e,n,r))&&(i=g(t,n,r)),i}class _{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.logger=i.create("interpolator"),this.options=e,this.format=e.interpolation&&e.interpolation.format||(e=>e),this.init(e)}init(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});let t=e.interpolation;this.escape=void 0!==t.escape?t.escape:h,this.escapeValue=void 0===t.escapeValue||t.escapeValue,this.useRawValueToEscape=void 0!==t.useRawValueToEscape&&t.useRawValueToEscape,this.prefix=t.prefix?d(t.prefix):t.prefixEscaped||"{{",this.suffix=t.suffix?d(t.suffix):t.suffixEscaped||"}}",this.formatSeparator=t.formatSeparator?t.formatSeparator:t.formatSeparator||",",this.unescapePrefix=t.unescapeSuffix?"":t.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":t.unescapeSuffix||"",this.nestingPrefix=t.nestingPrefix?d(t.nestingPrefix):t.nestingPrefixEscaped||d("$t("),this.nestingSuffix=t.nestingSuffix?d(t.nestingSuffix):t.nestingSuffixEscaped||d(")"),this.nestingOptionsSeparator=t.nestingOptionsSeparator?t.nestingOptionsSeparator:t.nestingOptionsSeparator||",",this.maxReplaces=t.maxReplaces?t.maxReplaces:1e3,this.alwaysFormat=void 0!==t.alwaysFormat&&t.alwaysFormat,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){let e=`${this.prefix}(.+?)${this.suffix}`;this.regexp=RegExp(e,"g");let t=`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`;this.regexpUnescape=RegExp(t,"g");let n=`${this.nestingPrefix}(.+?)${this.nestingSuffix}`;this.nestingRegexp=RegExp(n,"g")}interpolate(e,t,n,r){let o,i,a;let l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function c(e){return e.replace(/\$/g,"$$$$")}let u=e=>{if(0>e.indexOf(this.formatSeparator)){let o=j(t,l,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(o,void 0,n,{...r,...t,interpolationkey:e}):o}let o=e.split(this.formatSeparator),i=o.shift().trim(),a=o.join(this.formatSeparator).trim();return this.format(j(t,l,i,this.options.keySeparator,this.options.ignoreJSONStructure),a,n,{...r,...t,interpolationkey:i})};this.resetRegExp();let f=r&&r.missingInterpolationHandler||this.options.missingInterpolationHandler,d=r&&r.interpolation&&void 0!==r.interpolation.skipOnVariables?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables,p=[{regex:this.regexpUnescape,safeValue:e=>c(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?c(this.escape(e)):c(e)}];return p.forEach(t=>{for(a=0;o=t.regex.exec(e);){let n=o[1].trim();if(void 0===(i=u(n))){if("function"==typeof f){let t=f(e,o,r);i="string"==typeof t?t:""}else if(r&&Object.prototype.hasOwnProperty.call(r,n))i="";else if(d){i=o[0];continue}else this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`),i=""}else"string"==typeof i||this.useRawValueToEscape||(i=s(i));let l=t.safeValue(i);if(e=e.replace(o[0],l),d?(t.regex.lastIndex+=i.length,t.regex.lastIndex-=o[0].length):t.regex.lastIndex=0,++a>=this.maxReplaces)break}}),e}nest(e,t){let n,r,o,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};function a(e,t){let n=this.nestingOptionsSeparator;if(0>e.indexOf(n))return e;let r=e.split(RegExp(`${n}[ ]*{`)),i=`{${r[1]}`;e=r[0],i=this.interpolate(i,o);let a=i.match(/'/g),l=i.match(/"/g);(a&&a.length%2==0&&!l||l.length%2!=0)&&(i=i.replace(/'/g,'"'));try{o=JSON.parse(i),t&&(o={...t,...o})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${n}${i}`}return delete o.defaultValue,e}for(;n=this.nestingRegexp.exec(e);){let l=[];(o=(o={...i}).replace&&"string"!=typeof o.replace?o.replace:o).applyPostProcessor=!1,delete o.defaultValue;let c=!1;if(-1!==n[0].indexOf(this.formatSeparator)&&!/{.*}/.test(n[1])){let e=n[1].split(this.formatSeparator).map(e=>e.trim());n[1]=e.shift(),l=e,c=!0}if((r=t(a.call(this,n[1].trim(),o),o))&&n[0]===e&&"string"!=typeof r)return r;"string"!=typeof r&&(r=s(r)),r||(this.logger.warn(`missed to resolve ${n[1]} for nesting ${e}`),r=""),c&&(r=l.reduce((e,t)=>this.format(e,t,i.lng,{...i,interpolationkey:n[1].trim()}),r.trim())),e=e.replace(n[0],r),this.regexp.lastIndex=0}return e}}function R(e){let t={};return function(n,r,o){let i=r+JSON.stringify(o),a=t[i];return a||(a=e(v(r),o),t[i]=a),a(n)}}class A{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.logger=i.create("formatter"),this.options=e,this.formats={number:R((e,t)=>{let n=new Intl.NumberFormat(e,{...t});return e=>n.format(e)}),currency:R((e,t)=>{let n=new Intl.NumberFormat(e,{...t,style:"currency"});return e=>n.format(e)}),datetime:R((e,t)=>{let n=new Intl.DateTimeFormat(e,{...t});return e=>n.format(e)}),relativetime:R((e,t)=>{let n=new Intl.RelativeTimeFormat(e,{...t});return e=>n.format(e,t.range||"day")}),list:R((e,t)=>{let n=new Intl.ListFormat(e,{...t});return e=>n.format(e)})},this.init(e)}init(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}},n=t.interpolation;this.formatSeparator=n.formatSeparator?n.formatSeparator:n.formatSeparator||","}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=R(t)}format(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=t.split(this.formatSeparator),i=o.reduce((e,t)=>{let{formatName:o,formatOptions:i}=function(e){let t=e.toLowerCase().trim(),n={};if(e.indexOf("(")>-1){let r=e.split("(");t=r[0].toLowerCase().trim();let o=r[1].substring(0,r[1].length-1);if("currency"===t&&0>o.indexOf(":"))n.currency||(n.currency=o.trim());else if("relativetime"===t&&0>o.indexOf(":"))n.range||(n.range=o.trim());else{let e=o.split(";");e.forEach(e=>{if(!e)return;let[t,...r]=e.split(":"),o=r.join(":").trim().replace(/^'+|'+$/g,"");n[t.trim()]||(n[t.trim()]=o),"false"===o&&(n[t.trim()]=!1),"true"===o&&(n[t.trim()]=!0),isNaN(o)||(n[t.trim()]=parseInt(o,10))})}}return{formatName:t,formatOptions:n}}(t);if(this.formats[o]){let t=e;try{let a=r&&r.formatParams&&r.formatParams[r.interpolationkey]||{},l=a.locale||a.lng||r.locale||r.lng||n;t=this.formats[o](e,l,{...i,...r,...a})}catch(e){this.logger.warn(e)}return t}return this.logger.warn(`there was no format function for ${o}`),e},e);return i}}class N extends a{constructor(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=r,this.logger=i.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=r.maxParallelReads||10,this.readingCalls=0,this.maxRetries=r.maxRetries>=0?r.maxRetries:5,this.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(n,r.backend,r)}queueLoad(e,t,n,r){let o={},i={},a={},l={};return e.forEach(e=>{let r=!0;t.forEach(t=>{let a=`${e}|${t}`;!n.reload&&this.store.hasResourceBundle(e,t)?this.state[a]=2:this.state[a]<0||(1===this.state[a]?void 0===i[a]&&(i[a]=!0):(this.state[a]=1,r=!1,void 0===i[a]&&(i[a]=!0),void 0===o[a]&&(o[a]=!0),void 0===l[t]&&(l[t]=!0)))}),r||(a[e]=!0)}),(Object.keys(o).length||Object.keys(i).length)&&this.queue.push({pending:i,pendingCount:Object.keys(i).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(o),pending:Object.keys(i),toLoadLanguages:Object.keys(a),toLoadNamespaces:Object.keys(l)}}loaded(e,t,n){let r=e.split("|"),o=r[0],i=r[1];t&&this.emit("failedLoading",o,i,t),n&&this.store.addResourceBundle(o,i,n),this.state[e]=t?-1:2;let a={};this.queue.forEach(n=>{(function(e,t,n,r){let{obj:o,k:i}=c(e,t,Object);o[i]=o[i]||[],r&&(o[i]=o[i].concat(n)),r||o[i].push(n)})(n.loaded,[o],i),void 0!==n.pending[e]&&(delete n.pending[e],n.pendingCount--),t&&n.errors.push(t),0!==n.pendingCount||n.done||(Object.keys(n.loaded).forEach(e=>{a[e]||(a[e]={});let t=n.loaded[e];t.length&&t.forEach(t=>{void 0===a[e][t]&&(a[e][t]=!0)})}),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())}),this.emit("loaded",a),this.queue=this.queue.filter(e=>!e.done)}read(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.retryTimeout,i=arguments.length>5?arguments[5]:void 0;if(!e.length)return i(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:t,fcName:n,tried:r,wait:o,callback:i});return}this.readingCalls++;let a=(a,l)=>{if(this.readingCalls--,this.waitingReads.length>0){let e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}if(a&&l&&r{this.read.call(this,e,t,n,r+1,2*o,i)},o);return}i(a,l)},l=this.backend[n].bind(this.backend);if(2===l.length){try{let n=l(e,t);n&&"function"==typeof n.then?n.then(e=>a(null,e)).catch(a):a(null,n)}catch(e){a(e)}return}return l(e,t,a)}prepareLoading(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),r&&r();"string"==typeof e&&(e=this.languageUtils.toResolveHierarchy(e)),"string"==typeof t&&(t=[t]);let o=this.queueLoad(e,t,n,r);if(!o.toLoad.length)return o.pending.length||r(),null;o.toLoad.forEach(e=>{this.loadOne(e)})}load(e,t,n){this.prepareLoading(e,t,{},n)}reload(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}loadOne(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=e.split("|"),r=n[0],o=n[1];this.read(r,o,"read",void 0,void 0,(n,i)=>{n&&this.logger.warn(`${t}loading namespace ${o} for language ${r} failed`,n),!n&&i&&this.logger.log(`${t}loaded namespace ${o} for language ${r}`,i),this.loaded(e,n,i)})}saveMissing(e,t,n,r,o){let i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(t)){this.logger.warn(`did not save key "${n}" as the namespace "${t}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(null!=n&&""!==n){if(this.backend&&this.backend.create){let l={...i,isUpdate:o},s=this.backend.create.bind(this.backend);if(s.length<6)try{let o;(o=5===s.length?s(e,t,n,r,l):s(e,t,n,r))&&"function"==typeof o.then?o.then(e=>a(null,e)).catch(a):a(null,o)}catch(e){a(e)}else s(e,t,n,r,a,l)}e&&e[0]&&this.store.addResource(e[0],t,n,r)}}}function T(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){let t={};if("object"==typeof e[1]&&(t=e[1]),"string"==typeof e[1]&&(t.defaultValue=e[1]),"string"==typeof e[2]&&(t.tDescription=e[2]),"object"==typeof e[2]||"object"==typeof e[3]){let n=e[3]||e[2];Object.keys(n).forEach(e=>{t[e]=n[e]})}return t},interpolation:{escapeValue:!0,format:(e,t,n,r)=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function M(e){return"string"==typeof e.ns&&(e.ns=[e.ns]),"string"==typeof e.fallbackLng&&(e.fallbackLng=[e.fallbackLng]),"string"==typeof e.fallbackNS&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&0>e.supportedLngs.indexOf("cimode")&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function I(){}class F extends a{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;if(super(),this.options=M(e),this.services={},this.logger=i,this.modules={external:[]},!function(e){let t=Object.getOwnPropertyNames(Object.getPrototypeOf(e));t.forEach(t=>{"function"==typeof e[t]&&(e[t]=e[t].bind(e))})}(this),t&&!this.isInitialized&&!e.isClone){if(!this.options.initImmediate)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(){var e=this;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;"function"==typeof t&&(n=t,t={}),!t.defaultNS&&!1!==t.defaultNS&&t.ns&&("string"==typeof t.ns?t.defaultNS=t.ns:0>t.ns.indexOf("translation")&&(t.defaultNS=t.ns[0]));let r=T();function o(e){return e?"function"==typeof e?new e:e:null}if(this.options={...r,...this.options,...M(t)},"v1"!==this.options.compatibilityAPI&&(this.options.interpolation={...r.interpolation,...this.options.interpolation}),void 0!==t.keySeparator&&(this.options.userDefinedKeySeparator=t.keySeparator),void 0!==t.nsSeparator&&(this.options.userDefinedNsSeparator=t.nsSeparator),!this.options.isClone){let t;this.modules.logger?i.init(o(this.modules.logger),this.options):i.init(null,this.options),this.modules.formatter?t=this.modules.formatter:"undefined"!=typeof Intl&&(t=A);let n=new E(this.options);this.store=new y(this.options.resources,this.options);let a=this.services;a.logger=i,a.resourceStore=this.store,a.languageUtils=n,a.pluralResolver=new P(n,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),t&&(!this.options.interpolation.format||this.options.interpolation.format===r.interpolation.format)&&(a.formatter=o(t),a.formatter.init(a,this.options),this.options.interpolation.format=a.formatter.format.bind(a.formatter)),a.interpolator=new _(this.options),a.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},a.backendConnector=new N(o(this.modules.backend),a.resourceStore,a,this.options),a.backendConnector.on("*",function(t){for(var n=arguments.length,r=Array(n>1?n-1:0),o=1;o1?n-1:0),o=1;o{e.init&&e.init(this)})}if(this.format=this.options.interpolation.format,n||(n=I),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){let e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&"dev"!==e[0]&&(this.options.lng=e[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(t=>{this[t]=function(){return e.store[t](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(t=>{this[t]=function(){return e.store[t](...arguments),e}});let a=l(),s=()=>{let e=(e,t)=>{this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),a.resolve(t),n(e,t)};if(this.languages&&"v1"!==this.options.compatibilityAPI&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initImmediate?s():setTimeout(s,0),a}loadResources(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:I,n=t,r="string"==typeof e?e:this.language;if("function"==typeof e&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if(r&&"cimode"===r.toLowerCase()&&(!this.options.preload||0===this.options.preload.length))return n();let e=[],t=t=>{if(!t||"cimode"===t)return;let n=this.services.languageUtils.toResolveHierarchy(t);n.forEach(t=>{"cimode"!==t&&0>e.indexOf(t)&&e.push(t)})};if(r)t(r);else{let e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.forEach(e=>t(e))}this.options.preload&&this.options.preload.forEach(e=>t(e)),this.services.backendConnector.load(e,this.options.ns,e=>{e||this.resolvedLanguage||!this.language||this.setResolvedLanguage(this.language),n(e)})}else n(null)}reloadResources(e,t,n){let r=l();return e||(e=this.languages),t||(t=this.options.ns),n||(n=I),this.services.backendConnector.reload(e,t,e=>{r.resolve(),n(e)}),r}use(e){if(!e)throw Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&b.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}setResolvedLanguage(e){if(e&&this.languages&&!(["cimode","dev"].indexOf(e)>-1))for(let e=0;e-1)&&this.store.hasLanguageSomeTranslations(t)){this.resolvedLanguage=t;break}}}changeLanguage(e,t){var n=this;this.isLanguageChangingTo=e;let r=l();this.emit("languageChanging",e);let o=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},i=(e,i)=>{i?(o(i),this.translator.changeLanguage(i),this.isLanguageChangingTo=void 0,this.emit("languageChanged",i),this.logger.log("languageChanged",i)):this.isLanguageChangingTo=void 0,r.resolve(function(){return n.t(...arguments)}),t&&t(e,function(){return n.t(...arguments)})},a=t=>{e||t||!this.services.languageDetector||(t=[]);let n="string"==typeof t?t:this.services.languageUtils.getBestMatchFromCodes(t);n&&(this.language||o(n),this.translator.language||this.translator.changeLanguage(n),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(n)),this.loadResources(n,e=>{i(e,n)})};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(e):a(this.services.languageDetector.detect()),r}getFixedT(e,t,n){var r=this;let o=function(e,t){let i,a;if("object"!=typeof t){for(var l=arguments.length,s=Array(l>2?l-2:0),c=2;c`${i.keyPrefix}${u}${e}`):i.keyPrefix?`${i.keyPrefix}${u}${e}`:e,r.t(a,i)};return"string"==typeof e?o.lng=e:o.lngs=e,o.ns=t,o.keyPrefix=n,o}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;let n=t.lng||this.resolvedLanguage||this.languages[0],r=!!this.options&&this.options.fallbackLng,o=this.languages[this.languages.length-1];if("cimode"===n.toLowerCase())return!0;let i=(e,t)=>{let n=this.services.backendConnector.state[`${e}|${t}`];return -1===n||2===n};if(t.precheck){let e=t.precheck(this,i);if(void 0!==e)return e}return!!(this.hasResourceBundle(n,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||i(n,e)&&(!r||i(o,e)))}loadNamespaces(e,t){let n=l();return this.options.ns?("string"==typeof e&&(e=[e]),e.forEach(e=>{0>this.options.ns.indexOf(e)&&this.options.ns.push(e)}),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){let n=l();"string"==typeof e&&(e=[e]);let r=this.options.preload||[],o=e.filter(e=>0>r.indexOf(e));return o.length?(this.options.preload=r.concat(o),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!e)return"rtl";let t=this.services&&this.services.languageUtils||new E(T());return["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(t.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return new F(e,t)}cloneInstance(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:I,n=e.forkResourceStore;n&&delete e.forkResourceStore;let r={...this.options,...e,isClone:!0},o=new F(r);return(void 0!==e.debug||void 0!==e.prefix)&&(o.logger=o.logger.clone(e)),["store","services","language"].forEach(e=>{o[e]=this[e]}),o.services={...this.services},o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},n&&(o.store=new y(this.store.data,r),o.services.resourceStore=o.store),o.translator=new w(o.services,r),o.translator.on("*",function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r{let{componentCls:t,width:n,notificationMarginEdge:r}=e,o=new y.E4("antNotificationTopFadeIn",{"0%":{marginTop:"-100%",opacity:0},"100%":{marginTop:0,opacity:1}}),i=new y.E4("antNotificationBottomFadeIn",{"0%":{marginBottom:"-100%",opacity:0},"100%":{marginBottom:0,opacity:1}}),a=new y.E4("antNotificationLeftFadeIn",{"0%":{right:{_skip_check_:!0,value:n},opacity:0},"100%":{right:{_skip_check_:!0,value:0},opacity:1}});return{[`&${t}-top, &${t}-bottom`]:{marginInline:0},[`&${t}-top`]:{[`${t}-fade-enter${t}-fade-enter-active, ${t}-fade-appear${t}-fade-appear-active`]:{animationName:o}},[`&${t}-bottom`]:{[`${t}-fade-enter${t}-fade-enter-active, ${t}-fade-appear${t}-fade-appear-active`]:{animationName:i}},[`&${t}-topLeft, &${t}-bottomLeft`]:{marginInlineEnd:0,marginInlineStart:r,[`${t}-fade-enter${t}-fade-enter-active, ${t}-fade-appear${t}-fade-appear-active`]:{animationName:a}}}};let E=e=>{let{iconCls:t,componentCls:n,boxShadow:r,fontSizeLG:o,notificationMarginBottom:i,borderRadiusLG:a,colorSuccess:l,colorInfo:s,colorWarning:c,colorError:u,colorTextHeading:f,notificationBg:d,notificationPadding:p,notificationMarginEdge:h,motionDurationMid:m,motionEaseInOut:g,fontSize:v,lineHeight:x,width:w,notificationIconSize:E,colorText:S}=e,$=`${n}-notice`,O=new y.E4("antNotificationFadeIn",{"0%":{left:{_skip_check_:!0,value:w},opacity:0},"100%":{left:{_skip_check_:!0,value:0},opacity:1}}),k=new y.E4("antNotificationFadeOut",{"0%":{maxHeight:e.animationMaxHeight,marginBottom:i,opacity:1},"100%":{maxHeight:0,marginBottom:0,paddingTop:0,paddingBottom:0,opacity:0}}),Z={position:"relative",width:w,maxWidth:`calc(100vw - ${2*h}px)`,marginBottom:i,marginInlineStart:"auto",padding:p,overflow:"hidden",lineHeight:x,wordWrap:"break-word",background:d,borderRadius:a,boxShadow:r,[`${n}-close-icon`]:{fontSize:v,cursor:"pointer"},[`${$}-message`]:{marginBottom:e.marginXS,color:f,fontSize:o,lineHeight:e.lineHeightLG},[`${$}-description`]:{fontSize:v,color:S},[`&${$}-closable ${$}-message`]:{paddingInlineEnd:e.paddingLG},[`${$}-with-icon ${$}-message`]:{marginBottom:e.marginXS,marginInlineStart:e.marginSM+E,fontSize:o},[`${$}-with-icon ${$}-description`]:{marginInlineStart:e.marginSM+E,fontSize:v},[`${$}-icon`]:{position:"absolute",fontSize:E,lineHeight:0,[`&-success${t}`]:{color:l},[`&-info${t}`]:{color:s},[`&-warning${t}`]:{color:c},[`&-error${t}`]:{color:u}},[`${$}-close`]:{position:"absolute",top:e.notificationPaddingVertical,insetInlineEnd:e.notificationPaddingHorizontal,color:e.colorIcon,outline:"none",width:e.notificationCloseButtonSize,height:e.notificationCloseButtonSize,borderRadius:e.borderRadiusSM,transition:`background-color ${e.motionDurationMid}, color ${e.motionDurationMid}`,display:"flex",alignItems:"center",justifyContent:"center","&:hover":{color:e.colorIconHover,backgroundColor:e.wireframe?"transparent":e.colorFillContent}},[`${$}-btn`]:{float:"right",marginTop:e.marginSM}};return[{[n]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,b.Wf)(e)),{position:"fixed",zIndex:e.zIndexPopup,marginInlineEnd:h,[`${n}-hook-holder`]:{position:"relative"},[`&${n}-top, &${n}-bottom`]:{[$]:{marginInline:"auto auto"}},[`&${n}-topLeft, &${n}-bottomLeft`]:{[$]:{marginInlineEnd:"auto",marginInlineStart:0}},[`${n}-fade-enter, ${n}-fade-appear`]:{animationDuration:e.motionDurationMid,animationTimingFunction:g,animationFillMode:"both",opacity:0,animationPlayState:"paused"},[`${n}-fade-leave`]:{animationTimingFunction:g,animationFillMode:"both",animationDuration:m,animationPlayState:"paused"},[`${n}-fade-enter${n}-fade-enter-active, ${n}-fade-appear${n}-fade-appear-active`]:{animationName:O,animationPlayState:"running"},[`${n}-fade-leave${n}-fade-leave-active`]:{animationName:k,animationPlayState:"running"}}),C(e)),{"&-rtl":{direction:"rtl",[`${$}-btn`]:{float:"left"}}})},{[n]:{[$]:Object.assign({},Z)}},{[`${$}-pure-panel`]:Object.assign(Object.assign({},Z),{margin:0})}]};var S=(0,x.Z)("Notification",e=>{let t=e.paddingMD,n=e.paddingLG,r=(0,w.TS)(e,{notificationBg:e.colorBgElevated,notificationPaddingVertical:t,notificationPaddingHorizontal:n,notificationIconSize:e.fontSizeLG*e.lineHeightLG,notificationCloseButtonSize:.55*e.controlHeightLG,notificationMarginBottom:e.margin,notificationPadding:`${e.paddingMD}px ${e.paddingContentHorizontalLG}px`,notificationMarginEdge:e.marginLG,animationMaxHeight:150});return[E(r)]},e=>({zIndexPopup:e.zIndexPopupBase+50,width:384})),$=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);ot.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};function O(e,t){return null===t||!1===t?null:t||i.createElement("span",{className:`${e}-close-x`},i.createElement(u.Z,{className:`${e}-close-icon`}))}d.Z,s.Z,c.Z,f.Z,p.Z;let k={success:s.Z,info:d.Z,error:c.Z,warning:f.Z},Z=e=>{let{prefixCls:t,icon:n,type:r,message:o,description:a,btn:l,role:s="alert"}=e,c=null;return n?c=i.createElement("span",{className:`${t}-icon`},n):r&&(c=i.createElement(k[r]||null,{className:m()(`${t}-icon`,`${t}-icon-${r}`)})),i.createElement("div",{className:m()({[`${t}-with-icon`]:c}),role:s},c,i.createElement("div",{className:`${t}-message`},o),i.createElement("div",{className:`${t}-description`},a),l&&i.createElement("div",{className:`${t}-btn`},l))};var P=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);ot.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let j=e=>{let{children:t,prefixCls:n}=e,[,r]=S(n);return i.createElement(g.JB,{classNames:{list:r,notice:r}},t)},_=(e,t)=>{let{prefixCls:n,key:r}=t;return i.createElement(j,{prefixCls:n,key:r},e)},R=i.forwardRef((e,t)=>{let{top:n,bottom:r,prefixCls:o,getContainer:a,maxCount:l,rtl:s,onAllRemoved:c}=e,{getPrefixCls:u,getPopupContainer:f,notification:d}=i.useContext(v.E_),p=o||u("notification"),[h,y]=(0,g.lm)({prefixCls:p,style:e=>(function(e,t,n){let r;switch(e){case"top":r={left:"50%",transform:"translateX(-50%)",right:"auto",top:t,bottom:"auto"};break;case"topLeft":r={left:0,top:t,bottom:"auto"};break;case"topRight":r={right:0,top:t,bottom:"auto"};break;case"bottom":r={left:"50%",transform:"translateX(-50%)",right:"auto",top:"auto",bottom:n};break;case"bottomLeft":r={left:0,top:"auto",bottom:n};break;default:r={right:0,top:"auto",bottom:n}}return r})(e,null!=n?n:24,null!=r?r:24),className:()=>m()({[`${p}-rtl`]:s}),motion:()=>({motionName:`${p}-fade`}),closable:!0,closeIcon:O(p),duration:4.5,getContainer:()=>(null==a?void 0:a())||(null==f?void 0:f())||document.body,maxCount:l,onAllRemoved:c,renderNotifications:_});return i.useImperativeHandle(t,()=>Object.assign(Object.assign({},h),{prefixCls:p,notification:d})),y});function A(e){let t=i.useRef(null),n=i.useMemo(()=>{let n=n=>{var r;if(!t.current)return;let{open:o,prefixCls:a,notification:l}=t.current,s=`${a}-notice`,{message:c,description:u,icon:f,type:d,btn:p,className:h,style:g,role:v="alert",closeIcon:y}=n,b=P(n,["message","description","icon","type","btn","className","style","role","closeIcon"]),x=O(s,y);return o(Object.assign(Object.assign({placement:null!==(r=null==e?void 0:e.placement)&&void 0!==r?r:"topRight"},b),{content:i.createElement(Z,{prefixCls:s,icon:f,type:d,message:c,description:u,btn:p,role:v}),className:m()(d&&`${s}-${d}`,h,null==l?void 0:l.className),style:Object.assign(Object.assign({},null==l?void 0:l.style),g),closeIcon:x,closable:!!x}))},r={open:n,destroy:e=>{var n,r;void 0!==e?null===(n=t.current)||void 0===n||n.close(e):null===(r=t.current)||void 0===r||r.destroy()}};return["success","info","warning","error"].forEach(e=>{r[e]=t=>n(Object.assign(Object.assign({},t),{type:e}))}),r},[]);return[n,i.createElement(R,Object.assign({key:"notification-holder"},e,{ref:t}))]}let N=null,T=e=>e(),M=[],I={};function F(){let{prefixCls:e,getContainer:t,rtl:n,maxCount:r,top:o,bottom:i}=I,a=null!=e?e:(0,l.w6)().getPrefixCls("notification"),s=(null==t?void 0:t())||document.body;return{prefixCls:a,getContainer:()=>s,rtl:n,maxCount:r,top:o,bottom:i}}let L=i.forwardRef((e,t)=>{let[n,r]=i.useState(F),[o,a]=A(n),s=(0,l.w6)(),c=s.getRootPrefixCls(),u=s.getIconPrefixCls(),f=s.getTheme(),d=()=>{r(F)};return i.useEffect(d,[]),i.useImperativeHandle(t,()=>{let e=Object.assign({},o);return Object.keys(e).forEach(t=>{e[t]=function(){return d(),o[t].apply(o,arguments)}}),{instance:e,sync:d}}),i.createElement(l.ZP,{prefixCls:c,iconPrefixCls:u,theme:f},a)});function B(){if(!N){let e=document.createDocumentFragment(),t={fragment:e};N=t,T(()=>{(0,a.s)(i.createElement(L,{ref:e=>{let{instance:n,sync:r}=e||{};Promise.resolve().then(()=>{!t.instance&&n&&(t.instance=n,t.sync=r,B())})}}),e)});return}N.instance&&(M.forEach(e=>{switch(e.type){case"open":T(()=>{N.instance.open(Object.assign(Object.assign({},I),e.config))});break;case"destroy":T(()=>{null==N||N.instance.destroy(e.key)})}}),M=[])}function D(e){M.push({type:"open",config:e}),B()}let z={open:D,destroy:function(e){M.push({type:"destroy",key:e}),B()},config:function(e){I=Object.assign(Object.assign({},I),e),T(()=>{var e;null===(e=null==N?void 0:N.sync)||void 0===e||e.call(N)})},useNotification:function(e){return A(e)},_InternalPanelDoNotUseOrYouWillBeFired:e=>{let{prefixCls:t,className:n,icon:r,type:o,message:a,description:l,btn:s,closable:c=!0,closeIcon:u}=e,f=$(e,["prefixCls","className","icon","type","message","description","btn","closable","closeIcon"]),{getPrefixCls:d}=i.useContext(v.E_),p=t||d("notification"),h=`${p}-notice`,[,y]=S(p);return i.createElement(g.qX,Object.assign({},f,{prefixCls:p,className:m()(n,y,`${h}-pure-panel`),eventKey:"pure",duration:null,closable:c,closeIcon:O(p,u),content:i.createElement(Z,{prefixCls:h,icon:r,type:o,message:a,description:l,btn:s})}))}};["success","info","warning","error"].forEach(e=>{z[e]=t=>D(Object.assign(Object.assign({},t),{type:e}))});let H=(e,t)=>e.then(e=>{let{data:n}=e;if(!n)throw Error("Network Error!");if(!n.success){if("*"===t||n.err_code&&t&&t.includes(n.err_code));else{var r;throw z.error({message:"Request error",description:null!==(r=null==n?void 0:n.err_msg)&&void 0!==r?r:"The interface is abnormal. Please try again later"}),Error((null==n?void 0:n.err_msg)||"The interface is abnormal. Please try again later")}}return[null,n.data,n,e]}).catch(e=>(z.error({message:"Request error",description:e.message}),[e,null,null,null])),V=()=>e_("/api/v1/chat/dialogue/scenes"),U=e=>e_("/api/v1/chat/dialogue/new",e),W=()=>ej("/api/v1/chat/db/list"),K=()=>ej("/api/v1/chat/db/support/type"),q=e=>e_("/api/v1/chat/db/delete?db_name=".concat(e)),G=e=>e_("/api/v1/chat/db/edit",e),X=e=>e_("/api/v1/chat/db/add",e),Y=e=>e_("/api/v1/chat/db/test/connect",e),J=()=>ej("/api/v1/chat/dialogue/list"),Q=()=>ej("/api/v1/model/types"),ee=e=>e_("/api/v1/chat/mode/params/list?chat_mode=".concat(e)),et=e=>ej("/api/v1/chat/dialogue/messages/history?con_uid=".concat(e)),en=e=>{let{convUid:t,chatMode:n,data:r,config:o,model:i}=e;return e_("/api/v1/chat/mode/params/file/load?conv_uid=".concat(t,"&chat_mode=").concat(n,"&model_name=").concat(i),r,{headers:{"Content-Type":"multipart/form-data"},...o})},er=e=>e_("/api/v1/chat/dialogue/delete?con_uid=".concat(e)),eo=e=>e_("/knowledge/".concat(e,"/arguments"),{}),ei=(e,t)=>e_("/knowledge/".concat(e,"/argument/save"),t),ea=()=>e_("/knowledge/space/list",{}),el=(e,t)=>e_("/knowledge/".concat(e,"/document/list"),t),es=(e,t)=>e_("/knowledge/".concat(e,"/document/add"),t),ec=e=>e_("/knowledge/space/add",e),eu=(e,t)=>e_("/knowledge/".concat(e,"/document/sync"),t),ef=(e,t)=>e_("/knowledge/".concat(e,"/document/upload"),t),ed=(e,t)=>e_("/knowledge/".concat(e,"/chunk/list"),t),ep=(e,t)=>e_("/knowledge/".concat(e,"/document/delete"),t),eh=e=>e_("/knowledge/space/delete",e),em=()=>ej("/api/v1/worker/model/list"),eg=e=>e_("/api/v1/worker/model/stop",e),ev=e=>e_("/api/v1/worker/model/start",e),ey=()=>ej("/api/v1/worker/model/params"),eb=e=>e_("/api/v1/agent/query",e),ex=e=>e_("/api/v1/agent/hub/update",null!=e?e:{channel:"",url:"",branch:"",authorization:""}),ew=e=>e_("/api/v1/agent/my",void 0,{params:{user:e}}),eC=(e,t)=>e_("/api/v1/agent/install",void 0,{params:{plugin_name:e,user:t},timeout:6e4}),eE=(e,t)=>e_("/api/v1/agent/uninstall",void 0,{params:{plugin_name:e,user:t},timeout:6e4}),eS=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;return e_("/api/v1/personal/agent/upload",t,{params:{user:e},headers:{"Content-Type":"multipart/form-data"},...n})},e$=()=>ej("/api/v1/feedback/select",void 0),eO=(e,t)=>ej("/api/v1/feedback/find?conv_uid=".concat(e,"&conv_index=").concat(t),void 0),ek=e=>{let{data:t,config:n}=e;return e_("/api/v1/feedback/commit",t,{headers:{"Content-Type":"application/json"},...n})};var eZ=n(83454);let eP=o.Z.create({baseURL:null!==(r=eZ.env.API_BASE_URL)&&void 0!==r?r:"",timeout:1e4}),ej=(e,t,n)=>eP.get(e,{params:t,...n}),e_=(e,t,n)=>eP.post(e,t,n)},32665:function(e,t,n){"use strict";function r(e){}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"clientHookInServerComponentError",{enumerable:!0,get:function(){return r}}),n(38754),n(67294),("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},41219:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{ReadonlyURLSearchParams:function(){return p},useSearchParams:function(){return h},usePathname:function(){return m},ServerInsertedHTMLContext:function(){return s.ServerInsertedHTMLContext},useServerInsertedHTML:function(){return s.useServerInsertedHTML},useRouter:function(){return g},useParams:function(){return v},useSelectedLayoutSegments:function(){return y},useSelectedLayoutSegment:function(){return b},redirect:function(){return c.redirect},notFound:function(){return u.notFound}});let r=n(67294),o=n(27473),i=n(35802),a=n(32665),l=n(43512),s=n(98751),c=n(96885),u=n(86323),f=Symbol("internal for urlsearchparams readonly");function d(){return Error("ReadonlyURLSearchParams cannot be modified")}class p{[Symbol.iterator](){return this[f][Symbol.iterator]()}append(){throw d()}delete(){throw d()}set(){throw d()}sort(){throw d()}constructor(e){this[f]=e,this.entries=e.entries.bind(e),this.forEach=e.forEach.bind(e),this.get=e.get.bind(e),this.getAll=e.getAll.bind(e),this.has=e.has.bind(e),this.keys=e.keys.bind(e),this.values=e.values.bind(e),this.toString=e.toString.bind(e)}}function h(){(0,a.clientHookInServerComponentError)("useSearchParams");let e=(0,r.useContext)(i.SearchParamsContext),t=(0,r.useMemo)(()=>e?new p(e):null,[e]);return t}function m(){return(0,a.clientHookInServerComponentError)("usePathname"),(0,r.useContext)(i.PathnameContext)}function g(){(0,a.clientHookInServerComponentError)("useRouter");let e=(0,r.useContext)(o.AppRouterContext);if(null===e)throw Error("invariant expected app router to be mounted");return e}function v(){(0,a.clientHookInServerComponentError)("useParams");let e=(0,r.useContext)(o.GlobalLayoutRouterContext);return e?function e(t,n){void 0===n&&(n={});let r=t[1];for(let t of Object.values(r)){let r=t[0],o=Array.isArray(r),i=o?r[1]:r;!i||i.startsWith("__PAGE__")||(o&&(n[r[0]]=r[1]),n=e(t,n))}return n}(e.tree):null}function y(e){void 0===e&&(e="children"),(0,a.clientHookInServerComponentError)("useSelectedLayoutSegments");let{tree:t}=(0,r.useContext)(o.LayoutRouterContext);return function e(t,n,r,o){let i;if(void 0===r&&(r=!0),void 0===o&&(o=[]),r)i=t[1][n];else{var a;let e=t[1];i=null!=(a=e.children)?a:Object.values(e)[0]}if(!i)return o;let s=i[0],c=(0,l.getSegmentValue)(s);return!c||c.startsWith("__PAGE__")?o:(o.push(c),e(i,n,!1,o))}(t,e)}function b(e){void 0===e&&(e="children"),(0,a.clientHookInServerComponentError)("useSelectedLayoutSegment");let t=y(e);return 0===t.length?null:t[0]}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},86323:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{notFound:function(){return r},isNotFoundError:function(){return o}});let n="NEXT_NOT_FOUND";function r(){let e=Error(n);throw e.digest=n,e}function o(e){return(null==e?void 0:e.digest)===n}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},96885:function(e,t,n){"use strict";var r,o;Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{RedirectType:function(){return r},getRedirectError:function(){return l},redirect:function(){return s},isRedirectError:function(){return c},getURLFromRedirectError:function(){return u},getRedirectTypeFromError:function(){return f}});let i=n(68214),a="NEXT_REDIRECT";function l(e,t){let n=Error(a);n.digest=a+";"+t+";"+e;let r=i.requestAsyncStorage.getStore();return r&&(n.mutableCookies=r.mutableCookies),n}function s(e,t){throw void 0===t&&(t="replace"),l(e,t)}function c(e){if("string"!=typeof(null==e?void 0:e.digest))return!1;let[t,n,r]=e.digest.split(";",3);return t===a&&("replace"===n||"push"===n)&&"string"==typeof r}function u(e){return c(e)?e.digest.split(";",3)[2]:null}function f(e){if(!c(e))throw Error("Not a redirect error");return e.digest.split(";",3)[1]}(o=r||(r={})).push="push",o.replace="replace",("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},43512:function(e,t){"use strict";function n(e){return Array.isArray(e)?e[1]:e}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getSegmentValue",{enumerable:!0,get:function(){return n}}),("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},29382:function(e,t){"use strict";var n,r;Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{PrefetchKind:function(){return n},ACTION_REFRESH:function(){return o},ACTION_NAVIGATE:function(){return i},ACTION_RESTORE:function(){return a},ACTION_SERVER_PATCH:function(){return l},ACTION_PREFETCH:function(){return s},ACTION_FAST_REFRESH:function(){return c},ACTION_SERVER_ACTION:function(){return u}});let o="refresh",i="navigate",a="restore",l="server-patch",s="prefetch",c="fast-refresh",u="server-action";(r=n||(n={})).AUTO="auto",r.FULL="full",r.TEMPORARY="temporary",("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},75476:function(e,t){"use strict";function n(e,t,n,r){return!1}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getDomainLocale",{enumerable:!0,get:function(){return n}}),("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},69873:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return y}});let r=n(38754),o=n(61757),i=o._(n(67294)),a=r._(n(68965)),l=n(38083),s=n(2478),c=n(76226);n(59941);let u=r._(n(31720)),f={deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[16,32,48,64,96,128,256,384],path:"/_next/image/",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!0};function d(e){return void 0!==e.default}function p(e){return void 0===e?e:"number"==typeof e?Number.isFinite(e)?e:NaN:"string"==typeof e&&/^[0-9]+$/.test(e)?parseInt(e,10):NaN}function h(e,t,n,r,o,i,a){if(!e||e["data-loaded-src"]===t)return;e["data-loaded-src"]=t;let l="decode"in e?e.decode():Promise.resolve();l.catch(()=>{}).then(()=>{if(e.parentElement&&e.isConnected){if("blur"===n&&i(!0),null==r?void 0:r.current){let t=new Event("load");Object.defineProperty(t,"target",{writable:!1,value:e});let n=!1,o=!1;r.current({...t,nativeEvent:t,currentTarget:e,target:e,isDefaultPrevented:()=>n,isPropagationStopped:()=>o,persist:()=>{},preventDefault:()=>{n=!0,t.preventDefault()},stopPropagation:()=>{o=!0,t.stopPropagation()}})}(null==o?void 0:o.current)&&o.current(e)}})}function m(e){let[t,n]=i.version.split("."),r=parseInt(t,10),o=parseInt(n,10);return r>18||18===r&&o>=3?{fetchPriority:e}:{fetchpriority:e}}let g=(0,i.forwardRef)((e,t)=>{let{imgAttributes:n,heightInt:r,widthInt:o,qualityInt:a,className:l,imgStyle:s,blurStyle:c,isLazy:u,fetchPriority:f,fill:d,placeholder:p,loading:g,srcString:v,config:y,unoptimized:b,loader:x,onLoadRef:w,onLoadingCompleteRef:C,setBlurComplete:E,setShowAltText:S,onLoad:$,onError:O,...k}=e;return g=u?"lazy":g,i.default.createElement("img",{...k,...m(f),loading:g,width:o,height:r,decoding:"async","data-nimg":d?"fill":"1",className:l,style:{...s,...c},...n,ref:(0,i.useCallback)(e=>{t&&("function"==typeof t?t(e):"object"==typeof t&&(t.current=e)),e&&(O&&(e.src=e.src),e.complete&&h(e,v,p,w,C,E,b))},[v,p,w,C,E,O,b,t]),onLoad:e=>{let t=e.currentTarget;h(t,v,p,w,C,E,b)},onError:e=>{S(!0),"blur"===p&&E(!0),O&&O(e)}})}),v=(0,i.forwardRef)((e,t)=>{var n;let r,o,{src:h,sizes:v,unoptimized:y=!1,priority:b=!1,loading:x,className:w,quality:C,width:E,height:S,fill:$,style:O,onLoad:k,onLoadingComplete:Z,placeholder:P="empty",blurDataURL:j,fetchPriority:_,layout:R,objectFit:A,objectPosition:N,lazyBoundary:T,lazyRoot:M,...I}=e,F=(0,i.useContext)(c.ImageConfigContext),L=(0,i.useMemo)(()=>{let e=f||F||s.imageConfigDefault,t=[...e.deviceSizes,...e.imageSizes].sort((e,t)=>e-t),n=e.deviceSizes.sort((e,t)=>e-t);return{...e,allSizes:t,deviceSizes:n}},[F]),B=I.loader||u.default;delete I.loader;let D="__next_img_default"in B;if(D){if("custom"===L.loader)throw Error('Image with src "'+h+'" is missing "loader" prop.\nRead more: https://nextjs.org/docs/messages/next-image-missing-loader')}else{let e=B;B=t=>{let{config:n,...r}=t;return e(r)}}if(R){"fill"===R&&($=!0);let e={intrinsic:{maxWidth:"100%",height:"auto"},responsive:{width:"100%",height:"auto"}}[R];e&&(O={...O,...e});let t={responsive:"100vw",fill:"100vw"}[R];t&&!v&&(v=t)}let z="",H=p(E),V=p(S);if("object"==typeof(n=h)&&(d(n)||void 0!==n.src)){let e=d(h)?h.default:h;if(!e.src)throw Error("An object should only be passed to the image component src parameter if it comes from a static image import. It must include src. Received "+JSON.stringify(e));if(!e.height||!e.width)throw Error("An object should only be passed to the image component src parameter if it comes from a static image import. It must include height and width. Received "+JSON.stringify(e));if(r=e.blurWidth,o=e.blurHeight,j=j||e.blurDataURL,z=e.src,!$){if(H||V){if(H&&!V){let t=H/e.width;V=Math.round(e.height*t)}else if(!H&&V){let t=V/e.height;H=Math.round(e.width*t)}}else H=e.width,V=e.height}}let U=!b&&("lazy"===x||void 0===x);(!(h="string"==typeof h?h:z)||h.startsWith("data:")||h.startsWith("blob:"))&&(y=!0,U=!1),L.unoptimized&&(y=!0),D&&h.endsWith(".svg")&&!L.dangerouslyAllowSVG&&(y=!0),b&&(_="high");let[W,K]=(0,i.useState)(!1),[q,G]=(0,i.useState)(!1),X=p(C),Y=Object.assign($?{position:"absolute",height:"100%",width:"100%",left:0,top:0,right:0,bottom:0,objectFit:A,objectPosition:N}:{},q?{}:{color:"transparent"},O),J="blur"===P&&j&&!W?{backgroundSize:Y.objectFit||"cover",backgroundPosition:Y.objectPosition||"50% 50%",backgroundRepeat:"no-repeat",backgroundImage:'url("data:image/svg+xml;charset=utf-8,'+(0,l.getImageBlurSvg)({widthInt:H,heightInt:V,blurWidth:r,blurHeight:o,blurDataURL:j,objectFit:Y.objectFit})+'")'}:{},Q=function(e){let{config:t,src:n,unoptimized:r,width:o,quality:i,sizes:a,loader:l}=e;if(r)return{src:n,srcSet:void 0,sizes:void 0};let{widths:s,kind:c}=function(e,t,n){let{deviceSizes:r,allSizes:o}=e;if(n){let e=/(^|\s)(1?\d?\d)vw/g,t=[];for(let r;r=e.exec(n);r)t.push(parseInt(r[2]));if(t.length){let e=.01*Math.min(...t);return{widths:o.filter(t=>t>=r[0]*e),kind:"w"}}return{widths:o,kind:"w"}}if("number"!=typeof t)return{widths:r,kind:"w"};let i=[...new Set([t,2*t].map(e=>o.find(t=>t>=e)||o[o.length-1]))];return{widths:i,kind:"x"}}(t,o,a),u=s.length-1;return{sizes:a||"w"!==c?a:"100vw",srcSet:s.map((e,r)=>l({config:t,src:n,quality:i,width:e})+" "+("w"===c?e:r+1)+c).join(", "),src:l({config:t,src:n,quality:i,width:s[u]})}}({config:L,src:h,unoptimized:y,width:H,quality:X,sizes:v,loader:B}),ee=h,et=(0,i.useRef)(k);(0,i.useEffect)(()=>{et.current=k},[k]);let en=(0,i.useRef)(Z);(0,i.useEffect)(()=>{en.current=Z},[Z]);let er={isLazy:U,imgAttributes:Q,heightInt:V,widthInt:H,qualityInt:X,className:w,imgStyle:Y,blurStyle:J,loading:x,config:L,fetchPriority:_,fill:$,unoptimized:y,placeholder:P,loader:B,srcString:ee,onLoadRef:et,onLoadingCompleteRef:en,setBlurComplete:K,setShowAltText:G,...I};return i.default.createElement(i.default.Fragment,null,i.default.createElement(g,{...er,ref:t}),b?i.default.createElement(a.default,null,i.default.createElement("link",{key:"__nimg-"+Q.src+Q.srcSet+Q.sizes,rel:"preload",as:"image",href:Q.srcSet?void 0:Q.src,imageSrcSet:Q.srcSet,imageSizes:Q.sizes,crossOrigin:I.crossOrigin,referrerPolicy:I.referrerPolicy,...m(_)})):null)}),y=v;("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},9940:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return x}});let r=n(38754),o=r._(n(67294)),i=n(65722),a=n(65723),l=n(28904),s=n(95514),c=n(27521),u=n(44293),f=n(27473),d=n(81307),p=n(75476),h=n(66318),m=n(29382),g=new Set;function v(e,t,n,r,o,i){if(!i&&!(0,a.isLocalURL)(t))return;if(!r.bypassPrefetchedCheck){let o=void 0!==r.locale?r.locale:"locale"in e?e.locale:void 0,i=t+"%"+n+"%"+o;if(g.has(i))return;g.add(i)}let l=i?e.prefetch(t,o):e.prefetch(t,n,r);Promise.resolve(l).catch(e=>{})}function y(e){return"string"==typeof e?e:(0,l.formatUrl)(e)}let b=o.default.forwardRef(function(e,t){let n,r;let{href:l,as:g,children:b,prefetch:x=null,passHref:w,replace:C,shallow:E,scroll:S,locale:$,onClick:O,onMouseEnter:k,onTouchStart:Z,legacyBehavior:P=!1,...j}=e;n=b,P&&("string"==typeof n||"number"==typeof n)&&(n=o.default.createElement("a",null,n));let _=!1!==x,R=null===x?m.PrefetchKind.AUTO:m.PrefetchKind.FULL,A=o.default.useContext(u.RouterContext),N=o.default.useContext(f.AppRouterContext),T=null!=A?A:N,M=!A,{href:I,as:F}=o.default.useMemo(()=>{if(!A){let e=y(l);return{href:e,as:g?y(g):e}}let[e,t]=(0,i.resolveHref)(A,l,!0);return{href:e,as:g?(0,i.resolveHref)(A,g):t||e}},[A,l,g]),L=o.default.useRef(I),B=o.default.useRef(F);P&&(r=o.default.Children.only(n));let D=P?r&&"object"==typeof r&&r.ref:t,[z,H,V]=(0,d.useIntersection)({rootMargin:"200px"}),U=o.default.useCallback(e=>{(B.current!==F||L.current!==I)&&(V(),B.current=F,L.current=I),z(e),D&&("function"==typeof D?D(e):"object"==typeof D&&(D.current=e))},[F,D,I,V,z]);o.default.useEffect(()=>{T&&H&&_&&v(T,I,F,{locale:$},{kind:R},M)},[F,I,H,$,_,null==A?void 0:A.locale,T,M,R]);let W={ref:U,onClick(e){P||"function"!=typeof O||O(e),P&&r.props&&"function"==typeof r.props.onClick&&r.props.onClick(e),T&&!e.defaultPrevented&&function(e,t,n,r,i,l,s,c,u,f){let{nodeName:d}=e.currentTarget,p="A"===d.toUpperCase();if(p&&(function(e){let t=e.currentTarget,n=t.getAttribute("target");return n&&"_self"!==n||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.nativeEvent&&2===e.nativeEvent.which}(e)||!u&&!(0,a.isLocalURL)(n)))return;e.preventDefault();let h=()=>{"beforePopState"in t?t[i?"replace":"push"](n,r,{shallow:l,locale:c,scroll:s}):t[i?"replace":"push"](r||n,{forceOptimisticNavigation:!f})};u?o.default.startTransition(h):h()}(e,T,I,F,C,E,S,$,M,_)},onMouseEnter(e){P||"function"!=typeof k||k(e),P&&r.props&&"function"==typeof r.props.onMouseEnter&&r.props.onMouseEnter(e),T&&(_||!M)&&v(T,I,F,{locale:$,priority:!0,bypassPrefetchedCheck:!0},{kind:R},M)},onTouchStart(e){P||"function"!=typeof Z||Z(e),P&&r.props&&"function"==typeof r.props.onTouchStart&&r.props.onTouchStart(e),T&&(_||!M)&&v(T,I,F,{locale:$,priority:!0,bypassPrefetchedCheck:!0},{kind:R},M)}};if((0,s.isAbsoluteUrl)(F))W.href=F;else if(!P||w||"a"===r.type&&!("href"in r.props)){let e=void 0!==$?$:null==A?void 0:A.locale,t=(null==A?void 0:A.isLocaleDomain)&&(0,p.getDomainLocale)(F,e,null==A?void 0:A.locales,null==A?void 0:A.domainLocales);W.href=t||(0,h.addBasePath)((0,c.addLocale)(F,e,null==A?void 0:A.defaultLocale))}return P?o.default.cloneElement(r,W):o.default.createElement("a",{...j,...W},n)}),x=b;("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},81307:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"useIntersection",{enumerable:!0,get:function(){return s}});let r=n(67294),o=n(82997),i="function"==typeof IntersectionObserver,a=new Map,l=[];function s(e){let{rootRef:t,rootMargin:n,disabled:s}=e,c=s||!i,[u,f]=(0,r.useState)(!1),d=(0,r.useRef)(null),p=(0,r.useCallback)(e=>{d.current=e},[]);(0,r.useEffect)(()=>{if(i){if(c||u)return;let e=d.current;if(e&&e.tagName){let r=function(e,t,n){let{id:r,observer:o,elements:i}=function(e){let t;let n={root:e.root||null,margin:e.rootMargin||""},r=l.find(e=>e.root===n.root&&e.margin===n.margin);if(r&&(t=a.get(r)))return t;let o=new Map,i=new IntersectionObserver(e=>{e.forEach(e=>{let t=o.get(e.target),n=e.isIntersecting||e.intersectionRatio>0;t&&n&&t(n)})},e);return t={id:n,observer:i,elements:o},l.push(n),a.set(n,t),t}(n);return i.set(e,t),o.observe(e),function(){if(i.delete(e),o.unobserve(e),0===i.size){o.disconnect(),a.delete(r);let e=l.findIndex(e=>e.root===r.root&&e.margin===r.margin);e>-1&&l.splice(e,1)}}}(e,e=>e&&f(e),{root:null==t?void 0:t.current,rootMargin:n});return r}}else if(!u){let e=(0,o.requestIdleCallback)(()=>f(!0));return()=>(0,o.cancelIdleCallback)(e)}},[c,n,t,u,d.current]);let h=(0,r.useCallback)(()=>{f(!1)},[]);return[p,u,h]}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},38083:function(e,t){"use strict";function n(e){let{widthInt:t,heightInt:n,blurWidth:r,blurHeight:o,blurDataURL:i,objectFit:a}=e,l=r||t,s=o||n,c=i.startsWith("data:image/jpeg")?"%3CfeComponentTransfer%3E%3CfeFuncA type='discrete' tableValues='1 1'/%3E%3C/feComponentTransfer%3E%":"";return l&&s?"%3Csvg xmlns='http%3A//www.w3.org/2000/svg' viewBox='0 0 "+l+" "+s+"'%3E%3Cfilter id='b' color-interpolation-filters='sRGB'%3E%3CfeGaussianBlur stdDeviation='"+(r&&o?"1":"20")+"'/%3E"+c+"%3C/filter%3E%3Cimage preserveAspectRatio='none' filter='url(%23b)' x='0' y='0' height='100%25' width='100%25' href='"+i+"'/%3E%3C/svg%3E":"%3Csvg xmlns='http%3A//www.w3.org/2000/svg'%3E%3Cimage style='filter:blur(20px)' preserveAspectRatio='"+("contain"===a?"xMidYMid":"cover"===a?"xMidYMid slice":"none")+"' x='0' y='0' height='100%25' width='100%25' href='"+i+"'/%3E%3C/svg%3E"}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getImageBlurSvg",{enumerable:!0,get:function(){return n}})},31720:function(e,t){"use strict";function n(e){let{config:t,src:n,width:r,quality:o}=e;return t.path+"?url="+encodeURIComponent(n)+"&w="+r+"&q="+(o||75)}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return r}}),n.__next_img_default=!0;let r=n},98751:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{ServerInsertedHTMLContext:function(){return i},useServerInsertedHTML:function(){return a}});let r=n(61757),o=r._(n(67294)),i=o.default.createContext(null);function a(e){let t=(0,o.useContext)(i);t&&t(e)}},37262:function(e,t,n){"use strict";let r,o;n.r(t),n.d(t,{default:function(){return eM}});var i=n(85893),a=n(67294),l=n(41468),s=n(50489),c=n(98399),u=function(){return(0,i.jsx)("svg",{width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 1024 1024",children:(0,i.jsx)("path",{d:"M593.054 120.217C483.656 148.739 402.91 248.212 402.91 366.546c0 140.582 113.962 254.544 254.544 254.544 118.334 0 217.808-80.746 246.328-190.144C909.17 457.12 912 484.23 912 512c0 220.914-179.086 400-400 400S112 732.914 112 512s179.086-400 400-400c27.77 0 54.88 2.83 81.054 8.217z","p-id":"5941"})})},f=function(){return(0,i.jsx)("svg",{width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 1024 1024",children:(0,i.jsx)("path",{d:"M554.6 64h-85.4v128h85.4V64z m258.2 87.4L736 228.2l59.8 59.8 76.8-76.8-59.8-59.8z m-601.6 0l-59.8 59.8 76.8 76.8 59.8-59.8-76.8-76.8zM512 256c-140.8 0-256 115.2-256 256s115.2 256 256 256 256-115.2 256-256-115.2-256-256-256z m448 213.4h-128v85.4h128v-85.4z m-768 0H64v85.4h128v-85.4zM795.8 736L736 795.8l76.8 76.8 59.8-59.8-76.8-76.8z m-567.6 0l-76.8 76.8 59.8 59.8 76.8-76.8-59.8-59.8z m326.4 96h-85.4v128h85.4v-128z","p-id":"7802"})})},d=n(59766),p=n(87462),h=n(63366),m=n(71387),g=n(70917);function v(e){let{styles:t,defaultTheme:n={}}=e,r="function"==typeof t?e=>t(null==e||0===Object.keys(e).length?n:e):t;return(0,i.jsx)(g.xB,{styles:r})}var y=n(56760),b=n(71927);let x="mode",w="color-scheme",C="data-color-scheme";function E(e){if("undefined"!=typeof window&&"system"===e){let e=window.matchMedia("(prefers-color-scheme: dark)");return e.matches?"dark":"light"}}function S(e,t){return"light"===e.mode||"system"===e.mode&&"light"===e.systemMode?t("light"):"dark"===e.mode||"system"===e.mode&&"dark"===e.systemMode?t("dark"):void 0}function $(e,t){let n;if("undefined"!=typeof window){try{(n=localStorage.getItem(e)||void 0)||localStorage.setItem(e,t)}catch(e){}return n||t}}let O=["colorSchemes","components","generateCssVars","cssVarPrefix"];var k=n(1812),Z=n(13951),P=n(2548);let{CssVarsProvider:j,useColorScheme:_,getInitColorSchemeScript:R}=function(e){let{themeId:t,theme:n={},attribute:r=C,modeStorageKey:o=x,colorSchemeStorageKey:l=w,defaultMode:s="light",defaultColorScheme:c,disableTransitionOnChange:u=!1,resolveTheme:f,excludeVariablesFromRoot:g}=e;n.colorSchemes&&("string"!=typeof c||n.colorSchemes[c])&&("object"!=typeof c||n.colorSchemes[null==c?void 0:c.light])&&("object"!=typeof c||n.colorSchemes[null==c?void 0:c.dark])||console.error(`MUI: \`${c}\` does not exist in \`theme.colorSchemes\`.`);let k=a.createContext(void 0),Z="string"==typeof c?c:c.light,P="string"==typeof c?c:c.dark;return{CssVarsProvider:function({children:e,theme:m=n,modeStorageKey:C=o,colorSchemeStorageKey:Z=l,attribute:P=r,defaultMode:j=s,defaultColorScheme:_=c,disableTransitionOnChange:R=u,storageWindow:A="undefined"==typeof window?void 0:window,documentNode:N="undefined"==typeof document?void 0:document,colorSchemeNode:T="undefined"==typeof document?void 0:document.documentElement,colorSchemeSelector:M=":root",disableNestedContext:I=!1,disableStyleSheetGeneration:F=!1}){let L=a.useRef(!1),B=(0,y.Z)(),D=a.useContext(k),z=!!D&&!I,H=m[t],V=H||m,{colorSchemes:U={},components:W={},generateCssVars:K=()=>({vars:{},css:{}}),cssVarPrefix:q}=V,G=(0,h.Z)(V,O),X=Object.keys(U),Y="string"==typeof _?_:_.light,J="string"==typeof _?_:_.dark,{mode:Q,setMode:ee,systemMode:et,lightColorScheme:en,darkColorScheme:er,colorScheme:eo,setColorScheme:ei}=function(e){let{defaultMode:t="light",defaultLightColorScheme:n,defaultDarkColorScheme:r,supportedColorSchemes:o=[],modeStorageKey:i=x,colorSchemeStorageKey:l=w,storageWindow:s="undefined"==typeof window?void 0:window}=e,c=o.join(","),[u,f]=a.useState(()=>{let e=$(i,t),o=$(`${l}-light`,n),a=$(`${l}-dark`,r);return{mode:e,systemMode:E(e),lightColorScheme:o,darkColorScheme:a}}),d=S(u,e=>"light"===e?u.lightColorScheme:"dark"===e?u.darkColorScheme:void 0),h=a.useCallback(e=>{f(n=>{if(e===n.mode)return n;let r=e||t;try{localStorage.setItem(i,r)}catch(e){}return(0,p.Z)({},n,{mode:r,systemMode:E(r)})})},[i,t]),m=a.useCallback(e=>{e?"string"==typeof e?e&&!c.includes(e)?console.error(`\`${e}\` does not exist in \`theme.colorSchemes\`.`):f(t=>{let n=(0,p.Z)({},t);return S(t,t=>{try{localStorage.setItem(`${l}-${t}`,e)}catch(e){}"light"===t&&(n.lightColorScheme=e),"dark"===t&&(n.darkColorScheme=e)}),n}):f(t=>{let o=(0,p.Z)({},t),i=null===e.light?n:e.light,a=null===e.dark?r:e.dark;if(i){if(c.includes(i)){o.lightColorScheme=i;try{localStorage.setItem(`${l}-light`,i)}catch(e){}}else console.error(`\`${i}\` does not exist in \`theme.colorSchemes\`.`)}if(a){if(c.includes(a)){o.darkColorScheme=a;try{localStorage.setItem(`${l}-dark`,a)}catch(e){}}else console.error(`\`${a}\` does not exist in \`theme.colorSchemes\`.`)}return o}):f(e=>{try{localStorage.setItem(`${l}-light`,n),localStorage.setItem(`${l}-dark`,r)}catch(e){}return(0,p.Z)({},e,{lightColorScheme:n,darkColorScheme:r})})},[c,l,n,r]),g=a.useCallback(e=>{"system"===u.mode&&f(t=>(0,p.Z)({},t,{systemMode:null!=e&&e.matches?"dark":"light"}))},[u.mode]),v=a.useRef(g);return v.current=g,a.useEffect(()=>{let e=(...e)=>v.current(...e),t=window.matchMedia("(prefers-color-scheme: dark)");return t.addListener(e),e(t),()=>t.removeListener(e)},[]),a.useEffect(()=>{let e=e=>{let n=e.newValue;"string"==typeof e.key&&e.key.startsWith(l)&&(!n||c.match(n))&&(e.key.endsWith("light")&&m({light:n}),e.key.endsWith("dark")&&m({dark:n})),e.key===i&&(!n||["light","dark","system"].includes(n))&&h(n||t)};if(s)return s.addEventListener("storage",e),()=>s.removeEventListener("storage",e)},[m,h,i,l,c,t,s]),(0,p.Z)({},u,{colorScheme:d,setMode:h,setColorScheme:m})}({supportedColorSchemes:X,defaultLightColorScheme:Y,defaultDarkColorScheme:J,modeStorageKey:C,colorSchemeStorageKey:Z,defaultMode:j,storageWindow:A}),ea=Q,el=eo;z&&(ea=D.mode,el=D.colorScheme);let es=ea||("system"===j?s:j),ec=el||("dark"===es?J:Y),{css:eu,vars:ef}=K(),ed=(0,p.Z)({},G,{components:W,colorSchemes:U,cssVarPrefix:q,vars:ef,getColorSchemeSelector:e=>`[${P}="${e}"] &`}),ep={},eh={};Object.entries(U).forEach(([e,t])=>{let{css:n,vars:r}=K(e);ed.vars=(0,d.Z)(ed.vars,r),e===ec&&(Object.keys(t).forEach(e=>{t[e]&&"object"==typeof t[e]?ed[e]=(0,p.Z)({},ed[e],t[e]):ed[e]=t[e]}),ed.palette&&(ed.palette.colorScheme=e));let o="string"==typeof _?_:"dark"===j?_.dark:_.light;if(e===o){if(g){let t={};g(q).forEach(e=>{t[e]=n[e],delete n[e]}),ep[`[${P}="${e}"]`]=t}ep[`${M}, [${P}="${e}"]`]=n}else eh[`${":root"===M?"":M}[${P}="${e}"]`]=n}),ed.vars=(0,d.Z)(ed.vars,ef),a.useEffect(()=>{el&&T&&T.setAttribute(P,el)},[el,P,T]),a.useEffect(()=>{let e;if(R&&L.current&&N){let t=N.createElement("style");t.appendChild(N.createTextNode("*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),N.head.appendChild(t),window.getComputedStyle(N.body),e=setTimeout(()=>{N.head.removeChild(t)},1)}return()=>{clearTimeout(e)}},[el,R,N]),a.useEffect(()=>(L.current=!0,()=>{L.current=!1}),[]);let em=a.useMemo(()=>({mode:ea,systemMode:et,setMode:ee,lightColorScheme:en,darkColorScheme:er,colorScheme:el,setColorScheme:ei,allColorSchemes:X}),[X,el,er,en,ea,ei,ee,et]),eg=!0;(F||z&&(null==B?void 0:B.cssVarPrefix)===q)&&(eg=!1);let ev=(0,i.jsxs)(a.Fragment,{children:[eg&&(0,i.jsxs)(a.Fragment,{children:[(0,i.jsx)(v,{styles:{[M]:eu}}),(0,i.jsx)(v,{styles:ep}),(0,i.jsx)(v,{styles:eh})]}),(0,i.jsx)(b.Z,{themeId:H?t:void 0,theme:f?f(ed):ed,children:e})]});return z?ev:(0,i.jsx)(k.Provider,{value:em,children:ev})},useColorScheme:()=>{let e=a.useContext(k);if(!e)throw Error((0,m.Z)(19));return e},getInitColorSchemeScript:e=>(function(e){let{defaultMode:t="light",defaultLightColorScheme:n="light",defaultDarkColorScheme:r="dark",modeStorageKey:o=x,colorSchemeStorageKey:a=w,attribute:l=C,colorSchemeNode:s="document.documentElement"}=e||{};return(0,i.jsx)("script",{dangerouslySetInnerHTML:{__html:`(function() { try { var mode = localStorage.getItem('${o}') || '${t}'; var cssColorScheme = mode; var colorScheme = ''; @@ -158,7 +158,7 @@ if (colorScheme) { ${s}.setAttribute('${l}', colorScheme); } - } catch (e) {} })();`}},"mui-color-scheme-init")})((0,p.Z)({attribute:r,colorSchemeStorageKey:l,defaultMode:s,defaultLightColorScheme:Z,defaultDarkColorScheme:P,modeStorageKey:o},e))}}({themeId:P.Z,theme:k.Z,attribute:"data-joy-color-scheme",modeStorageKey:"joy-mode",colorSchemeStorageKey:"joy-color-scheme",defaultColorScheme:{light:"light",dark:"dark"},resolveTheme:e=>{let t=e.colorInversion;return e.colorInversion=(0,d.Z)({soft:(0,Z.pP)(e),solid:(0,Z.Lo)(e)},"function"==typeof t?t(e):t,{clone:!1}),e}});var A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M464 512a48 48 0 1096 0 48 48 0 10-96 0zm200 0a48 48 0 1096 0 48 48 0 10-96 0zm-400 0a48 48 0 1096 0 48 48 0 10-96 0zm661.2-173.6c-22.6-53.7-55-101.9-96.3-143.3a444.35 444.35 0 00-143.3-96.3C630.6 75.7 572.2 64 512 64h-2c-60.6.3-119.3 12.3-174.5 35.9a445.35 445.35 0 00-142 96.5c-40.9 41.3-73 89.3-95.2 142.8-23 55.4-34.6 114.3-34.3 174.9A449.4 449.4 0 00112 714v152a46 46 0 0046 46h152.1A449.4 449.4 0 00510 960h2.1c59.9 0 118-11.6 172.7-34.3a444.48 444.48 0 00142.8-95.2c41.3-40.9 73.8-88.7 96.5-142 23.6-55.2 35.6-113.9 35.9-174.5.3-60.9-11.5-120-34.8-175.6zm-151.1 438C704 845.8 611 884 512 884h-1.7c-60.3-.3-120.2-15.3-173.1-43.5l-8.4-4.5H188V695.2l-4.5-8.4C155.3 633.9 140.3 574 140 513.7c-.4-99.7 37.7-193.3 107.6-263.8 69.8-70.5 163.1-109.5 262.8-109.9h1.7c50 0 98.5 9.7 144.2 28.9 44.6 18.7 84.6 45.6 119 80 34.3 34.3 61.3 74.4 80 119 19.4 46.2 29.1 95.2 28.9 145.8-.6 99.6-39.7 192.9-110.1 262.7z"}}]},name:"message",theme:"outlined"},N=n(84089),T=a.forwardRef(function(e,t){return a.createElement(N.Z,(0,p.Z)({},e,{ref:t,icon:A}))}),M={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"defs",attrs:{},children:[{tag:"style",attrs:{}}]},{tag:"path",attrs:{d:"M301.3 496.7c-23.8 0-40.2-10.5-41.6-26.9H205c.9 43.4 36.9 70.3 93.9 70.3 59.1 0 95-28.4 95-75.5 0-35.8-20-55.9-64.5-64.5l-29.1-5.6c-23.8-4.7-33.8-11.9-33.8-24.2 0-15 13.3-24.5 33.4-24.5 20.1 0 35.3 11.1 36.6 27h53c-.9-41.7-37.5-70.3-90.3-70.3-54.4 0-89.7 28.9-89.7 73 0 35.5 21.2 58 62.5 65.8l29.7 5.9c25.8 5.2 35.6 11.9 35.6 24.4.1 14.7-14.5 25.1-36 25.1z"}},{tag:"path",attrs:{d:"M928 140H96c-17.7 0-32 14.3-32 32v496c0 17.7 14.3 32 32 32h380v112H304c-8.8 0-16 7.2-16 16v48c0 4.4 3.6 8 8 8h432c4.4 0 8-3.6 8-8v-48c0-8.8-7.2-16-16-16H548V700h380c17.7 0 32-14.3 32-32V172c0-17.7-14.3-32-32-32zm-40 488H136V212h752v416z"}},{tag:"path",attrs:{d:"M828.5 486.7h-95.8V308.5h-57.4V534h153.2zm-298.6 53.4c14.1 0 27.2-2 39.1-5.8l13.3 20.3h53.3L607.9 511c21.1-20 33-51.1 33-89.8 0-73.3-43.3-118.8-110.9-118.8s-111.2 45.3-111.2 118.8c-.1 73.7 43 118.9 111.1 118.9zm0-190c31.6 0 52.7 27.7 52.7 71.1 0 16.7-3.6 30.6-10 40.5l-5.2-6.9h-48.8L542 491c-3.9.9-8 1.4-12.2 1.4-31.7 0-52.8-27.5-52.8-71.2.1-43.6 21.2-71.1 52.9-71.1z"}}]},name:"console-sql",theme:"outlined"},I=a.forwardRef(function(e,t){return a.createElement(N.Z,(0,p.Z)({},e,{ref:t,icon:M}))}),F={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"defs",attrs:{},children:[{tag:"style",attrs:{}}]},{tag:"path",attrs:{d:"M640.6 429.8h257.1c7.9 0 14.3-6.4 14.3-14.3V158.3c0-7.9-6.4-14.3-14.3-14.3H640.6c-7.9 0-14.3 6.4-14.3 14.3v92.9H490.6c-3.9 0-7.1 3.2-7.1 7.1v221.5h-85.7v-96.5c0-7.9-6.4-14.3-14.3-14.3H126.3c-7.9 0-14.3 6.4-14.3 14.3v257.2c0 7.9 6.4 14.3 14.3 14.3h257.1c7.9 0 14.3-6.4 14.3-14.3V544h85.7v221.5c0 3.9 3.2 7.1 7.1 7.1h135.7v92.9c0 7.9 6.4 14.3 14.3 14.3h257.1c7.9 0 14.3-6.4 14.3-14.3v-257c0-7.9-6.4-14.3-14.3-14.3h-257c-7.9 0-14.3 6.4-14.3 14.3v100h-78.6v-393h78.6v100c0 7.9 6.4 14.3 14.3 14.3zm53.5-217.9h150V362h-150V211.9zM329.9 587h-150V437h150v150zm364.2 75.1h150v150.1h-150V662.1z"}}]},name:"partition",theme:"outlined"},L=a.forwardRef(function(e,t){return a.createElement(N.Z,(0,p.Z)({},e,{ref:t,icon:F}))}),B=n(16165),D={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M916 210H376c-17.7 0-32 14.3-32 32v236H108c-17.7 0-32 14.3-32 32v272c0 17.7 14.3 32 32 32h540c17.7 0 32-14.3 32-32V546h236c17.7 0 32-14.3 32-32V242c0-17.7-14.3-32-32-32zm-504 68h200v200H412V278zm-68 468H144V546h200v200zm268 0H412V546h200v200zm268-268H680V278h200v200z"}}]},name:"build",theme:"outlined"},z=a.forwardRef(function(e,t){return a.createElement(N.Z,(0,p.Z)({},e,{ref:t,icon:D}))}),H={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.4 800.9c.2-.3.5-.6.7-.9C920.6 722.1 960 621.7 960 512s-39.4-210.1-104.8-288c-.2-.3-.5-.5-.7-.8-1.1-1.3-2.1-2.5-3.2-3.7-.4-.5-.8-.9-1.2-1.4l-4.1-4.7-.1-.1c-1.5-1.7-3.1-3.4-4.6-5.1l-.1-.1c-3.2-3.4-6.4-6.8-9.7-10.1l-.1-.1-4.8-4.8-.3-.3c-1.5-1.5-3-2.9-4.5-4.3-.5-.5-1-1-1.6-1.5-1-1-2-1.9-3-2.8-.3-.3-.7-.6-1-1C736.4 109.2 629.5 64 512 64s-224.4 45.2-304.3 119.2c-.3.3-.7.6-1 1-1 .9-2 1.9-3 2.9-.5.5-1 1-1.6 1.5-1.5 1.4-3 2.9-4.5 4.3l-.3.3-4.8 4.8-.1.1c-3.3 3.3-6.5 6.7-9.7 10.1l-.1.1c-1.6 1.7-3.1 3.4-4.6 5.1l-.1.1c-1.4 1.5-2.8 3.1-4.1 4.7-.4.5-.8.9-1.2 1.4-1.1 1.2-2.1 2.5-3.2 3.7-.2.3-.5.5-.7.8C103.4 301.9 64 402.3 64 512s39.4 210.1 104.8 288c.2.3.5.6.7.9l3.1 3.7c.4.5.8.9 1.2 1.4l4.1 4.7c0 .1.1.1.1.2 1.5 1.7 3 3.4 4.6 5l.1.1c3.2 3.4 6.4 6.8 9.6 10.1l.1.1c1.6 1.6 3.1 3.2 4.7 4.7l.3.3c3.3 3.3 6.7 6.5 10.1 9.6 80.1 74 187 119.2 304.5 119.2s224.4-45.2 304.3-119.2a300 300 0 0010-9.6l.3-.3c1.6-1.6 3.2-3.1 4.7-4.7l.1-.1c3.3-3.3 6.5-6.7 9.6-10.1l.1-.1c1.5-1.7 3.1-3.3 4.6-5 0-.1.1-.1.1-.2 1.4-1.5 2.8-3.1 4.1-4.7.4-.5.8-.9 1.2-1.4a99 99 0 003.3-3.7zm4.1-142.6c-13.8 32.6-32 62.8-54.2 90.2a444.07 444.07 0 00-81.5-55.9c11.6-46.9 18.8-98.4 20.7-152.6H887c-3 40.9-12.6 80.6-28.5 118.3zM887 484H743.5c-1.9-54.2-9.1-105.7-20.7-152.6 29.3-15.6 56.6-34.4 81.5-55.9A373.86 373.86 0 01887 484zM658.3 165.5c39.7 16.8 75.8 40 107.6 69.2a394.72 394.72 0 01-59.4 41.8c-15.7-45-35.8-84.1-59.2-115.4 3.7 1.4 7.4 2.9 11 4.4zm-90.6 700.6c-9.2 7.2-18.4 12.7-27.7 16.4V697a389.1 389.1 0 01115.7 26.2c-8.3 24.6-17.9 47.3-29 67.8-17.4 32.4-37.8 58.3-59 75.1zm59-633.1c11 20.6 20.7 43.3 29 67.8A389.1 389.1 0 01540 327V141.6c9.2 3.7 18.5 9.1 27.7 16.4 21.2 16.7 41.6 42.6 59 75zM540 640.9V540h147.5c-1.6 44.2-7.1 87.1-16.3 127.8l-.3 1.2A445.02 445.02 0 00540 640.9zm0-156.9V383.1c45.8-2.8 89.8-12.5 130.9-28.1l.3 1.2c9.2 40.7 14.7 83.5 16.3 127.8H540zm-56 56v100.9c-45.8 2.8-89.8 12.5-130.9 28.1l-.3-1.2c-9.2-40.7-14.7-83.5-16.3-127.8H484zm-147.5-56c1.6-44.2 7.1-87.1 16.3-127.8l.3-1.2c41.1 15.6 85 25.3 130.9 28.1V484H336.5zM484 697v185.4c-9.2-3.7-18.5-9.1-27.7-16.4-21.2-16.7-41.7-42.7-59.1-75.1-11-20.6-20.7-43.3-29-67.8 37.2-14.6 75.9-23.3 115.8-26.1zm0-370a389.1 389.1 0 01-115.7-26.2c8.3-24.6 17.9-47.3 29-67.8 17.4-32.4 37.8-58.4 59.1-75.1 9.2-7.2 18.4-12.7 27.7-16.4V327zM365.7 165.5c3.7-1.5 7.3-3 11-4.4-23.4 31.3-43.5 70.4-59.2 115.4-21-12-40.9-26-59.4-41.8 31.8-29.2 67.9-52.4 107.6-69.2zM165.5 365.7c13.8-32.6 32-62.8 54.2-90.2 24.9 21.5 52.2 40.3 81.5 55.9-11.6 46.9-18.8 98.4-20.7 152.6H137c3-40.9 12.6-80.6 28.5-118.3zM137 540h143.5c1.9 54.2 9.1 105.7 20.7 152.6a444.07 444.07 0 00-81.5 55.9A373.86 373.86 0 01137 540zm228.7 318.5c-39.7-16.8-75.8-40-107.6-69.2 18.5-15.8 38.4-29.7 59.4-41.8 15.7 45 35.8 84.1 59.2 115.4-3.7-1.4-7.4-2.9-11-4.4zm292.6 0c-3.7 1.5-7.3 3-11 4.4 23.4-31.3 43.5-70.4 59.2-115.4 21 12 40.9 26 59.4 41.8a373.81 373.81 0 01-107.6 69.2z"}}]},name:"global",theme:"outlined"},V=a.forwardRef(function(e,t){return a.createElement(N.Z,(0,p.Z)({},e,{ref:t,icon:H}))}),U={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M408 442h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm-8 204c0 4.4 3.6 8 8 8h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56zm504-486H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 632H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM115.4 518.9L271.7 642c5.8 4.6 14.4.5 14.4-6.9V388.9c0-7.4-8.5-11.5-14.4-6.9L115.4 505.1a8.74 8.74 0 000 13.8z"}}]},name:"menu-fold",theme:"outlined"},W=a.forwardRef(function(e,t){return a.createElement(N.Z,(0,p.Z)({},e,{ref:t,icon:U}))}),K={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M408 442h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm-8 204c0 4.4 3.6 8 8 8h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56zm504-486H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 632H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM142.4 642.1L298.7 519a8.84 8.84 0 000-13.9L142.4 381.9c-5.8-4.6-14.4-.5-14.4 6.9v246.3a8.9 8.9 0 0014.4 7z"}}]},name:"menu-unfold",theme:"outlined"},q=a.forwardRef(function(e,t){return a.createElement(N.Z,(0,p.Z)({},e,{ref:t,icon:K}))}),G=n(24969),X={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M904 160H120c-4.4 0-8 3.6-8 8v64c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-64c0-4.4-3.6-8-8-8zm0 624H120c-4.4 0-8 3.6-8 8v64c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-64c0-4.4-3.6-8-8-8zm0-312H120c-4.4 0-8 3.6-8 8v64c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-64c0-4.4-3.6-8-8-8z"}}]},name:"menu",theme:"outlined"},Y=a.forwardRef(function(e,t){return a.createElement(N.Z,(0,p.Z)({},e,{ref:t,icon:X}))}),J={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M924.8 625.7l-65.5-56c3.1-19 4.7-38.4 4.7-57.8s-1.6-38.8-4.7-57.8l65.5-56a32.03 32.03 0 009.3-35.2l-.9-2.6a443.74 443.74 0 00-79.7-137.9l-1.8-2.1a32.12 32.12 0 00-35.1-9.5l-81.3 28.9c-30-24.6-63.5-44-99.7-57.6l-15.7-85a32.05 32.05 0 00-25.8-25.7l-2.7-.5c-52.1-9.4-106.9-9.4-159 0l-2.7.5a32.05 32.05 0 00-25.8 25.7l-15.8 85.4a351.86 351.86 0 00-99 57.4l-81.9-29.1a32 32 0 00-35.1 9.5l-1.8 2.1a446.02 446.02 0 00-79.7 137.9l-.9 2.6c-4.5 12.5-.8 26.5 9.3 35.2l66.3 56.6c-3.1 18.8-4.6 38-4.6 57.1 0 19.2 1.5 38.4 4.6 57.1L99 625.5a32.03 32.03 0 00-9.3 35.2l.9 2.6c18.1 50.4 44.9 96.9 79.7 137.9l1.8 2.1a32.12 32.12 0 0035.1 9.5l81.9-29.1c29.8 24.5 63.1 43.9 99 57.4l15.8 85.4a32.05 32.05 0 0025.8 25.7l2.7.5a449.4 449.4 0 00159 0l2.7-.5a32.05 32.05 0 0025.8-25.7l15.7-85a350 350 0 0099.7-57.6l81.3 28.9a32 32 0 0035.1-9.5l1.8-2.1c34.8-41.1 61.6-87.5 79.7-137.9l.9-2.6c4.5-12.3.8-26.3-9.3-35zM788.3 465.9c2.5 15.1 3.8 30.6 3.8 46.1s-1.3 31-3.8 46.1l-6.6 40.1 74.7 63.9a370.03 370.03 0 01-42.6 73.6L721 702.8l-31.4 25.8c-23.9 19.6-50.5 35-79.3 45.8l-38.1 14.3-17.9 97a377.5 377.5 0 01-85 0l-17.9-97.2-37.8-14.5c-28.5-10.8-55-26.2-78.7-45.7l-31.4-25.9-93.4 33.2c-17-22.9-31.2-47.6-42.6-73.6l75.5-64.5-6.5-40c-2.4-14.9-3.7-30.3-3.7-45.5 0-15.3 1.2-30.6 3.7-45.5l6.5-40-75.5-64.5c11.3-26.1 25.6-50.7 42.6-73.6l93.4 33.2 31.4-25.9c23.7-19.5 50.2-34.9 78.7-45.7l37.9-14.3 17.9-97.2c28.1-3.2 56.8-3.2 85 0l17.9 97 38.1 14.3c28.7 10.8 55.4 26.2 79.3 45.8l31.4 25.8 92.8-32.9c17 22.9 31.2 47.6 42.6 73.6L781.8 426l6.5 39.9zM512 326c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm79.2 255.2A111.6 111.6 0 01512 614c-29.9 0-58-11.7-79.2-32.8A111.6 111.6 0 01400 502c0-29.9 11.7-58 32.8-79.2C454 401.6 482.1 390 512 390c29.9 0 58 11.6 79.2 32.8A111.6 111.6 0 01624 502c0 29.9-11.7 58-32.8 79.2z"}}]},name:"setting",theme:"outlined"},Q=a.forwardRef(function(e,t){return a.createElement(N.Z,(0,p.Z)({},e,{ref:t,icon:J}))}),ee={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M752 664c-28.5 0-54.8 10-75.4 26.7L469.4 540.8a160.68 160.68 0 000-57.6l207.2-149.9C697.2 350 723.5 360 752 360c66.2 0 120-53.8 120-120s-53.8-120-120-120-120 53.8-120 120c0 11.6 1.6 22.7 4.7 33.3L439.9 415.8C410.7 377.1 364.3 352 312 352c-88.4 0-160 71.6-160 160s71.6 160 160 160c52.3 0 98.7-25.1 127.9-63.8l196.8 142.5c-3.1 10.6-4.7 21.8-4.7 33.3 0 66.2 53.8 120 120 120s120-53.8 120-120-53.8-120-120-120zm0-476c28.7 0 52 23.3 52 52s-23.3 52-52 52-52-23.3-52-52 23.3-52 52-52zM312 600c-48.5 0-88-39.5-88-88s39.5-88 88-88 88 39.5 88 88-39.5 88-88 88zm440 236c-28.7 0-52-23.3-52-52s23.3-52 52-52 52 23.3 52 52-23.3 52-52 52z"}}]},name:"share-alt",theme:"outlined"},et=a.forwardRef(function(e,t){return a.createElement(N.Z,(0,p.Z)({},e,{ref:t,icon:ee}))}),en=n(48689),er=n(12069),eo=n(2453),ei=n(83062),ea=n(85418),el=n(20640),es=n.n(el),ec=n(25675),eu=n.n(ec),ef=n(41664),ed=n.n(ef),ep=n(11163),eh=n.n(ep),em=n(67421),eg=function(){return(0,i.jsx)("svg",{width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 1024 1024",version:"1.1",children:(0,i.jsx)("path",{d:"M513.89 950.72c-5.5 0-11-1.4-15.99-4.2L143.84 743c-9.85-5.73-15.99-16.17-15.99-27.64V308.58c0-11.33 6.14-21.91 15.99-27.64L497.9 77.43c9.85-5.73 22.14-5.73 31.99 0l354.06 203.52c9.85 5.73 15.99 16.17 15.99 27.64V715.5c0 11.33-6.14 21.91-15.99 27.64L529.89 946.52c-4.99 2.8-10.49 4.2-16 4.2zM191.83 697.15L513.89 882.2l322.07-185.05V326.92L513.89 141.87 191.83 326.92v370.23z m322.06-153.34c-5.37 0-10.88-1.4-15.99-4.33L244.29 393.91c-15.35-8.79-20.6-28.27-11.77-43.56 8.83-15.28 28.41-20.5 43.76-11.72l253.61 145.7c15.35 8.79 20.6 28.27 11.77 43.56-6.01 10.32-16.76 15.92-27.77 15.92z m0 291.52c-17.66 0-31.99-14.26-31.99-31.84V530.44L244.55 393.91s-0.13 0-0.13-0.13l-100.45-57.69c-15.35-8.79-20.6-28.27-11.77-43.56s28.41-20.5 43.76-11.72l354.06 203.52c9.85 5.73 15.99 16.17 15.99 27.64v291.39c-0.13 17.71-14.46 31.97-32.12 31.97z m0 115.39c-17.66 0-31.99-14.26-31.99-31.84V511.97c0-17.58 14.33-31.84 31.99-31.84s31.99 14.26 31.99 31.84v406.91c0 17.7-14.33 31.84-31.99 31.84z m0-406.91c-11 0-21.75-5.73-27.77-15.92-8.83-15.28-3.58-34.64 11.77-43.56l354.06-203.52c15.35-8.79 34.8-3.57 43.76 11.72 8.83 15.28 3.58 34.64-11.77 43.56L529.89 539.61c-4.99 2.93-10.49 4.2-16 4.2z"})})};function ev(e){return"flex items-center px-2 h-8 hover:bg-slate-100 dark:hover:bg-[#353539] text-base w-full my-2 rounded transition-colors whitespace-nowrap ".concat(e?"bg-slate-100 dark:bg-[#353539]":"")}function ey(e){return"flex items-center justify-center mx-auto w-12 h-12 text-xl rounded hover:bg-slate-100 dark:hover:bg-[#353539] cursor-pointer ".concat(e?"bg-slate-100 dark:bg-[#353539]":"")}var eb=function(){let{chatId:e,scene:t,isMenuExpand:n,dialogueList:r,queryDialogueList:o,refreshDialogList:d,setIsMenuExpand:p}=(0,a.useContext)(l.p),{pathname:h,replace:m}=(0,ep.useRouter)(),{t:g,i18n:v}=(0,em.$G)(),{mode:y,setMode:b}=_(),[x,w]=(0,a.useState)("/LOGO_1.png"),C=(0,a.useMemo)(()=>{let e=[{key:"prompt",name:g("Prompt"),icon:(0,i.jsx)(T,{}),path:"/prompt"},{key:"database",name:g("Database"),icon:(0,i.jsx)(I,{}),path:"/database"},{key:"knowledge",name:g("Knowledge_Space"),icon:(0,i.jsx)(L,{}),path:"/knowledge"},{key:"models",name:g("model_manage"),path:"/models",icon:(0,i.jsx)(B.Z,{component:eg})},{key:"agent",name:g("Plusgins"),path:"/agent",icon:(0,i.jsx)(z,{})}];return e},[v.language]),E=()=>{p(!n)},S=(0,a.useCallback)(()=>{let e="light"===y?"dark":"light";b(e),localStorage.setItem(c.he,e)},[y]),$=(0,a.useCallback)(()=>{let e="en"===v.language?"zh":"en";v.changeLanguage(e),localStorage.setItem(c.Yl,e)},[v.language,v.changeLanguage]),O=(0,a.useMemo)(()=>{let e=[{key:"theme",name:g("Theme"),icon:"dark"===y?(0,i.jsx)(B.Z,{component:u}):(0,i.jsx)(B.Z,{component:f}),onClick:S},{key:"language",name:g("language"),icon:(0,i.jsx)(V,{}),onClick:$},{key:"fold",name:g(n?"Close_Sidebar":"Show_Sidebar"),icon:n?(0,i.jsx)(W,{}):(0,i.jsx)(q,{}),onClick:E,noDropdownItem:!0}];return e},[y,$,E,$]),k=(0,a.useMemo)(()=>C.map(e=>({key:e.key,label:(0,i.jsxs)(ed(),{href:e.path,className:"text-base",children:[e.icon,(0,i.jsx)("span",{className:"ml-2 text-sm",children:e.name})]})})),[C]),Z=(0,a.useMemo)(()=>O.filter(e=>!e.noDropdownItem).map(e=>({key:e.key,label:(0,i.jsxs)("div",{className:"text-base",onClick:e.onClick,children:[e.icon,(0,i.jsx)("span",{className:"ml-2 text-sm",children:e.name})]})})),[O]),P=(0,a.useCallback)(n=>{er.default.confirm({title:"Delete Chat",content:"Are you sure delete this chat?",width:"276px",centered:!0,onOk:()=>new Promise(async(r,o)=>{try{let[i]=await (0,s.Vx)((0,s.MX)(n.conv_uid));if(i){o();return}eo.ZP.success("success"),d(),n.chat_mode===t&&n.conv_uid===e&&m("/"),r()}catch(e){o()}})})},[d]),j=(0,a.useCallback)(e=>{let t=es()("".concat(location.origin,"/chat/").concat(e.chat_mode,"/").concat(e.conv_uid));eo.ZP[t?"success":"error"](t?"Copy success":"Copy failed")},[]);return((0,a.useEffect)(()=>{o()},[]),(0,a.useEffect)(()=>{w("dark"===y?"/WHITE_LOGO.png":"/LOGO_1.png")},[y]),n)?(0,i.jsxs)("div",{className:"flex flex-col h-screen border-r dark:bg-[#1A1E26]",children:[(0,i.jsx)(ed(),{href:"/",className:"p-2",children:(0,i.jsx)(eu(),{src:x,alt:"DB-GPT",width:239,height:60,className:"w-full h-full"})}),(0,i.jsxs)(ed(),{href:"/",className:"flex items-center justify-center mb-4 mx-4 h-11 bg-gradient-to-r from-[#31afff] to-[#1677ff] dark:bg-gradient-to-r dark:from-[#6a6a6a] dark:to-[#80868f] border-none rounded text-white",children:[(0,i.jsx)(G.Z,{className:"mr-2"}),(0,i.jsx)("span",{children:"New Chat"})]}),(0,i.jsx)("div",{className:"flex-1 overflow-y-scroll py-4 px-2 border-t",children:null==r?void 0:r.map(n=>{let r=n.conv_uid===e&&n.chat_mode===t;return(0,i.jsxs)(ed(),{href:"/chat?scene=".concat(n.chat_mode,"&id=").concat(n.conv_uid),className:"group/item ".concat(ev(r)),children:[(0,i.jsx)(T,{className:"text-base"}),(0,i.jsx)("div",{className:"flex-1 line-clamp-1 mx-2 text-sm",children:n.user_name||n.user_input}),(0,i.jsx)("div",{className:"group-hover/item:opacity-100 cursor-pointer opacity-0 mr-1",onClick:e=>{e.preventDefault(),j(n)},children:(0,i.jsx)(et,{})}),(0,i.jsx)("div",{className:"group-hover/item:opacity-100 cursor-pointer opacity-0",onClick:e=>{e.preventDefault(),P(n)},children:(0,i.jsx)(en.Z,{})})]},n.conv_uid)})}),(0,i.jsxs)("div",{className:"pt-2 pb-4 border-t",children:[(0,i.jsx)("div",{className:"px-2",children:C.map(e=>(0,i.jsx)(ed(),{href:e.path,className:"".concat(ev(h===e.path)),children:(0,i.jsxs)(i.Fragment,{children:[e.icon,(0,i.jsx)("span",{className:"ml-2 text-sm",children:e.name})]})},e.key))}),(0,i.jsx)("div",{className:"flex items-center justify-around py-4 border-t border-dashed",children:O.map(e=>(0,i.jsx)(ei.Z,{title:e.name,children:(0,i.jsx)("div",{className:"flex-1 flex items-center justify-center cursor-pointer text-xl",onClick:e.onClick,children:e.icon})},e.key))})]})]}):(0,i.jsxs)("div",{className:"flex flex-col justify-between h-screen border-r dark:bg-[#1A1E26] animate-fade animate-duration-300",children:[(0,i.jsx)(ed(),{href:"/",className:"px-2 py-3",children:(0,i.jsx)(eu(),{src:"/LOGO_SMALL.png",alt:"DB-GPT",width:63,height:46,className:"w-[63px] h-[46px]"})}),(0,i.jsx)("div",{className:"border-t border-dashed",children:(0,i.jsx)(ed(),{href:"/",className:"flex items-center justify-center my-4 mx-auto w-12 h-12 bg-gradient-to-r from-[#31afff] to-[#1677ff] dark:bg-gradient-to-r dark:from-[#6a6a6a] dark:to-[#80868f] border-none rounded-full text-white",children:(0,i.jsx)(G.Z,{className:"text-lg"})})}),(0,i.jsx)("div",{className:"flex-1 overflow-y-scroll py-4 border-t border-dashed space-y-2",children:null==r?void 0:r.map(n=>{let r=n.conv_uid===e&&n.chat_mode===t;return(0,i.jsx)(ei.Z,{title:n.user_name||n.user_input,placement:"right",children:(0,i.jsx)(ed(),{href:"/chat?scene=".concat(n.chat_mode,"&id=").concat(n.conv_uid),className:ey(r),children:(0,i.jsx)(T,{})})},n.conv_uid)})}),(0,i.jsxs)("div",{className:"py-4 space-y-2 border-t",children:[(0,i.jsx)(ea.Z,{menu:{items:k},placement:"topRight",children:(0,i.jsx)("div",{className:ey(),children:(0,i.jsx)(Y,{})})}),(0,i.jsx)(ea.Z,{menu:{items:Z},placement:"topRight",children:(0,i.jsx)("div",{className:ey(),children:(0,i.jsx)(Q,{})})}),O.filter(e=>e.noDropdownItem).map(e=>(0,i.jsx)(ei.Z,{title:e.name,placement:"right",children:(0,i.jsx)("div",{className:ey(),onClick:e.onClick,children:e.icon})},e.key))]})]})},ex=n(38629),ew=n(59077),eC=n(9818);let eE=(0,ew.Z)({colorSchemes:{light:{palette:{mode:"dark",primary:{...eC.Z.grey,solidBg:"#e6f4ff",solidColor:"#1677ff",solidHoverBg:"#e6f4ff"},neutral:{plainColor:"#4d4d4d",plainHoverColor:"#131318",plainHoverBg:"#EBEBEF",plainActiveBg:"#D8D8DF",plainDisabledColor:"#B9B9C6"},background:{body:"#fff",surface:"#fff"},text:{primary:"#505050"}}},dark:{palette:{mode:"light",primary:{...eC.Z.grey,softBg:"#353539",softHoverBg:"#35353978",softDisabledBg:"#353539",solidBg:"#51525beb",solidHoverBg:"#51525beb"},neutral:{plainColor:"#D8D8DF",plainHoverColor:"#F7F7F8",plainHoverBg:"#353539",plainActiveBg:"#434356",plainDisabledColor:"#434356",outlinedBorder:"#353539",outlinedHoverBorder:"#454651"},text:{primary:"#EBEBEF"},background:{body:"#212121",surface:"#51525beb"}}}},fontFamily:{body:"Josefin Sans, sans-serif",display:"Josefin Sans, sans-serif"},typography:{display1:{background:"linear-gradient(-30deg, var(--joy-palette-primary-900), var(--joy-palette-primary-400))",WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent"}},zIndex:{modal:1001}});var eS=n(74865),e$=n.n(eS);let eO=0;function ek(){"loading"!==o&&(o="loading",r=setTimeout(function(){e$().start()},250))}function eZ(){eO>0||(o="stop",clearTimeout(r),e$().done())}if(eh().events.on("routeChangeStart",ek),eh().events.on("routeChangeComplete",eZ),eh().events.on("routeChangeError",eZ),"function"==typeof(null==window?void 0:window.fetch)){let e=window.fetch;window.fetch=async function(){for(var t=arguments.length,n=Array(t),r=0;r{let e=function(){let e=localStorage.getItem(c.he);return e||(window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light")}();o(e)},[]),(0,a.useEffect)(()=>{if((null==s?void 0:s.current)&&r){var e,t,n,o,i,a;null==s||null===(e=s.current)||void 0===e||null===(t=e.classList)||void 0===t||t.add(r),"light"===r?null==s||null===(n=s.current)||void 0===n||null===(o=n.classList)||void 0===o||o.remove("dark"):null==s||null===(i=s.current)||void 0===i||null===(a=i.classList)||void 0===a||a.remove("light")}},[s,r]),(0,a.useEffect)(()=>{n.changeLanguage&&n.changeLanguage(window.localStorage.getItem(c.Yl)||"en")},[n]),(0,i.jsxs)("div",{ref:s,children:[(0,i.jsx)(eP,{}),(0,i.jsx)(l.R,{children:t})]})}function eT(e){let{children:t}=e,{isMenuExpand:n}=(0,a.useContext)(l.p),{mode:r}=_();return(0,i.jsx)(eR.ZP,{theme:{algorithm:"dark"===r?eA.default.darkAlgorithm:void 0},children:(0,i.jsxs)("div",{className:"flex w-screen h-screen overflow-hidden",children:[(0,i.jsx)("div",{className:e_()("transition-[width]",n?"w-64":"w-20","hidden","md:block"),children:(0,i.jsx)(eb,{})}),(0,i.jsx)("div",{className:"flex flex-col flex-1 relative overflow-hidden",children:t})]})})}var eM=function(e){let{Component:t,pageProps:n}=e;return(0,i.jsx)(ex.Z,{theme:eE,children:(0,i.jsx)(j,{theme:eE,defaultMode:"light",children:(0,i.jsx)(eN,{children:(0,i.jsx)(eT,{children:(0,i.jsx)(t,{...n})})})})})}},21876:function(e){!function(){var t={675:function(e,t){"use strict";t.byteLength=function(e){var t=s(e),n=t[0],r=t[1];return(n+r)*3/4-r},t.toByteArray=function(e){var t,n,i=s(e),a=i[0],l=i[1],c=new o((a+l)*3/4-l),u=0,f=l>0?a-4:a;for(n=0;n>16&255,c[u++]=t>>8&255,c[u++]=255&t;return 2===l&&(t=r[e.charCodeAt(n)]<<2|r[e.charCodeAt(n+1)]>>4,c[u++]=255&t),1===l&&(t=r[e.charCodeAt(n)]<<10|r[e.charCodeAt(n+1)]<<4|r[e.charCodeAt(n+2)]>>2,c[u++]=t>>8&255,c[u++]=255&t),c},t.fromByteArray=function(e){for(var t,r=e.length,o=r%3,i=[],a=0,l=r-o;a>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return i.join("")}(e,a,a+16383>l?l:a+16383));return 1===o?i.push(n[(t=e[r-1])>>2]+n[t<<4&63]+"=="):2===o&&i.push(n[(t=(e[r-2]<<8)+e[r-1])>>10]+n[t>>4&63]+n[t<<2&63]+"="),i.join("")};for(var n=[],r=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,l=i.length;a0)throw Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");-1===n&&(n=t);var r=n===t?0:4-n%4;return[n,r]}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},72:function(e,t,n){"use strict";/*! + } catch (e) {} })();`}},"mui-color-scheme-init")})((0,p.Z)({attribute:r,colorSchemeStorageKey:l,defaultMode:s,defaultLightColorScheme:Z,defaultDarkColorScheme:P,modeStorageKey:o},e))}}({themeId:P.Z,theme:k.Z,attribute:"data-joy-color-scheme",modeStorageKey:"joy-mode",colorSchemeStorageKey:"joy-color-scheme",defaultColorScheme:{light:"light",dark:"dark"},resolveTheme:e=>{let t=e.colorInversion;return e.colorInversion=(0,d.Z)({soft:(0,Z.pP)(e),solid:(0,Z.Lo)(e)},"function"==typeof t?t(e):t,{clone:!1}),e}});var A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M464 512a48 48 0 1096 0 48 48 0 10-96 0zm200 0a48 48 0 1096 0 48 48 0 10-96 0zm-400 0a48 48 0 1096 0 48 48 0 10-96 0zm661.2-173.6c-22.6-53.7-55-101.9-96.3-143.3a444.35 444.35 0 00-143.3-96.3C630.6 75.7 572.2 64 512 64h-2c-60.6.3-119.3 12.3-174.5 35.9a445.35 445.35 0 00-142 96.5c-40.9 41.3-73 89.3-95.2 142.8-23 55.4-34.6 114.3-34.3 174.9A449.4 449.4 0 00112 714v152a46 46 0 0046 46h152.1A449.4 449.4 0 00510 960h2.1c59.9 0 118-11.6 172.7-34.3a444.48 444.48 0 00142.8-95.2c41.3-40.9 73.8-88.7 96.5-142 23.6-55.2 35.6-113.9 35.9-174.5.3-60.9-11.5-120-34.8-175.6zm-151.1 438C704 845.8 611 884 512 884h-1.7c-60.3-.3-120.2-15.3-173.1-43.5l-8.4-4.5H188V695.2l-4.5-8.4C155.3 633.9 140.3 574 140 513.7c-.4-99.7 37.7-193.3 107.6-263.8 69.8-70.5 163.1-109.5 262.8-109.9h1.7c50 0 98.5 9.7 144.2 28.9 44.6 18.7 84.6 45.6 119 80 34.3 34.3 61.3 74.4 80 119 19.4 46.2 29.1 95.2 28.9 145.8-.6 99.6-39.7 192.9-110.1 262.7z"}}]},name:"message",theme:"outlined"},N=n(84089),T=a.forwardRef(function(e,t){return a.createElement(N.Z,(0,p.Z)({},e,{ref:t,icon:A}))}),M={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"defs",attrs:{},children:[{tag:"style",attrs:{}}]},{tag:"path",attrs:{d:"M301.3 496.7c-23.8 0-40.2-10.5-41.6-26.9H205c.9 43.4 36.9 70.3 93.9 70.3 59.1 0 95-28.4 95-75.5 0-35.8-20-55.9-64.5-64.5l-29.1-5.6c-23.8-4.7-33.8-11.9-33.8-24.2 0-15 13.3-24.5 33.4-24.5 20.1 0 35.3 11.1 36.6 27h53c-.9-41.7-37.5-70.3-90.3-70.3-54.4 0-89.7 28.9-89.7 73 0 35.5 21.2 58 62.5 65.8l29.7 5.9c25.8 5.2 35.6 11.9 35.6 24.4.1 14.7-14.5 25.1-36 25.1z"}},{tag:"path",attrs:{d:"M928 140H96c-17.7 0-32 14.3-32 32v496c0 17.7 14.3 32 32 32h380v112H304c-8.8 0-16 7.2-16 16v48c0 4.4 3.6 8 8 8h432c4.4 0 8-3.6 8-8v-48c0-8.8-7.2-16-16-16H548V700h380c17.7 0 32-14.3 32-32V172c0-17.7-14.3-32-32-32zm-40 488H136V212h752v416z"}},{tag:"path",attrs:{d:"M828.5 486.7h-95.8V308.5h-57.4V534h153.2zm-298.6 53.4c14.1 0 27.2-2 39.1-5.8l13.3 20.3h53.3L607.9 511c21.1-20 33-51.1 33-89.8 0-73.3-43.3-118.8-110.9-118.8s-111.2 45.3-111.2 118.8c-.1 73.7 43 118.9 111.1 118.9zm0-190c31.6 0 52.7 27.7 52.7 71.1 0 16.7-3.6 30.6-10 40.5l-5.2-6.9h-48.8L542 491c-3.9.9-8 1.4-12.2 1.4-31.7 0-52.8-27.5-52.8-71.2.1-43.6 21.2-71.1 52.9-71.1z"}}]},name:"console-sql",theme:"outlined"},I=a.forwardRef(function(e,t){return a.createElement(N.Z,(0,p.Z)({},e,{ref:t,icon:M}))}),F={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"defs",attrs:{},children:[{tag:"style",attrs:{}}]},{tag:"path",attrs:{d:"M640.6 429.8h257.1c7.9 0 14.3-6.4 14.3-14.3V158.3c0-7.9-6.4-14.3-14.3-14.3H640.6c-7.9 0-14.3 6.4-14.3 14.3v92.9H490.6c-3.9 0-7.1 3.2-7.1 7.1v221.5h-85.7v-96.5c0-7.9-6.4-14.3-14.3-14.3H126.3c-7.9 0-14.3 6.4-14.3 14.3v257.2c0 7.9 6.4 14.3 14.3 14.3h257.1c7.9 0 14.3-6.4 14.3-14.3V544h85.7v221.5c0 3.9 3.2 7.1 7.1 7.1h135.7v92.9c0 7.9 6.4 14.3 14.3 14.3h257.1c7.9 0 14.3-6.4 14.3-14.3v-257c0-7.9-6.4-14.3-14.3-14.3h-257c-7.9 0-14.3 6.4-14.3 14.3v100h-78.6v-393h78.6v100c0 7.9 6.4 14.3 14.3 14.3zm53.5-217.9h150V362h-150V211.9zM329.9 587h-150V437h150v150zm364.2 75.1h150v150.1h-150V662.1z"}}]},name:"partition",theme:"outlined"},L=a.forwardRef(function(e,t){return a.createElement(N.Z,(0,p.Z)({},e,{ref:t,icon:F}))}),B=n(16165),D={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M916 210H376c-17.7 0-32 14.3-32 32v236H108c-17.7 0-32 14.3-32 32v272c0 17.7 14.3 32 32 32h540c17.7 0 32-14.3 32-32V546h236c17.7 0 32-14.3 32-32V242c0-17.7-14.3-32-32-32zm-504 68h200v200H412V278zm-68 468H144V546h200v200zm268 0H412V546h200v200zm268-268H680V278h200v200z"}}]},name:"build",theme:"outlined"},z=a.forwardRef(function(e,t){return a.createElement(N.Z,(0,p.Z)({},e,{ref:t,icon:D}))}),H={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.4 800.9c.2-.3.5-.6.7-.9C920.6 722.1 960 621.7 960 512s-39.4-210.1-104.8-288c-.2-.3-.5-.5-.7-.8-1.1-1.3-2.1-2.5-3.2-3.7-.4-.5-.8-.9-1.2-1.4l-4.1-4.7-.1-.1c-1.5-1.7-3.1-3.4-4.6-5.1l-.1-.1c-3.2-3.4-6.4-6.8-9.7-10.1l-.1-.1-4.8-4.8-.3-.3c-1.5-1.5-3-2.9-4.5-4.3-.5-.5-1-1-1.6-1.5-1-1-2-1.9-3-2.8-.3-.3-.7-.6-1-1C736.4 109.2 629.5 64 512 64s-224.4 45.2-304.3 119.2c-.3.3-.7.6-1 1-1 .9-2 1.9-3 2.9-.5.5-1 1-1.6 1.5-1.5 1.4-3 2.9-4.5 4.3l-.3.3-4.8 4.8-.1.1c-3.3 3.3-6.5 6.7-9.7 10.1l-.1.1c-1.6 1.7-3.1 3.4-4.6 5.1l-.1.1c-1.4 1.5-2.8 3.1-4.1 4.7-.4.5-.8.9-1.2 1.4-1.1 1.2-2.1 2.5-3.2 3.7-.2.3-.5.5-.7.8C103.4 301.9 64 402.3 64 512s39.4 210.1 104.8 288c.2.3.5.6.7.9l3.1 3.7c.4.5.8.9 1.2 1.4l4.1 4.7c0 .1.1.1.1.2 1.5 1.7 3 3.4 4.6 5l.1.1c3.2 3.4 6.4 6.8 9.6 10.1l.1.1c1.6 1.6 3.1 3.2 4.7 4.7l.3.3c3.3 3.3 6.7 6.5 10.1 9.6 80.1 74 187 119.2 304.5 119.2s224.4-45.2 304.3-119.2a300 300 0 0010-9.6l.3-.3c1.6-1.6 3.2-3.1 4.7-4.7l.1-.1c3.3-3.3 6.5-6.7 9.6-10.1l.1-.1c1.5-1.7 3.1-3.3 4.6-5 0-.1.1-.1.1-.2 1.4-1.5 2.8-3.1 4.1-4.7.4-.5.8-.9 1.2-1.4a99 99 0 003.3-3.7zm4.1-142.6c-13.8 32.6-32 62.8-54.2 90.2a444.07 444.07 0 00-81.5-55.9c11.6-46.9 18.8-98.4 20.7-152.6H887c-3 40.9-12.6 80.6-28.5 118.3zM887 484H743.5c-1.9-54.2-9.1-105.7-20.7-152.6 29.3-15.6 56.6-34.4 81.5-55.9A373.86 373.86 0 01887 484zM658.3 165.5c39.7 16.8 75.8 40 107.6 69.2a394.72 394.72 0 01-59.4 41.8c-15.7-45-35.8-84.1-59.2-115.4 3.7 1.4 7.4 2.9 11 4.4zm-90.6 700.6c-9.2 7.2-18.4 12.7-27.7 16.4V697a389.1 389.1 0 01115.7 26.2c-8.3 24.6-17.9 47.3-29 67.8-17.4 32.4-37.8 58.3-59 75.1zm59-633.1c11 20.6 20.7 43.3 29 67.8A389.1 389.1 0 01540 327V141.6c9.2 3.7 18.5 9.1 27.7 16.4 21.2 16.7 41.6 42.6 59 75zM540 640.9V540h147.5c-1.6 44.2-7.1 87.1-16.3 127.8l-.3 1.2A445.02 445.02 0 00540 640.9zm0-156.9V383.1c45.8-2.8 89.8-12.5 130.9-28.1l.3 1.2c9.2 40.7 14.7 83.5 16.3 127.8H540zm-56 56v100.9c-45.8 2.8-89.8 12.5-130.9 28.1l-.3-1.2c-9.2-40.7-14.7-83.5-16.3-127.8H484zm-147.5-56c1.6-44.2 7.1-87.1 16.3-127.8l.3-1.2c41.1 15.6 85 25.3 130.9 28.1V484H336.5zM484 697v185.4c-9.2-3.7-18.5-9.1-27.7-16.4-21.2-16.7-41.7-42.7-59.1-75.1-11-20.6-20.7-43.3-29-67.8 37.2-14.6 75.9-23.3 115.8-26.1zm0-370a389.1 389.1 0 01-115.7-26.2c8.3-24.6 17.9-47.3 29-67.8 17.4-32.4 37.8-58.4 59.1-75.1 9.2-7.2 18.4-12.7 27.7-16.4V327zM365.7 165.5c3.7-1.5 7.3-3 11-4.4-23.4 31.3-43.5 70.4-59.2 115.4-21-12-40.9-26-59.4-41.8 31.8-29.2 67.9-52.4 107.6-69.2zM165.5 365.7c13.8-32.6 32-62.8 54.2-90.2 24.9 21.5 52.2 40.3 81.5 55.9-11.6 46.9-18.8 98.4-20.7 152.6H137c3-40.9 12.6-80.6 28.5-118.3zM137 540h143.5c1.9 54.2 9.1 105.7 20.7 152.6a444.07 444.07 0 00-81.5 55.9A373.86 373.86 0 01137 540zm228.7 318.5c-39.7-16.8-75.8-40-107.6-69.2 18.5-15.8 38.4-29.7 59.4-41.8 15.7 45 35.8 84.1 59.2 115.4-3.7-1.4-7.4-2.9-11-4.4zm292.6 0c-3.7 1.5-7.3 3-11 4.4 23.4-31.3 43.5-70.4 59.2-115.4 21 12 40.9 26 59.4 41.8a373.81 373.81 0 01-107.6 69.2z"}}]},name:"global",theme:"outlined"},V=a.forwardRef(function(e,t){return a.createElement(N.Z,(0,p.Z)({},e,{ref:t,icon:H}))}),U={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M408 442h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm-8 204c0 4.4 3.6 8 8 8h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56zm504-486H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 632H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM115.4 518.9L271.7 642c5.8 4.6 14.4.5 14.4-6.9V388.9c0-7.4-8.5-11.5-14.4-6.9L115.4 505.1a8.74 8.74 0 000 13.8z"}}]},name:"menu-fold",theme:"outlined"},W=a.forwardRef(function(e,t){return a.createElement(N.Z,(0,p.Z)({},e,{ref:t,icon:U}))}),K={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M408 442h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm-8 204c0 4.4 3.6 8 8 8h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56zm504-486H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 632H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM142.4 642.1L298.7 519a8.84 8.84 0 000-13.9L142.4 381.9c-5.8-4.6-14.4-.5-14.4 6.9v246.3a8.9 8.9 0 0014.4 7z"}}]},name:"menu-unfold",theme:"outlined"},q=a.forwardRef(function(e,t){return a.createElement(N.Z,(0,p.Z)({},e,{ref:t,icon:K}))}),G=n(24969),X={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M904 160H120c-4.4 0-8 3.6-8 8v64c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-64c0-4.4-3.6-8-8-8zm0 624H120c-4.4 0-8 3.6-8 8v64c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-64c0-4.4-3.6-8-8-8zm0-312H120c-4.4 0-8 3.6-8 8v64c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-64c0-4.4-3.6-8-8-8z"}}]},name:"menu",theme:"outlined"},Y=a.forwardRef(function(e,t){return a.createElement(N.Z,(0,p.Z)({},e,{ref:t,icon:X}))}),J={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M924.8 625.7l-65.5-56c3.1-19 4.7-38.4 4.7-57.8s-1.6-38.8-4.7-57.8l65.5-56a32.03 32.03 0 009.3-35.2l-.9-2.6a443.74 443.74 0 00-79.7-137.9l-1.8-2.1a32.12 32.12 0 00-35.1-9.5l-81.3 28.9c-30-24.6-63.5-44-99.7-57.6l-15.7-85a32.05 32.05 0 00-25.8-25.7l-2.7-.5c-52.1-9.4-106.9-9.4-159 0l-2.7.5a32.05 32.05 0 00-25.8 25.7l-15.8 85.4a351.86 351.86 0 00-99 57.4l-81.9-29.1a32 32 0 00-35.1 9.5l-1.8 2.1a446.02 446.02 0 00-79.7 137.9l-.9 2.6c-4.5 12.5-.8 26.5 9.3 35.2l66.3 56.6c-3.1 18.8-4.6 38-4.6 57.1 0 19.2 1.5 38.4 4.6 57.1L99 625.5a32.03 32.03 0 00-9.3 35.2l.9 2.6c18.1 50.4 44.9 96.9 79.7 137.9l1.8 2.1a32.12 32.12 0 0035.1 9.5l81.9-29.1c29.8 24.5 63.1 43.9 99 57.4l15.8 85.4a32.05 32.05 0 0025.8 25.7l2.7.5a449.4 449.4 0 00159 0l2.7-.5a32.05 32.05 0 0025.8-25.7l15.7-85a350 350 0 0099.7-57.6l81.3 28.9a32 32 0 0035.1-9.5l1.8-2.1c34.8-41.1 61.6-87.5 79.7-137.9l.9-2.6c4.5-12.3.8-26.3-9.3-35zM788.3 465.9c2.5 15.1 3.8 30.6 3.8 46.1s-1.3 31-3.8 46.1l-6.6 40.1 74.7 63.9a370.03 370.03 0 01-42.6 73.6L721 702.8l-31.4 25.8c-23.9 19.6-50.5 35-79.3 45.8l-38.1 14.3-17.9 97a377.5 377.5 0 01-85 0l-17.9-97.2-37.8-14.5c-28.5-10.8-55-26.2-78.7-45.7l-31.4-25.9-93.4 33.2c-17-22.9-31.2-47.6-42.6-73.6l75.5-64.5-6.5-40c-2.4-14.9-3.7-30.3-3.7-45.5 0-15.3 1.2-30.6 3.7-45.5l6.5-40-75.5-64.5c11.3-26.1 25.6-50.7 42.6-73.6l93.4 33.2 31.4-25.9c23.7-19.5 50.2-34.9 78.7-45.7l37.9-14.3 17.9-97.2c28.1-3.2 56.8-3.2 85 0l17.9 97 38.1 14.3c28.7 10.8 55.4 26.2 79.3 45.8l31.4 25.8 92.8-32.9c17 22.9 31.2 47.6 42.6 73.6L781.8 426l6.5 39.9zM512 326c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm79.2 255.2A111.6 111.6 0 01512 614c-29.9 0-58-11.7-79.2-32.8A111.6 111.6 0 01400 502c0-29.9 11.7-58 32.8-79.2C454 401.6 482.1 390 512 390c29.9 0 58 11.6 79.2 32.8A111.6 111.6 0 01624 502c0 29.9-11.7 58-32.8 79.2z"}}]},name:"setting",theme:"outlined"},Q=a.forwardRef(function(e,t){return a.createElement(N.Z,(0,p.Z)({},e,{ref:t,icon:J}))}),ee={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M752 664c-28.5 0-54.8 10-75.4 26.7L469.4 540.8a160.68 160.68 0 000-57.6l207.2-149.9C697.2 350 723.5 360 752 360c66.2 0 120-53.8 120-120s-53.8-120-120-120-120 53.8-120 120c0 11.6 1.6 22.7 4.7 33.3L439.9 415.8C410.7 377.1 364.3 352 312 352c-88.4 0-160 71.6-160 160s71.6 160 160 160c52.3 0 98.7-25.1 127.9-63.8l196.8 142.5c-3.1 10.6-4.7 21.8-4.7 33.3 0 66.2 53.8 120 120 120s120-53.8 120-120-53.8-120-120-120zm0-476c28.7 0 52 23.3 52 52s-23.3 52-52 52-52-23.3-52-52 23.3-52 52-52zM312 600c-48.5 0-88-39.5-88-88s39.5-88 88-88 88 39.5 88 88-39.5 88-88 88zm440 236c-28.7 0-52-23.3-52-52s23.3-52 52-52 52 23.3 52 52-23.3 52-52 52z"}}]},name:"share-alt",theme:"outlined"},et=a.forwardRef(function(e,t){return a.createElement(N.Z,(0,p.Z)({},e,{ref:t,icon:ee}))}),en=n(48689),er=n(12069),eo=n(2453),ei=n(83062),ea=n(85418),el=n(20640),es=n.n(el),ec=n(25675),eu=n.n(ec),ef=n(41664),ed=n.n(ef),ep=n(11163),eh=n.n(ep),em=n(67421),eg=function(){return(0,i.jsx)("svg",{width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 1024 1024",version:"1.1",children:(0,i.jsx)("path",{d:"M513.89 950.72c-5.5 0-11-1.4-15.99-4.2L143.84 743c-9.85-5.73-15.99-16.17-15.99-27.64V308.58c0-11.33 6.14-21.91 15.99-27.64L497.9 77.43c9.85-5.73 22.14-5.73 31.99 0l354.06 203.52c9.85 5.73 15.99 16.17 15.99 27.64V715.5c0 11.33-6.14 21.91-15.99 27.64L529.89 946.52c-4.99 2.8-10.49 4.2-16 4.2zM191.83 697.15L513.89 882.2l322.07-185.05V326.92L513.89 141.87 191.83 326.92v370.23z m322.06-153.34c-5.37 0-10.88-1.4-15.99-4.33L244.29 393.91c-15.35-8.79-20.6-28.27-11.77-43.56 8.83-15.28 28.41-20.5 43.76-11.72l253.61 145.7c15.35 8.79 20.6 28.27 11.77 43.56-6.01 10.32-16.76 15.92-27.77 15.92z m0 291.52c-17.66 0-31.99-14.26-31.99-31.84V530.44L244.55 393.91s-0.13 0-0.13-0.13l-100.45-57.69c-15.35-8.79-20.6-28.27-11.77-43.56s28.41-20.5 43.76-11.72l354.06 203.52c9.85 5.73 15.99 16.17 15.99 27.64v291.39c-0.13 17.71-14.46 31.97-32.12 31.97z m0 115.39c-17.66 0-31.99-14.26-31.99-31.84V511.97c0-17.58 14.33-31.84 31.99-31.84s31.99 14.26 31.99 31.84v406.91c0 17.7-14.33 31.84-31.99 31.84z m0-406.91c-11 0-21.75-5.73-27.77-15.92-8.83-15.28-3.58-34.64 11.77-43.56l354.06-203.52c15.35-8.79 34.8-3.57 43.76 11.72 8.83 15.28 3.58 34.64-11.77 43.56L529.89 539.61c-4.99 2.93-10.49 4.2-16 4.2z"})})};function ev(e){return"flex items-center px-2 h-8 hover:bg-slate-100 dark:hover:bg-[#353539] text-base w-full my-2 rounded transition-colors whitespace-nowrap ".concat(e?"bg-slate-100 dark:bg-[#353539]":"")}function ey(e){return"flex items-center justify-center mx-auto w-12 h-12 text-xl rounded hover:bg-slate-100 dark:hover:bg-[#353539] cursor-pointer ".concat(e?"bg-slate-100 dark:bg-[#353539]":"")}var eb=function(){let{chatId:e,scene:t,isMenuExpand:n,dialogueList:r,queryDialogueList:o,refreshDialogList:d,setIsMenuExpand:p}=(0,a.useContext)(l.p),{pathname:h,replace:m}=(0,ep.useRouter)(),{t:g,i18n:v}=(0,em.$G)(),{mode:y,setMode:b}=_(),[x,w]=(0,a.useState)("/LOGO_1.png"),C=(0,a.useMemo)(()=>{let e=[{key:"prompt",name:g("Prompt"),icon:(0,i.jsx)(T,{}),path:"/prompt"},{key:"database",name:g("Database"),icon:(0,i.jsx)(I,{}),path:"/database"},{key:"knowledge",name:g("Knowledge_Space"),icon:(0,i.jsx)(L,{}),path:"/knowledge"},{key:"models",name:g("model_manage"),path:"/models",icon:(0,i.jsx)(B.Z,{component:eg})},{key:"agent",name:g("Plugins"),path:"/agent",icon:(0,i.jsx)(z,{})}];return e},[v.language]),E=()=>{p(!n)},S=(0,a.useCallback)(()=>{let e="light"===y?"dark":"light";b(e),localStorage.setItem(c.he,e)},[y]),$=(0,a.useCallback)(()=>{let e="en"===v.language?"zh":"en";v.changeLanguage(e),localStorage.setItem(c.Yl,e)},[v.language,v.changeLanguage]),O=(0,a.useMemo)(()=>{let e=[{key:"theme",name:g("Theme"),icon:"dark"===y?(0,i.jsx)(B.Z,{component:u}):(0,i.jsx)(B.Z,{component:f}),onClick:S},{key:"language",name:g("language"),icon:(0,i.jsx)(V,{}),onClick:$},{key:"fold",name:g(n?"Close_Sidebar":"Show_Sidebar"),icon:n?(0,i.jsx)(W,{}):(0,i.jsx)(q,{}),onClick:E,noDropdownItem:!0}];return e},[y,$,E,$]),k=(0,a.useMemo)(()=>C.map(e=>({key:e.key,label:(0,i.jsxs)(ed(),{href:e.path,className:"text-base",children:[e.icon,(0,i.jsx)("span",{className:"ml-2 text-sm",children:e.name})]})})),[C]),Z=(0,a.useMemo)(()=>O.filter(e=>!e.noDropdownItem).map(e=>({key:e.key,label:(0,i.jsxs)("div",{className:"text-base",onClick:e.onClick,children:[e.icon,(0,i.jsx)("span",{className:"ml-2 text-sm",children:e.name})]})})),[O]),P=(0,a.useCallback)(n=>{er.default.confirm({title:"Delete Chat",content:"Are you sure delete this chat?",width:"276px",centered:!0,onOk:()=>new Promise(async(r,o)=>{try{let[i]=await (0,s.Vx)((0,s.MX)(n.conv_uid));if(i){o();return}eo.ZP.success("success"),d(),n.chat_mode===t&&n.conv_uid===e&&m("/"),r()}catch(e){o()}})})},[d]),j=(0,a.useCallback)(e=>{let t=es()("".concat(location.origin,"/chat/").concat(e.chat_mode,"/").concat(e.conv_uid));eo.ZP[t?"success":"error"](t?"Copy success":"Copy failed")},[]);return((0,a.useEffect)(()=>{o()},[]),(0,a.useEffect)(()=>{w("dark"===y?"/WHITE_LOGO.png":"/LOGO_1.png")},[y]),n)?(0,i.jsxs)("div",{className:"flex flex-col h-screen border-r dark:bg-[#1A1E26]",children:[(0,i.jsx)(ed(),{href:"/",className:"p-2",children:(0,i.jsx)(eu(),{src:x,alt:"DB-GPT",width:239,height:60,className:"w-full h-full"})}),(0,i.jsxs)(ed(),{href:"/",className:"flex items-center justify-center mb-4 mx-4 h-11 bg-gradient-to-r from-[#31afff] to-[#1677ff] dark:bg-gradient-to-r dark:from-[#6a6a6a] dark:to-[#80868f] border-none rounded text-white",children:[(0,i.jsx)(G.Z,{className:"mr-2"}),(0,i.jsx)("span",{children:"New Chat"})]}),(0,i.jsx)("div",{className:"flex-1 overflow-y-scroll py-4 px-2 border-t",children:null==r?void 0:r.map(n=>{let r=n.conv_uid===e&&n.chat_mode===t;return(0,i.jsxs)(ed(),{href:"/chat?scene=".concat(n.chat_mode,"&id=").concat(n.conv_uid),className:"group/item ".concat(ev(r)),children:[(0,i.jsx)(T,{className:"text-base"}),(0,i.jsx)("div",{className:"flex-1 line-clamp-1 mx-2 text-sm",children:n.user_name||n.user_input}),(0,i.jsx)("div",{className:"group-hover/item:opacity-100 cursor-pointer opacity-0 mr-1",onClick:e=>{e.preventDefault(),j(n)},children:(0,i.jsx)(et,{})}),(0,i.jsx)("div",{className:"group-hover/item:opacity-100 cursor-pointer opacity-0",onClick:e=>{e.preventDefault(),P(n)},children:(0,i.jsx)(en.Z,{})})]},n.conv_uid)})}),(0,i.jsxs)("div",{className:"pt-2 pb-4 border-t",children:[(0,i.jsx)("div",{className:"px-2",children:C.map(e=>(0,i.jsx)(ed(),{href:e.path,className:"".concat(ev(h===e.path)),children:(0,i.jsxs)(i.Fragment,{children:[e.icon,(0,i.jsx)("span",{className:"ml-2 text-sm",children:e.name})]})},e.key))}),(0,i.jsx)("div",{className:"flex items-center justify-around py-4 border-t border-dashed",children:O.map(e=>(0,i.jsx)(ei.Z,{title:e.name,children:(0,i.jsx)("div",{className:"flex-1 flex items-center justify-center cursor-pointer text-xl",onClick:e.onClick,children:e.icon})},e.key))})]})]}):(0,i.jsxs)("div",{className:"flex flex-col justify-between h-screen border-r dark:bg-[#1A1E26] animate-fade animate-duration-300",children:[(0,i.jsx)(ed(),{href:"/",className:"px-2 py-3",children:(0,i.jsx)(eu(),{src:"/LOGO_SMALL.png",alt:"DB-GPT",width:63,height:46,className:"w-[63px] h-[46px]"})}),(0,i.jsx)("div",{className:"border-t border-dashed",children:(0,i.jsx)(ed(),{href:"/",className:"flex items-center justify-center my-4 mx-auto w-12 h-12 bg-gradient-to-r from-[#31afff] to-[#1677ff] dark:bg-gradient-to-r dark:from-[#6a6a6a] dark:to-[#80868f] border-none rounded-full text-white",children:(0,i.jsx)(G.Z,{className:"text-lg"})})}),(0,i.jsx)("div",{className:"flex-1 overflow-y-scroll py-4 border-t border-dashed space-y-2",children:null==r?void 0:r.map(n=>{let r=n.conv_uid===e&&n.chat_mode===t;return(0,i.jsx)(ei.Z,{title:n.user_name||n.user_input,placement:"right",children:(0,i.jsx)(ed(),{href:"/chat?scene=".concat(n.chat_mode,"&id=").concat(n.conv_uid),className:ey(r),children:(0,i.jsx)(T,{})})},n.conv_uid)})}),(0,i.jsxs)("div",{className:"py-4 space-y-2 border-t",children:[(0,i.jsx)(ea.Z,{menu:{items:k},placement:"topRight",children:(0,i.jsx)("div",{className:ey(),children:(0,i.jsx)(Y,{})})}),(0,i.jsx)(ea.Z,{menu:{items:Z},placement:"topRight",children:(0,i.jsx)("div",{className:ey(),children:(0,i.jsx)(Q,{})})}),O.filter(e=>e.noDropdownItem).map(e=>(0,i.jsx)(ei.Z,{title:e.name,placement:"right",children:(0,i.jsx)("div",{className:ey(),onClick:e.onClick,children:e.icon})},e.key))]})]})},ex=n(38629),ew=n(59077),eC=n(9818);let eE=(0,ew.Z)({colorSchemes:{light:{palette:{mode:"dark",primary:{...eC.Z.grey,solidBg:"#e6f4ff",solidColor:"#1677ff",solidHoverBg:"#e6f4ff"},neutral:{plainColor:"#4d4d4d",plainHoverColor:"#131318",plainHoverBg:"#EBEBEF",plainActiveBg:"#D8D8DF",plainDisabledColor:"#B9B9C6"},background:{body:"#fff",surface:"#fff"},text:{primary:"#505050"}}},dark:{palette:{mode:"light",primary:{...eC.Z.grey,softBg:"#353539",softHoverBg:"#35353978",softDisabledBg:"#353539",solidBg:"#51525beb",solidHoverBg:"#51525beb"},neutral:{plainColor:"#D8D8DF",plainHoverColor:"#F7F7F8",plainHoverBg:"#353539",plainActiveBg:"#434356",plainDisabledColor:"#434356",outlinedBorder:"#353539",outlinedHoverBorder:"#454651"},text:{primary:"#EBEBEF"},background:{body:"#212121",surface:"#51525beb"}}}},fontFamily:{body:"Josefin Sans, sans-serif",display:"Josefin Sans, sans-serif"},typography:{display1:{background:"linear-gradient(-30deg, var(--joy-palette-primary-900), var(--joy-palette-primary-400))",WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent"}},zIndex:{modal:1001}});var eS=n(74865),e$=n.n(eS);let eO=0;function ek(){"loading"!==o&&(o="loading",r=setTimeout(function(){e$().start()},250))}function eZ(){eO>0||(o="stop",clearTimeout(r),e$().done())}if(eh().events.on("routeChangeStart",ek),eh().events.on("routeChangeComplete",eZ),eh().events.on("routeChangeError",eZ),"function"==typeof(null==window?void 0:window.fetch)){let e=window.fetch;window.fetch=async function(){for(var t=arguments.length,n=Array(t),r=0;r{let e=function(){let e=localStorage.getItem(c.he);return e||(window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light")}();o(e)},[]),(0,a.useEffect)(()=>{if((null==s?void 0:s.current)&&r){var e,t,n,o,i,a;null==s||null===(e=s.current)||void 0===e||null===(t=e.classList)||void 0===t||t.add(r),"light"===r?null==s||null===(n=s.current)||void 0===n||null===(o=n.classList)||void 0===o||o.remove("dark"):null==s||null===(i=s.current)||void 0===i||null===(a=i.classList)||void 0===a||a.remove("light")}},[s,r]),(0,a.useEffect)(()=>{n.changeLanguage&&n.changeLanguage(window.localStorage.getItem(c.Yl)||"en")},[n]),(0,i.jsxs)("div",{ref:s,children:[(0,i.jsx)(eP,{}),(0,i.jsx)(l.R,{children:t})]})}function eT(e){let{children:t}=e,{isMenuExpand:n}=(0,a.useContext)(l.p),{mode:r}=_();return(0,i.jsx)(eR.ZP,{theme:{algorithm:"dark"===r?eA.default.darkAlgorithm:void 0},children:(0,i.jsxs)("div",{className:"flex w-screen h-screen overflow-hidden",children:[(0,i.jsx)("div",{className:e_()("transition-[width]",n?"w-64":"w-20","hidden","md:block"),children:(0,i.jsx)(eb,{})}),(0,i.jsx)("div",{className:"flex flex-col flex-1 relative overflow-hidden",children:t})]})})}var eM=function(e){let{Component:t,pageProps:n}=e;return(0,i.jsx)(ex.Z,{theme:eE,children:(0,i.jsx)(j,{theme:eE,defaultMode:"light",children:(0,i.jsx)(eN,{children:(0,i.jsx)(eT,{children:(0,i.jsx)(t,{...n})})})})})}},19284:function(e,t,n){"use strict";n.d(t,{F:function(){return r}});let r={proxyllm:{label:"Proxy LLM",icon:"/models/chatgpt.png"},"flan-t5-base":{label:"flan-t5-base",icon:"/models/google.png"},"vicuna-13b":{label:"vicuna-13b",icon:"/models/vicuna.jpeg"},"vicuna-7b":{label:"vicuna-7b",icon:"/models/vicuna.jpeg"},"vicuna-13b-v1.5":{label:"vicuna-13b-v1.5",icon:"/models/vicuna.jpeg"},"vicuna-7b-v1.5":{label:"vicuna-7b-v1.5",icon:"/models/vicuna.jpeg"},"codegen2-1b":{label:"codegen2-1B",icon:"/models/vicuna.jpeg"},"codet5p-2b":{label:"codet5p-2b",icon:"/models/vicuna.jpeg"},"chatglm-6b-int4":{label:"chatglm-6b-int4",icon:"/models/chatglm.png"},"chatglm-6b":{label:"chatglm-6b",icon:"/models/chatglm.png"},"chatglm2-6b":{label:"chatglm2-6b",icon:"/models/chatglm.png"},"chatglm2-6b-int4":{label:"chatglm2-6b-int4",icon:"/models/chatglm.png"},"guanaco-33b-merged":{label:"guanaco-33b-merged",icon:"/models/huggingface.svg"},"falcon-40b":{label:"falcon-40b",icon:"/models/falcon.jpeg"},"gorilla-7b":{label:"gorilla-7b",icon:"/models/gorilla.png"},"gptj-6b":{label:"ggml-gpt4all-j-v1.3-groovy.bin",icon:""},chatgpt_proxyllm:{label:"chatgpt_proxyllm",icon:"/models/chatgpt.png"},bard_proxyllm:{label:"bard_proxyllm",icon:"/models/bard.gif"},claude_proxyllm:{label:"claude_proxyllm",icon:"/models/claude.png"},wenxin_proxyllm:{label:"wenxin_proxyllm",icon:""},tongyi_proxyllm:{label:"tongyi_proxyllm",icon:"/models/qwen2.png"},zhipu_proxyllm:{label:"zhipu_proxyllm",icon:"/models/zhipu.png"},"llama-2-7b":{label:"Llama-2-7b-chat-hf",icon:"/models/llama.jpg"},"llama-2-13b":{label:"Llama-2-13b-chat-hf",icon:"/models/llama.jpg"},"llama-2-70b":{label:"Llama-2-70b-chat-hf",icon:"/models/llama.jpg"},"baichuan-13b":{label:"Baichuan-13B-Chat",icon:"/models/baichuan.png"},"baichuan-7b":{label:"baichuan-7b",icon:"/models/baichuan.png"},"baichuan2-7b":{label:"Baichuan2-7B-Chat",icon:"/models/baichuan.png"},"baichuan2-13b":{label:"Baichuan2-13B-Chat",icon:"/models/baichuan.png"},"wizardlm-13b":{label:"WizardLM-13B-V1.2",icon:"/models/wizardlm.png"},"llama-cpp":{label:"ggml-model-q4_0.bin",icon:"/models/huggingface.svg"},"internlm-7b":{label:"internlm-chat-7b-v1_1",icon:"/models/internlm.png"},"internlm-7b-8k":{label:"internlm-chat-7b-8k",icon:"/models/internlm.png"}}},98399:function(e,t,n){"use strict";function r(){var e;let t=null!==(e=localStorage.getItem(a))&&void 0!==e?e:"";try{let e=JSON.parse(t);return e}catch(e){return null}}n.d(t,{rU:function(){return a},Yl:function(){return i},he:function(){return o},a_:function(){return r}}),n(19284);let o="__db_gpt_theme_key",i="__db_gpt_lng_key",a="__db_gpt_im_key"},21876:function(e){!function(){var t={675:function(e,t){"use strict";t.byteLength=function(e){var t=s(e),n=t[0],r=t[1];return(n+r)*3/4-r},t.toByteArray=function(e){var t,n,i=s(e),a=i[0],l=i[1],c=new o((a+l)*3/4-l),u=0,f=l>0?a-4:a;for(n=0;n>16&255,c[u++]=t>>8&255,c[u++]=255&t;return 2===l&&(t=r[e.charCodeAt(n)]<<2|r[e.charCodeAt(n+1)]>>4,c[u++]=255&t),1===l&&(t=r[e.charCodeAt(n)]<<10|r[e.charCodeAt(n+1)]<<4|r[e.charCodeAt(n+2)]>>2,c[u++]=t>>8&255,c[u++]=255&t),c},t.fromByteArray=function(e){for(var t,r=e.length,o=r%3,i=[],a=0,l=r-o;a>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return i.join("")}(e,a,a+16383>l?l:a+16383));return 1===o?i.push(n[(t=e[r-1])>>2]+n[t<<4&63]+"=="):2===o&&i.push(n[(t=(e[r-2]<<8)+e[r-1])>>10]+n[t>>4&63]+n[t<<2&63]+"="),i.join("")};for(var n=[],r=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,l=i.length;a0)throw Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");-1===n&&(n=t);var r=n===t?0:4-n%4;return[n,r]}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},72:function(e,t,n){"use strict";/*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh diff --git a/pilot/server/static/_next/static/chunks/pages/agent-3a8d0b5a32e39e4c.js b/pilot/server/static/_next/static/chunks/pages/agent-3a8d0b5a32e39e4c.js deleted file mode 100644 index 2bb3b0fd8..000000000 --- a/pilot/server/static/_next/static/chunks/pages/agent-3a8d0b5a32e39e4c.js +++ /dev/null @@ -1 +0,0 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[56],{98165:function(e,l,t){"use strict";t.d(l,{Z:function(){return r}});var a=t(87462),n=t(67294),s={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M168 504.2c1-43.7 10-86.1 26.9-126 17.3-41 42.1-77.7 73.7-109.4S337 212.3 378 195c42.4-17.9 87.4-27 133.9-27s91.5 9.1 133.8 27A341.5 341.5 0 01755 268.8c9.9 9.9 19.2 20.4 27.8 31.4l-60.2 47a8 8 0 003 14.1l175.7 43c5 1.2 9.9-2.6 9.9-7.7l.8-180.9c0-6.7-7.7-10.5-12.9-6.3l-56.4 44.1C765.8 155.1 646.2 92 511.8 92 282.7 92 96.3 275.6 92 503.8a8 8 0 008 8.2h60c4.4 0 7.9-3.5 8-7.8zm756 7.8h-60c-4.4 0-7.9 3.5-8 7.8-1 43.7-10 86.1-26.9 126-17.3 41-42.1 77.8-73.7 109.4A342.45 342.45 0 01512.1 856a342.24 342.24 0 01-243.2-100.8c-9.9-9.9-19.2-20.4-27.8-31.4l60.2-47a8 8 0 00-3-14.1l-175.7-43c-5-1.2-9.9 2.6-9.9 7.7l-.7 181c0 6.7 7.7 10.5 12.9 6.3l56.4-44.1C258.2 868.9 377.8 932 512.2 932c229.2 0 415.5-183.7 419.8-411.8a8 8 0 00-8-8.2z"}}]},name:"sync",theme:"outlined"},i=t(84089),r=n.forwardRef(function(e,l){return n.createElement(i.Z,(0,a.Z)({},e,{ref:l,icon:s}))})},88484:function(e,l,t){"use strict";t.d(l,{Z:function(){return r}});var a=t(87462),n=t(67294),s={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M400 317.7h73.9V656c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V317.7H624c6.7 0 10.4-7.7 6.3-12.9L518.3 163a8 8 0 00-12.6 0l-112 141.7c-4.1 5.3-.4 13 6.3 13zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"}}]},name:"upload",theme:"outlined"},i=t(84089),r=n.forwardRef(function(e,l){return n.createElement(i.Z,(0,a.Z)({},e,{ref:l,icon:s}))})},70355:function(e,l,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/agent",function(){return t(23867)}])},23867:function(e,l,t){"use strict";t.r(l),t.d(l,{default:function(){return S}});var a=t(85893),n=t(50489),s=t(577),i=t(39479),r=t(2453),c=t(83062),o=t(75081),d=t(59566),u=t(71577),h=t(85813),m=t(66309),f=t(67294),x=t(32983),p=t(67421),g=function(e){let{error:l,description:t,refresh:n}=e,{t:s}=(0,p.$G)();return(0,a.jsx)(x.Z,{image:"/empty.png",imageStyle:{width:320,height:320,margin:"0 auto",maxWidth:"100%",maxHeight:"100%"},className:"flex items-center justify-center flex-col h-full w-full",description:l?(0,a.jsx)(u.ZP,{type:"primary",onClick:n,children:s("try_again")}):null!=t?t:s("no_data")})},j=t(50888),Z=t(87462),v={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"defs",attrs:{},children:[{tag:"style",attrs:{}}]},{tag:"path",attrs:{d:"M899.1 869.6l-53-305.6H864c14.4 0 26-11.6 26-26V346c0-14.4-11.6-26-26-26H618V138c0-14.4-11.6-26-26-26H432c-14.4 0-26 11.6-26 26v182H160c-14.4 0-26 11.6-26 26v192c0 14.4 11.6 26 26 26h17.9l-53 305.6a25.95 25.95 0 0025.6 30.4h723c1.5 0 3-.1 4.4-.4a25.88 25.88 0 0021.2-30zM204 390h272V182h72v208h272v104H204V390zm468 440V674c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v156H416V674c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v156H202.8l45.1-260H776l45.1 260H672z"}}]},name:"clear",theme:"outlined"},w=t(84089),y=f.forwardRef(function(e,l){return f.createElement(w.Z,(0,Z.Z)({},e,{ref:l,icon:v}))}),b=t(23430),N=t(68795),_=t(98165),k={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M511.6 76.3C264.3 76.2 64 276.4 64 523.5 64 718.9 189.3 885 363.8 946c23.5 5.9 19.9-10.8 19.9-22.2v-77.5c-135.7 15.9-141.2-73.9-150.3-88.9C215 726 171.5 718 184.5 703c30.9-15.9 62.4 4 98.9 57.9 26.4 39.1 77.9 32.5 104 26 5.7-23.5 17.9-44.5 34.7-60.8-140.6-25.2-199.2-111-199.2-213 0-49.5 16.3-95 48.3-131.7-20.4-60.5 1.9-112.3 4.9-120 58.1-5.2 118.5 41.6 123.2 45.3 33-8.9 70.7-13.6 112.9-13.6 42.4 0 80.2 4.9 113.5 13.9 11.3-8.6 67.3-48.8 121.3-43.9 2.9 7.7 24.7 58.3 5.5 118 32.4 36.8 48.9 82.7 48.9 132.3 0 102.2-59 188.1-200 212.9a127.5 127.5 0 0138.1 91v112.5c.8 9 0 17.9 15 17.9 177.1-59.7 304.6-227 304.6-424.1 0-247.2-200.4-447.3-447.5-447.3z"}}]},name:"github",theme:"outlined"},C=f.forwardRef(function(e,l){return f.createElement(w.Z,(0,Z.Z)({},e,{ref:l,icon:k}))}),P=function(){let{t:e}=(0,p.$G)(),[l,t]=(0,f.useState)(!1),[x,Z]=(0,f.useState)(!1),[v,w]=(0,f.useState)(),[k]=i.Z.useForm(),P=(0,f.useMemo)(()=>({pageNo:1,pageSize:20}),[]),{data:V=[],loading:z,refresh:H}=(0,s.Z)(async()=>{var e;let l={page_index:P.pageNo,page_size:P.pageSize,filter:k.getFieldsValue()},[t,a]=await (0,n.Vx)((0,n.bC)(l));return Z(!!t),null!==(e=null==a?void 0:a.datas)&&void 0!==e?e:[]}),M=async()=>{try{t(!0);let[e]=await (0,n.Vx)((0,n.DM)());if(e)return;r.ZP.success("success"),H()}finally{t(!1)}},S=(0,f.useCallback)(async(e,l,t)=>{if(v)return;w(l);let[a]=await (0,n.Vx)((t?n.v6:n.YU)(e));a||(r.ZP.success("success"),H()),w(void 0)},[v]),E=(0,f.useCallback)((e,l)=>l===v?(0,a.jsx)(j.Z,{}):e.installed?(0,a.jsx)(c.Z,{title:"Uninstall",children:(0,a.jsx)("div",{className:"w-full h-full",onClick:()=>{S(e.name,l,!1)},children:(0,a.jsx)(y,{})})}):(0,a.jsx)(c.Z,{title:"Install",children:(0,a.jsx)("div",{className:"w-full h-full",onClick:()=>{S(e.name,l,!0)},children:(0,a.jsx)(b.Z,{})})}),[v]);return(0,a.jsxs)(o.Z,{spinning:z,children:[(0,a.jsxs)(i.Z,{form:k,layout:"inline",onFinish:H,className:"mb-2",children:[(0,a.jsx)(i.Z.Item,{className:"!mb-2",name:"name",label:"Name",children:(0,a.jsx)(d.default,{allowClear:!0,className:"w-48"})}),(0,a.jsxs)(i.Z.Item,{children:[(0,a.jsx)(u.ZP,{className:"mr-2",type:"primary",htmlType:"submit",icon:(0,a.jsx)(N.Z,{}),children:e("Search")}),(0,a.jsx)(u.ZP,{loading:l,type:"primary",icon:(0,a.jsx)(_.Z,{}),onClick:M,children:e("Update_From_Github")})]})]}),!V.length&&!z&&(0,a.jsx)(g,{error:x,refresh:H}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2 md:gap-4",children:V.map((e,l)=>(0,a.jsxs)(h.Z,{className:"w-full md:w-1/2 lg:w-1/3 xl:w-1/4",actions:[E(e,l),(0,a.jsx)(c.Z,{title:"Github",children:(0,a.jsx)("div",{className:"w-full h-full",onClick:()=>{window.open(e.storage_url,"_blank")},children:(0,a.jsx)(C,{})})},"github")],children:[(0,a.jsx)(c.Z,{title:e.name,children:(0,a.jsx)("h2",{className:"mb-2 text-base font-semibold line-clamp-1",children:e.name})}),e.author&&(0,a.jsx)(m.Z,{children:e.author}),e.version&&(0,a.jsxs)(m.Z,{children:["v",e.version]}),e.type&&(0,a.jsxs)(m.Z,{children:["Type ",e.type]}),e.storage_channel&&(0,a.jsx)(m.Z,{children:e.storage_channel}),(0,a.jsx)(c.Z,{title:e.description,children:(0,a.jsx)("p",{className:"mt-2 line-clamp-2 text-gray-400 text-sm",children:e.description})})]},e.id))})]})},V=t(31365),z=t(88484),H=function(){let{t:e}=(0,p.$G)(),[l,t]=r.ZP.useMessage(),[i,d]=(0,f.useState)(!1),[x,Z]=(0,f.useState)(!1),[v,w]=(0,f.useState)(),{data:b=[],loading:N,refresh:_}=(0,s.Z)(async()=>{let[e,l]=await (0,n.Vx)((0,n.N6)());return Z(!!e),null!=l?l:[]}),k=async(e,l)=>{if(v)return;w(l);let[t]=await (0,n.Vx)((0,n.YU)(e));r.ZP[t?"error":"success"](t?"failed":"success"),t||_(),w(void 0)},C=(0,f.useCallback)((e,l)=>l===v?(0,a.jsx)(j.Z,{}):(0,a.jsx)(c.Z,{title:"Uninstall",children:(0,a.jsx)("div",{className:"w-full h-full",onClick:()=>{k(e.name,l)},children:(0,a.jsx)(y,{})})}),[v]),P=async e=>{var t;if(!e){r.ZP.error("Please select the *.zip,*.rar file");return}if(!/\.(zip|rar)$/.test(null!==(t=e.file.name)&&void 0!==t?t:"")){r.ZP.error("File type must be zip or rar");return}try{let t=e.file;d(!0);let a=new FormData;a.append("doc_file",t),l.open({content:"Uploading ".concat(t.name),type:"loading",duration:0});let[s]=await (0,n.Vx)((0,n.Kn)(void 0,a,{timeout:6e4}));if(s)return;r.ZP.success("success"),_()}catch(e){r.ZP.error((null==e?void 0:e.message)||"Upload Error")}finally{d(!1),l.destroy()}};return(0,a.jsxs)(o.Z,{spinning:N,children:[t,(0,a.jsx)("div",{children:(0,a.jsx)(V.default,{disabled:N,className:"mr-1",beforeUpload:()=>!1,name:"file",accept:".zip,.rar",multiple:!1,onChange:P,showUploadList:{showDownloadIcon:!1,showPreviewIcon:!1,showRemoveIcon:!1},itemRender:()=>(0,a.jsx)(a.Fragment,{}),children:(0,a.jsx)(u.ZP,{loading:i,type:"primary",icon:(0,a.jsx)(z.Z,{}),children:e("Upload")})})}),!b.length&&!N&&(0,a.jsx)(g,{error:x,refresh:_}),(0,a.jsx)("div",{className:"flex gap-2 md:gap-4",children:b.map((e,l)=>(0,a.jsxs)(h.Z,{className:"w-full md:w-1/2 lg:w-1/3 xl:w-1/4",actions:[C(e,l)],children:[(0,a.jsx)(c.Z,{title:e.name,children:(0,a.jsx)("h2",{className:"mb-2 text-base font-semibold line-clamp-1",children:e.name})}),e.version&&(0,a.jsxs)(m.Z,{children:["v",e.version]}),e.type&&(0,a.jsxs)(m.Z,{children:["Type ",e.type]}),(0,a.jsx)(c.Z,{title:e.description,children:(0,a.jsx)("p",{className:"mt-2 line-clamp-2 text-gray-400 text-sm",children:e.description})})]},e.id))})]})},M=t(44442),S=function(){let{t:e}=(0,p.$G)(),[l,t]=(0,f.useState)("market"),n=(0,f.useMemo)(()=>[{key:"market",label:e("Market_Plugins"),children:(0,a.jsx)(P,{})},{key:"my",label:e("My_Plugins"),children:"market"===l?null:(0,a.jsx)(H,{})}],[e,l]);return(0,a.jsx)("div",{className:"h-screen p-4 md:p-6 overflow-y-auto",children:(0,a.jsx)(M.Z,{activeKey:l,items:n,onChange:t})})}}},function(e){e.O(0,[44,479,365,442,813,924,774,888,179],function(){return e(e.s=70355)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/pilot/server/static/_next/static/chunks/pages/agent-dbb8ff019a2c71c2.js b/pilot/server/static/_next/static/chunks/pages/agent-dbb8ff019a2c71c2.js new file mode 100644 index 000000000..bf826bf9e --- /dev/null +++ b/pilot/server/static/_next/static/chunks/pages/agent-dbb8ff019a2c71c2.js @@ -0,0 +1 @@ +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[56],{98165:function(e,l,a){"use strict";a.d(l,{Z:function(){return c}});var t=a(87462),s=a(67294),n={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M168 504.2c1-43.7 10-86.1 26.9-126 17.3-41 42.1-77.7 73.7-109.4S337 212.3 378 195c42.4-17.9 87.4-27 133.9-27s91.5 9.1 133.8 27A341.5 341.5 0 01755 268.8c9.9 9.9 19.2 20.4 27.8 31.4l-60.2 47a8 8 0 003 14.1l175.7 43c5 1.2 9.9-2.6 9.9-7.7l.8-180.9c0-6.7-7.7-10.5-12.9-6.3l-56.4 44.1C765.8 155.1 646.2 92 511.8 92 282.7 92 96.3 275.6 92 503.8a8 8 0 008 8.2h60c4.4 0 7.9-3.5 8-7.8zm756 7.8h-60c-4.4 0-7.9 3.5-8 7.8-1 43.7-10 86.1-26.9 126-17.3 41-42.1 77.8-73.7 109.4A342.45 342.45 0 01512.1 856a342.24 342.24 0 01-243.2-100.8c-9.9-9.9-19.2-20.4-27.8-31.4l60.2-47a8 8 0 00-3-14.1l-175.7-43c-5-1.2-9.9 2.6-9.9 7.7l-.7 181c0 6.7 7.7 10.5 12.9 6.3l56.4-44.1C258.2 868.9 377.8 932 512.2 932c229.2 0 415.5-183.7 419.8-411.8a8 8 0 00-8-8.2z"}}]},name:"sync",theme:"outlined"},i=a(84089),c=s.forwardRef(function(e,l){return s.createElement(i.Z,(0,t.Z)({},e,{ref:l,icon:n}))})},88484:function(e,l,a){"use strict";a.d(l,{Z:function(){return c}});var t=a(87462),s=a(67294),n={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M400 317.7h73.9V656c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V317.7H624c6.7 0 10.4-7.7 6.3-12.9L518.3 163a8 8 0 00-12.6 0l-112 141.7c-4.1 5.3-.4 13 6.3 13zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"}}]},name:"upload",theme:"outlined"},i=a(84089),c=s.forwardRef(function(e,l){return s.createElement(i.Z,(0,t.Z)({},e,{ref:l,icon:n}))})},70355:function(e,l,a){(window.__NEXT_P=window.__NEXT_P||[]).push(["/agent",function(){return a(23867)}])},23867:function(e,l,a){"use strict";a.r(l),a.d(l,{default:function(){return S}});var t=a(85893),s=a(50489),n=a(577),i=a(39479),c=a(2453),r=a(83062),o=a(75081),d=a(59566),u=a(71577),h=a(85813),m=a(66309),f=a(67294),x=a(32983),p=a(67421),g=function(e){let{error:l,description:a,refresh:s}=e,{t:n}=(0,p.$G)();return(0,t.jsx)(x.Z,{image:"/empty.png",imageStyle:{width:320,height:320,margin:"0 auto",maxWidth:"100%",maxHeight:"100%"},className:"flex items-center justify-center flex-col h-full w-full",description:l?(0,t.jsx)(u.ZP,{type:"primary",onClick:s,children:n("try_again")}):null!=a?a:n("no_data")})},j=a(50888),Z=a(87462),v={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"defs",attrs:{},children:[{tag:"style",attrs:{}}]},{tag:"path",attrs:{d:"M899.1 869.6l-53-305.6H864c14.4 0 26-11.6 26-26V346c0-14.4-11.6-26-26-26H618V138c0-14.4-11.6-26-26-26H432c-14.4 0-26 11.6-26 26v182H160c-14.4 0-26 11.6-26 26v192c0 14.4 11.6 26 26 26h17.9l-53 305.6a25.95 25.95 0 0025.6 30.4h723c1.5 0 3-.1 4.4-.4a25.88 25.88 0 0021.2-30zM204 390h272V182h72v208h272v104H204V390zm468 440V674c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v156H416V674c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v156H202.8l45.1-260H776l45.1 260H672z"}}]},name:"clear",theme:"outlined"},w=a(84089),y=f.forwardRef(function(e,l){return f.createElement(w.Z,(0,Z.Z)({},e,{ref:l,icon:v}))}),b=a(23430),N=a(68795),_=a(98165),k={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M511.6 76.3C264.3 76.2 64 276.4 64 523.5 64 718.9 189.3 885 363.8 946c23.5 5.9 19.9-10.8 19.9-22.2v-77.5c-135.7 15.9-141.2-73.9-150.3-88.9C215 726 171.5 718 184.5 703c30.9-15.9 62.4 4 98.9 57.9 26.4 39.1 77.9 32.5 104 26 5.7-23.5 17.9-44.5 34.7-60.8-140.6-25.2-199.2-111-199.2-213 0-49.5 16.3-95 48.3-131.7-20.4-60.5 1.9-112.3 4.9-120 58.1-5.2 118.5 41.6 123.2 45.3 33-8.9 70.7-13.6 112.9-13.6 42.4 0 80.2 4.9 113.5 13.9 11.3-8.6 67.3-48.8 121.3-43.9 2.9 7.7 24.7 58.3 5.5 118 32.4 36.8 48.9 82.7 48.9 132.3 0 102.2-59 188.1-200 212.9a127.5 127.5 0 0138.1 91v112.5c.8 9 0 17.9 15 17.9 177.1-59.7 304.6-227 304.6-424.1 0-247.2-200.4-447.3-447.5-447.3z"}}]},name:"github",theme:"outlined"},C=f.forwardRef(function(e,l){return f.createElement(w.Z,(0,Z.Z)({},e,{ref:l,icon:k}))}),P=function(){let{t:e}=(0,p.$G)(),[l,a]=(0,f.useState)(!1),[x,Z]=(0,f.useState)(!1),[v,w]=(0,f.useState)(),[k]=i.Z.useForm(),P=(0,f.useMemo)(()=>({pageNo:1,pageSize:20}),[]),{data:V=[],loading:z,refresh:H}=(0,n.Z)(async()=>{var e;let l={page_index:P.pageNo,page_size:P.pageSize,filter:k.getFieldsValue()},[a,t]=await (0,s.Vx)((0,s.bC)(l));return Z(!!a),null!==(e=null==t?void 0:t.datas)&&void 0!==e?e:[]}),M=async()=>{try{a(!0);let[e]=await (0,s.Vx)((0,s.DM)());if(e)return;c.ZP.success("success"),H()}finally{a(!1)}},S=(0,f.useCallback)(async(e,l,a)=>{if(v)return;w(l);let[t]=await (0,s.Vx)((a?s.v6:s.YU)(e));t||(c.ZP.success("success"),H()),w(void 0)},[v,H]),E=(0,f.useCallback)((e,l)=>l===v?(0,t.jsx)(j.Z,{}):e.installed?(0,t.jsx)(r.Z,{title:"Uninstall",children:(0,t.jsx)("div",{className:"w-full h-full",onClick:()=>{S(e.name,l,!1)},children:(0,t.jsx)(y,{})})}):(0,t.jsx)(r.Z,{title:"Install",children:(0,t.jsx)("div",{className:"w-full h-full",onClick:()=>{S(e.name,l,!0)},children:(0,t.jsx)(b.Z,{})})}),[v,S]);return(0,t.jsxs)(o.Z,{spinning:z,children:[(0,t.jsxs)(i.Z,{form:k,layout:"inline",onFinish:H,className:"mb-2",children:[(0,t.jsx)(i.Z.Item,{className:"!mb-2",name:"name",label:"Name",children:(0,t.jsx)(d.default,{allowClear:!0,className:"w-48"})}),(0,t.jsxs)(i.Z.Item,{children:[(0,t.jsx)(u.ZP,{className:"mr-2",type:"primary",htmlType:"submit",icon:(0,t.jsx)(N.Z,{}),children:e("Search")}),(0,t.jsx)(u.ZP,{loading:l,type:"primary",icon:(0,t.jsx)(_.Z,{}),onClick:M,children:e("Update_From_Github")})]})]}),!V.length&&!z&&(0,t.jsx)(g,{error:x,refresh:H}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2 md:gap-4",children:V.map((e,l)=>(0,t.jsxs)(h.Z,{className:"w-full md:w-1/2 lg:w-1/3 xl:w-1/4",actions:[E(e,l),(0,t.jsx)(r.Z,{title:"Github",children:(0,t.jsx)("div",{className:"w-full h-full",onClick:()=>{window.open(e.storage_url,"_blank")},children:(0,t.jsx)(C,{})})},"github")],children:[(0,t.jsx)(r.Z,{title:e.name,children:(0,t.jsx)("h2",{className:"mb-2 text-base font-semibold line-clamp-1",children:e.name})}),e.author&&(0,t.jsx)(m.Z,{children:e.author}),e.version&&(0,t.jsxs)(m.Z,{children:["v",e.version]}),e.type&&(0,t.jsxs)(m.Z,{children:["Type ",e.type]}),e.storage_channel&&(0,t.jsx)(m.Z,{children:e.storage_channel}),(0,t.jsx)(r.Z,{title:e.description,children:(0,t.jsx)("p",{className:"mt-2 line-clamp-2 text-gray-400 text-sm",children:e.description})})]},e.id))})]})},V=a(31365),z=a(88484),H=function(){let{t:e}=(0,p.$G)(),[l,a]=c.ZP.useMessage(),[i,d]=(0,f.useState)(!1),[x,Z]=(0,f.useState)(!1),[v,w]=(0,f.useState)(),{data:b=[],loading:N,refresh:_}=(0,n.Z)(async()=>{let[e,l]=await (0,s.Vx)((0,s.N6)());return Z(!!e),null!=l?l:[]}),k=async(e,l)=>{if(v)return;w(l);let[a]=await (0,s.Vx)((0,s.YU)(e));c.ZP[a?"error":"success"](a?"failed":"success"),a||_(),w(void 0)},C=(0,f.useCallback)((e,l)=>l===v?(0,t.jsx)(j.Z,{}):(0,t.jsx)(r.Z,{title:"Uninstall",children:(0,t.jsx)("div",{className:"w-full h-full",onClick:()=>{k(e.name,l)},children:(0,t.jsx)(y,{})})}),[v]),P=async e=>{if(!e){c.ZP.error("Please select the *.zip,*.rar file");return}try{let a=e.file;d(!0);let t=new FormData;t.append("doc_file",a),l.open({content:"Uploading ".concat(a.name),type:"loading",duration:0});let[n]=await (0,s.Vx)((0,s.Kn)(void 0,t,{timeout:6e4}));if(n)return;c.ZP.success("success"),_()}catch(e){c.ZP.error((null==e?void 0:e.message)||"Upload Error")}finally{d(!1),l.destroy()}};return(0,t.jsxs)(o.Z,{spinning:N,children:[a,(0,t.jsx)("div",{children:(0,t.jsx)(V.default,{disabled:N,className:"mr-1",beforeUpload:()=>!1,name:"file",accept:".zip,.rar",multiple:!1,onChange:P,showUploadList:{showDownloadIcon:!1,showPreviewIcon:!1,showRemoveIcon:!1},itemRender:()=>(0,t.jsx)(t.Fragment,{}),children:(0,t.jsx)(u.ZP,{loading:i,type:"primary",icon:(0,t.jsx)(z.Z,{}),children:e("Upload")})})}),!b.length&&!N&&(0,t.jsx)(g,{error:x,refresh:_}),(0,t.jsx)("div",{className:"flex gap-2 md:gap-4",children:b.map((e,l)=>(0,t.jsxs)(h.Z,{className:"w-full md:w-1/2 lg:w-1/3 xl:w-1/4",actions:[C(e,l)],children:[(0,t.jsx)(r.Z,{title:e.name,children:(0,t.jsx)("h2",{className:"mb-2 text-base font-semibold line-clamp-1",children:e.name})}),e.version&&(0,t.jsxs)(m.Z,{children:["v",e.version]}),e.type&&(0,t.jsxs)(m.Z,{children:["Type ",e.type]}),(0,t.jsx)(r.Z,{title:e.description,children:(0,t.jsx)("p",{className:"mt-2 line-clamp-2 text-gray-400 text-sm",children:e.description})})]},e.id))})]})},M=a(44442),S=function(){let{t:e}=(0,p.$G)(),[l,a]=(0,f.useState)("market"),s=(0,f.useMemo)(()=>[{key:"market",label:e("Market_Plugins"),children:(0,t.jsx)(P,{})},{key:"my",label:e("My_Plugins"),children:"market"===l?null:(0,t.jsx)(H,{})}],[e,l]);return(0,t.jsx)("div",{className:"h-screen p-4 md:p-6 overflow-y-auto",children:(0,t.jsx)(M.Z,{activeKey:l,items:s,onChange:a})})}}},function(e){e.O(0,[44,479,365,442,813,924,774,888,179],function(){return e(e.s=70355)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/pilot/server/static/_next/static/chunks/pages/chat-75cb71cb5d09f61b.js b/pilot/server/static/_next/static/chunks/pages/chat-197b88d512cc5b14.js similarity index 95% rename from pilot/server/static/_next/static/chunks/pages/chat-75cb71cb5d09f61b.js rename to pilot/server/static/_next/static/chunks/pages/chat-197b88d512cc5b14.js index ef2ced4ca..c41905ea9 100644 --- a/pilot/server/static/_next/static/chunks/pages/chat-75cb71cb5d09f61b.js +++ b/pilot/server/static/_next/static/chunks/pages/chat-197b88d512cc5b14.js @@ -1 +1 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[180],{99937:function(e,t,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/chat",function(){return r(27823)}])},50948:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{noSSR:function(){return u},default:function(){return o}});let l=r(38754),n=(r(67294),l._(r(23900)));function a(e){return{default:(null==e?void 0:e.default)||e}}function u(e,t){return delete t.webpack,delete t.modules,e(t)}function o(e,t){let r=n.default,l={loading:e=>{let{error:t,isLoading:r,pastDelay:l}=e;return null}};e instanceof Promise?l.loader=()=>e:"function"==typeof e?l.loader=e:"object"==typeof e&&(l={...l,...e}),l={...l,...t};let o=l.loader;return(l.loadableGenerated&&(l={...l,...l.loadableGenerated},delete l.loadableGenerated),"boolean"!=typeof l.ssr||l.ssr)?r({...l,loader:()=>null!=o?o().then(a):Promise.resolve(a(()=>null))}):(delete l.webpack,delete l.modules,u(r,l))}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},2804:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"LoadableContext",{enumerable:!0,get:function(){return a}});let l=r(38754),n=l._(r(67294)),a=n.default.createContext(null)},23900:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return _}});let l=r(38754),n=l._(r(67294)),a=r(2804),u=[],o=[],i=!1;function s(e){let t=e(),r={loading:!0,loaded:null,error:null};return r.promise=t.then(e=>(r.loading=!1,r.loaded=e,e)).catch(e=>{throw r.loading=!1,r.error=e,e}),r}class d{promise(){return this._res.promise}retry(){this._clearTimeouts(),this._res=this._loadFn(this._opts.loader),this._state={pastDelay:!1,timedOut:!1};let{_res:e,_opts:t}=this;e.loading&&("number"==typeof t.delay&&(0===t.delay?this._state.pastDelay=!0:this._delay=setTimeout(()=>{this._update({pastDelay:!0})},t.delay)),"number"==typeof t.timeout&&(this._timeout=setTimeout(()=>{this._update({timedOut:!0})},t.timeout))),this._res.promise.then(()=>{this._update({}),this._clearTimeouts()}).catch(e=>{this._update({}),this._clearTimeouts()}),this._update({})}_update(e){this._state={...this._state,error:this._res.error,loaded:this._res.loaded,loading:this._res.loading,...e},this._callbacks.forEach(e=>e())}_clearTimeouts(){clearTimeout(this._delay),clearTimeout(this._timeout)}getCurrentValue(){return this._state}subscribe(e){return this._callbacks.add(e),()=>{this._callbacks.delete(e)}}constructor(e,t){this._loadFn=e,this._opts=t,this._callbacks=new Set,this._delay=null,this._timeout=null,this.retry()}}function c(e){return function(e,t){let r=Object.assign({loader:null,loading:null,delay:200,timeout:null,webpack:null,modules:null},t),l=null;function u(){if(!l){let t=new d(e,r);l={getCurrentValue:t.getCurrentValue.bind(t),subscribe:t.subscribe.bind(t),retry:t.retry.bind(t),promise:t.promise.bind(t)}}return l.promise()}if(!i){let e=r.webpack?r.webpack():r.modules;e&&o.push(t=>{for(let r of e)if(t.includes(r))return u()})}function s(e,t){!function(){u();let e=n.default.useContext(a.LoadableContext);e&&Array.isArray(r.modules)&&r.modules.forEach(t=>{e(t)})}();let o=n.default.useSyncExternalStore(l.subscribe,l.getCurrentValue,l.getCurrentValue);return n.default.useImperativeHandle(t,()=>({retry:l.retry}),[]),n.default.useMemo(()=>{var t;return o.loading||o.error?n.default.createElement(r.loading,{isLoading:o.loading,pastDelay:o.pastDelay,timedOut:o.timedOut,error:o.error,retry:l.retry}):o.loaded?n.default.createElement((t=o.loaded)&&t.default?t.default:t,e):null},[e,o])}return s.preload=()=>u(),s.displayName="LoadableComponent",n.default.forwardRef(s)}(s,e)}function f(e,t){let r=[];for(;e.length;){let l=e.pop();r.push(l(t))}return Promise.all(r).then(()=>{if(e.length)return f(e,t)})}c.preloadAll=()=>new Promise((e,t)=>{f(u).then(e,t)}),c.preloadReady=e=>(void 0===e&&(e=[]),new Promise(t=>{let r=()=>(i=!0,t());f(o,e).then(r,r)})),window.__NEXT_PRELOADREADY=c.preloadReady;let _=c},27823:function(e,t,r){"use strict";r.r(t);var l=r(85893),n=r(67294),a=r(11163),u=r(41468),o=r(5152),i=r.n(o);let s=i()(()=>Promise.all([r.e(662),r.e(599),r.e(44),r.e(9),r.e(365),r.e(442),r.e(815),r.e(45),r.e(207),r.e(61),r.e(369),r.e(932)]).then(r.bind(r,53913)),{loadableGenerated:{webpack:()=>[53913]},ssr:!1}),d=i()(()=>Promise.all([r.e(662),r.e(599),r.e(44),r.e(479),r.e(9),r.e(365),r.e(815),r.e(924),r.e(411),r.e(270),r.e(45),r.e(207),r.e(539),r.e(266),r.e(369),r.e(214)]).then(r.bind(r,41189)),{loadableGenerated:{webpack:()=>[41189]},ssr:!1});t.default=function(){let{query:{id:e,scene:t}}=(0,a.useRouter)(),{isContract:r,setIsContract:o,setIsMenuExpand:i}=(0,n.useContext)(u.p);return(0,n.useEffect)(()=>{i("chat_dashboard"!==t),e&&t&&o(!1)},[e,t]),(0,l.jsx)(l.Fragment,{children:r?(0,l.jsx)(s,{}):(0,l.jsx)(d,{})})}},5152:function(e,t,r){e.exports=r(50948)}},function(e){e.O(0,[774,888,179],function(){return e(e.s=99937)}),_N_E=e.O()}]); \ No newline at end of file +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[180],{99937:function(e,t,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/chat",function(){return r(27823)}])},50948:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{noSSR:function(){return u},default:function(){return o}});let l=r(38754),n=(r(67294),l._(r(23900)));function a(e){return{default:(null==e?void 0:e.default)||e}}function u(e,t){return delete t.webpack,delete t.modules,e(t)}function o(e,t){let r=n.default,l={loading:e=>{let{error:t,isLoading:r,pastDelay:l}=e;return null}};e instanceof Promise?l.loader=()=>e:"function"==typeof e?l.loader=e:"object"==typeof e&&(l={...l,...e}),l={...l,...t};let o=l.loader;return(l.loadableGenerated&&(l={...l,...l.loadableGenerated},delete l.loadableGenerated),"boolean"!=typeof l.ssr||l.ssr)?r({...l,loader:()=>null!=o?o().then(a):Promise.resolve(a(()=>null))}):(delete l.webpack,delete l.modules,u(r,l))}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},2804:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"LoadableContext",{enumerable:!0,get:function(){return a}});let l=r(38754),n=l._(r(67294)),a=n.default.createContext(null)},23900:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return _}});let l=r(38754),n=l._(r(67294)),a=r(2804),u=[],o=[],i=!1;function s(e){let t=e(),r={loading:!0,loaded:null,error:null};return r.promise=t.then(e=>(r.loading=!1,r.loaded=e,e)).catch(e=>{throw r.loading=!1,r.error=e,e}),r}class d{promise(){return this._res.promise}retry(){this._clearTimeouts(),this._res=this._loadFn(this._opts.loader),this._state={pastDelay:!1,timedOut:!1};let{_res:e,_opts:t}=this;e.loading&&("number"==typeof t.delay&&(0===t.delay?this._state.pastDelay=!0:this._delay=setTimeout(()=>{this._update({pastDelay:!0})},t.delay)),"number"==typeof t.timeout&&(this._timeout=setTimeout(()=>{this._update({timedOut:!0})},t.timeout))),this._res.promise.then(()=>{this._update({}),this._clearTimeouts()}).catch(e=>{this._update({}),this._clearTimeouts()}),this._update({})}_update(e){this._state={...this._state,error:this._res.error,loaded:this._res.loaded,loading:this._res.loading,...e},this._callbacks.forEach(e=>e())}_clearTimeouts(){clearTimeout(this._delay),clearTimeout(this._timeout)}getCurrentValue(){return this._state}subscribe(e){return this._callbacks.add(e),()=>{this._callbacks.delete(e)}}constructor(e,t){this._loadFn=e,this._opts=t,this._callbacks=new Set,this._delay=null,this._timeout=null,this.retry()}}function c(e){return function(e,t){let r=Object.assign({loader:null,loading:null,delay:200,timeout:null,webpack:null,modules:null},t),l=null;function u(){if(!l){let t=new d(e,r);l={getCurrentValue:t.getCurrentValue.bind(t),subscribe:t.subscribe.bind(t),retry:t.retry.bind(t),promise:t.promise.bind(t)}}return l.promise()}if(!i){let e=r.webpack?r.webpack():r.modules;e&&o.push(t=>{for(let r of e)if(t.includes(r))return u()})}function s(e,t){!function(){u();let e=n.default.useContext(a.LoadableContext);e&&Array.isArray(r.modules)&&r.modules.forEach(t=>{e(t)})}();let o=n.default.useSyncExternalStore(l.subscribe,l.getCurrentValue,l.getCurrentValue);return n.default.useImperativeHandle(t,()=>({retry:l.retry}),[]),n.default.useMemo(()=>{var t;return o.loading||o.error?n.default.createElement(r.loading,{isLoading:o.loading,pastDelay:o.pastDelay,timedOut:o.timedOut,error:o.error,retry:l.retry}):o.loaded?n.default.createElement((t=o.loaded)&&t.default?t.default:t,e):null},[e,o])}return s.preload=()=>u(),s.displayName="LoadableComponent",n.default.forwardRef(s)}(s,e)}function f(e,t){let r=[];for(;e.length;){let l=e.pop();r.push(l(t))}return Promise.all(r).then(()=>{if(e.length)return f(e,t)})}c.preloadAll=()=>new Promise((e,t)=>{f(u).then(e,t)}),c.preloadReady=e=>(void 0===e&&(e=[]),new Promise(t=>{let r=()=>(i=!0,t());f(o,e).then(r,r)})),window.__NEXT_PRELOADREADY=c.preloadReady;let _=c},27823:function(e,t,r){"use strict";r.r(t);var l=r(85893),n=r(67294),a=r(11163),u=r(41468),o=r(5152),i=r.n(o);let s=i()(()=>Promise.all([r.e(662),r.e(599),r.e(44),r.e(9),r.e(365),r.e(442),r.e(815),r.e(45),r.e(207),r.e(61),r.e(304),r.e(932)]).then(r.bind(r,53913)),{loadableGenerated:{webpack:()=>[53913]},ssr:!1}),d=i()(()=>Promise.all([r.e(662),r.e(599),r.e(44),r.e(479),r.e(9),r.e(365),r.e(815),r.e(924),r.e(411),r.e(270),r.e(45),r.e(207),r.e(539),r.e(266),r.e(304),r.e(604)]).then(r.bind(r,24093)),{loadableGenerated:{webpack:()=>[24093]},ssr:!1});t.default=function(){let{query:{id:e,scene:t}}=(0,a.useRouter)(),{isContract:r,setIsContract:o,setIsMenuExpand:i}=(0,n.useContext)(u.p);return(0,n.useEffect)(()=>{i("chat_dashboard"!==t),e&&t&&o(!1)},[e,t]),(0,l.jsx)(l.Fragment,{children:r?(0,l.jsx)(s,{}):(0,l.jsx)(d,{})})}},5152:function(e,t,r){e.exports=r(50948)}},function(e){e.O(0,[774,888,179],function(){return e(e.s=99937)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/pilot/server/static/_next/static/chunks/pages/chat/[scene]/[id]-826f37ba492008eb.js b/pilot/server/static/_next/static/chunks/pages/chat/[scene]/[id]-ac949685f9639f4f.js similarity index 96% rename from pilot/server/static/_next/static/chunks/pages/chat/[scene]/[id]-826f37ba492008eb.js rename to pilot/server/static/_next/static/chunks/pages/chat/[scene]/[id]-ac949685f9639f4f.js index 7547f2a06..af486f583 100644 --- a/pilot/server/static/_next/static/chunks/pages/chat/[scene]/[id]-826f37ba492008eb.js +++ b/pilot/server/static/_next/static/chunks/pages/chat/[scene]/[id]-ac949685f9639f4f.js @@ -1 +1 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[24],{1826:function(e,t,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/chat/[scene]/[id]",function(){return r(99316)}])},50948:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{noSSR:function(){return u},default:function(){return o}});let l=r(38754),n=(r(67294),l._(r(23900)));function a(e){return{default:(null==e?void 0:e.default)||e}}function u(e,t){return delete t.webpack,delete t.modules,e(t)}function o(e,t){let r=n.default,l={loading:e=>{let{error:t,isLoading:r,pastDelay:l}=e;return null}};e instanceof Promise?l.loader=()=>e:"function"==typeof e?l.loader=e:"object"==typeof e&&(l={...l,...e}),l={...l,...t};let o=l.loader;return(l.loadableGenerated&&(l={...l,...l.loadableGenerated},delete l.loadableGenerated),"boolean"!=typeof l.ssr||l.ssr)?r({...l,loader:()=>null!=o?o().then(a):Promise.resolve(a(()=>null))}):(delete l.webpack,delete l.modules,u(r,l))}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},2804:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"LoadableContext",{enumerable:!0,get:function(){return a}});let l=r(38754),n=l._(r(67294)),a=n.default.createContext(null)},23900:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return _}});let l=r(38754),n=l._(r(67294)),a=r(2804),u=[],o=[],i=!1;function s(e){let t=e(),r={loading:!0,loaded:null,error:null};return r.promise=t.then(e=>(r.loading=!1,r.loaded=e,e)).catch(e=>{throw r.loading=!1,r.error=e,e}),r}class d{promise(){return this._res.promise}retry(){this._clearTimeouts(),this._res=this._loadFn(this._opts.loader),this._state={pastDelay:!1,timedOut:!1};let{_res:e,_opts:t}=this;e.loading&&("number"==typeof t.delay&&(0===t.delay?this._state.pastDelay=!0:this._delay=setTimeout(()=>{this._update({pastDelay:!0})},t.delay)),"number"==typeof t.timeout&&(this._timeout=setTimeout(()=>{this._update({timedOut:!0})},t.timeout))),this._res.promise.then(()=>{this._update({}),this._clearTimeouts()}).catch(e=>{this._update({}),this._clearTimeouts()}),this._update({})}_update(e){this._state={...this._state,error:this._res.error,loaded:this._res.loaded,loading:this._res.loading,...e},this._callbacks.forEach(e=>e())}_clearTimeouts(){clearTimeout(this._delay),clearTimeout(this._timeout)}getCurrentValue(){return this._state}subscribe(e){return this._callbacks.add(e),()=>{this._callbacks.delete(e)}}constructor(e,t){this._loadFn=e,this._opts=t,this._callbacks=new Set,this._delay=null,this._timeout=null,this.retry()}}function c(e){return function(e,t){let r=Object.assign({loader:null,loading:null,delay:200,timeout:null,webpack:null,modules:null},t),l=null;function u(){if(!l){let t=new d(e,r);l={getCurrentValue:t.getCurrentValue.bind(t),subscribe:t.subscribe.bind(t),retry:t.retry.bind(t),promise:t.promise.bind(t)}}return l.promise()}if(!i){let e=r.webpack?r.webpack():r.modules;e&&o.push(t=>{for(let r of e)if(t.includes(r))return u()})}function s(e,t){!function(){u();let e=n.default.useContext(a.LoadableContext);e&&Array.isArray(r.modules)&&r.modules.forEach(t=>{e(t)})}();let o=n.default.useSyncExternalStore(l.subscribe,l.getCurrentValue,l.getCurrentValue);return n.default.useImperativeHandle(t,()=>({retry:l.retry}),[]),n.default.useMemo(()=>{var t;return o.loading||o.error?n.default.createElement(r.loading,{isLoading:o.loading,pastDelay:o.pastDelay,timedOut:o.timedOut,error:o.error,retry:l.retry}):o.loaded?n.default.createElement((t=o.loaded)&&t.default?t.default:t,e):null},[e,o])}return s.preload=()=>u(),s.displayName="LoadableComponent",n.default.forwardRef(s)}(s,e)}function f(e,t){let r=[];for(;e.length;){let l=e.pop();r.push(l(t))}return Promise.all(r).then(()=>{if(e.length)return f(e,t)})}c.preloadAll=()=>new Promise((e,t)=>{f(u).then(e,t)}),c.preloadReady=e=>(void 0===e&&(e=[]),new Promise(t=>{let r=()=>(i=!0,t());f(o,e).then(r,r)})),window.__NEXT_PRELOADREADY=c.preloadReady;let _=c},99316:function(e,t,r){"use strict";r.r(t);var l=r(85893),n=r(67294),a=r(11163),u=r(41468),o=r(5152),i=r.n(o);let s=i()(()=>Promise.all([r.e(662),r.e(599),r.e(44),r.e(9),r.e(365),r.e(442),r.e(815),r.e(45),r.e(207),r.e(61),r.e(369),r.e(932)]).then(r.bind(r,53913)),{loadableGenerated:{webpack:()=>[53913]},ssr:!1}),d=i()(()=>Promise.all([r.e(662),r.e(599),r.e(44),r.e(479),r.e(9),r.e(365),r.e(815),r.e(924),r.e(411),r.e(270),r.e(45),r.e(207),r.e(539),r.e(266),r.e(369),r.e(214)]).then(r.bind(r,41189)),{loadableGenerated:{webpack:()=>[41189]},ssr:!1});t.default=function(){let{query:{id:e,scene:t}}=(0,a.useRouter)(),{isContract:r,setIsContract:o,setIsMenuExpand:i}=(0,n.useContext)(u.p);return(0,n.useEffect)(()=>{i("chat_dashboard"!==t),e&&t&&o(!1)},[e,t]),(0,l.jsx)(l.Fragment,{children:r?(0,l.jsx)(s,{}):(0,l.jsx)(d,{})})}},5152:function(e,t,r){e.exports=r(50948)}},function(e){e.O(0,[774,888,179],function(){return e(e.s=1826)}),_N_E=e.O()}]); \ No newline at end of file +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[24],{1826:function(e,t,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/chat/[scene]/[id]",function(){return r(99316)}])},50948:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{noSSR:function(){return u},default:function(){return o}});let l=r(38754),n=(r(67294),l._(r(23900)));function a(e){return{default:(null==e?void 0:e.default)||e}}function u(e,t){return delete t.webpack,delete t.modules,e(t)}function o(e,t){let r=n.default,l={loading:e=>{let{error:t,isLoading:r,pastDelay:l}=e;return null}};e instanceof Promise?l.loader=()=>e:"function"==typeof e?l.loader=e:"object"==typeof e&&(l={...l,...e}),l={...l,...t};let o=l.loader;return(l.loadableGenerated&&(l={...l,...l.loadableGenerated},delete l.loadableGenerated),"boolean"!=typeof l.ssr||l.ssr)?r({...l,loader:()=>null!=o?o().then(a):Promise.resolve(a(()=>null))}):(delete l.webpack,delete l.modules,u(r,l))}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},2804:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"LoadableContext",{enumerable:!0,get:function(){return a}});let l=r(38754),n=l._(r(67294)),a=n.default.createContext(null)},23900:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return _}});let l=r(38754),n=l._(r(67294)),a=r(2804),u=[],o=[],i=!1;function s(e){let t=e(),r={loading:!0,loaded:null,error:null};return r.promise=t.then(e=>(r.loading=!1,r.loaded=e,e)).catch(e=>{throw r.loading=!1,r.error=e,e}),r}class d{promise(){return this._res.promise}retry(){this._clearTimeouts(),this._res=this._loadFn(this._opts.loader),this._state={pastDelay:!1,timedOut:!1};let{_res:e,_opts:t}=this;e.loading&&("number"==typeof t.delay&&(0===t.delay?this._state.pastDelay=!0:this._delay=setTimeout(()=>{this._update({pastDelay:!0})},t.delay)),"number"==typeof t.timeout&&(this._timeout=setTimeout(()=>{this._update({timedOut:!0})},t.timeout))),this._res.promise.then(()=>{this._update({}),this._clearTimeouts()}).catch(e=>{this._update({}),this._clearTimeouts()}),this._update({})}_update(e){this._state={...this._state,error:this._res.error,loaded:this._res.loaded,loading:this._res.loading,...e},this._callbacks.forEach(e=>e())}_clearTimeouts(){clearTimeout(this._delay),clearTimeout(this._timeout)}getCurrentValue(){return this._state}subscribe(e){return this._callbacks.add(e),()=>{this._callbacks.delete(e)}}constructor(e,t){this._loadFn=e,this._opts=t,this._callbacks=new Set,this._delay=null,this._timeout=null,this.retry()}}function c(e){return function(e,t){let r=Object.assign({loader:null,loading:null,delay:200,timeout:null,webpack:null,modules:null},t),l=null;function u(){if(!l){let t=new d(e,r);l={getCurrentValue:t.getCurrentValue.bind(t),subscribe:t.subscribe.bind(t),retry:t.retry.bind(t),promise:t.promise.bind(t)}}return l.promise()}if(!i){let e=r.webpack?r.webpack():r.modules;e&&o.push(t=>{for(let r of e)if(t.includes(r))return u()})}function s(e,t){!function(){u();let e=n.default.useContext(a.LoadableContext);e&&Array.isArray(r.modules)&&r.modules.forEach(t=>{e(t)})}();let o=n.default.useSyncExternalStore(l.subscribe,l.getCurrentValue,l.getCurrentValue);return n.default.useImperativeHandle(t,()=>({retry:l.retry}),[]),n.default.useMemo(()=>{var t;return o.loading||o.error?n.default.createElement(r.loading,{isLoading:o.loading,pastDelay:o.pastDelay,timedOut:o.timedOut,error:o.error,retry:l.retry}):o.loaded?n.default.createElement((t=o.loaded)&&t.default?t.default:t,e):null},[e,o])}return s.preload=()=>u(),s.displayName="LoadableComponent",n.default.forwardRef(s)}(s,e)}function f(e,t){let r=[];for(;e.length;){let l=e.pop();r.push(l(t))}return Promise.all(r).then(()=>{if(e.length)return f(e,t)})}c.preloadAll=()=>new Promise((e,t)=>{f(u).then(e,t)}),c.preloadReady=e=>(void 0===e&&(e=[]),new Promise(t=>{let r=()=>(i=!0,t());f(o,e).then(r,r)})),window.__NEXT_PRELOADREADY=c.preloadReady;let _=c},99316:function(e,t,r){"use strict";r.r(t);var l=r(85893),n=r(67294),a=r(11163),u=r(41468),o=r(5152),i=r.n(o);let s=i()(()=>Promise.all([r.e(662),r.e(599),r.e(44),r.e(9),r.e(365),r.e(442),r.e(815),r.e(45),r.e(207),r.e(61),r.e(304),r.e(932)]).then(r.bind(r,53913)),{loadableGenerated:{webpack:()=>[53913]},ssr:!1}),d=i()(()=>Promise.all([r.e(662),r.e(599),r.e(44),r.e(479),r.e(9),r.e(365),r.e(815),r.e(924),r.e(411),r.e(270),r.e(45),r.e(207),r.e(539),r.e(266),r.e(304),r.e(604)]).then(r.bind(r,24093)),{loadableGenerated:{webpack:()=>[24093]},ssr:!1});t.default=function(){let{query:{id:e,scene:t}}=(0,a.useRouter)(),{isContract:r,setIsContract:o,setIsMenuExpand:i}=(0,n.useContext)(u.p);return(0,n.useEffect)(()=>{i("chat_dashboard"!==t),e&&t&&o(!1)},[e,t]),(0,l.jsx)(l.Fragment,{children:r?(0,l.jsx)(s,{}):(0,l.jsx)(d,{})})}},5152:function(e,t,r){e.exports=r(50948)}},function(e){e.O(0,[774,888,179],function(){return e(e.s=1826)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/pilot/server/static/_next/static/chunks/pages/index-02331aee6ba6a7fc.js b/pilot/server/static/_next/static/chunks/pages/index-02331aee6ba6a7fc.js new file mode 100644 index 000000000..fce01f6a7 --- /dev/null +++ b/pilot/server/static/_next/static/chunks/pages/index-02331aee6ba6a7fc.js @@ -0,0 +1 @@ +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[405],{57838:function(t,e,n){"use strict";n.d(e,{Z:function(){return o}});var i=n(67294);function o(){let[,t]=i.useReducer(t=>t+1,0);return t}},96074:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var i=n(94184),o=n.n(i),a=n(67294),r=n(53124),l=n(14747),s=n(67968),c=n(45503);let d=t=>{let{componentCls:e,sizePaddingEdgeHorizontal:n,colorSplit:i,lineWidth:o}=t;return{[e]:Object.assign(Object.assign({},(0,l.Wf)(t)),{borderBlockStart:`${o}px solid ${i}`,"&-vertical":{position:"relative",top:"-0.06em",display:"inline-block",height:"0.9em",margin:`0 ${t.dividerVerticalGutterMargin}px`,verticalAlign:"middle",borderTop:0,borderInlineStart:`${o}px solid ${i}`},"&-horizontal":{display:"flex",clear:"both",width:"100%",minWidth:"100%",margin:`${t.dividerHorizontalGutterMargin}px 0`},[`&-horizontal${e}-with-text`]:{display:"flex",alignItems:"center",margin:`${t.dividerHorizontalWithTextGutterMargin}px 0`,color:t.colorTextHeading,fontWeight:500,fontSize:t.fontSizeLG,whiteSpace:"nowrap",textAlign:"center",borderBlockStart:`0 ${i}`,"&::before, &::after":{position:"relative",width:"50%",borderBlockStart:`${o}px solid transparent`,borderBlockStartColor:"inherit",borderBlockEnd:0,transform:"translateY(50%)",content:"''"}},[`&-horizontal${e}-with-text-left`]:{"&::before":{width:"5%"},"&::after":{width:"95%"}},[`&-horizontal${e}-with-text-right`]:{"&::before":{width:"95%"},"&::after":{width:"5%"}},[`${e}-inner-text`]:{display:"inline-block",padding:"0 1em"},"&-dashed":{background:"none",borderColor:i,borderStyle:"dashed",borderWidth:`${o}px 0 0`},[`&-horizontal${e}-with-text${e}-dashed`]:{"&::before, &::after":{borderStyle:"dashed none none"}},[`&-vertical${e}-dashed`]:{borderInlineStartWidth:o,borderInlineEnd:0,borderBlockStart:0,borderBlockEnd:0},[`&-plain${e}-with-text`]:{color:t.colorText,fontWeight:"normal",fontSize:t.fontSize},[`&-horizontal${e}-with-text-left${e}-no-default-orientation-margin-left`]:{"&::before":{width:0},"&::after":{width:"100%"},[`${e}-inner-text`]:{paddingInlineStart:n}},[`&-horizontal${e}-with-text-right${e}-no-default-orientation-margin-right`]:{"&::before":{width:"100%"},"&::after":{width:0},[`${e}-inner-text`]:{paddingInlineEnd:n}}})}};var m=(0,s.Z)("Divider",t=>{let e=(0,c.TS)(t,{dividerVerticalGutterMargin:t.marginXS,dividerHorizontalWithTextGutterMargin:t.margin,dividerHorizontalGutterMargin:t.marginLG});return[d(e)]},{sizePaddingEdgeHorizontal:0}),p=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&0>e.indexOf(i)&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,i=Object.getOwnPropertySymbols(t);oe.indexOf(i[o])&&Object.prototype.propertyIsEnumerable.call(t,i[o])&&(n[i[o]]=t[i[o]]);return n},u=t=>{let{getPrefixCls:e,direction:n,divider:i}=a.useContext(r.E_),{prefixCls:l,type:s="horizontal",orientation:c="center",orientationMargin:d,className:u,rootClassName:h,children:g,dashed:f,plain:x,style:b}=t,v=p(t,["prefixCls","type","orientation","orientationMargin","className","rootClassName","children","dashed","plain","style"]),S=e("divider",l),[y,$]=m(S),w=c.length>0?`-${c}`:c,j=!!g,z="left"===c&&null!=d,C="right"===c&&null!=d,N=o()(S,null==i?void 0:i.className,$,`${S}-${s}`,{[`${S}-with-text`]:j,[`${S}-with-text${w}`]:j,[`${S}-dashed`]:!!f,[`${S}-plain`]:!!x,[`${S}-rtl`]:"rtl"===n,[`${S}-no-default-orientation-margin-left`]:z,[`${S}-no-default-orientation-margin-right`]:C},u,h),O=a.useMemo(()=>"number"==typeof d?d:/^\d+$/.test(d)?Number(d):d,[d]),E=Object.assign(Object.assign({},z&&{marginLeft:O}),C&&{marginRight:O});return y(a.createElement("div",Object.assign({className:N,style:Object.assign(Object.assign({},null==i?void 0:i.style),b)},v,{role:"separator"}),g&&"vertical"!==s&&a.createElement("span",{className:`${S}-inner-text`,style:E},g)))}},75081:function(t,e,n){"use strict";n.d(e,{Z:function(){return y}});var i=n(94184),o=n.n(i),a=n(98423),r=n(67294),l=n(96159),s=n(53124),c=n(23183),d=n(14747),m=n(67968),p=n(45503);let u=new c.E4("antSpinMove",{to:{opacity:1}}),h=new c.E4("antRotate",{to:{transform:"rotate(405deg)"}}),g=t=>({[`${t.componentCls}`]:Object.assign(Object.assign({},(0,d.Wf)(t)),{position:"absolute",display:"none",color:t.colorPrimary,fontSize:0,textAlign:"center",verticalAlign:"middle",opacity:0,transition:`transform ${t.motionDurationSlow} ${t.motionEaseInOutCirc}`,"&-spinning":{position:"static",display:"inline-block",opacity:1},"&-nested-loading":{position:"relative",[`> div > ${t.componentCls}`]:{position:"absolute",top:0,insetInlineStart:0,zIndex:4,display:"block",width:"100%",height:"100%",maxHeight:t.contentHeight,[`${t.componentCls}-dot`]:{position:"absolute",top:"50%",insetInlineStart:"50%",margin:-t.spinDotSize/2},[`${t.componentCls}-text`]:{position:"absolute",top:"50%",width:"100%",paddingTop:(t.spinDotSize-t.fontSize)/2+2,textShadow:`0 1px 2px ${t.colorBgContainer}`,fontSize:t.fontSize},[`&${t.componentCls}-show-text ${t.componentCls}-dot`]:{marginTop:-(t.spinDotSize/2)-10},"&-sm":{[`${t.componentCls}-dot`]:{margin:-t.spinDotSizeSM/2},[`${t.componentCls}-text`]:{paddingTop:(t.spinDotSizeSM-t.fontSize)/2+2},[`&${t.componentCls}-show-text ${t.componentCls}-dot`]:{marginTop:-(t.spinDotSizeSM/2)-10}},"&-lg":{[`${t.componentCls}-dot`]:{margin:-(t.spinDotSizeLG/2)},[`${t.componentCls}-text`]:{paddingTop:(t.spinDotSizeLG-t.fontSize)/2+2},[`&${t.componentCls}-show-text ${t.componentCls}-dot`]:{marginTop:-(t.spinDotSizeLG/2)-10}}},[`${t.componentCls}-container`]:{position:"relative",transition:`opacity ${t.motionDurationSlow}`,"&::after":{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,zIndex:10,width:"100%",height:"100%",background:t.colorBgContainer,opacity:0,transition:`all ${t.motionDurationSlow}`,content:'""',pointerEvents:"none"}},[`${t.componentCls}-blur`]:{clear:"both",opacity:.5,userSelect:"none",pointerEvents:"none","&::after":{opacity:.4,pointerEvents:"auto"}}},"&-tip":{color:t.spinDotDefault},[`${t.componentCls}-dot`]:{position:"relative",display:"inline-block",fontSize:t.spinDotSize,width:"1em",height:"1em","&-item":{position:"absolute",display:"block",width:(t.spinDotSize-t.marginXXS/2)/2,height:(t.spinDotSize-t.marginXXS/2)/2,backgroundColor:t.colorPrimary,borderRadius:"100%",transform:"scale(0.75)",transformOrigin:"50% 50%",opacity:.3,animationName:u,animationDuration:"1s",animationIterationCount:"infinite",animationTimingFunction:"linear",animationDirection:"alternate","&:nth-child(1)":{top:0,insetInlineStart:0},"&:nth-child(2)":{top:0,insetInlineEnd:0,animationDelay:"0.4s"},"&:nth-child(3)":{insetInlineEnd:0,bottom:0,animationDelay:"0.8s"},"&:nth-child(4)":{bottom:0,insetInlineStart:0,animationDelay:"1.2s"}},"&-spin":{transform:"rotate(45deg)",animationName:h,animationDuration:"1.2s",animationIterationCount:"infinite",animationTimingFunction:"linear"}},[`&-sm ${t.componentCls}-dot`]:{fontSize:t.spinDotSizeSM,i:{width:(t.spinDotSizeSM-t.marginXXS/2)/2,height:(t.spinDotSizeSM-t.marginXXS/2)/2}},[`&-lg ${t.componentCls}-dot`]:{fontSize:t.spinDotSizeLG,i:{width:(t.spinDotSizeLG-t.marginXXS)/2,height:(t.spinDotSizeLG-t.marginXXS)/2}},[`&${t.componentCls}-show-text ${t.componentCls}-text`]:{display:"block"}})});var f=(0,m.Z)("Spin",t=>{let e=(0,p.TS)(t,{spinDotDefault:t.colorTextDescription,spinDotSize:t.controlHeightLG/2,spinDotSizeSM:.35*t.controlHeightLG,spinDotSizeLG:t.controlHeight});return[g(e)]},{contentHeight:400}),x=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&0>e.indexOf(i)&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,i=Object.getOwnPropertySymbols(t);oe.indexOf(i[o])&&Object.prototype.propertyIsEnumerable.call(t,i[o])&&(n[i[o]]=t[i[o]]);return n};let b=null,v=t=>{let{spinPrefixCls:e,spinning:n=!0,delay:i=0,className:c,rootClassName:d,size:m="default",tip:p,wrapperClassName:u,style:h,children:g,hashId:f}=t,v=x(t,["spinPrefixCls","spinning","delay","className","rootClassName","size","tip","wrapperClassName","style","children","hashId"]),[S,y]=r.useState(()=>n&&(!n||!i||!!isNaN(Number(i))));r.useEffect(()=>{if(n){var t;let e=function(t,e,n){var i,o=n||{},a=o.noTrailing,r=void 0!==a&&a,l=o.noLeading,s=void 0!==l&&l,c=o.debounceMode,d=void 0===c?void 0:c,m=!1,p=0;function u(){i&&clearTimeout(i)}function h(){for(var n=arguments.length,o=Array(n),a=0;at?s?(p=Date.now(),r||(i=setTimeout(d?g:h,t))):h():!0!==r&&(i=setTimeout(d?g:h,void 0===d?t-c:t)))}return h.cancel=function(t){var e=(t||{}).upcomingOnly;u(),m=!(void 0!==e&&e)},h}(i,()=>{y(!0)},{debounceMode:!1!==(void 0!==(t=({}).atBegin)&&t)});return e(),()=>{var t;null===(t=null==e?void 0:e.cancel)||void 0===t||t.call(e)}}y(!1)},[i,n]);let $=r.useMemo(()=>void 0!==g,[g]),{direction:w,spin:j}=r.useContext(s.E_),z=o()(e,null==j?void 0:j.className,{[`${e}-sm`]:"small"===m,[`${e}-lg`]:"large"===m,[`${e}-spinning`]:S,[`${e}-show-text`]:!!p,[`${e}-rtl`]:"rtl"===w},c,d,f),C=o()(`${e}-container`,{[`${e}-blur`]:S}),N=(0,a.Z)(v,["indicator","prefixCls"]),O=Object.assign(Object.assign({},null==j?void 0:j.style),h),E=r.createElement("div",Object.assign({},N,{style:O,className:z,"aria-live":"polite","aria-busy":S}),function(t,e){let{indicator:n}=e,i=`${t}-dot`;return null===n?null:(0,l.l$)(n)?(0,l.Tm)(n,{className:o()(n.props.className,i)}):(0,l.l$)(b)?(0,l.Tm)(b,{className:o()(b.props.className,i)}):r.createElement("span",{className:o()(i,`${t}-dot-spin`)},r.createElement("i",{className:`${t}-dot-item`,key:1}),r.createElement("i",{className:`${t}-dot-item`,key:2}),r.createElement("i",{className:`${t}-dot-item`,key:3}),r.createElement("i",{className:`${t}-dot-item`,key:4}))}(e,t),p&&$?r.createElement("div",{className:`${e}-text`},p):null);return $?r.createElement("div",Object.assign({},N,{className:o()(`${e}-nested-loading`,u,f)}),S&&r.createElement("div",{key:"loading"},E),r.createElement("div",{className:C,key:"container"},g)):E},S=t=>{let{prefixCls:e}=t,{getPrefixCls:n}=r.useContext(s.E_),i=n("spin",e),[o,a]=f(i),l=Object.assign(Object.assign({},t),{spinPrefixCls:i,hashId:a});return o(r.createElement(v,Object.assign({},l)))};S.setDefaultIndicator=t=>{b=t};var y=S},48312:function(t,e,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/",function(){return n(57464)}])},81799:function(t,e,n){"use strict";n.d(e,{A:function(){return m}});var i=n(85893),o=n(41468),a=n(51009),r=n(19284),l=n(25675),s=n.n(l),c=n(67294),d=n(67421);function m(t,e){var n;let{width:o,height:a}=e||{};return t?(0,i.jsx)(s(),{className:"rounded-full border border-gray-200 object-contain bg-white inline-block",width:o||24,height:a||24,src:(null===(n=r.F[t])||void 0===n?void 0:n.icon)||"/models/huggingface.svg",alt:"llm"}):null}e.Z=function(t){let{onChange:e}=t,{t:n}=(0,d.$G)(),{modelList:l,model:s}=(0,c.useContext)(o.p);return!l||l.length<=0?null:(0,i.jsx)(a.default,{value:s,placeholder:n("choose_model"),className:"w-52",onChange:t=>{null==e||e(t)},children:l.map(t=>{var e;return(0,i.jsx)(a.default.Option,{children:(0,i.jsxs)("div",{className:"flex items-center",children:[m(t),(0,i.jsx)("span",{className:"ml-2",children:(null===(e=r.F[t])||void 0===e?void 0:e.label)||t})]})},t)})})}},38954:function(t,e,n){"use strict";n.d(e,{Z:function(){return S}});var i=n(85893),o=n(27496),a=n(59566),r=n(71577),l=n(67294),s=n(2487),c=n(83062),d=n(2453),m=n(74627),p=n(39479),u=n(51009),h=n(58299),g=n(577),f=n(30119),x=n(67421);let b=t=>{let{data:e,loading:n,submit:o,close:a}=t,{t:r}=(0,x.$G)(),l=t=>()=>{o(t),a()};return(0,i.jsx)("div",{style:{maxHeight:400,overflow:"auto"},children:(0,i.jsx)(s.Z,{dataSource:null==e?void 0:e.data,loading:n,rowKey:t=>t.prompt_name,renderItem:t=>(0,i.jsx)(s.Z.Item,{onClick:l(t.content),children:(0,i.jsx)(c.Z,{title:t.content,children:(0,i.jsx)(s.Z.Item.Meta,{style:{cursor:"copy"},title:t.prompt_name,description:r("Prompt_Info_Scene")+":".concat(t.chat_scene,",")+r("Prompt_Info_Sub_Scene")+":".concat(t.sub_chat_scene)})})},t.prompt_name)})})};var v=t=>{let{submit:e}=t,{t:n}=(0,x.$G)(),[o,a]=(0,l.useState)(!1),[r,s]=(0,l.useState)("common"),{data:v,loading:S}=(0,g.Z)(()=>(0,f.PR)("/prompt/list",{prompt_type:r}),{refreshDeps:[r],onError:t=>{d.ZP.error(null==t?void 0:t.message)}});return(0,i.jsx)(m.Z,{title:(0,i.jsx)(p.Z.Item,{label:"Prompt "+n("Type"),children:(0,i.jsx)(u.default,{style:{width:130},value:r,onChange:t=>{s(t)},options:[{label:n("Public")+" Prompts",value:"common"},{label:n("Private")+" Prompts",value:"private"}]})}),content:(0,i.jsx)(b,{data:v,loading:S,submit:e,close:()=>{a(!1)}}),placement:"topRight",trigger:"click",open:o,onOpenChange:t=>{a(t)},children:(0,i.jsx)(c.Z,{title:n("Click_Select")+" Prompt",children:(0,i.jsx)(h.Z,{className:"bottom-32"})})})},S=function(t){let{children:e,loading:n,onSubmit:s,...c}=t,[d,m]=(0,l.useState)("");return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(a.default.TextArea,{className:"flex-1",size:"large",value:d,autoSize:{minRows:1,maxRows:4},...c,onPressEnter:t=>{if(d.trim()&&13===t.keyCode){if(t.shiftKey){m(t=>t+"\n");return}s(d),setTimeout(()=>{m("")},0)}},onChange:t=>{if("number"==typeof c.maxLength){m(t.target.value.substring(0,c.maxLength));return}m(t.target.value)}}),(0,i.jsx)(r.ZP,{className:"ml-2 flex items-center justify-center",size:"large",type:"text",loading:n,icon:(0,i.jsx)(o.Z,{}),onClick:()=>{s(d)}}),(0,i.jsx)(v,{submit:t=>{m(d+t)}}),e]})}},57464:function(t,e,n){"use strict";n.r(e);var i=n(85893),o=n(577),a=n(67294),r=n(96074),l=n(75081),s=n(39332),c=n(25675),d=n.n(c),m=n(50489),p=n(81799),u=n(41468),h=n(38954),g=n(67421),f=n(98399);e.default=()=>{let t=(0,s.useRouter)(),{model:e,setModel:n}=(0,a.useContext)(u.p),{t:c}=(0,g.$G)(),[x,b]=(0,a.useState)(!1),[v,S]=(0,a.useState)(!1),{data:y=[]}=(0,o.Z)(async()=>{S(!0);let[,t]=await (0,m.Vx)((0,m.CU)());return S(!1),null!=t?t:[]}),$=async n=>{b(!0);let[,i]=await (0,m.Vx)((0,m.sW)({chat_mode:"chat_normal"}));i&&(localStorage.setItem(f.rU,JSON.stringify({id:i.conv_uid,message:n})),t.push("/chat/?scene=chat_normal&id=".concat(i.conv_uid).concat(e?"&model=".concat(e):""))),b(!1)},w=async n=>{let[,i]=await (0,m.Vx)((0,m.sW)({chat_mode:"chat_normal"}));i&&t.push("/chat?scene=".concat(n.chat_scene,"&id=").concat(i.conv_uid).concat(e?"&model=".concat(e):""))};return(0,i.jsxs)("div",{className:"mx-auto h-full justify-center flex max-w-3xl flex-col px-4",children:[(0,i.jsx)("div",{className:"my-0 mx-auto",children:(0,i.jsx)(d(),{src:"/LOGO.png",alt:"Revolutionizing Database Interactions with Private LLM Technology",width:856,height:160,className:"w-full",unoptimized:!0})}),(0,i.jsx)(r.Z,{className:"!text-[#878c93] !my-6",plain:!0,children:c("Quick_Start")}),(0,i.jsx)(l.Z,{spinning:v,children:(0,i.jsx)("div",{className:"flex flex-wrap -m-1 md:-m-3",children:y.map(t=>(0,i.jsx)("div",{className:"w-full sm:w-1/2 lg:w-1/3 p-1 md:p-3",children:(0,i.jsx)("div",{className:"cursor-pointer flex items-center justify-center w-full h-12 rounded font-semibold text-sm bg-[#E6F4FF] text-[#1677FE] dark:text-gray-100 dark:bg-[#4E4F56]",onClick:()=>{w(t)},children:t.scene_name})},t.chat_scene))})}),(0,i.jsx)("div",{className:"mt-8 mb-2",children:(0,i.jsx)(p.Z,{onChange:t=>{n(t)}})}),(0,i.jsx)("div",{className:"flex",children:(0,i.jsx)(h.Z,{loading:x,onSubmit:$})})]})}},30119:function(t,e,n){"use strict";n.d(e,{Tk:function(){return s},PR:function(){return c}});var i=n(2453),o=n(6154),a=n(83454);let r=o.Z.create({baseURL:a.env.API_BASE_URL});r.defaults.timeout=1e4,r.interceptors.response.use(t=>t.data,t=>Promise.reject(t)),n(96486);let l={"content-type":"application/json"},s=(t,e)=>{if(e){let n=Object.keys(e).filter(t=>void 0!==e[t]&&""!==e[t]).map(t=>"".concat(t,"=").concat(e[t])).join("&");n&&(t+="?".concat(n))}return r.get("/api"+t,{headers:l}).then(t=>t).catch(t=>{i.ZP.error(t),Promise.reject(t)})},c=(t,e)=>r.post(t,e,{headers:l}).then(t=>t).catch(t=>{i.ZP.error(t),Promise.reject(t)})}},function(t){t.O(0,[662,44,479,9,411,270,539,774,888,179],function(){return t(t.s=48312)}),_N_E=t.O()}]); \ No newline at end of file diff --git a/pilot/server/static/_next/static/chunks/pages/index-ccee0d0c06e351f8.js b/pilot/server/static/_next/static/chunks/pages/index-ccee0d0c06e351f8.js deleted file mode 100644 index 6b70dccc1..000000000 --- a/pilot/server/static/_next/static/chunks/pages/index-ccee0d0c06e351f8.js +++ /dev/null @@ -1 +0,0 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[405],{57838:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var i=n(67294);function o(){let[,e]=i.useReducer(e=>e+1,0);return e}},96074:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var i=n(94184),o=n.n(i),a=n(67294),l=n(53124),r=n(14747),s=n(67968),c=n(45503);let d=e=>{let{componentCls:t,sizePaddingEdgeHorizontal:n,colorSplit:i,lineWidth:o}=e;return{[t]:Object.assign(Object.assign({},(0,r.Wf)(e)),{borderBlockStart:`${o}px solid ${i}`,"&-vertical":{position:"relative",top:"-0.06em",display:"inline-block",height:"0.9em",margin:`0 ${e.dividerVerticalGutterMargin}px`,verticalAlign:"middle",borderTop:0,borderInlineStart:`${o}px solid ${i}`},"&-horizontal":{display:"flex",clear:"both",width:"100%",minWidth:"100%",margin:`${e.dividerHorizontalGutterMargin}px 0`},[`&-horizontal${t}-with-text`]:{display:"flex",alignItems:"center",margin:`${e.dividerHorizontalWithTextGutterMargin}px 0`,color:e.colorTextHeading,fontWeight:500,fontSize:e.fontSizeLG,whiteSpace:"nowrap",textAlign:"center",borderBlockStart:`0 ${i}`,"&::before, &::after":{position:"relative",width:"50%",borderBlockStart:`${o}px solid transparent`,borderBlockStartColor:"inherit",borderBlockEnd:0,transform:"translateY(50%)",content:"''"}},[`&-horizontal${t}-with-text-left`]:{"&::before":{width:"5%"},"&::after":{width:"95%"}},[`&-horizontal${t}-with-text-right`]:{"&::before":{width:"95%"},"&::after":{width:"5%"}},[`${t}-inner-text`]:{display:"inline-block",padding:"0 1em"},"&-dashed":{background:"none",borderColor:i,borderStyle:"dashed",borderWidth:`${o}px 0 0`},[`&-horizontal${t}-with-text${t}-dashed`]:{"&::before, &::after":{borderStyle:"dashed none none"}},[`&-vertical${t}-dashed`]:{borderInlineStartWidth:o,borderInlineEnd:0,borderBlockStart:0,borderBlockEnd:0},[`&-plain${t}-with-text`]:{color:e.colorText,fontWeight:"normal",fontSize:e.fontSize},[`&-horizontal${t}-with-text-left${t}-no-default-orientation-margin-left`]:{"&::before":{width:0},"&::after":{width:"100%"},[`${t}-inner-text`]:{paddingInlineStart:n}},[`&-horizontal${t}-with-text-right${t}-no-default-orientation-margin-right`]:{"&::before":{width:"100%"},"&::after":{width:0},[`${t}-inner-text`]:{paddingInlineEnd:n}}})}};var m=(0,s.Z)("Divider",e=>{let t=(0,c.TS)(e,{dividerVerticalGutterMargin:e.marginXS,dividerHorizontalWithTextGutterMargin:e.margin,dividerHorizontalGutterMargin:e.marginLG});return[d(t)]},{sizePaddingEdgeHorizontal:0}),p=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&0>t.indexOf(i)&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,i=Object.getOwnPropertySymbols(e);ot.indexOf(i[o])&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(n[i[o]]=e[i[o]]);return n},u=e=>{let{getPrefixCls:t,direction:n,divider:i}=a.useContext(l.E_),{prefixCls:r,type:s="horizontal",orientation:c="center",orientationMargin:d,className:u,rootClassName:g,children:h,dashed:b,plain:f,style:x}=e,v=p(e,["prefixCls","type","orientation","orientationMargin","className","rootClassName","children","dashed","plain","style"]),y=t("divider",r),[S,$]=m(y),w=c.length>0?`-${c}`:c,j=!!h,z="left"===c&&null!=d,C="right"===c&&null!=d,_=o()(y,null==i?void 0:i.className,$,`${y}-${s}`,{[`${y}-with-text`]:j,[`${y}-with-text${w}`]:j,[`${y}-dashed`]:!!b,[`${y}-plain`]:!!f,[`${y}-rtl`]:"rtl"===n,[`${y}-no-default-orientation-margin-left`]:z,[`${y}-no-default-orientation-margin-right`]:C},u,g),N=a.useMemo(()=>"number"==typeof d?d:/^\d+$/.test(d)?Number(d):d,[d]),O=Object.assign(Object.assign({},z&&{marginLeft:N}),C&&{marginRight:N});return S(a.createElement("div",Object.assign({className:_,style:Object.assign(Object.assign({},null==i?void 0:i.style),x)},v,{role:"separator"}),h&&"vertical"!==s&&a.createElement("span",{className:`${y}-inner-text`,style:O},h)))}},75081:function(e,t,n){"use strict";n.d(t,{Z:function(){return S}});var i=n(94184),o=n.n(i),a=n(98423),l=n(67294),r=n(96159),s=n(53124),c=n(23183),d=n(14747),m=n(67968),p=n(45503);let u=new c.E4("antSpinMove",{to:{opacity:1}}),g=new c.E4("antRotate",{to:{transform:"rotate(405deg)"}}),h=e=>({[`${e.componentCls}`]:Object.assign(Object.assign({},(0,d.Wf)(e)),{position:"absolute",display:"none",color:e.colorPrimary,fontSize:0,textAlign:"center",verticalAlign:"middle",opacity:0,transition:`transform ${e.motionDurationSlow} ${e.motionEaseInOutCirc}`,"&-spinning":{position:"static",display:"inline-block",opacity:1},"&-nested-loading":{position:"relative",[`> div > ${e.componentCls}`]:{position:"absolute",top:0,insetInlineStart:0,zIndex:4,display:"block",width:"100%",height:"100%",maxHeight:e.contentHeight,[`${e.componentCls}-dot`]:{position:"absolute",top:"50%",insetInlineStart:"50%",margin:-e.spinDotSize/2},[`${e.componentCls}-text`]:{position:"absolute",top:"50%",width:"100%",paddingTop:(e.spinDotSize-e.fontSize)/2+2,textShadow:`0 1px 2px ${e.colorBgContainer}`,fontSize:e.fontSize},[`&${e.componentCls}-show-text ${e.componentCls}-dot`]:{marginTop:-(e.spinDotSize/2)-10},"&-sm":{[`${e.componentCls}-dot`]:{margin:-e.spinDotSizeSM/2},[`${e.componentCls}-text`]:{paddingTop:(e.spinDotSizeSM-e.fontSize)/2+2},[`&${e.componentCls}-show-text ${e.componentCls}-dot`]:{marginTop:-(e.spinDotSizeSM/2)-10}},"&-lg":{[`${e.componentCls}-dot`]:{margin:-(e.spinDotSizeLG/2)},[`${e.componentCls}-text`]:{paddingTop:(e.spinDotSizeLG-e.fontSize)/2+2},[`&${e.componentCls}-show-text ${e.componentCls}-dot`]:{marginTop:-(e.spinDotSizeLG/2)-10}}},[`${e.componentCls}-container`]:{position:"relative",transition:`opacity ${e.motionDurationSlow}`,"&::after":{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,zIndex:10,width:"100%",height:"100%",background:e.colorBgContainer,opacity:0,transition:`all ${e.motionDurationSlow}`,content:'""',pointerEvents:"none"}},[`${e.componentCls}-blur`]:{clear:"both",opacity:.5,userSelect:"none",pointerEvents:"none","&::after":{opacity:.4,pointerEvents:"auto"}}},"&-tip":{color:e.spinDotDefault},[`${e.componentCls}-dot`]:{position:"relative",display:"inline-block",fontSize:e.spinDotSize,width:"1em",height:"1em","&-item":{position:"absolute",display:"block",width:(e.spinDotSize-e.marginXXS/2)/2,height:(e.spinDotSize-e.marginXXS/2)/2,backgroundColor:e.colorPrimary,borderRadius:"100%",transform:"scale(0.75)",transformOrigin:"50% 50%",opacity:.3,animationName:u,animationDuration:"1s",animationIterationCount:"infinite",animationTimingFunction:"linear",animationDirection:"alternate","&:nth-child(1)":{top:0,insetInlineStart:0},"&:nth-child(2)":{top:0,insetInlineEnd:0,animationDelay:"0.4s"},"&:nth-child(3)":{insetInlineEnd:0,bottom:0,animationDelay:"0.8s"},"&:nth-child(4)":{bottom:0,insetInlineStart:0,animationDelay:"1.2s"}},"&-spin":{transform:"rotate(45deg)",animationName:g,animationDuration:"1.2s",animationIterationCount:"infinite",animationTimingFunction:"linear"}},[`&-sm ${e.componentCls}-dot`]:{fontSize:e.spinDotSizeSM,i:{width:(e.spinDotSizeSM-e.marginXXS/2)/2,height:(e.spinDotSizeSM-e.marginXXS/2)/2}},[`&-lg ${e.componentCls}-dot`]:{fontSize:e.spinDotSizeLG,i:{width:(e.spinDotSizeLG-e.marginXXS)/2,height:(e.spinDotSizeLG-e.marginXXS)/2}},[`&${e.componentCls}-show-text ${e.componentCls}-text`]:{display:"block"}})});var b=(0,m.Z)("Spin",e=>{let t=(0,p.TS)(e,{spinDotDefault:e.colorTextDescription,spinDotSize:e.controlHeightLG/2,spinDotSizeSM:.35*e.controlHeightLG,spinDotSizeLG:e.controlHeight});return[h(t)]},{contentHeight:400}),f=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&0>t.indexOf(i)&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,i=Object.getOwnPropertySymbols(e);ot.indexOf(i[o])&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(n[i[o]]=e[i[o]]);return n};let x=null,v=e=>{let{spinPrefixCls:t,spinning:n=!0,delay:i=0,className:c,rootClassName:d,size:m="default",tip:p,wrapperClassName:u,style:g,children:h,hashId:b}=e,v=f(e,["spinPrefixCls","spinning","delay","className","rootClassName","size","tip","wrapperClassName","style","children","hashId"]),[y,S]=l.useState(()=>n&&(!n||!i||!!isNaN(Number(i))));l.useEffect(()=>{if(n){var e;let t=function(e,t,n){var i,o=n||{},a=o.noTrailing,l=void 0!==a&&a,r=o.noLeading,s=void 0!==r&&r,c=o.debounceMode,d=void 0===c?void 0:c,m=!1,p=0;function u(){i&&clearTimeout(i)}function g(){for(var n=arguments.length,o=Array(n),a=0;ae?s?(p=Date.now(),l||(i=setTimeout(d?h:g,e))):g():!0!==l&&(i=setTimeout(d?h:g,void 0===d?e-c:e)))}return g.cancel=function(e){var t=(e||{}).upcomingOnly;u(),m=!(void 0!==t&&t)},g}(i,()=>{S(!0)},{debounceMode:!1!==(void 0!==(e=({}).atBegin)&&e)});return t(),()=>{var e;null===(e=null==t?void 0:t.cancel)||void 0===e||e.call(t)}}S(!1)},[i,n]);let $=l.useMemo(()=>void 0!==h,[h]),{direction:w,spin:j}=l.useContext(s.E_),z=o()(t,null==j?void 0:j.className,{[`${t}-sm`]:"small"===m,[`${t}-lg`]:"large"===m,[`${t}-spinning`]:y,[`${t}-show-text`]:!!p,[`${t}-rtl`]:"rtl"===w},c,d,b),C=o()(`${t}-container`,{[`${t}-blur`]:y}),_=(0,a.Z)(v,["indicator","prefixCls"]),N=Object.assign(Object.assign({},null==j?void 0:j.style),g),O=l.createElement("div",Object.assign({},_,{style:N,className:z,"aria-live":"polite","aria-busy":y}),function(e,t){let{indicator:n}=t,i=`${e}-dot`;return null===n?null:(0,r.l$)(n)?(0,r.Tm)(n,{className:o()(n.props.className,i)}):(0,r.l$)(x)?(0,r.Tm)(x,{className:o()(x.props.className,i)}):l.createElement("span",{className:o()(i,`${e}-dot-spin`)},l.createElement("i",{className:`${e}-dot-item`,key:1}),l.createElement("i",{className:`${e}-dot-item`,key:2}),l.createElement("i",{className:`${e}-dot-item`,key:3}),l.createElement("i",{className:`${e}-dot-item`,key:4}))}(t,e),p&&$?l.createElement("div",{className:`${t}-text`},p):null);return $?l.createElement("div",Object.assign({},_,{className:o()(`${t}-nested-loading`,u,b)}),y&&l.createElement("div",{key:"loading"},O),l.createElement("div",{className:C,key:"container"},h)):O},y=e=>{let{prefixCls:t}=e,{getPrefixCls:n}=l.useContext(s.E_),i=n("spin",t),[o,a]=b(i),r=Object.assign(Object.assign({},e),{spinPrefixCls:i,hashId:a});return o(l.createElement(v,Object.assign({},r)))};y.setDefaultIndicator=e=>{x=e};var S=y},48312:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/",function(){return n(57464)}])},48567:function(e,t,n){"use strict";n.d(t,{Z:function(){return p},A:function(){return m}});var i=n(85893),o=n(41468),a=n(51009);let l={proxyllm:{label:"Proxy LLM",icon:"/models/chatgpt.png"},"flan-t5-base":{label:"flan-t5-base",icon:"/models/google.png"},"vicuna-13b":{label:"vicuna-13b",icon:"/models/vicuna.jpeg"},"vicuna-7b":{label:"vicuna-7b",icon:"/models/vicuna.jpeg"},"vicuna-13b-v1.5":{label:"vicuna-13b-v1.5",icon:"/models/vicuna.jpeg"},"vicuna-7b-v1.5":{label:"vicuna-7b-v1.5",icon:"/models/vicuna.jpeg"},"codegen2-1b":{label:"codegen2-1B",icon:"/models/vicuna.jpeg"},"codet5p-2b":{label:"codet5p-2b",icon:"/models/vicuna.jpeg"},"chatglm-6b-int4":{label:"chatglm-6b-int4",icon:"/models/chatglm.png"},"chatglm-6b":{label:"chatglm-6b",icon:"/models/chatglm.png"},"chatglm2-6b":{label:"chatglm2-6b",icon:"/models/chatglm.png"},"chatglm2-6b-int4":{label:"chatglm2-6b-int4",icon:"/models/chatglm.png"},"guanaco-33b-merged":{label:"guanaco-33b-merged",icon:"/models/huggingface.svg"},"falcon-40b":{label:"falcon-40b",icon:"/models/falcon.jpeg"},"gorilla-7b":{label:"gorilla-7b",icon:"/models/gorilla.png"},"gptj-6b":{label:"ggml-gpt4all-j-v1.3-groovy.bin",icon:""},chatgpt_proxyllm:{label:"chatgpt_proxyllm",icon:"/models/chatgpt.png"},bard_proxyllm:{label:"bard_proxyllm",icon:"/models/bard.gif"},claude_proxyllm:{label:"claude_proxyllm",icon:"/models/claude.png"},wenxin_proxyllm:{label:"wenxin_proxyllm",icon:""},tongyi_proxyllm:{label:"tongyi_proxyllm",icon:"/models/qwen2.png"},zhipu_proxyllm:{label:"zhipu_proxyllm",icon:"/models/zhipu.png"},"llama-2-7b":{label:"Llama-2-7b-chat-hf",icon:"/models/llama.jpg"},"llama-2-13b":{label:"Llama-2-13b-chat-hf",icon:"/models/llama.jpg"},"llama-2-70b":{label:"Llama-2-70b-chat-hf",icon:"/models/llama.jpg"},"baichuan-13b":{label:"Baichuan-13B-Chat",icon:"/models/baichuan.png"},"baichuan-7b":{label:"baichuan-7b",icon:"/models/baichuan.png"},"baichuan2-7b":{label:"Baichuan2-7B-Chat",icon:"/models/baichuan.png"},"baichuan2-13b":{label:"Baichuan2-13B-Chat",icon:"/models/baichuan.png"},"wizardlm-13b":{label:"WizardLM-13B-V1.2",icon:"/models/wizardlm.png"},"llama-cpp":{label:"ggml-model-q4_0.bin",icon:"/models/huggingface.svg"},"internlm-7b":{label:"internlm-chat-7b-v1_1",icon:"/models/internlm.png"},"internlm-7b-8k":{label:"internlm-chat-7b-8k",icon:"/models/internlm.png"}};var r=n(25675),s=n.n(r),c=n(67294),d=n(67421);function m(e,t){var n;let{width:o,height:a}=t||{};return e?(0,i.jsx)(s(),{className:"rounded-full border border-gray-200 object-contain bg-white inline-block",width:o||24,height:a||24,src:(null===(n=l[e])||void 0===n?void 0:n.icon)||"/models/huggingface.svg",alt:"llm"}):null}var p=function(e){let{onChange:t}=e,{t:n}=(0,d.$G)(),{modelList:r,model:s}=(0,c.useContext)(o.p);return!r||r.length<=0?null:(0,i.jsx)(a.default,{value:s,placeholder:n("choose_model"),className:"w-52",onChange:e=>{null==t||t(e)},children:r.map(e=>{var t;return(0,i.jsx)(a.default.Option,{children:(0,i.jsxs)("div",{className:"flex items-center",children:[m(e),(0,i.jsx)("span",{className:"ml-2",children:(null===(t=l[e])||void 0===t?void 0:t.label)||e})]})},e)})})}},38954:function(e,t,n){"use strict";n.d(t,{Z:function(){return y}});var i=n(85893),o=n(27496),a=n(59566),l=n(71577),r=n(67294),s=n(2487),c=n(83062),d=n(2453),m=n(74627),p=n(39479),u=n(51009),g=n(58299),h=n(577),b=n(30119),f=n(67421);let x=e=>{let{data:t,loading:n,submit:o,close:a}=e,{t:l}=(0,f.$G)(),r=e=>()=>{o(e),a()};return(0,i.jsx)("div",{style:{maxHeight:400,overflow:"auto"},children:(0,i.jsx)(s.Z,{dataSource:null==t?void 0:t.data,loading:n,rowKey:e=>e.prompt_name,renderItem:e=>(0,i.jsx)(s.Z.Item,{onClick:r(e.content),children:(0,i.jsx)(c.Z,{title:e.content,children:(0,i.jsx)(s.Z.Item.Meta,{style:{cursor:"copy"},title:e.prompt_name,description:l("Prompt_Info_Scene")+":".concat(e.chat_scene,",")+l("Prompt_Info_Sub_Scene")+":".concat(e.sub_chat_scene)})})},e.prompt_name)})})};var v=e=>{let{submit:t}=e,{t:n}=(0,f.$G)(),[o,a]=(0,r.useState)(!1),[l,s]=(0,r.useState)("common"),{data:v,loading:y}=(0,h.Z)(()=>(0,b.PR)("/prompt/list",{prompt_type:l}),{refreshDeps:[l],onError:e=>{d.ZP.error(null==e?void 0:e.message)}});return(0,i.jsx)(m.Z,{title:(0,i.jsx)(p.Z.Item,{label:"Prompt "+n("Type"),children:(0,i.jsx)(u.default,{style:{width:130},value:l,onChange:e=>{s(e)},options:[{label:n("Public")+" Prompts",value:"common"},{label:n("Private")+" Prompts",value:"private"}]})}),content:(0,i.jsx)(x,{data:v,loading:y,submit:t,close:()=>{a(!1)}}),placement:"topRight",trigger:"click",open:o,onOpenChange:e=>{a(e)},children:(0,i.jsx)(c.Z,{title:n("Click_Select")+" Prompt",children:(0,i.jsx)(g.Z,{className:"bottom-32"})})})},y=function(e){let{children:t,loading:n,onSubmit:s,...c}=e,[d,m]=(0,r.useState)("");return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(a.default.TextArea,{className:"flex-1",size:"large",value:d,autoSize:{minRows:1,maxRows:4},...c,onPressEnter:e=>{if(d.trim()&&13===e.keyCode){if(e.shiftKey){m(e=>e+"\n");return}s(d),setTimeout(()=>{m("")},0)}},onChange:e=>{if("number"==typeof c.maxLength){m(e.target.value.substring(0,c.maxLength));return}m(e.target.value)}}),(0,i.jsx)(l.ZP,{className:"ml-2 flex items-center justify-center",size:"large",type:"text",loading:n,icon:(0,i.jsx)(o.Z,{}),onClick:()=>{s(d)}}),(0,i.jsx)(v,{submit:e=>{m(d+e)}}),t]})}},57464:function(e,t,n){"use strict";n.r(t);var i=n(85893),o=n(577),a=n(67294),l=n(96074),r=n(75081),s=n(39332),c=n(25675),d=n.n(c),m=n(50489),p=n(48567),u=n(41468),g=n(38954),h=n(67421),b=n(8937);t.default=()=>{let e=(0,s.useRouter)(),{model:t,setModel:n}=(0,a.useContext)(u.p),{t:c}=(0,h.$G)(),[f,x]=(0,a.useState)(!1),[v,y]=(0,a.useState)(!1),{data:S=[]}=(0,o.Z)(async()=>{y(!0);let[,e]=await (0,m.Vx)((0,m.CU)());return y(!1),null!=e?e:[]}),$=async n=>{x(!0);let[,i]=await (0,m.Vx)((0,m.sW)({chat_mode:"chat_normal"}));i&&(localStorage.setItem(b.rU,JSON.stringify({id:i.conv_uid,message:n})),e.push("/chat/?scene=chat_normal&id=".concat(i.conv_uid).concat(t?"&model=".concat(t):""))),x(!1)},w=async n=>{let[,i]=await (0,m.Vx)((0,m.sW)({chat_mode:"chat_normal"}));i&&e.push("/chat?scene=".concat(n.chat_scene,"&id=").concat(i.conv_uid).concat(t?"&model=".concat(t):""))};return(0,i.jsxs)("div",{className:"mx-auto h-full justify-center flex max-w-3xl flex-col px-4",children:[(0,i.jsx)("div",{className:"my-0 mx-auto",children:(0,i.jsx)(d(),{src:"/LOGO.png",alt:"Revolutionizing Database Interactions with Private LLM Technology",width:856,height:160,className:"w-full",unoptimized:!0})}),(0,i.jsx)(l.Z,{className:"!text-[#878c93] !my-6",plain:!0,children:c("Quick_Start")}),(0,i.jsx)(r.Z,{spinning:v,children:(0,i.jsx)("div",{className:"flex flex-wrap -m-1 md:-m-3",children:S.map(e=>(0,i.jsx)("div",{className:"w-full sm:w-1/2 lg:w-1/3 p-1 md:p-3",children:(0,i.jsx)("div",{className:"cursor-pointer flex items-center justify-center w-full h-12 rounded font-semibold text-sm bg-[#E6F4FF] text-[#1677FE] dark:text-gray-100 dark:bg-[#4E4F56]",onClick:()=>{w(e)},children:e.scene_name})},e.chat_scene))})}),(0,i.jsx)("div",{className:"mt-8 mb-2",children:(0,i.jsx)(p.Z,{onChange:e=>{n(e)}})}),(0,i.jsx)("div",{className:"flex",children:(0,i.jsx)(g.Z,{loading:f,onSubmit:$})})]})}},30119:function(e,t,n){"use strict";n.d(t,{Tk:function(){return s},PR:function(){return c}});var i=n(2453),o=n(6154),a=n(83454);let l=o.Z.create({baseURL:a.env.API_BASE_URL});l.defaults.timeout=1e4,l.interceptors.response.use(e=>e.data,e=>Promise.reject(e)),n(96486);let r={"content-type":"application/json"},s=(e,t)=>{if(t){let n=Object.keys(t).filter(e=>void 0!==t[e]&&""!==t[e]).map(e=>"".concat(e,"=").concat(t[e])).join("&");n&&(e+="?".concat(n))}return l.get("/api"+e,{headers:r}).then(e=>e).catch(e=>{i.ZP.error(e),Promise.reject(e)})},c=(e,t)=>l.post(e,t,{headers:r}).then(e=>e).catch(e=>{i.ZP.error(e),Promise.reject(e)})}},function(e){e.O(0,[662,44,479,9,411,270,539,774,888,179],function(){return e(e.s=48312)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/pilot/server/static/_next/static/chunks/pages/knowledge-241088d0c9a7c3be.js b/pilot/server/static/_next/static/chunks/pages/knowledge-fe88b529e40b0db6.js similarity index 96% rename from pilot/server/static/_next/static/chunks/pages/knowledge-241088d0c9a7c3be.js rename to pilot/server/static/_next/static/chunks/pages/knowledge-fe88b529e40b0db6.js index e4bd71b23..15171e9e1 100644 --- a/pilot/server/static/_next/static/chunks/pages/knowledge-241088d0c9a7c3be.js +++ b/pilot/server/static/_next/static/chunks/pages/knowledge-fe88b529e40b0db6.js @@ -1 +1 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[265],{74627:function(e,t,n){"use strict";n.d(t,{Z:function(){return _}});var r=n(94184),a=n.n(r),o=n(67294);let l=e=>e?"function"==typeof e?e():e:null;var i=n(33603),s=n(53124),c=n(83062),d=n(92419),p=n(14747),m=n(50438),u=n(77786),h=n(8796),f=n(67968),g=n(45503);let x=e=>{let{componentCls:t,popoverColor:n,minWidth:r,fontWeightStrong:a,popoverPadding:o,boxShadowSecondary:l,colorTextHeading:i,borderRadiusLG:s,zIndexPopup:c,marginXS:d,colorBgElevated:m,popoverBg:h}=e;return[{[t]:Object.assign(Object.assign({},(0,p.Wf)(e)),{position:"absolute",top:0,left:{_skip_check_:!0,value:0},zIndex:c,fontWeight:"normal",whiteSpace:"normal",textAlign:"start",cursor:"auto",userSelect:"text",transformOrigin:"var(--arrow-x, 50%) var(--arrow-y, 50%)","--antd-arrow-background-color":m,"&-rtl":{direction:"rtl"},"&-hidden":{display:"none"},[`${t}-content`]:{position:"relative"},[`${t}-inner`]:{backgroundColor:h,backgroundClip:"padding-box",borderRadius:s,boxShadow:l,padding:o},[`${t}-title`]:{minWidth:r,marginBottom:d,color:i,fontWeight:a},[`${t}-inner-content`]:{color:n}})},(0,u.ZP)(e,{colorBg:"var(--antd-arrow-background-color)"}),{[`${t}-pure`]:{position:"relative",maxWidth:"none",margin:e.sizePopupArrow,display:"inline-block",[`${t}-content`]:{display:"inline-block"}}}]},v=e=>{let{componentCls:t}=e;return{[t]:h.i.map(n=>{let r=e[`${n}6`];return{[`&${t}-${n}`]:{"--antd-arrow-background-color":r,[`${t}-inner`]:{backgroundColor:r},[`${t}-arrow`]:{background:"transparent"}}}})}},w=e=>{let{componentCls:t,lineWidth:n,lineType:r,colorSplit:a,paddingSM:o,controlHeight:l,fontSize:i,lineHeight:s,padding:c}=e,d=l-Math.round(i*s);return{[t]:{[`${t}-inner`]:{padding:0},[`${t}-title`]:{margin:0,padding:`${d/2}px ${c}px ${d/2-n}px`,borderBottom:`${n}px ${r} ${a}`},[`${t}-inner-content`]:{padding:`${o}px ${c}px`}}}};var b=(0,f.Z)("Popover",e=>{let{colorBgElevated:t,colorText:n,wireframe:r}=e,a=(0,g.TS)(e,{popoverPadding:12,popoverBg:t,popoverColor:n});return[x(a),v(a),r&&w(a),(0,m._y)(a,"zoom-big")]},e=>({width:177,minWidth:177,zIndexPopup:e.zIndexPopupBase+30}),{deprecatedTokens:[["width","minWidth"]]}),y=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var a=0,r=Object.getOwnPropertySymbols(e);at.indexOf(r[a])&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]]);return n};let j=(e,t,n)=>{if(t||n)return o.createElement(o.Fragment,null,t&&o.createElement("div",{className:`${e}-title`},l(t)),o.createElement("div",{className:`${e}-inner-content`},l(n)))},k=e=>{let{hashId:t,prefixCls:n,className:r,style:l,placement:i="top",title:s,content:c,children:p}=e;return o.createElement("div",{className:a()(t,n,`${n}-pure`,`${n}-placement-${i}`,r),style:l},o.createElement("div",{className:`${n}-arrow`}),o.createElement(d.G,Object.assign({},e,{className:t,prefixCls:n}),p||j(n,s,c)))};var N=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var a=0,r=Object.getOwnPropertySymbols(e);at.indexOf(r[a])&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]]);return n};let $=e=>{let{title:t,content:n,prefixCls:r}=e;return o.createElement(o.Fragment,null,t&&o.createElement("div",{className:`${r}-title`},l(t)),o.createElement("div",{className:`${r}-inner-content`},l(n)))},C=o.forwardRef((e,t)=>{let{prefixCls:n,title:r,content:l,overlayClassName:d,placement:p="top",trigger:m="hover",mouseEnterDelay:u=.1,mouseLeaveDelay:h=.1,overlayStyle:f={}}=e,g=N(e,["prefixCls","title","content","overlayClassName","placement","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle"]),{getPrefixCls:x}=o.useContext(s.E_),v=x("popover",n),[w,y]=b(v),j=x(),k=a()(d,y);return w(o.createElement(c.Z,Object.assign({placement:p,trigger:m,mouseEnterDelay:u,mouseLeaveDelay:h,overlayStyle:f},g,{prefixCls:v,overlayClassName:k,ref:t,overlay:r||l?o.createElement($,{prefixCls:v,title:r,content:l}):null,transitionName:(0,i.m)(j,"zoom-big",g.transitionName),"data-popover-inject":!0})))});C._InternalPanelDoNotUseOrYouWillBeFired=e=>{let{prefixCls:t}=e,n=y(e,["prefixCls"]),{getPrefixCls:r}=o.useContext(s.E_),a=r("popover",t),[l,i]=b(a);return l(o.createElement(k,Object.assign({},n,{prefixCls:a,hashId:i})))};var _=C},54681:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/knowledge",function(){return n(59051)}])},59051:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return E}});var r=n(85893),a=n(67294),o=n(67421),l=n(24969),i=n(71577),s=n(12069),c=n(46735),d=n(74627),p=n(40411),m=n(11163),u=n(25675),h=n.n(u),f=n(21640),g=n(87462),x={icon:function(e,t){return{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M292.7 840h438.6l24.2-512h-487z",fill:t}},{tag:"path",attrs:{d:"M864 256H736v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zm-504-72h304v72H360v-72zm371.3 656H292.7l-24.2-512h487l-24.2 512z",fill:e}}]}},name:"delete",theme:"twotone"},v=n(84089),w=a.forwardRef(function(e,t){return a.createElement(v.Z,(0,g.Z)({},e,{ref:t,icon:x}))}),b={icon:function(e,t){return{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M775.3 248.9a369.62 369.62 0 00-119-80A370.2 370.2 0 00512.1 140h-1.7c-99.7.4-193 39.4-262.8 109.9-69.9 70.5-108 164.1-107.6 263.8.3 60.3 15.3 120.2 43.5 173.1l4.5 8.4V836h140.8l8.4 4.5c52.9 28.2 112.8 43.2 173.1 43.5h1.7c99 0 192-38.2 262.1-107.6 70.4-69.8 109.5-163.1 110.1-262.7.2-50.6-9.5-99.6-28.9-145.8a370.15 370.15 0 00-80-119zM312 560a48.01 48.01 0 010-96 48.01 48.01 0 010 96zm200 0a48.01 48.01 0 010-96 48.01 48.01 0 010 96zm200 0a48.01 48.01 0 010-96 48.01 48.01 0 010 96z",fill:t}},{tag:"path",attrs:{d:"M664 512a48 48 0 1096 0 48 48 0 10-96 0zm-400 0a48 48 0 1096 0 48 48 0 10-96 0z",fill:e}},{tag:"path",attrs:{d:"M925.2 338.4c-22.6-53.7-55-101.9-96.3-143.3a444.35 444.35 0 00-143.3-96.3C630.6 75.7 572.2 64 512 64h-2c-60.6.3-119.3 12.3-174.5 35.9a445.35 445.35 0 00-142 96.5c-40.9 41.3-73 89.3-95.2 142.8-23 55.4-34.6 114.3-34.3 174.9A449.4 449.4 0 00112 714v152a46 46 0 0046 46h152.1A449.4 449.4 0 00510 960h2.1c59.9 0 118-11.6 172.7-34.3a444.48 444.48 0 00142.8-95.2c41.3-40.9 73.8-88.7 96.5-142 23.6-55.2 35.6-113.9 35.9-174.5.3-60.9-11.5-120-34.8-175.6zm-151.1 438C704 845.8 611 884 512 884h-1.7c-60.3-.3-120.2-15.3-173.1-43.5l-8.4-4.5H188V695.2l-4.5-8.4C155.3 633.9 140.3 574 140 513.7c-.4-99.7 37.7-193.3 107.6-263.8 69.8-70.5 163.1-109.5 262.8-109.9h1.7c50 0 98.5 9.7 144.2 28.9 44.6 18.7 84.6 45.6 119 80 34.3 34.3 61.3 74.4 80 119 19.4 46.2 29.1 95.2 28.9 145.8-.6 99.6-39.7 192.9-110.1 262.7z",fill:e}},{tag:"path",attrs:{d:"M464 512a48 48 0 1096 0 48 48 0 10-96 0z",fill:e}}]}},name:"message",theme:"twotone"},y=a.forwardRef(function(e,t){return a.createElement(v.Z,(0,g.Z)({},e,{ref:t,icon:b}))}),j=n(92039),k=n(30381),N=n.n(k),$=n(50489);let{confirm:C}=s.default;function _(e){var t;let n=(0,m.useRouter)(),{spaceInfo:o,t:l,knowledgeSpaceToDelete:s,fetchKnowledge:u}=e,[g,x]=(0,a.useState)(o.docs),v=()=>{C({title:l("Tips"),icon:(0,r.jsx)(f.Z,{}),content:"".concat(l("Del_Knowledge_Tips"),"?"),okText:"Yes",okType:"danger",cancelText:"No",async onOk(){await (0,$.Vx)((0,$._s)({name:null==s?void 0:s.name})),u()}})},b=async e=>{e.stopPropagation();let[t,r]=await (0,$.Vx)((0,$.sW)({chat_mode:"chat_knowledge"}));(null==r?void 0:r.conv_uid)&&n.push("/chat?scene=chat_knowledge&id=".concat(null==r?void 0:r.conv_uid,"&db_param=").concat(o.name))};return(0,r.jsx)(c.ZP,{theme:{components:{Popover:{zIndexPopup:90}}},children:(0,r.jsx)(d.Z,{className:"dark:hover:border-white transition-all hover:shadow-md bg-[#FFFFFF] dark:bg-[#484848] relative shrink-0 grow-0 cursor-pointer rounded-[10px] border border-gray-200 border-solid w-full min-[width]:80",placement:"bottom",trigger:"click",content:(0,r.jsx)(j.Z,{setDocumentCount:x,knowledge:o}),children:(0,r.jsxs)(p.Z,{count:g||0,children:[(0,r.jsxs)("div",{className:"flex justify-between mx-6 mt-3",children:[(0,r.jsxs)("div",{className:"text-lg font-bold text-black truncate",children:[(t=o.vector_type,(0,r.jsx)(h(),{className:"rounded-full w-8 h-8 border border-gray-200 object-contain bg-white inline-block",width:36,height:136,src:{Chroma:"/models/chroma-logo.png"}[t]||"/models/knowledge-default.jpg",alt:"llm"})),(0,r.jsx)("span",{className:"dark:text-white ml-2",children:null==o?void 0:o.name})]}),(0,r.jsx)(w,{onClick:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),v()},style:{fontSize:"20px"},twoToneColor:"#CD2029",className:"text-3xl"})]}),(0,r.jsxs)("div",{className:"text-sm mt-2 p-6 pt-2 h-40",children:[(0,r.jsxs)("p",{className:"font-semibold",children:[l("Owner"),":"]}),(0,r.jsx)("p",{className:" truncate",children:null==o?void 0:o.owner}),(0,r.jsxs)("p",{className:"font-semibold mt-2",children:[l("Description"),":"]}),(0,r.jsx)("p",{className:" line-clamp-2",children:null==o?void 0:o.desc}),(0,r.jsx)("p",{className:"font-semibold mt-2",children:"Last modify:"}),(0,r.jsx)("p",{className:" truncate",children:N()(o.gmt_modified).format("YYYY-MM-DD HH:MM:SS")})]}),(0,r.jsx)("div",{className:"flex justify-center",children:(0,r.jsx)(i.ZP,{size:"middle",onClick:b,className:"mr-4 dark:text-white mb-2",shape:"round",icon:(0,r.jsx)(y,{}),children:l("Chat")})})]})})})}var O=n(78543),E=()=>{let{t:e}=(0,o.$G)(),[t,n]=(0,a.useState)([]),[s,c]=(0,a.useState)(!1);async function d(){let[e,t]=await (0,$.Vx)((0,$.eU)());n(t)}return(0,a.useEffect)(()=>{d()},[]),(0,r.jsxs)("div",{className:"bg-[#FAFAFA] dark:bg-[#212121] w-full h-full",children:[(0,r.jsxs)("div",{className:"page-body p-6 px-12 h-full overflow-auto",children:[(0,r.jsx)(i.ZP,{type:"primary",className:"flex items-center",icon:(0,r.jsx)(l.Z,{}),onClick:()=>{c(!0)},children:"Create"}),(0,r.jsx)("div",{className:"mt-3 grid grid-cols-1 gap-x-6 gap-y-5 sm:grid-cols-2 lg:grid-cols-4 xl:gap-x-5",children:null==t?void 0:t.map((t,n)=>(0,r.jsx)(_,{fetchKnowledge:d,spaceInfo:t,t:e,knowledgeSpaceToDelete:t,isAddShow:s,setIsAddShow:c},n))})]}),(0,r.jsx)(O.Z,{fetchKnowledge:d,setKnowledgeSpaceList:n,isAddShow:s,setIsAddShow:c,type:"knowledge"})]})}}},function(e){e.O(0,[885,44,479,365,442,813,924,411,104,747,774,888,179],function(){return e(e.s=54681)}),_N_E=e.O()}]); \ No newline at end of file +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[265],{74627:function(e,t,n){"use strict";n.d(t,{Z:function(){return _}});var r=n(94184),a=n.n(r),o=n(67294);let l=e=>e?"function"==typeof e?e():e:null;var i=n(33603),s=n(53124),c=n(83062),d=n(92419),p=n(14747),m=n(50438),u=n(77786),h=n(8796),f=n(67968),g=n(45503);let x=e=>{let{componentCls:t,popoverColor:n,minWidth:r,fontWeightStrong:a,popoverPadding:o,boxShadowSecondary:l,colorTextHeading:i,borderRadiusLG:s,zIndexPopup:c,marginXS:d,colorBgElevated:m,popoverBg:h}=e;return[{[t]:Object.assign(Object.assign({},(0,p.Wf)(e)),{position:"absolute",top:0,left:{_skip_check_:!0,value:0},zIndex:c,fontWeight:"normal",whiteSpace:"normal",textAlign:"start",cursor:"auto",userSelect:"text",transformOrigin:"var(--arrow-x, 50%) var(--arrow-y, 50%)","--antd-arrow-background-color":m,"&-rtl":{direction:"rtl"},"&-hidden":{display:"none"},[`${t}-content`]:{position:"relative"},[`${t}-inner`]:{backgroundColor:h,backgroundClip:"padding-box",borderRadius:s,boxShadow:l,padding:o},[`${t}-title`]:{minWidth:r,marginBottom:d,color:i,fontWeight:a},[`${t}-inner-content`]:{color:n}})},(0,u.ZP)(e,{colorBg:"var(--antd-arrow-background-color)"}),{[`${t}-pure`]:{position:"relative",maxWidth:"none",margin:e.sizePopupArrow,display:"inline-block",[`${t}-content`]:{display:"inline-block"}}}]},v=e=>{let{componentCls:t}=e;return{[t]:h.i.map(n=>{let r=e[`${n}6`];return{[`&${t}-${n}`]:{"--antd-arrow-background-color":r,[`${t}-inner`]:{backgroundColor:r},[`${t}-arrow`]:{background:"transparent"}}}})}},w=e=>{let{componentCls:t,lineWidth:n,lineType:r,colorSplit:a,paddingSM:o,controlHeight:l,fontSize:i,lineHeight:s,padding:c}=e,d=l-Math.round(i*s);return{[t]:{[`${t}-inner`]:{padding:0},[`${t}-title`]:{margin:0,padding:`${d/2}px ${c}px ${d/2-n}px`,borderBottom:`${n}px ${r} ${a}`},[`${t}-inner-content`]:{padding:`${o}px ${c}px`}}}};var b=(0,f.Z)("Popover",e=>{let{colorBgElevated:t,colorText:n,wireframe:r}=e,a=(0,g.TS)(e,{popoverPadding:12,popoverBg:t,popoverColor:n});return[x(a),v(a),r&&w(a),(0,m._y)(a,"zoom-big")]},e=>({width:177,minWidth:177,zIndexPopup:e.zIndexPopupBase+30}),{deprecatedTokens:[["width","minWidth"]]}),y=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var a=0,r=Object.getOwnPropertySymbols(e);at.indexOf(r[a])&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]]);return n};let j=(e,t,n)=>{if(t||n)return o.createElement(o.Fragment,null,t&&o.createElement("div",{className:`${e}-title`},l(t)),o.createElement("div",{className:`${e}-inner-content`},l(n)))},k=e=>{let{hashId:t,prefixCls:n,className:r,style:l,placement:i="top",title:s,content:c,children:p}=e;return o.createElement("div",{className:a()(t,n,`${n}-pure`,`${n}-placement-${i}`,r),style:l},o.createElement("div",{className:`${n}-arrow`}),o.createElement(d.G,Object.assign({},e,{className:t,prefixCls:n}),p||j(n,s,c)))};var N=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var a=0,r=Object.getOwnPropertySymbols(e);at.indexOf(r[a])&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]]);return n};let $=e=>{let{title:t,content:n,prefixCls:r}=e;return o.createElement(o.Fragment,null,t&&o.createElement("div",{className:`${r}-title`},l(t)),o.createElement("div",{className:`${r}-inner-content`},l(n)))},C=o.forwardRef((e,t)=>{let{prefixCls:n,title:r,content:l,overlayClassName:d,placement:p="top",trigger:m="hover",mouseEnterDelay:u=.1,mouseLeaveDelay:h=.1,overlayStyle:f={}}=e,g=N(e,["prefixCls","title","content","overlayClassName","placement","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle"]),{getPrefixCls:x}=o.useContext(s.E_),v=x("popover",n),[w,y]=b(v),j=x(),k=a()(d,y);return w(o.createElement(c.Z,Object.assign({placement:p,trigger:m,mouseEnterDelay:u,mouseLeaveDelay:h,overlayStyle:f},g,{prefixCls:v,overlayClassName:k,ref:t,overlay:r||l?o.createElement($,{prefixCls:v,title:r,content:l}):null,transitionName:(0,i.m)(j,"zoom-big",g.transitionName),"data-popover-inject":!0})))});C._InternalPanelDoNotUseOrYouWillBeFired=e=>{let{prefixCls:t}=e,n=y(e,["prefixCls"]),{getPrefixCls:r}=o.useContext(s.E_),a=r("popover",t),[l,i]=b(a);return l(o.createElement(k,Object.assign({},n,{prefixCls:a,hashId:i})))};var _=C},54681:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/knowledge",function(){return n(59051)}])},59051:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return E}});var r=n(85893),a=n(67294),o=n(67421),l=n(24969),i=n(71577),s=n(12069),c=n(46735),d=n(74627),p=n(40411),m=n(11163),u=n(25675),h=n.n(u),f=n(21640),g=n(87462),x={icon:function(e,t){return{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M292.7 840h438.6l24.2-512h-487z",fill:t}},{tag:"path",attrs:{d:"M864 256H736v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zm-504-72h304v72H360v-72zm371.3 656H292.7l-24.2-512h487l-24.2 512z",fill:e}}]}},name:"delete",theme:"twotone"},v=n(84089),w=a.forwardRef(function(e,t){return a.createElement(v.Z,(0,g.Z)({},e,{ref:t,icon:x}))}),b={icon:function(e,t){return{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M775.3 248.9a369.62 369.62 0 00-119-80A370.2 370.2 0 00512.1 140h-1.7c-99.7.4-193 39.4-262.8 109.9-69.9 70.5-108 164.1-107.6 263.8.3 60.3 15.3 120.2 43.5 173.1l4.5 8.4V836h140.8l8.4 4.5c52.9 28.2 112.8 43.2 173.1 43.5h1.7c99 0 192-38.2 262.1-107.6 70.4-69.8 109.5-163.1 110.1-262.7.2-50.6-9.5-99.6-28.9-145.8a370.15 370.15 0 00-80-119zM312 560a48.01 48.01 0 010-96 48.01 48.01 0 010 96zm200 0a48.01 48.01 0 010-96 48.01 48.01 0 010 96zm200 0a48.01 48.01 0 010-96 48.01 48.01 0 010 96z",fill:t}},{tag:"path",attrs:{d:"M664 512a48 48 0 1096 0 48 48 0 10-96 0zm-400 0a48 48 0 1096 0 48 48 0 10-96 0z",fill:e}},{tag:"path",attrs:{d:"M925.2 338.4c-22.6-53.7-55-101.9-96.3-143.3a444.35 444.35 0 00-143.3-96.3C630.6 75.7 572.2 64 512 64h-2c-60.6.3-119.3 12.3-174.5 35.9a445.35 445.35 0 00-142 96.5c-40.9 41.3-73 89.3-95.2 142.8-23 55.4-34.6 114.3-34.3 174.9A449.4 449.4 0 00112 714v152a46 46 0 0046 46h152.1A449.4 449.4 0 00510 960h2.1c59.9 0 118-11.6 172.7-34.3a444.48 444.48 0 00142.8-95.2c41.3-40.9 73.8-88.7 96.5-142 23.6-55.2 35.6-113.9 35.9-174.5.3-60.9-11.5-120-34.8-175.6zm-151.1 438C704 845.8 611 884 512 884h-1.7c-60.3-.3-120.2-15.3-173.1-43.5l-8.4-4.5H188V695.2l-4.5-8.4C155.3 633.9 140.3 574 140 513.7c-.4-99.7 37.7-193.3 107.6-263.8 69.8-70.5 163.1-109.5 262.8-109.9h1.7c50 0 98.5 9.7 144.2 28.9 44.6 18.7 84.6 45.6 119 80 34.3 34.3 61.3 74.4 80 119 19.4 46.2 29.1 95.2 28.9 145.8-.6 99.6-39.7 192.9-110.1 262.7z",fill:e}},{tag:"path",attrs:{d:"M464 512a48 48 0 1096 0 48 48 0 10-96 0z",fill:e}}]}},name:"message",theme:"twotone"},y=a.forwardRef(function(e,t){return a.createElement(v.Z,(0,g.Z)({},e,{ref:t,icon:b}))}),j=n(92039),k=n(30381),N=n.n(k),$=n(50489);let{confirm:C}=s.default;function _(e){var t;let n=(0,m.useRouter)(),{spaceInfo:o,t:l,knowledgeSpaceToDelete:s,fetchKnowledge:u}=e,[g,x]=(0,a.useState)(o.docs),v=()=>{C({title:l("Tips"),icon:(0,r.jsx)(f.Z,{}),content:"".concat(l("Del_Knowledge_Tips"),"?"),okText:"Yes",okType:"danger",cancelText:"No",async onOk(){await (0,$.Vx)((0,$._s)({name:null==s?void 0:s.name})),u()}})},b=async e=>{e.stopPropagation();let[t,r]=await (0,$.Vx)((0,$.sW)({chat_mode:"chat_knowledge"}));(null==r?void 0:r.conv_uid)&&n.push("/chat?scene=chat_knowledge&id=".concat(null==r?void 0:r.conv_uid,"&db_param=").concat(o.name))};return(0,r.jsx)(c.ZP,{theme:{components:{Popover:{zIndexPopup:90}}},children:(0,r.jsx)(d.Z,{className:"dark:hover:border-white transition-all hover:shadow-md bg-[#FFFFFF] dark:bg-[#484848] relative shrink-0 grow-0 cursor-pointer rounded-[10px] border border-gray-200 border-solid w-full min-[width]:80",placement:"bottom",trigger:"click",content:(0,r.jsx)(j.Z,{setDocumentCount:x,knowledge:o}),children:(0,r.jsxs)(p.Z,{count:g||0,children:[(0,r.jsxs)("div",{className:"flex justify-between mx-6 mt-3",children:[(0,r.jsxs)("div",{className:"text-lg font-bold text-black truncate",children:[(t=o.vector_type,(0,r.jsx)(h(),{className:"rounded-full w-8 h-8 border border-gray-200 object-contain bg-white inline-block",width:36,height:136,src:{Chroma:"/models/chroma-logo.png"}[t]||"/models/knowledge-default.jpg",alt:"llm"})),(0,r.jsx)("span",{className:"dark:text-white ml-2",children:null==o?void 0:o.name})]}),(0,r.jsx)(w,{onClick:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),v()},style:{fontSize:"20px"},twoToneColor:"#CD2029",className:"text-3xl"})]}),(0,r.jsxs)("div",{className:"text-sm mt-2 p-6 pt-2 h-40",children:[(0,r.jsxs)("p",{className:"font-semibold",children:[l("Owner"),":"]}),(0,r.jsx)("p",{className:" truncate",children:null==o?void 0:o.owner}),(0,r.jsxs)("p",{className:"font-semibold mt-2",children:[l("Description"),":"]}),(0,r.jsx)("p",{className:" line-clamp-2",children:null==o?void 0:o.desc}),(0,r.jsx)("p",{className:"font-semibold mt-2",children:"Last modify:"}),(0,r.jsx)("p",{className:" truncate",children:N()(o.gmt_modified).format("YYYY-MM-DD HH:MM:SS")})]}),(0,r.jsx)("div",{className:"flex justify-center",children:(0,r.jsx)(i.ZP,{size:"middle",onClick:b,className:"mr-4 dark:text-white mb-2",shape:"round",icon:(0,r.jsx)(y,{}),children:l("Chat")})})]})})})}var O=n(78543),E=()=>{let{t:e}=(0,o.$G)(),[t,n]=(0,a.useState)([]),[s,c]=(0,a.useState)(!1);async function d(){let[e,t]=await (0,$.Vx)((0,$.eU)());n(t)}return(0,a.useEffect)(()=>{d()},[]),(0,r.jsxs)("div",{className:"bg-[#FAFAFA] dark:bg-[#212121] w-full h-full",children:[(0,r.jsxs)("div",{className:"page-body p-6 px-12 h-full overflow-auto",children:[(0,r.jsx)(i.ZP,{type:"primary",className:"flex items-center",icon:(0,r.jsx)(l.Z,{}),onClick:()=>{c(!0)},children:"Create"}),(0,r.jsx)("div",{className:"mt-3 grid grid-cols-1 gap-x-6 gap-y-5 sm:grid-cols-2 lg:grid-cols-4 xl:gap-x-5",children:null==t?void 0:t.map(t=>(0,r.jsx)(_,{fetchKnowledge:d,spaceInfo:t,t:e,knowledgeSpaceToDelete:t,isAddShow:s,setIsAddShow:c},t.id))})]}),(0,r.jsx)(O.Z,{fetchKnowledge:d,setKnowledgeSpaceList:n,isAddShow:s,setIsAddShow:c,type:"knowledge"})]})}}},function(e){e.O(0,[885,44,479,365,442,813,924,411,104,747,774,888,179],function(){return e(e.s=54681)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/pilot/server/static/_next/static/chunks/pages/knowledge/[knowledgeName]/[id]-3ae2140c14e09e39.js b/pilot/server/static/_next/static/chunks/pages/knowledge/[knowledgeName]/[id]-288d3a43e60ca611.js similarity index 93% rename from pilot/server/static/_next/static/chunks/pages/knowledge/[knowledgeName]/[id]-3ae2140c14e09e39.js rename to pilot/server/static/_next/static/chunks/pages/knowledge/[knowledgeName]/[id]-288d3a43e60ca611.js index ac6a05562..a768a887d 100644 --- a/pilot/server/static/_next/static/chunks/pages/knowledge/[knowledgeName]/[id]-3ae2140c14e09e39.js +++ b/pilot/server/static/_next/static/chunks/pages/knowledge/[knowledgeName]/[id]-288d3a43e60ca611.js @@ -1,4 +1,4 @@ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[670],{80882:function(e,t,r){"use strict";r.d(t,{Z:function(){return i}});var n=r(87462),l=r(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"}}]},name:"down",theme:"outlined"},a=r(84089),i=l.forwardRef(function(e,t){return l.createElement(a.Z,(0,n.Z)({},e,{ref:t,icon:o}))})},54068:function(e,t,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/knowledge/[knowledgeName]/[id]",function(){return r(21543)}])},21543:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return X}});var n=r(85893),l=r(67294),o=r(11163),a=r(94184),i=r.n(a),s=r(50344),c=r(64217),u=r(96159),p=r(53124),m=r(80882),d=r(1142);let f=e=>{let{children:t}=e,{getPrefixCls:r}=l.useContext(p.E_),n=r("breadcrumb");return l.createElement("li",{className:`${n}-separator`,"aria-hidden":"true"},""===t?t:t||"/")};f.__ANT_BREADCRUMB_SEPARATOR=!0;var b=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var l=0,n=Object.getOwnPropertySymbols(e);lt.indexOf(n[l])&&Object.prototype.propertyIsEnumerable.call(e,n[l])&&(r[n[l]]=e[n[l]]);return r};function g(e,t,r,n){if(null==r)return null;let{className:o,onClick:a}=t,s=b(t,["className","onClick"]),u=Object.assign(Object.assign({},(0,c.Z)(s,{data:!0,aria:!0})),{onClick:a});return void 0!==n?l.createElement("a",Object.assign({},u,{className:i()(`${e}-link`,o),href:n}),r):l.createElement("span",Object.assign({},u,{className:i()(`${e}-link`,o)}),r)}var O=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var l=0,n=Object.getOwnPropertySymbols(e);lt.indexOf(n[l])&&Object.prototype.propertyIsEnumerable.call(e,n[l])&&(r[n[l]]=e[n[l]]);return r};let y=e=>{let{prefixCls:t,separator:r="/",children:n,menu:o,overlay:a,dropdownProps:i,href:s}=e,c=(e=>{if(o||a){let r=Object.assign({},i);if(o){let e=o||{},{items:t}=e,n=O(e,["items"]);r.menu=Object.assign(Object.assign({},n),{items:null==t?void 0:t.map((e,t)=>{var{key:r,title:n,label:o,path:a}=e,i=O(e,["key","title","label","path"]);let c=null!=o?o:n;return a&&(c=l.createElement("a",{href:`${s}${a}`},c)),Object.assign(Object.assign({},i),{key:null!=r?r:t,label:c})})})}else a&&(r.overlay=a);return l.createElement(d.Z,Object.assign({placement:"bottom"},r),l.createElement("span",{className:`${t}-overlay-link`},e,l.createElement(m.Z,null)))}return e})(n);return null!=c?l.createElement(l.Fragment,null,l.createElement("li",null,c),r&&l.createElement(f,null,r)):null},h=e=>{let{prefixCls:t,children:r,href:n}=e,o=O(e,["prefixCls","children","href"]),{getPrefixCls:a}=l.useContext(p.E_),i=a("breadcrumb",t);return l.createElement(y,Object.assign({},o,{prefixCls:i}),g(i,o,r,n))};h.__ANT_BREADCRUMB_ITEM=!0;var v=r(14747),j=r(67968),x=r(45503);let E=e=>{let{componentCls:t,iconCls:r}=e;return{[t]:Object.assign(Object.assign({},(0,v.Wf)(e)),{color:e.itemColor,fontSize:e.fontSize,[r]:{fontSize:e.iconFontSize},ol:{display:"flex",flexWrap:"wrap",margin:0,padding:0,listStyle:"none"},a:Object.assign({color:e.linkColor,transition:`color ${e.motionDurationMid}`,padding:`0 ${e.paddingXXS}px`,borderRadius:e.borderRadiusSM,height:e.lineHeight*e.fontSize,display:"inline-block",marginInline:-e.marginXXS,"&:hover":{color:e.linkHoverColor,backgroundColor:e.colorBgTextHover}},(0,v.Qy)(e)),"li:last-child":{color:e.lastItemColor},[`${t}-separator`]:{marginInline:e.separatorMargin,color:e.separatorColor},[`${t}-link`]:{[` > ${r} + span, > ${r} + a - `]:{marginInlineStart:e.marginXXS}},[`${t}-overlay-link`]:{borderRadius:e.borderRadiusSM,height:e.lineHeight*e.fontSize,display:"inline-block",padding:`0 ${e.paddingXXS}px`,marginInline:-e.marginXXS,[`> ${r}`]:{marginInlineStart:e.marginXXS,fontSize:e.fontSizeIcon},"&:hover":{color:e.linkHoverColor,backgroundColor:e.colorBgTextHover,a:{color:e.linkHoverColor}},a:{"&:hover":{backgroundColor:"transparent"}}},[`&${e.componentCls}-rtl`]:{direction:"rtl"}})}};var S=(0,j.Z)("Breadcrumb",e=>{let t=(0,x.TS)(e,{});return[E(t)]},e=>({itemColor:e.colorTextDescription,lastItemColor:e.colorText,iconFontSize:e.fontSize,linkColor:e.colorTextDescription,linkHoverColor:e.colorText,separatorColor:e.colorTextDescription,separatorMargin:e.marginXS})),k=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var l=0,n=Object.getOwnPropertySymbols(e);lt.indexOf(n[l])&&Object.prototype.propertyIsEnumerable.call(e,n[l])&&(r[n[l]]=e[n[l]]);return r};function C(e){let{breadcrumbName:t,children:r}=e,n=k(e,["breadcrumbName","children"]),l=Object.assign({title:t},n);return r&&(l.menu={items:r.map(e=>{var{breadcrumbName:t}=e;return Object.assign(Object.assign({},k(e,["breadcrumbName"])),{title:t})})}),l}var _=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var l=0,n=Object.getOwnPropertySymbols(e);lt.indexOf(n[l])&&Object.prototype.propertyIsEnumerable.call(e,n[l])&&(r[n[l]]=e[n[l]]);return r};let w=(e,t)=>{if(void 0===t)return t;let r=(t||"").replace(/^\//,"");return Object.keys(e).forEach(t=>{r=r.replace(`:${t}`,e[t])}),r},N=e=>{let t;let{prefixCls:r,separator:n="/",style:o,className:a,rootClassName:m,routes:d,items:b,children:O,itemRender:h,params:v={}}=e,j=_(e,["prefixCls","separator","style","className","rootClassName","routes","items","children","itemRender","params"]),{getPrefixCls:x,direction:E,breadcrumb:k}=l.useContext(p.E_),N=x("breadcrumb",r),[$,P]=S(N),T=(0,l.useMemo)(()=>b||(d?d.map(C):null),[b,d]),R=(e,t,r,n,l)=>{if(h)return h(e,t,r,n);let o=function(e,t){if(void 0===e.title||null===e.title)return null;let r=Object.keys(t).join("|");return"object"==typeof e.title?e.title:String(e.title).replace(RegExp(`:(${r})`,"g"),(e,r)=>t[r]||e)}(e,t);return g(N,e,o,l)};if(T&&T.length>0){let e=[],r=b||d;t=T.map((t,o)=>{let{path:a,key:i,type:s,menu:u,overlay:p,onClick:m,className:d,separator:b,dropdownProps:g}=t,O=w(v,a);void 0!==O&&e.push(O);let h=null!=i?i:o;if("separator"===s)return l.createElement(f,{key:h},b);let j={},x=o===T.length-1;u?j.menu=u:p&&(j.overlay=p);let{href:E}=t;return e.length&&void 0!==O&&(E=`#/${e.join("/")}`),l.createElement(y,Object.assign({key:h},j,(0,c.Z)(t,{data:!0,aria:!0}),{className:d,dropdownProps:g,href:E,separator:x?"":n,onClick:m,prefixCls:N}),R(t,v,r,e,E))})}else if(O){let e=(0,s.Z)(O).length;t=(0,s.Z)(O).map((t,r)=>t?(0,u.Tm)(t,{separator:r===e-1?"":n,key:r}):t)}let I=i()(N,null==k?void 0:k.className,{[`${N}-rtl`]:"rtl"===E},a,m,P),X=Object.assign(Object.assign({},null==k?void 0:k.style),o);return $(l.createElement("nav",Object.assign({className:I,style:X},j),l.createElement("ol",null,t)))};N.Item=h,N.Separator=f;var $=r(85813),P=r(32983),T=r(67421),R=r(50489),I=r(92039),X=function(){let e=(0,o.useRouter)(),{t}=(0,T.$G)(),[r,a]=(0,l.useState)([]),{query:{id:i,knowledgeName:s}}=(0,o.useRouter)(),c=async()=>{let[e,t]=await (0,R.Vx)((0,R.gV)(s,{document_id:i,page:1,page_size:20}));a(null==t?void 0:t.data)};return(0,l.useEffect)(()=>{s&&i&&c()},[i,s]),(0,n.jsxs)("div",{className:"h-full overflow-y-scroll",children:[(0,n.jsx)(N,{className:"m-6",items:[{title:"Knowledge",onClick(){e.back()},path:"/knowledge"},{title:s}]}),(null==r?void 0:r.length)>0?null==r?void 0:r.map((e,r)=>(0,n.jsxs)($.Z,{title:(0,n.jsxs)(n.Fragment,{children:[(0,I._)(e.doc_type),(0,n.jsx)("span",{children:e.doc_name})]}),children:[(0,n.jsxs)("p",{className:"font-semibold",children:[t("Content"),":"]}),(0,n.jsx)("p",{children:null==e?void 0:e.content}),(0,n.jsxs)("p",{className:"font-semibold",children:[t("Meta_Data"),": "]}),(0,n.jsx)("p",{children:null==e?void 0:e.meta_info})]},r)):(0,n.jsx)(P.Z,{image:P.Z.PRESENTED_IMAGE_DEFAULT})]})}}},function(e){e.O(0,[885,44,479,365,442,813,924,104,747,774,888,179],function(){return e(e.s=54068)}),_N_E=e.O()}]); \ No newline at end of file + `]:{marginInlineStart:e.marginXXS}},[`${t}-overlay-link`]:{borderRadius:e.borderRadiusSM,height:e.lineHeight*e.fontSize,display:"inline-block",padding:`0 ${e.paddingXXS}px`,marginInline:-e.marginXXS,[`> ${r}`]:{marginInlineStart:e.marginXXS,fontSize:e.fontSizeIcon},"&:hover":{color:e.linkHoverColor,backgroundColor:e.colorBgTextHover,a:{color:e.linkHoverColor}},a:{"&:hover":{backgroundColor:"transparent"}}},[`&${e.componentCls}-rtl`]:{direction:"rtl"}})}};var S=(0,j.Z)("Breadcrumb",e=>{let t=(0,x.TS)(e,{});return[E(t)]},e=>({itemColor:e.colorTextDescription,lastItemColor:e.colorText,iconFontSize:e.fontSize,linkColor:e.colorTextDescription,linkHoverColor:e.colorText,separatorColor:e.colorTextDescription,separatorMargin:e.marginXS})),k=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var l=0,n=Object.getOwnPropertySymbols(e);lt.indexOf(n[l])&&Object.prototype.propertyIsEnumerable.call(e,n[l])&&(r[n[l]]=e[n[l]]);return r};function C(e){let{breadcrumbName:t,children:r}=e,n=k(e,["breadcrumbName","children"]),l=Object.assign({title:t},n);return r&&(l.menu={items:r.map(e=>{var{breadcrumbName:t}=e;return Object.assign(Object.assign({},k(e,["breadcrumbName"])),{title:t})})}),l}var _=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var l=0,n=Object.getOwnPropertySymbols(e);lt.indexOf(n[l])&&Object.prototype.propertyIsEnumerable.call(e,n[l])&&(r[n[l]]=e[n[l]]);return r};let w=(e,t)=>{if(void 0===t)return t;let r=(t||"").replace(/^\//,"");return Object.keys(e).forEach(t=>{r=r.replace(`:${t}`,e[t])}),r},N=e=>{let t;let{prefixCls:r,separator:n="/",style:o,className:a,rootClassName:m,routes:d,items:b,children:O,itemRender:h,params:v={}}=e,j=_(e,["prefixCls","separator","style","className","rootClassName","routes","items","children","itemRender","params"]),{getPrefixCls:x,direction:E,breadcrumb:k}=l.useContext(p.E_),N=x("breadcrumb",r),[$,P]=S(N),T=(0,l.useMemo)(()=>b||(d?d.map(C):null),[b,d]),R=(e,t,r,n,l)=>{if(h)return h(e,t,r,n);let o=function(e,t){if(void 0===e.title||null===e.title)return null;let r=Object.keys(t).join("|");return"object"==typeof e.title?e.title:String(e.title).replace(RegExp(`:(${r})`,"g"),(e,r)=>t[r]||e)}(e,t);return g(N,e,o,l)};if(T&&T.length>0){let e=[],r=b||d;t=T.map((t,o)=>{let{path:a,key:i,type:s,menu:u,overlay:p,onClick:m,className:d,separator:b,dropdownProps:g}=t,O=w(v,a);void 0!==O&&e.push(O);let h=null!=i?i:o;if("separator"===s)return l.createElement(f,{key:h},b);let j={},x=o===T.length-1;u?j.menu=u:p&&(j.overlay=p);let{href:E}=t;return e.length&&void 0!==O&&(E=`#/${e.join("/")}`),l.createElement(y,Object.assign({key:h},j,(0,c.Z)(t,{data:!0,aria:!0}),{className:d,dropdownProps:g,href:E,separator:x?"":n,onClick:m,prefixCls:N}),R(t,v,r,e,E))})}else if(O){let e=(0,s.Z)(O).length;t=(0,s.Z)(O).map((t,r)=>t?(0,u.Tm)(t,{separator:r===e-1?"":n,key:r}):t)}let I=i()(N,null==k?void 0:k.className,{[`${N}-rtl`]:"rtl"===E},a,m,P),X=Object.assign(Object.assign({},null==k?void 0:k.style),o);return $(l.createElement("nav",Object.assign({className:I,style:X},j),l.createElement("ol",null,t)))};N.Item=h,N.Separator=f;var $=r(85813),P=r(32983),T=r(67421),R=r(50489),I=r(92039),X=function(){let e=(0,o.useRouter)(),{t}=(0,T.$G)(),[r,a]=(0,l.useState)([]),{query:{id:i,knowledgeName:s}}=(0,o.useRouter)(),c=async()=>{let[e,t]=await (0,R.Vx)((0,R.gV)(s,{document_id:i,page:1,page_size:20}));a(null==t?void 0:t.data)};return(0,l.useEffect)(()=>{s&&i&&c()},[i,s]),(0,n.jsxs)("div",{className:"h-full overflow-y-scroll",children:[(0,n.jsx)(N,{className:"m-6",items:[{title:"Knowledge",onClick(){e.back()},path:"/knowledge"},{title:s}]}),(null==r?void 0:r.length)>0?null==r?void 0:r.map(e=>(0,n.jsxs)($.Z,{title:(0,n.jsxs)(n.Fragment,{children:[(0,I._)(e.doc_type),(0,n.jsx)("span",{children:e.doc_name})]}),children:[(0,n.jsxs)("p",{className:"font-semibold",children:[t("Content"),":"]}),(0,n.jsx)("p",{children:null==e?void 0:e.content}),(0,n.jsxs)("p",{className:"font-semibold",children:[t("Meta_Data"),": "]}),(0,n.jsx)("p",{children:null==e?void 0:e.meta_info})]},e.id)):(0,n.jsx)(P.Z,{image:P.Z.PRESENTED_IMAGE_DEFAULT})]})}}},function(e){e.O(0,[885,44,479,365,442,813,924,104,747,774,888,179],function(){return e(e.s=54068)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/pilot/server/static/_next/static/chunks/pages/models-58b1d88132bdc672.js b/pilot/server/static/_next/static/chunks/pages/models-58b1d88132bdc672.js new file mode 100644 index 000000000..b0895609e --- /dev/null +++ b/pilot/server/static/_next/static/chunks/pages/models-58b1d88132bdc672.js @@ -0,0 +1,7 @@ +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[495],{22624:function(e,t,n){"use strict";var r=n(64836);t.Z=void 0;var l=r(n(64938)),a=n(85893),o=(0,l.default)([(0,a.jsx)("circle",{cx:"15.5",cy:"9.5",r:"1.5"},"0"),(0,a.jsx)("circle",{cx:"8.5",cy:"9.5",r:"1.5"},"1"),(0,a.jsx)("circle",{cx:"15.5",cy:"9.5",r:"1.5"},"2"),(0,a.jsx)("circle",{cx:"8.5",cy:"9.5",r:"1.5"},"3"),(0,a.jsx)("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8zm0-2.5c2.33 0 4.32-1.45 5.12-3.5h-1.67c-.69 1.19-1.97 2-3.45 2s-2.75-.81-3.45-2H6.88c.8 2.05 2.79 3.5 5.12 3.5z"},"4")],"SentimentSatisfiedAlt");t.Z=o},49769:function(e,t,n){"use strict";var r=n(64836);t.Z=void 0;var l=r(n(64938)),a=n(85893),o=(0,l.default)([(0,a.jsx)("circle",{cx:"15.5",cy:"9.5",r:"1.5"},"0"),(0,a.jsx)("circle",{cx:"8.5",cy:"9.5",r:"1.5"},"1"),(0,a.jsx)("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8zm0-6c-2.33 0-4.32 1.45-5.12 3.5h1.67c.69-1.19 1.97-2 3.45-2s2.75.81 3.45 2h1.67c-.8-2.05-2.79-3.5-5.12-3.5z"},"2")],"SentimentVeryDissatisfied");t.Z=o},98034:function(e,t,n){"use strict";var r=n(64836);t.Z=void 0;var l=r(n(64938)),a=n(85893),o=(0,l.default)((0,a.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm4 14H8V8h8v8z"}),"StopCircle");t.Z=o},64938:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return r.createSvgIcon}});var r=n(52869)},52869:function(e,t,n){"use strict";n.r(t),n.d(t,{capitalize:function(){return l.Z},createChainedFunction:function(){return a},createSvgIcon:function(){return o.Z},debounce:function(){return i},deprecatedPropType:function(){return s},isMuiElement:function(){return c},ownerDocument:function(){return d},ownerWindow:function(){return u},requirePropFactory:function(){return p},setRef:function(){return m},unstable_ClassNameGenerator:function(){return j},unstable_useEnhancedEffect:function(){return f},unstable_useId:function(){return h},unsupportedProp:function(){return b},useControlled:function(){return x},useEventCallback:function(){return v},useForkRef:function(){return g},useIsFocusVisible:function(){return y}});var r=n(37078),l=n(98216),a=function(...e){return e.reduce((e,t)=>null==t?e:function(...n){e.apply(this,n),t.apply(this,n)},()=>{})},o=n(34678),i=n(39336).Z,s=function(e,t){return()=>null},c=n(18719).Z,d=n(82690).Z,u=n(74161).Z;n(87462);var p=function(e,t){return()=>null},m=n(7960).Z,f=n(73546).Z,h=n(92996).Z,b=function(e,t,n,r,l){return null},x=n(19032).Z,v=n(59948).Z,g=n(33703).Z,y=n(99962).Z;let j={configure:e=>{r.Z.configure(e)}}},84567:function(e,t,n){"use strict";n.d(t,{Z:function(){return j}});var r=n(94184),l=n.n(r),a=n(50132),o=n(67294),i=n(53124),s=n(98866),c=n(65223);let d=o.createContext(null);var u=n(63185),p=n(45353),m=n(17415),f=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var l=0,r=Object.getOwnPropertySymbols(e);lt.indexOf(r[l])&&Object.prototype.propertyIsEnumerable.call(e,r[l])&&(n[r[l]]=e[r[l]]);return n};let h=o.forwardRef((e,t)=>{var n;let{prefixCls:r,className:h,rootClassName:b,children:x,indeterminate:v=!1,style:g,onMouseEnter:y,onMouseLeave:j,skipGroup:C=!1,disabled:w}=e,k=f(e,["prefixCls","className","rootClassName","children","indeterminate","style","onMouseEnter","onMouseLeave","skipGroup","disabled"]),{getPrefixCls:$,direction:_,checkbox:S}=o.useContext(i.E_),Z=o.useContext(d),{isFormItemInput:N}=o.useContext(c.aM),O=o.useContext(s.Z),E=null!==(n=(null==Z?void 0:Z.disabled)||w)&&void 0!==n?n:O,P=o.useRef(k.value);o.useEffect(()=>{null==Z||Z.registerValue(k.value)},[]),o.useEffect(()=>{if(!C)return k.value!==P.current&&(null==Z||Z.cancelValue(P.current),null==Z||Z.registerValue(k.value),P.current=k.value),()=>null==Z?void 0:Z.cancelValue(k.value)},[k.value]);let M=$("checkbox",r),[I,z]=(0,u.ZP)(M),V=Object.assign({},k);Z&&!C&&(V.onChange=function(){k.onChange&&k.onChange.apply(k,arguments),Z.toggleOption&&Z.toggleOption({label:x,value:k.value})},V.name=Z.name,V.checked=Z.value.includes(k.value));let D=l()(`${M}-wrapper`,{[`${M}-rtl`]:"rtl"===_,[`${M}-wrapper-checked`]:V.checked,[`${M}-wrapper-disabled`]:E,[`${M}-wrapper-in-form-item`]:N},null==S?void 0:S.className,h,b,z),F=l()({[`${M}-indeterminate`]:v},m.A,z);return I(o.createElement(p.Z,{component:"Checkbox",disabled:E},o.createElement("label",{className:D,style:Object.assign(Object.assign({},null==S?void 0:S.style),g),onMouseEnter:y,onMouseLeave:j},o.createElement(a.Z,Object.assign({"aria-checked":v?"mixed":void 0},V,{prefixCls:M,className:F,disabled:E,ref:t})),void 0!==x&&o.createElement("span",null,x))))});var b=n(74902),x=n(98423),v=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var l=0,r=Object.getOwnPropertySymbols(e);lt.indexOf(r[l])&&Object.prototype.propertyIsEnumerable.call(e,r[l])&&(n[r[l]]=e[r[l]]);return n};let g=o.forwardRef((e,t)=>{let{defaultValue:n,children:r,options:a=[],prefixCls:s,className:c,rootClassName:p,style:m,onChange:f}=e,g=v(e,["defaultValue","children","options","prefixCls","className","rootClassName","style","onChange"]),{getPrefixCls:y,direction:j}=o.useContext(i.E_),[C,w]=o.useState(g.value||n||[]),[k,$]=o.useState([]);o.useEffect(()=>{"value"in g&&w(g.value||[])},[g.value]);let _=o.useMemo(()=>a.map(e=>"string"==typeof e||"number"==typeof e?{label:e,value:e}:e),[a]),S=y("checkbox",s),Z=`${S}-group`,[N,O]=(0,u.ZP)(S),E=(0,x.Z)(g,["value","disabled"]),P=a.length?_.map(e=>o.createElement(h,{prefixCls:S,key:e.value.toString(),disabled:"disabled"in e?e.disabled:g.disabled,value:e.value,checked:C.includes(e.value),onChange:e.onChange,className:`${Z}-item`,style:e.style,title:e.title},e.label)):r,M={toggleOption:e=>{let t=C.indexOf(e.value),n=(0,b.Z)(C);-1===t?n.push(e.value):n.splice(t,1),"value"in g||w(n),null==f||f(n.filter(e=>k.includes(e)).sort((e,t)=>{let n=_.findIndex(t=>t.value===e),r=_.findIndex(e=>e.value===t);return n-r}))},value:C,disabled:g.disabled,name:g.name,registerValue:e=>{$(t=>[].concat((0,b.Z)(t),[e]))},cancelValue:e=>{$(t=>t.filter(t=>t!==e))}},I=l()(Z,{[`${Z}-rtl`]:"rtl"===j},c,p,O);return N(o.createElement("div",Object.assign({className:I,style:m},E,{ref:t}),o.createElement(d.Provider,{value:M},P)))});var y=o.memo(g);h.Group=y,h.__ANT_CHECKBOX=!0;var j=h},63185:function(e,t,n){"use strict";n.d(t,{C2:function(){return i}});var r=n(14747),l=n(45503),a=n(67968);let o=e=>{let{checkboxCls:t}=e,n=`${t}-wrapper`;return[{[`${t}-group`]:Object.assign(Object.assign({},(0,r.Wf)(e)),{display:"inline-flex",flexWrap:"wrap",columnGap:e.marginXS,[`> ${e.antCls}-row`]:{flex:1}}),[n]:Object.assign(Object.assign({},(0,r.Wf)(e)),{display:"inline-flex",alignItems:"baseline",cursor:"pointer","&:after":{display:"inline-block",width:0,overflow:"hidden",content:"'\\a0'"},[`& + ${n}`]:{marginInlineStart:0},[`&${n}-in-form-item`]:{'input[type="checkbox"]':{width:14,height:14}}}),[t]:Object.assign(Object.assign({},(0,r.Wf)(e)),{position:"relative",whiteSpace:"nowrap",lineHeight:1,cursor:"pointer",borderRadius:e.borderRadiusSM,alignSelf:"center",[`${t}-input`]:{position:"absolute",inset:0,zIndex:1,cursor:"pointer",opacity:0,margin:0,[`&:focus-visible + ${t}-inner`]:Object.assign({},(0,r.oN)(e))},[`${t}-inner`]:{boxSizing:"border-box",position:"relative",top:0,insetInlineStart:0,display:"block",width:e.checkboxSize,height:e.checkboxSize,direction:"ltr",backgroundColor:e.colorBgContainer,border:`${e.lineWidth}px ${e.lineType} ${e.colorBorder}`,borderRadius:e.borderRadiusSM,borderCollapse:"separate",transition:`all ${e.motionDurationSlow}`,"&:after":{boxSizing:"border-box",position:"absolute",top:"50%",insetInlineStart:"21.5%",display:"table",width:e.checkboxSize/14*5,height:e.checkboxSize/14*8,border:`${e.lineWidthBold}px solid ${e.colorWhite}`,borderTop:0,borderInlineStart:0,transform:"rotate(45deg) scale(0) translate(-50%,-50%)",opacity:0,content:'""',transition:`all ${e.motionDurationFast} ${e.motionEaseInBack}, opacity ${e.motionDurationFast}`}},"& + span":{paddingInlineStart:e.paddingXS,paddingInlineEnd:e.paddingXS}})},{[` + ${n}:not(${n}-disabled), + ${t}:not(${t}-disabled) + `]:{[`&:hover ${t}-inner`]:{borderColor:e.colorPrimary}},[`${n}:not(${n}-disabled)`]:{[`&:hover ${t}-checked:not(${t}-disabled) ${t}-inner`]:{backgroundColor:e.colorPrimaryHover,borderColor:"transparent"},[`&:hover ${t}-checked:not(${t}-disabled):after`]:{borderColor:e.colorPrimaryHover}}},{[`${t}-checked`]:{[`${t}-inner`]:{backgroundColor:e.colorPrimary,borderColor:e.colorPrimary,"&:after":{opacity:1,transform:"rotate(45deg) scale(1) translate(-50%,-50%)",transition:`all ${e.motionDurationMid} ${e.motionEaseOutBack} ${e.motionDurationFast}`}}},[` + ${n}-checked:not(${n}-disabled), + ${t}-checked:not(${t}-disabled) + `]:{[`&:hover ${t}-inner`]:{backgroundColor:e.colorPrimaryHover,borderColor:"transparent"}}},{[t]:{"&-indeterminate":{[`${t}-inner`]:{backgroundColor:e.colorBgContainer,borderColor:e.colorBorder,"&:after":{top:"50%",insetInlineStart:"50%",width:e.fontSizeLG/2,height:e.fontSizeLG/2,backgroundColor:e.colorPrimary,border:0,transform:"translate(-50%, -50%) scale(1)",opacity:1,content:'""'}}}}},{[`${n}-disabled`]:{cursor:"not-allowed"},[`${t}-disabled`]:{[`&, ${t}-input`]:{cursor:"not-allowed",pointerEvents:"none"},[`${t}-inner`]:{background:e.colorBgContainerDisabled,borderColor:e.colorBorder,"&:after":{borderColor:e.colorTextDisabled}},"&:after":{display:"none"},"& + span":{color:e.colorTextDisabled},[`&${t}-indeterminate ${t}-inner::after`]:{background:e.colorTextDisabled}}}]};function i(e,t){let n=(0,l.TS)(t,{checkboxCls:`.${e}`,checkboxSize:t.controlInteractiveSize});return[o(n)]}t.ZP=(0,a.Z)("Checkbox",(e,t)=>{let{prefixCls:n}=t;return[i(n,e)]})},80476:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/models",function(){return n(93167)}])},81799:function(e,t,n){"use strict";n.d(t,{A:function(){return u}});var r=n(85893),l=n(41468),a=n(51009),o=n(19284),i=n(25675),s=n.n(i),c=n(67294),d=n(67421);function u(e,t){var n;let{width:l,height:a}=t||{};return e?(0,r.jsx)(s(),{className:"rounded-full border border-gray-200 object-contain bg-white inline-block",width:l||24,height:a||24,src:(null===(n=o.F[e])||void 0===n?void 0:n.icon)||"/models/huggingface.svg",alt:"llm"}):null}t.Z=function(e){let{onChange:t}=e,{t:n}=(0,d.$G)(),{modelList:i,model:s}=(0,c.useContext)(l.p);return!i||i.length<=0?null:(0,r.jsx)(a.default,{value:s,placeholder:n("choose_model"),className:"w-52",onChange:e=>{null==t||t(e)},children:i.map(e=>{var t;return(0,r.jsx)(a.default.Option,{children:(0,r.jsxs)("div",{className:"flex items-center",children:[u(e),(0,r.jsx)("span",{className:"ml-2",children:(null===(t=o.F[e])||void 0===t?void 0:t.label)||e})]})},e)})})}},93167:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return _}});var r=n(85893),l=n(50489),a=n(67294),o=n(67421),i=n(22624),s=n(49769),c=n(98034),d=n(2453),u=n(83062),p=n(30381),m=n.n(p),f=n(81799),h=function(e){let{info:t}=e,{t:n}=(0,o.$G)(),[p,h]=(0,a.useState)(!1);async function b(e){if(p)return;h(!0);let[,t]=await (0,l.Vx)((0,l.kU)({host:e.host,port:e.port,model:e.model_name,worker_type:e.model_type,params:{}}));h(!1),!0===t&&d.ZP.success(n("stop_model_success"))}return(0,r.jsx)("div",{className:"relative flex flex-col py-4 px-4 sm:w-1/2 lg:w-1/3 min-w-min rounded-lg justify-between text-black bg-white border-gray-200 border hover:shadow-md dark:border-gray-600 dark:bg-black dark:text-white dark:hover:border-white transition-all",children:(0,r.jsx)("div",{className:"flex items-center",children:(0,r.jsxs)("div",{className:"flex flex-col",children:[t.healthy&&(0,r.jsx)(u.Z,{title:"Healthy",children:(0,r.jsx)(i.Z,{className:"absolute top-4 right-4 !text-3xl !text-green-600"})}),!t.healthy&&(0,r.jsx)(u.Z,{title:"Unhealthy",children:(0,r.jsx)(s.Z,{className:"absolute top-4 right-4 !text-3xl !text-red-600"})}),(0,r.jsx)(u.Z,{title:"Stop Model",children:(0,r.jsx)(c.Z,{className:"absolute right-4 bottom-4 !text-3xl !text-orange-600 cursor-pointer",onClick:()=>{b(t)}})}),(0,r.jsxs)("div",{className:"flex items-center",children:[(0,f.A)(t.model_name,{width:32,height:32}),(0,r.jsxs)("div",{className:"inline-block ml-2",children:[(0,r.jsx)("h3",{className:"text-lg font-semibold",children:t.model_name}),(0,r.jsx)("h3",{className:"text-sm text-gray-800 dark:text-gray-400",children:t.model_type})]})]}),(0,r.jsxs)("div",{className:"text-sm mt-2",children:[(0,r.jsx)("p",{className:"font-semibold",children:"Host:"}),(0,r.jsx)("p",{className:"text-gray-600",children:t.host}),(0,r.jsx)("p",{className:"font-semibold mt-2",children:"Manage host:"}),(0,r.jsxs)("p",{className:"text-gray-600",children:[(0,r.jsxs)("span",{children:[t.manager_host,":"]}),(0,r.jsx)("span",{children:t.manager_port})]}),(0,r.jsx)("p",{className:"font-semibold mt-2",children:"Last heart beat:"}),(0,r.jsx)("p",{className:"text-gray-600",children:m()(t.last_heartbeat).format("YYYY-MM-DD HH:MM:SS")})]})]})})})},b=n(51009),x=n(39479),v=n(71577),g=n(59566),y=n(48928),j=n(84567),C=function(e){let{params:t,form:n}=e;return((0,a.useEffect)(()=>{if(t){let e={};t.forEach(t=>{e[t.param_name]=t.default_value}),n.setFieldsValue(e)}},[t,n]),!t||(null==t?void 0:t.length)<1)?null:(0,r.jsx)(r.Fragment,{children:null==t?void 0:t.map(e=>{var t;return(0,r.jsx)(x.Z.Item,{label:(0,r.jsx)("p",{className:"whitespace-normal overflow-wrap-break-word",children:(null===(t=e.description)||void 0===t?void 0:t.length)>20?e.param_name:e.description}),name:e.param_name,initialValue:e.default_value,valuePropName:"bool"===e.param_type?"checked":"value",tooltip:e.description,rules:[{required:e.required,message:"Please input ".concat(e.description)}],children:function(e){switch(e.param_type){case"str":return(0,r.jsx)(g.default,{});case"int":return(0,r.jsx)(y.Z,{});case"bool":return(0,r.jsx)(j.Z,{})}}(e)},e.param_name)})})};let{Option:w}=b.default;var k=function(e){let{onCancel:t,onSuccess:n}=e,{t:i}=(0,o.$G)(),[s,c]=(0,a.useState)([]),[p,m]=(0,a.useState)(),[h,g]=(0,a.useState)(null),[y]=x.Z.useForm();async function j(){let[,e]=await (0,l.Vx)((0,l.xv)());e&&e.length&&c(e.sort((e,t)=>e.enabled&&!t.enabled?-1:!e.enabled&&t.enabled?1:e.model.localeCompare(t.model))),c(e)}async function k(e){if(!p)return;delete e.model;let[,t]=await (0,l.Vx)((0,l.vA)({host:p.host,port:p.port,model:p.model,worker_type:null==p?void 0:p.worker_type,params:e}));if(!0===t)return n(),d.ZP.success(i("start_model_success"))}return(0,a.useEffect)(()=>{j()},[]),(0,r.jsx)("div",{className:"",children:(0,r.jsxs)(x.Z,{labelCol:{span:8},wrapperCol:{span:16},onFinish:k,form:y,children:[(0,r.jsx)(x.Z.Item,{label:"Model",name:"model",rules:[{required:!0,message:i("model_select_tips")}],children:(0,r.jsx)(b.default,{showSearch:!0,onChange:function(e,t){m(t.model),g(t.model.params)},children:null==s?void 0:s.map(e=>(0,r.jsxs)(w,{value:e.model,label:e.model,model:e,disabled:!e.enabled,children:[(0,f.A)(e.model),(0,r.jsx)(u.Z,{title:e.enabled?e.model:i("download_model_tip"),children:(0,r.jsx)("span",{className:"ml-2",children:e.model})}),(0,r.jsx)(u.Z,{title:e.enabled?"".concat(e.host,":").concat(e.port):i("download_model_tip"),children:(0,r.jsxs)("p",{className:"inline-block absolute right-4",children:[(0,r.jsxs)("span",{children:[e.host,":"]}),(0,r.jsx)("span",{children:e.port})]})})]},e.model))})}),(0,r.jsx)(C,{params:h,form:y}),(0,r.jsxs)("div",{className:"flex justify-center",children:[(0,r.jsx)(v.ZP,{type:"primary",htmlType:"submit",children:i("submit")}),(0,r.jsx)(v.ZP,{className:"ml-10",onClick:t,children:"Cancel"})]})]})})},$=n(12069),_=function(){let{t:e}=(0,o.$G)(),[t,n]=(0,a.useState)([]),[i,s]=(0,a.useState)(!1);async function c(){let[,e]=await (0,l.Vx)((0,l.fZ)());n(null!=e?e:[])}return(0,a.useEffect)(()=>{c()},[]),(0,r.jsxs)("div",{className:"p-8 h-full",children:[(0,r.jsx)(v.ZP,{className:"mb-8",type:"primary",onClick:()=>{s(!0)},children:e("create_model")}),(0,r.jsx)("div",{className:"flex flex-wrap gap-4",children:t.map(e=>(0,r.jsx)(h,{info:e},e.model_name))}),(0,r.jsx)($.default,{width:800,open:i,title:e("create_model"),onCancel:()=>{s(!1)},footer:null,children:(0,r.jsx)(k,{onCancel:()=>{s(!1)},onSuccess:()=>{s(!1),c()}})})]})}},64836:function(e){e.exports=function(e){return e&&e.__esModule?e:{default:e}},e.exports.__esModule=!0,e.exports.default=e.exports}},function(e){e.O(0,[885,44,479,9,815,928,774,888,179],function(){return e(e.s=80476)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/pilot/server/static/_next/static/chunks/pages/models-cb013d8fe1f7d0c2.js b/pilot/server/static/_next/static/chunks/pages/models-cb013d8fe1f7d0c2.js deleted file mode 100644 index 1e36a56fa..000000000 --- a/pilot/server/static/_next/static/chunks/pages/models-cb013d8fe1f7d0c2.js +++ /dev/null @@ -1 +0,0 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[495],{80476:function(e,l,a){(window.__NEXT_P=window.__NEXT_P||[]).push(["/models",function(){return a(93167)}])},48567:function(e,l,a){"use strict";a.d(l,{Z:function(){return u},A:function(){return m}});var n=a(85893),t=a(41468),s=a(51009);let o={proxyllm:{label:"Proxy LLM",icon:"/models/chatgpt.png"},"flan-t5-base":{label:"flan-t5-base",icon:"/models/google.png"},"vicuna-13b":{label:"vicuna-13b",icon:"/models/vicuna.jpeg"},"vicuna-7b":{label:"vicuna-7b",icon:"/models/vicuna.jpeg"},"vicuna-13b-v1.5":{label:"vicuna-13b-v1.5",icon:"/models/vicuna.jpeg"},"vicuna-7b-v1.5":{label:"vicuna-7b-v1.5",icon:"/models/vicuna.jpeg"},"codegen2-1b":{label:"codegen2-1B",icon:"/models/vicuna.jpeg"},"codet5p-2b":{label:"codet5p-2b",icon:"/models/vicuna.jpeg"},"chatglm-6b-int4":{label:"chatglm-6b-int4",icon:"/models/chatglm.png"},"chatglm-6b":{label:"chatglm-6b",icon:"/models/chatglm.png"},"chatglm2-6b":{label:"chatglm2-6b",icon:"/models/chatglm.png"},"chatglm2-6b-int4":{label:"chatglm2-6b-int4",icon:"/models/chatglm.png"},"guanaco-33b-merged":{label:"guanaco-33b-merged",icon:"/models/huggingface.svg"},"falcon-40b":{label:"falcon-40b",icon:"/models/falcon.jpeg"},"gorilla-7b":{label:"gorilla-7b",icon:"/models/gorilla.png"},"gptj-6b":{label:"ggml-gpt4all-j-v1.3-groovy.bin",icon:""},chatgpt_proxyllm:{label:"chatgpt_proxyllm",icon:"/models/chatgpt.png"},bard_proxyllm:{label:"bard_proxyllm",icon:"/models/bard.gif"},claude_proxyllm:{label:"claude_proxyllm",icon:"/models/claude.png"},wenxin_proxyllm:{label:"wenxin_proxyllm",icon:""},tongyi_proxyllm:{label:"tongyi_proxyllm",icon:"/models/qwen2.png"},zhipu_proxyllm:{label:"zhipu_proxyllm",icon:"/models/zhipu.png"},"llama-2-7b":{label:"Llama-2-7b-chat-hf",icon:"/models/llama.jpg"},"llama-2-13b":{label:"Llama-2-13b-chat-hf",icon:"/models/llama.jpg"},"llama-2-70b":{label:"Llama-2-70b-chat-hf",icon:"/models/llama.jpg"},"baichuan-13b":{label:"Baichuan-13B-Chat",icon:"/models/baichuan.png"},"baichuan-7b":{label:"baichuan-7b",icon:"/models/baichuan.png"},"baichuan2-7b":{label:"Baichuan2-7B-Chat",icon:"/models/baichuan.png"},"baichuan2-13b":{label:"Baichuan2-13B-Chat",icon:"/models/baichuan.png"},"wizardlm-13b":{label:"WizardLM-13B-V1.2",icon:"/models/wizardlm.png"},"llama-cpp":{label:"ggml-model-q4_0.bin",icon:"/models/huggingface.svg"},"internlm-7b":{label:"internlm-chat-7b-v1_1",icon:"/models/internlm.png"},"internlm-7b-8k":{label:"internlm-chat-7b-8k",icon:"/models/internlm.png"}};var i=a(25675),c=a.n(i),r=a(67294),d=a(67421);function m(e,l){var a;let{width:t,height:s}=l||{};return e?(0,n.jsx)(c(),{className:"rounded-full border border-gray-200 object-contain bg-white inline-block",width:t||24,height:s||24,src:(null===(a=o[e])||void 0===a?void 0:a.icon)||"/models/huggingface.svg",alt:"llm"}):null}var u=function(e){let{onChange:l}=e,{t:a}=(0,d.$G)(),{modelList:i,model:c}=(0,r.useContext)(t.p);return!i||i.length<=0?null:(0,n.jsx)(s.default,{value:c,placeholder:a("choose_model"),className:"w-52",onChange:e=>{null==l||l(e)},children:i.map(e=>{var l;return(0,n.jsx)(s.default.Option,{children:(0,n.jsxs)("div",{className:"flex items-center",children:[m(e),(0,n.jsx)("span",{className:"ml-2",children:(null===(l=o[e])||void 0===l?void 0:l.label)||e})]})},e)})})}},93167:function(e,l,a){"use strict";a.r(l),a.d(l,{default:function(){return Z}});var n=a(85893),t=a(50489),s=a(67294),o=a(67421),i=a(22624),c=a(49769),r=a(98034),d=a(2453),m=a(83062),u=a(30381),h=a.n(u),b=a(48567),p=function(e){let{info:l}=e,{t:a}=(0,o.$G)(),[u,p]=(0,s.useState)(!1);async function g(e){if(u)return;p(!0);let[,l]=await (0,t.Vx)((0,t.kU)({host:e.host,port:e.port,model:e.model_name,worker_type:e.model_type,params:{}}));p(!1),!0===l&&d.ZP.success(a("stop_model_success"))}return(0,n.jsx)("div",{className:"relative flex flex-col py-4 px-4 sm:w-1/2 lg:w-1/3 min-w-min rounded-lg justify-between text-black bg-white border-gray-200 border hover:shadow-md dark:border-gray-600 dark:bg-black dark:text-white dark:hover:border-white transition-all",children:(0,n.jsx)("div",{className:"flex items-center",children:(0,n.jsxs)("div",{className:"flex flex-col",children:[l.healthy&&(0,n.jsx)(m.Z,{title:"Healthy",children:(0,n.jsx)(i.Z,{className:"absolute top-4 right-4 !text-3xl !text-green-600"})}),!l.healthy&&(0,n.jsx)(m.Z,{title:"Unhealthy",children:(0,n.jsx)(c.Z,{className:"absolute top-4 right-4 !text-3xl !text-red-600"})}),(0,n.jsx)(m.Z,{title:"Stop Model",children:(0,n.jsx)(r.Z,{className:"absolute right-4 bottom-4 !text-3xl !text-orange-600 cursor-pointer",onClick:()=>{g(l)}})}),(0,n.jsxs)("div",{className:"flex items-center",children:[(0,b.A)(l.model_name,{width:32,height:32}),(0,n.jsxs)("div",{className:"inline-block ml-2",children:[(0,n.jsx)("h3",{className:"text-lg font-semibold",children:l.model_name}),(0,n.jsx)("h3",{className:"text-sm text-gray-800 dark:text-gray-400",children:l.model_type})]})]}),(0,n.jsxs)("div",{className:"text-sm mt-2",children:[(0,n.jsx)("p",{className:"font-semibold",children:"Host:"}),(0,n.jsx)("p",{className:"text-gray-600",children:l.host}),(0,n.jsx)("p",{className:"font-semibold mt-2",children:"Manage host:"}),(0,n.jsxs)("p",{className:"text-gray-600",children:[(0,n.jsxs)("span",{children:[l.manager_host,":"]}),(0,n.jsx)("span",{children:l.manager_port})]}),(0,n.jsx)("p",{className:"font-semibold mt-2",children:"Last heart beat:"}),(0,n.jsx)("p",{className:"text-gray-600",children:h()(l.last_heartbeat).format("YYYY-MM-DD HH:MM:SS")})]})]})})})},g=a(51009),x=a(39479),f=a(71577),j=a(59566),v=a(48928),_=a(84567),y=function(e){let{params:l,form:a}=e;return((0,s.useEffect)(()=>{if(l){let e={};l.forEach(l=>{e[l.param_name]=l.default_value}),a.setFieldsValue(e)}},[l,a]),!l||(null==l?void 0:l.length)<1)?null:(0,n.jsx)(n.Fragment,{children:null==l?void 0:l.map(e=>{var l;return(0,n.jsx)(x.Z.Item,{label:(0,n.jsx)("p",{className:"whitespace-normal overflow-wrap-break-word",children:(null===(l=e.description)||void 0===l?void 0:l.length)>20?e.param_name:e.description}),name:e.param_name,initialValue:e.default_value,valuePropName:"bool"===e.param_type?"checked":"value",tooltip:e.description,rules:[{required:e.required,message:"Please input ".concat(e.description)}],children:function(e){switch(e.param_type){case"str":return(0,n.jsx)(j.default,{});case"int":return(0,n.jsx)(v.Z,{});case"bool":return(0,n.jsx)(_.Z,{})}}(e)},e.param_name)})})};let{Option:w}=g.default;var N=function(e){let{onCancel:l,onSuccess:a}=e,{t:i}=(0,o.$G)(),[c,r]=(0,s.useState)([]),[u,h]=(0,s.useState)(),[p,j]=(0,s.useState)(null),[v]=x.Z.useForm();async function _(){let[,e]=await (0,t.Vx)((0,t.xv)());e&&e.length&&r(e.sort((e,l)=>e.enabled&&!l.enabled?-1:!e.enabled&&l.enabled?1:e.model.localeCompare(l.model))),r(e)}async function N(e){if(!u)return;delete e.model;let[,l]=await (0,t.Vx)((0,t.vA)({host:u.host,port:u.port,model:u.model,worker_type:null==u?void 0:u.worker_type,params:e}));if(!0===l)return a(),d.ZP.success(i("start_model_success"))}return(0,s.useEffect)(()=>{_()},[]),(0,n.jsx)("div",{className:"",children:(0,n.jsxs)(x.Z,{labelCol:{span:8},wrapperCol:{span:16},onFinish:N,form:v,children:[(0,n.jsx)(x.Z.Item,{label:"Model",name:"model",rules:[{required:!0,message:i("model_select_tips")}],children:(0,n.jsx)(g.default,{showSearch:!0,onChange:function(e,l){h(l.model),j(l.model.params)},children:null==c?void 0:c.map(e=>(0,n.jsxs)(w,{value:e.model,label:e.model,model:e,disabled:!e.enabled,children:[(0,b.A)(e.model),(0,n.jsx)(m.Z,{title:e.enabled?e.model:i("download_model_tip"),children:(0,n.jsx)("span",{className:"ml-2",children:e.model})}),(0,n.jsx)(m.Z,{title:e.enabled?"".concat(e.host,":").concat(e.port):i("download_model_tip"),children:(0,n.jsxs)("p",{className:"inline-block absolute right-4",children:[(0,n.jsxs)("span",{children:[e.host,":"]}),(0,n.jsx)("span",{children:e.port})]})})]},e.model))})}),(0,n.jsx)(y,{params:p,form:v}),(0,n.jsxs)("div",{className:"flex justify-center",children:[(0,n.jsx)(f.ZP,{type:"primary",htmlType:"submit",children:i("submit")}),(0,n.jsx)(f.ZP,{className:"ml-10",onClick:l,children:"Cancel"})]})]})})},k=a(12069),Z=function(){let{t:e}=(0,o.$G)(),[l,a]=(0,s.useState)([]),[i,c]=(0,s.useState)(!1);async function r(){let[,e]=await (0,t.Vx)((0,t.fZ)());a(null!=e?e:[])}return(0,s.useEffect)(()=>{r()},[]),(0,n.jsxs)("div",{className:"p-8 h-full",children:[(0,n.jsx)(f.ZP,{className:"mb-8",type:"primary",onClick:()=>{c(!0)},children:e("create_model")}),(0,n.jsx)("div",{className:"flex flex-wrap gap-4",children:l.map(e=>(0,n.jsx)(p,{info:e},e.model_name))}),(0,n.jsx)(k.default,{width:800,open:i,title:e("create_model"),onCancel:()=>{c(!1)},footer:null,children:(0,n.jsx)(N,{onCancel:()=>{c(!1)},onSuccess:()=>{c(!1),r()}})})]})}}},function(e){e.O(0,[885,44,479,9,815,928,991,774,888,179],function(){return e(e.s=80476)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/pilot/server/static/_next/static/chunks/webpack-ac3f39ddc560768d.js b/pilot/server/static/_next/static/chunks/webpack-2e50ecf954b8023b.js similarity index 56% rename from pilot/server/static/_next/static/chunks/webpack-ac3f39ddc560768d.js rename to pilot/server/static/_next/static/chunks/webpack-2e50ecf954b8023b.js index 52e832914..53726b45d 100644 --- a/pilot/server/static/_next/static/chunks/webpack-ac3f39ddc560768d.js +++ b/pilot/server/static/_next/static/chunks/webpack-2e50ecf954b8023b.js @@ -1 +1 @@ -!function(){"use strict";var e,t,n,r,o,u,c,i,a,f,d,s,l={},b={};function p(e){var t=b[e];if(void 0!==t)return t.exports;var n=b[e]={id:e,loaded:!1,exports:{}},r=!0;try{l[e].call(n.exports,n,n.exports,p),r=!1}finally{r&&delete b[e]}return n.loaded=!0,n.exports}p.m=l,p.amdO={},e=[],p.O=function(t,n,r,o){if(n){o=o||0;for(var u=e.length;u>0&&e[u-1][2]>o;u--)e[u]=e[u-1];e[u]=[n,r,o];return}for(var c=1/0,u=0;u=o&&Object.keys(p.O).every(function(e){return p.O[e](n[a])})?n.splice(a--,1):(i=!1,o0&&e[u-1][2]>o;u--)e[u]=e[u-1];e[u]=[n,r,o];return}for(var i=1/0,u=0;u=o&&Object.keys(p.O).every(function(e){return p.O[e](n[c])})?n.splice(c--,1):(a=!1,o
\ No newline at end of file +
\ No newline at end of file diff --git a/pilot/server/static/chat/[scene]/[id]/index.html b/pilot/server/static/chat/[scene]/[id]/index.html index 76e912dc5..663999144 100644 --- a/pilot/server/static/chat/[scene]/[id]/index.html +++ b/pilot/server/static/chat/[scene]/[id]/index.html @@ -1 +1 @@ -
\ No newline at end of file +
\ No newline at end of file diff --git a/pilot/server/static/chat/index.html b/pilot/server/static/chat/index.html index f1f27534a..9fc16a7a5 100644 --- a/pilot/server/static/chat/index.html +++ b/pilot/server/static/chat/index.html @@ -1 +1 @@ -
\ No newline at end of file +
\ No newline at end of file diff --git a/pilot/server/static/database/index.html b/pilot/server/static/database/index.html index 128690821..35bf9e01a 100644 --- a/pilot/server/static/database/index.html +++ b/pilot/server/static/database/index.html @@ -1 +1 @@ -
MySQL

MySQL

Comming soon

Fast, reliable, scalable open-source relational database management system.

MSSQL

MSSQL

Comming soon

Powerful, scalable, secure relational database system by Microsoft.

DuckDB

DuckDB

Comming soon

In-memory analytical database with efficient query processing.

Sqlite

Sqlite

Comming soon

Lightweight embedded relational database with simplicity and portability.

ClickHouse

ClickHouse

Comming soon

Columnar database for high-performance analytics and real-time queries.

Oracle

Oracle

Comming soon

Robust, scalable, secure relational database widely used in enterprises.

Access

Access

Comming soon

Easy-to-use relational database for small-scale applications by Microsoft.

MongoDB

MongoDB

Comming soon

Flexible, scalable NoSQL document database for web and mobile apps.

DB2

DB2

Comming soon

Scalable, secure relational database system developed by IBM.

HBase

HBase

Comming soon

Distributed, scalable NoSQL database for large structured/semi-structured data.

Redis

Redis

Comming soon

Fast, versatile in-memory data structure store as cache, DB, or broker.

Cassandra

Cassandra

Comming soon

Scalable, fault-tolerant distributed NoSQL database for large data.

Couchbase

Couchbase

Comming soon

High-performance NoSQL document database with distributed architecture.

PostgreSQL

PostgreSQL

Comming soon

Powerful open-source relational database with extensibility and SQL standards.

Spark

Spark

Comming soon

Unified engine for large-scale data analytics.

\ No newline at end of file +
MySQL

MySQL

Comming soon

Fast, reliable, scalable open-source relational database management system.

MSSQL

MSSQL

Comming soon

Powerful, scalable, secure relational database system by Microsoft.

DuckDB

DuckDB

Comming soon

In-memory analytical database with efficient query processing.

Sqlite

Sqlite

Comming soon

Lightweight embedded relational database with simplicity and portability.

ClickHouse

ClickHouse

Comming soon

Columnar database for high-performance analytics and real-time queries.

Oracle

Oracle

Comming soon

Robust, scalable, secure relational database widely used in enterprises.

Access

Access

Comming soon

Easy-to-use relational database for small-scale applications by Microsoft.

MongoDB

MongoDB

Comming soon

Flexible, scalable NoSQL document database for web and mobile apps.

DB2

DB2

Comming soon

Scalable, secure relational database system developed by IBM.

HBase

HBase

Comming soon

Distributed, scalable NoSQL database for large structured/semi-structured data.

Redis

Redis

Comming soon

Fast, versatile in-memory data structure store as cache, DB, or broker.

Cassandra

Cassandra

Comming soon

Scalable, fault-tolerant distributed NoSQL database for large data.

Couchbase

Couchbase

Comming soon

High-performance NoSQL document database with distributed architecture.

PostgreSQL

PostgreSQL

Comming soon

Powerful open-source relational database with extensibility and SQL standards.

Spark

Spark

Comming soon

Unified engine for large-scale data analytics.

\ No newline at end of file diff --git a/pilot/server/static/index.html b/pilot/server/static/index.html index 43f6e9a77..1efdad899 100644 --- a/pilot/server/static/index.html +++ b/pilot/server/static/index.html @@ -1 +1 @@ -
\ No newline at end of file +
\ No newline at end of file diff --git a/pilot/server/static/knowledge/[knowledgeName]/[id]/index.html b/pilot/server/static/knowledge/[knowledgeName]/[id]/index.html index d11e79e27..1a690829c 100644 --- a/pilot/server/static/knowledge/[knowledgeName]/[id]/index.html +++ b/pilot/server/static/knowledge/[knowledgeName]/[id]/index.html @@ -1 +1 @@ -
\ No newline at end of file +
\ No newline at end of file diff --git a/pilot/server/static/knowledge/index.html b/pilot/server/static/knowledge/index.html index b68a12fde..fd320b235 100644 --- a/pilot/server/static/knowledge/index.html +++ b/pilot/server/static/knowledge/index.html @@ -1 +1 @@ -
\ No newline at end of file +
\ No newline at end of file diff --git a/pilot/server/static/models/index.html b/pilot/server/static/models/index.html index ce99905f1..b32a9ccc9 100644 --- a/pilot/server/static/models/index.html +++ b/pilot/server/static/models/index.html @@ -1 +1 @@ -
\ No newline at end of file +
\ No newline at end of file diff --git a/pilot/server/static/prompt/index.html b/pilot/server/static/prompt/index.html index 0fab20f07..fcc3522e1 100644 --- a/pilot/server/static/prompt/index.html +++ b/pilot/server/static/prompt/index.html @@ -1 +1 @@ -
NameSceneSub SceneContentOperation
No data
\ No newline at end of file +
NameSceneSub SceneContentOperation
No data
\ No newline at end of file