@customize-agent/server 4.2.2 → 4.2.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.
Files changed (43) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/build-manifest.json +20 -20
  3. package/.next/prerender-manifest.json +3 -3
  4. package/.next/server/chunks/1936.js +3 -3
  5. package/.next/server/chunks/8325.js +36 -36
  6. package/.next/server/chunks/9301.js +3 -3
  7. package/.next/server/middleware-build-manifest.js +1 -1
  8. package/.next/server/pages/404.html +1 -1
  9. package/.next/server/pages/500.html +1 -1
  10. package/.next/server/pages/_error.js +1 -1
  11. package/.next/server/pages/asset-library.html +1 -1
  12. package/.next/server/pages/document-roles.html +1 -1
  13. package/.next/server/pages/documents.html +1 -1
  14. package/.next/server/pages/guide.html +1 -1
  15. package/.next/server/pages/index.html +1 -1
  16. package/.next/server/pages/knowledge/file-detail.html +1 -1
  17. package/.next/server/pages/knowledge/files.html +1 -1
  18. package/.next/server/pages/knowledge/manage.html +1 -1
  19. package/.next/server/pages/knowledge.html +1 -1
  20. package/.next/server/pages/models.html +1 -1
  21. package/.next/server/pages/overview.html +1 -1
  22. package/.next/server/pages/prompt.html +1 -1
  23. package/.next/server/pages/settings.html +1 -1
  24. package/.next/server/pages/system/logs.html +1 -1
  25. package/.next/server/pages-manifest.json +30 -30
  26. package/.next/static/{Irr3gFa37qQ3lYUuhknT2 → NlYmM-VSPiEiIrPNdk1GP}/_buildManifest.js +1 -1
  27. package/.next/static/chunks/{289-12dfcb3abec1c4b4.js → 289-35ac595388bbd018.js} +1 -1
  28. package/.next/static/chunks/563-b12f299d34bb9e44.js +1 -0
  29. package/.next/static/chunks/788-3afeb069ed706ac0.js +1 -0
  30. package/.next/static/chunks/pages/documents-a2ccb31a69a78d98.js +1 -0
  31. package/.next/static/chunks/pages/knowledge/files-0d9a0d407b38a0a3.js +1 -0
  32. package/.next/static/chunks/pages/knowledge/manage-a00bb7fc6a76f820.js +1 -0
  33. package/.next/static/chunks/pages/prompt-224af05519ef8304.js +1 -0
  34. package/.next/static/chunks/pages/system/logs-6f45ef8d862759a2.js +1 -0
  35. package/package.json +1 -1
  36. package/.next/static/chunks/563-2b116a2500a97dba.js +0 -1
  37. package/.next/static/chunks/788-961761f5858f9189.js +0 -1
  38. package/.next/static/chunks/pages/documents-15b4a1768c50c0d8.js +0 -1
  39. package/.next/static/chunks/pages/knowledge/files-486b43235273de1c.js +0 -1
  40. package/.next/static/chunks/pages/knowledge/manage-ca9bafc8b0f4a76b.js +0 -1
  41. package/.next/static/chunks/pages/prompt-200241126dbfb31a.js +0 -1
  42. package/.next/static/chunks/pages/system/logs-c5a8920c6506a7e8.js +0 -1
  43. /package/.next/static/{Irr3gFa37qQ3lYUuhknT2 → NlYmM-VSPiEiIrPNdk1GP}/_ssgManifest.js +0 -0
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[298],{16403:(e,t,r)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/documents",function(){return r(19562)}])},19562:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>ei});var s=r(65321),a=r(97109),l=r(26171),n=r(7576),o=r(35292),i=r(33442),c=r(17807),d=r(63455),u=r(11702),p=r(88762),m=r(85114),x=r(58569),h=r(84253),g=r(34052),v=r(68787),j=r(42700),f=r(2256),y=r(38770),w=r(38332),A=r(76506),b=r(50883),k=r(23718),S=r(23216),I=r(26619),C=r(8263),N=r(16285),T=r(8579),R=r(75548),E=r(7851),z=r(84742),M=r(29071),B=r(63552),D=r(26631),F=r(7225),_=r(83914),P=r(58209),L=r(38762),G=r(54746),W=r(93051),q=r(64068),H=r(64629),O=r(1310),K=r(67547),U=r(76830),V=r(6578),Q=r(48321);let{TextArea:X}=n.A,{Text:J}=o.A,Y=l.A;function Z(e){let{type:t="info",title:r,children:a,style:l}=e,n="error"===t?"var(--colorError)":"warning"===t?"var(--colorWarning)":"success"===t?"var(--colorSuccess)":"var(--colorInfo)";return(0,s.jsxs)("div",{style:{border:"1px solid ".concat(n),background:"error"===t?"var(--colorErrorBg)":"warning"===t?"var(--colorWarningBg)":"success"===t?"var(--colorSuccessBg)":"var(--colorInfoBg)",borderRadius:8,padding:"9px 12px",...l},children:[(0,s.jsx)(J,{strong:!0,style:{color:n},children:r}),a&&(0,s.jsx)("div",{style:{marginTop:4,color:"var(--colorTextSecondary)",fontSize:12},children:a})]})}function $(e){let{children:t,gap:r=12,style:a}=e;return(0,s.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:r,...a},children:t})}let ee=null;function et(){null==ee||ee.listeners.forEach(e=>e())}let er={role_binding:(0,s.jsx)(S.A,{}),knowledge_retrieval:(0,s.jsx)(I.A,{}),file_understanding:(0,s.jsx)(C.A,{}),fact_extraction:(0,s.jsx)(N.A,{}),chapter_generation:(0,s.jsx)(T.A,{}),asset_generation:(0,s.jsx)(R.A,{}),validation:(0,s.jsx)(E.A,{}),formatting:(0,s.jsx)(z.A,{}),llm_review:(0,s.jsx)(M.A,{}),export_ready:(0,s.jsx)(B.A,{}),reference:(0,s.jsx)(R.A,{})},es={施工组织设计:(0,s.jsx)(E.A,{}),投标文件:(0,s.jsx)(B.A,{}),技术方案:(0,s.jsx)(N.A,{}),报告:(0,s.jsx)(D.A,{}),自定义:(0,s.jsx)(T.A,{})};function ea(e){return[...new Set(e.map(e=>e.trim()).filter(Boolean))]}function el(e){return e.map(e=>({key:e.key,value:e.key,rawTitle:e.title,title:e.isFolder?(0,s.jsxs)("div",{className:"flex items-center justify-between w-full pr-4",children:[(0,s.jsxs)(i.A,{size:4,children:[(0,s.jsx)(F.A,{style:{color:"#faad14"}}),(0,s.jsx)("span",{children:e.title})]}),(0,s.jsxs)("span",{className:"text-xs text-[var(--colorTextTertiary)]",children:[e.fileCount||0," 项"]})]}):(0,s.jsx)("span",{title:e.key,children:e.title}),isFolder:e.isFolder,fileCount:e.fileCount||+!e.isFolder,isLeaf:e.isLeaf}))}let en={role_binding:"角色配置绑定",knowledge_retrieval:"知识库检索",file_understanding:"多模态文件理解",fact_extraction:"LLM 事实抽取",chapter_generation:"LLM 章节生成",asset_generation:"多模态资源生成",validation:"规则校验",formatting:"格式化排版",llm_review:"LLM 审查优化",export_ready:"导出就绪",reference:"参考资源处理"},eo={"knowledge-base":"知识库","document-readiness":"生成准备度检查","quality-repair":"质量补写","export-gate":"导出门禁","context-memory":"项目上下文","final-format":"正式排版","multimodal-files":"多模态文件理解",tender_announcement:"招标公告"};function ei(){var e,t,r,l,o,R,F,ei;let ec=(0,Q.Vr)(),{message:ed}=c.A.useApp(),[eu]=d.A.useForm(),ep=(0,a.useRef)(null),[em,ex]=(0,a.useState)([]),[eh,eg]=(0,a.useState)("construction-organization-design"),[ev,ej]=(0,a.useState)([]),[ef,ey]=(0,a.useState)([]),[ew,eA]=(0,a.useState)([]),[eb,ek]=(0,a.useState)([]),[eS,eI]=(0,a.useState)(!1),[eC,eN]=(0,a.useState)(!0),[eT,eR]=(0,a.useState)(!1),[eE,ez]=(0,a.useState)(null),[eM,eB]=(0,a.useState)(""),[eD,eF]=(0,a.useState)([]),[e_,eP]=(0,a.useState)(null),[eL,eG]=(0,a.useState)(null),[eW,eq]=(0,a.useState)(""),[eH,eO]=(0,a.useState)(!1),[eK,eU]=(0,a.useState)("idle"),[eV,eQ]=(0,a.useState)(null),[eX,eJ]=(0,a.useState)(null),[eY,eZ]=(0,a.useState)({start:0,end:0}),[e$,e0]=(0,a.useState)([]),[e1,e2]=(0,a.useState)(!1),[e6,e5]=(0,a.useState)(!1),[e8,e3]=(0,a.useState)({}),e4=(0,a.useMemo)(()=>{var e,t,r;return(null==(e=ew.find(e=>e.selected))?void 0:e.projectRoot)||(null==(t=ew.find(e=>e.isCurrent))?void 0:t.projectRoot)||(null==(r=ew[0])?void 0:r.projectRoot)||""},[ew]),[e7,e9]=(0,a.useState)([]),[te,tt]=(0,a.useState)(null),[tr,ts]=(0,a.useState)(null),[ta,tl]=(0,a.useState)("templates"),[tn,to]=(0,a.useState)(!1),[ti,tc]=(0,a.useState)("workflow"),[td,tu]=(0,a.useState)(null),tp=(0,a.useRef)(new Map),tm=(0,a.useRef)(""),tx=(0,a.useRef)(null),th=(0,a.useRef)(0),tg=(0,a.useMemo)(()=>"activeGenDocId:".concat(e4||"default"),[e4]),tv=async()=>{try{eF((await (0,V.cQ)(e4||void 0)).documents)}catch(e){eF([])}};(0,a.useEffect)(()=>{let e=()=>{ee&&(e9(ee.flowSteps),tt(ee.activeFlowKey),eR(ee.loading),ee.documentId&&eP(ee.documentId),ee.draft&&ez(ee.draft),void 0!==ee.content&&eB(ee.content))},t=ee;return null==t||t.listeners.add(e),e(),()=>{null==t||t.listeners.delete(e)}},[]),(0,a.useEffect)(()=>{eN(!0),Promise.all([(0,V.Dl)().then(e=>{var t,r;ex(e.templates),eg(null!=(r=null==(t=e.templates[0])?void 0:t.id)?r:"construction-organization-design")}),(0,V.lv)().then(e=>{ej(e.roles),ey(e.configs)}),(0,V.dx)().then(e=>eA(e))]).catch(()=>ed.error(ec("common.error"))).finally(()=>eN(!1))},[ed,ec]),(0,a.useEffect)(()=>{e4&&(localStorage.removeItem("activeGenDocId"),tv())},[e4]),(0,a.useEffect)(()=>{if(0===eD.length)return;let e=localStorage.getItem(tg);if(!e)return;if(!eD.find(t=>t.id===e&&"generating"===t.status))return void localStorage.removeItem(tg);let t=setInterval(()=>{(async()=>{try{let{document:r}=await (0,V.v7)(e,!1,e4||void 0);if(!r)return;await tv(),"generating"!==r.status&&(localStorage.removeItem(tg),clearInterval(t))}catch(e){clearInterval(t)}})()},3e3);return()=>clearInterval(t)},[eD]);let tj=(0,a.useMemo)(()=>em.find(e=>e.id===eh),[em,eh]),tf=ef.map(e=>({label:e.name,value:e.id})),ty=Math.max(0,e7.findIndex(e=>e.key===te)),tw=e=>{var t;return e?(null==(t=ev.find(t=>t.id===e))?void 0:t.name)||eo[e]||"未知角色":""},tA=e=>e.subtitle||e.roleName||tw(e.roleId)||en[e.type]||e.type,tb=e=>{var t,r,s;return e.promptName||((t=e.promptId)?(null==(r=ew.find(e=>e.id===t))?void 0:r.projectName)||(null==(s=ev.find(e=>e.id===t))?void 0:s.name)||eo[t]||"未知提示词":"")},tk=()=>{th.current+=1,eq(""),eQ(null),eJ(null),e0([]),e2(!1),eO(!1),eU("idle")},tS=async e=>{eP(e.id),eg(e.templateId);let t=tI(e.status);if(t||"failed"===e.status||"aborted"===e.status){tk(),ts(e),ez(null),eB(""),eR(t),tc("workflow"),to(!0);try{let{document:t}=await (0,V.v7)(e.id,!1,e.projectRoot||e4||void 0);if(!t)throw Error("文档记录不存在");tR(t),tI(t.status)?tz(t.id,t.projectRoot||e.projectRoot||e4||void 0):await tv()}catch(t){tR(e)}return}tc("editor"),e9([]),tt(null),tk();try{let{document:t}=await (0,V.v7)(e.id,!1,e.projectRoot||e4||void 0);if(!t)throw Error("文档记录不存在");ez(t.draft||null),eB(t.editedMarkdown||t.markdown)}catch(e){ed.error(ec("common.error"))}to(!0)},tI=e=>"completed"!==e&&"warning"!==e&&"failed"!==e&&"aborted"!==e,tC=e=>{var t,r,s,a,l,n;return!!e&&("failed"===e.status||"aborted"===e.status||"warning"===e.status&&!!(null==(t=e.checkpointChapters)?void 0:t.length)&&/继续生成|重新生成|中断|卡住|未完成|门禁|阻断/u.test(e.error||(null==(r=e.warningIssues)?void 0:r.join(";"))||(null==(l=e.draft)||null==(a=l.exportGate)||null==(s=a.blockingIssues)?void 0:s.map(e=>e.message).join(";"))||"")||!!((null==(n=e.draft)?void 0:n.exportGate)&&!1===e.draft.exportGate.passed))},tN=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:eT;(null==ee?void 0:ee.loading)&&(ee.flowSteps=e,ee.activeFlowKey=t,ee.loading=r,et())},tT=e=>{var t,r,a,l,n;let o=e.executionStages||(null==(t=e.draft)?void 0:t.executionStages)||[];if(o.length>0){let t=o.map((t,r)=>{var a;let l,n=("failed"===e.status||"aborted"===e.status)&&"running"===t.status||"failed"===(l=t.status)?"error":"running"===l?"process":"finish";return{key:"".concat(t.type,"-").concat(r),title:t.title||en[t.type]||t.type,subtitle:tA(t),description:t.message||"",status:n,icon:"role_binding"===(a=t.type)?(0,s.jsx)(S.A,{}):"knowledge_retrieval"===a?(0,s.jsx)(I.A,{}):"file_understanding"===a?(0,s.jsx)(C.A,{}):"fact_extraction"===a?(0,s.jsx)(N.A,{}):"chapter_generation"===a?(0,s.jsx)(T.A,{}):"llm_review"===a?(0,s.jsx)(M.A,{}):"validation"===a?(0,s.jsx)(E.A,{}):"formatting"===a?(0,s.jsx)(z.A,{}):"export_ready"===a?(0,s.jsx)(B.A,{}):(0,s.jsx)(D.A,{}),subSteps:((e,t,r)=>{let s=Array.isArray(e.details)?e.details.filter(Boolean):[],a=e.progress?"".concat(e.progress.label||"进度",":").concat(e.progress.current,"/").concat(e.progress.total):"",l=[...a?[a]:[],...s];return 0===l.length?[{key:"stage-".concat(r),title:tb(e)?"提示词:".concat(tb(e)):tA(e),status:t}]:l.slice(0,8).map((e,s)=>({key:"stage-".concat(r,"-").concat(s),title:e,status:"process"===t&&0===s?"process":"error"===t&&0===s?"error":"warning"===t?"warning":"process"===t?"finish":t}))})(t,n,r)}});"generating"===e.status&&t.length>0&&(null==(r=t.at(-1))?void 0:r.status)==="finish"&&(t[t.length-1]={...t[t.length-1],status:"process"});let i="generating"===e.status?(null==(a=t.at(-1))?void 0:a.key)||"prepare":"failed"===e.status||"aborted"===e.status?(null==(l=t.find(e=>"error"===e.status))?void 0:l.key)||(null==(n=t.at(-1))?void 0:n.key)||"prepare":"done";return{steps:t,activeKey:i}}return{steps:[],activeKey:null}},tR=e=>{let t=e.executionStages||[],r="".concat(e.id,"|").concat(e.updatedAt,"|").concat(e.status,"|").concat(e.error||"","|").concat(t.length,"|").concat(t.map(e=>{var t,r,s,a;return"".concat(e.status,":").concat(null!=(s=null==(t=e.progress)?void 0:t.current)?s:0,"/").concat(null!=(a=null==(r=e.progress)?void 0:r.total)?a:0)}).join(","));if(tm.current===r)return;tm.current=r,ts(e);let{steps:s,activeKey:a}=tT(e);e9(s),tt(a),eR(tI(e.status)),tN(s,a,tI(e.status)),("failed"===e.status||"aborted"===e.status)&&tc("workflow"),("completed"===e.status||"warning"===e.status)&&e.draft&&(ez(e.draft),eB(e.editedMarkdown||e.markdown),tc("editor"),e9([]),tt(null))},tE=e=>{let t=tp.current.get(e);t&&(clearInterval(t),tp.current.delete(e))},tz=(e,t)=>{tE(e);let r=setInterval(()=>{(async()=>{try{let{document:r}=await (0,V.v7)(e,!0,t||e4||void 0);if(!r)return;tR(r),await tv(),tI(r.status)||(tE(e),localStorage.removeItem(tg))}catch(e){}})()},2e3);tp.current.set(e,r)};(0,a.useEffect)(()=>()=>{for(let e of tp.current.values())clearInterval(e);tp.current.clear(),tx.current&&(clearTimeout(tx.current),tx.current=null)},[]),(0,a.useEffect)(()=>{if(!eT||!te)return;let e=window.setInterval(()=>e9(e=>{let t=e.map(e=>{if(e.key!==te||"process"!==e.status)return e;let t=e.subSteps.findIndex(e=>"process"===e.status),r=t<0?0:Math.min(t+1,e.subSteps.length-1);return{...e,subSteps:e.subSteps.map((e,t)=>t<r?{...e,status:"finish"}:t===r?{...e,status:"process"}:{...e,status:"wait"})}});return tN(t,te),t}),1400);return()=>window.clearInterval(e)},[te,eT]);let tM=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";eI(!0);try{let t=await (0,V.Fi)(e,e4||void 0);ek(el(t.nodes))}catch(e){ed.error("知识库文件加载失败")}finally{eI(!1)}},tB=async e=>{var t;let r=String(null!=(t=e.key)?t:"");if(r)try{let e=await (0,V.Fi)(r,e4||void 0),t=el(e.nodes),s=e=>e.map(e=>e.key===r?{...e,children:t}:e.children?{...e,children:s(e.children)}:e);ek(e=>s(e))}catch(e){ed.error("加载子文件夹失败")}},tD=e=>{let t=null!=e?e:{id:"tpl-".concat(Date.now()),name:"",description:"",category:"自定义",outputTitle:"",projectRoleConfigId:void 0,chapters:[],projectBindings:[]};eu.resetFields(),eu.setFieldsValue({...t,projectMaterialRoots:ea((t.projectBindings||[]).map(e=>e.materialRootPath).filter(Boolean))}),tM(),e5(!0)},tF=async()=>{try{await eu.validateFields();let e=eu.getFieldsValue(!0),t=ea(e.projectMaterialRoots||[]).map(e=>({materialRootPath:e})),{projectMaterialRoots:r,...s}=e,a={...s,chapters:[],projectBindings:t},l=await (0,V.l2)(a);ex(l.templates),eg(l.template.id),e5(!1),await tv(),ed.success(ec("common.success"))}catch(e){e instanceof Error&&ed.error(e.message)}},t_=async e=>{try{let t=await (0,V.bV)(e);ex(t.templates),eg(t.template.id),ed.success(ec("common.success"))}catch(e){ed.error(ec("common.error"))}},tP=async e=>{try{var t,r;let s=await (0,V.h0)(e);ex(s.templates),eg(null!=(r=null==(t=s.templates[0])?void 0:t.id)?r:""),ed.success(ec("common.success"))}catch(e){ed.error(ec("common.error"))}},tL=async e=>{tu(e),eg(e),eP(null),ez(null),eB(""),tk(),tc("workflow"),to(!0),tl("drafts"),eR(!0),tt("prepare"),e9([{key:"prepare",title:"正在准备运行模板",description:"正在校验模板绑定的项目资料包、提示词配置和资料索引,校验通过后会自动开始生成。",status:"process",icon:(0,s.jsx)(_.A,{}),subSteps:[{key:"validate",title:"模板运行前检查",status:"process"},{key:"start",title:"准备生成任务",status:"wait"}]}]);try{let{validation:t}=await (0,V.SM)(e,e4||void 0);e3(r=>({...r,[e]:t}));let r=t.issues.filter(e=>"error"===e.level);if(r.length>0){tH.current=!0,eR(!1),tt("prepare"),e9([{key:"prepare",title:"模板运行前检查未通过",description:r.map(e=>e.message).join("\n"),status:"error",icon:(0,s.jsx)(L.A,{}),subSteps:[{key:"validate",title:"模板运行前检查",status:"error"},{key:"start",title:"准备生成任务",status:"wait"}]}]),ed.warning("模板运行前检查未通过,请先处理阻断项");return}t.issues.length>0&&ed.warning("模板存在非阻断警告,已继续运行"),e9([{key:"prepare",title:"模板检查通过,正在创建生成任务",description:"已确认模板绑定资源可用,正在启动后台生成任务。",status:"process",icon:(0,s.jsx)(_.A,{}),subSteps:[{key:"validate",title:"模板运行前检查",status:"finish"},{key:"start",title:"准备生成任务",status:"process"}]}]),await tq(e)}catch(t){tH.current=!0;let e=t instanceof Error?t.message:"模板运行前检查失败";eR(!1),e9([{key:"prepare",title:"模板运行准备失败",description:e,status:"error",icon:(0,s.jsx)(L.A,{}),subSteps:[{key:"validate",title:"模板运行前检查",status:"error"},{key:"start",title:"准备生成任务",status:"wait"}]}]),ed.error(e)}finally{tu(t=>t===e?null:t)}},tG=async e=>{try{await (0,V.QG)(e.id,e.projectRoot||e4||void 0),e_===e.id&&(eP(null),ez(null),eB("")),await tv(),ed.success(ec("common.success"))}catch(e){ed.error(ec("common.error"))}},tW=async(e,t)=>{let r=Date.now(),s=0,a=Date.now(),l=0;for(;;){let n;if(null==t?void 0:t.aborted)throw Error("用户中止");let o=new AbortController;t&&(t.pollController=o);try{({document:n}=await (0,V.v7)(e,!0,e4||void 0,o.signal,s||void 0)),l=0}catch(e){if((null==t?void 0:t.aborted)||e instanceof DOMException&&"AbortError"===e.name)throw Error("用户中止",{cause:e});if((l+=1)>=3)throw e instanceof Error?e:Error("生成进度获取失败");await new Promise(e=>window.setTimeout(e,2e3*l));continue}finally{(null==t?void 0:t.pollController)===o&&(t.pollController=void 0)}if(!n){if(Date.now()-r>75e5||Date.now()-a>96e4)throw Error("生成任务疑似卡住,请点击继续生成或重新生成");await new Promise(e=>window.setTimeout(e,1500));continue}if(tR(n),n.updatedAt!==s&&(s=n.updatedAt,a=Date.now()),("completed"===n.status||"warning"===n.status)&&n.draft)return n;if("failed"===n.status||"aborted"===n.status)throw Error(n.error||("aborted"===n.status?"生成已中止":"生成失败"));if(Date.now()-r>75e5||Date.now()-a>96e4)throw Error("生成任务疑似卡住,请点击继续生成或重新生成");await new Promise(e=>window.setTimeout(e,1500))}},tq=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:eh;if(!e)return;if((null==ee?void 0:ee.aborted)&&(ee=null),null==ee?void 0:ee.loading){e9(ee.flowSteps),tt(ee.activeFlowKey),eR(!0);return}if(!e4)return void ed.error("未识别当前项目,请先选择或打开项目后再生成文件");eR(!0);let t=e7.length>0?e7:[{key:"prepare",title:"正在创建生成任务",description:"系统正在创建后台生成任务,请稍候。",status:"process",icon:(0,s.jsx)(_.A,{}),subSteps:[{key:"start",title:"准备生成任务",status:"process"}]}],r=te||"prepare";e9(t),tt(r);let a=(0,V.OX)({templateId:e,projectRoot:e4});ee={id:Date.now(),templateId:e,loading:!0,flowSteps:t,activeFlowKey:r,promise:a,listeners:new Set};let l=[];try{let e=await a;e.documentId&&(localStorage.setItem(tg,e.documentId),eP(e.documentId),(null==ee?void 0:ee.promise)===a&&(ee.documentId=e.documentId)),await tv();let t=e.documentId?await tW(e.documentId,(null==ee?void 0:ee.promise)===a?ee:void 0):void 0,r=e.draft||(null==t?void 0:t.draft);if(!r)throw Error("生成结果为空");(e.documentId||(null==t?void 0:t.id))&&eP(e.documentId||t.id),l.forEach(e=>window.clearTimeout(e)),ez(r),eB((null==t?void 0:t.editedMarkdown)||(null==t?void 0:t.markdown)||r.markdown),(null==ee?void 0:ee.promise)===a&&(ee.draft=r,ee.content=(null==t?void 0:t.editedMarkdown)||(null==t?void 0:t.markdown)||r.markdown);let s=t||{id:e.documentId||"draft-".concat(Date.now()),templateId:eh,title:r.title,requirement:r.requirement,projectRoot:r.projectRoot||e4,projectId:r.projectId,markdown:r.markdown,status:r.validationIssues.some(e=>"error"===e.level||"warning"===e.level)||!r.exportGate.passed?"warning":"completed",draft:r,executionStages:r.executionStages,assets:r.assets||[],createdAt:r.generatedAt,updatedAt:Date.now()},{steps:n}=tT(s);e9(n),tN(n,"done",!1),tt("done"),(null==ee?void 0:ee.promise)===a&&(ee.activeFlowKey="done",ee.loading=!1,et(),ee=null),localStorage.removeItem(tg),await tv(),ed.success(ec("common.success")),window.setTimeout(()=>{var e;return null==(e=ep.current)?void 0:e.scrollIntoView({behavior:"smooth",block:"start"})},200)}catch(r){localStorage.removeItem(tg);let e=r instanceof Error?r.message:ec("common.error"),t=/用户中止|abort|aborted/i.test(e);t||e9(t=>{let r=t.map(t=>"process"===t.status?{...t,status:"error",description:e,subSteps:((e,t)=>{if("wait"===t)return e.subSteps.map(e=>({...e,status:"wait"}));if("finish"===t)return e.subSteps.map(e=>({...e,status:"finish"}));if("error"===t)return e.subSteps.map((e,t)=>({...e,status:0===t?"error":e.status}));let r=e.subSteps.findIndex(e=>"wait"===e.status);return e.subSteps.map((e,t)=>t<r||-1===r?{...e,status:"finish"}:t===r?{...e,status:"process"}:e)})(t,"error")}:t);return tN(r,te,!1),r}),(null==ee?void 0:ee.promise)===a&&(ee.loading=!1,ee.error=e,et(),ee=null),await tv().catch(()=>void 0),t||ed.error(e)}finally{l.forEach(e=>window.clearTimeout(e)),eR(!1),(null==ee?void 0:ee.promise)===a&&(ee.loading=!1,et())}},tH=(0,a.useRef)(!1);(0,a.useEffect)(()=>(tx.current&&(clearTimeout(tx.current),tx.current=null),!tn||"workflow"!==ti||td||e_||tH.current||(null==ee?void 0:ee.loading)||null==tj||!tj.projectRoleConfigId||(tH.current=!0,tx.current=setTimeout(()=>{tx.current=null,tn&&"workflow"===ti&&!e_&&eh==eh&&tq()},300)),tn||(tH.current=!1),()=>{tx.current&&(clearTimeout(tx.current),tx.current=null)}),[tn,ti,td,e_,tj,eh]);let tO=async e=>{try{eP(e.id),eg(e.templateId),tc("workflow"),to(!0),eR(!0);let t=await (0,V.UQ)(e.id,e.projectRoot||e4||void 0);localStorage.setItem(tg,t.documentId),await tv();let r=await tW(t.documentId);r.draft&&(ez(r.draft),eB(r.editedMarkdown||r.markdown||r.draft.markdown),tc("editor")),localStorage.removeItem(tg),await tv(),ed.success("已继续生成并完成")}catch(e){ed.error(e instanceof Error?e.message:"继续生成失败")}finally{eR(!1)}},tK=async e=>{if((null==ee?void 0:ee.loading)&&ee.documentId===e.id){var t;ee.aborted=!0,null==(t=ee.pollController)||t.abort(),ee.loading=!1,ee.error="用户中止",et(),ee=null,eR(!1)}localStorage.removeItem(tg),tE(e.id);try{await (0,V.r)(e.id,e.projectRoot||e4||void 0),ed.success("已中止生成任务")}catch(e){ed.info("任务已不在运行,已刷新状态")}finally{await tv(),e_===e.id&&(eP(null),ts(null),ez(null),eB(""))}},tU=async e=>{if(eE){eG(e);try{eE.exportGate.passed||ed.warning("导出门禁存在风险项,已允许导出,请下载后人工复核。");let t={documentId:e_||void 0,title:eE.title,markdown:eM,format:e,enforceGate:!1,exportGate:eE.exportGate,useClientMarkdown:!0,projectRoot:eE.projectRoot||e4||void 0},r=await (0,V.UE)(t);((e,t,r)=>{let s=new Blob([e],{type:r}),a=URL.createObjectURL(s),l=document.createElement("a");l.href=a,l.download=t,l.target="_self",l.rel="noopener",l.style.display="none",document.body.appendChild(l),l.dispatchEvent(new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window})),l.remove(),window.setTimeout(()=>URL.revokeObjectURL(a),1e3)})(r,"".concat(eE.title,".").concat("markdown"===e?"md":e),{markdown:"text/markdown;charset=utf-8",html:"text/html;charset=utf-8",pdf:"application/pdf",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"}[e])}catch(e){ed.error(e instanceof Error?e.message:ec("common.error"))}finally{eG(null)}}},tV=async()=>{if(eE)try{if(e_)await (0,V.a6)(e_,{editedMarkdown:eM,markdown:eM},eE.projectRoot||e4||void 0);else{let e=await (0,V.Af)({...eE,markdown:eM});ez(e.draft)}await tv(),ed.success(ec("common.success"))}catch(e){ed.error(ec("common.error"))}},tQ=(e,t)=>{e0(r=>[{id:"".concat(Date.now()),content:e,prompt:t,createdAt:Date.now()},...r].slice(0,12))},tX=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];e&&eq(""),eQ(null),eJ(null),eZ({start:0,end:0})},tJ=(e,t)=>{var r,s;return{title:(null==eE?void 0:eE.title)||"未命名文档",markdown:t,instruction:e,facts:null==eE||null==(r=eE.structuredFacts)?void 0:r.map(e=>"".concat(e.key,": ").concat(e.value)),chapters:null==eE||null==(s=eE.chapters)?void 0:s.map(e=>e.title),...(()=>{let e=eY.start,t=eY.end;return t>e?{selection:{start:e,end:t,text:eM.slice(e,t)},cursorOffset:e}:{cursorOffset:e}})()}},tY=async()=>{let e=eW.trim();if(!eE||!e||eH)return;let t=th.current+1;th.current=t,eO(!0),eU("planning"),eJ(null);try{let r=await (0,V.Gi)({mode:"plan",...tJ(e,eM)});if(th.current!==t||e_!=e_)return;if(!r.plan)throw Error("AI 未返回修改计划");eQ(r.plan)}catch(e){th.current===t&&ed.error(e instanceof Error?e.message:ec("common.error"))}finally{th.current===t&&(eO(!1),eU("idle"))}},tZ=async e=>{let t=eW.trim();if(!eE||!t||eH)return;let r=th.current+1;th.current=r,eO(!0),eU("applying");try{let s=await (0,V.Gi)({mode:"apply",...tJ(t,eM),plan:e});if(th.current!==r||e_!=e_)return;if(!s.markdown)throw Error("AI 未返回修改结果");eJ({plan:s.plan||e,markdown:s.markdown,beforeSnippet:s.beforeSnippet,afterSnippet:s.afterSnippet,summary:s.summary,changedChars:s.changedChars,prompt:t,before:eM})}catch(e){th.current===r&&ed.error(e instanceof Error?e.message:ec("common.error"))}finally{th.current===r&&(eO(!1),eU("idle"))}};if(eC)return(0,s.jsxs)("div",{className:"space-y-5 animateFadeIn",children:[(0,s.jsx)(p.A,{active:!0,title:!0,paragraph:{rows:1}}),(0,s.jsx)(p.A,{active:!0,paragraph:{rows:2}}),(0,s.jsx)(p.A,{active:!0,paragraph:{rows:8}})]});let t$="workflow"===ti?"工作流:".concat((null==tj?void 0:tj.name)||"选择模板"):"编辑:".concat((null==eE?void 0:eE.title)||(null==tj?void 0:tj.outputTitle)||"文档");return(0,s.jsxs)("div",{className:"space-y-5 animateFadeIn",children:[(0,s.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-end justify-between gap-4 pb-6 mb-2",children:[(0,s.jsxs)("div",{children:[(0,s.jsxs)("h1",{className:"text-3xl font-extrabold tracking-tight text-[var(--colorText)] mb-2.5 flex items-center gap-2",children:[(0,s.jsx)(S.A,{className:"text-[var(--colorAccent)]"}),ec("documents.title")]}),(0,s.jsx)("p",{className:"text-sm text-[var(--colorTextSecondary)]",children:ec("documents.description")})]}),(0,s.jsx)(m.Ay,{type:"primary",icon:(0,s.jsx)(G.A,{}),onClick:()=>tD(),className:"shadow-none rounded-lg",children:ec("documents.newTemplate")})]}),(0,s.jsxs)("div",{className:"bg-[var(--colorBgContainer)] rounded-2xl shadow-sm overflow-hidden",children:[(0,s.jsx)(x.A,{items:[{key:"templates",label:(0,s.jsxs)("span",{className:"px-4",children:["模板库 ",(0,s.jsx)(u.A,{className:"ml-2 border-0 bg-[var(--colorFillAlter)]",children:em.length})]})},{key:"drafts",label:(0,s.jsxs)("span",{className:"px-4",children:["生成记录 ",(0,s.jsx)(u.A,{className:"ml-2 border-0 bg-[var(--colorFillAlter)]",children:eD.length})]})}],activeKey:ta,onChange:tl,className:"documents-tabs",size:"large",tabBarStyle:{margin:0,padding:"0 16px",background:"var(--colorBgHover)",borderBottom:"1px solid var(--borderColor)"}}),(0,s.jsx)("div",{className:"p-4 bg-[var(--colorFillAlter)] min-h-[500px]",children:"templates"===ta?0===em.length?(0,s.jsx)("div",{className:"py-32 text-center border border-dashed border-[var(--borderColor)] rounded-2xl bg-[var(--colorBgContainer)]",children:(0,s.jsx)(h.A,{description:(0,s.jsx)("span",{className:"text-[var(--colorTextSecondary)]",children:ec("common.noData")})})}):(0,s.jsx)("div",{className:"grid grid-cols-1 gap-4",children:em.map(e=>(0,s.jsxs)("div",{className:"group flex items-center p-4 rounded-2xl transition-all cursor-pointer ".concat(eh===e.id?"bg-[var(--colorBgSelected)] shadow-md":"bg-[var(--colorBgContainer)] hover:bg-[var(--colorBgHover)] shadow-sm hover:shadow-md"),onClick:()=>eg(e.id),children:[(0,s.jsxs)("div",{className:"flex-1 min-w-0 pr-4",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 mb-2 min-w-0",children:[function(e,t){let r=es[e]||(0,s.jsx)(D.A,{});return(0,s.jsx)("span",{style:{color:t?"var(--colorAccent)":"var(--colorTextSecondary)",fontSize:16,marginTop:2,flexShrink:0},children:r})}(e.category,eh===e.id),(0,s.jsx)("span",{className:"font-bold text-base text-[var(--colorText)] truncate",children:e.name}),eh===e.id&&(0,s.jsx)(u.A,{color:"blue",className:"border-0 m-0 shrink-0",children:"当前选中"}),(0,s.jsx)(u.A,{className:"border-0 bg-[var(--colorFillSecondary)] m-0 shrink-0",children:e.category})]}),e.description&&(0,s.jsx)("div",{className:"text-sm text-[var(--colorTextSecondary)] line-clamp-2 leading-relaxed mb-3",children:e.description}),e8[e.id]&&(0,s.jsxs)("div",{onClick:e=>e.stopPropagation(),className:"flex flex-col items-start gap-2",children:[(0,s.jsxs)("div",{className:"inline-flex items-center gap-2 p-1.5 px-3 rounded-lg border text-xs ".concat(e8[e.id].issues.some(e=>"error"===e.level)?"border-red-200 bg-red-50/50":e8[e.id].issues.length?"border-yellow-200 bg-yellow-50/50":"border-green-200 bg-green-50/50"),children:[(0,s.jsx)("span",{className:"font-medium",children:e8[e.id].issues.some(e=>"error"===e.level)?"检查未通过":e8[e.id].issues.length?"存在警告":"检查通过"}),(0,s.jsx)("span",{className:"text-[var(--colorTextTertiary)]",children:"|"}),(0,s.jsxs)("span",{children:["项目资料 ",e8[e.id].fileDiagnostics.length]}),(0,s.jsxs)("span",{children:["提示词 ",e8[e.id].promptDiagnostics.length]}),!e8[e.id].issues.some(e=>"error"===e.level)&&e8[e.id].issues.length>0&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"text-[var(--colorTextTertiary)]",children:"|"}),(0,s.jsx)("span",{className:"text-blue-500 cursor-pointer hover:underline",onClick:()=>{tL(e.id)},children:"忽略警告并运行"})]})]}),e8[e.id].promptDiagnostics.length>0&&(0,s.jsxs)("div",{className:"flex max-w-full flex-col gap-1 rounded-lg border border-[var(--borderColor)] bg-[var(--colorFillQuaternary)] px-3 py-2 text-xs text-[var(--colorTextSecondary)]",children:[(0,s.jsx)("span",{className:"font-medium text-[var(--colorText)]",children:"实际提示词绑定"}),e8[e.id].promptDiagnostics.slice(0,3).map(e=>(0,s.jsxs)("div",{className:"max-w-full truncate",title:"".concat(e.roleName||e.roleId," -> ").concat(e.promptId,"\n").concat(e.contentPreview||""),children:[e.roleName||e.roleId," → ",e.promptId," \xb7 ",e.promptTitle||"未命名提示词"," \xb7 ",e.contentLength," 字符",e.contentHash?" \xb7 ".concat(e.contentHash):""]},"".concat(e.roleId,"-").concat(e.promptId))),e8[e.id].promptDiagnostics.length>3&&(0,s.jsxs)("span",{children:["另有 ",e8[e.id].promptDiagnostics.length-3," 个提示词绑定"]})]})]})]}),(0,s.jsxs)("div",{className:"flex shrink-0 flex-nowrap items-center gap-2 whitespace-nowrap transition-opacity ".concat(eh===e.id?"opacity-100":"opacity-0 group-hover:opacity-100"),onClick:e=>e.stopPropagation(),children:[(0,s.jsx)(m.Ay,{size:"small",onClick:t=>{t.stopPropagation(),tD(e)},className:"rounded-md",children:"配置"}),(0,s.jsx)(m.Ay,{size:"small",icon:(0,s.jsx)(W.A,{}),onClick:t=>{t.stopPropagation(),t_(e.id)},className:"rounded-md"}),(0,s.jsx)(Y,{title:ec("documents.deleteTemplateConfirm"),onConfirm:t=>{null==t||t.stopPropagation(),tP(e.id)},children:(0,s.jsx)(m.Ay,{size:"small",danger:!0,icon:(0,s.jsx)(P.A,{}),onClick:e=>e.stopPropagation(),className:"rounded-md"})}),(0,s.jsx)(m.Ay,{size:"small",type:"primary",icon:td===e.id?(0,s.jsx)(_.A,{}):(0,s.jsx)(q.A,{}),loading:td===e.id,disabled:!!td&&td!==e.id,onClick:t=>{t.stopPropagation(),tL(e.id)},className:"min-w-[72px] rounded-md justify-center",children:td===e.id?"准备中":"运行"})]})]},e.id))}):0===eD.length?(0,s.jsx)("div",{className:"py-32 text-center border border-dashed border-[var(--borderColor)] rounded-2xl bg-[var(--colorBgContainer)]",children:(0,s.jsx)(h.A,{description:(0,s.jsx)("span",{className:"text-[var(--colorTextSecondary)]",children:ec("common.noData")})})}):(0,s.jsx)("div",{className:"grid grid-cols-1 gap-4",children:eD.slice(0,15).map((e,t)=>{var r,a,l,n,o,i,c,d,p,x;let h,g;return(0,s.jsxs)("div",{className:"group flex items-center gap-4 p-4 rounded-2xl transition-all cursor-pointer ".concat(e_===e.id?"bg-[var(--colorBgSelected)] shadow-md":"bg-[var(--colorBgContainer)] hover:bg-[var(--colorBgHover)] shadow-sm hover:shadow-md"),onClick:()=>{tS(e)},children:[(0,s.jsx)("div",{className:"mt-1",children:"completed"===e.status?(0,s.jsx)(z.A,{className:"text-xl text-[var(--colorOk)]"}):"failed"===e.status||"aborted"===e.status?(0,s.jsx)(L.A,{className:"text-xl text-[var(--colorDanger)]"}):"warning"===e.status?(0,s.jsx)(E.A,{className:"text-xl text-[var(--colorWarning)]"}):(0,s.jsx)(H.A,{spin:!0,className:"text-xl text-blue-500"})}),(0,s.jsxs)("div",{className:"flex-1 min-w-0 pr-4",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 mb-2",children:[(0,s.jsx)("span",{className:"font-bold text-base text-[var(--colorText)] truncate",children:e.title}),(0,s.jsxs)(u.A,{className:"border-0 bg-[var(--colorFillSecondary)] m-0 shrink-0",children:["#",t+1]}),(0,s.jsx)(u.A,{color:"completed"===(h=e.status)?"success":"warning"===h?"warning":"failed"===h?"error":"aborted"===h?"default":"processing",className:"border-0 m-0 shrink-0",children:"completed"===(g=e.status)?"已完成":"warning"===g?"需复核":"failed"===g?"失败":"aborted"===g?"已中止":"生成中"})]}),(0,s.jsxs)("div",{className:"flex flex-wrap gap-x-4 gap-y-2 text-xs text-[var(--colorTextSecondary)] mb-3",children:[(0,s.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,s.jsx)(O.A,{})," ",new Date(e.updatedAt).toLocaleString()]}),(0,s.jsx)("span",{className:"text-[var(--colorTextTertiary)]",children:"|"}),(0,s.jsxs)("span",{children:["耗时 ",(e=>{let t=Math.max(0,Math.round(((e.completedAt||e.updatedAt)-e.createdAt)/1e3));if(t<60)return"".concat(t," 秒");let r=Math.floor(t/60),s=t%60;if(r<60)return s?"".concat(r," 分 ").concat(s," 秒"):"".concat(r," 分");let a=Math.floor(r/60),l=r%60;return l?"".concat(a," 小时 ").concat(l," 分"):"".concat(a," 小时")})(e)]}),e.partialChapters&&e.partialChapters.length>0&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"text-[var(--colorTextTertiary)]",children:"|"}),(0,s.jsxs)("span",{children:["进度 ",e.partialChapters.filter(e=>"completed"===e.status).length,"/",e.partialChapters.length," 章"]}),(0,s.jsx)("span",{className:"text-[var(--colorTextTertiary)]",children:"|"}),(0,s.jsxs)("span",{children:["共 ",e.partialChapters.reduce((e,t)=>e+t.chars,0).toLocaleString()," 字"]})]})]}),("warning"===e.status||"failed"===e.status||"aborted"===e.status)&&(0,s.jsxs)("div",{className:"inline-flex items-center gap-2 p-1.5 px-3 rounded-lg border text-xs ".concat("failed"===e.status||"aborted"===e.status?"border-red-200 bg-red-50/50":"border-yellow-200 bg-yellow-50/50"),children:[(0,s.jsx)("span",{className:"font-medium",children:"failed"===e.status?(null==(a=e.draft)||null==(r=a.exportGate)?void 0:r.passed)===!1?"门禁未通过":"生成失败":"aborted"===e.status?"已中止":"需复核"}),(0,s.jsx)("span",{className:"text-[var(--colorTextTertiary)]",children:"|"}),(0,s.jsx)("span",{className:"truncate max-w-[400px]",children:e.error||(null==(l=e.warningIssues)?void 0:l[0])||(null==(o=e.draft)||null==(n=o.validationIssues.find(e=>"error"===e.level||"warning"===e.level))?void 0:n.message)||(null==(d=e.draft)||null==(c=d.exportGate)||null==(i=c.checklist.find(e=>!e.passed))?void 0:i.label)||"需复核"})]})]}),(0,s.jsxs)("div",{className:"flex shrink-0 flex-nowrap items-center gap-2 whitespace-nowrap transition-opacity ".concat(e_===e.id?"opacity-100":"opacity-0 group-hover:opacity-100"),onClick:e=>e.stopPropagation(),children:[(0,s.jsx)(m.Ay,{size:"small",type:"primary",icon:tI(e.status)?(0,s.jsx)(H.A,{spin:!0}):(0,s.jsx)(q.A,{}),onClick:t=>{t.stopPropagation(),tS(e)},className:"min-w-[72px] rounded-md justify-center",children:"打开"}),tI(e.status)&&(0,s.jsx)(Y,{title:"确定中止此生成任务?",onConfirm:t=>{null==t||t.stopPropagation(),tK(e)},children:(0,s.jsx)(m.Ay,{size:"small",danger:!0,onClick:e=>e.stopPropagation(),className:"rounded-md",children:"中止"})}),("failed"===e.status||"aborted"===e.status||"warning"===e.status&&!!(null==(p=e.checkpointChapters)?void 0:p.length)&&/继续生成|重新生成|中断|卡住|未完成/u.test(e.error||(null==(x=e.warningIssues)?void 0:x.join(";"))||""))&&(0,s.jsx)(m.Ay,{size:"small",onClick:t=>{t.stopPropagation(),tO(e)},className:"rounded-md",children:"继续"}),(0,s.jsx)(Y,{title:"确认删除?",onConfirm:t=>{null==t||t.stopPropagation(),tG(e)},children:(0,s.jsx)(m.Ay,{size:"small",danger:!0,icon:(0,s.jsx)(P.A,{}),onClick:e=>e.stopPropagation(),className:"rounded-md"})})]})]},e.id)})})})]}),(0,s.jsx)(g.A,{title:t$,open:tn,onClose:()=>{for(let e of(to(!1),tp.current.values()))clearInterval(e);tp.current.clear()},size:"large",mask:{closable:!1},style:{borderRadius:"12px 0 0 12px"},styles:{body:{padding:"16px 24px"},header:{borderRadius:"12px 0 0 0",borderBottom:"1px solid var(--colorBorderSecondary)"}},extra:eE?(0,s.jsxs)(i.A,{wrap:!0,children:[tC(tr)&&(0,s.jsx)(m.Ay,{icon:(0,s.jsx)(q.A,{}),disabled:eH||eT,onClick:()=>{tr&&tO(tr)},children:"继续生成"}),(0,s.jsx)(m.Ay,{icon:(0,s.jsx)(K.A,{}),disabled:eH,onClick:()=>{tV()},children:ec("documents.saveDraft")}),(0,s.jsx)(m.Ay,{icon:(0,s.jsx)(U.A,{}),disabled:eH,loading:"markdown"===eL,onClick:()=>{tU("markdown")},children:"MD"}),(0,s.jsx)(m.Ay,{disabled:eH,loading:"html"===eL,onClick:()=>{tU("html")},children:"HTML"}),(0,s.jsx)(m.Ay,{disabled:eH,loading:"docx"===eL,onClick:()=>{tU("docx")},children:"DOCX"}),(0,s.jsx)(m.Ay,{type:"primary",disabled:eH,loading:"pdf"===eL,onClick:()=>{tU("pdf")},children:"PDF"})]}):tC(tr)?(0,s.jsx)(m.Ay,{type:"primary",icon:(0,s.jsx)(q.A,{}),loading:eT,onClick:()=>{tr&&tO(tr)},children:"继续生成"}):eT&&"workflow"===ti?(0,s.jsx)(m.Ay,{danger:!0,onClick:()=>{(async()=>{if(e_&&await (0,V.r)(e_,e4||void 0).catch(()=>void 0),ee){var e;ee.aborted=!0,null==(e=ee.pollController)||e.abort(),ee.loading=!1,ee.error="用户中止",et(),ee=null}for(let e of(localStorage.removeItem(tg),tp.current.values()))clearInterval(e);tp.current.clear(),eR(!1),e9([]),tt(null),to(!1),await tv(),ed.info("已中止生成任务")})()},children:"中止任务"}):void 0,children:(0,s.jsxs)($,{style:{width:"100%"},gap:16,children:["workflow"===ti&&e7.length>0&&(0,s.jsx)($,{gap:10,children:e7.map((e,t)=>{let r;return(0,s.jsxs)("div",{style:{display:"flex",gap:10,padding:10,border:"1px solid var(--colorBorderSecondary)",borderRadius:10,background:t===ty?"var(--colorFillAlter)":"var(--colorBgContainer)"},children:[(0,s.jsx)("span",{children:"process"===e.status?(0,s.jsx)(_.A,{}):"warning"===e.status?(0,s.jsx)(E.A,{style:{color:"var(--colorWarning)"}}):e.icon}),(0,s.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,s.jsxs)(i.A,{wrap:!0,children:[(0,s.jsx)(J,{strong:!0,children:e.title}),(0,s.jsx)(u.A,{color:"finish"===e.status?"success":"error"===e.status?"error":"warning"===e.status?"warning":"process"===e.status?"processing":"default",children:"warning"===(r=e.status)?"finish":r})]}),(0,s.jsx)("div",{style:{marginTop:4,color:"var(--colorTextSecondary)",fontSize:12,whiteSpace:"pre-wrap"},children:(0,s.jsxs)("div",{children:[e.subtitle&&(0,s.jsx)("div",{style:{marginBottom:4},children:(0,s.jsx)(u.A,{children:e.subtitle})}),(0,s.jsx)("div",{children:e.description}),(0,s.jsx)("div",{style:{marginTop:4},children:e.subSteps.map(e=>{var t;return(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:4,fontSize:12,color:"process"===e.status?"var(--colorPrimary)":"var(--colorTextSecondary)"},children:["process"===(t=e.status)?(0,s.jsx)(_.A,{}):"finish"===t?(0,s.jsx)(z.A,{}):"warning"===t?(0,s.jsx)(E.A,{style:{color:"var(--colorWarning)"}}):"error"===t?(0,s.jsx)(P.A,{}):(0,s.jsx)("span",{style:{display:"inline-block",height:6,width:6,borderRadius:"50%",background:"var(--colorTextTertiary)"}}),(0,s.jsx)("span",{children:e.title})]},e.key)})})]})})]})]},e.key)})}),"workflow"===ti&&(null==tr?void 0:tr.partialChapters)&&tr.partialChapters.length>0&&(0,s.jsx)(v.A,{size:"small",title:"章节进度",extra:(0,s.jsxs)(u.A,{color:"blue",children:[tr.partialChapters.filter(e=>"completed"===e.status).length,"/",tr.partialChapters.length]}),children:(0,s.jsx)($,{gap:6,style:{width:"100%"},children:tr.partialChapters.map(e=>(0,s.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",gap:8,fontSize:12},children:[(0,s.jsx)(J,{ellipsis:!0,style:{maxWidth:480},children:e.title}),(0,s.jsxs)(i.A,{size:6,children:[(0,s.jsx)(u.A,{color:"failed"===e.status?"error":"success",children:"failed"===e.status?"失败":"完成"}),(0,s.jsxs)(J,{type:"secondary",children:[e.chars.toLocaleString()," 字"]})]})]},e.id))})}),"workflow"===ti&&(null==tr||null==(t=tr.draft)||null==(e=t.exportGate)?void 0:e.passed)===!1&&(0,s.jsx)(Z,{type:"error",title:"生成已完成,但导出门禁未通过",children:(0,s.jsxs)(i.A,{direction:"vertical",size:8,style:{width:"100%"},children:[(0,s.jsx)("span",{children:"阻断项:".concat((null==(r=tr.draft.exportGate.blockingIssues)?void 0:r.slice(0,6).map(e=>e.message).join(";"))||tr.draft.exportGate.checklist.filter(e=>!e.passed).map(e=>e.label).join(";")||"存在阻断级校验错误","。可点击继续生成触发自动修复,或在“校验”页查看完整问题。")}),tC(tr)&&(0,s.jsx)(m.Ay,{type:"primary",size:"small",icon:(0,s.jsx)(q.A,{}),loading:eT,onClick:()=>{tO(tr)},children:"继续生成 / 自动修复"})]})}),"workflow"===ti&&(null==tr||null==(l=tr.reviewMetadata)?void 0:l.diagnostics)&&(0,s.jsx)(Z,{type:"info",title:"后台自动优化",children:"策略:".concat(tr.reviewMetadata.diagnostics.strategy.mode,";LLM 调用 ").concat(tr.reviewMetadata.diagnostics.llm.calls," 次;噪声过滤 ").concat((null==(o=tr.reviewMetadata.diagnostics.evidence)?void 0:o.filteredNoise)||0," 条;质量门禁 阻断").concat((null==(R=tr.reviewMetadata.diagnostics.quality)?void 0:R.blockingCount)||0,"/重要").concat((null==(F=tr.reviewMetadata.diagnostics.quality)?void 0:F.importantCount)||0,"/轻微").concat((null==(ei=tr.reviewMetadata.diagnostics.quality)?void 0:ei.minorCount)||0,";自动限流调整 ").concat(tr.reviewMetadata.diagnostics.llm.limitAdjustments," 次。审查与诊断信息仅用于系统修复,不会写入正文或导出文件。")}),"workflow"===ti&&eT&&0===e7.length&&(0,s.jsxs)("div",{style:{textAlign:"center",padding:40},children:[(0,s.jsx)(j.A,{}),(0,s.jsx)("div",{style:{marginTop:12,color:"var(--colorTextSecondary)"},children:"正在准备生成…"})]}),eE&&(0,s.jsx)("div",{ref:ep,children:(0,s.jsx)(x.A,{items:[{key:"edit",label:ec("documents.edit"),children:(0,s.jsxs)($,{gap:16,style:{width:"100%"},children:[(0,s.jsx)(X,{rows:28,value:eM,disabled:eH,onSelect:e=>{var t,r,s;return eZ({start:null!=(t=e.currentTarget.selectionStart)?t:0,end:null!=(s=null!=(r=e.currentTarget.selectionEnd)?r:e.currentTarget.selectionStart)?s:0})},onChange:e=>{var t,r,s;eB(e.target.value),eQ(null),eJ(null),eZ({start:null!=(t=e.target.selectionStart)?t:0,end:null!=(s=null!=(r=e.target.selectionEnd)?r:e.target.selectionStart)?s:0})}}),(0,s.jsx)(v.A,{size:"small",style:{borderRadius:12,background:"linear-gradient(135deg, var(--colorFillAlter), var(--colorBgContainer))"},children:(0,s.jsxs)($,{gap:16,style:{width:"100%"},children:[(0,s.jsxs)(i.A,{align:"start",style:{width:"100%",justifyContent:"space-between"},children:[(0,s.jsxs)("div",{children:[(0,s.jsxs)(i.A,{size:6,children:[(0,s.jsx)(M.A,{style:{color:"var(--colorAccent)"}}),(0,s.jsx)(J,{strong:!0,children:"精准修改"}),(0,s.jsx)(u.A,{color:"blue",children:"AI 辅助"})]}),(0,s.jsx)("div",{style:{marginTop:4,color:"var(--colorTextSecondary)",fontSize:12},children:"针对当前编辑内容补充更具体的要求,AI 会保留文档结构并按你的提示细化修改。"})]}),(0,s.jsxs)(m.Ay,{size:"small",icon:(0,s.jsx)(O.A,{}),onClick:()=>e2(e=>!e),disabled:0===e$.length,children:["历史版本 ",e$.length>0?e$.length:""]})]}),(0,s.jsx)(Z,{type:"info",title:"系统只负责识别修改范围,不改写你的提示词;选中文字后优先只改选区,没有选区时按光标所在小节/章节定位。"}),(0,s.jsx)(X,{rows:4,value:eW,disabled:eH,onChange:e=>{eq(e.target.value),eQ(null),eJ(null)},placeholder:"例如:写细一点;润色这段;第七章补充高处作业和临电安全措施;把安全检查频次改成每周一次。"}),(0,s.jsxs)(i.A,{wrap:!0,style:{width:"100%",justifyContent:"space-between"},children:[(0,s.jsx)(i.A,{wrap:!0,children:["写细一点","更专业","只润色选区","补充可执行措施"].map(e=>(0,s.jsx)(m.Ay,{size:"small",disabled:eH,onClick:()=>eq(t=>t?"".concat(t,";").concat(e):e),children:e},e))}),(0,s.jsx)(m.Ay,{type:"primary",icon:(0,s.jsx)(M.A,{}),loading:eH&&"planning"===eK,disabled:!eW.trim()||eH,onClick:()=>{tY()},children:"识别修改范围"})]}),eV&&!eX&&(0,s.jsx)(v.A,{size:"small",style:{borderRadius:10,borderColor:"var(--colorAccent)"},children:(0,s.jsxs)($,{gap:8,style:{width:"100%"},children:[(0,s.jsxs)(i.A,{wrap:!0,children:[(0,s.jsx)(u.A,{color:"purple",children:eV.scope}),(0,s.jsx)(u.A,{color:"blue",children:eV.action}),(0,s.jsxs)(u.A,{color:eV.confidence>=.8?"green":"orange",children:["置信度 ",Math.round(100*eV.confidence),"%"]}),eV.targetTitle&&(0,s.jsx)(J,{strong:!0,children:eV.targetTitle})]}),(0,s.jsx)(J,{children:eV.summary}),(0,s.jsx)(J,{type:"secondary",style:{fontSize:12},children:"将按你的原始提示词执行,不添加额外编辑任务。"}),(0,s.jsxs)(i.A,{children:[(0,s.jsx)(m.Ay,{type:"primary",loading:eH&&"applying"===eK,onClick:()=>{tZ(eV)},children:"执行并预览"}),(0,s.jsx)(m.Ay,{disabled:eH,onClick:()=>eQ(null),children:"取消"})]})]})}),eX&&(0,s.jsx)(v.A,{size:"small",style:{borderRadius:10,borderColor:"var(--colorSuccess)"},children:(0,s.jsxs)($,{gap:8,style:{width:"100%"},children:[(0,s.jsxs)(i.A,{wrap:!0,children:[(0,s.jsx)(u.A,{color:"green",children:"修改预览"}),(0,s.jsx)(J,{children:eX.summary||eX.plan.summary}),(0,s.jsxs)(u.A,{children:[eX.changedChars&&eX.changedChars>0?"+".concat(eX.changedChars):eX.changedChars," 字符"]})]}),(0,s.jsxs)(f.A,{gutter:12,children:[(0,s.jsxs)(y.A,{span:12,children:[(0,s.jsx)(J,{strong:!0,children:"修改前"}),(0,s.jsx)("div",{style:{marginTop:6,maxHeight:180,overflow:"auto",padding:10,borderRadius:8,background:"var(--colorFillAlter)",whiteSpace:"pre-wrap",fontSize:12},children:eX.beforeSnippet||"无片段预览"})]}),(0,s.jsxs)(y.A,{span:12,children:[(0,s.jsx)(J,{strong:!0,children:"修改后"}),(0,s.jsx)("div",{style:{marginTop:6,maxHeight:180,overflow:"auto",padding:10,borderRadius:8,background:"var(--colorFillAlter)",whiteSpace:"pre-wrap",fontSize:12},children:eX.afterSnippet||"无片段预览"})]})]}),(0,s.jsxs)(i.A,{children:[(0,s.jsx)(m.Ay,{type:"primary",onClick:()=>{eX&&(tQ(eX.before,eX.prompt),eB(eX.markdown),tX(!0),ed.success("已应用精准修改"))},children:"应用到文档"}),(0,s.jsx)(m.Ay,{onClick:()=>eJ(null),children:"返回计划"}),(0,s.jsx)(m.Ay,{danger:!0,onClick:()=>{eQ(null),eJ(null)},children:"放弃"})]})]})}),e1&&(0,s.jsx)("div",{style:{borderTop:"1px solid var(--colorBorderSecondary)",paddingTop:12},children:(0,s.jsx)(w.A,{size:"small",dataSource:e$,locale:{emptyText:"暂无历史版本"},renderItem:e=>(0,s.jsx)(w.A.Item,{actions:[(0,s.jsx)(m.Ay,{size:"small",disabled:eH,onClick:()=>{tQ(eM,"恢复前版本"),eB(e.content),tX(!0),ed.success("已恢复历史版本")},children:"恢复"},"restore")],children:(0,s.jsx)(w.A.Item.Meta,{title:(0,s.jsxs)(i.A,{children:[(0,s.jsx)(J,{children:new Date(e.createdAt).toLocaleString()}),(0,s.jsx)(u.A,{children:e.prompt})]}),description:(0,s.jsx)(J,{type:"secondary",ellipsis:!0,children:e.content.replace(/\s+/gu," ").slice(0,120)})})})})})]})})]})},{key:"chapters-facts",label:"章节与事实",children:(0,s.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:16},children:[eE.chapters.length>0&&(0,s.jsxs)("div",{children:[(0,s.jsxs)(J,{strong:!0,style:{fontSize:13,marginBottom:8,display:"block"},children:["章节 (",eE.chapters.length,")"]}),(0,s.jsx)(w.A,{size:"small",dataSource:eE.chapters,renderItem:e=>(0,s.jsx)(w.A.Item,{children:(0,s.jsx)(w.A.Item.Meta,{title:e.title,description:"证据: ".concat(e.evidence.length," \xb7 缺失: ").concat(e.missingFacts.length)})})})]}),eE.structuredFacts.length>0&&(0,s.jsxs)("div",{children:[(0,s.jsxs)(J,{strong:!0,style:{fontSize:13,marginBottom:8,display:"block"},children:["结构化事实 (",eE.structuredFacts.length,")"]}),(0,s.jsx)(A.A,{size:"small",column:1,bordered:!0,children:eE.structuredFacts.map((e,t)=>(0,s.jsxs)(A.A.Item,{label:e.key,children:[(0,s.jsx)("span",{children:e.value}),(0,s.jsx)(u.A,{style:{marginLeft:8},children:e.confidence.toFixed(2)}),(0,s.jsx)(J,{type:"secondary",style:{fontSize:11,marginLeft:8},children:e.sourceFile})]},t))})]})]})},{key:"sources-missing",label:"来源与缺失",children:(0,s.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:16},children:[(0,s.jsxs)("div",{children:[(0,s.jsxs)(J,{strong:!0,style:{fontSize:13,marginBottom:8,display:"block"},children:["引用来源 (",eE.sources.length,")"]}),0===eE.sources.length?(0,s.jsx)(h.A,{description:"暂无"}):(0,s.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:4},children:eE.sources.map(e=>(0,s.jsxs)(u.A,{color:"blue",children:[e.filePath," (",e.count,")"]},e.filePath))})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)(J,{strong:!0,style:{fontSize:13,marginBottom:8,display:"block"},children:["缺失项 (",eE.missingItems.length,")"]}),0===eE.missingItems.length?(0,s.jsx)(h.A,{description:"无缺失"}):(0,s.jsx)(w.A,{size:"small",dataSource:eE.missingItems,renderItem:e=>(0,s.jsx)(w.A.Item,{children:e})})]})]})},{key:"validation",label:"校验 (".concat(eE.validationIssues.length,")"),children:0===eE.validationIssues.length?(0,s.jsx)(h.A,{description:"校验通过"}):(0,s.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[eE.validationIssues.map(e=>(0,s.jsxs)("div",{style:{border:"1px solid var(--colorBorderSecondary)",borderRadius:8,padding:12},children:[(0,s.jsx)(u.A,{color:"error"===e.level?"error":"warning"===e.level?"warning":"blue",children:e.level}),(0,s.jsx)("div",{style:{marginTop:6,whiteSpace:"pre-wrap",overflowWrap:"anywhere",wordBreak:"break-all",lineHeight:1.6},children:e.message}),e.suggestion&&(0,s.jsx)("div",{style:{marginTop:6,color:"var(--colorTextSecondary)",whiteSpace:"pre-wrap",overflowWrap:"anywhere",wordBreak:"break-all"},children:e.suggestion})]},"".concat(e.level,"-").concat(e.message))),eE.exportGate.checklist.length>0&&(0,s.jsxs)("div",{style:{marginTop:8},children:[(0,s.jsx)(J,{strong:!0,style:{fontSize:13,marginBottom:8,display:"block"},children:"导出门禁"}),(0,s.jsx)(w.A,{size:"small",dataSource:eE.exportGate.checklist,renderItem:e=>(0,s.jsxs)(w.A.Item,{children:[(0,s.jsx)(J,{style:{overflowWrap:"anywhere",wordBreak:"break-word"},children:e.label}),(0,s.jsx)(u.A,{color:e.passed?"success":"error",children:e.passed?"PASS":"FAIL"})]})})]})]})},{key:"stages",label:"执行阶段 (".concat(eE.executionStages.length,")"),children:(0,s.jsx)(w.A,{size:"small",dataSource:eE.executionStages,renderItem:e=>(0,s.jsxs)(w.A.Item,{children:[(0,s.jsx)(w.A.Item.Meta,{avatar:er[e.type]||(0,s.jsx)(D.A,{}),title:(0,s.jsx)(J,{title:e.roleId,style:{overflowWrap:"anywhere",wordBreak:"break-word"},children:"".concat(en[e.type]||e.type," \xb7 ").concat(e.roleName||tw(e.roleId))}),description:(0,s.jsx)(J,{type:"secondary",style:{whiteSpace:"pre-wrap",overflowWrap:"anywhere",wordBreak:"break-word"},children:e.message})}),(0,s.jsx)(u.A,{color:"success"===e.status?"success":"failed"===e.status?"error":"skipped"===e.status?"default":"warning",children:e.status})]})})}]})})]})}),(0,s.jsx)(g.A,{title:ec("documents.templateEditor"),open:e6,onClose:()=>e5(!1),size:"large",mask:{closable:!1},styles:{body:{padding:20,overflow:"auto"},header:{borderBottom:"1px solid var(--colorBorderSecondary)"}},extra:(0,s.jsxs)(i.A,{children:[(0,s.jsx)(m.Ay,{onClick:()=>e5(!1),children:ec("common.cancel")}),(0,s.jsx)(m.Ay,{type:"primary",onClick:()=>{tF()},children:ec("common.save")})]}),children:(0,s.jsxs)(d.A,{form:eu,layout:"vertical",requiredMark:"optional",children:[(0,s.jsxs)(f.A,{gutter:12,children:[(0,s.jsx)(d.A.Item,{name:"id",hidden:!0,children:(0,s.jsx)(n.A,{})}),(0,s.jsx)(y.A,{xs:24,md:8,children:(0,s.jsx)(d.A.Item,{name:"name",label:ec("documents.templateName"),rules:[{required:!0}],children:(0,s.jsx)(n.A,{})})}),(0,s.jsx)(y.A,{xs:24,md:8,children:(0,s.jsx)(d.A.Item,{name:"category",label:ec("documents.templateCategory"),children:(0,s.jsx)(n.A,{})})}),(0,s.jsx)(y.A,{xs:24,md:8,children:(0,s.jsx)(d.A.Item,{name:"outputTitle",label:ec("documents.outputTitle"),children:(0,s.jsx)(n.A,{})})}),(0,s.jsx)(y.A,{xs:24,md:12,children:(0,s.jsx)(d.A.Item,{name:"description",label:ec("documents.templateDescription"),children:(0,s.jsx)(n.A,{})})})]}),(0,s.jsx)(d.A.Item,{name:"projectRoleConfigId",label:ec("documents.projectRoleConfig"),rules:[{required:!0,message:ec("documents.projectRoleConfigRequired")}],children:(0,s.jsx)(b.A,{showSearch:!0,placeholder:ec("documents.projectRoleConfigRequired"),options:tf})}),(0,s.jsxs)("div",{className:"mb-6",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(J,{strong:!0,className:"text-base text-[var(--colorText)] block mb-1",children:"项目资料包绑定"}),(0,s.jsx)("div",{className:"text-xs text-[var(--colorTextSecondary)]",children:"直接选择整个项目文件夹,系统会自动识别招标正文、清单、图纸、补疑等资料类型。"})]}),(0,s.jsx)(u.A,{color:"blue",className:"border-0",children:"按项目资料包"})]}),eS?(0,s.jsxs)("div",{className:"text-center py-8",children:[(0,s.jsx)(j.A,{}),(0,s.jsx)("div",{className:"mt-3 text-[var(--colorTextSecondary)] text-xs",children:"正在加载知识库文件…"})]}):0===eb.length?(0,s.jsx)(h.A,{image:h.A.PRESENTED_IMAGE_SIMPLE,description:"暂无知识库文件"}):(0,s.jsx)(d.A.Item,{name:"projectMaterialRoots",rules:[{required:!0,message:"请选择项目资料包"}],children:(0,s.jsx)(k.A,{treeData:eb,loadData:tB,fieldNames:{label:"rawTitle",value:"value",children:"children"},onChange:e=>{var t;return t=e.map(e=>String(e)),void eu.setFieldValue("projectMaterialRoots",ea(t))},treeCheckable:!0,showCheckedStrategy:k.A.SHOW_PARENT,placeholder:"点击这里选择项目文件夹...",style:{width:"100%"},listHeight:360,showSearch:!0,maxTagCount:"responsive",size:"large"})})]})]})})]})}}},e=>{e.O(0,[717,883,665,44,563,7,787,195,455,506,230,636,593,792],()=>e(e.s=16403)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[28],{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",drawingPreview:"style_drawingPreview__lkk_L"}},23793:(e,t)=>{"use strict";t.A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"}}]},name:"delete",theme:"outlined"}},25258:(e,t,r)=>{"use strict";r.d(t,{A:()=>b});var l=r(51541),a=r(61848),n=r(5669),s=r(97109),i=r(72658),c=r(3638),o=r(92162),d=r(82725),u=r(74567),f=r(632),h=r(49517),m=r(79412),p=r(19527);let v=(0,d.U)(e=>{let{prefixCls:t,className:r,closeIcon:l,closable:a,type:n,title:d,children:v,footer:g,classNames:x,styles:y,...b}=e,{getPrefixCls:w}=s.useContext(u.QO),{className:j,style:_,classNames:A,styles:z}=(0,u.TP)("modal"),k=w(),C=t||w("modal"),S=(0,f.A)(k),[M,P]=(0,p.Ay)(C,S),[N,O]=(0,o.AV)([A,x],[z,y],{props:e}),H=`${C}-confirm`,T={};return T=n?{closable:a??!1,title:"",footer:"",children:s.createElement(h.k,{...e,prefixCls:C,confirmPrefixCls:H,rootPrefixCls:k,content:v})}:{closable:a??!0,title:d,footer:null!==g&&s.createElement(m.w,{...e}),children:v},s.createElement(i.Z,{prefixCls:C,className:(0,c.$)(M,`${C}-pure-panel`,n&&H,n&&`${H}-${n}`,r,j,P,S,N.root),style:{..._,...O.root},...b,closeIcon:(0,m.O)(C,l),closable:a,classNames:N,styles:O,...T})});var g=r(99739);function x(e){return(0,l.Ay)((0,l.fp)(e))}let y=n.A;y.useModal=g.A,y.info=function(e){return(0,l.Ay)((0,l.$D)(e))},y.success=function(e){return(0,l.Ay)((0,l.Ej)(e))},y.error=function(e){return(0,l.Ay)((0,l.jT)(e))},y.warning=x,y.warn=x,y.confirm=function(e){return(0,l.Ay)((0,l.lr)(e))},y.destroyAll=function(){for(;a.A.length;){let e=a.A.pop();e&&e()}},y.config=l.FB,y._InternalPanelDoNotUseOrYouWillBeFired=v;let b=y},26619:(e,t,r)=>{"use strict";r.d(t,{A:()=>i});var l=r(97109),a=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 l in r)Object.prototype.hasOwnProperty.call(r,l)&&(e[l]=r[l])}return e}).apply(this,arguments)}let i=l.forwardRef((e,t)=>l.createElement(n.A,s({},e,{ref:t,icon:a.A})))},26631:(e,t,r)=>{"use strict";r.d(t,{A:()=>i});var l=r(97109),a=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 l in r)Object.prototype.hasOwnProperty.call(r,l)&&(e[l]=r[l])}return e}).apply(this,arguments)}let i=l.forwardRef((e,t)=>l.createElement(n.A,s({},e,{ref:t,icon:a.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";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 a(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"zh-CN";if(!e||e<=0)return"en-US"===t?"Never":"从未";let r=Math.floor(Math.floor((Date.now()-e)/1e3)/60),l=Math.floor(r/60),a=Math.floor(l/24);return a>30?new Date(e).toLocaleDateString(t):"en-US"===t?a>0?"".concat(a,"d ago"):l>0?"".concat(l,"h ago"):r>0?"".concat(r,"m ago"):"Just now":a>0?"".concat(a," 天前"):l>0?"".concat(l," 小时前"):r>0?"".concat(r," 分钟前"):"刚刚"}r.d(t,{Jm:()=>i,fw:()=>a,z3:()=>l});let n={document:"文档",spreadsheet:"表格",image:"图片",cad:"图纸",code:"代码",data:"数据",web:"网页",diagram:"图表",archive:"压缩包",other:"其他"},s={document:"Document",spreadsheet:"Spreadsheet",image:"Image",cad:"CAD",code:"Code",data:"Data",web:"Web",diagram:"Diagram",archive:"Archive",other:"Other"};function i(e){var t;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"zh-CN";return null!=(t=("en-US"===r?s:n)[e])?t:e}},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 l=r(97109),a=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 l in r)Object.prototype.hasOwnProperty.call(r,l)&&(e[l]=r[l])}return e}).apply(this,arguments)}let i=l.forwardRef((e,t)=>l.createElement(n.A,s({},e,{ref:t,icon:a.A})))},58209:(e,t,r)=>{"use strict";r.d(t,{A:()=>i});var l=r(97109),a=r(23793),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 l in r)Object.prototype.hasOwnProperty.call(r,l)&&(e[l]=r[l])}return e}).apply(this,arguments)}let i=l.forwardRef((e,t)=>l.createElement(n.A,s({},e,{ref:t,icon:a.A})))},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"}},61825:(e,t,r)=>{"use strict";r.d(t,{A:()=>i});var l=r(97109),a=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 l in r)Object.prototype.hasOwnProperty.call(r,l)&&(e[l]=r[l])}return e}).apply(this,arguments)}let i=l.forwardRef((e,t)=>l.createElement(n.A,s({},e,{ref:t,icon:a.A})))},64207:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>ee});var l=r(65321),a=r(97109),n=r(48321),s=r(43220),i=r.n(s),c=r(86109),o=r(17807),d=r(25258),u=r(11702),f=r(71102),h=r(85114),m=r(7576),p=r(50883),v=r(33442),g=r(21289),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 l in r)Object.prototype.hasOwnProperty.call(r,l)&&(e[l]=r[l])}return e}).apply(this,arguments)}let j=a.forwardRef((e,t)=>a.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 l in r)Object.prototype.hasOwnProperty.call(r,l)&&(e[l]=r[l])}return e}).apply(this,arguments)}let z=a.forwardRef((e,t)=>a.createElement(b.A,A({},e,{ref:t,icon:_.A})));var k=r(58520);function C(){return(C=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var l in r)Object.prototype.hasOwnProperty.call(r,l)&&(e[l]=r[l])}return e}).apply(this,arguments)}let S=a.forwardRef((e,t)=>a.createElement(b.A,C({},e,{ref:t,icon:k.A})));var M=r(90939);function P(){return(P=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var l in r)Object.prototype.hasOwnProperty.call(r,l)&&(e[l]=r[l])}return e}).apply(this,arguments)}let N=a.forwardRef((e,t)=>a.createElement(b.A,P({},e,{ref:t,icon:M.A})));var O=r(93314),H=r(61825),T=r(26619),E=r(7225),F=r(26631),V=r(64254),B=r(64629),I=r(58209),R=r(85855),L=r(30486),D=r(54746),q=r(84742),$=r(38762),J=r(39219),Q=r(22931),U=r(6578),W=r(45551),X=r(14569),G=r.n(X);let K=["document","spreadsheet","image","cad","code","data","web","diagram","other"],Z=/\.(zip|jar|war|apk|tar|gz|tgz|bz2|rar|7z)$/iu,Y=/(^|\/)\.DS_Store$|(^|\/)Thumbs\.db$|(^|\/)__MACOSX\/|\.bak$/iu;function ee(){let e=(0,n.Vr)("knowledge"),{locale:t}=(0,n.x_)(),{message:r}=o.A.useApp(),s=(0,c.useRouter)(),y="string"==typeof s.query.category?s.query.category:"",[b,w]=(0,a.useState)([]),[_,A]=(0,a.useState)(!1),[k,C]=(0,a.useState)(""),[M,P]=(0,a.useState)(""),[X,ee]=(0,a.useState)(y),[et,er]=(0,a.useState)(!1),[el,ea]=(0,a.useState)(!1),[en,es]=(0,a.useState)([]),[ei,ec]=(0,a.useState)([]),[eo,ed]=(0,a.useState)([]),eu=(0,a.useRef)(X),ef=(0,a.useRef)(new Set),eh=(0,a.useRef)(new Map);(0,a.useEffect)(()=>{eu.current=X},[X]),(0,a.useEffect)(()=>{ee("string"==typeof s.query.category?s.query.category:"")},[s.query.category]);let em=(0,a.useCallback)(async(e,t)=>{let r=null!=e?e:eu.current;(null==t?void 0:t.silent)||(A(!0),C(""));try{let e=await (0,U.HT)({category:r||void 0,limit:5e3});w(e.files||[]),e.initializing&&window.setTimeout(()=>{em(r,{silent:!0})},3e3)}catch(e){(null==t?void 0:t.silent)||(w([]),C(e instanceof Error?e.message:"文件列表加载失败"))}finally{(null==t?void 0:t.silent)||A(!1)}},[]);(0,a.useEffect)(()=>{em(X)},[X,em]);let ep=e=>"document"===e.type?null:{id:e.id,type:e.type,title:e.title,description:e.message,status:e.status,percent:e.percent,filePath:e.filePath,chunkCount:e.chunkCount,textLength:e.textLength,extractionMode:e.extractionMode,error:e.error,createdAt:e.createdAt},ev=(0,a.useCallback)(async()=>{try{let t=await (0,U.Qx)(),r=t.operations.map(ep).filter(e=>!!e);for(let r of[...ef.current]){var e;let l=t.operations.find(e=>e.id===r);if(!l)continue;let a="".concat(l.status,":").concat(l.stage),n=null!=(e=eh.current.get(r))?e:"";"success"===l.status||"error"===l.status?(ef.current.delete(r),eh.current.delete(r),em(void 0,{silent:!0})):a!==n&&(eh.current.set(r,a),em(void 0,{silent:!0}))}es(e=>{let t=new Set(r.map(e=>e.id).filter(Boolean)),l=r.map(t=>{var r;let l=e.find(e=>e.id===t.id);return l?{...l,...t,createdAt:null!=(r=l.createdAt)?r:t.createdAt}:t}),a=e.filter(e=>e.id&&!t.has(e.id)&&"processing"===e.status);return[...l,...a].slice(0,50)})}catch(e){}},[em]),eg=(0,a.useCallback)(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];es(r=>{let l=r.findIndex(r=>e.id&&r.id===e.id||t.includes(r.title));if(l>=0){var a;let t=[...r];return t[l]={...r[l],...e,createdAt:null!=(a=r[l].createdAt)?a:e.createdAt},t}return[e,...r].slice(0,50)})},[]);(0,a.useEffect)(()=>{ev()},[ev]);let ex=(0,a.useMemo)(()=>{let e=0,t=0,r=0;for(let l of en)"processing"===l.status?e++:"success"===l.status?t++:("error"===l.status||"warning"===l.status)&&r++;return{processing:e,success:t,error:r}},[en]);(0,a.useEffect)(()=>{if(0===ex.processing)return;let e=window.setInterval(()=>{ev()},2e3),t=window.setInterval(()=>{em(void 0,{silent:!0})},8e3);return()=>{window.clearInterval(e),window.clearInterval(t)}},[em,ev,ex.processing]);let ey=async e=>{let t=e.filter(e=>{let t=e.webkitRelativePath||e.name;return e.size>0&&!Z.test(e.name)&&!Y.test(t)}),l=e.length-t.length;if(l>0&&r.warning("已跳过 ".concat(l," 个空文件、系统文件、备份文件或压缩包")),0===t.length)return;let a=1===t.length?t[0].name:"".concat(t.length," 个文件");er(!0);let n="".concat(Date.now(),"-").concat(Math.random().toString(36).slice(2));ef.current.add(n),eh.current.set(n,""),eg({id:n,type:"upload",title:"上传 ".concat(a),description:"等待上传、解析、切片和入库;同路径文件会更新,其他已有文件不会清除",status:"processing",percent:5});try{await (0,U.c1)(t,void 0,n,e=>{eg({id:n,type:"upload",title:"上传 ".concat(a),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)))})}),r.info("文件已上传,正在后台解析、切片和入库;同路径文件会更新,其他已有文件不会清除,可在顶部“后台任务”查看进度"),P(""),ee(""),ec([]),eu.current="",await ev()}catch(e){if(e instanceof U.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,",失败文件可重新选择上传")),eg({id:n,type:"upload",title:"部分文件上传失败 ".concat(a),description:t||e.message,status:"warning",percent:100,error:t||e.message})}else{ef.current.delete(n),eh.current.delete(n);let t=e instanceof Error?e.message:"请重试或检查文件格式";r.error(t||"上传失败"),eg({id:n,type:"error",title:"上传失败 ".concat(a),description:t,status:"error",percent:100})}}finally{er(!1)}},eb=async()=>{ea(!0);let e="reindex-ui-".concat(Date.now());eg({id:e,type:"reindex",title:"重新解析入库",description:"正在提交后台任务",status:"processing",percent:5});try{var t;let l=await (0,U.H1)(),a=l.operationId||e,n=l.job;r.info(l.alreadyRunning?"已有重新解析任务正在后台执行":"已提交重新解析入库任务,可在顶部“后台任务”查看进度"),eg({id:a,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,U.ax)(a).then(e=>e.job).catch(async()=>(await (0,U.Qx)()).operations.find(e=>e.id===a));if(e){let t="success"===e.status||"error"===e.status;if(eg({id:a,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 em(),await ev()}catch(l){let t=l instanceof Error?l.message:"重新解析入库失败";r.error(t),eg({id:e,type:"error",title:"重新解析入库失败",description:t,status:"error",percent:100},["重新解析入库","重新解析入库完成","重新解析入库失败"])}finally{ea(!1)}},ew=async function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],l="file-reindex-ui-".concat(Date.now(),"-").concat(Math.random().toString(36).slice(2));eg({id:l,type:"reindex",title:"".concat(t?"重新解析文件夹":"重新解析"," ").concat(e),description:t?"正在提交文件夹后台任务":"正在提交单文件后台任务",status:"processing",percent:5,filePath:e});try{var a;let t=await (0,U.HC)(e),n=t.operationId||l,s=t.job;r.info(t.alreadyRunning?"已有知识库任务正在后台执行":"已提交单文件重新解析任务"),eg({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!=(a=null==s?void 0:s.percent)?a: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,U.ax)(n).then(e=>e.job).catch(async()=>(await (0,U.Qx)()).operations.find(e=>e.id===n));if(t){let l="success"===t.status||"error"===t.status;if(eg({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 em(),l){"success"===t.status?r.success(t.message||"单文件重新解析完成"):r.error(t.error||t.message||"单文件重新解析失败");break}}await new Promise(e=>setTimeout(e,1e3))}await em(),await ev()}catch(a){let t=a instanceof Error?a.message:"单文件重新解析失败";r.error(t),eg({id:l,type:"error",title:"重新解析失败 ".concat(e),description:t,status:"error",percent:100,filePath:e},["重新解析 ".concat(e)])}},ej=t=>{let l="selected"===t?eP:"filtered"===t?e_.map(e=>e.relativePath):[],a=b.length;if("all"!==t&&0===l.length||"all"===t&&0===a)return void r.info("没有可删除的文件");let n="all"===t?"删除全部文件 ".concat(a," 个?"):"filtered"===t?"删除当前筛选结果中的文件 ".concat(l.length," 个?"):"删除已选文件 ".concat(l.length," 个?");d.A.confirm({title:n,content:"将同时删除文件、切片、索引和向量记录。此操作不可撤销。",okText:e("common.delete"),cancelText:e("common.cancel"),okButtonProps:{danger:!0},onOk:async()=>{es(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,U.X8)():"selected"===t?await (0,U.tZ)(eM,eS):await (0,U.SJ)(l)).deleted)?e:"all"===t?a:l.length;r.success("已删除 ".concat(n," 个文件")),ec([]),es(e=>[{type:"delete",title:"批量删除完成",description:"已删除 ".concat(n," 个文件、切片和索引"),status:"success"},...e].slice(0,50)),await em(),await ev()}catch(e){r.error("批量删除失败"),es(e=>[{type:"error",title:"批量删除失败",description:"请重试",status:"error"},...e].slice(0,50))}}})},e_=(0,a.useMemo)(()=>M?b.filter(e=>e.relativePath.toLowerCase().includes(M.toLowerCase())):b,[M,b]),eA=(0,a.useMemo)(()=>new Set(e_.map(e=>e.relativePath)),[e_]),ez=(0,a.useMemo)(()=>{let e={};for(let r of[...e_].sort((e,t)=>e.relativePath.localeCompare(t.relativePath))){let l=r.relativePath.split("/"),a="";for(let n=0;n<l.length;n++){let s=l[n],i=a;a=a?"".concat(a,"/").concat(s):s;let c=n===l.length-1;if(e[a])c||e[a].isFolder?c&&(e[a].isFolder=!1,e[a].file=r,e[a].fileCount=1,e[a].totalSize=r.fileSize,e[a].totalChunks=r.chunkCount):(e[a].isFolder=!0,e[a].children=[],e[a].fileCount=0,e[a].totalSize=0,e[a].totalChunks=0);else{var t;e[a]={key:a,name:s,isFolder:!c,...c?{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[a])}}}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,l,a;e+=null!=(t=r.fileCount)?t:0,s+=null!=(l=r.totalSize)?l:0,i+=null!=(a=r.totalChunks)?a:0}n.fileCount=e,n.totalSize=s,n.totalChunks=i}},l=e=>e.map(e=>e.children?{...e,children:l(e.children)}:e).filter(e=>{var t,r,l;return!e.isFolder||(null!=(r=e.fileCount)?r:0)>0&&(null!=(l=null==(t=e.children)?void 0:t.length)?l:0)>0}),a=Object.values(e).filter(e=>!e.key.includes("/"));return r(a),l(a)},[e_]),ek=(0,a.useMemo)(()=>{let e=[],t=r=>{for(let l of r)e.push(l.key),l.children&&t(l.children)};return t(ez),e},[ez]),eC=(0,a.useMemo)(()=>new Set([...eA,...ek]),[ek,eA]),eS=(0,a.useMemo)(()=>ei.map(String).filter(e=>!eA.has(e)&&ek.includes(e)),[ek,ei,eA]),eM=(0,a.useMemo)(()=>ei.map(String).filter(e=>eA.has(e)),[ei,eA]),eP=(0,a.useMemo)(()=>{let e=new Set;for(let t of eM){let r=b.find(e=>e.relativePath===t);r&&e.add(r.relativePath)}for(let t of eS){let r="".concat(t,"/");for(let t of b)t.relativePath.startsWith(r)&&e.add(t.relativePath)}return Array.from(e)},[b,eM,eS]),eN=eP.length;(0,a.useEffect)(()=>{ec(e=>e.filter(e=>eC.has(String(e))))},[eC]);let eO=(0,a.useMemo)(()=>M?ek:[],[M,ek]);(0,a.useEffect)(()=>{ed(eO)},[eO]);let eH=(e,t)=>{ed(r=>e?[...r,t.key]:r.filter(e=>e!==t.key))},eT=[{title:e("fileName"),dataIndex:"name",key:"name",render:(e,t)=>(0,l.jsxs)("span",{className:G().fileNameCell,children:[t.isFolder?(0,l.jsx)("span",{style:{cursor:"pointer"},onClick:e=>{e.stopPropagation(),eH(!eo.includes(t.key),t)},children:(e=>{let t=e.children;return t&&0!==t.length?(0,l.jsx)(V.A,{style:{color:"#fa8c16",fontSize:15}}):(0,l.jsx)(E.A,{style:{color:"#fa8c16",fontSize:15}})})(t)}):(e=>{if(!e)return(0,l.jsx)(x.A,{style:{fontSize:15}});let t=e.category;return"image"===t?(0,l.jsx)(j,{style:{color:"#eb2f96",fontSize:15}}):"spreadsheet"===t?(0,l.jsx)(z,{style:{color:"#52c41a",fontSize:15}}):"document"===t?(0,l.jsx)(S,{style:{color:"#1677ff",fontSize:15}}):"code"===t?(0,l.jsx)(N,{style:{color:"#fa8c16",fontSize:15}}):"archive"===t?(0,l.jsx)(O.A,{style:{color:"#8c8c8c",fontSize:15}}):"web"===t?(0,l.jsx)(H.A,{style:{color:"#13c2c2",fontSize:15}}):"data"===t?(0,l.jsx)(T.A,{style:{color:"#722ed1",fontSize:15}}):"cad"===t?(0,l.jsx)(E.A,{style:{color:"#fa541c",fontSize:15}}):"diagram"===t?(0,l.jsx)(j,{style:{color:"#a0d911",fontSize:15}}):(0,l.jsx)(F.A,{style:{fontSize:15}})})(t.file),t.isFolder?(0,l.jsx)("span",{className:G().folderName,onClick:e=>{e.stopPropagation(),eH(!eo.includes(t.key),t)},children:t.name}):(0,l.jsx)(l.Fragment,{children:(0,l.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 a,n;return r.isFolder?(0,l.jsx)("span",{style:{color:"var(--colorTextQuaternary)"},children:"—"}):(0,l.jsx)(u.A,{children:(0,W.Jm)(null!=(n=null==(a=r.file)?void 0:a.category)?n:"",t)})}},{title:e("fileSize"),dataIndex:"fileSize",key:"size",width:90,render:(e,t)=>{var r,l,a;return(0,W.z3)(t.isFolder?null!=(l=t.totalSize)?l:0:null!=(a=null==(r=t.file)?void 0:r.fileSize)?a:0)}},{title:e("chunksCount"),dataIndex:"chunkCount",key:"chunks",width:80,render:(e,t)=>{var r,a,n;let s=t.isFolder?null!=(a=t.totalChunks)?a:0:null!=(n=null==(r=t.file)?void 0:r.chunkCount)?n:0;return(0,l.jsx)(u.A,{color:s>1?"green":"orange",children:s})}},{title:e("parsingStatus"),dataIndex:"status",key:"status",width:100,render:(e,t)=>{var r,a,n,s;return t.isFolder?(0,l.jsx)("span",{style:{color:"var(--colorTextQuaternary)"},children:"—"}):(0,l.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==(a=t.file)?void 0:a.errorMessage)||(null==(n=t.file)?void 0:n.status)||"—"})}},{title:e("fileDate"),dataIndex:"mtime",key:"date",width:130,render:(e,r)=>{var a;return r.isFolder?(0,l.jsx)("span",{style:{color:"var(--colorTextQuaternary)"},children:"—"}):(null==(a=r.file)?void 0:a.mtime)?new Date(r.file.mtime).toLocaleDateString(t):"—"}},{title:e("source"),key:"source",width:100,render:(t,r)=>r.isFolder?(0,l.jsx)("span",{style:{color:"var(--colorTextQuaternary)"},children:"—"}):(0,l.jsx)(u.A,{color:"cyan",children:e("fileSource")})},{title:"",key:"act",width:80,align:"center",render:(t,a)=>{var n;return(0,l.jsx)(f.A,{menu:{items:a.isFolder?[{key:"reindex-folder",label:"重新索引文件夹",icon:(0,l.jsx)(B.A,{}),disabled:(null!=(n=a.fileCount)?n:0)===0,onClick:()=>{ew(a.key,!0)}}]:[{key:"reindex",label:e("reindex"),icon:(0,l.jsx)(B.A,{}),onClick:()=>{ew(a.file.relativePath)}},{type:"divider"},{key:"delete",label:e("delete"),icon:(0,l.jsx)(I.A,{}),danger:!0,onClick:()=>{var t;return t=a.file,void d.A.confirm({title:e("delete"),content:e("deleteConfirm"),okText:e("common.confirm"),cancelText:e("common.cancel"),okButtonProps:{danger:!0},onOk:async()=>{es(e=>[{type:"delete",title:"删除 ".concat(t.relativePath),description:"正在删除文件记录",status:"processing"},...e].slice(0,50));try{await (0,U.xq)(t.relativePath),r.success("已删除"),es(e=>[{type:"delete",title:"删除完成 ".concat(t.relativePath),description:"文件和索引记录已移除",status:"success"},...e].slice(0,50)),ec(e=>e.filter(e=>e!==t.relativePath)),await em(),await ev()}catch(e){r.error("删除失败"),es(e=>[{type:"error",title:"删除失败 ".concat(t.relativePath),description:"请重试",status:"error"},...e].slice(0,50))}}})}}]},trigger:["click"],children:(0,l.jsx)(h.Ay,{type:"text",size:"small",icon:(0,l.jsx)(R.A,{})})})}}],eE=(0,l.jsxs)("div",{className:"flex flex-1 md:flex-none w-full md:w-auto items-center gap-3",children:[(0,l.jsx)(m.A,{placeholder:e("searchPlaceholder"),prefix:(0,l.jsx)(L.A,{className:"text-[var(--colorTextTertiary)]"}),value:M,onChange:e=>{P(e.target.value)},allowClear:!0,variant:"borderless",className:"max-w-[300px] flex-1 bg-transparent hover:bg-transparent focus:bg-transparent",style:{borderBottom:"1px solid var(--borderColor)",borderRadius:0,paddingLeft:0,paddingRight:0}}),(0,l.jsx)(p.A,{value:X||void 0,onChange:e=>{ee(e||"")},placeholder:e("filterCategory"),allowClear:!0,style:{width:140},variant:"borderless",options:[{label:e("allCategories"),value:""},...K.map(e=>({label:(0,W.Jm)(e,t),value:e}))]}),(0,l.jsx)("div",{className:"w-[1px] h-6 bg-[var(--borderColor)] mx-1"}),(0,l.jsx)(f.A,{menu:{items:[{key:"file",label:e("uploadFiles"),icon:(0,l.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,l.jsx)(E.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,l.jsx)(B.A,{}),onClick:()=>{eb()},danger:!0}]},trigger:["click"],children:(0,l.jsx)(h.Ay,{type:"primary",icon:(0,l.jsx)(D.A,{}),loading:et||el,className:"rounded-md px-4",children:e("new")})}),(0,l.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="",ey(r)}}),(0,l.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="",ey(r)}})]});return(0,l.jsxs)("div",{className:"h-[calc(100vh-140px)] flex flex-col",children:[(0,l.jsxs)("div",{className:"bg-[var(--colorBgContainer)] rounded-2xl border border-[var(--borderColor)] p-6 mb-4 shrink-0 animateFadeIn",children:[(0,l.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,l.jsxs)("div",{children:[(0,l.jsxs)("h1",{className:"text-2xl font-bold tracking-tight text-[var(--colorText)] mb-1 flex items-center gap-2",children:[(0,l.jsx)(T.A,{className:"text-[var(--colorAccent)]"}),e("files")]}),(0,l.jsx)("p",{className:"text-sm text-[var(--colorTextSecondary)] m-0",children:e("manageRawFiles")})]}),eE]}),(0,l.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-6 pt-6 stagger-1",children:[(0,l.jsxs)("div",{className:"flex items-center gap-4",children:[(0,l.jsx)("div",{className:"w-12 h-12 rounded-xl bg-[var(--colorBgHover)] flex items-center justify-center text-xl text-[var(--colorTextSecondary)]",children:(0,l.jsx)(V.A,{})}),(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{className:"text-[11px] font-semibold text-[var(--colorTextTertiary)] uppercase tracking-wider mb-1",children:e("totalRootFolders")}),(0,l.jsx)("div",{className:"text-xl font-bold text-[var(--colorText)] leading-none",children:ez.length})]})]}),(0,l.jsxs)("div",{className:"flex items-center gap-4",children:[(0,l.jsx)("div",{className:"w-12 h-12 rounded-xl bg-[var(--colorBgHover)] flex items-center justify-center text-xl text-[var(--colorTextSecondary)]",children:(0,l.jsx)(F.A,{})}),(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{className:"text-[11px] font-semibold text-[var(--colorTextTertiary)] uppercase tracking-wider mb-1",children:e("totalFilesStats")}),(0,l.jsx)("div",{className:"text-xl font-bold text-[var(--colorText)] leading-none",children:b.length})]})]}),(0,l.jsxs)("div",{className:"flex items-center gap-4",children:[(0,l.jsx)("div",{className:"w-12 h-12 rounded-xl bg-green-50 dark:bg-green-900/20 flex items-center justify-center text-xl text-green-600 dark:text-green-500",children:(0,l.jsx)(q.A,{})}),(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{className:"text-[11px] font-semibold text-[var(--colorTextTertiary)] uppercase tracking-wider mb-1",children:e("successfullyParsed")}),(0,l.jsx)("div",{className:"text-xl font-bold text-[var(--colorText)] leading-none",children:b.filter(e=>"success"===e.status).length})]})]}),(0,l.jsxs)("div",{className:"flex items-center gap-4",children:[(0,l.jsx)("div",{className:"w-12 h-12 rounded-xl bg-red-50 dark:bg-red-900/20 flex items-center justify-center text-xl text-red-600 dark:text-red-500",children:(0,l.jsx)($.A,{})}),(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{className:"text-[11px] font-semibold text-[var(--colorTextTertiary)] uppercase tracking-wider mb-1",children:e("parsingErrors")}),(0,l.jsx)("div",{className:"text-xl font-bold text-[var(--colorText)] leading-none",children:b.filter(e=>"error"===e.status).length})]})]})]})]}),k&&(0,l.jsx)("div",{className:"p-4 mb-4 bg-[var(--colorDanger)]/10 text-[var(--colorDanger)] rounded-xl border border-[var(--colorDanger)]/20",children:k}),(0,l.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,l.jsxs)("div",{className:"flex justify-between items-center p-4 bg-[var(--colorBgHover)] border-b border-[var(--borderColor)] shrink-0",children:[(0,l.jsx)("div",{className:"text-xs text-[var(--colorTextSecondary)] font-medium",children:e("showingMatchingFiles").replace("{count}",String(e_.length))}),(0,l.jsxs)(v.A,{size:8,children:[eN>0&&(0,l.jsxs)(h.Ay,{danger:!0,size:"small",icon:(0,l.jsx)(I.A,{}),onClick:()=>ej("selected"),className:"rounded-lg",children:[e("deleteSelected")," (",eN,")"]}),(0,l.jsx)(h.Ay,{danger:!0,size:"small",disabled:0===b.length,onClick:()=>ej("all"),className:"rounded-lg",children:e("deleteAll")})]})]}),(0,l.jsx)(g.A,{rowKey:"key",columns:eT,dataSource:ez,loading:_&&!et&&!el,size:"middle",className:"flex-1 custom-table border-0",scroll:{y:"calc(100vh - 460px)"},expandable:{expandedRowKeys:eo,onExpand:eH,expandIcon:e=>{let{expanded:t,onExpand:r,record:a}=e;return a.isFolder?(0,l.jsx)("button",{type:"button",onClick:e=>r(a,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,l.jsx)(J.A,{size:16}):(0,l.jsx)(Q.A,{size:16})}):(0,l.jsx)("span",{className:"w-6 h-6 inline-flex"})}},locale:{emptyText:_?e("common.loading"):M?e("emptySearch"):e("noFiles")},pagination:!1,rowClassName:e=>"hover:bg-[var(--colorBgHover)] transition-colors ".concat(e.isFolder?"font-medium bg-[var(--colorBgSecondary)]/30":""),rowSelection:{selectedRowKeys:ei,onChange:ec,checkStrictly:!1,getCheckboxProps:e=>{var t;return{disabled:!!e.isFolder&&(null!=(t=e.fileCount)?t:0)===0}}}})]})]})}},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"}},85855:(e,t,r)=>{"use strict";r.d(t,{A:()=>i});var l=r(97109),a=r(35311),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 l in r)Object.prototype.hasOwnProperty.call(r,l)&&(e[l]=r[l])}return e}).apply(this,arguments)}let i=l.forwardRef((e,t)=>l.createElement(n.A,s({},e,{ref:t,icon:a.A})))},90426:(e,t,r)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/knowledge/files",function(){return r(64207)}])},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"}},93314:(e,t,r)=>{"use strict";r.d(t,{A:()=>i});var l=r(97109),a=r(53234),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 l in r)Object.prototype.hasOwnProperty.call(r,l)&&(e[l]=r[l])}return e}).apply(this,arguments)}let i=l.forwardRef((e,t)=>l.createElement(n.A,s({},e,{ref:t,icon:a.A})))}},e=>{e.O(0,[717,883,665,44,563,7,289,636,593,792],()=>e(e.s=90426)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[414],{45551:(e,l,t)=>{"use strict";function n(e){if(0===e)return"0 B";let l=Math.floor(Math.log(e)/Math.log(1024)),t=e/Math.pow(1024,l);return"".concat(t.toFixed(+(0!==l))," ").concat(["B","KB","MB","GB","TB"][l])}function a(e){let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"zh-CN";if(!e||e<=0)return"en-US"===l?"Never":"从未";let t=Math.floor(Math.floor((Date.now()-e)/1e3)/60),n=Math.floor(t/60),a=Math.floor(n/24);return a>30?new Date(e).toLocaleDateString(l):"en-US"===l?a>0?"".concat(a,"d ago"):n>0?"".concat(n,"h ago"):t>0?"".concat(t,"m ago"):"Just now":a>0?"".concat(a," 天前"):n>0?"".concat(n," 小时前"):t>0?"".concat(t," 分钟前"):"刚刚"}t.d(l,{Jm:()=>s,fw:()=>a,z3:()=>n});let r={document:"文档",spreadsheet:"表格",image:"图片",cad:"图纸",code:"代码",data:"数据",web:"网页",diagram:"图表",archive:"压缩包",other:"其他"},o={document:"Document",spreadsheet:"Spreadsheet",image:"Image",cad:"CAD",code:"Code",data:"Data",web:"Web",diagram:"Diagram",archive:"Archive",other:"Other"};function s(e){var l;let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"zh-CN";return null!=(l=("en-US"===t?o:r)[e])?l:e}},50423:(e,l,t)=>{"use strict";t.r(l),t.d(l,{default:()=>E});var n=t(65321),a=t(97109),r=t(34986),o=t(48321),s=t(17807),c=t(33442),i=t(85114),d=t(2256),u=t(38770),h=t(68787),x=t(54849),g=t(50883),m=t(76506),j=t(11702),A=t(7225),f=t(30486),w=t(99811),k=t(56768),v=t(26619),p=t(93314),y=t(58740),b=t(35459),C=t(23216),S=t(63663),z=t(49484),D=t(6578),N=t(45551);let _=["document","spreadsheet","image","cad","code","data","web","diagram","archive","other"];function E(){var e,l,t,E;let I=(0,o.Vr)(),{locale:T}=(0,o.x_)(),M=(0,r.useRouter)(),{stats:B,loading:F,reload:R}=function(){let[e,l]=(0,a.useState)(null),[t,n]=(0,a.useState)(!1),r=(0,a.useCallback)(async()=>{n(!0);try{l(await (0,D.hc)())}catch(e){}finally{n(!1)}},[]);return(0,a.useEffect)(()=>{r()},[r]),{stats:e,loading:t,reload:r}}(),O=function(){let[e,l]=(0,a.useState)(null);return(0,a.useEffect)(()=>{(0,D.VW)().then(l).catch(()=>{})},[]),e}(),{reindexing:P,reindex:J}=function(){let[e,l]=(0,a.useState)(!1);return{reindexing:e,reindex:(0,a.useCallback)(async()=>{l(!0);try{return await (0,D.H1)(),!0}catch(e){return!1}finally{l(!1)}},[])}}(),[U,W]=(0,a.useState)("document"),[H,V]=(0,a.useState)({count:0,totalSize:0,totalChunks:0}),{message:X}=s.A.useApp(),G=(0,a.useCallback)(async e=>{try{let l=await (0,D.HT)({category:e,limit:1e4}),t=0,n=0;if(Array.isArray(l.files))for(let e of l.files)t+=e.fileSize||0,n+=e.chunkCount||0;V({count:l.total||0,totalSize:t,totalChunks:n})}catch(e){V({count:0,totalSize:0,totalChunks:0})}},[]);(0,a.useEffect)(()=>{G(U)},[U,G]);let K=async()=>{await J()?await Promise.all([R(),G(U)]):X.error(I("common.error"))};return(0,n.jsxs)("div",{className:"space-y-6 animateFadeIn",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("h1",{className:"pageTitle",children:I("knowledge.manageTitle")}),(0,n.jsx)("p",{className:"pageDesc",children:I("knowledge.manageDesc")})]}),(0,n.jsxs)(c.A,{children:[(0,n.jsx)(i.Ay,{icon:(0,n.jsx)(A.A,{}),onClick:()=>M.push("/knowledge/files"),children:I("knowledge.files")}),(0,n.jsx)(i.Ay,{icon:(0,n.jsx)(f.A,{}),onClick:()=>M.push("/knowledge/search"),children:I("knowledge.search")}),(0,n.jsx)(i.Ay,{icon:(0,n.jsx)(w.A,{}),loading:P,onClick:()=>{K()},children:I("knowledge.reindex")})]})]}),(0,n.jsx)(d.A,{gutter:[16,16],children:[{icon:(0,n.jsx)(k.A,{}),label:I("knowledge.totalFiles"),value:null!=(l=null==B?void 0:B.fileCount)?l:0},{icon:(0,n.jsx)(v.A,{}),label:I("knowledge.totalChunks"),value:null!=(t=null==B?void 0:B.chunkCount)?t:0},{icon:(0,n.jsx)(p.A,{}),label:I("knowledge.totalSize"),value:(0,N.z3)(null!=(E=null==B?void 0:B.totalSizeBytes)?E:0)},{icon:(0,n.jsx)(y.A,{}),label:I("knowledge.lastIndexed"),value:(null==B?void 0:B.lastIndexedAt)?(0,N.fw)(B.lastIndexedAt,T):I("common.never")}].map((e,l)=>(0,n.jsx)(u.A,{xs:12,sm:6,children:(0,n.jsx)(h.A,{size:"small",loading:F&&!B,children:(0,n.jsx)(x.A,{title:e.label,value:e.value,prefix:e.icon})})},l))}),(0,n.jsxs)(h.A,{title:I("knowledge.categories"),size:"small",children:[(0,n.jsx)(g.A,{value:U,onChange:e=>W(e),options:_.map(e=>({label:(0,N.Jm)(e,T),value:e})),style:{width:160,marginBottom:16}}),(0,n.jsxs)(d.A,{gutter:[16,16],children:[(0,n.jsx)(u.A,{xs:12,sm:6,children:(0,n.jsx)(x.A,{title:I("knowledge.fileCount"),value:H.count,prefix:(0,n.jsx)(k.A,{style:{color:"var(--colorAccent)"}})})}),(0,n.jsx)(u.A,{xs:12,sm:6,children:(0,n.jsx)(x.A,{title:I("knowledge.totalSize"),value:(0,N.z3)(H.totalSize),prefix:(0,n.jsx)(p.A,{style:{color:"var(--colorWarning)"}})})}),(0,n.jsx)(u.A,{xs:12,sm:6,children:(0,n.jsx)(x.A,{title:I("knowledge.chunksCount"),value:H.totalChunks,prefix:(0,n.jsx)(b.A,{style:{color:"var(--colorOk)"}})})}),(0,n.jsx)(u.A,{xs:12,sm:6,children:(0,n.jsx)(x.A,{title:I("knowledge.averageSize"),value:H.count>0?(0,N.z3)(H.totalSize/H.count):"—",prefix:(0,n.jsx)(v.A,{style:{color:"var(--colorDanger)"}})})})]})]}),O&&(0,n.jsx)(h.A,{title:I("knowledge.features"),size:"small",children:(0,n.jsxs)(m.A,{size:"small",column:{xs:1,sm:2},bordered:!0,children:[(0,n.jsx)(m.A.Item,{label:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(C.A,{style:{marginRight:4}}),I("knowledge.vectorStore")]}),children:(0,n.jsx)(j.A,{color:"blue",children:O.vectorStore})}),(0,n.jsx)(m.A.Item,{label:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(b.A,{style:{marginRight:4}}),I("knowledge.embedding")]}),children:(0,n.jsx)(j.A,{color:"purple",children:O.embeddingProvider})}),(0,n.jsxs)(m.A.Item,{label:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(S.A,{style:{marginRight:4}}),I("knowledge.featureDedup")]}),children:[(0,n.jsx)(j.A,{color:"green",children:O.dedupEngine}),(0,n.jsx)("div",{className:"text-xs",style:{color:"var(--colorTextSecondary)",marginTop:2},children:I("knowledge.featureDedupDesc")})]}),(0,n.jsxs)(m.A.Item,{label:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(z.A,{style:{marginRight:4}}),I("knowledge.featureChunker")]}),children:[(0,n.jsx)(j.A,{color:"orange",children:O.chunker}),(0,n.jsx)("div",{className:"text-xs",style:{color:"var(--colorTextSecondary)",marginTop:2},children:I("knowledge.featureChunkerDesc")})]}),(null==(e=O.builtinExtractors)?void 0:e.length)>0&&(0,n.jsx)(m.A.Item,{label:I("knowledge.builtinExtractors"),span:2,children:(0,n.jsx)(c.A,{wrap:!0,children:O.builtinExtractors.map(e=>(0,n.jsx)(j.A,{color:"cyan",children:e},e))})})]})})]})}},54178:(e,l,t)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/knowledge/manage",function(){return t(50423)}])}},e=>{e.O(0,[717,883,665,787,506,788,636,593,792],()=>e(e.s=54178)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[26],{27549:(e,t,r)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/prompt",function(){return r(34508)}])},34508:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>q});var o=r(65321),l=r(97109),a=r(48321),s=r(17807),n=r(33442),i=r(11702),c=r(56985),d=r(85114),p=r(26171),m=r(88762),h=r(7576),x=r(50883),u=r(49292),g=r(84253),f=r(34052),v=r(42700),y=r(55122),j=r(54746),w=r(99650),b=r(81668),S=r(58209),A=r(26631),N=r(7225),C=r(96091),k=r(30486),T=r(46082),F=r(42758),z=r(24810),P=r(7492);async function B(){let e=await fetch("/api/prompt");if(!e.ok)throw Error("Failed");return e.json()}async function E(e,t,r){let o=await fetch("/api/prompt",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({filePath:e,content:t,name:r})});if(!o.ok)throw Error("Failed");return o.json()}async function O(e){let t=await fetch("/api/prompt",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"create",projectRoot:e,content:"# CUSTOMIZE\n"})});if(!t.ok)throw Error("Failed");return t.json()}async function R(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 I(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 D(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 H(){return M("",!1,60)}async function _(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 M(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:30,o=new URLSearchParams({limit:String(r)});e.trim()&&o.set("q",e.trim()),t||o.set("includeContent","0");let l=await fetch("/api/kb/files/search?".concat(o));return l.ok&&(await l.json()).files||[]}async function J(e){let t=await fetch("/api/prompt/chat",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok){let e=await t.text();try{let t=JSON.parse(e);throw Error(t.error||t.message||e||"AI 对话失败")}catch(t){throw Error(e||"AI 对话失败")}}return t.json()}function L(e,t){let r=new Blob([JSON.stringify(t,null,2)],{type:"application/json;charset=utf-8"}),o=URL.createObjectURL(r),l=document.createElement("a");l.href=o,l.download=e,l.click(),URL.revokeObjectURL(o)}function W(e){return e.id.startsWith("custom:")}function K(e){return W(e)?"custom":e.isCurrent?"current":"project"}function U(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 $(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:220,r=e.hasFile&&e.content?e.content.replace(/^#.*$/gm,"").replace(/\n{3,}/g,"\n\n").trim():"";return r.length>t?"".concat(r.slice(0,t),"..."):r}function G(e){let t=Date.parse(e);return Number.isNaN(t)?"-":new Date(t).toLocaleString()}function X(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:K(e)}))}}function Y(e){let t=e.match(/(^|\s)@([^\s@]*)$/);return t?t[2]:null}function q(){let e=(0,a.Vr)(),{message:t}=s.A.useApp(),[r,q]=(0,l.useState)(!0),[Q,V]=(0,l.useState)([]),[Z,ee]=(0,l.useState)(!1),[et,er]=(0,l.useState)(null),[eo,el]=(0,l.useState)(""),[ea,es]=(0,l.useState)(""),[en,ei]=(0,l.useState)(!1),[ec,ed]=(0,l.useState)(!1),[ep,em]=(0,l.useState)("custom"),[eh,ex]=(0,l.useState)("all"),[eu,eg]=(0,l.useState)("mtime"),[ef,ev]=(0,l.useState)("list"),[ey,ej]=(0,l.useState)(""),[ew,eb]=(0,l.useState)(null),[eS,eA]=(0,l.useState)([]),[eN,eC]=(0,l.useState)(!1),[ek,eT]=(0,l.useState)([]),[eF,ez]=(0,l.useState)(""),[eP,eB]=(0,l.useState)(""),[eE,eO]=(0,l.useState)(!1),[eR,eI]=(0,l.useState)([]),[eD,eH]=(0,l.useState)([]),[e_,eM]=(0,l.useState)([]),[eJ,eL]=(0,l.useState)(!1),[eW,eK]=(0,l.useState)(!1),[eU,e$]=(0,l.useState)(!1),eG=(0,l.useRef)(null),eX=(0,l.useRef)(null),eY=Y(eP),eq=async()=>{q(!0);try{V(await B())}catch(r){t.error(e("common.error"))}finally{q(!1)}};(0,l.useEffect)(()=>{eq()},[]),(0,l.useEffect)(()=>{let e=window.localStorage.getItem("customize-agent:prompt-view-mode");("list"===e||"card"===e)&&ev(e)},[]),(0,l.useEffect)(()=>{window.localStorage.setItem("customize-agent:prompt-view-mode",ef)},[ef]),(0,l.useEffect)(()=>{let e=eX.current;e&&e.scrollTo({top:e.scrollHeight,behavior:"smooth"}),eF&&window.localStorage.setItem(eF,JSON.stringify(ek.slice(-30)))},[ek,eE,eF]),(0,l.useEffect)(()=>{!Z||eR.length>0||eJ||(eL(!0),H().then(eI).catch(()=>void 0).finally(()=>eL(!1)))},[Z,eR.length,eJ]),(0,l.useEffect)(()=>{let e=null==eY?void 0:eY.trim();if(!Z||!e){eH([]),eK(!1);return}let t=!1;eK(!0);let r=window.setTimeout(()=>{M(e).then(e=>{t||eH(e)}).catch(()=>{t||eH([])}).finally(()=>{t||eK(!1)})},250);return()=>{t=!0,window.clearTimeout(r)}},[Z,eY]);let eQ=Q.find(e=>e.isCurrent),eV=Q.filter(W),eZ={all:Q.length,custom:Q.filter(e=>"custom"===K(e)).length,current:Q.filter(e=>"current"===K(e)).length,project:Q.filter(e=>"project"===K(e)).length,selected:Q.filter(e=>e.selected).length,unselected:Q.filter(e=>!e.selected).length,hasFile:Q.filter(e=>e.hasFile).length,missingFile:Q.filter(e=>!e.hasFile).length},e0=Q.filter(e=>{var t;let r=K(e);return("all"===ep||r===ep)&&("selected"!==eh||!!e.selected)&&("unselected"!==eh||!e.selected)&&("hasFile"!==eh||!!e.hasFile)&&("missingFile"!==eh||!e.hasFile)&&(!ey.trim()||(t=ey.trim(),!!"".concat(e.projectName,"\n").concat(e.projectRoot||"","\n").concat(e.customizePath||"","\n").concat(e.content||"").toLowerCase().includes(t.toLowerCase())))}).sort((e,t)=>"name"===eu?e.projectName.localeCompare(t.projectName):"source"===eu?["custom","current","project"].indexOf(K(e))-["custom","current","project"].indexOf(K(t)):"selected"===eu&&Number(t.selected)-Number(e.selected)||Date.parse(t.mtime||"")-Date.parse(e.mtime||"")),e1=e0.find(e=>e.id===ew)||e0[0]||null,e2=eS.filter(e=>e0.some(t=>t.id===e)),e4=(null==eY?void 0:eY.trim())?eD:eR,e3=(e,t,r)=>{let o=U(e,t,r);ez(o),eT(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[]}}(o)),eB(""),eO(!1),eM([]),e$(!1)},e8=r=>{if(null==r?void 0:r.projectRoot)return void O(r.projectRoot).then(()=>{t.success(e("common.success")),eq()}).catch(()=>t.error(e("common.error")));let o="new:".concat(Date.now());er(null),ed(!0),es(""),el(""),e3(null,"new",o),ee(!0)},e5=async()=>{if(!ea.trim())return void t.error("请输入名称");ei(!0);try{if(et)await E(et.customizePath,eo,W(et)?ea.trim():void 0),t.success(e("common.success"));else{let r=await R(ea.trim(),eo||"# ".concat(ea.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)}(eF,U({id:r.id,projectId:r.id,projectName:ea.trim(),customizePath:r.id,content:eo,mtime:"",hasFile:!0,isCurrent:!1,selected:!1,source:"custom"},ea.trim())),t.success(e("common.success"))}ee(!1),await eq()}catch(r){t.error(e("common.error"))}finally{ei(!1)}},e6=async e=>{let t=Array.from(new Set([...e_,...eR.filter(t=>e.includes("@".concat(t.relativePath))).map(e=>e.relativePath)])).slice(0,3),r=[];for(let e of t){let t=await _(e);t&&r.push({relativePath:e,content:t})}return r},e7=async()=>{let e=eP.trim();if(!e||eE)return;let r=[...ek,{role:"user",content:e}];eT(r),eB(""),e$(!1),eO(!0);try{let t=await e6(e),o=await J({name:ea||(null==et?void 0:et.projectName)||"未命名提示词",content:eo,message:e,history:ek,references:t});eT([...r,{role:"assistant",content:o.content||"AI 未返回内容"}])}catch(e){t.error(e instanceof Error?e.message:"AI 对话失败,请检查模型配置"),eT(r)}finally{eO(!1)}},e9=async(r,o)=>{let l=o?Array.from(new Set([...Q.filter(e=>e.selected).map(e=>e.id),r.id])):Q.filter(e=>e.selected&&e.id!==r.id).map(e=>e.id);try{await I(l),V(e=>e.map(e=>({...e,selected:l.includes(e.id)})))}catch(r){t.error(e("common.error"))}},te=async r=>{let o=Q.filter(e=>e.selected).map(e=>e.id),l=r?Array.from(new Set([...o,...e2])):o.filter(e=>!e2.includes(e));try{await I(l),V(e=>e.map(e=>({...e,selected:l.includes(e.id)}))),eA([]),t.success(e("common.success"))}catch(r){t.error(e("common.error"))}},tt=async r=>{try{if(!(await fetch("/api/prompt",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectId:r.projectId,filePath:r.customizePath})})).ok)throw Error("Failed");t.success(e("common.success")),eA(e=>e.filter(e=>e!==r.id)),await eq()}catch(r){t.error(e("common.error"))}},tr=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"custom",r="checked"===e?Q.filter(e=>e2.includes(e.id)):"filtered"===e?e0:eV;L("customize-prompts-".concat(new Date().toISOString().slice(0,10),".json"),X(r)),t.success("已导出 ".concat(r.length," 条提示词"))},to=async e=>{if(e){eC(!0);try{let r=await e.text(),o=JSON.parse(r),l=await D(o);t.success("已导入 ".concat(l.imported," 条提示词")),await eq()}catch(e){t.error("导入失败,请确认 JSON 文件格式正确")}finally{eC(!1),eG.current&&(eG.current.value="")}}},tl=t=>{let r=K(t);return(0,o.jsxs)(n.A,{size:4,wrap:!0,children:[(0,o.jsx)(i.A,{color:"custom"===r?"cyan":"current"===r?"green":"project"===r?"blue":"default",style:{margin:0},children:e("custom"===r?"prompt.customPrompt":"current"===r?"prompt.currentProject":"project"===r?"prompt.otherProjects":"prompt.allPrompts")}),t.selected&&(0,o.jsx)(i.A,{color:"purple",style:{margin:0},children:e("prompt.selected")}),!t.hasFile&&(0,o.jsx)(i.A,{style:{margin:0},children:e("prompt.missingFileStatus")})]})},ta=r=>(0,o.jsxs)("div",{className:"flex items-center gap-1.5",children:[r.hasFile&&(0,o.jsx)(c.A,{checked:r.selected,onChange:e=>{e9(r,e.target.checked)},className:"mr-1",children:e("prompt.selected")}),!r.hasFile&&r.projectRoot&&(0,o.jsx)(d.Ay,{size:"small",icon:(0,o.jsx)(j.A,{}),onClick:()=>e8(r),children:e("common.add")}),r.hasFile&&(0,o.jsx)(d.Ay,{size:"small",icon:(0,o.jsx)(w.A,{}),onClick:()=>{er(r),ed(!1),es(r.projectName),el(r.content||""),e3(r,r.projectName),ee(!0)},children:e("common.edit")}),r.hasFile&&(0,o.jsx)(d.Ay,{size:"small",icon:(0,o.jsx)(b.A,{}),onClick:()=>{var e;return e=r,void(L("customize-prompt-".concat(e.projectName.trim().replace(/[\\/:*?"<>|]/g,"-").slice(0,80)||"untitled","-").concat(new Date().toISOString().slice(0,10),".json"),X([e])),t.success("已导出 1 条提示词"))},children:"导出"}),(0,o.jsx)(p.A,{title:W(r)?"删除自定义提示词?":"删除项目记录及文件?",onConfirm:()=>{tt(r)},children:(0,o.jsx)(d.Ay,{size:"small",danger:!0,icon:(0,o.jsx)(S.A,{})})})]});return r?(0,o.jsxs)("div",{className:"space-y-12",children:[(0,o.jsx)(m.A,{active:!0,title:!0,paragraph:{rows:1}}),(0,o.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,o.jsx)("div",{className:"p-4 border border-[var(--borderColor)]",children:(0,o.jsx)(m.A,{active:!0,paragraph:{rows:4}})},t))})]}):(0,o.jsxs)("div",{className:"space-y-8 animateFadeIn",children:[(0,o.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-end justify-between gap-4 pb-6 mb-2",children:[(0,o.jsxs)("div",{children:[(0,o.jsxs)("h1",{className:"text-3xl font-extrabold tracking-tight text-[var(--colorText)] mb-2.5 flex items-center gap-2",children:[(0,o.jsx)(A.A,{className:"text-[var(--colorAccent)]"}),e("nav.promptManagement")]}),(0,o.jsx)("p",{className:"text-sm text-[var(--colorTextSecondary)]",children:e("prompt.description")})]}),(0,o.jsxs)(n.A,{wrap:!0,children:[eQ&&(0,o.jsxs)(i.A,{color:"green",style:{lineHeight:"22px"},className:"border-0",children:[(0,o.jsx)(N.A,{})," ",eQ.projectRoot]}),(0,o.jsx)("input",{ref:eG,type:"file",accept:"application/json,.json",style:{display:"none"},onChange:e=>{var t;to(null==(t=e.target.files)?void 0:t[0])}}),(0,o.jsx)(d.Ay,{icon:(0,o.jsx)(C.A,{}),loading:eN,onClick:()=>{var e;return null==(e=eG.current)?void 0:e.click()},className:"rounded-lg",children:e("prompt.import")}),(0,o.jsx)(d.Ay,{icon:(0,o.jsx)(b.A,{}),disabled:0===e0.length,onClick:()=>tr("filtered"),className:"rounded-lg",children:e("prompt.exportFiltered")}),(0,o.jsx)(d.Ay,{type:"primary",icon:(0,o.jsx)(j.A,{}),onClick:()=>e8(),className:"shadow-none rounded-lg",children:e("prompt.createPrompt")})]})]}),(0,o.jsxs)("div",{className:"flex flex-wrap items-center gap-3 bg-[var(--colorBgContainer)] p-3 rounded-xl shadow-sm mb-6",children:[(0,o.jsx)(h.A,{prefix:(0,o.jsx)(k.A,{className:"text-[var(--colorTextTertiary)]"}),allowClear:!0,placeholder:e("prompt.searchPrompt"),value:ey,onChange:e=>ej(e.target.value),style:{width:280},variant:"borderless",className:"bg-[var(--colorBgHover)] rounded-lg hover:bg-[var(--colorFillAlter)] focus:bg-[var(--colorBgElevated)] transition-colors"}),(0,o.jsx)("div",{className:"h-4 w-[1px] bg-[var(--borderColorStrong)] mx-1"}),(0,o.jsx)(x.A,{value:ep,onChange:em,style:{width:150},variant:"borderless",options:[{label:"".concat(e("prompt.allPrompts")," (").concat(eZ.all,")"),value:"all"},{label:"".concat(e("prompt.customPrompt")," (").concat(eZ.custom,")"),value:"custom"},{label:"".concat(e("prompt.currentProject")," (").concat(eZ.current,")"),value:"current"},{label:"".concat(e("prompt.otherProjects")," (").concat(eZ.project,")"),value:"project"}]}),(0,o.jsx)(x.A,{value:eh,onChange:ex,style:{width:130},variant:"borderless",options:[{label:e("prompt.promptStatus"),value:"all"},{label:"".concat(e("prompt.selected")," (").concat(eZ.selected,")"),value:"selected"},{label:"".concat(e("prompt.unselected")," (").concat(eZ.unselected,")"),value:"unselected"},{label:"".concat(e("prompt.hasFileStatus")," (").concat(eZ.hasFile,")"),value:"hasFile"},{label:"".concat(e("prompt.missingFileStatus")," (").concat(eZ.missingFile,")"),value:"missingFile"}]}),(0,o.jsx)(x.A,{value:eu,onChange:eg,style:{width:140},variant:"borderless",options:[{label:e("prompt.sortByMtime"),value:"mtime"},{label:e("prompt.sortByName"),value:"name"},{label:e("prompt.sortBySource"),value:"source"},{label:e("prompt.sortBySelected"),value:"selected"}]}),(0,o.jsx)("div",{className:"flex-1"}),(0,o.jsx)(u.A,{value:ef,onChange:e=>ev(e),options:[{label:(0,o.jsx)(T.A,{}),value:"list"},{label:(0,o.jsx)(F.A,{}),value:"card"}],className:"bg-[var(--colorBgHover)] p-1 rounded-lg"})]}),(0,o.jsx)("div",{className:"grid grid-cols-1 gap-8 items-start",children:(0,o.jsxs)("div",{className:"min-w-0",children:[e2.length>0&&(0,o.jsxs)("div",{className:"flex items-center gap-3 flex-wrap p-4 mb-6 bg-[var(--colorBgHover)] rounded-xl shadow-sm",children:[(0,o.jsxs)("span",{className:"font-semibold text-sm",children:["已选择 ",(0,o.jsx)("span",{className:"text-[var(--colorAccent)]",children:e2.length})," 项"]}),(0,o.jsx)("div",{className:"h-4 w-[1px] bg-[var(--borderColorStrong)] mx-1"}),(0,o.jsx)(d.Ay,{size:"small",onClick:()=>{te(!0)},children:e("prompt.batchSelect")}),(0,o.jsx)(d.Ay,{size:"small",onClick:()=>{te(!1)},children:e("prompt.cancelSelect")}),(0,o.jsx)(d.Ay,{size:"small",icon:(0,o.jsx)(b.A,{}),onClick:()=>tr("checked"),children:e("prompt.exportSelected")}),(0,o.jsx)(d.Ay,{size:"small",danger:!0,onClick:()=>eA([]),children:e("prompt.clearSelect")})]}),0===e0.length?(0,o.jsx)("div",{className:"py-32 text-center border border-dashed border-[var(--borderColor)] rounded-2xl bg-[var(--colorBgHover)]",children:(0,o.jsx)(g.A,{image:g.A.PRESENTED_IMAGE_SIMPLE,description:(0,o.jsx)("span",{className:"text-[var(--colorTextSecondary)]",children:ey||"all"!==eh?e("prompt.noMatchDesc"):e("prompt.noPromptInGroup")})})}):"list"===ef?(0,o.jsx)("div",{className:"flex flex-col gap-3",children:e0.map(e=>{let t=$(e,180),r=(null==e1?void 0:e1.id)===e.id;return(0,o.jsxs)("div",{onClick:()=>eb(e.id),className:"group grid grid-cols-[28px_1fr_auto] gap-4 items-center p-4 rounded-xl transition-all cursor-pointer ".concat(r?"bg-[var(--colorBgSelected)] shadow-md":"bg-transparent hover:bg-[var(--colorBgHover)] hover:shadow-sm"),children:[(0,o.jsx)(c.A,{checked:eS.includes(e.id),onClick:e=>e.stopPropagation(),onChange:t=>eA(r=>t.target.checked?Array.from(new Set([...r,e.id])):r.filter(t=>t!==e.id))}),(0,o.jsxs)("div",{className:"min-w-0",children:[(0,o.jsxs)("div",{className:"flex items-center gap-3 mb-1.5",children:[(0,o.jsx)(A.A,{className:e.isCurrent?"text-[var(--colorOk)] text-lg":"text-[var(--colorTextSecondary)] text-lg"}),(0,o.jsx)("span",{className:"font-semibold truncate text-[var(--colorText)] text-base",children:e.projectName}),tl(e)]}),(0,o.jsxs)("div",{className:"text-xs text-[var(--colorTextTertiary)] truncate flex items-center gap-1.5 font-medium",children:[(0,o.jsx)(N.A,{})," ",e.projectRoot||e.customizePath||"本地提示词",(0,o.jsx)("span",{className:"text-[var(--colorBorderSecondary)]",children:"|"}),G(e.mtime)]}),t&&(0,o.jsx)("div",{className:"mt-2.5 bg-[var(--colorFillAlter)] p-2.5 rounded-lg overflow-hidden",children:(0,o.jsx)("div",{className:"text-sm text-[var(--colorTextSecondary)] line-clamp-2 leading-normal",children:t})})]}),(0,o.jsx)("div",{onClick:e=>e.stopPropagation(),className:"transition-opacity flex items-center ".concat(r?"opacity-100":"opacity-0 group-hover:opacity-100"),children:ta(e)})]},e.id)})}):(0,o.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-5",children:e0.map(e=>{let t=$(e,180),r=(null==e1?void 0:e1.id)===e.id;return(0,o.jsxs)("div",{onClick:()=>eb(e.id),className:"group flex flex-col p-5 rounded-2xl transition-all cursor-pointer ".concat(r?"bg-[var(--colorBgSelected)] shadow-md":"bg-[var(--colorBgContainer)] hover:bg-[var(--colorBgHover)] shadow-sm hover:shadow-md"),children:[(0,o.jsx)("div",{className:"flex items-start justify-between gap-3 mb-4 min-w-0",children:(0,o.jsxs)("div",{className:"flex items-center gap-3 min-w-0 flex-1",children:[(0,o.jsx)(c.A,{checked:eS.includes(e.id),onClick:e=>e.stopPropagation(),onChange:t=>eA(r=>t.target.checked?Array.from(new Set([...r,e.id])):r.filter(t=>t!==e.id))}),(0,o.jsx)(A.A,{className:e.isCurrent?"text-[var(--colorOk)] text-lg":"text-[var(--colorTextSecondary)] text-lg"}),(0,o.jsx)("span",{className:"font-bold text-base text-[var(--colorText)] truncate mb-1",children:e.projectName})]})}),(0,o.jsx)("div",{className:"mb-3",children:tl(e)}),(0,o.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,o.jsx)(N.A,{}),e.projectRoot||e.customizePath||"本地提示词"]}),(0,o.jsx)("div",{className:"flex-1 bg-[var(--colorFillAlter)] p-3 rounded-xl mb-4 overflow-hidden",children:t?(0,o.jsx)("div",{className:"text-sm text-[var(--colorTextSecondary)] line-clamp-3 leading-normal",children:t}):(0,o.jsx)("div",{className:"text-sm text-[var(--colorTextQuaternary)] italic",children:"暂无内容预览"})}),(0,o.jsxs)("div",{className:"mt-auto pt-4 flex justify-between items-center",onClick:e=>e.stopPropagation(),children:[(0,o.jsx)("span",{className:"text-xs font-medium text-[var(--colorTextTertiary)] bg-[var(--colorFillSecondary)] px-2 py-1 rounded",children:G(e.mtime)}),(0,o.jsx)("div",{className:"transition-opacity ".concat(r?"opacity-100":"opacity-0 group-hover:opacity-100"),children:ta(e)})]})]},e.id)})})]})}),(0,o.jsxs)(f.A,{title:ec?e("prompt.createPrompt"):et&&W(et)?"".concat(e("prompt.customPrompt")," — ").concat(ea||et.projectName):"".concat(e("prompt.currentProject")," — ").concat((null==et?void 0:et.projectName)||""),open:Z,onClose:()=>ee(!1),styles:{wrapper:{width:1080},mask:{pointerEvents:"none"},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,o.jsxs)(n.A,{children:[(0,o.jsx)(d.Ay,{onClick:()=>ee(!1),children:e("common.cancel")}),(0,o.jsx)(d.Ay,{type:"primary",loading:en,onClick:()=>{e5()},children:e("common.save")})]}),children:[(0,o.jsxs)("div",{style:{minHeight:0,display:"flex",flexDirection:"column"},children:[(0,o.jsx)("div",{style:{marginBottom:16},children:ec||et&&W(et)?(0,o.jsx)(h.A,{size:"large",placeholder:e("prompt.promptName"),value:ea,onChange:e=>es(e.target.value),style:{maxWidth:"100%",fontWeight:500,fontSize:16}}):null}),(0,o.jsx)(h.A.TextArea,{value:eo,onChange:e=>el(e.target.value),style:{flex:1,minHeight:280,fontFamily:"SF Mono, Monaco, Consolas, monospace",fontSize:13,resize:"none"}})]}),(0,o.jsxs)("div",{style:{minHeight:0,border:"1px solid var(--colorBorderSecondary)",borderRadius:10,background:"var(--colorBgContainer)",display:"flex",flexDirection:"column",overflow:"hidden",boxShadow:"0 8px 24px rgba(15, 23, 42, 0.06)"},children:[(0,o.jsxs)("div",{style:{padding:"10px 12px",borderBottom:"1px solid var(--colorBorderSecondary)",display:"flex",alignItems:"center",justifyContent:"space-between",gap:8},children:[(0,o.jsxs)(n.A,{size:6,children:[(0,o.jsx)(z.A,{style:{color:"var(--colorAccent)"}}),(0,o.jsx)("span",{style:{fontWeight:600},children:e("prompt.aiPromptAssistant")})]}),(0,o.jsxs)(n.A,{size:6,children:[ek.length>0&&(0,o.jsx)(d.Ay,{size:"small",onClick:()=>eT([]),children:e("prompt.clearHistory")}),eE?(0,o.jsx)(i.A,{color:"processing",style:{margin:0},children:e("prompt.generating")}):(0,o.jsx)(i.A,{color:"blue",style:{margin:0},children:e("prompt.canConverse")})]})]}),(0,o.jsx)("div",{ref:eX,style:{flex:1,minHeight:0,overflowY:"auto",padding:14,background:"var(--colorFillAlter)"},children:0!==ek.length||eE?(0,o.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:12,width:"100%"},children:[ek.map((r,l)=>{let a="user"===r.role;return(0,o.jsx)("div",{style:{display:"flex",justifyContent:a?"flex-end":"flex-start"},children:(0,o.jsxs)("div",{style:{maxWidth:"78%",padding:"10px 12px",borderRadius:12,background:a?"var(--colorFillSecondary)":"var(--colorBgContainer)",color:"var(--colorText)",border:"1px solid var(--colorBorderSecondary)",whiteSpace:"pre-wrap",lineHeight:1.7,fontSize:13,transition:"all .2s ease"},children:[r.content,!a&&(0,o.jsx)("div",{style:{display:"flex",justifyContent:"flex-end",marginTop:8},children:(0,o.jsx)(d.Ay,{size:"small",type:"primary",onClick:()=>{el(r.content),t.success("已应用到编辑内容,请确认后保存")},children:e("prompt.apply")})})]})},"".concat(r.role,"-").concat(l))}),eE&&(0,o.jsx)("div",{style:{display:"flex",justifyContent:"flex-start"},children:(0,o.jsxs)("div",{style:{padding:"10px 12px",borderRadius:12,background:"var(--colorBgContainer)",border:"1px solid var(--colorBorderSecondary)",color:"var(--colorTextSecondary)",fontSize:13},children:[(0,o.jsx)(v.A,{size:"small",style:{marginRight:8}}),e("prompt.aiAnalyzing")]})})]}):(0,o.jsx)(g.A,{image:g.A.PRESENTED_IMAGE_SIMPLE,description:e("prompt.mentionRecallHint")})}),(0,o.jsx)(y.A,{style:{margin:0}}),(0,o.jsxs)("div",{style:{padding:12},children:[e_.length>0&&(0,o.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:4,marginBottom:8},children:e_.map(e=>(0,o.jsxs)(i.A,{closable:!0,onClose:()=>eM(t=>t.filter(t=>t!==e)),style:{margin:0,maxWidth:360,overflow:"hidden",textOverflow:"ellipsis"},children:["@",e]},e))}),eU&&(0,o.jsxs)("div",{style:{maxHeight:260,overflowY:"auto",marginBottom:8,border:"1px solid var(--colorBorderSecondary)",borderRadius:12,background:"var(--colorBgElevated, var(--colorBgContainer))",boxShadow:"0 16px 40px rgba(15, 23, 42, 0.14)"},children:[(0,o.jsxs)("div",{style:{position:"sticky",top:0,zIndex:1,padding:"10px 12px",borderBottom:"1px solid var(--colorBorderSecondary)",background:"var(--colorBgElevated, var(--colorBgContainer))",display:"flex",justifyContent:"space-between",gap:12,alignItems:"center"},children:[(0,o.jsxs)("div",{children:[(0,o.jsx)("div",{style:{color:"var(--colorText)",fontSize:13,fontWeight:700},children:e("prompt.recallKbFiles")}),(0,o.jsx)("div",{style:{color:"var(--colorTextSecondary)",fontSize:11},children:e("prompt.recallLimitHint")})]}),(0,o.jsx)(i.A,{color:eY?"blue":"default",style:{margin:0,maxWidth:240,overflow:"hidden",textOverflow:"ellipsis"},children:eY?"@".concat(eY):e("prompt.inputAtKeyword")})]}),eJ?(0,o.jsxs)("div",{style:{padding:14,color:"var(--colorTextSecondary)",fontSize:12},children:[(0,o.jsx)(v.A,{size:"small",style:{marginRight:8}}),e("prompt.loadingKbFiles")]}):0===eR.length?(0,o.jsx)("div",{style:{padding:14,color:"var(--colorTextSecondary)",fontSize:12},children:e("prompt.noRecallableKbFiles")}):0===e4.length?(0,o.jsx)("div",{style:{padding:14,color:"var(--colorTextSecondary)",fontSize:12},children:eW?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(v.A,{size:"small",style:{marginRight:8}}),e("prompt.searchingKbContent")]}):e("prompt.noMatchingKbFiles")}):(0,o.jsxs)(o.Fragment,{children:[eW&&(0,o.jsxs)("div",{style:{padding:"8px 12px",color:"var(--colorTextSecondary)",fontSize:12,borderBottom:"1px solid var(--colorBorderSecondary)"},children:[(0,o.jsx)(v.A,{size:"small",style:{marginRight:8}}),e("prompt.continueSearchingKb")]}),e4.slice(0,30).map(t=>(0,o.jsxs)("div",{onMouseDown:e=>{var r;e.preventDefault(),r=t.relativePath,eM(e=>e.includes(r)?e:[...e,r]),eB(e=>e.replace(/(^|\s)@([^\s@]*)$/,"$1@".concat(r," "))),e$(!1)},style:{padding:"10px 12px",cursor:"pointer",borderBottom:"1px solid var(--colorBorderSecondary)",fontSize:12,display:"grid",gridTemplateColumns:"22px minmax(0, 1fr) auto",gap:10,alignItems:"center"},children:[(0,o.jsx)("div",{style:{width:22,height:22,borderRadius:7,background:"var(--colorFillSecondary)",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,o.jsx)(A.A,{style:{color:"var(--colorAccent)"}})}),(0,o.jsxs)("div",{style:{minWidth:0},children:[(0,o.jsx)("div",{style:{color:"var(--colorText)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontWeight:700},children:t.relativePath}),(0,o.jsxs)("div",{style:{color:"var(--colorTextSecondary)",fontSize:11,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[t.category||e("prompt.unclassified")," \xb7 ",t.format||e("prompt.unknownFormat"),"number"==typeof t.score?" \xb7 score ".concat(t.score.toFixed(2)):""]})]}),(0,o.jsxs)(n.A,{size:4,children:[(0,o.jsx)(i.A,{color:"content"===t.matchedBy?"purple":"disk"===t.matchedBy?"orange":"blue",style:{margin:0},children:"content"===t.matchedBy?e("prompt.contentMatch"):"disk"===t.matchedBy?e("prompt.diskFile"):e("prompt.fileMatch")}),(0,o.jsx)(i.A,{style:{margin:0},children:t.status})]})]},t.relativePath))]})]}),(0,o.jsxs)("div",{style:{display:"flex",gap:8,alignItems:"flex-end"},children:[(0,o.jsx)(h.A.TextArea,{value:eP,onChange:e=>{let t=e.target.value;eB(t),e$(null!==Y(t))},onFocus:()=>e$(null!==Y(eP)),onPressEnter:e=>{e.shiftKey||(e.preventDefault(),e7())},disabled:eE,placeholder:e("prompt.mentionRecallPlaceholder"),autoSize:{minRows:2,maxRows:5},style:{fontSize:13,lineHeight:1.6}}),(0,o.jsx)(d.Ay,{type:"primary",icon:(0,o.jsx)(P.A,{}),loading:eE,disabled:!eP.trim(),onClick:()=>{e7()},children:e("prompt.send")})]})]})]})]})]})}}},e=>{e.O(0,[717,883,44,563,195,187,636,593,792],()=>e(e.s=27549)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[979],{9137:(e,r,t)=>{"use strict";t.d(r,{Ay:()=>C});var a=t(9750),s=t(97109),o=t(42644),l=t(10252),n=t(74567),c=t(48921),i=t(98379),d=t(3638),x=t(632),m=t(34475),g=t(52093),p=t(60815),u=t(5741);let f=null,h=e=>e(),v=[],b={};function y(){let{getContainer:e,duration:r,rtl:t,maxCount:a,top:s,stack:o}=b,l=e?.()||document.body;return{getContainer:()=>l,duration:r,rtl:t,maxCount:a,top:s,stack:o}}let w=s.forwardRef((e,r)=>{let{messageConfig:t,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)({...t,prefixCls:c,...i.message});return s.useImperativeHandle(r,()=>{let e={...d};return Object.keys(e).forEach(r=>{e[r]=(...e)=>(a(),d[r].apply(d,e))}),{instance:e,sync:a}}),x}),j=s.forwardRef((e,r)=>{let[t,a]=s.useState(y),o=()=>{a(y)};s.useEffect(o,[]);let l=(0,c.cr)(),n=l.getRootPrefixCls(),i=l.getIconPrefixCls(),d=l.getTheme(),x=s.createElement(w,{ref:r,sync:o,messageConfig:t});return s.createElement(c.Ay,{prefixCls:n,iconPrefixCls:i,theme:d},l.holderRender?l.holderRender(x):x)}),N=()=>{if(!f){let e=document.createDocumentFragment(),r={fragment:e};f=r,h(()=>{(0,o.XX)(s.createElement(j,{ref:e=>{let{instance:t,sync:a}=e||{};Promise.resolve().then(()=>{!r.instance&&t&&(r.instance=t,r.sync=a,N())})}}),e)});return}f.instance&&(v.forEach(e=>{let{type:r,skipped:t}=e;if(!t)switch(r){case"open":h(()=>{let r=f.instance.open({...b,...e.config});r?.then(e.resolve),e.setCloseFn(r)});break;case"destroy":h(()=>{f?.instance.destroy(e.key)});break;default:h(()=>{var t;let s=(t=f.instance)[r].apply(t,(0,a.A)(e.args));s?.then(e.resolve),e.setCloseFn(s)})}}),v=[])},A={open:function(e){let r=(0,u.E)(r=>{let t,a={type:"open",config:e,resolve:r,setCloseFn:e=>{t=e}};return v.push(a),()=>{t?h(()=>{t()}):a.skipped=!0}});return N(),r},destroy:e=>{v.push({type:"destroy",key:e}),N()},config:function(e){b={...b,...e},h(()=>{f?.sync?.()})},useMessage:p.A,_InternalPanelDoNotUseOrYouWillBeFired:m.Ay,_InternalListDoNotUseOrYouWillBeFired:e=>{let{items:r,classNames:t,style:a}=e,{getPrefixCls:o}=(0,n.TP)("message"),l=o("message"),c=(0,x.A)(l),[p,u]=(0,g.A)(l,c),f=`${l}-notice`,h=r.map(e=>{let{content:r,duration:t,key:a,type:s}=e,o=s?`${f}-icon-${s}`:void 0;return{key:a,duration:t,icon:(0,m.HC)(s),title:r,className:`${f}-${s}`,classNames:{wrapper:`${l}-${s}`,icon:o}}});return s.createElement(i.qb,{prefixCls:l,placement:"top",configList:h,className:(0,d.$)(p,u,c),classNames:{...t,wrapper:t?.wrapper,title:t?.title},style:a,stack:!1})}};["success","info","warning","error","loading"].forEach(e=>{A[e]=(...r)=>(function(e,r){(0,c.cr)();let t=(0,u.E)(t=>{let a,s={type:e,args:r,resolve:t,setCloseFn:e=>{a=e}};return v.push(s),()=>{a?h(()=>{a()}):s.skipped=!0}});return N(),t})(e,r)});let C=A},12446:(e,r)=>{"use strict";r.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,r)=>{"use strict";r.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"}},29606:(e,r,t)=>{"use strict";t.r(r),t.d(r,{default:()=>A});var a=t(65321),s=t(97109),o=t(35292),l=t(9137),n=t(11702),c=t(88762),i=t(7576),d=t(85114),x=t(26171),m=t(21289),g=t(84253),p=t(30486),u=t(99811),f=t(58209),h=t(12446),v=t(88483);function b(){return(b=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e}).apply(this,arguments)}let y=s.forwardRef((e,r)=>s.createElement(v.A,b({},e,{ref:r,icon:h.A})));var w=t(48321),j=t(6578);let{Text:N}=o.A;function A(){let e=(0,w.Vr)(),[r,t]=(0,s.useState)([]),[o,h]=(0,s.useState)(!0),[v,b]=(0,s.useState)(""),A=async()=>{h(!0);try{t((await (0,j.oH)(500)).logs)}catch(e){l.Ay.error(e instanceof Error?e.message:"加载日志失败")}finally{h(!1)}};(0,s.useEffect)(()=>{A()},[]);let C=(0,s.useMemo)(()=>{let e=v.trim().toLowerCase();return e?r.filter(r=>[r.id,r.level,r.source,r.functionName,r.message,r.stack].filter(Boolean).some(r=>String(r).toLowerCase().includes(e))):r},[v,r]),k=[{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)(n.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)(N,{copyable:!0,className:"text-[10px] font-mono text-[var(--colorTextTertiary)]",children:e.slice(0,8)})}];return o&&0===r.length?(0,a.jsxs)("div",{className:"space-y-8 animateFadeIn",children:[(0,a.jsx)(c.A,{active:!0,title:!0,paragraph:{rows:1}}),(0,a.jsx)(c.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)(i.A,{placeholder:e("logs.searchLogs"),prefix:(0,a.jsx)(p.A,{className:"text-[var(--colorTextTertiary)]"}),value:v,onChange:e=>b(e.target.value),allowClear:!0,className:"w-[260px] bg-[var(--colorBgHover)] border-transparent"}),(0,a.jsx)(d.Ay,{icon:(0,a.jsx)(u.A,{}),loading:o,onClick:()=>void A(),className:"shadow-none",children:e("logs.refresh")}),(0,a.jsx)(x.A,{title:e("logs.clearConfirm"),onConfirm:()=>{(async()=>{await (0,j.hH)(),l.Ay.success(e("common.success")),await A()})()},children:(0,a.jsx)(d.Ay,{danger:!0,icon:(0,a.jsx)(f.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)(y,{})," ",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)(m.A,{rowKey:"id",loading:o,dataSource:C,columns:k,size:"middle",className:"h-full modern-table",scroll:{y:"calc(100vh - 280px)"},locale:{emptyText:(0,a.jsx)(g.A,{description:e("logs.noLogsFound"),className:"py-20"})},pagination:!1,rowClassName:"hover:bg-[var(--colorBgHover)] transition-colors cursor-pointer",expandable:{expandedRowRender:r=>(0,a.jsxs)("div",{className:"flex flex-col gap-4 p-4 bg-[var(--colorBgHover)]/50 border-t border-[var(--borderColor)]",children:[r.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:r.functionName})]}),r.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(r.request,null,2)})]}),void 0!==r.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(r.meta,null,2)})]}),r.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:r.stack})]})]})}})})]})}},39214:(e,r,t)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/system/logs",function(){return t(29606)}])},99811:(e,r,t)=>{"use strict";t.d(r,{A:()=>n});var a=t(97109),s=t(14995),o=t(88483);function l(){return(l=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e}).apply(this,arguments)}let n=a.forwardRef((e,r)=>a.createElement(o.A,l({},e,{ref:r,icon:s.A})))}},e=>{e.O(0,[717,883,665,44,563,7,289,195,636,593,792],()=>e(e.s=39214)),_N_E=e.O()}]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@customize-agent/server",
3
- "version": "4.2.2",
3
+ "version": "4.2.3",
4
4
  "description": "Customize Agent Web 管理控制台",
5
5
  "exports": {
6
6
  "./package.json": "./package.json"
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[563],{23830:(e,t)=>{t.A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 298.4H521L403.7 186.2a8.15 8.15 0 00-5.5-2.2H144c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V330.4c0-17.7-14.3-32-32-32zM840 768H184V256h188.5l119.6 114.4H840V768z"}}]},name:"folder",theme:"outlined"}},29606:(e,t,n)=>{n.d(t,{A:()=>l});var i=n(97109),o=n(23830),a=n(88483);function r(){return(r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e}).apply(this,arguments)}let l=i.forwardRef((e,t)=>i.createElement(a.A,r({},e,{ref:t,icon:o.A})))},42700:(e,t,n)=>{let i;n.d(t,{A:()=>z});var o=n(97109),a=n(3638),r=n(92162),l=n(74567),s=n(27273),c=n(52690),d=n(42644);let m=80*Math.PI,p=e=>{let{dotClassName:t,style:n,hasCircleCls:i}=e;return o.createElement("circle",{className:(0,a.$)(`${t}-circle`,{[`${t}-circle-bg`]:i}),r:40,cx:50,cy:50,strokeWidth:20,style:n})},u=({percent:e,prefixCls:t})=>{let n=`${t}-dot`,i=`${n}-holder`,r=`${i}-hidden`,[l,s]=o.useState(!1);(0,d.Nf)(()=>{0!==e&&s(!0)},[0!==e]);let c=Math.max(Math.min(e,100),0);if(!l)return null;let u={strokeDashoffset:`${m/4}`,strokeDasharray:`${m*c/100} ${m*(100-c)/100}`};return o.createElement("span",{className:(0,a.$)(i,`${n}-progress`,{[r]:c<=0})},o.createElement("svg",{viewBox:"0 0 100 100",role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":c},o.createElement(p,{dotClassName:n,hasCircleCls:!0}),o.createElement(p,{dotClassName:n,style:u})))};function f(e){let{prefixCls:t,percent:n=0,className:i,style:r}=e,l=`${t}-dot`,s=`${l}-holder`,c=`${s}-hidden`;return o.createElement(o.Fragment,null,o.createElement("span",{className:(0,a.$)(s,i,n>0&&c),style:r},o.createElement("span",{className:(0,a.$)(l,`${t}-dot-spin`)},[1,2,3,4].map(e=>o.createElement("i",{className:`${t}-dot-item`,key:e})))),o.createElement(u,{prefixCls:t,percent:n}))}function h(e){let{prefixCls:t,indicator:n,percent:i,className:r,style:l}=e,s=`${t}-dot`;return n&&o.isValidElement(n)?(0,c.Ob)(n,e=>({className:(0,a.$)(e.className,s,r),style:{...e.style,...l},percent:i})):o.createElement(f,{prefixCls:t,percent:i,className:r,style:l})}var $=n(15561),g=n(7961),v=n(10540),y=n(28403);let b=new $.Mo("antSpinMove",{to:{opacity:1}}),E=new $.Mo("antRotate",{to:{transform:"rotate(405deg)"}}),N=(0,v.OF)("Spin",e=>{let t=(0,y.oX)(e,{spinDotDefault:e.colorTextDescription});return[(e=>{let{componentCls:t}=e,n=`${t}-section`;return{[t]:{...(0,g.dF)(e),position:"relative","&-rtl":{direction:"rtl"},[`&${n}, ${n}`]:{display:"flex",alignItems:"center",flexDirection:"column",gap:e.paddingSM,color:e.colorPrimary},[`&${n}`]:{display:"inline-flex"},[n]:{position:"absolute",top:"50%",left:{_skip_check_:!0,value:"50%"},transform:"translate(-50%, -50%)",zIndex:1},[`${t}-description`]:{fontSize:e.fontSize,lineHeight:1},[`${t}-container`]:{position:"relative",transition:`opacity ${e.motionDurationSlow}`,"&::after":{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,zIndex:10,width:"100%",height:"100%",background:e.colorBgContainer,opacity:0,transition:`all ${e.motionDurationSlow}`,content:'""',pointerEvents:"none"}},"&-spinning":{[`${t}-description`]:{textShadow:`0 0px 5px ${e.colorBgContainer}`},[`${t}-container`]:{clear:"both",opacity:.5,userSelect:"none",pointerEvents:"none","&::after":{opacity:.4,pointerEvents:"auto"}}},"&-fullscreen":{position:"fixed",inset:0,backgroundColor:e.colorBgMask,zIndex:e.zIndexPopupBase,opacity:0,pointerEvents:"none",transition:`all ${e.motionDurationMid}`,[`&${t}-spinning`]:{opacity:1,pointerEvents:"auto"},[n]:{color:e.colorWhite,[`${t}-description`]:{color:e.colorTextLightSolid}}}}}})(t),(e=>{let{componentCls:t,antCls:n,motionDurationSlow:i}=e,[o,a]=(0,v.PN)(n,"spin");return{[t]:{[o("dot-holder-size")]:e.dotSize,[o("dot-item-size")]:`calc((${a("dot-holder-size")} - ${e.marginXXS} / 2) / 2)`,[`${t}-dot`]:{"&-holder":{width:"1em",height:"1em",fontSize:a("dot-holder-size"),display:"inline-block",transition:["transform","opacity"].map(e=>`${e} ${i} ease`).join(", "),transformOrigin:"50% 50%",lineHeight:1,"&-hidden":{transform:"scale(0.3)",opacity:0}},position:"relative",display:"inline-block",fontSize:a("dot-holder-size"),width:"1em",height:"1em","&-spin":{transform:"rotate(45deg)",animationName:E,animationDuration:"1.2s",animationIterationCount:"infinite",animationTimingFunction:"linear"},"&-item":{position:"absolute",display:"block",width:a("dot-item-size"),height:a("dot-item-size"),background:"currentColor",borderRadius:"100%",transform:"scale(0.75)",transformOrigin:"50% 50%",opacity:.3,animationName:b,animationDuration:"1s",animationIterationCount:"infinite",animationTimingFunction:"linear",animationDirection:"alternate","&:nth-child(1)":{top:0,insetInlineStart:0,animationDelay:"0s"},"&:nth-child(2)":{top:0,insetInlineEnd:0,animationDelay:"0.4s"},"&:nth-child(3)":{insetInlineEnd:0,bottom:0,animationDelay:"0.8s"},"&:nth-child(4)":{bottom:0,insetInlineStart:0,animationDelay:"1.2s"}},"&-progress":{position:"absolute",left:"50%",top:0,transform:"translateX(-50%)"},"&-circle":{strokeLinecap:"round",transition:["stroke-dashoffset","stroke-dasharray","stroke","stroke-width","opacity"].map(e=>`${e} ${i} ease`).join(","),fillOpacity:0,stroke:"currentcolor"},"&-circle-bg":{stroke:e.colorFillSecondary}}}}})(t),(e=>{let{componentCls:t}=e,[n]=(0,v.PN)(e.antCls,"spin");return{[t]:{"&-sm":{[n("dot-holder-size")]:e.dotSizeSM},"&-lg":{[n("dot-holder-size")]:e.dotSizeLG}}}})(t)]},e=>{let{controlHeightLG:t,controlHeight:n}=e;return{contentHeight:400,dotSize:t/2,dotSizeSM:.35*t,dotSizeLG:n}}),S=[[30,.05],[70,.03],[96,.01]],k=e=>{let{prefixCls:t,spinning:n=!0,delay:c=0,className:d,rootClassName:m,size:p,tip:u,description:f,wrapperClassName:$,style:g,children:v,fullscreen:y=!1,indicator:b,percent:E,classNames:k,styles:z,...x}=e,{getPrefixCls:w,direction:D,indicator:C,className:I,style:M,classNames:O,styles:T}=(0,l.TP)("spin"),A=w("spin",t),[F,H]=N(A),[P,_]=o.useState(()=>n&&!function(e,t){return!!e&&!!t&&!Number.isNaN(Number(t))}(n,c)),B=function(e,t){let[n,i]=o.useState(0),a=o.useRef(null),r="auto"===t;return o.useEffect(()=>(r&&e&&(i(0),a.current=setInterval(()=>{i(e=>{let t=100-e;for(let n=0;n<S.length;n+=1){let[i,o]=S[n];if(e<=i)return e+t*o}return e})},200)),()=>{a.current&&(clearInterval(a.current),a.current=null)}),[r,e]),r?n:t}(P,E);o.useEffect(()=>{if(n){let e=function(e,t,n){var i=void 0;return function(e,t,n){var i,o=n||{},a=o.noTrailing,r=void 0!==a&&a,l=o.noLeading,s=void 0!==l&&l,c=o.debounceMode,d=void 0===c?void 0:c,m=!1,p=0;function u(){i&&clearTimeout(i)}function f(){for(var n=arguments.length,o=Array(n),a=0;a<n;a++)o[a]=arguments[a];var l=this,c=Date.now()-p;function f(){p=Date.now(),t.apply(l,o)}function h(){i=void 0}!m&&(s||!d||i||f(),u(),void 0===d&&c>e?s?(p=Date.now(),r||(i=setTimeout(d?h:f,e))):f():!0!==r&&(i=setTimeout(d?h:f,void 0===d?e-c:e)))}return f.cancel=function(e){var t=(e||{}).upcomingOnly;u(),m=!(void 0!==t&&t)},f}(e,t,{debounceMode:!1!==(void 0!==i&&i)})}(c,()=>{_(!0)});return e(),()=>{e?.cancel?.()}}_(!1)},[c,n]);let L=(0,s.A)(e=>p??e),j=f??u,V={...e,size:L,spinning:P,tip:j,description:j,fullscreen:y,children:v,percent:B},[R,X]=(0,r.AV)([O,k],[T,z],{props:V}),G=b??C??i,W=void 0!==v,q=W||y,J=o.createElement(o.Fragment,null,o.createElement(h,{className:(0,a.$)(R.indicator),style:X.indicator,prefixCls:A,indicator:G,percent:B}),j&&o.createElement("div",{className:(0,a.$)(`${A}-description`,R.tip,R.description),style:{...X.tip,...X.description}},j));return o.createElement("div",{className:(0,a.$)(A,{[`${A}-sm`]:"small"===L,[`${A}-lg`]:"large"===L,[`${A}-spinning`]:P,[`${A}-rtl`]:"rtl"===D,[`${A}-fullscreen`]:y},m,R.root,y&&R.mask,q?$:[`${A}-section`,R.section],I,d,F,H),style:{...X.root,...!q?X.section:{},...y?X.mask:{},...M,...g},"aria-live":"polite","aria-busy":P,...x},P&&(q?o.createElement("div",{className:(0,a.$)(`${A}-section`,R.section),style:X.section},J):J),W&&o.createElement("div",{className:(0,a.$)(`${A}-container`,R.container),style:X.container},v))};k.setDefaultIndicator=e=>{i=e};let z=k}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[788],{1611:(e,t)=>{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"}},2256:(e,t,r)=>{r.d(t,{A:()=>a});let a=r(25341).A},11100:(e,t)=>{t.A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M567.1 512l318.5-319.3c5-5 1.5-13.7-5.6-13.7h-90.5c-2.1 0-4.2.8-5.6 2.3l-273.3 274-90.2-90.5c12.5-22.1 19.7-47.6 19.7-74.8 0-83.9-68.1-152-152-152s-152 68.1-152 152 68.1 152 152 152c27.7 0 53.6-7.4 75.9-20.3l90 90.3-90.1 90.3A151.04 151.04 0 00288 582c-83.9 0-152 68.1-152 152s68.1 152 152 152 152-68.1 152-152c0-27.2-7.2-52.7-19.7-74.8l90.2-90.5 273.3 274c1.5 1.5 3.5 2.3 5.6 2.3H880c7.1 0 10.7-8.6 5.6-13.7L567.1 512zM288 370c-44.1 0-80-35.9-80-80s35.9-80 80-80 80 35.9 80 80-35.9 80-80 80zm0 444c-44.1 0-80-35.9-80-80s35.9-80 80-80 80 35.9 80 80-35.9 80-80 80z"}}]},name:"scissor",theme:"outlined"}},14995:(e,t)=>{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"}},15033:(e,t,r)=>{r.d(t,{A:()=>a});let a=(0,r(97109).createContext)({})},21247:(e,t)=>{t.A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M482.2 508.4L331.3 389c-3-2.4-7.3-.2-7.3 3.6V478H184V184h204v128c0 2.2 1.8 4 4 4h60c2.2 0 4-1.8 4-4V144c0-15.5-12.5-28-28-28H144c-15.5 0-28 12.5-28 28v736c0 15.5 12.5 28 28 28h284c15.5 0 28-12.5 28-28V712c0-2.2-1.8-4-4-4h-60c-2.2 0-4 1.8-4 4v128H184V546h140v85.4c0 3.8 4.4 6 7.3 3.6l150.9-119.4a4.5 4.5 0 000-7.2zM880 116H596c-15.5 0-28 12.5-28 28v168c0 2.2 1.8 4 4 4h60c2.2 0 4-1.8 4-4V184h204v294H700v-85.4c0-3.8-4.3-6-7.3-3.6l-151 119.4a4.52 4.52 0 000 7.1l151 119.5c2.9 2.3 7.3.2 7.3-3.6V546h140v294H636V712c0-2.2-1.8-4-4-4h-60c-2.2 0-4 1.8-4 4v168c0 15.5 12.5 28 28 28h284c15.5 0 28-12.5 28-28V144c0-15.5-12.5-28-28-28z"}}]},name:"merge-cells",theme:"outlined"}},23216:(e,t,r)=>{r.d(t,{A:()=>o});var a=r(97109),n=r(29664),l=r(88483);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 o=a.forwardRef((e,t)=>a.createElement(l.A,c({},e,{ref:t,icon:n.A})))},23830:(e,t)=>{t.A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 298.4H521L403.7 186.2a8.15 8.15 0 00-5.5-2.2H144c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V330.4c0-17.7-14.3-32-32-32zM840 768H184V256h188.5l119.6 114.4H840V768z"}}]},name:"folder",theme:"outlined"}},25341:(e,t,r)=>{r.d(t,{A:()=>u});var a=r(97109),n=r(3638),l=r(26047),c=r(19135),o=r(74567),s=r(59609),i=r(15033),f=r(84060);let d=(e,t)=>{let[r,n]=a.useState(()=>(0,l.Kg)(e)?e:"");return a.useEffect(()=>{(()=>{if((0,l.Kg)(e)&&n(e),(0,l.Qd)(e))for(let r=0;r<c.ye.length;r++){let a=c.ye[r];if(!t||!t[a])continue;let l=e[a];if(void 0!==l)return void n(l)}})()},[JSON.stringify(e),t]),r},u=a.forwardRef((e,t)=>{let{prefixCls:r,justify:u,align:v,className:h,style:p,children:m,gutter:g=0,wrap:$,...A}=e,{getPrefixCls:b,direction:y}=a.useContext(o.QO),w=(0,s.A)(!0,null),x=d(v,w),H=d(u,w),E=b("row",r),[O,V]=(0,f.L3)(E),z=function(e,t){let r=[void 0,void 0],a=Array.isArray(e)?e:[e,void 0],n=t||{xs:!0,sm:!0,md:!0,lg:!0,xl:!0,xxl:!0,xxxl:!0};return a.forEach((e,t)=>{if((0,l.Qd)(e))for(let a=0;a<c.ye.length;a++){let l=c.ye[a];if(n[l]&&void 0!==e[l]){r[t]=e[l];break}}else r[t]=e}),r}(g,w),j=(0,n.$)(E,{[`${E}-no-wrap`]:!1===$,[`${E}-${H}`]:H,[`${E}-${x}`]:x,[`${E}-rtl`]:"rtl"===y},h,O,V),M={};z?.[0]&&(M.marginInline=(0,l.Et)(z[0])?`${-(z[0]/2)}px`:`calc(${z[0]} / -2)`);let[N,R]=z;M.rowGap=R;let S=a.useMemo(()=>({gutter:[N,R],wrap:$}),[N,R,$]);return a.createElement(i.A.Provider,{value:S},a.createElement("div",{...A,className:j,style:{...M,...p},ref:t},m))})},26619:(e,t,r)=>{r.d(t,{A:()=>o});var a=r(97109),n=r(1611),l=r(88483);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 o=a.forwardRef((e,t)=>a.createElement(l.A,c({},e,{ref:t,icon:n.A})))},29606:(e,t,r)=>{r.d(t,{A:()=>o});var a=r(97109),n=r(23830),l=r(88483);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 o=a.forwardRef((e,t)=>a.createElement(l.A,c({},e,{ref:t,icon:n.A})))},29664:(e,t)=>{t.A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M908 640H804V488c0-4.4-3.6-8-8-8H548v-96h108c8.8 0 16-7.2 16-16V80c0-8.8-7.2-16-16-16H368c-8.8 0-16 7.2-16 16v288c0 8.8 7.2 16 16 16h108v96H228c-4.4 0-8 3.6-8 8v152H116c-8.8 0-16 7.2-16 16v288c0 8.8 7.2 16 16 16h288c8.8 0 16-7.2 16-16V656c0-8.8-7.2-16-16-16H292v-88h440v88H620c-8.8 0-16 7.2-16 16v288c0 8.8 7.2 16 16 16h288c8.8 0 16-7.2 16-16V656c0-8.8-7.2-16-16-16zm-564 76v168H176V716h168zm84-408V140h168v168H428zm420 576H680V716h168v168z"}}]},name:"apartment",theme:"outlined"}},30960:(e,t)=>{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 42h216v494z"}}]},name:"file",theme:"outlined"}},35459:(e,t,r)=>{r.d(t,{A:()=>o});var a=r(97109),n=r(98995),l=r(88483);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 o=a.forwardRef((e,t)=>a.createElement(l.A,c({},e,{ref:t,icon:n.A})))},38770:(e,t,r)=>{r.d(t,{A:()=>a});let a=r(51916).A},49484:(e,t,r)=>{r.d(t,{A:()=>o});var a=r(97109),n=r(11100),l=r(88483);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 o=a.forwardRef((e,t)=>a.createElement(l.A,c({},e,{ref:t,icon:n.A})))},51916:(e,t,r)=>{r.d(t,{A:()=>u});var a=r(97109),n=r(3638),l=r(26047),c=r(19135),o=r(74567),s=r(10540),i=r(15033),f=r(84060);function d(e){return"auto"===e?"1 1 auto":(0,l.Et)(e)?`${e} ${e} auto`:/^\d+(\.\d+)?(px|em|rem|%)$/.test(e)?`0 0 ${e}`:e}let u=a.forwardRef((e,t)=>{let{getPrefixCls:r,direction:u}=a.useContext(o.QO),{gutter:v,wrap:h}=a.useContext(i.A),{prefixCls:p,span:m,order:g,offset:$,push:A,pull:b,className:y,children:w,flex:x,style:H,...E}=e,O=r("col",p),V=r(),[z,j]=(0,f.xV)(O),[M]=(0,s.PN)(V,"col"),N={},R={};c.Gl.forEach(t=>{let r={},a=e[t];(0,l.Et)(a)?r.span=a:(0,l.Qd)(a)&&(r=a||{}),delete E[t],R={...R,[`${O}-${t}-${r.span}`]:(0,l.R)(r.span),[`${O}-${t}-order-${r.order}`]:r.order||0===r.order,[`${O}-${t}-offset-${r.offset}`]:r.offset||0===r.offset,[`${O}-${t}-push-${r.push}`]:r.push||0===r.push,[`${O}-${t}-pull-${r.pull}`]:r.pull||0===r.pull,[`${O}-rtl`]:"rtl"===u},r.flex&&(R[`${O}-${t}-flex`]=!0,N[M(`${t}-flex`)]=d(r.flex))});let S=(0,n.$)(O,{[`${O}-${m}`]:void 0!==m,[`${O}-order-${g}`]:g,[`${O}-offset-${$}`]:$,[`${O}-push-${A}`]:A,[`${O}-pull-${b}`]:b},y,R,z,j),k={};return v?.[0]&&(k.paddingInline=(0,l.Et)(v[0])?`${v[0]/2}px`:`calc(${v[0]} / 2)`),x&&(k.flex=d(x),!1!==h||k.minWidth||(k.minWidth=0)),a.createElement("div",{...E,style:{...k,...H,...N},className:S,ref:t},w)})},53234:(e,t)=>{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"}},54849:(e,t,r)=>{r.d(t,{A:()=>y});var a=r(97109),n=r(42644),l=r(52690),c=r(3638),o=r(92162),s=r(26047),i=r(74567),f=r(88762);let d=e=>{let t,{value:r,formatter:n,precision:l,decimalSeparator:c,groupSeparator:o="",prefixCls:i,className:f,style:d}=e;if((0,s.Tn)(n))t=n(r);else{let e=String(r),n=e.match(/^(-?)(\d*)(\.(\d+))?$/);if(n&&"-"!==e){let e=n[1],r=n[2]||"0",f=n[4]||"";r=r.replace(/\B(?=(\d{3})+(?!\d))/g,o),(0,s.Et)(l)&&(f=f.padEnd(l,"0").slice(0,l>0?l:0)),f&&(f=`${c}${f}`),t=[a.createElement("span",{key:"int",className:`${i}-content-value-int`},e,r),f&&a.createElement("span",{key:"decimal",className:`${i}-content-value-decimal`},f)]}else t=e}return a.createElement("span",{className:f,style:d},t)};var u=r(7961),v=r(10540),h=r(28403);let p=(0,v.OF)("Statistic",e=>(e=>{let{componentCls:t,marginXXS:r,padding:a,colorTextDescription:n,titleFontSize:l,colorTextHeading:c,contentFontSize:o,fontFamily:s}=e;return{[t]:{...(0,u.dF)(e),[`${t}-header`]:{paddingBottom:r,[`${t}-title`]:{color:n,fontSize:l}},[`${t}-skeleton`]:{paddingTop:a},[`${t}-content`]:{color:c,fontSize:o,fontFamily:s,[`${t}-content-value`]:{display:"inline-block",direction:"ltr"},[`${t}-content-prefix, ${t}-content-suffix`]:{display:"inline-block"},[`${t}-content-prefix`]:{marginInlineEnd:r},[`${t}-content-suffix`]:{marginInlineStart:r}}}}})((0,h.oX)(e,{})),e=>{let{fontSizeHeading3:t,fontSize:r}=e;return{titleFontSize:r,contentFontSize:t}}),m=a.forwardRef((e,t)=>{let{prefixCls:r,className:l,rootClassName:u,style:v,valueStyle:h,value:m=0,title:g,valueRender:$,prefix:A,suffix:b,loading:y=!1,formatter:w,precision:x,decimalSeparator:H=".",groupSeparator:E=",",onMouseEnter:O,onMouseLeave:V,styles:z,classNames:j,...M}=e,{getPrefixCls:N,direction:R,className:S,style:k,classNames:C,styles:P}=(0,i.TP)("statistic"),B=N("statistic",r),[T,I]=p(B),L={...e,decimalSeparator:H,groupSeparator:E,loading:y,value:m},D=(0,o.XT)(k),Q=(0,o.XT)(v),[_,F]=(0,o.AV)([C,j],[P,D,z,Q],{props:L}),K=(0,c.$)(B,{[`${B}-rtl`]:"rtl"===R},S,l,u,_.root,T,I),X=(0,c.$)(`${B}-header`,_.header),G=(0,c.$)(`${B}-title`,_.title),W=(0,c.$)(`${B}-content`,_.content),q=(0,c.$)(`${B}-content-value`,_.value),J=(0,c.$)(`${B}-content-prefix`,_.prefix),Y=(0,c.$)(`${B}-content-suffix`,_.suffix),U=a.createElement(d,{decimalSeparator:H,groupSeparator:E,prefixCls:B,formatter:w,precision:x,value:m,className:q,style:F.value}),Z=a.useRef(null);a.useImperativeHandle(t,()=>({nativeElement:Z.current}));let ee=(0,n.KE)(M,{aria:!0,data:!0});return a.createElement("div",{...ee,className:K,style:F.root,ref:Z,onMouseEnter:O,onMouseLeave:V},g&&a.createElement("div",{className:X,style:F.header},a.createElement("div",{className:G,style:F.title},g)),a.createElement(f.A,{paragraph:!1,loading:y,className:`${B}-skeleton`,active:!0},a.createElement("div",{className:W,style:{...h,...F.content}},A&&a.createElement("span",{className:J,style:F.prefix},A),(0,s.Tn)($)?$(U):U,b&&a.createElement("span",{className:Y,style:F.suffix},b))))}),g=[["Y",31536e6],["M",2592e6],["D",864e5],["H",36e5],["m",6e4],["s",1e3],["S",1]],$=1e3/60,A=e=>{let{value:t,format:r="HH:mm:ss",onChange:c,onFinish:o,type:s,...i}=e,f="countdown"===s,[d,u]=a.useState(null),v=(0,n._q)(()=>{let e=Date.now(),r=new Date(t).getTime();u({});let a=f?r-e:e-r;return c?.(a),!f||!(r<e)||(o?.(),!1)});return a.useEffect(()=>{let e;return e=window.setInterval(()=>{v()||window.clearInterval(e)},$),()=>{window.clearInterval(e)}},[t,f]),a.useEffect(()=>{u({})},[]),a.createElement(m,{...i,value:t,valueRender:e=>(0,l.Ob)(e,{title:void 0}),formatter:(e,t)=>d?function(e,t,r){let{format:a=""}=t,n=new Date(e).getTime(),l=Date.now();return function(e,t){let r=e,a=/\[[^\]]*]/g,n=(t.match(a)||[]).map(e=>e.slice(1,-1)),l=t.replace(a,"[]"),c=g.reduce((e,[t,a])=>{if(e.includes(t)){let n=Math.floor(r/a);return r-=n*a,e.replace(RegExp(`${t}+`,"g"),e=>{let t=e.length;return n.toString().padStart(t,"0")})}return e},l),o=0;return c.replace(a,()=>{let e=n[o];return o+=1,e})}(r?Math.max(n-l,0):Math.max(l-n,0),a)}(e,{...t,format:r},f):"-"})},b=a.memo(e=>a.createElement(A,{...e,type:"countdown"}));m.Timer=A,m.Countdown=b;let y=m},56768:(e,t,r)=>{r.d(t,{A:()=>o});var a=r(97109),n=r(30960),l=r(88483);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 o=a.forwardRef((e,t)=>a.createElement(l.A,c({},e,{ref:t,icon:n.A})))},63663:(e,t,r)=>{r.d(t,{A:()=>o});var a=r(97109),n=r(21247),l=r(88483);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 o=a.forwardRef((e,t)=>a.createElement(l.A,c({},e,{ref:t,icon:n.A})))},93314:(e,t,r)=>{r.d(t,{A:()=>o});var a=r(97109),n=r(53234),l=r(88483);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 o=a.forwardRef((e,t)=>a.createElement(l.A,c({},e,{ref:t,icon:n.A})))},98995:(e,t)=>{t.A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M856 376H648V168c0-8.8-7.2-16-16-16H168c-8.8 0-16 7.2-16 16v464c0 8.8 7.2 16 16 16h208v208c0 8.8 7.2 16 16 16h464c8.8 0 16-7.2 16-16V392c0-8.8-7.2-16-16-16zm-480 16v188H220V220h360v156H392c-8.8 0-16 7.2-16 16zm204 52v136H444V444h136zm224 360H444V648h188c8.8 0 16-7.2 16-16V444h156v360z"}}]},name:"block",theme:"outlined"}},99811:(e,t,r)=>{r.d(t,{A:()=>o});var a=r(97109),n=r(14995),l=r(88483);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 o=a.forwardRef((e,t)=>a.createElement(l.A,c({},e,{ref:t,icon:n.A})))}}]);