@customize-agent/server 4.60.2 → 4.60.3
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 +56 -54
- package/.next/prerender-manifest.json +3 -3
- package/.next/required-server-files.json +1 -1
- package/.next/server/chunks/1243.js +1 -1
- package/.next/server/chunks/2328.js +1 -1
- package/.next/server/chunks/{7848.js → 4683.js} +86 -85
- package/.next/server/chunks/5304.js +1 -1
- package/.next/server/chunks/6321.js +1 -1
- package/.next/server/chunks/6822.js +1 -1
- package/.next/server/chunks/8204.js +1 -1
- package/.next/server/chunks/9399.js +1 -0
- package/.next/server/chunks/9666.js +55 -54
- package/.next/server/instrumentation.js +1 -1
- package/.next/server/instrumentation.js.nft.json +1 -1
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/pages/404.html +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/server/pages/api/documents/export.js +2 -2
- package/.next/server/pages/api/documents/export.js.nft.json +1 -1
- package/.next/server/pages/api/documents/generate/preview.js +1 -1
- package/.next/server/pages/api/documents/generate.js +1 -1
- package/.next/server/pages/api/health.js +1 -1
- package/.next/server/pages/canvas/[id].html +1 -1
- package/.next/server/pages/canvas.html +1 -1
- package/.next/server/pages/documents.html +1 -1
- package/.next/server/pages/guide.html +1 -1
- package/.next/server/pages/index.html +1 -1
- package/.next/server/pages/knowledge/file-detail.html +1 -1
- package/.next/server/pages/knowledge/files.html +1 -1
- package/.next/server/pages/knowledge/manage.html +1 -1
- package/.next/server/pages/knowledge/source-preview.html +1 -1
- package/.next/server/pages/knowledge.html +1 -1
- package/.next/server/pages/models.html +1 -1
- package/.next/server/pages/overview.html +1 -1
- package/.next/server/pages/prompt.html +1 -1
- package/.next/server/pages/settings.html +1 -1
- package/.next/server/pages/skills/[id]/edit.html +1 -1
- package/.next/server/pages/skills/[id]/edit.js.nft.json +1 -1
- package/.next/server/pages/skills/[id].html +1 -1
- package/.next/server/pages/skills/[id].js.nft.json +1 -1
- package/.next/server/pages/skills/new.html +1 -1
- package/.next/server/pages/skills/new.js.nft.json +1 -1
- package/.next/server/pages/skills.html +1 -1
- package/.next/server/pages/system/logs.html +1 -1
- package/.next/server/pages-manifest.json +29 -29
- package/.next/static/7ea0ee326182fc159e629b4cd9354c5c800c7d5e156fcd6533182444b20d26cf/_buildManifest.js +1 -0
- package/.next/static/chunks/2-8570cd2beee4da6e.js +1 -0
- package/.next/static/chunks/257-3ea888b096943bc8.js +1 -0
- package/.next/static/chunks/280-3ce590d421b5c47d.js +16 -0
- package/.next/static/chunks/425-42f2568bcdd98f4c.js +1 -0
- package/.next/static/chunks/530-a5a65dc8adb1ee11.js +1 -0
- package/.next/static/chunks/564-d3426eef3e3e415b.js +4 -0
- package/.next/static/chunks/576-6699fed6c88502fe.js +1 -0
- package/.next/static/chunks/579-fc0a2eb64aedb001.js +1 -0
- package/.next/static/chunks/{795-1a33b085051ecf2b.js → 795-1c1cb3bf1f600e99.js} +1 -1
- package/.next/static/chunks/819-96247c9054ad9683.js +1 -0
- package/.next/static/chunks/{964-82cc4701f08f7351.js → 964-569c27befeaff602.js} +2 -2
- package/.next/static/chunks/pages/{_app-3df96a32b2c9a6ca.js → _app-10f13111671af8a4.js} +3 -3
- package/.next/static/chunks/pages/canvas/[id]-534b45f39f39630c.js +1 -0
- package/.next/static/chunks/pages/{canvas-8372faba7b5bb116.js → canvas-ffb08963e5cf9558.js} +1 -1
- package/.next/static/chunks/pages/knowledge/{file-detail-6c8b86752d2ddf88.js → file-detail-4ccc50ced6382dab.js} +1 -1
- package/.next/static/chunks/pages/knowledge/source-preview-56ce59763fa015db.js +1 -0
- package/.next/static/chunks/pages/knowledge-84e386d765ddd311.js +1 -0
- package/.next/static/chunks/pages/{models-dde7dc26b2ee4b83.js → models-5eee2d09deb081fb.js} +1 -1
- package/.next/static/chunks/pages/prompt-f00bf2272142bfa1.js +1 -0
- package/.next/static/chunks/pages/{settings-8ebbd4413f976a60.js → settings-f6dfff648cf9ac0e.js} +1 -1
- package/.next/static/chunks/pages/skills/[id]/{edit-334c249d48dc651d.js → edit-89bbed9a3a854b04.js} +1 -1
- package/.next/static/chunks/pages/skills/[id]-101d753aa8fbf7a9.js +1 -0
- package/.next/static/chunks/pages/skills/{new-750c28325b6c869a.js → new-124599c772150a1d.js} +1 -1
- package/.next/static/chunks/pages/{skills-25f02f34e4a24e7e.js → skills-476714776be63ce5.js} +1 -1
- package/.next/static/chunks/pages/system/logs-40edb648d89b0749.js +1 -0
- package/.next/static/css/e67420f8d0ea180d.css +1 -0
- package/package.json +1 -1
- package/public/apple-touch-icon.png +0 -0
- package/public/favicon.ico +0 -0
- package/public/favicon.svg +7 -0
- package/scripts/generate-brand-assets.cjs +109 -0
- package/.next/static/cf07df1d78876548cb59ce9935b756d62660ad2a6b02180bef97865f98fcc4c8/_buildManifest.js +0 -1
- package/.next/static/chunks/257-9484b4285bd5f43b.js +0 -1
- package/.next/static/chunks/530-ccc3837d353bcf74.js +0 -1
- package/.next/static/chunks/573-c52901488f5731dd.js +0 -4
- package/.next/static/chunks/576-052a39d403d5d32e.js +0 -1
- package/.next/static/chunks/638-29ddb55b708c7969.js +0 -1
- package/.next/static/chunks/712-1f2d7c40d613f4d8.js +0 -1
- package/.next/static/chunks/815-585fb0b4aa9b369c.js +0 -16
- package/.next/static/chunks/933-e9c4889bb9f825ce.js +0 -1
- package/.next/static/chunks/pages/canvas/[id]-996d9a43ff45a4b3.js +0 -1
- package/.next/static/chunks/pages/knowledge/source-preview-c803a44df4b1d2f2.js +0 -1
- package/.next/static/chunks/pages/knowledge-135c4c9260f07108.js +0 -1
- package/.next/static/chunks/pages/prompt-7559b2569b3934a5.js +0 -1
- package/.next/static/chunks/pages/skills/[id]-eb1bdec00ba09ad2.js +0 -1
- package/.next/static/chunks/pages/system/logs-e08749c3a8f9a104.js +0 -1
- package/.next/static/css/5bab0d7ea874d4e0.css +0 -1
- /package/.next/static/{cf07df1d78876548cb59ce9935b756d62660ad2a6b02180bef97865f98fcc4c8 → 7ea0ee326182fc159e629b4cd9354c5c800c7d5e156fcd6533182444b20d26cf}/_ssgManifest.js +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[790],{38977:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>eZ});var r=n(65321),l=n(97109),i=n(3454),a=n.n(i),o=n(43220),s=n.n(o),c=n(86109),d=n(48399),u=n(17807),h=n(42700),p=n(32941),m=n(33442),x=n(85114),g=n(25258),v=n(11702),f=n(85493),y=n(99811),j=n(6578),A=n(32244),b=n(93533),k=n(8090);function w(e){let{readings:t}=e,n=null==t?void 0:t.contractQuality;if(!n)return(0,r.jsx)("div",{role:"status",children:"七维评价尚未产出。"});let l=n.score,i=null==t?void 0:t.contractQualityStale;return Array.isArray(l.defects)?(0,r.jsxs)("div",{"aria-label":"七维评价",style:{fontSize:12,lineHeight:1.8},children:[(0,r.jsx)("strong",{children:i?"编辑前的历史七维诊断":"七维专业诊断"}),(0,r.jsxs)("span",{children:[";",i?"当前正文须重新评价":l.deliveryReady?"适用职责核验满足,待专业验收":"仍有缺陷或待核事项"]}),(0,r.jsxs)("div",{children:["阻断 ",l.blocking.length," 项;按根因归并的问题 ",l.defects.length," 项。专业档位不换算为未经标定的百分分数。"]}),i&&(0,r.jsx)("div",{children:i.reason}),(0,r.jsxs)("details",{children:[(0,r.jsx)("summary",{children:"查看七个维度"}),(0,r.jsxs)("table",{style:{width:"100%"},children:[(0,r.jsx)("thead",{children:(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{children:"维度"}),(0,r.jsx)("th",{children:"质量档位"}),(0,r.jsx)("th",{children:"满足 / 未满足 / 未判定"})]})}),(0,r.jsx)("tbody",{children:l.dimensions.map(e=>(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:e.label}),(0,r.jsx)("td",{children:"not-applicable"===e.status?"不适用":e.qualityLabel}),(0,r.jsxs)("td",{children:[e.verification.met," / ",e.verification.failed," / ",e.verification.unmeasured]})]},e.id))})]}),(0,r.jsx)("div",{children:n.expertValidated?"已完成专家校准。":"尚未完成专家校准。"})]})]}):(0,r.jsx)("div",{role:"status",children:"历史评价回执保留;按当前专业诊断口径重新评价后显示核验与质量档位。"})}let{Paragraph:S,Text:I}=d.A;function C(e){return new Date(e).toLocaleString()}function z(e){var t,n,i;let{status:a,title:o,html:s,source:c,truncated:d,totalChars:u,renderedChars:p,stats:g,gate:y,loading:j,error:A,onRetry:b,updatedAt:z,generatedAt:R,className:N,t:E,deliveryReadings:T}=e,M=null!=s?s:"",L=M.trim().length>0,D=g?function(e){let t=[];return e.droppedDangerousBlocks>0&&t.push("删除了 ".concat(e.droppedDangerousBlocks," 处可执行/可加载内容(脚本、样式、内嵌页面等)")),e.blockedUrls>0&&t.push("拦截了 ".concat(e.blockedUrls," 个协议不安全的链接(如 javascript: / data:)")),e.escapedTags>0&&t.push("转义了 ".concat(e.escapedTags," 个不支持的标签(原文里的原始 HTML 会以文字显示)")),e.droppedAttributes>0&&t.push("剥离了 ".concat(e.droppedAttributes," 个属性(样式、事件、非白名单属性)")),e.droppedComments>0&&t.push("删除了 ".concat(e.droppedComments," 处注释/声明")),t}(g):[],[P,B]=(0,l.useState)(!1),q=null!=(t=null==y?void 0:y.issues)?t:[],H=q.length>5,_=P?q:q.slice(0,5),W=q.length-_.length,F=W+(null!=(n=null==y?void 0:y.truncatedCount)?n:0),U=(0,r.jsxs)("div",{className:"deliverablePreviewMeta",children:[o&&(0,r.jsx)(I,{strong:!0,style:{fontSize:15},children:o}),a&&(0,r.jsx)(v.A,{color:(0,k.uj)(a),children:(0,k.GC)(a,E)}),c&&(0,r.jsx)(I,{type:"secondary",style:{fontSize:12},children:"预览正文:".concat("editedMarkdown"===c?"编辑后的正文(以它为准)":"markdown"===c?"记录里的正文(markdown 字段)":"draft"===c?"生成时的草案正文(draft.markdown)":"none"===c?"没有正文":"未识别的正文来源(".concat(c,")"))}),R?(0,r.jsx)(I,{type:"secondary",style:{fontSize:12},children:"生成于 ".concat(C(R))}):null,z?(0,r.jsx)(I,{type:"secondary",style:{fontSize:12},children:"更新于 ".concat(C(z))}):null]}),G=q.length>0&&(0,r.jsxs)("div",{style:{fontSize:12.5,lineHeight:1.8},children:[_.map((e,t)=>(0,r.jsxs)("div",{children:["\xb7 ",e]},"".concat(t,"-").concat(e.slice(0,12)))),F>0&&(0,r.jsx)("div",{children:"…还有 ".concat(F," 项未列出").concat(W>0&&(null!=(i=null==y?void 0:y.truncatedCount)?i:0)>0?"(服务端只下发了 ".concat(q.length," 项)"):"")}),H&&(0,r.jsx)(x.Ay,{type:"link",size:"small",style:{paddingInline:0},onClick:()=>B(e=>!e),children:P?"收起阻断项":"展开全部 ".concat(q.length," 项")})]}),O=y?(0,r.jsx)(f.A,{style:{width:"100%"},type:y.passed?"success":"warning",showIcon:!0,message:y.passed?"交付门禁:通过":"交付门禁:阻断 ".concat(y.blockingCount," 项"),description:(0,r.jsxs)(m.A,{direction:"vertical",size:4,style:{width:"100%"},children:[(0,r.jsx)(I,{type:"secondary",style:{fontSize:12},children:"能否导出由服务端判定;此处仅供查看。"}),G]})}):(0,r.jsx)(f.A,{style:{width:"100%"},type:"info",showIcon:!0,message:"尚无交付门禁结论(生成中或尚未完成)——这不代表已通过。"});return(0,r.jsx)("div",{className:null!=N?N:"deliverablePreview",children:(0,r.jsxs)("div",{className:"deliverablePreviewStack",children:[U,(0,r.jsx)(w,{readings:T}),O,d&&(0,r.jsx)(f.A,{style:{width:"100%"},type:"warning",showIcon:!0,message:"正文过长,预览只渲染了前 ".concat((null!=p?p:0).toLocaleString()," 字(共 ").concat((null!=u?u:0).toLocaleString()," 字)"),description:"后续内容未渲染;导出物是完整正文,不受预览截断影响。"}),D.length>0&&(0,r.jsx)(f.A,{style:{width:"100%"},type:"info",showIcon:!0,message:"预览已对内容做安全处置(与导出物可能存在差异)",description:(0,r.jsx)("div",{style:{fontSize:12,lineHeight:1.7},children:D.map(e=>(0,r.jsxs)("div",{children:["\xb7 ",e]},e))})}),j&&(0,r.jsxs)(m.A,{align:"center",size:8,children:[(0,r.jsx)(h.A,{size:"small"}),(0,r.jsx)(I,{type:"secondary",children:"正在取回成稿预览(服务端渲染 + 清洗)…"})]}),!j&&A&&(0,r.jsx)(f.A,{style:{width:"100%"},type:"error",showIcon:!0,message:"取回成稿预览失败",description:(0,r.jsxs)(m.A,{direction:"vertical",size:6,children:[(0,r.jsx)(I,{style:{fontSize:12},children:A}),b&&(0,r.jsx)(x.Ay,{size:"small",onClick:b,children:"重新取回"})]})}),!j&&!A&&!L&&(0,r.jsx)(f.A,{style:{width:"100%"},type:"info",showIcon:!0,message:"这条记录还没有可预览的正文",description:"生成完成后这里会显示成稿全文;生成中的记录只有节点日志(见画布),没有正文可预览。"}),!A&&L&&(0,r.jsxs)("div",{className:"deliverablePreviewPaper",children:[(0,r.jsx)("article",{className:"deliverablePreviewBody","aria-label":"成稿预览正文",dangerouslySetInnerHTML:{__html:M}}),(0,r.jsxs)("div",{className:"deliverablePreviewEnd",children:[(0,r.jsx)(I,{type:"secondary",style:{fontSize:12},children:d?"正文到此为止(预览有截断,见上方提示;导出物是完整正文)":p&&p>0?"正文到此为止:以上是本记录的全部正文,共 ".concat(p.toLocaleString()," 字(未截断)"):"正文到此为止:以上是本记录的全部正文(未截断)"}),y&&!y.passed&&(0,r.jsx)(I,{style:{fontSize:12,color:"var(--colorWarning)"},children:"交付门禁未通过(阻断 ".concat(y.blockingCount," 项)——正文在这里结束并不代表成稿完整,缺什么见上方的阻断项清单。")})]})]}),!A&&L&&(0,r.jsx)(S,{type:"secondary",style:{fontSize:12,marginBottom:0,textAlign:"center"},children:"预览为服务端渲染结果;排版细节(字体、页眉页脚、分页)以导出物为准。"})]})})}let R=new Set(["prepare","understand","plan","blueprint"]),N=new Set(["close","deliver"]),E=new Set(["chapter","write"]);function T(e,t){let n=new Map;for(let t of e){if(void 0===t.parentId)continue;let e=n.get(t.parentId);e?e.push(t.id):n.set(t.parentId,[t.id])}let r=new Set([t]),l=[t],i=[];for(;l.length>0;){var a;let e=l.shift();for(let t of(i.push(e),null!=(a=n.get(e))?a:[]))r.has(t)||(r.add(t),l.push(t))}return i}function M(e,t){var n;let r=new Map(e.map(e=>[e.id,e])),l=r.get(t);if(!l)return;let i=T(e,t),a=e.map(e=>e.id).sort();if(R.has(l.type))return{targetNodeId:t,kind:"contaminated",affectedNodeIds:a,reason:"".concat(l.type," 承载事实 / 命名 / 标题指纹 → 11.1:跨文档污染,**不可回滚**(要么回滚,要么重新校准)"),escalate:a.length>5,rollbackable:!1};let o=(n=l.type).split(".")[0]||n;if(N.has(l.type)||N.has(o))return{targetNodeId:t,kind:"propagated",affectedNodeIds:a,reason:"".concat(l.type," 属全篇收口 / 交付层 → 预算守恒与全量判据复检波及整篇(11.1)"),escalate:a.length>5,rollbackable:!0};if(E.has(l.type)||"round"===o){let n=function(e,t,n){let r=new Set([t]),l=e.get(t);for(;l;){if(n(l))return l;let t=l.parentId;if(void 0===t||r.has(t))break;r.add(t),l=e.get(t)}}(r,t,e=>E.has(e.type)),i=n?T(e,n.id):a;return{targetNodeId:t,kind:"propagated",affectedNodeIds:i,reason:n?"".concat(l.type," 在章级锚点「").concat(n.title||n.id,"」内 → 跨章数值一致性 / 复读 / 依据对账(11.1)波及同章其余部分"):"".concat(l.type," 无章级锚点 → 按整篇保守估算(11.1)"),escalate:i.length>5,rollbackable:!0}}return{targetNodeId:t,kind:"local",affectedNodeIds:i,reason:"".concat(l.type," 属定点补丁层(11.5:确定性处理节点)→ 影响面限自身子树"),escalate:i.length>5,rollbackable:!0}}function L(e){let t=Math.max(18,Math.abs(e.y2-e.y1)/2);return"M ".concat(e.x1," ").concat(e.y1," C ").concat(e.x1," ").concat(e.y1+t,", ").concat(e.x2," ").concat(e.y2-t,", ").concat(e.x2," ").concat(e.y2)}let D={default:"canvasEdge",active:"canvasEdge canvasEdgeActive",warn:"canvasEdge canvasEdgeWarn",affected:"canvasEdge canvasEdgeAffected"},P={default:"url(#canvasArrow)",active:"url(#canvasArrowActive)",warn:"url(#canvasArrowWarn)",affected:"url(#canvasArrow)"};function B(e){let{edge:t,tone:n="default"}=e;return(0,r.jsx)("path",{className:D[n],d:L(t),markerEnd:P[n],"data-edge":"".concat(t.fromId,"->").concat(t.toId)})}function q(e){let{edges:t,width:n,height:l,toneOf:i,flowing:a,style:o}=e;return(0,r.jsxs)("svg",{className:"canvasEdgeLayer",width:Math.max(1,n),height:Math.max(1,l),viewBox:"0 0 ".concat(Math.max(1,n)," ").concat(Math.max(1,l)),"aria-hidden":"true",focusable:"false",style:o,children:[(0,r.jsxs)("defs",{children:[(0,r.jsx)("marker",{id:"canvasArrow",markerWidth:"8",markerHeight:"8",refX:"7",refY:"4",orient:"auto",markerUnits:"strokeWidth",children:(0,r.jsx)("path",{d:"M0,0 L8,4 L0,8 z",fill:"var(--canvasEdge)"})}),(0,r.jsx)("marker",{id:"canvasArrowActive",markerWidth:"8",markerHeight:"8",refX:"7",refY:"4",orient:"auto",markerUnits:"strokeWidth",children:(0,r.jsx)("path",{d:"M0,0 L8,4 L0,8 z",fill:"var(--canvasEdgeActive)"})}),(0,r.jsx)("marker",{id:"canvasArrowWarn",markerWidth:"8",markerHeight:"8",refX:"7",refY:"4",orient:"auto",markerUnits:"strokeWidth",children:(0,r.jsx)("path",{d:"M0,0 L8,4 L0,8 z",fill:"var(--canvasEdgeWarn)"})})]}),t.map(e=>{var t;return(0,r.jsxs)("g",{children:[(0,r.jsx)(B,{edge:e,tone:null!=(t=null==i?void 0:i(e))?t:"default"}),(null==a?void 0:a.has(e.id))&&(0,r.jsx)("path",{className:"canvasEdgeFlow",d:L(e),"data-flow":"".concat(e.fromId,"->").concat(e.toId)})]},e.id)})]})}let H=new Set(["completed","failed","skipped"]),_=[{key:"chars",unit:" 字"},{key:"words",unit:" 字"},{key:"noteChars",unit:" 字"},{key:"turn",unit:" 轮",prefix:"第 "},{key:"chapters",unit:" 章"},{key:"facts",unit:" 条事实"},{key:"evidence",unit:" 条证据"},{key:"issues",unit:" 个问题"},{key:"toolCalls",unit:" 次工具调用"},{key:"totalFiles",unit:" 份资料"},{key:"totalChunks",unit:" 个切片"},{key:"roundIteration",unit:" 轮修复",prefix:"第 "}];function W(e){var t;let n=null==(t=e.metrics)?void 0:t.note;return"string"==typeof n&&n.trim()?n.trim():void 0}function F(e,t){let{input:n,output:r}=function(e){let t=e=>"string"==typeof e&&e.trim()?e.trim():void 0;return{input:t(e.inputSummary),output:t(e.outputSummary)}}(e);for(let l of"dispatch"===t?[n,W(e),e.title]:[r,W(e),e.title,function(e){var t;let n=null!=(t=e.metrics)?t:{},r=[];for(let{key:e,unit:t,prefix:l}of _){let i=n[e];if(("number"==typeof i||"string"==typeof i)&&""!==i&&0!==i&&(r.push("".concat(null!=l?l:"").concat("number"==typeof i?i.toLocaleString():i).concat(t)),2===r.length))break}return r.length>0?r.join(" \xb7 "):void 0}(e)])if(l&&l.trim())return function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:24,n=e.replace(/\s+/gu," ").trim();return n.length>t?"".concat(n.slice(0,t-1),"…"):n}(l)}function U(e){let{bubbles:t,layout:n,static:l=!1}=e;return 0===t.length?null:(0,r.jsx)("div",{className:"canvasBubbleLayer",style:{width:Math.max(1,n.width),height:Math.max(1,n.height)},"aria-hidden":"true",children:t.map(e=>{let t=function(e,t){let n=t.edges.find(t=>t.fromId===e.fromId&&t.toId===e.toId);if(n)return L(n);let r=t.edges.find(t=>t.fromId===e.toId&&t.toId===e.fromId);return r?function(e){let t=L(e),n=/^M ([\d.-]+) ([\d.-]+) C ([\d.-]+) ([\d.-]+), ([\d.-]+) ([\d.-]+), ([\d.-]+) ([\d.-]+)$/u.exec(t);if(!n)return t;let[,r,l,i,a,o,s,c,d]=n;return"M ".concat(c," ").concat(d," C ").concat(o," ").concat(s,", ").concat(i," ").concat(a,", ").concat(r," ").concat(l)}(r):null}(e,n);return t?(0,r.jsx)("div",{className:l?"canvasBubble canvasBubbleStatic":"canvasBubble","data-kind":e.kind,"data-from":e.fromId,"data-to":e.toId,style:{offsetPath:'path("'.concat(t,'")'),offsetRotate:"0deg",animationDuration:"".concat(1500,"ms")},children:(0,r.jsx)("span",{className:"canvasBubbleBody",children:(0,r.jsx)("span",{className:"canvasBubbleText",children:e.label})})},e.id):null})})}var G=n(94394);function O(e){return"stage-details"===e.source}let Q=new Set(["running","repairing"]),X=new Set(["role_binding","knowledge_retrieval","file_understanding","fact_extraction","chapter_generation","llm_review","validation","reference"]);function V(e){var t;return X.has(e)?null!=(t=G.i_[e])?t:e:(0,k.z9)(e)}function J(e,t){var n;let r=null==(n=e.metrics)?void 0:n[t];return"string"==typeof r&&r.trim()?r.trim():void 0}function Y(e,t,n){var r;let l=function(e){var t;let n=null==(t=e.metrics)?void 0:t.stageType;return"string"==typeof n&&n.trim()?n.trim():e.type.split(".")[0]||"default"}(e),i=null!=(r=J(e,"stageSubtitle"))?r:J(e,"stageRoleId"),a=J(e,"note");return{id:e.id,kind:l,kindLabel:V(l),...i&&i!==e.title?{role:i}:{},title:e.title||V(l),...a?{activity:a}:{},status:e.status,..."number"==typeof e.startedAt?{startedAt:e.startedAt}:{},..."number"==typeof e.completedAt?{completedAt:e.completedAt}:{},metrics:(0,k.dB)(e.metrics,8),depth:t}}function K(e,t){if("number"==typeof e.startedAt)return Math.max(0,("number"==typeof e.completedAt?e.completedAt:t)-e.startedAt)}var Z=n(46758),$=n(99605);let{Text:ee}=d.A,et=["error","warning","info"],en={error:"#ff4d4f",warning:"#faad14",info:"#1677ff"};function er(e){let{node:t,x:n,y:i,selected:a,affected:o,flashed:s,onSelect:c,onDrag:d,t:u}=e,h=function(e){let t=[],n=[];for(let r of e.issues)(O(r)?n:t).push(r);return{problems:t,details:n,counts:{error:t.filter(e=>"error"===e.level).length,warning:t.filter(e=>"warning"===e.level).length,info:t.filter(e=>"info"===e.level).length}}}(t),p=(0,k.Jy)(t),m=(0,k.O0)(t.metrics,2),x=(0,l.useRef)(null);return(0,l.useEffect)(()=>()=>{var e;null==(e=x.current)||e.call(x)},[]),(0,r.jsxs)("div",{className:"canvasNode".concat(a?" canvasNodeSelected":"").concat(o?" canvasNodeAffected":"").concat(s?" canvasNodeFlashed":""),style:{left:n,top:i,width:k.zT,height:k.EL},role:"button",tabIndex:0,"aria-label":"节点 ".concat(t.title),"data-node-id":t.id,onClick:e=>{e.stopPropagation(),c(t)},onPointerDown:e=>{var n,r;if(0!==e.button||(e.stopPropagation(),!d||(null==(r=e.target)||null==(n=r.closest)?void 0:n.call(r,"button, a, input, textarea"))))return;let l=e.clientX,i=e.clientY,a=e.pointerId,o=!1,s={dx:0,dy:0},c=e=>{e.pointerId===a&&(s={dx:e.clientX-l,dy:e.clientY-i},!o&&4>Math.abs(s.dx)&&4>Math.abs(s.dy)||(o=!0,d(t,s.dx,s.dy,"move")))},u=e=>{if(e.pointerId===a)document.removeEventListener("pointermove",c),document.removeEventListener("pointerup",u),document.removeEventListener("pointercancel",u),x.current=null,o&&(document.addEventListener("click",e=>{e.stopPropagation(),e.preventDefault()},{capture:!0,once:!0}),d(t,s.dx,s.dy,"end"))};document.addEventListener("pointermove",c),document.addEventListener("pointerup",u),document.addEventListener("pointercancel",u),x.current=()=>{document.removeEventListener("pointermove",c),document.removeEventListener("pointerup",u),document.removeEventListener("pointercancel",u)}},onContextMenu:e=>{e.preventDefault(),e.stopPropagation()},onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),c(t))},children:[(0,r.jsxs)("div",{className:"canvasNodeHeader",children:[(0,r.jsx)("span",{className:"canvasNodeIcon","data-status":t.status,children:(0,k.kH)(t.type)}),(0,r.jsx)(ee,{ellipsis:!0,style:{flex:1,minWidth:0,fontWeight:600,fontSize:13},title:t.title,children:t.title}),et.map(e=>h.counts[e]>0&&(0,r.jsx)("span",{"data-issue-level":e,style:{flexShrink:0},children:(0,r.jsx)(Z.A,{count:h.counts[e],size:"small",color:en[e]})},e))]}),(0,r.jsxs)("div",{className:"canvasNodeMeta",children:[(0,r.jsx)(v.A,{color:(0,k.uv)(t.status),style:{marginInlineEnd:4},children:(0,k.m_)(t.status,u)}),(0,r.jsx)(ee,{type:"secondary",style:{fontSize:11},ellipsis:!0,children:(0,k.z9)(t.type)})]}),t.progress&&t.progress.total>0?(0,r.jsx)($.A,{percent:Math.round(t.progress.current/t.progress.total*100),size:"small",showInfo:!1,status:"failed"===t.status?"exception":"completed"===t.status?"success":"active",style:{marginBottom:0}}):(0,r.jsxs)("div",{className:"canvasNodeMetrics",children:[m.map(e=>(0,r.jsx)(ee,{type:"secondary",style:{fontSize:11},ellipsis:!0,children:e},e)),0===m.length&&(0,r.jsx)(ee,{type:"secondary",style:{fontSize:11},children:(0,k.uH)(p)})]})]})}var el=n(14932),ei=n(57271),ea=n(55122),eo=n(32965),es=n(44400),ec=n(99271),ed=n(37510),eu=n(48156),eh=n(63046),ep=n(64068),em=n(76830),ex=n(96651),eg=n(83914);function ev(e){let{updatedAt:t,running:n}=e,[i,a]=(0,l.useState)(()=>Date.now());if((0,l.useEffect)(()=>{if(!n)return;let e=setInterval(()=>a(Date.now()),5e3);return()=>clearInterval(e)},[n]),!n||!t)return null;let o=Math.max(0,i-t);return o<=9e4?(0,r.jsx)(el.A,{title:"记录每 30 秒刷新一次(最近一次 ".concat(new Date(t).toLocaleTimeString(),")——长阶段里画布可能几分钟没有新节点,这个信号说明进程还在跑"),children:(0,r.jsxs)(v.A,{color:"processing",children:["心跳 ",Math.round(o/1e3)," 秒前"]})}):(0,r.jsx)(el.A,{title:"最后一次进度写入是 ".concat(new Date(t).toLocaleTimeString(),"——超过 ").concat(Math.round(1.5)," 分钟没有动静,进程可能已退出(可「继续生成」续跑)"),children:(0,r.jsxs)(v.A,{color:"warning",children:["心跳已停 ",Math.floor(o/6e4)," 分钟"]})})}function ef(e){let{startedAt:t,endedAt:n,running:i}=e,[a,o]=(0,l.useState)(()=>Date.now());if((0,l.useEffect)(()=>{if(!i)return;let e=setInterval(()=>o(Date.now()),1e3);return()=>clearInterval(e)},[i]),!t)return null;let s=Math.max(0,(i?a:null!=n?n:a)-t);return(0,r.jsx)(el.A,{title:"本轮生成的整体耗时(自 ".concat(new Date(t).toLocaleTimeString()," 起").concat(i?"":",已结束",")"),children:(0,r.jsx)(v.A,{color:"default",children:"耗时 ".concat((0,k.uH)(s))})})}var ey=n(55897),ej=n(49075),eA=n(84742);let{Text:eb}=d.A;function ek(e){var t;let{row:n,now:l,onLocate:i}=e;return(0,r.jsxs)("div",{className:"canvasAgentDetail","data-node-id":n.id,children:[(0,r.jsxs)("div",{className:"canvasAgentDetailHead",children:[(0,r.jsx)("span",{className:"canvasAgentIcon","data-status":n.status,children:(0,k.Qs)(n.kind)}),(0,r.jsx)(eb,{strong:!0,style:{fontSize:12},children:n.kindLabel}),n.role&&(0,r.jsxs)(eb,{type:"secondary",style:{fontSize:12},children:["\xb7 ",n.role]})]}),(0,r.jsxs)("div",{className:"canvasAgentDetailRow",children:[(0,r.jsx)(eb,{type:"secondary",style:{fontSize:12},children:"在干什么"}),(0,r.jsx)(eb,{style:{fontSize:12},children:null!=(t=n.activity)?t:n.title})]}),n.activity&&n.title&&n.activity!==n.title&&(0,r.jsxs)("div",{className:"canvasAgentDetailRow",children:[(0,r.jsx)(eb,{type:"secondary",style:{fontSize:12},children:"对象"}),(0,r.jsx)(eb,{style:{fontSize:12},children:n.title})]}),(0,r.jsxs)("div",{className:"canvasAgentDetailRow",children:[(0,r.jsx)(eb,{type:"secondary",style:{fontSize:12},children:n.completedAt?"耗时":"已跑"}),(0,r.jsx)(eb,{style:{fontSize:12},children:(0,k.uH)(K(n,l))})]}),n.metrics.length>0&&(0,r.jsxs)("div",{className:"canvasAgentDetailRow",children:[(0,r.jsx)(eb,{type:"secondary",style:{fontSize:12},children:"指标"}),(0,r.jsx)(eb,{style:{fontSize:12},children:n.metrics.map(e=>e.text).join(" \xb7 ")})]}),(0,r.jsxs)("button",{type:"button",className:"canvasAgentLocate",onClick:()=>i(n.id),title:"在画布上定位到这条节点",children:[(0,r.jsx)(ej.A,{})," 定位到节点"]})]})}function ew(e){return e.some(e=>"failed"===e.status)?"repairing":"completed"}function eS(e){let{view:t,running:n,onLocate:i,decisions:a=[],active:o=!1}=e,[s,c]=(0,l.useState)(()=>Date.now());if((0,l.useEffect)(()=>{if(!n)return;let e=setInterval(()=>c(Date.now()),1e3);return()=>clearInterval(e)},[n]),0===t.runningTotal&&0===t.recentTotal&&0===a.length&&!o)return null;let d=t.runningTotal-t.running.length;return(0,r.jsxs)(m.A,{size:4,align:"center",wrap:!0,"data-agents":t.runningTotal,className:"canvasAgentsChips",children:[(0,r.jsx)(el.A,{title:"本稿此刻在调度哪些智能体(点图标看在干什么)",children:(0,r.jsx)(eb,{type:"secondary",style:{fontSize:12},children:"智能体调度中心"})}),(o||a.length>0)&&(0,r.jsx)(ey.A,{trigger:"click",placement:"bottomLeft",content:(0,r.jsx)("div",{className:"canvasAgentDetail",children:0===a.length?(0,r.jsx)("div",{className:"canvasAgentDetailRow",children:(0,r.jsx)(eb,{type:"secondary",style:{fontSize:12},children:"尚无来源或任务裁决回执。主智能体负责施工部署、来源与工况核定及作者协调;当前执行进度见运行节点。"})}):a.map(e=>{var t;return(0,r.jsxs)("div",{className:"canvasAgentDetailRow",children:[(0,r.jsx)(eb,{type:"secondary",style:{fontSize:12},children:e.action}),(0,r.jsx)(eb,{style:{fontSize:12},children:null!=(t=e.note)?t:e.title})]},e.id)})}),children:(0,r.jsxs)("button",{type:"button",className:"canvasAgentChip canvasAgentChipMain","data-kind":"supervisor","data-status":ew(a),title:"主智能体:核定施工部署、裁决来源与工况、协调作者任务和交付",children:[(0,r.jsx)("span",{className:"canvasAgentAvatar","data-status":ew(a),children:(0,r.jsx)("span",{className:"canvasAgentAvatarGlyph",children:(0,k.Qs)("supervisor")})}),(0,r.jsx)("span",{className:"canvasAgentRole","data-role":"main",children:"主"})]})}),t.running.map(e=>{var t;return(0,r.jsx)(ey.A,{trigger:"click",placement:"bottomLeft",content:(0,r.jsx)(ek,{row:e,now:s,onLocate:i}),children:(0,r.jsxs)("button",{type:"button",className:"canvasAgentChip","data-node-id":e.id,"data-kind":e.kind,"data-status":e.status,title:"".concat(e.kindLabel).concat(e.role?" \xb7 ".concat(e.role):"",":").concat(null!=(t=e.activity)?t:e.title),children:[(0,r.jsx)("span",{className:"canvasAgentAvatar","data-status":e.status,children:(0,r.jsx)("span",{className:"canvasAgentAvatarGlyph",children:(0,k.Qs)(e.kind)})}),(0,r.jsx)("span",{className:"canvasAgentRole","data-role":"sub",title:"子智能体(执行具体环节)",children:"子"})]})},e.id)}),d>0&&(0,r.jsx)(el.A,{title:"另有 ".concat(d," 个在跑(画布上可逐个查看)"),children:(0,r.jsxs)(eb,{type:"secondary",style:{fontSize:12},children:["+",d]})}),t.recent.length>0&&(0,r.jsx)(el.A,{title:t.recent.map(e=>"".concat(e.kindLabel,":").concat(e.title,"(已完成)")).join("\n"),children:(0,r.jsxs)(eb,{type:"secondary",style:{fontSize:12},children:[(0,r.jsx)(eA.A,{})," 刚完成 ",t.recentTotal]})})]})}var eI=n(34052),eC=n(84253),ez=n(96538);function eR(e){let{reports:t,deliveryReadings:n,t:i}=e,[a,o]=(0,l.useState)(!1),s=(e,t)=>{let n=null==i?void 0:i(e);return n&&n!==e?n:t},c=(0,l.useSyncExternalStore)(j.p5,j.dH,j.dH),d=c?function(e,t){var n,r;let{receipt:l}=e,i=(e,n,r,l)=>t(e,n).replace("{count}",String(r))+(l?":".concat(l):""),a=[];"review"===l.exportPurpose&&a.push({key:"review-purpose",tone:"info",text:"审阅稿:验收结论保持原状态,独立问题报告与正文版本绑定"}),l.issuesReport&&a.push({key:"review-report",tone:"info",text:"独立问题报告:".concat(l.issuesReport.id.slice(0,12),";正文 SHA256:").concat(l.issuesReport.bodySha256)}),"mismatch"===l.gateBinding?a.push({key:"binding-mismatch",tone:"error",text:t("records.receiptBindingMismatch","正文与门禁指纹不匹配:放行依据不是这份正文(收口后被编辑/替换过)")}):"absent"===l.gateBinding&&a.push({key:"binding-absent",tone:"warning",text:t("records.receiptBindingAbsent","门禁未绑定正文指纹:无法核对放行依据是否就是这份正文")}),l.gateIssues&&l.gateIssues.length>0&&a.push({key:"gate-issues",tone:"error",text:i("records.receiptGateIssues","门禁阻断清单 {count} 项",l.gateIssues.length,l.gateIssues[0])}),l.contentIssues&&l.contentIssues.length>0&&a.push({key:"content-issues",tone:"warning",text:i("records.receiptContentIssues","内容问题 {count} 条",l.contentIssues.length,l.contentIssues[0])});let o=null!=(r=null==(n=l.figureInline)?void 0:n.failed)?r:[];return o.length>0&&a.push({key:"figure-inline",tone:"warning",text:i("records.receiptFigureFailures","图件未内联 {count} 张",o.length,o[0])}),l.renderAudit&&l.renderAudit.blockerCount>0&&a.push({key:"render-blockers",tone:"error",text:i("records.receiptRenderBlockers","渲染审计:源层结构缺陷 {count} 项",l.renderAudit.blockerCount)}),l.renderAudit&&l.renderAudit.notices.length>0&&a.push({key:"render-notices",tone:"warning",text:i("records.receiptRenderNotices","渲染审计告警 {count} 条",l.renderAudit.notices.length,l.renderAudit.notices[0])}),l.templateWarning&&a.push({key:"template-warning",tone:"warning",text:"".concat(t("records.receiptTemplateWarning","模板占位符缺失,已回退:")).concat(l.templateWarning)}),l.pageLimit&&a.push({key:"page-limit",tone:"warning",text:l.pageLimit}),"number"==typeof l.pdfPageCount&&a.push({key:"pdf-pages",tone:"info",text:t("records.receiptPdfPages","PDF 共 {count} 页").replace("{count}",String(l.pdfPageCount))}),a}(c,s):[],u=d.filter(e=>"info"!==e.tone),h=d.length>0;if(0===t.length&&!n&&0===u.length&&!(null==c?void 0:c.receipt.issuesReport)&&(null==c?void 0:c.receipt.exportPurpose)!=="review")return null;let p=[...t].sort((e,t)=>t.exportedAt-e.exportedAt),m=p.find(e=>{var t,n;return(null!=(n=null==(t=e.gateChecklist)?void 0:t.items.length)?n:0)>0});return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(el.A,{title:s("records.reportTitle","导出闭环报告"),children:(0,r.jsxs)(x.Ay,{size:"small",icon:(0,r.jsx)(em.A,{}),onClick:()=>o(!0),children:[(null==n?void 0:n.contractQuality)?"七维诊断".concat(n.contractQualityStale?"(历史)":n.contractQuality.score.deliveryReady?"(待验收)":"(待修验)"):s("records.reportEntry","导出报告"),t.length>0&&(0,r.jsx)("span",{className:"ml-1 text-[var(--colorTextTertiary)]",children:t.length}),u.length>0&&(0,r.jsx)(v.A,{color:u.some(e=>"error"===e.tone)?"error":"warning",className:"m-0 ml-1 border-0",children:s("records.receiptBadge","本次导出 {count} 项提醒").replace("{count}",String(u.length))})]})}),(0,r.jsxs)(eI.A,{title:s("records.reportTitle","导出闭环报告"),placement:"right",size:"default",open:a,onClose:()=>o(!1),styles:{body:{padding:16}},children:[h&&c&&(0,r.jsxs)("div",{className:"mb-3 rounded-xl border px-3 py-2.5 text-xs ".concat(u.length>0?"border-[var(--colorWarning)] bg-[var(--colorWarningBg)]":"border-[var(--borderColor)] bg-[var(--colorFillAlter)]"),children:[(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,r.jsx)("span",{className:"font-semibold",children:s("records.receiptTitle","最近一次导出回执")}),(0,r.jsx)(v.A,{color:"blue",className:"m-0 border-0 font-semibold",children:c.format.toUpperCase()}),(0,r.jsx)("span",{className:"text-[var(--colorTextTertiary)]",children:new Date(c.at).toLocaleString()}),c.filename&&(0,r.jsx)("span",{className:"break-all text-[var(--colorTextTertiary)]",children:c.filename})]}),c.receipt.issuesReport&&(0,r.jsx)("a",{className:"text-[var(--colorPrimary)] underline",href:(0,j.Es)(c,c.receipt.issuesReport),children:"下载本份正文的独立问题报告"}),(0,r.jsx)("div",{className:"mt-2 flex flex-col gap-1.5",children:d.map(e=>(0,r.jsx)("div",{className:"error"===e.tone?"text-[var(--colorError)]":"warning"===e.tone?"text-[var(--colorWarning)]":"text-[var(--colorTextSecondary)]",children:e.text},e.key))})]}),n&&(0,r.jsxs)("div",{className:"mb-3 flex flex-col gap-2 rounded-xl border border-[var(--borderColor)] bg-[var(--colorFillAlter)] px-3 py-2.5 text-xs",children:[n.contractQuality&&(0,r.jsx)(w,{readings:n}),n.netChars&&(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,r.jsx)("span",{className:"text-[var(--colorTextSecondary)]",children:s("records.netCharsLabel","修复链净增字数")}),(0,r.jsxs)("span",{className:"font-semibold",children:[n.netChars.delta>0?"+":"",n.netChars.delta]}),(0,r.jsxs)("span",{className:"text-[var(--colorTextSecondary)]",children:["(",n.netChars.before," → ",n.netChars.after,",",s("records.netCharsRatio","占原稿")," ",(100*n.netChars.ratio).toFixed(1),"%)"]}),n.netChars.ratio>.05&&(0,r.jsx)(el.A,{title:s("records.netCharsWarn",'目标 ≤5%:净增越大,"分是修出来的"成分越高——首过写作的缺口被修复链补上了'),children:(0,r.jsx)(v.A,{color:"warning",className:"m-0 border-0",children:s("records.netCharsOver","超目标")})})]}),(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,r.jsx)("span",{className:"text-[var(--colorTextSecondary)]",children:s("records.reviewReportLabel","交付三件套报告")}),(0,r.jsx)("a",{href:"/api/documents/generated/".concat(encodeURIComponent(n.docId),"/report").concat(n.projectRoot?"?projectRoot=".concat(encodeURIComponent(n.projectRoot),"&download=1"):"?download=1"),className:"text-[var(--colorPrimary)] underline",children:s("records.reviewReportDownload","下载 .md")}),(0,r.jsx)("a",{href:"/api/documents/generated/".concat(encodeURIComponent(n.docId),"/report").concat(n.projectRoot?"?projectRoot=".concat(encodeURIComponent(n.projectRoot)):""),target:"_blank",rel:"noreferrer",className:"text-[var(--colorPrimary)] underline",children:s("records.reviewReportView","在线查看")}),(0,r.jsx)("span",{className:"text-[var(--colorTextTertiary)]",children:s("records.reviewReportHint","未跑到终门禁的记录没有报告(打开会说明原因)")})]})]}),0===p.length?(0,r.jsx)(eC.A,{image:eC.A.PRESENTED_IMAGE_SIMPLE,description:s("records.reportEmpty","还没有导出记录")}):(0,r.jsxs)("div",{className:"flex flex-col gap-3",children:[p.map((e,t)=>(0,r.jsxs)("div",{className:"rounded-xl border border-[var(--borderColor)] bg-[var(--colorFillAlter)] px-3 py-2.5 text-xs",children:[(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,r.jsx)(v.A,{color:"blue",className:"m-0 border-0 font-semibold",children:e.format.toUpperCase()}),(0,r.jsx)("span",{className:"text-[var(--colorTextSecondary)]",children:new Date(e.exportedAt).toLocaleString()}),"review"===e.exportPurpose&&(0,r.jsx)(v.A,{children:"审阅稿"}),e.reviewReport&&(0,r.jsx)("a",{className:"text-[var(--colorPrimary)] underline",href:(0,j.Es)({documentId:null==n?void 0:n.docId,projectRoot:null==n?void 0:n.projectRoot},e.reviewReport),children:"下载独立问题报告"})]}),(0,r.jsxs)("div",{className:"mt-1.5 flex flex-wrap items-center gap-x-3 gap-y-1 text-[var(--colorTextSecondary)]",children:[void 0!==e.durationMs&&(0,r.jsxs)("span",{children:[s("records.reportDuration","总用时")," ",(0,ez.a)(e.durationMs,{unit:"ms",style:"fine-decimal"})]}),void 0!==e.repairedCount&&(0,r.jsxs)("span",{children:[s("records.reportRepaired","修复")," ",e.repairedCount,void 0!==e.blockingCount?"(".concat(s("records.reportBlocking","质量诊断快照阻断")," ").concat(e.blockingCount,")"):""]}),e.ruleSummary&&e.ruleSummary.length>0&&(0,r.jsxs)("span",{children:[s("records.reportRules","规则")," ",e.ruleSummary.length]}),!1===e.gatePassed&&(0,r.jsxs)(v.A,{color:"error",className:"m-0 border-0",children:[s("records.reportGateBlocked","非交付物"),void 0!==e.gateIssueCount&&e.gateIssueCount>0?" \xb7 ".concat(s("records.reportGateBlockedCount","门禁阻断")," ").concat(e.gateIssueCount," ").concat(s("records.reportGateBlockedUnit","项")):" \xb7 ".concat(s("records.reportGateBlockedUnknown","阻断数未记录(清单缺失)"))]}),e.healthAlerts&&e.healthAlerts.length>0&&(0,r.jsxs)(v.A,{color:"warning",className:"m-0 border-0",children:[s("records.reportHealthAlerts","健康告警")," ",e.healthAlerts.length]})]})]},"".concat(e.exportedAt,"-").concat(t))),(null==m?void 0:m.gateChecklist)&&(0,r.jsxs)("div",{className:"rounded-xl border border-[var(--colorWarning)] bg-[var(--colorWarningBg)] px-3 py-2.5",children:[(0,r.jsxs)("div",{className:"text-xs font-semibold text-[var(--colorWarning)]",children:[s("records.reportChecklistTitle","最近一次非交付物导出的未收敛项"),"(",s("records.reportChecklistTotal","共 {count} 项").replace("{count}",String(m.gateChecklist.total)),")"]}),(0,r.jsx)("div",{className:"mt-2 flex flex-col gap-2",children:m.gateChecklist.items.map(e=>(0,r.jsxs)("div",{className:"text-xs",children:[(0,r.jsx)("div",{className:"whitespace-pre-wrap text-[var(--colorText)]",children:"".concat(e.index,".【").concat(e.category,"】").concat(e.problem)}),(0,r.jsxs)("div",{className:"text-[var(--colorTextSecondary)]",children:[e.repairPath,e.detectorId?"|".concat(e.detectorId):""]})]},e.index))})]})]})]})]})}let{Text:eN}=d.A,eE={connecting:{text:"通道连接中",color:"default"},open:{text:"事件通道已连",color:"success"},error:{text:"通道已断(改用增量补差)",color:"warning"},closed:{text:"通道已关闭",color:"default"}};function eT(e){let{title:t,status:n,updatedAt:l,wordCount:i,nodeCount:a,visibleCount:o,hiddenCount:s,degraded:c,skills:d,gate:u,connection:h,lastSeq:p,zoom:g,depth:j,following:A,followStatus:b,generating:w,resumable:S,exporting:I,nonDeliverableExport:C,onZoomIn:z,onZoomOut:R,onZoomReset:N,onFit:E,onDepthChange:T,onToggleFollow:M,onContinue:L,onPause:D,onResume:P,onAbort:B,onExport:q,exportReports:H,deliveryReadings:_,previewOpen:W,onTogglePreview:F,hasNodeOffsets:U,onResetNodeLayout:G,agents:O,onLocateAgent:Q,supervisorDecisions:X,agentsActive:V,startedAt:J,t:Y,collapsed:K=!1,onToggleCollapsed:Z}=e,$=w&&!S,ee=(0,r.jsxs)("div",{style:{fontSize:12,lineHeight:1.7},children:[(0,r.jsx)("div",{children:"导出当前真实正文供审阅,并下载独立问题报告;不会自动补齐缺章或签发交付验收。"}),(0,r.jsx)("div",{children:"审阅身份标在文件名和回执中,正文不添加诊断、封面或水印。"})]});return K?(0,r.jsx)("div",{className:"canvasToolbar canvasToolbarCollapsed",children:(0,r.jsx)(el.A,{title:"展开画布工具条(视图缩放 / 生成控制 / 审阅导出)",placement:"bottomLeft",children:(0,r.jsxs)("button",{type:"button",className:"canvasToolbarBubble","aria-expanded":!1,onClick:()=>null==Z?void 0:Z(!1),children:[(0,r.jsx)(es.A,{}),n&&(0,r.jsx)(v.A,{color:(0,k.uj)(n),className:"m-0",children:(0,k.GC)(n,Y)}),(0,r.jsx)(ev,{updatedAt:l,running:$}),u&&!u.passed&&(0,r.jsx)(v.A,{color:"error",className:"m-0",children:"门禁 ".concat(u.blockingCount)}),C?(0,r.jsx)(v.A,{color:"processing",className:"m-0",children:"已导出审阅稿"}):null]})})}):(0,r.jsxs)("div",{className:"canvasToolbar",children:[(0,r.jsxs)(m.A,{wrap:!0,size:8,align:"center",style:{flex:1,minWidth:0},children:[(0,r.jsx)(eN,{strong:!0,style:{fontSize:14},ellipsis:!0,title:t,children:t}),n&&(0,r.jsx)(v.A,{color:(0,k.uj)(n),children:(0,k.GC)(n,Y)}),(0,r.jsxs)(eN,{type:"secondary",style:{fontSize:12},children:[void 0!==i?"".concat(i.toLocaleString()," 字"):""," 已接收 ".concat(a," 个节点,显示 ").concat(o," 个"),s>0?"(未显示 ".concat(s,")"):"",l?" 更新于 ".concat(new Date(l).toLocaleTimeString()):""]}),(0,r.jsx)(ev,{updatedAt:l,running:$}),(0,r.jsx)(ef,{startedAt:J,endedAt:l,running:$}),O&&(0,r.jsx)(eS,{view:O,running:O.runningTotal>0,onLocate:null!=Q?Q:()=>{},...X?{decisions:X}:{},active:!!V}),(0,r.jsx)(el.A,{title:"通道游标 seq=".concat(null!=p?p:0,"(断线重连用它补发;节点增量用日志时间 t)"),children:(0,r.jsx)(v.A,{color:eE[h].color,children:eE[h].text})}),d.hits.length>0&&(0,r.jsx)(el.A,{title:d.hits.map(e=>"".concat(e.title,"(").concat(e.skillId,")")).join("、"),children:(0,r.jsxs)(v.A,{color:"blue",children:["技能命中 ",d.hits.length]})}),u&&(0,r.jsx)(el.A,{title:u.issues.length>0?u.issues.join("\n"):"服务端门禁结论:通过",children:(0,r.jsx)(v.A,{color:u.passed?"success":"error",children:u.passed?"门禁:通过":"门禁:阻断 ".concat(u.blockingCount," 项")})})]}),(0,r.jsxs)(m.A,{wrap:!0,size:6,align:"center",children:[(0,r.jsx)(x.Ay,{size:"small",icon:(0,r.jsx)(ec.A,{}),onClick:R,"aria-label":"缩小"}),(0,r.jsxs)(eN,{type:"secondary",style:{fontSize:12,width:44,textAlign:"center"},children:[Math.round(100*g),"%"]}),(0,r.jsx)(x.Ay,{size:"small",icon:(0,r.jsx)(ed.A,{}),onClick:z,"aria-label":"放大"}),(0,r.jsx)(el.A,{title:"恢复到 100% 并回到原点",children:(0,r.jsx)(x.Ay,{size:"small",icon:(0,r.jsx)(y.A,{}),onClick:N,"aria-label":"重置视图"})}),(0,r.jsx)(el.A,{title:U?"把拖过的节点放回自动排布(手工摆放的是**偏移**,清空即恢复)":"没有手工拖过的节点:布局就是自动排布的",children:(0,r.jsx)(x.Ay,{size:"small",disabled:!U,onClick:G,children:"恢复布局"})}),(0,r.jsx)(el.A,{title:"适应窗口(按内容包围盒缩放)",children:(0,r.jsx)(x.Ay,{size:"small",onClick:E,children:"适应"})}),(0,r.jsx)(ei.A,{size:"small",value:j,style:{width:108},onChange:e=>T(e),options:[{value:1,label:"只看 1 层"},{value:2,label:"看 2 层"},{value:3,label:"看 3 层"},{value:"all",label:"全部层"}]}),(0,r.jsx)(el.A,{title:null!=b?b:"跟随最新:生成中新出现的节点自动定位(关掉就不再打扰你的视角)",children:(0,r.jsx)(x.Ay,{size:"small",type:A?"primary":"default",onClick:M,children:A?(null==b?void 0:b.startsWith("跟随暂停"))?"跟随暂停中":"跟随中":"跟随最新"})}),(0,r.jsx)(ea.A,{type:"vertical"}),$&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(el.A,{title:"立即取消模型调用并保存已完成正文,停稳后可继续",children:(0,r.jsx)(x.Ay,{size:"small",icon:(0,r.jsx)(eu.A,{}),onClick:D,children:"暂停"})}),(0,r.jsx)(eo.A,{title:"中止生成",description:"确定中止本次生成?已生成的章节会保留,可从中断处继续。",okText:"中止",cancelText:"取消",okButtonProps:{danger:!0},onConfirm:B,children:(0,r.jsx)(x.Ay,{size:"small",danger:!0,icon:(0,r.jsx)(eh.A,{}),children:"中止"})})]}),!$&&S&&(0,r.jsx)(x.Ay,{size:"small",type:"primary",icon:(0,r.jsx)(ep.A,{}),onClick:L,children:"继续生成"}),!$&&!S&&"paused"===n&&(0,r.jsx)(x.Ay,{size:"small",type:"primary",icon:(0,r.jsx)(ep.A,{}),onClick:P,children:"从暂停处继续"}),(0,r.jsx)(ea.A,{type:"vertical"}),(0,r.jsx)(el.A,{title:ee,children:(0,r.jsxs)(m.A,{size:4,children:[(0,r.jsx)(eN,{type:"secondary",children:"审阅导出"}),[{key:"markdown",label:"MD"},{key:"html",label:"HTML"},{key:"docx",label:"DOCX"},{key:"pdf",label:"PDF",primary:!0}].map(e=>(0,r.jsx)(x.Ay,{size:"small",type:e.primary?"primary":"default",icon:"markdown"===e.key?(0,r.jsx)(em.A,{}):void 0,loading:I===e.key,disabled:null!==I&&I!==e.key,onClick:()=>q(e.key),children:e.label},e.key))]})}),(0,r.jsx)(eR,{reports:null!=H?H:[],..._?{deliveryReadings:_}:{},...Y?{t:Y}:{}}),(0,r.jsx)(el.A,{title:"成稿预览(服务端渲染并清洗后的全文;只读,不提供导出)",children:(0,r.jsx)(x.Ay,{size:"small",type:W?"primary":"default",onClick:F,children:"成稿预览"})}),(0,r.jsx)(el.A,{title:"收起工具条(把画布还给内容;状态与门禁仍留在气泡上)",children:(0,r.jsx)(x.Ay,{size:"small",icon:(0,r.jsx)(ex.A,{}),"aria-label":"收起工具条",onClick:()=>null==Z?void 0:Z(!0)})})]}),C&&(0,r.jsx)(f.A,{style:{width:"100%",marginTop:8},type:"info",showIcon:!0,message:"已导出审阅稿与独立问题报告",description:(0,r.jsxs)("div",{style:{whiteSpace:"pre-wrap",fontSize:12},children:[(0,r.jsx)("div",{children:"正文保留实际内容;审阅导出不代表交付验收通过。"}),C.count>0&&(0,r.jsxs)("div",{style:{marginTop:4},children:["阻断项(".concat(C.count,"):"),C.issues.slice(0,5).map((e,t)=>(0,r.jsxs)("div",{children:["\xb7 ",e]},t)),C.count>5&&(0,r.jsx)("div",{children:"…还有 ".concat(C.count-5," 项")})]})]})}),c.length>0&&(0,r.jsx)(f.A,{style:{width:"100%",marginTop:8},type:"warning",showIcon:!0,message:"画布显示有取整(下列内容本次未下发;聚合值与节点信息不受影响)",description:(0,r.jsx)("div",{style:{fontSize:12},children:c.map((e,t)=>(0,r.jsxs)("div",{children:["\xb7 ",e]},t))})}),0===a&&w&&(0,r.jsx)(f.A,{style:{width:"100%",marginTop:8},type:"info",showIcon:!0,icon:(0,r.jsx)(eg.A,{}),message:"还没有节点日志:生成侧尚未写入第一个节点(节点日志是唯一真相源,画布不伪造占位节点)"})]})}var eM=n(57481),eL=n(28629),eD=n(52057),eP=n(8665),eB=n(38332),eq=n(7576),eH=n(58569),e_=n(76506),eW=n(45042);let{Paragraph:eF,Text:eU}=d.A,eG={local:{text:"影响面:局部",color:"blue",hint:"改动只落在该节点自身子树:定点补丁即可。"},propagated:{text:"影响面:传播",color:"orange",hint:'改动会沿依赖传播到同章其余部分:按 11.1,走"变更传播"而不是重跑整个节点。'},contaminated:{text:"影响面:事实/命名类",color:"red",hint:"该节点持有事实 / 命名 / 标题指纹:按 11.1,**要么回滚、要么重新校准**,不能当普通改动提交。"}},eO={error:{color:"red",text:"错误"},warning:{color:"orange",text:"警告"},info:{color:"blue",text:"提示"}};function eQ(e){var t,n,i,a,o,s,c,d,u,h,p;let{node:g,impact:f,flatNodes:y,highlighted:j,generating:A,repairPreview:b,onFocusNode:w,onRequestRepair:S,onClose:I,onDraftRepairNote:C,onCancelRepairPreview:z,onMention:R,onLocate:N,onPause:E,onResume:T,nodeEvents:M,t:L,onRunRepair:D,onConfirmRepair:P,onRollbackRepair:B,repairRun:q,defaultRepairNote:H}=e,_="skill.load"===g.type||"string"==typeof g.metrics.skillId,W=new Map(y.map(e=>[e.id,e])),F=(0,k.Jy)(g),U=(0,k.dB)(g.metrics,24),G=g.issues.filter(e=>!O(e)),Q=g.issues.filter(e=>O(e)),X=G.filter(e=>"error"===e.level).length,V=f?(0,r.jsxs)(m.A,{direction:"vertical",size:8,style:{width:"100%"},children:[(0,r.jsxs)(m.A,{wrap:!0,children:[(0,r.jsx)(v.A,{color:eG[f.kind].color,children:eG[f.kind].text}),(0,r.jsx)(v.A,{color:f.rollbackable?"default":"red",children:f.rollbackable?"可回滚":"需回滚或重新校准"}),(0,r.jsx)(v.A,{color:f.escalate?"red":"default",children:"波及 ".concat(f.affectedNodeIds.length," 节点").concat(f.escalate?"(超阈值)":"")})]}),(0,r.jsx)(eU,{type:"secondary",style:{fontSize:12},children:f.reason}),(0,r.jsx)(eU,{type:"secondary",style:{fontSize:12},children:eG[f.kind].hint}),f.escalate&&(0,r.jsx)(v.A,{color:"red",children:"影响面超出阈值:该改动需**人工确认**后才能提交(自动留痕不再适用)"}),(0,r.jsx)(eB.A,{size:"small",header:(0,r.jsx)(eU,{type:"secondary",style:{fontSize:12},children:"波及节点(点击定位)"}),dataSource:f.affectedNodeIds,renderItem:e=>{let t=W.get(e);return(0,r.jsx)(eB.A.Item,{style:{paddingBlock:4},children:(0,r.jsx)(x.Ay,{type:"link",size:"small",style:{padding:0,height:"auto"},onClick:()=>w(e),children:t?"".concat(t.title,"(").concat((0,k.z9)(t.type),")"):"未知节点 ".concat(e)})})}})]}):(0,r.jsxs)(m.A,{direction:"vertical",size:6,children:[(0,r.jsx)(eC.A,{image:eC.A.PRESENTED_IMAGE_SIMPLE,description:"该节点没有预计算的影响面"}),(0,r.jsx)(eU,{type:"secondary",style:{fontSize:12},children:"聚合接口只对**有问题的节点**与**修复节点**预计算影响面(首屏不做 O(n\xb2))。 这里可以按需触发一次修复请求,服务端会在事务前给出权威判定——**本面板不冒充结论**。"}),(0,r.jsx)(x.Ay,{size:"small",disabled:!S,onClick:()=>null==S?void 0:S(g),children:"按需评估影响面(走修复请求)"})]}),[J,Y]=(0,l.useState)("");(0,l.useEffect)(()=>{Y(null!=H?H:"")},[H,g.id]);let K=b&&b.nodeId===g.id?(0,r.jsx)("div",{className:"nodeInfoRepair",children:(0,r.jsxs)(m.A,{direction:"vertical",size:6,style:{width:"100%"},children:[(0,r.jsxs)(m.A,{wrap:!0,size:6,children:[(0,r.jsx)(eU,{strong:!0,style:{fontSize:13},children:"修复影响面预览"}),(0,r.jsx)(v.A,{color:eG[b.impact.kind].color,children:eG[b.impact.kind].text}),(0,r.jsx)(v.A,{color:b.impact.rollbackable?"default":"red",children:b.impact.rollbackable?"可回滚":"不可回滚"})]}),(0,r.jsxs)(eU,{type:"secondary",style:{fontSize:12},children:["波及 ".concat(b.impact.affectedNodeIds.length," 个节点").concat(b.impact.escalate?",超出阈值需人工确认":"","。"),b.impact.reason]}),!b.impact.rollbackable&&(0,r.jsx)(eU,{style:{fontSize:12,color:"var(--colorError)"},children:"11.1:污染类改动**要么回滚、要么重新校准**,不能当普通改动提交。"}),(0,r.jsxs)(m.A,{wrap:!0,size:6,children:[(0,r.jsx)(x.Ay,{size:"small",onClick:C,children:"把修复意图写进输入框"}),(0,r.jsx)(x.Ay,{size:"small",type:"text",onClick:z,children:"收起"})]}),D&&(0,r.jsxs)("div",{className:"nodeInfoRepairRun","data-repair-node":g.id,children:[(0,r.jsx)(eU,{type:"secondary",style:{fontSize:12},children:"修复说明(会逐字记进修复请求;服务端按它定位与归因)"}),(0,r.jsx)(eq.A.TextArea,{size:"small",autoSize:{minRows:2,maxRows:4},value:J,onChange:e=>Y(e.target.value),placeholder:"例如:这一节的开挖深度与资料不符,应按图纸标注 5.15m 改写"}),(0,r.jsxs)(m.A,{wrap:!0,size:6,children:[(0,r.jsx)(x.Ay,{size:"small",type:"primary",loading:(null==q?void 0:q.phase)==="creating"&&q.nodeId===g.id,disabled:0===J.trim().length,onClick:()=>D(J.trim()),children:"发起修复(@本节点)"}),(null==q?void 0:q.nodeId)===g.id&&"confirmable"===q.phase&&P&&!(q.needsLocalization&&(null!=(o=null==(t=q.candidates)?void 0:t.length)?o:0)>0)&&(0,r.jsx)(x.Ay,{size:"small",danger:!0,onClick:()=>P(),children:"确认执行变更事务"}),(null==q?void 0:q.nodeId)===g.id&&"executed"===q.phase&&q.requestId&&B&&(0,r.jsx)(x.Ay,{size:"small",onClick:B,children:"回滚这次修复"})]}),(null==q?void 0:q.nodeId)===g.id&&"creating"!==q.phase&&(0,r.jsxs)("div",{className:"nodeInfoRepairResult",children:["error"===q.phase&&(0,r.jsx)(eU,{style:{fontSize:12,color:"var(--colorError)"},children:"修复请求未建立:".concat(null!=(s=q.message)?s:"")}),"confirmable"===q.phase&&(0,r.jsx)(eU,{type:"secondary",style:{fontSize:12},children:"请求已建立(".concat(null!=(c=q.requestId)?c:"",")").concat(q.attribution?";归因:".concat(q.attribution):"","。")+(q.needsLocalization&&(null!=(d=null==(n=q.candidates)?void 0:n.length)?d:0)>0?"这句话该改哪个节点由你定:下面列出系统定位到的候选,点一个才会执行(缺定位服务端一律拒绝)。":'点「确认执行变更事务」后才会真的改正文——这是"必须人工确认"的落点。')}),"confirmable"===q.phase&&q.needsLocalization&&(null!=(u=null==(i=q.candidates)?void 0:i.length)?u:0)>0&&(0,r.jsx)(m.A,{direction:"vertical",size:4,style:{width:"100%"},children:q.candidates.map(e=>(0,r.jsx)("div",{"data-testid":"repair-location-candidate",children:(0,r.jsxs)(m.A,{size:6,wrap:!0,children:[(0,r.jsx)(v.A,{children:"匹配 ".concat(e.score.toFixed(2))}),(0,r.jsx)(eU,{style:{fontSize:12},children:e.excerpt.slice(0,60)}),P&&(0,r.jsx)(x.Ay,{size:"small",type:"primary",onClick:()=>P(e.nodeId),children:"定位到该节点并执行"})]})},e.nodeId))}),"executed"===q.phase&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(m.A,{wrap:!0,size:6,children:[(0,r.jsx)(v.A,{color:"applied"===q.outcome?"green":"rolled-back"===q.outcome?"orange":"red",children:"执行结果:".concat(null!=(h=q.outcome)?h:"未执行")}),q.attribution&&(0,r.jsx)(v.A,{children:"归因:".concat(q.attribution)}),void 0!==q.restoredChars&&(0,r.jsx)(v.A,{children:"恢复 ".concat(q.restoredChars," 字")})]}),q.notExecutedReason&&(0,r.jsx)(eU,{style:{fontSize:12,color:"var(--colorError)"},children:q.notExecutedReason})]})]})]})]})}):null;return(0,r.jsxs)("div",{className:"nodeInfoPanel","data-node-id":g.id,children:[(0,r.jsxs)("div",{className:"nodeInfoHeader",children:[(0,r.jsx)("span",{className:"nodeInfoHeaderIcon",children:(0,k.kH)(g.type)}),(0,r.jsx)(eU,{strong:!0,ellipsis:!0,style:{flex:1,minWidth:0,fontSize:14},title:g.title,children:g.title}),g.unknownType&&(0,r.jsx)(v.A,{children:"未知类型"}),(0,r.jsx)(v.A,{color:(0,k.uv)(g.status),children:(0,k.m_)(g.status,L)}),X>0&&(0,r.jsx)(v.A,{color:"red",children:"".concat(X," 个错误")}),A&&"running"===g.status&&(0,r.jsx)(eU,{type:"secondary",style:{fontSize:11},children:"运行中"}),I&&(0,r.jsx)(el.A,{title:"关闭(Esc)",children:(0,r.jsx)(x.Ay,{type:"text",size:"small",className:"nodeInfoClose","aria-label":"关闭信息卡片",onClick:I,children:(0,r.jsx)(eW.A,{})})})]}),(0,r.jsxs)("div",{className:"nodeInfoActions",children:[(0,r.jsx)(x.Ay,{size:"small",onClick:()=>null==R?void 0:R(g),children:"@ 到对话框"}),(0,r.jsx)(x.Ay,{size:"small",onClick:()=>null==N?void 0:N(g),children:"在画布中定位"}),(0,r.jsx)(x.Ay,{size:"small",danger:X>0,onClick:()=>null==S?void 0:S(g),children:"请求修复(预览影响面)"}),A&&"running"===g.status&&E&&(0,r.jsx)(x.Ay,{size:"small",onClick:E,children:"暂停"}),"paused"===g.status&&T&&(0,r.jsx)(x.Ay,{size:"small",onClick:T,children:"继续生成"})]}),K,(0,r.jsx)(eH.A,{size:"small",items:[{key:"overview",label:"概览",children:(0,r.jsxs)(e_.A,{size:"small",column:1,bordered:!0,children:[(0,r.jsx)(e_.A.Item,{label:"状态",children:(0,r.jsx)(v.A,{color:(0,k.uv)(g.status),children:(0,k.m_)(g.status,L)})}),(0,r.jsxs)(e_.A.Item,{label:"类型",children:[(0,k.z9)(g.type),g.unknownType?"(闭集外的类型,按通用卡片渲染)":""]}),(0,r.jsx)(e_.A.Item,{label:"节点 id",children:(0,r.jsx)(eF,{copyable:{text:g.id},style:{margin:0,fontSize:12},children:g.id})}),(0,r.jsx)(e_.A.Item,{label:"稳定序号",children:g.seq}),(0,r.jsx)(e_.A.Item,{label:"父节点",children:g.parentId?(0,r.jsx)(x.Ay,{type:"link",size:"small",style:{padding:0,height:"auto"},onClick:()=>w(g.parentId),children:null!=(p=null==(a=W.get(g.parentId))?void 0:a.title)?p:g.parentId}):"(根节点)"}),(0,r.jsxs)(e_.A.Item,{label:"耗时",children:[(0,k.uH)(F),"running"===g.status?"(运行中)":""]}),(0,r.jsx)(e_.A.Item,{label:"进度",children:g.progress?"".concat(g.progress.label||"进度",":").concat(g.progress.current,"/").concat(g.progress.total):"—"}),(0,r.jsxs)(e_.A.Item,{label:"子节点数",children:[g.children.length,j?"(当前处于影响面高亮)":""]}),(0,r.jsxs)(e_.A.Item,{label:"开始 / 完成",children:[g.startedAt?new Date(g.startedAt).toLocaleString():"—"," / ",g.completedAt?new Date(g.completedAt).toLocaleString():"—"]})]})},{key:"issues",label:"问题".concat(G.length>0?"(".concat(G.length,")"):""),children:0===G.length?(0,r.jsx)(eC.A,{image:eC.A.PRESENTED_IMAGE_SIMPLE,description:"该节点没有记录问题"}):(0,r.jsx)(eB.A,{size:"small",dataSource:G,renderItem:e=>{var t,n;let l=null!=(n=eO[e.level])?n:{color:"default",text:String(e.level)};return(0,r.jsx)(eB.A.Item,{children:(0,r.jsxs)(m.A,{direction:"vertical",size:2,style:{width:"100%"},children:[(0,r.jsxs)(m.A,{wrap:!0,size:4,children:[(0,r.jsx)(v.A,{color:l.color,children:l.text}),e.category&&(0,r.jsx)(v.A,{children:e.category}),e.repairability&&(0,r.jsx)(v.A,{color:"blue",children:e.repairability}),(null==(t=e.provenance)?void 0:t.detectorId)&&(0,r.jsx)(el.A,{title:e.provenance.fingerprint,children:(0,r.jsx)(v.A,{children:e.provenance.detectorId})})]}),(0,r.jsx)(eU,{style:{fontSize:12},children:e.message}),e.suggestion&&(0,r.jsxs)(eU,{type:"secondary",style:{fontSize:12},children:["建议:",e.suggestion]}),(e.chapterId||e.sectionTitle)&&(0,r.jsxs)(eU,{type:"secondary",style:{fontSize:11},children:["位置:",e.chapterId||""," ",e.sectionTitle||""]})]})})}})},...Q.length>0?[{key:"details",label:"明细(".concat(Q.length,")"),children:(0,r.jsx)(eB.A,{size:"small",dataSource:Q,renderItem:e=>(0,r.jsx)(eB.A.Item,{style:{paddingBlock:3},children:(0,r.jsx)(eU,{type:"secondary",style:{fontSize:12},children:e.message})})})}]:[],...M&&M.length>0?[{key:"events",label:"事件(".concat(M.length,")"),children:(0,r.jsx)(eB.A,{size:"small",dataSource:[...M].slice(-40).reverse(),renderItem:e=>(0,r.jsx)(eB.A.Item,{style:{paddingBlock:3},children:(0,r.jsxs)(m.A,{size:6,wrap:!0,children:[(0,r.jsxs)(eU,{type:"secondary",style:{fontSize:11},children:["#",e.seq]}),(0,r.jsx)(v.A,{style:{fontSize:11},children:e.type}),(0,r.jsx)(eU,{type:"secondary",style:{fontSize:11},children:new Date(e.at).toLocaleTimeString()}),e.detail?(0,r.jsx)(eU,{style:{fontSize:11},ellipsis:!0,children:e.detail}):null]})})})}]:[],{key:"impact",label:"影响面",children:V},..._?[{key:"skills",label:"技能",children:(()=>{let e="string"==typeof g.metrics.skillId?g.metrics.skillId:void 0;return(0,r.jsxs)(e_.A,{size:"small",column:1,bordered:!0,children:[(0,r.jsx)(e_.A.Item,{label:"技能 id",children:null!=e?e:g.id}),(0,r.jsx)(e_.A.Item,{label:"技能名",children:g.title}),(0,r.jsx)(e_.A.Item,{label:"命中章节",children:"string"==typeof g.metrics.chapter?g.metrics.chapter:"—"}),(0,r.jsx)(e_.A.Item,{label:"状态",children:(0,r.jsx)(v.A,{color:(0,k.uv)(g.status),children:(0,k.m_)(g.status,L)})})]})})()}]:[],...U.length>0?[{key:"metrics",label:"指标",children:(0,r.jsx)(e_.A,{size:"small",column:1,bordered:!0,children:U.map(e=>(0,r.jsx)(e_.A.Item,{label:e.key,children:e.text.replace("".concat(e.key,": "),"")},e.key))})}]:[],...g.payloadRef?[{key:"payload",label:"载荷",children:(0,r.jsxs)(m.A,{direction:"vertical",size:6,children:[(0,r.jsx)(eF,{copyable:{text:g.payloadRef},style:{margin:0,fontSize:12},children:g.payloadRef}),(0,r.jsx)(eU,{type:"secondary",style:{fontSize:12},children:"8.6 / 附录 F.2:节点**不得携带载荷**(`agentWorkflow` 已是 p50 2.2 MB / max 94.6 MB)。 prompt / response / 证据快照等明细都在内容寻址的 `artifacts/<sha256>` 里,这里只有引用。"})]})}]:[]]})]})}var eX=n(34038);let{Text:eV}=d.A,eJ=["upsert","status","rollup","reset","start","stage","thinking","text","tool_call_preview","progress","error","done","complete","log"];function eY(e,t){var n,r;let l=null!=(n=e.projectRoot)?n:t;return{specId:e.templateId||e.id,promptIds:null!=(r=e.promptIds)?r:[],...e.materialRoot?{materialRoot:e.materialRoot}:{},...l?{projectRoot:l}:{},...e.templateName?{title:e.templateName}:{}}}function eK(e,t){let n=t.node;if(!n||"string"!=typeof n.id)return!0;if("upsert"===t.type)return e.set(n.id,n),!0;let r=e.get(n.id);if(!r){var l,i;return e.set(n.id,{...n,title:null!=(l=n.title)?l:n.id,seq:null!=(i=n.seq)?i:0}),!1}let{startedAt:a,...o}=n;return e.set(n.id,{...r,...o,id:r.id}),!0}function eZ(){var e,t,n,i,o,d,w,S,I,C,R,N,E,T,L,D,P,B,_,W,G,O,X,V,J,Z,$,ee,et;let en=(0,c.useRouter)(),el=(0,A.Vr)(),{message:ei}=u.A.useApp(),ea="string"==typeof en.query.id?en.query.id:"",eo="string"==typeof en.query.projectRoot?en.query.projectRoot:void 0,[es,ec]=(0,l.useState)(null),[ed,eu]=(0,l.useState)(!0),[eh,ep]=(0,l.useState)(null),[em,ex]=(0,l.useState)(new Map),[eg,ev]=(0,l.useState)("connecting"),[ef,ey]=(0,l.useState)(0),[ej,eA]=(0,l.useState)(null),[eb,ek]=(0,l.useState)("all"),[ew,eS]=(0,l.useState)(!0),[eI,eC]=(0,l.useState)(0),[ez,eR]=(0,l.useState)(()=>Date.now()),eN=(0,l.useCallback)(()=>{ew&&eC(Date.now()+eD.WF)},[ew]),[eE,eB]=(0,l.useState)(""),[eq,eH]=(0,l.useState)(!1),[e_,eW]=(0,l.useState)([]),[,eF]=(0,l.useState)([]),[eU,eG]=(0,l.useState)([]),[eO,eZ]=(0,l.useState)(null),[e0,e1]=(0,l.useState)(null),{bubbles:e2,push:e4,clear:e5}=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1500,[t,n]=(0,l.useState)([]),r=(0,l.useRef)(null),i=(0,l.useCallback)(t=>{let r=function(e){var t,n;let r=null!=(t=e.now)?t:Date.now(),l=null!=(n=e.freshMs)?n:15e3,{before:i,after:a}=e,o=a.parentId;if(!o)return null;if(!i){if("number"!=typeof a.startedAt||r-a.startedAt>l||r-a.startedAt<-l)return null;let e=F(a,"dispatch");return e?{id:"".concat(o,"->").concat(a.id,":dispatch"),fromId:o,toId:a.id,kind:"dispatch",label:e,at:r}:null}if(!(H.has(a.status)&&!H.has(i.status))||"number"!=typeof a.completedAt||r-a.completedAt>l||r-a.completedAt<-l)return null;let s=F(a,"report");return s?{id:"".concat(a.id,"->").concat(o,":report"),fromId:a.id,toId:o,kind:"report",label:s,at:r}:null}(t);r&&n(t=>(function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1500,l=arguments.length>4&&void 0!==arguments[4]?arguments[4]:6,i=[...e.filter(e=>n-e.at<r&&e.id!==t.id),t];return i.length>l?i.slice(i.length-l):i})(t,r,r.at,e))},[e]),a=(0,l.useCallback)(()=>{n(e=>0===e.length?e:[])},[]);return(0,l.useEffect)(()=>{if(0!==t.length)return r.current=setTimeout(()=>{r.current=null,n(t=>(function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1500,r=e.filter(e=>t-e.at<n);return r.length===e.length?e:r})(t,Date.now(),e))},Math.max(0,t.reduce((e,t)=>Math.min(e,t.at),1/0)+e-Date.now())),()=>{r.current&&(clearTimeout(r.current),r.current=null)}},[t,e]),{bubbles:t,push:i,clear:a}}(),[e8,e6]=(0,l.useState)(!1);(0,l.useEffect)(()=>{if("function"!=typeof window.matchMedia)return;let e=window.matchMedia("(prefers-reduced-motion: reduce)"),t=()=>e6(e.matches);return t(),e.addEventListener("change",t),()=>e.removeEventListener("change",t)},[]);let[e3,e9]=(0,l.useState)(null),[e7,te]=(0,l.useState)(()=>new Map),[tt,tn]=(0,l.useState)([]),[tr,tl]=(0,l.useState)(null),[ti,ta]=(0,l.useState)(!1),[to,ts]=(0,l.useState)(!0),[tc,td]=(0,l.useState)(!0),[tu,th]=(0,l.useState)([]),[tp,tm]=(0,l.useState)(null),[tx,tg]=(0,l.useState)(!1),tv=(0,eD.s_)(),{centerOn:tf,zoomAt:ty,fit:tj,reset:tA}=tv,tb=(0,l.useCallback)(()=>{var e;let t=null==(e=tv.containerRef.current)?void 0:e.getBoundingClientRect();if(!t)return{left:0,top:0,right:0,bottom:0};let n=e=>{let n=document.querySelector(e);if(!n)return null;let r=n.getBoundingClientRect();return{top:r.top-t.top,bottom:r.bottom-t.top}},r=n(".canvasToolbar"),l=n(".canvasInputBar"),i=Math.min(r?r.bottom+8:24,.4*t.height),a=Math.max(l?l.top-8:t.height-24,.6*t.height);return{left:24,top:i,right:t.width-24,bottom:a}},[tv.containerRef]),tk=(0,l.useRef)(new Map),tw=(0,l.useRef)(0),tS=(0,l.useRef)({nodes:[],events:[],cursor:0}),tI=(0,l.useRef)(null),tC=(0,l.useRef)(0),tz=(0,l.useRef)(eo),tR=(0,l.useRef)(!1),tN=(0,l.useCallback)(e=>{let t=e.key?el(e.key):e.text,n=t===e.key?e.text:t;tC.current+=1,eF(t=>[{id:tC.current,kind:e.kind,text:n,at:Date.now()},...t].slice(0,100)),"error"===e.kind?ei.error(n):"warning"===e.kind?ei.warning(n):"success"===e.kind&&ei.success(n)},[ei,el]),tE=(0,b.tl)({projectRoot:eo,documentId:ea||null,onNotice:tN,t:el}),{refreshDocuments:tT,applyRecord:tM}=tE,tL=function(e,t){let[n,r]=(0,l.useState)({loading:!1,error:null,preview:null}),i=(0,l.useRef)(0),a=(0,l.useCallback)(async()=>{if(!e)return void r({loading:!1,error:"缺少记录 id,无法取回成稿预览",preview:null});let n=i.current+1;i.current=n,r(e=>({...e,loading:!0,error:null}));try{let{preview:l}=await (0,j.sz)(e,t);if(i.current!==n)return;r({loading:!1,error:null,preview:l})}catch(e){if(i.current!==n)return;r({loading:!1,error:e instanceof Error?e.message:"取回成稿预览失败",preview:null})}},[e,t]),o=(0,l.useCallback)(()=>{i.current+=1,r({loading:!1,error:null,preview:null})},[]);return{...n,load:a,reset:o}}(ea,null!=(E=tz.current)?E:eo),tD=(0,l.useCallback)(()=>{var e;if(ti){tL.reset(),ta(!1);return}ta(!0),tL.load(),(0,j.f$)(null!=(e=tz.current)?e:eo).then(e=>th(e.assets.filter(e=>e.usedByDocumentIds.includes(ea)))).catch(()=>th([]))},[ti,tL,ea,eo]),tP=(0,l.useCallback)(e=>{var t;let n=null!=(t=tz.current)?t:eo;if("image"!==e.type)return void(0,j.oS)(e.id,"file",n).catch(()=>tN({kind:"error",text:"打开资产失败"}));tg(!1),tm(e)},[eo,tN]),tB=(0,l.useCallback)(e=>{tn(t=>t.includes(e)?t:[...t,e])},[]),tq=(0,l.useCallback)(()=>{tI.current||(tI.current=setTimeout(()=>{tI.current=null;let e=tS.current;if(tS.current={nodes:[],events:[],cursor:0},e.nodes.length>0){let n=tk.current,r=0;for(let l of e.nodes){var t;let e=null==(t=l.node)?void 0:t.id,i=e?n.get(e):void 0;eK(n,l)||(r+=1);let a=e?n.get(e):void 0;a&&e4({...i?{before:i}:{},after:a})}ex(new Map(n)),r>0&&tB("通道收到 ".concat(r," 条指向未知节点的补丁:已按最小节点收下(说明本客户端漏读了 upsert,或日志存在损坏)"))}if(e.cursor>tw.current&&(tw.current=e.cursor),e.events.length>0){let t=e.events;eW(e=>[...t.reverse(),...e].slice(0,200)),ey(e=>t.reduce((e,t)=>Math.max(e,t.seq),e))}},120))},[tB,e4]);(0,l.useEffect)(()=>()=>{tI.current&&clearTimeout(tI.current)},[]);let tH=(0,l.useCallback)((e,t)=>{let n=tS.current;t&&n.nodes.push(t),n.events.push(e),(null==t?void 0:t.logT)&&t.logT>n.cursor&&(n.cursor=t.logT),tq()},[tq]),t_=(0,l.useCallback)(async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(ea){e.silent||eu(!0);try{var t,n,r,l,i,a;let e=tz.current?"?projectRoot=".concat(encodeURIComponent(tz.current)):"",o=await fetch("/api/documents/canvas/".concat(encodeURIComponent(ea)).concat(e));if(404===o.status)return void ep("记录不存在(可能已被删除)");if(!o.ok)throw Error(await o.text()||"HTTP ".concat(o.status));let s=await o.json();tz.current=null!=(r=s.document.projectRoot)?r:tz.current,ec(s),ep(null),tn(null!=(l=s.degraded)?l:[]);let c=function(e){let t=[],n=e=>{for(let r of e){let{children:e,...l}=r;t.push(l),e&&n(e)}};return n(e),t}(null!=(i=null==(t=s.nodes)?void 0:t.tree)?i:[]),d=new Map(c.map(e=>[e.id,e]));tk.current=d,ex(d),tw.current=Math.max(tw.current,null!=(a=null==(n=s.nodes)?void 0:n.cursor)?a:0)}catch(e){ep(e instanceof Error?e.message:String(e))}finally{e.silent||eu(!1)}}},[ea]);(0,l.useEffect)(()=>{t_()},[t_]),(0,l.useEffect)(()=>{var e;let t=null==es||null==(e=es.nodes)?void 0:e.depth;null==t||tR.current||ek(t)},[es]),(0,l.useEffect)(()=>{ea&&tT()},[ea,tT]),(0,l.useEffect)(()=>{let e=tE.documents.find(e=>e.id===ea);e&&tM(e)},[tM,ea,tE.documents]);let tW=(0,l.useCallback)(async()=>{if(ea)try{var e,t;let n=new URLSearchParams({since:String(tw.current)});tz.current&&n.set("projectRoot",tz.current);let r=await fetch("/api/documents/generated/".concat(encodeURIComponent(ea),"/nodes?").concat(n.toString()));if(!r.ok)return;let l=await r.json(),i=tk.current;for(let t of null!=(e=l.nodes)?e:[])eK(i,{type:"upsert",node:t});(null!=(t=l.nodes)?t:[]).length>0&&ex(new Map(i)),l.cursor&&(tw.current=Math.max(tw.current,l.cursor)),l.downgraded&&tB(l.reason||"增量过大,服务端已降级为全量快照")}catch(e){}},[tB,ea]);(0,l.useEffect)(()=>{if(!ea)return;let e=setInterval(()=>{tW()},1e4);return()=>clearInterval(e)},[ea,tW]),(0,l.useEffect)(()=>{if(!ea||"undefined"==typeof EventSource)return;let e=tz.current?"?projectRoot=".concat(encodeURIComponent(tz.current)):"",t=new EventSource("/api/documents/generated/".concat(encodeURIComponent(ea),"/events").concat(e));ev("connecting");let n=e=>t=>{var n,r,l;let i={};try{i=JSON.parse(t.data)}catch(e){}let a=null!=(l=i.type)?l:e;"reset"===a&&(e5(),t_({silent:!0}),tB("通道补发不可用(服务端重启或环形覆盖):已重取全量快照"));let o=null==(n=i.node)?void 0:n.title;tH({seq:"number"==typeof i.seq?i.seq:0,type:a,at:"number"==typeof i.at?i.at:Date.now(),...i.nodeId?{nodeId:i.nodeId}:{},...o?{nodeTitle:o}:{},...(null==(r=i.payload)?void 0:r.message)?{detail:i.payload.message}:{}},i.node?{type:a,node:i.node,...i.logT?{logT:i.logT}:{}}:void 0),i.node&&tT()},r=eJ.map(e=>[e,n(e)]);for(let[e,n]of(t.onopen=()=>ev("open"),t.onerror=()=>{ev("error"),tW()},r))t.addEventListener(e,n);return t.onmessage=n("message"),()=>{for(let[e,n]of r)t.removeEventListener(e,n);t.close()}},[tB,e5,ea,t_,tH,tT,tW]),(0,l.useEffect)(()=>{e5()},[e5,ea]);let tF=(0,l.useMemo)(()=>(0,k.Jr)([...em.values()],"all"===eb?void 0:eb),[em,eb]),tU=(0,l.useMemo)(()=>(0,k.x8)(tF),[tF]),tG=(0,l.useMemo)(()=>(0,k.PI)(tF),[tF]),tO=(0,l.useMemo)(()=>0!==e7.size||e3?(0,k.bJ)(tG,(0,k.Kq)(e7,e3)):tG,[tG,e7,e3]),tQ=(0,l.useRef)(1);tQ.current=tv.view.k;let tX=(0,l.useRef)(!1);tX.current=null!==e3;let tV=(0,l.useCallback)((e,t,n,r)=>{let{dx:l,dy:i}=(0,k.qj)({dx:t,dy:n},tQ.current);if("move"===r)return void e9({id:e.id,dx:l,dy:i});e9(null),(0!==t||0!==n)&&te(t=>{var n;let r=new Map(t),a=null!=(n=r.get(e.id))?n:{dx:0,dy:0};return r.set(e.id,{dx:a.dx+l,dy:a.dy+i}),r})},[]),tJ=(0,l.useCallback)(()=>{e9(null),te(new Map)},[]),tY=(0,l.useMemo)(()=>new Map(tU.map(e=>[e.id,e])),[tU]),tK=ej&&null!=(T=tY.get(ej))?T:null,tZ=(0,l.useMemo)(()=>{if(ej)return M(tU.map(e$),ej)},[tU,ej]),t$=(0,l.useMemo)(()=>{var e;return new Set(null!=(e=null==tZ?void 0:tZ.affectedNodeIds)?e:[])},[tZ]),t0=(0,l.useMemo)(()=>new Set(ej?[...(0,k.II)(tF,ej),ej]:[]),[tF,ej]),t1=(0,l.useMemo)(()=>(0,k.Kg)(tO),[tO]),t2=(0,l.useMemo)(()=>(function(e,t){var n,r;let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=null!=(n=l.limit)?n:6,a=null!=(r=l.recentLimit)?r:3,o=[],s=[],c=(e,n)=>{for(let r of e)Q.has(r.status)?o.push(Y(r,n,t)):"completed"===r.status&&"number"==typeof r.completedAt&&t-r.completedAt<=9e4&&s.push(Y(r,n,t)),r.children.length>0&&c(r.children,n+1)};return c(e,0),o.sort((e,n)=>{var r,l;let i=null!=(r=K(e,t))?r:0;return(null!=(l=K(n,t))?l:0)-i||e.id.localeCompare(n.id)}),s.sort((e,t)=>{var n,r;return(null!=(n=t.completedAt)?n:0)-(null!=(r=e.completedAt)?r:0)||e.id.localeCompare(t.id)}),{running:o.slice(0,i),recent:s.slice(0,a),runningTotal:o.length,recentTotal:s.length}})(tF,Date.now()),[tF]),t4=(0,l.useMemo)(()=>(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:4,n=[],r=e=>{for(let i of e){if("supervisor"===i.type){var t,l;let e="string"==typeof(null==(t=i.metrics)?void 0:t.action)?i.metrics.action:"unknown",r="string"==typeof(null==(l=i.metrics)?void 0:l.note)?i.metrics.note:void 0;n.push({id:i.id,action:e,title:i.title||"调度决策",...r?{note:r}:{},status:i.status,..."number"==typeof i.completedAt?{at:i.completedAt}:"number"==typeof i.startedAt?{at:i.startedAt}:{}})}i.children.length>0&&r(i.children)}};return r(e),n.sort((e,t)=>{var n,r;return(null!=(n=t.at)?n:0)-(null!=(r=e.at)?r:0)||e.id.localeCompare(t.id)}),n.slice(0,t)})(tF),[tF]),t5=(0,l.useCallback)(e=>{let t=tY.get(e.fromId);return t?t$.has(e.fromId)&&t$.has(e.toId)?"affected":2>=(0,k.vp)(t.status)?"warn":t0.has(e.fromId)&&t0.has(e.toId)?"active":"default":"default"},[t$,t0,tY]);(0,l.useEffect)(()=>{if(0===eI)return;let e=setInterval(()=>eR(Date.now()),1e3);return()=>clearInterval(e)},[eI]);let t8=(0,l.useMemo)(()=>{if(0===tU.length)return null;let e=tU.filter(e=>"running"===e.status),t=e.length>0?e:tU;return t.reduce((e,t)=>{var n,r;return(null!=(n=t.seq)?n:0)>=(null!=(r=e.seq)?r:0)?t:e},t[0])},[tU]),t6=null==t8?void 0:t8.id,t3=(0,l.useMemo)(()=>{var e;return(0,eD.be)({following:ew,pausedUntil:eI,now:ez,node:t8?{title:t8.title,...(null==(e=t8.metrics)?void 0:e.roundIteration)!==void 0?{round:t8.metrics.roundIteration}:{}}:void 0})},[ew,eI,ez,t8]);(0,l.useEffect)(()=>{var e;if(!ew||!t6||eI>Date.now()||tX.current)return;let t=null==(e=tv.containerRef.current)?void 0:e.getBoundingClientRect();if(!t)return;let n=tO.nodes.find(e=>e.node.id===t6);n&&(0,eD.xA)({x:n.x,y:n.y,width:k.zT,height:k.EL},tv.view,{width:t.width,height:t.height},tb())&&tf(n.x,n.y,void 0,tb())},[tf,ew,eI,tO.nodes,t6,tb,tv.containerRef,tv.view]),(0,l.useEffect)(()=>{var e;if(!(null==(e=tv.containerRef.current)?void 0:e.getBoundingClientRect())||0===tO.nodes.length)return;let{dx:t,dy:n}=(0,eD.B)({width:tO.width,height:tO.height},tv.view,tb());tv.panBy(t,n)},[tO.width,tO.height,tO.nodes.length]);let t9=(0,l.useCallback)(e=>{eA(e);let t=tO.nodes.find(t=>t.node.id===e);t&&tf(t.x,t.y,void 0,tb())},[tf,tO.nodes,tb]);(0,l.useEffect)(()=>{if(!ej)return;let e=e=>{"Escape"===e.key&&eA(null)};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[ej]);let t7=(0,l.useCallback)(e=>{eB(t=>""===t||t.endsWith(" ")?"".concat(t,"@").concat(e.title," "):"".concat(t," @").concat(e.title," "))},[]),ne=(0,l.useCallback)(()=>{let e=null==es?void 0:es.document;if(!e)return;let t=eE.trim();t&&(eH(!0),(0,j.wI)(e.id,t,{...tz.current?{projectRoot:tz.current}:{}}).then(e=>{var t;tN({kind:"info",text:e.answer?"".concat(e.receipt,"\n").concat(e.answer):e.receipt}),eG(null!=(t=e.candidates)?t:[]),eB("")}).catch(e=>tN({kind:"error",text:e instanceof Error?e.message:"指令未受理"})).finally(()=>eH(!1)))},[es,tN,eE]),nt=(0,l.useCallback)(()=>{let e=null==es?void 0:es.document;e&&(eH(!0),tE.startGeneration(eY(e,tz.current),eE.trim()).finally(()=>eH(!1)))},[es,tE,eE]),nn=(0,l.useCallback)(e=>{let t=null==es?void 0:es.document;t&&(eH(!0),(0,j.wI)(t.id,"(选定:".concat(e.label,")"),{...tz.current?{projectRoot:tz.current}:{},acceptedCandidate:{kind:e.kind}}).then(e=>{tN({kind:"info",text:e.receipt}),eG([])}).catch(e=>tN({kind:"error",text:e instanceof Error?e.message:"指令未受理"})).finally(()=>eH(!1)))},[es,tN]),nr=(0,l.useCallback)(async()=>{let e=null==es?void 0:es.document;if(!e)return;let t=eY(e,tz.current);if(!t.projectRoot)return void tN({kind:"error",text:"未识别当前项目,无法预览结构"});try{let e=await (0,j.dk)({promptIds:t.promptIds,requirement:eE.trim(),...t.materialRoot?{materialRoot:t.materialRoot}:{},...t.title?{title:t.title}:{},projectRoot:t.projectRoot});tl({title:e.title,chapters:e.chapters,outlineSource:e.derivation.outlineSource,materialScope:e.materialScope})}catch(e){tN({kind:"error",text:e instanceof Error?e.message:"结构预览失败"})}},[es,tN,eE]),nl=(0,l.useCallback)(e=>{let t=M(tU.map(e$),e.id);if(!t)return void tN({kind:"warning",text:"该节点不在当前节点集合里,无法评估影响面"});eZ({nodeId:e.id,nodeTitle:e.title,nodeType:e.type,impact:t})},[tU,tN]),ni=(0,l.useCallback)(()=>{if(!eO)return;let e=(0,k.RV)(eO.nodeTitle,eO.impact);eB(t=>t?"".concat(t," ").concat(e):e),eZ(null)},[eO]),[na,no]=(0,l.useState)(null),[ns,nc]=(0,l.useState)(null),nd=(0,l.useCallback)(e=>{if(!eO)return;let t=eO.nodeId;no({nodeId:t,phase:"creating"}),(0,j.xU)({documentId:ea,targetNodeId:t,userMessage:e}).then(e=>{var n,r,l,i;no({nodeId:t,phase:"confirmable",requestId:null==(n=e.request)?void 0:n.id,attribution:"string"==typeof e.attribution?e.attribution:void 0,localizationNote:e.localizationNote,...e.needsLocalization?{needsLocalization:!0}:{},...(null==(i=e.request)||null==(l=i.localization)||null==(r=l.candidates)?void 0:r.length)?{candidates:e.request.localization.candidates}:{}})}).catch(e=>{no({nodeId:t,phase:"error",message:e instanceof Error?e.message:String(e)})})},[ea,eO]),nu=(0,l.useCallback)(e=>{nc({phase:"creating"}),(0,j.xU)({documentId:ea,userMessage:e}).then(e=>{var t,n,r,l;nc({phase:"confirmable",requestId:null==(t=e.request)?void 0:t.id,attribution:"string"==typeof e.attribution?e.attribution:void 0,candidates:null!=(l=null==(r=e.request)||null==(n=r.localization)?void 0:n.candidates)?l:[],localizationNote:e.localizationNote})}).catch(e=>{nc({phase:"error",message:e instanceof Error?e.message:String(e)})})},[ea]),nh=(0,l.useCallback)(e=>{(null==ns?void 0:ns.requestId)&&(0,j.Ho)({documentId:ea,requestId:ns.requestId,acceptedNodeId:e}).then(e=>{var t;nc({...ns,phase:"executed",outcome:String(null!=(t=e.outcome)?t:""),notExecutedReason:e.notExecutedReason})}).catch(e=>{nc({...ns,phase:"error",message:e instanceof Error?e.message:String(e)})})},[ns,ea]),np=(0,l.useCallback)(e=>{(null==na?void 0:na.requestId)&&(0,j.Ho)({documentId:ea,requestId:na.requestId,...e?{acceptedNodeId:e}:{}}).then(e=>{var t;no({...na,phase:"executed",outcome:String(null!=(t=e.outcome)?t:""),notExecutedReason:e.notExecutedReason,attribution:"string"==typeof e.attribution?e.attribution:na.attribution})}).catch(e=>{no({...na,phase:"error",message:e instanceof Error?e.message:String(e)})})},[ea,na]),nm=(0,l.useCallback)(()=>{(null==na?void 0:na.requestId)&&(0,j.vX)({documentId:ea,requestId:na.requestId}).then(e=>{var t,n,r;let l=null==(t=e.restoredChars)?void 0:t.beforeChars,i=null==(n=e.restoredChars)?void 0:n.afterChars;no({...na,phase:"executed",outcome:String(null!=(r=e.outcome)?r:"rolled-back"),restoredChars:void 0!==l&&void 0!==i?l-i:void 0})}).catch(e=>{no({...na,phase:"error",message:e instanceof Error?e.message:String(e)})})},[ea,na]),nx=(0,l.useCallback)(()=>{tE.pauseDocument(ea).catch(e=>tN({kind:"error",text:e instanceof Error?e.message:"暂停失败"}))},[ea,tE,tN]),ng=(0,l.useCallback)(()=>{tE.resumePausedDocument(ea).catch(e=>tN({kind:"error",text:e instanceof Error?e.message:"继续失败"}))},[ea,tE,tN]),nv=null==es?void 0:es.document.status,nf=tE.loading||"generating"===nv||"queued"===nv,ny=(0,l.useRef)(null),nj=(0,l.useRef)(null),[nA,nb]=(0,l.useState)({width:0,height:0});(0,l.useLayoutEffect)(()=>{let e=nj.current;if(!e)return void nb({width:0,height:0});let t=()=>{let t=e.firstElementChild;if(!t)return;let n=e.offsetWidth,r=Math.max(t.scrollHeight,t.offsetHeight);nb(e=>Math.abs(e.width-n)>2||Math.abs(e.height-r)>2?{width:n,height:r}:e)};t();let n=new ResizeObserver(t);return n.observe(e),e.firstElementChild&&n.observe(e.firstElementChild),()=>n.disconnect()},[ej]);let nk=(0,l.useMemo)(()=>{var e;if(!ej)return null;let t=tO.nodes.find(e=>e.node.id===ej),n=null==(e=tv.containerRef.current)?void 0:e.getBoundingClientRect();if(!t||!n)return null;let r=[".canvasToolbar",".canvasInputBar",".canvasRecordsBall"].map(e=>{var t;return null==(t=document.querySelector(e))?void 0:t.getBoundingClientRect()}).filter(e=>!!e).map(e=>({left:e.left-n.left,top:e.top-n.top,right:e.right-n.left,bottom:e.bottom-n.top})),l="".concat(tv.view.x,",").concat(tv.view.y,",").concat(tv.view.k),i=ny.current,a=i&&i.id===ej&&i.viewKey===l?i:null,o=(0,k.Aq)({node:{x:t.x,y:t.y},view:tv.view,box:n,panelWidth:nA.width>0?nA.width:462,panelHeight:nA.height>0?nA.height:480,obstacles:r,...a?{pin:{left:a.left,top:a.top}}:{}});ny.current={id:ej,viewKey:l,left:o.left,top:o.top};let s=Math.round(.62*n.height);return{left:o.left,top:o.top,maxHeight:Math.max(180,Math.min(o.maxHeight,s))}},[tO.nodes,ej,tv,nA]),nw=(0,l.useCallback)(e=>{t7(e),requestAnimationFrame(()=>{var e;return null==(e=document.querySelector(".canvasInputBar textarea"))?void 0:e.focus()})},[t7]),nS=(0,l.useCallback)(e=>{t9(e.id),e1(e.id),window.setTimeout(()=>e1(t=>t===e.id?null:t),1200)},[t9]),nI=(0,l.useCallback)(async e=>{if(ea)try{let{document:t}=await (0,j.v7)(ea,!1,tz.current);if(!t)return void tN({kind:"warning",text:"记录不存在,无法导出"});await tE.export.exportRecord(t,e)}catch(e){tN({kind:"error",text:e instanceof Error?e.message:"导出失败"})}},[ea,tE.export,tN]),nC=tE.boundRecord,nz=function(e,t){if(!e)return;let n=(null==t?void 0:t.docId)===e.id?t:void 0,r=e.deliveryQuality;return r?{...n,docId:e.id,...e.projectRoot?{projectRoot:e.projectRoot}:{},contractQuality:r.receipt,...r.stale?{contractQualityStale:r.stale}:{contractQualityStale:void 0}}:n}(null==es?void 0:es.document,tE.deliveryReadings),nR=tE.canResume;return ea?eh?(0,r.jsx)(p.Ay,{status:"warning",title:"画布打不开",subTitle:eh,extra:(0,r.jsxs)(m.A,{children:[(0,r.jsx)(x.Ay,{icon:(0,r.jsx)(y.A,{}),onClick:()=>{t_()},children:"重试"}),(0,r.jsx)(s(),{href:"/documents",children:(0,r.jsx)(x.Ay,{type:"primary",children:"回到文档页"})})]})}):(0,r.jsxs)("div",{className:"canvasRoot",children:[(0,r.jsx)(a(),{children:(0,r.jsx)("title",{children:(null==es?void 0:es.document.title)?"".concat(es.document.title," \xb7 画布"):"生成画布"})}),(0,r.jsx)(eT,{title:(null==es?void 0:es.document.title)||"生成画布",...nv?{status:nv}:{},...(null==es?void 0:es.document.updatedAt)!==void 0?{updatedAt:es.document.updatedAt}:{},...(null==es?void 0:es.document.wordCount)!==void 0?{wordCount:es.document.wordCount}:{},agents:t2,supervisorDecisions:t4,agentsActive:nf,...(null==es?void 0:es.document.createdAt)!==void 0?{startedAt:es.document.createdAt}:{},onLocateAgent:e=>{eA(e),e1(e)},nodeCount:em.size,visibleCount:tO.nodes.length,hiddenCount:null!=(L=null==es?void 0:es.nodes.hiddenCount)?L:0,degraded:tt,skills:{hits:null!=(D=null==es?void 0:es.skills.hits)?D:[],note:null!=(P=null==es?void 0:es.skills.note)?P:""},gate:null!=(B=null==es?void 0:es.gate)?B:null,connection:eg,lastSeq:ef,zoom:tv.view.k,depth:eb,following:ew,followStatus:t3.title,generating:!!nf,resumable:nR,exporting:tE.export.exporting,nonDeliverableExport:tE.export.nonDeliverableExport,onZoomIn:()=>ty(1.2),onZoomOut:()=>ty(1/1.2),onZoomReset:tA,onFit:()=>tj(tO.width,tO.height,tb()),onDepthChange:e=>{tR.current=!0,ek(e)},onToggleFollow:()=>eS(e=>!e),onContinue:()=>{nC&&tE.resumeDocument(nC)},onPause:nx,onResume:ng,onAbort:()=>{tE.abortGeneration()},onExport:e=>{nI(e)},exportReports:tE.export.exportReports,...nz?{deliveryReadings:nz}:{},previewOpen:ti,onTogglePreview:tD,hasNodeOffsets:e7.size>0,onResetNodeLayout:tJ,collapsed:to,onToggleCollapsed:ts,t:el}),(0,r.jsxs)("div",{ref:tv.containerRef,className:"canvasStage",style:{backgroundImage:"radial-gradient(var(--canvasGridDot) 1px, transparent 1px)",backgroundSize:"".concat(eD.VF*tv.view.k,"px ").concat(eD.VF*tv.view.k,"px"),backgroundPosition:"".concat(tv.view.x,"px ").concat(tv.view.y,"px"),cursor:"grab"},onWheelCapture:eN,onPointerDown:e=>{var t;let n=e.target;null!=n&&null!=(t=n.closest)&&t.call(n,".nodeInfoLayer, .canvasToolbar, .canvasInputBar")||(eN(),tv.onPointerDown(e))},onPointerMove:tv.onPointerMove,onPointerUp:tv.endDrag,onPointerLeave:tv.endDrag,onClick:()=>eA(null),children:[ed&&(0,r.jsx)("div",{style:{position:"absolute",inset:0,display:"grid",placeItems:"center"},children:(0,r.jsxs)(m.A,{direction:"vertical",align:"center",children:[(0,r.jsx)(h.A,{}),(0,r.jsx)(eV,{type:"secondary",children:"正在读取节点日志…"})]})}),!ed&&0===tO.nodes.length&&(0,r.jsx)("div",{style:{position:"absolute",inset:0,display:"grid",placeItems:"center",pointerEvents:"none"},children:(0,r.jsxs)(m.A,{direction:"vertical",align:"center",size:8,children:[(0,r.jsx)(eV,{type:"secondary",children:"还没有节点日志"}),(0,r.jsx)(eV,{type:"secondary",style:{fontSize:12},children:"节点日志是唯一真相源:这里**不造占位节点**,发起生成后节点会随日志追加而出现。"})]})}),(0,r.jsxs)("div",{style:{position:"absolute",left:0,top:0,transformOrigin:"0 0",transform:"translate(".concat(tv.view.x,"px, ").concat(tv.view.y,"px) scale(").concat(tv.view.k,")"),width:tO.width,height:tO.height},children:[(0,r.jsx)(q,{edges:tO.edges,width:tO.width,height:tO.height,toneOf:t5,flowing:t1}),(0,r.jsx)(U,{bubbles:e2,layout:tO,static:e8}),tO.nodes.map(e=>(0,r.jsx)(er,{node:e.node,x:e.x,y:e.y,selected:e.node.id===ej,affected:t$.has(e.node.id)&&e.node.id!==ej,flashed:e0===e.node.id,onDrag:tV,onSelect:e=>eA(e.id),t:el},e.node.id))]}),tK&&nk&&(0,r.jsx)("div",{ref:nj,className:"nodeInfoLayer",style:{left:nk.left,top:nk.top,maxHeight:nk.maxHeight},onClick:e=>e.stopPropagation(),onContextMenu:e=>e.stopPropagation(),children:(0,r.jsx)(eQ,{node:tK,...tZ?{impact:tZ}:{},flatNodes:tU,highlighted:!!(ej&&t$.has(ej)),generating:!!nf,repairPreview:eO,repairRun:na,onRunRepair:nd,onConfirmRepair:np,onRollbackRepair:nm,defaultRepairNote:eO?(0,k.RV)(eO.nodeTitle,eO.impact):"",onFocusNode:t9,onRequestRepair:nl,onClose:()=>eA(null),onDraftRepairNote:ni,onCancelRepairPreview:()=>eZ(null),onMention:nw,onLocate:nS,onPause:nx,onResume:ng,nodeEvents:e_.filter(e=>e.nodeId===(null==tK?void 0:tK.id)),t:el})})]}),(0,r.jsx)(eP._,{quickActions:[...eU.map(e=>({key:e.kind,label:"按「".concat(e.label,"」执行"),onClick:()=>nn(e)})),{key:"document-repair",label:"按这段要求修复正文(先定位)",onClick:()=>nu(eE.trim())},{key:"regenerate",label:"按这段要求再生成一份",onClick:nt}],value:eE,onChange:eB,onSend:ne,generating:!!nf,submitting:eq,disabled:!es,...es?{}:{disabledReason:"正在读取记录…"},selectedNode:tK,onMentionSelected:()=>{tK&&t7(tK)},resumable:nR,onContinue:()=>{nC&&tE.resumeDocument(nC)},onPreviewStructure:()=>{nr()},collapsed:tc,onToggleCollapsed:td}),(0,r.jsx)(eM._,{currentDocumentId:ea,...eo?{projectRoot:eo}:{},onSelect:e=>{en.push((0,eL.p)(e.id,e.projectRoot||eo))},onCurrentDeleted:()=>{en.push("/canvas")}}),(0,r.jsxs)(g.A,{open:!!ns,title:"文档级修复(先定位)",onCancel:()=>nc(null),footer:(0,r.jsx)(x.Ay,{onClick:()=>nc(null),children:"关闭"}),width:640,children:[(null==ns?void 0:ns.phase)==="creating"&&(0,r.jsx)(eV,{type:"secondary",children:"正在定位要改的节点…"}),(null==ns?void 0:ns.phase)==="error"&&(0,r.jsx)(eV,{type:"danger",children:"修复请求未建立:".concat(null!=(_=ns.message)?_:"")}),(null==ns?void 0:ns.phase)==="confirmable"&&(0,r.jsxs)(m.A,{direction:"vertical",size:8,style:{width:"100%"},children:[(0,r.jsx)(eV,{type:"secondary",style:{fontSize:12},children:"请求已建立(".concat(null!=(W=ns.requestId)?W:"",")").concat(ns.attribution?";归因:".concat(ns.attribution):"","。")+"点一个候选才会真的改正文——定位这件事由你定,系统不替你点头。"}),(null!=(G=null==(e=ns.candidates)?void 0:e.length)?G:0)===0?(0,r.jsx)(eV,{type:"warning",children:"系统定位不出候选节点:请改用「@ 节点名」指定,或在节点面板里发起(不猜一个节点去改)"}):ns.candidates.map(e=>(0,r.jsx)("div",{"data-testid":"document-repair-candidate",children:(0,r.jsxs)(m.A,{size:6,wrap:!0,children:[(0,r.jsx)(v.A,{children:"匹配 ".concat(e.score.toFixed(2))}),(0,r.jsx)(eV,{style:{fontSize:12},children:e.excerpt.slice(0,80)}),(0,r.jsx)(x.Ay,{size:"small",type:"primary",onClick:()=>nh(e.nodeId),children:"定位到该节点并执行"})]})},e.nodeId))]}),(null==ns?void 0:ns.phase)==="executed"&&(0,r.jsxs)(m.A,{direction:"vertical",size:6,children:[(0,r.jsx)(v.A,{color:"applied"===ns.outcome?"green":"rolled-back"===ns.outcome?"orange":"red",children:"执行结果:".concat(null!=(O=ns.outcome)?O:"未执行")}),ns.notExecutedReason&&(0,r.jsx)(eV,{type:"danger",style:{fontSize:12},children:ns.notExecutedReason})]})]}),(0,r.jsx)(eX.B,{open:!!tr,title:null!=(X=null==tr?void 0:tr.title)?X:"",chapters:null!=(V=null==tr?void 0:tr.chapters)?V:[],...(null==tr?void 0:tr.outlineSource)?{outlineSource:tr.outlineSource}:{},...(null==tr?void 0:tr.materialScope)?{materialScope:tr.materialScope}:{},onClose:()=>tl(null)}),(0,r.jsxs)(g.A,{open:ti,title:"成稿预览",onCancel:()=>{tL.reset(),ta(!1)},footer:(0,r.jsxs)(m.A,{children:[(0,r.jsx)(x.Ay,{onClick:()=>{tL.load()},loading:tL.loading,children:"重新取回"}),(0,r.jsx)(x.Ay,{type:"primary",onClick:()=>{tL.reset(),ta(!1)},children:"关闭"})]}),width:920,styles:{body:{maxHeight:"72vh",overflow:"auto",background:"var(--colorBgLayout)",padding:"16px 20px"}},style:{top:32},children:[(0,r.jsx)(z,{status:null!=(J=null==(t=tL.preview)?void 0:t.status)?J:nv,title:null!=(Z=null==(n=tL.preview)?void 0:n.title)?Z:null==es?void 0:es.document.title,html:null==(i=tL.preview)?void 0:i.html,source:null==(o=tL.preview)?void 0:o.source,truncated:null==(d=tL.preview)?void 0:d.truncated,totalChars:null==(w=tL.preview)?void 0:w.totalChars,renderedChars:null==(S=tL.preview)?void 0:S.renderedChars,stats:null==(I=tL.preview)?void 0:I.stats,gate:null!=(ee=null!=($=null==(C=tL.preview)?void 0:C.gate)?$:null==es?void 0:es.gate)?ee:null,deliveryReadings:nz,loading:tL.loading,error:tL.error,onRetry:()=>{tL.load()},updatedAt:null==(R=tL.preview)?void 0:R.updatedAt,generatedAt:null==(N=tL.preview)?void 0:N.generatedAt,t:el}),(0,r.jsxs)("div",{style:{marginTop:16,borderTop:"1px solid var(--colorBorderSecondary)",paddingTop:12},children:[(0,r.jsx)(eV,{strong:!0,style:{fontSize:13},children:"本档用到的资产"}),0===tu.length?(0,r.jsx)("div",{children:(0,r.jsx)(eV,{type:"secondary",style:{fontSize:12},children:"本档暂无资产"})}):(0,r.jsxs)(m.A,{direction:"vertical",size:4,style:{width:"100%",marginTop:6},children:[tu.slice(0,20).map(e=>(0,r.jsxs)(m.A,{size:8,children:[(0,r.jsx)(eV,{style:{fontSize:12},children:e.name}),(0,r.jsx)(x.Ay,{size:"small",type:"link",onClick:()=>tP(e),children:"打开"})]},e.id)),tu.length>20?(0,r.jsxs)(eV,{type:"secondary",style:{fontSize:12},children:["还有 ",tu.length-20," 项未列出"]}):null]})]})]}),(0,r.jsxs)(g.A,{open:!!tp,title:tp?"资产预览:".concat(tp.name):"",onCancel:()=>{tm(null),tg(!1)},footer:(0,r.jsxs)(m.A,{children:[tx&&tp?(0,r.jsx)(x.Ay,{onClick:()=>{var e;(0,j.oS)(tp.id,"file",null!=(e=tz.current)?e:eo).catch(()=>tN({kind:"error",text:"打开资产失败"}))},children:"用系统程序打开"}):null,(0,r.jsx)(x.Ay,{type:"primary",onClick:()=>{tm(null),tg(!1)},children:"关闭"})]}),width:760,styles:{body:{maxHeight:"68vh",overflow:"auto"}},children:[tp&&!tx?(0,r.jsx)("img",{alt:tp.name,src:(0,j.iN)(tp.id,null!=(et=tz.current)?et:eo),style:{maxWidth:"100%",display:"block",margin:"0 auto"},onError:()=>tg(!0)}):null,tx&&(0,r.jsx)(f.A,{type:"info",showIcon:!0,message:"这个资产不能在应用内渲染",description:"服务端只对图片(PNG / JPEG / WebP,按文件头验证)提供应用内渲染;其它形态请用系统程序打开。"})]})]}):(0,r.jsx)("div",{className:"appShellPlaceholder",children:(0,r.jsx)(h.A,{style:{margin:48}})})}function e$(e){return e}},72210:(e,t,n)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/canvas/[id]",function(){return n(38977)}])}},e=>{e.O(0,[324,815,665,576,569,499,808,127,638,530,636,593,792],()=>e(e.s=72210)),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[95],{2232:(e,r,t)=>{"use strict";t.r(r),t.d(r,{default:()=>H});var s=t(65321),l=t(97109),a=t(1873),n=t.n(a),o=t(43220),c=t.n(o),i=t(86109),d=t(33442),x=t(14932),m=t(85114),h=t(85493),u=t(48318),p=t(75174),j=t(57271),g=t(42700),v=t(84253),y=t(68787),f=t(11702),b=t(76506),w=t(58569),N=t(7576),C=t(99271),A=t(37510),S=t(47210),k=t(99811),z=t(6578);let T={whiteSpace:"pre-wrap",overflowWrap:"anywhere",margin:0,fontFamily:"ui-monospace, SFMono-Regular, Menlo, monospace",fontSize:12.5,lineHeight:1.75};function M(e){let{children:r,maxHeight:t=520}=e;return(0,s.jsx)("div",{className:"rounded-xl border border-[var(--borderColor)] bg-[var(--colorFillAlter)] px-3 py-2.5",style:{maxHeight:t,overflow:"auto"},children:r})}function R(e){let{zoom:r,onChange:t,viewportRef:l}=e,a=e=>Math.min(4,Math.max(.2,Math.round(100*e)/100));return(0,s.jsxs)(d.A,{size:4,align:"center",children:[(0,s.jsx)(x.A,{title:"缩小(Ctrl/⌘ + 滚轮同效)",children:(0,s.jsx)(m.Ay,{size:"small",icon:(0,s.jsx)(C.A,{}),"aria-label":"缩小",onClick:()=>t(a(r-.1))})}),(0,s.jsxs)("span",{className:"text-xs tabular-nums text-[var(--colorTextSecondary)] w-12 text-center",children:[Math.round(100*r),"%"]}),(0,s.jsx)(x.A,{title:"放大(Ctrl/⌘ + 滚轮同效)",children:(0,s.jsx)(m.Ay,{size:"small",icon:(0,s.jsx)(A.A,{}),"aria-label":"放大",onClick:()=>t(a(r+.1))})}),(0,s.jsx)(m.Ay,{size:"small",onClick:()=>{let e=l.current,s=null==e?void 0:e.firstElementChild;if(!e||!s)return;let n=s.clientWidth/r;n&&t(a((e.clientWidth-2)/n))},children:"适应宽度"}),(0,s.jsx)(m.Ay,{size:"small",disabled:1===r,onClick:()=>t(1),children:"原始比例"})]})}function F(e){let{zoom:r,viewportRef:t,children:l}=e;return(0,s.jsx)("div",{ref:t,className:"rounded-xl border border-[var(--borderColor)] bg-[var(--colorBgContainer)] p-2 overflow-auto",style:{maxHeight:"68vh"},children:1===r?l:(0,s.jsx)("div",{style:{zoom:r},children:l})})}function I(e){var r,t,l;let{block:a,parts:n}=e;if("undefined"==typeof DOMParser)return(0,s.jsx)(M,{children:(0,s.jsx)("pre",{style:T,children:a.text})});let o=null!=(l=null==(r=/<[^!?][^>]*?\s([^>]*)>/u.exec(null!=(t=n[a.part])?t:""))?void 0:r[1])?l:'xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"',c=new DOMParser().parseFromString("<root ".concat(o,">").concat(a.xml,"</root>"),"application/xml"),i=c.documentElement.firstElementChild;if(!i||c.querySelector("parsererror"))return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(h.A,{type:"warning",message:"表格XML显示未完成,保留原文及结构供核查"}),(0,s.jsx)(M,{children:(0,s.jsx)("pre",{style:T,children:a.text})})]});let d=[...i.children].filter(e=>"tr"===e.localName).map(e=>{let r=0;return[...e.children].filter(e=>"tc"===e.localName).map(e=>{var t,s,l;let a=Number(null!=(s=null==(t=e.getElementsByTagName("w:gridSpan")[0])?void 0:t.getAttribute("w:val"))?s:1),n=e.getElementsByTagName("w:vMerge")[0],o={column:r,span:a,merge:n?null!=(l=n.getAttribute("w:val"))?l:"continue":void 0,text:[...e.getElementsByTagName("w:t")].map(e=>{var r;return null!=(r=e.textContent)?r:""}).join("")};return r+=a,o})});return(0,s.jsx)("table",{className:"w-full border-collapse my-3 text-sm",children:(0,s.jsx)("tbody",{children:d.map((e,r)=>(0,s.jsx)("tr",{className:"even:bg-[var(--colorFillAlter)]",children:e.filter(e=>"continue"!==e.merge).map(e=>{var t,l;let a=1;if("restart"===e.merge)for(;(null==(l=d[r+a])||null==(t=l.find(r=>r.column===e.column))?void 0:t.merge)==="continue";)a++;return(0,s.jsx)("td",{className:"border border-[var(--borderColor)] p-2 align-top whitespace-pre-wrap",colSpan:e.span,rowSpan:a,children:e.text},e.column)})},r))})})}function P(e){let{sheet:r,zoom:t,viewportRef:a}=e,[n,o]=(0,l.useState)(1),[c,i]=(0,l.useState)(1),d=r.cells.reduce((e,r)=>Math.max(e,r.row),r.merges.reduce((e,r)=>Math.max(e,r.endRow),1)),x=r.cells.reduce((e,r)=>Math.max(e,r.col),r.merges.reduce((e,r)=>Math.max(e,r.endCol),1)),m=(0,l.useMemo)(()=>new Map(r.cells.map(e=>["".concat(e.row,":").concat(e.col),e])),[r]),h=(n-1)*50+1,j=Math.min(d,h+49),g=Math.min(x,c+19);return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-3 mb-3 text-xs text-[var(--colorTextSecondary)]",children:[(0,s.jsx)("span",{children:"原工作表物理坐标;公式使用已保存缓存值"}),(0,s.jsxs)("span",{className:"inline-flex items-center gap-2",children:["起始列 ",(0,s.jsx)(u.A,{size:"small",min:1,max:x,value:c,onChange:e=>i(null!=e?e:1)})]})]}),(0,s.jsx)(F,{zoom:t,viewportRef:a,children:(0,s.jsxs)("table",{className:"border-collapse text-xs",children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{className:"border border-[var(--borderColor)] bg-[var(--colorFillSecondary)] px-2 py-1 sticky top-0 left-0 z-[2]",children:"行"}),Array.from({length:g-c+1},(e,r)=>(0,s.jsxs)("th",{className:"border border-[var(--borderColor)] bg-[var(--colorFillSecondary)] px-2 py-1 sticky top-0 z-[1] min-w-24",children:["C",c+r]},r))]})}),(0,s.jsx)("tbody",{children:Array.from({length:j-h+1},(e,t)=>{let l=h+t;return(0,s.jsxs)("tr",{className:"even:bg-[var(--colorFillAlter)]",children:[(0,s.jsxs)("th",{className:"border border-[var(--borderColor)] bg-[var(--colorFillSecondary)] px-2 py-1 text-[var(--colorTextSecondary)] sticky left-0 z-[1]",children:["R",l]}),Array.from({length:g-c+1},(e,t)=>{var a,n,o;let i=c+t,d=m.get("".concat(l,":").concat(i)),x=r.merges.find(e=>l>=e.startRow&&l<=e.endRow&&i>=e.startCol&&i<=e.endCol);if(x&&(l!==Math.max(h,x.startRow)||i!==Math.max(c,x.startCol)))return null;let u=x?m.get("".concat(x.startRow,":").concat(x.startCol)):d,p=null!=(a=null==u?void 0:u.display)?a:"";return(0,s.jsxs)("td",{className:"border border-[var(--borderColor)] px-2 py-1 whitespace-pre-wrap align-top ".concat("number"==typeof p||"string"==typeof p&&/^-?[\d,]+(\.\d+)?$/u.test(p.trim())?"text-right tabular-nums":""," ").concat(""===p?"bg-[var(--colorFillQuaternary)]":""),rowSpan:x?Math.min(j,x.endRow)-Math.max(h,x.startRow)+1:1,colSpan:x?Math.min(g,x.endCol)-Math.max(c,x.startCol)+1:1,title:"".concat(null!=(n=null==u?void 0:u.address)?n:"R".concat(l,"C").concat(i),"\n原值: ").concat(String(null!=(o=null==u?void 0:u.value)?o:"")).concat((null==u?void 0:u.formula)?"\n公式: =".concat(u.formula):""),children:[p,(null==u?void 0:u.formula)&&(0,s.jsxs)("div",{className:"text-[10px] text-[var(--colorTextTertiary)]",children:["=",u.formula]})]},i)})]},l)})})]})}),(0,s.jsx)("div",{className:"mt-3 flex justify-end",children:(0,s.jsx)(p.A,{size:"small",current:n,pageSize:50,total:d,showSizeChanger:!1,onChange:o})})]})}function E(e){let{frameIds:r,endpoint:t,zoom:a,viewportRef:o}=e,[c,i]=(0,l.useState)(0),[d,x]=(0,l.useState)(""),[m,u]=(0,l.useState)(),[p,y]=(0,l.useState)(""),[f,b]=(0,l.useState)(!1);return(0,l.useEffect)(()=>{let e=!0;x(""),y(""),u(void 0);let s=r[c];if(s)return b(!0),(0,z.x6)("".concat(t,"&frame=").concat(encodeURIComponent(s),"&format=json")).then(r=>{e&&(x(r.image),u(r.receipt))}).catch(r=>{e&&y(String(r))}).finally(()=>{e&&b(!1)}),()=>{e=!1}},[c,r,t]),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"mb-3 flex flex-wrap items-center gap-3",children:[(0,s.jsx)(j.A,{size:"small",className:"min-w-64",value:c,onChange:i,options:r.map((e,r)=>({value:r,label:e}))}),(0,s.jsx)("span",{className:"text-xs text-[var(--colorTextSecondary)]",children:"显示实际库内实体与块实例;绘制限制不等同数据丢失。"})]}),(0,s.jsxs)(g.A,{spinning:f,children:[p&&(0,s.jsx)(h.A,{type:"warning",message:"图框显示未完成",description:"".concat(p,";请区分已入库结构和绘制能力,已有库内文字仍可读取。")}),d?(0,s.jsx)(F,{zoom:a,viewportRef:o,children:(0,s.jsx)("div",{className:"bg-white inline-block p-2",children:(0,s.jsx)(n(),{unoptimized:!0,width:2400,height:1800,src:d,alt:"已解析CAD图框",style:{width:"100%",height:"auto",display:"block"}})})}):!f&&!p&&(0,s.jsx)(v.A,{description:"尚未识别到可显示图框"}),void 0!==m&&(0,s.jsxs)("details",{className:"mt-3",children:[(0,s.jsx)("summary",{className:"text-xs cursor-pointer text-[var(--colorTextSecondary)]",children:"本次绘制回执与限制"}),(0,s.jsx)(M,{maxHeight:260,children:(0,s.jsx)("pre",{style:T,children:JSON.stringify(m,null,2)})})]})]})]})}function _(e){let{structure:r,endpoint:t,zoom:a,viewportRef:o}=e,[c,i]=(0,l.useState)(0);if(r.spreadsheet){let e=r.spreadsheet.sheets;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"mb-3",children:(0,s.jsx)(j.A,{size:"small",className:"min-w-64",value:c,options:e.map((e,r)=>({value:r,label:e.name})),onChange:i})}),e[c]&&(0,s.jsx)(P,{sheet:e[c],zoom:a,viewportRef:o},c)]})}if(r.docx)return(0,s.jsx)(s.Fragment,{children:(0,s.jsx)(F,{zoom:a,viewportRef:o,children:(0,s.jsxs)("div",{className:"mx-auto",style:{maxWidth:860},children:[r.docx.blocks.map(e=>(0,s.jsxs)("div",{id:e.id,className:"mb-4",children:[(0,s.jsxs)("div",{className:"mb-1 text-[10px] text-[var(--colorTextTertiary)]",children:[e.part," \xb7 第 ",e.index+1," 块"]}),"table"===e.kind?(0,s.jsx)(I,{block:e,parts:r.docx.parts}):(0,s.jsx)("p",{className:e.headingLevel?"font-semibold text-lg whitespace-pre-wrap mt-2":"whitespace-pre-wrap leading-8 text-sm",children:e.text}),(0,s.jsxs)("details",{children:[(0,s.jsx)("summary",{className:"text-xs cursor-pointer text-[var(--colorTextTertiary)]",children:"来源 XML"}),(0,s.jsx)(M,{maxHeight:260,children:(0,s.jsx)("pre",{style:T,children:e.xml})})]})]},e.id)),r.docx.images.map(e=>(0,s.jsxs)("div",{className:"mb-4",children:[(0,s.jsx)("div",{className:"mb-1 text-xs text-[var(--colorTextSecondary)]",children:e.name}),/^image\/(?:png|jpeg|gif|webp|svg\+xml|bmp)$/u.test(e.mediaType)?(0,s.jsx)(n(),{unoptimized:!0,width:1200,height:900,src:"".concat(t,"&image=").concat(encodeURIComponent(e.name)),alt:e.name,style:{maxWidth:"100%",height:"auto"}}):(0,s.jsx)(h.A,{type:"info",message:"已保留".concat(e.mediaType,"图片数据,浏览器未声明支持显示")})]},e.name))]})})});if(r.pdf){var d,x,m,u;let e=r.pdf.pages,t=e[c],l=null!=(x=null!=(d=null==t?void 0:t.width)?d:null==t?void 0:t.glyphs.reduce((e,r)=>Math.max(e,r.x+r.width+20),600))?x:600,n=null!=(u=null!=(m=null==t?void 0:t.height)?m:null==t?void 0:t.glyphs.reduce((e,r)=>Math.max(e,r.y+r.height+20),800))?u:800;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"mb-3 flex flex-wrap items-center justify-between gap-3",children:[(0,s.jsx)("span",{className:"text-xs text-[var(--colorTextSecondary)]",children:"显示库内已保存文字与位置;可选原版本对照不影响本页及后续生成。"}),(0,s.jsx)(p.A,{size:"small",current:c+1,pageSize:1,total:e.length,showSizeChanger:!1,onChange:e=>i(e-1)})]}),t&&(0,s.jsxs)(F,{zoom:a,viewportRef:o,children:[(0,s.jsx)("div",{className:"mx-auto bg-white shadow-sm border border-[var(--borderColor)]",style:{width:l},children:(0,s.jsx)("svg",{viewBox:"0 0 ".concat(l," ").concat(n),width:"100%",role:"img","aria-label":"解析第".concat(t.page,"页"),children:t.glyphs.map(e=>(0,s.jsx)("text",{x:e.x,y:n-e.y,fontSize:Math.max(6,e.height),children:e.str},e.id))})}),t.ocrText&&(0,s.jsxs)("div",{className:"mt-3",children:[(0,s.jsx)("div",{className:"mb-1 text-xs text-[var(--colorTextSecondary)]",children:"该页 OCR 文本"}),(0,s.jsx)(M,{maxHeight:260,children:(0,s.jsx)("pre",{style:T,children:t.ocrText})})]}),!t.glyphs.length&&!t.ocrText&&(0,s.jsx)(v.A,{description:"该页没有可展示文字,不能据此断言原页为空"})]})]})}return r.cad?(0,s.jsx)(E,{frameIds:r.cad.frameIds,endpoint:t,zoom:a,viewportRef:o}):(0,s.jsx)(v.A,{description:"此解析结果尚无结构显示适配,完整解析文字仍可查看"})}function H(){var e;let r=(0,i.useRouter)(),t="string"==typeof r.query.relativePath?r.query.relativePath:"",a="string"==typeof r.query.projectRoot?r.query.projectRoot:"",[n,o]=(0,l.useState)(),[x,u]=(0,l.useState)(""),[j,C]=(0,l.useState)(!1),[A,F]=(0,l.useState)(""),[I,P]=(0,l.useState)(1),E=(0,l.useRef)(null),H=(0,l.useRef)(0),W=new URLSearchParams({relativePath:t,...a?{projectRoot:a}:{}}),O="/api/kb/files/source-preview?".concat(W),B="".concat(O).concat((null==n?void 0:n.status)==="recorded"?"&snapshotId=".concat(n.identity.snapshotId):""),q=(0,l.useCallback)(async e=>{let r=++H.current;C(!0),u("");try{let t=await (0,z.x6)(e);r===H.current&&o(t)}catch(e){r===H.current&&u(e instanceof Error?e.message:String(e))}finally{r===H.current&&C(!1)}},[]);(0,l.useEffect)(()=>{o(void 0),t&&q(O)},[t,O,q]);let D=e=>{(e.ctrlKey||e.metaKey)&&(e.preventDefault(),P(r=>Math.min(4,Math.max(.2,Math.round((r-.1*Math.sign(e.deltaY))*100)/100))))},L=null==n?void 0:n.pdfCoverage,U=L&&"complete"!==L.status?(0,s.jsx)(h.A,{showIcon:!0,type:"warning",message:"unmeasured"===L.status?"PDF 页覆盖未记录":"PDF 页覆盖不完整",description:(0,s.jsxs)(d.A,{direction:"vertical",size:2,children:[L.pageCount?(0,s.jsx)("span",{children:"已处理页:".concat(L.processedPages,"/").concat(L.pageCount)}):(0,s.jsx)("span",{children:'没有记录到声明页数,无法据此断言"处理了几页"。'}),L.missingPages.length>0&&(0,s.jsx)("span",{children:"缺少页:".concat(L.missingPages.join(", "))}),L.failedPages.length>0&&(0,s.jsx)("span",{children:"失败页:".concat(L.failedPages.join(", "))}),(0,s.jsx)("span",{children:"这条读数只说明解析侧处理了哪些页,不证明内容、版式或专业采用正确。"})]}),className:"mt-3"}):null;return(0,s.jsxs)("div",{className:"space-y-5 animateFadeIn",children:[(0,s.jsx)("div",{className:"bg-[var(--colorBgContainer)] rounded-2xl border border-[var(--borderColor)] p-6",children:(0,s.jsxs)("div",{className:"flex flex-col md:flex-row md:items-center justify-between gap-4",children:[(0,s.jsxs)("div",{className:"flex items-center min-w-0",children:[(0,s.jsxs)(c(),{href:"/knowledge/file-detail?".concat(W),className:"mr-4 text-sm text-[var(--colorTextSecondary)] hover:text-[var(--colorText)] inline-flex items-center gap-1 shrink-0",children:[(0,s.jsx)(S.A,{})," 返回切片详情"]}),(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("h1",{className:"text-2xl font-bold text-[var(--colorText)] mb-1",children:"解析核查预览"}),(0,s.jsx)("p",{className:"text-sm text-[var(--colorTextSecondary)] m-0 break-all",children:t})]})]}),(0,s.jsxs)(d.A,{wrap:!0,className:"shrink-0",children:[(0,s.jsx)(R,{zoom:I,onChange:P,viewportRef:E}),(0,s.jsx)(m.Ay,{size:"small",icon:(0,s.jsx)(k.A,{}),onClick:()=>{q(O)},loading:j,children:"刷新"})]})]})}),x&&(0,s.jsx)(h.A,{type:"error",message:x}),(0,s.jsx)(g.A,{spinning:j,children:(null==n?void 0:n.status)==="not-recorded"?(0,s.jsxs)(y.A,{className:"rounded-2xl border-[var(--borderColor)]",children:[(0,s.jsx)(h.A,{type:"warning",message:"独立解析底稿尚未记录",description:n.reason}),U,(0,s.jsx)(m.Ay,{className:"mt-4",onClick:()=>{(async()=>{try{await (0,z.HC)(t,a||void 0),u("重新解析任务已提交,请在处理完成后刷新本页。")}catch(e){u(String(e))}})()},children:"重新解析此文件"}),(0,s.jsx)("p",{className:"mt-4 mb-2 text-sm text-[var(--colorTextSecondary)]",children:"当前实际库内切片(不是独立底稿):"}),n.chunks.map(e=>(0,s.jsxs)("div",{className:"my-3",children:[(0,s.jsxs)(f.A,{children:["切片 ",e.chunkIndex]}),(0,s.jsx)(M,{children:(0,s.jsx)("pre",{style:T,children:e.content})})]},e.id)),(0,s.jsx)("div",{className:"mt-3 flex justify-end",children:(0,s.jsx)(p.A,{current:Math.floor(n.offset/30)+1,pageSize:30,total:n.totalChunks,showSizeChanger:!1,onChange:e=>{q("".concat(O,"&offset=").concat((e-1)*30))}})})]}):(null==n?void 0:n.status)==="recorded"?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(y.A,{className:"rounded-2xl border-[var(--borderColor)] mb-5",children:[(0,s.jsxs)(b.A,{size:"small",column:{xxl:3,xl:3,lg:2,md:1,sm:1,xs:1},bordered:!0,styles:{label:{width:"120px",background:"var(--colorFillAlter)",color:"var(--colorTextSecondary)"}},children:[(0,s.jsx)(b.A.Item,{label:"原文件SHA256",children:(0,s.jsx)("span",{className:"break-all text-xs",children:n.identity.sourceHash})}),(0,s.jsx)(b.A.Item,{label:"解析版本",children:(0,s.jsx)("span",{className:"text-xs",children:n.identity.parserVersion})}),(0,s.jsx)(b.A.Item,{label:"解析身份",children:(0,s.jsx)("span",{className:"break-all text-xs",children:n.identity.snapshotId})})]}),(0,s.jsx)(h.A,{className:"mt-3",type:"verified"===n.conservation.status&&n.conservation.chunkCountMatches&&!n.conservation.staleChunkIdentities.length?"success":"error",message:"文本覆盖:".concat(n.conservation.coveredNonWhitespaceChars,"/").concat(n.conservation.sourceNonWhitespaceChars,";实际切片:").concat(n.totalChunks),description:"这项检查只证明独立解析文字与切片的内容覆盖,不证明原文件解析、版式、工程理解或专业采用全部正确。"}),U,n.identity.limitations.map(e=>(0,s.jsx)("p",{className:"mt-2 mb-0 text-xs text-[var(--colorTextSecondary)]",children:e},e)),(0,s.jsxs)(d.A,{className:"mt-3",wrap:!0,children:[(0,s.jsx)(m.Ay,{size:"small",href:"".concat(B,"&original=1"),target:"_blank",children:"查看/下载入库原版本"}),(0,s.jsx)(m.Ay,{size:"small",onClick:()=>{(0,z.tn)(t,"source-version",a||void 0).catch(e=>u("可选原版本对照不可用:".concat(String(e),";库内数据仍可读取")))},children:"本机打开入库原版本"})]})]}),(0,s.jsx)(w.A,{className:"documents-tabs",items:[{key:"structure",label:"解析结构",children:(0,s.jsx)(y.A,{className:"rounded-2xl border-[var(--borderColor)]",onWheelCapture:D,children:(0,s.jsx)(_,{structure:n.structure,endpoint:B,zoom:I,viewportRef:E},n.identity.snapshotId)})},{key:"text",label:"独立解析全文",children:(0,s.jsx)(y.A,{className:"rounded-2xl border-[var(--borderColor)]",onWheelCapture:D,children:(0,s.jsx)(M,{maxHeight:640,children:(0,s.jsx)("pre",{style:{...T,zoom:I},children:n.text})})})},{key:"chunks",label:"实际切片重组",children:(0,s.jsxs)(y.A,{className:"rounded-2xl border-[var(--borderColor)]",children:[(0,s.jsxs)("p",{className:"text-xs text-[var(--colorTextSecondary)]",children:["当前展示切片 ",n.offset+1," 至 ",n.offset+n.chunks.length,",共 ",n.totalChunks," 块;分页不代表其余内容不存在。"]}),n.chunks.map(e=>(0,s.jsxs)("div",{className:"my-4",children:[(0,s.jsxs)(d.A,{size:4,wrap:!0,children:[(0,s.jsxs)(f.A,{children:["切片 ",e.chunkIndex]}),e.sectionTitle?(0,s.jsx)(f.A,{color:"cyan",children:e.sectionTitle}):null]}),(0,s.jsx)("div",{className:"mt-2",children:(0,s.jsx)(M,{children:(0,s.jsx)("pre",{style:T,children:e.content})})}),(0,s.jsxs)("details",{className:"mt-2",children:[(0,s.jsx)("summary",{className:"text-xs cursor-pointer text-[var(--colorTextTertiary)]",children:"库内解析底稿区间"}),(0,s.jsx)(M,{maxHeight:240,children:(0,s.jsx)("pre",{style:T,children:JSON.stringify(e.sourceSpans,null,2)})})]})]},e.id)),(0,s.jsx)("div",{className:"mt-3 flex justify-end",children:(0,s.jsx)(p.A,{current:Math.floor(n.offset/30)+1,pageSize:30,total:n.totalChunks,showSizeChanger:!1,onChange:e=>{q("".concat(B,"&offset=").concat((e-1)*30))}})})]})},{key:"issues",label:"覆盖与来源问题",children:(0,s.jsx)(y.A,{className:"rounded-2xl border-[var(--borderColor)]",children:(0,s.jsx)(M,{maxHeight:640,children:(0,s.jsx)("pre",{style:T,children:JSON.stringify(n.conservation,null,2)})})})},{key:"retrieval",label:"本地定位回放",children:(0,s.jsxs)(y.A,{className:"rounded-2xl border-[var(--borderColor)]",children:[(0,s.jsx)(N.A.Search,{value:A,onChange:e=>F(e.target.value),onSearch:e=>{q("".concat(B,"&q=").concat(encodeURIComponent(e)))},enterButton:"定位",loading:j}),(0,s.jsx)("p",{className:"my-3 text-xs text-[var(--colorTextSecondary)]",children:"只在此文件内执行本地关键词检索,不调用模型;零命中不证明资料不存在,也不等于向量或规划验收通过。"}),null==(e=n.retrieval)?void 0:e.results.map(e=>(0,s.jsxs)("div",{className:"my-3",children:[(0,s.jsxs)(f.A,{children:["切片 ",e.chunkIndex]}),(0,s.jsx)("div",{className:"mt-2",children:(0,s.jsx)(M,{children:(0,s.jsx)("pre",{style:T,children:e.content})})})]},e.id)),n.retrieval&&!n.retrieval.results.length&&(0,s.jsx)(v.A,{description:"本次关键词未命中,请核对原文、对象名称及其他检索方式"})]})}]})]}):!j&&(0,s.jsx)(v.A,{description:"选择文件后查看解析结果"})})]})}},59528:(e,r,t)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/knowledge/source-preview",function(){return t(2232)}])}},e=>{e.O(0,[324,815,665,576,569,499,787,808,318,781,636,593,792],()=>e(e.s=59528)),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[12],{1611:(e,t)=>{"use strict";t.A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M832 64H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V96c0-17.7-14.3-32-32-32zm-600 72h560v208H232V136zm560 480H232V408h560v208zm0 272H232V680h560v208zM304 240a40 40 0 1080 0 40 40 0 10-80 0zm0 272a40 40 0 1080 0 40 40 0 10-80 0zm0 272a40 40 0 1080 0 40 40 0 10-80 0z"}}]},name:"database",theme:"outlined"}},12887:(e,t)=>{"use strict";t.A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494zM504 618H320c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h184c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8zM312 490v48c0 4.4 3.6 8 8 8h384c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H320c-4.4 0-8 3.6-8 8z"}}]},name:"file-text",theme:"outlined"}},13067:(e,t)=>{"use strict";t.A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494zM514.1 580.1l-61.8-102.4c-2.2-3.6-6.1-5.8-10.3-5.8h-38.4c-2.3 0-4.5.6-6.4 1.9-5.6 3.5-7.3 10.9-3.7 16.6l82.3 130.4-83.4 132.8a12.04 12.04 0 0010.2 18.4h34.5c4.2 0 8-2.2 10.2-5.7L510 664.8l62.3 101.4c2.2 3.6 6.1 5.7 10.2 5.7H620c2.3 0 4.5-.7 6.5-1.9 5.6-3.6 7.2-11 3.6-16.6l-84-130.4 85.3-132.5a12.04 12.04 0 00-10.1-18.5h-35.7c-4.2 0-8.1 2.2-10.3 5.8l-61.2 102.3z"}}]},name:"file-excel",theme:"outlined"}},14569:e=>{e.exports={featureLabel:"style_featureLabel__XFSTX",featureValue:"style_featureValue__I_wMP",filterInput:"style_filterInput__4_Elu",filterSelect:"style_filterSelect__vUBJ9",statusCard:"style_statusCard__H7Mee",statusSummary:"style_statusSummary__7KavF",statusSummaryText:"style_statusSummaryText__Shw3j",statusClearBtn:"style_statusClearBtn__uJ9bE",statusExpandBtn:"style_statusExpandBtn__HhgIj",statusFilters:"style_statusFilters__g_LbG",filterPill:"style_filterPill__1pjFW",filterPillActive:"style_filterPillActive___UZVi",statusPanel:"style_statusPanel__9arTu",statusEmpty:"style_statusEmpty__8LWzH",timelineList:"style_timelineList__dqJrz",timelineItem:"style_timelineItem__dbuL_",timelineStatusIcon:"style_timelineStatusIcon__SkRwb",timelinePercent:"style_timelinePercent__pEyH4",timelineRow:"style_timelineRow__EDOVa",timelineTitle:"style_timelineTitle__Yujr8",timelineClose:"style_timelineClose__Byx_9",timelineDetail:"style_timelineDetail__nALei",timelineDesc:"style_timelineDesc__FMjWE",timelinePath:"style_timelinePath__C9VQI",timelineMeta:"style_timelineMeta__u_pCn",timelineMetaTag:"style_timelineMetaTag__G3jF1",timelineExpandArrow:"style_timelineExpandArrow__xIBdF",timelineExpandArrowOpen:"style_timelineExpandArrowOpen__TWWDC",fileNameCell:"style_fileNameCell__EHsnt",folderName:"style_folderName__VhLXP",folderRow:"style_folderRow__d7k9S",searchResultList:"style_searchResultList__cVKZg",searchResultItem:"style_searchResultItem__boj6D",searchResultHeader:"style_searchResultHeader__meVdJ",searchContent:"style_searchContent__XbUVk",pdfPreviewStrip:"style_pdfPreviewStrip__94_eG"}},26619:(e,t,r)=>{"use strict";r.d(t,{A:()=>i});var a=r(97109),l=r(1611),n=r(88483);function s(){return(s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e}).apply(this,arguments)}let i=a.forwardRef((e,t)=>a.createElement(n.A,s({},e,{ref:t,icon:l.A})))},26631:(e,t,r)=>{"use strict";r.d(t,{A:()=>i});var a=r(97109),l=r(12887),n=r(88483);function s(){return(s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e}).apply(this,arguments)}let i=a.forwardRef((e,t)=>a.createElement(n.A,s({},e,{ref:t,icon:l.A})))},30289:(e,t)=>{"use strict";t.A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.4 800.9c.2-.3.5-.6.7-.9C920.6 722.1 960 621.7 960 512s-39.4-210.1-104.8-288c-.2-.3-.5-.5-.7-.8-1.1-1.3-2.1-2.5-3.2-3.7-.4-.5-.8-.9-1.2-1.4l-4.1-4.7-.1-.1c-1.5-1.7-3.1-3.4-4.6-5.1l-.1-.1c-3.2-3.4-6.4-6.8-9.7-10.1l-.1-.1-4.8-4.8-.3-.3c-1.5-1.5-3-2.9-4.5-4.3-.5-.5-1-1-1.6-1.5-1-1-2-1.9-3-2.8-.3-.3-.7-.6-1-1C736.4 109.2 629.5 64 512 64s-224.4 45.2-304.3 119.2c-.3.3-.7.6-1 1-1 .9-2 1.9-3 2.9-.5.5-1 1-1.6 1.5-1.5 1.4-3 2.9-4.5 4.3l-.3.3-4.8 4.8-.1.1c-3.3 3.3-6.5 6.7-9.7 10.1l-.1.1c-1.6 1.7-3.1 3.4-4.6 5.1l-.1.1c-1.4 1.5-2.8 3.1-4.1 4.7-.4.5-.8.9-1.2 1.4-1.1 1.2-2.1 2.5-3.2 3.7-.2.3-.5.5-.7.8C103.4 301.9 64 402.3 64 512s39.4 210.1 104.8 288c.2.3.5.6.7.9l3.1 3.7c.4.5.8.9 1.2 1.4l4.1 4.7c0 .1.1.1.1.2 1.5 1.7 3 3.4 4.6 5l.1.1c3.2 3.4 6.4 6.8 9.6 10.1l.1.1c1.6 1.6 3.1 3.2 4.7 4.7l.3.3c3.3 3.3 6.7 6.5 10.1 9.6 80.1 74 187 119.2 304.5 119.2s224.4-45.2 304.3-119.2a300 300 0 0010-9.6l.3-.3c1.6-1.6 3.2-3.1 4.7-4.7l.1-.1c3.3-3.3 6.5-6.7 9.6-10.1l.1-.1c1.5-1.7 3.1-3.3 4.6-5 0-.1.1-.1.1-.2 1.4-1.5 2.8-3.1 4.1-4.7.4-.5.8-.9 1.2-1.4a99 99 0 003.3-3.7zm4.1-142.6c-13.8 32.6-32 62.8-54.2 90.2a444.07 444.07 0 00-81.5-55.9c11.6-46.9 18.8-98.4 20.7-152.6H887c-3 40.9-12.6 80.6-28.5 118.3zM887 484H743.5c-1.9-54.2-9.1-105.7-20.7-152.6 29.3-15.6 56.6-34.4 81.5-55.9A373.86 373.86 0 01887 484zM658.3 165.5c39.7 16.8 75.8 40 107.6 69.2a394.72 394.72 0 01-59.4 41.8c-15.7-45-35.8-84.1-59.2-115.4 3.7 1.4 7.4 2.9 11 4.4zm-90.6 700.6c-9.2 7.2-18.4 12.7-27.7 16.4V697a389.1 389.1 0 01115.7 26.2c-8.3 24.6-17.9 47.3-29 67.8-17.4 32.4-37.8 58.3-59 75.1zm59-633.1c11 20.6 20.7 43.3 29 67.8A389.1 389.1 0 01540 327V141.6c9.2 3.7 18.5 9.1 27.7 16.4 21.2 16.7 41.6 42.6 59 75zM540 640.9V540h147.5c-1.6 44.2-7.1 87.1-16.3 127.8l-.3 1.2A445.02 445.02 0 00540 640.9zm0-156.9V383.1c45.8-2.8 89.8-12.5 130.9-28.1l.3 1.2c9.2 40.7 14.7 83.5 16.3 127.8H540zm-56 56v100.9c-45.8 2.8-89.8 12.5-130.9 28.1l-.3-1.2c-9.2-40.7-14.7-83.5-16.3-127.8H484zm-147.5-56c1.6-44.2 7.1-87.1 16.3-127.8l.3-1.2c41.1 15.6 85 25.3 130.9 28.1V484H336.5zM484 697v185.4c-9.2-3.7-18.5-9.1-27.7-16.4-21.2-16.7-41.7-42.7-59.1-75.1-11-20.6-20.7-43.3-29-67.8 37.2-14.6 75.9-23.3 115.8-26.1zm0-370a389.1 389.1 0 01-115.7-26.2c8.3-24.6 17.9-47.3 29-67.8 17.4-32.4 37.8-58.4 59.1-75.1 9.2-7.2 18.4-12.7 27.7-16.4V327zM365.7 165.5c3.7-1.5 7.3-3 11-4.4-23.4 31.3-43.5 70.4-59.2 115.4-21-12-40.9-26-59.4-41.8 31.8-29.2 67.9-52.4 107.6-69.2zM165.5 365.7c13.8-32.6 32-62.8 54.2-90.2 24.9 21.5 52.2 40.3 81.5 55.9-11.6 46.9-18.8 98.4-20.7 152.6H137c3-40.9 12.6-80.6 28.5-118.3zM137 540h143.5c1.9 54.2 9.1 105.7 20.7 152.6a444.07 444.07 0 00-81.5 55.9A373.86 373.86 0 01137 540zm228.7 318.5c-39.7-16.8-75.8-40-107.6-69.2 18.5-15.8 38.4-29.7 59.4-41.8 15.7 45 35.8 84.1 59.2 115.4-3.7-1.4-7.4-2.9-11-4.4zm292.6 0c-3.7 1.5-7.3 3-11 4.4 23.4-31.3 43.5-70.4 59.2-115.4 21 12 40.9 26 59.4 41.8a373.81 373.81 0 01-107.6 69.2z"}}]},name:"global",theme:"outlined"}},35311:(e,t)=>{"use strict";t.A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M456 231a56 56 0 10112 0 56 56 0 10-112 0zm0 280a56 56 0 10112 0 56 56 0 10-112 0zm0 280a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"more",theme:"outlined"}},45551:(e,t,r)=>{"use strict";r.d(t,{Jm:()=>o,fw:()=>n,je:()=>a.j,mc:()=>c,z3:()=>l});var a=r(96538);function l(e){if(0===e)return"0 B";let t=Math.floor(Math.log(e)/Math.log(1024)),r=e/Math.pow(1024,t);return"".concat(r.toFixed(+(0!==t))," ").concat(["B","KB","MB","GB","TB"][t])}function n(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"zh-CN";if(!e||e<=0)return"en-US"===t?"Never":"从未";let r=Math.floor(Math.floor((Date.now()-e)/1e3)/60),a=Math.floor(r/60),l=Math.floor(a/24);return l>30?new Date(e).toLocaleDateString(t):"en-US"===t?l>0?"".concat(l,"d ago"):a>0?"".concat(a,"h ago"):r>0?"".concat(r,"m ago"):"Just now":l>0?"".concat(l," 天前"):a>0?"".concat(a," 小时前"):r>0?"".concat(r," 分钟前"):"刚刚"}let s={document:"文档",spreadsheet:"表格",image:"图片",cad:"图纸",code:"代码",data:"数据",web:"网页",diagram:"图表",archive:"压缩包",other:"其他"},i={document:"Document",spreadsheet:"Spreadsheet",image:"Image",cad:"CAD",code:"Code",data:"Data",web:"Web",diagram:"Diagram",archive:"Archive",other:"Other"};function o(e){var t;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"zh-CN";return null!=(t=("en-US"===r?i:s)[e])?t:e}let c={active:"common.statusIndexed",outdated:"common.statusOutdated",error:"common.statusAbnormal",deleted:"common.statusDeleted",disk:"common.statusNotIndexed"}},48893:(e,t)=>{"use strict";t.A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M553.1 509.1l-77.8 99.2-41.1-52.4a8 8 0 00-12.6 0l-99.8 127.2a7.98 7.98 0 006.3 12.9H696c6.7 0 10.4-7.7 6.3-12.9l-136.5-174a8.1 8.1 0 00-12.7 0zM360 442a40 40 0 1080 0 40 40 0 10-80 0zm494.6-153.4L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494z"}}]},name:"file-image",theme:"outlined"}},53234:(e,t)=>{"use strict";t.A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M832 64H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V96c0-17.7-14.3-32-32-32zm-600 72h560v208H232V136zm560 480H232V408h560v208zm0 272H232V680h560v208zM496 208H312c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h184c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8zM312 544h184c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H312c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8zm328 244a40 40 0 1080 0 40 40 0 10-80 0z"}}]},name:"hdd",theme:"outlined"}},54746:(e,t,r)=>{"use strict";r.d(t,{A:()=>i});var a=r(97109),l=r(71242),n=r(88483);function s(){return(s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e}).apply(this,arguments)}let i=a.forwardRef((e,t)=>a.createElement(n.A,s({},e,{ref:t,icon:l.A})))},56398:(e,t)=>{"use strict";t.A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M505.7 661a8 8 0 0012.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9h-74.1V168c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"}}]},name:"download",theme:"outlined"}},58520:(e,t)=>{"use strict";t.A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494zM528.1 472h-32.2c-5.5 0-10.3 3.7-11.6 9.1L434.6 680l-46.1-198.7c-1.3-5.4-6.1-9.3-11.7-9.3h-35.4a12.02 12.02 0 00-11.6 15.1l74.2 276c1.4 5.2 6.2 8.9 11.6 8.9h32c5.4 0 10.2-3.6 11.6-8.9l52.8-197 52.8 197c1.4 5.2 6.2 8.9 11.6 8.9h31.8c5.4 0 10.2-3.6 11.6-8.9l74.4-276a12.04 12.04 0 00-11.6-15.1H647c-5.6 0-10.4 3.9-11.7 9.3l-45.8 199.1-49.8-199.3c-1.3-5.4-6.1-9.1-11.6-9.1z"}}]},name:"file-word",theme:"outlined"}},58690:(e,t,r)=>{"use strict";function a(e){var t,r,a;let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{defaultPageSize:null!=(t=l.pageSize)?t:10,pageSizeOptions:null!=(r=l.pageSizeOptions)?r:[10,20,50,100],showSizeChanger:!0,showTotal:t=>{var r,a;return e(null!=(r=l.totalLabelKey)?r:"common.totalRows",null!=(a=l.totalLabelFallback)?a:"共 {count} 条").replace("{count}",String(t))},hideOnSinglePage:null!=(a=l.hideOnSinglePage)&&a,showQuickJumper:!1}}r.d(t,{B:()=>a})},61825:(e,t,r)=>{"use strict";r.d(t,{A:()=>i});var a=r(97109),l=r(30289),n=r(88483);function s(){return(s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e}).apply(this,arguments)}let i=a.forwardRef((e,t)=>a.createElement(n.A,s({},e,{ref:t,icon:l.A})))},71242:(e,t)=>{"use strict";t.A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8z"}},{tag:"path",attrs:{d:"M192 474h672q8 0 8 8v60q0 8-8 8H160q-8 0-8-8v-60q0-8 8-8z"}}]},name:"plus",theme:"outlined"}},74183:(e,t,r)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/knowledge",function(){return r(84607)}])},76830:(e,t,r)=>{"use strict";r.d(t,{A:()=>i});var a=r(97109),l=r(56398),n=r(88483);function s(){return(s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e}).apply(this,arguments)}let i=a.forwardRef((e,t)=>a.createElement(n.A,s({},e,{ref:t,icon:l.A})))},84607:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>es});var a=r(65321),l=r(97109),n=r(32244),s=r(43220),i=r.n(s),o=r(86109),c=r(17807),d=r(25258),u=r(11702),h=r(71102),f=r(85114),m=r(7576),p=r(57271),g=r(33442),v=r(38964),x=r(56768),y=r(48893),b=r(88483);function w(){return(w=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e}).apply(this,arguments)}let j=l.forwardRef((e,t)=>l.createElement(b.A,w({},e,{ref:t,icon:y.A})));var _=r(13067);function A(){return(A=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e}).apply(this,arguments)}let k=l.forwardRef((e,t)=>l.createElement(b.A,A({},e,{ref:t,icon:_.A})));var z=r(58520);function C(){return(C=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e}).apply(this,arguments)}let S=l.forwardRef((e,t)=>l.createElement(b.A,C({},e,{ref:t,icon:z.A})));var M=r(90939);function P(){return(P=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e}).apply(this,arguments)}let O=l.forwardRef((e,t)=>l.createElement(b.A,P({},e,{ref:t,icon:M.A})));var N=r(53234);function H(){return(H=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e}).apply(this,arguments)}let E=l.forwardRef((e,t)=>l.createElement(b.A,H({},e,{ref:t,icon:N.A})));var R=r(61825),F=r(26619),V=r(29606),B=r(26631),T=r(64254),L=r(64629),I=r(58209),D=r(35311);function q(){return(q=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e}).apply(this,arguments)}let U=l.forwardRef((e,t)=>l.createElement(b.A,q({},e,{ref:t,icon:D.A})));var J=r(30486),Q=r(54746),X=r(58740),W=r(38762),K=r(76830),G=r(39219),$=r(22931),Z=r(6578),Y=r(45551),ee=r(14569),et=r.n(ee),er=r(58690);let ea=["document","spreadsheet","image","cad","code","data","web","diagram","archive","other"],el=/\.(zip|jar|war|apk|tar|gz|tgz|bz2|rar|7z)$/iu,en=/(^|\/)\.DS_Store$|(^|\/)Thumbs\.db$|(^|\/)__MACOSX\/|\.bak$/iu;function es(){let e=(0,n.Vr)("knowledge"),{locale:t}=(0,n.x_)(),{message:r}=c.A.useApp(),[s,y]=(0,l.useState)(!1),[b,w]=(0,l.useState)([]),[_,A]=(0,l.useState)(""),[z,C]=(0,l.useState)(!1),M=(0,l.useCallback)(async()=>{try{w(await (0,Z.Ls)())}catch(t){r.error(e("ignoreRulesLoadFailed"))}},[e]),P=(0,l.useCallback)(()=>{y(!0),A(""),M()},[M]),N=(0,l.useCallback)(async()=>{let t=_.trim();if(t){C(!0);try{await (0,Z.YO)([t]),A(""),await M(),r.success(e("ignoreRulesAdded"))}catch(t){r.error(e("ignoreRulesSaveFailed"))}finally{C(!1)}}},[_,M,e]),H=(0,l.useCallback)(async t=>{C(!0);try{await (0,Z.Pw)(t),await M(),r.success(e("ignoreRulesDeleted"))}catch(t){r.error(e("ignoreRulesSaveFailed"))}finally{C(!1)}},[M,e]),D=(0,o.useRouter)(),q="string"==typeof D.query.category?D.query.category:"",{stats:ee,reload:es}=function(){let[e,t]=(0,l.useState)(null),[r,a]=(0,l.useState)(!1),n=(0,l.useCallback)(async()=>{a(!0);try{t(await (0,Z.hc)())}catch(e){}finally{a(!1)}},[]);return(0,l.useEffect)(()=>{n()},[n]),{stats:e,loading:r,reload:n}}(),[ei,eo]=(0,l.useState)([]),[ec,ed]=(0,l.useState)(!1),[eu,eh]=(0,l.useState)(""),[ef,em]=(0,l.useState)(""),[ep,eg]=(0,l.useState)(q),[ev,ex]=(0,l.useState)(!1),[ey,eb]=(0,l.useState)(!1),[ew,ej]=(0,l.useState)([]),[e_,eA]=(0,l.useState)([]),[ek,ez]=(0,l.useState)([]),[eC,eS]=(0,l.useState)({}),eM=(0,l.useRef)(ep),eP=(0,l.useRef)(new Set),eO=(0,l.useRef)(new Map);(0,l.useEffect)(()=>{eM.current=ep},[ep]),(0,l.useEffect)(()=>{eg("string"==typeof D.query.category?D.query.category:"")},[D.query.category]);let eN=(0,l.useCallback)(async()=>{try{let e=await (0,Z.BO)(),t={};for(let r of e)t[r.category]=r.fileCount;eS(t)}catch(e){}},[]);(0,l.useEffect)(()=>{eN()},[eN]);let eH=(0,l.useCallback)(async(e,t)=>{let r=null!=e?e:eM.current;(null==t?void 0:t.silent)||(ed(!0),eh(""));try{let e=await (0,Z.HT)({category:r||void 0,limit:5e3});eo(e.files||[]),e.initializing&&window.setTimeout(()=>{eH(r,{silent:!0})},3e3)}catch(e){(null==t?void 0:t.silent)||(eo([]),eh(e instanceof Error?e.message:"文件列表加载失败"))}finally{(null==t?void 0:t.silent)||ed(!1)}},[]);(0,l.useEffect)(()=>{eH(ep)},[ep,eH]);let eE=(0,l.useCallback)(async e=>{await eH(void 0,e),es(),eN()},[eN,eH,es]),eR=e=>"document"===e.type?null:{id:e.id,type:e.type,title:e.title,description:e.message,status:e.status,percent:e.percent,filePath:e.filePath,chunkCount:e.chunkCount,textLength:e.textLength,extractionMode:e.extractionMode,error:e.error,createdAt:e.createdAt},eF=(0,l.useCallback)(async()=>{try{let t=await (0,Z.Qx)(),r=t.operations.map(eR).filter(e=>!!e);for(let r of[...eP.current]){var e;let a=t.operations.find(e=>e.id===r);if(!a)continue;let l="".concat(a.status,":").concat(a.stage),n=null!=(e=eO.current.get(r))?e:"";"success"===a.status||"error"===a.status?(eP.current.delete(r),eO.current.delete(r),eE({silent:!0})):l!==n&&(eO.current.set(r,l),eE({silent:!0}))}ej(e=>{let t=new Set(r.map(e=>e.id).filter(Boolean)),a=r.map(t=>{var r;let a=e.find(e=>e.id===t.id);return a?{...a,...t,createdAt:null!=(r=a.createdAt)?r:t.createdAt}:t}),l=e.filter(e=>e.id&&!t.has(e.id)&&"processing"===e.status);return[...a,...l].slice(0,50)})}catch(e){}},[eE]),eV=(0,l.useCallback)(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];ej(r=>{let a=r.findIndex(r=>e.id&&r.id===e.id||t.includes(r.title));if(a>=0){var l;let t=[...r];return t[a]={...r[a],...e,createdAt:null!=(l=r[a].createdAt)?l:e.createdAt},t}return[e,...r].slice(0,50)})},[]);(0,l.useEffect)(()=>{eF()},[eF]);let eB=(0,l.useMemo)(()=>{let e=0,t=0,r=0;for(let a of ew)"processing"===a.status?e++:"success"===a.status?t++:("error"===a.status||"warning"===a.status)&&r++;return{processing:e,success:t,error:r}},[ew]);(0,l.useEffect)(()=>{if(0===eB.processing)return;let e=window.setInterval(()=>{eF()},2e3),t=window.setInterval(()=>{eE({silent:!0})},8e3);return()=>{window.clearInterval(e),window.clearInterval(t)}},[eF,eE,eB.processing]);let eT=async e=>{let t=e.filter(e=>{let t=e.webkitRelativePath||e.name;return e.size>0&&!el.test(e.name)&&!en.test(t)}),a=e.length-t.length;if(a>0&&r.warning("已跳过 ".concat(a," 个空文件、系统文件、备份文件或压缩包")),0===t.length)return;let l=1===t.length?t[0].name:"".concat(t.length," 个文件");ex(!0);let n="".concat(Date.now(),"-").concat(Math.random().toString(36).slice(2));eP.current.add(n),eO.current.set(n,""),eV({id:n,type:"upload",title:"上传 ".concat(l),description:"等待上传、解析、切片和入库;同路径文件会更新,其他已有文件不会清除",status:"processing",percent:5});try{await (0,Z.c1)(t,void 0,n,e=>{eV({id:n,type:"upload",title:"上传 ".concat(l),description:"正在上传文件:".concat(e.uploadedFiles,"/").concat(e.totalFiles,",批次 ").concat(e.batchIndex+1,"/").concat(e.totalBatches),status:"processing",percent:Math.min(5,Math.max(1,Math.round(e.uploadedFiles/Math.max(1,e.totalFiles)*5)))})});let e=ef||ep?"当前筛选(".concat([ef?"搜索「".concat(ef,"」"):"",ep?"分类「".concat(ep,"」"):""].filter(Boolean).join(" + "),")不会自动清空——新文件若未出现在列表里,调整筛选即可看到"):"新文件会随解析进度出现在列表里";r.info("文件已上传,正在后台解析、切片和入库;同路径文件会更新,其他已有文件不会清除,可在顶部“后台任务”查看进度。".concat(e)),await eF()}catch(e){if(e instanceof Z.NH){let t=e.failures.slice(0,3).map(e=>"批次 ".concat(e.batchIndex+1,"(").concat(e.files.join("、")).concat(e.files.length<5?"":" 等","):").concat(e.message)).join(";");r.warning("".concat(e.message,",失败文件可重新选择上传")),eV({id:n,type:"upload",title:"部分文件上传失败 ".concat(l),description:t||e.message,status:"warning",percent:100,error:t||e.message})}else{eP.current.delete(n),eO.current.delete(n);let t=e instanceof Error?e.message:"请重试或检查文件格式";r.error(t||"上传失败"),eV({id:n,type:"error",title:"上传失败 ".concat(l),description:t,status:"error",percent:100})}}finally{ex(!1),eE({silent:!0})}},eL=async()=>{eb(!0);let e="reindex-ui-".concat(Date.now());eV({id:e,type:"reindex",title:"重新解析入库",description:"正在提交后台任务",status:"processing",percent:5});try{var t;let a=await (0,Z.H1)(),l=a.operationId||e,n=a.job;r.info(a.alreadyRunning?"已有重新解析任务正在后台执行":"已提交重新解析入库任务,可在顶部“后台任务”查看进度"),eV({id:l,type:"reindex",title:(null==n?void 0:n.title)||"重新解析入库",description:(null==n?void 0:n.message)||"后台将重新扫描文件、解析、切片并重建索引",status:(null==n?void 0:n.status)||"processing",percent:null!=(t=null==n?void 0:n.percent)?t:10,error:null==n?void 0:n.error},["重新解析入库"]);for(let e=0;e<360;e++){let e=await (0,Z.ax)(l).then(e=>e.job).catch(async()=>(await (0,Z.Qx)()).operations.find(e=>e.id===l));if(e){let t="success"===e.status||"error"===e.status;if(eV({id:l,type:"error"===e.status?"error":"reindex",title:"success"===e.status?"重新解析入库完成":"error"===e.status?"重新解析入库失败":e.title,description:e.error||e.message,status:e.status,percent:e.percent,filePath:e.filePath,chunkCount:e.chunkCount,error:e.error}),t){"success"===e.status?r.success(e.message||"重新解析入库完成"):r.error(e.error||e.message||"重新解析入库失败");break}}await new Promise(e=>setTimeout(e,1e3))}await eE(),await eF()}catch(a){let t=a instanceof Error?a.message:"重新解析入库失败";r.error(t),eV({id:e,type:"error",title:"重新解析入库失败",description:t,status:"error",percent:100},["重新解析入库","重新解析入库完成","重新解析入库失败"])}finally{eb(!1)}},eI=async function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a="file-reindex-ui-".concat(Date.now(),"-").concat(Math.random().toString(36).slice(2));eV({id:a,type:"reindex",title:"".concat(t?"重新解析文件夹":"重新解析"," ").concat(e),description:t?"正在提交文件夹后台任务":"正在提交单文件后台任务",status:"processing",percent:5,filePath:e});try{var l;let t=await (0,Z.HC)(e),n=t.operationId||a,s=t.job;r.info(t.alreadyRunning?"已有知识库任务正在后台执行":"已提交单文件重新解析任务"),eV({id:n,type:"reindex",title:(null==s?void 0:s.title)||"重新解析 ".concat(e),description:(null==s?void 0:s.message)||"后台将重新解析、分块并入库该文件",status:(null==s?void 0:s.status)||"processing",percent:null!=(l=null==s?void 0:s.percent)?l:10,filePath:(null==s?void 0:s.filePath)||e,chunkCount:null==s?void 0:s.chunkCount,error:null==s?void 0:s.error},["重新解析 ".concat(e)]);for(let t=0;t<240;t++){let t=await (0,Z.ax)(n).then(e=>e.job).catch(async()=>(await (0,Z.Qx)()).operations.find(e=>e.id===n));if(t){let a="success"===t.status||"error"===t.status;if(eV({id:n,type:"error"===t.status?"error":"reindex",title:"success"===t.status?"重新解析完成 ".concat(e):"error"===t.status?"重新解析失败 ".concat(e):t.title,description:t.error||t.message,status:t.status,percent:t.percent,filePath:t.filePath||e,chunkCount:t.chunkCount,error:t.error}),await eH(),a){"success"===t.status?r.success(t.message||"单文件重新解析完成"):r.error(t.error||t.message||"单文件重新解析失败");break}}await new Promise(e=>setTimeout(e,1e3))}await eE(),await eF()}catch(l){let t=l instanceof Error?l.message:"单文件重新解析失败";r.error(t),eV({id:a,type:"error",title:"重新解析失败 ".concat(e),description:t,status:"error",percent:100,filePath:e},["重新解析 ".concat(e)])}},eD=t=>{let a="selected"===t?eY:"filtered"===t?eU.map(e=>e.relativePath):[],l=ei.length;if("all"!==t&&0===a.length||"all"===t&&0===l)return void r.info("没有可删除的文件");let n="all"===t?"删除全部文件 ".concat(l," 个?"):"filtered"===t?"删除当前筛选结果中的文件 ".concat(a.length," 个?"):"删除已选文件 ".concat(a.length," 个?");d.A.confirm({title:n,content:"将同时删除文件、切片、索引和向量记录。此操作不可撤销。",okText:e("common.delete"),cancelText:e("common.cancel"),okButtonProps:{danger:!0},onOk:async()=>{ej(e=>[{type:"delete",title:n,description:"正在批量删除文件和索引",status:"processing",percent:10},...e].slice(0,50));try{var e;let n=null!=(e=("all"===t?await (0,Z.X8)():"selected"===t?await (0,Z.tZ)(eZ,e$):await (0,Z.SJ)(a)).deleted)?e:"all"===t?l:a.length;r.success("已删除 ".concat(n," 个文件")),eA([]),ej(e=>[{type:"delete",title:"批量删除完成",description:"已删除 ".concat(n," 个文件、切片和索引"),status:"success"},...e].slice(0,50)),await eE(),await eF()}catch(t){let e=t instanceof Error&&t.message?t.message:"批量删除失败";r.error(e),ej(t=>[{type:"error",title:"批量删除失败",description:e,status:"error"},...t].slice(0,50))}}})},eq=async()=>{if(0===eZ.length&&0===e$.length)return;let t=r.loading(e("exporting"),0);try{let{blob:t,fileName:a,exported:l,skipped:n}=await (0,Z.G8)({relativePaths:eZ,folderPaths:e$}),s=URL.createObjectURL(t),i=document.createElement("a");i.href=s,i.download=a,document.body.appendChild(i),i.click(),i.remove(),URL.revokeObjectURL(s),n>0?r.warning(e("exportParsedSkipped").replace("{count}",String(n))):r.success(e("exportParsedSuccess").replace("{count}",String(l)))}catch(t){r.error(t instanceof Error&&t.message?t.message:e("exportParsedFailed"))}finally{t()}},eU=(0,l.useMemo)(()=>ef?ei.filter(e=>e.relativePath.toLowerCase().includes(ef.toLowerCase())):ei,[ef,ei]),eJ=(0,l.useMemo)(()=>new Set(eU.map(e=>e.relativePath)),[eU]),eQ=(0,l.useMemo)(()=>ei.filter(e=>"error"===e.status).length,[ei]),eX=(0,l.useMemo)(()=>{let r=ea.filter(e=>"other"!==e),a=Object.keys(eC).filter(e=>!r.includes(e)&&"other"!==e);return[{label:e("allCategories"),value:""},...[...r,...a,"other"].map(e=>{var r;let a=null!=(r=eC[e])?r:0,l=(0,Y.Jm)(e,t);return{label:a>0?"".concat(l," (").concat(a,")"):l,value:e}})]},[eC,t,e]),eW=(0,l.useMemo)(()=>{let e={};for(let r of[...eU].sort((e,t)=>e.relativePath.localeCompare(t.relativePath))){let a=r.relativePath.split("/"),l="";for(let n=0;n<a.length;n++){let s=a[n],i=l;l=l?"".concat(l,"/").concat(s):s;let o=n===a.length-1;if(e[l])o||e[l].isFolder?o&&(e[l].isFolder=!1,e[l].file=r,e[l].fileCount=1,e[l].totalSize=r.fileSize,e[l].totalChunks=r.chunkCount):(e[l].isFolder=!0,e[l].children=[],e[l].fileCount=0,e[l].totalSize=0,e[l].totalChunks=0);else{var t;e[l]={key:l,name:s,isFolder:!o,...o?{file:r,fileCount:1,totalSize:r.fileSize,totalChunks:r.chunkCount}:{children:[],fileCount:0,totalSize:0,totalChunks:0}},i&&(null==(t=e[i])?void 0:t.children)&&e[i].children.push(e[l])}}}let r=e=>{for(let n of e)if(n.children){r(n.children);let e=0,s=0,i=0;for(let r of n.children){var t,a,l;e+=null!=(t=r.fileCount)?t:0,s+=null!=(a=r.totalSize)?a:0,i+=null!=(l=r.totalChunks)?l:0}n.fileCount=e,n.totalSize=s,n.totalChunks=i}},a=e=>e.map(e=>e.children?{...e,children:a(e.children)}:e).filter(e=>{var t,r,a;return!e.isFolder||(null!=(r=e.fileCount)?r:0)>0&&(null!=(a=null==(t=e.children)?void 0:t.length)?a:0)>0}),l=Object.values(e).filter(e=>!e.key.includes("/"));return r(l),a(l)},[eU]),eK=(0,l.useMemo)(()=>{let e=[],t=r=>{for(let a of r)e.push(a.key),a.children&&t(a.children)};return t(eW),e},[eW]),eG=(0,l.useMemo)(()=>new Set([...eJ,...eK]),[eK,eJ]),e$=(0,l.useMemo)(()=>e_.map(String).filter(e=>!eJ.has(e)&&eK.includes(e)),[eK,e_,eJ]),eZ=(0,l.useMemo)(()=>e_.map(String).filter(e=>eJ.has(e)),[e_,eJ]),eY=(0,l.useMemo)(()=>{let e=new Set;for(let t of eZ){let r=ei.find(e=>e.relativePath===t);r&&e.add(r.relativePath)}for(let t of e$){let r="".concat(t,"/");for(let t of ei)t.relativePath.startsWith(r)&&e.add(t.relativePath)}return Array.from(e)},[ei,eZ,e$]),e0=eY.length;(0,l.useEffect)(()=>{eA(e=>e.filter(e=>eG.has(String(e))))},[eG]);let e1=(0,l.useRef)(ef);(0,l.useEffect)(()=>{e1.current!==ef&&(e1.current=ef,ez(ef?eK:[]))},[ef,eK]);let e4=(e,t)=>{ez(r=>e?[...r,t.key]:r.filter(e=>e!==t.key))},e2=[{title:e("fileName"),dataIndex:"name",key:"name",render:(e,t)=>(0,a.jsxs)("span",{className:et().fileNameCell,children:[t.isFolder?(0,a.jsx)("span",{style:{cursor:"pointer"},onClick:e=>{e.stopPropagation(),e4(!ek.includes(t.key),t)},children:(e=>{let t=e.children;return t&&0!==t.length?(0,a.jsx)(T.A,{style:{color:"#fa8c16",fontSize:15}}):(0,a.jsx)(V.A,{style:{color:"#fa8c16",fontSize:15}})})(t)}):(e=>{if(!e)return(0,a.jsx)(x.A,{style:{fontSize:15}});let t=e.category;return"image"===t?(0,a.jsx)(j,{style:{color:"#eb2f96",fontSize:15}}):"spreadsheet"===t?(0,a.jsx)(k,{style:{color:"#52c41a",fontSize:15}}):"document"===t?(0,a.jsx)(S,{style:{color:"#1677ff",fontSize:15}}):"code"===t?(0,a.jsx)(O,{style:{color:"#fa8c16",fontSize:15}}):"archive"===t?(0,a.jsx)(E,{style:{color:"#8c8c8c",fontSize:15}}):"web"===t?(0,a.jsx)(R.A,{style:{color:"#13c2c2",fontSize:15}}):"data"===t?(0,a.jsx)(F.A,{style:{color:"#722ed1",fontSize:15}}):"cad"===t?(0,a.jsx)(V.A,{style:{color:"#fa541c",fontSize:15}}):"diagram"===t?(0,a.jsx)(j,{style:{color:"#a0d911",fontSize:15}}):(0,a.jsx)(B.A,{style:{fontSize:15}})})(t.file),t.isFolder?(0,a.jsx)("span",{className:et().folderName,onClick:e=>{e.stopPropagation(),e4(!ek.includes(t.key),t)},children:t.name}):(0,a.jsx)(a.Fragment,{children:(0,a.jsx)(i(),{className:"min-w-0 max-w-[520px] whitespace-normal break-words leading-relaxed",href:"/knowledge/file-detail?relativePath=".concat(encodeURIComponent(t.key)),children:t.name})})]})},{title:e("fileCategory"),dataIndex:"category",key:"cat",width:110,render:(e,r)=>{var l,n;return r.isFolder?(0,a.jsx)("span",{style:{color:"var(--colorTextQuaternary)"},children:"—"}):(0,a.jsx)(u.A,{children:(0,Y.Jm)(null!=(n=null==(l=r.file)?void 0:l.category)?n:"",t)})}},{title:e("fileSize"),dataIndex:"fileSize",key:"size",width:90,render:(e,t)=>{var r,a,l;return(0,Y.z3)(t.isFolder?null!=(a=t.totalSize)?a:0:null!=(l=null==(r=t.file)?void 0:r.fileSize)?l:0)}},{title:e("chunksCount"),dataIndex:"chunkCount",key:"chunks",width:80,render:(e,t)=>{var r,l,n;let s=t.isFolder?null!=(l=t.totalChunks)?l:0:null!=(n=null==(r=t.file)?void 0:r.chunkCount)?n:0;return(0,a.jsx)(u.A,{color:s>1?"green":"orange",children:s})}},{title:e("parsingStatus"),dataIndex:"status",key:"status",width:100,render:(e,t)=>{var r,l,n,s;return t.isFolder?(0,a.jsx)("span",{style:{color:"var(--colorTextQuaternary)"},children:"—"}):(0,a.jsx)(u.A,{color:"active"===(s=null==(r=t.file)?void 0:r.status)?"green":"processing"===s||"indexing"===s?"blue":"error"===s?"red":"orange",children:(null==(l=t.file)?void 0:l.errorMessage)||(null==(n=t.file)?void 0:n.status)||"—"})}},{title:e("fileDate"),dataIndex:"mtime",key:"date",width:130,render:(e,r)=>{var l;return r.isFolder?(0,a.jsx)("span",{style:{color:"var(--colorTextQuaternary)"},children:"—"}):(null==(l=r.file)?void 0:l.mtime)?new Date(r.file.mtime).toLocaleDateString(t):"—"}},{title:e("source"),key:"source",width:100,render:(t,r)=>r.isFolder?(0,a.jsx)("span",{style:{color:"var(--colorTextQuaternary)"},children:"—"}):(0,a.jsx)(u.A,{color:"cyan",children:e("fileSource")})},{title:"",key:"act",width:80,align:"center",render:(t,l)=>{var n;return(0,a.jsx)(h.A,{menu:{items:l.isFolder?[{key:"reindex-folder",label:"重新索引文件夹",icon:(0,a.jsx)(L.A,{}),disabled:(null!=(n=l.fileCount)?n:0)===0,onClick:()=>{eI(l.key,!0)}}]:[{key:"reindex",label:e("reindex"),icon:(0,a.jsx)(L.A,{}),onClick:()=>{eI(l.file.relativePath)}},{type:"divider"},{key:"delete",label:e("delete"),icon:(0,a.jsx)(I.A,{}),danger:!0,onClick:()=>{var t;return t=l.file,void d.A.confirm({title:e("delete"),content:e("deleteConfirm"),okText:e("common.confirm"),cancelText:e("common.cancel"),okButtonProps:{danger:!0},onOk:async()=>{ej(e=>[{type:"delete",title:"删除 ".concat(t.relativePath),description:"正在删除文件记录",status:"processing"},...e].slice(0,50));try{await (0,Z.xq)(t.relativePath),r.success("已删除"),ej(e=>[{type:"delete",title:"删除完成 ".concat(t.relativePath),description:"文件和索引记录已移除",status:"success"},...e].slice(0,50)),eA([]),await eE(),await eF()}catch(a){let e=a instanceof Error&&a.message?a.message:"删除失败";r.error(e),ej(r=>[{type:"error",title:"删除失败 ".concat(t.relativePath),description:e,status:"error"},...r].slice(0,50))}}})}}]},trigger:["click"],children:(0,a.jsx)(f.Ay,{type:"text",size:"small",icon:(0,a.jsx)(U,{})})})}}],e3=(0,a.jsxs)("div",{className:"flex flex-1 md:flex-none w-full md:w-auto items-center gap-3",children:[(0,a.jsx)(m.A,{placeholder:e("searchPlaceholder"),prefix:(0,a.jsx)(J.A,{className:"text-[var(--colorTextTertiary)]"}),value:ef,onChange:e=>{em(e.target.value)},allowClear:!0,variant:"borderless",className:"max-w-[420px] flex-1 bg-transparent hover:bg-transparent focus:bg-transparent",style:{borderBottom:"1px solid var(--borderColor)",borderRadius:0,paddingLeft:0,paddingRight:0}}),(0,a.jsx)(p.A,{value:ep||void 0,onChange:e=>{eg(e||"")},placeholder:e("filterCategory"),allowClear:!0,style:{width:170},variant:"borderless",options:eX}),(0,a.jsx)("div",{className:"w-[1px] h-6 bg-[var(--borderColor)] mx-1"}),(0,a.jsx)(h.A,{menu:{items:[{key:"file",label:e("uploadFiles"),icon:(0,a.jsx)(x.A,{}),onClick:()=>{var e;return null==(e=document.getElementById("kb-file-upload-input"))?void 0:e.click()}},{key:"folder",label:e("uploadFolder"),icon:(0,a.jsx)(V.A,{}),onClick:()=>{var e;return null==(e=document.getElementById("kb-folder-upload-input"))?void 0:e.click()}},{type:"divider"},{key:"reindex",label:e("reindexAll"),icon:(0,a.jsx)(L.A,{}),onClick:()=>{eL()},danger:!0}]},trigger:["click"],children:(0,a.jsx)(f.Ay,{type:"primary",icon:(0,a.jsx)(Q.A,{}),loading:ev||ey,className:"rounded-md px-4",children:e("new")})}),(0,a.jsx)("input",{id:"kb-file-upload-input",type:"file",multiple:!0,hidden:!0,accept:".pdf,.doc,.docx,.txt,.md,.csv,.tsv,.xls,.xlsx,.png,.jpg,.jpeg,.webp,.svg,.dwg,.dxf,.step,.stp,.iges,.igs,.js,.ts,.tsx,.jsx,.py,.go,.java,.cs,.cpp,.c,.h,.json,.jsonl,.yaml,.yml,.xml,.html,.htm,.drawio,.dio,.vsdx,.vdx,.puml,.plantuml,.mmd,.mermaid,.excalidraw",onChange:e=>{var t;let r=Array.from(null!=(t=e.target.files)?t:[]);e.target.value="",eT(r)}}),(0,a.jsx)("input",{id:"kb-folder-upload-input",type:"file",multiple:!0,hidden:!0,webkitdirectory:"",onChange:e=>{var t;let r=Array.from(null!=(t=e.target.files)?t:[]);e.target.value="",eT(r)}})]}),e6=[{icon:(0,a.jsx)(x.A,{}),label:e("totalFiles"),value:ee?String(ee.fileCount):"—"},{icon:(0,a.jsx)(F.A,{}),label:e("totalChunks"),value:ee?String(ee.chunkCount):"—"},{icon:(0,a.jsx)(E,{}),label:e("totalSize"),value:ee?(0,Y.z3)(ee.totalSizeBytes):"—"},{icon:(0,a.jsx)(X.A,{}),label:e("lastIndexed"),value:ee?ee.lastIndexedAt?(0,Y.fw)(ee.lastIndexedAt,t):e("common.never"):"—"}];return(0,a.jsxs)("div",{className:"h-[calc(100vh_-_140px)] flex flex-col",children:[(0,a.jsxs)("div",{className:"bg-[var(--colorBgContainer)] rounded-2xl border border-[var(--borderColor)] p-6 mb-4 shrink-0 animateFadeIn",children:[(0,a.jsxs)("div",{className:"flex flex-col md:flex-row md:items-center justify-between gap-6 pb-6 border-b border-[var(--borderColor)]",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("h1",{className:"text-2xl font-bold tracking-tight text-[var(--colorText)] mb-1 flex items-center gap-2",children:[(0,a.jsx)(F.A,{className:"text-[var(--colorAccent)]"}),e("title")]}),(0,a.jsx)("p",{className:"text-sm text-[var(--colorTextSecondary)] m-0",children:e("description")})]}),e3]}),(0,a.jsx)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-6 pt-6 stagger-1",children:e6.map(e=>(0,a.jsxs)("div",{className:"flex items-center gap-4",children:[(0,a.jsx)("div",{className:"w-12 h-12 rounded-xl bg-[var(--colorBgHover)] flex items-center justify-center text-xl text-[var(--colorTextSecondary)]",children:e.icon}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("div",{className:"text-[11px] font-semibold text-[var(--colorTextTertiary)] uppercase tracking-wider mb-1",children:e.label}),(0,a.jsx)("div",{className:"text-xl font-bold text-[var(--colorText)] leading-none truncate",children:e.value})]})]},e.label))})]}),eu&&(0,a.jsx)("div",{role:"alert",className:"p-4 mb-4 bg-[var(--colorDanger)]/10 text-[var(--colorDanger)] rounded-xl border border-[var(--colorDanger)]/20",children:eu}),(0,a.jsxs)("div",{className:"flex-1 min-h-0 bg-[var(--colorBgContainer)] rounded-2xl border border-[var(--borderColor)] overflow-hidden flex flex-col animateFadeIn stagger-3",style:{opacity:0},children:[(0,a.jsxs)("div",{className:"flex flex-wrap justify-between items-center gap-3 p-4 bg-[var(--colorBgHover)] border-b border-[var(--borderColor)] shrink-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 text-xs text-[var(--colorTextSecondary)] font-medium",children:[(0,a.jsx)("span",{children:e("showingMatchingFiles").replace("{count}",String(eU.length))}),eQ>0&&(0,a.jsxs)(u.A,{color:"red",icon:(0,a.jsx)(W.A,{}),className:"m-0 border-0",children:[e("parsingErrors")," ",eQ]})]}),(0,a.jsxs)(g.A,{size:8,children:[e0>0&&(0,a.jsxs)(f.Ay,{size:"small",icon:(0,a.jsx)(K.A,{}),onClick:()=>void eq(),className:"rounded-lg",children:[e("exportParsed")," (",e0,")"]}),e0>0&&(0,a.jsxs)(f.Ay,{danger:!0,size:"small",icon:(0,a.jsx)(I.A,{}),onClick:()=>eD("selected"),className:"rounded-lg",children:[e("deleteSelected")," (",e0,")"]}),(0,a.jsx)(f.Ay,{danger:!0,size:"small",disabled:0===ei.length,onClick:()=>eD("all"),className:"rounded-lg",children:e("deleteAll")}),(0,a.jsx)(f.Ay,{size:"small",onClick:P,className:"rounded-lg",children:e("ignoreRules")})]})]}),(0,a.jsx)(v.A,{rowKey:"key",columns:e2,dataSource:eW,loading:ec&&!ev&&!ey,size:"middle",className:"flex-1 border-0 tableFillHeight",expandable:{expandedRowKeys:ek,onExpand:e4,expandIcon:e=>{let{expanded:t,onExpand:r,record:l}=e;return l.isFolder?(0,a.jsx)("button",{type:"button",onClick:e=>r(l,e),className:"w-6 h-6 mr-1 inline-flex items-center justify-center align-middle text-[var(--colorTextTertiary)] hover:text-[var(--colorText)] transition-colors bg-transparent border-0 p-0 leading-none",children:t?(0,a.jsx)(G.A,{size:16}):(0,a.jsx)($.A,{size:16})}):null}},locale:{emptyText:eu?"—":ec?e("common.loading"):ef?e("emptySearch"):e("noFiles")},pagination:(0,er.B)(e,{totalLabelKey:"knowledge.topLevelCount",totalLabelFallback:"共 {count} 个顶层项目"}),rowClassName:e=>"hover:bg-[var(--colorBgHover)] transition-colors ".concat(e.isFolder?"font-medium bg-[var(--colorBgSecondary)]/30":""),rowSelection:{selectedRowKeys:e_,onChange:eA,checkStrictly:!1,getCheckboxProps:e=>{var t;return{disabled:!!e.isFolder&&(null!=(t=e.fileCount)?t:0)===0}}}})]}),(0,a.jsxs)(d.A,{title:e("ignoreRules"),open:s,onCancel:()=>y(!1),footer:null,width:560,children:[(0,a.jsx)("p",{className:"text-xs text-[var(--colorTextSecondary)] m-0 mb-3",children:e("ignoreRulesHint")}),(0,a.jsxs)(g.A.Compact,{style:{width:"100%"},className:"mb-3",children:[(0,a.jsx)(m.A,{value:_,onChange:e=>A(e.target.value),onPressEnter:()=>void N(),placeholder:e("ignoreRulesPlaceholder"),"aria-label":e("ignoreRulesAdd")}),(0,a.jsx)(f.Ay,{type:"primary",loading:z,onClick:()=>void N(),children:e("ignoreRulesAdd")})]}),0===b.length?(0,a.jsx)("p",{className:"text-xs text-[var(--colorTextTertiary)] m-0",children:e("ignoreRulesEmpty")}):(0,a.jsx)("ul",{className:"m-0 p-0 list-none flex flex-col gap-2",children:b.map(t=>(0,a.jsxs)("li",{className:"flex items-center justify-between gap-3 rounded-lg border border-[var(--borderColor)] px-3 py-2",children:[(0,a.jsx)("code",{className:"text-xs break-all",children:t}),(0,a.jsx)(f.Ay,{size:"small",danger:!0,type:"text",disabled:z,onClick:()=>void H(t),children:e("ignoreRulesDelete")})]},t))})]})]})}},90939:(e,t)=>{"use strict";t.A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M516 673c0 4.4 3.4 8 7.5 8h185c4.1 0 7.5-3.6 7.5-8v-48c0-4.4-3.4-8-7.5-8h-185c-4.1 0-7.5 3.6-7.5 8v48zm-194.9 6.1l192-161c3.8-3.2 3.8-9.1 0-12.3l-192-160.9A7.95 7.95 0 00308 351v62.7c0 2.4 1 4.6 2.9 6.1L420.7 512l-109.8 92.2a8.1 8.1 0 00-2.9 6.1V673c0 6.8 7.9 10.5 13.1 6.1zM880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"code",theme:"outlined"}},96538:(e,t,r)=>{"use strict";r.d(t,{a:()=>l,j:()=>n});let a={coarse:function(e,t){let r=Math.floor(e/1e3),a=Math.floor(r/86400),l=Math.floor(r%86400/3600),n=Math.floor(r%3600/60),s="en-US"===t;return a>0?s?"".concat(a,"d ").concat(l,"h"):"".concat(a," 天 ").concat(l," 小时"):l>0?s?"".concat(l,"h ").concat(n,"m"):"".concat(l," 小时 ").concat(n," 分"):n>0?s?"".concat(n,"m"):"".concat(n," 分"):s?"Just now":"刚刚"},fine:function(e){let t=Math.round(e/1e3);if(t<60)return"".concat(t," 秒");let r=Math.floor(t/60);return r<60?"".concat(r," 分 ").concat(t%60," 秒"):"".concat(Math.floor(r/60)," 小时 ").concat(r%60," 分")},"fine-decimal":function(e){return e>=6e4?"".concat(Math.floor(e/6e4)," 分 ").concat(Math.round(e%6e4/1e3)," 秒"):"".concat((e/1e3).toFixed(1)," 秒")},metric:function(e){return e<1e3?"".concat(Math.round(e),"ms"):e<6e4?"".concat((e/1e3).toFixed(1),"s"):"".concat((e/6e4).toFixed(1),"min")}};function l(e,t){var r;return a[t.style](function(e,t){let r="s"===t?1e3*e:e;return Number.isFinite(r)&&r>0?r:0}(e,t.unit),null!=(r=t.locale)?r:"zh-CN")}function n(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"zh-CN";return l(e,{unit:"s",style:"coarse",locale:t})}}},e=>{e.O(0,[324,815,665,576,499,338,964,636,593,792],()=>e(e.s=74183)),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[26],{27549:(e,t,r)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/prompt",function(){return r(69583)}])},45551:(e,t,r)=>{"use strict";r.d(t,{Jm:()=>i,fw:()=>l,je:()=>a.j,mc:()=>c,z3:()=>o});var a=r(96538);function o(e){if(0===e)return"0 B";let t=Math.floor(Math.log(e)/Math.log(1024)),r=e/Math.pow(1024,t);return"".concat(r.toFixed(+(0!==t))," ").concat(["B","KB","MB","GB","TB"][t])}function l(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"zh-CN";if(!e||e<=0)return"en-US"===t?"Never":"从未";let r=Math.floor(Math.floor((Date.now()-e)/1e3)/60),a=Math.floor(r/60),o=Math.floor(a/24);return o>30?new Date(e).toLocaleDateString(t):"en-US"===t?o>0?"".concat(o,"d ago"):a>0?"".concat(a,"h ago"):r>0?"".concat(r,"m ago"):"Just now":o>0?"".concat(o," 天前"):a>0?"".concat(a," 小时前"):r>0?"".concat(r," 分钟前"):"刚刚"}let s={document:"文档",spreadsheet:"表格",image:"图片",cad:"图纸",code:"代码",data:"数据",web:"网页",diagram:"图表",archive:"压缩包",other:"其他"},n={document:"Document",spreadsheet:"Spreadsheet",image:"Image",cad:"CAD",code:"Code",data:"Data",web:"Web",diagram:"Diagram",archive:"Archive",other:"Other"};function i(e){var t;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"zh-CN";return null!=(t=("en-US"===r?n:s)[e])?t:e}let c={active:"common.statusIndexed",outdated:"common.statusOutdated",error:"common.statusAbnormal",deleted:"common.statusDeleted",disk:"common.statusNotIndexed"}},58690:(e,t,r)=>{"use strict";function a(e){var t,r,a;let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{defaultPageSize:null!=(t=o.pageSize)?t:10,pageSizeOptions:null!=(r=o.pageSizeOptions)?r:[10,20,50,100],showSizeChanger:!0,showTotal:t=>{var r,a;return e(null!=(r=o.totalLabelKey)?r:"common.totalRows",null!=(a=o.totalLabelFallback)?a:"共 {count} 条").replace("{count}",String(t))},hideOnSinglePage:null!=(a=o.hideOnSinglePage)&&a,showQuickJumper:!1}}r.d(t,{B:()=>a})},69583:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>eo});var a=r(65321),o=r(97109),l=r(32244),s=r(45551),n=r(58690),i=r(6578),c=r(17807),d=r(33442),m=r(11702),p=r(85114),x=r(32965),u=r(56985),h=r(88762),g=r(45759),f=r(7576),v=r(57271),j=r(49292),y=r(84253),w=r(38964),b=r(34052),N=r(42700),S=r(55122),A=r(93360),C=r(82238);function T(e){let{idPrefix:t="prompt-writing-guide"}=e,r=(0,l.Vr)();return(0,a.jsxs)("aside",{"aria-labelledby":"".concat(t,"-title"),className:"mb-3 shrink-0 rounded-xl border border-[var(--borderColor)] bg-[var(--colorBgHover)] px-3 py-2.5 text-xs leading-relaxed",children:[(0,a.jsx)("div",{id:"".concat(t,"-title"),className:"font-semibold text-[var(--colorText)]",children:r("prompt.writingGuideTitle")}),(0,a.jsx)("p",{id:"".concat(t,"-intro"),className:"mt-1 text-[var(--colorTextSecondary)]",children:r("prompt.writingGuideIntro")}),(0,a.jsx)("p",{className:"mt-1 text-[var(--colorTextSecondary)]",children:r("prompt.writingGuideParameters")}),(0,a.jsxs)("details",{className:"mt-2",children:[(0,a.jsx)("summary",{className:"cursor-pointer text-[var(--colorAccent)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2",children:r("prompt.writingGuideDetails")}),(0,a.jsxs)("div",{className:"mt-3 max-h-[320px] overflow-y-auto pr-1 text-[var(--colorTextSecondary)]",children:[(0,a.jsx)("div",{className:"font-semibold text-[var(--colorText)]",children:r("prompt.writingGuideNeedsTitle")}),(0,a.jsxs)("ul",{className:"mt-1 list-disc space-y-1 pl-4",children:[(0,a.jsx)("li",{children:r("prompt.writingGuidePurpose")}),(0,a.jsx)("li",{children:r("prompt.writingGuideStructure")}),(0,a.jsx)("li",{children:r("prompt.writingGuideEngineering")}),(0,a.jsx)("li",{children:r("prompt.writingGuideStyle")})]}),(0,a.jsx)("div",{className:"mt-3 font-semibold text-[var(--colorText)]",children:r("prompt.writingGuideManagedTitle")}),(0,a.jsx)("p",{className:"mt-1",children:r("prompt.writingGuideManaged")}),(0,a.jsx)("p",{className:"mt-1",children:r("prompt.writingGuideAvoid")}),(0,a.jsx)("div",{className:"mt-3 font-semibold text-[var(--colorText)]",children:r("prompt.writingGuideExampleTitle")}),(0,a.jsx)("p",{className:"mt-1",children:r("prompt.writingGuideExampleHint")}),(0,a.jsx)("pre",{className:"mt-2 whitespace-pre-wrap break-words rounded-lg border border-[var(--borderColor)] bg-[var(--colorBgContainer)] p-2.5 font-mono text-[11px] text-[var(--colorText)]",children:r("prompt.writingGuideExample")}),(0,a.jsx)("p",{className:"mt-2",children:r("prompt.writingGuideOneOutline")})]})]})]})}var z=r(99650),F=r(81668),E=r(58209),k=r(26631),P=r(29606),O=r(96091),B=r(54746),M=r(30486),D=r(46082),I=r(42758),G=r(7851),R=r(84742),_=r(24810),J=r(7492);async function L(){let e=await fetch("/api/prompt");if(!e.ok)throw Error("Failed");return e.json()}async function U(e,t,r){let a=await fetch("/api/prompt",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({filePath:e,content:t,name:r})});if(!a.ok)throw Error("Failed");return a.json()}async function K(e){let t=await fetch("/api/prompt",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"previewRules",content:e})});return t.ok&&(await t.json()).preview||null}async function H(e,t){let r=await fetch("/api/prompt",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"createCustom",name:e,content:t})});if(!r.ok)throw Error("Failed");return r.json()}async function X(e){let t=await fetch("/api/prompt",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"select",selectedIds:e})});if(!t.ok)throw Error("Failed");return t.json()}async function $(e){let t=await fetch("/api/prompt",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"import",...e&&"object"==typeof e?e:{prompts:[]}})});if(!t.ok)throw Error(await t.text());return t.json()}async function q(){return W("",!1,60)}async function V(e){let t=await fetch("/api/kb/files/detail?relativePath=".concat(encodeURIComponent(e)));if(!t.ok)throw Error("Failed");return((await t.json()).chunks||[]).map(e=>e.content||"").filter(Boolean).join("\n\n").slice(0,12e3)}async function W(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:30;return(await (0,i.nU)({limit:r,...e.trim()?{query:e.trim()}:{},...t?{}:{includeContent:!1}})).files||[]}async function Q(e,t){let r=await fetch("/api/prompt/chat",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!r.ok){let e=await r.text();try{let r=JSON.parse(e);throw Error(r.error||r.message||e||t)}catch(r){throw Error(e||t)}}return r.json()}function Y(e,t){let r=new Blob([JSON.stringify(t,null,2)],{type:"application/json;charset=utf-8"}),a=URL.createObjectURL(r),o=document.createElement("a");o.href=a,o.download=e,o.click(),URL.revokeObjectURL(a)}function Z(e,t,r){return e?"customize-agent:prompt-chat:".concat(e.id,":").concat(e.customizePath||e.projectName):"customize-agent:prompt-chat:draft:".concat(r||t||"new")}function ee(e){let t=Date.parse(e);return Number.isNaN(t)?"-":new Date(t).toLocaleString()}function et(e){return{type:"customize-agent.prompts",version:1,exportedAt:new Date().toISOString(),prompts:e.map(e=>({name:e.projectName,content:e.content||"",selected:e.selected,source:"custom"}))}}function er(e){return e.trim().replace(/[\\/:*?"<>|]/g,"-").slice(0,80)||"untitled"}function ea(e){let t=e.match(/(^|\s)@([^\s@]*)$/);return t?t[2]:null}function eo(){let e=(0,l.Vr)(),{message:t}=c.A.useApp(),[r,i]=(0,o.useState)(!0),[eo,el]=(0,o.useState)([]),[es,en]=(0,o.useState)(!1),[ei,ec]=(0,o.useState)(null),[ed,em]=(0,o.useState)(""),[ep,ex]=(0,o.useState)(""),[eu,eh]=(0,o.useState)(!1),[eg,ef]=(0,o.useState)(!1),[ev,ej]=(0,o.useState)("all"),[ey,ew]=(0,o.useState)("mtime"),[eb,eN]=(0,o.useState)("list"),[eS,eA]=(0,o.useState)(""),[eC,eT]=(0,o.useState)(!1),[ez,eF]=(0,o.useState)([]),[eE,ek]=(0,o.useState)(""),[eP,eO]=(0,o.useState)(""),[eB,eM]=(0,o.useState)(!1),[eD,eI]=(0,o.useState)([]),[eG,eR]=(0,o.useState)([]),[e_,eJ]=(0,o.useState)([]),[eL,eU]=(0,o.useState)(!1),[eK,eH]=(0,o.useState)(!1),[eX,e$]=(0,o.useState)(!1),[eq,eV]=(0,o.useState)(null),[eW,eQ]=(0,o.useState)(!1),[eY,eZ]=(0,o.useState)([]),[e0,e1]=(0,o.useState)(!1),[e2,e3]=(0,o.useState)(!1);(0,o.useEffect)(()=>{if(!es||!ed.trim()){eV(null),eQ(!1);return}eQ(!0);let e=setTimeout(()=>{K(ed).then(e=>{eV(e),eQ(!1)})},500);return()=>clearTimeout(e)},[ed,es]);let e4=(0,o.useRef)(null),e5=ea(eP),e6=async()=>{i(!0);try{let e,t=[],r=await (e=L(),e.catch(()=>(t.push("提示词列表"),null)));eZ(t),r&&el(r)}catch(r){t.error(e("common.error"))}finally{i(!1)}};(0,o.useEffect)(()=>{e6()},[]),(0,o.useEffect)(()=>{let e=window.localStorage.getItem("customize-agent:prompt-view-mode");("list"===e||"card"===e)&&eN(e)},[]),(0,o.useEffect)(()=>{window.localStorage.setItem("customize-agent:prompt-view-mode",eb)},[eb]),(0,o.useEffect)(()=>{let e=e4.current;e&&e.scrollTo({top:e.scrollHeight,behavior:"smooth"}),eE&&window.localStorage.setItem(eE,JSON.stringify(ez.slice(-30)))},[ez,eB,eE]),(0,o.useEffect)(()=>{es||e1(!1)},[es]),(0,o.useEffect)(()=>{!es||eD.length>0||eL||e0||(eU(!0),q().then(e=>{eI(e),e1(!1)}).catch(()=>e1(!0)).finally(()=>eU(!1)))},[es,eD.length,eL,e0]),(0,o.useEffect)(()=>{let e=null==e5?void 0:e5.trim();if(!es||!e){eR([]),eH(!1),e3(!1);return}let t=!1;eH(!0);let r=window.setTimeout(()=>{W(e).then(e=>{t||(eR(e),e3(!1))}).catch(()=>{t||(eR([]),e3(!0))}).finally(()=>{t||eH(!1)})},250);return()=>{t=!0,window.clearTimeout(r)}},[es,e5]);let e8=eY.includes("提示词列表"),e9=e=>e8?"—":String(e),e7={selected:eo.filter(e=>e.selected).length,unselected:eo.filter(e=>!e.selected).length,hasFile:eo.filter(e=>e.hasFile).length,missingFile:eo.filter(e=>!e.hasFile).length},te=eo.filter(e=>{var t;return("selected"!==ev||!!e.selected)&&("unselected"!==ev||!e.selected)&&("hasFile"!==ev||!!e.hasFile)&&("missingFile"!==ev||!e.hasFile)&&(!eS.trim()||(t=eS.trim(),!!"".concat(e.projectName,"\n").concat(e.projectRoot||"","\n").concat(e.customizePath||"","\n").concat(e.content||"").toLowerCase().includes(t.toLowerCase())))}).sort((e,t)=>"name"===ey?e.projectName.localeCompare(t.projectName):"selected"===ey&&Number(t.selected)-Number(e.selected)||Date.parse(t.mtime||"")-Date.parse(e.mtime||"")),tt=te.filter(e=>e.selected).length,tr=te.length>0&&te.every(e=>e.selected),ta=(null==e5?void 0:e5.trim())?eG:eD,to=(e,t,r)=>{let a=Z(e,t,r);ek(a),eF(function(e){try{let t=JSON.parse(window.localStorage.getItem(e)||"[]");return Array.isArray(t)?t.filter(e=>("user"===e.role||"assistant"===e.role)&&"string"==typeof e.content).slice(-30):[]}catch(e){return[]}}(a)),eO(""),eM(!1),eJ([]),e$(!1)},tl=async()=>{if(!ep.trim())return void t.error(e("prompt.nameRequired"));eh(!0);try{if(ei)await U(ei.customizePath,ed,ep.trim()),t.success(e("common.success"));else{let r=await H(ep.trim(),ed||"# ".concat(ep.trim(),"\n"));!function(e,t){if(!e||!t||e===t)return;let r=window.localStorage.getItem(e);r&&!window.localStorage.getItem(t)&&window.localStorage.setItem(t,r)}(eE,Z({id:r.id,projectId:r.id,projectName:ep.trim(),customizePath:r.id,content:ed,mtime:"",hasFile:!0,isCurrent:!1,selected:!1,source:"custom"},ep.trim())),t.success(e("common.success"))}en(!1),await e6()}catch(r){t.error(e("common.error"))}finally{eh(!1)}},ts=async e=>{let t=Array.from(new Set([...e_,...eD.filter(t=>e.includes("@".concat(t.relativePath))).map(e=>e.relativePath)])).slice(0,3),r=[];for(let e of t){let t=await V(e);t&&r.push({relativePath:e,content:t})}return r},tn=async()=>{let r=eP.trim();if(!r||eB)return;let a=[...ez,{role:"user",content:r}];eF(a),eO(""),e$(!1),eM(!0);try{let t=await ts(r),o=await Q({name:ep||(null==ei?void 0:ei.projectName)||e("prompt.untitled"),content:ed,message:r,history:ez,references:t},e("prompt.chatFailed"));eF([...a,{role:"assistant",content:o.content||e("prompt.chatEmptyReply")}])}catch(r){t.error(r instanceof Error?r.message:e("prompt.chatFailed")),eF(a)}finally{eM(!1)}},ti=async(r,a)=>{let o=a?Array.from(new Set([...eo.filter(e=>e.selected).map(e=>e.id),r.id])):eo.filter(e=>e.selected&&e.id!==r.id).map(e=>e.id);try{await X(o),el(e=>e.map(e=>({...e,selected:o.includes(e.id)})))}catch(r){t.error(e("common.error"))}},tc=async r=>{let a=eo.filter(e=>e.selected).map(e=>e.id),o=te.map(e=>e.id),l=r?Array.from(new Set([...a,...o])):a.filter(e=>!o.includes(e));try{await X(l),el(e=>e.map(e=>({...e,selected:l.includes(e.id)}))),t.success(e("common.success"))}catch(r){t.error(e("common.error"))}},td=async r=>{try{if(!(await fetch("/api/prompt",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({filePath:r.customizePath})})).ok)throw Error("Failed");t.success(e("common.success")),await e6()}catch(r){t.error(e("common.error"))}},tm=async r=>{if(r){eT(!0);try{let a=await r.text(),o=JSON.parse(a),l=await $(o);t.success(e("prompt.importedCount").replace("{count}",String(l.imported))),await e6()}catch(r){t.error(e("prompt.importFailed"))}finally{eT(!1)}}},tp=t=>(0,a.jsx)(d.A,{size:4,wrap:!0,children:!t.hasFile&&(0,a.jsx)(m.A,{style:{margin:0},children:e("prompt.missingFileStatus")})}),tx=r=>(0,a.jsxs)(d.A,{size:0,onClick:e=>e.stopPropagation(),children:[(0,a.jsx)(p.Ay,{size:"small",type:"text",icon:(0,a.jsx)(z.A,{}),title:e("common.edit"),onClick:()=>{ec(r),ef(!1),ex(r.projectName),em(r.content||""),to(r,r.projectName),en(!0)}}),(0,a.jsx)(p.Ay,{size:"small",type:"text",icon:(0,a.jsx)(F.A,{}),title:e("prompt.exportOne"),onClick:()=>{Y("customize-prompt-".concat(er(r.projectName),"-").concat(new Date().toISOString().slice(0,10),".json"),et([r])),t.success(e("prompt.exportedCount").replace("{count}","1"))}}),(0,a.jsx)(x.A,{title:e("prompt.deleteCustomConfirm"),onConfirm:()=>{td(r)},children:(0,a.jsx)(p.Ay,{size:"small",type:"text",danger:!0,icon:(0,a.jsx)(E.A,{}),title:e("common.delete")})})]}),tu=[{title:e("prompt.promptName"),dataIndex:"projectName",render:(e,t)=>(0,a.jsxs)(d.A,{size:8,className:"min-w-0",children:[(0,a.jsx)(k.A,{className:t.isCurrent?"text-[var(--colorOk)] text-lg":"text-[var(--colorTextSecondary)] text-lg"}),(0,a.jsx)("span",{className:"font-semibold text-[var(--colorText)]",children:e}),tp(t)]})},{title:e("prompt.columnSource"),width:170,render:()=>(0,a.jsxs)("span",{className:"text-xs text-[var(--colorTextTertiary)] inline-flex items-center gap-1.5",children:[(0,a.jsx)(P.A,{}),e("prompt.localPrompt")]})},{title:e("prompt.columnMtime"),width:210,render:(e,t)=>(0,a.jsx)("span",{className:"text-xs text-[var(--colorTextTertiary)]",children:ee(t.mtime)})},{title:e("prompt.columnActions"),width:140,render:(e,t)=>(0,a.jsx)("div",{onClick:e=>e.stopPropagation(),children:tx(t)})}];return r?(0,a.jsxs)("div",{className:"space-y-12",children:[(0,a.jsx)(h.A,{active:!0,title:!0,paragraph:{rows:1}}),(0,a.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6",children:Array.from({length:4}).map((e,t)=>(0,a.jsx)("div",{className:"p-4 border border-[var(--borderColor)]",children:(0,a.jsx)(h.A,{active:!0,paragraph:{rows:4}})},t))})]}):(0,a.jsxs)("div",{className:"space-y-6 animateFadeIn",children:[(0,a.jsx)(C.X,{failures:eY}),(0,a.jsx)(A.z,{title:e("nav.promptManagement"),description:e("prompt.description"),extra:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(g.A,{accept:"application/json,.json",showUploadList:!1,beforeUpload:e=>(tm(e),!1),children:(0,a.jsx)(p.Ay,{icon:(0,a.jsx)(O.A,{}),loading:eC,className:"rounded-lg",children:e("prompt.import")})}),(0,a.jsx)(p.Ay,{icon:(0,a.jsx)(F.A,{}),disabled:0===eo.length,onClick:()=>(()=>{let r=eo.filter(e=>e.selected);if(0===r.length)return void t.warning(e("prompt.exportNoneSelected"));let a=new Date().toISOString().slice(0,10);r.forEach((e,t)=>{window.setTimeout(()=>{Y("customize-prompt-".concat(er(e.projectName),"-").concat(a,".json"),et([e]))},250*t)}),t.success(e("prompt.exportedCount").replace("{count}",String(r.length)))})(),className:"rounded-lg",children:e("prompt.exportOne")}),(0,a.jsx)(p.Ay,{type:"primary",icon:(0,a.jsx)(B.A,{}),onClick:()=>(()=>{let e="new:".concat(Date.now());ec(null),ef(!0),ex(""),em(""),to(null,"new",e),en(!0)})(),className:"shadow-none rounded-lg",children:e("prompt.createPrompt")})]})}),(0,a.jsx)(T,{idPrefix:"prompt-page-guide"}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-3 bg-[var(--colorBgContainer)] border border-[var(--borderColor)] p-3 rounded-2xl",children:[(0,a.jsx)(f.A,{prefix:(0,a.jsx)(M.A,{className:"text-[var(--colorTextTertiary)]"}),allowClear:!0,placeholder:e("prompt.searchPrompt"),value:eS,onChange:e=>eA(e.target.value),style:{width:260},className:"rounded-lg"}),(0,a.jsx)("div",{className:"h-6 w-[1px] bg-[var(--borderColor)] mx-1","aria-hidden":!0}),(0,a.jsx)(v.A,{value:ev,onChange:ej,style:{width:130},className:"rounded-lg",options:[{label:e("prompt.promptStatus"),value:"all"},{label:"".concat(e("prompt.selected")," (").concat(e9(e7.selected),")"),value:"selected"},{label:"".concat(e("prompt.unselected")," (").concat(e9(e7.unselected),")"),value:"unselected"},{label:"".concat(e("prompt.hasFileStatus")," (").concat(e9(e7.hasFile),")"),value:"hasFile"},{label:"".concat(e("prompt.missingFileStatus")," (").concat(e9(e7.missingFile),")"),value:"missingFile"}]}),(0,a.jsx)(v.A,{value:ey,onChange:ew,style:{width:140},className:"rounded-lg",options:[{label:e("prompt.sortByMtime"),value:"mtime"},{label:e("prompt.sortByName"),value:"name"},{label:e("prompt.sortBySelected"),value:"selected"}]}),(0,a.jsx)("div",{className:"flex-1 min-w-4"}),(0,a.jsx)(j.A,{value:eb,onChange:e=>eN(e),options:[{label:(0,a.jsx)(D.A,{}),value:"list"},{label:(0,a.jsx)(I.A,{}),value:"card"}],className:"bg-[var(--colorBgHover)] p-1 rounded-lg"})]}),(0,a.jsxs)("div",{className:"min-w-0 rounded-2xl border border-[var(--borderColor)] bg-[var(--colorBgContainer)] overflow-hidden",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 flex-wrap px-4 py-3 border-b border-[var(--borderColor)]",children:[(0,a.jsx)("span",{className:"text-sm text-[var(--colorTextSecondary)]",children:e("prompt.shownCount").replace("{count}",e9(te.length))}),(0,a.jsx)("div",{className:"h-4 w-[1px] bg-[var(--borderColor)] mx-1","aria-hidden":!0}),(0,a.jsx)("span",{className:"font-semibold text-sm",children:e("prompt.selectedCount").replace("{count}",String(tt))}),(0,a.jsx)("div",{className:"flex-1 min-w-4"}),(0,a.jsx)(p.Ay,{size:"small",disabled:0===te.length,onClick:()=>{tc(!tr)},children:tr?e("prompt.cancelSelectAll"):e("prompt.selectAll")})]}),0===te.length?(0,a.jsx)("div",{className:"py-24 text-center",children:e8?(0,a.jsx)("span",{className:"text-[var(--colorTextTertiary)]",children:"—"}):(0,a.jsx)(y.A,{image:y.A.PRESENTED_IMAGE_SIMPLE,description:(0,a.jsx)("span",{className:"text-[var(--colorTextSecondary)]",children:eS||"all"!==ev?e("prompt.noMatchDesc"):e("prompt.noPromptInGroup")})})}):"list"===eb?(0,a.jsx)(w.A,{rowKey:"id",dataSource:te,columns:tu,pagination:(0,n.B)(e),rowSelection:{selectedRowKeys:eo.filter(e=>e.selected).map(e=>e.id),onSelect:(e,t)=>{ti(e,t)},onSelectAll:e=>{tc(e)}},className:"custom-table"}):(0,a.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-5 p-4",children:te.map(t=>(0,a.jsxs)("div",{className:"flex flex-col p-5 rounded-2xl border border-[var(--borderColor)] bg-[var(--colorBgContainer)] hover:bg-[var(--colorBgHover)] hover:shadow-md transition-all",children:[(0,a.jsx)("div",{className:"flex items-start justify-between gap-3 mb-4 min-w-0",children:(0,a.jsxs)("div",{className:"flex items-center gap-3 min-w-0 flex-1",children:[(0,a.jsx)(u.A,{checked:t.selected,onChange:e=>{ti(t,e.target.checked)}}),(0,a.jsx)(k.A,{className:t.isCurrent?"text-[var(--colorOk)] text-lg":"text-[var(--colorTextSecondary)] text-lg"}),(0,a.jsx)("span",{className:"font-bold text-base text-[var(--colorText)] truncate mb-1",children:t.projectName})]})}),(0,a.jsx)("div",{className:"mb-3",children:tp(t)}),(0,a.jsxs)("div",{className:"text-xs text-[var(--colorTextTertiary)] truncate flex items-center gap-1.5 mb-4 bg-[var(--colorFillAlter)] p-1.5 rounded inline-flex self-start",children:[(0,a.jsx)(P.A,{}),e("prompt.localPrompt")]}),(0,a.jsxs)("div",{className:"mt-auto pt-4 flex justify-between items-center",children:[(0,a.jsx)("span",{className:"text-xs font-medium text-[var(--colorTextTertiary)] bg-[var(--colorFillSecondary)] px-2 py-1 rounded",children:ee(t.mtime)}),tx(t)]})]},t.id))})]}),(0,a.jsxs)(b.A,{title:eg?e("prompt.createPrompt"):"".concat(e("prompt.customPrompt")," — ").concat(ep||(null==ei?void 0:ei.projectName)||""),open:es,onClose:()=>en(!1),styles:{body:{padding:"24px 32px",display:"grid",gridTemplateRows:"minmax(320px, 1fr) 420px",gap:24,height:"100%"},header:{borderBottom:"1px solid var(--colorBorderSecondary)",padding:"16px 32px"}},extra:(0,a.jsx)(d.A,{children:(0,a.jsx)(p.Ay,{type:"primary",loading:eu,onClick:()=>{tl()},children:e("common.save")})}),children:[(0,a.jsxs)("div",{className:"min-h-0 flex flex-col overflow-y-auto",children:[eg||null!==ei?(0,a.jsx)(f.A,{size:"large",placeholder:e("prompt.promptName"),value:ep,onChange:e=>ex(e.target.value),className:"mb-4 font-medium"}):null,(0,a.jsx)(T,{}),(0,a.jsx)(f.A.TextArea,{"aria-describedby":"prompt-writing-guide-intro",value:ed,onChange:e=>em(e.target.value),className:"flex-1 shrink-0 min-h-[140px] resize-none font-mono text-[13px]"}),(0,a.jsxs)("div",{className:"mt-3 rounded-xl border border-[var(--borderColor)] bg-[var(--colorBgContainer)] px-3 py-2.5 max-h-[170px] overflow-y-auto",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-1.5",children:[(0,a.jsxs)(d.A,{size:6,children:[(0,a.jsx)(G.A,{className:"text-[var(--colorAccent)]"}),(0,a.jsx)("span",{className:"font-semibold text-xs",children:e("prompt.rulePreviewTitle")})]}),eW&&(0,a.jsx)(N.A,{size:"small"})]}),eq?eq.recognized?(0,a.jsx)("div",{className:"flex flex-col gap-1",children:eq.summary.map((e,t)=>(0,a.jsxs)("div",{className:"text-xs text-[var(--colorText)] flex gap-1.5 leading-relaxed",children:[(0,a.jsx)(R.A,{className:"text-[var(--colorSuccess)] mt-1"}),(0,a.jsx)("span",{children:e})]},t))}):(0,a.jsx)("div",{className:"text-xs text-[var(--colorTextSecondary)]",children:e("prompt.rulePreviewNone")}):(0,a.jsx)("div",{className:"text-xs text-[var(--colorTextSecondary)]",children:ed.trim()?e("prompt.rulePreviewAnalyzing"):e("prompt.rulePreviewHint")})]})]}),(0,a.jsxs)("div",{className:"min-h-0 rounded-xl border border-[var(--borderColor)] bg-[var(--colorBgContainer)] flex flex-col overflow-hidden",children:[(0,a.jsxs)("div",{className:"px-3 py-2.5 border-b border-[var(--borderColor)] flex items-center justify-between gap-2",children:[(0,a.jsxs)(d.A,{size:6,children:[(0,a.jsx)(_.A,{className:"text-[var(--colorAccent)]"}),(0,a.jsx)("span",{className:"font-semibold",children:e("prompt.aiPromptAssistant")})]}),(0,a.jsxs)(d.A,{size:6,children:[ez.length>0&&(0,a.jsx)(p.Ay,{size:"small",onClick:()=>eF([]),children:e("prompt.clearHistory")}),eB?(0,a.jsx)(m.A,{color:"processing",className:"m-0",children:e("prompt.generating")}):(0,a.jsx)(m.A,{color:"blue",className:"m-0",children:e("prompt.canConverse")})]})]}),(0,a.jsx)("div",{ref:e4,className:"flex-1 min-h-0 overflow-y-auto p-3.5 bg-[var(--colorFillAlter)]",children:0!==ez.length||eB?(0,a.jsxs)("div",{className:"flex flex-col gap-3 w-full",children:[ez.map((r,o)=>{let l="user"===r.role;return(0,a.jsx)("div",{className:"flex ".concat(l?"justify-end":"justify-start"),children:(0,a.jsxs)("div",{className:"max-w-[78%] px-3 py-2.5 rounded-xl border border-[var(--borderColor)] whitespace-pre-wrap leading-relaxed text-[13px] transition-colors ".concat(l?"bg-[var(--colorFillSecondary)]":"bg-[var(--colorBgContainer)]"),children:[r.content,!l&&(0,a.jsx)("div",{className:"flex justify-end mt-2",children:(0,a.jsx)(p.Ay,{size:"small",type:"primary",onClick:()=>{em(r.content),t.success(e("prompt.appliedToEditor"))},children:e("prompt.apply")})})]})},"".concat(r.role,"-").concat(o))}),eB&&(0,a.jsx)("div",{className:"flex justify-start",children:(0,a.jsxs)("div",{className:"px-3 py-2.5 rounded-xl bg-[var(--colorBgContainer)] border border-[var(--borderColor)] text-[var(--colorTextSecondary)] text-[13px]",children:[(0,a.jsx)(N.A,{size:"small",className:"mr-2"}),e("prompt.aiAnalyzing")]})})]}):(0,a.jsx)(y.A,{image:y.A.PRESENTED_IMAGE_SIMPLE,description:e("prompt.mentionRecallHint")})}),(0,a.jsx)(S.A,{className:"!m-0"}),(0,a.jsxs)("div",{className:"p-3",children:[e_.length>0&&(0,a.jsx)("div",{className:"flex flex-wrap gap-1 mb-2",children:e_.map(e=>(0,a.jsxs)(m.A,{closable:!0,onClose:()=>eJ(t=>t.filter(t=>t!==e)),className:"m-0 max-w-[360px] overflow-hidden text-ellipsis",children:["@",e]},e))}),eX&&(0,a.jsxs)("div",{className:"max-h-[260px] overflow-y-auto mb-2 rounded-xl border border-[var(--borderColor)] bg-[var(--colorBgElevated)] shadow-lg",children:[(0,a.jsxs)("div",{className:"sticky top-0 z-[1] px-3 py-2.5 border-b border-[var(--borderColor)] bg-[var(--colorBgElevated)] flex justify-between gap-3 items-center",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-[var(--colorText)] text-[13px] font-bold",children:e("prompt.recallKbFiles")}),(0,a.jsx)("div",{className:"text-[var(--colorTextSecondary)] text-[11px]",children:e("prompt.recallLimitHint")})]}),(0,a.jsx)(m.A,{color:e5?"blue":"default",className:"m-0 max-w-[240px] overflow-hidden text-ellipsis",children:e5?"@".concat(e5):e("prompt.inputAtKeyword")})]}),(e0||e2)&&(0,a.jsx)("div",{className:"p-2.5",children:(0,a.jsx)(C.X,{failures:[...e0?["知识库文件清单"]:[],...e2?["知识库检索"]:[]]})}),e0?null:eL?(0,a.jsxs)("div",{className:"p-3.5 text-[var(--colorTextSecondary)] text-xs",children:[(0,a.jsx)(N.A,{size:"small",className:"mr-2"}),e("prompt.loadingKbFiles")]}):0===eD.length?(0,a.jsx)("div",{className:"p-3.5 text-[var(--colorTextSecondary)] text-xs",children:e("prompt.noRecallableKbFiles")}):0===ta.length?(0,a.jsx)("div",{className:"p-3.5 text-[var(--colorTextSecondary)] text-xs",children:eK?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(N.A,{size:"small",className:"mr-2"}),e("prompt.searchingKbContent")]}):e2?null:e("prompt.noMatchingKbFiles")}):(0,a.jsxs)(a.Fragment,{children:[eK&&(0,a.jsxs)("div",{className:"px-3 py-2 text-[var(--colorTextSecondary)] text-xs border-b border-[var(--borderColor)]",children:[(0,a.jsx)(N.A,{size:"small",className:"mr-2"}),e("prompt.continueSearchingKb")]}),ta.slice(0,30).map(t=>(0,a.jsxs)("div",{onMouseDown:e=>{var r;e.preventDefault(),r=t.relativePath,eJ(e=>e.includes(r)?e:[...e,r]),eO(e=>e.replace(/(^|\s)@([^\s@]*)$/,"$1@".concat(r," "))),e$(!1)},className:"px-3 py-2.5 cursor-pointer border-b border-[var(--borderColor)] text-xs grid grid-cols-[22px_minmax(0,1fr)_auto] gap-2.5 items-center hover:bg-[var(--colorBgHover)] transition-colors",children:[(0,a.jsx)("div",{className:"w-[22px] h-[22px] rounded-lg bg-[var(--colorFillSecondary)] flex items-center justify-center",children:(0,a.jsx)(k.A,{className:"text-[var(--colorAccent)]"})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("div",{className:"text-[var(--colorText)] truncate font-bold",children:t.relativePath}),(0,a.jsxs)("div",{className:"text-[var(--colorTextSecondary)] text-[11px] truncate",children:[t.category||e("prompt.unclassified")," \xb7 ",t.format||e("prompt.unknownFormat"),"number"==typeof t.score?" \xb7 score ".concat(t.score.toFixed(2)):""]})]}),(0,a.jsxs)(d.A,{size:4,children:[(0,a.jsx)(m.A,{color:"content"===t.matchedBy?"purple":"disk"===t.matchedBy?"orange":"blue",className:"m-0",children:"content"===t.matchedBy?e("prompt.contentMatch"):"disk"===t.matchedBy?e("prompt.diskFile"):e("prompt.fileMatch")}),(0,a.jsx)(m.A,{className:"m-0",children:e(s.mc[t.status]||"common.unknown")})]})]},t.relativePath))]})]}),(0,a.jsxs)("div",{className:"flex gap-2 items-end",children:[(0,a.jsx)(f.A.TextArea,{value:eP,onChange:e=>{let t=e.target.value;eO(t),e$(null!==ea(t))},onFocus:()=>e$(null!==ea(eP)),onPressEnter:e=>{e.shiftKey||(e.preventDefault(),tn())},disabled:eB,placeholder:e("prompt.mentionRecallPlaceholder"),autoSize:{minRows:1,maxRows:5},className:"flex-1 min-w-0 text-[13px] leading-relaxed"}),(0,a.jsx)(p.Ay,{type:"primary",icon:(0,a.jsx)(J.A,{}),loading:eB,disabled:!eP.trim(),onClick:()=>{tn()},className:"shrink-0",children:e("prompt.send")})]})]})]})]})]})}},93360:(e,t,r)=>{"use strict";r.d(t,{z:()=>i});var a=r(65321);r(97109);var o=r(48399),l=r(33442);let{Title:s,Text:n}=o.A;function i(e){let{title:t,description:r,extra:o,bottomContent:i}=e;return(0,a.jsxs)("div",{className:"mb-6 animateFadeIn",children:[(0,a.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-end justify-between gap-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(s,{level:4,style:{margin:0,fontWeight:700,letterSpacing:"-0.01em"},children:t}),r&&(0,a.jsx)(n,{type:"secondary",className:"mt-1 block text-sm",children:r})]}),o&&(0,a.jsx)(l.A,{className:"w-full sm:w-auto overflow-x-auto pb-1 sm:pb-0",size:"middle",wrap:!1,children:o})]}),i&&(0,a.jsx)("div",{className:"mt-4",children:i})]})}},96538:(e,t,r)=>{"use strict";r.d(t,{a:()=>o,j:()=>l});let a={coarse:function(e,t){let r=Math.floor(e/1e3),a=Math.floor(r/86400),o=Math.floor(r%86400/3600),l=Math.floor(r%3600/60),s="en-US"===t;return a>0?s?"".concat(a,"d ").concat(o,"h"):"".concat(a," 天 ").concat(o," 小时"):o>0?s?"".concat(o,"h ").concat(l,"m"):"".concat(o," 小时 ").concat(l," 分"):l>0?s?"".concat(l,"m"):"".concat(l," 分"):s?"Just now":"刚刚"},fine:function(e){let t=Math.round(e/1e3);if(t<60)return"".concat(t," 秒");let r=Math.floor(t/60);return r<60?"".concat(r," 分 ").concat(t%60," 秒"):"".concat(Math.floor(r/60)," 小时 ").concat(r%60," 分")},"fine-decimal":function(e){return e>=6e4?"".concat(Math.floor(e/6e4)," 分 ").concat(Math.round(e%6e4/1e3)," 秒"):"".concat((e/1e3).toFixed(1)," 秒")},metric:function(e){return e<1e3?"".concat(Math.round(e),"ms"):e<6e4?"".concat((e/1e3).toFixed(1),"s"):"".concat((e/6e4).toFixed(1),"min")}};function o(e,t){var r;return a[t.style](function(e,t){let r="s"===t?1e3*e:e;return Number.isFinite(r)&&r>0?r:0}(e,t.unit),null!=(r=t.locale)?r:"zh-CN")}function l(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"zh-CN";return o(e,{unit:"s",style:"coarse",locale:t})}}},e=>{e.O(0,[324,815,665,576,499,338,964,711,636,593,792],()=>e(e.s=27549)),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[388],{33061:(e,l,t)=>{"use strict";t.d(l,{G:()=>n});var s=t(97109),r=t(35071);function n(){let[e,l]=(0,s.useState)([]),[t,n]=(0,s.useState)(),[i,a]=(0,s.useState)([]),[c,o]=(0,s.useState)(!0),[d,u]=(0,s.useState)(""),m=(0,s.useCallback)(async()=>{o(!0);let e=await (0,r.SS)("/api/skills");if(e.ok){var t;l(e.data.skills),n(e.data.options),a(null!=(t=e.data.invalid)?t:[]),u("")}else u(e.message);o(!1)},[]);return(0,s.useEffect)(()=>{m()},[m]),{skills:e,options:t,invalid:i,loading:c,failed:d,reload:m,applySkills:l}}},35071:(e,l,t)=>{"use strict";t.d(l,{F:()=>n,Ie:()=>o,Oz:()=>a,RW:()=>m,SS:()=>r,eT:()=>s,m6:()=>c});let s={"Content-Type":"application/json"};async function r(e,l){try{let s,r=await fetch(e,l),n=await r.text();try{s=n?JSON.parse(n):void 0}catch(e){s=void 0}if(!r.ok){var t;let e=null!=s?s:{};return{ok:!1,status:r.status,message:null!=(t=e.error)?t:"HTTP ".concat(r.status),issues:Array.isArray(e.errors)?e.errors:[]}}return{ok:!0,data:s}}catch(e){return{ok:!1,status:0,message:e instanceof Error?e.message:"网络请求失败",issues:[]}}}let n="内置技能只读,随应用版本更新。可新建用户技能进行配置。";function i(e){return[...new Set((null!=e?e:[]).map(e=>e.trim()).filter(e=>e.length>0))]}function a(e){return"string"==typeof e?e:e.phrase}function c(e){return{id:e.id,enabled:e.enabled,match:{chapterDomain:e.match.chapterDomain,projectTypes:[...e.match.projectTypes],sectionKeywords:[...e.match.sectionKeywords],...e.match.sectionRegex?{sectionRegex:e.match.sectionRegex}:{}},requires:e.requires.map(e=>({...e})),structure:e.structure.map(e=>{var l;return{title:e.title,required:[...null!=(l=e.required)?l:[]]}}),forbidden:e.forbidden.map(a),knowledge:e.knowledge.map(e=>({kind:e.kind,...e.ids?{ids:[...e.ids]}:{},...e.note?{note:e.note}:{}})),acceptance:e.acceptance.map(e=>({kind:"llmChecklist",checklistItems:[...e.items]})),...void 0!==e.outputTitle?{outputTitle:e.outputTitle}:{},...e.chapterChecklist?{chapterChecklist:{...e.chapterChecklist,...e.chapterChecklist.sections?{sections:[...e.chapterChecklist.sections]}:{}}}:{}}}function o(){return{id:"skill-".concat(Date.now()),enabled:!0,match:{projectTypes:[],sectionKeywords:[]},requires:[{source:"boq",required:!1}],structure:[{}],forbidden:[],knowledge:[],acceptance:[{kind:"llmChecklist",checklistItems:[]}]}}function d(e){var l;return(null!=(l=e.ids)?l:[]).length>0}function u(e){var l;return(null!=(l=e.checklistItems)?l:[]).length>0}function m(e,l,t){var s,r,n,a,c,o,m,x,p,h;let j={chapterDomain:null==(s=e.match)?void 0:s.chapterDomain,projectTypes:[...null!=(o=null==(r=e.match)?void 0:r.projectTypes)?o:[]],sectionKeywords:i(null==(n=e.match)?void 0:n.sectionKeywords),...(null==(c=e.match)||null==(a=c.sectionRegex)?void 0:a.trim())?{sectionRegex:e.match.sectionRegex.trim()}:{}},v=(null!=(m=e.requires)?m:[]).filter(e=>{var l;return(null!=(l=e.key)?l:"").trim().length>0}).map(e=>{var l;return{key:(null!=(l=e.key)?l:"").trim(),source:e.source,required:!0===e.required}}),y=(null!=(x=e.structure)?x:[]).filter(e=>{var l;return(null!=(l=e.title)?l:"").trim().length>0}).map(e=>{var l;return{title:(null!=(l=e.title)?l:"").trim(),required:i(e.required)}}),b=(null!=(p=e.knowledge)?p:[]).filter(d).map(e=>{var l;return{kind:"processCard",ids:i(e.ids),...(null==(l=e.note)?void 0:l.trim())?{note:e.note.trim()}:{}}}),f=(null!=(h=e.acceptance)?h:[]).filter(u).map(e=>({kind:"llmChecklist",items:i(e.checklistItems),nonDeterministic:!0}));return{id:e.id.trim(),version:l,source:"user",enabled:!1!==e.enabled,match:j,requires:v,structure:y,forbidden:i(e.forbidden),knowledge:b,acceptance:f,...function(e){var l,t,s,r;let n=null!=(r=null==(l=e.outputTitle)?void 0:l.trim())?r:"",a=e.chapterChecklist,c={sections:i(null==a?void 0:a.sections),queries:i(null==a?void 0:a.queries),requiredFacts:i(null==a?void 0:a.requiredFacts),tableSections:i(null==a?void 0:a.tableSections),tableRequirements:i(null==a?void 0:a.tableRequirements),pinnedEvidenceFilePaths:i(null==a?void 0:a.pinnedEvidenceFilePaths)},o=!!(null==a||null==(t=a.purpose)?void 0:t.trim())||Object.values(c).some(e=>e.length>0);return{...n?{outputTitle:n}:{},...o?{chapterChecklist:{...(null==a||null==(s=a.purpose)?void 0:s.trim())?{purpose:a.purpose.trim()}:{},...Object.fromEntries(Object.entries(c).filter(e=>{let[,l]=e;return l.length>0}))}}:{}}}(e),...t?{examples:t}:{}}}},62561:(e,l,t)=>{"use strict";t.d(l,{e:()=>a});var s=t(65321),r=t(43220),n=t.n(r),i=t(47210);function a(e){let{title:l,description:t,extra:r}=e;return(0,s.jsx)("div",{className:"bg-[var(--colorBgContainer)] rounded-2xl border border-[var(--borderColor)] p-6 mb-6",children:(0,s.jsxs)("div",{className:"flex flex-col md:flex-row md:items-center justify-between gap-6",children:[(0,s.jsxs)("div",{className:"flex items-center min-w-0",children:[(0,s.jsxs)(n(),{href:"/skills",className:"mr-4 text-sm text-[var(--colorTextSecondary)] hover:text-[var(--colorText)] inline-flex items-center gap-1 shrink-0",children:[(0,s.jsx)(i.A,{})," 返回技能库"]}),(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("h1",{className:"text-2xl font-bold text-[var(--colorText)] mb-1 truncate",children:l}),t?(0,s.jsx)("p",{className:"text-sm text-[var(--colorTextSecondary)] m-0",children:t}):null]})]}),r?(0,s.jsx)("div",{className:"shrink-0 flex items-center gap-2",children:r}):null]})})}},71922:(e,l,t)=>{"use strict";t.r(l),t.d(l,{default:()=>q});var s=t(65321),r=t(86109),n=t(43220),i=t.n(n),a=t(88762),c=t(85493),o=t(84253),d=t(85114),u=t(99650),m=t(97109),x=t(62561),p=t(48399),h=t(68787),j=t(11702),v=t(35071);let{Text:y}=p.A;function b(e){let{label:l,children:t}=e;return(0,s.jsxs)("div",{className:"flex flex-col sm:flex-row gap-1 sm:gap-3 py-2 border-b border-[var(--colorBorderSecondary)] last:border-0",children:[(0,s.jsx)("div",{className:"sm:w-44 shrink-0 text-xs font-semibold uppercase tracking-wider text-[var(--colorTextTertiary)] sm:pt-0.5",children:l}),(0,s.jsx)("div",{className:"min-w-0 flex-1 text-sm",children:t})]})}function f(e){let{title:l,children:t}=e;return(0,s.jsx)(h.A,{size:"small",title:l,className:"rounded-2xl mb-4",styles:{body:{padding:"4px 12px"}},children:t})}function k(e){let{items:l,empty:t="未声明"}=e;return 0===l.length?(0,s.jsx)(y,{type:"secondary",className:"text-xs",children:t}):(0,s.jsx)("div",{className:"flex flex-wrap gap-1",children:l.map((e,l)=>(0,s.jsx)("span",{children:e},l))})}function g(e){var l,t,r,n,i;let{skill:a,options:c,labelMap:o}=e,d=e=>{var l;return null!=(l=o.get(e))?l:e},u=e=>{var l,t;return null!=(t=null==c||null==(l=c.processCards.find(l=>l.value===e))?void 0:l.label)?t:e},m=a.chapterChecklist,x=m?[{label:"章内检索词",values:null!=(l=m.queries)?l:[]},{label:"必含事实",values:null!=(t=m.requiredFacts)?t:[]},{label:"要求成表的小节",values:null!=(r=m.tableSections)?r:[]},{label:"表格形态要求",values:null!=(n=m.tableRequirements)?n:[]},{label:"钉住的证据文件",values:null!=(i=m.pinnedEvidenceFilePaths)?i:[]}].filter(e=>e.values.length>0):[];return(0,s.jsxs)("div",{children:[(0,s.jsxs)(f,{title:"基本信息",children:[(0,s.jsxs)(b,{label:"技能 ID",children:[(0,s.jsx)(y,{code:!0,className:"text-xs",children:a.id}),(0,s.jsx)(y,{type:"secondary",className:"text-xs ml-2",children:"用于区分和管理技能"})]}),(0,s.jsxs)(b,{label:"来源",children:[a.builtIn?(0,s.jsx)(j.A,{color:"gold",children:"内置"}):(0,s.jsx)(j.A,{children:"用户"}),(0,s.jsxs)(y,{type:"secondary",className:"text-xs ml-2",children:["技能格式 v",a.version]})]}),(0,s.jsx)(b,{label:"启用",children:(0,s.jsx)(j.A,{color:a.enabled?"green":"default",className:"border-0",children:a.enabled?"已启用":"已停用"})})]}),(0,s.jsxs)(f,{title:"匹配条件",children:[(0,s.jsx)(b,{label:"章域",children:(0,s.jsx)(j.A,{color:"blue",children:d(a.match.chapterDomain)})}),(0,s.jsx)(b,{label:"适用工程类型",children:(0,s.jsx)(k,{empty:"全类型(不限定工程类型)",items:a.match.projectTypes.map(e=>(0,s.jsx)(j.A,{children:d(e)},e))})}),(0,s.jsx)(b,{label:"小节标题关键词",children:(0,s.jsx)(k,{empty:"未限定小节标题关键词",items:a.match.sectionKeywords.map(e=>(0,s.jsx)(j.A,{className:"border-0 bg-[var(--colorFillSecondary)]",children:e},e))})}),(0,s.jsx)(b,{label:"小节标题正则",children:a.match.sectionRegex?(0,s.jsx)(y,{code:!0,className:"text-xs",children:a.match.sectionRegex}):(0,s.jsx)(y,{type:"secondary",className:"text-xs",children:"未声明"})})]}),(0,s.jsx)(f,{title:"所需项目资料",children:(0,s.jsx)(k,{empty:"未声明必需事实",items:a.requires.map(e=>(0,s.jsxs)(j.A,{color:e.required?"red":"default",className:"mb-1",children:[e.key," \xb7 ",d(e.source),e.required?" \xb7 必需":" \xb7 可选"]},e.key))})}),(0,s.jsx)(f,{title:"相关专业主题 \xb7 ".concat(a.structure.length," 项"),children:0===a.structure.length?(0,s.jsx)(y,{type:"secondary",className:"text-xs",children:"未声明专业主题"}):(0,s.jsx)("ol",{className:"m-0 pl-5 text-sm leading-7",children:a.structure.map((e,l)=>{var t;return(0,s.jsxs)("li",{children:[e.title,(0,s.jsx)(y,{type:"secondary",className:"text-xs ml-2",children:(null==(t=e.required)?void 0:t.join(";"))||"按具体对象组织内容"})]},"".concat(e.title,"-").concat(l))})})}),(0,s.jsxs)(f,{title:"文档业务提示",children:[(0,s.jsx)(b,{label:"文档名称",children:a.outputTitle?(0,s.jsx)(y,{strong:!0,children:a.outputTitle}):(0,s.jsx)(y,{type:"secondary",className:"text-xs",children:"未声明(不对文档名称表态)"})}),(0,s.jsx)(b,{label:"章职责",children:(null==m?void 0:m.purpose)?(0,s.jsx)("span",{children:m.purpose}):(0,s.jsx)(y,{type:"secondary",className:"text-xs",children:"未声明"})}),x.map(e=>(0,s.jsx)(b,{label:e.label,children:(0,s.jsx)(k,{items:e.values.map(e=>(0,s.jsx)(j.A,{className:"border-0 bg-[var(--colorFillSecondary)]",children:e},e))})},e.label))]}),(0,s.jsx)(f,{title:"禁写项",children:(0,s.jsx)(k,{empty:"没有禁写项",items:a.forbidden.map(e=>(0,s.jsx)(j.A,{color:"red",className:"border-0",children:(0,v.Oz)(e)},(0,v.Oz)(e)))})}),(0,s.jsx)(f,{title:"工艺知识引用",children:(0,s.jsx)(k,{empty:"未声明知识引用",items:a.knowledge.map((e,l)=>{var t,r,n,i;let a=(null!=(t=e.ids)?t:[]).map(u).join("、");return(0,s.jsxs)(j.A,{className:"mb-1",children:[(r=e.kind,null!=(i=null==c||null==(n=c.knowledgeKinds.find(e=>e.value===r))?void 0:n.label)?i:r),a?" \xb7 ".concat(a):"",e.note?"(".concat(e.note,")"):""]},"".concat(e.kind,"-").concat(l))})})}),(0,s.jsxs)(f,{title:"专业写作核对提示",children:[(0,s.jsx)(y,{type:"secondary",children:"按本任务对象和工况选用,不是数量要求或验收通过证明。"}),(0,s.jsx)("ul",{children:a.acceptance.flatMap(e=>e.items).map(e=>(0,s.jsx)("li",{children:e},e))})]}),(0,s.jsx)(f,{title:"表达示例",children:(0,s.jsx)(b,{label:"是否带示例",children:a.examples?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(j.A,{color:"green",className:"border-0",children:"带正例/反例"}),(0,s.jsx)(y,{type:"secondary",className:"text-xs ml-2",children:"供理解专业表达,不能作为本项目事实;本编辑器保留原示例。"})]}):(0,s.jsx)(y,{type:"secondary",className:"text-xs",children:"无"})})}),c&&(0,s.jsx)(f,{title:"资料与采用边界",children:c.isolationRules.map(e=>(0,s.jsxs)("div",{className:"py-1.5",children:[(0,s.jsx)(j.A,{children:e.label}),(0,s.jsx)(y,{type:"secondary",className:"text-xs",children:e.note})]},e.id))})]})}var N=t(33061);function w(e){let{skillId:l}=e,t=(0,N.G)(),r=(0,m.useMemo)(()=>l?t.skills.find(e=>e.id===l):void 0,[t.skills,l]),n=(0,m.useMemo)(()=>{var e,l,s,r,n,i;return new Map([...null!=(r=null==(e=t.options)?void 0:e.chapterDomains)?r:[],...null!=(n=null==(l=t.options)?void 0:l.projectTypes)?n:[],...null!=(i=null==(s=t.options)?void 0:s.factSources)?i:[]].map(e=>[e.value,e.label]))},[t.options]),p=!l,h=!t.loading&&!t.failed&&!!t.options&&!r;return p||t.loading?(0,s.jsxs)("div",{className:"space-y-5 animateFadeIn",children:[(0,s.jsx)(a.A,{active:!0,title:!0,paragraph:{rows:2}}),(0,s.jsx)(a.A,{active:!0,paragraph:{rows:10}})]}):t.failed?(0,s.jsxs)("div",{className:"space-y-5 animateFadeIn",children:[(0,s.jsx)(x.e,{title:"技能预览"}),(0,s.jsx)(c.A,{type:"error",showIcon:!0,message:"技能库读取失败",description:"".concat(t.failed,';这不是"技能不存在",请核对服务端状态后重试。')})]}):h||!r?(0,s.jsxs)("div",{className:"space-y-5 animateFadeIn",children:[(0,s.jsx)(x.e,{title:"技能预览"}),(0,s.jsx)(o.A,{description:"技能库里没有「".concat(l,"」这条技能(可能已被删除或改名)"),children:(0,s.jsx)(i(),{href:"/skills",children:(0,s.jsx)(d.Ay,{type:"primary",children:"返回技能库"})})})]}):(0,s.jsxs)("div",{className:"space-y-5 animateFadeIn",children:[(0,s.jsx)(x.e,{title:"技能预览 \xb7 ".concat(r.displayName),description:"只读查看这条技能声明了什么;要改内容进编辑页,保存前会做字段与引用校验。",extra:(0,s.jsx)(i(),{href:"/skills/".concat(encodeURIComponent(r.id),"/edit"),children:(0,s.jsx)(d.Ay,{type:"primary",icon:(0,s.jsx)(u.A,{}),disabled:r.builtIn,title:r.builtIn?v.F:void 0,children:"编辑"})})}),r.builtIn&&(0,s.jsx)(c.A,{type:"info",showIcon:!0,message:"内置技能",description:v.F}),(0,s.jsx)(g,{skill:r,options:t.options,labelMap:n})]})}function q(){let e=(0,r.useRouter)(),l="string"==typeof e.query.id?e.query.id:void 0;return(0,s.jsx)(w,{skillId:l})}},95195:(e,l,t)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/skills/[id]",function(){return t(71922)}])}},e=>{e.O(0,[665,569,787,573,636,593,792],()=>e(e.s=95195)),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[979],{7225:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>S});var a=r(65321),s=r(97109),o=r(43220),l=r.n(o),n=r(48399),c=r(9137),i=r(11702),d=r(88762),x=r(85114),g=r(7576),m=r(32965),p=r(38964),u=r(84253),h=r(47210),f=r(30486),v=r(99811),b=r(58209),w=r(12446),y=r(88483);function j(){return(j=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e}).apply(this,arguments)}let N=s.forwardRef((e,t)=>s.createElement(y.A,j({},e,{ref:t,icon:w.A})));var A=r(32244),C=r(6578),k=r(58690);let{Text:T}=n.A;function S(){let e=(0,A.Vr)(),[t,r]=(0,s.useState)([]),[o,n]=(0,s.useState)(!0),[w,y]=(0,s.useState)(""),j=async()=>{n(!0);try{r((await (0,C.oH)(500)).logs)}catch(e){c.Ay.error(e instanceof Error?e.message:"加载日志失败")}finally{n(!1)}};(0,s.useEffect)(()=>{j()},[]);let S=(0,s.useMemo)(()=>{let e=w.trim().toLowerCase();return e?t.filter(t=>[t.id,t.level,t.source,t.functionName,t.message,t.stack].filter(Boolean).some(t=>String(t).toLowerCase().includes(e))):t},[w,t]),O=[{title:e("logs.time"),dataIndex:"createdAt",width:160,render:e=>(0,a.jsx)("span",{className:"text-xs text-[var(--colorTextSecondary)] font-mono",children:new Date(e).toLocaleString()})},{title:e("logs.level"),dataIndex:"level",width:80,render:e=>(0,a.jsx)(i.A,{color:"error"===e?"error":"warn"===e?"warning":"blue",className:"m-0 text-[10px] uppercase tracking-wider border-0",children:e})},{title:e("logs.source"),dataIndex:"source",width:220,render:e=>(0,a.jsx)("span",{className:"text-xs font-mono text-[var(--colorTextSecondary)] break-all",children:e})},{title:e("logs.message"),dataIndex:"message",render:e=>(0,a.jsx)("div",{className:"text-sm text-[var(--colorText)] max-w-3xl whitespace-normal break-words leading-relaxed",title:e,children:e})},{title:e("logs.requestId"),dataIndex:"id",width:120,render:e=>(0,a.jsx)(T,{copyable:!0,className:"text-[10px] font-mono text-[var(--colorTextTertiary)]",children:e.slice(0,8)})}];return o&&0===t.length?(0,a.jsxs)("div",{className:"space-y-8 animateFadeIn",children:[(0,a.jsx)(d.A,{active:!0,title:!0,paragraph:{rows:1}}),(0,a.jsx)(d.A,{active:!0,paragraph:{rows:12}})]}):(0,a.jsxs)("div",{className:"h-[calc(100vh_-_140px)] flex flex-col",children:[(0,a.jsxs)("div",{className:"flex flex-col md:flex-row md:items-center justify-between gap-4 pb-4 border-b border-[var(--borderColor)] shrink-0 animateFadeIn",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"text-2xl font-bold tracking-tight text-[var(--colorText)] mb-1",children:e("nav.systemLogs")}),(0,a.jsx)("p",{className:"text-xs text-[var(--colorTextSecondary)]",children:e("logs.monitorSystem")})]}),(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)(l(),{href:"/settings",children:(0,a.jsx)(x.Ay,{icon:(0,a.jsx)(h.A,{}),className:"shadow-none",children:e("logs.backToSettings")})}),(0,a.jsx)(g.A,{placeholder:e("logs.searchLogs"),prefix:(0,a.jsx)(f.A,{className:"text-[var(--colorTextTertiary)]"}),value:w,onChange:e=>y(e.target.value),allowClear:!0,className:"w-[260px] bg-[var(--colorBgHover)] border-transparent"}),(0,a.jsx)(x.Ay,{icon:(0,a.jsx)(v.A,{}),loading:o,onClick:()=>void j(),className:"shadow-none",children:e("logs.refresh")}),(0,a.jsx)(m.A,{title:e("logs.clearConfirm"),onConfirm:()=>{(async()=>{let t=await (0,C.hH)();c.Ay.success(e("logs.clearedFiles").replace("{count}",String(t.deleted))),await j()})()},children:(0,a.jsx)(x.Ay,{danger:!0,icon:(0,a.jsx)(b.A,{}),className:"shadow-none border-transparent",children:e("logs.clear")})})]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2 py-3 px-1 text-xs text-[var(--colorTextTertiary)] shrink-0 animateFadeIn stagger-1",children:[(0,a.jsx)(N,{})," ",e("logs.logStorageInfo")," ",(0,a.jsx)("code",{className:"bg-[var(--colorBgHover)] px-1 rounded",children:"~/.customize-agent/logs/errors.jsonl"}),". ",e("logs.maxLoaded")]}),(0,a.jsx)("div",{className:"flex-1 overflow-hidden bg-[var(--colorBg)] rounded-lg animateFadeIn stagger-2",children:(0,a.jsx)(p.A,{rowKey:"id",loading:o,dataSource:S,columns:O,size:"middle",className:"h-full modern-table tableFillHeight",locale:{emptyText:(0,a.jsx)(u.A,{description:e("logs.noLogsFound"),className:"py-20"})},pagination:(0,k.B)(e),rowClassName:"hover:bg-[var(--colorBgHover)] transition-colors cursor-pointer",expandable:{expandedRowRender:t=>(0,a.jsxs)("div",{className:"flex flex-col gap-4 p-4 bg-[var(--colorBgHover)]/50 border-t border-[var(--borderColor)]",children:[t.functionName&&(0,a.jsxs)("div",{className:"text-xs text-[var(--colorTextSecondary)]",children:[(0,a.jsx)("span",{className:"font-semibold uppercase tracking-wider text-[var(--colorTextTertiary)] mr-2",children:e("logs.function")}),(0,a.jsx)("code",{className:"font-mono bg-[var(--colorBgElevated)] px-2 py-1 rounded",children:t.functionName})]}),t.request&&(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-[10px] font-semibold uppercase tracking-wider text-[var(--colorTextTertiary)] mb-2",children:e("logs.requestContext")}),(0,a.jsx)("pre",{className:"text-xs font-mono bg-[var(--colorBgElevated)] p-3 rounded-md border border-[var(--borderColor)] whitespace-pre-wrap break-all m-0 text-[var(--colorTextSecondary)]",children:JSON.stringify(t.request,null,2)})]}),void 0!==t.meta&&(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-[10px] font-semibold uppercase tracking-wider text-[var(--colorTextTertiary)] mb-2",children:e("logs.metadata")}),(0,a.jsx)("pre",{className:"text-xs font-mono bg-[var(--colorBgElevated)] p-3 rounded-md border border-[var(--borderColor)] whitespace-pre-wrap break-all m-0 text-[var(--colorTextSecondary)]",children:JSON.stringify(t.meta,null,2)})]}),t.stack&&(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-[10px] font-semibold uppercase tracking-wider text-[var(--colorTextTertiary)] mb-2",children:e("logs.stackTrace")}),(0,a.jsx)("pre",{className:"text-[11px] font-mono bg-[#1e1e1e] text-[#d4d4d4] p-3 rounded-md overflow-x-auto m-0 leading-relaxed",children:t.stack})]})]})}})})]})}},9137:(e,t,r)=>{"use strict";r.d(t,{Ay:()=>C});var a=r(9750),s=r(97109),o=r(42644),l=r(10252),n=r(74567),c=r(48921),i=r(98379),d=r(3638),x=r(632),g=r(34475),m=r(52093),p=r(60815),u=r(5741);let h=null,f=e=>e(),v=[],b={};function w(){let{getContainer:e,duration:t,rtl:r,maxCount:a,top:s,stack:o}=b,l=e?.()||document.body;return{getContainer:()=>l,duration:t,rtl:r,maxCount:a,top:s,stack:o}}let y=s.forwardRef((e,t)=>{let{messageConfig:r,sync:a}=e,{getPrefixCls:o}=(0,s.useContext)(n.QO),c=b.prefixCls||o("message"),i=(0,s.useContext)(l.B),[d,x]=(0,p.y)({...r,prefixCls:c,...i.message});return s.useImperativeHandle(t,()=>{let e={...d};return Object.keys(e).forEach(t=>{e[t]=(...e)=>(a(),d[t].apply(d,e))}),{instance:e,sync:a}}),x}),j=s.forwardRef((e,t)=>{let[r,a]=s.useState(w),o=()=>{a(w)};s.useEffect(o,[]);let l=(0,c.cr)(),n=l.getRootPrefixCls(),i=l.getIconPrefixCls(),d=l.getTheme(),x=s.createElement(y,{ref:t,sync:o,messageConfig:r});return s.createElement(c.Ay,{prefixCls:n,iconPrefixCls:i,theme:d},l.holderRender?l.holderRender(x):x)}),N=()=>{if(!h){let e=document.createDocumentFragment(),t={fragment:e};h=t,f(()=>{(0,o.XX)(s.createElement(j,{ref:e=>{let{instance:r,sync:a}=e||{};Promise.resolve().then(()=>{!t.instance&&r&&(t.instance=r,t.sync=a,N())})}}),e)});return}h.instance&&(v.forEach(e=>{let{type:t,skipped:r}=e;if(!r)switch(t){case"open":f(()=>{let t=h.instance.open({...b,...e.config});t?.then(e.resolve),e.setCloseFn(t)});break;case"destroy":f(()=>{h?.instance.destroy(e.key)});break;default:f(()=>{var r;let s=(r=h.instance)[t].apply(r,(0,a.A)(e.args));s?.then(e.resolve),e.setCloseFn(s)})}}),v=[])},A={open:function(e){let t=(0,u.E)(t=>{let r,a={type:"open",config:e,resolve:t,setCloseFn:e=>{r=e}};return v.push(a),()=>{r?f(()=>{r()}):a.skipped=!0}});return N(),t},destroy:e=>{v.push({type:"destroy",key:e}),N()},config:function(e){b={...b,...e},f(()=>{h?.sync?.()})},useMessage:p.A,_InternalPanelDoNotUseOrYouWillBeFired:g.Ay,_InternalListDoNotUseOrYouWillBeFired:e=>{let{items:t,classNames:r,style:a}=e,{getPrefixCls:o}=(0,n.TP)("message"),l=o("message"),c=(0,x.A)(l),[p,u]=(0,m.A)(l,c),h=`${l}-notice`,f=t.map(e=>{let{content:t,duration:r,key:a,type:s}=e,o=s?`${h}-icon-${s}`:void 0;return{key:a,duration:r,icon:(0,g.HC)(s),title:t,className:`${h}-${s}`,classNames:{wrapper:`${l}-${s}`,icon:o}}});return s.createElement(i.qb,{prefixCls:l,placement:"top",configList:f,className:(0,d.$)(p,u,c),classNames:{...r,wrapper:r?.wrapper,title:r?.title},style:a,stack:!1})}};["success","info","warning","error","loading"].forEach(e=>{A[e]=(...t)=>(function(e,t){(0,c.cr)();let r=(0,u.E)(r=>{let a,s={type:e,args:t,resolve:r,setCloseFn:e=>{a=e}};return v.push(s),()=>{a?f(()=>{a()}):s.skipped=!0}});return N(),r})(e,t)});let C=A},12446:(e,t)=>{"use strict";t.A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M464 336a48 48 0 1096 0 48 48 0 10-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z"}}]},name:"info-circle",theme:"outlined"}},14995:(e,t)=>{"use strict";t.A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M909.1 209.3l-56.4 44.1C775.8 155.1 656.2 92 521.9 92 290 92 102.3 279.5 102 511.5 101.7 743.7 289.8 932 521.9 932c181.3 0 335.8-115 394.6-276.1 1.5-4.2-.7-8.9-4.9-10.3l-56.7-19.5a8 8 0 00-10.1 4.8c-1.8 5-3.8 10-5.9 14.9-17.3 41-42.1 77.8-73.7 109.4A344.77 344.77 0 01655.9 829c-42.3 17.9-87.4 27-133.8 27-46.5 0-91.5-9.1-133.8-27A341.5 341.5 0 01279 755.2a342.16 342.16 0 01-73.7-109.4c-17.9-42.4-27-87.4-27-133.9s9.1-91.5 27-133.9c17.3-41 42.1-77.8 73.7-109.4 31.6-31.6 68.4-56.4 109.3-73.8 42.3-17.9 87.4-27 133.8-27 46.5 0 91.5 9.1 133.8 27a341.5 341.5 0 01109.3 73.8c9.9 9.9 19.2 20.4 27.8 31.4l-60.2 47a8 8 0 003 14.1l175.6 43c5 1.2 9.9-2.6 9.9-7.7l.8-180.9c-.1-6.6-7.8-10.3-13-6.2z"}}]},name:"reload",theme:"outlined"}},39214:(e,t,r)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/system/logs",function(){return r(7225)}])},47210:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});var a=r(97109),s=r(58970),o=r(88483);function l(){return(l=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e}).apply(this,arguments)}let n=a.forwardRef((e,t)=>a.createElement(o.A,l({},e,{ref:t,icon:s.A})))},58690:(e,t,r)=>{"use strict";function a(e){var t,r,a;let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{defaultPageSize:null!=(t=s.pageSize)?t:10,pageSizeOptions:null!=(r=s.pageSizeOptions)?r:[10,20,50,100],showSizeChanger:!0,showTotal:t=>{var r,a;return e(null!=(r=s.totalLabelKey)?r:"common.totalRows",null!=(a=s.totalLabelFallback)?a:"共 {count} 条").replace("{count}",String(t))},hideOnSinglePage:null!=(a=s.hideOnSinglePage)&&a,showQuickJumper:!1}}r.d(t,{B:()=>a})},58970:(e,t)=>{"use strict";t.A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M872 474H286.9l350.2-304c5.6-4.9 2.2-14-5.2-14h-88.5c-3.9 0-7.6 1.4-10.5 3.9L155 487.8a31.96 31.96 0 000 48.3L535.1 866c1.5 1.3 3.3 2 5.2 2h91.5c7.4 0 10.8-9.2 5.2-14L286.9 550H872c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8z"}}]},name:"arrow-left",theme:"outlined"}},99811:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});var a=r(97109),s=r(14995),o=r(88483);function l(){return(l=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e}).apply(this,arguments)}let n=a.forwardRef((e,t)=>a.createElement(o.A,l({},e,{ref:t,icon:s.A})))}},e=>{e.O(0,[324,815,665,576,499,338,964,636,593,792],()=>e(e.s=39214)),_N_E=e.O()}]);
|