@customize-agent/server 3.0.10 → 3.0.11
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 +54 -36
- package/.next/prerender-manifest.json +3 -3
- package/.next/routes-manifest.json +6 -0
- package/.next/server/chunks/3445.js +6 -6
- package/.next/server/chunks/5076.js +1 -1
- package/.next/server/chunks/8204.js +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/documents/chapter/regenerate.js +1 -1
- package/.next/server/pages/api/documents/chapter/regenerate.js.nft.json +1 -1
- package/.next/server/pages/api/documents/export.js +1 -1
- package/.next/server/pages/api/documents/export.js.nft.json +1 -1
- package/.next/server/pages/api/documents/generate.js +1 -1
- package/.next/server/pages/api/documents/generate.js.nft.json +1 -1
- package/.next/server/pages/api/documents/specs.js +1 -0
- package/.next/server/pages/api/documents/specs.js.nft.json +1 -0
- package/.next/server/pages/api/documents/templates.js +1 -1
- package/.next/server/pages/api/documents/templates.js.nft.json +1 -1
- package/.next/server/pages/context/long-term.html +1 -1
- package/.next/server/pages/context/short-term.html +1 -1
- package/.next/server/pages/document-roles.html +1 -1
- package/.next/server/pages/document-specs.html +1 -0
- package/.next/server/pages/document-specs.js.nft.json +1 -0
- 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/search.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-manifest.json +22 -20
- package/.next/static/chunks/{400-ba996d76e74a7368.js → 400-f06f00619f22421e.js} +1 -1
- package/.next/static/chunks/730-727fe4b055c78dc2.js +1 -0
- package/.next/static/chunks/740-2bcba39d841f2b16.js +16 -0
- package/.next/static/chunks/{845-b394c886baabe12f.js → 804-e654a1589d9adc65.js} +3 -3
- package/.next/static/chunks/846-fed995f7c83fc6c3.js +1 -0
- package/.next/static/chunks/958-66e2dcf301fb3c3f.js +1 -0
- package/.next/static/chunks/pages/{_app-15fb8428c7126df0.js → _app-49c11d5b0712c7a5.js} +9 -9
- package/.next/static/chunks/pages/context/{long-term-9685fc1fd8397807.js → long-term-710aaeb12e378258.js} +1 -1
- package/.next/static/chunks/pages/context/{short-term-86f5d204405bb05c.js → short-term-e68f01478e7ed238.js} +1 -1
- package/.next/static/chunks/pages/document-roles-caee7af42da4f792.js +1 -0
- package/.next/static/chunks/pages/document-specs-7085069b6dcdaee6.js +1 -0
- package/.next/static/chunks/pages/documents-b78988e17525927f.js +1 -0
- package/.next/static/chunks/pages/{guide-0aa6938c95fd8152.js → guide-b495954d18d56b33.js} +1 -1
- package/.next/static/chunks/pages/knowledge/{file-detail-21dbc84d04f969ca.js → file-detail-793d12234ccddac1.js} +1 -1
- package/.next/static/chunks/pages/knowledge/{files-369d7ccf6a6e4e43.js → files-a3a4bbc49c980b46.js} +1 -1
- package/.next/static/chunks/pages/knowledge/manage-64ad6cdce068edb1.js +1 -0
- package/.next/static/chunks/pages/knowledge/{search-5a199ff773f7938b.js → search-fe148477dfe05966.js} +1 -1
- package/.next/static/chunks/pages/models-6131bc7596604158.js +1 -0
- package/.next/static/chunks/pages/overview-db5df4f0bec2a77c.js +1 -0
- package/.next/static/yEauW-YU8G-h4UdYFV8_d/_buildManifest.js +1 -0
- package/package.json +4 -4
- package/.next/static/PkdECgLy3eGpkRC2sc90n/_buildManifest.js +0 -1
- package/.next/static/chunks/228-7112f995b33b1fd3.js +0 -1
- package/.next/static/chunks/740-cd38299e151d3ffc.js +0 -16
- package/.next/static/chunks/951-320008e618be7e4f.js +0 -1
- package/.next/static/chunks/958-0793922b6b146891.js +0 -1
- package/.next/static/chunks/pages/document-roles-1449654aa961426e.js +0 -1
- package/.next/static/chunks/pages/documents-dc6582d6886d4fb6.js +0 -1
- package/.next/static/chunks/pages/knowledge/manage-447ce42652c203f4.js +0 -1
- package/.next/static/chunks/pages/models-fc67c4147d2aa3cb.js +0 -1
- package/.next/static/chunks/pages/overview-558db8205a06d058.js +0 -1
- /package/.next/static/{PkdECgLy3eGpkRC2sc90n → yEauW-YU8G-h4UdYFV8_d}/_ssgManifest.js +0 -0
package/.next/static/chunks/pages/knowledge/{files-369d7ccf6a6e4e43.js → files-a3a4bbc49c980b46.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[28],{426:(e,t,n)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/knowledge/files",function(){return n(6451)}])},2803:(e,t)=>{"use strict";t.A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M400 317.7h73.9V656c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V317.7H624c6.7 0 10.4-7.7 6.3-12.9L518.3 163a8 8 0 00-12.6 0l-112 141.7c-4.1 5.3-.4 13 6.3 13zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"}}]},name:"upload",theme:"outlined"}},3793:(e,t)=>{"use strict";t.A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"}}]},name:"delete",theme:"outlined"}},4569:e=>{e.exports={featureLabel:"style_featureLabel__XFSTX",featureValue:"style_featureValue__I_wMP",filterInput:"style_filterInput__4_Elu",filterSelect:"style_filterSelect__vUBJ9",statusPanel:"style_statusPanel__9arTu",statusPanelHeader:"style_statusPanelHeader__nKv1I",statusEmpty:"style_statusEmpty__8LWzH",statusList:"style_statusList__FpNgC",statusItem:"style_statusItem__uzO80",statusHeader:"style_statusHeader__o9q_b",statusDesc:"style_statusDesc__XiWFa",statusPath:"style_statusPath__Udxvv",statusMeta:"style_statusMeta__XukHt",searchResultList:"style_searchResultList__cVKZg",searchResultItem:"style_searchResultItem__boj6D",searchResultHeader:"style_searchResultHeader__meVdJ",searchContent:"style_searchContent__XbUVk",pdfPreviewStrip:"style_pdfPreviewStrip__94_eG",drawingPreview:"style_drawingPreview__lkk_L"}},5258:(e,t,n)=>{"use strict";n.d(t,{A:()=>w});var a=n(1541),r=n(1848),i=n(1249),s=n(7109),o=n(2658),c=n(3638),l=n(2162),d=n(2725),u=n(4567),p=n(632),h=n(9517),y=n(9412),f=n(9527);let g=(0,d.U)(e=>{let{prefixCls:t,className:n,closeIcon:a,closable:r,type:i,title:d,children:g,footer:m,classNames:x,styles:v,...w}=e,{getPrefixCls:b}=s.useContext(u.QO),{className:j,style:C,classNames:S,styles:P}=(0,u.TP)("modal"),_=b(),k=t||b("modal"),T=(0,p.A)(_),[A,N]=(0,f.Ay)(k,T),[O,E]=(0,l.AV)([S,x],[P,v],{props:e}),L=`${k}-confirm`,R={};return R=i?{closable:r??!1,title:"",footer:"",children:s.createElement(h.k,{...e,prefixCls:k,confirmPrefixCls:L,rootPrefixCls:_,content:g})}:{closable:r??!0,title:d,footer:null!==m&&s.createElement(y.w,{...e}),children:g},s.createElement(o.Z,{prefixCls:k,className:(0,c.$)(A,`${k}-pure-panel`,i&&L,i&&`${L}-${i}`,n,j,N,T,O.root),style:{...C,...E.root},...w,closeIcon:(0,y.O)(k,a),closable:r,classNames:O,styles:E,...R})});var m=n(9739);function x(e){return(0,a.Ay)((0,a.fp)(e))}let v=i.A;v.useModal=m.A,v.info=function(e){return(0,a.Ay)((0,a.$D)(e))},v.success=function(e){return(0,a.Ay)((0,a.Ej)(e))},v.error=function(e){return(0,a.Ay)((0,a.jT)(e))},v.warning=x,v.warn=x,v.confirm=function(e){return(0,a.Ay)((0,a.lr)(e))},v.destroyAll=function(){for(;r.A.length;){let e=r.A.pop();e&&e()}},v.config=a.FB,v._InternalPanelDoNotUseOrYouWillBeFired=g;let w=v},5551:(e,t,n)=>{"use strict";function a(e){if(0===e)return"0 B";let t=Math.floor(Math.log(e)/Math.log(1024)),n=e/Math.pow(1024,t);return"".concat(n.toFixed(+(0!==t))," ").concat(["B","KB","MB","GB","TB"][t])}function r(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"zh-CN";if(!e||e<=0)return"en-US"===t?"Never":"从未";let n=Math.floor(Math.floor((Date.now()-e)/1e3)/60),a=Math.floor(n/60),r=Math.floor(a/24);return r>30?new Date(e).toLocaleDateString(t):"en-US"===t?r>0?"".concat(r,"d ago"):a>0?"".concat(a,"h ago"):n>0?"".concat(n,"m ago"):"Just now":r>0?"".concat(r," 天前"):a>0?"".concat(a," 小时前"):n>0?"".concat(n," 分钟前"):"刚刚"}n.d(t,{Jm:()=>o,fw:()=>r,z3:()=>a});let i={document:"文档",spreadsheet:"表格",image:"图片",cad:"图纸",code:"代码",data:"数据",web:"网页",diagram:"图表",archive:"压缩包",other:"其他"},s={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 n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"zh-CN";return null!=(t=("en-US"===n?s:i)[e])?t:e}},6451:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>E});var a=n(5321),r=n(7109),i=n(3014),s=n(3220),o=n.n(s),c=n(4986),l=n(7807),d=n(5258),u=n(3442),p=n(1702),h=n(5114),y=n(4668),f=n(7271),g=n(2551),m=n(9605),x=n(8787),v=n(9400),w=n(6631),b=n(8209),j=n(486),C=n(2803),S=n(8483);function P(){return(P=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}let _=r.forwardRef((e,t)=>r.createElement(S.A,P({},e,{ref:t,icon:C.A})));var k=n(6578),T=n(5551),A=n(4569),N=n.n(A);let O=["document","spreadsheet","image","cad","code","data","web","diagram","archive","other"];function E(){let e=(0,i.Vr)("knowledge"),{locale:t}=(0,i.x_)(),{message:n}=l.A.useApp(),s=(0,c.useSearchParams)().get("category")||"",[C,S]=(0,r.useState)([]),[P,A]=(0,r.useState)(!0),[E,L]=(0,r.useState)(""),[R,I]=(0,r.useState)(s),[J,U]=(0,r.useState)(!1),[D,M]=(0,r.useState)([]),[H,z]=(0,r.useState)([]),[B,V]=(0,r.useState)(1),F=(0,r.useRef)(R);(0,r.useEffect)(()=>{F.current=R},[R]);let X=(0,r.useCallback)(async e=>{let t=null!=e?e:F.current;A(!0);try{let e=await (0,k.HT)({category:t||void 0,limit:200});S(e.files||[])}catch(e){S([])}finally{A(!1)}},[]);(0,r.useEffect)(()=>{X(R)},[R,X]);let W=e=>({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}),$=(0,r.useCallback)(async()=>{try{let e=await (0,k.Qx)();M(e.operations.map(W))}catch(e){}},[]);(0,r.useEffect)(()=>{$()},[$]);let q=async()=>{try{await (0,k.H7)(),M([]),n.success("任务状态已清空")}catch(e){n.error("清空任务状态失败")}},Q=async e=>{if(0===e.length)return;let t=1===e.length?e[0].name:"".concat(e.length," 个文件");U(!0),M(e=>[{type:"upload",title:"上传 ".concat(t),description:"等待上传、解析、切片和入库",status:"processing",percent:10},...e].slice(0,50));let a="".concat(Date.now(),"-").concat(Math.random().toString(36).slice(2)),r=setInterval(()=>{(0,k.QT)(a).then(e=>{M(n=>[{type:"upload",title:"上传 ".concat(t),description:"".concat(e.message).concat(e.chunkCount?",".concat(e.chunkCount," 个切片"):""),status:"error"===e.stage?"warning":"processing",percent:e.percent},...n.filter(e=>e.title!=="上传 ".concat(t))].slice(0,50))}).catch(()=>void 0)},500);try{var i,s;let o=await (0,k.c1)(e,void 0,a);clearInterval(r),(null==(i=o.vectorStatus)?void 0:i.status)==="error"?n.info("文件已上传,正在后台入库"):n.success("上传成功"),L(""),I(""),z([]),V(1),F.current="";let c=null==(s=o.files)?void 0:s.find(e=>e.relativePath===o.relativePath),l=(e=>{if(!e)return{};let t={};try{t=e.metadataJson?JSON.parse(e.metadataJson):{}}catch(e){}let n="object"==typeof t.extraction&&t.extraction?t.extraction:t;return{textLength:"number"==typeof n.textLength?n.textLength:void 0,extractionMode:"string"==typeof n.extractionMode?n.extractionMode:void 0}})(c);await $(),M(e=>[{type:"upload",title:"上传完成 ".concat(t),description:"解析、分块和入库流程已完成",status:"success",filePath:null==c?void 0:c.relativePath,chunkCount:null==c?void 0:c.chunkCount,textLength:l.textLength,extractionMode:l.extractionMode},...e.filter(e=>e.title!=="上传 ".concat(t))].slice(0,50)),Array.isArray(o.files)?S(o.files):(await (0,k.H1)(),await X(""),await $())}catch(e){n.error("上传失败"),M(e=>[{type:"error",title:"上传失败 ".concat(t),description:"请重试或检查文件格式",status:"error"},...e].slice(0,50))}finally{clearInterval(r),U(!1)}},K=e=>{let t="selected"===e?H.map(String):"filtered"===e?Z.map(e=>e.relativePath):[];if("all"!==e&&0===t.length)return;let a="all"===e?"删除全部文件?":"filtered"===e?"删除当前筛选结果 ".concat(t.length," 个文件?"):"删除已选 ".concat(t.length," 个文件?");d.A.confirm({title:a,content:"将同时删除文件、切片、索引和向量记录。此操作不可撤销。",okText:"确认删除",cancelText:"取消",okButtonProps:{danger:!0},onOk:async()=>{M(e=>[{type:"delete",title:a,description:"正在批量删除文件和索引",status:"processing",percent:10},...e].slice(0,50));try{var r;let a=null!=(r=("all"===e?await (0,k.X8)():await (0,k.SJ)(t)).deleted)?r:t.length;n.success("已删除 ".concat(a," 个文件")),z([]),M(e=>[{type:"delete",title:"批量删除完成",description:"已删除 ".concat(a," 个文件、切片和索引"),status:"success"},...e].slice(0,50)),await X(),await $()}catch(e){n.error("批量删除失败"),M(e=>[{type:"error",title:"批量删除失败",description:"请重试",status:"error"},...e].slice(0,50))}}})},Z=E?C.filter(e=>e.relativePath.toLowerCase().includes(E.toLowerCase())):C,G=[{title:e("fileName"),dataIndex:"relativePath",key:"name",render:e=>(0,a.jsxs)(u.A,{children:[(0,a.jsx)(w.A,{}),(0,a.jsx)(o(),{className:"truncate max-w-[400px] inline-block",href:"/knowledge/file-detail?relativePath=".concat(encodeURIComponent(e)),children:e})]})},{title:e("fileCategory"),dataIndex:"category",key:"cat",width:120,render:e=>(0,a.jsx)(p.A,{children:(0,T.Jm)(e,t)})},{title:e("fileSize"),dataIndex:"fileSize",key:"size",width:100,render:e=>(0,T.z3)(e)},{title:"切片",dataIndex:"chunkCount",key:"chunks",width:90,render:e=>(0,a.jsx)(p.A,{color:e>1?"green":"orange",children:e})},{title:"解析状态",dataIndex:"status",key:"status",width:110,render:(e,t)=>(0,a.jsx)(p.A,{color:"active"===e?"green":"red",children:t.errorMessage||e})},{title:e("fileDate"),dataIndex:"mtime",key:"date",width:140,render:e=>e?new Date(e).toLocaleDateString(t):"—"},{title:"",key:"act",width:60,render:(t,r)=>(0,a.jsx)(h.Ay,{type:"text",danger:!0,size:"small",icon:(0,a.jsx)(b.A,{}),onClick:()=>{d.A.confirm({title:e("delete"),content:e("deleteConfirm"),okText:"确认",cancelText:"取消",okButtonProps:{danger:!0},onOk:async()=>{M(e=>[{type:"delete",title:"删除 ".concat(r.relativePath),description:"正在删除文件记录",status:"processing"},...e].slice(0,50));try{await (0,k.xq)(r.relativePath),n.success("已删除"),M(e=>[{type:"delete",title:"删除完成 ".concat(r.relativePath),description:"文件和索引记录已移除",status:"success"},...e].slice(0,50)),z(e=>e.filter(e=>e!==r.relativePath)),await X(),await $()}catch(e){n.error("删除失败"),M(e=>[{type:"error",title:"删除失败 ".concat(r.relativePath),description:"请重试",status:"error"},...e].slice(0,50))}}})}})}];return(0,a.jsxs)("div",{className:"space-y-5 animateFadeIn",children:[(0,a.jsx)("h2",{className:"pageTitle",children:e("fileList")}),(0,a.jsxs)("div",{className:"flex flex-wrap items-end gap-3",children:[(0,a.jsx)(y.A,{placeholder:e("searchPlaceholder"),prefix:(0,a.jsx)(j.A,{}),value:E,onChange:e=>{L(e.target.value),V(1)},allowClear:!0,className:N().filterInput}),(0,a.jsx)(f.A,{value:R||void 0,onChange:e=>{I(e||""),V(1)},placeholder:e("filterCategory"),allowClear:!0,className:N().filterSelect,options:[{label:e("allCategories"),value:""},...O.map(e=>({label:(0,T.Jm)(e,t),value:e}))]}),(0,a.jsx)(h.Ay,{type:"primary",icon:(0,a.jsx)(_,{}),loading:J,onClick:()=>{var e;return null==(e=document.getElementById("kb-file-upload-input"))?void 0:e.click()},children:J?e("uploading"):e("upload")}),(0,a.jsx)(h.Ay,{icon:(0,a.jsx)(_,{}),loading:J,onClick:()=>{var e;return null==(e=document.getElementById("kb-folder-upload-input"))?void 0:e.click()},children:"上传文件夹"}),(0,a.jsxs)(h.Ay,{danger:!0,disabled:0===H.length,icon:(0,a.jsx)(b.A,{}),onClick:()=>K("selected"),children:["删除已选 ",H.length||""]}),(0,a.jsx)(h.Ay,{danger:!0,disabled:0===Z.length||!E&&!R,onClick:()=>K("filtered"),children:"删除筛选结果"}),(0,a.jsx)(h.Ay,{danger:!0,disabled:0===C.length,onClick:()=>K("all"),children:"删除全部"}),(0,a.jsx)("input",{id:"kb-file-upload-input",type:"file",multiple:!0,hidden:!0,onChange:e=>{var t;let n=Array.from(null!=(t=e.target.files)?t:[]);e.target.value="",Q(n)}}),(0,a.jsx)("input",{id:"kb-folder-upload-input",type:"file",multiple:!0,hidden:!0,webkitdirectory:"",onChange:e=>{var t;let n=Array.from(null!=(t=e.target.files)?t:[]);e.target.value="",Q(n)}})]}),(0,a.jsxs)("div",{className:N().statusPanel,children:[(0,a.jsxs)("div",{className:N().statusPanelHeader,children:[(0,a.jsxs)(u.A,{children:[(0,a.jsx)(w.A,{}),"文件任务状态"]}),(0,a.jsx)(h.Ay,{size:"small",type:"text",disabled:0===D.length,onClick:()=>void q(),children:"清空"})]}),0===D.length?(0,a.jsx)("div",{className:N().statusEmpty,children:"暂无文件任务。"}):(0,a.jsx)("div",{className:N().statusList,children:D.map((e,n)=>(0,a.jsxs)("div",{className:N().statusItem,children:[(0,a.jsxs)("div",{className:N().statusHeader,children:[(0,a.jsxs)(u.A,{size:8,wrap:!0,children:[(0,a.jsx)(p.A,{color:"success"===e.status?"green":"error"===e.status?"red":"warning"===e.status?"orange":"blue",children:"upload"===e.type?"上传":"delete"===e.type?"删除":"reindex"===e.type?"重建":"失败"}),(0,a.jsx)(g.A,{title:e.title,children:(0,a.jsx)("strong",{children:e.title})})]}),(0,a.jsx)(p.A,{color:"success"===e.status?"success":"processing"===e.status?"processing":"warning"===e.status?"warning":"error",children:"success"===e.status?"完成":"processing"===e.status?"处理中":"warning"===e.status?"需关注":"失败"})]}),(0,a.jsx)(g.A,{title:e.description,children:(0,a.jsx)("div",{className:N().statusDesc,children:e.description})}),e.filePath&&(0,a.jsx)(g.A,{title:e.filePath,children:(0,a.jsx)("div",{className:N().statusPath,children:e.filePath})}),(0,a.jsxs)("div",{className:N().statusMeta,children:["number"==typeof e.chunkCount&&(0,a.jsxs)("span",{children:["切片 ",(0,a.jsx)("b",{children:e.chunkCount})]}),"number"==typeof e.textLength&&(0,a.jsxs)("span",{children:["正文 ",(0,a.jsx)("b",{children:e.textLength.toLocaleString(t)})," 字符"]}),e.extractionMode&&(0,a.jsxs)("span",{children:["解析 ",(0,a.jsx)("b",{children:e.extractionMode})]})]}),"number"==typeof e.percent&&"processing"===e.status&&(0,a.jsx)(m.A,{percent:e.percent,size:"small"})]},"".concat(e.title,"-").concat(n)))})]}),(0,a.jsx)(x.A,{children:(0,a.jsx)(v.A,{rowKey:"relativePath",columns:G,dataSource:Z,loading:P,size:"middle",locale:{emptyText:E?e("emptySearch"):e("noFiles")},pagination:{current:B,pageSize:50,showSizeChanger:!1,onChange:V},rowSelection:{selectedRowKeys:H,onChange:z}})})]})}},6578:(e,t,n)=>{"use strict";async function a(e,t){let n=await fetch(e,t);if(!n.ok){let e=await n.text(),t=e||"HTTP ".concat(n.status);try{let n=JSON.parse(e);t=n.error||n.message||t}catch(e){}throw Error(t)}return n.json()}async function r(e){let t=e?"?projectRoot=".concat(encodeURIComponent(e)):"";return a("/api/kb/stats".concat(t))}async function i(e){var t,n;let r=new URLSearchParams;return(null==e?void 0:e.projectRoot)&&r.set("projectRoot",e.projectRoot),(null==e?void 0:e.category)&&r.set("category",e.category),(null==e?void 0:e.page)&&r.set("page",String(null!=(t=e.page)?t:1)),(null==e?void 0:e.limit)&&r.set("limit",String(null!=(n=e.limit)?n:50)),a("/api/kb/files?".concat(r))}async function s(e,t){let n=new URLSearchParams({relativePath:e});return t&&n.set("projectRoot",t),a("/api/kb/files/detail?".concat(n))}async function o(e,t){return a("/api/kb/files/reindex",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({relativePath:e,projectRoot:t})})}async function c(e,t,n){return a("/api/kb/files/open",{method:"POST",body:JSON.stringify({relativePath:e,target:t,projectRoot:n})})}async function l(e){return new Promise((t,n)=>{let a=new FileReader;a.onload=()=>{let e=a.result,n=e.indexOf(",");t(n>=0?e.slice(n+1):e)},a.onerror=n,a.readAsDataURL(e)})}async function d(e,t,n){return a("/api/kb/upload",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({files:await Promise.all(e.map(async e=>({fileName:e.name,fileData:await l(e),relativePath:e.webkitRelativePath||void 0}))),projectRoot:t,uploadId:n})})}async function u(e){return a("/api/kb/upload/progress?id=".concat(encodeURIComponent(e)))}async function p(e){let t=new URLSearchParams({limit:"50"});return e&&t.set("projectRoot",e),a("/api/kb/operations?".concat(t))}async function h(e){let t=new URLSearchParams;return e&&t.set("projectRoot",e),a("/api/kb/operations?".concat(t),{method:"DELETE"})}async function y(e,t){return a("/api/kb/files",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({relativePath:e,projectRoot:t})})}async function f(e,t){return a("/api/kb/files",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({relativePaths:e,projectRoot:t})})}async function g(e){return a("/api/kb/files",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({all:!0,projectRoot:e})})}async function m(e){return a("/api/kb/reindex",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectRoot:e})})}async function x(){return a("/api/kb/features")}async function v(e,t){var n,r,i,s,o;let c=new URLSearchParams({q:e});return(null==t?void 0:t.projectRoot)&&c.set("projectRoot",t.projectRoot),(null==t?void 0:t.category)&&c.set("category",t.category),(null==t?void 0:t.limit)&&c.set("limit",String(null!=(o=t.limit)?o:20)),(null==t||null==(n=t.weights)?void 0:n.keyword)!=null&&c.set("keywordWeight",String(t.weights.keyword)),(null==t||null==(r=t.weights)?void 0:r.vector)!=null&&c.set("vectorWeight",String(t.weights.vector)),(null==t||null==(i=t.weights)?void 0:i.rewrite)!=null&&c.set("rewriteWeight",String(t.weights.rewrite)),(null==t||null==(s=t.weights)?void 0:s.hybridBonus)!=null&&c.set("hybridBonus",String(t.weights.hybridBonus)),a("/api/kb/search?".concat(c))}async function w(){return a("/api/prompt")}async function b(e){return a("/api/documents/roles".concat(e?"?type=".concat(e):""))}async function j(e){return a("/api/documents/roles",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}async function C(e,t){return a("/api/documents/roles?type=".concat(e,"&id=").concat(encodeURIComponent(t)),{method:"DELETE"})}async function S(e){return a("/api/documents/roles?mode=config",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}async function P(e){return a("/api/documents/roles?mode=config&id=".concat(encodeURIComponent(e)),{method:"DELETE"})}async function _(){return a("/api/documents/templates")}async function k(e){return a("/api/documents/templates",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}async function T(e){return a("/api/documents/templates?templateId=".concat(encodeURIComponent(e)),{method:"DELETE"})}async function A(e){return a("/api/documents/templates",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({templateId:e})})}async function N(e){return a("/api/documents/generate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}async function O(e){return a("/api/documents/chapter/regenerate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}async function E(){return a("/api/documents/drafts")}async function L(e,t){return a("/api/documents/drafts",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({draft:e,id:t})})}async function R(e){let t=await fetch("/api/documents/export",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw Error(await t.text());return t.blob()}async function I(){return a("/api/config/providers")}async function J(e,t){return a("/api/config/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e,...t})})}async function U(e){return a("/api/config/providers/".concat(encodeURIComponent(e)),{method:"DELETE"})}async function D(){return a("/api/config/models")}async function M(e){return a("/api/config/models",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}async function H(){return a("/api/config/embedding")}async function z(e){return a("/api/config/embedding",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}async function B(){return a("/api/config/embedding/healthCheck",{method:"POST"})}async function V(e){return a("/api/config/healthCheck",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:e})})}async function F(){return a("/api/system/stats")}async function X(e,t){let n=t?"?type=".concat(e,"&search=").concat(encodeURIComponent(t)):"?type=".concat(e);return a("/api/context".concat(n))}async function W(e){return a("/api/context?type=".concat(e,"&stats=1"))}async function $(e){return a("/api/context",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"compress",type:e})})}async function q(e){return a("/api/context",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"clear",type:e})})}async function Q(e){return a("/api/context?id=".concat(encodeURIComponent(e)),{method:"DELETE"})}async function K(e,t){return a("/api/context",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e,...t})})}async function Z(e){return a("/api/config/providers/".concat(encodeURIComponent(e)))}n.d(t,{Af:()=>L,Bh:()=>Z,Dl:()=>_,E:()=>q,FC:()=>F,FV:()=>C,H1:()=>m,H7:()=>h,HC:()=>o,HT:()=>i,II:()=>H,NR:()=>S,OX:()=>N,PH:()=>$,QT:()=>u,Qx:()=>p,R1:()=>O,SJ:()=>f,UE:()=>R,VW:()=>x,W2:()=>v,X8:()=>g,Z3:()=>I,_m:()=>J,aP:()=>M,bV:()=>A,bZ:()=>V,c1:()=>d,dd:()=>z,dg:()=>j,dw:()=>P,dx:()=>w,h0:()=>T,h1:()=>U,hc:()=>r,hn:()=>X,l2:()=>k,lv:()=>b,p:()=>W,q7:()=>E,tn:()=>c,u6:()=>B,xC:()=>s,xq:()=>y,xw:()=>Q,zo:()=>K,zr:()=>D})},8209:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var a=n(7109),r=n(3793),i=n(8483);function s(){return(s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}let o=a.forwardRef((e,t)=>a.createElement(i.A,s({},e,{ref:t,icon:r.A})))}},e=>{e.O(0,[260,167,382,201,668,227,740,174,446,400,15,636,593,792],()=>e(e.s=426)),_N_E=e.O()}]);
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[28],{426:(e,t,n)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/knowledge/files",function(){return n(6451)}])},2803:(e,t)=>{"use strict";t.A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M400 317.7h73.9V656c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V317.7H624c6.7 0 10.4-7.7 6.3-12.9L518.3 163a8 8 0 00-12.6 0l-112 141.7c-4.1 5.3-.4 13 6.3 13zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"}}]},name:"upload",theme:"outlined"}},3793:(e,t)=>{"use strict";t.A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"}}]},name:"delete",theme:"outlined"}},4569:e=>{e.exports={featureLabel:"style_featureLabel__XFSTX",featureValue:"style_featureValue__I_wMP",filterInput:"style_filterInput__4_Elu",filterSelect:"style_filterSelect__vUBJ9",statusPanel:"style_statusPanel__9arTu",statusPanelHeader:"style_statusPanelHeader__nKv1I",statusEmpty:"style_statusEmpty__8LWzH",statusList:"style_statusList__FpNgC",statusItem:"style_statusItem__uzO80",statusHeader:"style_statusHeader__o9q_b",statusDesc:"style_statusDesc__XiWFa",statusPath:"style_statusPath__Udxvv",statusMeta:"style_statusMeta__XukHt",searchResultList:"style_searchResultList__cVKZg",searchResultItem:"style_searchResultItem__boj6D",searchResultHeader:"style_searchResultHeader__meVdJ",searchContent:"style_searchContent__XbUVk",pdfPreviewStrip:"style_pdfPreviewStrip__94_eG",drawingPreview:"style_drawingPreview__lkk_L"}},5258:(e,t,n)=>{"use strict";n.d(t,{A:()=>w});var a=n(1541),r=n(1848),s=n(1249),i=n(7109),o=n(2658),c=n(3638),l=n(2162),d=n(2725),u=n(4567),p=n(632),h=n(9517),y=n(9412),f=n(9527);let m=(0,d.U)(e=>{let{prefixCls:t,className:n,closeIcon:a,closable:r,type:s,title:d,children:m,footer:g,classNames:x,styles:v,...w}=e,{getPrefixCls:b}=i.useContext(u.QO),{className:j,style:C,classNames:S,styles:P}=(0,u.TP)("modal"),_=b(),k=t||b("modal"),T=(0,p.A)(_),[A,N]=(0,f.Ay)(k,T),[O,E]=(0,l.AV)([S,x],[P,v],{props:e}),L=`${k}-confirm`,R={};return R=s?{closable:r??!1,title:"",footer:"",children:i.createElement(h.k,{...e,prefixCls:k,confirmPrefixCls:L,rootPrefixCls:_,content:m})}:{closable:r??!0,title:d,footer:null!==g&&i.createElement(y.w,{...e}),children:m},i.createElement(o.Z,{prefixCls:k,className:(0,c.$)(A,`${k}-pure-panel`,s&&L,s&&`${L}-${s}`,n,j,N,T,O.root),style:{...C,...E.root},...w,closeIcon:(0,y.O)(k,a),closable:r,classNames:O,styles:E,...R})});var g=n(9739);function x(e){return(0,a.Ay)((0,a.fp)(e))}let v=s.A;v.useModal=g.A,v.info=function(e){return(0,a.Ay)((0,a.$D)(e))},v.success=function(e){return(0,a.Ay)((0,a.Ej)(e))},v.error=function(e){return(0,a.Ay)((0,a.jT)(e))},v.warning=x,v.warn=x,v.confirm=function(e){return(0,a.Ay)((0,a.lr)(e))},v.destroyAll=function(){for(;r.A.length;){let e=r.A.pop();e&&e()}},v.config=a.FB,v._InternalPanelDoNotUseOrYouWillBeFired=m;let w=v},5551:(e,t,n)=>{"use strict";function a(e){if(0===e)return"0 B";let t=Math.floor(Math.log(e)/Math.log(1024)),n=e/Math.pow(1024,t);return"".concat(n.toFixed(+(0!==t))," ").concat(["B","KB","MB","GB","TB"][t])}function r(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"zh-CN";if(!e||e<=0)return"en-US"===t?"Never":"从未";let n=Math.floor(Math.floor((Date.now()-e)/1e3)/60),a=Math.floor(n/60),r=Math.floor(a/24);return r>30?new Date(e).toLocaleDateString(t):"en-US"===t?r>0?"".concat(r,"d ago"):a>0?"".concat(a,"h ago"):n>0?"".concat(n,"m ago"):"Just now":r>0?"".concat(r," 天前"):a>0?"".concat(a," 小时前"):n>0?"".concat(n," 分钟前"):"刚刚"}n.d(t,{Jm:()=>o,fw:()=>r,z3:()=>a});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 n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"zh-CN";return null!=(t=("en-US"===n?i:s)[e])?t:e}},6451:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>E});var a=n(5321),r=n(7109),s=n(3014),i=n(3220),o=n.n(i),c=n(4986),l=n(7807),d=n(5258),u=n(3442),p=n(1702),h=n(5114),y=n(4668),f=n(7271),m=n(2551),g=n(9605),x=n(8787),v=n(9400),w=n(6631),b=n(8209),j=n(486),C=n(2803),S=n(8483);function P(){return(P=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}let _=r.forwardRef((e,t)=>r.createElement(S.A,P({},e,{ref:t,icon:C.A})));var k=n(6578),T=n(5551),A=n(4569),N=n.n(A);let O=["document","spreadsheet","image","cad","code","data","web","diagram","archive","other"];function E(){let e=(0,s.Vr)("knowledge"),{locale:t}=(0,s.x_)(),{message:n}=l.A.useApp(),i=(0,c.useSearchParams)().get("category")||"",[C,S]=(0,r.useState)([]),[P,A]=(0,r.useState)(!0),[E,L]=(0,r.useState)(""),[R,I]=(0,r.useState)(i),[J,U]=(0,r.useState)(!1),[D,M]=(0,r.useState)([]),[H,z]=(0,r.useState)([]),[B,V]=(0,r.useState)(1),F=(0,r.useRef)(R);(0,r.useEffect)(()=>{F.current=R},[R]);let X=(0,r.useCallback)(async e=>{let t=null!=e?e:F.current;A(!0);try{let e=await (0,k.HT)({category:t||void 0,limit:200});S(e.files||[])}catch(e){S([])}finally{A(!1)}},[]);(0,r.useEffect)(()=>{X(R)},[R,X]);let W=e=>({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}),$=(0,r.useCallback)(async()=>{try{let e=await (0,k.Qx)();M(e.operations.map(W))}catch(e){}},[]);(0,r.useEffect)(()=>{$()},[$]);let q=async()=>{try{await (0,k.H7)(),M([]),n.success("任务状态已清空")}catch(e){n.error("清空任务状态失败")}},K=async e=>{if(0===e.length)return;let t=1===e.length?e[0].name:"".concat(e.length," 个文件");U(!0),M(e=>[{type:"upload",title:"上传 ".concat(t),description:"等待上传、解析、切片和入库",status:"processing",percent:10},...e].slice(0,50));let a="".concat(Date.now(),"-").concat(Math.random().toString(36).slice(2)),r=setInterval(()=>{(0,k.QT)(a).then(e=>{M(n=>[{type:"upload",title:"上传 ".concat(t),description:"".concat(e.message).concat(e.chunkCount?",".concat(e.chunkCount," 个切片"):""),status:"error"===e.stage?"warning":"processing",percent:e.percent},...n.filter(e=>e.title!=="上传 ".concat(t))].slice(0,50))}).catch(()=>void 0)},500);try{var s,i;let o=await (0,k.c1)(e,void 0,a);clearInterval(r),(null==(s=o.vectorStatus)?void 0:s.status)==="error"?n.info("文件已上传,正在后台入库"):n.success("上传成功"),L(""),I(""),z([]),V(1),F.current="";let c=null==(i=o.files)?void 0:i.find(e=>e.relativePath===o.relativePath),l=(e=>{if(!e)return{};let t={};try{t=e.metadataJson?JSON.parse(e.metadataJson):{}}catch(e){}let n="object"==typeof t.extraction&&t.extraction?t.extraction:t;return{textLength:"number"==typeof n.textLength?n.textLength:void 0,extractionMode:"string"==typeof n.extractionMode?n.extractionMode:void 0}})(c);await $(),M(e=>[{type:"upload",title:"上传完成 ".concat(t),description:"解析、分块和入库流程已完成",status:"success",filePath:null==c?void 0:c.relativePath,chunkCount:null==c?void 0:c.chunkCount,textLength:l.textLength,extractionMode:l.extractionMode},...e.filter(e=>e.title!=="上传 ".concat(t))].slice(0,50)),Array.isArray(o.files)?S(o.files):(await (0,k.H1)(),await X(""),await $())}catch(e){n.error("上传失败"),M(e=>[{type:"error",title:"上传失败 ".concat(t),description:"请重试或检查文件格式",status:"error"},...e].slice(0,50))}finally{clearInterval(r),U(!1)}},Q=e=>{let t="selected"===e?H.map(String):"filtered"===e?Z.map(e=>e.relativePath):[];if("all"!==e&&0===t.length)return;let a="all"===e?"删除全部文件?":"filtered"===e?"删除当前筛选结果 ".concat(t.length," 个文件?"):"删除已选 ".concat(t.length," 个文件?");d.A.confirm({title:a,content:"将同时删除文件、切片、索引和向量记录。此操作不可撤销。",okText:"确认删除",cancelText:"取消",okButtonProps:{danger:!0},onOk:async()=>{M(e=>[{type:"delete",title:a,description:"正在批量删除文件和索引",status:"processing",percent:10},...e].slice(0,50));try{var r;let a=null!=(r=("all"===e?await (0,k.X8)():await (0,k.SJ)(t)).deleted)?r:t.length;n.success("已删除 ".concat(a," 个文件")),z([]),M(e=>[{type:"delete",title:"批量删除完成",description:"已删除 ".concat(a," 个文件、切片和索引"),status:"success"},...e].slice(0,50)),await X(),await $()}catch(e){n.error("批量删除失败"),M(e=>[{type:"error",title:"批量删除失败",description:"请重试",status:"error"},...e].slice(0,50))}}})},Z=E?C.filter(e=>e.relativePath.toLowerCase().includes(E.toLowerCase())):C,G=[{title:e("fileName"),dataIndex:"relativePath",key:"name",render:e=>(0,a.jsxs)(u.A,{children:[(0,a.jsx)(w.A,{}),(0,a.jsx)(o(),{className:"truncate max-w-[400px] inline-block",href:"/knowledge/file-detail?relativePath=".concat(encodeURIComponent(e)),children:e})]})},{title:e("fileCategory"),dataIndex:"category",key:"cat",width:120,render:e=>(0,a.jsx)(p.A,{children:(0,T.Jm)(e,t)})},{title:e("fileSize"),dataIndex:"fileSize",key:"size",width:100,render:e=>(0,T.z3)(e)},{title:"切片",dataIndex:"chunkCount",key:"chunks",width:90,render:e=>(0,a.jsx)(p.A,{color:e>1?"green":"orange",children:e})},{title:"解析状态",dataIndex:"status",key:"status",width:110,render:(e,t)=>(0,a.jsx)(p.A,{color:"active"===e?"green":"red",children:t.errorMessage||e})},{title:e("fileDate"),dataIndex:"mtime",key:"date",width:140,render:e=>e?new Date(e).toLocaleDateString(t):"—"},{title:"",key:"act",width:60,render:(t,r)=>(0,a.jsx)(h.Ay,{type:"text",danger:!0,size:"small",icon:(0,a.jsx)(b.A,{}),onClick:()=>{d.A.confirm({title:e("delete"),content:e("deleteConfirm"),okText:"确认",cancelText:"取消",okButtonProps:{danger:!0},onOk:async()=>{M(e=>[{type:"delete",title:"删除 ".concat(r.relativePath),description:"正在删除文件记录",status:"processing"},...e].slice(0,50));try{await (0,k.xq)(r.relativePath),n.success("已删除"),M(e=>[{type:"delete",title:"删除完成 ".concat(r.relativePath),description:"文件和索引记录已移除",status:"success"},...e].slice(0,50)),z(e=>e.filter(e=>e!==r.relativePath)),await X(),await $()}catch(e){n.error("删除失败"),M(e=>[{type:"error",title:"删除失败 ".concat(r.relativePath),description:"请重试",status:"error"},...e].slice(0,50))}}})}})}];return(0,a.jsxs)("div",{className:"space-y-5 animateFadeIn",children:[(0,a.jsx)("h2",{className:"pageTitle",children:e("fileList")}),(0,a.jsxs)("div",{className:"flex flex-wrap items-end gap-3",children:[(0,a.jsx)(y.A,{placeholder:e("searchPlaceholder"),prefix:(0,a.jsx)(j.A,{}),value:E,onChange:e=>{L(e.target.value),V(1)},allowClear:!0,className:N().filterInput}),(0,a.jsx)(f.A,{value:R||void 0,onChange:e=>{I(e||""),V(1)},placeholder:e("filterCategory"),allowClear:!0,className:N().filterSelect,options:[{label:e("allCategories"),value:""},...O.map(e=>({label:(0,T.Jm)(e,t),value:e}))]}),(0,a.jsx)(h.Ay,{type:"primary",icon:(0,a.jsx)(_,{}),loading:J,onClick:()=>{var e;return null==(e=document.getElementById("kb-file-upload-input"))?void 0:e.click()},children:J?e("uploading"):e("upload")}),(0,a.jsx)(h.Ay,{icon:(0,a.jsx)(_,{}),loading:J,onClick:()=>{var e;return null==(e=document.getElementById("kb-folder-upload-input"))?void 0:e.click()},children:"上传文件夹"}),(0,a.jsxs)(h.Ay,{danger:!0,disabled:0===H.length,icon:(0,a.jsx)(b.A,{}),onClick:()=>Q("selected"),children:["删除已选 ",H.length||""]}),(0,a.jsx)(h.Ay,{danger:!0,disabled:0===Z.length||!E&&!R,onClick:()=>Q("filtered"),children:"删除筛选结果"}),(0,a.jsx)(h.Ay,{danger:!0,disabled:0===C.length,onClick:()=>Q("all"),children:"删除全部"}),(0,a.jsx)("input",{id:"kb-file-upload-input",type:"file",multiple:!0,hidden:!0,onChange:e=>{var t;let n=Array.from(null!=(t=e.target.files)?t:[]);e.target.value="",K(n)}}),(0,a.jsx)("input",{id:"kb-folder-upload-input",type:"file",multiple:!0,hidden:!0,webkitdirectory:"",onChange:e=>{var t;let n=Array.from(null!=(t=e.target.files)?t:[]);e.target.value="",K(n)}})]}),(0,a.jsxs)("div",{className:N().statusPanel,children:[(0,a.jsxs)("div",{className:N().statusPanelHeader,children:[(0,a.jsxs)(u.A,{children:[(0,a.jsx)(w.A,{}),"文件任务状态"]}),(0,a.jsx)(h.Ay,{size:"small",type:"text",disabled:0===D.length,onClick:()=>void q(),children:"清空"})]}),0===D.length?(0,a.jsx)("div",{className:N().statusEmpty,children:"暂无文件任务。"}):(0,a.jsx)("div",{className:N().statusList,children:D.map((e,n)=>(0,a.jsxs)("div",{className:N().statusItem,children:[(0,a.jsxs)("div",{className:N().statusHeader,children:[(0,a.jsxs)(u.A,{size:8,wrap:!0,children:[(0,a.jsx)(p.A,{color:"success"===e.status?"green":"error"===e.status?"red":"warning"===e.status?"orange":"blue",children:"upload"===e.type?"上传":"delete"===e.type?"删除":"reindex"===e.type?"重建":"失败"}),(0,a.jsx)(m.A,{title:e.title,children:(0,a.jsx)("strong",{children:e.title})})]}),(0,a.jsx)(p.A,{color:"success"===e.status?"success":"processing"===e.status?"processing":"warning"===e.status?"warning":"error",children:"success"===e.status?"完成":"processing"===e.status?"处理中":"warning"===e.status?"需关注":"失败"})]}),(0,a.jsx)(m.A,{title:e.description,children:(0,a.jsx)("div",{className:N().statusDesc,children:e.description})}),e.filePath&&(0,a.jsx)(m.A,{title:e.filePath,children:(0,a.jsx)("div",{className:N().statusPath,children:e.filePath})}),(0,a.jsxs)("div",{className:N().statusMeta,children:["number"==typeof e.chunkCount&&(0,a.jsxs)("span",{children:["切片 ",(0,a.jsx)("b",{children:e.chunkCount})]}),"number"==typeof e.textLength&&(0,a.jsxs)("span",{children:["正文 ",(0,a.jsx)("b",{children:e.textLength.toLocaleString(t)})," 字符"]}),e.extractionMode&&(0,a.jsxs)("span",{children:["解析 ",(0,a.jsx)("b",{children:e.extractionMode})]})]}),"number"==typeof e.percent&&"processing"===e.status&&(0,a.jsx)(g.A,{percent:e.percent,size:"small"})]},"".concat(e.title,"-").concat(n)))})]}),(0,a.jsx)(x.A,{children:(0,a.jsx)(v.A,{rowKey:"relativePath",columns:G,dataSource:Z,loading:P,size:"middle",locale:{emptyText:E?e("emptySearch"):e("noFiles")},pagination:{current:B,pageSize:50,showSizeChanger:!1,onChange:V},rowSelection:{selectedRowKeys:H,onChange:z}})})]})}},6578:(e,t,n)=>{"use strict";async function a(e,t){let n=await fetch(e,t);if(!n.ok){let e=await n.text(),t=e||"HTTP ".concat(n.status);try{let n=JSON.parse(e);t=n.error||n.message||t}catch(e){}throw Error(t)}return n.json()}async function r(e){let t=e?"?projectRoot=".concat(encodeURIComponent(e)):"";return a("/api/kb/stats".concat(t))}async function s(e){var t,n;let r=new URLSearchParams;return(null==e?void 0:e.projectRoot)&&r.set("projectRoot",e.projectRoot),(null==e?void 0:e.category)&&r.set("category",e.category),(null==e?void 0:e.page)&&r.set("page",String(null!=(t=e.page)?t:1)),(null==e?void 0:e.limit)&&r.set("limit",String(null!=(n=e.limit)?n:50)),a("/api/kb/files?".concat(r))}async function i(e,t){let n=new URLSearchParams({relativePath:e});return t&&n.set("projectRoot",t),a("/api/kb/files/detail?".concat(n))}async function o(e,t){return a("/api/kb/files/reindex",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({relativePath:e,projectRoot:t})})}async function c(e,t,n){return a("/api/kb/files/open",{method:"POST",body:JSON.stringify({relativePath:e,target:t,projectRoot:n})})}async function l(e){return new Promise((t,n)=>{let a=new FileReader;a.onload=()=>{let e=a.result,n=e.indexOf(",");t(n>=0?e.slice(n+1):e)},a.onerror=n,a.readAsDataURL(e)})}async function d(e,t,n){return a("/api/kb/upload",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({files:await Promise.all(e.map(async e=>({fileName:e.name,fileData:await l(e),relativePath:e.webkitRelativePath||void 0}))),projectRoot:t,uploadId:n})})}async function u(e){return a("/api/kb/upload/progress?id=".concat(encodeURIComponent(e)))}async function p(e){let t=new URLSearchParams({limit:"50"});return e&&t.set("projectRoot",e),a("/api/kb/operations?".concat(t))}async function h(e){let t=new URLSearchParams;return e&&t.set("projectRoot",e),a("/api/kb/operations?".concat(t),{method:"DELETE"})}async function y(e,t){return a("/api/kb/files",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({relativePath:e,projectRoot:t})})}async function f(e,t){return a("/api/kb/files",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({relativePaths:e,projectRoot:t})})}async function m(e){return a("/api/kb/files",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({all:!0,projectRoot:e})})}async function g(e){return a("/api/kb/reindex",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectRoot:e})})}async function x(){return a("/api/kb/features")}async function v(e,t){var n,r,s,i,o;let c=new URLSearchParams({q:e});return(null==t?void 0:t.projectRoot)&&c.set("projectRoot",t.projectRoot),(null==t?void 0:t.category)&&c.set("category",t.category),(null==t?void 0:t.limit)&&c.set("limit",String(null!=(o=t.limit)?o:20)),(null==t||null==(n=t.weights)?void 0:n.keyword)!=null&&c.set("keywordWeight",String(t.weights.keyword)),(null==t||null==(r=t.weights)?void 0:r.vector)!=null&&c.set("vectorWeight",String(t.weights.vector)),(null==t||null==(s=t.weights)?void 0:s.rewrite)!=null&&c.set("rewriteWeight",String(t.weights.rewrite)),(null==t||null==(i=t.weights)?void 0:i.hybridBonus)!=null&&c.set("hybridBonus",String(t.weights.hybridBonus)),a("/api/kb/search?".concat(c))}async function w(){return a("/api/prompt")}async function b(e){return a("/api/documents/roles".concat(e?"?type=".concat(e):""))}async function j(e){return a("/api/documents/roles",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}async function C(e,t){return a("/api/documents/roles?type=".concat(e,"&id=").concat(encodeURIComponent(t)),{method:"DELETE"})}async function S(e){return a("/api/documents/roles?mode=config",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}async function P(e){return a("/api/documents/roles?mode=config&id=".concat(encodeURIComponent(e)),{method:"DELETE"})}async function _(){return a("/api/documents/specs")}async function k(e){return a("/api/documents/specs",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}async function T(e){return a("/api/documents/specs?id=".concat(encodeURIComponent(e)),{method:"DELETE"})}async function A(){return a("/api/documents/templates")}async function N(e){return a("/api/documents/templates",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}async function O(e){return a("/api/documents/templates?templateId=".concat(encodeURIComponent(e)),{method:"DELETE"})}async function E(e){return a("/api/documents/templates",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({templateId:e})})}async function L(e){return a("/api/documents/generate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}async function R(e){return a("/api/documents/chapter/regenerate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}async function I(){return a("/api/documents/drafts")}async function J(e,t){return a("/api/documents/drafts",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({draft:e,id:t})})}async function U(e){let t=await fetch("/api/documents/export",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw Error(await t.text());return t.blob()}async function D(){return a("/api/config/providers")}async function M(e,t){return a("/api/config/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e,...t})})}async function H(e){return a("/api/config/providers/".concat(encodeURIComponent(e)),{method:"DELETE"})}async function z(){return a("/api/config/models")}async function B(e){return a("/api/config/models",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}async function V(){return a("/api/config/embedding")}async function F(e){return a("/api/config/embedding",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}async function X(){return a("/api/config/embedding/healthCheck",{method:"POST"})}async function W(e){return a("/api/config/healthCheck",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:e})})}async function $(){return a("/api/system/stats")}async function q(e,t){let n=t?"?type=".concat(e,"&search=").concat(encodeURIComponent(t)):"?type=".concat(e);return a("/api/context".concat(n))}async function K(e){return a("/api/context?type=".concat(e,"&stats=1"))}async function Q(e){return a("/api/context",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"compress",type:e})})}async function Z(e){return a("/api/context",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"clear",type:e})})}async function G(e){return a("/api/context?id=".concat(encodeURIComponent(e)),{method:"DELETE"})}async function Y(e,t){return a("/api/context",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e,...t})})}async function ee(e){return a("/api/config/providers/".concat(encodeURIComponent(e)))}n.d(t,{Af:()=>J,Bh:()=>ee,Dl:()=>A,E:()=>Z,EK:()=>k,ER:()=>T,FC:()=>$,FV:()=>C,H1:()=>g,H7:()=>h,HC:()=>o,HT:()=>s,II:()=>V,NR:()=>S,OX:()=>L,PH:()=>Q,QT:()=>u,Qx:()=>p,R1:()=>R,SJ:()=>f,UE:()=>U,VW:()=>x,W2:()=>v,X8:()=>m,Z3:()=>D,_m:()=>M,aP:()=>B,bV:()=>E,bZ:()=>W,c1:()=>d,dd:()=>F,dg:()=>j,dw:()=>P,dx:()=>w,h0:()=>O,h1:()=>H,hc:()=>r,hn:()=>q,l2:()=>N,lv:()=>b,mx:()=>_,p:()=>K,q7:()=>I,tn:()=>c,u6:()=>X,xC:()=>i,xq:()=>y,xw:()=>G,zo:()=>Y,zr:()=>z})},8209:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var a=n(7109),r=n(3793),s=n(8483);function i(){return(i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}let o=a.forwardRef((e,t)=>a.createElement(s.A,i({},e,{ref:t,icon:r.A})))}},e=>{e.O(0,[260,167,382,201,668,227,740,174,446,400,15,636,593,792],()=>e(e.s=426)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[414],{423:(e,n,t)=>{"use strict";t.r(n),t.d(n,{default:()=>E});var o=t(5321),a=t(7109),i=t(4986),c=t(3014),r=t(7807),s=t(3442),l=t(5114),d=t(2256),u=t(8770),p=t(8787),y=t(4849),f=t(6911),h=t(9400),m=t(1702),g=t(9606),w=t(486),b=t(9811),S=t(6768),k=t(6619),x=t(933),j=t(8740),T=t(6578),v=t(5551);let C=["document","spreadsheet","image","cad","code","data","web","diagram","archive","other"];function E(){var e,n,t;let E=(0,c.Vr)(),{locale:O}=(0,c.x_)(),N=(0,i.useRouter)(),{stats:A,loading:P,reload:R}=function(){let[e,n]=(0,a.useState)(null),[t,o]=(0,a.useState)(!0),i=(0,a.useCallback)(async()=>{o(!0);try{n(await (0,T.hc)())}catch(e){}finally{o(!1)}},[]);return(0,a.useEffect)(()=>{i()},[i]),{stats:e,loading:t,reload:i}}(),D=function(){let[e,n]=(0,a.useState)(null);return(0,a.useEffect)(()=>{(0,T.VW)().then(n).catch(()=>{})},[]),e}(),{reindexing:J,reindex:U}=function(){let[e,n]=(0,a.useState)(!1);return{reindexing:e,reindex:(0,a.useCallback)(async()=>{n(!0);try{return await (0,T.H1)(),!0}catch(e){return!1}finally{n(!1)}},[])}}(),[I,z]=(0,a.useState)("document"),[L,_]=(0,a.useState)({count:0,totalSize:0}),{message:B}=r.A.useApp(),H=(0,a.useCallback)(async e=>{try{let n=await (0,T.HT)({category:e,limit:1e4}),t=0;if(Array.isArray(n.files))for(let e of n.files)t+=e.fileSize||0;_({count:n.total||0,totalSize:t})}catch(e){_({count:0,totalSize:0})}},[]);(0,a.useEffect)(()=>{H(I)},[I,H]);let M=async()=>{await U()?await Promise.all([R(),H(I)]):B.error(E("common.error"))};return(0,o.jsxs)("div",{className:"space-y-6 animateFadeIn",children:[(0,o.jsxs)("div",{className:"flex items-center justify-between",children:[(0,o.jsxs)("div",{children:[(0,o.jsx)("h1",{className:"pageTitle",children:E("knowledge.manageTitle")}),(0,o.jsx)("p",{className:"pageDesc",children:E("knowledge.manageDesc")})]}),(0,o.jsxs)(s.A,{children:[(0,o.jsx)(l.Ay,{icon:(0,o.jsx)(g.A,{}),onClick:()=>N.push("/knowledge/files"),children:E("knowledge.files")}),(0,o.jsx)(l.Ay,{icon:(0,o.jsx)(w.A,{}),onClick:()=>N.push("/knowledge/search"),children:E("knowledge.search")}),(0,o.jsx)(l.Ay,{icon:(0,o.jsx)(b.A,{}),loading:J,onClick:()=>{M()},children:E("knowledge.reindex")})]})]}),(0,o.jsx)(d.A,{gutter:[16,16],children:[{icon:(0,o.jsx)(S.A,{}),label:E("knowledge.totalFiles"),value:null!=(e=null==A?void 0:A.fileCount)?e:0},{icon:(0,o.jsx)(k.A,{}),label:E("knowledge.totalChunks"),value:null!=(n=null==A?void 0:A.chunkCount)?n:0},{icon:(0,o.jsx)(x.A,{}),label:E("knowledge.totalSize"),value:(0,v.z3)(null!=(t=null==A?void 0:A.totalSizeBytes)?t:0)},{icon:(0,o.jsx)(j.A,{}),label:E("knowledge.lastIndexed"),value:(null==A?void 0:A.lastIndexedAt)?(0,v.fw)(A.lastIndexedAt,O):E("common.never")}].map((e,n)=>(0,o.jsx)(u.A,{xs:12,sm:6,children:(0,o.jsx)(p.A,{size:"small",loading:P&&!A,children:(0,o.jsx)(y.A,{title:e.label,value:e.value,prefix:e.icon})})},n))}),(0,o.jsxs)(p.A,{title:E("knowledge.categories"),size:"small",children:[(0,o.jsx)(f.A,{value:I,onChange:e=>z(String(e)),options:C.map(e=>({label:(0,v.Jm)(e,O),value:e})),className:"mb-4"}),(0,o.jsxs)(d.A,{gutter:[16,16],children:[(0,o.jsx)(u.A,{xs:12,sm:8,children:(0,o.jsx)(y.A,{title:E("knowledge.fileCount"),value:L.count,prefix:(0,o.jsx)(S.A,{})})}),(0,o.jsx)(u.A,{xs:12,sm:8,children:(0,o.jsx)(y.A,{title:E("knowledge.totalSize"),value:(0,v.z3)(L.totalSize),prefix:(0,o.jsx)(x.A,{})})})]})]}),D&&(0,o.jsx)(p.A,{title:E("knowledge.features"),size:"small",children:(0,o.jsx)(h.A,{dataSource:[{key:"vectorStore",label:"Vector Store",desc:E("knowledge.featureVectorStoreDesc"),value:D.vectorStore},{key:"embedding",label:"Embedding",desc:E("knowledge.featureEmbeddingDesc"),value:D.embeddingProvider},{key:"dedup",label:E("knowledge.featureDedup"),desc:E("knowledge.featureDedupDesc"),value:D.dedupEngine},{key:"chunker",label:E("knowledge.featureChunker"),desc:E("knowledge.featureChunkerDesc"),value:D.chunker}],columns:[{title:E("knowledge.featureName"),dataIndex:"label",key:"label",width:120},{title:E("knowledge.featureDesc"),dataIndex:"desc",key:"desc"},{title:E("knowledge.featureValue"),dataIndex:"value",key:"value",render:e=>(0,o.jsx)(m.A,{color:"blue",children:e})}],pagination:!1,size:"small"})})]})}},4178:(e,n,t)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/knowledge/manage",function(){return t(423)}])},5551:(e,n,t)=>{"use strict";function o(e){if(0===e)return"0 B";let n=Math.floor(Math.log(e)/Math.log(1024)),t=e/Math.pow(1024,n);return"".concat(t.toFixed(+(0!==n))," ").concat(["B","KB","MB","GB","TB"][n])}function a(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"zh-CN";if(!e||e<=0)return"en-US"===n?"Never":"从未";let t=Math.floor(Math.floor((Date.now()-e)/1e3)/60),o=Math.floor(t/60),a=Math.floor(o/24);return a>30?new Date(e).toLocaleDateString(n):"en-US"===n?a>0?"".concat(a,"d ago"):o>0?"".concat(o,"h ago"):t>0?"".concat(t,"m ago"):"Just now":a>0?"".concat(a," 天前"):o>0?"".concat(o," 小时前"):t>0?"".concat(t," 分钟前"):"刚刚"}t.d(n,{Jm:()=>r,fw:()=>a,z3:()=>o});let i={document:"文档",spreadsheet:"表格",image:"图片",cad:"图纸",code:"代码",data:"数据",web:"网页",diagram:"图表",archive:"压缩包",other:"其他"},c={document:"Document",spreadsheet:"Spreadsheet",image:"Image",cad:"CAD",code:"Code",data:"Data",web:"Web",diagram:"Diagram",archive:"Archive",other:"Other"};function r(e){var n;let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"zh-CN";return null!=(n=("en-US"===t?c:i)[e])?n:e}},6578:(e,n,t)=>{"use strict";async function o(e,n){let t=await fetch(e,n);if(!t.ok){let e=await t.text(),n=e||"HTTP ".concat(t.status);try{let t=JSON.parse(e);n=t.error||t.message||n}catch(e){}throw Error(n)}return t.json()}async function a(e){let n=e?"?projectRoot=".concat(encodeURIComponent(e)):"";return o("/api/kb/stats".concat(n))}async function i(e){var n,t;let a=new URLSearchParams;return(null==e?void 0:e.projectRoot)&&a.set("projectRoot",e.projectRoot),(null==e?void 0:e.category)&&a.set("category",e.category),(null==e?void 0:e.page)&&a.set("page",String(null!=(n=e.page)?n:1)),(null==e?void 0:e.limit)&&a.set("limit",String(null!=(t=e.limit)?t:50)),o("/api/kb/files?".concat(a))}async function c(e,n){let t=new URLSearchParams({relativePath:e});return n&&t.set("projectRoot",n),o("/api/kb/files/detail?".concat(t))}async function r(e,n){return o("/api/kb/files/reindex",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({relativePath:e,projectRoot:n})})}async function s(e,n,t){return o("/api/kb/files/open",{method:"POST",body:JSON.stringify({relativePath:e,target:n,projectRoot:t})})}async function l(e){return new Promise((n,t)=>{let o=new FileReader;o.onload=()=>{let e=o.result,t=e.indexOf(",");n(t>=0?e.slice(t+1):e)},o.onerror=t,o.readAsDataURL(e)})}async function d(e,n,t){return o("/api/kb/upload",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({files:await Promise.all(e.map(async e=>({fileName:e.name,fileData:await l(e),relativePath:e.webkitRelativePath||void 0}))),projectRoot:n,uploadId:t})})}async function u(e){return o("/api/kb/upload/progress?id=".concat(encodeURIComponent(e)))}async function p(e){let n=new URLSearchParams({limit:"50"});return e&&n.set("projectRoot",e),o("/api/kb/operations?".concat(n))}async function y(e){let n=new URLSearchParams;return e&&n.set("projectRoot",e),o("/api/kb/operations?".concat(n),{method:"DELETE"})}async function f(e,n){return o("/api/kb/files",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({relativePath:e,projectRoot:n})})}async function h(e,n){return o("/api/kb/files",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({relativePaths:e,projectRoot:n})})}async function m(e){return o("/api/kb/files",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({all:!0,projectRoot:e})})}async function g(e){return o("/api/kb/reindex",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectRoot:e})})}async function w(){return o("/api/kb/features")}async function b(e,n){var t,a,i,c,r;let s=new URLSearchParams({q:e});return(null==n?void 0:n.projectRoot)&&s.set("projectRoot",n.projectRoot),(null==n?void 0:n.category)&&s.set("category",n.category),(null==n?void 0:n.limit)&&s.set("limit",String(null!=(r=n.limit)?r:20)),(null==n||null==(t=n.weights)?void 0:t.keyword)!=null&&s.set("keywordWeight",String(n.weights.keyword)),(null==n||null==(a=n.weights)?void 0:a.vector)!=null&&s.set("vectorWeight",String(n.weights.vector)),(null==n||null==(i=n.weights)?void 0:i.rewrite)!=null&&s.set("rewriteWeight",String(n.weights.rewrite)),(null==n||null==(c=n.weights)?void 0:c.hybridBonus)!=null&&s.set("hybridBonus",String(n.weights.hybridBonus)),o("/api/kb/search?".concat(s))}async function S(){return o("/api/prompt")}async function k(e){return o("/api/documents/roles".concat(e?"?type=".concat(e):""))}async function x(e){return o("/api/documents/roles",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}async function j(e,n){return o("/api/documents/roles?type=".concat(e,"&id=").concat(encodeURIComponent(n)),{method:"DELETE"})}async function T(e){return o("/api/documents/roles?mode=config",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}async function v(e){return o("/api/documents/roles?mode=config&id=".concat(encodeURIComponent(e)),{method:"DELETE"})}async function C(){return o("/api/documents/specs")}async function E(e){return o("/api/documents/specs",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}async function O(e){return o("/api/documents/specs?id=".concat(encodeURIComponent(e)),{method:"DELETE"})}async function N(){return o("/api/documents/templates")}async function A(e){return o("/api/documents/templates",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}async function P(e){return o("/api/documents/templates?templateId=".concat(encodeURIComponent(e)),{method:"DELETE"})}async function R(e){return o("/api/documents/templates",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({templateId:e})})}async function D(e){return o("/api/documents/generate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}async function J(e){return o("/api/documents/chapter/regenerate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}async function U(){return o("/api/documents/drafts")}async function I(e,n){return o("/api/documents/drafts",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({draft:e,id:n})})}async function z(e){let n=await fetch("/api/documents/export",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!n.ok)throw Error(await n.text());return n.blob()}async function L(){return o("/api/config/providers")}async function _(e,n){return o("/api/config/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e,...n})})}async function B(e){return o("/api/config/providers/".concat(encodeURIComponent(e)),{method:"DELETE"})}async function H(){return o("/api/config/models")}async function M(e){return o("/api/config/models",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}async function V(){return o("/api/config/embedding")}async function W(e){return o("/api/config/embedding",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}async function F(){return o("/api/config/embedding/healthCheck",{method:"POST"})}async function X(e){return o("/api/config/healthCheck",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:e})})}async function q(){return o("/api/system/stats")}async function K(e,n){let t=n?"?type=".concat(e,"&search=").concat(encodeURIComponent(n)):"?type=".concat(e);return o("/api/context".concat(t))}async function Q(e){return o("/api/context?type=".concat(e,"&stats=1"))}async function Z(e){return o("/api/context",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"compress",type:e})})}async function G(e){return o("/api/context",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"clear",type:e})})}async function Y(e){return o("/api/context?id=".concat(encodeURIComponent(e)),{method:"DELETE"})}async function $(e,n){return o("/api/context",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e,...n})})}async function ee(e){return o("/api/config/providers/".concat(encodeURIComponent(e)))}t.d(n,{Af:()=>I,Bh:()=>ee,Dl:()=>N,E:()=>G,EK:()=>E,ER:()=>O,FC:()=>q,FV:()=>j,H1:()=>g,H7:()=>y,HC:()=>r,HT:()=>i,II:()=>V,NR:()=>T,OX:()=>D,PH:()=>Z,QT:()=>u,Qx:()=>p,R1:()=>J,SJ:()=>h,UE:()=>z,VW:()=>w,W2:()=>b,X8:()=>m,Z3:()=>L,_m:()=>_,aP:()=>M,bV:()=>R,bZ:()=>X,c1:()=>d,dd:()=>W,dg:()=>x,dw:()=>v,dx:()=>S,h0:()=>P,h1:()=>B,hc:()=>a,hn:()=>K,l2:()=>A,lv:()=>k,mx:()=>C,p:()=>Q,q7:()=>U,tn:()=>s,u6:()=>F,xC:()=>c,xq:()=>f,xw:()=>Y,zo:()=>$,zr:()=>H})}},e=>{e.O(0,[260,167,382,201,227,740,174,446,400,958,891,636,593,792],()=>e(e.s=4178)),_N_E=e.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[207],{470:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var s=n(7109),r=n(838),a=n(8483);function i(){return(i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e}).apply(this,arguments)}let o=s.forwardRef((e,t)=>s.createElement(a.A,i({},e,{ref:t,icon:r.A})))},838:(e,t)=>{"use strict";t.A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"}}]},name:"down",theme:"outlined"}},4184:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>v});var s=n(5321),r=n(3220),a=n.n(r),i=n(7109),o=n(5292),c=n(8787),l=n(3442),d=n(4668),u=n(5114),p=n(4992),h=n(6506),y=n(1702),m=n(2700),f=n(4253),g=n(486),j=n(6578),b=n(4569),x=n.n(b);let{Paragraph:w}=o.A;function _(e){return"number"==typeof e?e.toFixed(2):"-"}function v(){var e,t,n;let[r,o]=(0,i.useState)(""),[b,v]=(0,i.useState)(!1),[S,T]=(0,i.useState)([]),[C,k]=(0,i.useState)(),[P,O]=(0,i.useState)(),[N,R]=(0,i.useState)({keyword:1,vector:.9,rewrite:.72,hybridBonus:.35}),A=async()=>{let e=r.trim();if(e){v(!0);try{let t=await (0,j.W2)(e,{limit:10,weights:N});T(t.results),k(t.queryTimeMs),O(t.debug)}finally{v(!1)}}};return(0,s.jsxs)("div",{className:"space-y-6 animateFadeIn",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h1",{className:"pageTitle",children:"知识库搜索"}),(0,s.jsx)("p",{className:"pageDesc",children:"查看 hybrid 检索、parent 回填、分块来源和评分明细。"})]}),(0,s.jsx)(c.A,{size:"small",children:(0,s.jsxs)(l.A.Compact,{className:"w-full",children:[(0,s.jsx)(d.A,{value:r,onChange:e=>o(e.target.value),onPressEnter:()=>{A()},placeholder:"输入要搜索的知识库内容"}),(0,s.jsx)(u.Ay,{type:"primary",icon:(0,s.jsx)(g.A,{}),loading:b,onClick:()=>{A()},children:"搜索"})]})}),(0,s.jsx)(c.A,{size:"small",title:"召回权重调节",children:(0,s.jsxs)(l.A,{wrap:!0,children:[(0,s.jsxs)("span",{children:["Keyword ",(0,s.jsx)(p.A,{min:0,max:5,step:.1,value:N.keyword,onChange:e=>R(t=>({...t,keyword:Number(null!=e?e:1)}))})]}),(0,s.jsxs)("span",{children:["Vector ",(0,s.jsx)(p.A,{min:0,max:5,step:.1,value:N.vector,onChange:e=>R(t=>({...t,vector:Number(null!=e?e:.9)}))})]}),(0,s.jsxs)("span",{children:["Rewrite ",(0,s.jsx)(p.A,{min:0,max:5,step:.1,value:N.rewrite,onChange:e=>R(t=>({...t,rewrite:Number(null!=e?e:.72)}))})]}),(0,s.jsxs)("span",{children:["Hybrid Bonus ",(0,s.jsx)(p.A,{min:0,max:2,step:.05,value:N.hybridBonus,onChange:e=>R(t=>({...t,hybridBonus:Number(null!=e?e:.35)}))})]})]})}),P&&(0,s.jsx)(c.A,{size:"small",title:"检索调试面板",children:(0,s.jsxs)(h.A,{size:"small",column:2,bordered:!0,children:[(0,s.jsx)(h.A.Item,{label:"原始查询",children:P.originalQuery}),(0,s.jsx)(h.A.Item,{label:"Reranker",children:P.reranker}),(0,s.jsx)(h.A.Item,{label:"查询改写",span:2,children:(0,s.jsx)(l.A,{wrap:!0,children:null==(e=P.rewrittenQueries)?void 0:e.map(e=>(0,s.jsx)(y.A,{children:e},e))})}),(0,s.jsx)(h.A.Item,{label:"召回数量",span:2,children:(0,s.jsx)(l.A,{wrap:!0,children:Object.entries(null!=(t=P.recallCounts)?t:{}).map(e=>{let[t,n]=e;return(0,s.jsxs)(y.A,{children:[t,": ",n]},t)})})}),(0,s.jsx)(h.A.Item,{label:"召回权重",span:2,children:(0,s.jsx)(l.A,{wrap:!0,children:Object.entries(null!=(n=P.weights)?n:{}).map(e=>{let[t,n]=e;return(0,s.jsxs)(y.A,{children:[t,": ",n]},t)})})})]})}),(0,s.jsx)(c.A,{size:"small",title:"搜索结果",extra:"number"==typeof C?"".concat(C," ms"):void 0,children:b?(0,s.jsx)(m.A,{}):0===S.length?(0,s.jsx)(f.A,{description:"暂无结果"}):(0,s.jsx)("div",{className:x().searchResultList,children:S.map(e=>{var t,n,i,o,c,d;return(0,s.jsxs)("div",{className:x().searchResultItem,children:[(0,s.jsxs)("div",{className:x().searchResultHeader,children:[(0,s.jsxs)(l.A,{size:8,wrap:!0,children:[(0,s.jsx)(y.A,{color:"hybrid"===e.source?"purple":"vector"===e.source?"blue":"green",children:null!=(d=e.source)?d:"keyword"}),(0,s.jsx)(y.A,{children:e.scope}),e.chunkKind&&(0,s.jsx)(y.A,{color:"geekblue",children:e.chunkKind}),e.rowRange&&(0,s.jsxs)(y.A,{color:"gold",children:["行 ",e.rowRange]}),e.sectionTitle&&(0,s.jsx)(y.A,{color:"cyan",children:e.sectionTitle})]}),(0,s.jsx)("strong",{children:_(e.score)})]}),(0,s.jsxs)("div",{className:x().statusPath,children:[(0,s.jsx)(a(),{href:"/knowledge/file-detail?relativePath=".concat(encodeURIComponent(e.filePath)),children:e.filePath}),"number"==typeof e.chunkIndex?" #".concat(e.chunkIndex):""]}),(0,s.jsx)(w,{ellipsis:{rows:6,expandable:!0,symbol:"展开"},className:x().searchContent,children:function(e,t){let n=[t.trim(),...t.split(/[\s,,。;;::、]+/u)].filter(Boolean).sort((e,t)=>t.length-e.length);if(0===n.length)return e;let r=RegExp("(".concat(n.map(e=>e.replace(/[.*+?^${}()|[\]\\]/gu,"\\$&")).join("|"),")"),"giu");return e.split(r).map((e,t)=>n.some(t=>t.toLowerCase()===e.toLowerCase())?(0,s.jsx)("mark",{children:e},t):e)}(e.content,r)}),e.facets&&Object.keys(e.facets).length>0&&(0,s.jsx)("div",{className:x().statusMeta,children:Object.entries(e.facets).slice(0,8).map(e=>{let[t,n]=e;return(0,s.jsxs)("span",{children:[t," ",(0,s.jsx)("b",{children:Array.isArray(n)?n.join(", "):String(n)})]},t)})}),(0,s.jsxs)("div",{className:x().statusMeta,children:[(0,s.jsxs)("span",{children:["keyword ",(0,s.jsx)("b",{children:_(null==(t=e.scoreDetails)?void 0:t.keywordScore)})]}),(0,s.jsxs)("span",{children:["bm25 ",(0,s.jsx)("b",{children:_(null==(n=e.scoreDetails)?void 0:n.bm25Score)})]}),(0,s.jsxs)("span",{children:["vector ",(0,s.jsx)("b",{children:_(null==(i=e.scoreDetails)?void 0:i.vectorScore)})]}),(0,s.jsxs)("span",{children:["rerank ",(0,s.jsx)("b",{children:_(null==(o=e.scoreDetails)?void 0:o.rerankBoost)})]}),(0,s.jsxs)("span",{children:["hybrid ",(0,s.jsx)("b",{children:_(null==(c=e.scoreDetails)?void 0:c.hybridScore)})]})]})]},e.id)})})})]})}},4569:e=>{e.exports={featureLabel:"style_featureLabel__XFSTX",featureValue:"style_featureValue__I_wMP",filterInput:"style_filterInput__4_Elu",filterSelect:"style_filterSelect__vUBJ9",statusPanel:"style_statusPanel__9arTu",statusPanelHeader:"style_statusPanelHeader__nKv1I",statusEmpty:"style_statusEmpty__8LWzH",statusList:"style_statusList__FpNgC",statusItem:"style_statusItem__uzO80",statusHeader:"style_statusHeader__o9q_b",statusDesc:"style_statusDesc__XiWFa",statusPath:"style_statusPath__Udxvv",statusMeta:"style_statusMeta__XukHt",searchResultList:"style_searchResultList__cVKZg",searchResultItem:"style_searchResultItem__boj6D",searchResultHeader:"style_searchResultHeader__meVdJ",searchContent:"style_searchContent__XbUVk",pdfPreviewStrip:"style_pdfPreviewStrip__94_eG",drawingPreview:"style_drawingPreview__lkk_L"}},6578:(e,t,n)=>{"use strict";async function s(e,t){let n=await fetch(e,t);if(!n.ok){let e=await n.text(),t=e||"HTTP ".concat(n.status);try{let n=JSON.parse(e);t=n.error||n.message||t}catch(e){}throw Error(t)}return n.json()}async function r(e){let t=e?"?projectRoot=".concat(encodeURIComponent(e)):"";return s("/api/kb/stats".concat(t))}async function a(e){var t,n;let r=new URLSearchParams;return(null==e?void 0:e.projectRoot)&&r.set("projectRoot",e.projectRoot),(null==e?void 0:e.category)&&r.set("category",e.category),(null==e?void 0:e.page)&&r.set("page",String(null!=(t=e.page)?t:1)),(null==e?void 0:e.limit)&&r.set("limit",String(null!=(n=e.limit)?n:50)),s("/api/kb/files?".concat(r))}async function i(e,t){let n=new URLSearchParams({relativePath:e});return t&&n.set("projectRoot",t),s("/api/kb/files/detail?".concat(n))}async function o(e,t){return s("/api/kb/files/reindex",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({relativePath:e,projectRoot:t})})}async function c(e,t,n){return s("/api/kb/files/open",{method:"POST",body:JSON.stringify({relativePath:e,target:t,projectRoot:n})})}async function l(e){return new Promise((t,n)=>{let s=new FileReader;s.onload=()=>{let e=s.result,n=e.indexOf(",");t(n>=0?e.slice(n+1):e)},s.onerror=n,s.readAsDataURL(e)})}async function d(e,t,n){return s("/api/kb/upload",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({files:await Promise.all(e.map(async e=>({fileName:e.name,fileData:await l(e),relativePath:e.webkitRelativePath||void 0}))),projectRoot:t,uploadId:n})})}async function u(e){return s("/api/kb/upload/progress?id=".concat(encodeURIComponent(e)))}async function p(e){let t=new URLSearchParams({limit:"50"});return e&&t.set("projectRoot",e),s("/api/kb/operations?".concat(t))}async function h(e){let t=new URLSearchParams;return e&&t.set("projectRoot",e),s("/api/kb/operations?".concat(t),{method:"DELETE"})}async function y(e,t){return s("/api/kb/files",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({relativePath:e,projectRoot:t})})}async function m(e,t){return s("/api/kb/files",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({relativePaths:e,projectRoot:t})})}async function f(e){return s("/api/kb/files",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({all:!0,projectRoot:e})})}async function g(e){return s("/api/kb/reindex",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectRoot:e})})}async function j(){return s("/api/kb/features")}async function b(e,t){var n,r,a,i,o;let c=new URLSearchParams({q:e});return(null==t?void 0:t.projectRoot)&&c.set("projectRoot",t.projectRoot),(null==t?void 0:t.category)&&c.set("category",t.category),(null==t?void 0:t.limit)&&c.set("limit",String(null!=(o=t.limit)?o:20)),(null==t||null==(n=t.weights)?void 0:n.keyword)!=null&&c.set("keywordWeight",String(t.weights.keyword)),(null==t||null==(r=t.weights)?void 0:r.vector)!=null&&c.set("vectorWeight",String(t.weights.vector)),(null==t||null==(a=t.weights)?void 0:a.rewrite)!=null&&c.set("rewriteWeight",String(t.weights.rewrite)),(null==t||null==(i=t.weights)?void 0:i.hybridBonus)!=null&&c.set("hybridBonus",String(t.weights.hybridBonus)),s("/api/kb/search?".concat(c))}async function x(){return s("/api/prompt")}async function w(e){return s("/api/documents/roles".concat(e?"?type=".concat(e):""))}async function _(e){return s("/api/documents/roles",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}async function v(e,t){return s("/api/documents/roles?type=".concat(e,"&id=").concat(encodeURIComponent(t)),{method:"DELETE"})}async function S(e){return s("/api/documents/roles?mode=config",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}async function T(e){return s("/api/documents/roles?mode=config&id=".concat(encodeURIComponent(e)),{method:"DELETE"})}async function C(){return s("/api/documents/templates")}async function k(e){return s("/api/documents/templates",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}async function P(e){return s("/api/documents/templates?templateId=".concat(encodeURIComponent(e)),{method:"DELETE"})}async function O(e){return s("/api/documents/templates",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({templateId:e})})}async function N(e){return s("/api/documents/generate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}async function R(e){return s("/api/documents/chapter/regenerate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}async function A(){return s("/api/documents/drafts")}async function E(e,t){return s("/api/documents/drafts",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({draft:e,id:t})})}async function I(e){let t=await fetch("/api/documents/export",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw Error(await t.text());return t.blob()}async function L(){return s("/api/config/providers")}async function J(e,t){return s("/api/config/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e,...t})})}async function U(e){return s("/api/config/providers/".concat(encodeURIComponent(e)),{method:"DELETE"})}async function D(){return s("/api/config/models")}async function H(e){return s("/api/config/models",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}async function B(){return s("/api/config/embedding")}async function z(e){return s("/api/config/embedding",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}async function V(){return s("/api/config/embedding/healthCheck",{method:"POST"})}async function X(e){return s("/api/config/healthCheck",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:e})})}async function F(){return s("/api/system/stats")}async function W(e,t){let n=t?"?type=".concat(e,"&search=").concat(encodeURIComponent(t)):"?type=".concat(e);return s("/api/context".concat(n))}async function M(e){return s("/api/context?type=".concat(e,"&stats=1"))}async function q(e){return s("/api/context",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"compress",type:e})})}async function K(e){return s("/api/context",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"clear",type:e})})}async function Q(e){return s("/api/context?id=".concat(encodeURIComponent(e)),{method:"DELETE"})}async function Z(e,t){return s("/api/context",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e,...t})})}async function $(e){return s("/api/config/providers/".concat(encodeURIComponent(e)))}n.d(t,{Af:()=>E,Bh:()=>$,Dl:()=>C,E:()=>K,FC:()=>F,FV:()=>v,H1:()=>g,H7:()=>h,HC:()=>o,HT:()=>a,II:()=>B,NR:()=>S,OX:()=>N,PH:()=>q,QT:()=>u,Qx:()=>p,R1:()=>R,SJ:()=>m,UE:()=>I,VW:()=>j,W2:()=>b,X8:()=>f,Z3:()=>L,_m:()=>J,aP:()=>H,bV:()=>O,bZ:()=>X,c1:()=>d,dd:()=>z,dg:()=>_,dw:()=>T,dx:()=>x,h0:()=>P,h1:()=>U,hc:()=>r,hn:()=>W,l2:()=>k,lv:()=>w,p:()=>M,q7:()=>A,tn:()=>c,u6:()=>V,xC:()=>i,xq:()=>y,xw:()=>Q,zo:()=>Z,zr:()=>D})},9208:(e,t,n)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/knowledge/search",function(){return n(4184)}])}},e=>{e.O(0,[260,167,382,201,668,227,292,992,969,636,593,792],()=>e(e.s=9208)),_N_E=e.O()}]);
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[207],{470:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var s=n(7109),r=n(838),a=n(8483);function i(){return(i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e}).apply(this,arguments)}let o=s.forwardRef((e,t)=>s.createElement(a.A,i({},e,{ref:t,icon:r.A})))},838:(e,t)=>{"use strict";t.A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"}}]},name:"down",theme:"outlined"}},4184:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>v});var s=n(5321),r=n(3220),a=n.n(r),i=n(7109),o=n(5292),c=n(8787),l=n(3442),d=n(4668),u=n(5114),p=n(4992),h=n(6506),y=n(1702),m=n(2700),f=n(4253),g=n(486),j=n(6578),b=n(4569),x=n.n(b);let{Paragraph:w}=o.A;function _(e){return"number"==typeof e?e.toFixed(2):"-"}function v(){var e,t,n;let[r,o]=(0,i.useState)(""),[b,v]=(0,i.useState)(!1),[S,T]=(0,i.useState)([]),[C,P]=(0,i.useState)(),[k,O]=(0,i.useState)(),[E,N]=(0,i.useState)({keyword:1,vector:.9,rewrite:.72,hybridBonus:.35}),R=async()=>{let e=r.trim();if(e){v(!0);try{let t=await (0,j.W2)(e,{limit:10,weights:E});T(t.results),P(t.queryTimeMs),O(t.debug)}finally{v(!1)}}};return(0,s.jsxs)("div",{className:"space-y-6 animateFadeIn",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h1",{className:"pageTitle",children:"知识库搜索"}),(0,s.jsx)("p",{className:"pageDesc",children:"查看 hybrid 检索、parent 回填、分块来源和评分明细。"})]}),(0,s.jsx)(c.A,{size:"small",children:(0,s.jsxs)(l.A.Compact,{className:"w-full",children:[(0,s.jsx)(d.A,{value:r,onChange:e=>o(e.target.value),onPressEnter:()=>{R()},placeholder:"输入要搜索的知识库内容"}),(0,s.jsx)(u.Ay,{type:"primary",icon:(0,s.jsx)(g.A,{}),loading:b,onClick:()=>{R()},children:"搜索"})]})}),(0,s.jsx)(c.A,{size:"small",title:"召回权重调节",children:(0,s.jsxs)(l.A,{wrap:!0,children:[(0,s.jsxs)("span",{children:["Keyword ",(0,s.jsx)(p.A,{min:0,max:5,step:.1,value:E.keyword,onChange:e=>N(t=>({...t,keyword:Number(null!=e?e:1)}))})]}),(0,s.jsxs)("span",{children:["Vector ",(0,s.jsx)(p.A,{min:0,max:5,step:.1,value:E.vector,onChange:e=>N(t=>({...t,vector:Number(null!=e?e:.9)}))})]}),(0,s.jsxs)("span",{children:["Rewrite ",(0,s.jsx)(p.A,{min:0,max:5,step:.1,value:E.rewrite,onChange:e=>N(t=>({...t,rewrite:Number(null!=e?e:.72)}))})]}),(0,s.jsxs)("span",{children:["Hybrid Bonus ",(0,s.jsx)(p.A,{min:0,max:2,step:.05,value:E.hybridBonus,onChange:e=>N(t=>({...t,hybridBonus:Number(null!=e?e:.35)}))})]})]})}),k&&(0,s.jsx)(c.A,{size:"small",title:"检索调试面板",children:(0,s.jsxs)(h.A,{size:"small",column:2,bordered:!0,children:[(0,s.jsx)(h.A.Item,{label:"原始查询",children:k.originalQuery}),(0,s.jsx)(h.A.Item,{label:"Reranker",children:k.reranker}),(0,s.jsx)(h.A.Item,{label:"查询改写",span:2,children:(0,s.jsx)(l.A,{wrap:!0,children:null==(e=k.rewrittenQueries)?void 0:e.map(e=>(0,s.jsx)(y.A,{children:e},e))})}),(0,s.jsx)(h.A.Item,{label:"召回数量",span:2,children:(0,s.jsx)(l.A,{wrap:!0,children:Object.entries(null!=(t=k.recallCounts)?t:{}).map(e=>{let[t,n]=e;return(0,s.jsxs)(y.A,{children:[t,": ",n]},t)})})}),(0,s.jsx)(h.A.Item,{label:"召回权重",span:2,children:(0,s.jsx)(l.A,{wrap:!0,children:Object.entries(null!=(n=k.weights)?n:{}).map(e=>{let[t,n]=e;return(0,s.jsxs)(y.A,{children:[t,": ",n]},t)})})})]})}),(0,s.jsx)(c.A,{size:"small",title:"搜索结果",extra:"number"==typeof C?"".concat(C," ms"):void 0,children:b?(0,s.jsx)(m.A,{}):0===S.length?(0,s.jsx)(f.A,{description:"暂无结果"}):(0,s.jsx)("div",{className:x().searchResultList,children:S.map(e=>{var t,n,i,o,c,d;return(0,s.jsxs)("div",{className:x().searchResultItem,children:[(0,s.jsxs)("div",{className:x().searchResultHeader,children:[(0,s.jsxs)(l.A,{size:8,wrap:!0,children:[(0,s.jsx)(y.A,{color:"hybrid"===e.source?"purple":"vector"===e.source?"blue":"green",children:null!=(d=e.source)?d:"keyword"}),(0,s.jsx)(y.A,{children:e.scope}),e.chunkKind&&(0,s.jsx)(y.A,{color:"geekblue",children:e.chunkKind}),e.rowRange&&(0,s.jsxs)(y.A,{color:"gold",children:["行 ",e.rowRange]}),e.sectionTitle&&(0,s.jsx)(y.A,{color:"cyan",children:e.sectionTitle})]}),(0,s.jsx)("strong",{children:_(e.score)})]}),(0,s.jsxs)("div",{className:x().statusPath,children:[(0,s.jsx)(a(),{href:"/knowledge/file-detail?relativePath=".concat(encodeURIComponent(e.filePath)),children:e.filePath}),"number"==typeof e.chunkIndex?" #".concat(e.chunkIndex):""]}),(0,s.jsx)(w,{ellipsis:{rows:6,expandable:!0,symbol:"展开"},className:x().searchContent,children:function(e,t){let n=[t.trim(),...t.split(/[\s,,。;;::、]+/u)].filter(Boolean).sort((e,t)=>t.length-e.length);if(0===n.length)return e;let r=RegExp("(".concat(n.map(e=>e.replace(/[.*+?^${}()|[\]\\]/gu,"\\$&")).join("|"),")"),"giu");return e.split(r).map((e,t)=>n.some(t=>t.toLowerCase()===e.toLowerCase())?(0,s.jsx)("mark",{children:e},t):e)}(e.content,r)}),e.facets&&Object.keys(e.facets).length>0&&(0,s.jsx)("div",{className:x().statusMeta,children:Object.entries(e.facets).slice(0,8).map(e=>{let[t,n]=e;return(0,s.jsxs)("span",{children:[t," ",(0,s.jsx)("b",{children:Array.isArray(n)?n.join(", "):String(n)})]},t)})}),(0,s.jsxs)("div",{className:x().statusMeta,children:[(0,s.jsxs)("span",{children:["keyword ",(0,s.jsx)("b",{children:_(null==(t=e.scoreDetails)?void 0:t.keywordScore)})]}),(0,s.jsxs)("span",{children:["bm25 ",(0,s.jsx)("b",{children:_(null==(n=e.scoreDetails)?void 0:n.bm25Score)})]}),(0,s.jsxs)("span",{children:["vector ",(0,s.jsx)("b",{children:_(null==(i=e.scoreDetails)?void 0:i.vectorScore)})]}),(0,s.jsxs)("span",{children:["rerank ",(0,s.jsx)("b",{children:_(null==(o=e.scoreDetails)?void 0:o.rerankBoost)})]}),(0,s.jsxs)("span",{children:["hybrid ",(0,s.jsx)("b",{children:_(null==(c=e.scoreDetails)?void 0:c.hybridScore)})]})]})]},e.id)})})})]})}},4569:e=>{e.exports={featureLabel:"style_featureLabel__XFSTX",featureValue:"style_featureValue__I_wMP",filterInput:"style_filterInput__4_Elu",filterSelect:"style_filterSelect__vUBJ9",statusPanel:"style_statusPanel__9arTu",statusPanelHeader:"style_statusPanelHeader__nKv1I",statusEmpty:"style_statusEmpty__8LWzH",statusList:"style_statusList__FpNgC",statusItem:"style_statusItem__uzO80",statusHeader:"style_statusHeader__o9q_b",statusDesc:"style_statusDesc__XiWFa",statusPath:"style_statusPath__Udxvv",statusMeta:"style_statusMeta__XukHt",searchResultList:"style_searchResultList__cVKZg",searchResultItem:"style_searchResultItem__boj6D",searchResultHeader:"style_searchResultHeader__meVdJ",searchContent:"style_searchContent__XbUVk",pdfPreviewStrip:"style_pdfPreviewStrip__94_eG",drawingPreview:"style_drawingPreview__lkk_L"}},6578:(e,t,n)=>{"use strict";async function s(e,t){let n=await fetch(e,t);if(!n.ok){let e=await n.text(),t=e||"HTTP ".concat(n.status);try{let n=JSON.parse(e);t=n.error||n.message||t}catch(e){}throw Error(t)}return n.json()}async function r(e){let t=e?"?projectRoot=".concat(encodeURIComponent(e)):"";return s("/api/kb/stats".concat(t))}async function a(e){var t,n;let r=new URLSearchParams;return(null==e?void 0:e.projectRoot)&&r.set("projectRoot",e.projectRoot),(null==e?void 0:e.category)&&r.set("category",e.category),(null==e?void 0:e.page)&&r.set("page",String(null!=(t=e.page)?t:1)),(null==e?void 0:e.limit)&&r.set("limit",String(null!=(n=e.limit)?n:50)),s("/api/kb/files?".concat(r))}async function i(e,t){let n=new URLSearchParams({relativePath:e});return t&&n.set("projectRoot",t),s("/api/kb/files/detail?".concat(n))}async function o(e,t){return s("/api/kb/files/reindex",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({relativePath:e,projectRoot:t})})}async function c(e,t,n){return s("/api/kb/files/open",{method:"POST",body:JSON.stringify({relativePath:e,target:t,projectRoot:n})})}async function l(e){return new Promise((t,n)=>{let s=new FileReader;s.onload=()=>{let e=s.result,n=e.indexOf(",");t(n>=0?e.slice(n+1):e)},s.onerror=n,s.readAsDataURL(e)})}async function d(e,t,n){return s("/api/kb/upload",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({files:await Promise.all(e.map(async e=>({fileName:e.name,fileData:await l(e),relativePath:e.webkitRelativePath||void 0}))),projectRoot:t,uploadId:n})})}async function u(e){return s("/api/kb/upload/progress?id=".concat(encodeURIComponent(e)))}async function p(e){let t=new URLSearchParams({limit:"50"});return e&&t.set("projectRoot",e),s("/api/kb/operations?".concat(t))}async function h(e){let t=new URLSearchParams;return e&&t.set("projectRoot",e),s("/api/kb/operations?".concat(t),{method:"DELETE"})}async function y(e,t){return s("/api/kb/files",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({relativePath:e,projectRoot:t})})}async function m(e,t){return s("/api/kb/files",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({relativePaths:e,projectRoot:t})})}async function f(e){return s("/api/kb/files",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({all:!0,projectRoot:e})})}async function g(e){return s("/api/kb/reindex",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectRoot:e})})}async function j(){return s("/api/kb/features")}async function b(e,t){var n,r,a,i,o;let c=new URLSearchParams({q:e});return(null==t?void 0:t.projectRoot)&&c.set("projectRoot",t.projectRoot),(null==t?void 0:t.category)&&c.set("category",t.category),(null==t?void 0:t.limit)&&c.set("limit",String(null!=(o=t.limit)?o:20)),(null==t||null==(n=t.weights)?void 0:n.keyword)!=null&&c.set("keywordWeight",String(t.weights.keyword)),(null==t||null==(r=t.weights)?void 0:r.vector)!=null&&c.set("vectorWeight",String(t.weights.vector)),(null==t||null==(a=t.weights)?void 0:a.rewrite)!=null&&c.set("rewriteWeight",String(t.weights.rewrite)),(null==t||null==(i=t.weights)?void 0:i.hybridBonus)!=null&&c.set("hybridBonus",String(t.weights.hybridBonus)),s("/api/kb/search?".concat(c))}async function x(){return s("/api/prompt")}async function w(e){return s("/api/documents/roles".concat(e?"?type=".concat(e):""))}async function _(e){return s("/api/documents/roles",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}async function v(e,t){return s("/api/documents/roles?type=".concat(e,"&id=").concat(encodeURIComponent(t)),{method:"DELETE"})}async function S(e){return s("/api/documents/roles?mode=config",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}async function T(e){return s("/api/documents/roles?mode=config&id=".concat(encodeURIComponent(e)),{method:"DELETE"})}async function C(){return s("/api/documents/specs")}async function P(e){return s("/api/documents/specs",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}async function k(e){return s("/api/documents/specs?id=".concat(encodeURIComponent(e)),{method:"DELETE"})}async function O(){return s("/api/documents/templates")}async function E(e){return s("/api/documents/templates",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}async function N(e){return s("/api/documents/templates?templateId=".concat(encodeURIComponent(e)),{method:"DELETE"})}async function R(e){return s("/api/documents/templates",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({templateId:e})})}async function A(e){return s("/api/documents/generate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}async function I(e){return s("/api/documents/chapter/regenerate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}async function L(){return s("/api/documents/drafts")}async function U(e,t){return s("/api/documents/drafts",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({draft:e,id:t})})}async function J(e){let t=await fetch("/api/documents/export",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw Error(await t.text());return t.blob()}async function D(){return s("/api/config/providers")}async function H(e,t){return s("/api/config/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e,...t})})}async function B(e){return s("/api/config/providers/".concat(encodeURIComponent(e)),{method:"DELETE"})}async function z(){return s("/api/config/models")}async function V(e){return s("/api/config/models",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}async function X(){return s("/api/config/embedding")}async function F(e){return s("/api/config/embedding",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}async function W(){return s("/api/config/embedding/healthCheck",{method:"POST"})}async function M(e){return s("/api/config/healthCheck",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:e})})}async function K(){return s("/api/system/stats")}async function q(e,t){let n=t?"?type=".concat(e,"&search=").concat(encodeURIComponent(t)):"?type=".concat(e);return s("/api/context".concat(n))}async function Q(e){return s("/api/context?type=".concat(e,"&stats=1"))}async function Z(e){return s("/api/context",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"compress",type:e})})}async function $(e){return s("/api/context",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"clear",type:e})})}async function G(e){return s("/api/context?id=".concat(encodeURIComponent(e)),{method:"DELETE"})}async function Y(e,t){return s("/api/context",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e,...t})})}async function ee(e){return s("/api/config/providers/".concat(encodeURIComponent(e)))}n.d(t,{Af:()=>U,Bh:()=>ee,Dl:()=>O,E:()=>$,EK:()=>P,ER:()=>k,FC:()=>K,FV:()=>v,H1:()=>g,H7:()=>h,HC:()=>o,HT:()=>a,II:()=>X,NR:()=>S,OX:()=>A,PH:()=>Z,QT:()=>u,Qx:()=>p,R1:()=>I,SJ:()=>m,UE:()=>J,VW:()=>j,W2:()=>b,X8:()=>f,Z3:()=>D,_m:()=>H,aP:()=>V,bV:()=>R,bZ:()=>M,c1:()=>d,dd:()=>F,dg:()=>_,dw:()=>T,dx:()=>x,h0:()=>N,h1:()=>B,hc:()=>r,hn:()=>q,l2:()=>E,lv:()=>w,mx:()=>C,p:()=>Q,q7:()=>L,tn:()=>c,u6:()=>W,xC:()=>i,xq:()=>y,xw:()=>G,zo:()=>Y,zr:()=>z})},9208:(e,t,n)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/knowledge/search",function(){return n(4184)}])}},e=>{e.O(0,[260,167,382,201,668,227,292,992,969,636,593,792],()=>e(e.s=9208)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[46],{69:(e,t)=>{"use strict";t.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"}},289:(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"}},2256:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});let o=n(5341).A},2323:e=>{e.exports={cardMeta:"style_cardMeta__6KOa3",cardName:"style_cardName__WcLAf",cardAction:"style_cardAction__XUfPD",cardMain:"style_cardMain__qI1jU",providerCard:"style_providerCard__tLKGs",providerGrid:"style_providerGrid__Gx5GR",urlLine:"style_urlLine__DuMYs",tierDesc:"style_tierDesc__wOd6p",modelTags:"style_modelTags__nmMVj"}},3114:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var o=n(7109),a=n(5450),r=n(8483);function s(){return(s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}let i=o.forwardRef((e,t)=>o.createElement(r.A,s({},e,{ref:t,icon:a.A})))},3214:(e,t)=>{"use strict";t.A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 00-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z"}}]},name:"check",theme:"outlined"}},4190:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var o=n(7109),a=n(3214),r=n(8483);function s(){return(s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}let i=o.forwardRef((e,t)=>o.createElement(r.A,s({},e,{ref:t,icon:a.A})))},5450:(e,t)=>{"use strict";t.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"}},6578:(e,t,n)=>{"use strict";async function o(e,t){let n=await fetch(e,t);if(!n.ok){let e=await n.text(),t=e||"HTTP ".concat(n.status);try{let n=JSON.parse(e);t=n.error||n.message||t}catch(e){}throw Error(t)}return n.json()}async function a(e){let t=e?"?projectRoot=".concat(encodeURIComponent(e)):"";return o("/api/kb/stats".concat(t))}async function r(e){var t,n;let a=new URLSearchParams;return(null==e?void 0:e.projectRoot)&&a.set("projectRoot",e.projectRoot),(null==e?void 0:e.category)&&a.set("category",e.category),(null==e?void 0:e.page)&&a.set("page",String(null!=(t=e.page)?t:1)),(null==e?void 0:e.limit)&&a.set("limit",String(null!=(n=e.limit)?n:50)),o("/api/kb/files?".concat(a))}async function s(e,t){let n=new URLSearchParams({relativePath:e});return t&&n.set("projectRoot",t),o("/api/kb/files/detail?".concat(n))}async function i(e,t){return o("/api/kb/files/reindex",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({relativePath:e,projectRoot:t})})}async function l(e,t,n){return o("/api/kb/files/open",{method:"POST",body:JSON.stringify({relativePath:e,target:t,projectRoot:n})})}async function c(e){return new Promise((t,n)=>{let o=new FileReader;o.onload=()=>{let e=o.result,n=e.indexOf(",");t(n>=0?e.slice(n+1):e)},o.onerror=n,o.readAsDataURL(e)})}async function d(e,t,n){return o("/api/kb/upload",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({files:await Promise.all(e.map(async e=>({fileName:e.name,fileData:await c(e),relativePath:e.webkitRelativePath||void 0}))),projectRoot:t,uploadId:n})})}async function m(e){return o("/api/kb/upload/progress?id=".concat(encodeURIComponent(e)))}async function p(e){let t=new URLSearchParams({limit:"50"});return e&&t.set("projectRoot",e),o("/api/kb/operations?".concat(t))}async function u(e){let t=new URLSearchParams;return e&&t.set("projectRoot",e),o("/api/kb/operations?".concat(t),{method:"DELETE"})}async function h(e,t){return o("/api/kb/files",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({relativePath:e,projectRoot:t})})}async function y(e,t){return o("/api/kb/files",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({relativePaths:e,projectRoot:t})})}async function f(e){return o("/api/kb/files",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({all:!0,projectRoot:e})})}async function g(e){return o("/api/kb/reindex",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectRoot:e})})}async function v(){return o("/api/kb/features")}async function b(e,t){var n,a,r,s,i;let l=new URLSearchParams({q:e});return(null==t?void 0:t.projectRoot)&&l.set("projectRoot",t.projectRoot),(null==t?void 0:t.category)&&l.set("category",t.category),(null==t?void 0:t.limit)&&l.set("limit",String(null!=(i=t.limit)?i:20)),(null==t||null==(n=t.weights)?void 0:n.keyword)!=null&&l.set("keywordWeight",String(t.weights.keyword)),(null==t||null==(a=t.weights)?void 0:a.vector)!=null&&l.set("vectorWeight",String(t.weights.vector)),(null==t||null==(r=t.weights)?void 0:r.rewrite)!=null&&l.set("rewriteWeight",String(t.weights.rewrite)),(null==t||null==(s=t.weights)?void 0:s.hybridBonus)!=null&&l.set("hybridBonus",String(t.weights.hybridBonus)),o("/api/kb/search?".concat(l))}async function x(){return o("/api/prompt")}async function j(e){return o("/api/documents/roles".concat(e?"?type=".concat(e):""))}async function A(e){return o("/api/documents/roles",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}async function C(e,t){return o("/api/documents/roles?type=".concat(e,"&id=").concat(encodeURIComponent(t)),{method:"DELETE"})}async function w(e){return o("/api/documents/roles?mode=config",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}async function S(e){return o("/api/documents/roles?mode=config&id=".concat(encodeURIComponent(e)),{method:"DELETE"})}async function E(){return o("/api/documents/specs")}async function N(e){return o("/api/documents/specs",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}async function O(e){return o("/api/documents/specs?id=".concat(encodeURIComponent(e)),{method:"DELETE"})}async function T(){return o("/api/documents/templates")}async function P(e){return o("/api/documents/templates",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}async function I(e){return o("/api/documents/templates?templateId=".concat(encodeURIComponent(e)),{method:"DELETE"})}async function k(e){return o("/api/documents/templates",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({templateId:e})})}async function R(e){return o("/api/documents/generate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}async function $(e){return o("/api/documents/chapter/regenerate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}async function z(){return o("/api/documents/drafts")}async function L(e,t){return o("/api/documents/drafts",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({draft:e,id:t})})}async function _(e){let t=await fetch("/api/documents/export",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw Error(await t.text());return t.blob()}async function M(){return o("/api/config/providers")}async function U(e,t){return o("/api/config/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e,...t})})}async function H(e){return o("/api/config/providers/".concat(encodeURIComponent(e)),{method:"DELETE"})}async function D(){return o("/api/config/models")}async function K(e){return o("/api/config/models",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}async function J(){return o("/api/config/embedding")}async function B(e){return o("/api/config/embedding",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}async function V(){return o("/api/config/embedding/healthCheck",{method:"POST"})}async function F(e){return o("/api/config/healthCheck",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:e})})}async function G(){return o("/api/system/stats")}async function W(e,t){let n=t?"?type=".concat(e,"&search=").concat(encodeURIComponent(t)):"?type=".concat(e);return o("/api/context".concat(n))}async function X(e){return o("/api/context?type=".concat(e,"&stats=1"))}async function Q(e){return o("/api/context",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"compress",type:e})})}async function q(e){return o("/api/context",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"clear",type:e})})}async function Z(e){return o("/api/context?id=".concat(encodeURIComponent(e)),{method:"DELETE"})}async function Y(e,t){return o("/api/context",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e,...t})})}async function ee(e){return o("/api/config/providers/".concat(encodeURIComponent(e)))}n.d(t,{Af:()=>L,Bh:()=>ee,Dl:()=>T,E:()=>q,EK:()=>N,ER:()=>O,FC:()=>G,FV:()=>C,H1:()=>g,H7:()=>u,HC:()=>i,HT:()=>r,II:()=>J,NR:()=>w,OX:()=>R,PH:()=>Q,QT:()=>m,Qx:()=>p,R1:()=>$,SJ:()=>y,UE:()=>_,VW:()=>v,W2:()=>b,X8:()=>f,Z3:()=>M,_m:()=>U,aP:()=>K,bV:()=>k,bZ:()=>F,c1:()=>d,dd:()=>B,dg:()=>A,dw:()=>S,dx:()=>x,h0:()=>I,h1:()=>H,hc:()=>a,hn:()=>W,l2:()=>P,lv:()=>j,mx:()=>E,p:()=>X,q7:()=>z,tn:()=>l,u6:()=>V,xC:()=>s,xq:()=>h,xw:()=>Z,zo:()=>Y,zr:()=>D})},7305:(e,t,n)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/models",function(){return n(9526)}])},8770:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});let o=n(1916).A},8847:(e,t)=>{"use strict";t.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"}},9071:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var o=n(7109),a=n(8847),r=n(8483);function s(){return(s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}let i=o.forwardRef((e,t)=>o.createElement(r.A,s({},e,{ref:t,icon:a.A})))},9526:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>el});var o=n(5321),a=n(7109),r=n(3014),s=n(7807),i=n(5114),l=n(8787),c=n(2256),d=n(8770),m=n(3442),p=n(6171),u=n(9188),h=n(4216),y=n(5042),f=n(7137),g=n(2188),v=n(7189),b=n(2644),x=n(3638),j=n(2162),A=n(6047),C=n(4567),w=n(5561),S=n(7961),E=n(540);let N=(e,t,n)=>({background:e,[`${n}-icon`]:{color:t}}),O=(0,E.OF)("Alert",e=>[(e=>{let{componentCls:t,motionDurationSlow:n,marginXS:o,marginSM:a,fontSize:r,fontSizeLG:s,lineHeight:i,borderRadiusLG:l,motionEaseInOutCirc:c,withDescriptionIconSize:d,colorText:m,colorTextHeading:p,withDescriptionPadding:u,defaultPadding:h,lineWidth:y,lineType:f,colorSuccessBorder:g,colorWarningBorder:v,colorErrorBorder:b,colorInfoBorder:x}=e;return{[t]:{...(0,S.dF)(e),position:"relative",display:"flex",alignItems:"center",padding:h,wordWrap:"break-word",borderRadius:l,borderWidth:(0,w.zA)(y),borderStyle:f,[`&${t}-success`]:{borderColor:g},[`&${t}-info`]:{borderColor:x},[`&${t}-warning`]:{borderColor:v},[`&${t}-error`]:{borderColor:b},[`&${t}-filled`]:{borderColor:"transparent"},[`&${t}-rtl`]:{direction:"rtl"},[`${t}-section`]:{flex:1,minWidth:0},[`${t}-icon`]:{marginInlineEnd:o,lineHeight:0},"&-description":{display:"none",fontSize:r,lineHeight:i},"&-title":{color:p},[`&${t}-motion-leave`]:{overflow:"hidden",opacity:1,transition:["max-height","opacity","padding-top","padding-bottom","margin-bottom"].map(e=>`${e} ${n} ${c}`).join(", ")},[`&${t}-motion-leave-active`]:{maxHeight:0,marginBottom:"0 !important",paddingTop:0,paddingBottom:0,opacity:0},[`&${t}-with-description`]:{alignItems:"flex-start",padding:u,[`${t}-icon`]:{marginInlineEnd:a,fontSize:d,lineHeight:0},[`${t}-title`]:{display:"block",marginBottom:o,color:p,fontSize:s},[`${t}-description`]:{display:"block",color:m}},[`&${t}-banner`]:{marginBottom:0,border:"0 !important",borderRadius:0}}}})(e),(e=>{let{componentCls:t,colorSuccess:n,colorSuccessBg:o,colorWarning:a,colorWarningBg:r,colorError:s,colorErrorBg:i,colorInfo:l,colorInfoBg:c}=e;return{[t]:{"&-success":N(o,n,t),"&-info":N(c,l,t),"&-warning":N(r,a,t),"&-error":{...N(i,s,t),[`${t}-description > pre`]:{margin:0,padding:0}}}}})(e),(e=>{let{componentCls:t,iconCls:n,motionDurationMid:o,marginXS:a,fontSizeIcon:r,colorIcon:s,colorIconHover:i}=e;return{[t]:{[`${t}-actions`]:{marginInlineStart:a},[`${t}-close-icon`]:{marginInlineStart:a,padding:0,overflow:"hidden",fontSize:r,lineHeight:(0,w.zA)(r),backgroundColor:"transparent",border:"none",cursor:"pointer",...(0,S.K8)(e),[`${n}-close`]:{color:s,transition:`color ${o}`,"&:hover":{color:i}}},"&-close-text":{color:s,transition:`color ${o}`,"&:hover":{color:i}}}}})(e)],e=>({withDescriptionIconSize:e.fontSizeHeading3,defaultPadding:`${e.paddingContentVerticalSM}px 12px`,withDescriptionPadding:`${e.paddingMD}px ${e.paddingContentHorizontalLG}px`})),T=e=>{let{icon:t,type:n,className:o,style:r,successIcon:s,infoIcon:i,warningIcon:l,errorIcon:c}=e,d={success:s??a.createElement(u.A,null),info:i??a.createElement(g.A,null),error:c??a.createElement(h.A,null),warning:l??a.createElement(f.A,null)};return a.createElement("span",{className:o,style:r},t??d[n])},P=e=>{let{isClosable:t,prefixCls:n,closeIcon:o,handleClose:r,ariaProps:s,className:i,style:l}=e,c=!0===o||void 0===o?a.createElement(y.A,null):o;return t?a.createElement("button",{type:"button",onClick:r,className:(0,x.$)(`${n}-close-icon`,i),tabIndex:0,style:l,...s},c):null},I=a.forwardRef((e,t)=>{let{description:n,prefixCls:o,message:r,title:s,banner:i,className:l,rootClassName:c,style:d,onMouseEnter:m,onMouseLeave:p,onClick:u,afterClose:h,showIcon:y,closable:f,closeText:g,closeIcon:w,action:S,id:E,styles:N,classNames:I,...k}=e,R=s??r,[$,z]=a.useState(!1),L=a.useRef(null);a.useImperativeHandle(t,()=>({nativeElement:L.current}));let{getPrefixCls:_,direction:M,variant:U,closable:H,closeIcon:D,className:K,style:J,classNames:B,styles:V,successIcon:F,infoIcon:G,warningIcon:W,errorIcon:X}=(0,C.TP)("alert"),Q=_("alert",o),[q,Z]=O(Q),{onClose:Y,afterClose:ee}=(0,A.Qd)(f)?f:{},et=t=>{z(!0),(Y??e.onClose)?.(t)},en=a.useMemo(()=>void 0!==e.type?e.type:i?"warning":"info",[e.type,i]),eo=e.variant??U??"outlined",ea=a.useMemo(()=>!!(0,A.Qd)(f)&&!!f.closeIcon||!!g||("boolean"==typeof f?f:!!(!1!==w&&(0,A.R)(w))||!!H),[g,w,f,H]),er=!!i&&void 0===y||y,es={...e,prefixCls:Q,variant:eo,type:en,showIcon:er,closable:ea},ei=(0,j.XT)(J),el=(0,j.XT)(d),[ec,ed]=(0,j.AV)([B,I],[V,ei,N,el],{props:es}),em=(0,x.$)(Q,`${Q}-${en}`,`${Q}-${eo}`,{[`${Q}-with-description`]:!!n,[`${Q}-no-icon`]:!er,[`${Q}-banner`]:!!i,[`${Q}-rtl`]:"rtl"===M},K,l,c,ec.root,Z,q),ep=(0,b.KE)(k,{aria:!0,data:!0}),eu=a.useMemo(()=>(0,A.Qd)(f)&&f.closeIcon?f.closeIcon:g||(void 0!==w?w:(0,A.Qd)(H)&&H.closeIcon?H.closeIcon:D),[w,f,H,g,D]),eh=a.useMemo(()=>{let e=f??H;return(0,A.Qd)(e)?(0,b.KE)(e,{data:!0,aria:!0}):{}},[f,H]);return a.createElement(v.Ay,{visible:!$,motionName:`${Q}-motion`,motionAppear:!1,motionEnter:!1,onLeaveStart:e=>({maxHeight:e.offsetHeight}),onLeaveEnd:ee??h},({className:t,style:o},r)=>a.createElement("div",{id:E,ref:(0,b.K4)(L,r),"data-show":!$,className:(0,x.$)(em,t),style:{...ed.root,...o},onMouseEnter:m,onMouseLeave:p,onClick:u,role:"alert",...ep},er?a.createElement(T,{className:(0,x.$)(`${Q}-icon`,ec.icon),style:ed.icon,description:n,icon:e.icon,prefixCls:Q,type:en,successIcon:F,infoIcon:G,warningIcon:W,errorIcon:X}):null,a.createElement("div",{className:(0,x.$)(`${Q}-section`,ec.section),style:ed.section},R?a.createElement("div",{className:(0,x.$)(`${Q}-title`,ec.title),style:ed.title},R):null,n?a.createElement("div",{className:(0,x.$)(`${Q}-description`,ec.description),style:ed.description},n):null),S?a.createElement("div",{className:(0,x.$)(`${Q}-actions`,ec.actions),style:ed.actions},S):null,a.createElement(P,{className:ec.close,style:ed.close,isClosable:ea,prefixCls:Q,closeIcon:eu,handleClose:et,ariaProps:eh})))});var k=n(1113),R=n(9939),$=n(218),z=n(3076),L=n(3784),_=n(5472);let M=function(e){function t(){var e,n,o;return(0,k.A)(this,t),n=t,o=arguments,n=(0,$.A)(n),(e=(0,L.A)(this,(0,z.A)()?Reflect.construct(n,o||[],(0,$.A)(this).constructor):n.apply(this,o))).state={error:void 0,info:{}},e}return(0,_.A)(t,e),(0,R.A)(t,[{key:"componentDidCatch",value:function(e,t){this.setState({error:e,info:t})}},{key:"render",value:function(){let{message:e,title:t,description:n,id:o,children:r}=this.props,{error:s,info:i}=this.state,l=t??e,c=i?.componentStack||null,d=(0,A.R)(l)?l:s?.toString(),m=(0,A.R)(n)?n:c;return s?a.createElement(I,{id:o,type:"error",title:d,description:a.createElement("pre",{style:{fontSize:"0.9em",overflowX:"auto"}},m)}):r}}])}(a.PureComponent);I.ErrorBoundary=M;var U=n(3455),H=n(7271),D=n(4668),K=n(4992),J=n(1702),B=n(5258),V=n(4746),F=n(9071),G=n(3114),W=n(9650),X=n(8209),Q=n(69),q=n(8483);function Z(){return(Z=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}let Y=a.forwardRef((e,t)=>a.createElement(q.A,Z({},e,{ref:t,icon:Q.A})));var ee=n(289);function et(){return(et=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}let en=a.forwardRef((e,t)=>a.createElement(q.A,et({},e,{ref:t,icon:ee.A})));var eo=n(6578),ea=n(2323),er=n.n(ea);let es=[{label:"OpenAI 兼容",value:"openai"},{label:"Anthropic",value:"anthropic"},{label:"Google",value:"google"},{label:"Ollama",value:"ollama"},{label:"OpenRouter",value:"openrouter"}],ei=[{key:"reader",labelKey:"models.tierReader",descKey:"models.tierReaderDesc"},{key:"reasoning",labelKey:"models.tierReasoning",descKey:"models.tierReasoningDesc"},{key:"action",labelKey:"models.tierAction",descKey:"models.tierActionDesc"}];function el(){let e=(0,r.Vr)(),{message:t}=s.A.useApp(),n=[{label:e("models.embeddingProviderHash"),value:"hash"},{label:e("models.embeddingProviderOpenAI"),value:"openai-compatible"}],[y,f]=(0,a.useState)(!0),[g,v]=(0,a.useState)([]),[b,x]=(0,a.useState)(null),[j,A]=(0,a.useState)({provider:"hash",dimensions:384}),[C,w]=(0,a.useState)(!1),[S,E]=(0,a.useState)(!1),[N,O]=(0,a.useState)(null),[T,P]=(0,a.useState)(!1),[k,R]=(0,a.useState)(""),[$,z]=(0,a.useState)(""),[L,_]=(0,a.useState)(""),[M,Q]=(0,a.useState)("openai"),[q,Z]=(0,a.useState)(!1),[ee,et]=(0,a.useState)(!1),[ea,el]=(0,a.useState)(""),[ec,ed]=(0,a.useState)(""),[em,ep]=(0,a.useState)(""),[eu,eh]=(0,a.useState)(""),[ey,ef]=(0,a.useState)("openai"),[eg,ev]=(0,a.useState)(!1),[eb,ex]=(0,a.useState)(null),[ej,eA]=(0,a.useState)({}),eC=async()=>{f(!0);try{let[e,t,n]=await Promise.all([(0,eo.Z3)().catch(()=>[]),(0,eo.zr)().catch(()=>null),(0,eo.II)().catch(()=>({provider:"hash",dimensions:384}))]);v(e),x(t),A(n)}catch(n){t.error(e("common.error"))}finally{f(!1)}};(0,a.useEffect)(()=>{eC()},[]);let ew=async()=>{if(k.trim()){Z(!0);try{await (0,eo._m)(k.trim(),{apiKey:$||void 0,baseUrl:L||void 0,protocol:M}),P(!1),R(""),z(""),_(""),Q("openai"),await eC(),t.success(e("common.success"))}catch(n){t.error(e("common.error"))}finally{Z(!1)}}},eS=async n=>{try{await (0,eo.h1)(n),await eC(),t.success(e("common.success"))}catch(n){t.error(e("common.error"))}},eE=async e=>{el(e.name),ed(e.name),ep("");try{let t=await (0,eo.Bh)(e.name);ep(t.apiKey?"••••••••":""),eh(t.baseUrl||""),ef(t.protocol||t.detectedProtocol||"openai")}catch(t){eh(e.baseUrl||""),ef(e.protocol||e.detectedProtocol||"openai")}et(!0)},eN=async()=>{if(ec.trim()){ev(!0);try{let n=em.includes("•")?void 0:em||void 0;await (0,eo._m)(ec.trim(),{oldName:ea,apiKey:n,baseUrl:eu||void 0,protocol:ey}),et(!1),el(""),ed(""),ep(""),eh(""),ef("openai"),await eC(),t.success(e("common.success"))}catch(n){t.error(e("common.error"))}finally{ev(!1)}}},eO=async n=>{ex(n);try{let o=await (0,eo.bZ)(n);eA(e=>({...e,[n]:o.success})),t[o.success?"success":"error"](o.success?e("models.connected"):e("models.connectionFailed"))}catch(e){eA(e=>({...e,[n]:!1}))}finally{ex(null)}},eT=async()=>{w(!0);try{let n=await (0,eo.dd)(j);A(n),O(null),t.success(e("common.success"))}catch(n){t.error(e("common.error"))}finally{w(!1)}},eP=async()=>{E(!0);try{let n=await (0,eo.u6)();O(n.success),t[n.success?"success":"error"](n.message||(n.success?e("models.connected"):e("models.connectionFailed")))}catch(n){O(!1),t.error(e("common.error"))}finally{E(!1)}},eI=async(n,o)=>{if(!b)return;let a={...b},r=a[n];if(!o){r.active="",x(a);try{await (0,eo.aP)(a)}catch(n){t.error(e("common.error"))}return}let s=o.indexOf(":"),i=s>=0?o.slice(0,s):o,l=s>=0?o.slice(s+1):o;r.active=l,r.list.some(e=>e.name===l&&e.provider===i)||r.list.push({name:l,provider:i}),x(a);try{await (0,eo.aP)(a)}catch(n){t.error(e("common.error"))}};return(0,o.jsxs)("div",{className:"space-y-6 animateFadeIn",children:[(0,o.jsxs)("div",{className:"flex items-center justify-between",children:[(0,o.jsxs)("div",{children:[(0,o.jsx)("h1",{className:"pageTitle",children:e("models.title")}),(0,o.jsx)("p",{className:"pageDesc",children:e("models.description")})]}),(0,o.jsx)(i.Ay,{type:"primary",icon:(0,o.jsx)(V.A,{}),onClick:()=>P(!0),children:e("models.addModel")})]}),(0,o.jsx)(l.A,{title:e("models.modelList"),size:"small",loading:y,children:0===g.length?(0,o.jsx)("span",{className:er().cardMeta,children:e("models.noProviders")}):(0,o.jsx)(c.A,{gutter:[12,12],align:"stretch",children:g.map(t=>(0,o.jsx)(d.A,{xs:24,sm:12,lg:8,xl:6,className:er().providerGrid,children:(0,o.jsxs)(l.A,{size:"small",className:er().providerCard,children:[(0,o.jsxs)("div",{className:er().cardAction,children:[(0,o.jsxs)("div",{className:er().cardMain,children:[(0,o.jsx)("div",{className:er().cardName,title:t.name,children:t.name}),(0,o.jsxs)("div",{className:er().cardMeta,children:[(0,o.jsx)(F.A,{})," ",t.protocol||t.detectedProtocol||"openai"]})]}),(0,o.jsxs)(m.A,{size:2,wrap:!1,children:[(0,o.jsx)(i.Ay,{size:"small",type:"text",loading:eb===t.name,onClick:()=>{eO(t.name)},icon:!0===ej[t.name]?(0,o.jsx)(u.A,{className:"text-[var(--colorOk)]"}):!1===ej[t.name]?(0,o.jsx)(h.A,{className:"text-[var(--colorDanger)]"}):(0,o.jsx)(G.A,{})}),(0,o.jsx)(i.Ay,{size:"small",type:"text",icon:(0,o.jsx)(W.A,{}),onClick:()=>{eE(t)}}),(0,o.jsx)(p.A,{title:e("models.deleteProviderConfirm"),onConfirm:()=>{eS(t.name)},children:(0,o.jsx)(i.Ay,{size:"small",type:"text",danger:!0,icon:(0,o.jsx)(X.A,{})})})]})]}),(0,o.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,o.jsxs)("span",{className:"".concat(er().cardMeta," text-xs"),children:[(0,o.jsx)(Y,{})," ",t.hasApiKey?"••••••••":"—"]}),t.baseUrl&&(0,o.jsxs)("span",{className:"".concat(er().cardMeta," ").concat(er().urlLine," text-xs"),title:t.baseUrl,children:[(0,o.jsx)(en,{})," ",t.baseUrl]})]})]})},t.name))})}),(0,o.jsxs)(l.A,{title:e("models.embeddingConfig"),size:"small",loading:y,children:[(0,o.jsx)(I,{className:"mb-4",type:"info",showIcon:!0,message:e("models.embeddingHint")}),(0,o.jsxs)(U.A,{layout:"vertical",size:"middle",children:[(0,o.jsxs)(c.A,{gutter:[12,12],children:[(0,o.jsx)(d.A,{xs:24,lg:8,children:(0,o.jsx)(U.A.Item,{label:e("models.embeddingProvider"),children:(0,o.jsx)(H.A,{value:j.provider,options:n,onChange:e=>A(t=>({...t,provider:e,dimensions:"hash"===e?384:t.dimensions||1024}))})})}),"openai-compatible"===j.provider&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(d.A,{xs:24,lg:8,children:(0,o.jsx)(U.A.Item,{label:"Base URL",children:(0,o.jsx)(D.A,{value:j.baseUrl,onChange:e=>A(t=>({...t,baseUrl:e.target.value})),placeholder:"http://localhost:11434/v1"})})}),(0,o.jsx)(d.A,{xs:24,lg:8,children:(0,o.jsx)(U.A.Item,{label:e("models.model"),children:(0,o.jsx)(D.A,{value:j.model,onChange:e=>A(t=>({...t,model:e.target.value})),placeholder:"bge-m3"})})}),(0,o.jsx)(d.A,{xs:24,lg:8,children:(0,o.jsx)(U.A.Item,{label:e("models.apiKey"),help:j.hasApiKey?e("models.embeddingApiKeyHint"):void 0,children:(0,o.jsx)(D.A.Password,{value:j.apiKey,onFocus:()=>{var e;(null==(e=j.apiKey)?void 0:e.includes("•"))&&A(e=>({...e,apiKey:""}))},onChange:e=>A(t=>({...t,apiKey:e.target.value})),placeholder:e("models.optional")})})})]}),(0,o.jsx)(d.A,{xs:24,lg:8,children:(0,o.jsx)(U.A.Item,{label:e("models.dimensions"),children:(0,o.jsx)(K.A,{className:"w-full",min:1,value:j.dimensions,onChange:e=>A(t=>({...t,dimensions:Number(e||("hash"===t.provider?384:1024))}))})})}),(0,o.jsx)(d.A,{xs:24,lg:8,children:(0,o.jsx)(U.A.Item,{label:e("models.status"),children:(0,o.jsxs)(m.A,{children:[(0,o.jsx)(J.A,{color:"hash"===j.provider?"default":"blue",children:"hash"===j.provider?e("models.localHash"):e("models.openAICompatible")}),!0===N&&(0,o.jsx)(J.A,{color:"success",children:e("models.connected")}),!1===N&&(0,o.jsx)(J.A,{color:"error",children:e("models.connectionFailed")})]})})})]}),(0,o.jsxs)(m.A,{children:[(0,o.jsx)(i.Ay,{type:"primary",loading:C,onClick:()=>{eT()},children:e("models.saveEmbedding")}),(0,o.jsx)(i.Ay,{icon:(0,o.jsx)(G.A,{}),loading:S,onClick:()=>{eP()},children:e("models.testEmbedding")})]})]})]}),b&&(0,o.jsx)(l.A,{title:e("models.modelTiers"),size:"small",children:(0,o.jsx)(c.A,{gutter:[12,12],children:ei.map(n=>{var a;let{key:r,labelKey:s,descKey:i}=n,c=b[r],m=c.list.map(e=>({label:"".concat(e.provider," / ").concat(e.name),value:"".concat(e.provider,":").concat(e.name)})),p=g.filter(e=>!c.list.some(t=>t.provider===e.name)).map(e=>({label:"".concat(e.name," / ").concat(e.name),value:"".concat(e.name,":").concat(e.name)}));return(0,o.jsx)(d.A,{xs:24,lg:8,children:(0,o.jsxs)(l.A,{size:"small",title:e(s),children:[(0,o.jsx)("span",{className:er().tierDesc,children:e(i)}),(0,o.jsx)(H.A,{value:c.active?"".concat((null==(a=c.list.find(e=>e.name===c.active))?void 0:a.provider)||"",":").concat(c.active):void 0,onChange:e=>{eI(r,e)},allowClear:!0,placeholder:e("models.selectModelPlaceholder"),className:"w-full",options:[...m,...p]}),c.list.length>0&&(0,o.jsx)("div",{className:er().modelTags,children:c.list.map(n=>(0,o.jsxs)(J.A,{color:n.name===c.active?"blue":void 0,closable:!0,onClose:()=>{var o,a;let s={...b},i=s[r];i.list=i.list.filter(e=>e.name!==n.name||e.provider!==n.provider),i.active===n.name&&(i.active=null!=(a=null==(o=i.list[0])?void 0:o.name)?a:""),x(s),(0,eo.aP)(s).catch(()=>t.error(e("common.error")))},children:[n.provider,"/",n.name]},"".concat(n.provider,":").concat(n.name)))})]})},r)})})}),(0,o.jsx)(B.A,{title:e("models.addModel"),open:T,onCancel:()=>{P(!1),R(""),z(""),_(""),Q("openai")},onOk:()=>{ew()},confirmLoading:q,children:(0,o.jsxs)(U.A,{layout:"vertical",size:"middle",children:[(0,o.jsx)(U.A.Item,{label:e("models.modelName"),children:(0,o.jsx)(D.A,{value:k,onChange:e=>R(e.target.value),placeholder:e("models.modelNamePlaceholder")})}),(0,o.jsx)(U.A.Item,{label:e("models.apiKey"),children:(0,o.jsx)(D.A.Password,{value:$,onChange:e=>z(e.target.value),placeholder:"sk-..."})}),(0,o.jsx)(U.A.Item,{label:e("models.baseUrl"),children:(0,o.jsx)(D.A,{value:L,onChange:e=>_(e.target.value),placeholder:"https://api.openai.com/v1"})}),(0,o.jsx)(U.A.Item,{label:e("models.protocol"),children:(0,o.jsx)(H.A,{value:M,onChange:Q,options:es})})]})}),(0,o.jsx)(B.A,{title:e("models.editModel"),open:ee,onCancel:()=>{et(!1),el(""),ed(""),ep(""),eh(""),ef("openai")},onOk:()=>{eN()},confirmLoading:eg,children:(0,o.jsxs)(U.A,{layout:"vertical",size:"middle",children:[(0,o.jsx)(U.A.Item,{label:e("models.modelName"),children:(0,o.jsx)(D.A,{value:ec,onChange:e=>ed(e.target.value),placeholder:e("models.modelNamePlaceholder")})}),(0,o.jsx)(U.A.Item,{label:e("models.apiKey"),help:e("models.apiKeyEditHint"),children:(0,o.jsx)(D.A.Password,{value:em,onFocus:()=>{em.includes("•")&&ep("")},onCopy:e=>e.preventDefault(),onChange:e=>ep(e.target.value),placeholder:e("models.apiKeyEditPlaceholder")})}),(0,o.jsx)(U.A.Item,{label:e("models.baseUrl"),children:(0,o.jsx)(D.A,{value:eu,onChange:e=>eh(e.target.value),placeholder:"https://api.openai.com/v1"})}),(0,o.jsx)(U.A.Item,{label:e("models.protocol"),children:(0,o.jsx)(H.A,{value:ey,onChange:ef,options:es})})]})})]})}}},e=>{e.O(0,[260,167,382,201,668,740,492,455,992,636,593,792],()=>e(e.s=7305)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[449],{3139:(e,n,t)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/overview",function(){return t(7795)}])},6578:(e,n,t)=>{"use strict";async function o(e,n){let t=await fetch(e,n);if(!t.ok){let e=await t.text(),n=e||"HTTP ".concat(t.status);try{let t=JSON.parse(e);n=t.error||t.message||n}catch(e){}throw Error(n)}return t.json()}async function i(e){let n=e?"?projectRoot=".concat(encodeURIComponent(e)):"";return o("/api/kb/stats".concat(n))}async function s(e){var n,t;let i=new URLSearchParams;return(null==e?void 0:e.projectRoot)&&i.set("projectRoot",e.projectRoot),(null==e?void 0:e.category)&&i.set("category",e.category),(null==e?void 0:e.page)&&i.set("page",String(null!=(n=e.page)?n:1)),(null==e?void 0:e.limit)&&i.set("limit",String(null!=(t=e.limit)?t:50)),o("/api/kb/files?".concat(i))}async function r(e,n){let t=new URLSearchParams({relativePath:e});return n&&t.set("projectRoot",n),o("/api/kb/files/detail?".concat(t))}async function c(e,n){return o("/api/kb/files/reindex",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({relativePath:e,projectRoot:n})})}async function a(e,n,t){return o("/api/kb/files/open",{method:"POST",body:JSON.stringify({relativePath:e,target:n,projectRoot:t})})}async function l(e){return new Promise((n,t)=>{let o=new FileReader;o.onload=()=>{let e=o.result,t=e.indexOf(",");n(t>=0?e.slice(t+1):e)},o.onerror=t,o.readAsDataURL(e)})}async function d(e,n,t){return o("/api/kb/upload",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({files:await Promise.all(e.map(async e=>({fileName:e.name,fileData:await l(e),relativePath:e.webkitRelativePath||void 0}))),projectRoot:n,uploadId:t})})}async function u(e){return o("/api/kb/upload/progress?id=".concat(encodeURIComponent(e)))}async function p(e){let n=new URLSearchParams({limit:"50"});return e&&n.set("projectRoot",e),o("/api/kb/operations?".concat(n))}async function y(e){let n=new URLSearchParams;return e&&n.set("projectRoot",e),o("/api/kb/operations?".concat(n),{method:"DELETE"})}async function m(e,n){return o("/api/kb/files",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({relativePath:e,projectRoot:n})})}async function h(e,n){return o("/api/kb/files",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({relativePaths:e,projectRoot:n})})}async function f(e){return o("/api/kb/files",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({all:!0,projectRoot:e})})}async function x(e){return o("/api/kb/reindex",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectRoot:e})})}async function v(){return o("/api/kb/features")}async function g(e,n){var t,i,s,r,c;let a=new URLSearchParams({q:e});return(null==n?void 0:n.projectRoot)&&a.set("projectRoot",n.projectRoot),(null==n?void 0:n.category)&&a.set("category",n.category),(null==n?void 0:n.limit)&&a.set("limit",String(null!=(c=n.limit)?c:20)),(null==n||null==(t=n.weights)?void 0:t.keyword)!=null&&a.set("keywordWeight",String(n.weights.keyword)),(null==n||null==(i=n.weights)?void 0:i.vector)!=null&&a.set("vectorWeight",String(n.weights.vector)),(null==n||null==(s=n.weights)?void 0:s.rewrite)!=null&&a.set("rewriteWeight",String(n.weights.rewrite)),(null==n||null==(r=n.weights)?void 0:r.hybridBonus)!=null&&a.set("hybridBonus",String(n.weights.hybridBonus)),o("/api/kb/search?".concat(a))}async function j(){return o("/api/prompt")}async function T(e){return o("/api/documents/roles".concat(e?"?type=".concat(e):""))}async function S(e){return o("/api/documents/roles",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}async function w(e,n){return o("/api/documents/roles?type=".concat(e,"&id=").concat(encodeURIComponent(n)),{method:"DELETE"})}async function b(e){return o("/api/documents/roles?mode=config",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}async function A(e){return o("/api/documents/roles?mode=config&id=".concat(encodeURIComponent(e)),{method:"DELETE"})}async function k(){return o("/api/documents/specs")}async function C(e){return o("/api/documents/specs",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}async function O(e){return o("/api/documents/specs?id=".concat(encodeURIComponent(e)),{method:"DELETE"})}async function E(){return o("/api/documents/templates")}async function P(e){return o("/api/documents/templates",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}async function N(e){return o("/api/documents/templates?templateId=".concat(encodeURIComponent(e)),{method:"DELETE"})}async function R(e){return o("/api/documents/templates",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({templateId:e})})}async function U(e){return o("/api/documents/generate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}async function J(e){return o("/api/documents/chapter/regenerate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}async function D(){return o("/api/documents/drafts")}async function z(e,n){return o("/api/documents/drafts",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({draft:e,id:n})})}async function I(e){let n=await fetch("/api/documents/export",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!n.ok)throw Error(await n.text());return n.blob()}async function L(){return o("/api/config/providers")}async function _(e,n){return o("/api/config/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e,...n})})}async function B(e){return o("/api/config/providers/".concat(encodeURIComponent(e)),{method:"DELETE"})}async function F(){return o("/api/config/models")}async function M(e){return o("/api/config/models",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}async function H(){return o("/api/config/embedding")}async function W(e){return o("/api/config/embedding",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}async function q(){return o("/api/config/embedding/healthCheck",{method:"POST"})}async function V(e){return o("/api/config/healthCheck",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:e})})}async function X(){return o("/api/system/stats")}async function Z(e,n){let t=n?"?type=".concat(e,"&search=").concat(encodeURIComponent(n)):"?type=".concat(e);return o("/api/context".concat(t))}async function K(e){return o("/api/context?type=".concat(e,"&stats=1"))}async function Q(e){return o("/api/context",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"compress",type:e})})}async function G(e){return o("/api/context",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"clear",type:e})})}async function Y(e){return o("/api/context?id=".concat(encodeURIComponent(e)),{method:"DELETE"})}async function $(e,n){return o("/api/context",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e,...n})})}async function ee(e){return o("/api/config/providers/".concat(encodeURIComponent(e)))}t.d(n,{Af:()=>z,Bh:()=>ee,Dl:()=>E,E:()=>G,EK:()=>C,ER:()=>O,FC:()=>X,FV:()=>w,H1:()=>x,H7:()=>y,HC:()=>c,HT:()=>s,II:()=>H,NR:()=>b,OX:()=>U,PH:()=>Q,QT:()=>u,Qx:()=>p,R1:()=>J,SJ:()=>h,UE:()=>I,VW:()=>v,W2:()=>g,X8:()=>f,Z3:()=>L,_m:()=>_,aP:()=>M,bV:()=>R,bZ:()=>V,c1:()=>d,dd:()=>W,dg:()=>S,dw:()=>A,dx:()=>j,h0:()=>N,h1:()=>B,hc:()=>i,hn:()=>Z,l2:()=>P,lv:()=>T,mx:()=>k,p:()=>K,q7:()=>D,tn:()=>a,u6:()=>q,xC:()=>r,xq:()=>m,xw:()=>Y,zo:()=>$,zr:()=>F})},7795:(e,n,t)=>{"use strict";t.r(n),t.d(n,{default:()=>A});var o=t(5321),i=t(7109),s=t(3014),r=t(2700),c=t(5114),a=t(2256),l=t(8770),d=t(8787),u=t(9605),p=t(4849),y=t(3442),m=t(1702),h=t(6109),f=t(9811),x=t(520),v=t(933),g=t(3114),j=t(9071),T=t(6631),S=t(4742),w=t(6381),b=t(6578);function A(){var e,n,t,A,k,C,O,E,P,N,R,U;let J=(0,s.Vr)(),D=(0,h.useRouter)(),[z,I]=(0,i.useState)(null),[L,_]=(0,i.useState)(!0),[B,F]=(0,i.useState)(0),M=(0,i.useCallback)(async()=>{_(!0);try{let[e,n]=await Promise.all([(0,b.FC)(),(0,b.Z3)().catch(()=>[])]);I(e),F(Array.isArray(n)?n.length:0)}catch(e){}finally{_(!1)}},[]);if((0,i.useEffect)(()=>{M();let e=setInterval(()=>{M()},1e4);return()=>clearInterval(e)},[M]),L&&!z)return(0,o.jsx)("div",{className:"flex justify-center py-16",children:(0,o.jsx)(r.A,{size:"large"})});let H=(null!=(n=null==z?void 0:z.cpu.usagePercent)?n:0)>80?"var(--colorDanger)":(null!=(t=null==z?void 0:z.cpu.usagePercent)?t:0)>50?"var(--colorWarning)":"var(--colorOk)",W=(null!=(A=null==z?void 0:z.memory.usagePercent)?A:0)>80?"var(--colorDanger)":(null!=(k=null==z?void 0:z.memory.usagePercent)?k:0)>50?"var(--colorWarning)":"var(--colorOk)",q=(null==z?void 0:z.tasks.total)?Math.round(z.tasks.success/z.tasks.total*100):0,V=null==z||null==(e=z.models)?void 0:e[0];return(0,o.jsxs)("div",{className:"space-y-6 animateFadeIn",children:[(0,o.jsxs)("div",{className:"flex items-center justify-between",children:[(0,o.jsxs)("div",{children:[(0,o.jsx)("h1",{className:"pageTitle",children:J("overview.title")}),(0,o.jsx)("p",{className:"pageDesc",children:J("overview.description")})]}),(0,o.jsx)(c.Ay,{icon:(0,o.jsx)(f.A,{spin:L}),loading:L,onClick:()=>{M()},children:J("common.retry")})]}),(0,o.jsxs)(a.A,{gutter:[16,16],children:[(0,o.jsx)(l.A,{xs:24,sm:12,children:(0,o.jsx)(d.A,{size:"small",title:(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(x.A,{})," CPU"]}),children:(0,o.jsxs)("div",{style:{textAlign:"center"},children:[(0,o.jsx)(u.A,{type:"circle",percent:null!=(C=null==z?void 0:z.cpu.usagePercent)?C:0,size:120,strokeColor:H,format:e=>"".concat(null==e?void 0:e.toFixed(1),"%")}),(0,o.jsxs)("div",{className:"text-xs mt-2",style:{color:"var(--colorTextSecondary)"},children:[null!=(O=null==z?void 0:z.cpu.cores)?O:0," ",J("overview.cores")]})]})})}),(0,o.jsx)(l.A,{xs:24,sm:12,children:(0,o.jsx)(d.A,{size:"small",title:(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(v.A,{})," ",J("overview.memory")]}),children:(0,o.jsxs)("div",{style:{textAlign:"center"},children:[(0,o.jsx)(u.A,{type:"circle",percent:null!=(E=null==z?void 0:z.memory.usagePercent)?E:0,size:120,strokeColor:W,format:e=>"".concat(e,"%")}),(0,o.jsxs)("div",{className:"text-xs mt-2",style:{color:"var(--colorTextSecondary)"},children:[null!=(P=null==z?void 0:z.memory.processMB)?P:0," MB / ",null!=(N=null==z?void 0:z.memory.totalMB)?N:0," MB"]})]})})})]}),(0,o.jsxs)(a.A,{gutter:[16,16],children:[(0,o.jsx)(l.A,{xs:12,sm:6,children:(0,o.jsx)(d.A,{size:"small",children:(0,o.jsx)(p.A,{title:J("overview.providersCount"),value:B,prefix:(0,o.jsx)(g.A,{})})})}),(0,o.jsx)(l.A,{xs:12,sm:6,children:(0,o.jsx)(d.A,{size:"small",children:(0,o.jsx)(p.A,{title:J("overview.tokensUsed"),value:null!=(R=null==z?void 0:z.tokens.total)?R:0,prefix:(0,o.jsx)(j.A,{})})})}),(0,o.jsx)(l.A,{xs:12,sm:6,children:(0,o.jsx)(d.A,{size:"small",children:(0,o.jsx)(p.A,{title:J("overview.tasksTotal"),value:null!=(U=null==z?void 0:z.tasks.total)?U:0,prefix:(0,o.jsx)(T.A,{})})})}),(0,o.jsx)(l.A,{xs:12,sm:6,children:(0,o.jsx)(d.A,{size:"small",children:(0,o.jsx)(p.A,{title:J("overview.successRate"),value:q,suffix:"%",prefix:q>80?(0,o.jsx)(S.A,{style:{color:"var(--colorOk)"}}):(0,o.jsx)(w.A,{style:{color:"var(--colorDanger)"}})})})})]}),(0,o.jsxs)(a.A,{gutter:[16,16],children:[(0,o.jsx)(l.A,{xs:24,sm:12,children:(0,o.jsx)(d.A,{size:"small",title:J("overview.topModel"),children:V?(0,o.jsxs)("div",{className:"flex items-center gap-4",children:[(0,o.jsx)(g.A,{style:{fontSize:24,color:"var(--colorAccent)"}}),(0,o.jsxs)("div",{children:[(0,o.jsx)("div",{className:"font-semibold",children:V.model}),(0,o.jsxs)("div",{style:{color:"var(--colorTextSecondary)",fontSize:12},children:["@",V.provider," — ",V.count," ",J("overview.calls")]})]})]}):(0,o.jsx)("span",{style:{color:"var(--colorTextSecondary)"},children:J("common.noData")})})}),(0,o.jsx)(l.A,{xs:24,sm:12,children:(0,o.jsx)(d.A,{size:"small",title:J("overview.taskTypes"),children:(null==z?void 0:z.tasks.types)&&Object.keys(z.tasks.types).length>0?(0,o.jsx)(y.A,{wrap:!0,children:Object.entries(z.tasks.types).map(e=>{let[n,t]=e;return(0,o.jsxs)(m.A,{children:[n.slice(0,30),": ",t]},n)})}):(0,o.jsx)("span",{style:{color:"var(--colorTextSecondary)"},children:J("common.noData")})})})]}),(0,o.jsx)(d.A,{title:J("overview.quickActions"),size:"small",children:(0,o.jsxs)(y.A,{wrap:!0,children:[(0,o.jsx)(c.Ay,{onClick:()=>{D.push("/knowledge/manage")},children:J("overview.goToKnowledge")}),(0,o.jsx)(c.Ay,{onClick:()=>{D.push("/models")},children:J("overview.goToModels")}),(0,o.jsx)(c.Ay,{onClick:()=>{D.push("/settings")},children:J("overview.goToSettings")}),(0,o.jsx)(c.Ay,{onClick:()=>{D.push("/prompt")},children:J("nav.promptManagement")}),(0,o.jsx)(c.Ay,{onClick:()=>{D.push("/context/long-term")},children:J("nav.contextEngineering")})]})})]})}}},e=>{e.O(0,[260,167,227,15,958,851,636,593,792],()=>e(e.s=3139)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
self.__BUILD_MANIFEST=function(s,e,c,t,a,n,d,i,u,o,k,f,r,h,b,g,l,j,m,p,_,w,I,x){return{__rewrites:{afterFiles:[],beforeFiles:[],fallback:[]},__routerFilterStatic:{numItems:0,errorRate:1e-4,numBits:0,numHashes:m,bitArray:[]},__routerFilterDynamic:{numItems:r,errorRate:1e-4,numBits:r,numHashes:m,bitArray:[]},"/":["static/chunks/pages/index-505bd438c95ec0e8.js"],"/_error":["static/chunks/pages/_error-18decb9cd478883d.js"],"/context/long-term":[s,e,c,t,a,n,d,i,u,o,k,f,p,"static/chunks/pages/context/long-term-710aaeb12e378258.js"],"/context/short-term":[s,e,c,t,a,n,d,i,u,o,k,f,p,"static/chunks/pages/context/short-term-e68f01478e7ed238.js"],"/document-roles":[s,e,c,t,a,n,d,i,u,o,b,"static/chunks/pages/document-roles-caee7af42da4f792.js"],"/document-specs":[s,e,c,t,a,n,d,i,u,o,g,b,"static/chunks/pages/document-specs-7085069b6dcdaee6.js"],"/documents":[s,e,c,t,a,n,d,i,u,o,h,b,_,"static/chunks/pages/documents-b78988e17525927f.js"],"/guide":[s,e,c,h,_,"static/chunks/804-e654a1589d9adc65.js","static/chunks/pages/guide-b495954d18d56b33.js"],"/knowledge":["static/chunks/pages/knowledge-81fd1e907a6fcb84.js"],"/knowledge/file-detail":[s,e,c,t,a,n,d,i,k,f,h,w,"static/chunks/517-f43787133528ba48.js",l,"static/chunks/pages/knowledge/file-detail-793d12234ccddac1.js"],"/knowledge/files":[s,e,c,t,a,n,d,i,k,f,I,l,"static/chunks/pages/knowledge/files-a3a4bbc49c980b46.js"],"/knowledge/manage":[s,e,c,t,n,d,i,k,f,x,"static/chunks/891-b6a172e1df7ab8c1.js","static/chunks/pages/knowledge/manage-64ad6cdce068edb1.js"],"/knowledge/search":[s,e,c,t,a,n,h,g,w,l,"static/chunks/pages/knowledge/search-fe148477dfe05966.js"],"/models":[s,e,c,t,a,d,u,o,g,"static/css/0e153583d22cc52e.css","static/chunks/pages/models-6131bc7596604158.js"],"/overview":[s,e,n,I,x,"static/chunks/851-1190cb42a0630eef.js","static/chunks/pages/overview-db5df4f0bec2a77c.js"],"/prompt":[s,e,c,t,a,u,k,"static/chunks/pages/prompt-654d82321a383233.js"],"/settings":[s,"static/css/82b6ddff0ef364fe.css","static/chunks/pages/settings-88f50b9cafc389e0.js"],sortedPages:["/","/_app","/_error","/context/long-term","/context/short-term","/document-roles","/document-specs","/documents","/guide","/knowledge","/knowledge/file-detail","/knowledge/files","/knowledge/manage","/knowledge/search","/models","/overview","/prompt","/settings"]}}("static/chunks/260-7a7a65a3ca8539ba.js","static/chunks/167-9f45623d7ea7ab43.js","static/chunks/382-dd7535429e16931b.js","static/chunks/201-b16b4788042ed1aa.js","static/chunks/668-662b7bc81e4ad48f.js","static/chunks/227-442963c7b630eade.js","static/chunks/740-2bcba39d841f2b16.js","static/chunks/174-e7df14600b457a5c.js","static/chunks/492-62671486700ed3f9.js","static/chunks/455-e31becaaf948f868.js","static/chunks/446-0591221372df7d49.js","static/chunks/400-f06f00619f22421e.js",0,"static/chunks/292-c2888a94068fae74.js","static/chunks/846-fed995f7c83fc6c3.js","static/chunks/992-ea93dfa182a02a8e.js","static/css/d284a7454d6f6b06.css",1e-4,NaN,"static/chunks/257-ba16dfe16a27f417.js","static/chunks/730-727fe4b055c78dc2.js","static/chunks/969-8843874536e7fd83.js","static/chunks/15-289cb38b53bafa4a.js","static/chunks/958-66e2dcf301fb3c3f.js"),self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@customize-agent/server",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.11",
|
|
4
4
|
"description": "Customize Agent Web 管理控制台",
|
|
5
5
|
"exports": {
|
|
6
6
|
"./package.json": "./package.json"
|
|
@@ -46,9 +46,9 @@
|
|
|
46
46
|
"react-dom": "^19.0.0",
|
|
47
47
|
"tesseract.js": "^7.0.0",
|
|
48
48
|
"xlsx": "^0.18.5",
|
|
49
|
-
"@customize-agent/
|
|
50
|
-
"@customize-agent/
|
|
51
|
-
"@customize-agent/
|
|
49
|
+
"@customize-agent/knowledge": "^3.0.7",
|
|
50
|
+
"@customize-agent/runtime": "^3.0.5",
|
|
51
|
+
"@customize-agent/llm": "^3.0.3"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@tailwindcss/postcss": "^4.3.2",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
self.__BUILD_MANIFEST=function(s,e,c,t,a,n,i,d,u,k,o,r,f,b,h,g,l,j,m,p,_,w,I,x){return{__rewrites:{afterFiles:[],beforeFiles:[],fallback:[]},__routerFilterStatic:{numItems:0,errorRate:1e-4,numBits:0,numHashes:l,bitArray:[]},__routerFilterDynamic:{numItems:f,errorRate:1e-4,numBits:f,numHashes:l,bitArray:[]},"/":["static/chunks/pages/index-505bd438c95ec0e8.js"],"/_error":["static/chunks/pages/_error-18decb9cd478883d.js"],"/context/long-term":[s,e,c,t,a,n,i,d,u,k,o,r,j,"static/chunks/pages/context/long-term-9685fc1fd8397807.js"],"/context/short-term":[s,e,c,t,a,n,i,d,u,k,o,r,j,"static/chunks/pages/context/short-term-86f5d204405bb05c.js"],"/document-roles":[s,e,c,t,a,n,i,d,u,r,m,"static/chunks/pages/document-roles-1449654aa961426e.js"],"/documents":[s,e,c,t,a,n,i,d,u,r,b,p,m,"static/chunks/pages/documents-dc6582d6886d4fb6.js"],"/guide":[s,e,c,b,p,"static/chunks/845-b394c886baabe12f.js","static/chunks/pages/guide-0aa6938c95fd8152.js"],"/knowledge":["static/chunks/pages/knowledge-81fd1e907a6fcb84.js"],"/knowledge/file-detail":[s,e,c,t,a,n,i,d,k,o,b,_,"static/chunks/517-f43787133528ba48.js",h,"static/chunks/pages/knowledge/file-detail-21dbc84d04f969ca.js"],"/knowledge/files":[s,e,c,t,a,n,i,d,k,o,w,h,"static/chunks/pages/knowledge/files-369d7ccf6a6e4e43.js"],"/knowledge/manage":[s,e,c,t,n,i,d,k,o,I,"static/chunks/891-b6a172e1df7ab8c1.js","static/chunks/pages/knowledge/manage-447ce42652c203f4.js"],"/knowledge/search":[s,e,c,t,a,n,b,x,_,h,"static/chunks/pages/knowledge/search-5a199ff773f7938b.js"],"/models":[s,e,c,t,a,i,u,r,x,"static/css/0e153583d22cc52e.css","static/chunks/pages/models-fc67c4147d2aa3cb.js"],"/overview":[s,e,n,w,I,"static/chunks/851-1190cb42a0630eef.js","static/chunks/pages/overview-558db8205a06d058.js"],"/prompt":[s,e,c,t,a,u,k,"static/chunks/pages/prompt-654d82321a383233.js"],"/settings":[s,"static/css/82b6ddff0ef364fe.css","static/chunks/pages/settings-88f50b9cafc389e0.js"],sortedPages:["/","/_app","/_error","/context/long-term","/context/short-term","/document-roles","/documents","/guide","/knowledge","/knowledge/file-detail","/knowledge/files","/knowledge/manage","/knowledge/search","/models","/overview","/prompt","/settings"]}}("static/chunks/260-7a7a65a3ca8539ba.js","static/chunks/167-9f45623d7ea7ab43.js","static/chunks/382-dd7535429e16931b.js","static/chunks/201-b16b4788042ed1aa.js","static/chunks/668-662b7bc81e4ad48f.js","static/chunks/227-442963c7b630eade.js","static/chunks/740-cd38299e151d3ffc.js","static/chunks/174-e7df14600b457a5c.js","static/chunks/492-62671486700ed3f9.js","static/chunks/446-0591221372df7d49.js","static/chunks/400-ba996d76e74a7368.js","static/chunks/455-e31becaaf948f868.js",0,"static/chunks/292-c2888a94068fae74.js","static/css/d284a7454d6f6b06.css",1e-4,NaN,"static/chunks/257-ba16dfe16a27f417.js","static/chunks/951-320008e618be7e4f.js","static/chunks/228-7112f995b33b1fd3.js","static/chunks/969-8843874536e7fd83.js","static/chunks/15-289cb38b53bafa4a.js","static/chunks/958-0793922b6b146891.js","static/chunks/992-ea93dfa182a02a8e.js"),self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB();
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[228],{2256:(e,t,i)=>{i.d(t,{A:()=>o});let o=i(5341).A},7564:(e,t,i)=>{i.d(t,{j:()=>o});let o=i(7109).createContext(null)},8770:(e,t,i)=>{i.d(t,{A:()=>o});let o=i(1916).A},9730:(e,t,i)=>{i.d(t,{A:()=>P});var o=i(7109),r=i(4190),n=i(5042),l=i(9981),a=i(3638),c=i(2162),s=i(6047),m=i(8862),d=i(5622),p=i(4567),$=i(7273),h=i(9609),u=i(540),g=i(2551),b=i(7564);let v=e=>{let{prefixCls:t}=e;return o.createElement("svg",{className:`${t}-panel-arrow`,viewBox:"0 0 100 100",xmlns:"http://www.w3.org/2000/svg",preserveAspectRatio:"none"},o.createElement("title",null,"Arrow"),o.createElement("path",{d:"M 0 0 L 100 50 L 0 100"}))},f=e=>{let{prefixCls:t,rootPrefixCls:i,children:r,percent:n}=e,l=`${t}-item-progress-icon`,c=`${l}-circle`,[,s]=(0,u.PN)(i,"cmp-steps"),m=`calc(${s("progress-radius")} * 2 * ${Math.PI*n/100}) 9999`;return o.createElement(o.Fragment,null,o.createElement("svg",{className:`${l}-svg`,viewBox:"0 0 100 100",width:"100%",height:"100%",xmlns:"http://www.w3.org/2000/svg","aria-valuemax":100,"aria-valuemin":0,"aria-valuenow":n},o.createElement("title",null,"Progress"),o.createElement("circle",{className:(0,a.$)(c,`${c}-rail`)}),o.createElement("circle",{className:(0,a.$)(c,`${c}-ptg`),strokeDasharray:m,transform:"rotate(-90 50 50)"})),r)};var x=i(7961),z=i(8403);let w=(e,t,i)=>{let{calc:o,componentCls:r,descriptionMaxWidth:n,antCls:l}=e,a=`${r}-item`,[,c]=(0,u.PN)(l,"cmp-steps");return{[`@container style(${(n||"--ant-not-exist").replace(/var\((.*)\)/,"$1")})`]:[{[`${a}-icon`]:{marginInlineStart:o(n).sub(c("icon-size")).div(2).equal()},[`${a}-rail`]:{width:"auto",insetInlineStart:o(n).add(c("icon-size")).div(2).add(t).equal(),insetInlineEnd:o(n).sub(c("icon-size")).div(2).sub(t).mul(-1).equal()}},i]}};var y=i(5561);let S="wait",I="process",k="finish",C="error",E=(0,u.OF)("Steps",e=>{let t=(0,z.oX)(e,{inlineDotSize:6});return[(e=>{let{componentCls:t,antCls:i}=e,o=`${t}-item`,[r,n]=(0,u.PN)(i,"cmp-steps");return{[t]:{[r("title-font-size")]:e.fontSizeLG,[r("title-line-height")]:e.lineHeightLG,[r("subtitle-font-size")]:e.fontSize,[r("subtitle-line-height")]:e.lineHeight,[r("item-wrapper-padding-top")]:"0px",[r("rail-size")]:e.lineWidth,[r("rail-line-style")]:e.lineType,...(0,x.dF)(e),display:"flex",flexWrap:"nowrap",alignItems:"flex-start",[o]:{flex:"none",position:"relative"},[`${o}-wrapper`]:{display:"flex",flexWrap:"nowrap",paddingTop:n("item-wrapper-padding-top")},[`${o}-header`]:{display:"flex",flexWrap:"nowrap",alignItems:"center"},[`${o}-title`]:{color:e.colorText,fontSize:n("title-font-size"),lineHeight:n("title-line-height"),wordBreak:"break-word"},[`${o}-subtitle`]:{color:e.colorTextDescription,fontWeight:"normal",fontSize:n("subtitle-font-size"),lineHeight:n("subtitle-line-height"),marginInlineStart:e.marginXS,wordBreak:"break-word"},[`${o}-content`]:{color:e.colorTextDescription,fontSize:e.fontSize,lineHeight:e.lineHeight,wordBreak:"break-word"},[`${o}-rail`]:{borderStyle:n("rail-line-style"),borderWidth:0},[`${o}-title, ${o}-subtitle, ${o}-content, ${o}-rail`]:{transition:`all ${e.motionDurationSlow}`},[`&${t}-ellipsis`]:{[`${o}-title, ${o}-subtitle, ${o}-content`]:x.L9},[`${o}[role='button']:not(${o}-active):hover`]:{cursor:"pointer"}}}})(t),(e=>{let{componentCls:t,customIconFontSize:i,motionDurationSlow:o,iconSize:r,lineWidth:n,lineType:l,antCls:a}=e,c=`${t}-item`,[s,m]=(0,u.PN)(a,"cmp-steps");return{[t]:{[s("icon-size")]:r,[s("icon-border-width")]:n,[`${c}-icon`]:{width:m("icon-size"),height:m("icon-size"),margin:0,flex:"none",display:"flex",alignItems:"center",justifyContent:"center",fontSize:e.iconFontSize,fontFamily:e.fontFamily,lineHeight:m("icon-size"),textAlign:"center",borderRadius:m("icon-size"),border:`${m("icon-border-width")} ${l} transparent`,transition:["background-color","border","color","inset","transform"].map(e=>`${e} ${o}`).join(", "),zIndex:1},[`${c}-custom ${c}-icon`]:{background:"none",border:0,fontSize:i}}}})(t),(e=>{let{componentCls:t,marginXXS:i,paddingSM:o,controlHeight:r,antCls:n,calc:l}=e,a=`${t}-item`,[c,s]=(0,u.PN)(n,"cmp-steps");return{[`${t}-vertical`]:{[c("vertical-rail-margin")]:l(i).mul(1.5).equal(),flexDirection:"column",alignItems:"stretch",[`> ${a}`]:{minHeight:l(r).mul(1.5).equal(),paddingBottom:o,"&:last-child":{paddingBottom:0},[`${a}-icon`]:{marginInlineStart:`calc((${s("icon-size-max")} - ${s("icon-size")}) / 2)`},[`${a}-rail`]:{[c("rail-offset")]:l(s("heading-height")).sub(s("icon-size")).div(2).equal(),borderInlineStartWidth:s("rail-size"),position:"absolute",top:l(s("icon-size")).add(s("item-wrapper-padding-top")).add(s("rail-offset")).add(s("vertical-rail-margin")).equal(),insetInlineStart:l(s("icon-size-max")).div(2).equal(),bottom:l(s("vertical-rail-margin")).sub(s("rail-offset")).equal(),marginInlineStart:`calc(${s("rail-size")} / -2)`}}}}})(t),(e=>{let{componentCls:t,antCls:i}=e,o=`${t}-item`,[r,n]=(0,u.PN)(i,"cmp-steps");return{[`${t}-horizontal`]:{[`> ${o}`]:{flex:"1 1 auto",minWidth:e.iconSize,[`${o}-rail`]:{[r("horizontal-rail-margin")]:`calc(${n("icon-size-max")} / 2 - ${n("rail-size")} / 2 + ${n("item-wrapper-padding-top")})`,position:"static",marginTop:n("horizontal-rail-margin"),width:"auto",borderBlockStartWidth:n("rail-size"),flex:1,minWidth:0,alignSelf:"flex-start"}}}}})(t),(e=>{let{componentCls:t,descriptionMaxWidth:i,marginXS:o,fontHeightLG:r,margin:n,paddingSM:l,marginXXS:a,antCls:c,calc:s}=e,m=`${t}-item`,[d,p]=(0,u.PN)(c,"cmp-steps");return{[t]:{[d("icon-size-max")]:`max(${p("icon-size")}, ${p("icon-size-active",p("icon-size"))})`,[`${m}-icon`]:{marginBlockStart:`calc((${p("heading-height")} - ${p("icon-size")}) / 2)`}},[`${t}-title-horizontal`]:{[d("title-horizontal-item-margin")]:n,[d("title-horizontal-rail-margin")]:n,[d("title-horizontal-title-height")]:r,[d("heading-height")]:`max(${p("icon-size")}, ${p("title-horizontal-title-height")})`,[`&${t}-horizontal, &${t}-horizontal-alternate`]:{[`${m}:not(:first-child)`]:{marginInlineStart:p("title-horizontal-item-margin")},[`${m}:last-child`]:{flex:"0 1 auto"},[`${m}-wrapper`]:{columnGap:e.marginXS}},[`&${t}-vertical`]:{[`${m}-wrapper`]:{columnGap:e.margin},[`${m}-empty-header`]:{[`${m}-header`]:{minHeight:"auto"},[`${m}-content`]:{marginTop:s(p("heading-height")).sub(e.fontHeight).div(2).equal()}}},[`${m}-section`]:{flex:1,minWidth:0},[`${m}-header`]:{minHeight:p("heading-height")},[`${m}-title`]:{flex:"0 1 auto"},[`${m}-content`]:{maxWidth:i},[`${m}-subtitle`]:{flex:"0 9999 auto"},[`&${t}-horizontal ${m}-rail`]:{[d("item-wrapper-padding-top")]:"0px",flex:"1 1 0%",marginInlineStart:p("title-horizontal-rail-margin")}},[`${t}-title-vertical`]:{[d("title-vertical-row-gap")]:l,[d("title-horizontal-rail-gap")]:a,[d("heading-height")]:p("icon-size-max"),[`> ${m}`]:{flex:"1 1 0%",[`${m}-wrapper`]:{flexDirection:"column",rowGap:p("title-vertical-row-gap"),alignItems:"center"},[`${m}-section`]:{alignSelf:"stretch"},[`${m}-header`]:{flexDirection:"column",alignItems:"center"},[`${m}-title, ${m}-subtitle, ${m}-content`]:{textAlign:"center",maxWidth:"100%"},[`${m}-subtitle`]:{margin:0},[`${m}-rail`]:{position:"absolute",top:0,width:`calc(100% - ${p("icon-size")} - ${p("title-horizontal-rail-gap")} * 2)`,insetInlineStart:`calc(50% + ${p("icon-size")} / 2 + ${p("title-horizontal-rail-gap")})`}},...w(e,o,{[`${m}:last-child`]:{flex:"none"},[`${m}-icon`]:{alignSelf:"flex-start"},[`${m}-section`]:{width:i}})}}})(t),(e=>{let{componentCls:t,iconSizeSM:i,fontSize:o,lineHeight:r,marginXS:n,fontHeight:l,marginSM:a,paddingXS:c,antCls:s}=e,[m]=(0,u.PN)(s,"cmp-steps");return{[`${t}${t}-small`]:{[m("icon-size")]:i,[m("title-horizontal-item-margin")]:a,[m("title-vertical-row-gap")]:c,[m("title-font-size")]:o,[m("title-line-height")]:r,[m("title-horizontal-rail-margin")]:n,[m("title-horizontal-title-height")]:l,[`&${t}-horizontal${t}-title-vertical`]:w(e,n)}}})(t),(e=>{let{componentCls:t,iconSize:i,dotSize:o,dotCurrentSize:r,marginXXS:n,lineWidthBold:l,fontSizeSM:a,antCls:c}=e,s=`${t}-item`,[m,d]=(0,u.PN)(c,"cmp-steps");return{[`${t}${t}-dot`]:{[m("icon-size-active")]:r,[m("icon-size")]:o,[m("dot-icon-size")]:o,[m("dot-icon-border-width")]:l,[m("rail-size")]:l,[m("icon-border-width")]:l,[`${s}-custom ${s}-icon`]:{fontSize:a},[`${s}-icon`]:{position:"relative","&:after":{content:'""',width:i,height:i,display:"block",position:"absolute",top:"50%",left:{_skip_check_:!0,value:"50%"},transform:"translate(-50%, -50%)"}},[`${s}-active ${s}-icon`]:{[m("icon-size")]:d("icon-size-active")},[`&${t}-horizontal`]:{[`&, &${t}-small`]:w(e,n)}}}})(t),(e=>{let{componentCls:t,colorTextDisabled:i,colorTextLightSolid:o,colorPrimary:r,colorTextLabel:n,colorError:l,colorErrorHover:a,colorErrorBgFilledHover:c,colorFillTertiary:s,colorErrorBg:m,colorPrimaryBgHover:d,colorPrimaryBg:p,colorText:$,colorTextDescription:h,colorBgContainer:g,colorPrimaryHover:b,lineType:v,antCls:f}=e,x=`${t}-item`,[z,w]=(0,u.PN)(f,"cmp-steps");return{[t]:[{[x]:{[z("item-solid-line-color")]:"#000",[z("item-title-color")]:"#000",[z("item-content-color")]:"#000",[z("item-subtitle-color")]:w("item-content-color"),[z("item-icon-custom-color")]:"#000",[z("item-icon-bg-color")]:"#000",[z("item-icon-border-color")]:"#000",[z("item-icon-text-color")]:"#fff",[z("item-icon-dot-color")]:"#000",[z("item-icon-dot-bg-color")]:w("item-icon-dot-color"),[z("item-icon-dot-border-color")]:w("item-icon-dot-color"),[z("item-text-hover-color")]:"#000",[z("item-icon-bg-hover-color")]:w("item-icon-bg-color"),[z("item-icon-border-hover-color")]:w("item-icon-border-color"),[z("item-icon-text-hover-color")]:w("item-icon-text-color"),[z("item-content-active-color")]:w("item-content-color"),[z("item-icon-active-bg-color")]:w("item-icon-bg-color"),[z("item-icon-active-border-color")]:w("item-icon-border-color"),[z("item-icon-active-text-color")]:w("item-icon-text-color"),[z("item-process-rail-line-style")]:v},[`${x}-rail`]:{borderColor:w("item-solid-line-color")},[`${x}-custom ${x}-icon`]:{color:w("item-icon-custom-color")},[`${x}-title`]:{color:w("item-title-color")},[`${x}-subtitle`]:{color:w("item-subtitle-color")},[`${x}-content`]:{color:w("item-content-color")},[`${x}-active ${x}-icon`]:{},[`${x}-active ${x}-content`]:{color:w("item-content-active-color")},[`${x}[role='button']:not(${x}-active):hover`]:{[`${x}-title, ${x}-content`]:{color:w("item-text-hover-color")}},[`&:not(${t}-dot)`]:{[`${x}:not(${x}-custom)`]:{[`${x}-icon`]:{background:w("item-icon-bg-color"),borderColor:w("item-icon-border-color"),color:w("item-icon-text-color")},[`&[role='button']:not(${x}-active):hover`]:{[`${x}-icon`]:{background:w("item-icon-bg-hover-color"),borderColor:w("item-icon-border-hover-color"),color:w("item-icon-text-hover-color")}},[`&${x}-active`]:{[`${x}-icon`]:{background:w("item-icon-active-bg-color"),borderColor:w("item-icon-active-border-color"),color:w("item-icon-active-text-color")}}}},[`&${t}-dot`]:{[`${x}-icon`]:{background:w("item-icon-dot-bg-color"),borderColor:w("item-icon-dot-border-color"),color:w("item-icon-dot-color"),[`&${x}-icon-dot-custom`]:{background:"transparent",border:"none"}}}},{[`${x}-${S}`]:{[z("item-icon-custom-color")]:i,[z("item-title-color")]:h,[z("item-content-color")]:h,[z("item-content-active-color")]:$,[z("item-text-hover-color")]:b},[`${x}-rail-${S}`]:{[z("item-solid-line-color")]:i},[`${x}-${I}`]:{[z("item-icon-custom-color")]:r,[z("item-title-color")]:$,[z("item-content-color")]:h,[z("item-content-active-color")]:$,[z("item-text-hover-color")]:b},[`${x}-rail-${I}`]:{[z("item-solid-line-color")]:r,[z("rail-line-style")]:w("item-process-rail-line-style")},[`${x}-${k}`]:{[z("item-icon-custom-color")]:r,[z("item-title-color")]:$,[z("item-content-color")]:h,[z("item-content-active-color")]:$,[z("item-text-hover-color")]:b},[`${x}-rail-${k}`]:{[z("item-solid-line-color")]:r},[`${x}-${C}`]:{[z("item-icon-custom-color")]:l,[z("item-title-color")]:l,[z("item-content-color")]:l,[z("item-content-active-color")]:l,[z("item-text-hover-color")]:a},[`${x}-rail-${C}`]:{[z("item-solid-line-color")]:l}},{[`&${t}-filled`]:{[x]:{[z("item-icon-dot-border-color")]:"transparent"},[`${x}-${S}`]:{[z("item-icon-bg-color")]:s,[z("item-icon-border-color")]:"transparent",[z("item-icon-text-color")]:n,[z("item-icon-dot-bg-color")]:i,[z("item-icon-bg-hover-color")]:d,[z("item-icon-border-hover-color")]:"transparent",[z("item-icon-text-hover-color")]:r,[z("item-icon-active-bg-color")]:r,[z("item-icon-active-border-color")]:"transparent",[z("item-icon-active-text-color")]:o},[`${x}-${I}, ${x}-${k}`]:{[z("item-icon-bg-color")]:p,[z("item-icon-border-color")]:"transparent",[z("item-icon-text-color")]:r,[z("item-icon-dot-bg-color")]:r,[z("item-icon-bg-hover-color")]:d,[z("item-icon-border-hover-color")]:"transparent",[z("item-icon-text-hover-color")]:r,[z("item-icon-active-bg-color")]:r,[z("item-icon-active-border-color")]:"transparent",[z("item-icon-active-text-color")]:o},[`${x}-${C}`]:{[z("item-icon-bg-color")]:m,[z("item-icon-border-color")]:"transparent",[z("item-icon-text-color")]:l,[z("item-icon-dot-bg-color")]:l,[z("item-icon-bg-hover-color")]:c,[z("item-icon-border-hover-color")]:"transparent",[z("item-icon-text-hover-color")]:l,[z("item-icon-active-bg-color")]:l,[z("item-icon-active-border-color")]:"transparent",[z("item-icon-active-text-color")]:o}}},{[`&${t}-outlined`]:{[x]:{[z("item-icon-dot-bg-color")]:"transparent"},[`${x}-${S}`]:{[z("item-icon-bg-color")]:g,[z("item-icon-border-color")]:i,[z("item-icon-text-color")]:i,[z("item-icon-dot-color")]:i,[z("item-icon-bg-hover-color")]:"transparent",[z("item-icon-border-hover-color")]:b,[z("item-icon-text-hover-color")]:b,[z("item-icon-active-bg-color")]:s},[`${x}-${I}, ${x}-${k}`]:{[z("item-icon-bg-color")]:g,[z("item-icon-border-color")]:r,[z("item-icon-text-color")]:r,[z("item-icon-dot-color")]:r,[z("item-icon-bg-hover-color")]:"transparent",[z("item-icon-border-hover-color")]:b,[z("item-icon-text-hover-color")]:b,[z("item-icon-active-bg-color")]:p},[`${x}-${C}`]:{[z("item-icon-bg-color")]:g,[z("item-icon-border-color")]:l,[z("item-icon-text-color")]:l,[z("item-icon-dot-color")]:l,[z("item-icon-bg-hover-color")]:"transparent",[z("item-icon-border-hover-color")]:a,[z("item-icon-text-hover-color")]:a,[z("item-icon-active-bg-color")]:m}}}]}})(t),(e=>{let{componentCls:t,fontSizeIcon:i,navContentMaxWidth:o,navArrowColor:r,colorPrimary:n,motionDurationSlow:l,antCls:a,calc:c}=e,s=`${t}-item`,[m,d]=(0,u.PN)(a,"cmp-steps");return{[`${t}${t}-navigation`]:{[s.repeat(4)]:{display:"flex",justifyContent:"center",position:"relative",flex:1,marginInlineStart:0,[`${s}-wrapper`]:{paddingBlock:e.paddingSM},[`${s}-section`]:{maxWidth:o},[`${s}-rail`]:{display:"none"},"&:before":{position:"absolute",display:"block",backgroundColor:n,transition:`all ${l}`,transitionTimingFunction:"ease-out",content:'""'},"&:not(:last-child):after":{position:"absolute",display:"block",borderTop:`${(0,y.zA)(e.lineWidth)} ${e.lineType} ${r}`,borderBottom:"none",borderInlineStart:"none",borderInlineEnd:`${(0,y.zA)(e.lineWidth)} ${e.lineType} ${r}`,content:'""'},[`&${s}-active`]:{[m("item-content-active-color")]:d("item-content-color"),[m("item-icon-active-bg-color")]:d("item-icon-bg-color"),[m("item-icon-active-border-color")]:d("item-icon-border-color"),[m("item-icon-active-text-color")]:d("item-icon-text-color")}},[`&${t}-horizontal`]:{[s]:{"&:before":{bottom:0,insetInlineStart:"50%",width:0,height:e.lineWidthBold},[`&${s}-active:before`]:{insetInlineStart:0,width:"100%"},"&:not(:last-child):after":{top:"50%",insetInlineStart:c(i).div(2).mul(-1).add("100%").equal(),width:i,height:i,transform:"translateY(-50%) rotate(45deg)"}}},[`&${t}-vertical`]:{[s.repeat(4)]:{[`${s}-content`]:{padding:0},"&:before":{insetInlineEnd:0,top:"50%",width:e.lineWidthBold,height:0},[`&${s}-active::before`]:{top:0,height:"100%"},"&:not(:last-child):after":{left:{_skip_check_:!0,value:"50%"},top:"100%",width:c(i).div(3).mul(2).equal(),height:c(i).div(3).mul(2).equal(),transform:"translateY(-50%) translateX(-50%) rotate(135deg)"}}}}}})(t),(e=>{let{componentCls:t,lineWidthBold:i,borderRadius:o,borderRadiusSM:r,motionDurationMid:n,paddingXS:l,lineType:a,paddingSM:c,antCls:s,calc:m}=e,d=`${t}-item`,[p,$]=(0,u.PN)(s,"cmp-steps"),h=`${(0,y.zA)(i)} ${a} ${$("panel-border-color")}`;return{[`${t}${t}-panel`]:[{[`${d}-rail`]:{display:"none"},[`&${t}-horizontal`]:{alignItems:"stretch",[d]:{flex:1,margin:0}}},{"&":{[p("panel-padding")]:c,[p("item-border-radius")]:o,[d]:{[p("panel-bg-color")]:$("item-icon-bg-color"),[p("panel-border-color")]:$("item-icon-border-color"),[p("panel-active-bg-color")]:$("item-icon-active-bg-color"),[p("panel-active-border-color")]:$("item-icon-active-border-color"),[p("panel-title-height")]:`calc(${$("title-font-size")} * ${$("title-line-height")})`,[p("item-base-height")]:m($("panel-padding")).mul(2).add($("icon-size")).add($("panel-title-height")).equal(),[p("item-base-width")]:`calc(${$("item-base-height")} * 0.7071)`,transition:`background-color ${n}`}},[`${d}-icon`]:{display:"none"},[`${d}-header`]:{minHeight:"auto"},[`${t}-panel-arrow`]:{position:"absolute",top:m(i).mul(-1).equal(),insetInlineStart:"100%",zIndex:1,height:m(i).mul(2).add("100%").equal(),width:$("item-base-width"),overflow:"visible",strokeLinecap:"round",path:{fill:$("panel-bg-color"),stroke:$("panel-border-color"),strokeWidth:i,vectorEffect:"non-scaling-stroke",transition:`fill ${n}`}},[`${d}:last-child ${t}-panel-arrow`]:{display:"none"},[d]:{padding:$("panel-padding"),background:$("panel-bg-color"),position:"relative",borderBlock:h,"&:not(:first-child)":{paddingInlineStart:`calc(${$("panel-padding")} + ${$("item-base-width")})`},"&:first-child":{borderInlineStart:h,borderStartStartRadius:$("item-border-radius"),borderEndStartRadius:$("item-border-radius")},"&:last-child":{borderInlineEnd:h,borderStartEndRadius:$("item-border-radius"),borderEndEndRadius:$("item-border-radius")},"&-active":{background:$("panel-active-bg-color"),borderColor:$("panel-active-border-color"),[`${t}-panel-arrow`]:{path:{fill:$("panel-active-bg-color"),stroke:$("panel-active-border-color")}},[`${d}-title, ${d}-subtitle, ${d}-content`]:{color:$("item-icon-active-text-color")}}}},{[`&${t}-small`]:{[p("panel-padding")]:l,[p("item-border-radius")]:r}},{[`&${t}-filled`]:{[d]:{"&:not(:first-child)":{clipPath:`polygon(${(0,y.zA)(i)} 0,calc(100% + ${$("item-base-width")}) 0,calc(100% + ${$("item-base-width")}) 100%,${(0,y.zA)(i)} 100%,calc(${$("item-base-width")} + ${(0,y.zA)(i)}) 50%)`}}}},{[`&${t}-outlined`]:{[`${t}-panel-arrow`]:{top:m(i).div(2).mul(-1).equal(),height:m(i).add("100%").equal()}}}]}})(t),(e=>{let{componentCls:t,inlineDotSize:i,paddingXS:o,lineWidth:r,antCls:n,calc:l}=e,a=l(o).add(r).equal(),c=`${t}-item`,[s,m]=(0,u.PN)(n,"cmp-steps");return{[`${t}-inline`]:{[s("items-offset")]:"0",[s("item-wrapper-padding-top")]:a,display:"inline-flex","&:before":{content:'""',flex:m("items-offset")},[c]:{[s("title-vertical-row-gap")]:o,[s("icon-size")]:i,[s("icon-size-active")]:i,[s("title-font-size")]:e.fontSizeSM,[s("title-line-height")]:e.lineHeightSM,[s("item-title-color")]:e.colorTextSecondary,[s("subtitle-font-size")]:e.fontSizeSM,[s("subtitle-line-height")]:e.lineHeightSM,[s("item-subtitle-color")]:e.colorTextQuaternary,[s("rail-size")]:e.lineWidth,[s("title-horizontal-rail-gap")]:"0px",flex:1,"&-wrapper":{paddingInline:e.paddingXXS,marginInline:e.calc(e.marginXXS).div(2).equal(),borderRadius:e.borderRadiusSM,cursor:"pointer",transition:`background-color ${e.motionDurationMid}`,"&:hover":{background:e.controlItemBgHover}},"&-icon":{[`${c}-icon-dot`]:{"&:after":{display:"none"}}},"&-title":{fontWeight:"normal",whiteSpace:"nowrap"},"&-content":{display:"none"}}}}})(t),(e=>{let{componentCls:t}=e,i=`${t}-item`;return{[`${t}-max-count`]:{[`${i}-ellipsis`]:{[`${i}-title, ${i}-subtitle, ${i}-content`]:{color:e.colorTextDescription}}}}})(t),(e=>{let{calc:t,antCls:i,componentCls:o,lineWidthBold:r,motionDurationSlow:n}=e,l=`${o}-item`,[a,c]=(0,u.PN)(i,"cmp-steps"),s=t(r).add(r).equal();return{[`${o}${o}-with-progress`]:{[a("item-wrapper-padding-top")]:s,[`${l}${l}-process`]:{[`${l}-icon`]:{position:"relative"}},[`${l}-progress-icon`]:{"&-svg":{[a("svg-size")]:t(s).mul(2).add(c("icon-size")).equal(),[a("icon-size-ptg-unitless")]:`calc(100 / tan(atan2(${c("svg-size")}, 1px)))`,fontSize:c("svg-size"),lineHeight:c("icon-size-ptg-unitless"),position:"absolute",inset:t(s).mul(-1).equal(),width:"auto",height:"auto"},"&-circle":{lineHeight:c("icon-size-ptg-unitless"),strokeWidth:t(c("icon-size-ptg-unitless")).mul(r).equal(),[a("progress-radius")]:t(c("svg-size")).sub(r).mul(c("icon-size-ptg-unitless")).div(2).equal(),r:c("progress-radius"),fill:"none",cx:50,cy:50,transition:`all ${n} ease-in-out`,"&-rail":{stroke:e.colorSplit},"&-ptg":{stroke:e.colorPrimary}}}}}})(t),(e=>{let{componentCls:t,lineWidthBold:i,antCls:o}=e,r=`${t}-item`,[,n]=(0,u.PN)(o,"cmp-steps");return{[`${t}${t}-rtl`]:{direction:"rtl",[`&${t}-navigation${t}-horizontal`]:{[`${r}:after`]:{transform:"translateY(-50%) rotate(-45deg)"}},[`&${t}-panel`]:{[`${t}-panel-arrow`]:{transform:"scaleX(-1)"},[`&${t}-filled`]:{[r]:{"&:not(:first-child)":{clipPath:`polygon(calc(0px - ${n("item-base-width")}) 0px,calc(100% - ${(0,y.zA)(i)}) 0px,calc(100% - ${n("item-base-width")} - ${(0,y.zA)(i)}) 50%,calc(100% - ${(0,y.zA)(i)}) 100%,calc(0px - ${n("item-base-width")}) 100%)`}}}}}}})(t)]},e=>({titleLineHeight:e.controlHeight,customIconSize:e.controlHeight,customIconTop:0,customIconFontSize:e.controlHeightSM,iconSize:e.controlHeight,iconTop:-.5,iconFontSize:e.fontSize,iconSizeSM:e.fontSizeHeading3,dotSize:e.controlHeight/4,dotCurrentSize:e.controlHeightLG/4,navArrowColor:e.colorTextDisabled,navContentMaxWidth:"unset",descriptionMaxWidth:void 0,waitIconColor:e.wireframe?e.colorTextDisabled:e.colorTextLabel,waitIconBgColor:e.wireframe?e.colorBgContainer:e.colorFillContent,waitIconBorderColor:e.wireframe?e.colorTextDisabled:"transparent",finishIconBgColor:e.wireframe?e.colorBgContainer:e.controlItemBgActive,finishIconBorderColor:e.wireframe?e.colorPrimary:e.controlItemBgActive}));var N=i(241);let A={itemIcon:d.D},P=e=>{let t,i,{size:d,className:x,rootClassName:z,style:w,variant:y="filled",type:S,classNames:I,styles:k,direction:C,orientation:P,responsive:H=!0,progressDot:W,labelPlacement:B,titlePlacement:M,ellipsis:T,maxCount:q,offset:R=0,items:D,percent:j,current:O=0,initial:F=0,onChange:_,iconRender:L,...X}=e,G=o.useContext(b.j),Y=(0,p.TP)("steps"),{getPrefixCls:Q,direction:K,className:V,style:J}=Y,U={};G?U={root:G.rootComponent,item:G.itemComponent}:{classNames:t,styles:i}=Y;let Z=Q(),ee=Q("steps",e.prefixCls),et=`${ee}-item-icon`,[ei,eo]=E(ee),[er]=(0,u.PN)(Z,"cmp-steps"),en=(0,$.A)(d),el=o.useMemo(()=>(D||[]).filter(Boolean),[D]),{xs:ea}=(0,h.A)(H),ec=o.useMemo(()=>S&&"default"!==S?S:W?"dot":S,[W,S]),es="inline"===ec,em="dot"===ec||"inline"===ec,ed=o.useMemo(()=>"dot"===ec&&(0,s.Tn)(W)?W:void 0,[ec,W]),ep=o.useMemo(()=>{let e=P||C;return"panel"===ec?"horizontal":H&&ea||"vertical"===e?"vertical":"horizontal"},[P,C,ec,H,ea]),e$=o.useMemo(()=>em||"vertical"===ep?"vertical"===ep?"horizontal":"vertical":"navigation"===S?"horizontal":M||B||"horizontal",[em,B,ep,M,S]),eh=es?void 0:j,{canApplyMaxCount:eu,displaySteps:eg,mappedDisplayCurrent:eb,displayItems:ev}=function(e,t,i,r,n){let l=void 0!==r&&r>=3&&e.length>r,a=t-i,c=o.useMemo(()=>{if(!l)return e.map((e,t)=>({item:e,originIndex:t}));let t=function(e,t,i){let o=Math.min(Math.max(t,0),e-1),r=Math.min(i,e),n=new Set([0,o,e-1]);for(let t=1;n.size<r&&t<e;t+=1)for(let i of[o-t,o+t,t,e-1-t]){if(n.size>=r)break;i>=0&&i<e&&n.add(i)}return Array.from(n).sort((e,t)=>e-t).flatMap((e,t,i)=>t>0&&e-i[t-1]>1?[null,e]:[e])}(e.length,a,r);return t.map((i,r)=>{var l;return null===i?function(e,t,i,r,n){let l=e[i].key??i,a=e[r].key??r,c=e.slice(i+1,r).some(e=>"error"===e.status)?"error":r-1<t?"finish":"wait";return{item:{key:`ellipsis-${l}-${a}`,title:"",icon:o.createElement(N.A),status:c,disabled:!0,className:`${n}-item-ellipsis`},originIndex:-1}}(e,a,t[r-1],t[r+1],n):(l=e[i],{item:{...l,key:l.key??i},originIndex:i})})},[l,a,e,r,n]),s=c.findIndex(e=>e.originIndex===a);return{canApplyMaxCount:l,displaySteps:c,mappedDisplayCurrent:s>=0?s:a,displayItems:c.map(e=>e.item)}}(el,O,F,q,ee),ef={...e,variant:y,size:en,type:ec,orientation:ep,titlePlacement:e$,current:O,initial:F,percent:eh,responsive:H,offset:R,ellipsis:T,maxCount:q},[ex,ez]=(0,c.AV)([A,t,I],[i,k],{props:ef}),ew="panel"===ec?e=>o.createElement(o.Fragment,null,e,o.createElement(v,{prefixCls:ee})):void 0,ey={[er("items-offset")]:`${R}`,...J,...w},eS=(0,a.$)(V,`${ee}-${y}`,{[`${ee}-${ec}`]:"dot"!==ec&&ec,[`${ee}-rtl`]:"rtl"===K,[`${ee}-dot`]:em,[`${ee}-ellipsis`]:T,[`${ee}-max-count`]:eu,[`${ee}-with-progress`]:void 0!==eh,[`${ee}-small`]:"small"===en},x,z,ei,eo);return o.createElement(l.Ay,{...X,prefixCls:ee,className:eS,style:ey,classNames:ex,styles:ez,orientation:ep,titlePlacement:e$,components:U,initial:0,current:eb,items:ev,onChange:_?e=>{let t=eg[e];_&&t&&t.originIndex>=0&&_(F+t.originIndex)}:void 0,iconRender:(e,t)=>{let{item:i,index:l,active:a,components:{Icon:c}}=t,m=eg[l]?.originIndex,d=void 0!==m&&m>=0?F+m:l,{status:p,icon:$}=i,h=null;if(em||$)h=$;else switch(p){case"finish":h=o.createElement(r.A,{className:`${et}-finish`});break;case"error":h=o.createElement(n.A,{className:`${et}-error`});break;default:{let e=o.createElement("span",{className:`${et}-number`},d+1);"process"===p&&void 0!==eh&&(e=o.createElement(f,{prefixCls:ee,rootPrefixCls:Z,percent:eh},e)),h=e}}let u=o.createElement(c,null,h);return L?u=L(u,{index:d,active:a,item:i,components:{Icon:c}}):(0,s.Tn)(ed)&&(u=ed(u,{index:d,...i})),u},itemRender:(e,t)=>{let i=e;return es&&t.item.content&&(i=o.createElement(g.A,{destroyOnHidden:!0,title:t.item.content},e)),o.createElement(m.A,{component:"Steps",disabled:t.item.disabled||!_,colorSource:"filled"===y?"color":null},i)},itemWrapperRender:ew})}},9981:(e,t,i)=>{i.d(t,{QB:()=>a,Ay:()=>b});var o=i(3638),r=i(7109),n=i(9452);function l(e){let{prefixCls:t,className:i,style:n,status:l}=e,a=`${t}-rail`;return r.createElement("div",{className:(0,o.$)(a,`${a}-${l}`,i),style:n})}let a=r.createContext({}),c=r.createContext(null);var s=i(7597);function m(){return(m=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(e[o]=i[o])}return e}).apply(this,arguments)}let d=r.createContext({}),p=r.forwardRef((e,t)=>{let{className:i,style:n,children:l,...a}=e,{prefixCls:p,classNames:$,styles:h}=r.useContext(c),{className:u,style:g}=r.useContext(d),b=`${p}-item`;return r.createElement("div",m({},(0,s.A)(a,!1),{ref:t,className:(0,o.$)(`${b}-icon`,$.itemIcon,u,i),style:{...h.itemIcon,...g,...n}}),l)});function $(){return($=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(e[o]=i[o])}return e}).apply(this,arguments)}function h(e){let{prefixCls:t,classNames:i,styles:s,data:m,last:h,nextStatus:u,active:g,index:b,itemRender:v,iconRender:f,itemWrapperRender:x,onClick:z}=e,w=`${t}-item`,{railFollowPrevStatus:y}=r.useContext(a),{ItemComponent:S}=r.useContext(c),{onClick:I,title:k,subTitle:C,content:E,description:N,disabled:A,icon:P,status:H,className:W,style:B,classNames:M={},styles:T={},...q}=m,R=E??N,D={item:{...m,content:R},index:b,active:g},j={};(z||I)&&!A&&(j.role="button",j.tabIndex=0,j.onClick=e=>{I?.(e),z(b)},j.onKeyDown=e=>{let{which:t}=e;(t===n.A.ENTER||t===n.A.SPACE)&&z(b)});let O=H||"wait",F=null!=k,_=null!=C,L=(0,o.$)(w,`${w}-${O}`,{[`${w}-custom`]:P,[`${w}-active`]:g,[`${w}-disabled`]:!0===A,[`${w}-empty-header`]:!F&&!_},W,i.item,M.root),X=r.createElement(p,null);f&&(X=f(X,{...D,components:{Icon:p}}));let G=r.createElement("div",{className:(0,o.$)(`${w}-wrapper`,i.itemWrapper,M.wrapper),style:{...s.itemWrapper,...T.wrapper}},r.createElement(d.Provider,{value:{className:M.icon,style:T.icon}},X),r.createElement("div",{className:(0,o.$)(`${w}-section`,i.itemSection,M.section),style:{...s.itemSection,...T.section}},r.createElement("div",{className:(0,o.$)(`${w}-header`,i.itemHeader,M.header),style:{...s.itemHeader,...T.header}},F&&r.createElement("div",{className:(0,o.$)(`${w}-title`,i.itemTitle,M.title),style:{...s.itemTitle,...T.title}},k),_&&r.createElement("div",{title:"string"==typeof C?C:void 0,className:(0,o.$)(`${w}-subtitle`,i.itemSubtitle,M.subtitle),style:{...s.itemSubtitle,...T.subtitle}},C),!h&&r.createElement(l,{prefixCls:w,className:(0,o.$)(i.itemRail,M.rail),style:{...s.itemRail,...T.rail},status:y?H:u})),null!=R&&r.createElement("div",{className:(0,o.$)(`${w}-content`,i.itemContent,M.content),style:{...s.itemContent,...T.content}},R))),Y=r.createElement(S,$({},q,j,{className:L,style:{...s.item,...T.root,...B}}),x?x(G):G);return v&&(Y=v(Y,D)||null),Y}function u(){return(u=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(e[o]=i[o])}return e}).apply(this,arguments)}let g={},b=function(e){let{prefixCls:t="rc-steps",style:i,className:n,classNames:l=g,styles:a=g,rootClassName:s,orientation:m,titlePlacement:d,components:p,status:$="process",current:b=0,initial:v=0,onChange:f,items:x,iconRender:z,itemRender:w,itemWrapperRender:y,...S}=e,I="vertical"===m,k=(0,o.$)(t,`${t}-${I?"vertical":"horizontal"}`,`${t}-title-${I||"vertical"!==d?"horizontal":"vertical"}`,s,n,l.root),C=r.useMemo(()=>(x||[]).filter(Boolean),[x]),E=r.useMemo(()=>C.map(({status:e},t)=>{let i=v+t;return e?e:i===b?$:i<b?"finish":"wait"}),[C,$,b,v]),N=e=>{f&&b!==e&&f(e)},{root:A="div",item:P="div"}=p||{},H=r.useMemo(()=>({prefixCls:t,classNames:l,styles:a,ItemComponent:P}),[t,l,a,P]);return r.createElement(A,u({className:k,style:{...i,...a?.root}},S),r.createElement(c.Provider,{value:H},C.map((e,i)=>{let o=v+i,n=E[i],c=E[i+1],s={...e,status:n};return r.createElement(h,{key:o,prefixCls:t,classNames:l,styles:a,data:s,nextStatus:c,active:o===b,index:o,last:C.length-1===i,iconRender:z,itemRender:w,itemWrapperRender:y,onClick:f&&N})})))}}}]);
|