@customize-agent/server 4.60.12 → 4.60.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next/BUILD_ID +1 -1
- package/.next/build-manifest.json +61 -61
- package/.next/prerender-manifest.json +3 -3
- package/.next/required-server-files.json +1 -1
- package/.next/server/chunks/1243.js +1 -1
- package/.next/server/chunks/1928.js +1 -1
- package/.next/server/chunks/1936.js +9 -9
- package/.next/server/chunks/2328.js +1 -1
- package/.next/server/chunks/4722.js +3 -3
- package/.next/server/chunks/6021.js +1 -0
- package/.next/server/chunks/6321.js +1 -1
- package/.next/server/chunks/6822.js +1 -1
- package/.next/server/chunks/8204.js +1 -1
- package/.next/server/chunks/9666.js +13 -13
- package/.next/server/instrumentation.js.nft.json +1 -1
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/pages/404.html +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/server/pages/api/assets/generated/preview.js.nft.json +1 -1
- package/.next/server/pages/api/assets/generated.js.nft.json +1 -1
- package/.next/server/pages/api/config/embedding/healthCheck.js.nft.json +1 -1
- package/.next/server/pages/api/documents/canvas/[id].js.nft.json +1 -1
- package/.next/server/pages/api/documents/export.js.nft.json +1 -1
- package/.next/server/pages/api/documents/generate/preview.js.nft.json +1 -1
- package/.next/server/pages/api/documents/generate.js.nft.json +1 -1
- package/.next/server/pages/api/documents/generated/[id]/events.js.nft.json +1 -1
- package/.next/server/pages/api/documents/generated/[id]/figure/[name].js.nft.json +1 -1
- package/.next/server/pages/api/documents/generated/[id]/instruction.js.nft.json +1 -1
- package/.next/server/pages/api/documents/generated/[id]/nodes/[nodeId].js.nft.json +1 -1
- package/.next/server/pages/api/documents/generated/[id]/nodes.js.nft.json +1 -1
- package/.next/server/pages/api/documents/generated/[id]/pause.js.nft.json +1 -1
- package/.next/server/pages/api/documents/generated/[id]/preview.js.nft.json +1 -1
- package/.next/server/pages/api/documents/generated/[id]/repair/[rid]/confirm.js +1 -1
- package/.next/server/pages/api/documents/generated/[id]/repair/[rid]/confirm.js.nft.json +1 -1
- package/.next/server/pages/api/documents/generated/[id]/repair/[rid]/rollback.js.nft.json +1 -1
- package/.next/server/pages/api/documents/generated/[id]/repair.js.nft.json +1 -1
- package/.next/server/pages/api/documents/generated/[id]/report.js.nft.json +1 -1
- package/.next/server/pages/api/documents/generated/[id]/resume-generate.js.nft.json +1 -1
- package/.next/server/pages/api/documents/generated/[id].js.nft.json +1 -1
- package/.next/server/pages/api/documents/generated.js.nft.json +1 -1
- package/.next/server/pages/api/health.js +1 -1
- package/.next/server/pages/api/jobs/[id].js.nft.json +1 -1
- package/.next/server/pages/api/kb/categories.js.nft.json +1 -1
- package/.next/server/pages/api/kb/duplicates.js.nft.json +1 -1
- package/.next/server/pages/api/kb/files/detail.js.nft.json +1 -1
- package/.next/server/pages/api/kb/files/export.js.nft.json +1 -1
- package/.next/server/pages/api/kb/files/open.js.nft.json +1 -1
- package/.next/server/pages/api/kb/files/preview-pdf-page.js.nft.json +1 -1
- package/.next/server/pages/api/kb/files/reindex.js.nft.json +1 -1
- package/.next/server/pages/api/kb/files/search.js.nft.json +1 -1
- package/.next/server/pages/api/kb/files/source-preview.js.nft.json +1 -1
- package/.next/server/pages/api/kb/files.js.nft.json +1 -1
- package/.next/server/pages/api/kb/ignore.js.nft.json +1 -1
- package/.next/server/pages/api/kb/material-groups.js.nft.json +1 -1
- package/.next/server/pages/api/kb/operations.js.nft.json +1 -1
- package/.next/server/pages/api/kb/reindex.js.nft.json +1 -1
- package/.next/server/pages/api/kb/stats.js.nft.json +1 -1
- package/.next/server/pages/api/kb/tags.js.nft.json +1 -1
- package/.next/server/pages/api/kb/upload/complete.js.nft.json +1 -1
- package/.next/server/pages/api/kb/upload.js +1 -1
- package/.next/server/pages/api/kb/upload.js.nft.json +1 -1
- package/.next/server/pages/api/system/reset.js.nft.json +1 -1
- package/.next/server/pages/canvas/[id].html +1 -1
- package/.next/server/pages/canvas.html +1 -1
- package/.next/server/pages/documents.html +1 -1
- package/.next/server/pages/guide.html +1 -1
- package/.next/server/pages/index.html +1 -1
- package/.next/server/pages/knowledge/file-detail.html +1 -1
- package/.next/server/pages/knowledge/files.html +1 -1
- package/.next/server/pages/knowledge/manage.html +1 -1
- package/.next/server/pages/knowledge/source-preview.html +1 -1
- package/.next/server/pages/knowledge.html +1 -1
- package/.next/server/pages/models.html +1 -1
- package/.next/server/pages/overview.html +1 -1
- package/.next/server/pages/prompt.html +1 -1
- package/.next/server/pages/settings.html +1 -1
- package/.next/server/pages/skills/[id]/edit.html +1 -1
- package/.next/server/pages/skills/[id]/edit.js.nft.json +1 -1
- package/.next/server/pages/skills/[id].html +1 -1
- package/.next/server/pages/skills/[id].js.nft.json +1 -1
- package/.next/server/pages/skills/new.html +1 -1
- package/.next/server/pages/skills/new.js.nft.json +1 -1
- package/.next/server/pages/skills.html +1 -1
- package/.next/server/pages/system/logs.html +1 -1
- package/.next/server/pages-manifest.json +30 -30
- package/.next/static/c7f9aefd14f63a15dfe1a3ab4b189ce98e5784658308b514fdf3e998d82aba47/_buildManifest.js +1 -0
- package/.next/static/chunks/162-36b2a3e6ee7d9717.js +8 -0
- package/.next/static/chunks/257-879f095890deadad.js +1 -0
- package/.next/static/chunks/313-4b3ff7075e0ff3c3.js +1 -0
- package/.next/static/chunks/530-98c3b3fbf3fcd8e3.js +1 -0
- package/.next/static/chunks/551-446a9d48add4944f.js +16 -0
- package/.next/static/chunks/715-6285c5942e5ec5ea.js +1 -0
- package/.next/static/chunks/717-743b697a417dd5ee.js +4 -0
- package/.next/static/chunks/748-e13db510f76568b1.js +1 -0
- package/.next/static/chunks/795-3edd02531a6d39ae.js +1 -0
- package/.next/static/chunks/955-f0542d4dea118b62.js +1 -0
- package/.next/static/chunks/{964-569c27befeaff602.js → 964-82cc4701f08f7351.js} +2 -2
- package/.next/static/chunks/pages/{_app-28228d95968c4d44.js → _app-4165169ba0fabd04.js} +1 -1
- package/.next/static/chunks/pages/canvas/[id]-792d02e3874c19c0.js +1 -0
- package/.next/static/chunks/pages/{canvas-ffb08963e5cf9558.js → canvas-e011bb88585d3441.js} +1 -1
- package/.next/static/chunks/pages/guide-3185f12fbcb5a6af.js +1 -0
- package/.next/static/chunks/pages/knowledge/file-detail-c34e1f995fb8316f.js +1 -0
- package/.next/static/chunks/pages/knowledge/source-preview-814c683fc3723177.js +1 -0
- package/.next/static/chunks/pages/knowledge-3afd4bc337d44550.js +1 -0
- package/.next/static/chunks/pages/models-e07b2e29595effd7.js +1 -0
- package/.next/static/chunks/pages/prompt-47a1ac955831dedb.js +1 -0
- package/.next/static/chunks/pages/settings-8879d8c90bee2025.js +1 -0
- package/.next/static/chunks/pages/skills/[id]/{edit-89bbed9a3a854b04.js → edit-88e2490a4190467b.js} +1 -1
- package/.next/static/chunks/pages/skills/[id]-4700cd743c5efe05.js +1 -0
- package/.next/static/chunks/pages/skills/{new-124599c772150a1d.js → new-b2204742b055565a.js} +1 -1
- package/.next/static/chunks/pages/skills-1f6bcb42cd90abeb.js +1 -0
- package/.next/static/chunks/pages/system/logs-8c5dd4d06fa9d8c9.js +1 -0
- package/.next/static/css/cb79b8022e718258.css +1 -0
- package/package.json +2 -2
- package/scripts/half-built-scan.baseline.json +3 -4
- package/scripts/kb-index-worker.cjs +4 -1
- package/.next/server/chunks/9399.js +0 -1
- package/.next/static/b1bfae7c0251c082ada423097236fed51bd95e3e34a0749ccd55030dbf543f5d/_buildManifest.js +0 -1
- package/.next/static/chunks/162-a5be07e04aedf98a.js +0 -8
- package/.next/static/chunks/2-434e34e83819f4e4.js +0 -1
- package/.next/static/chunks/257-6938c7ab284ab21c.js +0 -1
- package/.next/static/chunks/280-3ce590d421b5c47d.js +0 -16
- package/.next/static/chunks/324-650dc02536b071bf.js +0 -4
- package/.next/static/chunks/425-42f2568bcdd98f4c.js +0 -1
- package/.next/static/chunks/530-7e79396d68742829.js +0 -1
- package/.next/static/chunks/564-d3426eef3e3e415b.js +0 -4
- package/.next/static/chunks/781-a6b83dbcd1a33cab.js +0 -1
- package/.next/static/chunks/795-1c1cb3bf1f600e99.js +0 -1
- package/.next/static/chunks/819-96247c9054ad9683.js +0 -1
- package/.next/static/chunks/pages/canvas/[id]-534b45f39f39630c.js +0 -1
- package/.next/static/chunks/pages/guide-82ae330966139191.js +0 -1
- package/.next/static/chunks/pages/knowledge/file-detail-dc1807f8ed32cd59.js +0 -1
- package/.next/static/chunks/pages/knowledge/source-preview-4309277bf497521c.js +0 -1
- package/.next/static/chunks/pages/knowledge-84e386d765ddd311.js +0 -1
- package/.next/static/chunks/pages/models-5eee2d09deb081fb.js +0 -1
- package/.next/static/chunks/pages/prompt-d75de6a6fead73c9.js +0 -1
- package/.next/static/chunks/pages/settings-f6dfff648cf9ac0e.js +0 -1
- package/.next/static/chunks/pages/skills/[id]-5130d68546be49cb.js +0 -1
- package/.next/static/chunks/pages/skills-476714776be63ce5.js +0 -1
- package/.next/static/chunks/pages/system/logs-40edb648d89b0749.js +0 -1
- package/.next/static/css/f4f2d386cfeae8e4.css +0 -1
- /package/.next/static/{b1bfae7c0251c082ada423097236fed51bd95e3e34a0749ccd55030dbf543f5d → c7f9aefd14f63a15dfe1a3ab4b189ce98e5784658308b514fdf3e998d82aba47}/_ssgManifest.js +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[920],{2548:(e,s,l)=>{"use strict";l.r(s),l.d(s,{default:()=>E});var r=l(65321),t=l(97109),c=l(43220),a=l.n(c),o=l(48399),n=l(11702),i=l(55122),d=l(80300),x=l(68787),m=l(15622),h=l(26619),u=l(71330),v=l(64068),j=l(84742),p=l(4527),g=l(95118),f=l(33555),N=l(64629),b=l(6578),w=l(85310),y=l(93360);let{Paragraph:k,Text:C}=o.A,T=[{icon:(0,r.jsx)(h.A,{}),title:"整理项目资料包",goal:"把同一项目的招标正文、清单、图纸、补疑等资料放进同一个项目文件夹,然后在知识库页上传;解析、切片、入库都在后台跑。",checks:["资料已上传","索引完成","可选择项目文件夹"],href:"/knowledge"},{icon:(0,r.jsx)(u.A,{}),title:"准备提示词",goal:'在提示词页维护"这一篇按什么口径、什么章节结构写"的提示词(章节大纲写在 <OUTLINE> 块里)。',checks:["提示词已保存","提示词里有 <OUTLINE> 大纲"],href:"/prompt"},{icon:(0,r.jsx)(v.A,{}),title:"在画布发起生成",goal:"进入画布,用输入框左侧的「+」选中提示词与项目,写下要求后点「生成」;节点随日志追加出现。",checks:["提示词与项目已选中","生成任务已启动","证据来源可追溯"],href:"/canvas"},{icon:(0,r.jsx)(j.A,{}),title:"审查与导出",goal:"先回画布看这次生成跑到哪、证据来自哪、有没有阻断项——导出门禁也在那里判定。确认无误后到生成记录里打开文档,做人工编辑并导出。",checks:["无阻断问题","正文无后台话术","导出结果可打开"],href:"/canvas",secondary:{href:"/documents",label:"去生成记录导出"}}],A=[{title:"招标文件正文",desc:"确定项目边界、响应要求、工期质量安全目标和评审关注点。",color:"blue"},{title:"工程量清单",desc:"确定主要工程内容、分部分项、项目特征、工程量和资源配置依据。",color:"green"},{title:"图纸/设计资料",desc:"确定施工对象、空间关系、构造做法、专业接口和重点难点。",color:"purple"},{title:"补疑/澄清/答疑",desc:"修正招标正文、清单或图纸口径;与原文件冲突时优先采用。",color:"orange"}],S=[{icon:(0,r.jsx)(p.A,{}),title:"自动资料识别",desc:"根据文件名、目录和内容线索识别资料类型。"},{icon:(0,r.jsx)(g.A,{}),title:"项目理解",desc:"建立项目资料包视角,提炼工程范围、招标要求、清单内容、图纸对象和补疑修正项。"},{icon:(0,r.jsx)(f.A,{}),title:"章节证据计划",desc:"不同章节按不同资料组合召回,减少泛化套话和无来源事实。"}];function _(e){let{n:s}=e;return(0,r.jsx)("span",{className:"w-6 h-6 shrink-0 rounded-full bg-[var(--colorBrand)]/10 text-[var(--colorBrand)] text-xs font-bold flex items-center justify-center",children:s})}function E(){let[e,s]=(0,t.useState)(null);return(0,t.useEffect)(()=>{let e=!1;return(async()=>{try{var l,r,t;let c=await (0,b.dx)(),a=(null==(l=c.find(e=>e.selected))?void 0:l.projectRoot)||(null==(r=c.find(e=>e.isCurrent))?void 0:r.projectRoot)||(null==(t=c[0])?void 0:t.projectRoot)||"",[o,n]=await Promise.all([(0,b.cQ)(a||void 0),(0,b.hc)(a||void 0)]);if(e)return;s({kbFileCount:n.fileCount,promptCount:c.filter(e=>e.projectRoot===a&&!1!==e.hasFile).length,recordCount:o.documents.length,completedRecordCount:o.documents.filter(e=>"completed"===e.status||"completed_with_issues"===e.status||"warning"===e.status).length,exportCount:o.documents.reduce((e,s)=>{var l;return e+((null==(l=s.exportReports)?void 0:l.length)||0)},0)})}catch(e){}})(),()=>{e=!0}},[]),(0,r.jsxs)("div",{className:"space-y-6",children:[(0,r.jsx)(y.z,{title:"使用指南",description:"生成只需要两样人工输入:提示词(这一篇按什么结构、什么口径写)与项目(资料范围来自项目自己的知识库)。系统自动识别招标正文、工程量清单、图纸、补疑、技术规范等资料类型,并基于项目理解生成专业文档。",extra:(0,r.jsxs)("div",{className:"flex flex-wrap gap-1.5",children:[(0,r.jsx)(n.A,{color:"blue",bordered:!1,className:"m-0 px-3 py-1",children:"项目资料包"}),(0,r.jsx)(n.A,{color:"green",bordered:!1,className:"m-0 px-3 py-1",children:"自动识别"}),(0,r.jsx)(n.A,{color:"purple",bordered:!1,className:"m-0 px-3 py-1",children:"项目理解"})]})}),(0,r.jsx)(w.Zk,{title:"推荐操作流程",description:"从资料入库到文档导出,按以下四步完成。每步右下角显示当前项目的完成度。",children:(0,r.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 xl:grid-cols-4 gap-4",children:T.map((s,l)=>{let t;return(0,r.jsxs)("div",{className:"flex flex-col h-full p-4 ".concat(w.wD),children:[(0,r.jsxs)("div",{className:"flex items-center gap-3 mb-3",children:[(0,r.jsx)("div",{className:"w-10 h-10 shrink-0 rounded-xl bg-[var(--colorFillSecondary)] text-[var(--colorPrimary)] flex items-center justify-center text-lg",children:s.icon}),(0,r.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,r.jsx)(_,{n:l+1}),(0,r.jsx)("div",{className:"font-semibold text-[var(--colorText)] truncate",children:s.title})]})]}),(0,r.jsx)(k,{className:"text-sm text-[var(--colorTextSecondary)] min-h-[66px] !mb-4",children:s.goal}),(0,r.jsx)("div",{className:"flex flex-wrap gap-1.5",children:s.checks.map(e=>(0,r.jsx)(n.A,{className:"m-0",children:e},e))}),(0,r.jsx)(i.A,{className:"!my-3"}),(0,r.jsxs)("div",{className:"mt-auto flex flex-col gap-2",children:[(t=(s=>{if(!e)return{text:"加载中…",level:"todo"};switch(s){case 0:return e.kbFileCount>0?{text:"已入库 ".concat(e.kbFileCount," 份资料文件"),level:"done"}:{text:"尚未上传项目资料",level:"progress"};case 1:return e.promptCount>0?{text:"".concat(e.promptCount," 份提示词可用"),level:"done"}:{text:"尚未准备提示词",level:"todo"};case 2:return e.recordCount>0?{text:"已生成 ".concat(e.completedRecordCount,"/").concat(e.recordCount," 条有效记录"),level:"done"}:{text:"尚无生成记录",level:"todo"};case 3:return e.exportCount>0?{text:"已导出 ".concat(e.exportCount," 次,报告已归档"),level:"done"}:e.completedRecordCount>0?{text:"有生成记录待导出",level:"progress"}:{text:"等待生成记录后导出",level:"todo"};default:return{text:"",level:"todo"}}})(l),(0,r.jsx)(n.A,{color:"done"===t.level?"success":"progress"===t.level?"processing":"default",icon:null===e?(0,r.jsx)(N.A,{spin:!0}):void 0,className:"border-0 m-0",children:t.text})),(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,r.jsx)(a(),{className:"text-xs font-medium text-[var(--colorPrimary)] hover:underline",href:s.href,children:"去完成 ›"}),s.secondary&&(0,r.jsxs)(a(),{className:"text-xs text-[var(--colorTextSecondary)] hover:text-[var(--colorText)] hover:underline",href:s.secondary.href,children:[s.secondary.label," ›"]})]})]})]},s.title)})})}),(0,r.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-5 gap-6",children:[(0,r.jsx)("div",{className:"lg:col-span-2",children:(0,r.jsx)(w.Zk,{title:"项目资料包如何组织",children:(0,r.jsx)(d.A,{className:"mt-1",items:[{color:"blue",children:(0,r.jsxs)("div",{children:[(0,r.jsx)(C,{strong:!0,children:"一个项目一个文件夹"}),(0,r.jsx)(k,{className:"!mb-0 text-sm text-[var(--colorTextSecondary)]",children:"例如“徽光阁项目/”,在画布上选中它即可。"})]})},{color:"green",children:(0,r.jsxs)("div",{children:[(0,r.jsx)(C,{strong:!0,children:"资料集中放置"}),(0,r.jsx)(k,{className:"!mb-0 text-sm text-[var(--colorTextSecondary)]",children:"招标正文、清单、图纸、补疑、技术规范等资料放在同一个资料包下。"})]})},{color:"purple",children:(0,r.jsxs)("div",{children:[(0,r.jsx)(C,{strong:!0,children:"系统自动理解"}),(0,r.jsx)(k,{className:"!mb-0 text-sm text-[var(--colorTextSecondary)]",children:"生成前构建项目资料画像和项目理解模型。"})]})}]})})}),(0,r.jsx)("div",{className:"lg:col-span-3",children:(0,r.jsx)(w.Zk,{title:"关键资料职责",children:(0,r.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:A.map(e=>(0,r.jsxs)("div",{className:"p-4 ".concat(w.wD),children:[(0,r.jsx)(n.A,{color:e.color,bordered:!1,className:"m-0 mb-2",children:e.title}),(0,r.jsx)(k,{className:"!mb-0 text-sm text-[var(--colorTextSecondary)]",children:e.desc})]},e.title))})})})]}),(0,r.jsx)(w.Zk,{title:"生成链路说明",description:"这三件事在后台把「资料」变成「可写的证据」,是文档不写空话的来源。",children:(0,r.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:S.map((e,s)=>(0,r.jsxs)("div",{className:"p-4 ".concat(w.wD),children:[(0,r.jsxs)("div",{className:"flex items-center gap-3 mb-3",children:[(0,r.jsx)("div",{className:"w-9 h-9 shrink-0 rounded-xl bg-[var(--colorFillSecondary)] text-[var(--colorPrimary)] flex items-center justify-center",children:e.icon}),(0,r.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,r.jsx)(_,{n:s+1}),(0,r.jsx)(C,{strong:!0,className:"truncate",children:e.title})]})]}),(0,r.jsx)(k,{className:"!mb-0 text-sm text-[var(--colorTextSecondary)]",children:e.desc})]},e.title))})}),(0,r.jsx)(x.A,{className:"rounded-2xl border border-[var(--borderColor)]",styles:{body:{padding:0}},children:(0,r.jsx)(m.A,{ghost:!0,items:[{key:"binding",label:"生成需要准备什么?",children:(0,r.jsxs)(k,{className:"!mb-0",children:["两样:一份带 ",(0,r.jsx)(C,{code:!0,children:"<OUTLINE>"})," 章节大纲的提示词,和一个项目。资料职责由系统自动识别,选中的项目自己的知识库就是本次的资料范围。"]})},{key:"addendum",label:"补疑/澄清如何处理?",children:(0,r.jsx)(k,{className:"!mb-0",children:"补疑、澄清、答疑属于高优先级资料。如与招标正文、清单或图纸存在冲突,生成时优先采用补疑/澄清口径。"})},{key:"quality",label:"专业性如何保证?",children:(0,r.jsx)(k,{className:"!mb-0",children:"生成链路会结合项目理解、章节证据计划、结构化事实、质量审查和导出门禁,减少泛化套话和无来源事实。"})},{key:"review",label:"生成完在哪里看结果、在哪里导出?",children:(0,r.jsxs)(k,{className:"!mb-0",children:["分两处:",(0,r.jsx)(C,{strong:!0,children:"审查在画布"}),"——节点日志、证据来源、阻断项与导出门禁结论都在那里;",(0,r.jsx)(C,{strong:!0,children:"编辑与导出在生成记录"}),"——打开某条记录即可人工修改正文并导出 MD/HTML/DOCX/PDF。"]})}]})})]})}},34899:(e,s,l)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/guide",function(){return l(2548)}])},85310:(e,s,l)=>{"use strict";l.d(s,{Zk:()=>c,dh:()=>a,wD:()=>t});var r=l(65321);l(97109);let t="rounded-xl bg-[var(--colorBgContainer)] shadow-[var(--shadowSurface)] hover:shadow-[var(--shadowSurfaceHover)] transition-shadow";function c(e){let{title:s,count:l,description:t,extra:c,className:a,children:o}=e;return(0,r.jsxs)("section",{className:"rounded-2xl bg-[var(--colorBgContainer)] shadow-[var(--shadowSurface)] p-6 animateFadeIn ".concat(null!=a?a:""),children:[(0,r.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-start justify-between gap-3 mb-5",children:[(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsxs)("h2",{className:"text-base font-semibold text-[var(--colorText)] tracking-wide flex items-center gap-2 m-0",children:[s,void 0!==l&&(0,r.jsx)("span",{className:"text-[var(--colorTextTertiary)] font-normal text-sm",children:l})]}),t&&(0,r.jsx)("p",{className:"text-xs text-[var(--colorTextTertiary)] mt-1.5 mb-0 leading-relaxed max-w-3xl",children:t})]}),c]}),o]})}function a(e){let{children:s}=e;return(0,r.jsx)("div",{className:"text-xs font-semibold uppercase tracking-wider mb-2 text-[var(--colorTextTertiary)]",children:s})}},93360:(e,s,l)=>{"use strict";l.d(s,{z:()=>c});var r=l(65321);l(97109);var t=l(33442);function c(e){let{title:s,description:l,extra:c,bottomContent:a}=e;return(0,r.jsxs)("div",{className:"animateFadeIn",children:[(0,r.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-end justify-between gap-4 pb-6 border-b border-[var(--borderColor)]",children:[(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsx)("h1",{className:"text-3xl font-extrabold tracking-tight text-[var(--colorText)] mb-2",children:s}),l&&(0,r.jsx)("p",{className:"text-sm text-[var(--colorTextSecondary)] m-0",children:l})]}),c&&(0,r.jsx)(t.A,{className:"w-full sm:w-auto overflow-x-auto pb-1 sm:pb-0 shrink-0",size:"middle",wrap:!1,children:c})]}),a&&(0,r.jsx)("div",{className:"mt-6",children:a})]})}}},e=>{e.O(0,[717,665,569,787,162,636,593,792],()=>e(e.s=34899)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[309],{9137:(e,t,l)=>{"use strict";l.d(t,{Ay:()=>A});var n=l(9750),r=l(97109),a=l(42644),s=l(10252),o=l(74567),i=l(48921),c=l(98379),d=l(3638),u=l(632),m=l(34475),h=l(52093),x=l(60815),g=l(5741);let p=null,f=e=>e(),w=[],_={};function y(){let{getContainer:e,duration:t,rtl:l,maxCount:n,top:r,stack:a}=_,s=e?.()||document.body;return{getContainer:()=>s,duration:t,rtl:l,maxCount:n,top:r,stack:a}}let k=r.forwardRef((e,t)=>{let{messageConfig:l,sync:n}=e,{getPrefixCls:a}=(0,r.useContext)(o.QO),i=_.prefixCls||a("message"),c=(0,r.useContext)(s.B),[d,u]=(0,x.y)({...l,prefixCls:i,...c.message});return r.useImperativeHandle(t,()=>{let e={...d};return Object.keys(e).forEach(t=>{e[t]=(...e)=>(n(),d[t].apply(d,e))}),{instance:e,sync:n}}),u}),b=r.forwardRef((e,t)=>{let[l,n]=r.useState(y),a=()=>{n(y)};r.useEffect(a,[]);let s=(0,i.cr)(),o=s.getRootPrefixCls(),c=s.getIconPrefixCls(),d=s.getTheme(),u=r.createElement(k,{ref:t,sync:a,messageConfig:l});return r.createElement(i.Ay,{prefixCls:o,iconPrefixCls:c,theme:d},s.holderRender?s.holderRender(u):u)}),j=()=>{if(!p){let e=document.createDocumentFragment(),t={fragment:e};p=t,f(()=>{(0,a.XX)(r.createElement(b,{ref:e=>{let{instance:l,sync:n}=e||{};Promise.resolve().then(()=>{!t.instance&&l&&(t.instance=l,t.sync=n,j())})}}),e)});return}p.instance&&(w.forEach(e=>{let{type:t,skipped:l}=e;if(!l)switch(t){case"open":f(()=>{let t=p.instance.open({..._,...e.config});t?.then(e.resolve),e.setCloseFn(t)});break;case"destroy":f(()=>{p?.instance.destroy(e.key)});break;default:f(()=>{var l;let r=(l=p.instance)[t].apply(l,(0,n.A)(e.args));r?.then(e.resolve),e.setCloseFn(r)})}}),w=[])},v={open:function(e){let t=(0,g.E)(t=>{let l,n={type:"open",config:e,resolve:t,setCloseFn:e=>{l=e}};return w.push(n),()=>{l?f(()=>{l()}):n.skipped=!0}});return j(),t},destroy:e=>{w.push({type:"destroy",key:e}),j()},config:function(e){_={..._,...e},f(()=>{p?.sync?.()})},useMessage:x.A,_InternalPanelDoNotUseOrYouWillBeFired:m.Ay,_InternalListDoNotUseOrYouWillBeFired:e=>{let{items:t,classNames:l,style:n}=e,{getPrefixCls:a}=(0,o.TP)("message"),s=a("message"),i=(0,u.A)(s),[x,g]=(0,h.A)(s,i),p=`${s}-notice`,f=t.map(e=>{let{content:t,duration:l,key:n,type:r}=e,a=r?`${p}-icon-${r}`:void 0;return{key:n,duration:l,icon:(0,m.HC)(r),title:t,className:`${p}-${r}`,classNames:{wrapper:`${s}-${r}`,icon:a}}});return r.createElement(c.qb,{prefixCls:s,placement:"top",configList:f,className:(0,d.$)(x,g,i),classNames:{...l,wrapper:l?.wrapper,title:l?.title},style:n,stack:!1})}};["success","info","warning","error","loading"].forEach(e=>{v[e]=(...t)=>(function(e,t){(0,i.cr)();let l=(0,g.E)(l=>{let n,r={type:e,args:t,resolve:l,setCloseFn:e=>{n=e}};return w.push(r),()=>{n?f(()=>{n()}):r.skipped=!0}});return j(),l})(e,t)});let A=v},14569:e=>{e.exports={featureLabel:"style_featureLabel__XFSTX",featureValue:"style_featureValue__I_wMP",filterInput:"style_filterInput__4_Elu",filterSelect:"style_filterSelect__vUBJ9",statusCard:"style_statusCard__H7Mee",statusSummary:"style_statusSummary__7KavF",statusSummaryText:"style_statusSummaryText__Shw3j",statusClearBtn:"style_statusClearBtn__uJ9bE",statusExpandBtn:"style_statusExpandBtn__HhgIj",statusFilters:"style_statusFilters__g_LbG",filterPill:"style_filterPill__1pjFW",filterPillActive:"style_filterPillActive___UZVi",statusPanel:"style_statusPanel__9arTu",statusEmpty:"style_statusEmpty__8LWzH",timelineList:"style_timelineList__dqJrz",timelineItem:"style_timelineItem__dbuL_",timelineStatusIcon:"style_timelineStatusIcon__SkRwb",timelinePercent:"style_timelinePercent__pEyH4",timelineRow:"style_timelineRow__EDOVa",timelineTitle:"style_timelineTitle__Yujr8",timelineClose:"style_timelineClose__Byx_9",timelineDetail:"style_timelineDetail__nALei",timelineDesc:"style_timelineDesc__FMjWE",timelinePath:"style_timelinePath__C9VQI",timelineMeta:"style_timelineMeta__u_pCn",timelineMetaTag:"style_timelineMetaTag__G3jF1",timelineExpandArrow:"style_timelineExpandArrow__xIBdF",timelineExpandArrowOpen:"style_timelineExpandArrowOpen__TWWDC",fileNameCell:"style_fileNameCell__EHsnt",folderName:"style_folderName__VhLXP",folderRow:"style_folderRow__d7k9S",searchResultList:"style_searchResultList__cVKZg",searchResultItem:"style_searchResultItem__boj6D",searchResultHeader:"style_searchResultHeader__meVdJ",searchContent:"style_searchContent__XbUVk",pdfPreviewStrip:"style_pdfPreviewStrip__94_eG"}},37690:(e,t,l)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/knowledge/file-detail",function(){return l(48200)}])},45551:(e,t,l)=>{"use strict";l.d(t,{Jm:()=>i,fw:()=>a,je:()=>n.j,mc:()=>c,z3:()=>r});var n=l(96538);function r(e){if(0===e)return"0 B";let t=Math.floor(Math.log(e)/Math.log(1024)),l=e/Math.pow(1024,t);return"".concat(l.toFixed(+(0!==t))," ").concat(["B","KB","MB","GB","TB"][t])}function a(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"zh-CN";if(!e||e<=0)return"en-US"===t?"Never":"从未";let l=Math.floor(Math.floor((Date.now()-e)/1e3)/60),n=Math.floor(l/60),r=Math.floor(n/24);return r>30?new Date(e).toLocaleDateString(t):"en-US"===t?r>0?"".concat(r,"d ago"):n>0?"".concat(n,"h ago"):l>0?"".concat(l,"m ago"):"Just now":r>0?"".concat(r," 天前"):n>0?"".concat(n," 小时前"):l>0?"".concat(l," 分钟前"):"刚刚"}let s={document:"文档",spreadsheet:"表格",image:"图片",cad:"图纸",code:"代码",data:"数据",web:"网页",diagram:"图表",archive:"压缩包",other:"其他"},o={document:"Document",spreadsheet:"Spreadsheet",image:"Image",cad:"CAD",code:"Code",data:"Data",web:"Web",diagram:"Diagram",archive:"Archive",other:"Other"};function i(e){var t;let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"zh-CN";return null!=(t=("en-US"===l?o:s)[e])?t:e}let c={active:"common.statusIndexed",outdated:"common.statusOutdated",error:"common.statusAbnormal",deleted:"common.statusDeleted",disk:"common.statusNotIndexed"}},48200:(e,t,l)=>{"use strict";l.r(t),l.d(t,{default:()=>S});var n=l(65321),r=l(97109),a=l(86109),s=l(48399),o=l(9137),i=l(11702),c=l(33442),d=l(88762),u=l(68787),m=l(85493),h=l(84253),x=l(85114),g=l(76506),p=l(7576),f=l(38964),w=l(6578),_=l(39507),y=l(85979),k=l(45551),b=l(14569),j=l.n(b),v=l(58690);let{Paragraph:A}=s.A;function C(e){if(!e)return{};try{return JSON.parse(e)}catch(e){return{}}}function N(e,t){let l=t.trim()?[t.trim(),...t.split(/[\s,,。;;::、]+/u)].filter(Boolean).sort((e,t)=>t.length-e.length):[];if(0===l.length)return e;let r=RegExp("(".concat(l.map(e=>e.replace(/[.*+?^${}()|[\]\\]/gu,"\\$&")).join("|"),")"),"giu");return e.split(r).map((e,t)=>l.some(t=>t.toLowerCase()===e.toLowerCase())?(0,n.jsx)("mark",{children:e},t):e)}function S(){var e,t,l,s,b,S,I,F;let P=(0,_.Vr)(),M=(0,a.useRouter)(),E="string"==typeof M.query.relativePath?M.query.relativePath:"",R="string"==typeof M.query.projectRoot?M.query.projectRoot:void 0,[T,L]=(0,r.useState)(),[z,B]=(0,r.useState)(!1),[D,O]=(0,r.useState)(""),[J,H]=(0,r.useState)(!1),[U,V]=(0,r.useState)("");(0,r.useEffect)(()=>{E&&(B(!0),O(""),(0,w.xC)(E,R).then(L).catch(e=>{L(void 0),O(e instanceof Error?e.message:P("knowledge.fileDetailLoadFailed"))}).finally(()=>B(!1)))},[E,R,P]);let $=(0,r.useMemo)(()=>(function(e){let t=C(null==e?void 0:e.file.metadataJson);return"object"==typeof t.extraction&&t.extraction?t.extraction:t})(T),[T]),W=U.trim().toLowerCase(),q=(0,r.useMemo)(()=>{var e;return T&&W?T.chunks.filter(e=>{let t=C(e.metadataJson);return[e.content,e.sectionTitle,t.rowRange,t.chunkKind,t.parentId,JSON.stringify(t)].some(e=>String(null!=e?e:"").toLowerCase().includes(W))}):null!=(e=null==T?void 0:T.chunks)?e:[]},[T,W]),K=(0,r.useMemo)(()=>{var e;return T&&W?T.parents.filter(e=>[e.content,e.sectionTitle,e.parentId,e.metadataJson].some(e=>String(null!=e?e:"").toLowerCase().includes(W))):null!=(e=null==T?void 0:T.parents)?e:[]},[T,W]),X=async()=>{if(E){H(!0);try{let e=await (0,w.HC)(E,R);e.detail&&L(e.detail),o.Ay.success(P("knowledge.fileReindexed"))}finally{H(!1)}}},G=async e=>{E&&(await (0,w.tn)(E,e,R),o.Ay.success("file"===e?P("knowledge.openFileRequested"):P("knowledge.openDirectoryRequested")))},Q=[{title:P("knowledge.index"),key:"index",width:70,render:(e,t,l)=>l+1},{title:P("knowledge.chunkIndex"),dataIndex:"chunkIndex",width:90,render:e=>String(e)},{title:P("knowledge.chunkType"),width:110,render:(e,t)=>{var l;return(0,n.jsx)(i.A,{children:String(null!=(l=C(t.metadataJson).chunkKind)?l:t.category)})}},{title:P("knowledge.sectionOrRange"),width:220,render:(e,t)=>{let l=C(t.metadataJson),r="string"==typeof l.rowRange?l.rowRange:void 0;return(0,n.jsxs)(c.A,{wrap:!0,children:[t.sectionTitle?(0,n.jsx)(i.A,{color:"cyan",children:t.sectionTitle}):null,r?(0,n.jsxs)(i.A,{color:"gold",children:[P("knowledge.rowPrefix")," ",r]}):null]})}},{title:P("knowledge.tokens"),dataIndex:"tokenCount",width:90},{title:P("knowledge.chunkContent"),render:(e,t)=>(0,n.jsx)(A,{ellipsis:{rows:3,expandable:!0,symbol:P("knowledge.openExpand")},className:j().searchContent,children:N(t.content,U)})}],Y=[{title:P("knowledge.index"),key:"index",width:70,render:(e,t,l)=>l+1},{title:P("knowledge.parentChunkId"),dataIndex:"parentId",width:260,render:e=>(0,n.jsx)("span",{className:"break-all",children:e})},{title:P("knowledge.chunkCount"),dataIndex:"chunkCount",width:90},{title:P("knowledge.section"),dataIndex:"sectionTitle",width:220},{title:P("knowledge.chunkContent"),render:(e,t)=>(0,n.jsx)(A,{ellipsis:{rows:3,expandable:!0,symbol:P("knowledge.openExpand")},className:j().searchContent,children:N(t.content,U)})}];return z?(0,n.jsxs)("div",{className:"space-y-5 animateFadeIn",children:[(0,n.jsx)(d.A,{active:!0,paragraph:{rows:1}}),(0,n.jsx)(u.A,{size:"small",children:(0,n.jsx)(d.A,{active:!0,paragraph:{rows:6}})}),(0,n.jsx)(u.A,{size:"small",children:(0,n.jsx)(d.A,{active:!0,paragraph:{rows:4}})})]}):D?(0,n.jsx)(m.A,{type:"error",showIcon:!0,description:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{children:P("knowledge.fileDetailLoadFailed")}),(0,n.jsx)("div",{children:D})]})}):T?(0,n.jsxs)("div",{className:"space-y-5 animateFadeIn",children:[(0,n.jsx)(y.k,{backHref:"/knowledge",backLabel:P("knowledge.backToFileList"),title:P("knowledge.fileDetailTitle"),description:P("knowledge.fileDetailDesc"),extra:(0,n.jsxs)(c.A,{wrap:!0,children:[(0,n.jsx)(x.Ay,{size:"small",onClick:()=>{M.push("/knowledge/source-preview?".concat(new URLSearchParams({relativePath:E,...R?{projectRoot:R}:{}})))},children:"解析核查预览"}),(0,n.jsx)(x.Ay,{size:"small",onClick:()=>{G("file")},children:P("assets.openFile")}),(0,n.jsx)(x.Ay,{size:"small",onClick:()=>{G("directory")},children:P("assets.openDirectory")}),(0,n.jsx)(x.Ay,{size:"small",type:"primary",loading:J,onClick:()=>{X()},children:P("knowledge.reindexFile")})]})}),(null==(e=T.parseAttempt)?void 0:e.status)==="error"&&(0,n.jsx)(m.A,{showIcon:!0,type:"error",message:P("knowledge.latestParseFailed"),description:"".concat(null!=(l=T.parseAttempt.error)?l:"").concat(T.parseAttempt.recordRetained?";".concat(P("knowledge.previousParseRetained")):"")}),(null==(t=T.parseAttempt)?void 0:t.status)==="parsing"&&(0,n.jsx)(m.A,{showIcon:!0,type:"info",message:P("knowledge.currentParseInProgress")}),(0,n.jsx)(u.A,{className:"rounded-2xl border-[var(--borderColor)]",title:(0,n.jsx)("span",{className:"font-semibold",children:P("knowledge.basicInfo")}),children:(0,n.jsxs)(g.A,{size:"small",column:{xxl:3,xl:2,lg:2,md:1,sm:1,xs:1},bordered:!0,styles:{label:{width:"120px",background:"var(--colorFillAlter)",color:"var(--colorTextSecondary)"}},children:[(0,n.jsx)(g.A.Item,{label:P("knowledge.path"),span:3,children:(0,n.jsx)("span",{className:"break-all",children:T.file.relativePath})}),(0,n.jsx)(g.A.Item,{label:P("knowledge.originalFile"),span:3,children:(0,n.jsx)("span",{className:"break-all",children:null!=(s=T.absolutePath)?s:"-"})}),(0,n.jsx)(g.A.Item,{label:P("knowledge.directory"),span:3,children:(0,n.jsx)("span",{className:"break-all",children:null!=(b=T.directory)?b:"-"})}),(0,n.jsx)(g.A.Item,{label:P("knowledge.fileCategory"),children:(0,n.jsxs)(c.A,{size:4,children:[(0,n.jsx)(i.A,{className:"m-0 border-0 bg-[var(--colorFillSecondary)]",children:(0,k.Jm)(T.file.category)})," ",(0,n.jsx)(i.A,{className:"m-0 border-0 bg-[var(--colorFillSecondary)]",children:T.file.format})]})}),(0,n.jsx)(g.A.Item,{label:P("knowledge.fileSize"),children:(0,k.z3)(T.file.fileSize)}),(0,n.jsx)(g.A.Item,{label:P("knowledge.chunkCount"),children:T.file.chunkCount}),(0,n.jsx)(g.A.Item,{label:P("knowledge.status"),children:(0,n.jsx)(i.A,{color:"active"===T.file.status?"success":"error"===T.file.status?"error":"outdated"===T.file.status?"warning":"disk"===T.file.status||"deleted"===T.file.status?"default":"processing",className:"m-0",children:P(k.mc[T.file.status]||"common.unknown")})}),(0,n.jsx)(g.A.Item,{label:P("knowledge.extractionMode"),children:String(null!=(S=$.extractionMode)?S:"-")}),(0,n.jsx)(g.A.Item,{label:P("knowledge.contentCoverage"),children:String(null!=(I=$.contentCoverage)?I:"-")}),(0,n.jsx)(g.A.Item,{label:P("knowledge.textLength"),children:String(null!=(F=$.textLength)?F:"-")})]})}),(0,n.jsx)(u.A,{className:"rounded-2xl border-[var(--borderColor)]",title:(0,n.jsx)("span",{className:"font-semibold",children:P("knowledge.detailFilter")}),children:(0,n.jsxs)("div",{className:"flex flex-col w-full gap-4",children:[(0,n.jsx)(p.A,{allowClear:!0,size:"large",value:U,onChange:e=>V(e.target.value),placeholder:P("knowledge.detailFilterPlaceholder"),className:"rounded-xl bg-[var(--colorBgHover)] border-[var(--borderColor)] focus:bg-[var(--colorBgContainer)] hover:bg-[var(--colorBgContainer)] w-full"}),U?(0,n.jsxs)("div",{className:"flex flex-wrap gap-2 items-center bg-[var(--colorFillAlter)] p-3 rounded-xl border border-[var(--colorBorderSecondary)]",children:[(0,n.jsx)("span",{className:"text-sm font-medium text-[var(--colorTextSecondary)] mr-2",children:"过滤结果:"}),(0,n.jsxs)(i.A,{color:"blue",className:"m-0 border-0",children:[P("knowledge.parentMatches")," ",K.length]}),(0,n.jsxs)(i.A,{color:"green",className:"m-0 border-0",children:[P("knowledge.childMatches")," ",q.length]}),(0,n.jsx)("div",{className:"w-[1px] h-3 bg-[var(--colorBorderSecondary)] mx-1"}),(0,n.jsxs)("span",{className:"text-xs text-[var(--colorTextTertiary)]",children:[P("knowledge.filterTerm")," ",(0,n.jsx)("strong",{className:"text-[var(--colorText)]",children:U})]})]}):null]})}),(0,n.jsxs)(u.A,{className:"rounded-2xl border-[var(--borderColor)]",title:(0,n.jsxs)("span",{className:"font-semibold",children:[P("knowledge.parentChunks")," ",(0,n.jsxs)(i.A,{className:"ml-2 border-0 bg-[var(--colorFillSecondary)] text-xs font-normal",children:[K.length," / ",T.parents.length]})]}),children:[(0,n.jsx)(m.A,{type:"info",showIcon:!0,description:P("knowledge.parentChunkHint"),className:"mb-4 rounded-xl border-blue-200 bg-blue-50/50"}),(0,n.jsx)(f.A,{rowKey:"id",columns:Y,dataSource:K,pagination:(0,v.B)(P),size:"small",className:"custom-table"})]}),(0,n.jsx)(u.A,{className:"rounded-2xl border-[var(--borderColor)]",title:(0,n.jsxs)("span",{className:"font-semibold",children:[P("knowledge.childChunks")," ",(0,n.jsxs)(i.A,{className:"ml-2 border-0 bg-[var(--colorFillSecondary)] text-xs font-normal",children:[q.length," / ",T.chunks.length]})]}),children:(0,n.jsx)(f.A,{rowKey:"id",columns:Q,dataSource:q,pagination:(0,v.B)(P),size:"small",className:"custom-table"})})]}):(0,n.jsx)(h.A,{description:P("knowledge.selectFile")})}},58690:(e,t,l)=>{"use strict";function n(e){var t,l,n;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{defaultPageSize:null!=(t=r.pageSize)?t:10,pageSizeOptions:null!=(l=r.pageSizeOptions)?l:[10,20,50,100],showSizeChanger:!0,showTotal:t=>{var l,n;return e(null!=(l=r.totalLabelKey)?l:"common.totalRows",null!=(n=r.totalLabelFallback)?n:"共 {count} 条").replace("{count}",String(t))},hideOnSinglePage:null!=(n=r.hideOnSinglePage)&&n,showQuickJumper:!1}}l.d(t,{B:()=>n})},85979:(e,t,l)=>{"use strict";l.d(t,{k:()=>o});var n=l(65321),r=l(43220),a=l.n(r),s=l(91648);function o(e){let{backHref:t,backLabel:l,title:r,description:o,extra:i}=e;return(0,n.jsx)("div",{className:"mb-6 bg-[var(--colorBgContainer)] rounded-2xl overflow-hidden border border-[var(--borderColor)] p-6",children:(0,n.jsxs)("div",{className:"flex flex-col md:flex-row md:items-end justify-between gap-4 md:gap-6",children:[(0,n.jsxs)("div",{className:"flex items-center gap-3 min-w-0",children:[(0,n.jsxs)(a(),{href:t,prefetch:!1,className:"detailBack",children:[(0,n.jsx)(s.A,{size:16,strokeWidth:2,"aria-hidden":!0}),(0,n.jsx)("span",{children:l})]}),(0,n.jsxs)("div",{className:"min-w-0 space-y-1",children:[(0,n.jsx)("h1",{className:"text-2xl font-bold text-[var(--colorText)] m-0 truncate",children:r}),o?(0,n.jsx)("p",{className:"text-sm text-[var(--colorTextSecondary)] m-0 break-all",children:o}):null]})]}),i?(0,n.jsx)("div",{className:"shrink-0 flex items-center gap-2",children:i}):null]})})}},91648:(e,t,l)=>{"use strict";l.d(t,{A:()=>n});let n=(0,l(1278).A)("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]])},96538:(e,t,l)=>{"use strict";l.d(t,{a:()=>r,j:()=>a});let n={coarse:function(e,t){let l=Math.floor(e/1e3),n=Math.floor(l/86400),r=Math.floor(l%86400/3600),a=Math.floor(l%3600/60),s="en-US"===t;return n>0?s?"".concat(n,"d ").concat(r,"h"):"".concat(n," 天 ").concat(r," 小时"):r>0?s?"".concat(r,"h ").concat(a,"m"):"".concat(r," 小时 ").concat(a," 分"):a>0?s?"".concat(a,"m"):"".concat(a," 分"):s?"Just now":"刚刚"},fine:function(e){let t=Math.round(e/1e3);if(t<60)return"".concat(t," 秒");let l=Math.floor(t/60);return l<60?"".concat(l," 分 ").concat(t%60," 秒"):"".concat(Math.floor(l/60)," 小时 ").concat(l%60," 分")},"fine-decimal":function(e){return e>=6e4?"".concat(Math.floor(e/6e4)," 分 ").concat(Math.round(e%6e4/1e3)," 秒"):"".concat((e/1e3).toFixed(1)," 秒")},metric:function(e){return e<1e3?"".concat(Math.round(e),"ms"):e<6e4?"".concat((e/1e3).toFixed(1),"s"):"".concat((e/6e4).toFixed(1),"min")}};function r(e,t){var l;return n[t.style](function(e,t){let l="s"===t?1e3*e:e;return Number.isFinite(l)&&l>0?l:0}(e,t.unit),null!=(l=t.locale)?l:"zh-CN")}function a(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"zh-CN";return r(e,{unit:"s",style:"coarse",locale:t})}}},e=>{e.O(0,[717,551,665,576,569,499,787,338,964,808,636,593,792],()=>e(e.s=37690)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[95],{2232:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>P});var r=s(65321),a=s(97109),l=s(1873),n=s.n(l),c=s(86109),i=s(33442),o=s(14932),d=s(85114),x=s(85493),h=s(48318),m=s(75174),u=s(57271),p=s(42700),j=s(84253),v=s(68787),g=s(11702),f=s(76506),y=s(58569),b=s(88762),N=s(99271),w=s(37510),C=s(99811),k=s(6578),S=s(85979);let A={whiteSpace:"pre-wrap",overflowWrap:"anywhere",margin:0,fontFamily:"ui-monospace, SFMono-Regular, Menlo, monospace",fontSize:12.5,lineHeight:1.75};function T(e){let{children:t,maxHeight:s=520}=e;return(0,r.jsx)("div",{className:"rounded-xl border border-[var(--borderColor)] bg-[var(--colorFillAlter)] px-3 py-2.5",style:{maxHeight:s,overflow:"auto"},children:t})}function z(e){let{zoom:t,onChange:s,viewportRef:a}=e,l=e=>Math.min(4,Math.max(.2,Math.round(100*e)/100));return(0,r.jsxs)(i.A,{size:4,align:"center",children:[(0,r.jsx)(o.A,{title:"缩小(Ctrl/⌘ + 滚轮同效)",children:(0,r.jsx)(d.Ay,{size:"small",icon:(0,r.jsx)(N.A,{}),"aria-label":"缩小",onClick:()=>s(l(t-.1))})}),(0,r.jsxs)("span",{className:"text-xs tabular-nums text-[var(--colorTextSecondary)] w-12 text-center",children:[Math.round(100*t),"%"]}),(0,r.jsx)(o.A,{title:"放大(Ctrl/⌘ + 滚轮同效)",children:(0,r.jsx)(d.Ay,{size:"small",icon:(0,r.jsx)(w.A,{}),"aria-label":"放大",onClick:()=>s(l(t+.1))})}),(0,r.jsx)(d.Ay,{size:"small",onClick:()=>{let e=a.current,r=null==e?void 0:e.firstElementChild;if(!e||!r)return;let n=r.clientWidth/t;n&&s(l((e.clientWidth-2)/n))},children:"适应宽度"}),(0,r.jsx)(d.Ay,{size:"small",disabled:1===t,onClick:()=>s(1),children:"原始比例"})]})}function M(e){let{zoom:t,viewportRef:s,children:a}=e;return(0,r.jsx)("div",{ref:s,className:"rounded-xl border border-[var(--borderColor)] bg-[var(--colorBgContainer)] p-3 overflow-auto",style:{maxHeight:"68vh"},children:1===t?a:(0,r.jsx)("div",{style:{zoom:t},children:a})})}function R(e){var t,s,a;let{block:l,parts:n}=e;if("undefined"==typeof DOMParser)return(0,r.jsx)(T,{children:(0,r.jsx)("pre",{style:A,children:l.text})});let c=null!=(a=null==(t=/<[^!?][^>]*?\s([^>]*)>/u.exec(null!=(s=n[l.part])?s:""))?void 0:t[1])?a:'xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"',i=new DOMParser().parseFromString("<root ".concat(c,">").concat(l.xml,"</root>"),"application/xml"),o=i.documentElement.firstElementChild;if(!o||i.querySelector("parsererror"))return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(x.A,{type:"warning",message:"表格XML显示未完成,保留原文及结构供核查"}),(0,r.jsx)(T,{children:(0,r.jsx)("pre",{style:A,children:l.text})})]});let d=[...o.children].filter(e=>"tr"===e.localName).map(e=>{let t=0;return[...e.children].filter(e=>"tc"===e.localName).map(e=>{var s,r,a;let l=Number(null!=(r=null==(s=e.getElementsByTagName("w:gridSpan")[0])?void 0:s.getAttribute("w:val"))?r:1),n=e.getElementsByTagName("w:vMerge")[0],c={column:t,span:l,merge:n?null!=(a=n.getAttribute("w:val"))?a:"continue":void 0,text:[...e.getElementsByTagName("w:t")].map(e=>{var t;return null!=(t=e.textContent)?t:""}).join("")};return t+=l,c})});return(0,r.jsx)("table",{className:"w-full border-collapse my-3 text-sm",children:(0,r.jsx)("tbody",{children:d.map((e,t)=>(0,r.jsx)("tr",{className:"even:bg-[var(--colorFillAlter)]",children:e.filter(e=>"continue"!==e.merge).map(e=>{var s,a;let l=1;if("restart"===e.merge)for(;(null==(a=d[t+l])||null==(s=a.find(t=>t.column===e.column))?void 0:s.merge)==="continue";)l++;return(0,r.jsx)("td",{className:"border border-[var(--borderColor)] p-2 align-top whitespace-pre-wrap",colSpan:e.span,rowSpan:l,children:e.text},e.column)})},t))})})}function I(e){let{sheet:t,zoom:s,viewportRef:l}=e,[n,c]=(0,a.useState)(1),[i,o]=(0,a.useState)(1),d=t.cells.reduce((e,t)=>Math.max(e,t.row),t.merges.reduce((e,t)=>Math.max(e,t.endRow),1)),x=t.cells.reduce((e,t)=>Math.max(e,t.col),t.merges.reduce((e,t)=>Math.max(e,t.endCol),1)),u=(0,a.useMemo)(()=>new Map(t.cells.map(e=>["".concat(e.row,":").concat(e.col),e])),[t]),p=(n-1)*50+1,j=Math.min(d,p+49),v=Math.min(x,i+19);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-3 mb-3 text-xs text-[var(--colorTextSecondary)]",children:[(0,r.jsx)("span",{children:"原工作表物理坐标;公式使用已保存缓存值"}),(0,r.jsxs)("span",{className:"inline-flex items-center gap-2",children:["起始列 ",(0,r.jsx)(h.A,{size:"small",min:1,max:x,value:i,onChange:e=>o(null!=e?e:1)})]})]}),(0,r.jsx)(M,{zoom:s,viewportRef:l,children:(0,r.jsxs)("table",{className:"border-collapse text-xs",children:[(0,r.jsx)("thead",{children:(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{className:"border border-[var(--borderColor)] bg-[var(--colorFillSecondary)] px-2 py-1 sticky top-0 left-0 z-[2]",children:"行"}),Array.from({length:v-i+1},(e,t)=>(0,r.jsxs)("th",{className:"border border-[var(--borderColor)] bg-[var(--colorFillSecondary)] px-2 py-1 sticky top-0 z-[1] min-w-24",children:["C",i+t]},t))]})}),(0,r.jsx)("tbody",{children:Array.from({length:j-p+1},(e,s)=>{let a=p+s;return(0,r.jsxs)("tr",{className:"even:bg-[var(--colorFillAlter)]",children:[(0,r.jsxs)("th",{className:"border border-[var(--borderColor)] bg-[var(--colorFillSecondary)] px-2 py-1 text-[var(--colorTextSecondary)] sticky left-0 z-[1]",children:["R",a]}),Array.from({length:v-i+1},(e,s)=>{var l,n,c;let o=i+s,d=u.get("".concat(a,":").concat(o)),x=t.merges.find(e=>a>=e.startRow&&a<=e.endRow&&o>=e.startCol&&o<=e.endCol);if(x&&(a!==Math.max(p,x.startRow)||o!==Math.max(i,x.startCol)))return null;let h=x?u.get("".concat(x.startRow,":").concat(x.startCol)):d,m=null!=(l=null==h?void 0:h.display)?l:"";return(0,r.jsxs)("td",{className:"border border-[var(--borderColor)] px-2 py-1 whitespace-pre-wrap align-top ".concat("number"==typeof m||"string"==typeof m&&/^-?[\d,]+(\.\d+)?$/u.test(m.trim())?"text-right tabular-nums":""," ").concat(""===m?"bg-[var(--colorFillQuaternary)]":""),rowSpan:x?Math.min(j,x.endRow)-Math.max(p,x.startRow)+1:1,colSpan:x?Math.min(v,x.endCol)-Math.max(i,x.startCol)+1:1,title:"".concat(null!=(n=null==h?void 0:h.address)?n:"R".concat(a,"C").concat(o),"\n原值: ").concat(String(null!=(c=null==h?void 0:h.value)?c:"")).concat((null==h?void 0:h.formula)?"\n公式: =".concat(h.formula):""),children:[m,(null==h?void 0:h.formula)&&(0,r.jsxs)("div",{className:"text-[10px] text-[var(--colorTextTertiary)]",children:["=",h.formula]})]},o)})]},a)})})]})}),(0,r.jsx)("div",{className:"mt-3 flex justify-end",children:(0,r.jsx)(m.A,{size:"small",current:n,pageSize:50,total:d,showSizeChanger:!1,onChange:c})})]})}function F(e){let{frameIds:t,endpoint:s,zoom:l,viewportRef:c}=e,[i,o]=(0,a.useState)(0),[d,h]=(0,a.useState)(""),[m,v]=(0,a.useState)(),[g,f]=(0,a.useState)(""),[y,b]=(0,a.useState)(!1);return(0,a.useEffect)(()=>{let e=!0;h(""),f(""),v(void 0);let r=t[i];if(r)return b(!0),(0,k.x6)("".concat(s,"&frame=").concat(encodeURIComponent(r),"&format=json")).then(t=>{e&&(h(t.image),v(t.receipt))}).catch(t=>{e&&f(String(t))}).finally(()=>{e&&b(!1)}),()=>{e=!1}},[i,t,s]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"mb-3 flex flex-wrap items-center gap-3",children:[(0,r.jsx)(u.A,{size:"small",className:"min-w-64",value:i,onChange:o,options:t.map((e,t)=>({value:t,label:e}))}),(0,r.jsx)("span",{className:"text-xs text-[var(--colorTextSecondary)]",children:"显示实际库内实体与块实例;绘制限制不等同数据丢失。"})]}),(0,r.jsxs)(p.A,{spinning:y,children:[g&&(0,r.jsx)(x.A,{type:"warning",message:"图框显示未完成",description:"".concat(g,";请区分已入库结构和绘制能力,已有库内文字仍可读取。")}),d?(0,r.jsx)(M,{zoom:l,viewportRef:c,children:(0,r.jsx)("div",{className:"bg-white inline-block p-2",children:(0,r.jsx)(n(),{unoptimized:!0,width:2400,height:1800,src:d,alt:"已解析CAD图框",style:{width:"100%",height:"auto",display:"block"}})})}):!y&&!g&&(0,r.jsx)(j.A,{description:"尚未识别到可显示图框"}),void 0!==m&&(0,r.jsxs)("details",{className:"mt-3",children:[(0,r.jsx)("summary",{className:"text-xs cursor-pointer text-[var(--colorTextSecondary)]",children:"本次绘制回执与限制"}),(0,r.jsx)(T,{maxHeight:260,children:(0,r.jsx)("pre",{style:A,children:JSON.stringify(m,null,2)})})]})]})]})}function O(e){let{structure:t,endpoint:s,zoom:l,viewportRef:c}=e,[i,o]=(0,a.useState)(0);if(t.spreadsheet){let e=t.spreadsheet.sheets;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"mb-3",children:(0,r.jsx)(u.A,{size:"small",className:"min-w-64",value:i,options:e.map((e,t)=>({value:t,label:e.name})),onChange:o})}),e[i]&&(0,r.jsx)(I,{sheet:e[i],zoom:l,viewportRef:c},i)]})}if(t.docx)return(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(M,{zoom:l,viewportRef:c,children:(0,r.jsxs)("div",{className:"mx-auto",style:{maxWidth:860},children:[t.docx.blocks.map(e=>(0,r.jsxs)("div",{id:e.id,className:"mb-4",children:[(0,r.jsxs)("div",{className:"mb-1 text-[10px] text-[var(--colorTextTertiary)]",children:[e.part," \xb7 第 ",e.index+1," 块"]}),"table"===e.kind?(0,r.jsx)(R,{block:e,parts:t.docx.parts}):(0,r.jsx)("p",{className:e.headingLevel?"font-semibold text-lg whitespace-pre-wrap mt-2":"whitespace-pre-wrap leading-8 text-sm",children:e.text}),(0,r.jsxs)("details",{children:[(0,r.jsx)("summary",{className:"text-xs cursor-pointer text-[var(--colorTextTertiary)]",children:"来源 XML"}),(0,r.jsx)(T,{maxHeight:260,children:(0,r.jsx)("pre",{style:A,children:e.xml})})]})]},e.id)),t.docx.images.map(e=>(0,r.jsxs)("div",{className:"mb-4",children:[(0,r.jsx)("div",{className:"mb-1 text-xs text-[var(--colorTextSecondary)]",children:e.name}),/^image\/(?:png|jpeg|gif|webp|svg\+xml|bmp)$/u.test(e.mediaType)?(0,r.jsx)(n(),{unoptimized:!0,width:1200,height:900,src:"".concat(s,"&image=").concat(encodeURIComponent(e.name)),alt:e.name,style:{maxWidth:"100%",height:"auto"}}):(0,r.jsx)(x.A,{type:"info",message:"已保留".concat(e.mediaType,"图片数据,浏览器未声明支持显示")})]},e.name))]})})});if(t.pdf){var d,h,p,v;let e=t.pdf.pages,s=e[i],a=null!=(h=null!=(d=null==s?void 0:s.width)?d:null==s?void 0:s.glyphs.reduce((e,t)=>Math.max(e,t.x+t.width+20),600))?h:600,n=null!=(v=null!=(p=null==s?void 0:s.height)?p:null==s?void 0:s.glyphs.reduce((e,t)=>Math.max(e,t.y+t.height+20),800))?v:800;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"mb-3 flex flex-wrap items-center justify-between gap-3",children:[(0,r.jsx)("span",{className:"text-xs text-[var(--colorTextSecondary)]",children:"显示库内已保存文字与位置;可选原版本对照不影响本页及后续生成。"}),(0,r.jsx)(m.A,{size:"small",current:i+1,pageSize:1,total:e.length,showSizeChanger:!1,onChange:e=>o(e-1)})]}),s&&(0,r.jsxs)(M,{zoom:l,viewportRef:c,children:[(0,r.jsx)("div",{className:"mx-auto bg-white shadow-sm border border-[var(--borderColor)]",style:{width:a},children:(0,r.jsx)("svg",{viewBox:"0 0 ".concat(a," ").concat(n),width:"100%",role:"img","aria-label":"解析第".concat(s.page,"页"),children:s.glyphs.map(e=>(0,r.jsx)("text",{x:e.x,y:n-e.y,fontSize:Math.max(6,e.height),children:e.str},e.id))})}),s.ocrText&&(0,r.jsxs)("div",{className:"mt-3",children:[(0,r.jsx)("div",{className:"mb-1 text-xs text-[var(--colorTextSecondary)]",children:"该页 OCR 文本"}),(0,r.jsx)(T,{maxHeight:260,children:(0,r.jsx)("pre",{style:A,children:s.ocrText})})]}),!s.glyphs.length&&!s.ocrText&&(0,r.jsx)(j.A,{description:"该页没有可展示文字,不能据此断言原页为空"})]})]})}return t.cad?(0,r.jsx)(F,{frameIds:t.cad.frameIds,endpoint:s,zoom:l,viewportRef:c}):(0,r.jsx)(j.A,{description:"此解析结果尚无结构显示适配,完整解析文字仍可查看"})}function E(e){let{data:t}=e,s=t.conservation,a=[{key:"chars",label:"文本覆盖",value:"".concat(s.coveredNonWhitespaceChars," / ").concat(s.sourceNonWhitespaceChars," 个非空白字符"),trouble:s.coveredNonWhitespaceChars!==s.sourceNonWhitespaceChars,...s.uncovered.length?{detail:(0,r.jsxs)(r.Fragment,{children:[s.uncovered.slice(0,5).map((e,t)=>(0,r.jsxs)("div",{className:"mb-1",children:["字符 ",e.start,"–",e.end,":",e.text.slice(0,120)]},t)),s.uncovered.length>5?(0,r.jsxs)("div",{children:["…还有 ",s.uncovered.length-5," 段"]}):null]})}:{}},{key:"chunks",label:"切片数",value:"".concat(t.totalChunks," 块(库内登记 ").concat(s.registeredChunkCount,",与底稿一致:").concat(s.chunkCountMatches?"是":"否",")"),trouble:!s.chunkCountMatches},{key:"stale",label:"身份过期的切片",value:s.staleChunkIdentities.length?"".concat(s.staleChunkIdentities.length," 块"):"无",trouble:s.staleChunkIdentities.length>0,...s.staleChunkIdentities.length?{detail:(0,r.jsxs)("div",{children:["切片序号:",s.staleChunkIdentities.slice(0,20).join(", "),s.staleChunkIdentities.length>20?" …":""]})}:{}},{key:"unmapped",label:"未能映射回底稿的切片",value:s.unmapped.length?"".concat(s.unmapped.length," 块"):"无",trouble:s.unmapped.length>0,...s.unmapped.length?{detail:(0,r.jsxs)(r.Fragment,{children:[s.unmapped.slice(0,5).map(e=>(0,r.jsxs)("div",{className:"mb-1",children:["切片 ",e.chunkIndex,":",e.text.slice(0,120)]},e.chunkIndex)),s.unmapped.length>5?(0,r.jsxs)("div",{children:["…还有 ",s.unmapped.length-5," 块"]}):null]})}:{}},{key:"order",label:"切片顺序",value:s.outOfOrderChunks.length?"乱序 ".concat(s.outOfOrderChunks.length," 块"):"与底稿一致",trouble:s.outOfOrderChunks.length>0,...s.outOfOrderChunks.length?{detail:(0,r.jsxs)("div",{children:["切片序号:",s.outOfOrderChunks.slice(0,20).join(", ")]})}:{}},{key:"repeated",label:"重复上下文跨度",value:"".concat(s.repeatedContextSpans," 处"),trouble:!1}];return(0,r.jsx)("div",{className:"flex flex-col",children:a.map(e=>(0,r.jsxs)("div",{className:"flex flex-col sm:flex-row gap-1 sm:gap-3 py-2 border-b border-[var(--colorBorderSecondary)] last:border-0",children:[(0,r.jsx)("div",{className:"sm:w-44 shrink-0 text-xs text-[var(--colorTextTertiary)] sm:pt-0.5",children:e.label}),(0,r.jsxs)("div",{className:"min-w-0 flex-1 text-sm",children:[(0,r.jsx)("span",{className:e.trouble?"text-[var(--colorError)]":"text-[var(--colorText)]",children:e.value}),e.detail&&(0,r.jsxs)("details",{className:"mt-1",children:[(0,r.jsx)("summary",{className:"text-xs cursor-pointer text-[var(--colorTextSecondary)]",children:"展开明细"}),(0,r.jsx)(T,{maxHeight:220,children:(0,r.jsx)("div",{className:"text-xs text-[var(--colorTextSecondary)]",children:e.detail})})]})]})]},e.key))})}function P(){let e=(0,c.useRouter)(),t="string"==typeof e.query.relativePath?e.query.relativePath:"",s="string"==typeof e.query.projectRoot?e.query.projectRoot:"",[l,n]=(0,a.useState)(),[o,h]=(0,a.useState)(""),[u,N]=(0,a.useState)(!1),[w,M]=(0,a.useState)(1),[R,I]=(0,a.useState)("structure"),F=(0,a.useRef)(null),P=(0,a.useRef)(0),_=new URLSearchParams({relativePath:t,...s?{projectRoot:s}:{}}),H="/api/kb/files/source-preview?".concat(_),W="".concat(H).concat((null==l?void 0:l.status)==="recorded"?"&snapshotId=".concat(l.identity.snapshotId):""),B=(0,a.useCallback)(async e=>{let t=++P.current;N(!0),h("");try{let s=await (0,k.x6)(e);t===P.current&&n(s)}catch(e){t===P.current&&h(e instanceof Error?e.message:String(e))}finally{t===P.current&&N(!1)}},[]);(0,a.useEffect)(()=>{n(void 0),t&&B(H)},[t,H,B]);let D=null==l?void 0:l.pdfCoverage,q=D&&"complete"!==D.status?(0,r.jsx)(x.A,{showIcon:!0,type:"warning",message:"unmeasured"===D.status?"PDF 页覆盖未记录":"PDF 页覆盖不完整",description:(0,r.jsxs)(i.A,{direction:"vertical",size:2,children:[D.pageCount?(0,r.jsx)("span",{children:"已处理页:".concat(D.processedPages,"/").concat(D.pageCount)}):(0,r.jsx)("span",{children:'没有记录到声明页数,无法据此断言"处理了几页"。'}),D.missingPages.length>0&&(0,r.jsx)("span",{children:"缺少页:".concat(D.missingPages.join(", "))}),D.failedPages.length>0&&(0,r.jsx)("span",{children:"失败页:".concat(D.failedPages.join(", "))}),(0,r.jsx)("span",{children:"这条读数只说明解析侧处理了哪些页,不证明内容、版式或专业采用正确。"})]})}):null;return(0,r.jsxs)("div",{className:"space-y-5 animateFadeIn",children:[(0,r.jsx)(S.k,{backHref:"/knowledge/file-detail?".concat(_),backLabel:"返回切片详情",title:"解析核查预览",description:t,extra:(0,r.jsxs)(i.A,{wrap:!0,children:["structure"===R&&(0,r.jsx)(z,{zoom:w,onChange:M,viewportRef:F}),(0,r.jsx)(d.Ay,{size:"small",icon:(0,r.jsx)(C.A,{}),onClick:()=>{B(H)},loading:u,children:"刷新"})]})}),o&&(0,r.jsx)(x.A,{type:"error",message:o}),(0,r.jsx)(p.A,{spinning:u,children:(null==l?void 0:l.status)==="not-recorded"?(0,r.jsxs)(v.A,{className:"rounded-2xl border-[var(--borderColor)]",children:[(0,r.jsx)(x.A,{type:"warning",message:"独立解析底稿尚未记录",description:l.reason}),q&&(0,r.jsx)("div",{className:"mt-3",children:q}),(0,r.jsx)(d.Ay,{className:"mt-4",onClick:()=>{(async()=>{try{await (0,k.HC)(t,s||void 0),h("重新解析任务已提交,请在处理完成后刷新本页。")}catch(e){h(String(e))}})()},children:"重新解析此文件"}),(0,r.jsx)("p",{className:"mt-4 mb-2 text-sm text-[var(--colorTextSecondary)]",children:"当前实际库内切片(不是独立底稿):"}),l.chunks.map(e=>(0,r.jsxs)("div",{className:"my-3",children:[(0,r.jsxs)(g.A,{children:["切片 ",e.chunkIndex]}),(0,r.jsx)(T,{children:(0,r.jsx)("pre",{style:A,children:e.content})})]},e.id)),(0,r.jsx)("div",{className:"mt-3 flex justify-end",children:(0,r.jsx)(m.A,{current:Math.floor(l.offset/30)+1,pageSize:30,total:l.totalChunks,showSizeChanger:!1,onChange:e=>{B("".concat(H,"&offset=").concat((e-1)*30))}})})]}):(null==l?void 0:l.status)==="recorded"?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(v.A,{className:"rounded-2xl border-[var(--borderColor)] mb-5",children:[(0,r.jsx)(E,{data:l}),(0,r.jsx)("p",{className:"mt-3 mb-0 text-xs text-[var(--colorTextSecondary)]",children:"这项检查只证明独立解析文字与切片的内容覆盖,不证明原文件解析、版式、工程理解或专业采用全部正确。"}),q&&(0,r.jsx)("div",{className:"mt-3",children:q}),l.identity.limitations.map(e=>(0,r.jsx)("p",{className:"mt-2 mb-0 text-xs text-[var(--colorTextSecondary)]",children:e},e)),(0,r.jsxs)("div",{className:"mt-4 flex flex-wrap items-center gap-2",children:[(0,r.jsx)(d.Ay,{size:"small",href:"".concat(W,"&original=1"),target:"_blank",children:"查看/下载入库原版本"}),(0,r.jsx)(d.Ay,{size:"small",onClick:()=>{(0,k.tn)(t,"source-version",s||void 0).catch(e=>h("可选原版本对照不可用:".concat(String(e),";库内数据仍可读取")))},children:"本机打开入库原版本"})]}),(0,r.jsxs)("details",{className:"mt-4",children:[(0,r.jsx)("summary",{className:"text-xs cursor-pointer text-[var(--colorTextSecondary)]",children:"技术详情(原文件哈希 / 解析版本 / 解析身份 / 核查口径)"}),(0,r.jsx)("div",{className:"mt-3",children:(0,r.jsxs)(f.A,{size:"small",column:1,bordered:!0,styles:{label:{width:"120px",background:"var(--colorFillAlter)",color:"var(--colorTextSecondary)"}},children:[(0,r.jsx)(f.A.Item,{label:"原文件SHA256",children:(0,r.jsx)("span",{className:"break-all text-xs",children:l.identity.sourceHash})}),(0,r.jsx)(f.A.Item,{label:"解析版本",children:(0,r.jsx)("span",{className:"text-xs",children:l.identity.parserVersion})}),(0,r.jsx)(f.A.Item,{label:"解析身份",children:(0,r.jsx)("span",{className:"break-all text-xs",children:l.identity.snapshotId})}),(0,r.jsx)(f.A.Item,{label:"核查口径",children:(0,r.jsxs)("span",{className:"text-xs",children:[l.conservation.version," \xb7 ",l.conservation.scope," \xb7 入库状态 ",l.conservation.ingestionStatus]})}),(0,r.jsx)(f.A.Item,{label:"底稿快照",children:(0,r.jsx)("span",{className:"break-all text-xs",children:l.conservation.snapshotId})})]})})]})]}),(0,r.jsx)(y.A,{className:"documents-tabs",activeKey:R,onChange:I,items:[{key:"structure",label:"解析结构",children:(0,r.jsx)(v.A,{className:"rounded-2xl border-[var(--borderColor)]",onWheelCapture:e=>{(e.ctrlKey||e.metaKey)&&(e.preventDefault(),M(t=>Math.min(4,Math.max(.2,Math.round((t-.1*Math.sign(e.deltaY))*100)/100))))},children:(0,r.jsx)(O,{structure:l.structure,endpoint:W,zoom:w,viewportRef:F},l.identity.snapshotId)})},{key:"chunks",label:"实际切片重组",children:(0,r.jsxs)(v.A,{className:"rounded-2xl border-[var(--borderColor)]",children:[(0,r.jsxs)("p",{className:"text-xs text-[var(--colorTextSecondary)]",children:["当前展示切片 ",l.offset+1," 至 ",l.offset+l.chunks.length,",共 ",l.totalChunks," 块;分页不代表其余内容不存在。"]}),l.chunks.map(e=>(0,r.jsxs)("div",{className:"my-4",children:[(0,r.jsxs)(i.A,{size:4,wrap:!0,children:[(0,r.jsxs)(g.A,{children:["切片 ",e.chunkIndex]}),e.sectionTitle?(0,r.jsx)(g.A,{color:"cyan",children:e.sectionTitle}):null]}),(0,r.jsx)("div",{className:"mt-2",children:(0,r.jsx)(T,{children:(0,r.jsx)("pre",{style:A,children:e.content})})}),(0,r.jsxs)("details",{className:"mt-2",children:[(0,r.jsx)("summary",{className:"text-xs cursor-pointer text-[var(--colorTextTertiary)]",children:"库内解析底稿区间"}),(0,r.jsx)(T,{maxHeight:240,children:(0,r.jsx)("pre",{style:A,children:JSON.stringify(e.sourceSpans,null,2)})})]})]},e.id)),(0,r.jsx)("div",{className:"mt-3 flex justify-end",children:(0,r.jsx)(m.A,{current:Math.floor(l.offset/30)+1,pageSize:30,total:l.totalChunks,showSizeChanger:!1,onChange:e=>{B("".concat(W,"&offset=").concat((e-1)*30))}})})]})}]})]}):u?(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsx)(b.A,{active:!0,title:!1,paragraph:{rows:3}}),(0,r.jsx)(b.A,{active:!0,title:!1,paragraph:{rows:6}})]}):(0,r.jsx)(j.A,{description:"选择文件后查看解析结果"})})]})}},59528:(e,t,s)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/knowledge/source-preview",function(){return s(2232)}])},85979:(e,t,s)=>{"use strict";s.d(t,{k:()=>c});var r=s(65321),a=s(43220),l=s.n(a),n=s(91648);function c(e){let{backHref:t,backLabel:s,title:a,description:c,extra:i}=e;return(0,r.jsx)("div",{className:"mb-6 bg-[var(--colorBgContainer)] rounded-2xl overflow-hidden border border-[var(--borderColor)] p-6",children:(0,r.jsxs)("div",{className:"flex flex-col md:flex-row md:items-end justify-between gap-4 md:gap-6",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3 min-w-0",children:[(0,r.jsxs)(l(),{href:t,prefetch:!1,className:"detailBack",children:[(0,r.jsx)(n.A,{size:16,strokeWidth:2,"aria-hidden":!0}),(0,r.jsx)("span",{children:s})]}),(0,r.jsxs)("div",{className:"min-w-0 space-y-1",children:[(0,r.jsx)("h1",{className:"text-2xl font-bold text-[var(--colorText)] m-0 truncate",children:a}),c?(0,r.jsx)("p",{className:"text-sm text-[var(--colorTextSecondary)] m-0 break-all",children:c}):null]})]}),i?(0,r.jsx)("div",{className:"shrink-0 flex items-center gap-2",children:i}):null]})})}}},e=>{e.O(0,[717,551,665,569,499,787,808,318,955,636,593,792],()=>e(e.s=59528)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[12],{1611:(e,t)=>{"use strict";t.A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M832 64H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V96c0-17.7-14.3-32-32-32zm-600 72h560v208H232V136zm560 480H232V408h560v208zm0 272H232V680h560v208zM304 240a40 40 0 1080 0 40 40 0 10-80 0zm0 272a40 40 0 1080 0 40 40 0 10-80 0zm0 272a40 40 0 1080 0 40 40 0 10-80 0z"}}]},name:"database",theme:"outlined"}},12887:(e,t)=>{"use strict";t.A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494zM504 618H320c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h184c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8zM312 490v48c0 4.4 3.6 8 8 8h384c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H320c-4.4 0-8 3.6-8 8z"}}]},name:"file-text",theme:"outlined"}},13067:(e,t)=>{"use strict";t.A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494zM514.1 580.1l-61.8-102.4c-2.2-3.6-6.1-5.8-10.3-5.8h-38.4c-2.3 0-4.5.6-6.4 1.9-5.6 3.5-7.3 10.9-3.7 16.6l82.3 130.4-83.4 132.8a12.04 12.04 0 0010.2 18.4h34.5c4.2 0 8-2.2 10.2-5.7L510 664.8l62.3 101.4c2.2 3.6 6.1 5.7 10.2 5.7H620c2.3 0 4.5-.7 6.5-1.9 5.6-3.6 7.2-11 3.6-16.6l-84-130.4 85.3-132.5a12.04 12.04 0 00-10.1-18.5h-35.7c-4.2 0-8.1 2.2-10.3 5.8l-61.2 102.3z"}}]},name:"file-excel",theme:"outlined"}},14569:e=>{e.exports={featureLabel:"style_featureLabel__XFSTX",featureValue:"style_featureValue__I_wMP",filterInput:"style_filterInput__4_Elu",filterSelect:"style_filterSelect__vUBJ9",statusCard:"style_statusCard__H7Mee",statusSummary:"style_statusSummary__7KavF",statusSummaryText:"style_statusSummaryText__Shw3j",statusClearBtn:"style_statusClearBtn__uJ9bE",statusExpandBtn:"style_statusExpandBtn__HhgIj",statusFilters:"style_statusFilters__g_LbG",filterPill:"style_filterPill__1pjFW",filterPillActive:"style_filterPillActive___UZVi",statusPanel:"style_statusPanel__9arTu",statusEmpty:"style_statusEmpty__8LWzH",timelineList:"style_timelineList__dqJrz",timelineItem:"style_timelineItem__dbuL_",timelineStatusIcon:"style_timelineStatusIcon__SkRwb",timelinePercent:"style_timelinePercent__pEyH4",timelineRow:"style_timelineRow__EDOVa",timelineTitle:"style_timelineTitle__Yujr8",timelineClose:"style_timelineClose__Byx_9",timelineDetail:"style_timelineDetail__nALei",timelineDesc:"style_timelineDesc__FMjWE",timelinePath:"style_timelinePath__C9VQI",timelineMeta:"style_timelineMeta__u_pCn",timelineMetaTag:"style_timelineMetaTag__G3jF1",timelineExpandArrow:"style_timelineExpandArrow__xIBdF",timelineExpandArrowOpen:"style_timelineExpandArrowOpen__TWWDC",fileNameCell:"style_fileNameCell__EHsnt",folderName:"style_folderName__VhLXP",folderRow:"style_folderRow__d7k9S",searchResultList:"style_searchResultList__cVKZg",searchResultItem:"style_searchResultItem__boj6D",searchResultHeader:"style_searchResultHeader__meVdJ",searchContent:"style_searchContent__XbUVk",pdfPreviewStrip:"style_pdfPreviewStrip__94_eG"}},26619:(e,t,r)=>{"use strict";r.d(t,{A:()=>i});var a=r(97109),l=r(1611),n=r(88483);function s(){return(s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e}).apply(this,arguments)}let i=a.forwardRef((e,t)=>a.createElement(n.A,s({},e,{ref:t,icon:l.A})))},26631:(e,t,r)=>{"use strict";r.d(t,{A:()=>i});var a=r(97109),l=r(12887),n=r(88483);function s(){return(s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e}).apply(this,arguments)}let i=a.forwardRef((e,t)=>a.createElement(n.A,s({},e,{ref:t,icon:l.A})))},30289:(e,t)=>{"use strict";t.A={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"}},35311:(e,t)=>{"use strict";t.A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M456 231a56 56 0 10112 0 56 56 0 10-112 0zm0 280a56 56 0 10112 0 56 56 0 10-112 0zm0 280a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"more",theme:"outlined"}},45551:(e,t,r)=>{"use strict";r.d(t,{Jm:()=>o,fw:()=>n,je:()=>a.j,mc:()=>c,z3:()=>l});var a=r(96538);function l(e){if(0===e)return"0 B";let t=Math.floor(Math.log(e)/Math.log(1024)),r=e/Math.pow(1024,t);return"".concat(r.toFixed(+(0!==t))," ").concat(["B","KB","MB","GB","TB"][t])}function n(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"zh-CN";if(!e||e<=0)return"en-US"===t?"Never":"从未";let r=Math.floor(Math.floor((Date.now()-e)/1e3)/60),a=Math.floor(r/60),l=Math.floor(a/24);return l>30?new Date(e).toLocaleDateString(t):"en-US"===t?l>0?"".concat(l,"d ago"):a>0?"".concat(a,"h ago"):r>0?"".concat(r,"m ago"):"Just now":l>0?"".concat(l," 天前"):a>0?"".concat(a," 小时前"):r>0?"".concat(r," 分钟前"):"刚刚"}let s={document:"文档",spreadsheet:"表格",image:"图片",cad:"图纸",code:"代码",data:"数据",web:"网页",diagram:"图表",archive:"压缩包",other:"其他"},i={document:"Document",spreadsheet:"Spreadsheet",image:"Image",cad:"CAD",code:"Code",data:"Data",web:"Web",diagram:"Diagram",archive:"Archive",other:"Other"};function o(e){var t;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"zh-CN";return null!=(t=("en-US"===r?i:s)[e])?t:e}let c={active:"common.statusIndexed",outdated:"common.statusOutdated",error:"common.statusAbnormal",deleted:"common.statusDeleted",disk:"common.statusNotIndexed"}},48893:(e,t)=>{"use strict";t.A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M553.1 509.1l-77.8 99.2-41.1-52.4a8 8 0 00-12.6 0l-99.8 127.2a7.98 7.98 0 006.3 12.9H696c6.7 0 10.4-7.7 6.3-12.9l-136.5-174a8.1 8.1 0 00-12.7 0zM360 442a40 40 0 1080 0 40 40 0 10-80 0zm494.6-153.4L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494z"}}]},name:"file-image",theme:"outlined"}},53234:(e,t)=>{"use strict";t.A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M832 64H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V96c0-17.7-14.3-32-32-32zm-600 72h560v208H232V136zm560 480H232V408h560v208zm0 272H232V680h560v208zM496 208H312c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h184c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8zM312 544h184c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H312c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8zm328 244a40 40 0 1080 0 40 40 0 10-80 0z"}}]},name:"hdd",theme:"outlined"}},54746:(e,t,r)=>{"use strict";r.d(t,{A:()=>i});var a=r(97109),l=r(71242),n=r(88483);function s(){return(s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e}).apply(this,arguments)}let i=a.forwardRef((e,t)=>a.createElement(n.A,s({},e,{ref:t,icon:l.A})))},56398:(e,t)=>{"use strict";t.A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M505.7 661a8 8 0 0012.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9h-74.1V168c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8zM878 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:"download",theme:"outlined"}},58520:(e,t)=>{"use strict";t.A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494zM528.1 472h-32.2c-5.5 0-10.3 3.7-11.6 9.1L434.6 680l-46.1-198.7c-1.3-5.4-6.1-9.3-11.7-9.3h-35.4a12.02 12.02 0 00-11.6 15.1l74.2 276c1.4 5.2 6.2 8.9 11.6 8.9h32c5.4 0 10.2-3.6 11.6-8.9l52.8-197 52.8 197c1.4 5.2 6.2 8.9 11.6 8.9h31.8c5.4 0 10.2-3.6 11.6-8.9l74.4-276a12.04 12.04 0 00-11.6-15.1H647c-5.6 0-10.4 3.9-11.7 9.3l-45.8 199.1-49.8-199.3c-1.3-5.4-6.1-9.1-11.6-9.1z"}}]},name:"file-word",theme:"outlined"}},58690:(e,t,r)=>{"use strict";function a(e){var t,r,a;let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{defaultPageSize:null!=(t=l.pageSize)?t:10,pageSizeOptions:null!=(r=l.pageSizeOptions)?r:[10,20,50,100],showSizeChanger:!0,showTotal:t=>{var r,a;return e(null!=(r=l.totalLabelKey)?r:"common.totalRows",null!=(a=l.totalLabelFallback)?a:"共 {count} 条").replace("{count}",String(t))},hideOnSinglePage:null!=(a=l.hideOnSinglePage)&&a,showQuickJumper:!1}}r.d(t,{B:()=>a})},61825:(e,t,r)=>{"use strict";r.d(t,{A:()=>i});var a=r(97109),l=r(30289),n=r(88483);function s(){return(s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e}).apply(this,arguments)}let i=a.forwardRef((e,t)=>a.createElement(n.A,s({},e,{ref:t,icon:l.A})))},71242:(e,t)=>{"use strict";t.A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8z"}},{tag:"path",attrs:{d:"M192 474h672q8 0 8 8v60q0 8-8 8H160q-8 0-8-8v-60q0-8 8-8z"}}]},name:"plus",theme:"outlined"}},74183:(e,t,r)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/knowledge",function(){return r(84607)}])},76830:(e,t,r)=>{"use strict";r.d(t,{A:()=>i});var a=r(97109),l=r(56398),n=r(88483);function s(){return(s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e}).apply(this,arguments)}let i=a.forwardRef((e,t)=>a.createElement(n.A,s({},e,{ref:t,icon:l.A})))},84607:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>ei});var a=r(65321),l=r(97109),n=r(39507),s=r(43220),i=r.n(s),o=r(86109),c=r(17807),d=r(25258),u=r(11702),h=r(71102),f=r(85114),m=r(7576),p=r(57271),g=r(33442),v=r(38964),x=r(56768),y=r(48893),b=r(88483);function w(){return(w=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e}).apply(this,arguments)}let j=l.forwardRef((e,t)=>l.createElement(b.A,w({},e,{ref:t,icon:y.A})));var _=r(13067);function z(){return(z=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e}).apply(this,arguments)}let A=l.forwardRef((e,t)=>l.createElement(b.A,z({},e,{ref:t,icon:_.A})));var k=r(58520);function C(){return(C=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e}).apply(this,arguments)}let S=l.forwardRef((e,t)=>l.createElement(b.A,C({},e,{ref:t,icon:k.A})));var M=r(90939);function P(){return(P=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e}).apply(this,arguments)}let O=l.forwardRef((e,t)=>l.createElement(b.A,P({},e,{ref:t,icon:M.A})));var N=r(53234);function H(){return(H=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e}).apply(this,arguments)}let E=l.forwardRef((e,t)=>l.createElement(b.A,H({},e,{ref:t,icon:N.A})));var R=r(61825),F=r(26619),V=r(29606),B=r(26631),T=r(64254),I=r(64629),L=r(58209),D=r(35311);function q(){return(q=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e}).apply(this,arguments)}let U=l.forwardRef((e,t)=>l.createElement(b.A,q({},e,{ref:t,icon:D.A})));var J=r(30486),Q=r(54746),X=r(58740),W=r(38762),K=r(76830),G=r(39219),$=r(22931),Z=r(6578),Y=r(45551),ee=r(14569),et=r.n(ee),er=r(58690),ea=r(93360);let el=["document","spreadsheet","image","cad","code","data","web","diagram","archive","other"],en=/\.(zip|jar|war|apk|tar|gz|tgz|bz2|rar|7z)$/iu,es=/(^|\/)\.DS_Store$|(^|\/)Thumbs\.db$|(^|\/)__MACOSX\/|\.bak$/iu;function ei(){let e=(0,n.Vr)("knowledge"),{locale:t}=(0,n.x_)(),{message:r}=c.A.useApp(),[s,y]=(0,l.useState)(!1),[b,w]=(0,l.useState)([]),[_,z]=(0,l.useState)(""),[k,C]=(0,l.useState)(!1),M=(0,l.useCallback)(async()=>{try{w(await (0,Z.Ls)())}catch(t){r.error(e("ignoreRulesLoadFailed"))}},[e]),P=(0,l.useCallback)(()=>{y(!0),z(""),M()},[M]),N=(0,l.useCallback)(async()=>{let t=_.trim();if(t){C(!0);try{await (0,Z.YO)([t]),z(""),await M(),r.success(e("ignoreRulesAdded"))}catch(t){r.error(e("ignoreRulesSaveFailed"))}finally{C(!1)}}},[_,M,e]),H=(0,l.useCallback)(async t=>{C(!0);try{await (0,Z.Pw)(t),await M(),r.success(e("ignoreRulesDeleted"))}catch(t){r.error(e("ignoreRulesSaveFailed"))}finally{C(!1)}},[M,e]),D=(0,o.useRouter)(),q="string"==typeof D.query.category?D.query.category:"",{stats:ee,reload:ei}=function(){let[e,t]=(0,l.useState)(null),[r,a]=(0,l.useState)(!1),n=(0,l.useCallback)(async()=>{a(!0);try{t(await (0,Z.hc)())}catch(e){}finally{a(!1)}},[]);return(0,l.useEffect)(()=>{n()},[n]),{stats:e,loading:r,reload:n}}(),[eo,ec]=(0,l.useState)([]),[ed,eu]=(0,l.useState)(!1),[eh,ef]=(0,l.useState)(""),[em,ep]=(0,l.useState)(""),[eg,ev]=(0,l.useState)(q),[ex,ey]=(0,l.useState)(!1),[eb,ew]=(0,l.useState)(!1),[ej,e_]=(0,l.useState)([]),[ez,eA]=(0,l.useState)([]),[ek,eC]=(0,l.useState)([]),[eS,eM]=(0,l.useState)({}),eP=(0,l.useRef)(eg),eO=(0,l.useRef)(new Set),eN=(0,l.useRef)(new Map);(0,l.useEffect)(()=>{eP.current=eg},[eg]),(0,l.useEffect)(()=>{ev("string"==typeof D.query.category?D.query.category:"")},[D.query.category]);let eH=(0,l.useCallback)(async()=>{try{let e=await (0,Z.BO)(),t={};for(let r of e)t[r.category]=r.fileCount;eM(t)}catch(e){}},[]);(0,l.useEffect)(()=>{eH()},[eH]);let eE=(0,l.useCallback)(async(e,t)=>{let r=null!=e?e:eP.current;(null==t?void 0:t.silent)||(eu(!0),ef(""));try{let e=await (0,Z.HT)({category:r||void 0,limit:5e3});ec(e.files||[]),e.initializing&&window.setTimeout(()=>{eE(r,{silent:!0})},3e3)}catch(e){(null==t?void 0:t.silent)||(ec([]),ef(e instanceof Error?e.message:"文件列表加载失败"))}finally{(null==t?void 0:t.silent)||eu(!1)}},[]);(0,l.useEffect)(()=>{eE(eg)},[eg,eE]);let eR=(0,l.useCallback)(async e=>{await eE(void 0,e),ei(),eH()},[eH,eE,ei]),eF=e=>"document"===e.type?null:{id:e.id,type:e.type,title:e.title,description:e.message,status:e.status,percent:e.percent,filePath:e.filePath,chunkCount:e.chunkCount,textLength:e.textLength,extractionMode:e.extractionMode,error:e.error,createdAt:e.createdAt},eV=(0,l.useCallback)(async()=>{try{let t=await (0,Z.Qx)(),r=t.operations.map(eF).filter(e=>!!e);for(let r of[...eO.current]){var e;let a=t.operations.find(e=>e.id===r);if(!a)continue;let l="".concat(a.status,":").concat(a.stage),n=null!=(e=eN.current.get(r))?e:"";"success"===a.status||"error"===a.status?(eO.current.delete(r),eN.current.delete(r),eR({silent:!0})):l!==n&&(eN.current.set(r,l),eR({silent:!0}))}e_(e=>{let t=new Set(r.map(e=>e.id).filter(Boolean)),a=r.map(t=>{var r;let a=e.find(e=>e.id===t.id);return a?{...a,...t,createdAt:null!=(r=a.createdAt)?r:t.createdAt}:t}),l=e.filter(e=>e.id&&!t.has(e.id)&&"processing"===e.status);return[...a,...l].slice(0,50)})}catch(e){}},[eR]),eB=(0,l.useCallback)(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];e_(r=>{let a=r.findIndex(r=>e.id&&r.id===e.id||t.includes(r.title));if(a>=0){var l;let t=[...r];return t[a]={...r[a],...e,createdAt:null!=(l=r[a].createdAt)?l:e.createdAt},t}return[e,...r].slice(0,50)})},[]);(0,l.useEffect)(()=>{eV()},[eV]);let eT=(0,l.useMemo)(()=>{let e=0,t=0,r=0;for(let a of ej)"processing"===a.status?e++:"success"===a.status?t++:("error"===a.status||"warning"===a.status)&&r++;return{processing:e,success:t,error:r}},[ej]);(0,l.useEffect)(()=>{if(0===eT.processing)return;let e=window.setInterval(()=>{eV()},2e3),t=window.setInterval(()=>{eR({silent:!0})},8e3);return()=>{window.clearInterval(e),window.clearInterval(t)}},[eV,eR,eT.processing]);let eI=async e=>{let t=e.filter(e=>{let t=e.webkitRelativePath||e.name;return e.size>0&&!en.test(e.name)&&!es.test(t)}),a=e.length-t.length;if(a>0&&r.warning("已跳过 ".concat(a," 个空文件、系统文件、备份文件或压缩包")),0===t.length)return;let l=1===t.length?t[0].name:"".concat(t.length," 个文件");ey(!0);let n="".concat(Date.now(),"-").concat(Math.random().toString(36).slice(2));eO.current.add(n),eN.current.set(n,""),eB({id:n,type:"upload",title:"上传 ".concat(l),description:"等待上传、解析、切片和入库;同路径文件会更新,其他已有文件不会清除",status:"processing",percent:5});try{await (0,Z.c1)(t,void 0,n,e=>{eB({id:n,type:"upload",title:"上传 ".concat(l),description:"正在上传文件:".concat(e.uploadedFiles,"/").concat(e.totalFiles,",批次 ").concat(e.batchIndex+1,"/").concat(e.totalBatches),status:"processing",percent:Math.min(5,Math.max(1,Math.round(e.uploadedFiles/Math.max(1,e.totalFiles)*5)))})});let e=em||eg?"当前筛选(".concat([em?"搜索「".concat(em,"」"):"",eg?"分类「".concat(eg,"」"):""].filter(Boolean).join(" + "),")不会自动清空——新文件若未出现在列表里,调整筛选即可看到"):"新文件会随解析进度出现在列表里";r.info("文件已上传,正在后台解析、切片和入库;同路径文件会更新,其他已有文件不会清除,可在顶部“后台任务”查看进度。".concat(e)),await eV()}catch(e){if(e instanceof Z.NH){let t=e.failures.slice(0,3).map(e=>"批次 ".concat(e.batchIndex+1,"(").concat(e.files.join("、")).concat(e.files.length<5?"":" 等","):").concat(e.message)).join(";");r.warning("".concat(e.message,",失败文件可重新选择上传")),eB({id:n,type:"upload",title:"部分文件上传失败 ".concat(l),description:t||e.message,status:"warning",percent:100,error:t||e.message})}else{eO.current.delete(n),eN.current.delete(n);let t=e instanceof Error?e.message:"请重试或检查文件格式";r.error(t||"上传失败"),eB({id:n,type:"error",title:"上传失败 ".concat(l),description:t,status:"error",percent:100})}}finally{ey(!1),eR({silent:!0})}},eL=async()=>{ew(!0);let e="reindex-ui-".concat(Date.now());eB({id:e,type:"reindex",title:"重新解析入库",description:"正在提交后台任务",status:"processing",percent:5});try{var t;let a=await (0,Z.H1)(),l=a.operationId||e,n=a.job;r.info(a.alreadyRunning?"已有重新解析任务正在后台执行":"已提交重新解析入库任务,可在顶部“后台任务”查看进度"),eB({id:l,type:"reindex",title:(null==n?void 0:n.title)||"重新解析入库",description:(null==n?void 0:n.message)||"后台将重新扫描文件、解析、切片并重建索引",status:(null==n?void 0:n.status)||"processing",percent:null!=(t=null==n?void 0:n.percent)?t:10,error:null==n?void 0:n.error},["重新解析入库"]);for(let e=0;e<360;e++){let e=await (0,Z.ax)(l).then(e=>e.job).catch(async()=>(await (0,Z.Qx)()).operations.find(e=>e.id===l));if(e){let t="success"===e.status||"error"===e.status;if(eB({id:l,type:"error"===e.status?"error":"reindex",title:"success"===e.status?"重新解析入库完成":"error"===e.status?"重新解析入库失败":e.title,description:e.error||e.message,status:e.status,percent:e.percent,filePath:e.filePath,chunkCount:e.chunkCount,error:e.error}),t){"success"===e.status?r.success(e.message||"重新解析入库完成"):r.error(e.error||e.message||"重新解析入库失败");break}}await new Promise(e=>setTimeout(e,1e3))}await eR(),await eV()}catch(a){let t=a instanceof Error?a.message:"重新解析入库失败";r.error(t),eB({id:e,type:"error",title:"重新解析入库失败",description:t,status:"error",percent:100},["重新解析入库","重新解析入库完成","重新解析入库失败"])}finally{ew(!1)}},eD=async function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a="file-reindex-ui-".concat(Date.now(),"-").concat(Math.random().toString(36).slice(2));eB({id:a,type:"reindex",title:"".concat(t?"重新解析文件夹":"重新解析"," ").concat(e),description:t?"正在提交文件夹后台任务":"正在提交单文件后台任务",status:"processing",percent:5,filePath:e});try{var l;let t=await (0,Z.HC)(e),n=t.operationId||a,s=t.job;r.info(t.alreadyRunning?"已有知识库任务正在后台执行":"已提交单文件重新解析任务"),eB({id:n,type:"reindex",title:(null==s?void 0:s.title)||"重新解析 ".concat(e),description:(null==s?void 0:s.message)||"后台将重新解析、分块并入库该文件",status:(null==s?void 0:s.status)||"processing",percent:null!=(l=null==s?void 0:s.percent)?l:10,filePath:(null==s?void 0:s.filePath)||e,chunkCount:null==s?void 0:s.chunkCount,error:null==s?void 0:s.error},["重新解析 ".concat(e)]);for(let t=0;t<240;t++){let t=await (0,Z.ax)(n).then(e=>e.job).catch(async()=>(await (0,Z.Qx)()).operations.find(e=>e.id===n));if(t){let a="success"===t.status||"error"===t.status;if(eB({id:n,type:"error"===t.status?"error":"reindex",title:"success"===t.status?"重新解析完成 ".concat(e):"error"===t.status?"重新解析失败 ".concat(e):t.title,description:t.error||t.message,status:t.status,percent:t.percent,filePath:t.filePath||e,chunkCount:t.chunkCount,error:t.error}),await eE(),a){"success"===t.status?r.success(t.message||"单文件重新解析完成"):r.error(t.error||t.message||"单文件重新解析失败");break}}await new Promise(e=>setTimeout(e,1e3))}await eR(),await eV()}catch(l){let t=l instanceof Error?l.message:"单文件重新解析失败";r.error(t),eB({id:a,type:"error",title:"重新解析失败 ".concat(e),description:t,status:"error",percent:100,filePath:e},["重新解析 ".concat(e)])}},eq=t=>{let a="selected"===t?e0:"filtered"===t?eJ.map(e=>e.relativePath):[],l=eo.length;if("all"!==t&&0===a.length||"all"===t&&0===l)return void r.info("没有可删除的文件");let n="all"===t?"删除全部文件 ".concat(l," 个?"):"filtered"===t?"删除当前筛选结果中的文件 ".concat(a.length," 个?"):"删除已选文件 ".concat(a.length," 个?");d.A.confirm({title:n,content:"将同时删除文件、切片、索引和向量记录。此操作不可撤销。",okText:e("common.delete"),cancelText:e("common.cancel"),okButtonProps:{danger:!0},onOk:async()=>{e_(e=>[{type:"delete",title:n,description:"正在批量删除文件和索引",status:"processing",percent:10},...e].slice(0,50));try{var e;let n=null!=(e=("all"===t?await (0,Z.X8)():"selected"===t?await (0,Z.tZ)(eY,eZ):await (0,Z.SJ)(a)).deleted)?e:"all"===t?l:a.length;r.success("已删除 ".concat(n," 个文件")),eA([]),e_(e=>[{type:"delete",title:"批量删除完成",description:"已删除 ".concat(n," 个文件、切片和索引"),status:"success"},...e].slice(0,50)),await eR(),await eV()}catch(t){let e=t instanceof Error&&t.message?t.message:"批量删除失败";r.error(e),e_(t=>[{type:"error",title:"批量删除失败",description:e,status:"error"},...t].slice(0,50))}}})},eU=async()=>{if(0===eY.length&&0===eZ.length)return;let t=r.loading(e("exporting"),0);try{let{blob:t,fileName:a,exported:l,skipped:n}=await (0,Z.G8)({relativePaths:eY,folderPaths:eZ}),s=URL.createObjectURL(t),i=document.createElement("a");i.href=s,i.download=a,document.body.appendChild(i),i.click(),i.remove(),URL.revokeObjectURL(s),n>0?r.warning(e("exportParsedSkipped").replace("{count}",String(n))):r.success(e("exportParsedSuccess").replace("{count}",String(l)))}catch(t){r.error(t instanceof Error&&t.message?t.message:e("exportParsedFailed"))}finally{t()}},eJ=(0,l.useMemo)(()=>em?eo.filter(e=>e.relativePath.toLowerCase().includes(em.toLowerCase())):eo,[em,eo]),eQ=(0,l.useMemo)(()=>new Set(eJ.map(e=>e.relativePath)),[eJ]),eX=(0,l.useMemo)(()=>eo.filter(e=>"error"===e.status).length,[eo]),eW=(0,l.useMemo)(()=>{let r=el.filter(e=>"other"!==e),a=Object.keys(eS).filter(e=>!r.includes(e)&&"other"!==e);return[{label:e("allCategories"),value:""},...[...r,...a,"other"].map(e=>{var r;let a=null!=(r=eS[e])?r:0,l=(0,Y.Jm)(e,t);return{label:a>0?"".concat(l," (").concat(a,")"):l,value:e}})]},[eS,t,e]),eK=(0,l.useMemo)(()=>{let e={};for(let r of[...eJ].sort((e,t)=>e.relativePath.localeCompare(t.relativePath))){let a=r.relativePath.split("/"),l="";for(let n=0;n<a.length;n++){let s=a[n],i=l;l=l?"".concat(l,"/").concat(s):s;let o=n===a.length-1;if(e[l])o||e[l].isFolder?o&&(e[l].isFolder=!1,e[l].file=r,e[l].fileCount=1,e[l].totalSize=r.fileSize,e[l].totalChunks=r.chunkCount):(e[l].isFolder=!0,e[l].children=[],e[l].fileCount=0,e[l].totalSize=0,e[l].totalChunks=0);else{var t;e[l]={key:l,name:s,isFolder:!o,...o?{file:r,fileCount:1,totalSize:r.fileSize,totalChunks:r.chunkCount}:{children:[],fileCount:0,totalSize:0,totalChunks:0}},i&&(null==(t=e[i])?void 0:t.children)&&e[i].children.push(e[l])}}}let r=e=>{for(let n of e)if(n.children){r(n.children);let e=0,s=0,i=0;for(let r of n.children){var t,a,l;e+=null!=(t=r.fileCount)?t:0,s+=null!=(a=r.totalSize)?a:0,i+=null!=(l=r.totalChunks)?l:0}n.fileCount=e,n.totalSize=s,n.totalChunks=i}},a=e=>e.map(e=>e.children?{...e,children:a(e.children)}:e).filter(e=>{var t,r,a;return!e.isFolder||(null!=(r=e.fileCount)?r:0)>0&&(null!=(a=null==(t=e.children)?void 0:t.length)?a:0)>0}),l=Object.values(e).filter(e=>!e.key.includes("/"));return r(l),a(l)},[eJ]),eG=(0,l.useMemo)(()=>{let e=[],t=r=>{for(let a of r)e.push(a.key),a.children&&t(a.children)};return t(eK),e},[eK]),e$=(0,l.useMemo)(()=>new Set([...eQ,...eG]),[eG,eQ]),eZ=(0,l.useMemo)(()=>ez.map(String).filter(e=>!eQ.has(e)&&eG.includes(e)),[eG,ez,eQ]),eY=(0,l.useMemo)(()=>ez.map(String).filter(e=>eQ.has(e)),[ez,eQ]),e0=(0,l.useMemo)(()=>{let e=new Set;for(let t of eY){let r=eo.find(e=>e.relativePath===t);r&&e.add(r.relativePath)}for(let t of eZ){let r="".concat(t,"/");for(let t of eo)t.relativePath.startsWith(r)&&e.add(t.relativePath)}return Array.from(e)},[eo,eY,eZ]),e1=e0.length;(0,l.useEffect)(()=>{eA(e=>e.filter(e=>e$.has(String(e))))},[e$]);let e4=(0,l.useRef)(em);(0,l.useEffect)(()=>{e4.current!==em&&(e4.current=em,eC(em?eG:[]))},[em,eG]);let e2=(e,t)=>{eC(r=>e?[...r,t.key]:r.filter(e=>e!==t.key))},e3=[{title:e("fileName"),dataIndex:"name",key:"name",render:(e,t)=>(0,a.jsxs)("span",{className:et().fileNameCell,children:[t.isFolder?(0,a.jsx)("span",{style:{cursor:"pointer"},onClick:e=>{e.stopPropagation(),e2(!ek.includes(t.key),t)},children:(e=>{let t=e.children;return t&&0!==t.length?(0,a.jsx)(T.A,{style:{color:"#fa8c16",fontSize:15}}):(0,a.jsx)(V.A,{style:{color:"#fa8c16",fontSize:15}})})(t)}):(e=>{if(!e)return(0,a.jsx)(x.A,{style:{fontSize:15}});let t=e.category;return"image"===t?(0,a.jsx)(j,{style:{color:"#eb2f96",fontSize:15}}):"spreadsheet"===t?(0,a.jsx)(A,{style:{color:"#52c41a",fontSize:15}}):"document"===t?(0,a.jsx)(S,{style:{color:"#1677ff",fontSize:15}}):"code"===t?(0,a.jsx)(O,{style:{color:"#fa8c16",fontSize:15}}):"archive"===t?(0,a.jsx)(E,{style:{color:"#8c8c8c",fontSize:15}}):"web"===t?(0,a.jsx)(R.A,{style:{color:"#13c2c2",fontSize:15}}):"data"===t?(0,a.jsx)(F.A,{style:{color:"#722ed1",fontSize:15}}):"cad"===t?(0,a.jsx)(V.A,{style:{color:"#fa541c",fontSize:15}}):"diagram"===t?(0,a.jsx)(j,{style:{color:"#a0d911",fontSize:15}}):(0,a.jsx)(B.A,{style:{fontSize:15}})})(t.file),t.isFolder?(0,a.jsx)("span",{className:et().folderName,onClick:e=>{e.stopPropagation(),e2(!ek.includes(t.key),t)},children:t.name}):(0,a.jsx)(a.Fragment,{children:(0,a.jsx)(i(),{className:"min-w-0 max-w-[520px] whitespace-normal break-words leading-relaxed",href:"/knowledge/file-detail?relativePath=".concat(encodeURIComponent(t.key)),children:t.name})})]})},{title:e("fileCategory"),dataIndex:"category",key:"cat",width:110,render:(e,r)=>{var l,n;return r.isFolder?(0,a.jsx)("span",{style:{color:"var(--colorTextQuaternary)"},children:"—"}):(0,a.jsx)(u.A,{children:(0,Y.Jm)(null!=(n=null==(l=r.file)?void 0:l.category)?n:"",t)})}},{title:e("fileSize"),dataIndex:"fileSize",key:"size",width:90,render:(e,t)=>{var r,a,l;return(0,Y.z3)(t.isFolder?null!=(a=t.totalSize)?a:0:null!=(l=null==(r=t.file)?void 0:r.fileSize)?l:0)}},{title:e("chunksCount"),dataIndex:"chunkCount",key:"chunks",width:80,render:(e,t)=>{var r,l,n;let s=t.isFolder?null!=(l=t.totalChunks)?l:0:null!=(n=null==(r=t.file)?void 0:r.chunkCount)?n:0;return(0,a.jsx)(u.A,{color:s>1?"green":"orange",children:s})}},{title:e("parsingStatus"),dataIndex:"status",key:"status",width:100,render:(e,t)=>{var r,l,n,s;return t.isFolder?(0,a.jsx)("span",{style:{color:"var(--colorTextQuaternary)"},children:"—"}):(0,a.jsx)(u.A,{color:"active"===(s=null==(r=t.file)?void 0:r.status)?"green":"processing"===s||"indexing"===s?"blue":"error"===s?"red":"orange",children:(null==(l=t.file)?void 0:l.errorMessage)||(null==(n=t.file)?void 0:n.status)||"—"})}},{title:e("fileDate"),dataIndex:"mtime",key:"date",width:130,render:(e,r)=>{var l;return r.isFolder?(0,a.jsx)("span",{style:{color:"var(--colorTextQuaternary)"},children:"—"}):(null==(l=r.file)?void 0:l.mtime)?new Date(r.file.mtime).toLocaleDateString(t):"—"}},{title:e("source"),key:"source",width:100,render:(t,r)=>r.isFolder?(0,a.jsx)("span",{style:{color:"var(--colorTextQuaternary)"},children:"—"}):(0,a.jsx)(u.A,{color:"cyan",children:e("fileSource")})},{title:"",key:"act",width:80,align:"center",render:(t,l)=>{var n;return(0,a.jsx)(h.A,{menu:{items:l.isFolder?[{key:"reindex-folder",label:"重新索引文件夹",icon:(0,a.jsx)(I.A,{}),disabled:(null!=(n=l.fileCount)?n:0)===0,onClick:()=>{eD(l.key,!0)}}]:[{key:"reindex",label:e("reindex"),icon:(0,a.jsx)(I.A,{}),onClick:()=>{eD(l.file.relativePath)}},{type:"divider"},{key:"delete",label:e("delete"),icon:(0,a.jsx)(L.A,{}),danger:!0,onClick:()=>{var t;return t=l.file,void d.A.confirm({title:e("delete"),content:e("deleteConfirm"),okText:e("common.confirm"),cancelText:e("common.cancel"),okButtonProps:{danger:!0},onOk:async()=>{e_(e=>[{type:"delete",title:"删除 ".concat(t.relativePath),description:"正在删除文件记录",status:"processing"},...e].slice(0,50));try{await (0,Z.xq)(t.relativePath),r.success("已删除"),e_(e=>[{type:"delete",title:"删除完成 ".concat(t.relativePath),description:"文件和索引记录已移除",status:"success"},...e].slice(0,50)),eA([]),await eR(),await eV()}catch(a){let e=a instanceof Error&&a.message?a.message:"删除失败";r.error(e),e_(r=>[{type:"error",title:"删除失败 ".concat(t.relativePath),description:e,status:"error"},...r].slice(0,50))}}})}}]},trigger:["click"],children:(0,a.jsx)(f.Ay,{type:"text",size:"small",icon:(0,a.jsx)(U,{})})})}}],e6=(0,a.jsxs)("div",{className:"flex flex-1 md:flex-none w-full md:w-auto items-center gap-3",children:[(0,a.jsx)(m.A,{placeholder:e("searchPlaceholder"),prefix:(0,a.jsx)(J.A,{className:"text-[var(--colorTextTertiary)]"}),value:em,onChange:e=>{ep(e.target.value)},allowClear:!0,variant:"borderless",className:"max-w-[420px] flex-1 bg-transparent hover:bg-transparent focus:bg-transparent",style:{borderBottom:"1px solid var(--borderColor)",borderRadius:0,paddingLeft:0,paddingRight:0}}),(0,a.jsx)(p.A,{value:eg||void 0,onChange:e=>{ev(e||"")},placeholder:e("filterCategory"),allowClear:!0,style:{width:170},variant:"borderless",options:eW}),(0,a.jsx)("div",{className:"w-[1px] h-6 bg-[var(--borderColor)] mx-1"}),(0,a.jsx)(h.A,{menu:{items:[{key:"file",label:e("uploadFiles"),icon:(0,a.jsx)(x.A,{}),onClick:()=>{var e;return null==(e=document.getElementById("kb-file-upload-input"))?void 0:e.click()}},{key:"folder",label:e("uploadFolder"),icon:(0,a.jsx)(V.A,{}),onClick:()=>{var e;return null==(e=document.getElementById("kb-folder-upload-input"))?void 0:e.click()}},{type:"divider"},{key:"reindex",label:e("reindexAll"),icon:(0,a.jsx)(I.A,{}),onClick:()=>{eL()},danger:!0}]},trigger:["click"],children:(0,a.jsx)(f.Ay,{type:"primary",icon:(0,a.jsx)(Q.A,{}),loading:ex||eb,className:"rounded-md px-4",children:e("new")})}),(0,a.jsx)("input",{id:"kb-file-upload-input",type:"file",multiple:!0,hidden:!0,accept:".pdf,.doc,.docx,.txt,.md,.csv,.tsv,.xls,.xlsx,.png,.jpg,.jpeg,.webp,.svg,.dwg,.dxf,.step,.stp,.iges,.igs,.js,.ts,.tsx,.jsx,.py,.go,.java,.cs,.cpp,.c,.h,.json,.jsonl,.yaml,.yml,.xml,.html,.htm,.drawio,.dio,.vsdx,.vdx,.puml,.plantuml,.mmd,.mermaid,.excalidraw",onChange:e=>{var t;let r=Array.from(null!=(t=e.target.files)?t:[]);e.target.value="",eI(r)}}),(0,a.jsx)("input",{id:"kb-folder-upload-input",type:"file",multiple:!0,hidden:!0,webkitdirectory:"",onChange:e=>{var t;let r=Array.from(null!=(t=e.target.files)?t:[]);e.target.value="",eI(r)}})]}),e8=[{icon:(0,a.jsx)(x.A,{}),label:e("totalFiles"),value:ee?String(ee.fileCount):"—"},{icon:(0,a.jsx)(F.A,{}),label:e("totalChunks"),value:ee?String(ee.chunkCount):"—"},{icon:(0,a.jsx)(E,{}),label:e("totalSize"),value:ee?(0,Y.z3)(ee.totalSizeBytes):"—"},{icon:(0,a.jsx)(X.A,{}),label:e("lastIndexed"),value:ee?ee.lastIndexedAt?(0,Y.fw)(ee.lastIndexedAt,t):e("common.never"):"—"}];return(0,a.jsxs)("div",{className:"h-[calc(100vh_-_240px)] flex flex-col",children:[(0,a.jsx)(ea.z,{title:e("title"),description:e("description"),extra:e6}),(0,a.jsx)("div",{className:"bg-[var(--colorBgContainer)] rounded-2xl border border-[var(--borderColor)] px-6 py-5 mb-4 shrink-0 animateFadeIn",children:(0,a.jsx)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-6 stagger-1",children:e8.map(e=>(0,a.jsxs)("div",{className:"flex items-center gap-4",children:[(0,a.jsx)("div",{className:"w-12 h-12 rounded-xl bg-[var(--colorBgHover)] flex items-center justify-center text-xl text-[var(--colorTextSecondary)]",children:e.icon}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("div",{className:"text-[11px] font-semibold text-[var(--colorTextTertiary)] uppercase tracking-wider mb-1",children:e.label}),(0,a.jsx)("div",{className:"text-xl font-bold text-[var(--colorText)] leading-none truncate",children:e.value})]})]},e.label))})}),eh&&(0,a.jsx)("div",{role:"alert",className:"p-4 mb-4 bg-[var(--colorDanger)]/10 text-[var(--colorDanger)] rounded-xl border border-[var(--colorDanger)]/20",children:eh}),(0,a.jsxs)("div",{className:"flex-1 min-h-0 bg-[var(--colorBgContainer)] rounded-2xl border border-[var(--borderColor)] overflow-hidden flex flex-col animateFadeIn stagger-3",style:{opacity:0},children:[(0,a.jsxs)("div",{className:"flex flex-wrap justify-between items-center gap-3 p-4 bg-[var(--colorBgHover)] border-b border-[var(--borderColor)] shrink-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 text-xs text-[var(--colorTextSecondary)] font-medium",children:[(0,a.jsx)("span",{children:e("showingMatchingFiles").replace("{count}",String(eJ.length))}),eX>0&&(0,a.jsxs)(u.A,{color:"red",icon:(0,a.jsx)(W.A,{}),className:"m-0 border-0",children:[e("parsingErrors")," ",eX]})]}),(0,a.jsxs)(g.A,{size:8,children:[e1>0&&(0,a.jsxs)(f.Ay,{size:"small",icon:(0,a.jsx)(K.A,{}),onClick:()=>void eU(),className:"rounded-lg",children:[e("exportParsed")," (",e1,")"]}),e1>0&&(0,a.jsxs)(f.Ay,{danger:!0,size:"small",icon:(0,a.jsx)(L.A,{}),onClick:()=>eq("selected"),className:"rounded-lg",children:[e("deleteSelected")," (",e1,")"]}),(0,a.jsx)(f.Ay,{danger:!0,size:"small",disabled:0===eo.length,onClick:()=>eq("all"),className:"rounded-lg",children:e("deleteAll")}),(0,a.jsx)(f.Ay,{size:"small",onClick:P,className:"rounded-lg",children:e("ignoreRules")})]})]}),(0,a.jsx)(v.A,{rowKey:"key",columns:e3,dataSource:eK,loading:ed&&!ex&&!eb,size:"middle",className:"flex-1 border-0 tableFillHeight",expandable:{expandedRowKeys:ek,onExpand:e2,expandIcon:e=>{let{expanded:t,onExpand:r,record:l}=e;return l.isFolder?(0,a.jsx)("button",{type:"button",onClick:e=>r(l,e),className:"w-6 h-6 mr-1 inline-flex items-center justify-center align-middle text-[var(--colorTextTertiary)] hover:text-[var(--colorText)] transition-colors bg-transparent border-0 p-0 leading-none",children:t?(0,a.jsx)(G.A,{size:16}):(0,a.jsx)($.A,{size:16})}):null}},locale:{emptyText:eh?"—":ed?e("common.loading"):em?e("emptySearch"):e("noFiles")},pagination:(0,er.B)(e,{totalLabelKey:"knowledge.topLevelCount",totalLabelFallback:"共 {count} 个顶层项目"}),rowClassName:e=>"hover:bg-[var(--colorBgHover)] transition-colors ".concat(e.isFolder?"font-medium bg-[var(--colorBgSecondary)]/30":""),rowSelection:{selectedRowKeys:ez,onChange:eA,checkStrictly:!1,getCheckboxProps:e=>{var t;return{disabled:!!e.isFolder&&(null!=(t=e.fileCount)?t:0)===0}}}})]}),(0,a.jsxs)(d.A,{title:e("ignoreRules"),open:s,onCancel:()=>y(!1),footer:null,width:560,children:[(0,a.jsx)("p",{className:"text-xs text-[var(--colorTextSecondary)] m-0 mb-3",children:e("ignoreRulesHint")}),(0,a.jsxs)(g.A.Compact,{style:{width:"100%"},className:"mb-3",children:[(0,a.jsx)(m.A,{value:_,onChange:e=>z(e.target.value),onPressEnter:()=>void N(),placeholder:e("ignoreRulesPlaceholder"),"aria-label":e("ignoreRulesAdd")}),(0,a.jsx)(f.Ay,{type:"primary",loading:k,onClick:()=>void N(),children:e("ignoreRulesAdd")})]}),0===b.length?(0,a.jsx)("p",{className:"text-xs text-[var(--colorTextTertiary)] m-0",children:e("ignoreRulesEmpty")}):(0,a.jsx)("ul",{className:"m-0 p-0 list-none flex flex-col gap-2",children:b.map(t=>(0,a.jsxs)("li",{className:"flex items-center justify-between gap-3 rounded-lg border border-[var(--borderColor)] px-3 py-2",children:[(0,a.jsx)("code",{className:"text-xs break-all",children:t}),(0,a.jsx)(f.Ay,{size:"small",danger:!0,type:"text",disabled:k,onClick:()=>void H(t),children:e("ignoreRulesDelete")})]},t))})]})]})}},90939:(e,t)=>{"use strict";t.A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M516 673c0 4.4 3.4 8 7.5 8h185c4.1 0 7.5-3.6 7.5-8v-48c0-4.4-3.4-8-7.5-8h-185c-4.1 0-7.5 3.6-7.5 8v48zm-194.9 6.1l192-161c3.8-3.2 3.8-9.1 0-12.3l-192-160.9A7.95 7.95 0 00308 351v62.7c0 2.4 1 4.6 2.9 6.1L420.7 512l-109.8 92.2a8.1 8.1 0 00-2.9 6.1V673c0 6.8 7.9 10.5 13.1 6.1zM880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"code",theme:"outlined"}},93360:(e,t,r)=>{"use strict";r.d(t,{z:()=>n});var a=r(65321);r(97109);var l=r(33442);function n(e){let{title:t,description:r,extra:n,bottomContent:s}=e;return(0,a.jsxs)("div",{className:"animateFadeIn",children:[(0,a.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-end justify-between gap-4 pb-6 border-b border-[var(--borderColor)]",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("h1",{className:"text-3xl font-extrabold tracking-tight text-[var(--colorText)] mb-2",children:t}),r&&(0,a.jsx)("p",{className:"text-sm text-[var(--colorTextSecondary)] m-0",children:r})]}),n&&(0,a.jsx)(l.A,{className:"w-full sm:w-auto overflow-x-auto pb-1 sm:pb-0 shrink-0",size:"middle",wrap:!1,children:n})]}),s&&(0,a.jsx)("div",{className:"mt-6",children:s})]})}},96538:(e,t,r)=>{"use strict";r.d(t,{a:()=>l,j:()=>n});let a={coarse:function(e,t){let r=Math.floor(e/1e3),a=Math.floor(r/86400),l=Math.floor(r%86400/3600),n=Math.floor(r%3600/60),s="en-US"===t;return a>0?s?"".concat(a,"d ").concat(l,"h"):"".concat(a," 天 ").concat(l," 小时"):l>0?s?"".concat(l,"h ").concat(n,"m"):"".concat(l," 小时 ").concat(n," 分"):n>0?s?"".concat(n,"m"):"".concat(n," 分"):s?"Just now":"刚刚"},fine:function(e){let t=Math.round(e/1e3);if(t<60)return"".concat(t," 秒");let r=Math.floor(t/60);return r<60?"".concat(r," 分 ").concat(t%60," 秒"):"".concat(Math.floor(r/60)," 小时 ").concat(r%60," 分")},"fine-decimal":function(e){return e>=6e4?"".concat(Math.floor(e/6e4)," 分 ").concat(Math.round(e%6e4/1e3)," 秒"):"".concat((e/1e3).toFixed(1)," 秒")},metric:function(e){return e<1e3?"".concat(Math.round(e),"ms"):e<6e4?"".concat((e/1e3).toFixed(1),"s"):"".concat((e/6e4).toFixed(1),"min")}};function l(e,t){var r;return a[t.style](function(e,t){let r="s"===t?1e3*e:e;return Number.isFinite(r)&&r>0?r:0}(e,t.unit),null!=(r=t.locale)?r:"zh-CN")}function n(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"zh-CN";return l(e,{unit:"s",style:"coarse",locale:t})}}},e=>{e.O(0,[717,551,665,576,499,338,964,636,593,792],()=>e(e.s=74183)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[46],{69:(e,a)=>{"use strict";a.A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M608 112c-167.9 0-304 136.1-304 304 0 70.3 23.9 135 63.9 186.5L255.8 713.6l-62.3-62.3a8.19 8.19 0 00-11.4 0l-39.8 39.8a8.19 8.19 0 000 11.4l62.3 62.3-44.9 44.9-62.3-62.3a8.19 8.19 0 00-11.4 0l-39.8 39.8a8.19 8.19 0 000 11.4l110.3 111.2c3.1 3.1 8.2 3.1 11.3 0l253.6-253.6A304.1 304.1 0 00608 720c167.9 0 304-136.1 304-304S775.9 112 608 112m161.2 465.2C726.2 620.3 668.9 644 608 644s-118.2-23.7-161.2-66.8C403.7 534.2 380 476.9 380 416s23.7-118.2 66.8-161.2c43-43.1 100.3-66.8 161.2-66.8s118.2 23.7 161.2 66.8c43.1 43 66.8 100.3 66.8 161.2s-23.7 118.2-66.8 161.2"}}]},name:"key",theme:"outlined"}},5450:(e,a)=>{"use strict";a.A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M917.7 148.8l-42.4-42.4c-1.6-1.6-3.6-2.3-5.7-2.3s-4.1.8-5.7 2.3l-76.1 76.1a199.27 199.27 0 00-112.1-34.3c-51.2 0-102.4 19.5-141.5 58.6L432.3 308.7a8.03 8.03 0 000 11.3L704 591.7c1.6 1.6 3.6 2.3 5.7 2.3 2 0 4.1-.8 5.7-2.3l101.9-101.9c68.9-69 77-175.7 24.3-253.5l76.1-76.1c3.1-3.2 3.1-8.3 0-11.4zM769.1 441.7l-59.4 59.4-186.8-186.8 59.4-59.4c24.9-24.9 58.1-38.7 93.4-38.7 35.3 0 68.4 13.7 93.4 38.7 24.9 24.9 38.7 58.1 38.7 93.4 0 35.3-13.8 68.4-38.7 93.4zm-190.2 105a8.03 8.03 0 00-11.3 0L501 613.3 410.7 523l66.7-66.7c3.1-3.1 3.1-8.2 0-11.3L441 408.6a8.03 8.03 0 00-11.3 0L363 475.3l-43-43a7.85 7.85 0 00-5.7-2.3c-2 0-4.1.8-5.7 2.3L206.8 534.2c-68.9 69-77 175.7-24.3 253.5l-76.1 76.1a8.03 8.03 0 000 11.3l42.4 42.4c1.6 1.6 3.6 2.3 5.7 2.3s4.1-.8 5.7-2.3l76.1-76.1c33.7 22.9 72.9 34.3 112.1 34.3 51.2 0 102.4-19.5 141.5-58.6l101.9-101.9c3.1-3.1 3.1-8.2 0-11.3l-43-43 66.7-66.7c3.1-3.1 3.1-8.2 0-11.3l-36.6-36.2zM441.7 769.1a131.32 131.32 0 01-93.4 38.7c-35.3 0-68.4-13.7-93.4-38.7a131.32 131.32 0 01-38.7-93.4c0-35.3 13.7-68.4 38.7-93.4l59.4-59.4 186.8 186.8-59.4 59.4z"}}]},name:"api",theme:"outlined"}},13114:(e,a,r)=>{"use strict";r.d(a,{A:()=>c});var l=r(97109),s=r(5450),o=r(88483);function t(){return(t=Object.assign?Object.assign.bind():function(e){for(var a=1;a<arguments.length;a++){var r=arguments[a];for(var l in r)Object.prototype.hasOwnProperty.call(r,l)&&(e[l]=r[l])}return e}).apply(this,arguments)}let c=l.forwardRef((e,a)=>l.createElement(o.A,t({},e,{ref:a,icon:s.A})))},29071:(e,a,r)=>{"use strict";r.d(a,{A:()=>c});var l=r(97109),s=r(78847),o=r(88483);function t(){return(t=Object.assign?Object.assign.bind():function(e){for(var a=1;a<arguments.length;a++){var r=arguments[a];for(var l in r)Object.prototype.hasOwnProperty.call(r,l)&&(e[l]=r[l])}return e}).apply(this,arguments)}let c=l.forwardRef((e,a)=>l.createElement(o.A,t({},e,{ref:a,icon:s.A})))},30289:(e,a)=>{"use strict";a.A={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"}},54746:(e,a,r)=>{"use strict";r.d(a,{A:()=>c});var l=r(97109),s=r(71242),o=r(88483);function t(){return(t=Object.assign?Object.assign.bind():function(e){for(var a=1;a<arguments.length;a++){var r=arguments[a];for(var l in r)Object.prototype.hasOwnProperty.call(r,l)&&(e[l]=r[l])}return e}).apply(this,arguments)}let c=l.forwardRef((e,a)=>l.createElement(o.A,t({},e,{ref:a,icon:s.A})))},61825:(e,a,r)=>{"use strict";r.d(a,{A:()=>c});var l=r(97109),s=r(30289),o=r(88483);function t(){return(t=Object.assign?Object.assign.bind():function(e){for(var a=1;a<arguments.length;a++){var r=arguments[a];for(var l in r)Object.prototype.hasOwnProperty.call(r,l)&&(e[l]=r[l])}return e}).apply(this,arguments)}let c=l.forwardRef((e,a)=>l.createElement(o.A,t({},e,{ref:a,icon:s.A})))},71242:(e,a)=>{"use strict";a.A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8z"}},{tag:"path",attrs:{d:"M192 474h672q8 0 8 8v60q0 8-8 8H160q-8 0-8-8v-60q0-8 8-8z"}}]},name:"plus",theme:"outlined"}},77305:(e,a,r)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/models",function(){return r(98841)}])},78847:(e,a)=>{"use strict";a.A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M848 359.3H627.7L825.8 109c4.1-5.3.4-13-6.3-13H436c-2.8 0-5.5 1.5-6.9 4L170 547.5c-3.1 5.3.7 12 6.9 12h174.4l-89.4 357.6c-1.9 7.8 7.5 13.3 13.3 7.7L853.5 373c5.2-4.9 1.7-13.7-5.5-13.7zM378.2 732.5l60.3-241H281.1l189.6-327.4h224.6L487 427.4h211L378.2 732.5z"}}]},name:"thunderbolt",theme:"outlined"}},85310:(e,a,r)=>{"use strict";r.d(a,{Zk:()=>o,dh:()=>t,wD:()=>s});var l=r(65321);r(97109);let s="rounded-xl bg-[var(--colorBgContainer)] shadow-[var(--shadowSurface)] hover:shadow-[var(--shadowSurfaceHover)] transition-shadow";function o(e){let{title:a,count:r,description:s,extra:o,className:t,children:c}=e;return(0,l.jsxs)("section",{className:"rounded-2xl bg-[var(--colorBgContainer)] shadow-[var(--shadowSurface)] p-6 animateFadeIn ".concat(null!=t?t:""),children:[(0,l.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-start justify-between gap-3 mb-5",children:[(0,l.jsxs)("div",{className:"min-w-0",children:[(0,l.jsxs)("h2",{className:"text-base font-semibold text-[var(--colorText)] tracking-wide flex items-center gap-2 m-0",children:[a,void 0!==r&&(0,l.jsx)("span",{className:"text-[var(--colorTextTertiary)] font-normal text-sm",children:r})]}),s&&(0,l.jsx)("p",{className:"text-xs text-[var(--colorTextTertiary)] mt-1.5 mb-0 leading-relaxed max-w-3xl",children:s})]}),o]}),c]})}function t(e){let{children:a}=e;return(0,l.jsx)("div",{className:"text-xs font-semibold uppercase tracking-wider mb-2 text-[var(--colorTextTertiary)]",children:a})}},93360:(e,a,r)=>{"use strict";r.d(a,{z:()=>o});var l=r(65321);r(97109);var s=r(33442);function o(e){let{title:a,description:r,extra:o,bottomContent:t}=e;return(0,l.jsxs)("div",{className:"animateFadeIn",children:[(0,l.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-end justify-between gap-4 pb-6 border-b border-[var(--borderColor)]",children:[(0,l.jsxs)("div",{className:"min-w-0",children:[(0,l.jsx)("h1",{className:"text-3xl font-extrabold tracking-tight text-[var(--colorText)] mb-2",children:a}),r&&(0,l.jsx)("p",{className:"text-sm text-[var(--colorTextSecondary)] m-0",children:r})]}),o&&(0,l.jsx)(s.A,{className:"w-full sm:w-auto overflow-x-auto pb-1 sm:pb-0 shrink-0",size:"middle",wrap:!1,children:o})]}),t&&(0,l.jsx)("div",{className:"mt-6",children:t})]})}},98841:(e,a,r)=>{"use strict";r.r(a),r.d(a,{default:()=>q});var l=r(65321),s=r(97109),o=r(39507),t=r(93360),c=r(17807),n=r(88762),i=r(85114),d=r(84253),m=r(88278),x=r(33442),p=r(32965),h=r(11702),v=r(57271),u=r(7576),b=r(48318),g=r(34052),j=r(63455),f=r(56985),y=r(44534),A=r(54746),w=r(29071),N=r(59188),C=r(4216),S=r(13114),k=r(99650),z=r(58209),E=r(69),T=r(88483);function P(){return(P=Object.assign?Object.assign.bind():function(e){for(var a=1;a<arguments.length;a++){var r=arguments[a];for(var l in r)Object.prototype.hasOwnProperty.call(r,l)&&(e[l]=r[l])}return e}).apply(this,arguments)}let B=s.forwardRef((e,a)=>s.createElement(T.A,P({},e,{ref:a,icon:E.A})));var H=r(61825),K=r(6578),O=r(85310),I=r(82238);let M=[{labelKey:"models.openAICompatible",value:"openai"},{labelKey:"models.anthropic",value:"anthropic"},{labelKey:"models.google",value:"google"},{labelKey:"models.ollama",value:"ollama"},{labelKey:"models.openRouter",value:"openrouter"}],L=[{key:"imageGeneration",labelKey:"models.imageGeneration"},{key:"imageUnderstanding",labelKey:"models.imageUnderstanding"},{key:"fileUnderstanding",labelKey:"models.fileUnderstanding"},{key:"audio",labelKey:"models.audioCapability"},{key:"video",labelKey:"models.videoCapability"}],U="••••••••",_=e=>e.includes("•");function q(){let e=(0,o.Vr)(),{message:a}=c.A.useApp(),[r,E]=(0,s.useState)(!0),[T,P]=(0,s.useState)([]),[q,F]=(0,s.useState)(null),[R,D]=(0,s.useState)(!1),[V,Z]=(0,s.useState)(null),[G,X]=(0,s.useState)(!1),[J,Q]=(0,s.useState)(!1),[W,Y]=(0,s.useState)(null),[$,ee]=(0,s.useState)(null),[ea,er]=(0,s.useState)({}),[el,es]=(0,s.useState)(!1),[eo,et]=(0,s.useState)(!1),[ec,en]=(0,s.useState)(""),[ei,ed]=(0,s.useState)(""),[em,ex]=(0,s.useState)(""),[ep,eh]=(0,s.useState)(""),[ev,eu]=(0,s.useState)(""),[eb,eg]=(0,s.useState)("openai"),[ej,ef]=(0,s.useState)(!1),[ey,eA]=(0,s.useState)({}),[ew,eN]=(0,s.useState)(!1),[eC,eS]=(0,s.useState)(!1),[ek,ez]=(0,s.useState)([]),eE=async()=>{E(!0);try{let e=[],a=(a,r,l)=>r.catch(()=>(e.push(a),l)),[r,l,s]=await Promise.all([a("模型供应商",(0,K.Z3)(),null),a("生成模型",(0,K.zr)(),null),a("嵌入配置",(0,K.II)(),null)]);ez(e),r&&P(r),l&&F(l),s&&Z(s)}catch(r){a.error(e("common.error"))}finally{E(!1)}};(0,s.useEffect)(()=>{eE()},[]);let eT=ek.includes("模型供应商"),eP=ek.includes("生成模型"),eB=async e=>{var a,r,l,s;et(!0),en(e.name),ed(e.name),ex(null!=(l=null==q||null==(a=q.list.find(a=>a.provider===e.name))?void 0:a.name)?l:e.name),eh(""),eu(e.baseUrl||""),ef(!0===e.directEndpoint),eg(e.protocol||e.detectedProtocol||"openai"),eA(e.capabilities||{}),eN(!!(null==(r=e.capabilities)?void 0:r.webSearch));try{let a=await (0,K.Bh)(e.name);eh(a.apiKey?U:""),eu(a.baseUrl||""),eA(a.capabilities||{}),ef(!0===a.directEndpoint),eN(!!(null==(s=a.capabilities)?void 0:s.webSearch))}catch(e){}es(!0)},eH=async()=>{if(ei.trim()){eS(!0);try{let r=eo&&_(ep)?void 0:ep||void 0,l={...ey,webSearch:ew};await (0,K._m)(ei.trim(),{modelName:em.trim()||ei.trim(),oldName:eo?ec:void 0,apiKey:r,baseUrl:ev||void 0,protocol:eb,directEndpoint:ej,capabilities:l}),es(!1),await eE(),a.success(e("common.success"))}catch(r){a.error(e("common.error"))}finally{eS(!1)}}},eK=async r=>{try{await (0,K.h1)(r),await eE(),a.success(e("common.success"))}catch(r){a.error(e("common.error"))}},eO=async r=>{ee(r);try{let l=await (0,K.bZ)(r);er(e=>({...e,[r]:l.success}));let s=l.success?e("models.connected"):"".concat(e("models.connectionFailed")).concat(l.message?":".concat(l.message):"").concat(l.requestId?" (".concat(l.requestId,")"):"");a[l.success?"success":"error"](s)}catch(l){er(e=>({...e,[r]:!1})),a.error(l instanceof Error?l.message:e("models.connectionFailed"))}finally{ee(null)}},eI=async r=>{if(R)return!1;D(!0);try{let e=await (0,K.aP)(r);return F(e.models),!0}catch(r){return a.error(r instanceof Error?r.message:e("common.error")),!1}finally{D(!1)}},eM=async e=>{if(!q)return;let a=q.list.find(a=>a.provider===e),r=null!=a?a:{provider:e,name:e};await eI({active:{provider:r.provider,name:r.name},list:a?q.list:[...q.list,r]})},eL=async()=>{if(V){X(!0);try{let r=await (0,K.dd)(V);Z(r),Y(null),a.success(e("common.success"))}catch(r){a.error(e("common.error"))}finally{X(!1)}}},eU=async()=>{Q(!0);try{let r=await (0,K.u6)();Y(r.success),a[r.success?"success":"error"](r.message||(r.success?e("models.connected"):e("models.connectionFailed")))}catch(e){Y(!1)}finally{Q(!1)}};return r?(0,l.jsxs)("div",{className:"space-y-6",children:[(0,l.jsx)(n.A,{active:!0,title:!0,paragraph:{rows:1}}),(0,l.jsx)("div",{className:"p-4 bg-[var(--colorBgHover)] rounded-xl border border-[var(--borderColor)]",children:(0,l.jsx)(n.A,{active:!0,paragraph:{rows:6}})}),(0,l.jsx)("div",{className:"p-4 bg-[var(--colorBgHover)] rounded-xl border border-[var(--borderColor)]",children:(0,l.jsx)(n.A,{active:!0,paragraph:{rows:4}})}),(0,l.jsx)("div",{className:"p-4 bg-[var(--colorBgHover)] rounded-xl border border-[var(--borderColor)]",children:(0,l.jsx)(n.A,{active:!0,paragraph:{rows:3}})})]}):(0,l.jsxs)("div",{className:"space-y-6",children:[(0,l.jsx)(I.X,{failures:ek}),(0,l.jsx)(t.z,{title:e("models.title"),description:e("models.description"),extra:(0,l.jsx)(i.Ay,{type:"primary",icon:(0,l.jsx)(A.A,{}),onClick:()=>{et(!1),en(""),ed(""),ex(""),eh(""),eu(""),eg("openai"),ef(!1),eA({}),eN(!1),es(!0)},children:e("models.addProvider")})}),(0,l.jsx)(O.Zk,{title:e("models.modelList"),count:eT?void 0:T.length,description:e("models.modelListDesc"),children:eT?(0,l.jsx)("div",{className:"py-10 rounded-xl border border-dashed border-[var(--borderColorStrong)] bg-[var(--colorBgHover)] text-center",children:(0,l.jsx)("span",{className:"text-sm text-[var(--colorTextTertiary)]",children:"—"})}):0===T.length?(0,l.jsx)("div",{className:"py-10 rounded-xl border border-dashed border-[var(--borderColorStrong)] bg-[var(--colorBgHover)]",children:(0,l.jsx)(d.A,{image:d.A.PRESENTED_IMAGE_SIMPLE,description:(0,l.jsx)("span",{className:"text-[var(--colorTextTertiary)] text-sm",children:e("models.noProviders")})})}):(0,l.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-5",children:T.map(a=>{var r,s,o;let t=null==q?void 0:q.list.find(e=>e.provider===a.name),c=null!=(o=null==t?void 0:t.name)?o:a.name,n=(null==q||null==(r=q.active)?void 0:r.provider)===a.name&&q.active.name===c;return(0,l.jsxs)("div",{role:"group","aria-label":a.name,className:"group p-5 ".concat(O.wD," flex flex-col"),children:[(0,l.jsxs)("div",{className:"flex items-start justify-between gap-3 mb-4 min-w-0",children:[(0,l.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,l.jsx)(m.Ay,{name:"generation-model-service",checked:n,disabled:eP||!q||R,onChange:()=>{eM(a.name)},children:(0,l.jsx)("span",{className:"font-bold text-base text-[var(--colorText)]",children:a.name})}),c!==a.name&&(0,l.jsx)("div",{className:"text-xs text-[var(--colorTextSecondary)] mt-1 break-all",children:c}),(0,l.jsxs)("div",{className:"text-xs text-[var(--colorTextTertiary)] flex items-center gap-1 uppercase tracking-wider font-semibold",children:[(0,l.jsx)(w.A,{})," ",a.protocol||a.detectedProtocol||"openai"]})]}),(0,l.jsxs)(x.A,{size:0,className:"-mr-2 opacity-0 group-hover:opacity-100 focus-within:opacity-100 transition-opacity",children:[(0,l.jsx)(i.Ay,{type:"text",size:"small",loading:$===a.name,title:e("models.testConnection"),"aria-label":e("models.testConnection"),onClick:e=>{e.stopPropagation(),eO(a.name)},icon:!0===ea[a.name]?(0,l.jsx)(N.A,{className:"text-[var(--colorOk)]"}):!1===ea[a.name]?(0,l.jsx)(C.A,{className:"text-[var(--colorDanger)]"}):(0,l.jsx)(S.A,{className:"text-[var(--colorTextSecondary)]"})}),(0,l.jsx)(i.Ay,{type:"text",size:"small",title:e("common.edit"),icon:(0,l.jsx)(k.A,{className:"text-[var(--colorTextSecondary)]"}),onClick:e=>{e.stopPropagation(),eB(a)}}),(0,l.jsx)(p.A,{title:e("models.deleteProviderConfirm"),onConfirm:e=>{null==e||e.stopPropagation(),eK(a.name)},onCancel:e=>null==e?void 0:e.stopPropagation(),children:(0,l.jsx)(i.Ay,{type:"text",size:"small",danger:!0,title:e("common.delete"),icon:(0,l.jsx)(z.A,{}),onClick:e=>e.stopPropagation()})})]})]}),(0,l.jsxs)("div",{className:"flex flex-col gap-3 mt-auto pt-4 border-t border-[var(--borderColor)]",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between text-xs text-[var(--colorTextSecondary)]",children:[(0,l.jsxs)("span",{className:"flex items-center gap-1",children:[(0,l.jsx)(B,{})," ",e("models.apiKey")]}),(0,l.jsx)("span",{className:"font-mono text-[var(--colorTextTertiary)]",children:a.hasApiKey?U:e("models.none")})]}),a.baseUrl&&(0,l.jsxs)("div",{className:"flex items-center justify-between text-xs text-[var(--colorTextSecondary)]",children:[(0,l.jsxs)("span",{className:"flex items-center gap-1",children:[(0,l.jsx)(H.A,{})," URL"]}),(0,l.jsx)("span",{className:"truncate max-w-[120px] font-mono text-[var(--colorTextTertiary)]",title:a.baseUrl,children:a.baseUrl.replace(/^https?:\/\//,"")})]}),(0,l.jsxs)("div",{className:"flex flex-wrap gap-1 mt-2",children:[L.filter(e=>{var r;return null==(r=a.capabilities)?void 0:r[e.key]}).map(a=>(0,l.jsx)(h.A,{color:"blue",bordered:!1,className:"m-0 text-[10px] bg-[var(--colorBrand)]/5 text-[var(--colorBrand)] leading-[18px]",children:e(a.labelKey)},a.key)),(null==(s=a.capabilities)?void 0:s.webSearch)&&(0,l.jsx)(h.A,{color:"green",bordered:!1,className:"m-0 text-[10px] leading-[18px]",children:e("models.webEnhancement")})]})]})]},a.name)})})}),(0,l.jsx)(O.Zk,{title:e("models.embeddingConfig"),description:e("models.embeddingConfigDesc"),extra:(0,l.jsxs)(x.A,{size:6,children:[V?(0,l.jsx)(h.A,{color:"blue",bordered:!1,className:"m-0",children:"transformers-local"===V.provider?e("models.localEmbedding"):e("models.openAICompatible")}):(0,l.jsx)(h.A,{bordered:!1,className:"m-0",children:"—"}),!0===W&&(0,l.jsx)(h.A,{color:"success",bordered:!1,className:"m-0",icon:(0,l.jsx)(N.A,{}),children:e("models.connected")}),!1===W&&(0,l.jsx)(h.A,{color:"error",bordered:!1,className:"m-0",icon:(0,l.jsx)(C.A,{}),children:e("models.connectionFailed")})]}),children:V?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)(O.dh,{children:e("models.embeddingProvider")}),(0,l.jsx)(v.A,{value:V.provider,className:"w-full h-10",variant:"borderless",style:{background:"var(--colorBgHover)",borderRadius:"8px"},options:[{label:e("models.localRecommended"),value:"transformers-local"},{label:e("models.externalAdvanced"),value:"openai-compatible"}],onChange:e=>Z(a=>a?{...a,provider:e,model:"transformers-local"===e?a.model||"BAAI/bge-small-zh-v1.5":a.model,dimensions:"transformers-local"===e?512:a.dimensions||1024}:a)})]}),"openai-compatible"===V.provider&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{children:[(0,l.jsx)(O.dh,{children:e("models.baseUrl")}),(0,l.jsx)(u.A,{className:"h-10 px-4 bg-[var(--colorBgHover)]",value:V.baseUrl,onChange:e=>Z(a=>a?{...a,baseUrl:e.target.value}:a),placeholder:"http://localhost:11434/v1"})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(O.dh,{children:e("models.model")}),(0,l.jsx)(u.A,{className:"h-10 px-4 bg-[var(--colorBgHover)]",value:V.model,onChange:e=>Z(a=>a?{...a,model:e.target.value}:a),placeholder:"bge-m3"})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(O.dh,{children:e("models.apiKey")}),(0,l.jsx)(u.A.Password,{className:"h-10 px-4 bg-[var(--colorBgHover)]",value:V.apiKey,onFocus:()=>{V.apiKey&&_(V.apiKey)&&Z(e=>e?{...e,apiKey:""}:e)},onChange:e=>Z(a=>a?{...a,apiKey:e.target.value}:a),placeholder:e("models.optional")})]})]}),"transformers-local"===V.provider&&(0,l.jsxs)("div",{children:[(0,l.jsx)(O.dh,{children:e("models.model")}),(0,l.jsx)(u.A,{className:"h-10 px-4 bg-[var(--colorBgHover)]",disabled:!0,value:V.model,placeholder:"BAAI/bge-small-zh-v1.5"})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(O.dh,{children:e("models.dimensions")}),(0,l.jsx)(b.A,{className:"w-full h-10 px-2 bg-[var(--colorBgHover)] border-transparent flex items-center",min:1,value:V.dimensions,onChange:e=>Z(a=>a?{...a,dimensions:Number(e||("transformers-local"===a.provider?512:1024))}:a)})]})]}),(0,l.jsxs)("div",{className:"mt-6 flex flex-wrap gap-3",children:[(0,l.jsx)(i.Ay,{type:"primary",className:"h-10 px-6 font-medium shadow-none",loading:G,onClick:()=>{eL()},children:e("models.saveEmbedding")}),(0,l.jsx)(i.Ay,{className:"h-10 px-6 font-medium shadow-none bg-[var(--colorBgHover)] border-transparent hover:border-[var(--borderColorStrong)]",loading:J,onClick:()=>{eU()},children:e("models.testEmbedding")})]})]}):(0,l.jsx)("div",{className:"text-sm text-[var(--colorTextTertiary)]",children:"—"})}),(0,l.jsx)(g.A,{title:eo?e("models.editProvider"):e("models.addProvider"),open:el,onClose:()=>es(!1),size:"large",styles:{body:{padding:"24px 32px"},header:{padding:"16px 32px",borderBottom:"1px solid var(--colorBorderSecondary)"}},extra:(0,l.jsx)(x.A,{children:(0,l.jsx)(i.Ay,{type:"primary",loading:eC,onClick:()=>{eH()},children:e("common.save")})}),children:(0,l.jsxs)(j.A,{layout:"vertical",children:[(0,l.jsx)(j.A.Item,{label:e("models.providerName"),children:(0,l.jsx)(u.A,{value:ei,onChange:e=>ed(e.target.value),placeholder:e("models.providerNamePlaceholder")})}),(0,l.jsx)(j.A.Item,{label:e("models.modelIdentifier"),help:e("models.modelIdentifierHint"),children:(0,l.jsx)(u.A,{value:em,onChange:e=>ex(e.target.value),placeholder:ei||e("models.modelIdentifierPlaceholder")})}),(0,l.jsx)(j.A.Item,{label:e("models.apiKey"),help:eo?e("models.apiKeyEditHint"):void 0,children:(0,l.jsx)(u.A.Password,{value:ep,onFocus:()=>{eo&&_(ep)&&eh("")},onChange:e=>eh(e.target.value),placeholder:eo?e("models.apiKeyEditPlaceholder"):"sk-..."})}),(0,l.jsx)(j.A.Item,{label:e("models.baseUrl"),children:(0,l.jsx)(u.A,{value:ev,onChange:e=>eu(e.target.value),placeholder:"https://api.openai.com/v1"})}),(0,l.jsx)(j.A.Item,{label:e("models.protocol"),children:(0,l.jsx)(v.A,{value:eb,onChange:eg,options:M.map(a=>({label:e(a.labelKey),value:a.value}))})}),(0,l.jsx)(j.A.Item,{label:e("models.directEndpoint"),children:(0,l.jsx)(f.A,{checked:ej,onChange:e=>ef(e.target.checked),children:e("models.directEndpointDesc")})}),(0,l.jsxs)(j.A.Item,{label:e("models.webEnhancement"),children:[(0,l.jsx)(y.A,{checked:ew,onChange:eN}),(0,l.jsx)("span",{className:"ml-3 text-xs text-[var(--colorTextSecondary)]",children:e("models.webEnhancementDesc")})]}),(0,l.jsx)(j.A.Item,{label:e("models.capabilities"),children:(0,l.jsx)(f.A.Group,{value:L.filter(e=>ey[e.key]).map(e=>e.key),options:L.map(a=>({label:e(a.labelKey),value:a.key})),onChange:e=>eA(Object.fromEntries(L.map(a=>[a.key,e.includes(a.key)])))})})]})})]})}}},e=>{e.O(0,[717,551,576,338,864,318,636,593,792],()=>e(e.s=77305)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[26],{27549:(e,t,r)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/prompt",function(){return r(69583)}])},45551:(e,t,r)=>{"use strict";r.d(t,{Jm:()=>i,fw:()=>l,je:()=>a.j,mc:()=>c,z3:()=>o});var a=r(96538);function o(e){if(0===e)return"0 B";let t=Math.floor(Math.log(e)/Math.log(1024)),r=e/Math.pow(1024,t);return"".concat(r.toFixed(+(0!==t))," ").concat(["B","KB","MB","GB","TB"][t])}function l(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"zh-CN";if(!e||e<=0)return"en-US"===t?"Never":"从未";let r=Math.floor(Math.floor((Date.now()-e)/1e3)/60),a=Math.floor(r/60),o=Math.floor(a/24);return o>30?new Date(e).toLocaleDateString(t):"en-US"===t?o>0?"".concat(o,"d ago"):a>0?"".concat(a,"h ago"):r>0?"".concat(r,"m ago"):"Just now":o>0?"".concat(o," 天前"):a>0?"".concat(a," 小时前"):r>0?"".concat(r," 分钟前"):"刚刚"}let s={document:"文档",spreadsheet:"表格",image:"图片",cad:"图纸",code:"代码",data:"数据",web:"网页",diagram:"图表",archive:"压缩包",other:"其他"},n={document:"Document",spreadsheet:"Spreadsheet",image:"Image",cad:"CAD",code:"Code",data:"Data",web:"Web",diagram:"Diagram",archive:"Archive",other:"Other"};function i(e){var t;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"zh-CN";return null!=(t=("en-US"===r?n:s)[e])?t:e}let c={active:"common.statusIndexed",outdated:"common.statusOutdated",error:"common.statusAbnormal",deleted:"common.statusDeleted",disk:"common.statusNotIndexed"}},58690:(e,t,r)=>{"use strict";function a(e){var t,r,a;let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{defaultPageSize:null!=(t=o.pageSize)?t:10,pageSizeOptions:null!=(r=o.pageSizeOptions)?r:[10,20,50,100],showSizeChanger:!0,showTotal:t=>{var r,a;return e(null!=(r=o.totalLabelKey)?r:"common.totalRows",null!=(a=o.totalLabelFallback)?a:"共 {count} 条").replace("{count}",String(t))},hideOnSinglePage:null!=(a=o.hideOnSinglePage)&&a,showQuickJumper:!1}}r.d(t,{B:()=>a})},69583:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>eo});var a=r(65321),o=r(97109),l=r(39507),s=r(45551),n=r(58690),i=r(6578),c=r(17807),d=r(33442),m=r(11702),p=r(85114),x=r(32965),u=r(56985),h=r(88762),g=r(45759),f=r(7576),v=r(57271),j=r(49292),w=r(84253),y=r(38964),b=r(34052),N=r(42700),S=r(55122),A=r(93360),C=r(82238);function T(e){let{idPrefix:t="prompt-writing-guide"}=e,r=(0,l.Vr)();return(0,a.jsxs)("aside",{"aria-labelledby":"".concat(t,"-title"),className:"mb-3 shrink-0 rounded-xl border border-[var(--borderColor)] bg-[var(--colorBgHover)] px-3 py-2.5 text-xs leading-relaxed",children:[(0,a.jsx)("div",{id:"".concat(t,"-title"),className:"font-semibold text-[var(--colorText)]",children:r("prompt.writingGuideTitle")}),(0,a.jsx)("p",{id:"".concat(t,"-intro"),className:"mt-1 text-[var(--colorTextSecondary)]",children:r("prompt.writingGuideIntro")}),(0,a.jsx)("p",{className:"mt-1 text-[var(--colorTextSecondary)]",children:r("prompt.writingGuideParameters")}),(0,a.jsxs)("details",{className:"mt-2",children:[(0,a.jsx)("summary",{className:"cursor-pointer text-[var(--colorAccent)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2",children:r("prompt.writingGuideDetails")}),(0,a.jsxs)("div",{className:"mt-3 max-h-[320px] overflow-y-auto pr-1 text-[var(--colorTextSecondary)]",children:[(0,a.jsx)("div",{className:"font-semibold text-[var(--colorText)]",children:r("prompt.writingGuideNeedsTitle")}),(0,a.jsxs)("ul",{className:"mt-1 list-disc space-y-1 pl-4",children:[(0,a.jsx)("li",{children:r("prompt.writingGuidePurpose")}),(0,a.jsx)("li",{children:r("prompt.writingGuideStructure")}),(0,a.jsx)("li",{children:r("prompt.writingGuideEngineering")}),(0,a.jsx)("li",{children:r("prompt.writingGuideStyle")})]}),(0,a.jsx)("div",{className:"mt-3 font-semibold text-[var(--colorText)]",children:r("prompt.writingGuideManagedTitle")}),(0,a.jsx)("p",{className:"mt-1",children:r("prompt.writingGuideManaged")}),(0,a.jsx)("p",{className:"mt-1",children:r("prompt.writingGuideAvoid")}),(0,a.jsx)("div",{className:"mt-3 font-semibold text-[var(--colorText)]",children:r("prompt.writingGuideExampleTitle")}),(0,a.jsx)("p",{className:"mt-1",children:r("prompt.writingGuideExampleHint")}),(0,a.jsx)("pre",{className:"mt-2 whitespace-pre-wrap break-words rounded-lg border border-[var(--borderColor)] bg-[var(--colorBgContainer)] p-2.5 font-mono text-[11px] text-[var(--colorText)]",children:r("prompt.writingGuideExample")}),(0,a.jsx)("p",{className:"mt-2",children:r("prompt.writingGuideOneOutline")})]})]})]})}var z=r(99650),F=r(81668),k=r(58209),E=r(26631),P=r(29606),O=r(96091),B=r(54746),M=r(30486),D=r(46082),I=r(42758),G=r(7851),R=r(84742),_=r(24810),J=r(7492);async function L(){let e=await fetch("/api/prompt");if(!e.ok)throw Error("Failed");return e.json()}async function U(e,t,r){let a=await fetch("/api/prompt",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({filePath:e,content:t,name:r})});if(!a.ok)throw Error("Failed");return a.json()}async function K(e){let t=await fetch("/api/prompt",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"previewRules",content:e})});return t.ok&&(await t.json()).preview||null}async function H(e,t){let r=await fetch("/api/prompt",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"createCustom",name:e,content:t})});if(!r.ok)throw Error("Failed");return r.json()}async function X(e){let t=await fetch("/api/prompt",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"select",selectedIds:e})});if(!t.ok)throw Error("Failed");return t.json()}async function $(e){let t=await fetch("/api/prompt",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"import",...e&&"object"==typeof e?e:{prompts:[]}})});if(!t.ok)throw Error(await t.text());return t.json()}async function q(){return Q("",!1,60)}async function V(e){let t=await fetch("/api/kb/files/detail?relativePath=".concat(encodeURIComponent(e)));if(!t.ok)throw Error("Failed");return((await t.json()).chunks||[]).map(e=>e.content||"").filter(Boolean).join("\n\n").slice(0,12e3)}async function Q(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:30;return(await (0,i.nU)({limit:r,...e.trim()?{query:e.trim()}:{},...t?{}:{includeContent:!1}})).files||[]}async function W(e,t){let r=await fetch("/api/prompt/chat",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!r.ok){let e=await r.text();try{let r=JSON.parse(e);throw Error(r.error||r.message||e||t)}catch(r){throw Error(e||t)}}return r.json()}function Y(e,t){let r=new Blob([JSON.stringify(t,null,2)],{type:"application/json;charset=utf-8"}),a=URL.createObjectURL(r),o=document.createElement("a");o.href=a,o.download=e,o.click(),URL.revokeObjectURL(a)}function Z(e,t,r){return e?"customize-agent:prompt-chat:".concat(e.id,":").concat(e.customizePath||e.projectName):"customize-agent:prompt-chat:draft:".concat(r||t||"new")}function ee(e){let t=Date.parse(e);return Number.isNaN(t)?"-":new Date(t).toLocaleString()}function et(e){return{type:"customize-agent.prompts",version:1,exportedAt:new Date().toISOString(),prompts:e.map(e=>({name:e.projectName,content:e.content||"",selected:e.selected,source:"custom"}))}}function er(e){return e.trim().replace(/[\\/:*?"<>|]/g,"-").slice(0,80)||"untitled"}function ea(e){let t=e.match(/(^|\s)@([^\s@]*)$/);return t?t[2]:null}function eo(){let e=(0,l.Vr)(),{message:t}=c.A.useApp(),[r,i]=(0,o.useState)(!0),[eo,el]=(0,o.useState)([]),[es,en]=(0,o.useState)(!1),[ei,ec]=(0,o.useState)(null),[ed,em]=(0,o.useState)(""),[ep,ex]=(0,o.useState)(""),[eu,eh]=(0,o.useState)(!1),[eg,ef]=(0,o.useState)(!1),[ev,ej]=(0,o.useState)("all"),[ew,ey]=(0,o.useState)("mtime"),[eb,eN]=(0,o.useState)("list"),[eS,eA]=(0,o.useState)(""),[eC,eT]=(0,o.useState)(!1),[ez,eF]=(0,o.useState)([]),[ek,eE]=(0,o.useState)(""),[eP,eO]=(0,o.useState)(""),[eB,eM]=(0,o.useState)(!1),[eD,eI]=(0,o.useState)([]),[eG,eR]=(0,o.useState)([]),[e_,eJ]=(0,o.useState)([]),[eL,eU]=(0,o.useState)(!1),[eK,eH]=(0,o.useState)(!1),[eX,e$]=(0,o.useState)(!1),[eq,eV]=(0,o.useState)(null),[eQ,eW]=(0,o.useState)(!1),[eY,eZ]=(0,o.useState)([]),[e0,e1]=(0,o.useState)(!1),[e2,e3]=(0,o.useState)(!1);(0,o.useEffect)(()=>{if(!es||!ed.trim()){eV(null),eW(!1);return}eW(!0);let e=setTimeout(()=>{K(ed).then(e=>{eV(e),eW(!1)})},500);return()=>clearTimeout(e)},[ed,es]);let e5=(0,o.useRef)(null),e6=ea(eP),e4=async()=>{i(!0);try{let e,t=[],r=await (e=L(),e.catch(()=>(t.push("提示词列表"),null)));eZ(t),r&&el(r)}catch(r){t.error(e("common.error"))}finally{i(!1)}};(0,o.useEffect)(()=>{e4()},[]),(0,o.useEffect)(()=>{let e=window.localStorage.getItem("customize-agent:prompt-view-mode");("list"===e||"card"===e)&&eN(e)},[]),(0,o.useEffect)(()=>{window.localStorage.setItem("customize-agent:prompt-view-mode",eb)},[eb]),(0,o.useEffect)(()=>{let e=e5.current;e&&e.scrollTo({top:e.scrollHeight,behavior:"smooth"}),ek&&window.localStorage.setItem(ek,JSON.stringify(ez.slice(-30)))},[ez,eB,ek]),(0,o.useEffect)(()=>{es||e1(!1)},[es]),(0,o.useEffect)(()=>{!es||eD.length>0||eL||e0||(eU(!0),q().then(e=>{eI(e),e1(!1)}).catch(()=>e1(!0)).finally(()=>eU(!1)))},[es,eD.length,eL,e0]),(0,o.useEffect)(()=>{let e=null==e6?void 0:e6.trim();if(!es||!e){eR([]),eH(!1),e3(!1);return}let t=!1;eH(!0);let r=window.setTimeout(()=>{Q(e).then(e=>{t||(eR(e),e3(!1))}).catch(()=>{t||(eR([]),e3(!0))}).finally(()=>{t||eH(!1)})},250);return()=>{t=!0,window.clearTimeout(r)}},[es,e6]);let e9=eY.includes("提示词列表"),e8=e=>e9?"—":String(e),e7={selected:eo.filter(e=>e.selected).length,unselected:eo.filter(e=>!e.selected).length,hasFile:eo.filter(e=>e.hasFile).length,missingFile:eo.filter(e=>!e.hasFile).length},te=eo.filter(e=>{var t;return("selected"!==ev||!!e.selected)&&("unselected"!==ev||!e.selected)&&("hasFile"!==ev||!!e.hasFile)&&("missingFile"!==ev||!e.hasFile)&&(!eS.trim()||(t=eS.trim(),!!"".concat(e.projectName,"\n").concat(e.projectRoot||"","\n").concat(e.customizePath||"","\n").concat(e.content||"").toLowerCase().includes(t.toLowerCase())))}).sort((e,t)=>"name"===ew?e.projectName.localeCompare(t.projectName):"selected"===ew&&Number(t.selected)-Number(e.selected)||Date.parse(t.mtime||"")-Date.parse(e.mtime||"")),tt=te.filter(e=>e.selected).length,tr=te.length>0&&te.every(e=>e.selected),ta=(null==e6?void 0:e6.trim())?eG:eD,to=(e,t,r)=>{let a=Z(e,t,r);eE(a),eF(function(e){try{let t=JSON.parse(window.localStorage.getItem(e)||"[]");return Array.isArray(t)?t.filter(e=>("user"===e.role||"assistant"===e.role)&&"string"==typeof e.content).slice(-30):[]}catch(e){return[]}}(a)),eO(""),eM(!1),eJ([]),e$(!1)},tl=async()=>{if(!ep.trim())return void t.error(e("prompt.nameRequired"));eh(!0);try{if(ei)await U(ei.customizePath,ed,ep.trim()),t.success(e("common.success"));else{let r=await H(ep.trim(),ed||"# ".concat(ep.trim(),"\n"));!function(e,t){if(!e||!t||e===t)return;let r=window.localStorage.getItem(e);r&&!window.localStorage.getItem(t)&&window.localStorage.setItem(t,r)}(ek,Z({id:r.id,projectId:r.id,projectName:ep.trim(),customizePath:r.id,content:ed,mtime:"",hasFile:!0,isCurrent:!1,selected:!1,source:"custom"},ep.trim())),t.success(e("common.success"))}en(!1),await e4()}catch(r){t.error(e("common.error"))}finally{eh(!1)}},ts=async e=>{let t=Array.from(new Set([...e_,...eD.filter(t=>e.includes("@".concat(t.relativePath))).map(e=>e.relativePath)])).slice(0,3),r=[];for(let e of t){let t=await V(e);t&&r.push({relativePath:e,content:t})}return r},tn=async()=>{let r=eP.trim();if(!r||eB)return;let a=[...ez,{role:"user",content:r}];eF(a),eO(""),e$(!1),eM(!0);try{let t=await ts(r),o=await W({name:ep||(null==ei?void 0:ei.projectName)||e("prompt.untitled"),content:ed,message:r,history:ez,references:t},e("prompt.chatFailed"));eF([...a,{role:"assistant",content:o.content||e("prompt.chatEmptyReply")}])}catch(r){t.error(r instanceof Error?r.message:e("prompt.chatFailed")),eF(a)}finally{eM(!1)}},ti=async(r,a)=>{let o=a?Array.from(new Set([...eo.filter(e=>e.selected).map(e=>e.id),r.id])):eo.filter(e=>e.selected&&e.id!==r.id).map(e=>e.id);try{await X(o),el(e=>e.map(e=>({...e,selected:o.includes(e.id)})))}catch(r){t.error(e("common.error"))}},tc=async r=>{let a=eo.filter(e=>e.selected).map(e=>e.id),o=te.map(e=>e.id),l=r?Array.from(new Set([...a,...o])):a.filter(e=>!o.includes(e));try{await X(l),el(e=>e.map(e=>({...e,selected:l.includes(e.id)}))),t.success(e("common.success"))}catch(r){t.error(e("common.error"))}},td=async r=>{try{if(!(await fetch("/api/prompt",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({filePath:r.customizePath})})).ok)throw Error("Failed");t.success(e("common.success")),await e4()}catch(r){t.error(e("common.error"))}},tm=async r=>{if(r){eT(!0);try{let a=await r.text(),o=JSON.parse(a),l=await $(o);t.success(e("prompt.importedCount").replace("{count}",String(l.imported))),await e4()}catch(r){t.error(e("prompt.importFailed"))}finally{eT(!1)}}},tp=t=>(0,a.jsx)(d.A,{size:4,wrap:!0,children:!t.hasFile&&(0,a.jsx)(m.A,{style:{margin:0},children:e("prompt.missingFileStatus")})}),tx=r=>(0,a.jsxs)(d.A,{size:0,onClick:e=>e.stopPropagation(),children:[(0,a.jsx)(p.Ay,{size:"small",type:"text",icon:(0,a.jsx)(z.A,{}),title:e("common.edit"),onClick:()=>{ec(r),ef(!1),ex(r.projectName),em(r.content||""),to(r,r.projectName),en(!0)}}),(0,a.jsx)(p.Ay,{size:"small",type:"text",icon:(0,a.jsx)(F.A,{}),title:e("prompt.exportOne"),onClick:()=>{Y("customize-prompt-".concat(er(r.projectName),"-").concat(new Date().toISOString().slice(0,10),".json"),et([r])),t.success(e("prompt.exportedCount").replace("{count}","1"))}}),(0,a.jsx)(x.A,{title:e("prompt.deleteCustomConfirm"),onConfirm:()=>{td(r)},children:(0,a.jsx)(p.Ay,{size:"small",type:"text",danger:!0,icon:(0,a.jsx)(k.A,{}),title:e("common.delete")})})]}),tu=[{title:e("prompt.promptName"),dataIndex:"projectName",render:(e,t)=>(0,a.jsxs)(d.A,{size:8,className:"min-w-0",children:[(0,a.jsx)(E.A,{className:t.isCurrent?"text-[var(--colorOk)] text-lg":"text-[var(--colorTextSecondary)] text-lg"}),(0,a.jsx)("span",{className:"font-semibold text-[var(--colorText)]",children:e}),tp(t)]})},{title:e("prompt.columnSource"),width:170,render:()=>(0,a.jsxs)("span",{className:"text-xs text-[var(--colorTextTertiary)] inline-flex items-center gap-1.5",children:[(0,a.jsx)(P.A,{}),e("prompt.localPrompt")]})},{title:e("prompt.columnMtime"),width:210,render:(e,t)=>(0,a.jsx)("span",{className:"text-xs text-[var(--colorTextTertiary)]",children:ee(t.mtime)})},{title:e("prompt.columnActions"),width:140,render:(e,t)=>(0,a.jsx)("div",{onClick:e=>e.stopPropagation(),children:tx(t)})}];return r?(0,a.jsxs)("div",{className:"space-y-12",children:[(0,a.jsx)(h.A,{active:!0,title:!0,paragraph:{rows:1}}),(0,a.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6",children:Array.from({length:4}).map((e,t)=>(0,a.jsx)("div",{className:"p-4 border border-[var(--borderColor)]",children:(0,a.jsx)(h.A,{active:!0,paragraph:{rows:4}})},t))})]}):(0,a.jsxs)("div",{className:"space-y-6 animateFadeIn",children:[(0,a.jsx)(C.X,{failures:eY}),(0,a.jsx)(A.z,{title:e("nav.promptManagement"),description:e("prompt.description"),extra:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(g.A,{accept:"application/json,.json",showUploadList:!1,beforeUpload:e=>(tm(e),!1),children:(0,a.jsx)(p.Ay,{icon:(0,a.jsx)(O.A,{}),loading:eC,className:"rounded-lg",children:e("prompt.import")})}),(0,a.jsx)(p.Ay,{icon:(0,a.jsx)(F.A,{}),disabled:0===eo.length,onClick:()=>(()=>{let r=eo.filter(e=>e.selected);if(0===r.length)return void t.warning(e("prompt.exportNoneSelected"));let a=new Date().toISOString().slice(0,10);r.forEach((e,t)=>{window.setTimeout(()=>{Y("customize-prompt-".concat(er(e.projectName),"-").concat(a,".json"),et([e]))},250*t)}),t.success(e("prompt.exportedCount").replace("{count}",String(r.length)))})(),className:"rounded-lg",children:e("prompt.exportOne")}),(0,a.jsx)(p.Ay,{type:"primary",icon:(0,a.jsx)(B.A,{}),onClick:()=>(()=>{let e="new:".concat(Date.now());ec(null),ef(!0),ex(""),em(""),to(null,"new",e),en(!0)})(),className:"shadow-none rounded-lg",children:e("prompt.createPrompt")})]})}),(0,a.jsx)(T,{idPrefix:"prompt-page-guide"}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-3 bg-[var(--colorBgContainer)] border border-[var(--borderColor)] p-3 rounded-2xl",children:[(0,a.jsx)(f.A,{prefix:(0,a.jsx)(M.A,{className:"text-[var(--colorTextTertiary)]"}),allowClear:!0,placeholder:e("prompt.searchPrompt"),value:eS,onChange:e=>eA(e.target.value),style:{width:260},className:"rounded-lg"}),(0,a.jsx)("div",{className:"h-6 w-[1px] bg-[var(--borderColor)] mx-1","aria-hidden":!0}),(0,a.jsx)(v.A,{value:ev,onChange:ej,style:{width:130},className:"rounded-lg",options:[{label:e("prompt.promptStatus"),value:"all"},{label:"".concat(e("prompt.selected")," (").concat(e8(e7.selected),")"),value:"selected"},{label:"".concat(e("prompt.unselected")," (").concat(e8(e7.unselected),")"),value:"unselected"},{label:"".concat(e("prompt.hasFileStatus")," (").concat(e8(e7.hasFile),")"),value:"hasFile"},{label:"".concat(e("prompt.missingFileStatus")," (").concat(e8(e7.missingFile),")"),value:"missingFile"}]}),(0,a.jsx)(v.A,{value:ew,onChange:ey,style:{width:140},className:"rounded-lg",options:[{label:e("prompt.sortByMtime"),value:"mtime"},{label:e("prompt.sortByName"),value:"name"},{label:e("prompt.sortBySelected"),value:"selected"}]}),(0,a.jsx)("div",{className:"flex-1 min-w-4"}),(0,a.jsx)(j.A,{value:eb,onChange:e=>eN(e),options:[{label:(0,a.jsx)(D.A,{}),value:"list"},{label:(0,a.jsx)(I.A,{}),value:"card"}],className:"bg-[var(--colorBgHover)] p-1 rounded-lg"})]}),(0,a.jsxs)("div",{className:"min-w-0 rounded-2xl border border-[var(--borderColor)] bg-[var(--colorBgContainer)] overflow-hidden",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 flex-wrap px-4 py-3 border-b border-[var(--borderColor)]",children:[(0,a.jsx)("span",{className:"text-sm text-[var(--colorTextSecondary)]",children:e("prompt.shownCount").replace("{count}",e8(te.length))}),(0,a.jsx)("div",{className:"h-4 w-[1px] bg-[var(--borderColor)] mx-1","aria-hidden":!0}),(0,a.jsx)("span",{className:"font-semibold text-sm",children:e("prompt.selectedCount").replace("{count}",String(tt))}),(0,a.jsx)("div",{className:"flex-1 min-w-4"}),(0,a.jsx)(p.Ay,{size:"small",disabled:0===te.length,onClick:()=>{tc(!tr)},children:tr?e("prompt.cancelSelectAll"):e("prompt.selectAll")})]}),0===te.length?(0,a.jsx)("div",{className:"py-24 text-center",children:e9?(0,a.jsx)("span",{className:"text-[var(--colorTextTertiary)]",children:"—"}):(0,a.jsx)(w.A,{image:w.A.PRESENTED_IMAGE_SIMPLE,description:(0,a.jsx)("span",{className:"text-[var(--colorTextSecondary)]",children:eS||"all"!==ev?e("prompt.noMatchDesc"):e("prompt.noPromptInGroup")})})}):"list"===eb?(0,a.jsx)(y.A,{rowKey:"id",dataSource:te,columns:tu,pagination:(0,n.B)(e),rowSelection:{selectedRowKeys:eo.filter(e=>e.selected).map(e=>e.id),onSelect:(e,t)=>{ti(e,t)},onSelectAll:e=>{tc(e)}},className:"custom-table"}):(0,a.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-5 p-4",children:te.map(t=>(0,a.jsxs)("div",{className:"flex flex-col p-5 rounded-2xl border border-[var(--borderColor)] bg-[var(--colorBgContainer)] hover:bg-[var(--colorBgHover)] hover:shadow-md transition-all",children:[(0,a.jsx)("div",{className:"flex items-start justify-between gap-3 mb-4 min-w-0",children:(0,a.jsxs)("div",{className:"flex items-center gap-3 min-w-0 flex-1",children:[(0,a.jsx)(u.A,{checked:t.selected,onChange:e=>{ti(t,e.target.checked)}}),(0,a.jsx)(E.A,{className:t.isCurrent?"text-[var(--colorOk)] text-lg":"text-[var(--colorTextSecondary)] text-lg"}),(0,a.jsx)("span",{className:"font-bold text-base text-[var(--colorText)] truncate mb-1",children:t.projectName})]})}),(0,a.jsx)("div",{className:"mb-3",children:tp(t)}),(0,a.jsxs)("div",{className:"text-xs text-[var(--colorTextTertiary)] truncate flex items-center gap-1.5 mb-4 bg-[var(--colorFillAlter)] p-1.5 rounded inline-flex self-start",children:[(0,a.jsx)(P.A,{}),e("prompt.localPrompt")]}),(0,a.jsxs)("div",{className:"mt-auto pt-4 flex justify-between items-center",children:[(0,a.jsx)("span",{className:"text-xs font-medium text-[var(--colorTextTertiary)] bg-[var(--colorFillSecondary)] px-2 py-1 rounded",children:ee(t.mtime)}),tx(t)]})]},t.id))})]}),(0,a.jsxs)(b.A,{title:(0,a.jsx)("span",{className:"truncate",children:eg?e("prompt.createPrompt"):e("prompt.customPrompt")}),open:es,onClose:()=>en(!1),styles:{body:{padding:"24px 32px",display:"grid",gridTemplateRows:"minmax(320px, 1fr) 420px",gap:24,height:"100%"},header:{borderBottom:"1px solid var(--colorBorderSecondary)",padding:"16px 32px"}},extra:(0,a.jsx)(d.A,{children:(0,a.jsx)(p.Ay,{type:"primary",loading:eu,onClick:()=>{tl()},children:e("common.save")})}),children:[(0,a.jsxs)("div",{className:"min-h-0 flex flex-col overflow-y-auto",children:[eg||null!==ei?(0,a.jsxs)("div",{className:"mb-4",children:[(0,a.jsx)("div",{className:"text-xs text-[var(--colorTextSecondary)] mb-1.5",children:e("prompt.promptName")}),(0,a.jsx)(f.A,{size:"large",placeholder:e("prompt.promptName"),value:ep,onChange:e=>ex(e.target.value),className:"font-medium"})]}):null,(0,a.jsx)(f.A.TextArea,{"aria-describedby":"prompt-page-guide-intro",value:ed,onChange:e=>em(e.target.value),className:"flex-1 shrink-0 min-h-[140px] resize-none font-mono text-[13px]"}),(0,a.jsxs)("div",{className:"mt-3 rounded-xl border border-[var(--borderColor)] bg-[var(--colorBgContainer)] px-4 py-3 max-h-[190px] overflow-y-auto",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-1.5",children:[(0,a.jsxs)(d.A,{size:6,children:[(0,a.jsx)(G.A,{className:"text-[var(--colorAccent)]"}),(0,a.jsx)("span",{className:"font-semibold text-xs",children:e("prompt.rulePreviewTitle")})]}),eQ&&(0,a.jsx)(N.A,{size:"small"})]}),eq?eq.recognized?(0,a.jsx)("div",{className:"flex flex-col gap-1",children:eq.summary.map((e,t)=>(0,a.jsxs)("div",{className:"text-xs text-[var(--colorText)] flex gap-1.5 leading-relaxed",children:[(0,a.jsx)(R.A,{className:"text-[var(--colorSuccess)] mt-1"}),(0,a.jsx)("span",{children:e})]},t))}):(0,a.jsx)("div",{className:"text-xs text-[var(--colorTextSecondary)]",children:e("prompt.rulePreviewNone")}):(0,a.jsx)("div",{className:"text-xs text-[var(--colorTextSecondary)]",children:ed.trim()?e("prompt.rulePreviewAnalyzing"):e("prompt.rulePreviewHint")})]})]}),(0,a.jsxs)("div",{className:"min-h-0 rounded-xl border border-[var(--borderColor)] bg-[var(--colorBgContainer)] flex flex-col overflow-hidden",children:[(0,a.jsxs)("div",{className:"px-3 py-2.5 border-b border-[var(--borderColor)] flex items-center justify-between gap-2",children:[(0,a.jsxs)(d.A,{size:6,children:[(0,a.jsx)(_.A,{className:"text-[var(--colorAccent)]"}),(0,a.jsx)("span",{className:"font-semibold",children:e("prompt.aiPromptAssistant")})]}),(0,a.jsxs)(d.A,{size:6,children:[ez.length>0&&(0,a.jsx)(p.Ay,{size:"small",onClick:()=>eF([]),children:e("prompt.clearHistory")}),eB?(0,a.jsx)(m.A,{color:"processing",className:"m-0",children:e("prompt.generating")}):(0,a.jsx)(m.A,{color:"blue",className:"m-0",children:e("prompt.canConverse")})]})]}),(0,a.jsx)("div",{ref:e5,className:"flex-1 min-h-0 overflow-y-auto p-3.5 bg-[var(--colorFillAlter)]",children:0!==ez.length||eB?(0,a.jsxs)("div",{className:"flex flex-col gap-3 w-full",children:[ez.map((r,o)=>{let l="user"===r.role;return(0,a.jsx)("div",{className:"flex ".concat(l?"justify-end":"justify-start"),children:(0,a.jsxs)("div",{className:"max-w-[78%] px-3 py-2.5 rounded-xl border border-[var(--borderColor)] whitespace-pre-wrap leading-relaxed text-[13px] transition-colors ".concat(l?"bg-[var(--colorFillSecondary)]":"bg-[var(--colorBgContainer)]"),children:[r.content,!l&&(0,a.jsx)("div",{className:"flex justify-end mt-2",children:(0,a.jsx)(p.Ay,{size:"small",type:"primary",onClick:()=>{em(r.content),t.success(e("prompt.appliedToEditor"))},children:e("prompt.apply")})})]})},"".concat(r.role,"-").concat(o))}),eB&&(0,a.jsx)("div",{className:"flex justify-start",children:(0,a.jsxs)("div",{className:"px-3 py-2.5 rounded-xl bg-[var(--colorBgContainer)] border border-[var(--borderColor)] text-[var(--colorTextSecondary)] text-[13px]",children:[(0,a.jsx)(N.A,{size:"small",className:"mr-2"}),e("prompt.aiAnalyzing")]})})]}):(0,a.jsx)(w.A,{image:w.A.PRESENTED_IMAGE_SIMPLE,description:e("prompt.mentionRecallHint")})}),(0,a.jsx)(S.A,{className:"!m-0"}),(0,a.jsxs)("div",{className:"p-3",children:[e_.length>0&&(0,a.jsx)("div",{className:"flex flex-wrap gap-1 mb-2",children:e_.map(e=>(0,a.jsxs)(m.A,{closable:!0,onClose:()=>eJ(t=>t.filter(t=>t!==e)),className:"m-0 max-w-[360px] overflow-hidden text-ellipsis",children:["@",e]},e))}),eX&&(0,a.jsxs)("div",{className:"max-h-[260px] overflow-y-auto mb-2 rounded-xl border border-[var(--borderColor)] bg-[var(--colorBgElevated)] shadow-lg",children:[(0,a.jsxs)("div",{className:"sticky top-0 z-[1] px-3 py-2.5 border-b border-[var(--borderColor)] bg-[var(--colorBgElevated)] flex justify-between gap-3 items-center",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-[var(--colorText)] text-[13px] font-bold",children:e("prompt.recallKbFiles")}),(0,a.jsx)("div",{className:"text-[var(--colorTextSecondary)] text-[11px]",children:e("prompt.recallLimitHint")})]}),(0,a.jsx)(m.A,{color:e6?"blue":"default",className:"m-0 max-w-[240px] overflow-hidden text-ellipsis",children:e6?"@".concat(e6):e("prompt.inputAtKeyword")})]}),(e0||e2)&&(0,a.jsx)("div",{className:"p-2.5",children:(0,a.jsx)(C.X,{failures:[...e0?["知识库文件清单"]:[],...e2?["知识库检索"]:[]]})}),e0?null:eL?(0,a.jsxs)("div",{className:"p-3.5 text-[var(--colorTextSecondary)] text-xs",children:[(0,a.jsx)(N.A,{size:"small",className:"mr-2"}),e("prompt.loadingKbFiles")]}):0===eD.length?(0,a.jsx)("div",{className:"p-3.5 text-[var(--colorTextSecondary)] text-xs",children:e("prompt.noRecallableKbFiles")}):0===ta.length?(0,a.jsx)("div",{className:"p-3.5 text-[var(--colorTextSecondary)] text-xs",children:eK?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(N.A,{size:"small",className:"mr-2"}),e("prompt.searchingKbContent")]}):e2?null:e("prompt.noMatchingKbFiles")}):(0,a.jsxs)(a.Fragment,{children:[eK&&(0,a.jsxs)("div",{className:"px-3 py-2 text-[var(--colorTextSecondary)] text-xs border-b border-[var(--borderColor)]",children:[(0,a.jsx)(N.A,{size:"small",className:"mr-2"}),e("prompt.continueSearchingKb")]}),ta.slice(0,30).map(t=>(0,a.jsxs)("div",{onMouseDown:e=>{var r;e.preventDefault(),r=t.relativePath,eJ(e=>e.includes(r)?e:[...e,r]),eO(e=>e.replace(/(^|\s)@([^\s@]*)$/,"$1@".concat(r," "))),e$(!1)},className:"px-3 py-2.5 cursor-pointer border-b border-[var(--borderColor)] text-xs grid grid-cols-[22px_minmax(0,1fr)_auto] gap-2.5 items-center hover:bg-[var(--colorBgHover)] transition-colors",children:[(0,a.jsx)("div",{className:"w-[22px] h-[22px] rounded-lg bg-[var(--colorFillSecondary)] flex items-center justify-center",children:(0,a.jsx)(E.A,{className:"text-[var(--colorAccent)]"})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("div",{className:"text-[var(--colorText)] truncate font-bold",children:t.relativePath}),(0,a.jsxs)("div",{className:"text-[var(--colorTextSecondary)] text-[11px] truncate",children:[t.category||e("prompt.unclassified")," \xb7 ",t.format||e("prompt.unknownFormat"),"number"==typeof t.score?" \xb7 score ".concat(t.score.toFixed(2)):""]})]}),(0,a.jsxs)(d.A,{size:4,children:[(0,a.jsx)(m.A,{color:"content"===t.matchedBy?"purple":"disk"===t.matchedBy?"orange":"blue",className:"m-0",children:"content"===t.matchedBy?e("prompt.contentMatch"):"disk"===t.matchedBy?e("prompt.diskFile"):e("prompt.fileMatch")}),(0,a.jsx)(m.A,{className:"m-0",children:e(s.mc[t.status]||"common.unknown")})]})]},t.relativePath))]})]}),(0,a.jsxs)("div",{className:"flex gap-2 items-end",children:[(0,a.jsx)(f.A.TextArea,{value:eP,onChange:e=>{let t=e.target.value;eO(t),e$(null!==ea(t))},onFocus:()=>e$(null!==ea(eP)),onPressEnter:e=>{e.shiftKey||(e.preventDefault(),tn())},disabled:eB,placeholder:e("prompt.mentionRecallPlaceholder"),autoSize:{minRows:1,maxRows:5},className:"flex-1 min-w-0 text-[13px] leading-relaxed"}),(0,a.jsx)(p.Ay,{type:"primary",icon:(0,a.jsx)(J.A,{}),loading:eB,disabled:!eP.trim(),onClick:()=>{tn()},className:"shrink-0",children:e("prompt.send")})]})]})]})]})]})}},93360:(e,t,r)=>{"use strict";r.d(t,{z:()=>l});var a=r(65321);r(97109);var o=r(33442);function l(e){let{title:t,description:r,extra:l,bottomContent:s}=e;return(0,a.jsxs)("div",{className:"animateFadeIn",children:[(0,a.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-end justify-between gap-4 pb-6 border-b border-[var(--borderColor)]",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("h1",{className:"text-3xl font-extrabold tracking-tight text-[var(--colorText)] mb-2",children:t}),r&&(0,a.jsx)("p",{className:"text-sm text-[var(--colorTextSecondary)] m-0",children:r})]}),l&&(0,a.jsx)(o.A,{className:"w-full sm:w-auto overflow-x-auto pb-1 sm:pb-0 shrink-0",size:"middle",wrap:!1,children:l})]}),s&&(0,a.jsx)("div",{className:"mt-6",children:s})]})}},96538:(e,t,r)=>{"use strict";r.d(t,{a:()=>o,j:()=>l});let a={coarse:function(e,t){let r=Math.floor(e/1e3),a=Math.floor(r/86400),o=Math.floor(r%86400/3600),l=Math.floor(r%3600/60),s="en-US"===t;return a>0?s?"".concat(a,"d ").concat(o,"h"):"".concat(a," 天 ").concat(o," 小时"):o>0?s?"".concat(o,"h ").concat(l,"m"):"".concat(o," 小时 ").concat(l," 分"):l>0?s?"".concat(l,"m"):"".concat(l," 分"):s?"Just now":"刚刚"},fine:function(e){let t=Math.round(e/1e3);if(t<60)return"".concat(t," 秒");let r=Math.floor(t/60);return r<60?"".concat(r," 分 ").concat(t%60," 秒"):"".concat(Math.floor(r/60)," 小时 ").concat(r%60," 分")},"fine-decimal":function(e){return e>=6e4?"".concat(Math.floor(e/6e4)," 分 ").concat(Math.round(e%6e4/1e3)," 秒"):"".concat((e/1e3).toFixed(1)," 秒")},metric:function(e){return e<1e3?"".concat(Math.round(e),"ms"):e<6e4?"".concat((e/1e3).toFixed(1),"s"):"".concat((e/6e4).toFixed(1),"min")}};function o(e,t){var r;return a[t.style](function(e,t){let r="s"===t?1e3*e:e;return Number.isFinite(r)&&r>0?r:0}(e,t.unit),null!=(r=t.locale)?r:"zh-CN")}function l(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"zh-CN";return o(e,{unit:"s",style:"coarse",locale:t})}}},e=>{e.O(0,[717,551,665,576,499,338,964,711,636,593,792],()=>e(e.s=27549)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[199],{24716:(e,r,a)=>{"use strict";a.d(r,{A:()=>m});var t=a(97109),s=a(3638),l=a(4034),o=a(74567),n=a(49644),i=a(7961),c=a(77032),d=a(10540);let x=(0,d.OF)("Addon",e=>[(e=>{let{componentCls:r,borderRadius:a,paddingSM:t,colorBorder:s,paddingXS:l,fontSizeLG:o,fontSizeSM:n,borderRadiusLG:c,borderRadiusSM:x,colorBgContainerDisabled:m,lineWidth:u,antCls:p}=e,[g,v]=(0,d.PN)(p,"space-addon");return{[r]:[{...(0,i.dF)(e),display:"inline-flex",alignItems:"center",gap:0,whiteSpace:"nowrap",paddingInline:t,margin:0,borderWidth:u,borderStyle:"solid",borderRadius:a,"&:hover":{zIndex:0},[`&${r}-disabled`]:{color:e.colorTextDisabled},"&-large":{fontSize:o,borderRadius:c},"&-small":{paddingInline:l,borderRadius:x,fontSize:n},"&-compact-last-item":{borderEndStartRadius:0,borderStartStartRadius:0},"&-compact-first-item":{borderEndEndRadius:0,borderStartEndRadius:0},"&-compact-item:not(:first-child):not(:last-child)":{borderRadius:0},"&-compact-item:not(:last-child)":{borderInlineEndWidth:0},"&-compact-item:not(:first-child)":{borderInlineStartWidth:0}},{[g("addon-border-color")]:s,[g("addon-background")]:m,[g("addon-border-color-outlined")]:s,[g("addon-background-filled")]:m,borderColor:v("addon-border-color"),background:v("addon-background"),"&-variant-outlined":{[g("addon-border-color")]:v("addon-border-color-outlined")},"&-variant-filled":{[g("addon-border-color")]:"transparent",[g("addon-background")]:v("addon-background-filled"),[`&${r}-disabled`]:{[g("addon-border-color")]:s,[g("addon-background")]:m}},"&-variant-borderless":{border:"none",background:"transparent"},"&-variant-underlined":{border:"none",background:"transparent"}},{"&-status-error":{[g("addon-border-color-outlined")]:e.colorError,[g("addon-background-filled")]:e.colorErrorBg,color:e.colorError},"&-status-warning":{[g("addon-border-color-outlined")]:e.colorWarning,[g("addon-background-filled")]:e.colorWarningBg,color:e.colorWarning}}]}})(e),(0,c.G)(e,{focus:!1})]),m=t.forwardRef((e,r)=>{let{className:a,children:i,style:c,prefixCls:d,variant:m="outlined",disabled:u,status:p,...g}=e,{getPrefixCls:v,direction:h}=t.useContext(o.QO),y=v("space-addon",d),[b,f]=x(y),{compactItemClassnames:j,compactSize:w}=(0,n.RQ)(y,h),k=(0,l.L)(y,p),N=(0,s.$)(y,b,j,f,`${y}-variant-${m}`,k,{[`${y}-${w}`]:w,[`${y}-disabled`]:u},a);return t.createElement("div",{ref:r,className:N,style:c,...g},i)})},33442:(e,r,a)=>{"use strict";a.d(r,{A:()=>j});var t=a(97109),s=a(42644),l=a(3638),o=a(26047);function n(e){return["small","middle","medium","large"].includes(e)}function i(e){return!!e&&(0,o.Et)(e)}var c=a(5045),d=a(92162),x=a(74567),m=a(24716),u=a(49644);let p=t.createContext({latestIndex:0}),g=p.Provider,v=e=>{let{className:r,prefix:a,index:s,children:n,separator:i,style:c,classNames:d,styles:x}=e,{latestIndex:m}=t.useContext(p);return(0,o.AZ)(n)?t.createElement(t.Fragment,null,t.createElement("div",{className:r,style:c},n),s<m&&i&&t.createElement("span",{className:(0,l.$)(`${a}-item-separator`,d?.separator),style:x?.separator},i)):null};var h=a(10540),y=a(28403);let b=(0,h.OF)("Space",e=>{let r=(0,y.oX)(e,{spaceGapSmallSize:e.paddingXS,spaceGapMiddleSize:e.padding,spaceGapLargeSize:e.paddingLG});return[(e=>{let{componentCls:r,antCls:a}=e;return{[r]:{display:"inline-flex","&-rtl":{direction:"rtl"},"&-vertical":{flexDirection:"column"},"&-align":{flexDirection:"column","&-center":{alignItems:"center"},"&-start":{alignItems:"flex-start"},"&-end":{alignItems:"flex-end"},"&-baseline":{alignItems:"baseline"}},[`${r}-item:empty`]:{display:"none"},[`${r}-item > ${a}-badge-not-a-wrapper:only-child`]:{display:"block"}}}})(r),(e=>{let{componentCls:r}=e;return{[r]:{"&-gap-row-small":{rowGap:e.spaceGapSmallSize},"&-gap-row-medium, &-gap-row-middle":{rowGap:e.spaceGapMiddleSize},"&-gap-row-large":{rowGap:e.spaceGapLargeSize},"&-gap-col-small":{columnGap:e.spaceGapSmallSize},"&-gap-col-medium, &-gap-col-middle":{columnGap:e.spaceGapMiddleSize},"&-gap-col-large":{columnGap:e.spaceGapLargeSize}}}})(r)]},()=>({}),{resetStyle:!1}),f=t.forwardRef((e,r)=>{let{getPrefixCls:a,direction:m,size:u,className:p,style:h,classNames:y,styles:f}=(0,x.TP)("space"),{size:j=u??"small",align:w,className:k,rootClassName:N,children:T,direction:S,orientation:z,prefixCls:A,split:C,separator:$,style:E,vertical:D,wrap:I=!1,classNames:G,styles:M,...F}=e,[P,_]=Array.isArray(j)?j:[j,j],B=n(_),R=n(P),W=i(_),O=i(P),Z=(0,s.$r)(T,{keepEmpty:!0}),[L,V]=(0,c.M)(z,D,S),X=void 0!==w||V?w:"center",q=$??C,K=a("space",A),[H,Q]=b(K),U={...e,size:j,orientation:L,align:X},[J,Y]=(0,d.AV)([y,G],[f,M],{props:U}),ee=(0,l.$)(K,p,H,`${K}-${L}`,{[`${K}-rtl`]:"rtl"===m,[`${K}-align-${X}`]:X,[`${K}-gap-row-${_}`]:B,[`${K}-gap-col-${P}`]:R},k,N,Q,J.root),er=(0,l.$)(`${K}-item`,J.item),ea=Z.map((e,r)=>{let a=e?.key||`${er}-${r}`;return t.createElement(v,{prefix:K,classNames:J,styles:Y,className:er,key:a,index:r,separator:q,style:Y.item},e)}),et=t.useMemo(()=>({latestIndex:Z.reduce((e,r,a)=>(0,o.AZ)(r)?a:e,0)}),[Z]);if(0===Z.length)return null;let es={};return I&&(es.flexWrap="wrap"),!R&&O&&(es.columnGap=P),!B&&W&&(es.rowGap=_),t.createElement("div",{ref:r,className:ee,style:{...es,...Y.root,...h,...E},...F},t.createElement(g,{value:et},ea))});f.Compact=u.Ay,f.Addon=m.A;let j=f},49078:(e,r,a)=>{"use strict";a.r(r),a.d(r,{default:()=>z});var t=a(65321),s=a(97109),l=a(43220),o=a.n(l),n=a(39507),i=a(49759),c=a(17807),d=a(88762),x=a(99605),m=a(85114),u=a(25258),p=a(73340),g=a(1278);let v=(0,g.A)("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);var h=a(56733),y=a(38300);let b=(0,g.A)("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);var f=a(87824);let j=(0,g.A)("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]),w=(0,g.A)("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);var k=a(6578),N=a(85310),T=a(93360),S=a(82238);function z(){var e,r,a,l;let g=(0,n.Vr)("settings"),{theme:z,resolvedTheme:A,setTheme:C}=(0,i.D)(),{locale:$,setLocale:E}=(0,n.x_)(),{message:D}=c.A.useApp(),[I,G]=(0,s.useState)(null),[M,F]=(0,s.useState)(null),[P,_]=(0,s.useState)(null),[B,R]=(0,s.useState)(!0),[W,O]=(0,s.useState)(!1),[Z,L]=(0,s.useState)(!1),[V,X]=(0,s.useState)([]);(0,s.useEffect)(()=>{R(!0);let e=[],r=(r,a,t)=>a.catch(()=>(e.push(r),t));Promise.all([r("系统统计",(0,k.FC)(),null),r("服务健康",(0,k.le)(),null),r("嵌入配置",(0,k.II)(),null)]).then(r=>{let[a,t,s]=r;X(e),a&&G(a),t&&F(t),s&&_(s)}).finally(()=>R(!1))},[]);let q=async()=>{L(!0);try{await (0,k.NI)(),D.success("已清除全部数据,即将刷新"),window.setTimeout(()=>window.location.reload(),800)}catch(e){D.error(e instanceof Error?e.message:"清除失败,请重试")}finally{L(!1),O(!1)}},K="system"===z?"system":A,H=e=>"flex items-center gap-2 px-4 py-2 text-sm font-medium rounded-xl border transition-colors ".concat(e?"bg-[var(--colorText)] text-[var(--colorBg)] border-transparent":"bg-transparent text-[var(--colorTextSecondary)] border-[var(--borderColor)] hover:border-[var(--colorTextTertiary)]"),Q=e=>{let{label:r,value:a,mono:s,tone:l}=e;return(0,t.jsxs)("div",{className:"p-4 ".concat(N.wD),children:[(0,t.jsx)("div",{className:"text-[10px] text-[var(--colorTextTertiary)] uppercase tracking-wider mb-2",children:r}),(0,t.jsx)("div",{className:"text-sm ".concat(s?"font-mono":"font-semibold"," ").concat(null!=l?l:"text-[var(--colorText)]"," truncate"),title:"string"==typeof a?a:void 0,children:a})]})};return B?(0,t.jsxs)("div",{className:"space-y-6 animateFadeIn",children:[(0,t.jsx)(d.A,{active:!0,title:!0,paragraph:{rows:1}}),(0,t.jsx)("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:Array.from({length:4}).map((e,r)=>(0,t.jsx)("div",{className:"p-6 rounded-2xl bg-[var(--colorBgContainer)] shadow-[var(--shadowSurface)]",children:(0,t.jsx)(d.A,{active:!0,paragraph:{rows:4}})},r))})]}):(0,t.jsxs)("div",{className:"space-y-6 animateFadeIn",children:[(0,t.jsx)(S.X,{failures:V}),(0,t.jsx)(T.z,{title:g("title"),description:g("description")}),(0,t.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[(0,t.jsx)(N.Zk,{title:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(p.A,{size:18,className:"text-[var(--colorTextTertiary)]"}),g("language")]}),description:g("languageDesc"),children:(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsx)("button",{className:H("zh-CN"===$),onClick:()=>E("zh-CN"),children:"中文"}),(0,t.jsx)("button",{className:H("en-US"===$),onClick:()=>E("en-US"),children:"English"})]})}),(0,t.jsx)(N.Zk,{title:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(v,{size:18,className:"text-[var(--colorTextTertiary)]"}),g("theme")]}),description:g("themeDesc"),children:(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsxs)("button",{className:H("light"===K),onClick:()=>C("light"),children:[(0,t.jsx)(h.A,{size:14}),g("light")]}),(0,t.jsxs)("button",{className:H("dark"===K),onClick:()=>C("dark"),children:[(0,t.jsx)(y.A,{size:14}),g("dark")]}),(0,t.jsxs)("button",{className:H("system"===K),onClick:()=>C("system"),children:[(0,t.jsx)(v,{size:14}),g("system")]})]})}),(0,t.jsx)(N.Zk,{title:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(b,{size:18,className:"text-[var(--colorTextTertiary)]"}),g("serverStatus")]}),description:g("serverStatusDesc"),children:(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,t.jsx)(Q,{label:g("status"),value:M?"ok"===M.status?g("healthy"):g("unknown"):"—",tone:M?"ok"===M.status?"text-[var(--colorOk)]":"text-[var(--colorDanger)]":void 0}),(0,t.jsx)(Q,{label:g("uptime"),value:M?(e=>{let r=Math.floor(e/86400),a=Math.floor(e%86400/3600),t=Math.floor(e%3600/60);return r>0?"".concat(r," ").concat(g("days")," ").concat(a," ").concat(g("hours")):a>0?"".concat(a," ").concat(g("hours")," ").concat(t," ").concat(g("minutes")):"".concat(t," ").concat(g("minutes"))})(M.uptime):"—"}),(0,t.jsxs)("div",{className:"col-span-2 p-4 ".concat(N.wD," flex items-center gap-5"),children:[(0,t.jsx)(x.A,{type:"dashboard",percent:null!=(e=null==I?void 0:I.cpu.usagePercent)?e:0,size:48,strokeColor:(null!=(r=null==I?void 0:I.cpu.usagePercent)?r:0)>80?"var(--colorDanger)":"var(--colorText)",strokeWidth:12,showInfo:!1}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("div",{className:"text-[10px] text-[var(--colorTextTertiary)] uppercase tracking-wider mb-1",children:g("cpu")}),(0,t.jsxs)("div",{className:"font-mono text-[var(--colorText)]",children:[I?"".concat(I.cpu.usagePercent.toFixed(1),"%"):"—"," ",(0,t.jsxs)("span",{className:"text-xs text-[var(--colorTextTertiary)] ml-1",children:["(",I?I.cpu.cores:"—"," ",g("cores"),")"]})]})]})]}),(0,t.jsxs)("div",{className:"col-span-2 p-4 ".concat(N.wD," flex items-center gap-5"),children:[(0,t.jsx)(x.A,{type:"dashboard",percent:null!=(a=null==I?void 0:I.memory.usagePercent)?a:0,size:48,strokeColor:(null!=(l=null==I?void 0:I.memory.usagePercent)?l:0)>80?"var(--colorDanger)":"var(--colorTextSecondary)",strokeWidth:12,showInfo:!1}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("div",{className:"text-[10px] text-[var(--colorTextTertiary)] uppercase tracking-wider mb-1",children:g("memory")}),(0,t.jsxs)("div",{className:"font-mono text-[var(--colorText)]",children:[I?"".concat(I.memory.usedMB," MB"):"—"," ",(0,t.jsxs)("span",{className:"text-xs text-[var(--colorTextTertiary)] ml-1",children:["/ ",I?I.memory.totalMB:"—"," MB"]})]})]})]})]})}),(0,t.jsx)(N.Zk,{title:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(f.A,{size:18,className:"text-[var(--colorTextTertiary)]"}),g("embeddingConfig")]}),description:g("embeddingConfigDesc"),children:(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,t.jsx)("div",{className:"col-span-2",children:(0,t.jsx)(Q,{label:g("provider"),value:(null==P?void 0:P.provider)||"—",mono:!0})}),(0,t.jsx)("div",{className:"col-span-2",children:(0,t.jsx)(Q,{label:g("model"),value:(null==P?void 0:P.model)||"—",mono:!0})}),(0,t.jsx)(Q,{label:g("apiKey"),value:P?P.hasApiKey?g("configured"):g("none"):"—",tone:(null==P?void 0:P.hasApiKey)?"text-[var(--colorOk)]":"text-[var(--colorTextSecondary)]"}),(0,t.jsx)(Q,{label:g("dimensions"),value:(null==P?void 0:P.dimensions)?"".concat(P.dimensions):"—",mono:!0})]})})]}),(0,t.jsxs)(N.Zk,{title:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(j,{size:18,className:"text-[var(--colorTextTertiary)]"}),g("localData")]}),description:g("localDataDesc"),children:[(0,t.jsxs)("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-4",children:[(0,t.jsx)(Q,{label:g("directory"),value:"~/.customize-agent/",mono:!0}),(0,t.jsx)(Q,{label:g("knowledgeBase"),value:g("localVectors")}),(0,t.jsx)(Q,{label:g("tasks"),value:I?I.tasks.total.toLocaleString():"—",mono:!0}),(0,t.jsx)(Q,{label:g("tokens"),value:I?I.tokens.total.toLocaleString():"—",mono:!0})]}),(0,t.jsxs)("div",{className:"mt-4 flex flex-col sm:flex-row sm:items-center justify-between gap-3 rounded-xl bg-[var(--colorFillAlter)] px-4 py-3",children:[(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("div",{className:"text-sm font-medium text-[var(--colorText)]",children:g("diagnostics")}),(0,t.jsx)("div",{className:"text-xs text-[var(--colorTextTertiary)] mt-0.5",children:g("diagnosticsDesc")})]}),(0,t.jsxs)(o(),{href:"/system/logs",className:"shrink-0 text-sm font-medium text-[var(--colorPrimary)] hover:underline",children:[g("openDiagnostics")," ›"]})]}),(0,t.jsxs)("div",{className:"mt-3 flex flex-col sm:flex-row sm:items-center justify-between gap-3 rounded-xl border border-[var(--colorDanger)]/30 bg-[var(--colorDanger)]/5 px-4 py-3",children:[(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("div",{className:"text-sm font-medium text-[var(--colorDanger)]",children:"清除全部数据"}),(0,t.jsx)("div",{className:"text-xs text-[var(--colorTextTertiary)] mt-0.5",children:"删除知识库上传文件、生成记录、提示词、配置、状态与日志,不可恢复"})]}),(0,t.jsx)(m.Ay,{danger:!0,size:"small",icon:(0,t.jsx)(w,{size:14}),onClick:()=>O(!0),children:"清除全部数据"})]})]}),(0,t.jsx)(u.A,{title:"清除全部数据",open:W,onCancel:()=>O(!1),okText:Z?"清除中…":"确认清除",cancelText:"取消",okButtonProps:{danger:!0,disabled:Z},onOk:()=>{q()},children:(0,t.jsxs)("div",{className:"text-sm text-[var(--colorTextSecondary)]",children:[(0,t.jsxs)("div",{children:["将删除存储根 ",(0,t.jsx)("code",{children:"~/.customize-agent"})," 下的全部内容:知识库上传文件、生成记录、提示词、模型/嵌入配置、状态与日志。"]}),(0,t.jsx)("div",{className:"mt-2 text-[var(--colorDanger)]",children:"此操作不可恢复,请确认已备份需要保留的资料。"})]})})]})}},58451:(e,r,a)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/settings",function(){return a(49078)}])},85310:(e,r,a)=>{"use strict";a.d(r,{Zk:()=>l,dh:()=>o,wD:()=>s});var t=a(65321);a(97109);let s="rounded-xl bg-[var(--colorBgContainer)] shadow-[var(--shadowSurface)] hover:shadow-[var(--shadowSurfaceHover)] transition-shadow";function l(e){let{title:r,count:a,description:s,extra:l,className:o,children:n}=e;return(0,t.jsxs)("section",{className:"rounded-2xl bg-[var(--colorBgContainer)] shadow-[var(--shadowSurface)] p-6 animateFadeIn ".concat(null!=o?o:""),children:[(0,t.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-start justify-between gap-3 mb-5",children:[(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsxs)("h2",{className:"text-base font-semibold text-[var(--colorText)] tracking-wide flex items-center gap-2 m-0",children:[r,void 0!==a&&(0,t.jsx)("span",{className:"text-[var(--colorTextTertiary)] font-normal text-sm",children:a})]}),s&&(0,t.jsx)("p",{className:"text-xs text-[var(--colorTextTertiary)] mt-1.5 mb-0 leading-relaxed max-w-3xl",children:s})]}),l]}),n]})}function o(e){let{children:r}=e;return(0,t.jsx)("div",{className:"text-xs font-semibold uppercase tracking-wider mb-2 text-[var(--colorTextTertiary)]",children:r})}},93360:(e,r,a)=>{"use strict";a.d(r,{z:()=>l});var t=a(65321);a(97109);var s=a(33442);function l(e){let{title:r,description:a,extra:l,bottomContent:o}=e;return(0,t.jsxs)("div",{className:"animateFadeIn",children:[(0,t.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-end justify-between gap-4 pb-6 border-b border-[var(--borderColor)]",children:[(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("h1",{className:"text-3xl font-extrabold tracking-tight text-[var(--colorText)] mb-2",children:r}),a&&(0,t.jsx)("p",{className:"text-sm text-[var(--colorTextSecondary)] m-0",children:a})]}),l&&(0,t.jsx)(s.A,{className:"w-full sm:w-auto overflow-x-auto pb-1 sm:pb-0 shrink-0",size:"middle",wrap:!1,children:l})]}),o&&(0,t.jsx)("div",{className:"mt-6",children:o})]})}}},e=>{e.O(0,[636,593,792],()=>e(e.s=58451)),_N_E=e.O()}]);
|
package/.next/static/chunks/pages/skills/[id]/{edit-89bbed9a3a854b04.js → edit-88e2490a4190467b.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[975],{31268:(e,i,u)=>{"use strict";u.r(i),u.d(i,{default:()=>t});var d=u(65321),n=u(86109),s=u(75257);function t(){let e=(0,n.useRouter)(),i="string"==typeof e.query.id?e.query.id:void 0;return(0,d.jsx)(s.q,{mode:"edit",skillId:i},null!=i?i:"loading")}},39928:(e,i,u)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/skills/[id]/edit",function(){return u(31268)}])}},e=>{e.O(0,[
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[975],{31268:(e,i,u)=>{"use strict";u.r(i),u.d(i,{default:()=>t});var d=u(65321),n=u(86109),s=u(75257);function t(){let e=(0,n.useRouter)(),i="string"==typeof e.query.id?e.query.id:void 0;return(0,d.jsx)(s.q,{mode:"edit",skillId:i},null!=i?i:"loading")}},39928:(e,i,u)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/skills/[id]/edit",function(){return u(31268)}])}},e=>{e.O(0,[717,551,665,576,569,787,864,313,748,257,636,593,792],()=>e(e.s=39928)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[388],{71922:(e,l,s)=>{"use strict";s.r(l),s.d(l,{default:()=>A});var t=s(65321),n=s(86109),r=s(43220),a=s.n(r),i=s(88762),o=s(85493),c=s(84253),d=s(85114),m=s(99650),p=s(97109),x=s(85979),u=s(48399),h=s(68787),j=s(11702),g=s(14524),v=s(35071);let{Text:b}=u.A;function y(e){let{label:l,children:s}=e;return(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("div",{className:"text-xs text-[var(--colorTextTertiary)] mb-1",children:l}),(0,t.jsx)("div",{className:"text-sm font-medium text-[var(--colorText)] break-words",children:s})]})}function f(e){var l,s,n,r,a;let{skill:i,options:o,labelMap:c}=e,d=e=>{var l;return null!=(l=c.get(e))?l:e},m=i.chapterChecklist,p=m?[{label:"章内检索词",values:null!=(l=m.queries)?l:[]},{label:"必含事实",values:null!=(s=m.requiredFacts)?s:[]},{label:"要求成表的小节",values:null!=(n=m.tableSections)?n:[]},{label:"表格形态要求",values:null!=(r=m.tableRequirements)?r:[]},{label:"钉住的证据文件",values:null!=(a=m.pinnedEvidenceFilePaths)?a:[]}].filter(e=>e.values.length>0):[];return(0,t.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,t.jsx)(h.A,{className:"rounded-2xl border-[var(--borderColor)]",children:(0,t.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-3 xl:grid-cols-4 gap-x-6 gap-y-4",children:[(0,t.jsx)(y,{label:"技能 ID",children:(0,t.jsx)(b,{code:!0,className:"text-xs",children:i.id})}),(0,t.jsxs)(y,{label:"来源",children:[i.builtIn?(0,t.jsx)(j.A,{color:"gold",className:"m-0",children:"内置"}):(0,t.jsx)(j.A,{className:"m-0",children:"用户"}),(0,t.jsxs)(b,{type:"secondary",className:"text-xs ml-2",children:["技能格式 v",i.version]})]}),(0,t.jsx)(y,{label:"状态",children:(0,t.jsx)(j.A,{color:i.enabled?"green":"default",className:"m-0 border-0",children:i.enabled?"已启用":"已停用"})}),(0,t.jsx)(y,{label:"章域",children:(0,t.jsx)(j.A,{color:"blue",className:"m-0",children:d(i.match.chapterDomain)})}),(0,t.jsx)(y,{label:"适用工程类型",children:0===i.match.projectTypes.length?(0,t.jsx)(b,{type:"secondary",className:"text-xs",children:"全类型(不限定工程类型)"}):(0,t.jsx)("div",{className:"tagWrap flex flex-wrap gap-1 min-w-0",children:i.match.projectTypes.map(e=>(0,t.jsx)(j.A,{className:"m-0",children:d(e)},e))})}),(0,t.jsx)(y,{label:"文档名称建议",children:i.outputTitle?(0,t.jsx)("span",{children:i.outputTitle}):(0,t.jsx)(b,{type:"secondary",className:"text-xs",children:"未声明(不对文档名称表态)"})}),(0,t.jsx)(y,{label:"章职责",children:(null==m?void 0:m.purpose)?(0,t.jsx)("span",{children:m.purpose}):(0,t.jsx)(b,{type:"secondary",className:"text-xs",children:"未声明"})}),(0,t.jsx)(y,{label:"提供内容",children:(0,t.jsxs)("div",{className:"tagWrap flex flex-wrap gap-1 min-w-0",children:[(0,t.jsxs)(j.A,{className:"m-0",children:[i.structure.length," 个专业主题"]}),(0,t.jsxs)(j.A,{color:"green",className:"m-0",children:[i.acceptance.reduce((e,l)=>e+l.items.length,0)," 条核对提示"]})]})})]})}),(0,t.jsxs)("div",{className:"grid grid-cols-1 xl:grid-cols-2 gap-4 items-start",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,t.jsx)(g.PZ,{title:"相关专业主题",description:"本条技能提供的专业内容主题。",hint:"".concat(i.structure.length," 项"),children:0===i.structure.length?(0,t.jsx)(b,{type:"secondary",className:"text-xs",children:"未声明专业主题"}):(0,t.jsx)("ol",{className:"m-0 pl-5 text-sm leading-7",children:i.structure.map((e,l)=>{var s;return(0,t.jsxs)("li",{children:[e.title,(0,t.jsx)(b,{type:"secondary",className:"text-xs ml-2",children:(null==(s=e.required)?void 0:s.join(";"))||"按具体对象组织内容"})]},"".concat(e.title,"-").concat(l))})})}),(0,t.jsxs)(g.PZ,{title:"匹配条件",description:"这条技能在什么章域、工程类型与章节标题下被选用。",children:[(0,t.jsx)(g.RU,{label:"小节标题关键词",children:(0,t.jsx)(g.n$,{empty:"未限定小节标题关键词",items:i.match.sectionKeywords.map(e=>(0,t.jsx)(j.A,{className:"m-0 border-0 bg-[var(--colorFillSecondary)]",children:e},e))})}),(0,t.jsx)(g.RU,{label:"小节标题匹配表达式",children:i.match.sectionRegex?(0,t.jsx)(b,{code:!0,className:"text-xs",children:i.match.sectionRegex}):void 0})]}),(0,t.jsx)(g.PZ,{title:"工艺知识引用",description:"写作时可加载的专业参考(按工艺卡名称显示)。",children:0===i.knowledge.length?(0,t.jsx)(b,{type:"secondary",className:"text-xs",children:"未声明知识引用"}):(0,t.jsx)("div",{className:"flex flex-col gap-2",children:i.knowledge.map((e,l)=>{var s,n,r,a;return(0,t.jsxs)("div",{className:"rounded-xl border border-[var(--borderColor)] bg-[var(--colorFillAlter)] px-3 py-2.5",children:[(0,t.jsxs)("div",{className:"tagWrap flex flex-wrap items-center gap-1.5 min-w-0",children:[(0,t.jsx)(j.A,{color:"blue",className:"m-0",children:(n=e.kind,null!=(a=null==o||null==(r=o.knowledgeKinds.find(e=>e.value===n))?void 0:r.label)?a:n)}),(null!=(s=e.ids)?s:[]).map(e=>{var l,s;return(0,t.jsx)(j.A,{className:"m-0 border-0 bg-[var(--colorFillSecondary)]",children:null!=(s=null==o||null==(l=o.processCards.find(l=>l.value===e))?void 0:l.label)?s:e},e)})]}),e.note?(0,t.jsx)("p",{className:"m-0 mt-2 text-xs leading-relaxed text-[var(--colorTextSecondary)]",children:e.note}):null]},"".concat(e.kind,"-").concat(l))})})}),o&&o.isolationRules.length>0&&(0,t.jsx)(g.PZ,{title:"资料与采用边界",description:"以下边界由软件统一执行,技能不能扩大或豁免。",children:(0,t.jsx)("div",{className:"flex flex-col gap-2",children:o.isolationRules.map(e=>(0,t.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-baseline gap-1 sm:gap-2",children:[(0,t.jsx)(b,{className:"text-sm shrink-0",children:e.label}),(0,t.jsx)(b,{type:"secondary",className:"text-xs",children:e.note})]},e.id))})})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,t.jsx)(g.PZ,{title:"所需项目资料",description:"本次任务要先查证的项目事实;标为必需而查不到时会被上游拦下。",children:(0,t.jsx)(g.n$,{empty:"未声明必需事实",items:i.requires.map(e=>(0,t.jsxs)(j.A,{color:e.required?"red":"default",className:"mb-1",children:[e.key," \xb7 ",d(e.source),e.required?" \xb7 必需":" \xb7 可选"]},e.key))})}),(0,t.jsx)(g.PZ,{title:"文档业务提示",description:"给本次规划的章级候选内容与资料检索提示。",children:0===p.length?(0,t.jsx)(b,{type:"secondary",className:"text-xs",children:"未声明章级清单"}):p.map(e=>(0,t.jsx)(g.RU,{label:e.label,children:(0,t.jsx)(g.n$,{items:e.values.map(e=>(0,t.jsx)(j.A,{className:"m-0 border-0 bg-[var(--colorFillSecondary)]",children:e},e))})},e.label))}),(0,t.jsx)(g.PZ,{title:"禁写项",description:"这条技能明确要求避免的内容或表达。",children:(0,t.jsx)(g.n$,{empty:"没有禁写项",items:i.forbidden.map(e=>(0,t.jsx)(j.A,{color:"red",className:"m-0 border-0",children:(0,v.Oz)(e)},(0,v.Oz)(e)))})}),(0,t.jsx)(g.PZ,{title:"专业写作核对提示",description:"按本任务对象和工况选用,不是数量要求或验收通过证明。",children:0===i.acceptance.flatMap(e=>e.items).length?(0,t.jsx)(b,{type:"secondary",className:"text-xs",children:"没有核对提示"}):(0,t.jsx)("ul",{className:"m-0 pl-5 text-sm leading-7",children:i.acceptance.flatMap(e=>e.items).map(e=>(0,t.jsx)("li",{children:e},e))})}),(0,t.jsx)(g.PZ,{title:"表达示例",description:"示例供理解专业表达,不能作为本项目事实。",children:(0,t.jsx)(g.RU,{label:"是否带示例",children:i.examples?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(j.A,{color:"green",className:"m-0 border-0",children:"带正例/反例"}),(0,t.jsx)(b,{type:"secondary",className:"text-xs ml-2",children:"本编辑器保留原示例。"})]}):void 0})})]})]})]})}var N=s(33061);function $(e){let{skillId:l}=e,s=(0,N.G)(),n=(0,p.useMemo)(()=>l?s.skills.find(e=>e.id===l):void 0,[s.skills,l]),r=(0,p.useMemo)(()=>{var e,l,t,n,r,a;return new Map([...null!=(n=null==(e=s.options)?void 0:e.chapterDomains)?n:[],...null!=(r=null==(l=s.options)?void 0:l.projectTypes)?r:[],...null!=(a=null==(t=s.options)?void 0:t.factSources)?a:[]].map(e=>[e.value,e.label]))},[s.options]),u=!l,h=!s.loading&&!s.failed&&!!s.options&&!n;return u||s.loading?(0,t.jsxs)("div",{className:"space-y-5 animateFadeIn",children:[(0,t.jsx)(i.A,{active:!0,title:!0,paragraph:{rows:2}}),(0,t.jsx)(i.A,{active:!0,paragraph:{rows:10}})]}):s.failed?(0,t.jsxs)("div",{className:"space-y-5 animateFadeIn",children:[(0,t.jsx)(x.k,{backHref:"/skills",backLabel:"返回技能库",title:"技能预览"}),(0,t.jsx)(o.A,{type:"error",showIcon:!0,message:"技能库读取失败",description:"".concat(s.failed,';这不是"技能不存在",请核对服务端状态后重试。')})]}):h||!n?(0,t.jsxs)("div",{className:"space-y-5 animateFadeIn",children:[(0,t.jsx)(x.k,{backHref:"/skills",backLabel:"返回技能库",title:"技能预览"}),(0,t.jsx)(c.A,{description:"技能库里没有「".concat(l,"」这条技能(可能已被删除或改名)"),children:(0,t.jsx)(a(),{href:"/skills",children:(0,t.jsx)(d.Ay,{type:"primary",children:"返回技能库"})})})]}):(0,t.jsxs)("div",{className:"space-y-5 animateFadeIn",children:[(0,t.jsx)(x.k,{backHref:"/skills",backLabel:"返回技能库",title:"技能预览 \xb7 ".concat(n.displayName),description:"只读查看这条技能声明了什么;要改内容进编辑页,保存前会做字段与引用校验。",extra:(0,t.jsx)(a(),{href:"/skills/".concat(encodeURIComponent(n.id),"/edit"),children:(0,t.jsx)(d.Ay,{type:"primary",icon:(0,t.jsx)(m.A,{}),disabled:n.builtIn,title:n.builtIn?v.F:void 0,children:"编辑"})})}),n.builtIn&&(0,t.jsx)(o.A,{type:"info",showIcon:!0,message:v.F}),(0,t.jsx)(f,{skill:n,options:s.options,labelMap:r})]})}function A(){let e=(0,n.useRouter)(),l="string"==typeof e.query.id?e.query.id:void 0;return(0,t.jsx)($,{skillId:l})}},85493:(e,l,s)=>{"use strict";s.d(l,{A:()=>S});var t=s(97109),n=s(59188),r=s(4216),a=s(45042),i=s(97137),o=s(62188),c=s(67189),d=s(42644),m=s(3638),p=s(92162),x=s(26047),u=s(74567),h=s(15561),j=s(7961),g=s(10540);let v=(e,l,s)=>({background:e,[`${s}-icon`]:{color:l}}),b=(0,g.OF)("Alert",e=>[(e=>{let{componentCls:l,motionDurationSlow:s,marginXS:t,marginSM:n,fontSize:r,fontSizeLG:a,lineHeight:i,borderRadiusLG:o,motionEaseInOutCirc:c,withDescriptionIconSize:d,colorText:m,colorTextHeading:p,withDescriptionPadding:x,defaultPadding:u,lineWidth:g,lineType:v,colorSuccessBorder:b,colorWarningBorder:y,colorErrorBorder:f,colorInfoBorder:N}=e;return{[l]:{...(0,j.dF)(e),position:"relative",display:"flex",alignItems:"center",padding:u,wordWrap:"break-word",borderRadius:o,borderWidth:(0,h.zA)(g),borderStyle:v,[`&${l}-success`]:{borderColor:b},[`&${l}-info`]:{borderColor:N},[`&${l}-warning`]:{borderColor:y},[`&${l}-error`]:{borderColor:f},[`&${l}-filled`]:{borderColor:"transparent"},[`&${l}-rtl`]:{direction:"rtl"},[`${l}-section`]:{flex:1,minWidth:0},[`${l}-icon`]:{marginInlineEnd:t,lineHeight:0},"&-description":{display:"none",fontSize:r,lineHeight:i},"&-title":{color:p},[`&${l}-motion-leave`]:{overflow:"hidden",opacity:1,transition:["max-height","opacity","padding-top","padding-bottom","margin-bottom"].map(e=>`${e} ${s} ${c}`).join(", ")},[`&${l}-motion-leave-active`]:{maxHeight:0,marginBottom:"0 !important",paddingTop:0,paddingBottom:0,opacity:0},[`&${l}-with-description`]:{alignItems:"flex-start",padding:x,[`${l}-icon`]:{marginInlineEnd:n,fontSize:d,lineHeight:0},[`${l}-title`]:{display:"block",marginBottom:t,color:p,fontSize:a},[`${l}-description`]:{display:"block",color:m}},[`&${l}-banner`]:{marginBottom:0,border:"0 !important",borderRadius:0}}}})(e),(e=>{let{componentCls:l,colorSuccess:s,colorSuccessBg:t,colorWarning:n,colorWarningBg:r,colorError:a,colorErrorBg:i,colorInfo:o,colorInfoBg:c}=e;return{[l]:{"&-success":v(t,s,l),"&-info":v(c,o,l),"&-warning":v(r,n,l),"&-error":{...v(i,a,l),[`${l}-description > pre`]:{margin:0,padding:0}}}}})(e),(e=>{let{componentCls:l,iconCls:s,motionDurationMid:t,marginXS:n,fontSizeIcon:r,colorIcon:a,colorIconHover:i}=e;return{[l]:{[`${l}-actions`]:{marginInlineStart:n},[`${l}-close-icon`]:{marginInlineStart:n,padding:0,overflow:"hidden",fontSize:r,lineHeight:(0,h.zA)(r),backgroundColor:"transparent",border:"none",cursor:"pointer",...(0,j.K8)(e),[`${s}-close`]:{color:a,transition:`color ${t}`,"&:hover":{color:i}}},"&-close-text":{color:a,transition:`color ${t}`,"&:hover":{color:i}}}}})(e)],e=>({withDescriptionIconSize:e.fontSizeHeading3,defaultPadding:`${e.paddingContentVerticalSM}px 12px`,withDescriptionPadding:`${e.paddingMD}px ${e.paddingContentHorizontalLG}px`})),y=e=>{let{icon:l,type:s,className:a,style:c,successIcon:d,infoIcon:m,warningIcon:p,errorIcon:x}=e,u={success:d??t.createElement(n.A,null),info:m??t.createElement(o.A,null),error:x??t.createElement(r.A,null),warning:p??t.createElement(i.A,null)};return t.createElement("span",{className:a,style:c},l??u[s])},f=e=>{let{isClosable:l,prefixCls:s,closeIcon:n,handleClose:r,ariaProps:i,className:o,style:c}=e,d=!0===n||void 0===n?t.createElement(a.A,null):n;return l?t.createElement("button",{type:"button",onClick:r,className:(0,m.$)(`${s}-close-icon`,o),tabIndex:0,style:c,...i},d):null},N=t.forwardRef((e,l)=>{let{description:s,prefixCls:n,message:r,title:a,banner:i,className:o,rootClassName:h,style:j,onMouseEnter:g,onMouseLeave:v,onClick:N,afterClose:$,showIcon:A,closable:k,closeText:w,closeIcon:I,action:E,id:C,styles:S,classNames:R,...P}=e,F=a??r,[M,T]=t.useState(!1),H=t.useRef(null);t.useImperativeHandle(l,()=>({nativeElement:H.current}));let{getPrefixCls:z,direction:_,variant:q,closable:L,closeIcon:Z,className:D,style:K,classNames:W,styles:B,successIcon:O,infoIcon:Q,warningIcon:U,errorIcon:X}=(0,u.TP)("alert"),G=z("alert",n),[V,J]=b(G),{onClose:Y,afterClose:ee}=(0,x.Qd)(k)?k:{},el=l=>{T(!0),(Y??e.onClose)?.(l)},es=t.useMemo(()=>void 0!==e.type?e.type:i?"warning":"info",[e.type,i]),et=e.variant??q??"outlined",en=t.useMemo(()=>!!(0,x.Qd)(k)&&!!k.closeIcon||!!w||("boolean"==typeof k?k:!!(!1!==I&&(0,x.R)(I))||!!L),[w,I,k,L]),er=!!i&&void 0===A||A,ea={...e,prefixCls:G,variant:et,type:es,showIcon:er,closable:en},ei=(0,p.XT)(K),eo=(0,p.XT)(j),[ec,ed]=(0,p.AV)([W,R],[B,ei,S,eo],{props:ea}),em=(0,m.$)(G,`${G}-${es}`,`${G}-${et}`,{[`${G}-with-description`]:!!s,[`${G}-no-icon`]:!er,[`${G}-banner`]:!!i,[`${G}-rtl`]:"rtl"===_},D,o,h,ec.root,J,V),ep=(0,d.KE)(P,{aria:!0,data:!0}),ex=t.useMemo(()=>(0,x.Qd)(k)&&k.closeIcon?k.closeIcon:w||(void 0!==I?I:(0,x.Qd)(L)&&L.closeIcon?L.closeIcon:Z),[I,k,L,w,Z]),eu=t.useMemo(()=>{let e=k??L;return(0,x.Qd)(e)?(0,d.KE)(e,{data:!0,aria:!0}):{}},[k,L]);return t.createElement(c.Ay,{visible:!M,motionName:`${G}-motion`,motionAppear:!1,motionEnter:!1,onLeaveStart:e=>({maxHeight:e.offsetHeight}),onLeaveEnd:ee??$},({className:l,style:n},r)=>t.createElement("div",{id:C,ref:(0,d.K4)(H,r),"data-show":!M,className:(0,m.$)(em,l),style:{...ed.root,...n},onMouseEnter:g,onMouseLeave:v,onClick:N,role:"alert",...ep},er?t.createElement(y,{className:(0,m.$)(`${G}-icon`,ec.icon),style:ed.icon,description:s,icon:e.icon,prefixCls:G,type:es,successIcon:O,infoIcon:Q,warningIcon:U,errorIcon:X}):null,t.createElement("div",{className:(0,m.$)(`${G}-section`,ec.section),style:ed.section},F?t.createElement("div",{className:(0,m.$)(`${G}-title`,ec.title),style:ed.title},F):null,s?t.createElement("div",{className:(0,m.$)(`${G}-description`,ec.description),style:ed.description},s):null),E?t.createElement("div",{className:(0,m.$)(`${G}-actions`,ec.actions),style:ed.actions},E):null,t.createElement(f,{className:ec.close,style:ed.close,isClosable:en,prefixCls:G,closeIcon:ex,handleClose:el,ariaProps:eu})))});var $=s(41113),A=s(49939),k=s(90218),w=s(13076),I=s(83784),E=s(15472);let C=function(e){function l(){var e,s,t;return(0,$.A)(this,l),s=l,t=arguments,s=(0,k.A)(s),(e=(0,I.A)(this,(0,w.A)()?Reflect.construct(s,t||[],(0,k.A)(this).constructor):s.apply(this,t))).state={error:void 0,info:{}},e}return(0,E.A)(l,e),(0,A.A)(l,[{key:"componentDidCatch",value:function(e,l){this.setState({error:e,info:l})}},{key:"render",value:function(){let{message:e,title:l,description:s,id:n,children:r}=this.props,{error:a,info:i}=this.state,o=l??e,c=i?.componentStack||null,d=(0,x.R)(o)?o:a?.toString(),m=(0,x.R)(s)?s:c;return a?t.createElement(N,{id:n,type:"error",title:d,description:t.createElement("pre",{style:{fontSize:"0.9em",overflowX:"auto"}},m)}):r}}])}(t.PureComponent);N.ErrorBoundary=C;let S=N},91648:(e,l,s)=>{"use strict";s.d(l,{A:()=>t});let t=(0,s(1278).A)("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]])},95195:(e,l,s)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/skills/[id]",function(){return s(71922)}])}},e=>{e.O(0,[717,665,569,787,748,636,593,792],()=>e(e.s=95195)),_N_E=e.O()}]);
|
package/.next/static/chunks/pages/skills/{new-124599c772150a1d.js → new-b2204742b055565a.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[677],{34698:(e,_,n)=>{"use strict";n.r(_),n.d(_,{default:()=>r});var s=n(65321),u=n(75257);function r(){return(0,s.jsx)(u.q,{mode:"create"})}},84788:(e,_,n)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/skills/new",function(){return n(34698)}])}},e=>{e.O(0,[
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[677],{34698:(e,_,n)=>{"use strict";n.r(_),n.d(_,{default:()=>r});var s=n(65321),u=n(75257);function r(){return(0,s.jsx)(u.q,{mode:"create"})}},84788:(e,_,n)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/skills/new",function(){return n(34698)}])}},e=>{e.O(0,[717,551,665,576,569,787,864,313,748,257,636,593,792],()=>e(e.s=84788)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[950],{25981:(e,t,n)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/skills",function(){return n(81828)}])},33061:(e,t,n)=>{"use strict";n.d(t,{G:()=>s});var i=n(97109),l=n(35071);function s(){let[e,t]=(0,i.useState)([]),[n,s]=(0,i.useState)(),[r,a]=(0,i.useState)([]),[c,o]=(0,i.useState)(!0),[d,u]=(0,i.useState)(""),p=(0,i.useCallback)(async()=>{o(!0);let e=await (0,l.SS)("/api/skills");if(e.ok){var n;t(e.data.skills),s(e.data.options),a(null!=(n=e.data.invalid)?n:[]),u("")}else u(e.message);o(!1)},[]);return(0,i.useEffect)(()=>{p()},[p]),{skills:e,options:n,invalid:r,loading:c,failed:d,reload:p,applySkills:t}}},35071:(e,t,n)=>{"use strict";n.d(t,{F:()=>s,Ie:()=>o,Oz:()=>a,RW:()=>p,SS:()=>l,eT:()=>i,m6:()=>c});let i={"Content-Type":"application/json"};async function l(e,t){try{let i,l=await fetch(e,t),s=await l.text();try{i=s?JSON.parse(s):void 0}catch(e){i=void 0}if(!l.ok){var n;let e=null!=i?i:{};return{ok:!1,status:l.status,message:null!=(n=e.error)?n:"HTTP ".concat(l.status),issues:Array.isArray(e.errors)?e.errors:[]}}return{ok:!0,data:i}}catch(e){return{ok:!1,status:0,message:e instanceof Error?e.message:"网络请求失败",issues:[]}}}let s="内置技能只读,随应用版本更新。可新建用户技能进行配置。";function r(e){return[...new Set((null!=e?e:[]).map(e=>e.trim()).filter(e=>e.length>0))]}function a(e){return"string"==typeof e?e:e.phrase}function c(e){return{id:e.id,enabled:e.enabled,match:{chapterDomain:e.match.chapterDomain,projectTypes:[...e.match.projectTypes],sectionKeywords:[...e.match.sectionKeywords],...e.match.sectionRegex?{sectionRegex:e.match.sectionRegex}:{}},requires:e.requires.map(e=>({...e})),structure:e.structure.map(e=>{var t;return{title:e.title,required:[...null!=(t=e.required)?t:[]]}}),forbidden:e.forbidden.map(a),knowledge:e.knowledge.map(e=>({kind:e.kind,...e.ids?{ids:[...e.ids]}:{},...e.note?{note:e.note}:{}})),acceptance:e.acceptance.map(e=>({kind:"llmChecklist",checklistItems:[...e.items]})),...void 0!==e.outputTitle?{outputTitle:e.outputTitle}:{},...e.chapterChecklist?{chapterChecklist:{...e.chapterChecklist,...e.chapterChecklist.sections?{sections:[...e.chapterChecklist.sections]}:{}}}:{}}}function o(){return{id:"skill-".concat(Date.now()),enabled:!0,match:{projectTypes:[],sectionKeywords:[]},requires:[{source:"boq",required:!1}],structure:[{}],forbidden:[],knowledge:[],acceptance:[{kind:"llmChecklist",checklistItems:[]}]}}function d(e){var t;return(null!=(t=e.ids)?t:[]).length>0}function u(e){var t;return(null!=(t=e.checklistItems)?t:[]).length>0}function p(e,t,n){var i,l,s,a,c,o,p,m,h,x;let v={chapterDomain:null==(i=e.match)?void 0:i.chapterDomain,projectTypes:[...null!=(o=null==(l=e.match)?void 0:l.projectTypes)?o:[]],sectionKeywords:r(null==(s=e.match)?void 0:s.sectionKeywords),...(null==(c=e.match)||null==(a=c.sectionRegex)?void 0:a.trim())?{sectionRegex:e.match.sectionRegex.trim()}:{}},g=(null!=(p=e.requires)?p:[]).filter(e=>{var t;return(null!=(t=e.key)?t:"").trim().length>0}).map(e=>{var t;return{key:(null!=(t=e.key)?t:"").trim(),source:e.source,required:!0===e.required}}),k=(null!=(m=e.structure)?m:[]).filter(e=>{var t;return(null!=(t=e.title)?t:"").trim().length>0}).map(e=>{var t;return{title:(null!=(t=e.title)?t:"").trim(),required:r(e.required)}}),f=(null!=(h=e.knowledge)?h:[]).filter(d).map(e=>{var t;return{kind:"processCard",ids:r(e.ids),...(null==(t=e.note)?void 0:t.trim())?{note:e.note.trim()}:{}}}),j=(null!=(x=e.acceptance)?x:[]).filter(u).map(e=>({kind:"llmChecklist",items:r(e.checklistItems),nonDeterministic:!0}));return{id:e.id.trim(),version:t,source:"user",enabled:!1!==e.enabled,match:v,requires:g,structure:k,forbidden:r(e.forbidden),knowledge:f,acceptance:j,...function(e){var t,n,i,l;let s=null!=(l=null==(t=e.outputTitle)?void 0:t.trim())?l:"",a=e.chapterChecklist,c={sections:r(null==a?void 0:a.sections),queries:r(null==a?void 0:a.queries),requiredFacts:r(null==a?void 0:a.requiredFacts),tableSections:r(null==a?void 0:a.tableSections),tableRequirements:r(null==a?void 0:a.tableRequirements),pinnedEvidenceFilePaths:r(null==a?void 0:a.pinnedEvidenceFilePaths)},o=!!(null==a||null==(n=a.purpose)?void 0:n.trim())||Object.values(c).some(e=>e.length>0);return{...s?{outputTitle:s}:{},...o?{chapterChecklist:{...(null==a||null==(i=a.purpose)?void 0:i.trim())?{purpose:a.purpose.trim()}:{},...Object.fromEntries(Object.entries(c).filter(e=>{let[,t]=e;return t.length>0}))}}:{}}}(e),...n?{examples:n}:{}}}},58690:(e,t,n)=>{"use strict";function i(e){var t,n,i;let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{defaultPageSize:null!=(t=l.pageSize)?t:10,pageSizeOptions:null!=(n=l.pageSizeOptions)?n:[10,20,50,100],showSizeChanger:!0,showTotal:t=>{var n,i;return e(null!=(n=l.totalLabelKey)?n:"common.totalRows",null!=(i=l.totalLabelFallback)?i:"共 {count} 条").replace("{count}",String(t))},hideOnSinglePage:null!=(i=l.hideOnSinglePage)&&i,showQuickJumper:!1}}n.d(t,{B:()=>i})},81828:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>I});var i=n(65321),l=n(97109),s=n(86109),r=n(48399),a=n(17807),c=n(85114),o=n(85493),d=n(68787),u=n(42700),p=n(84253),m=n(38964),h=n(11702),x=n(33442),v=n(44534),g=n(32965),k=n(54746),f=n(8263),j=n(99650),y=n(58209),b=n(39507),w=n(58690),S=n(93360),A=n(33061),C=n(35071);let{Text:T}=r.A;function I(){let{message:e}=a.A.useApp(),t=(0,b.Vr)(),n=(0,s.useRouter)(),r=(0,A.G)(),{skills:I,options:N}=r,q=(0,l.useMemo)(()=>{var e,t,n;return new Map([...null!=(e=null==N?void 0:N.chapterDomains)?e:[],...null!=(t=null==N?void 0:N.projectTypes)?t:[],...null!=(n=null==N?void 0:N.factSources)?n:[]].map(e=>[e.value,e.label]))},[N]),z=async(t,n)=>{var i,l;let s=await (0,C.SS)("/api/skills/".concat(encodeURIComponent(t.id)),{method:"PUT",headers:C.eT,body:JSON.stringify({...t,enabled:n})});if(!s.ok)return void e.error("切换启用状态失败:".concat(s.message));i=s.data,r.applySkills(i.skills),(null==(l=i.warnings)?void 0:l.length)&&e.warning("已保存,但有 ".concat(i.warnings.length," 条提示:").concat(i.warnings.map(e=>e.message).join(";")))},R=async n=>{let i=await (0,C.SS)("/api/skills/".concat(encodeURIComponent(n.id)),{method:"DELETE"});if(!i.ok)return void e.error("删除失败:".concat(i.message));r.applySkills(i.data.skills),e.success(t("common.success"))},E=e=>{n.push("/skills/".concat(encodeURIComponent(e.id)))};return(0,i.jsxs)("div",{className:"space-y-6 animateFadeIn",children:[(0,i.jsx)(S.z,{title:t("nav.skills"),description:"技能提供专业主题、资料需求、工艺知识和写作核对提示,按章域、工程类型与具体对象选用。本次任务的实际章节职责由主控规划确定。保存时会校验技能字段与工艺卡引用。",extra:(0,i.jsx)(c.Ay,{type:"primary",icon:(0,i.jsx)(k.A,{}),onClick:()=>{n.push("/skills/new")},disabled:!N,children:"新建技能"})}),r.invalid.length>0&&(0,i.jsx)(o.A,{type:"warning",showIcon:!0,message:"技能库有 ".concat(r.invalid.length," 个无法读取的文件(不影响其余技能)"),description:(0,i.jsx)("div",{className:"text-xs",children:r.invalid.map(e=>(0,i.jsxs)("div",{children:[e.file,":",e.reason]},e.file))})}),r.failed&&!r.loading&&(0,i.jsx)(o.A,{type:"error",showIcon:!0,message:"技能库读取失败",description:"".concat(r.failed,';这不是"技能库为空",请核对服务端状态后重试。')}),(0,i.jsx)(d.A,{className:"rounded-2xl",children:r.loading?(0,i.jsx)("div",{className:"py-10 text-center",children:(0,i.jsx)(u.A,{})}):0===I.length?r.failed?null:(0,i.jsx)(p.A,{description:"技能库为空"}):(0,i.jsx)(m.A,{dataSource:I,rowKey:"id",pagination:(0,w.B)(t),onRow:e=>({onClick:()=>E(e),style:{cursor:"pointer"}}),columns:[{title:"技能",dataIndex:"displayName",render:e=>(0,i.jsx)(T,{strong:!0,children:e})},{title:"章域",width:140,render:(e,t)=>{var n;return(0,i.jsx)(h.A,{color:"blue",children:null!=(n=q.get(t.match.chapterDomain))?n:t.match.chapterDomain})}},{title:"工程类型",width:180,render:(e,t)=>0===t.match.projectTypes.length?(0,i.jsx)(T,{type:"secondary",className:"text-xs",children:"全类型"}):(0,i.jsx)(x.A,{size:4,wrap:!0,children:t.match.projectTypes.map(e=>{var t;return(0,i.jsx)(h.A,{children:null!=(t=q.get(e))?t:e},e)})})},{title:"主题 / 专业提示",width:180,render:(e,t)=>(0,i.jsxs)(x.A,{size:4,children:[(0,i.jsxs)(h.A,{children:[t.structure.length," 个主题"]}),(0,i.jsxs)(h.A,{color:"green",children:[t.acceptance.length," 组提示"]})]})},{title:"来源",width:100,render:(e,t)=>t.builtIn?(0,i.jsx)(h.A,{color:"gold",title:C.F,children:"内置"}):(0,i.jsx)(h.A,{children:"用户"})},{title:"启用",width:90,render:(e,t)=>(0,i.jsx)("div",{onClick:e=>e.stopPropagation(),className:"inline-flex",children:(0,i.jsx)(v.A,{size:"small",checked:t.enabled,disabled:t.builtIn,title:t.builtIn?C.F:void 0,onChange:e=>{z(t,e)}})})},{title:"操作",width:150,render:(e,l)=>(0,i.jsxs)(x.A,{size:0,onClick:e=>e.stopPropagation(),children:[(0,i.jsx)(c.Ay,{size:"small",type:"text",icon:(0,i.jsx)(f.A,{}),title:"预览",onClick:()=>E(l)}),(0,i.jsx)(c.Ay,{size:"small",type:"text",icon:(0,i.jsx)(j.A,{}),disabled:l.builtIn,title:l.builtIn?C.F:t("common.edit"),onClick:()=>{n.push("/skills/".concat(encodeURIComponent(l.id),"/edit"))}}),(0,i.jsx)(g.A,{title:"确认删除该技能?",onConfirm:()=>{R(l)},disabled:l.builtIn,children:(0,i.jsx)(c.Ay,{size:"small",type:"text",danger:!0,icon:(0,i.jsx)(y.A,{}),disabled:l.builtIn,title:l.builtIn?C.F:t("common.delete")})})]})}]})})]})}},93360:(e,t,n)=>{"use strict";n.d(t,{z:()=>s});var i=n(65321);n(97109);var l=n(33442);function s(e){let{title:t,description:n,extra:s,bottomContent:r}=e;return(0,i.jsxs)("div",{className:"animateFadeIn",children:[(0,i.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-end justify-between gap-4 pb-6 border-b border-[var(--borderColor)]",children:[(0,i.jsxs)("div",{className:"min-w-0",children:[(0,i.jsx)("h1",{className:"text-3xl font-extrabold tracking-tight text-[var(--colorText)] mb-2",children:t}),n&&(0,i.jsx)("p",{className:"text-sm text-[var(--colorTextSecondary)] m-0",children:n})]}),s&&(0,i.jsx)(l.A,{className:"w-full sm:w-auto overflow-x-auto pb-1 sm:pb-0 shrink-0",size:"middle",wrap:!1,children:s})]}),r&&(0,i.jsx)("div",{className:"mt-6",children:r})]})}}},e=>{e.O(0,[717,551,665,569,499,787,338,964,715,636,593,792],()=>e(e.s=25981)),_N_E=e.O()}]);
|