@blueking/ai-blueking 2.1.4-beta.23 → 2.1.4-beta.24

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.
@@ -53435,7 +53435,10 @@ var iZ = ["src"], aZ = {
53435
53435
  e.toolCall?.toolMessage ? (U(), G(j$, me(Za({ key: 0 }, e.toolCall.toolMessage)), null, 16)) : J("v-if", !0)
53436
53436
  ], 512), [[es, !s.value]])]));
53437
53437
  }
53438
- }), R$ = { class: "ai-assistant-message" }, z$ = { class: "ai-assistant-message-content" }, B$ = /* @__PURE__ */ V({
53438
+ }), R$ = { class: "ai-assistant-message" }, z$ = {
53439
+ key: 0,
53440
+ class: "ai-assistant-message-content"
53441
+ }, B$ = /* @__PURE__ */ V({
53439
53442
  __name: "assistant-message",
53440
53443
  props: {
53441
53444
  toolCalls: {},
@@ -53449,7 +53452,7 @@ var iZ = ["src"], aZ = {
53449
53452
  property: {}
53450
53453
  },
53451
53454
  setup(e) {
53452
- return (t, n) => (U(), W("div", R$, [K("div", z$, [ui(t.$slots, "default", me(Ga({ content: e.content })), () => [q(cY, {
53455
+ return (t, n) => (U(), W("div", R$, [e.content ? (U(), W("div", z$, [ui(t.$slots, "default", me(Ga({ content: e.content })), () => [q(cY, {
53453
53456
  content: e.content || "",
53454
53457
  status: e.status,
53455
53458
  type: B(qs).Text
@@ -53457,9 +53460,9 @@ var iZ = ["src"], aZ = {
53457
53460
  "content",
53458
53461
  "status",
53459
53462
  "type"
53460
- ])])]), e.toolCalls && e.toolCalls.length > 0 ? (U(!0), W(H, { key: 0 }, ci(e.toolCalls, (t) => (U(), G(L$, {
53463
+ ])])])) : J("v-if", !0), e.toolCalls && e.toolCalls.length > 0 ? (U(!0), W(H, { key: 1 }, ci(e.toolCalls, (t) => (U(), G(L$, {
53461
53464
  key: t.id,
53462
- status: e.status,
53465
+ status: t.toolMessage?.status ?? e.status,
53463
53466
  "tool-call": t
53464
53467
  }, null, 8, ["status", "tool-call"]))), 128)) : J("v-if", !0)]));
53465
53468
  }
@@ -3484,7 +3484,7 @@ Input "@" to trigger tool and MCP
3484
3484
  Use Shift + Enter to enter a new line`:`输入 "/" 唤出 Skill
3485
3485
  输入 "\\" 唤出 Prompt
3486
3486
  输入 "@" 唤出 工具和 MCP
3487
- 通过 Shift + Enter 进行换行输入`},prompts:{default:()=>[]},resources:{default:()=>[]},shortcutId:{},shortcuts:{},skills:{default:()=>[]},supportUpload:{type:Boolean,default:!0},tippyOptions:{}},{cite:{required:!1,default:``},citeModifiers:{}}),emits:yr([`selectShortcut`,`deleteShortcut`,`update:modelValue`],[`update:cite`]),setup(e,{expose:t,emit:n}){let r=$n(`aiSlashInputRef`),i=$n(`filesRef`),a=Er(e,`cite`),o=sn(200),s=e,l=n,u=on(s.defaultUploadFiles||[]),d=fi(()=>s.shortcuts?.find(e=>e.id===s.shortcutId)),f=fi(()=>s.messageStatus&&[Li.Pending,Li.Streaming,Li.Fetching].includes(s.messageStatus)?s.messageStatus:s.modelValue?.length<1||Array.isArray(s.modelValue)&&!u9(s.modelValue).trim()?Li.Disabled:s.messageStatus);Cee(()=>{let e=s.inputMaxHeight||200;if(u.value.length<1||!i.value){o.value=e;return}o.value=e+(i.value?.clientHeight||0)});let p=async()=>{try{r.value?.cleanup?.();let e;u.value?.length?(e=u.value?.slice().map(e=>({type:Fi.Binary,url:e.url,mimeType:e.file?.type||``,filename:e.file?.name||``})),s.modelValue&&e.push({type:Fi.Text,text:u9(s.modelValue)})):e=typeof s.modelValue==`string`?s.modelValue:u9(s.modelValue),s.onSendMessage?.(e,s.modelValue),u.value=[]}catch(e){console.error(e)}},m=e=>{if(e.key===`Enter`||e.key===`NumpadEnter`){if(e.shiftKey||f.value===Li.Disabled||f.value===Li.Fetching)return;p()}},h=async()=>{try{s.onStopSending?.()}catch(e){console.error(e)}},g=()=>{a.value=``},_=e=>{l(`selectShortcut`,e)},v=()=>{l(`deleteShortcut`)},y=e=>`${e.name}_${e.size}_${e.lastModified}`,b=(oie/(1024*1024)).toFixed(1),x=async e=>{if(!s.supportUpload)return;if(u.value.length>=3){e.length>0&&Td({message:Ri(e.length,b,Hi),theme:`error`});return}let t=new Set(u.value.map(e=>e.file?y(e.file):``)),n=0;for(let r=0;r<e.length;r++){let i=e[r];if(u.value.length>=3){n+=e.length-r;break}let a=y(i);if(t.has(a)){n+=1;continue}if(i.size<=0||i.size>=2516582.4){n+=1;continue}t.add(a);let o={file:i,status:E9.Pending};u.value.push(o),s.onUpload?.(i).then(e=>{if(e&&typeof e==`object`&&`download_url`in e){o.url=e.download_url,o.status=E9.Success;return}o.status=E9.Error}).catch(()=>{o.status=E9.Error})}n>0&&Td({message:Ri(n,b,Hi),theme:`error`})},S=e=>{u.value=u.value.filter(t=>t.file?t.file!==e.file:t.url?t.url!==e.url:t.filename?t.filename!==e.filename:!0)},C=(e,t)=>{l(`update:modelValue`,e,t)};return t({focus:()=>{r.value?.focus?.()},triggerSendMessage:p}),(t,n)=>(V(),H(`div`,{class:`chat-input-container`,style:he({"--chat-z-index":B($re)})},[pr(t.$slots,`top`),Jr(`div`,{class:`chat-input`,style:he({maxHeight:o.value+`px`})},[pr(t.$slots,`input-header`,{},()=>[a.value?(V(),Wr(BHt,{key:0,class:`chat-input-cite`,content:a.value,onClose:g},null,8,[`content`])):$r(`v-if`,!0)]),pr(t.$slots,`files`,xe(Xr({files:u.value})),()=>[u.value.length?(V(),H(`div`,{key:0,ref_key:`filesRef`,ref:i,class:`chat-input-files`},[Yr(_Ut,{files:u.value,onDeleteFile:S},null,8,[`files`])],512)):$r(`v-if`,!0)]),Yr(BUt,{ref_key:`aiSlashInputRef`,ref:r,"model-value":e.modelValue,placeholder:e.placeholder,prompts:e.prompts,resources:e.resources,skills:e.skills,onKeydown:m,"onUpdate:modelValue":C,onUpload:x},null,8,[`model-value`,`placeholder`,`prompts`,`resources`,`skills`]),Yr(HUt,{"message-state":f.value,"tippy-options":e.tippyOptions,onSendMessage:p,onStopSending:h},{default:jn(()=>[e.supportUpload?(V(),Wr(LHt,{key:0,"tippy-options":e.tippyOptions,onUpload:x},null,8,[`tippy-options`])):$r(`v-if`,!0),e.supportUpload&&(e.shortcuts?.length||d.value)?(V(),H(`span`,UUt)):$r(`v-if`,!0),pr(t.$slots,`attachment`,{},()=>[e.shortcuts&&!d.value?(V(),Wr(uTe,{key:0,shortcuts:e.shortcuts,onSelectShortcut:_},null,8,[`shortcuts`])):$r(`v-if`,!0),d.value?(V(),Wr(tp,{key:1,class:`selected-shortcut-btn`,shortcut:d.value},{append:jn(()=>[Yr(B(Xi),{onClick:v})]),_:1},8,[`shortcut`])):$r(`v-if`,!0)])]),"send-icon":jn(()=>[pr(t.$slots,`send-icon`)]),_:3},8,[`message-state`,`tippy-options`])],4)],4))}}),GUt={class:`ai-delete-confirm`},KUt={class:`ai-delete-confirm__title`},qUt={class:`ai-delete-confirm__desc`},JUt={class:`ai-delete-confirm__actions`},YUt=Qn({__name:`delete-tool`,props:{description:{},id:{},name:{},disabled:{type:Boolean},tippyOptions:{}},emits:[`confirm`,`cancel`],setup(e,{emit:t}){let n=e,r=t,i=$n(`tippyRef`),a=fi(()=>({id:n.id,name:n.name,description:n.description,disabled:n.disabled,tippyOptions:n.tippyOptions})),o=fi(()=>({arrow:!1,interactive:!0,offset:[0,6],theme:`ai-chat-box-light light`,trigger:`click`,appendTo:()=>document.body,...n.tippyOptions||{}})),s=()=>{if(n.disabled)return!1},l=()=>{i.value?.hide?.()},u=()=>{l(),r(`confirm`)},d=()=>{l(),r(`cancel`)};return cr(()=>{l()}),(e,t)=>(V(),Wr(B($f),ri({ref_key:`tippyRef`,ref:i},o.value,{onShow:s}),{content:jn(()=>[Jr(`div`,GUt,[Jr(`div`,KUt,Oe(B(Ui)(`确认删除该回答?`)),1),Jr(`div`,qUt,Oe(B(Ui)(`删除操作无法撤回,请谨慎操作!`)),1),Jr(`div`,JUt,[Yr(B(yu),{size:`small`,theme:`danger`,onClick:u},{default:jn(()=>[Qr(Oe(B(Ui)(`删除`)),1)]),_:1}),Yr(B(yu),{size:`small`,onClick:d},{default:jn(()=>[Qr(Oe(B(Ui)(`取消`)),1)]),_:1})])])]),default:jn(()=>[Yr(Cp,xe(Xr(a.value)),null,16)]),_:1},16))}}),XUt={class:`ai-feedback-title`},ZUt={class:`ai-feedback-reason-list`},QUt=[`onClick`],$Ut={class:`ai-feedback-other`},eWt={class:`ai-feedback-footer`},tWt=Qn({__name:`user-feedback`,props:{loading:{type:Boolean},reasonList:{},title:{}},emits:[`submit`,`cancel`],setup(e,{emit:t}){let n=t,r=sn(``),i=sn([]),a=e=>{i.value.includes(e)?i.value=i.value.filter(t=>t!==e):i.value=[...i.value,e]},o=()=>{n(`submit`,i.value,r.value)},s=()=>{i.value=[],r.value=``,n(`cancel`)};return(t,n)=>(V(),H(`div`,{class:`ai-user-feedback`,onMouseenter:n[1]||=Mi(()=>{},[`stop`,`prevent`])},[Jr(`div`,XUt,Oe(e.title),1),Jr(`div`,ZUt,[e.loading?(V(),H(Ir,{key:0},dr(8,e=>Jr(`div`,{key:e,class:`reason-item ai-skeleton-element`})),64)):(V(!0),H(Ir,{key:1},dr(e.reasonList,e=>(V(),H(`div`,{key:e,class:be([`reason-item`,{"is-active":i.value.includes(e)}]),onClick:t=>a(e)},Oe(e),11,QUt))),128))]),Jr(`div`,$Ut,[Yr(B(Au),{modelValue:r.value,"onUpdate:modelValue":n[0]||=e=>r.value=e,placeholder:B(Ui)(`说出您的想法`),rows:3,type:`textarea`},null,8,[`modelValue`,`placeholder`])]),Jr(`div`,eWt,[Yr(B(yu),{class:`custom-btn`,disabled:!r.value&&i.value.length===0,size:`small`,theme:`primary`,onClick:o},{default:jn(()=>[Qr(Oe(B(Ui)(`提交`)),1)]),_:1},8,[`disabled`]),Yr(B(yu),{class:`custom-btn`,size:`small`,width:`80px`,onClick:s},{default:jn(()=>[Qr(Oe(B(Ui)(`取消`)),1)]),_:1})])],32))}}),nWt={ref:`messageToolsRef`,class:`message-tools-container`},rWt={class:`message-tools`,style:{"margin-right":`8px`}},iWt={key:0,class:`ai-divider`,style:{"margin-right":`8px`}},aWt={class:`message-tools`},oWt=Qn({__name:`message-tools`,props:{messageTools:{default:()=>rie},messageToolsStatus:{},onAction:{},tippyOptions:{},updateTools:{default:()=>aie}},emits:[`feedback`],setup(e,{emit:t}){let n=e,r=t,i=$n(`feedbackTippyRef`),a=sn(!1),o=sn([]),s=sn(null),l=fi(()=>({arrow:!1,interactive:!0,offset:[0,6],theme:`ai-chat-box-light light`,trigger:`click`,appendTo:()=>document.body,...n.tippyOptions||{}})),u=async e=>{if(e.id===`like`||e.id===`unlike`){try{a.value=!0,o.value=[],o.value=await n.onAction?.(e)||[]}finally{a.value=!1}return}await n.onAction?.(e)},d=async e=>{await n.onAction?.(e)},f=()=>{i.value?.forEach(e=>e?.hide?.())},p=e=>s.value?s.value===`like`&&e===`like`?`activeLike`:s.value===`unlike`&&e===`unlike`?`activeUnLike`:e:e,m=e=>{let t=p(e);return t===`activeLike`?Ui(`取消满意`):t===`activeUnLike`?Ui(`取消不满意`):n.updateTools?.find(e=>e.id===t)?.description||``},h=(e,t,n)=>{f(),s.value===e.id?s.value=null:s.value=e.id,r(`feedback`,e,t,n)},g=e=>{if(n.messageToolsStatus===D9.Disabled)return!1;if(s.value&&s.value===e)return s.value=null,!1};return cr(()=>{f(),o.value=[]}),(t,n)=>(V(),H(`div`,nWt,[Jr(`div`,rWt,[(V(!0),H(Ir,null,dr(e.messageTools,t=>(V(),H(Ir,{key:t.id},[t.id===`delete`?(V(),Wr(YUt,ri({key:0,ref_for:!0},t,{disabled:e.messageToolsStatus===B(D9).Disabled,"tippy-options":e.tippyOptions,onConfirm:e=>d(t)}),null,16,[`disabled`,`tippy-options`,`onConfirm`])):(V(),Wr(Cp,ri({key:1,ref_for:!0},t,{disabled:e.messageToolsStatus===B(D9).Disabled,"tippy-options":e.tippyOptions,onClick:e=>u(t)}),null,16,[`disabled`,`tippy-options`,`onClick`]))],64))),128))]),e.updateTools.length>0?(V(),H(`div`,iWt)):$r(`v-if`,!0),Jr(`div`,aWt,[(V(!0),H(Ir,null,dr(e.updateTools,t=>(V(),H(Ir,{key:t.id},[t.id===`like`||t.id===`unlike`?(V(),Wr(B($f),ri({key:0,ref_for:!0,ref_key:`feedbackTippyRef`,ref:i},{ref_for:!0},l.value,{onShow:e=>g(t.id)}),{content:jn(()=>[Yr(tWt,{loading:a.value,"reason-list":o.value,title:t.id===`like`?B(Ui)(`什么原因让你满意?`):B(Ui)(`什么原因让你不满意?`),onCancel:f,onSubmit:(e,n)=>h(t,e,n)},null,8,[`loading`,`reason-list`,`title`,`onSubmit`])]),default:jn(()=>[Yr(Cp,ri({ref_for:!0},t,{id:p(t.id),active:s.value===t.id,disabled:e.messageToolsStatus===B(D9).Disabled,"tippy-options":{...e.tippyOptions,content:m(t.id)},onClick:e=>u(t)}),null,16,[`id`,`active`,`disabled`,`tippy-options`,`onClick`])]),_:2},1040,[`onShow`])):t.id===`delete`?(V(),Wr(YUt,ri({key:1,ref_for:!0},t,{disabled:e.messageToolsStatus===B(D9).Disabled,"tippy-options":e.tippyOptions,onConfirm:e=>d(t)}),null,16,[`disabled`,`tippy-options`,`onConfirm`])):(V(),Wr(Cp,ri({key:2,ref_for:!0},t,{disabled:e.messageToolsStatus===B(D9).Disabled,"tippy-options":e.tippyOptions,onClick:e=>u(t)}),null,16,[`disabled`,`tippy-options`,`onClick`]))],64))),128))])],512))}}),O9=Qn({name:`HighlightKeyword`,props:{text:{type:String,required:!0}},setup(e){let t=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),n=WTe(),r=fi(()=>{if(!e.text||!n?.value)return e.text;let r=n.value.trim();if(!r)return e.text;let i=RegExp(`(${t(r)})`,`ig`),a=e.text?.toString().split(i);return a.length<=1?e.text:a.map(e=>i.test(e)?U(`span`,{class:sie},e):e)});return()=>U(`span`,r.value)}}),sWt={class:`ai-activity-message`},cWt={class:`ai-activity-message-content`},lWt=Qn({__name:`activity-layout`,props:yr({activityType:{}},{collapsed:{type:Boolean,default:!1},collapsedModifiers:{}}),emits:[`update:collapsed`],setup(e){let t=Er(e,`collapsed`);return(n,r)=>(V(),H(`div`,sWt,[Jr(`div`,{class:`ai-activity-message-title`,onClick:r[0]||=e=>t.value=!t.value},[pr(n.$slots,`title`,xe(Xr({collapsed:t.value}))),e.activityType===B(Fi).FlowAgent?$r(`v-if`,!0):(V(),H(`span`,{key:0,class:be([`ai-activity-message-title-icon collapsed-icon`,{"is-collapsed":t.value}])},[Yr(B(Yi))],2))]),Mn(Jr(`div`,cWt,[pr(n.$slots,`default`)],512),[[wi,!t.value]])]))}}),k9=[{color:`#3A84FF`,icon:null,key:`running`,label:Ui(`执行中`),rawStates:[`CREATED`,`LOOP_READY`,`READY`,`RUNNING`,`BLOCKED`,`ROLLING_BACK`,`ROLL_BACK_SUCCESS`]},{color:`#65C389`,icon:vie,key:`success`,label:Ui(`成功`),rawStates:[`FINISHED`]},{color:`#EA3636`,icon:yie,key:`failed`,label:Ui(`失败`),rawStates:[`FAILED`,`REVOKED`,`ROLL_BACK_FAILED`]},{color:`#F59500`,icon:bie,key:`suspended`,label:Ui(`挂起`),rawStates:[`SUSPENDED`]},{color:`#4D4F56`,dotColor:`#DCDEE5`,icon:xie,key:`pending`,label:Ui(`待执行`),rawStates:[`PENDING`]},{color:`#5B7290`,icon:Sie,key:`skipped`,label:Ui(`跳过`),rawStates:[`SKIPPED`]}],uWt=Object.fromEntries(k9.map(e=>[e.key,e])),dWt=Object.fromEntries(k9.flatMap(e=>e.rawStates.map(t=>[t,e.key]))),fWt=e=>dWt[e]??`running`,pWt=e=>uWt[e].dotColor??uWt[e].color,mWt=e=>{let t=uWt[e].icon;return t?Zr(t):null},hWt=e=>{let t=fi(()=>Array.isArray(e.value)?e.value:[e.value??{}]),n=sn({}),r=e=>n.value[e.task_id]!==!1;return{isTaskExpanded:r,taskList:t,toggleTaskExpanded:e=>{n.value={...n.value,[e.task_id]:!r(e)}},viewTasks:fi(()=>t.value.map(e=>{let t=Object.values(e.nodes??{}).map(e=>{let t=fWt(e.state);return{convergedState:t,dotColor:pWt(t),elapsedTimeText:Zre(e.elapsed_time),id:e.id,name:e.name,raw:e}}),n=t.reduce((e,t)=>e+t.raw.elapsed_time,0),r=fWt(e.task_state??``);return{convergedState:r,hasConfidence:!!e.has_confidence,confidenceTitle:e.confidence_title,isActive:!!e.is_active,nodes:t,raw:e,stateIcon:mWt(r),taskId:e.task_id,taskName:e.task_name,totalTimeText:Zre(n)}})),visibleStats:fi(()=>{let e={};for(let t of k9)e[t.key]=0;for(let n of t.value)for(let[t,r]of Object.entries(n.statistics?.state_counts??{}))e[fWt(t)]+=r;return k9.filter(t=>e[t.key]>0).map(t=>({color:t.color,display:e[t.key]>99?`99+`:String(e[t.key]),dotColor:pWt(t.key),key:t.key,label:t.label}))})}},gWt={class:`ai-detail-section`},_Wt={class:`section-heading`},vWt={class:`section-text`},A9=Qn({__name:`detail-section`,props:{title:{}},setup(e){return(t,n)=>(V(),H(`div`,gWt,[Jr(`div`,_Wt,[n[0]||=Jr(`span`,{class:`section-bar`},null,-1),Jr(`span`,vWt,Oe(e.title),1)]),pr(t.$slots,`default`)]))}}),yWt={class:`ai-simple-table`},bWt={key:0},xWt=[`colspan`],SWt=Qn({__name:`simple-table`,props:{columns:{},data:{}},setup(e){return(t,n)=>(V(),H(`table`,yWt,[Jr(`thead`,null,[Jr(`tr`,null,[(V(!0),H(Ir,null,dr(e.columns,e=>(V(),H(`th`,{key:e.key},Oe(e.label),1))),128))])]),Jr(`tbody`,null,[(V(!0),H(Ir,null,dr(e.data,(t,n)=>(V(),H(`tr`,{key:n},[(V(!0),H(Ir,null,dr(e.columns,e=>(V(),H(`td`,{key:e.key,class:be({"is-break-all":e.breakAll})},Oe(t[e.key]??`--`),3))),128))]))),128)),e.data.length?$r(`v-if`,!0):(V(),H(`tr`,bWt,[Jr(`td`,{class:`is-empty`,colspan:e.columns.length},` -- `,8,xWt)]))])]))}}),CWt={class:`flow-agent-node-detail`},wWt={class:`detail-title`},TWt={key:1,class:`detail-title-content`},EWt={class:`detail-tab-bar`},DWt=[`onClick`],OWt={class:`detail-body`},kWt={class:`skeleton-section`},AWt={class:`skeleton-section`},jWt={class:`info-form`},MWt={class:`info-label`},NWt={class:`info-value`},PWt={class:`info-row`},FWt={class:`info-label`},IWt={class:`info-value`},LWt={key:0,class:`failure-item`},RWt={key:1,class:`failure-item`},zWt={class:`info-row`},BWt={class:`info-label`},VWt={class:`info-value`},HWt={key:0,class:`skeleton-section`},j9=function(e){return e.Config=`config`,e.Output=`output`,e}(j9||{}),UWt=Qn({__name:`flow-agent-node-detail`,props:{data:{},has_confidence:{type:Boolean},loading:{type:Boolean},node_id:{},node_name:{},task_id:{},task_name:{}},setup(e){let t=[{key:j9.Config,label:Ui(`节点配置`)},{key:j9.Output,label:Ui(`节点输出`)}],n=[{key:`key`,label:Ui(`参数名`)},{breakAll:!0,key:`value`,label:Ui(`参数值`)}],r=[{key:`name`,label:Ui(`名称`)},{key:`description`,label:Ui(`变量说明`)},{key:`key`,label:`KEY`}],i=[{key:`key`,label:Ui(`参数名`)},{breakAll:!0,key:`value`,label:Ui(`参数值`)}],a={forced_fail:Hi?`Force Fail`:`强制失败`},o=e,s=sn(j9.Config),l=fi(()=>o.data?.basic_info),u=fi(()=>{let e=l.value;return e?[{label:Ui(`流程模板`),value:e.template_name||`--`},{label:Ui(`节点名称`),value:e.node_name||`--`},{label:Ui(`步骤名称`),value:e.stage_name||`--`},{label:Ui(`是否可选`),value:e.optional?Ui(`是`):Ui(`否`)}]:[]}),d=fi(()=>{let e=l.value;return e?.skippable||e?.auto_retry?.enable}),f=fi(()=>{let e=l.value?.auto_retry;return e?.enable?Hi?`In ${e.interval} seconds, auto retry ${e.times} times`:`在 ${e.interval} 秒后,自动重试 ${e.times} 次`:``}),p=fi(()=>{let e=l.value?.timeout_config;if(!e?.enable)return`--`;let t=a[e.action]??e.action;return Hi?`Timeout ${e.seconds} seconds later, ${t}`:`超时 ${e.seconds} 秒后则${t}`}),m=fi(()=>Object.entries(o.data?.inputs??{}).map(([e,t])=>({key:e,value:_(t)}))),h=fi(()=>(o.data?.plugin_output??[]).map(e=>({description:e.schema?.description||`--`,name:e.name,key:e.key}))),g=fi(()=>(o.data?.outputs??[]).map(e=>({key:e.key,value:_(e.value)}))),_=e=>e==null?`--`:typeof e==`object`?JSON.stringify(e):String(e);return(a,o)=>(V(),H(`div`,CWt,[Jr(`h3`,wWt,[e.loading?(V(),H(Ir,{key:0},[Jr(`span`,null,Oe(B(Ui)(`节点`))+`:`,1),o[0]||=Jr(`span`,{class:`skeleton-title ai-skeleton-element`},null,-1)],64)):(V(),H(`div`,TWt,Oe(B(Ui)(`节点`))+`:`+Oe(l.value?.node_name),1)),pr(a.$slots,`locateButton`)]),Jr(`div`,EWt,[(V(),H(Ir,null,dr(t,e=>Jr(`div`,{key:e.key,class:be([`detail-tab`,{"is-active":s.value===e.key}]),onClick:t=>s.value=e.key},[(V(),Wr(lr(e.key===j9.Config?B(wie):B(Ji)),{class:`detail-tab-icon`})),Qr(` `+Oe(e.label),1)],10,DWt)),64))]),Jr(`div`,OWt,[s.value===j9.Config?(V(),H(Ir,{key:0},[e.loading?(V(),H(Ir,{key:0},[Jr(`div`,kWt,[o[1]||=Jr(`div`,{class:`skeleton-heading ai-skeleton-element`},null,-1),(V(),H(Ir,null,dr(6,e=>Jr(`div`,{key:e,class:`skeleton-row ai-skeleton-element`})),64))]),Jr(`div`,AWt,[o[2]||=Jr(`div`,{class:`skeleton-heading ai-skeleton-element`},null,-1),(V(),H(Ir,null,dr(4,e=>Jr(`div`,{key:e,class:`skeleton-row ai-skeleton-element`})),64))])],64)):(V(),H(Ir,{key:1},[Yr(A9,{title:B(Ui)(`基础信息`)},{default:jn(()=>[Jr(`div`,jWt,[(V(!0),H(Ir,null,dr(u.value,e=>(V(),H(`div`,{key:e.label,class:`info-row`},[Jr(`div`,MWt,Oe(e.label),1),Jr(`div`,NWt,Oe(e.value),1)]))),128)),Jr(`div`,PWt,[Jr(`div`,FWt,Oe(B(Ui)(`失败处理`)),1),Jr(`div`,IWt,[d.value?(V(),H(Ir,{key:0},[l.value?.skippable?(V(),H(`span`,LWt,[o[3]||=Jr(`span`,{class:`tag-badge`},`MS`,-1),Qr(` `+Oe(B(Ui)(`手动跳过`))+Oe(l.value?.auto_retry?.enable?`;`:``),1)])):$r(`v-if`,!0),l.value?.auto_retry?.enable?(V(),H(`span`,RWt,[o[4]||=Jr(`span`,{class:`tag-badge`},`AR`,-1),Qr(` `+Oe(f.value),1)])):$r(`v-if`,!0)],64)):(V(),H(Ir,{key:1},[Qr(`--`)],64))])]),Jr(`div`,zWt,[Jr(`div`,BWt,Oe(B(Ui)(`超时控制`)),1),Jr(`div`,VWt,Oe(p.value),1)])])]),_:1},8,[`title`]),Yr(A9,{title:B(Ui)(`输入参数`)},{default:jn(()=>[Yr(SWt,{columns:n,data:m.value},null,8,[`data`])]),_:1},8,[`title`]),Yr(A9,{title:B(Ui)(`输出参数`)},{default:jn(()=>[Yr(SWt,{columns:r,data:h.value},null,8,[`data`])]),_:1},8,[`title`])],64))],64)):(V(),H(Ir,{key:1},[e.loading?(V(),H(`div`,HWt,[o[5]||=Jr(`div`,{class:`skeleton-heading ai-skeleton-element`},null,-1),(V(),H(Ir,null,dr(5,e=>Jr(`div`,{key:e,class:`skeleton-row ai-skeleton-element`})),64))])):(V(),Wr(A9,{key:1,title:B(Ui)(`结构化输出`)},{default:jn(()=>[Yr(SWt,{columns:i,data:g.value},null,8,[`data`])]),_:1},8,[`title`]))],64))])]))}}),M9=e=>e.task_id==null?``:`${e.task_id}`,WWt=M9,GWt=(e,t)=>e.task_id==null?``:`${e.task_id}|${t.id}|${t.name}`,KWt=e=>{let{messageUid:t,taskList:n}=e,r=DTe(),i=CTe(),a=fi(()=>r.selectedTab.value?.name??``),o=sn(!1),s=()=>{o.value=!0},l=fi(()=>{if(o.value)return a.value;let e=n.value.find(e=>e.is_active);return e?.task_id==null?a.value:M9(e)}),u=e=>{let t=l.value;return t===M9(e)||t===WWt(e)},d=(e,t)=>l.value===GWt(e,t),f=(e,n)=>{let i=e.task_id;i!=null&&(s(),r.addCustomTab?.({label:n.name,name:GWt(e,n),data:{component:UWt,messageUid:t.value,props:{data:{},loading:!0,node_id:n.id,node_name:n.name,task_id:i,task_name:e.task_name}}}))},p=e=>{let n=e?.task_id;n&&(s(),r.addCustomTab?.({label:Ui(`有效证据`),name:WWt(e),data:{component:UWt,messageUid:t.value,props:{data:{},has_confidence:e.has_confidence,loading:!0,task_id:n,task_name:e.task_name}}}))};return Ln(a,(e,t)=>{t!==void 0&&s()}),or(()=>{i?.value&&p(n.value.find(e=>e.is_active&&e.has_confidence))}),cr(()=>{if(i?.value)for(let e of n.value){r.removeCustomTab?.(M9(e)),r.removeCustomTab?.(WWt(e));for(let t of Object.values(e.nodes??{}))r.removeCustomTab?.(GWt(e,t))}}),{displaySelectedTabName:l,isNodeSelected:d,isTaskSelected:u,markUserTabSelection:s,openConfidence:p,openNodeDetail:f}},qWt={class:`ai-activity-message-title-text`},JWt={class:`flow-agent-title-label`},YWt={class:`flow-agent-stat-tooltip`},XWt={class:`flow-agent-stat-tooltip-status`},ZWt={class:`flow-agent-stat-tooltip-label`},QWt={class:`flow-agent-task-state-icon`},$Wt={class:`flow-agent-task-name`},eGt={key:0,class:`flow-agent-task-trailing`},tGt={class:`flow-agent-task-time`},nGt=[`onClick`],rGt={class:`flow-agent-task-nodes`},iGt={class:`flow-agent-node-status`},aGt=[`title`],oGt={key:0,class:`flow-agent-node-trailing`},sGt={class:`flow-agent-node-time`},cGt=[`onClick`],lGt=Qn({__name:`flow-agent-content`,props:yr({content:{},messageUid:{},status:{}},{collapsed:{type:Boolean,default:!1},collapsedModifiers:{}}),emits:[`update:collapsed`],setup(e){let t=e,n=ap(),r=Er(e,`collapsed`),i=HTe(),a=fi(()=>i.value!==Wi.Share),o=fi(()=>t.status===Li.Pending||t.status===Li.Streaming),{isTaskExpanded:s,taskList:l,toggleTaskExpanded:u,viewTasks:d,visibleStats:f}=hWt(fn(t,`content`)),{isNodeSelected:p,isTaskSelected:m,openConfidence:h,openNodeDetail:g}=KWt({messageUid:fn(t,`messageUid`),taskList:l});return(e,t)=>(V(),Wr(lWt,{collapsed:r.value,"onUpdate:collapsed":t[0]||=e=>r.value=e,"activity-type":B(Fi).FlowAgent,class:`flow-agent-activity`},{title:jn(()=>[$r(` hover 整条执行情况栏展示统计 tooltip(设计稿 annotation) `),Yr(B($f),ri({class:`flow-agent-title-bar`,theme:`ai-chat-box-light light`},{...B(n),tag:`div`,arrow:!0,followCursor:!1,offset:[0,10]}),{content:jn(()=>[Jr(`div`,YWt,[(V(!0),H(Ir,null,dr(B(f),e=>(V(),H(`div`,{key:e.key,class:`flow-agent-stat-tooltip-item`},[Jr(`span`,XWt,[e.key===`running`?(V(),Wr(B(du),{key:0,mode:`spin`,size:`mini`,theme:`primary`})):(V(),H(`span`,{key:1,class:`flow-agent-stat-dot`,style:he({borderColor:e.dotColor})},null,4))]),Jr(`span`,ZWt,Oe(e.label)+`:`,1),Jr(`span`,{class:`flow-agent-stat-tooltip-count`,style:he({color:e.color})},Oe(e.display),5)]))),128))])]),default:jn(()=>[Jr(`span`,{class:be([`ai-activity-message-title-icon`,{"icon-collapsed":r.value}])},[o.value?(V(),Wr($d,{key:0,size:12})):(V(),Wr(B(qi),{key:1}))],2),Jr(`span`,qWt,[Jr(`span`,JWt,Oe(B(Ui)(`执行情况`))+`:`,1),(V(!0),H(Ir,null,dr(B(f),e=>(V(),H(`span`,{key:e.key,class:`flow-agent-stat-item`},[e.key===`running`?(V(),Wr(B(du),{key:0,class:`flow-agent-stat-loading`,mode:`spin`,size:`mini`,theme:`primary`})):(V(),H(`span`,{key:1,class:`flow-agent-stat-dot`,style:he({borderColor:e.dotColor})},null,4)),Jr(`span`,{class:`flow-agent-stat-count`,style:he({color:e.color})},Oe(e.display),5)]))),128))])]),_:1},16)]),default:jn(()=>[(V(!0),H(Ir,null,dr(B(d),e=>(V(),H(`div`,{key:e.taskId,class:`flow-agent-task-group`},[Jr(`div`,{class:be([`flow-agent-task-header`,{"has-confidence":e.hasConfidence,"is-selected":B(m)(e.raw)}])},[Jr(`span`,{class:be([`flow-agent-task-arrow`,{"is-expanded":B(s)(e.raw)}])},[Yr(B(qi),{onClick:Mi(t=>B(u)(e.raw),[`stop`])},null,8,[`onClick`])],2),Jr(`span`,QWt,[e.convergedState===`running`?(V(),Wr(B(du),{key:0,mode:`spin`,size:`mini`,theme:`primary`})):(V(),Wr(lr(e.stateIcon),{key:1}))]),Mn((V(),H(`span`,$Wt,[Yr(B(O9),{text:e.taskName},null,8,[`text`])])),[[B(Sp),{...B(n)}]]),a.value?(V(),H(`span`,eGt,[Jr(`span`,tGt,Oe(e.totalTimeText),1),e.hasConfidence?(V(),H(`span`,{key:0,class:`flow-agent-task-action-btn flow-agent-task-confidence-btn`,onClick:Mi(t=>B(h)(e.raw),[`stop`])},[Yr(B(Ji)),Qr(` `+Oe(e.confidenceTitle??B(Ui)(`有效证据`)),1)],8,nGt)):$r(`v-if`,!0)])):$r(`v-if`,!0)],2),Mn(Jr(`div`,rGt,[(V(!0),H(Ir,null,dr(e.nodes,t=>(V(),H(`div`,{key:t.id,class:be([`flow-agent-node-item`,{"is-selected":B(p)(e.raw,t.raw)}])},[Jr(`span`,iGt,[t.convergedState===`running`?(V(),Wr(B(du),{key:0,mode:`spin`,size:`mini`,theme:`primary`})):(V(),H(`span`,{key:1,class:`flow-agent-status-dot`,style:he({borderColor:t.dotColor})},null,4))]),Mn((V(),H(`span`,{class:`flow-agent-node-name`,title:t.name},[Yr(B(O9),{text:t.name},null,8,[`text`])],8,aGt)),[[B(Sp),{...B(n)}]]),a.value?(V(),H(`span`,oGt,[Jr(`span`,sGt,Oe(t.elapsedTimeText),1),Jr(`span`,{class:`flow-agent-node-detail-btn`,onClick:Mi(n=>B(g)(e.raw,t.raw),[`stop`])},[Yr(B(Ji)),Qr(` `+Oe(B(Ui)(`详情`)),1)],8,cGt)])):$r(`v-if`,!0)],2))),128))],512),[[wi,B(s)(e.raw)]])]))),128))]),_:1},8,[`collapsed`,`activity-type`]))}}),uGt={class:`ai-activity-message-title-icon`},dGt={class:`ai-activity-message-title-text`},fGt={class:`knowledge-rag-content`},pGt=Qn({__name:`knowledge-rag-content`,props:yr({content:{},messageUid:{},status:{}},{collapsed:{type:Boolean,default:!1},collapsedModifiers:{}}),emits:[`update:collapsed`],setup(e){let t=e,n=Er(e,`collapsed`),r=fi(()=>t.status===Li.Pending||t.status===Li.Streaming),i=fi(()=>r.value?Ui(`检索中`):Ui(`检索完成`));return(t,a)=>(V(),Wr(lWt,{collapsed:n.value,"onUpdate:collapsed":a[0]||=e=>n.value=e},{title:jn(()=>[Jr(`span`,uGt,[r.value?(V(),Wr($d,{key:0})):(V(),Wr(B(Ki),{key:1,style:{"font-size":`12px`}}))]),Jr(`span`,dGt,Oe(i.value),1)]),default:jn(()=>[Jr(`div`,fGt,[Yr(i9,{content:e.content?.content||``},null,8,[`content`])]),Yr(a9,{content:e.content?.referenceDocument||[]},null,8,[`content`])]),_:1},8,[`collapsed`]))}}),mGt={class:`ai-activity-message-title-icon`},hGt={class:`ai-activity-message-title-text`},gGt=Qn({__name:`reference-doc-content`,props:yr({content:{},messageUid:{}},{collapsed:{type:Boolean,default:!1},collapsedModifiers:{}}),emits:[`update:collapsed`],setup(e){let t=e,n=Er(e,`collapsed`),r=fi(()=>{let e=t.content?.length??0;return Hi?`Reference ${e} documents as reference`:`引用 ${e} 篇资料作为参考`});return(t,i)=>(V(),Wr(lWt,{collapsed:n.value,"onUpdate:collapsed":i[0]||=e=>n.value=e},{title:jn(()=>[Jr(`span`,mGt,[Yr(B(Ki),{style:{"font-size":`12px`}})]),Jr(`span`,hGt,Oe(r.value),1)]),default:jn(()=>[Yr(a9,{content:e.content||[]},null,8,[`content`])]),_:1},8,[`collapsed`]))}}),_Gt=Qn({__name:`activity-message`,props:yr({activityType:{},content:{},id:{},messageId:{},name:{},role:{},status:{},uid:{},property:{}},{collapsed:{type:Boolean,default:!1},collapsedModifiers:{}}),emits:[`update:collapsed`],setup(e){let t={[Fi.FlowAgent]:lGt,[Fi.KnowledgeRag]:pGt,[Fi.ReferenceDocument]:gGt},n=e,r=Er(e,`collapsed`),i=fi(()=>t[n.activityType??``]);return(t,n)=>i.value?(V(),Wr(lr(i.value),{key:0,collapsed:r.value,"onUpdate:collapsed":n[0]||=e=>r.value=e,content:e.content,"message-uid":e.uid,status:e.status},null,40,[`collapsed`,`content`,`message-uid`,`status`])):$r(`v-if`,!0)}}),vGt={class:`toolcall-desc`},yGt={class:`desc-title`},bGt={class:`desc-panel`},xGt={class:`desc-label`},SGt={class:`desc-value`},CGt=Qn({__name:`desc-panel`,props:{desc:{},title:{}},setup(e){let t=e,n=fi(()=>{try{return JSON.parse(t.desc||``)}catch{return t.desc}});return(t,r)=>(V(),H(`div`,vGt,[Jr(`div`,yGt,Oe(e.title),1),Jr(`div`,bGt,[typeof n.value==`object`?(V(!0),H(Ir,{key:0},dr(n.value,(e,t)=>(V(),H(`div`,{key:t,class:`desc-panel-item`},[Jr(`span`,xGt,[Yr(B(O9),{text:t},null,8,[`text`]),r[0]||=Qr(`:`,-1)]),Jr(`span`,SGt,[Yr(B(O9),{style:{"word-break":`break-all`},text:typeof e==`object`&&e?JSON.stringify(e):e},null,8,[`text`])])]))),128)):(V(),Wr(B(O9),{key:1,style:{wordBreak:`break-all`},text:n.value},null,8,[`text`]))])]))}}),wGt={class:`tool-message`},TGt=Qn({__name:`tool-message`,props:{duration:{},error:{type:[Boolean,String]},toolCallId:{},content:{},id:{},messageId:{},name:{},role:{},status:{},uid:{},property:{}},setup(e){return(t,n)=>(V(),H(`div`,wGt,[Yr(CGt,{desc:e.content||(typeof e.error==`string`?e.error:void 0),title:B(Ui)(`返回内容`)},null,8,[`desc`,`title`])]))}}),EGt={class:`ai-toolcall-render`},DGt={class:`toolcall-header-title`},OGt={class:`toolcall-status-title`},kGt={key:1,class:`toolcall-duration`},AGt={class:`ai-toolcall-render-content`},jGt=Qn({__name:`toolcall-render`,props:{duration:{},status:{},toolCall:{}},setup(e){let t=e,n=sn(!0),r=sn(null),i=ap(),{keywordMatched:a,keyword:o}=GTe(()=>[t.toolCall?.function.name,t.toolCall?.function.mcpName,t.toolCall?.function.description,t.toolCall?.function.arguments,t.toolCall?.id]),s=fi(()=>r.value===null?o?.value?.trim()?!a.value:n.value:r.value);function l(){n.value=!s.value,r.value=n.value}let u=fi(()=>{let e=t.toolCall?.function.mcpName||``,n=t.toolCall?.function.name||t.toolCall?.id||``;return e?`${e} / ${n}`:n}),d=fi(()=>{switch(t.status){default:case Li.Pending:return Ui(`调用中`);case Li.Complete:case Li.Success:return Ui(`调用成功`);case Li.Error||t.toolCall?.toolMessage?.error:return Ui(`调用失败`)}}),f=fi(()=>{let e=t.duration||t.toolCall?.toolMessage?.duration;return e?Xre(e):``});return(t,n)=>(V(),H(`div`,EGt,[Jr(`div`,{class:be([`ai-toolcall-render-header`,`toolcall-status-${e.status}`]),onClick:l},[Yr(B(qi),{class:be({"is-collapsed":s.value})},null,8,[`class`]),Qr(` `+Oe(e.toolCall?.function.mcpName?B(Ui)(`调用 MCP:`):B(Ui)(`调用工具:`))+` `,1),Mn((V(),H(`span`,DGt,[Yr(B(O9),{text:u.value},null,8,[`text`])])),[[B(Sp),{...B(i),text:u.value,appendTo:`parent`}]]),Jr(`span`,OGt,[e.status===B(Li).Pending||e.status===B(Li).Streaming?(V(),Wr(B(du),{key:0,mode:`spin`,size:`mini`,theme:`primary`})):$r(`v-if`,!0),Yr(B(O9),{text:d.value},null,8,[`text`]),f.value?(V(),H(`span`,kGt,` (`+Oe(f.value)+`) `,1)):$r(`v-if`,!0)])],2),Mn(Jr(`div`,AGt,[Yr(CGt,{desc:e.toolCall?.function.description,title:B(Ui)(`描述`)},null,8,[`desc`,`title`]),Yr(CGt,{desc:e.toolCall?.function.arguments,title:B(Ui)(`参数`)},null,8,[`desc`,`title`]),e.toolCall?.toolMessage?(V(),Wr(TGt,xe(ri({key:0},e.toolCall.toolMessage)),null,16)):$r(`v-if`,!0)],512),[[wi,!s.value]])]))}}),MGt={class:`ai-assistant-message`},NGt={class:`ai-assistant-message-content`},PGt=Qn({__name:`assistant-message`,props:{toolCalls:{},content:{},id:{},messageId:{},name:{},role:{},status:{},uid:{},property:{}},setup(e){return(t,n)=>(V(),H(`div`,MGt,[Jr(`div`,NGt,[pr(t.$slots,`default`,xe(Xr({content:e.content})),()=>[Yr(o9,{content:e.content||``,status:e.status,type:B(Fi).Text},null,8,[`content`,`status`,`type`])])]),e.toolCalls&&e.toolCalls.length>0?(V(!0),H(Ir,{key:0},dr(e.toolCalls,t=>(V(),Wr(jGt,{key:t.id,status:e.status,"tool-call":t},null,8,[`status`,`tool-call`]))),128)):$r(`v-if`,!0)]))}}),FGt={class:`info-message`},IGt=Qn({__name:`info-message`,props:{content:{},id:{},messageId:{},name:{},role:{},status:{},uid:{},property:{}},setup(e){return(t,n)=>(V(),H(`div`,FGt,[(V(!0),H(Ir,null,dr(Array.isArray(e.content)?e.content:[e.content],(e,t)=>(V(),H(`div`,{key:t,class:`info-message-content`},Oe(e),1))),128))]))}}),LGt={class:`ai-loading-message`},RGt=Qn({__name:`loading-message`,setup(e){return(e,t)=>(V(),H(`div`,LGt,[Yr($d,{size:18}),pr(e.$slots,`default`,{},()=>[Qr(Oe(B(Ui)(`请求中...`)),1)])]))}}),zGt={class:`ai-reasoning-message`},BGt={key:0,class:`ai-reasoning-message-title-icon`},VGt={class:`ai-reasoning-message-title-text`},HGt={class:`ai-reasoning-message-content`},UGt=Qn({__name:`reasoning-message`,props:yr({duration:{},content:{},id:{},messageId:{},name:{},role:{},status:{},uid:{},property:{}},{collapsed:{type:Boolean,default:!1},collapsedModifiers:{}}),emits:[`update:collapsed`],setup(e){let t=e,n=Er(e,`collapsed`),{stop:r}=Ln(()=>t.duration,async e=>{e&&(n.value=!0,await En(),r?.())},{immediate:!0}),i=fi(()=>{switch(t.status){case Li.Pending:return Ui(`思考中`);case Li.Success:case Li.Complete:return Ui(`已思考完成`)+(t.duration?` (${Ui(`耗时`)} :${Xre(t.duration)})`:``);case Li.Error:return Ui(`思考失败`);default:return Ui(`思考中`)}});return(t,r)=>(V(),H(`div`,zGt,[Jr(`div`,{class:be([`ai-reasoning-message-title`,{"ai-reasoning-message-title-collapsed":n.value,"is-thinking":e.status===B(Li).Pending||e.status===B(Li).Streaming,"is-complete":e.status===B(Li).Complete||e.status===B(Li).Success,"is-error":e.status===B(Li).Error}]),onClick:r[0]||=e=>n.value=!n.value},[e.status===B(Li).Pending||e.status===B(Li).Streaming?(V(),H(`span`,BGt,[Yr($d)])):$r(`v-if`,!0),Jr(`span`,VGt,Oe(i.value),1),$r(` <template v-if="status === MessageStatus.Pending || status === MessageStatus.Streaming">
3487
+ 通过 Shift + Enter 进行换行输入`},prompts:{default:()=>[]},resources:{default:()=>[]},shortcutId:{},shortcuts:{},skills:{default:()=>[]},supportUpload:{type:Boolean,default:!0},tippyOptions:{}},{cite:{required:!1,default:``},citeModifiers:{}}),emits:yr([`selectShortcut`,`deleteShortcut`,`update:modelValue`],[`update:cite`]),setup(e,{expose:t,emit:n}){let r=$n(`aiSlashInputRef`),i=$n(`filesRef`),a=Er(e,`cite`),o=sn(200),s=e,l=n,u=on(s.defaultUploadFiles||[]),d=fi(()=>s.shortcuts?.find(e=>e.id===s.shortcutId)),f=fi(()=>s.messageStatus&&[Li.Pending,Li.Streaming,Li.Fetching].includes(s.messageStatus)?s.messageStatus:s.modelValue?.length<1||Array.isArray(s.modelValue)&&!u9(s.modelValue).trim()?Li.Disabled:s.messageStatus);Cee(()=>{let e=s.inputMaxHeight||200;if(u.value.length<1||!i.value){o.value=e;return}o.value=e+(i.value?.clientHeight||0)});let p=async()=>{try{r.value?.cleanup?.();let e;u.value?.length?(e=u.value?.slice().map(e=>({type:Fi.Binary,url:e.url,mimeType:e.file?.type||``,filename:e.file?.name||``})),s.modelValue&&e.push({type:Fi.Text,text:u9(s.modelValue)})):e=typeof s.modelValue==`string`?s.modelValue:u9(s.modelValue),s.onSendMessage?.(e,s.modelValue),u.value=[]}catch(e){console.error(e)}},m=e=>{if(e.key===`Enter`||e.key===`NumpadEnter`){if(e.shiftKey||f.value===Li.Disabled||f.value===Li.Fetching)return;p()}},h=async()=>{try{s.onStopSending?.()}catch(e){console.error(e)}},g=()=>{a.value=``},_=e=>{l(`selectShortcut`,e)},v=()=>{l(`deleteShortcut`)},y=e=>`${e.name}_${e.size}_${e.lastModified}`,b=(oie/(1024*1024)).toFixed(1),x=async e=>{if(!s.supportUpload)return;if(u.value.length>=3){e.length>0&&Td({message:Ri(e.length,b,Hi),theme:`error`});return}let t=new Set(u.value.map(e=>e.file?y(e.file):``)),n=0;for(let r=0;r<e.length;r++){let i=e[r];if(u.value.length>=3){n+=e.length-r;break}let a=y(i);if(t.has(a)){n+=1;continue}if(i.size<=0||i.size>=2516582.4){n+=1;continue}t.add(a);let o={file:i,status:E9.Pending};u.value.push(o),s.onUpload?.(i).then(e=>{if(e&&typeof e==`object`&&`download_url`in e){o.url=e.download_url,o.status=E9.Success;return}o.status=E9.Error}).catch(()=>{o.status=E9.Error})}n>0&&Td({message:Ri(n,b,Hi),theme:`error`})},S=e=>{u.value=u.value.filter(t=>t.file?t.file!==e.file:t.url?t.url!==e.url:t.filename?t.filename!==e.filename:!0)},C=(e,t)=>{l(`update:modelValue`,e,t)};return t({focus:()=>{r.value?.focus?.()},triggerSendMessage:p}),(t,n)=>(V(),H(`div`,{class:`chat-input-container`,style:he({"--chat-z-index":B($re)})},[pr(t.$slots,`top`),Jr(`div`,{class:`chat-input`,style:he({maxHeight:o.value+`px`})},[pr(t.$slots,`input-header`,{},()=>[a.value?(V(),Wr(BHt,{key:0,class:`chat-input-cite`,content:a.value,onClose:g},null,8,[`content`])):$r(`v-if`,!0)]),pr(t.$slots,`files`,xe(Xr({files:u.value})),()=>[u.value.length?(V(),H(`div`,{key:0,ref_key:`filesRef`,ref:i,class:`chat-input-files`},[Yr(_Ut,{files:u.value,onDeleteFile:S},null,8,[`files`])],512)):$r(`v-if`,!0)]),Yr(BUt,{ref_key:`aiSlashInputRef`,ref:r,"model-value":e.modelValue,placeholder:e.placeholder,prompts:e.prompts,resources:e.resources,skills:e.skills,onKeydown:m,"onUpdate:modelValue":C,onUpload:x},null,8,[`model-value`,`placeholder`,`prompts`,`resources`,`skills`]),Yr(HUt,{"message-state":f.value,"tippy-options":e.tippyOptions,onSendMessage:p,onStopSending:h},{default:jn(()=>[e.supportUpload?(V(),Wr(LHt,{key:0,"tippy-options":e.tippyOptions,onUpload:x},null,8,[`tippy-options`])):$r(`v-if`,!0),e.supportUpload&&(e.shortcuts?.length||d.value)?(V(),H(`span`,UUt)):$r(`v-if`,!0),pr(t.$slots,`attachment`,{},()=>[e.shortcuts&&!d.value?(V(),Wr(uTe,{key:0,shortcuts:e.shortcuts,onSelectShortcut:_},null,8,[`shortcuts`])):$r(`v-if`,!0),d.value?(V(),Wr(tp,{key:1,class:`selected-shortcut-btn`,shortcut:d.value},{append:jn(()=>[Yr(B(Xi),{onClick:v})]),_:1},8,[`shortcut`])):$r(`v-if`,!0)])]),"send-icon":jn(()=>[pr(t.$slots,`send-icon`)]),_:3},8,[`message-state`,`tippy-options`])],4)],4))}}),GUt={class:`ai-delete-confirm`},KUt={class:`ai-delete-confirm__title`},qUt={class:`ai-delete-confirm__desc`},JUt={class:`ai-delete-confirm__actions`},YUt=Qn({__name:`delete-tool`,props:{description:{},id:{},name:{},disabled:{type:Boolean},tippyOptions:{}},emits:[`confirm`,`cancel`],setup(e,{emit:t}){let n=e,r=t,i=$n(`tippyRef`),a=fi(()=>({id:n.id,name:n.name,description:n.description,disabled:n.disabled,tippyOptions:n.tippyOptions})),o=fi(()=>({arrow:!1,interactive:!0,offset:[0,6],theme:`ai-chat-box-light light`,trigger:`click`,appendTo:()=>document.body,...n.tippyOptions||{}})),s=()=>{if(n.disabled)return!1},l=()=>{i.value?.hide?.()},u=()=>{l(),r(`confirm`)},d=()=>{l(),r(`cancel`)};return cr(()=>{l()}),(e,t)=>(V(),Wr(B($f),ri({ref_key:`tippyRef`,ref:i},o.value,{onShow:s}),{content:jn(()=>[Jr(`div`,GUt,[Jr(`div`,KUt,Oe(B(Ui)(`确认删除该回答?`)),1),Jr(`div`,qUt,Oe(B(Ui)(`删除操作无法撤回,请谨慎操作!`)),1),Jr(`div`,JUt,[Yr(B(yu),{size:`small`,theme:`danger`,onClick:u},{default:jn(()=>[Qr(Oe(B(Ui)(`删除`)),1)]),_:1}),Yr(B(yu),{size:`small`,onClick:d},{default:jn(()=>[Qr(Oe(B(Ui)(`取消`)),1)]),_:1})])])]),default:jn(()=>[Yr(Cp,xe(Xr(a.value)),null,16)]),_:1},16))}}),XUt={class:`ai-feedback-title`},ZUt={class:`ai-feedback-reason-list`},QUt=[`onClick`],$Ut={class:`ai-feedback-other`},eWt={class:`ai-feedback-footer`},tWt=Qn({__name:`user-feedback`,props:{loading:{type:Boolean},reasonList:{},title:{}},emits:[`submit`,`cancel`],setup(e,{emit:t}){let n=t,r=sn(``),i=sn([]),a=e=>{i.value.includes(e)?i.value=i.value.filter(t=>t!==e):i.value=[...i.value,e]},o=()=>{n(`submit`,i.value,r.value)},s=()=>{i.value=[],r.value=``,n(`cancel`)};return(t,n)=>(V(),H(`div`,{class:`ai-user-feedback`,onMouseenter:n[1]||=Mi(()=>{},[`stop`,`prevent`])},[Jr(`div`,XUt,Oe(e.title),1),Jr(`div`,ZUt,[e.loading?(V(),H(Ir,{key:0},dr(8,e=>Jr(`div`,{key:e,class:`reason-item ai-skeleton-element`})),64)):(V(!0),H(Ir,{key:1},dr(e.reasonList,e=>(V(),H(`div`,{key:e,class:be([`reason-item`,{"is-active":i.value.includes(e)}]),onClick:t=>a(e)},Oe(e),11,QUt))),128))]),Jr(`div`,$Ut,[Yr(B(Au),{modelValue:r.value,"onUpdate:modelValue":n[0]||=e=>r.value=e,placeholder:B(Ui)(`说出您的想法`),rows:3,type:`textarea`},null,8,[`modelValue`,`placeholder`])]),Jr(`div`,eWt,[Yr(B(yu),{class:`custom-btn`,disabled:!r.value&&i.value.length===0,size:`small`,theme:`primary`,onClick:o},{default:jn(()=>[Qr(Oe(B(Ui)(`提交`)),1)]),_:1},8,[`disabled`]),Yr(B(yu),{class:`custom-btn`,size:`small`,width:`80px`,onClick:s},{default:jn(()=>[Qr(Oe(B(Ui)(`取消`)),1)]),_:1})])],32))}}),nWt={ref:`messageToolsRef`,class:`message-tools-container`},rWt={class:`message-tools`,style:{"margin-right":`8px`}},iWt={key:0,class:`ai-divider`,style:{"margin-right":`8px`}},aWt={class:`message-tools`},oWt=Qn({__name:`message-tools`,props:{messageTools:{default:()=>rie},messageToolsStatus:{},onAction:{},tippyOptions:{},updateTools:{default:()=>aie}},emits:[`feedback`],setup(e,{emit:t}){let n=e,r=t,i=$n(`feedbackTippyRef`),a=sn(!1),o=sn([]),s=sn(null),l=fi(()=>({arrow:!1,interactive:!0,offset:[0,6],theme:`ai-chat-box-light light`,trigger:`click`,appendTo:()=>document.body,...n.tippyOptions||{}})),u=async e=>{if(e.id===`like`||e.id===`unlike`){try{a.value=!0,o.value=[],o.value=await n.onAction?.(e)||[]}finally{a.value=!1}return}await n.onAction?.(e)},d=async e=>{await n.onAction?.(e)},f=()=>{i.value?.forEach(e=>e?.hide?.())},p=e=>s.value?s.value===`like`&&e===`like`?`activeLike`:s.value===`unlike`&&e===`unlike`?`activeUnLike`:e:e,m=e=>{let t=p(e);return t===`activeLike`?Ui(`取消满意`):t===`activeUnLike`?Ui(`取消不满意`):n.updateTools?.find(e=>e.id===t)?.description||``},h=(e,t,n)=>{f(),s.value===e.id?s.value=null:s.value=e.id,r(`feedback`,e,t,n)},g=e=>{if(n.messageToolsStatus===D9.Disabled)return!1;if(s.value&&s.value===e)return s.value=null,!1};return cr(()=>{f(),o.value=[]}),(t,n)=>(V(),H(`div`,nWt,[Jr(`div`,rWt,[(V(!0),H(Ir,null,dr(e.messageTools,t=>(V(),H(Ir,{key:t.id},[t.id===`delete`?(V(),Wr(YUt,ri({key:0,ref_for:!0},t,{disabled:e.messageToolsStatus===B(D9).Disabled,"tippy-options":e.tippyOptions,onConfirm:e=>d(t)}),null,16,[`disabled`,`tippy-options`,`onConfirm`])):(V(),Wr(Cp,ri({key:1,ref_for:!0},t,{disabled:e.messageToolsStatus===B(D9).Disabled,"tippy-options":e.tippyOptions,onClick:e=>u(t)}),null,16,[`disabled`,`tippy-options`,`onClick`]))],64))),128))]),e.updateTools.length>0?(V(),H(`div`,iWt)):$r(`v-if`,!0),Jr(`div`,aWt,[(V(!0),H(Ir,null,dr(e.updateTools,t=>(V(),H(Ir,{key:t.id},[t.id===`like`||t.id===`unlike`?(V(),Wr(B($f),ri({key:0,ref_for:!0,ref_key:`feedbackTippyRef`,ref:i},{ref_for:!0},l.value,{onShow:e=>g(t.id)}),{content:jn(()=>[Yr(tWt,{loading:a.value,"reason-list":o.value,title:t.id===`like`?B(Ui)(`什么原因让你满意?`):B(Ui)(`什么原因让你不满意?`),onCancel:f,onSubmit:(e,n)=>h(t,e,n)},null,8,[`loading`,`reason-list`,`title`,`onSubmit`])]),default:jn(()=>[Yr(Cp,ri({ref_for:!0},t,{id:p(t.id),active:s.value===t.id,disabled:e.messageToolsStatus===B(D9).Disabled,"tippy-options":{...e.tippyOptions,content:m(t.id)},onClick:e=>u(t)}),null,16,[`id`,`active`,`disabled`,`tippy-options`,`onClick`])]),_:2},1040,[`onShow`])):t.id===`delete`?(V(),Wr(YUt,ri({key:1,ref_for:!0},t,{disabled:e.messageToolsStatus===B(D9).Disabled,"tippy-options":e.tippyOptions,onConfirm:e=>d(t)}),null,16,[`disabled`,`tippy-options`,`onConfirm`])):(V(),Wr(Cp,ri({key:2,ref_for:!0},t,{disabled:e.messageToolsStatus===B(D9).Disabled,"tippy-options":e.tippyOptions,onClick:e=>u(t)}),null,16,[`disabled`,`tippy-options`,`onClick`]))],64))),128))])],512))}}),O9=Qn({name:`HighlightKeyword`,props:{text:{type:String,required:!0}},setup(e){let t=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),n=WTe(),r=fi(()=>{if(!e.text||!n?.value)return e.text;let r=n.value.trim();if(!r)return e.text;let i=RegExp(`(${t(r)})`,`ig`),a=e.text?.toString().split(i);return a.length<=1?e.text:a.map(e=>i.test(e)?U(`span`,{class:sie},e):e)});return()=>U(`span`,r.value)}}),sWt={class:`ai-activity-message`},cWt={class:`ai-activity-message-content`},lWt=Qn({__name:`activity-layout`,props:yr({activityType:{}},{collapsed:{type:Boolean,default:!1},collapsedModifiers:{}}),emits:[`update:collapsed`],setup(e){let t=Er(e,`collapsed`);return(n,r)=>(V(),H(`div`,sWt,[Jr(`div`,{class:`ai-activity-message-title`,onClick:r[0]||=e=>t.value=!t.value},[pr(n.$slots,`title`,xe(Xr({collapsed:t.value}))),e.activityType===B(Fi).FlowAgent?$r(`v-if`,!0):(V(),H(`span`,{key:0,class:be([`ai-activity-message-title-icon collapsed-icon`,{"is-collapsed":t.value}])},[Yr(B(Yi))],2))]),Mn(Jr(`div`,cWt,[pr(n.$slots,`default`)],512),[[wi,!t.value]])]))}}),k9=[{color:`#3A84FF`,icon:null,key:`running`,label:Ui(`执行中`),rawStates:[`CREATED`,`LOOP_READY`,`READY`,`RUNNING`,`BLOCKED`,`ROLLING_BACK`,`ROLL_BACK_SUCCESS`]},{color:`#65C389`,icon:vie,key:`success`,label:Ui(`成功`),rawStates:[`FINISHED`]},{color:`#EA3636`,icon:yie,key:`failed`,label:Ui(`失败`),rawStates:[`FAILED`,`REVOKED`,`ROLL_BACK_FAILED`]},{color:`#F59500`,icon:bie,key:`suspended`,label:Ui(`挂起`),rawStates:[`SUSPENDED`]},{color:`#4D4F56`,dotColor:`#DCDEE5`,icon:xie,key:`pending`,label:Ui(`待执行`),rawStates:[`PENDING`]},{color:`#5B7290`,icon:Sie,key:`skipped`,label:Ui(`跳过`),rawStates:[`SKIPPED`]}],uWt=Object.fromEntries(k9.map(e=>[e.key,e])),dWt=Object.fromEntries(k9.flatMap(e=>e.rawStates.map(t=>[t,e.key]))),fWt=e=>dWt[e]??`running`,pWt=e=>uWt[e].dotColor??uWt[e].color,mWt=e=>{let t=uWt[e].icon;return t?Zr(t):null},hWt=e=>{let t=fi(()=>Array.isArray(e.value)?e.value:[e.value??{}]),n=sn({}),r=e=>n.value[e.task_id]!==!1;return{isTaskExpanded:r,taskList:t,toggleTaskExpanded:e=>{n.value={...n.value,[e.task_id]:!r(e)}},viewTasks:fi(()=>t.value.map(e=>{let t=Object.values(e.nodes??{}).map(e=>{let t=fWt(e.state);return{convergedState:t,dotColor:pWt(t),elapsedTimeText:Zre(e.elapsed_time),id:e.id,name:e.name,raw:e}}),n=t.reduce((e,t)=>e+t.raw.elapsed_time,0),r=fWt(e.task_state??``);return{convergedState:r,hasConfidence:!!e.has_confidence,confidenceTitle:e.confidence_title,isActive:!!e.is_active,nodes:t,raw:e,stateIcon:mWt(r),taskId:e.task_id,taskName:e.task_name,totalTimeText:Zre(n)}})),visibleStats:fi(()=>{let e={};for(let t of k9)e[t.key]=0;for(let n of t.value)for(let[t,r]of Object.entries(n.statistics?.state_counts??{}))e[fWt(t)]+=r;return k9.filter(t=>e[t.key]>0).map(t=>({color:t.color,display:e[t.key]>99?`99+`:String(e[t.key]),dotColor:pWt(t.key),key:t.key,label:t.label}))})}},gWt={class:`ai-detail-section`},_Wt={class:`section-heading`},vWt={class:`section-text`},A9=Qn({__name:`detail-section`,props:{title:{}},setup(e){return(t,n)=>(V(),H(`div`,gWt,[Jr(`div`,_Wt,[n[0]||=Jr(`span`,{class:`section-bar`},null,-1),Jr(`span`,vWt,Oe(e.title),1)]),pr(t.$slots,`default`)]))}}),yWt={class:`ai-simple-table`},bWt={key:0},xWt=[`colspan`],SWt=Qn({__name:`simple-table`,props:{columns:{},data:{}},setup(e){return(t,n)=>(V(),H(`table`,yWt,[Jr(`thead`,null,[Jr(`tr`,null,[(V(!0),H(Ir,null,dr(e.columns,e=>(V(),H(`th`,{key:e.key},Oe(e.label),1))),128))])]),Jr(`tbody`,null,[(V(!0),H(Ir,null,dr(e.data,(t,n)=>(V(),H(`tr`,{key:n},[(V(!0),H(Ir,null,dr(e.columns,e=>(V(),H(`td`,{key:e.key,class:be({"is-break-all":e.breakAll})},Oe(t[e.key]??`--`),3))),128))]))),128)),e.data.length?$r(`v-if`,!0):(V(),H(`tr`,bWt,[Jr(`td`,{class:`is-empty`,colspan:e.columns.length},` -- `,8,xWt)]))])]))}}),CWt={class:`flow-agent-node-detail`},wWt={class:`detail-title`},TWt={key:1,class:`detail-title-content`},EWt={class:`detail-tab-bar`},DWt=[`onClick`],OWt={class:`detail-body`},kWt={class:`skeleton-section`},AWt={class:`skeleton-section`},jWt={class:`info-form`},MWt={class:`info-label`},NWt={class:`info-value`},PWt={class:`info-row`},FWt={class:`info-label`},IWt={class:`info-value`},LWt={key:0,class:`failure-item`},RWt={key:1,class:`failure-item`},zWt={class:`info-row`},BWt={class:`info-label`},VWt={class:`info-value`},HWt={key:0,class:`skeleton-section`},j9=function(e){return e.Config=`config`,e.Output=`output`,e}(j9||{}),UWt=Qn({__name:`flow-agent-node-detail`,props:{data:{},has_confidence:{type:Boolean},loading:{type:Boolean},node_id:{},node_name:{},task_id:{},task_name:{}},setup(e){let t=[{key:j9.Config,label:Ui(`节点配置`)},{key:j9.Output,label:Ui(`节点输出`)}],n=[{key:`key`,label:Ui(`参数名`)},{breakAll:!0,key:`value`,label:Ui(`参数值`)}],r=[{key:`name`,label:Ui(`名称`)},{key:`description`,label:Ui(`变量说明`)},{key:`key`,label:`KEY`}],i=[{key:`key`,label:Ui(`参数名`)},{breakAll:!0,key:`value`,label:Ui(`参数值`)}],a={forced_fail:Hi?`Force Fail`:`强制失败`},o=e,s=sn(j9.Config),l=fi(()=>o.data?.basic_info),u=fi(()=>{let e=l.value;return e?[{label:Ui(`流程模板`),value:e.template_name||`--`},{label:Ui(`节点名称`),value:e.node_name||`--`},{label:Ui(`步骤名称`),value:e.stage_name||`--`},{label:Ui(`是否可选`),value:e.optional?Ui(`是`):Ui(`否`)}]:[]}),d=fi(()=>{let e=l.value;return e?.skippable||e?.auto_retry?.enable}),f=fi(()=>{let e=l.value?.auto_retry;return e?.enable?Hi?`In ${e.interval} seconds, auto retry ${e.times} times`:`在 ${e.interval} 秒后,自动重试 ${e.times} 次`:``}),p=fi(()=>{let e=l.value?.timeout_config;if(!e?.enable)return`--`;let t=a[e.action]??e.action;return Hi?`Timeout ${e.seconds} seconds later, ${t}`:`超时 ${e.seconds} 秒后则${t}`}),m=fi(()=>Object.entries(o.data?.inputs??{}).map(([e,t])=>({key:e,value:_(t)}))),h=fi(()=>(o.data?.plugin_output??[]).map(e=>({description:e.schema?.description||`--`,name:e.name,key:e.key}))),g=fi(()=>(o.data?.outputs??[]).map(e=>({key:e.key,value:_(e.value)}))),_=e=>e==null?`--`:typeof e==`object`?JSON.stringify(e):String(e);return(a,o)=>(V(),H(`div`,CWt,[Jr(`h3`,wWt,[e.loading?(V(),H(Ir,{key:0},[Jr(`span`,null,Oe(B(Ui)(`节点`))+`:`,1),o[0]||=Jr(`span`,{class:`skeleton-title ai-skeleton-element`},null,-1)],64)):(V(),H(`div`,TWt,Oe(B(Ui)(`节点`))+`:`+Oe(l.value?.node_name),1)),pr(a.$slots,`locateButton`)]),Jr(`div`,EWt,[(V(),H(Ir,null,dr(t,e=>Jr(`div`,{key:e.key,class:be([`detail-tab`,{"is-active":s.value===e.key}]),onClick:t=>s.value=e.key},[(V(),Wr(lr(e.key===j9.Config?B(wie):B(Ji)),{class:`detail-tab-icon`})),Qr(` `+Oe(e.label),1)],10,DWt)),64))]),Jr(`div`,OWt,[s.value===j9.Config?(V(),H(Ir,{key:0},[e.loading?(V(),H(Ir,{key:0},[Jr(`div`,kWt,[o[1]||=Jr(`div`,{class:`skeleton-heading ai-skeleton-element`},null,-1),(V(),H(Ir,null,dr(6,e=>Jr(`div`,{key:e,class:`skeleton-row ai-skeleton-element`})),64))]),Jr(`div`,AWt,[o[2]||=Jr(`div`,{class:`skeleton-heading ai-skeleton-element`},null,-1),(V(),H(Ir,null,dr(4,e=>Jr(`div`,{key:e,class:`skeleton-row ai-skeleton-element`})),64))])],64)):(V(),H(Ir,{key:1},[Yr(A9,{title:B(Ui)(`基础信息`)},{default:jn(()=>[Jr(`div`,jWt,[(V(!0),H(Ir,null,dr(u.value,e=>(V(),H(`div`,{key:e.label,class:`info-row`},[Jr(`div`,MWt,Oe(e.label),1),Jr(`div`,NWt,Oe(e.value),1)]))),128)),Jr(`div`,PWt,[Jr(`div`,FWt,Oe(B(Ui)(`失败处理`)),1),Jr(`div`,IWt,[d.value?(V(),H(Ir,{key:0},[l.value?.skippable?(V(),H(`span`,LWt,[o[3]||=Jr(`span`,{class:`tag-badge`},`MS`,-1),Qr(` `+Oe(B(Ui)(`手动跳过`))+Oe(l.value?.auto_retry?.enable?`;`:``),1)])):$r(`v-if`,!0),l.value?.auto_retry?.enable?(V(),H(`span`,RWt,[o[4]||=Jr(`span`,{class:`tag-badge`},`AR`,-1),Qr(` `+Oe(f.value),1)])):$r(`v-if`,!0)],64)):(V(),H(Ir,{key:1},[Qr(`--`)],64))])]),Jr(`div`,zWt,[Jr(`div`,BWt,Oe(B(Ui)(`超时控制`)),1),Jr(`div`,VWt,Oe(p.value),1)])])]),_:1},8,[`title`]),Yr(A9,{title:B(Ui)(`输入参数`)},{default:jn(()=>[Yr(SWt,{columns:n,data:m.value},null,8,[`data`])]),_:1},8,[`title`]),Yr(A9,{title:B(Ui)(`输出参数`)},{default:jn(()=>[Yr(SWt,{columns:r,data:h.value},null,8,[`data`])]),_:1},8,[`title`])],64))],64)):(V(),H(Ir,{key:1},[e.loading?(V(),H(`div`,HWt,[o[5]||=Jr(`div`,{class:`skeleton-heading ai-skeleton-element`},null,-1),(V(),H(Ir,null,dr(5,e=>Jr(`div`,{key:e,class:`skeleton-row ai-skeleton-element`})),64))])):(V(),Wr(A9,{key:1,title:B(Ui)(`结构化输出`)},{default:jn(()=>[Yr(SWt,{columns:i,data:g.value},null,8,[`data`])]),_:1},8,[`title`]))],64))])]))}}),M9=e=>e.task_id==null?``:`${e.task_id}`,WWt=M9,GWt=(e,t)=>e.task_id==null?``:`${e.task_id}|${t.id}|${t.name}`,KWt=e=>{let{messageUid:t,taskList:n}=e,r=DTe(),i=CTe(),a=fi(()=>r.selectedTab.value?.name??``),o=sn(!1),s=()=>{o.value=!0},l=fi(()=>{if(o.value)return a.value;let e=n.value.find(e=>e.is_active);return e?.task_id==null?a.value:M9(e)}),u=e=>{let t=l.value;return t===M9(e)||t===WWt(e)},d=(e,t)=>l.value===GWt(e,t),f=(e,n)=>{let i=e.task_id;i!=null&&(s(),r.addCustomTab?.({label:n.name,name:GWt(e,n),data:{component:UWt,messageUid:t.value,props:{data:{},loading:!0,node_id:n.id,node_name:n.name,task_id:i,task_name:e.task_name}}}))},p=e=>{let n=e?.task_id;n&&(s(),r.addCustomTab?.({label:Ui(`有效证据`),name:WWt(e),data:{component:UWt,messageUid:t.value,props:{data:{},has_confidence:e.has_confidence,loading:!0,task_id:n,task_name:e.task_name}}}))};return Ln(a,(e,t)=>{t!==void 0&&s()}),or(()=>{i?.value&&p(n.value.find(e=>e.is_active&&e.has_confidence))}),cr(()=>{if(i?.value)for(let e of n.value){r.removeCustomTab?.(M9(e)),r.removeCustomTab?.(WWt(e));for(let t of Object.values(e.nodes??{}))r.removeCustomTab?.(GWt(e,t))}}),{displaySelectedTabName:l,isNodeSelected:d,isTaskSelected:u,markUserTabSelection:s,openConfidence:p,openNodeDetail:f}},qWt={class:`ai-activity-message-title-text`},JWt={class:`flow-agent-title-label`},YWt={class:`flow-agent-stat-tooltip`},XWt={class:`flow-agent-stat-tooltip-status`},ZWt={class:`flow-agent-stat-tooltip-label`},QWt={class:`flow-agent-task-state-icon`},$Wt={class:`flow-agent-task-name`},eGt={key:0,class:`flow-agent-task-trailing`},tGt={class:`flow-agent-task-time`},nGt=[`onClick`],rGt={class:`flow-agent-task-nodes`},iGt={class:`flow-agent-node-status`},aGt=[`title`],oGt={key:0,class:`flow-agent-node-trailing`},sGt={class:`flow-agent-node-time`},cGt=[`onClick`],lGt=Qn({__name:`flow-agent-content`,props:yr({content:{},messageUid:{},status:{}},{collapsed:{type:Boolean,default:!1},collapsedModifiers:{}}),emits:[`update:collapsed`],setup(e){let t=e,n=ap(),r=Er(e,`collapsed`),i=HTe(),a=fi(()=>i.value!==Wi.Share),o=fi(()=>t.status===Li.Pending||t.status===Li.Streaming),{isTaskExpanded:s,taskList:l,toggleTaskExpanded:u,viewTasks:d,visibleStats:f}=hWt(fn(t,`content`)),{isNodeSelected:p,isTaskSelected:m,openConfidence:h,openNodeDetail:g}=KWt({messageUid:fn(t,`messageUid`),taskList:l});return(e,t)=>(V(),Wr(lWt,{collapsed:r.value,"onUpdate:collapsed":t[0]||=e=>r.value=e,"activity-type":B(Fi).FlowAgent,class:`flow-agent-activity`},{title:jn(()=>[$r(` hover 整条执行情况栏展示统计 tooltip(设计稿 annotation) `),Yr(B($f),ri({class:`flow-agent-title-bar`,theme:`ai-chat-box-light light`},{...B(n),tag:`div`,arrow:!0,followCursor:!1,offset:[0,10]}),{content:jn(()=>[Jr(`div`,YWt,[(V(!0),H(Ir,null,dr(B(f),e=>(V(),H(`div`,{key:e.key,class:`flow-agent-stat-tooltip-item`},[Jr(`span`,XWt,[e.key===`running`?(V(),Wr(B(du),{key:0,mode:`spin`,size:`mini`,theme:`primary`})):(V(),H(`span`,{key:1,class:`flow-agent-stat-dot`,style:he({borderColor:e.dotColor})},null,4))]),Jr(`span`,ZWt,Oe(e.label)+`:`,1),Jr(`span`,{class:`flow-agent-stat-tooltip-count`,style:he({color:e.color})},Oe(e.display),5)]))),128))])]),default:jn(()=>[Jr(`span`,{class:be([`ai-activity-message-title-icon`,{"icon-collapsed":r.value}])},[o.value?(V(),Wr($d,{key:0,size:12})):(V(),Wr(B(qi),{key:1}))],2),Jr(`span`,qWt,[Jr(`span`,JWt,Oe(B(Ui)(`执行情况`))+`:`,1),(V(!0),H(Ir,null,dr(B(f),e=>(V(),H(`span`,{key:e.key,class:`flow-agent-stat-item`},[e.key===`running`?(V(),Wr(B(du),{key:0,class:`flow-agent-stat-loading`,mode:`spin`,size:`mini`,theme:`primary`})):(V(),H(`span`,{key:1,class:`flow-agent-stat-dot`,style:he({borderColor:e.dotColor})},null,4)),Jr(`span`,{class:`flow-agent-stat-count`,style:he({color:e.color})},Oe(e.display),5)]))),128))])]),_:1},16)]),default:jn(()=>[(V(!0),H(Ir,null,dr(B(d),e=>(V(),H(`div`,{key:e.taskId,class:`flow-agent-task-group`},[Jr(`div`,{class:be([`flow-agent-task-header`,{"has-confidence":e.hasConfidence,"is-selected":B(m)(e.raw)}])},[Jr(`span`,{class:be([`flow-agent-task-arrow`,{"is-expanded":B(s)(e.raw)}])},[Yr(B(qi),{onClick:Mi(t=>B(u)(e.raw),[`stop`])},null,8,[`onClick`])],2),Jr(`span`,QWt,[e.convergedState===`running`?(V(),Wr(B(du),{key:0,mode:`spin`,size:`mini`,theme:`primary`})):(V(),Wr(lr(e.stateIcon),{key:1}))]),Mn((V(),H(`span`,$Wt,[Yr(B(O9),{text:e.taskName},null,8,[`text`])])),[[B(Sp),{...B(n)}]]),a.value?(V(),H(`span`,eGt,[Jr(`span`,tGt,Oe(e.totalTimeText),1),e.hasConfidence?(V(),H(`span`,{key:0,class:`flow-agent-task-action-btn flow-agent-task-confidence-btn`,onClick:Mi(t=>B(h)(e.raw),[`stop`])},[Yr(B(Ji)),Qr(` `+Oe(e.confidenceTitle??B(Ui)(`有效证据`)),1)],8,nGt)):$r(`v-if`,!0)])):$r(`v-if`,!0)],2),Mn(Jr(`div`,rGt,[(V(!0),H(Ir,null,dr(e.nodes,t=>(V(),H(`div`,{key:t.id,class:be([`flow-agent-node-item`,{"is-selected":B(p)(e.raw,t.raw)}])},[Jr(`span`,iGt,[t.convergedState===`running`?(V(),Wr(B(du),{key:0,mode:`spin`,size:`mini`,theme:`primary`})):(V(),H(`span`,{key:1,class:`flow-agent-status-dot`,style:he({borderColor:t.dotColor})},null,4))]),Mn((V(),H(`span`,{class:`flow-agent-node-name`,title:t.name},[Yr(B(O9),{text:t.name},null,8,[`text`])],8,aGt)),[[B(Sp),{...B(n)}]]),a.value?(V(),H(`span`,oGt,[Jr(`span`,sGt,Oe(t.elapsedTimeText),1),Jr(`span`,{class:`flow-agent-node-detail-btn`,onClick:Mi(n=>B(g)(e.raw,t.raw),[`stop`])},[Yr(B(Ji)),Qr(` `+Oe(B(Ui)(`详情`)),1)],8,cGt)])):$r(`v-if`,!0)],2))),128))],512),[[wi,B(s)(e.raw)]])]))),128))]),_:1},8,[`collapsed`,`activity-type`]))}}),uGt={class:`ai-activity-message-title-icon`},dGt={class:`ai-activity-message-title-text`},fGt={class:`knowledge-rag-content`},pGt=Qn({__name:`knowledge-rag-content`,props:yr({content:{},messageUid:{},status:{}},{collapsed:{type:Boolean,default:!1},collapsedModifiers:{}}),emits:[`update:collapsed`],setup(e){let t=e,n=Er(e,`collapsed`),r=fi(()=>t.status===Li.Pending||t.status===Li.Streaming),i=fi(()=>r.value?Ui(`检索中`):Ui(`检索完成`));return(t,a)=>(V(),Wr(lWt,{collapsed:n.value,"onUpdate:collapsed":a[0]||=e=>n.value=e},{title:jn(()=>[Jr(`span`,uGt,[r.value?(V(),Wr($d,{key:0})):(V(),Wr(B(Ki),{key:1,style:{"font-size":`12px`}}))]),Jr(`span`,dGt,Oe(i.value),1)]),default:jn(()=>[Jr(`div`,fGt,[Yr(i9,{content:e.content?.content||``},null,8,[`content`])]),Yr(a9,{content:e.content?.referenceDocument||[]},null,8,[`content`])]),_:1},8,[`collapsed`]))}}),mGt={class:`ai-activity-message-title-icon`},hGt={class:`ai-activity-message-title-text`},gGt=Qn({__name:`reference-doc-content`,props:yr({content:{},messageUid:{}},{collapsed:{type:Boolean,default:!1},collapsedModifiers:{}}),emits:[`update:collapsed`],setup(e){let t=e,n=Er(e,`collapsed`),r=fi(()=>{let e=t.content?.length??0;return Hi?`Reference ${e} documents as reference`:`引用 ${e} 篇资料作为参考`});return(t,i)=>(V(),Wr(lWt,{collapsed:n.value,"onUpdate:collapsed":i[0]||=e=>n.value=e},{title:jn(()=>[Jr(`span`,mGt,[Yr(B(Ki),{style:{"font-size":`12px`}})]),Jr(`span`,hGt,Oe(r.value),1)]),default:jn(()=>[Yr(a9,{content:e.content||[]},null,8,[`content`])]),_:1},8,[`collapsed`]))}}),_Gt=Qn({__name:`activity-message`,props:yr({activityType:{},content:{},id:{},messageId:{},name:{},role:{},status:{},uid:{},property:{}},{collapsed:{type:Boolean,default:!1},collapsedModifiers:{}}),emits:[`update:collapsed`],setup(e){let t={[Fi.FlowAgent]:lGt,[Fi.KnowledgeRag]:pGt,[Fi.ReferenceDocument]:gGt},n=e,r=Er(e,`collapsed`),i=fi(()=>t[n.activityType??``]);return(t,n)=>i.value?(V(),Wr(lr(i.value),{key:0,collapsed:r.value,"onUpdate:collapsed":n[0]||=e=>r.value=e,content:e.content,"message-uid":e.uid,status:e.status},null,40,[`collapsed`,`content`,`message-uid`,`status`])):$r(`v-if`,!0)}}),vGt={class:`toolcall-desc`},yGt={class:`desc-title`},bGt={class:`desc-panel`},xGt={class:`desc-label`},SGt={class:`desc-value`},CGt=Qn({__name:`desc-panel`,props:{desc:{},title:{}},setup(e){let t=e,n=fi(()=>{try{return JSON.parse(t.desc||``)}catch{return t.desc}});return(t,r)=>(V(),H(`div`,vGt,[Jr(`div`,yGt,Oe(e.title),1),Jr(`div`,bGt,[typeof n.value==`object`?(V(!0),H(Ir,{key:0},dr(n.value,(e,t)=>(V(),H(`div`,{key:t,class:`desc-panel-item`},[Jr(`span`,xGt,[Yr(B(O9),{text:t},null,8,[`text`]),r[0]||=Qr(`:`,-1)]),Jr(`span`,SGt,[Yr(B(O9),{style:{"word-break":`break-all`},text:typeof e==`object`&&e?JSON.stringify(e):e},null,8,[`text`])])]))),128)):(V(),Wr(B(O9),{key:1,style:{wordBreak:`break-all`},text:n.value},null,8,[`text`]))])]))}}),wGt={class:`tool-message`},TGt=Qn({__name:`tool-message`,props:{duration:{},error:{type:[Boolean,String]},toolCallId:{},content:{},id:{},messageId:{},name:{},role:{},status:{},uid:{},property:{}},setup(e){return(t,n)=>(V(),H(`div`,wGt,[Yr(CGt,{desc:e.content||(typeof e.error==`string`?e.error:void 0),title:B(Ui)(`返回内容`)},null,8,[`desc`,`title`])]))}}),EGt={class:`ai-toolcall-render`},DGt={class:`toolcall-header-title`},OGt={class:`toolcall-status-title`},kGt={key:1,class:`toolcall-duration`},AGt={class:`ai-toolcall-render-content`},jGt=Qn({__name:`toolcall-render`,props:{duration:{},status:{},toolCall:{}},setup(e){let t=e,n=sn(!0),r=sn(null),i=ap(),{keywordMatched:a,keyword:o}=GTe(()=>[t.toolCall?.function.name,t.toolCall?.function.mcpName,t.toolCall?.function.description,t.toolCall?.function.arguments,t.toolCall?.id]),s=fi(()=>r.value===null?o?.value?.trim()?!a.value:n.value:r.value);function l(){n.value=!s.value,r.value=n.value}let u=fi(()=>{let e=t.toolCall?.function.mcpName||``,n=t.toolCall?.function.name||t.toolCall?.id||``;return e?`${e} / ${n}`:n}),d=fi(()=>{switch(t.status){default:case Li.Pending:return Ui(`调用中`);case Li.Complete:case Li.Success:return Ui(`调用成功`);case Li.Error||t.toolCall?.toolMessage?.error:return Ui(`调用失败`)}}),f=fi(()=>{let e=t.duration||t.toolCall?.toolMessage?.duration;return e?Xre(e):``});return(t,n)=>(V(),H(`div`,EGt,[Jr(`div`,{class:be([`ai-toolcall-render-header`,`toolcall-status-${e.status}`]),onClick:l},[Yr(B(qi),{class:be({"is-collapsed":s.value})},null,8,[`class`]),Qr(` `+Oe(e.toolCall?.function.mcpName?B(Ui)(`调用 MCP:`):B(Ui)(`调用工具:`))+` `,1),Mn((V(),H(`span`,DGt,[Yr(B(O9),{text:u.value},null,8,[`text`])])),[[B(Sp),{...B(i),text:u.value,appendTo:`parent`}]]),Jr(`span`,OGt,[e.status===B(Li).Pending||e.status===B(Li).Streaming?(V(),Wr(B(du),{key:0,mode:`spin`,size:`mini`,theme:`primary`})):$r(`v-if`,!0),Yr(B(O9),{text:d.value},null,8,[`text`]),f.value?(V(),H(`span`,kGt,` (`+Oe(f.value)+`) `,1)):$r(`v-if`,!0)])],2),Mn(Jr(`div`,AGt,[Yr(CGt,{desc:e.toolCall?.function.description,title:B(Ui)(`描述`)},null,8,[`desc`,`title`]),Yr(CGt,{desc:e.toolCall?.function.arguments,title:B(Ui)(`参数`)},null,8,[`desc`,`title`]),e.toolCall?.toolMessage?(V(),Wr(TGt,xe(ri({key:0},e.toolCall.toolMessage)),null,16)):$r(`v-if`,!0)],512),[[wi,!s.value]])]))}}),MGt={class:`ai-assistant-message`},NGt={key:0,class:`ai-assistant-message-content`},PGt=Qn({__name:`assistant-message`,props:{toolCalls:{},content:{},id:{},messageId:{},name:{},role:{},status:{},uid:{},property:{}},setup(e){return(t,n)=>(V(),H(`div`,MGt,[e.content?(V(),H(`div`,NGt,[pr(t.$slots,`default`,xe(Xr({content:e.content})),()=>[Yr(o9,{content:e.content||``,status:e.status,type:B(Fi).Text},null,8,[`content`,`status`,`type`])])])):$r(`v-if`,!0),e.toolCalls&&e.toolCalls.length>0?(V(!0),H(Ir,{key:1},dr(e.toolCalls,t=>(V(),Wr(jGt,{key:t.id,status:t.toolMessage?.status??e.status,"tool-call":t},null,8,[`status`,`tool-call`]))),128)):$r(`v-if`,!0)]))}}),FGt={class:`info-message`},IGt=Qn({__name:`info-message`,props:{content:{},id:{},messageId:{},name:{},role:{},status:{},uid:{},property:{}},setup(e){return(t,n)=>(V(),H(`div`,FGt,[(V(!0),H(Ir,null,dr(Array.isArray(e.content)?e.content:[e.content],(e,t)=>(V(),H(`div`,{key:t,class:`info-message-content`},Oe(e),1))),128))]))}}),LGt={class:`ai-loading-message`},RGt=Qn({__name:`loading-message`,setup(e){return(e,t)=>(V(),H(`div`,LGt,[Yr($d,{size:18}),pr(e.$slots,`default`,{},()=>[Qr(Oe(B(Ui)(`请求中...`)),1)])]))}}),zGt={class:`ai-reasoning-message`},BGt={key:0,class:`ai-reasoning-message-title-icon`},VGt={class:`ai-reasoning-message-title-text`},HGt={class:`ai-reasoning-message-content`},UGt=Qn({__name:`reasoning-message`,props:yr({duration:{},content:{},id:{},messageId:{},name:{},role:{},status:{},uid:{},property:{}},{collapsed:{type:Boolean,default:!1},collapsedModifiers:{}}),emits:[`update:collapsed`],setup(e){let t=e,n=Er(e,`collapsed`),{stop:r}=Ln(()=>t.duration,async e=>{e&&(n.value=!0,await En(),r?.())},{immediate:!0}),i=fi(()=>{switch(t.status){case Li.Pending:return Ui(`思考中`);case Li.Success:case Li.Complete:return Ui(`已思考完成`)+(t.duration?` (${Ui(`耗时`)} :${Xre(t.duration)})`:``);case Li.Error:return Ui(`思考失败`);default:return Ui(`思考中`)}});return(t,r)=>(V(),H(`div`,zGt,[Jr(`div`,{class:be([`ai-reasoning-message-title`,{"ai-reasoning-message-title-collapsed":n.value,"is-thinking":e.status===B(Li).Pending||e.status===B(Li).Streaming,"is-complete":e.status===B(Li).Complete||e.status===B(Li).Success,"is-error":e.status===B(Li).Error}]),onClick:r[0]||=e=>n.value=!n.value},[e.status===B(Li).Pending||e.status===B(Li).Streaming?(V(),H(`span`,BGt,[Yr($d)])):$r(`v-if`,!0),Jr(`span`,VGt,Oe(i.value),1),$r(` <template v-if="status === MessageStatus.Pending || status === MessageStatus.Streaming">
3488
3488
  <ContentLoadingIcon
3489
3489
  v-for="i in 3"
3490
3490
  :key="i"
@@ -3484,7 +3484,7 @@ Input "@" to trigger tool and MCP
3484
3484
  Use Shift + Enter to enter a new line`:`输入 "/" 唤出 Skill
3485
3485
  输入 "\\" 唤出 Prompt
3486
3486
  输入 "@" 唤出 工具和 MCP
3487
- 通过 Shift + Enter 进行换行输入`},prompts:{default:()=>[]},resources:{default:()=>[]},shortcutId:{},shortcuts:{},skills:{default:()=>[]},supportUpload:{type:Boolean,default:!0},tippyOptions:{}},{cite:{required:!1,default:``},citeModifiers:{}}),emits:br([`selectShortcut`,`deleteShortcut`,`update:modelValue`],[`update:cite`]),setup(e,{expose:t,emit:n}){let r=er(`aiSlashInputRef`),i=er(`filesRef`),a=Or(e,`cite`),o=ln(200),s=e,l=n,u=cn(s.defaultUploadFiles||[]),d=mi(()=>s.shortcuts?.find(e=>e.id===s.shortcutId)),f=mi(()=>s.messageStatus&&[zi.Pending,zi.Streaming,zi.Fetching].includes(s.messageStatus)?s.messageStatus:s.modelValue?.length<1||Array.isArray(s.modelValue)&&!u9(s.modelValue).trim()?zi.Disabled:s.messageStatus);Cee(()=>{let e=s.inputMaxHeight||200;if(u.value.length<1||!i.value){o.value=e;return}o.value=e+(i.value?.clientHeight||0)});let p=async()=>{try{r.value?.cleanup?.();let e;u.value?.length?(e=u.value?.slice().map(e=>({type:Li.Binary,url:e.url,mimeType:e.file?.type||``,filename:e.file?.name||``})),s.modelValue&&e.push({type:Li.Text,text:u9(s.modelValue)})):e=typeof s.modelValue==`string`?s.modelValue:u9(s.modelValue),s.onSendMessage?.(e,s.modelValue),u.value=[]}catch(e){console.error(e)}},m=e=>{if(e.key===`Enter`||e.key===`NumpadEnter`){if(e.shiftKey||f.value===zi.Disabled||f.value===zi.Fetching)return;p()}},h=async()=>{try{s.onStopSending?.()}catch(e){console.error(e)}},g=()=>{a.value=``},_=e=>{l(`selectShortcut`,e)},v=()=>{l(`deleteShortcut`)},y=e=>`${e.name}_${e.size}_${e.lastModified}`,b=(aie/(1024*1024)).toFixed(1),x=async e=>{if(!s.supportUpload)return;if(u.value.length>=3){e.length>0&&Ed({message:Bi(e.length,b,Wi),theme:`error`});return}let t=new Set(u.value.map(e=>e.file?y(e.file):``)),n=0;for(let r=0;r<e.length;r++){let i=e[r];if(u.value.length>=3){n+=e.length-r;break}let a=y(i);if(t.has(a)){n+=1;continue}if(i.size<=0||i.size>=2516582.4){n+=1;continue}t.add(a);let o={file:i,status:E9.Pending};u.value.push(o),s.onUpload?.(i).then(e=>{if(e&&typeof e==`object`&&`download_url`in e){o.url=e.download_url,o.status=E9.Success;return}o.status=E9.Error}).catch(()=>{o.status=E9.Error})}n>0&&Ed({message:Bi(n,b,Wi),theme:`error`})},S=e=>{u.value=u.value.filter(t=>t.file?t.file!==e.file:t.url?t.url!==e.url:t.filename?t.filename!==e.filename:!0)},C=(e,t)=>{l(`update:modelValue`,e,t)};return t({focus:()=>{r.value?.focus?.()},triggerSendMessage:p}),(t,n)=>(V(),H(`div`,{class:`chat-input-container`,style:ge({"--chat-z-index":B(Qre)})},[mr(t.$slots,`top`),Xr(`div`,{class:`chat-input`,style:ge({maxHeight:o.value+`px`})},[mr(t.$slots,`input-header`,{},()=>[a.value?(V(),Kr(VHt,{key:0,class:`chat-input-cite`,content:a.value,onClose:g},null,8,[`content`])):ti(`v-if`,!0)]),mr(t.$slots,`files`,Se(Qr({files:u.value})),()=>[u.value.length?(V(),H(`div`,{key:0,ref_key:`filesRef`,ref:i,class:`chat-input-files`},[Zr(vUt,{files:u.value,onDeleteFile:S},null,8,[`files`])],512)):ti(`v-if`,!0)]),Zr(VUt,{ref_key:`aiSlashInputRef`,ref:r,"model-value":e.modelValue,placeholder:e.placeholder,prompts:e.prompts,resources:e.resources,skills:e.skills,onKeydown:m,"onUpdate:modelValue":C,onUpload:x},null,8,[`model-value`,`placeholder`,`prompts`,`resources`,`skills`]),Zr(UUt,{"message-state":f.value,"tippy-options":e.tippyOptions,onSendMessage:p,onStopSending:h},{default:Mn(()=>[e.supportUpload?(V(),Kr(RHt,{key:0,"tippy-options":e.tippyOptions,onUpload:x},null,8,[`tippy-options`])):ti(`v-if`,!0),e.supportUpload&&(e.shortcuts?.length||d.value)?(V(),H(`span`,WUt)):ti(`v-if`,!0),mr(t.$slots,`attachment`,{},()=>[e.shortcuts&&!d.value?(V(),Kr(lTe,{key:0,shortcuts:e.shortcuts,onSelectShortcut:_},null,8,[`shortcuts`])):ti(`v-if`,!0),d.value?(V(),Kr(rp,{key:1,class:`selected-shortcut-btn`,shortcut:d.value},{append:Mn(()=>[Zr(B(Qi),{onClick:v})]),_:1},8,[`shortcut`])):ti(`v-if`,!0)])]),"send-icon":Mn(()=>[mr(t.$slots,`send-icon`)]),_:3},8,[`message-state`,`tippy-options`])],4)],4))}}),KUt={class:`ai-delete-confirm`},qUt={class:`ai-delete-confirm__title`},JUt={class:`ai-delete-confirm__desc`},YUt={class:`ai-delete-confirm__actions`},XUt=$n({__name:`delete-tool`,props:{description:{},id:{},name:{},disabled:{type:Boolean},tippyOptions:{}},emits:[`confirm`,`cancel`],setup(e,{emit:t}){let n=e,r=t,i=er(`tippyRef`),a=mi(()=>({id:n.id,name:n.name,description:n.description,disabled:n.disabled,tippyOptions:n.tippyOptions})),o=mi(()=>({arrow:!1,interactive:!0,offset:[0,6],theme:`ai-chat-box-light light`,trigger:`click`,appendTo:()=>document.body,...n.tippyOptions||{}})),s=()=>{if(n.disabled)return!1},l=()=>{i.value?.hide?.()},u=()=>{l(),r(`confirm`)},d=()=>{l(),r(`cancel`)};return lr(()=>{l()}),(e,t)=>(V(),Kr(B(tp),ai({ref_key:`tippyRef`,ref:i},o.value,{onShow:s}),{content:Mn(()=>[Xr(`div`,KUt,[Xr(`div`,qUt,ke(B(Gi)(`确认删除该回答?`)),1),Xr(`div`,JUt,ke(B(Gi)(`删除操作无法撤回,请谨慎操作!`)),1),Xr(`div`,YUt,[Zr(B(bu),{size:`small`,theme:`danger`,onClick:u},{default:Mn(()=>[ei(ke(B(Gi)(`删除`)),1)]),_:1}),Zr(B(bu),{size:`small`,onClick:d},{default:Mn(()=>[ei(ke(B(Gi)(`取消`)),1)]),_:1})])])]),default:Mn(()=>[Zr(Tp,Se(Qr(a.value)),null,16)]),_:1},16))}}),ZUt={class:`ai-feedback-title`},QUt={class:`ai-feedback-reason-list`},$Ut=[`onClick`],eWt={class:`ai-feedback-other`},tWt={class:`ai-feedback-footer`},nWt=$n({__name:`user-feedback`,props:{loading:{type:Boolean},reasonList:{},title:{}},emits:[`submit`,`cancel`],setup(e,{emit:t}){let n=t,r=ln(``),i=ln([]),a=e=>{i.value.includes(e)?i.value=i.value.filter(t=>t!==e):i.value=[...i.value,e]},o=()=>{n(`submit`,i.value,r.value)},s=()=>{i.value=[],r.value=``,n(`cancel`)};return(t,n)=>(V(),H(`div`,{class:`ai-user-feedback`,onMouseenter:n[1]||=Pi(()=>{},[`stop`,`prevent`])},[Xr(`div`,ZUt,ke(e.title),1),Xr(`div`,QUt,[e.loading?(V(),H(Rr,{key:0},fr(8,e=>Xr(`div`,{key:e,class:`reason-item ai-skeleton-element`})),64)):(V(!0),H(Rr,{key:1},fr(e.reasonList,e=>(V(),H(`div`,{key:e,class:xe([`reason-item`,{"is-active":i.value.includes(e)}]),onClick:t=>a(e)},ke(e),11,$Ut))),128))]),Xr(`div`,eWt,[Zr(B(ju),{modelValue:r.value,"onUpdate:modelValue":n[0]||=e=>r.value=e,placeholder:B(Gi)(`说出您的想法`),rows:3,type:`textarea`},null,8,[`modelValue`,`placeholder`])]),Xr(`div`,tWt,[Zr(B(bu),{class:`custom-btn`,disabled:!r.value&&i.value.length===0,size:`small`,theme:`primary`,onClick:o},{default:Mn(()=>[ei(ke(B(Gi)(`提交`)),1)]),_:1},8,[`disabled`]),Zr(B(bu),{class:`custom-btn`,size:`small`,width:`80px`,onClick:s},{default:Mn(()=>[ei(ke(B(Gi)(`取消`)),1)]),_:1})])],32))}}),rWt={ref:`messageToolsRef`,class:`message-tools-container`},iWt={class:`message-tools`,style:{"margin-right":`8px`}},aWt={key:0,class:`ai-divider`,style:{"margin-right":`8px`}},oWt={class:`message-tools`},sWt=$n({__name:`message-tools`,props:{messageTools:{default:()=>nie},messageToolsStatus:{},onAction:{},tippyOptions:{},updateTools:{default:()=>iie}},emits:[`feedback`],setup(e,{emit:t}){let n=e,r=t,i=er(`feedbackTippyRef`),a=ln(!1),o=ln([]),s=ln(null),l=mi(()=>({arrow:!1,interactive:!0,offset:[0,6],theme:`ai-chat-box-light light`,trigger:`click`,appendTo:()=>document.body,...n.tippyOptions||{}})),u=async e=>{if(e.id===`like`||e.id===`unlike`){try{a.value=!0,o.value=[],o.value=await n.onAction?.(e)||[]}finally{a.value=!1}return}await n.onAction?.(e)},d=async e=>{await n.onAction?.(e)},f=()=>{i.value?.forEach(e=>e?.hide?.())},p=e=>s.value?s.value===`like`&&e===`like`?`activeLike`:s.value===`unlike`&&e===`unlike`?`activeUnLike`:e:e,m=e=>{let t=p(e);return t===`activeLike`?Gi(`取消满意`):t===`activeUnLike`?Gi(`取消不满意`):n.updateTools?.find(e=>e.id===t)?.description||``},h=(e,t,n)=>{f(),s.value===e.id?s.value=null:s.value=e.id,r(`feedback`,e,t,n)},g=e=>{if(n.messageToolsStatus===D9.Disabled)return!1;if(s.value&&s.value===e)return s.value=null,!1};return lr(()=>{f(),o.value=[]}),(t,n)=>(V(),H(`div`,rWt,[Xr(`div`,iWt,[(V(!0),H(Rr,null,fr(e.messageTools,t=>(V(),H(Rr,{key:t.id},[t.id===`delete`?(V(),Kr(XUt,ai({key:0,ref_for:!0},t,{disabled:e.messageToolsStatus===B(D9).Disabled,"tippy-options":e.tippyOptions,onConfirm:e=>d(t)}),null,16,[`disabled`,`tippy-options`,`onConfirm`])):(V(),Kr(Tp,ai({key:1,ref_for:!0},t,{disabled:e.messageToolsStatus===B(D9).Disabled,"tippy-options":e.tippyOptions,onClick:e=>u(t)}),null,16,[`disabled`,`tippy-options`,`onClick`]))],64))),128))]),e.updateTools.length>0?(V(),H(`div`,aWt)):ti(`v-if`,!0),Xr(`div`,oWt,[(V(!0),H(Rr,null,fr(e.updateTools,t=>(V(),H(Rr,{key:t.id},[t.id===`like`||t.id===`unlike`?(V(),Kr(B(tp),ai({key:0,ref_for:!0,ref_key:`feedbackTippyRef`,ref:i},{ref_for:!0},l.value,{onShow:e=>g(t.id)}),{content:Mn(()=>[Zr(nWt,{loading:a.value,"reason-list":o.value,title:t.id===`like`?B(Gi)(`什么原因让你满意?`):B(Gi)(`什么原因让你不满意?`),onCancel:f,onSubmit:(e,n)=>h(t,e,n)},null,8,[`loading`,`reason-list`,`title`,`onSubmit`])]),default:Mn(()=>[Zr(Tp,ai({ref_for:!0},t,{id:p(t.id),active:s.value===t.id,disabled:e.messageToolsStatus===B(D9).Disabled,"tippy-options":{...e.tippyOptions,content:m(t.id)},onClick:e=>u(t)}),null,16,[`id`,`active`,`disabled`,`tippy-options`,`onClick`])]),_:2},1040,[`onShow`])):t.id===`delete`?(V(),Kr(XUt,ai({key:1,ref_for:!0},t,{disabled:e.messageToolsStatus===B(D9).Disabled,"tippy-options":e.tippyOptions,onConfirm:e=>d(t)}),null,16,[`disabled`,`tippy-options`,`onConfirm`])):(V(),Kr(Tp,ai({key:2,ref_for:!0},t,{disabled:e.messageToolsStatus===B(D9).Disabled,"tippy-options":e.tippyOptions,onClick:e=>u(t)}),null,16,[`disabled`,`tippy-options`,`onClick`]))],64))),128))])],512))}}),O9=$n({name:`HighlightKeyword`,props:{text:{type:String,required:!0}},setup(e){let t=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),n=UTe(),r=mi(()=>{if(!e.text||!n?.value)return e.text;let r=n.value.trim();if(!r)return e.text;let i=RegExp(`(${t(r)})`,`ig`),a=e.text?.toString().split(i);return a.length<=1?e.text:a.map(e=>i.test(e)?U(`span`,{class:oie},e):e)});return()=>U(`span`,r.value)}}),cWt={class:`ai-activity-message`},lWt={class:`ai-activity-message-content`},uWt=$n({__name:`activity-layout`,props:br({activityType:{}},{collapsed:{type:Boolean,default:!1},collapsedModifiers:{}}),emits:[`update:collapsed`],setup(e){let t=Or(e,`collapsed`);return(n,r)=>(V(),H(`div`,cWt,[Xr(`div`,{class:`ai-activity-message-title`,onClick:r[0]||=e=>t.value=!t.value},[mr(n.$slots,`title`,Se(Qr({collapsed:t.value}))),e.activityType===B(Li).FlowAgent?ti(`v-if`,!0):(V(),H(`span`,{key:0,class:xe([`ai-activity-message-title-icon collapsed-icon`,{"is-collapsed":t.value}])},[Zr(B(Zi))],2))]),Nn(Xr(`div`,lWt,[mr(n.$slots,`default`)],512),[[Ei,!t.value]])]))}}),k9=[{color:`#3A84FF`,icon:null,key:`running`,label:Gi(`执行中`),rawStates:[`CREATED`,`LOOP_READY`,`READY`,`RUNNING`,`BLOCKED`,`ROLLING_BACK`,`ROLL_BACK_SUCCESS`]},{color:`#65C389`,icon:_ie,key:`success`,label:Gi(`成功`),rawStates:[`FINISHED`]},{color:`#EA3636`,icon:vie,key:`failed`,label:Gi(`失败`),rawStates:[`FAILED`,`REVOKED`,`ROLL_BACK_FAILED`]},{color:`#F59500`,icon:yie,key:`suspended`,label:Gi(`挂起`),rawStates:[`SUSPENDED`]},{color:`#4D4F56`,dotColor:`#DCDEE5`,icon:bie,key:`pending`,label:Gi(`待执行`),rawStates:[`PENDING`]},{color:`#5B7290`,icon:xie,key:`skipped`,label:Gi(`跳过`),rawStates:[`SKIPPED`]}],dWt=Object.fromEntries(k9.map(e=>[e.key,e])),fWt=Object.fromEntries(k9.flatMap(e=>e.rawStates.map(t=>[t,e.key]))),pWt=e=>fWt[e]??`running`,mWt=e=>dWt[e].dotColor??dWt[e].color,hWt=e=>{let t=dWt[e].icon;return t?$r(t):null},gWt=e=>{let t=mi(()=>Array.isArray(e.value)?e.value:[e.value??{}]),n=ln({}),r=e=>n.value[e.task_id]!==!1;return{isTaskExpanded:r,taskList:t,toggleTaskExpanded:e=>{n.value={...n.value,[e.task_id]:!r(e)}},viewTasks:mi(()=>t.value.map(e=>{let t=Object.values(e.nodes??{}).map(e=>{let t=pWt(e.state);return{convergedState:t,dotColor:mWt(t),elapsedTimeText:Xre(e.elapsed_time),id:e.id,name:e.name,raw:e}}),n=t.reduce((e,t)=>e+t.raw.elapsed_time,0),r=pWt(e.task_state??``);return{convergedState:r,hasConfidence:!!e.has_confidence,confidenceTitle:e.confidence_title,isActive:!!e.is_active,nodes:t,raw:e,stateIcon:hWt(r),taskId:e.task_id,taskName:e.task_name,totalTimeText:Xre(n)}})),visibleStats:mi(()=>{let e={};for(let t of k9)e[t.key]=0;for(let n of t.value)for(let[t,r]of Object.entries(n.statistics?.state_counts??{}))e[pWt(t)]+=r;return k9.filter(t=>e[t.key]>0).map(t=>({color:t.color,display:e[t.key]>99?`99+`:String(e[t.key]),dotColor:mWt(t.key),key:t.key,label:t.label}))})}},_Wt={class:`ai-detail-section`},vWt={class:`section-heading`},yWt={class:`section-text`},A9=$n({__name:`detail-section`,props:{title:{}},setup(e){return(t,n)=>(V(),H(`div`,_Wt,[Xr(`div`,vWt,[n[0]||=Xr(`span`,{class:`section-bar`},null,-1),Xr(`span`,yWt,ke(e.title),1)]),mr(t.$slots,`default`)]))}}),bWt={class:`ai-simple-table`},xWt={key:0},SWt=[`colspan`],CWt=$n({__name:`simple-table`,props:{columns:{},data:{}},setup(e){return(t,n)=>(V(),H(`table`,bWt,[Xr(`thead`,null,[Xr(`tr`,null,[(V(!0),H(Rr,null,fr(e.columns,e=>(V(),H(`th`,{key:e.key},ke(e.label),1))),128))])]),Xr(`tbody`,null,[(V(!0),H(Rr,null,fr(e.data,(t,n)=>(V(),H(`tr`,{key:n},[(V(!0),H(Rr,null,fr(e.columns,e=>(V(),H(`td`,{key:e.key,class:xe({"is-break-all":e.breakAll})},ke(t[e.key]??`--`),3))),128))]))),128)),e.data.length?ti(`v-if`,!0):(V(),H(`tr`,xWt,[Xr(`td`,{class:`is-empty`,colspan:e.columns.length},` -- `,8,SWt)]))])]))}}),wWt={class:`flow-agent-node-detail`},TWt={class:`detail-title`},EWt={key:1,class:`detail-title-content`},DWt={class:`detail-tab-bar`},OWt=[`onClick`],kWt={class:`detail-body`},AWt={class:`skeleton-section`},jWt={class:`skeleton-section`},MWt={class:`info-form`},NWt={class:`info-label`},PWt={class:`info-value`},FWt={class:`info-row`},IWt={class:`info-label`},LWt={class:`info-value`},RWt={key:0,class:`failure-item`},zWt={key:1,class:`failure-item`},BWt={class:`info-row`},VWt={class:`info-label`},HWt={class:`info-value`},UWt={key:0,class:`skeleton-section`},j9=function(e){return e.Config=`config`,e.Output=`output`,e}(j9||{}),WWt=$n({__name:`flow-agent-node-detail`,props:{data:{},has_confidence:{type:Boolean},loading:{type:Boolean},node_id:{},node_name:{},task_id:{},task_name:{}},setup(e){let t=[{key:j9.Config,label:Gi(`节点配置`)},{key:j9.Output,label:Gi(`节点输出`)}],n=[{key:`key`,label:Gi(`参数名`)},{breakAll:!0,key:`value`,label:Gi(`参数值`)}],r=[{key:`name`,label:Gi(`名称`)},{key:`description`,label:Gi(`变量说明`)},{key:`key`,label:`KEY`}],i=[{key:`key`,label:Gi(`参数名`)},{breakAll:!0,key:`value`,label:Gi(`参数值`)}],a={forced_fail:Wi?`Force Fail`:`强制失败`},o=e,s=ln(j9.Config),l=mi(()=>o.data?.basic_info),u=mi(()=>{let e=l.value;return e?[{label:Gi(`流程模板`),value:e.template_name||`--`},{label:Gi(`节点名称`),value:e.node_name||`--`},{label:Gi(`步骤名称`),value:e.stage_name||`--`},{label:Gi(`是否可选`),value:e.optional?Gi(`是`):Gi(`否`)}]:[]}),d=mi(()=>{let e=l.value;return e?.skippable||e?.auto_retry?.enable}),f=mi(()=>{let e=l.value?.auto_retry;return e?.enable?Wi?`In ${e.interval} seconds, auto retry ${e.times} times`:`在 ${e.interval} 秒后,自动重试 ${e.times} 次`:``}),p=mi(()=>{let e=l.value?.timeout_config;if(!e?.enable)return`--`;let t=a[e.action]??e.action;return Wi?`Timeout ${e.seconds} seconds later, ${t}`:`超时 ${e.seconds} 秒后则${t}`}),m=mi(()=>Object.entries(o.data?.inputs??{}).map(([e,t])=>({key:e,value:_(t)}))),h=mi(()=>(o.data?.plugin_output??[]).map(e=>({description:e.schema?.description||`--`,name:e.name,key:e.key}))),g=mi(()=>(o.data?.outputs??[]).map(e=>({key:e.key,value:_(e.value)}))),_=e=>e==null?`--`:typeof e==`object`?JSON.stringify(e):String(e);return(a,o)=>(V(),H(`div`,wWt,[Xr(`h3`,TWt,[e.loading?(V(),H(Rr,{key:0},[Xr(`span`,null,ke(B(Gi)(`节点`))+`:`,1),o[0]||=Xr(`span`,{class:`skeleton-title ai-skeleton-element`},null,-1)],64)):(V(),H(`div`,EWt,ke(B(Gi)(`节点`))+`:`+ke(l.value?.node_name),1)),mr(a.$slots,`locateButton`)]),Xr(`div`,DWt,[(V(),H(Rr,null,fr(t,e=>Xr(`div`,{key:e.key,class:xe([`detail-tab`,{"is-active":s.value===e.key}]),onClick:t=>s.value=e.key},[(V(),Kr(ur(e.key===j9.Config?B(Cie):B(Xi)),{class:`detail-tab-icon`})),ei(` `+ke(e.label),1)],10,OWt)),64))]),Xr(`div`,kWt,[s.value===j9.Config?(V(),H(Rr,{key:0},[e.loading?(V(),H(Rr,{key:0},[Xr(`div`,AWt,[o[1]||=Xr(`div`,{class:`skeleton-heading ai-skeleton-element`},null,-1),(V(),H(Rr,null,fr(6,e=>Xr(`div`,{key:e,class:`skeleton-row ai-skeleton-element`})),64))]),Xr(`div`,jWt,[o[2]||=Xr(`div`,{class:`skeleton-heading ai-skeleton-element`},null,-1),(V(),H(Rr,null,fr(4,e=>Xr(`div`,{key:e,class:`skeleton-row ai-skeleton-element`})),64))])],64)):(V(),H(Rr,{key:1},[Zr(A9,{title:B(Gi)(`基础信息`)},{default:Mn(()=>[Xr(`div`,MWt,[(V(!0),H(Rr,null,fr(u.value,e=>(V(),H(`div`,{key:e.label,class:`info-row`},[Xr(`div`,NWt,ke(e.label),1),Xr(`div`,PWt,ke(e.value),1)]))),128)),Xr(`div`,FWt,[Xr(`div`,IWt,ke(B(Gi)(`失败处理`)),1),Xr(`div`,LWt,[d.value?(V(),H(Rr,{key:0},[l.value?.skippable?(V(),H(`span`,RWt,[o[3]||=Xr(`span`,{class:`tag-badge`},`MS`,-1),ei(` `+ke(B(Gi)(`手动跳过`))+ke(l.value?.auto_retry?.enable?`;`:``),1)])):ti(`v-if`,!0),l.value?.auto_retry?.enable?(V(),H(`span`,zWt,[o[4]||=Xr(`span`,{class:`tag-badge`},`AR`,-1),ei(` `+ke(f.value),1)])):ti(`v-if`,!0)],64)):(V(),H(Rr,{key:1},[ei(`--`)],64))])]),Xr(`div`,BWt,[Xr(`div`,VWt,ke(B(Gi)(`超时控制`)),1),Xr(`div`,HWt,ke(p.value),1)])])]),_:1},8,[`title`]),Zr(A9,{title:B(Gi)(`输入参数`)},{default:Mn(()=>[Zr(CWt,{columns:n,data:m.value},null,8,[`data`])]),_:1},8,[`title`]),Zr(A9,{title:B(Gi)(`输出参数`)},{default:Mn(()=>[Zr(CWt,{columns:r,data:h.value},null,8,[`data`])]),_:1},8,[`title`])],64))],64)):(V(),H(Rr,{key:1},[e.loading?(V(),H(`div`,UWt,[o[5]||=Xr(`div`,{class:`skeleton-heading ai-skeleton-element`},null,-1),(V(),H(Rr,null,fr(5,e=>Xr(`div`,{key:e,class:`skeleton-row ai-skeleton-element`})),64))])):(V(),Kr(A9,{key:1,title:B(Gi)(`结构化输出`)},{default:Mn(()=>[Zr(CWt,{columns:i,data:g.value},null,8,[`data`])]),_:1},8,[`title`]))],64))])]))}}),M9=e=>e.task_id==null?``:`${e.task_id}`,GWt=M9,KWt=(e,t)=>e.task_id==null?``:`${e.task_id}|${t.id}|${t.name}`,qWt=e=>{let{messageUid:t,taskList:n}=e,r=ETe(),i=STe(),a=mi(()=>r.selectedTab.value?.name??``),o=ln(!1),s=()=>{o.value=!0},l=mi(()=>{if(o.value)return a.value;let e=n.value.find(e=>e.is_active);return e?.task_id==null?a.value:M9(e)}),u=e=>{let t=l.value;return t===M9(e)||t===GWt(e)},d=(e,t)=>l.value===KWt(e,t),f=(e,n)=>{let i=e.task_id;i!=null&&(s(),r.addCustomTab?.({label:n.name,name:KWt(e,n),data:{component:WWt,messageUid:t.value,props:{data:{},loading:!0,node_id:n.id,node_name:n.name,task_id:i,task_name:e.task_name}}}))},p=e=>{let n=e?.task_id;n&&(s(),r.addCustomTab?.({label:Gi(`有效证据`),name:GWt(e),data:{component:WWt,messageUid:t.value,props:{data:{},has_confidence:e.has_confidence,loading:!0,task_id:n,task_name:e.task_name}}}))};return Rn(a,(e,t)=>{t!==void 0&&s()}),sr(()=>{i?.value&&p(n.value.find(e=>e.is_active&&e.has_confidence))}),lr(()=>{if(i?.value)for(let e of n.value){r.removeCustomTab?.(M9(e)),r.removeCustomTab?.(GWt(e));for(let t of Object.values(e.nodes??{}))r.removeCustomTab?.(KWt(e,t))}}),{displaySelectedTabName:l,isNodeSelected:d,isTaskSelected:u,markUserTabSelection:s,openConfidence:p,openNodeDetail:f}},JWt={class:`ai-activity-message-title-text`},YWt={class:`flow-agent-title-label`},XWt={class:`flow-agent-stat-tooltip`},ZWt={class:`flow-agent-stat-tooltip-status`},QWt={class:`flow-agent-stat-tooltip-label`},$Wt={class:`flow-agent-task-state-icon`},eGt={class:`flow-agent-task-name`},tGt={key:0,class:`flow-agent-task-trailing`},nGt={class:`flow-agent-task-time`},rGt=[`onClick`],iGt={class:`flow-agent-task-nodes`},aGt={class:`flow-agent-node-status`},oGt=[`title`],sGt={key:0,class:`flow-agent-node-trailing`},cGt={class:`flow-agent-node-time`},lGt=[`onClick`],uGt=$n({__name:`flow-agent-content`,props:br({content:{},messageUid:{},status:{}},{collapsed:{type:Boolean,default:!1},collapsedModifiers:{}}),emits:[`update:collapsed`],setup(e){let t=e,n=sp(),r=Or(e,`collapsed`),i=VTe(),a=mi(()=>i.value!==Ki.Share),o=mi(()=>t.status===zi.Pending||t.status===zi.Streaming),{isTaskExpanded:s,taskList:l,toggleTaskExpanded:u,viewTasks:d,visibleStats:f}=gWt(mn(t,`content`)),{isNodeSelected:p,isTaskSelected:m,openConfidence:h,openNodeDetail:g}=qWt({messageUid:mn(t,`messageUid`),taskList:l});return(e,t)=>(V(),Kr(uWt,{collapsed:r.value,"onUpdate:collapsed":t[0]||=e=>r.value=e,"activity-type":B(Li).FlowAgent,class:`flow-agent-activity`},{title:Mn(()=>[ti(` hover 整条执行情况栏展示统计 tooltip(设计稿 annotation) `),Zr(B(tp),ai({class:`flow-agent-title-bar`,theme:`ai-chat-box-light light`},{...B(n),tag:`div`,arrow:!0,followCursor:!1,offset:[0,10]}),{content:Mn(()=>[Xr(`div`,XWt,[(V(!0),H(Rr,null,fr(B(f),e=>(V(),H(`div`,{key:e.key,class:`flow-agent-stat-tooltip-item`},[Xr(`span`,ZWt,[e.key===`running`?(V(),Kr(B(fu),{key:0,mode:`spin`,size:`mini`,theme:`primary`})):(V(),H(`span`,{key:1,class:`flow-agent-stat-dot`,style:ge({borderColor:e.dotColor})},null,4))]),Xr(`span`,QWt,ke(e.label)+`:`,1),Xr(`span`,{class:`flow-agent-stat-tooltip-count`,style:ge({color:e.color})},ke(e.display),5)]))),128))])]),default:Mn(()=>[Xr(`span`,{class:xe([`ai-activity-message-title-icon`,{"icon-collapsed":r.value}])},[o.value?(V(),Kr(ef,{key:0,size:12})):(V(),Kr(B(Yi),{key:1}))],2),Xr(`span`,JWt,[Xr(`span`,YWt,ke(B(Gi)(`执行情况`))+`:`,1),(V(!0),H(Rr,null,fr(B(f),e=>(V(),H(`span`,{key:e.key,class:`flow-agent-stat-item`},[e.key===`running`?(V(),Kr(B(fu),{key:0,class:`flow-agent-stat-loading`,mode:`spin`,size:`mini`,theme:`primary`})):(V(),H(`span`,{key:1,class:`flow-agent-stat-dot`,style:ge({borderColor:e.dotColor})},null,4)),Xr(`span`,{class:`flow-agent-stat-count`,style:ge({color:e.color})},ke(e.display),5)]))),128))])]),_:1},16)]),default:Mn(()=>[(V(!0),H(Rr,null,fr(B(d),e=>(V(),H(`div`,{key:e.taskId,class:`flow-agent-task-group`},[Xr(`div`,{class:xe([`flow-agent-task-header`,{"has-confidence":e.hasConfidence,"is-selected":B(m)(e.raw)}])},[Xr(`span`,{class:xe([`flow-agent-task-arrow`,{"is-expanded":B(s)(e.raw)}])},[Zr(B(Yi),{onClick:Pi(t=>B(u)(e.raw),[`stop`])},null,8,[`onClick`])],2),Xr(`span`,$Wt,[e.convergedState===`running`?(V(),Kr(B(fu),{key:0,mode:`spin`,size:`mini`,theme:`primary`})):(V(),Kr(ur(e.stateIcon),{key:1}))]),Nn((V(),H(`span`,eGt,[Zr(B(O9),{text:e.taskName},null,8,[`text`])])),[[B(wp),{...B(n)}]]),a.value?(V(),H(`span`,tGt,[Xr(`span`,nGt,ke(e.totalTimeText),1),e.hasConfidence?(V(),H(`span`,{key:0,class:`flow-agent-task-action-btn flow-agent-task-confidence-btn`,onClick:Pi(t=>B(h)(e.raw),[`stop`])},[Zr(B(Xi)),ei(` `+ke(e.confidenceTitle??B(Gi)(`有效证据`)),1)],8,rGt)):ti(`v-if`,!0)])):ti(`v-if`,!0)],2),Nn(Xr(`div`,iGt,[(V(!0),H(Rr,null,fr(e.nodes,t=>(V(),H(`div`,{key:t.id,class:xe([`flow-agent-node-item`,{"is-selected":B(p)(e.raw,t.raw)}])},[Xr(`span`,aGt,[t.convergedState===`running`?(V(),Kr(B(fu),{key:0,mode:`spin`,size:`mini`,theme:`primary`})):(V(),H(`span`,{key:1,class:`flow-agent-status-dot`,style:ge({borderColor:t.dotColor})},null,4))]),Nn((V(),H(`span`,{class:`flow-agent-node-name`,title:t.name},[Zr(B(O9),{text:t.name},null,8,[`text`])],8,oGt)),[[B(wp),{...B(n)}]]),a.value?(V(),H(`span`,sGt,[Xr(`span`,cGt,ke(t.elapsedTimeText),1),Xr(`span`,{class:`flow-agent-node-detail-btn`,onClick:Pi(n=>B(g)(e.raw,t.raw),[`stop`])},[Zr(B(Xi)),ei(` `+ke(B(Gi)(`详情`)),1)],8,lGt)])):ti(`v-if`,!0)],2))),128))],512),[[Ei,B(s)(e.raw)]])]))),128))]),_:1},8,[`collapsed`,`activity-type`]))}}),dGt={class:`ai-activity-message-title-icon`},fGt={class:`ai-activity-message-title-text`},pGt={class:`knowledge-rag-content`},mGt=$n({__name:`knowledge-rag-content`,props:br({content:{},messageUid:{},status:{}},{collapsed:{type:Boolean,default:!1},collapsedModifiers:{}}),emits:[`update:collapsed`],setup(e){let t=e,n=Or(e,`collapsed`),r=mi(()=>t.status===zi.Pending||t.status===zi.Streaming),i=mi(()=>r.value?Gi(`检索中`):Gi(`检索完成`));return(t,a)=>(V(),Kr(uWt,{collapsed:n.value,"onUpdate:collapsed":a[0]||=e=>n.value=e},{title:Mn(()=>[Xr(`span`,dGt,[r.value?(V(),Kr(ef,{key:0})):(V(),Kr(B(Ji),{key:1,style:{"font-size":`12px`}}))]),Xr(`span`,fGt,ke(i.value),1)]),default:Mn(()=>[Xr(`div`,pGt,[Zr(i9,{content:e.content?.content||``},null,8,[`content`])]),Zr(a9,{content:e.content?.referenceDocument||[]},null,8,[`content`])]),_:1},8,[`collapsed`]))}}),hGt={class:`ai-activity-message-title-icon`},gGt={class:`ai-activity-message-title-text`},_Gt=$n({__name:`reference-doc-content`,props:br({content:{},messageUid:{}},{collapsed:{type:Boolean,default:!1},collapsedModifiers:{}}),emits:[`update:collapsed`],setup(e){let t=e,n=Or(e,`collapsed`),r=mi(()=>{let e=t.content?.length??0;return Wi?`Reference ${e} documents as reference`:`引用 ${e} 篇资料作为参考`});return(t,i)=>(V(),Kr(uWt,{collapsed:n.value,"onUpdate:collapsed":i[0]||=e=>n.value=e},{title:Mn(()=>[Xr(`span`,hGt,[Zr(B(Ji),{style:{"font-size":`12px`}})]),Xr(`span`,gGt,ke(r.value),1)]),default:Mn(()=>[Zr(a9,{content:e.content||[]},null,8,[`content`])]),_:1},8,[`collapsed`]))}}),vGt=$n({__name:`activity-message`,props:br({activityType:{},content:{},id:{},messageId:{},name:{},role:{},status:{},uid:{},property:{}},{collapsed:{type:Boolean,default:!1},collapsedModifiers:{}}),emits:[`update:collapsed`],setup(e){let t={[Li.FlowAgent]:uGt,[Li.KnowledgeRag]:mGt,[Li.ReferenceDocument]:_Gt},n=e,r=Or(e,`collapsed`),i=mi(()=>t[n.activityType??``]);return(t,n)=>i.value?(V(),Kr(ur(i.value),{key:0,collapsed:r.value,"onUpdate:collapsed":n[0]||=e=>r.value=e,content:e.content,"message-uid":e.uid,status:e.status},null,40,[`collapsed`,`content`,`message-uid`,`status`])):ti(`v-if`,!0)}}),yGt={class:`toolcall-desc`},bGt={class:`desc-title`},xGt={class:`desc-panel`},SGt={class:`desc-label`},CGt={class:`desc-value`},wGt=$n({__name:`desc-panel`,props:{desc:{},title:{}},setup(e){let t=e,n=mi(()=>{try{return JSON.parse(t.desc||``)}catch{return t.desc}});return(t,r)=>(V(),H(`div`,yGt,[Xr(`div`,bGt,ke(e.title),1),Xr(`div`,xGt,[typeof n.value==`object`?(V(!0),H(Rr,{key:0},fr(n.value,(e,t)=>(V(),H(`div`,{key:t,class:`desc-panel-item`},[Xr(`span`,SGt,[Zr(B(O9),{text:t},null,8,[`text`]),r[0]||=ei(`:`,-1)]),Xr(`span`,CGt,[Zr(B(O9),{style:{"word-break":`break-all`},text:typeof e==`object`&&e?JSON.stringify(e):e},null,8,[`text`])])]))),128)):(V(),Kr(B(O9),{key:1,style:{wordBreak:`break-all`},text:n.value},null,8,[`text`]))])]))}}),TGt={class:`tool-message`},EGt=$n({__name:`tool-message`,props:{duration:{},error:{type:[Boolean,String]},toolCallId:{},content:{},id:{},messageId:{},name:{},role:{},status:{},uid:{},property:{}},setup(e){return(t,n)=>(V(),H(`div`,TGt,[Zr(wGt,{desc:e.content||(typeof e.error==`string`?e.error:void 0),title:B(Gi)(`返回内容`)},null,8,[`desc`,`title`])]))}}),DGt={class:`ai-toolcall-render`},OGt={class:`toolcall-header-title`},kGt={class:`toolcall-status-title`},AGt={key:1,class:`toolcall-duration`},jGt={class:`ai-toolcall-render-content`},MGt=$n({__name:`toolcall-render`,props:{duration:{},status:{},toolCall:{}},setup(e){let t=e,n=ln(!0),r=ln(null),i=sp(),{keywordMatched:a,keyword:o}=WTe(()=>[t.toolCall?.function.name,t.toolCall?.function.mcpName,t.toolCall?.function.description,t.toolCall?.function.arguments,t.toolCall?.id]),s=mi(()=>r.value===null?o?.value?.trim()?!a.value:n.value:r.value);function l(){n.value=!s.value,r.value=n.value}let u=mi(()=>{let e=t.toolCall?.function.mcpName||``,n=t.toolCall?.function.name||t.toolCall?.id||``;return e?`${e} / ${n}`:n}),d=mi(()=>{switch(t.status){default:case zi.Pending:return Gi(`调用中`);case zi.Complete:case zi.Success:return Gi(`调用成功`);case zi.Error||t.toolCall?.toolMessage?.error:return Gi(`调用失败`)}}),f=mi(()=>{let e=t.duration||t.toolCall?.toolMessage?.duration;return e?Yre(e):``});return(t,n)=>(V(),H(`div`,DGt,[Xr(`div`,{class:xe([`ai-toolcall-render-header`,`toolcall-status-${e.status}`]),onClick:l},[Zr(B(Yi),{class:xe({"is-collapsed":s.value})},null,8,[`class`]),ei(` `+ke(e.toolCall?.function.mcpName?B(Gi)(`调用 MCP:`):B(Gi)(`调用工具:`))+` `,1),Nn((V(),H(`span`,OGt,[Zr(B(O9),{text:u.value},null,8,[`text`])])),[[B(wp),{...B(i),text:u.value,appendTo:`parent`}]]),Xr(`span`,kGt,[e.status===B(zi).Pending||e.status===B(zi).Streaming?(V(),Kr(B(fu),{key:0,mode:`spin`,size:`mini`,theme:`primary`})):ti(`v-if`,!0),Zr(B(O9),{text:d.value},null,8,[`text`]),f.value?(V(),H(`span`,AGt,` (`+ke(f.value)+`) `,1)):ti(`v-if`,!0)])],2),Nn(Xr(`div`,jGt,[Zr(wGt,{desc:e.toolCall?.function.description,title:B(Gi)(`描述`)},null,8,[`desc`,`title`]),Zr(wGt,{desc:e.toolCall?.function.arguments,title:B(Gi)(`参数`)},null,8,[`desc`,`title`]),e.toolCall?.toolMessage?(V(),Kr(EGt,Se(ai({key:0},e.toolCall.toolMessage)),null,16)):ti(`v-if`,!0)],512),[[Ei,!s.value]])]))}}),NGt={class:`ai-assistant-message`},PGt={class:`ai-assistant-message-content`},FGt=$n({__name:`assistant-message`,props:{toolCalls:{},content:{},id:{},messageId:{},name:{},role:{},status:{},uid:{},property:{}},setup(e){return(t,n)=>(V(),H(`div`,NGt,[Xr(`div`,PGt,[mr(t.$slots,`default`,Se(Qr({content:e.content})),()=>[Zr(o9,{content:e.content||``,status:e.status,type:B(Li).Text},null,8,[`content`,`status`,`type`])])]),e.toolCalls&&e.toolCalls.length>0?(V(!0),H(Rr,{key:0},fr(e.toolCalls,t=>(V(),Kr(MGt,{key:t.id,status:e.status,"tool-call":t},null,8,[`status`,`tool-call`]))),128)):ti(`v-if`,!0)]))}}),IGt={class:`info-message`},LGt=$n({__name:`info-message`,props:{content:{},id:{},messageId:{},name:{},role:{},status:{},uid:{},property:{}},setup(e){return(t,n)=>(V(),H(`div`,IGt,[(V(!0),H(Rr,null,fr(Array.isArray(e.content)?e.content:[e.content],(e,t)=>(V(),H(`div`,{key:t,class:`info-message-content`},ke(e),1))),128))]))}}),RGt={class:`ai-loading-message`},zGt=$n({__name:`loading-message`,setup(e){return(e,t)=>(V(),H(`div`,RGt,[Zr(ef,{size:18}),mr(e.$slots,`default`,{},()=>[ei(ke(B(Gi)(`请求中...`)),1)])]))}}),BGt={class:`ai-reasoning-message`},VGt={key:0,class:`ai-reasoning-message-title-icon`},HGt={class:`ai-reasoning-message-title-text`},UGt={class:`ai-reasoning-message-content`},WGt=$n({__name:`reasoning-message`,props:br({duration:{},content:{},id:{},messageId:{},name:{},role:{},status:{},uid:{},property:{}},{collapsed:{type:Boolean,default:!1},collapsedModifiers:{}}),emits:[`update:collapsed`],setup(e){let t=e,n=Or(e,`collapsed`),{stop:r}=Rn(()=>t.duration,async e=>{e&&(n.value=!0,await Dn(),r?.())},{immediate:!0}),i=mi(()=>{switch(t.status){case zi.Pending:return Gi(`思考中`);case zi.Success:case zi.Complete:return Gi(`已思考完成`)+(t.duration?` (${Gi(`耗时`)} :${Yre(t.duration)})`:``);case zi.Error:return Gi(`思考失败`);default:return Gi(`思考中`)}});return(t,r)=>(V(),H(`div`,BGt,[Xr(`div`,{class:xe([`ai-reasoning-message-title`,{"ai-reasoning-message-title-collapsed":n.value,"is-thinking":e.status===B(zi).Pending||e.status===B(zi).Streaming,"is-complete":e.status===B(zi).Complete||e.status===B(zi).Success,"is-error":e.status===B(zi).Error}]),onClick:r[0]||=e=>n.value=!n.value},[e.status===B(zi).Pending||e.status===B(zi).Streaming?(V(),H(`span`,VGt,[Zr(ef)])):ti(`v-if`,!0),Xr(`span`,HGt,ke(i.value),1),ti(` <template v-if="status === MessageStatus.Pending || status === MessageStatus.Streaming">
3487
+ 通过 Shift + Enter 进行换行输入`},prompts:{default:()=>[]},resources:{default:()=>[]},shortcutId:{},shortcuts:{},skills:{default:()=>[]},supportUpload:{type:Boolean,default:!0},tippyOptions:{}},{cite:{required:!1,default:``},citeModifiers:{}}),emits:br([`selectShortcut`,`deleteShortcut`,`update:modelValue`],[`update:cite`]),setup(e,{expose:t,emit:n}){let r=er(`aiSlashInputRef`),i=er(`filesRef`),a=Or(e,`cite`),o=ln(200),s=e,l=n,u=cn(s.defaultUploadFiles||[]),d=mi(()=>s.shortcuts?.find(e=>e.id===s.shortcutId)),f=mi(()=>s.messageStatus&&[zi.Pending,zi.Streaming,zi.Fetching].includes(s.messageStatus)?s.messageStatus:s.modelValue?.length<1||Array.isArray(s.modelValue)&&!u9(s.modelValue).trim()?zi.Disabled:s.messageStatus);Cee(()=>{let e=s.inputMaxHeight||200;if(u.value.length<1||!i.value){o.value=e;return}o.value=e+(i.value?.clientHeight||0)});let p=async()=>{try{r.value?.cleanup?.();let e;u.value?.length?(e=u.value?.slice().map(e=>({type:Li.Binary,url:e.url,mimeType:e.file?.type||``,filename:e.file?.name||``})),s.modelValue&&e.push({type:Li.Text,text:u9(s.modelValue)})):e=typeof s.modelValue==`string`?s.modelValue:u9(s.modelValue),s.onSendMessage?.(e,s.modelValue),u.value=[]}catch(e){console.error(e)}},m=e=>{if(e.key===`Enter`||e.key===`NumpadEnter`){if(e.shiftKey||f.value===zi.Disabled||f.value===zi.Fetching)return;p()}},h=async()=>{try{s.onStopSending?.()}catch(e){console.error(e)}},g=()=>{a.value=``},_=e=>{l(`selectShortcut`,e)},v=()=>{l(`deleteShortcut`)},y=e=>`${e.name}_${e.size}_${e.lastModified}`,b=(aie/(1024*1024)).toFixed(1),x=async e=>{if(!s.supportUpload)return;if(u.value.length>=3){e.length>0&&Ed({message:Bi(e.length,b,Wi),theme:`error`});return}let t=new Set(u.value.map(e=>e.file?y(e.file):``)),n=0;for(let r=0;r<e.length;r++){let i=e[r];if(u.value.length>=3){n+=e.length-r;break}let a=y(i);if(t.has(a)){n+=1;continue}if(i.size<=0||i.size>=2516582.4){n+=1;continue}t.add(a);let o={file:i,status:E9.Pending};u.value.push(o),s.onUpload?.(i).then(e=>{if(e&&typeof e==`object`&&`download_url`in e){o.url=e.download_url,o.status=E9.Success;return}o.status=E9.Error}).catch(()=>{o.status=E9.Error})}n>0&&Ed({message:Bi(n,b,Wi),theme:`error`})},S=e=>{u.value=u.value.filter(t=>t.file?t.file!==e.file:t.url?t.url!==e.url:t.filename?t.filename!==e.filename:!0)},C=(e,t)=>{l(`update:modelValue`,e,t)};return t({focus:()=>{r.value?.focus?.()},triggerSendMessage:p}),(t,n)=>(V(),H(`div`,{class:`chat-input-container`,style:ge({"--chat-z-index":B(Qre)})},[mr(t.$slots,`top`),Xr(`div`,{class:`chat-input`,style:ge({maxHeight:o.value+`px`})},[mr(t.$slots,`input-header`,{},()=>[a.value?(V(),Kr(VHt,{key:0,class:`chat-input-cite`,content:a.value,onClose:g},null,8,[`content`])):ti(`v-if`,!0)]),mr(t.$slots,`files`,Se(Qr({files:u.value})),()=>[u.value.length?(V(),H(`div`,{key:0,ref_key:`filesRef`,ref:i,class:`chat-input-files`},[Zr(vUt,{files:u.value,onDeleteFile:S},null,8,[`files`])],512)):ti(`v-if`,!0)]),Zr(VUt,{ref_key:`aiSlashInputRef`,ref:r,"model-value":e.modelValue,placeholder:e.placeholder,prompts:e.prompts,resources:e.resources,skills:e.skills,onKeydown:m,"onUpdate:modelValue":C,onUpload:x},null,8,[`model-value`,`placeholder`,`prompts`,`resources`,`skills`]),Zr(UUt,{"message-state":f.value,"tippy-options":e.tippyOptions,onSendMessage:p,onStopSending:h},{default:Mn(()=>[e.supportUpload?(V(),Kr(RHt,{key:0,"tippy-options":e.tippyOptions,onUpload:x},null,8,[`tippy-options`])):ti(`v-if`,!0),e.supportUpload&&(e.shortcuts?.length||d.value)?(V(),H(`span`,WUt)):ti(`v-if`,!0),mr(t.$slots,`attachment`,{},()=>[e.shortcuts&&!d.value?(V(),Kr(lTe,{key:0,shortcuts:e.shortcuts,onSelectShortcut:_},null,8,[`shortcuts`])):ti(`v-if`,!0),d.value?(V(),Kr(rp,{key:1,class:`selected-shortcut-btn`,shortcut:d.value},{append:Mn(()=>[Zr(B(Qi),{onClick:v})]),_:1},8,[`shortcut`])):ti(`v-if`,!0)])]),"send-icon":Mn(()=>[mr(t.$slots,`send-icon`)]),_:3},8,[`message-state`,`tippy-options`])],4)],4))}}),KUt={class:`ai-delete-confirm`},qUt={class:`ai-delete-confirm__title`},JUt={class:`ai-delete-confirm__desc`},YUt={class:`ai-delete-confirm__actions`},XUt=$n({__name:`delete-tool`,props:{description:{},id:{},name:{},disabled:{type:Boolean},tippyOptions:{}},emits:[`confirm`,`cancel`],setup(e,{emit:t}){let n=e,r=t,i=er(`tippyRef`),a=mi(()=>({id:n.id,name:n.name,description:n.description,disabled:n.disabled,tippyOptions:n.tippyOptions})),o=mi(()=>({arrow:!1,interactive:!0,offset:[0,6],theme:`ai-chat-box-light light`,trigger:`click`,appendTo:()=>document.body,...n.tippyOptions||{}})),s=()=>{if(n.disabled)return!1},l=()=>{i.value?.hide?.()},u=()=>{l(),r(`confirm`)},d=()=>{l(),r(`cancel`)};return lr(()=>{l()}),(e,t)=>(V(),Kr(B(tp),ai({ref_key:`tippyRef`,ref:i},o.value,{onShow:s}),{content:Mn(()=>[Xr(`div`,KUt,[Xr(`div`,qUt,ke(B(Gi)(`确认删除该回答?`)),1),Xr(`div`,JUt,ke(B(Gi)(`删除操作无法撤回,请谨慎操作!`)),1),Xr(`div`,YUt,[Zr(B(bu),{size:`small`,theme:`danger`,onClick:u},{default:Mn(()=>[ei(ke(B(Gi)(`删除`)),1)]),_:1}),Zr(B(bu),{size:`small`,onClick:d},{default:Mn(()=>[ei(ke(B(Gi)(`取消`)),1)]),_:1})])])]),default:Mn(()=>[Zr(Tp,Se(Qr(a.value)),null,16)]),_:1},16))}}),ZUt={class:`ai-feedback-title`},QUt={class:`ai-feedback-reason-list`},$Ut=[`onClick`],eWt={class:`ai-feedback-other`},tWt={class:`ai-feedback-footer`},nWt=$n({__name:`user-feedback`,props:{loading:{type:Boolean},reasonList:{},title:{}},emits:[`submit`,`cancel`],setup(e,{emit:t}){let n=t,r=ln(``),i=ln([]),a=e=>{i.value.includes(e)?i.value=i.value.filter(t=>t!==e):i.value=[...i.value,e]},o=()=>{n(`submit`,i.value,r.value)},s=()=>{i.value=[],r.value=``,n(`cancel`)};return(t,n)=>(V(),H(`div`,{class:`ai-user-feedback`,onMouseenter:n[1]||=Pi(()=>{},[`stop`,`prevent`])},[Xr(`div`,ZUt,ke(e.title),1),Xr(`div`,QUt,[e.loading?(V(),H(Rr,{key:0},fr(8,e=>Xr(`div`,{key:e,class:`reason-item ai-skeleton-element`})),64)):(V(!0),H(Rr,{key:1},fr(e.reasonList,e=>(V(),H(`div`,{key:e,class:xe([`reason-item`,{"is-active":i.value.includes(e)}]),onClick:t=>a(e)},ke(e),11,$Ut))),128))]),Xr(`div`,eWt,[Zr(B(ju),{modelValue:r.value,"onUpdate:modelValue":n[0]||=e=>r.value=e,placeholder:B(Gi)(`说出您的想法`),rows:3,type:`textarea`},null,8,[`modelValue`,`placeholder`])]),Xr(`div`,tWt,[Zr(B(bu),{class:`custom-btn`,disabled:!r.value&&i.value.length===0,size:`small`,theme:`primary`,onClick:o},{default:Mn(()=>[ei(ke(B(Gi)(`提交`)),1)]),_:1},8,[`disabled`]),Zr(B(bu),{class:`custom-btn`,size:`small`,width:`80px`,onClick:s},{default:Mn(()=>[ei(ke(B(Gi)(`取消`)),1)]),_:1})])],32))}}),rWt={ref:`messageToolsRef`,class:`message-tools-container`},iWt={class:`message-tools`,style:{"margin-right":`8px`}},aWt={key:0,class:`ai-divider`,style:{"margin-right":`8px`}},oWt={class:`message-tools`},sWt=$n({__name:`message-tools`,props:{messageTools:{default:()=>nie},messageToolsStatus:{},onAction:{},tippyOptions:{},updateTools:{default:()=>iie}},emits:[`feedback`],setup(e,{emit:t}){let n=e,r=t,i=er(`feedbackTippyRef`),a=ln(!1),o=ln([]),s=ln(null),l=mi(()=>({arrow:!1,interactive:!0,offset:[0,6],theme:`ai-chat-box-light light`,trigger:`click`,appendTo:()=>document.body,...n.tippyOptions||{}})),u=async e=>{if(e.id===`like`||e.id===`unlike`){try{a.value=!0,o.value=[],o.value=await n.onAction?.(e)||[]}finally{a.value=!1}return}await n.onAction?.(e)},d=async e=>{await n.onAction?.(e)},f=()=>{i.value?.forEach(e=>e?.hide?.())},p=e=>s.value?s.value===`like`&&e===`like`?`activeLike`:s.value===`unlike`&&e===`unlike`?`activeUnLike`:e:e,m=e=>{let t=p(e);return t===`activeLike`?Gi(`取消满意`):t===`activeUnLike`?Gi(`取消不满意`):n.updateTools?.find(e=>e.id===t)?.description||``},h=(e,t,n)=>{f(),s.value===e.id?s.value=null:s.value=e.id,r(`feedback`,e,t,n)},g=e=>{if(n.messageToolsStatus===D9.Disabled)return!1;if(s.value&&s.value===e)return s.value=null,!1};return lr(()=>{f(),o.value=[]}),(t,n)=>(V(),H(`div`,rWt,[Xr(`div`,iWt,[(V(!0),H(Rr,null,fr(e.messageTools,t=>(V(),H(Rr,{key:t.id},[t.id===`delete`?(V(),Kr(XUt,ai({key:0,ref_for:!0},t,{disabled:e.messageToolsStatus===B(D9).Disabled,"tippy-options":e.tippyOptions,onConfirm:e=>d(t)}),null,16,[`disabled`,`tippy-options`,`onConfirm`])):(V(),Kr(Tp,ai({key:1,ref_for:!0},t,{disabled:e.messageToolsStatus===B(D9).Disabled,"tippy-options":e.tippyOptions,onClick:e=>u(t)}),null,16,[`disabled`,`tippy-options`,`onClick`]))],64))),128))]),e.updateTools.length>0?(V(),H(`div`,aWt)):ti(`v-if`,!0),Xr(`div`,oWt,[(V(!0),H(Rr,null,fr(e.updateTools,t=>(V(),H(Rr,{key:t.id},[t.id===`like`||t.id===`unlike`?(V(),Kr(B(tp),ai({key:0,ref_for:!0,ref_key:`feedbackTippyRef`,ref:i},{ref_for:!0},l.value,{onShow:e=>g(t.id)}),{content:Mn(()=>[Zr(nWt,{loading:a.value,"reason-list":o.value,title:t.id===`like`?B(Gi)(`什么原因让你满意?`):B(Gi)(`什么原因让你不满意?`),onCancel:f,onSubmit:(e,n)=>h(t,e,n)},null,8,[`loading`,`reason-list`,`title`,`onSubmit`])]),default:Mn(()=>[Zr(Tp,ai({ref_for:!0},t,{id:p(t.id),active:s.value===t.id,disabled:e.messageToolsStatus===B(D9).Disabled,"tippy-options":{...e.tippyOptions,content:m(t.id)},onClick:e=>u(t)}),null,16,[`id`,`active`,`disabled`,`tippy-options`,`onClick`])]),_:2},1040,[`onShow`])):t.id===`delete`?(V(),Kr(XUt,ai({key:1,ref_for:!0},t,{disabled:e.messageToolsStatus===B(D9).Disabled,"tippy-options":e.tippyOptions,onConfirm:e=>d(t)}),null,16,[`disabled`,`tippy-options`,`onConfirm`])):(V(),Kr(Tp,ai({key:2,ref_for:!0},t,{disabled:e.messageToolsStatus===B(D9).Disabled,"tippy-options":e.tippyOptions,onClick:e=>u(t)}),null,16,[`disabled`,`tippy-options`,`onClick`]))],64))),128))])],512))}}),O9=$n({name:`HighlightKeyword`,props:{text:{type:String,required:!0}},setup(e){let t=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),n=UTe(),r=mi(()=>{if(!e.text||!n?.value)return e.text;let r=n.value.trim();if(!r)return e.text;let i=RegExp(`(${t(r)})`,`ig`),a=e.text?.toString().split(i);return a.length<=1?e.text:a.map(e=>i.test(e)?U(`span`,{class:oie},e):e)});return()=>U(`span`,r.value)}}),cWt={class:`ai-activity-message`},lWt={class:`ai-activity-message-content`},uWt=$n({__name:`activity-layout`,props:br({activityType:{}},{collapsed:{type:Boolean,default:!1},collapsedModifiers:{}}),emits:[`update:collapsed`],setup(e){let t=Or(e,`collapsed`);return(n,r)=>(V(),H(`div`,cWt,[Xr(`div`,{class:`ai-activity-message-title`,onClick:r[0]||=e=>t.value=!t.value},[mr(n.$slots,`title`,Se(Qr({collapsed:t.value}))),e.activityType===B(Li).FlowAgent?ti(`v-if`,!0):(V(),H(`span`,{key:0,class:xe([`ai-activity-message-title-icon collapsed-icon`,{"is-collapsed":t.value}])},[Zr(B(Zi))],2))]),Nn(Xr(`div`,lWt,[mr(n.$slots,`default`)],512),[[Ei,!t.value]])]))}}),k9=[{color:`#3A84FF`,icon:null,key:`running`,label:Gi(`执行中`),rawStates:[`CREATED`,`LOOP_READY`,`READY`,`RUNNING`,`BLOCKED`,`ROLLING_BACK`,`ROLL_BACK_SUCCESS`]},{color:`#65C389`,icon:_ie,key:`success`,label:Gi(`成功`),rawStates:[`FINISHED`]},{color:`#EA3636`,icon:vie,key:`failed`,label:Gi(`失败`),rawStates:[`FAILED`,`REVOKED`,`ROLL_BACK_FAILED`]},{color:`#F59500`,icon:yie,key:`suspended`,label:Gi(`挂起`),rawStates:[`SUSPENDED`]},{color:`#4D4F56`,dotColor:`#DCDEE5`,icon:bie,key:`pending`,label:Gi(`待执行`),rawStates:[`PENDING`]},{color:`#5B7290`,icon:xie,key:`skipped`,label:Gi(`跳过`),rawStates:[`SKIPPED`]}],dWt=Object.fromEntries(k9.map(e=>[e.key,e])),fWt=Object.fromEntries(k9.flatMap(e=>e.rawStates.map(t=>[t,e.key]))),pWt=e=>fWt[e]??`running`,mWt=e=>dWt[e].dotColor??dWt[e].color,hWt=e=>{let t=dWt[e].icon;return t?$r(t):null},gWt=e=>{let t=mi(()=>Array.isArray(e.value)?e.value:[e.value??{}]),n=ln({}),r=e=>n.value[e.task_id]!==!1;return{isTaskExpanded:r,taskList:t,toggleTaskExpanded:e=>{n.value={...n.value,[e.task_id]:!r(e)}},viewTasks:mi(()=>t.value.map(e=>{let t=Object.values(e.nodes??{}).map(e=>{let t=pWt(e.state);return{convergedState:t,dotColor:mWt(t),elapsedTimeText:Xre(e.elapsed_time),id:e.id,name:e.name,raw:e}}),n=t.reduce((e,t)=>e+t.raw.elapsed_time,0),r=pWt(e.task_state??``);return{convergedState:r,hasConfidence:!!e.has_confidence,confidenceTitle:e.confidence_title,isActive:!!e.is_active,nodes:t,raw:e,stateIcon:hWt(r),taskId:e.task_id,taskName:e.task_name,totalTimeText:Xre(n)}})),visibleStats:mi(()=>{let e={};for(let t of k9)e[t.key]=0;for(let n of t.value)for(let[t,r]of Object.entries(n.statistics?.state_counts??{}))e[pWt(t)]+=r;return k9.filter(t=>e[t.key]>0).map(t=>({color:t.color,display:e[t.key]>99?`99+`:String(e[t.key]),dotColor:mWt(t.key),key:t.key,label:t.label}))})}},_Wt={class:`ai-detail-section`},vWt={class:`section-heading`},yWt={class:`section-text`},A9=$n({__name:`detail-section`,props:{title:{}},setup(e){return(t,n)=>(V(),H(`div`,_Wt,[Xr(`div`,vWt,[n[0]||=Xr(`span`,{class:`section-bar`},null,-1),Xr(`span`,yWt,ke(e.title),1)]),mr(t.$slots,`default`)]))}}),bWt={class:`ai-simple-table`},xWt={key:0},SWt=[`colspan`],CWt=$n({__name:`simple-table`,props:{columns:{},data:{}},setup(e){return(t,n)=>(V(),H(`table`,bWt,[Xr(`thead`,null,[Xr(`tr`,null,[(V(!0),H(Rr,null,fr(e.columns,e=>(V(),H(`th`,{key:e.key},ke(e.label),1))),128))])]),Xr(`tbody`,null,[(V(!0),H(Rr,null,fr(e.data,(t,n)=>(V(),H(`tr`,{key:n},[(V(!0),H(Rr,null,fr(e.columns,e=>(V(),H(`td`,{key:e.key,class:xe({"is-break-all":e.breakAll})},ke(t[e.key]??`--`),3))),128))]))),128)),e.data.length?ti(`v-if`,!0):(V(),H(`tr`,xWt,[Xr(`td`,{class:`is-empty`,colspan:e.columns.length},` -- `,8,SWt)]))])]))}}),wWt={class:`flow-agent-node-detail`},TWt={class:`detail-title`},EWt={key:1,class:`detail-title-content`},DWt={class:`detail-tab-bar`},OWt=[`onClick`],kWt={class:`detail-body`},AWt={class:`skeleton-section`},jWt={class:`skeleton-section`},MWt={class:`info-form`},NWt={class:`info-label`},PWt={class:`info-value`},FWt={class:`info-row`},IWt={class:`info-label`},LWt={class:`info-value`},RWt={key:0,class:`failure-item`},zWt={key:1,class:`failure-item`},BWt={class:`info-row`},VWt={class:`info-label`},HWt={class:`info-value`},UWt={key:0,class:`skeleton-section`},j9=function(e){return e.Config=`config`,e.Output=`output`,e}(j9||{}),WWt=$n({__name:`flow-agent-node-detail`,props:{data:{},has_confidence:{type:Boolean},loading:{type:Boolean},node_id:{},node_name:{},task_id:{},task_name:{}},setup(e){let t=[{key:j9.Config,label:Gi(`节点配置`)},{key:j9.Output,label:Gi(`节点输出`)}],n=[{key:`key`,label:Gi(`参数名`)},{breakAll:!0,key:`value`,label:Gi(`参数值`)}],r=[{key:`name`,label:Gi(`名称`)},{key:`description`,label:Gi(`变量说明`)},{key:`key`,label:`KEY`}],i=[{key:`key`,label:Gi(`参数名`)},{breakAll:!0,key:`value`,label:Gi(`参数值`)}],a={forced_fail:Wi?`Force Fail`:`强制失败`},o=e,s=ln(j9.Config),l=mi(()=>o.data?.basic_info),u=mi(()=>{let e=l.value;return e?[{label:Gi(`流程模板`),value:e.template_name||`--`},{label:Gi(`节点名称`),value:e.node_name||`--`},{label:Gi(`步骤名称`),value:e.stage_name||`--`},{label:Gi(`是否可选`),value:e.optional?Gi(`是`):Gi(`否`)}]:[]}),d=mi(()=>{let e=l.value;return e?.skippable||e?.auto_retry?.enable}),f=mi(()=>{let e=l.value?.auto_retry;return e?.enable?Wi?`In ${e.interval} seconds, auto retry ${e.times} times`:`在 ${e.interval} 秒后,自动重试 ${e.times} 次`:``}),p=mi(()=>{let e=l.value?.timeout_config;if(!e?.enable)return`--`;let t=a[e.action]??e.action;return Wi?`Timeout ${e.seconds} seconds later, ${t}`:`超时 ${e.seconds} 秒后则${t}`}),m=mi(()=>Object.entries(o.data?.inputs??{}).map(([e,t])=>({key:e,value:_(t)}))),h=mi(()=>(o.data?.plugin_output??[]).map(e=>({description:e.schema?.description||`--`,name:e.name,key:e.key}))),g=mi(()=>(o.data?.outputs??[]).map(e=>({key:e.key,value:_(e.value)}))),_=e=>e==null?`--`:typeof e==`object`?JSON.stringify(e):String(e);return(a,o)=>(V(),H(`div`,wWt,[Xr(`h3`,TWt,[e.loading?(V(),H(Rr,{key:0},[Xr(`span`,null,ke(B(Gi)(`节点`))+`:`,1),o[0]||=Xr(`span`,{class:`skeleton-title ai-skeleton-element`},null,-1)],64)):(V(),H(`div`,EWt,ke(B(Gi)(`节点`))+`:`+ke(l.value?.node_name),1)),mr(a.$slots,`locateButton`)]),Xr(`div`,DWt,[(V(),H(Rr,null,fr(t,e=>Xr(`div`,{key:e.key,class:xe([`detail-tab`,{"is-active":s.value===e.key}]),onClick:t=>s.value=e.key},[(V(),Kr(ur(e.key===j9.Config?B(Cie):B(Xi)),{class:`detail-tab-icon`})),ei(` `+ke(e.label),1)],10,OWt)),64))]),Xr(`div`,kWt,[s.value===j9.Config?(V(),H(Rr,{key:0},[e.loading?(V(),H(Rr,{key:0},[Xr(`div`,AWt,[o[1]||=Xr(`div`,{class:`skeleton-heading ai-skeleton-element`},null,-1),(V(),H(Rr,null,fr(6,e=>Xr(`div`,{key:e,class:`skeleton-row ai-skeleton-element`})),64))]),Xr(`div`,jWt,[o[2]||=Xr(`div`,{class:`skeleton-heading ai-skeleton-element`},null,-1),(V(),H(Rr,null,fr(4,e=>Xr(`div`,{key:e,class:`skeleton-row ai-skeleton-element`})),64))])],64)):(V(),H(Rr,{key:1},[Zr(A9,{title:B(Gi)(`基础信息`)},{default:Mn(()=>[Xr(`div`,MWt,[(V(!0),H(Rr,null,fr(u.value,e=>(V(),H(`div`,{key:e.label,class:`info-row`},[Xr(`div`,NWt,ke(e.label),1),Xr(`div`,PWt,ke(e.value),1)]))),128)),Xr(`div`,FWt,[Xr(`div`,IWt,ke(B(Gi)(`失败处理`)),1),Xr(`div`,LWt,[d.value?(V(),H(Rr,{key:0},[l.value?.skippable?(V(),H(`span`,RWt,[o[3]||=Xr(`span`,{class:`tag-badge`},`MS`,-1),ei(` `+ke(B(Gi)(`手动跳过`))+ke(l.value?.auto_retry?.enable?`;`:``),1)])):ti(`v-if`,!0),l.value?.auto_retry?.enable?(V(),H(`span`,zWt,[o[4]||=Xr(`span`,{class:`tag-badge`},`AR`,-1),ei(` `+ke(f.value),1)])):ti(`v-if`,!0)],64)):(V(),H(Rr,{key:1},[ei(`--`)],64))])]),Xr(`div`,BWt,[Xr(`div`,VWt,ke(B(Gi)(`超时控制`)),1),Xr(`div`,HWt,ke(p.value),1)])])]),_:1},8,[`title`]),Zr(A9,{title:B(Gi)(`输入参数`)},{default:Mn(()=>[Zr(CWt,{columns:n,data:m.value},null,8,[`data`])]),_:1},8,[`title`]),Zr(A9,{title:B(Gi)(`输出参数`)},{default:Mn(()=>[Zr(CWt,{columns:r,data:h.value},null,8,[`data`])]),_:1},8,[`title`])],64))],64)):(V(),H(Rr,{key:1},[e.loading?(V(),H(`div`,UWt,[o[5]||=Xr(`div`,{class:`skeleton-heading ai-skeleton-element`},null,-1),(V(),H(Rr,null,fr(5,e=>Xr(`div`,{key:e,class:`skeleton-row ai-skeleton-element`})),64))])):(V(),Kr(A9,{key:1,title:B(Gi)(`结构化输出`)},{default:Mn(()=>[Zr(CWt,{columns:i,data:g.value},null,8,[`data`])]),_:1},8,[`title`]))],64))])]))}}),M9=e=>e.task_id==null?``:`${e.task_id}`,GWt=M9,KWt=(e,t)=>e.task_id==null?``:`${e.task_id}|${t.id}|${t.name}`,qWt=e=>{let{messageUid:t,taskList:n}=e,r=ETe(),i=STe(),a=mi(()=>r.selectedTab.value?.name??``),o=ln(!1),s=()=>{o.value=!0},l=mi(()=>{if(o.value)return a.value;let e=n.value.find(e=>e.is_active);return e?.task_id==null?a.value:M9(e)}),u=e=>{let t=l.value;return t===M9(e)||t===GWt(e)},d=(e,t)=>l.value===KWt(e,t),f=(e,n)=>{let i=e.task_id;i!=null&&(s(),r.addCustomTab?.({label:n.name,name:KWt(e,n),data:{component:WWt,messageUid:t.value,props:{data:{},loading:!0,node_id:n.id,node_name:n.name,task_id:i,task_name:e.task_name}}}))},p=e=>{let n=e?.task_id;n&&(s(),r.addCustomTab?.({label:Gi(`有效证据`),name:GWt(e),data:{component:WWt,messageUid:t.value,props:{data:{},has_confidence:e.has_confidence,loading:!0,task_id:n,task_name:e.task_name}}}))};return Rn(a,(e,t)=>{t!==void 0&&s()}),sr(()=>{i?.value&&p(n.value.find(e=>e.is_active&&e.has_confidence))}),lr(()=>{if(i?.value)for(let e of n.value){r.removeCustomTab?.(M9(e)),r.removeCustomTab?.(GWt(e));for(let t of Object.values(e.nodes??{}))r.removeCustomTab?.(KWt(e,t))}}),{displaySelectedTabName:l,isNodeSelected:d,isTaskSelected:u,markUserTabSelection:s,openConfidence:p,openNodeDetail:f}},JWt={class:`ai-activity-message-title-text`},YWt={class:`flow-agent-title-label`},XWt={class:`flow-agent-stat-tooltip`},ZWt={class:`flow-agent-stat-tooltip-status`},QWt={class:`flow-agent-stat-tooltip-label`},$Wt={class:`flow-agent-task-state-icon`},eGt={class:`flow-agent-task-name`},tGt={key:0,class:`flow-agent-task-trailing`},nGt={class:`flow-agent-task-time`},rGt=[`onClick`],iGt={class:`flow-agent-task-nodes`},aGt={class:`flow-agent-node-status`},oGt=[`title`],sGt={key:0,class:`flow-agent-node-trailing`},cGt={class:`flow-agent-node-time`},lGt=[`onClick`],uGt=$n({__name:`flow-agent-content`,props:br({content:{},messageUid:{},status:{}},{collapsed:{type:Boolean,default:!1},collapsedModifiers:{}}),emits:[`update:collapsed`],setup(e){let t=e,n=sp(),r=Or(e,`collapsed`),i=VTe(),a=mi(()=>i.value!==Ki.Share),o=mi(()=>t.status===zi.Pending||t.status===zi.Streaming),{isTaskExpanded:s,taskList:l,toggleTaskExpanded:u,viewTasks:d,visibleStats:f}=gWt(mn(t,`content`)),{isNodeSelected:p,isTaskSelected:m,openConfidence:h,openNodeDetail:g}=qWt({messageUid:mn(t,`messageUid`),taskList:l});return(e,t)=>(V(),Kr(uWt,{collapsed:r.value,"onUpdate:collapsed":t[0]||=e=>r.value=e,"activity-type":B(Li).FlowAgent,class:`flow-agent-activity`},{title:Mn(()=>[ti(` hover 整条执行情况栏展示统计 tooltip(设计稿 annotation) `),Zr(B(tp),ai({class:`flow-agent-title-bar`,theme:`ai-chat-box-light light`},{...B(n),tag:`div`,arrow:!0,followCursor:!1,offset:[0,10]}),{content:Mn(()=>[Xr(`div`,XWt,[(V(!0),H(Rr,null,fr(B(f),e=>(V(),H(`div`,{key:e.key,class:`flow-agent-stat-tooltip-item`},[Xr(`span`,ZWt,[e.key===`running`?(V(),Kr(B(fu),{key:0,mode:`spin`,size:`mini`,theme:`primary`})):(V(),H(`span`,{key:1,class:`flow-agent-stat-dot`,style:ge({borderColor:e.dotColor})},null,4))]),Xr(`span`,QWt,ke(e.label)+`:`,1),Xr(`span`,{class:`flow-agent-stat-tooltip-count`,style:ge({color:e.color})},ke(e.display),5)]))),128))])]),default:Mn(()=>[Xr(`span`,{class:xe([`ai-activity-message-title-icon`,{"icon-collapsed":r.value}])},[o.value?(V(),Kr(ef,{key:0,size:12})):(V(),Kr(B(Yi),{key:1}))],2),Xr(`span`,JWt,[Xr(`span`,YWt,ke(B(Gi)(`执行情况`))+`:`,1),(V(!0),H(Rr,null,fr(B(f),e=>(V(),H(`span`,{key:e.key,class:`flow-agent-stat-item`},[e.key===`running`?(V(),Kr(B(fu),{key:0,class:`flow-agent-stat-loading`,mode:`spin`,size:`mini`,theme:`primary`})):(V(),H(`span`,{key:1,class:`flow-agent-stat-dot`,style:ge({borderColor:e.dotColor})},null,4)),Xr(`span`,{class:`flow-agent-stat-count`,style:ge({color:e.color})},ke(e.display),5)]))),128))])]),_:1},16)]),default:Mn(()=>[(V(!0),H(Rr,null,fr(B(d),e=>(V(),H(`div`,{key:e.taskId,class:`flow-agent-task-group`},[Xr(`div`,{class:xe([`flow-agent-task-header`,{"has-confidence":e.hasConfidence,"is-selected":B(m)(e.raw)}])},[Xr(`span`,{class:xe([`flow-agent-task-arrow`,{"is-expanded":B(s)(e.raw)}])},[Zr(B(Yi),{onClick:Pi(t=>B(u)(e.raw),[`stop`])},null,8,[`onClick`])],2),Xr(`span`,$Wt,[e.convergedState===`running`?(V(),Kr(B(fu),{key:0,mode:`spin`,size:`mini`,theme:`primary`})):(V(),Kr(ur(e.stateIcon),{key:1}))]),Nn((V(),H(`span`,eGt,[Zr(B(O9),{text:e.taskName},null,8,[`text`])])),[[B(wp),{...B(n)}]]),a.value?(V(),H(`span`,tGt,[Xr(`span`,nGt,ke(e.totalTimeText),1),e.hasConfidence?(V(),H(`span`,{key:0,class:`flow-agent-task-action-btn flow-agent-task-confidence-btn`,onClick:Pi(t=>B(h)(e.raw),[`stop`])},[Zr(B(Xi)),ei(` `+ke(e.confidenceTitle??B(Gi)(`有效证据`)),1)],8,rGt)):ti(`v-if`,!0)])):ti(`v-if`,!0)],2),Nn(Xr(`div`,iGt,[(V(!0),H(Rr,null,fr(e.nodes,t=>(V(),H(`div`,{key:t.id,class:xe([`flow-agent-node-item`,{"is-selected":B(p)(e.raw,t.raw)}])},[Xr(`span`,aGt,[t.convergedState===`running`?(V(),Kr(B(fu),{key:0,mode:`spin`,size:`mini`,theme:`primary`})):(V(),H(`span`,{key:1,class:`flow-agent-status-dot`,style:ge({borderColor:t.dotColor})},null,4))]),Nn((V(),H(`span`,{class:`flow-agent-node-name`,title:t.name},[Zr(B(O9),{text:t.name},null,8,[`text`])],8,oGt)),[[B(wp),{...B(n)}]]),a.value?(V(),H(`span`,sGt,[Xr(`span`,cGt,ke(t.elapsedTimeText),1),Xr(`span`,{class:`flow-agent-node-detail-btn`,onClick:Pi(n=>B(g)(e.raw,t.raw),[`stop`])},[Zr(B(Xi)),ei(` `+ke(B(Gi)(`详情`)),1)],8,lGt)])):ti(`v-if`,!0)],2))),128))],512),[[Ei,B(s)(e.raw)]])]))),128))]),_:1},8,[`collapsed`,`activity-type`]))}}),dGt={class:`ai-activity-message-title-icon`},fGt={class:`ai-activity-message-title-text`},pGt={class:`knowledge-rag-content`},mGt=$n({__name:`knowledge-rag-content`,props:br({content:{},messageUid:{},status:{}},{collapsed:{type:Boolean,default:!1},collapsedModifiers:{}}),emits:[`update:collapsed`],setup(e){let t=e,n=Or(e,`collapsed`),r=mi(()=>t.status===zi.Pending||t.status===zi.Streaming),i=mi(()=>r.value?Gi(`检索中`):Gi(`检索完成`));return(t,a)=>(V(),Kr(uWt,{collapsed:n.value,"onUpdate:collapsed":a[0]||=e=>n.value=e},{title:Mn(()=>[Xr(`span`,dGt,[r.value?(V(),Kr(ef,{key:0})):(V(),Kr(B(Ji),{key:1,style:{"font-size":`12px`}}))]),Xr(`span`,fGt,ke(i.value),1)]),default:Mn(()=>[Xr(`div`,pGt,[Zr(i9,{content:e.content?.content||``},null,8,[`content`])]),Zr(a9,{content:e.content?.referenceDocument||[]},null,8,[`content`])]),_:1},8,[`collapsed`]))}}),hGt={class:`ai-activity-message-title-icon`},gGt={class:`ai-activity-message-title-text`},_Gt=$n({__name:`reference-doc-content`,props:br({content:{},messageUid:{}},{collapsed:{type:Boolean,default:!1},collapsedModifiers:{}}),emits:[`update:collapsed`],setup(e){let t=e,n=Or(e,`collapsed`),r=mi(()=>{let e=t.content?.length??0;return Wi?`Reference ${e} documents as reference`:`引用 ${e} 篇资料作为参考`});return(t,i)=>(V(),Kr(uWt,{collapsed:n.value,"onUpdate:collapsed":i[0]||=e=>n.value=e},{title:Mn(()=>[Xr(`span`,hGt,[Zr(B(Ji),{style:{"font-size":`12px`}})]),Xr(`span`,gGt,ke(r.value),1)]),default:Mn(()=>[Zr(a9,{content:e.content||[]},null,8,[`content`])]),_:1},8,[`collapsed`]))}}),vGt=$n({__name:`activity-message`,props:br({activityType:{},content:{},id:{},messageId:{},name:{},role:{},status:{},uid:{},property:{}},{collapsed:{type:Boolean,default:!1},collapsedModifiers:{}}),emits:[`update:collapsed`],setup(e){let t={[Li.FlowAgent]:uGt,[Li.KnowledgeRag]:mGt,[Li.ReferenceDocument]:_Gt},n=e,r=Or(e,`collapsed`),i=mi(()=>t[n.activityType??``]);return(t,n)=>i.value?(V(),Kr(ur(i.value),{key:0,collapsed:r.value,"onUpdate:collapsed":n[0]||=e=>r.value=e,content:e.content,"message-uid":e.uid,status:e.status},null,40,[`collapsed`,`content`,`message-uid`,`status`])):ti(`v-if`,!0)}}),yGt={class:`toolcall-desc`},bGt={class:`desc-title`},xGt={class:`desc-panel`},SGt={class:`desc-label`},CGt={class:`desc-value`},wGt=$n({__name:`desc-panel`,props:{desc:{},title:{}},setup(e){let t=e,n=mi(()=>{try{return JSON.parse(t.desc||``)}catch{return t.desc}});return(t,r)=>(V(),H(`div`,yGt,[Xr(`div`,bGt,ke(e.title),1),Xr(`div`,xGt,[typeof n.value==`object`?(V(!0),H(Rr,{key:0},fr(n.value,(e,t)=>(V(),H(`div`,{key:t,class:`desc-panel-item`},[Xr(`span`,SGt,[Zr(B(O9),{text:t},null,8,[`text`]),r[0]||=ei(`:`,-1)]),Xr(`span`,CGt,[Zr(B(O9),{style:{"word-break":`break-all`},text:typeof e==`object`&&e?JSON.stringify(e):e},null,8,[`text`])])]))),128)):(V(),Kr(B(O9),{key:1,style:{wordBreak:`break-all`},text:n.value},null,8,[`text`]))])]))}}),TGt={class:`tool-message`},EGt=$n({__name:`tool-message`,props:{duration:{},error:{type:[Boolean,String]},toolCallId:{},content:{},id:{},messageId:{},name:{},role:{},status:{},uid:{},property:{}},setup(e){return(t,n)=>(V(),H(`div`,TGt,[Zr(wGt,{desc:e.content||(typeof e.error==`string`?e.error:void 0),title:B(Gi)(`返回内容`)},null,8,[`desc`,`title`])]))}}),DGt={class:`ai-toolcall-render`},OGt={class:`toolcall-header-title`},kGt={class:`toolcall-status-title`},AGt={key:1,class:`toolcall-duration`},jGt={class:`ai-toolcall-render-content`},MGt=$n({__name:`toolcall-render`,props:{duration:{},status:{},toolCall:{}},setup(e){let t=e,n=ln(!0),r=ln(null),i=sp(),{keywordMatched:a,keyword:o}=WTe(()=>[t.toolCall?.function.name,t.toolCall?.function.mcpName,t.toolCall?.function.description,t.toolCall?.function.arguments,t.toolCall?.id]),s=mi(()=>r.value===null?o?.value?.trim()?!a.value:n.value:r.value);function l(){n.value=!s.value,r.value=n.value}let u=mi(()=>{let e=t.toolCall?.function.mcpName||``,n=t.toolCall?.function.name||t.toolCall?.id||``;return e?`${e} / ${n}`:n}),d=mi(()=>{switch(t.status){default:case zi.Pending:return Gi(`调用中`);case zi.Complete:case zi.Success:return Gi(`调用成功`);case zi.Error||t.toolCall?.toolMessage?.error:return Gi(`调用失败`)}}),f=mi(()=>{let e=t.duration||t.toolCall?.toolMessage?.duration;return e?Yre(e):``});return(t,n)=>(V(),H(`div`,DGt,[Xr(`div`,{class:xe([`ai-toolcall-render-header`,`toolcall-status-${e.status}`]),onClick:l},[Zr(B(Yi),{class:xe({"is-collapsed":s.value})},null,8,[`class`]),ei(` `+ke(e.toolCall?.function.mcpName?B(Gi)(`调用 MCP:`):B(Gi)(`调用工具:`))+` `,1),Nn((V(),H(`span`,OGt,[Zr(B(O9),{text:u.value},null,8,[`text`])])),[[B(wp),{...B(i),text:u.value,appendTo:`parent`}]]),Xr(`span`,kGt,[e.status===B(zi).Pending||e.status===B(zi).Streaming?(V(),Kr(B(fu),{key:0,mode:`spin`,size:`mini`,theme:`primary`})):ti(`v-if`,!0),Zr(B(O9),{text:d.value},null,8,[`text`]),f.value?(V(),H(`span`,AGt,` (`+ke(f.value)+`) `,1)):ti(`v-if`,!0)])],2),Nn(Xr(`div`,jGt,[Zr(wGt,{desc:e.toolCall?.function.description,title:B(Gi)(`描述`)},null,8,[`desc`,`title`]),Zr(wGt,{desc:e.toolCall?.function.arguments,title:B(Gi)(`参数`)},null,8,[`desc`,`title`]),e.toolCall?.toolMessage?(V(),Kr(EGt,Se(ai({key:0},e.toolCall.toolMessage)),null,16)):ti(`v-if`,!0)],512),[[Ei,!s.value]])]))}}),NGt={class:`ai-assistant-message`},PGt={key:0,class:`ai-assistant-message-content`},FGt=$n({__name:`assistant-message`,props:{toolCalls:{},content:{},id:{},messageId:{},name:{},role:{},status:{},uid:{},property:{}},setup(e){return(t,n)=>(V(),H(`div`,NGt,[e.content?(V(),H(`div`,PGt,[mr(t.$slots,`default`,Se(Qr({content:e.content})),()=>[Zr(o9,{content:e.content||``,status:e.status,type:B(Li).Text},null,8,[`content`,`status`,`type`])])])):ti(`v-if`,!0),e.toolCalls&&e.toolCalls.length>0?(V(!0),H(Rr,{key:1},fr(e.toolCalls,t=>(V(),Kr(MGt,{key:t.id,status:t.toolMessage?.status??e.status,"tool-call":t},null,8,[`status`,`tool-call`]))),128)):ti(`v-if`,!0)]))}}),IGt={class:`info-message`},LGt=$n({__name:`info-message`,props:{content:{},id:{},messageId:{},name:{},role:{},status:{},uid:{},property:{}},setup(e){return(t,n)=>(V(),H(`div`,IGt,[(V(!0),H(Rr,null,fr(Array.isArray(e.content)?e.content:[e.content],(e,t)=>(V(),H(`div`,{key:t,class:`info-message-content`},ke(e),1))),128))]))}}),RGt={class:`ai-loading-message`},zGt=$n({__name:`loading-message`,setup(e){return(e,t)=>(V(),H(`div`,RGt,[Zr(ef,{size:18}),mr(e.$slots,`default`,{},()=>[ei(ke(B(Gi)(`请求中...`)),1)])]))}}),BGt={class:`ai-reasoning-message`},VGt={key:0,class:`ai-reasoning-message-title-icon`},HGt={class:`ai-reasoning-message-title-text`},UGt={class:`ai-reasoning-message-content`},WGt=$n({__name:`reasoning-message`,props:br({duration:{},content:{},id:{},messageId:{},name:{},role:{},status:{},uid:{},property:{}},{collapsed:{type:Boolean,default:!1},collapsedModifiers:{}}),emits:[`update:collapsed`],setup(e){let t=e,n=Or(e,`collapsed`),{stop:r}=Rn(()=>t.duration,async e=>{e&&(n.value=!0,await Dn(),r?.())},{immediate:!0}),i=mi(()=>{switch(t.status){case zi.Pending:return Gi(`思考中`);case zi.Success:case zi.Complete:return Gi(`已思考完成`)+(t.duration?` (${Gi(`耗时`)} :${Yre(t.duration)})`:``);case zi.Error:return Gi(`思考失败`);default:return Gi(`思考中`)}});return(t,r)=>(V(),H(`div`,BGt,[Xr(`div`,{class:xe([`ai-reasoning-message-title`,{"ai-reasoning-message-title-collapsed":n.value,"is-thinking":e.status===B(zi).Pending||e.status===B(zi).Streaming,"is-complete":e.status===B(zi).Complete||e.status===B(zi).Success,"is-error":e.status===B(zi).Error}]),onClick:r[0]||=e=>n.value=!n.value},[e.status===B(zi).Pending||e.status===B(zi).Streaming?(V(),H(`span`,VGt,[Zr(ef)])):ti(`v-if`,!0),Xr(`span`,HGt,ke(i.value),1),ti(` <template v-if="status === MessageStatus.Pending || status === MessageStatus.Streaming">
3488
3488
  <ContentLoadingIcon
3489
3489
  v-for="i in 3"
3490
3490
  :key="i"
@@ -51605,7 +51605,10 @@ var iW = ["src"], aW = {
51605
51605
  e.toolCall?.toolMessage ? (V(), p(jK, F(M({ key: 0 }, e.toolCall.toolMessage)), null, 16)) : m("v-if", !0)
51606
51606
  ], 512), [[de, !s.value]])]));
51607
51607
  }
51608
- }), RK = { class: "ai-assistant-message" }, zK = { class: "ai-assistant-message-content" }, BK = /* @__PURE__ */ x({
51608
+ }), RK = { class: "ai-assistant-message" }, zK = {
51609
+ key: 0,
51610
+ class: "ai-assistant-message-content"
51611
+ }, BK = /* @__PURE__ */ x({
51609
51612
  __name: "assistant-message",
51610
51613
  props: {
51611
51614
  toolCalls: {},
@@ -51619,7 +51622,7 @@ var iW = ["src"], aW = {
51619
51622
  property: {}
51620
51623
  },
51621
51624
  setup(e) {
51622
- return (t, n) => (V(), h("div", RK, [g("div", zK, [W(t.$slots, "default", F(C({ content: e.content })), () => [y(cH, {
51625
+ return (t, n) => (V(), h("div", RK, [e.content ? (V(), h("div", zK, [W(t.$slots, "default", F(C({ content: e.content })), () => [y(cH, {
51623
51626
  content: e.content || "",
51624
51627
  status: e.status,
51625
51628
  type: J(Kk).Text
@@ -51627,9 +51630,9 @@ var iW = ["src"], aW = {
51627
51630
  "content",
51628
51631
  "status",
51629
51632
  "type"
51630
- ])])]), e.toolCalls && e.toolCalls.length > 0 ? (V(!0), h(o, { key: 0 }, U(e.toolCalls, (t) => (V(), p(LK, {
51633
+ ])])])) : m("v-if", !0), e.toolCalls && e.toolCalls.length > 0 ? (V(!0), h(o, { key: 1 }, U(e.toolCalls, (t) => (V(), p(LK, {
51631
51634
  key: t.id,
51632
- status: e.status,
51635
+ status: t.toolMessage?.status ?? e.status,
51633
51636
  "tool-call": t
51634
51637
  }, null, 8, ["status", "tool-call"]))), 128)) : m("v-if", !0)]));
51635
51638
  }
@@ -3487,7 +3487,7 @@ Input "@" to trigger tool and MCP
3487
3487
  Use Shift + Enter to enter a new line`:`输入 "/" 唤出 Skill
3488
3488
  输入 "\\" 唤出 Prompt
3489
3489
  输入 "@" 唤出 工具和 MCP
3490
- 通过 Shift + Enter 进行换行输入`},prompts:{default:()=>[]},resources:{default:()=>[]},shortcutId:{},shortcuts:{},skills:{default:()=>[]},supportUpload:{type:Boolean,default:!0},tippyOptions:{}},{cite:{required:!1,default:``},citeModifiers:{}}),emits:yr([`selectShortcut`,`deleteShortcut`,`update:modelValue`],[`update:cite`]),setup(e,{expose:t,emit:n}){let r=$n(`aiSlashInputRef`),i=$n(`filesRef`),a=Dr(e,`cite`),o=sn(200),s=e,l=n,u=on(s.defaultUploadFiles||[]),d=pi(()=>s.shortcuts?.find(e=>e.id===s.shortcutId)),f=pi(()=>s.messageStatus&&[Sp.Pending,Sp.Streaming,Sp.Fetching].includes(s.messageStatus)?s.messageStatus:s.modelValue?.length<1||Array.isArray(s.modelValue)&&!w9(s.modelValue).trim()?Sp.Disabled:s.messageStatus);Cee(()=>{let e=s.inputMaxHeight||200;if(u.value.length<1||!i.value){o.value=e;return}o.value=e+(i.value?.clientHeight||0)});let p=async()=>{try{r.value?.cleanup?.();let e;u.value?.length?(e=u.value?.slice().map(e=>({type:bp.Binary,url:e.url,mimeType:e.file?.type||``,filename:e.file?.name||``})),s.modelValue&&e.push({type:bp.Text,text:w9(s.modelValue)})):e=typeof s.modelValue==`string`?s.modelValue:w9(s.modelValue),s.onSendMessage?.(e,s.modelValue),u.value=[]}catch(e){console.error(e)}},m=e=>{if(e.key===`Enter`||e.key===`NumpadEnter`){if(e.shiftKey||f.value===Sp.Disabled||f.value===Sp.Fetching)return;p()}},h=async()=>{try{s.onStopSending?.()}catch(e){console.error(e)}},g=()=>{a.value=``},_=e=>{l(`selectShortcut`,e)},v=()=>{l(`deleteShortcut`)},y=e=>`${e.name}_${e.size}_${e.lastModified}`,b=(KTe/(1024*1024)).toFixed(1),x=async e=>{if(!s.supportUpload)return;if(u.value.length>=3){e.length>0&&dd({message:Cp(e.length,b,Dp),theme:`error`});return}let t=new Set(u.value.map(e=>e.file?y(e.file):``)),n=0;for(let r=0;r<e.length;r++){let i=e[r];if(u.value.length>=3){n+=e.length-r;break}let a=y(i);if(t.has(a)){n+=1;continue}if(i.size<=0||i.size>=2516582.4){n+=1;continue}t.add(a);let o={file:i,status:z9.Pending};u.value.push(o),s.onUpload?.(i).then(e=>{if(e&&typeof e==`object`&&`download_url`in e){o.url=e.download_url,o.status=z9.Success;return}o.status=z9.Error}).catch(()=>{o.status=z9.Error})}n>0&&dd({message:Cp(n,b,Dp),theme:`error`})},S=e=>{u.value=u.value.filter(t=>t.file?t.file!==e.file:t.url?t.url!==e.url:t.filename?t.filename!==e.filename:!0)},C=(e,t)=>{l(`update:modelValue`,e,t)};return t({focus:()=>{r.value?.focus?.()},triggerSendMessage:p}),(t,n)=>(V(),H(`div`,{class:`chat-input-container`,style:he({"--chat-z-index":B(zTe)})},[pr(t.$slots,`top`),Yr(`div`,{class:`chat-input`,style:he({maxHeight:o.value+`px`})},[pr(t.$slots,`input-header`,{},()=>[a.value?(V(),Gr(ZUt,{key:0,class:`chat-input-cite`,content:a.value,onClose:g},null,8,[`content`])):ei(`v-if`,!0)]),pr(t.$slots,`files`,xe(Zr({files:u.value})),()=>[u.value.length?(V(),H(`div`,{key:0,ref_key:`filesRef`,ref:i,class:`chat-input-files`},[Xr(OWt,{files:u.value,onDeleteFile:S},null,8,[`files`])],512)):ei(`v-if`,!0)]),Xr(ZWt,{ref_key:`aiSlashInputRef`,ref:r,"model-value":e.modelValue,placeholder:e.placeholder,prompts:e.prompts,resources:e.resources,skills:e.skills,onKeydown:m,"onUpdate:modelValue":C,onUpload:x},null,8,[`model-value`,`placeholder`,`prompts`,`resources`,`skills`]),Xr($Wt,{"message-state":f.value,"tippy-options":e.tippyOptions,onSendMessage:p,onStopSending:h},{default:jn(()=>[e.supportUpload?(V(),Gr(JUt,{key:0,"tippy-options":e.tippyOptions,onUpload:x},null,8,[`tippy-options`])):ei(`v-if`,!0),e.supportUpload&&(e.shortcuts?.length||d.value)?(V(),H(`span`,eGt)):ei(`v-if`,!0),pr(t.$slots,`attachment`,{},()=>[e.shortcuts&&!d.value?(V(),Gr(QEe,{key:0,shortcuts:e.shortcuts,onSelectShortcut:_},null,8,[`shortcuts`])):ei(`v-if`,!0),d.value?(V(),Gr(Lp,{key:1,class:`selected-shortcut-btn`,shortcut:d.value},{append:jn(()=>[Xr(B(Fp),{onClick:v})]),_:1},8,[`shortcut`])):ei(`v-if`,!0)])]),"send-icon":jn(()=>[pr(t.$slots,`send-icon`)]),_:3},8,[`message-state`,`tippy-options`])],4)],4))}}),nGt={class:`ai-delete-confirm`},rGt={class:`ai-delete-confirm__title`},iGt={class:`ai-delete-confirm__desc`},aGt={class:`ai-delete-confirm__actions`},oGt=Qn({__name:`delete-tool`,props:{description:{},id:{},name:{},disabled:{type:Boolean},tippyOptions:{}},emits:[`confirm`,`cancel`],setup(e,{emit:t}){let n=e,r=t,i=$n(`tippyRef`),a=pi(()=>({id:n.id,name:n.name,description:n.description,disabled:n.disabled,tippyOptions:n.tippyOptions})),o=pi(()=>({arrow:!1,interactive:!0,offset:[0,6],theme:`ai-chat-box-light light`,trigger:`click`,appendTo:()=>document.body,...n.tippyOptions||{}})),s=()=>{if(n.disabled)return!1},l=()=>{i.value?.hide?.()},u=()=>{l(),r(`confirm`)},d=()=>{l(),r(`cancel`)};return cr(()=>{l()}),(e,t)=>(V(),Gr(B(vp),ii({ref_key:`tippyRef`,ref:i},o.value,{onShow:s}),{content:jn(()=>[Yr(`div`,nGt,[Yr(`div`,rGt,Oe(B(Op)(`确认删除该回答?`)),1),Yr(`div`,iGt,Oe(B(Op)(`删除操作无法撤回,请谨慎操作!`)),1),Yr(`div`,aGt,[Xr(B(ou),{size:`small`,theme:`danger`,onClick:u},{default:jn(()=>[$r(Oe(B(Op)(`删除`)),1)]),_:1}),Xr(B(ou),{size:`small`,onClick:d},{default:jn(()=>[$r(Oe(B(Op)(`取消`)),1)]),_:1})])])]),default:jn(()=>[Xr(Up,xe(Zr(a.value)),null,16)]),_:1},16))}}),sGt={class:`ai-feedback-title`},cGt={class:`ai-feedback-reason-list`},lGt=[`onClick`],uGt={class:`ai-feedback-other`},dGt={class:`ai-feedback-footer`},fGt=Qn({__name:`user-feedback`,props:{loading:{type:Boolean},reasonList:{},title:{}},emits:[`submit`,`cancel`],setup(e,{emit:t}){let n=t,r=sn(``),i=sn([]),a=e=>{i.value.includes(e)?i.value=i.value.filter(t=>t!==e):i.value=[...i.value,e]},o=()=>{n(`submit`,i.value,r.value)},s=()=>{i.value=[],r.value=``,n(`cancel`)};return(t,n)=>(V(),H(`div`,{class:`ai-user-feedback`,onMouseenter:n[1]||=Ni(()=>{},[`stop`,`prevent`])},[Yr(`div`,sGt,Oe(e.title),1),Yr(`div`,cGt,[e.loading?(V(),H(Lr,{key:0},dr(8,e=>Yr(`div`,{key:e,class:`reason-item ai-skeleton-element`})),64)):(V(!0),H(Lr,{key:1},dr(e.reasonList,e=>(V(),H(`div`,{key:e,class:be([`reason-item`,{"is-active":i.value.includes(e)}]),onClick:t=>a(e)},Oe(e),11,lGt))),128))]),Yr(`div`,uGt,[Xr(B(_u),{modelValue:r.value,"onUpdate:modelValue":n[0]||=e=>r.value=e,placeholder:B(Op)(`说出您的想法`),rows:3,type:`textarea`},null,8,[`modelValue`,`placeholder`])]),Yr(`div`,dGt,[Xr(B(ou),{class:`custom-btn`,disabled:!r.value&&i.value.length===0,size:`small`,theme:`primary`,onClick:o},{default:jn(()=>[$r(Oe(B(Op)(`提交`)),1)]),_:1},8,[`disabled`]),Xr(B(ou),{class:`custom-btn`,size:`small`,width:`80px`,onClick:s},{default:jn(()=>[$r(Oe(B(Op)(`取消`)),1)]),_:1})])],32))}}),pGt={ref:`messageToolsRef`,class:`message-tools-container`},mGt={class:`message-tools`,style:{"margin-right":`8px`}},hGt={key:0,class:`ai-divider`,style:{"margin-right":`8px`}},gGt={class:`message-tools`},_Gt=Qn({__name:`message-tools`,props:{messageTools:{default:()=>UTe},messageToolsStatus:{},onAction:{},tippyOptions:{},updateTools:{default:()=>GTe}},emits:[`feedback`],setup(e,{emit:t}){let n=e,r=t,i=$n(`feedbackTippyRef`),a=sn(!1),o=sn([]),s=sn(null),l=pi(()=>({arrow:!1,interactive:!0,offset:[0,6],theme:`ai-chat-box-light light`,trigger:`click`,appendTo:()=>document.body,...n.tippyOptions||{}})),u=async e=>{if(e.id===`like`||e.id===`unlike`){try{a.value=!0,o.value=[],o.value=await n.onAction?.(e)||[]}finally{a.value=!1}return}await n.onAction?.(e)},d=async e=>{await n.onAction?.(e)},f=()=>{i.value?.forEach(e=>e?.hide?.())},p=e=>s.value?s.value===`like`&&e===`like`?`activeLike`:s.value===`unlike`&&e===`unlike`?`activeUnLike`:e:e,m=e=>{let t=p(e);return t===`activeLike`?Op(`取消满意`):t===`activeUnLike`?Op(`取消不满意`):n.updateTools?.find(e=>e.id===t)?.description||``},h=(e,t,n)=>{f(),s.value===e.id?s.value=null:s.value=e.id,r(`feedback`,e,t,n)},g=e=>{if(n.messageToolsStatus===B9.Disabled)return!1;if(s.value&&s.value===e)return s.value=null,!1};return cr(()=>{f(),o.value=[]}),(t,n)=>(V(),H(`div`,pGt,[Yr(`div`,mGt,[(V(!0),H(Lr,null,dr(e.messageTools,t=>(V(),H(Lr,{key:t.id},[t.id===`delete`?(V(),Gr(oGt,ii({key:0,ref_for:!0},t,{disabled:e.messageToolsStatus===B(B9).Disabled,"tippy-options":e.tippyOptions,onConfirm:e=>d(t)}),null,16,[`disabled`,`tippy-options`,`onConfirm`])):(V(),Gr(Up,ii({key:1,ref_for:!0},t,{disabled:e.messageToolsStatus===B(B9).Disabled,"tippy-options":e.tippyOptions,onClick:e=>u(t)}),null,16,[`disabled`,`tippy-options`,`onClick`]))],64))),128))]),e.updateTools.length>0?(V(),H(`div`,hGt)):ei(`v-if`,!0),Yr(`div`,gGt,[(V(!0),H(Lr,null,dr(e.updateTools,t=>(V(),H(Lr,{key:t.id},[t.id===`like`||t.id===`unlike`?(V(),Gr(B(vp),ii({key:0,ref_for:!0,ref_key:`feedbackTippyRef`,ref:i},{ref_for:!0},l.value,{onShow:e=>g(t.id)}),{content:jn(()=>[Xr(fGt,{loading:a.value,"reason-list":o.value,title:t.id===`like`?B(Op)(`什么原因让你满意?`):B(Op)(`什么原因让你不满意?`),onCancel:f,onSubmit:(e,n)=>h(t,e,n)},null,8,[`loading`,`reason-list`,`title`,`onSubmit`])]),default:jn(()=>[Xr(Up,ii({ref_for:!0},t,{id:p(t.id),active:s.value===t.id,disabled:e.messageToolsStatus===B(B9).Disabled,"tippy-options":{...e.tippyOptions,content:m(t.id)},onClick:e=>u(t)}),null,16,[`id`,`active`,`disabled`,`tippy-options`,`onClick`])]),_:2},1040,[`onShow`])):t.id===`delete`?(V(),Gr(oGt,ii({key:1,ref_for:!0},t,{disabled:e.messageToolsStatus===B(B9).Disabled,"tippy-options":e.tippyOptions,onConfirm:e=>d(t)}),null,16,[`disabled`,`tippy-options`,`onConfirm`])):(V(),Gr(Up,ii({key:2,ref_for:!0},t,{disabled:e.messageToolsStatus===B(B9).Disabled,"tippy-options":e.tippyOptions,onClick:e=>u(t)}),null,16,[`disabled`,`tippy-options`,`onClick`]))],64))),128))])],512))}}),V9=Qn({name:`HighlightKeyword`,props:{text:{type:String,required:!0}},setup(e){let t=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),n=MDe(),r=pi(()=>{if(!e.text||!n?.value)return e.text;let r=n.value.trim();if(!r)return e.text;let i=RegExp(`(${t(r)})`,`ig`),a=e.text?.toString().split(i);return a.length<=1?e.text:a.map(e=>i.test(e)?U(`span`,{class:qTe},e):e)});return()=>U(`span`,r.value)}}),vGt={class:`ai-activity-message`},yGt={class:`ai-activity-message-content`},bGt=Qn({__name:`activity-layout`,props:yr({activityType:{}},{collapsed:{type:Boolean,default:!1},collapsedModifiers:{}}),emits:[`update:collapsed`],setup(e){let t=Dr(e,`collapsed`);return(n,r)=>(V(),H(`div`,vGt,[Yr(`div`,{class:`ai-activity-message-title`,onClick:r[0]||=e=>t.value=!t.value},[pr(n.$slots,`title`,xe(Zr({collapsed:t.value}))),e.activityType===B(bp).FlowAgent?ei(`v-if`,!0):(V(),H(`span`,{key:0,class:be([`ai-activity-message-title-icon collapsed-icon`,{"is-collapsed":t.value}])},[Xr(B(Pp))],2))]),Mn(Yr(`div`,yGt,[pr(n.$slots,`default`)],512),[[Ti,!t.value]])]))}}),H9=[{color:`#3A84FF`,icon:null,key:`running`,label:Op(`执行中`),rawStates:[`CREATED`,`LOOP_READY`,`READY`,`RUNNING`,`BLOCKED`,`ROLLING_BACK`,`ROLL_BACK_SUCCESS`]},{color:`#65C389`,icon:iEe,key:`success`,label:Op(`成功`),rawStates:[`FINISHED`]},{color:`#EA3636`,icon:aEe,key:`failed`,label:Op(`失败`),rawStates:[`FAILED`,`REVOKED`,`ROLL_BACK_FAILED`]},{color:`#F59500`,icon:oEe,key:`suspended`,label:Op(`挂起`),rawStates:[`SUSPENDED`]},{color:`#4D4F56`,dotColor:`#DCDEE5`,icon:sEe,key:`pending`,label:Op(`待执行`),rawStates:[`PENDING`]},{color:`#5B7290`,icon:cEe,key:`skipped`,label:Op(`跳过`),rawStates:[`SKIPPED`]}],xGt=Object.fromEntries(H9.map(e=>[e.key,e])),SGt=Object.fromEntries(H9.flatMap(e=>e.rawStates.map(t=>[t,e.key]))),CGt=e=>SGt[e]??`running`,wGt=e=>xGt[e].dotColor??xGt[e].color,TGt=e=>{let t=xGt[e].icon;return t?Qr(t):null},EGt=e=>{let t=pi(()=>Array.isArray(e.value)?e.value:[e.value??{}]),n=sn({}),r=e=>n.value[e.task_id]!==!1;return{isTaskExpanded:r,taskList:t,toggleTaskExpanded:e=>{n.value={...n.value,[e.task_id]:!r(e)}},viewTasks:pi(()=>t.value.map(e=>{let t=Object.values(e.nodes??{}).map(e=>{let t=CGt(e.state);return{convergedState:t,dotColor:wGt(t),elapsedTimeText:LTe(e.elapsed_time),id:e.id,name:e.name,raw:e}}),n=t.reduce((e,t)=>e+t.raw.elapsed_time,0),r=CGt(e.task_state??``);return{convergedState:r,hasConfidence:!!e.has_confidence,confidenceTitle:e.confidence_title,isActive:!!e.is_active,nodes:t,raw:e,stateIcon:TGt(r),taskId:e.task_id,taskName:e.task_name,totalTimeText:LTe(n)}})),visibleStats:pi(()=>{let e={};for(let t of H9)e[t.key]=0;for(let n of t.value)for(let[t,r]of Object.entries(n.statistics?.state_counts??{}))e[CGt(t)]+=r;return H9.filter(t=>e[t.key]>0).map(t=>({color:t.color,display:e[t.key]>99?`99+`:String(e[t.key]),dotColor:wGt(t.key),key:t.key,label:t.label}))})}},DGt={class:`ai-detail-section`},OGt={class:`section-heading`},kGt={class:`section-text`},U9=Qn({__name:`detail-section`,props:{title:{}},setup(e){return(t,n)=>(V(),H(`div`,DGt,[Yr(`div`,OGt,[n[0]||=Yr(`span`,{class:`section-bar`},null,-1),Yr(`span`,kGt,Oe(e.title),1)]),pr(t.$slots,`default`)]))}}),AGt={class:`ai-simple-table`},jGt={key:0},MGt=[`colspan`],NGt=Qn({__name:`simple-table`,props:{columns:{},data:{}},setup(e){return(t,n)=>(V(),H(`table`,AGt,[Yr(`thead`,null,[Yr(`tr`,null,[(V(!0),H(Lr,null,dr(e.columns,e=>(V(),H(`th`,{key:e.key},Oe(e.label),1))),128))])]),Yr(`tbody`,null,[(V(!0),H(Lr,null,dr(e.data,(t,n)=>(V(),H(`tr`,{key:n},[(V(!0),H(Lr,null,dr(e.columns,e=>(V(),H(`td`,{key:e.key,class:be({"is-break-all":e.breakAll})},Oe(t[e.key]??`--`),3))),128))]))),128)),e.data.length?ei(`v-if`,!0):(V(),H(`tr`,jGt,[Yr(`td`,{class:`is-empty`,colspan:e.columns.length},` -- `,8,MGt)]))])]))}}),PGt={class:`flow-agent-node-detail`},FGt={class:`detail-title`},IGt={key:1,class:`detail-title-content`},LGt={class:`detail-tab-bar`},RGt=[`onClick`],zGt={class:`detail-body`},BGt={class:`skeleton-section`},VGt={class:`skeleton-section`},HGt={class:`info-form`},UGt={class:`info-label`},WGt={class:`info-value`},GGt={class:`info-row`},KGt={class:`info-label`},qGt={class:`info-value`},JGt={key:0,class:`failure-item`},YGt={key:1,class:`failure-item`},XGt={class:`info-row`},ZGt={class:`info-label`},QGt={class:`info-value`},$Gt={key:0,class:`skeleton-section`},W9=function(e){return e.Config=`config`,e.Output=`output`,e}(W9||{}),eKt=Qn({__name:`flow-agent-node-detail`,props:{data:{},has_confidence:{type:Boolean},loading:{type:Boolean},node_id:{},node_name:{},task_id:{},task_name:{}},setup(e){let t=[{key:W9.Config,label:Op(`节点配置`)},{key:W9.Output,label:Op(`节点输出`)}],n=[{key:`key`,label:Op(`参数名`)},{breakAll:!0,key:`value`,label:Op(`参数值`)}],r=[{key:`name`,label:Op(`名称`)},{key:`description`,label:Op(`变量说明`)},{key:`key`,label:`KEY`}],i=[{key:`key`,label:Op(`参数名`)},{breakAll:!0,key:`value`,label:Op(`参数值`)}],a={forced_fail:Dp?`Force Fail`:`强制失败`},o=e,s=sn(W9.Config),l=pi(()=>o.data?.basic_info),u=pi(()=>{let e=l.value;return e?[{label:Op(`流程模板`),value:e.template_name||`--`},{label:Op(`节点名称`),value:e.node_name||`--`},{label:Op(`步骤名称`),value:e.stage_name||`--`},{label:Op(`是否可选`),value:e.optional?Op(`是`):Op(`否`)}]:[]}),d=pi(()=>{let e=l.value;return e?.skippable||e?.auto_retry?.enable}),f=pi(()=>{let e=l.value?.auto_retry;return e?.enable?Dp?`In ${e.interval} seconds, auto retry ${e.times} times`:`在 ${e.interval} 秒后,自动重试 ${e.times} 次`:``}),p=pi(()=>{let e=l.value?.timeout_config;if(!e?.enable)return`--`;let t=a[e.action]??e.action;return Dp?`Timeout ${e.seconds} seconds later, ${t}`:`超时 ${e.seconds} 秒后则${t}`}),m=pi(()=>Object.entries(o.data?.inputs??{}).map(([e,t])=>({key:e,value:_(t)}))),h=pi(()=>(o.data?.plugin_output??[]).map(e=>({description:e.schema?.description||`--`,name:e.name,key:e.key}))),g=pi(()=>(o.data?.outputs??[]).map(e=>({key:e.key,value:_(e.value)}))),_=e=>e==null?`--`:typeof e==`object`?JSON.stringify(e):String(e);return(a,o)=>(V(),H(`div`,PGt,[Yr(`h3`,FGt,[e.loading?(V(),H(Lr,{key:0},[Yr(`span`,null,Oe(B(Op)(`节点`))+`:`,1),o[0]||=Yr(`span`,{class:`skeleton-title ai-skeleton-element`},null,-1)],64)):(V(),H(`div`,IGt,Oe(B(Op)(`节点`))+`:`+Oe(l.value?.node_name),1)),pr(a.$slots,`locateButton`)]),Yr(`div`,LGt,[(V(),H(Lr,null,dr(t,e=>Yr(`div`,{key:e.key,class:be([`detail-tab`,{"is-active":s.value===e.key}]),onClick:t=>s.value=e.key},[(V(),Gr(lr(e.key===W9.Config?B(uEe):B(Np)),{class:`detail-tab-icon`})),$r(` `+Oe(e.label),1)],10,RGt)),64))]),Yr(`div`,zGt,[s.value===W9.Config?(V(),H(Lr,{key:0},[e.loading?(V(),H(Lr,{key:0},[Yr(`div`,BGt,[o[1]||=Yr(`div`,{class:`skeleton-heading ai-skeleton-element`},null,-1),(V(),H(Lr,null,dr(6,e=>Yr(`div`,{key:e,class:`skeleton-row ai-skeleton-element`})),64))]),Yr(`div`,VGt,[o[2]||=Yr(`div`,{class:`skeleton-heading ai-skeleton-element`},null,-1),(V(),H(Lr,null,dr(4,e=>Yr(`div`,{key:e,class:`skeleton-row ai-skeleton-element`})),64))])],64)):(V(),H(Lr,{key:1},[Xr(U9,{title:B(Op)(`基础信息`)},{default:jn(()=>[Yr(`div`,HGt,[(V(!0),H(Lr,null,dr(u.value,e=>(V(),H(`div`,{key:e.label,class:`info-row`},[Yr(`div`,UGt,Oe(e.label),1),Yr(`div`,WGt,Oe(e.value),1)]))),128)),Yr(`div`,GGt,[Yr(`div`,KGt,Oe(B(Op)(`失败处理`)),1),Yr(`div`,qGt,[d.value?(V(),H(Lr,{key:0},[l.value?.skippable?(V(),H(`span`,JGt,[o[3]||=Yr(`span`,{class:`tag-badge`},`MS`,-1),$r(` `+Oe(B(Op)(`手动跳过`))+Oe(l.value?.auto_retry?.enable?`;`:``),1)])):ei(`v-if`,!0),l.value?.auto_retry?.enable?(V(),H(`span`,YGt,[o[4]||=Yr(`span`,{class:`tag-badge`},`AR`,-1),$r(` `+Oe(f.value),1)])):ei(`v-if`,!0)],64)):(V(),H(Lr,{key:1},[$r(`--`)],64))])]),Yr(`div`,XGt,[Yr(`div`,ZGt,Oe(B(Op)(`超时控制`)),1),Yr(`div`,QGt,Oe(p.value),1)])])]),_:1},8,[`title`]),Xr(U9,{title:B(Op)(`输入参数`)},{default:jn(()=>[Xr(NGt,{columns:n,data:m.value},null,8,[`data`])]),_:1},8,[`title`]),Xr(U9,{title:B(Op)(`输出参数`)},{default:jn(()=>[Xr(NGt,{columns:r,data:h.value},null,8,[`data`])]),_:1},8,[`title`])],64))],64)):(V(),H(Lr,{key:1},[e.loading?(V(),H(`div`,$Gt,[o[5]||=Yr(`div`,{class:`skeleton-heading ai-skeleton-element`},null,-1),(V(),H(Lr,null,dr(5,e=>Yr(`div`,{key:e,class:`skeleton-row ai-skeleton-element`})),64))])):(V(),Gr(U9,{key:1,title:B(Op)(`结构化输出`)},{default:jn(()=>[Xr(NGt,{columns:i,data:g.value},null,8,[`data`])]),_:1},8,[`title`]))],64))])]))}}),G9=e=>e.task_id==null?``:`${e.task_id}`,tKt=G9,nKt=(e,t)=>e.task_id==null?``:`${e.task_id}|${t.id}|${t.name}`,rKt=e=>{let{messageUid:t,taskList:n}=e,r=hDe(),i=dDe(),a=pi(()=>r.selectedTab.value?.name??``),o=sn(!1),s=()=>{o.value=!0},l=pi(()=>{if(o.value)return a.value;let e=n.value.find(e=>e.is_active);return e?.task_id==null?a.value:G9(e)}),u=e=>{let t=l.value;return t===G9(e)||t===tKt(e)},d=(e,t)=>l.value===nKt(e,t),f=(e,n)=>{let i=e.task_id;i!=null&&(s(),r.addCustomTab?.({label:n.name,name:nKt(e,n),data:{component:eKt,messageUid:t.value,props:{data:{},loading:!0,node_id:n.id,node_name:n.name,task_id:i,task_name:e.task_name}}}))},p=e=>{let n=e?.task_id;n&&(s(),r.addCustomTab?.({label:Op(`有效证据`),name:tKt(e),data:{component:eKt,messageUid:t.value,props:{data:{},has_confidence:e.has_confidence,loading:!0,task_id:n,task_name:e.task_name}}}))};return Ln(a,(e,t)=>{t!==void 0&&s()}),or(()=>{i?.value&&p(n.value.find(e=>e.is_active&&e.has_confidence))}),cr(()=>{if(i?.value)for(let e of n.value){r.removeCustomTab?.(G9(e)),r.removeCustomTab?.(tKt(e));for(let t of Object.values(e.nodes??{}))r.removeCustomTab?.(nKt(e,t))}}),{displaySelectedTabName:l,isNodeSelected:d,isTaskSelected:u,markUserTabSelection:s,openConfidence:p,openNodeDetail:f}},iKt={class:`ai-activity-message-title-text`},aKt={class:`flow-agent-title-label`},oKt={class:`flow-agent-stat-tooltip`},sKt={class:`flow-agent-stat-tooltip-status`},cKt={class:`flow-agent-stat-tooltip-label`},lKt={class:`flow-agent-task-state-icon`},uKt={class:`flow-agent-task-name`},dKt={key:0,class:`flow-agent-task-trailing`},fKt={class:`flow-agent-task-time`},pKt=[`onClick`],mKt={class:`flow-agent-task-nodes`},hKt={class:`flow-agent-node-status`},gKt=[`title`],_Kt={key:0,class:`flow-agent-node-trailing`},vKt={class:`flow-agent-node-time`},yKt=[`onClick`],bKt=Qn({__name:`flow-agent-content`,props:yr({content:{},messageUid:{},status:{}},{collapsed:{type:Boolean,default:!1},collapsedModifiers:{}}),emits:[`update:collapsed`],setup(e){let t=e,n=Vp(),r=Dr(e,`collapsed`),i=ADe(),a=pi(()=>i.value!==kp.Share),o=pi(()=>t.status===Sp.Pending||t.status===Sp.Streaming),{isTaskExpanded:s,taskList:l,toggleTaskExpanded:u,viewTasks:d,visibleStats:f}=EGt(fn(t,`content`)),{isNodeSelected:p,isTaskSelected:m,openConfidence:h,openNodeDetail:g}=rKt({messageUid:fn(t,`messageUid`),taskList:l});return(e,t)=>(V(),Gr(bGt,{collapsed:r.value,"onUpdate:collapsed":t[0]||=e=>r.value=e,"activity-type":B(bp).FlowAgent,class:`flow-agent-activity`},{title:jn(()=>[ei(` hover 整条执行情况栏展示统计 tooltip(设计稿 annotation) `),Xr(B(vp),ii({class:`flow-agent-title-bar`,theme:`ai-chat-box-light light`},{...B(n),tag:`div`,arrow:!0,followCursor:!1,offset:[0,10]}),{content:jn(()=>[Yr(`div`,oKt,[(V(!0),H(Lr,null,dr(B(f),e=>(V(),H(`div`,{key:e.key,class:`flow-agent-stat-tooltip-item`},[Yr(`span`,sKt,[e.key===`running`?(V(),Gr(B(Ql),{key:0,mode:`spin`,size:`mini`,theme:`primary`})):(V(),H(`span`,{key:1,class:`flow-agent-stat-dot`,style:he({borderColor:e.dotColor})},null,4))]),Yr(`span`,cKt,Oe(e.label)+`:`,1),Yr(`span`,{class:`flow-agent-stat-tooltip-count`,style:he({color:e.color})},Oe(e.display),5)]))),128))])]),default:jn(()=>[Yr(`span`,{class:be([`ai-activity-message-title-icon`,{"icon-collapsed":r.value}])},[o.value?(V(),Gr(Ip,{key:0,size:12})):(V(),Gr(B(Mp),{key:1}))],2),Yr(`span`,iKt,[Yr(`span`,aKt,Oe(B(Op)(`执行情况`))+`:`,1),(V(!0),H(Lr,null,dr(B(f),e=>(V(),H(`span`,{key:e.key,class:`flow-agent-stat-item`},[e.key===`running`?(V(),Gr(B(Ql),{key:0,class:`flow-agent-stat-loading`,mode:`spin`,size:`mini`,theme:`primary`})):(V(),H(`span`,{key:1,class:`flow-agent-stat-dot`,style:he({borderColor:e.dotColor})},null,4)),Yr(`span`,{class:`flow-agent-stat-count`,style:he({color:e.color})},Oe(e.display),5)]))),128))])]),_:1},16)]),default:jn(()=>[(V(!0),H(Lr,null,dr(B(d),e=>(V(),H(`div`,{key:e.taskId,class:`flow-agent-task-group`},[Yr(`div`,{class:be([`flow-agent-task-header`,{"has-confidence":e.hasConfidence,"is-selected":B(m)(e.raw)}])},[Yr(`span`,{class:be([`flow-agent-task-arrow`,{"is-expanded":B(s)(e.raw)}])},[Xr(B(Mp),{onClick:Ni(t=>B(u)(e.raw),[`stop`])},null,8,[`onClick`])],2),Yr(`span`,lKt,[e.convergedState===`running`?(V(),Gr(B(Ql),{key:0,mode:`spin`,size:`mini`,theme:`primary`})):(V(),Gr(lr(e.stateIcon),{key:1}))]),Mn((V(),H(`span`,uKt,[Xr(B(V9),{text:e.taskName},null,8,[`text`])])),[[B(Hp),{...B(n)}]]),a.value?(V(),H(`span`,dKt,[Yr(`span`,fKt,Oe(e.totalTimeText),1),e.hasConfidence?(V(),H(`span`,{key:0,class:`flow-agent-task-action-btn flow-agent-task-confidence-btn`,onClick:Ni(t=>B(h)(e.raw),[`stop`])},[Xr(B(Np)),$r(` `+Oe(e.confidenceTitle??B(Op)(`有效证据`)),1)],8,pKt)):ei(`v-if`,!0)])):ei(`v-if`,!0)],2),Mn(Yr(`div`,mKt,[(V(!0),H(Lr,null,dr(e.nodes,t=>(V(),H(`div`,{key:t.id,class:be([`flow-agent-node-item`,{"is-selected":B(p)(e.raw,t.raw)}])},[Yr(`span`,hKt,[t.convergedState===`running`?(V(),Gr(B(Ql),{key:0,mode:`spin`,size:`mini`,theme:`primary`})):(V(),H(`span`,{key:1,class:`flow-agent-status-dot`,style:he({borderColor:t.dotColor})},null,4))]),Mn((V(),H(`span`,{class:`flow-agent-node-name`,title:t.name},[Xr(B(V9),{text:t.name},null,8,[`text`])],8,gKt)),[[B(Hp),{...B(n)}]]),a.value?(V(),H(`span`,_Kt,[Yr(`span`,vKt,Oe(t.elapsedTimeText),1),Yr(`span`,{class:`flow-agent-node-detail-btn`,onClick:Ni(n=>B(g)(e.raw,t.raw),[`stop`])},[Xr(B(Np)),$r(` `+Oe(B(Op)(`详情`)),1)],8,yKt)])):ei(`v-if`,!0)],2))),128))],512),[[Ti,B(s)(e.raw)]])]))),128))]),_:1},8,[`collapsed`,`activity-type`]))}}),xKt={class:`ai-activity-message-title-icon`},SKt={class:`ai-activity-message-title-text`},CKt={class:`knowledge-rag-content`},wKt=Qn({__name:`knowledge-rag-content`,props:yr({content:{},messageUid:{},status:{}},{collapsed:{type:Boolean,default:!1},collapsedModifiers:{}}),emits:[`update:collapsed`],setup(e){let t=e,n=Dr(e,`collapsed`),r=pi(()=>t.status===Sp.Pending||t.status===Sp.Streaming),i=pi(()=>r.value?Op(`检索中`):Op(`检索完成`));return(t,a)=>(V(),Gr(bGt,{collapsed:n.value,"onUpdate:collapsed":a[0]||=e=>n.value=e},{title:jn(()=>[Yr(`span`,xKt,[r.value?(V(),Gr(Ip,{key:0})):(V(),Gr(B(jp),{key:1,style:{"font-size":`12px`}}))]),Yr(`span`,SKt,Oe(i.value),1)]),default:jn(()=>[Yr(`div`,CKt,[Xr(b9,{content:e.content?.content||``},null,8,[`content`])]),Xr(LHt,{content:e.content?.referenceDocument||[]},null,8,[`content`])]),_:1},8,[`collapsed`]))}}),TKt={class:`ai-activity-message-title-icon`},EKt={class:`ai-activity-message-title-text`},DKt=Qn({__name:`reference-doc-content`,props:yr({content:{},messageUid:{}},{collapsed:{type:Boolean,default:!1},collapsedModifiers:{}}),emits:[`update:collapsed`],setup(e){let t=e,n=Dr(e,`collapsed`),r=pi(()=>{let e=t.content?.length??0;return Dp?`Reference ${e} documents as reference`:`引用 ${e} 篇资料作为参考`});return(t,i)=>(V(),Gr(bGt,{collapsed:n.value,"onUpdate:collapsed":i[0]||=e=>n.value=e},{title:jn(()=>[Yr(`span`,TKt,[Xr(B(jp),{style:{"font-size":`12px`}})]),Yr(`span`,EKt,Oe(r.value),1)]),default:jn(()=>[Xr(LHt,{content:e.content||[]},null,8,[`content`])]),_:1},8,[`collapsed`]))}}),OKt=Qn({__name:`activity-message`,props:yr({activityType:{},content:{},id:{},messageId:{},name:{},role:{},status:{},uid:{},property:{}},{collapsed:{type:Boolean,default:!1},collapsedModifiers:{}}),emits:[`update:collapsed`],setup(e){let t={[bp.FlowAgent]:bKt,[bp.KnowledgeRag]:wKt,[bp.ReferenceDocument]:DKt},n=e,r=Dr(e,`collapsed`),i=pi(()=>t[n.activityType??``]);return(t,n)=>i.value?(V(),Gr(lr(i.value),{key:0,collapsed:r.value,"onUpdate:collapsed":n[0]||=e=>r.value=e,content:e.content,"message-uid":e.uid,status:e.status},null,40,[`collapsed`,`content`,`message-uid`,`status`])):ei(`v-if`,!0)}}),kKt={class:`toolcall-desc`},AKt={class:`desc-title`},jKt={class:`desc-panel`},MKt={class:`desc-label`},NKt={class:`desc-value`},PKt=Qn({__name:`desc-panel`,props:{desc:{},title:{}},setup(e){let t=e,n=pi(()=>{try{return JSON.parse(t.desc||``)}catch{return t.desc}});return(t,r)=>(V(),H(`div`,kKt,[Yr(`div`,AKt,Oe(e.title),1),Yr(`div`,jKt,[typeof n.value==`object`?(V(!0),H(Lr,{key:0},dr(n.value,(e,t)=>(V(),H(`div`,{key:t,class:`desc-panel-item`},[Yr(`span`,MKt,[Xr(B(V9),{text:t},null,8,[`text`]),r[0]||=$r(`:`,-1)]),Yr(`span`,NKt,[Xr(B(V9),{style:{"word-break":`break-all`},text:typeof e==`object`&&e?JSON.stringify(e):e},null,8,[`text`])])]))),128)):(V(),Gr(B(V9),{key:1,style:{wordBreak:`break-all`},text:n.value},null,8,[`text`]))])]))}}),FKt={class:`tool-message`},IKt=Qn({__name:`tool-message`,props:{duration:{},error:{type:[Boolean,String]},toolCallId:{},content:{},id:{},messageId:{},name:{},role:{},status:{},uid:{},property:{}},setup(e){return(t,n)=>(V(),H(`div`,FKt,[Xr(PKt,{desc:e.content||(typeof e.error==`string`?e.error:void 0),title:B(Op)(`返回内容`)},null,8,[`desc`,`title`])]))}}),LKt={class:`ai-toolcall-render`},RKt={class:`toolcall-header-title`},zKt={class:`toolcall-status-title`},BKt={key:1,class:`toolcall-duration`},VKt={class:`ai-toolcall-render-content`},HKt=Qn({__name:`toolcall-render`,props:{duration:{},status:{},toolCall:{}},setup(e){let t=e,n=sn(!0),r=sn(null),i=Vp(),{keywordMatched:a,keyword:o}=NDe(()=>[t.toolCall?.function.name,t.toolCall?.function.mcpName,t.toolCall?.function.description,t.toolCall?.function.arguments,t.toolCall?.id]),s=pi(()=>r.value===null?o?.value?.trim()?!a.value:n.value:r.value);function l(){n.value=!s.value,r.value=n.value}let u=pi(()=>{let e=t.toolCall?.function.mcpName||``,n=t.toolCall?.function.name||t.toolCall?.id||``;return e?`${e} / ${n}`:n}),d=pi(()=>{switch(t.status){default:case Sp.Pending:return Op(`调用中`);case Sp.Complete:case Sp.Success:return Op(`调用成功`);case Sp.Error||t.toolCall?.toolMessage?.error:return Op(`调用失败`)}}),f=pi(()=>{let e=t.duration||t.toolCall?.toolMessage?.duration;return e?ITe(e):``});return(t,n)=>(V(),H(`div`,LKt,[Yr(`div`,{class:be([`ai-toolcall-render-header`,`toolcall-status-${e.status}`]),onClick:l},[Xr(B(Mp),{class:be({"is-collapsed":s.value})},null,8,[`class`]),$r(` `+Oe(e.toolCall?.function.mcpName?B(Op)(`调用 MCP:`):B(Op)(`调用工具:`))+` `,1),Mn((V(),H(`span`,RKt,[Xr(B(V9),{text:u.value},null,8,[`text`])])),[[B(Hp),{...B(i),text:u.value,appendTo:`parent`}]]),Yr(`span`,zKt,[e.status===B(Sp).Pending||e.status===B(Sp).Streaming?(V(),Gr(B(Ql),{key:0,mode:`spin`,size:`mini`,theme:`primary`})):ei(`v-if`,!0),Xr(B(V9),{text:d.value},null,8,[`text`]),f.value?(V(),H(`span`,BKt,` (`+Oe(f.value)+`) `,1)):ei(`v-if`,!0)])],2),Mn(Yr(`div`,VKt,[Xr(PKt,{desc:e.toolCall?.function.description,title:B(Op)(`描述`)},null,8,[`desc`,`title`]),Xr(PKt,{desc:e.toolCall?.function.arguments,title:B(Op)(`参数`)},null,8,[`desc`,`title`]),e.toolCall?.toolMessage?(V(),Gr(IKt,xe(ii({key:0},e.toolCall.toolMessage)),null,16)):ei(`v-if`,!0)],512),[[Ti,!s.value]])]))}}),UKt={class:`ai-assistant-message`},WKt={class:`ai-assistant-message-content`},GKt=Qn({__name:`assistant-message`,props:{toolCalls:{},content:{},id:{},messageId:{},name:{},role:{},status:{},uid:{},property:{}},setup(e){return(t,n)=>(V(),H(`div`,UKt,[Yr(`div`,WKt,[pr(t.$slots,`default`,xe(Zr({content:e.content})),()=>[Xr(RHt,{content:e.content||``,status:e.status,type:B(bp).Text},null,8,[`content`,`status`,`type`])])]),e.toolCalls&&e.toolCalls.length>0?(V(!0),H(Lr,{key:0},dr(e.toolCalls,t=>(V(),Gr(HKt,{key:t.id,status:e.status,"tool-call":t},null,8,[`status`,`tool-call`]))),128)):ei(`v-if`,!0)]))}}),KKt={class:`info-message`},qKt=Qn({__name:`info-message`,props:{content:{},id:{},messageId:{},name:{},role:{},status:{},uid:{},property:{}},setup(e){return(t,n)=>(V(),H(`div`,KKt,[(V(!0),H(Lr,null,dr(Array.isArray(e.content)?e.content:[e.content],(e,t)=>(V(),H(`div`,{key:t,class:`info-message-content`},Oe(e),1))),128))]))}}),JKt={class:`ai-loading-message`},YKt=Qn({__name:`loading-message`,setup(e){return(e,t)=>(V(),H(`div`,JKt,[Xr(Ip,{size:18}),pr(e.$slots,`default`,{},()=>[$r(Oe(B(Op)(`请求中...`)),1)])]))}}),XKt={class:`ai-reasoning-message`},ZKt={key:0,class:`ai-reasoning-message-title-icon`},QKt={class:`ai-reasoning-message-title-text`},$Kt={class:`ai-reasoning-message-content`},eqt=Qn({__name:`reasoning-message`,props:yr({duration:{},content:{},id:{},messageId:{},name:{},role:{},status:{},uid:{},property:{}},{collapsed:{type:Boolean,default:!1},collapsedModifiers:{}}),emits:[`update:collapsed`],setup(e){let t=e,n=Dr(e,`collapsed`),{stop:r}=Ln(()=>t.duration,async e=>{e&&(n.value=!0,await En(),r?.())},{immediate:!0}),i=pi(()=>{switch(t.status){case Sp.Pending:return Op(`思考中`);case Sp.Success:case Sp.Complete:return Op(`已思考完成`)+(t.duration?` (${Op(`耗时`)} :${ITe(t.duration)})`:``);case Sp.Error:return Op(`思考失败`);default:return Op(`思考中`)}});return(t,r)=>(V(),H(`div`,XKt,[Yr(`div`,{class:be([`ai-reasoning-message-title`,{"ai-reasoning-message-title-collapsed":n.value,"is-thinking":e.status===B(Sp).Pending||e.status===B(Sp).Streaming,"is-complete":e.status===B(Sp).Complete||e.status===B(Sp).Success,"is-error":e.status===B(Sp).Error}]),onClick:r[0]||=e=>n.value=!n.value},[e.status===B(Sp).Pending||e.status===B(Sp).Streaming?(V(),H(`span`,ZKt,[Xr(Ip)])):ei(`v-if`,!0),Yr(`span`,QKt,Oe(i.value),1),ei(` <template v-if="status === MessageStatus.Pending || status === MessageStatus.Streaming">
3490
+ 通过 Shift + Enter 进行换行输入`},prompts:{default:()=>[]},resources:{default:()=>[]},shortcutId:{},shortcuts:{},skills:{default:()=>[]},supportUpload:{type:Boolean,default:!0},tippyOptions:{}},{cite:{required:!1,default:``},citeModifiers:{}}),emits:yr([`selectShortcut`,`deleteShortcut`,`update:modelValue`],[`update:cite`]),setup(e,{expose:t,emit:n}){let r=$n(`aiSlashInputRef`),i=$n(`filesRef`),a=Dr(e,`cite`),o=sn(200),s=e,l=n,u=on(s.defaultUploadFiles||[]),d=pi(()=>s.shortcuts?.find(e=>e.id===s.shortcutId)),f=pi(()=>s.messageStatus&&[Sp.Pending,Sp.Streaming,Sp.Fetching].includes(s.messageStatus)?s.messageStatus:s.modelValue?.length<1||Array.isArray(s.modelValue)&&!w9(s.modelValue).trim()?Sp.Disabled:s.messageStatus);Cee(()=>{let e=s.inputMaxHeight||200;if(u.value.length<1||!i.value){o.value=e;return}o.value=e+(i.value?.clientHeight||0)});let p=async()=>{try{r.value?.cleanup?.();let e;u.value?.length?(e=u.value?.slice().map(e=>({type:bp.Binary,url:e.url,mimeType:e.file?.type||``,filename:e.file?.name||``})),s.modelValue&&e.push({type:bp.Text,text:w9(s.modelValue)})):e=typeof s.modelValue==`string`?s.modelValue:w9(s.modelValue),s.onSendMessage?.(e,s.modelValue),u.value=[]}catch(e){console.error(e)}},m=e=>{if(e.key===`Enter`||e.key===`NumpadEnter`){if(e.shiftKey||f.value===Sp.Disabled||f.value===Sp.Fetching)return;p()}},h=async()=>{try{s.onStopSending?.()}catch(e){console.error(e)}},g=()=>{a.value=``},_=e=>{l(`selectShortcut`,e)},v=()=>{l(`deleteShortcut`)},y=e=>`${e.name}_${e.size}_${e.lastModified}`,b=(KTe/(1024*1024)).toFixed(1),x=async e=>{if(!s.supportUpload)return;if(u.value.length>=3){e.length>0&&dd({message:Cp(e.length,b,Dp),theme:`error`});return}let t=new Set(u.value.map(e=>e.file?y(e.file):``)),n=0;for(let r=0;r<e.length;r++){let i=e[r];if(u.value.length>=3){n+=e.length-r;break}let a=y(i);if(t.has(a)){n+=1;continue}if(i.size<=0||i.size>=2516582.4){n+=1;continue}t.add(a);let o={file:i,status:z9.Pending};u.value.push(o),s.onUpload?.(i).then(e=>{if(e&&typeof e==`object`&&`download_url`in e){o.url=e.download_url,o.status=z9.Success;return}o.status=z9.Error}).catch(()=>{o.status=z9.Error})}n>0&&dd({message:Cp(n,b,Dp),theme:`error`})},S=e=>{u.value=u.value.filter(t=>t.file?t.file!==e.file:t.url?t.url!==e.url:t.filename?t.filename!==e.filename:!0)},C=(e,t)=>{l(`update:modelValue`,e,t)};return t({focus:()=>{r.value?.focus?.()},triggerSendMessage:p}),(t,n)=>(V(),H(`div`,{class:`chat-input-container`,style:he({"--chat-z-index":B(zTe)})},[pr(t.$slots,`top`),Yr(`div`,{class:`chat-input`,style:he({maxHeight:o.value+`px`})},[pr(t.$slots,`input-header`,{},()=>[a.value?(V(),Gr(ZUt,{key:0,class:`chat-input-cite`,content:a.value,onClose:g},null,8,[`content`])):ei(`v-if`,!0)]),pr(t.$slots,`files`,xe(Zr({files:u.value})),()=>[u.value.length?(V(),H(`div`,{key:0,ref_key:`filesRef`,ref:i,class:`chat-input-files`},[Xr(OWt,{files:u.value,onDeleteFile:S},null,8,[`files`])],512)):ei(`v-if`,!0)]),Xr(ZWt,{ref_key:`aiSlashInputRef`,ref:r,"model-value":e.modelValue,placeholder:e.placeholder,prompts:e.prompts,resources:e.resources,skills:e.skills,onKeydown:m,"onUpdate:modelValue":C,onUpload:x},null,8,[`model-value`,`placeholder`,`prompts`,`resources`,`skills`]),Xr($Wt,{"message-state":f.value,"tippy-options":e.tippyOptions,onSendMessage:p,onStopSending:h},{default:jn(()=>[e.supportUpload?(V(),Gr(JUt,{key:0,"tippy-options":e.tippyOptions,onUpload:x},null,8,[`tippy-options`])):ei(`v-if`,!0),e.supportUpload&&(e.shortcuts?.length||d.value)?(V(),H(`span`,eGt)):ei(`v-if`,!0),pr(t.$slots,`attachment`,{},()=>[e.shortcuts&&!d.value?(V(),Gr(QEe,{key:0,shortcuts:e.shortcuts,onSelectShortcut:_},null,8,[`shortcuts`])):ei(`v-if`,!0),d.value?(V(),Gr(Lp,{key:1,class:`selected-shortcut-btn`,shortcut:d.value},{append:jn(()=>[Xr(B(Fp),{onClick:v})]),_:1},8,[`shortcut`])):ei(`v-if`,!0)])]),"send-icon":jn(()=>[pr(t.$slots,`send-icon`)]),_:3},8,[`message-state`,`tippy-options`])],4)],4))}}),nGt={class:`ai-delete-confirm`},rGt={class:`ai-delete-confirm__title`},iGt={class:`ai-delete-confirm__desc`},aGt={class:`ai-delete-confirm__actions`},oGt=Qn({__name:`delete-tool`,props:{description:{},id:{},name:{},disabled:{type:Boolean},tippyOptions:{}},emits:[`confirm`,`cancel`],setup(e,{emit:t}){let n=e,r=t,i=$n(`tippyRef`),a=pi(()=>({id:n.id,name:n.name,description:n.description,disabled:n.disabled,tippyOptions:n.tippyOptions})),o=pi(()=>({arrow:!1,interactive:!0,offset:[0,6],theme:`ai-chat-box-light light`,trigger:`click`,appendTo:()=>document.body,...n.tippyOptions||{}})),s=()=>{if(n.disabled)return!1},l=()=>{i.value?.hide?.()},u=()=>{l(),r(`confirm`)},d=()=>{l(),r(`cancel`)};return cr(()=>{l()}),(e,t)=>(V(),Gr(B(vp),ii({ref_key:`tippyRef`,ref:i},o.value,{onShow:s}),{content:jn(()=>[Yr(`div`,nGt,[Yr(`div`,rGt,Oe(B(Op)(`确认删除该回答?`)),1),Yr(`div`,iGt,Oe(B(Op)(`删除操作无法撤回,请谨慎操作!`)),1),Yr(`div`,aGt,[Xr(B(ou),{size:`small`,theme:`danger`,onClick:u},{default:jn(()=>[$r(Oe(B(Op)(`删除`)),1)]),_:1}),Xr(B(ou),{size:`small`,onClick:d},{default:jn(()=>[$r(Oe(B(Op)(`取消`)),1)]),_:1})])])]),default:jn(()=>[Xr(Up,xe(Zr(a.value)),null,16)]),_:1},16))}}),sGt={class:`ai-feedback-title`},cGt={class:`ai-feedback-reason-list`},lGt=[`onClick`],uGt={class:`ai-feedback-other`},dGt={class:`ai-feedback-footer`},fGt=Qn({__name:`user-feedback`,props:{loading:{type:Boolean},reasonList:{},title:{}},emits:[`submit`,`cancel`],setup(e,{emit:t}){let n=t,r=sn(``),i=sn([]),a=e=>{i.value.includes(e)?i.value=i.value.filter(t=>t!==e):i.value=[...i.value,e]},o=()=>{n(`submit`,i.value,r.value)},s=()=>{i.value=[],r.value=``,n(`cancel`)};return(t,n)=>(V(),H(`div`,{class:`ai-user-feedback`,onMouseenter:n[1]||=Ni(()=>{},[`stop`,`prevent`])},[Yr(`div`,sGt,Oe(e.title),1),Yr(`div`,cGt,[e.loading?(V(),H(Lr,{key:0},dr(8,e=>Yr(`div`,{key:e,class:`reason-item ai-skeleton-element`})),64)):(V(!0),H(Lr,{key:1},dr(e.reasonList,e=>(V(),H(`div`,{key:e,class:be([`reason-item`,{"is-active":i.value.includes(e)}]),onClick:t=>a(e)},Oe(e),11,lGt))),128))]),Yr(`div`,uGt,[Xr(B(_u),{modelValue:r.value,"onUpdate:modelValue":n[0]||=e=>r.value=e,placeholder:B(Op)(`说出您的想法`),rows:3,type:`textarea`},null,8,[`modelValue`,`placeholder`])]),Yr(`div`,dGt,[Xr(B(ou),{class:`custom-btn`,disabled:!r.value&&i.value.length===0,size:`small`,theme:`primary`,onClick:o},{default:jn(()=>[$r(Oe(B(Op)(`提交`)),1)]),_:1},8,[`disabled`]),Xr(B(ou),{class:`custom-btn`,size:`small`,width:`80px`,onClick:s},{default:jn(()=>[$r(Oe(B(Op)(`取消`)),1)]),_:1})])],32))}}),pGt={ref:`messageToolsRef`,class:`message-tools-container`},mGt={class:`message-tools`,style:{"margin-right":`8px`}},hGt={key:0,class:`ai-divider`,style:{"margin-right":`8px`}},gGt={class:`message-tools`},_Gt=Qn({__name:`message-tools`,props:{messageTools:{default:()=>UTe},messageToolsStatus:{},onAction:{},tippyOptions:{},updateTools:{default:()=>GTe}},emits:[`feedback`],setup(e,{emit:t}){let n=e,r=t,i=$n(`feedbackTippyRef`),a=sn(!1),o=sn([]),s=sn(null),l=pi(()=>({arrow:!1,interactive:!0,offset:[0,6],theme:`ai-chat-box-light light`,trigger:`click`,appendTo:()=>document.body,...n.tippyOptions||{}})),u=async e=>{if(e.id===`like`||e.id===`unlike`){try{a.value=!0,o.value=[],o.value=await n.onAction?.(e)||[]}finally{a.value=!1}return}await n.onAction?.(e)},d=async e=>{await n.onAction?.(e)},f=()=>{i.value?.forEach(e=>e?.hide?.())},p=e=>s.value?s.value===`like`&&e===`like`?`activeLike`:s.value===`unlike`&&e===`unlike`?`activeUnLike`:e:e,m=e=>{let t=p(e);return t===`activeLike`?Op(`取消满意`):t===`activeUnLike`?Op(`取消不满意`):n.updateTools?.find(e=>e.id===t)?.description||``},h=(e,t,n)=>{f(),s.value===e.id?s.value=null:s.value=e.id,r(`feedback`,e,t,n)},g=e=>{if(n.messageToolsStatus===B9.Disabled)return!1;if(s.value&&s.value===e)return s.value=null,!1};return cr(()=>{f(),o.value=[]}),(t,n)=>(V(),H(`div`,pGt,[Yr(`div`,mGt,[(V(!0),H(Lr,null,dr(e.messageTools,t=>(V(),H(Lr,{key:t.id},[t.id===`delete`?(V(),Gr(oGt,ii({key:0,ref_for:!0},t,{disabled:e.messageToolsStatus===B(B9).Disabled,"tippy-options":e.tippyOptions,onConfirm:e=>d(t)}),null,16,[`disabled`,`tippy-options`,`onConfirm`])):(V(),Gr(Up,ii({key:1,ref_for:!0},t,{disabled:e.messageToolsStatus===B(B9).Disabled,"tippy-options":e.tippyOptions,onClick:e=>u(t)}),null,16,[`disabled`,`tippy-options`,`onClick`]))],64))),128))]),e.updateTools.length>0?(V(),H(`div`,hGt)):ei(`v-if`,!0),Yr(`div`,gGt,[(V(!0),H(Lr,null,dr(e.updateTools,t=>(V(),H(Lr,{key:t.id},[t.id===`like`||t.id===`unlike`?(V(),Gr(B(vp),ii({key:0,ref_for:!0,ref_key:`feedbackTippyRef`,ref:i},{ref_for:!0},l.value,{onShow:e=>g(t.id)}),{content:jn(()=>[Xr(fGt,{loading:a.value,"reason-list":o.value,title:t.id===`like`?B(Op)(`什么原因让你满意?`):B(Op)(`什么原因让你不满意?`),onCancel:f,onSubmit:(e,n)=>h(t,e,n)},null,8,[`loading`,`reason-list`,`title`,`onSubmit`])]),default:jn(()=>[Xr(Up,ii({ref_for:!0},t,{id:p(t.id),active:s.value===t.id,disabled:e.messageToolsStatus===B(B9).Disabled,"tippy-options":{...e.tippyOptions,content:m(t.id)},onClick:e=>u(t)}),null,16,[`id`,`active`,`disabled`,`tippy-options`,`onClick`])]),_:2},1040,[`onShow`])):t.id===`delete`?(V(),Gr(oGt,ii({key:1,ref_for:!0},t,{disabled:e.messageToolsStatus===B(B9).Disabled,"tippy-options":e.tippyOptions,onConfirm:e=>d(t)}),null,16,[`disabled`,`tippy-options`,`onConfirm`])):(V(),Gr(Up,ii({key:2,ref_for:!0},t,{disabled:e.messageToolsStatus===B(B9).Disabled,"tippy-options":e.tippyOptions,onClick:e=>u(t)}),null,16,[`disabled`,`tippy-options`,`onClick`]))],64))),128))])],512))}}),V9=Qn({name:`HighlightKeyword`,props:{text:{type:String,required:!0}},setup(e){let t=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),n=MDe(),r=pi(()=>{if(!e.text||!n?.value)return e.text;let r=n.value.trim();if(!r)return e.text;let i=RegExp(`(${t(r)})`,`ig`),a=e.text?.toString().split(i);return a.length<=1?e.text:a.map(e=>i.test(e)?U(`span`,{class:qTe},e):e)});return()=>U(`span`,r.value)}}),vGt={class:`ai-activity-message`},yGt={class:`ai-activity-message-content`},bGt=Qn({__name:`activity-layout`,props:yr({activityType:{}},{collapsed:{type:Boolean,default:!1},collapsedModifiers:{}}),emits:[`update:collapsed`],setup(e){let t=Dr(e,`collapsed`);return(n,r)=>(V(),H(`div`,vGt,[Yr(`div`,{class:`ai-activity-message-title`,onClick:r[0]||=e=>t.value=!t.value},[pr(n.$slots,`title`,xe(Zr({collapsed:t.value}))),e.activityType===B(bp).FlowAgent?ei(`v-if`,!0):(V(),H(`span`,{key:0,class:be([`ai-activity-message-title-icon collapsed-icon`,{"is-collapsed":t.value}])},[Xr(B(Pp))],2))]),Mn(Yr(`div`,yGt,[pr(n.$slots,`default`)],512),[[Ti,!t.value]])]))}}),H9=[{color:`#3A84FF`,icon:null,key:`running`,label:Op(`执行中`),rawStates:[`CREATED`,`LOOP_READY`,`READY`,`RUNNING`,`BLOCKED`,`ROLLING_BACK`,`ROLL_BACK_SUCCESS`]},{color:`#65C389`,icon:iEe,key:`success`,label:Op(`成功`),rawStates:[`FINISHED`]},{color:`#EA3636`,icon:aEe,key:`failed`,label:Op(`失败`),rawStates:[`FAILED`,`REVOKED`,`ROLL_BACK_FAILED`]},{color:`#F59500`,icon:oEe,key:`suspended`,label:Op(`挂起`),rawStates:[`SUSPENDED`]},{color:`#4D4F56`,dotColor:`#DCDEE5`,icon:sEe,key:`pending`,label:Op(`待执行`),rawStates:[`PENDING`]},{color:`#5B7290`,icon:cEe,key:`skipped`,label:Op(`跳过`),rawStates:[`SKIPPED`]}],xGt=Object.fromEntries(H9.map(e=>[e.key,e])),SGt=Object.fromEntries(H9.flatMap(e=>e.rawStates.map(t=>[t,e.key]))),CGt=e=>SGt[e]??`running`,wGt=e=>xGt[e].dotColor??xGt[e].color,TGt=e=>{let t=xGt[e].icon;return t?Qr(t):null},EGt=e=>{let t=pi(()=>Array.isArray(e.value)?e.value:[e.value??{}]),n=sn({}),r=e=>n.value[e.task_id]!==!1;return{isTaskExpanded:r,taskList:t,toggleTaskExpanded:e=>{n.value={...n.value,[e.task_id]:!r(e)}},viewTasks:pi(()=>t.value.map(e=>{let t=Object.values(e.nodes??{}).map(e=>{let t=CGt(e.state);return{convergedState:t,dotColor:wGt(t),elapsedTimeText:LTe(e.elapsed_time),id:e.id,name:e.name,raw:e}}),n=t.reduce((e,t)=>e+t.raw.elapsed_time,0),r=CGt(e.task_state??``);return{convergedState:r,hasConfidence:!!e.has_confidence,confidenceTitle:e.confidence_title,isActive:!!e.is_active,nodes:t,raw:e,stateIcon:TGt(r),taskId:e.task_id,taskName:e.task_name,totalTimeText:LTe(n)}})),visibleStats:pi(()=>{let e={};for(let t of H9)e[t.key]=0;for(let n of t.value)for(let[t,r]of Object.entries(n.statistics?.state_counts??{}))e[CGt(t)]+=r;return H9.filter(t=>e[t.key]>0).map(t=>({color:t.color,display:e[t.key]>99?`99+`:String(e[t.key]),dotColor:wGt(t.key),key:t.key,label:t.label}))})}},DGt={class:`ai-detail-section`},OGt={class:`section-heading`},kGt={class:`section-text`},U9=Qn({__name:`detail-section`,props:{title:{}},setup(e){return(t,n)=>(V(),H(`div`,DGt,[Yr(`div`,OGt,[n[0]||=Yr(`span`,{class:`section-bar`},null,-1),Yr(`span`,kGt,Oe(e.title),1)]),pr(t.$slots,`default`)]))}}),AGt={class:`ai-simple-table`},jGt={key:0},MGt=[`colspan`],NGt=Qn({__name:`simple-table`,props:{columns:{},data:{}},setup(e){return(t,n)=>(V(),H(`table`,AGt,[Yr(`thead`,null,[Yr(`tr`,null,[(V(!0),H(Lr,null,dr(e.columns,e=>(V(),H(`th`,{key:e.key},Oe(e.label),1))),128))])]),Yr(`tbody`,null,[(V(!0),H(Lr,null,dr(e.data,(t,n)=>(V(),H(`tr`,{key:n},[(V(!0),H(Lr,null,dr(e.columns,e=>(V(),H(`td`,{key:e.key,class:be({"is-break-all":e.breakAll})},Oe(t[e.key]??`--`),3))),128))]))),128)),e.data.length?ei(`v-if`,!0):(V(),H(`tr`,jGt,[Yr(`td`,{class:`is-empty`,colspan:e.columns.length},` -- `,8,MGt)]))])]))}}),PGt={class:`flow-agent-node-detail`},FGt={class:`detail-title`},IGt={key:1,class:`detail-title-content`},LGt={class:`detail-tab-bar`},RGt=[`onClick`],zGt={class:`detail-body`},BGt={class:`skeleton-section`},VGt={class:`skeleton-section`},HGt={class:`info-form`},UGt={class:`info-label`},WGt={class:`info-value`},GGt={class:`info-row`},KGt={class:`info-label`},qGt={class:`info-value`},JGt={key:0,class:`failure-item`},YGt={key:1,class:`failure-item`},XGt={class:`info-row`},ZGt={class:`info-label`},QGt={class:`info-value`},$Gt={key:0,class:`skeleton-section`},W9=function(e){return e.Config=`config`,e.Output=`output`,e}(W9||{}),eKt=Qn({__name:`flow-agent-node-detail`,props:{data:{},has_confidence:{type:Boolean},loading:{type:Boolean},node_id:{},node_name:{},task_id:{},task_name:{}},setup(e){let t=[{key:W9.Config,label:Op(`节点配置`)},{key:W9.Output,label:Op(`节点输出`)}],n=[{key:`key`,label:Op(`参数名`)},{breakAll:!0,key:`value`,label:Op(`参数值`)}],r=[{key:`name`,label:Op(`名称`)},{key:`description`,label:Op(`变量说明`)},{key:`key`,label:`KEY`}],i=[{key:`key`,label:Op(`参数名`)},{breakAll:!0,key:`value`,label:Op(`参数值`)}],a={forced_fail:Dp?`Force Fail`:`强制失败`},o=e,s=sn(W9.Config),l=pi(()=>o.data?.basic_info),u=pi(()=>{let e=l.value;return e?[{label:Op(`流程模板`),value:e.template_name||`--`},{label:Op(`节点名称`),value:e.node_name||`--`},{label:Op(`步骤名称`),value:e.stage_name||`--`},{label:Op(`是否可选`),value:e.optional?Op(`是`):Op(`否`)}]:[]}),d=pi(()=>{let e=l.value;return e?.skippable||e?.auto_retry?.enable}),f=pi(()=>{let e=l.value?.auto_retry;return e?.enable?Dp?`In ${e.interval} seconds, auto retry ${e.times} times`:`在 ${e.interval} 秒后,自动重试 ${e.times} 次`:``}),p=pi(()=>{let e=l.value?.timeout_config;if(!e?.enable)return`--`;let t=a[e.action]??e.action;return Dp?`Timeout ${e.seconds} seconds later, ${t}`:`超时 ${e.seconds} 秒后则${t}`}),m=pi(()=>Object.entries(o.data?.inputs??{}).map(([e,t])=>({key:e,value:_(t)}))),h=pi(()=>(o.data?.plugin_output??[]).map(e=>({description:e.schema?.description||`--`,name:e.name,key:e.key}))),g=pi(()=>(o.data?.outputs??[]).map(e=>({key:e.key,value:_(e.value)}))),_=e=>e==null?`--`:typeof e==`object`?JSON.stringify(e):String(e);return(a,o)=>(V(),H(`div`,PGt,[Yr(`h3`,FGt,[e.loading?(V(),H(Lr,{key:0},[Yr(`span`,null,Oe(B(Op)(`节点`))+`:`,1),o[0]||=Yr(`span`,{class:`skeleton-title ai-skeleton-element`},null,-1)],64)):(V(),H(`div`,IGt,Oe(B(Op)(`节点`))+`:`+Oe(l.value?.node_name),1)),pr(a.$slots,`locateButton`)]),Yr(`div`,LGt,[(V(),H(Lr,null,dr(t,e=>Yr(`div`,{key:e.key,class:be([`detail-tab`,{"is-active":s.value===e.key}]),onClick:t=>s.value=e.key},[(V(),Gr(lr(e.key===W9.Config?B(uEe):B(Np)),{class:`detail-tab-icon`})),$r(` `+Oe(e.label),1)],10,RGt)),64))]),Yr(`div`,zGt,[s.value===W9.Config?(V(),H(Lr,{key:0},[e.loading?(V(),H(Lr,{key:0},[Yr(`div`,BGt,[o[1]||=Yr(`div`,{class:`skeleton-heading ai-skeleton-element`},null,-1),(V(),H(Lr,null,dr(6,e=>Yr(`div`,{key:e,class:`skeleton-row ai-skeleton-element`})),64))]),Yr(`div`,VGt,[o[2]||=Yr(`div`,{class:`skeleton-heading ai-skeleton-element`},null,-1),(V(),H(Lr,null,dr(4,e=>Yr(`div`,{key:e,class:`skeleton-row ai-skeleton-element`})),64))])],64)):(V(),H(Lr,{key:1},[Xr(U9,{title:B(Op)(`基础信息`)},{default:jn(()=>[Yr(`div`,HGt,[(V(!0),H(Lr,null,dr(u.value,e=>(V(),H(`div`,{key:e.label,class:`info-row`},[Yr(`div`,UGt,Oe(e.label),1),Yr(`div`,WGt,Oe(e.value),1)]))),128)),Yr(`div`,GGt,[Yr(`div`,KGt,Oe(B(Op)(`失败处理`)),1),Yr(`div`,qGt,[d.value?(V(),H(Lr,{key:0},[l.value?.skippable?(V(),H(`span`,JGt,[o[3]||=Yr(`span`,{class:`tag-badge`},`MS`,-1),$r(` `+Oe(B(Op)(`手动跳过`))+Oe(l.value?.auto_retry?.enable?`;`:``),1)])):ei(`v-if`,!0),l.value?.auto_retry?.enable?(V(),H(`span`,YGt,[o[4]||=Yr(`span`,{class:`tag-badge`},`AR`,-1),$r(` `+Oe(f.value),1)])):ei(`v-if`,!0)],64)):(V(),H(Lr,{key:1},[$r(`--`)],64))])]),Yr(`div`,XGt,[Yr(`div`,ZGt,Oe(B(Op)(`超时控制`)),1),Yr(`div`,QGt,Oe(p.value),1)])])]),_:1},8,[`title`]),Xr(U9,{title:B(Op)(`输入参数`)},{default:jn(()=>[Xr(NGt,{columns:n,data:m.value},null,8,[`data`])]),_:1},8,[`title`]),Xr(U9,{title:B(Op)(`输出参数`)},{default:jn(()=>[Xr(NGt,{columns:r,data:h.value},null,8,[`data`])]),_:1},8,[`title`])],64))],64)):(V(),H(Lr,{key:1},[e.loading?(V(),H(`div`,$Gt,[o[5]||=Yr(`div`,{class:`skeleton-heading ai-skeleton-element`},null,-1),(V(),H(Lr,null,dr(5,e=>Yr(`div`,{key:e,class:`skeleton-row ai-skeleton-element`})),64))])):(V(),Gr(U9,{key:1,title:B(Op)(`结构化输出`)},{default:jn(()=>[Xr(NGt,{columns:i,data:g.value},null,8,[`data`])]),_:1},8,[`title`]))],64))])]))}}),G9=e=>e.task_id==null?``:`${e.task_id}`,tKt=G9,nKt=(e,t)=>e.task_id==null?``:`${e.task_id}|${t.id}|${t.name}`,rKt=e=>{let{messageUid:t,taskList:n}=e,r=hDe(),i=dDe(),a=pi(()=>r.selectedTab.value?.name??``),o=sn(!1),s=()=>{o.value=!0},l=pi(()=>{if(o.value)return a.value;let e=n.value.find(e=>e.is_active);return e?.task_id==null?a.value:G9(e)}),u=e=>{let t=l.value;return t===G9(e)||t===tKt(e)},d=(e,t)=>l.value===nKt(e,t),f=(e,n)=>{let i=e.task_id;i!=null&&(s(),r.addCustomTab?.({label:n.name,name:nKt(e,n),data:{component:eKt,messageUid:t.value,props:{data:{},loading:!0,node_id:n.id,node_name:n.name,task_id:i,task_name:e.task_name}}}))},p=e=>{let n=e?.task_id;n&&(s(),r.addCustomTab?.({label:Op(`有效证据`),name:tKt(e),data:{component:eKt,messageUid:t.value,props:{data:{},has_confidence:e.has_confidence,loading:!0,task_id:n,task_name:e.task_name}}}))};return Ln(a,(e,t)=>{t!==void 0&&s()}),or(()=>{i?.value&&p(n.value.find(e=>e.is_active&&e.has_confidence))}),cr(()=>{if(i?.value)for(let e of n.value){r.removeCustomTab?.(G9(e)),r.removeCustomTab?.(tKt(e));for(let t of Object.values(e.nodes??{}))r.removeCustomTab?.(nKt(e,t))}}),{displaySelectedTabName:l,isNodeSelected:d,isTaskSelected:u,markUserTabSelection:s,openConfidence:p,openNodeDetail:f}},iKt={class:`ai-activity-message-title-text`},aKt={class:`flow-agent-title-label`},oKt={class:`flow-agent-stat-tooltip`},sKt={class:`flow-agent-stat-tooltip-status`},cKt={class:`flow-agent-stat-tooltip-label`},lKt={class:`flow-agent-task-state-icon`},uKt={class:`flow-agent-task-name`},dKt={key:0,class:`flow-agent-task-trailing`},fKt={class:`flow-agent-task-time`},pKt=[`onClick`],mKt={class:`flow-agent-task-nodes`},hKt={class:`flow-agent-node-status`},gKt=[`title`],_Kt={key:0,class:`flow-agent-node-trailing`},vKt={class:`flow-agent-node-time`},yKt=[`onClick`],bKt=Qn({__name:`flow-agent-content`,props:yr({content:{},messageUid:{},status:{}},{collapsed:{type:Boolean,default:!1},collapsedModifiers:{}}),emits:[`update:collapsed`],setup(e){let t=e,n=Vp(),r=Dr(e,`collapsed`),i=ADe(),a=pi(()=>i.value!==kp.Share),o=pi(()=>t.status===Sp.Pending||t.status===Sp.Streaming),{isTaskExpanded:s,taskList:l,toggleTaskExpanded:u,viewTasks:d,visibleStats:f}=EGt(fn(t,`content`)),{isNodeSelected:p,isTaskSelected:m,openConfidence:h,openNodeDetail:g}=rKt({messageUid:fn(t,`messageUid`),taskList:l});return(e,t)=>(V(),Gr(bGt,{collapsed:r.value,"onUpdate:collapsed":t[0]||=e=>r.value=e,"activity-type":B(bp).FlowAgent,class:`flow-agent-activity`},{title:jn(()=>[ei(` hover 整条执行情况栏展示统计 tooltip(设计稿 annotation) `),Xr(B(vp),ii({class:`flow-agent-title-bar`,theme:`ai-chat-box-light light`},{...B(n),tag:`div`,arrow:!0,followCursor:!1,offset:[0,10]}),{content:jn(()=>[Yr(`div`,oKt,[(V(!0),H(Lr,null,dr(B(f),e=>(V(),H(`div`,{key:e.key,class:`flow-agent-stat-tooltip-item`},[Yr(`span`,sKt,[e.key===`running`?(V(),Gr(B(Ql),{key:0,mode:`spin`,size:`mini`,theme:`primary`})):(V(),H(`span`,{key:1,class:`flow-agent-stat-dot`,style:he({borderColor:e.dotColor})},null,4))]),Yr(`span`,cKt,Oe(e.label)+`:`,1),Yr(`span`,{class:`flow-agent-stat-tooltip-count`,style:he({color:e.color})},Oe(e.display),5)]))),128))])]),default:jn(()=>[Yr(`span`,{class:be([`ai-activity-message-title-icon`,{"icon-collapsed":r.value}])},[o.value?(V(),Gr(Ip,{key:0,size:12})):(V(),Gr(B(Mp),{key:1}))],2),Yr(`span`,iKt,[Yr(`span`,aKt,Oe(B(Op)(`执行情况`))+`:`,1),(V(!0),H(Lr,null,dr(B(f),e=>(V(),H(`span`,{key:e.key,class:`flow-agent-stat-item`},[e.key===`running`?(V(),Gr(B(Ql),{key:0,class:`flow-agent-stat-loading`,mode:`spin`,size:`mini`,theme:`primary`})):(V(),H(`span`,{key:1,class:`flow-agent-stat-dot`,style:he({borderColor:e.dotColor})},null,4)),Yr(`span`,{class:`flow-agent-stat-count`,style:he({color:e.color})},Oe(e.display),5)]))),128))])]),_:1},16)]),default:jn(()=>[(V(!0),H(Lr,null,dr(B(d),e=>(V(),H(`div`,{key:e.taskId,class:`flow-agent-task-group`},[Yr(`div`,{class:be([`flow-agent-task-header`,{"has-confidence":e.hasConfidence,"is-selected":B(m)(e.raw)}])},[Yr(`span`,{class:be([`flow-agent-task-arrow`,{"is-expanded":B(s)(e.raw)}])},[Xr(B(Mp),{onClick:Ni(t=>B(u)(e.raw),[`stop`])},null,8,[`onClick`])],2),Yr(`span`,lKt,[e.convergedState===`running`?(V(),Gr(B(Ql),{key:0,mode:`spin`,size:`mini`,theme:`primary`})):(V(),Gr(lr(e.stateIcon),{key:1}))]),Mn((V(),H(`span`,uKt,[Xr(B(V9),{text:e.taskName},null,8,[`text`])])),[[B(Hp),{...B(n)}]]),a.value?(V(),H(`span`,dKt,[Yr(`span`,fKt,Oe(e.totalTimeText),1),e.hasConfidence?(V(),H(`span`,{key:0,class:`flow-agent-task-action-btn flow-agent-task-confidence-btn`,onClick:Ni(t=>B(h)(e.raw),[`stop`])},[Xr(B(Np)),$r(` `+Oe(e.confidenceTitle??B(Op)(`有效证据`)),1)],8,pKt)):ei(`v-if`,!0)])):ei(`v-if`,!0)],2),Mn(Yr(`div`,mKt,[(V(!0),H(Lr,null,dr(e.nodes,t=>(V(),H(`div`,{key:t.id,class:be([`flow-agent-node-item`,{"is-selected":B(p)(e.raw,t.raw)}])},[Yr(`span`,hKt,[t.convergedState===`running`?(V(),Gr(B(Ql),{key:0,mode:`spin`,size:`mini`,theme:`primary`})):(V(),H(`span`,{key:1,class:`flow-agent-status-dot`,style:he({borderColor:t.dotColor})},null,4))]),Mn((V(),H(`span`,{class:`flow-agent-node-name`,title:t.name},[Xr(B(V9),{text:t.name},null,8,[`text`])],8,gKt)),[[B(Hp),{...B(n)}]]),a.value?(V(),H(`span`,_Kt,[Yr(`span`,vKt,Oe(t.elapsedTimeText),1),Yr(`span`,{class:`flow-agent-node-detail-btn`,onClick:Ni(n=>B(g)(e.raw,t.raw),[`stop`])},[Xr(B(Np)),$r(` `+Oe(B(Op)(`详情`)),1)],8,yKt)])):ei(`v-if`,!0)],2))),128))],512),[[Ti,B(s)(e.raw)]])]))),128))]),_:1},8,[`collapsed`,`activity-type`]))}}),xKt={class:`ai-activity-message-title-icon`},SKt={class:`ai-activity-message-title-text`},CKt={class:`knowledge-rag-content`},wKt=Qn({__name:`knowledge-rag-content`,props:yr({content:{},messageUid:{},status:{}},{collapsed:{type:Boolean,default:!1},collapsedModifiers:{}}),emits:[`update:collapsed`],setup(e){let t=e,n=Dr(e,`collapsed`),r=pi(()=>t.status===Sp.Pending||t.status===Sp.Streaming),i=pi(()=>r.value?Op(`检索中`):Op(`检索完成`));return(t,a)=>(V(),Gr(bGt,{collapsed:n.value,"onUpdate:collapsed":a[0]||=e=>n.value=e},{title:jn(()=>[Yr(`span`,xKt,[r.value?(V(),Gr(Ip,{key:0})):(V(),Gr(B(jp),{key:1,style:{"font-size":`12px`}}))]),Yr(`span`,SKt,Oe(i.value),1)]),default:jn(()=>[Yr(`div`,CKt,[Xr(b9,{content:e.content?.content||``},null,8,[`content`])]),Xr(LHt,{content:e.content?.referenceDocument||[]},null,8,[`content`])]),_:1},8,[`collapsed`]))}}),TKt={class:`ai-activity-message-title-icon`},EKt={class:`ai-activity-message-title-text`},DKt=Qn({__name:`reference-doc-content`,props:yr({content:{},messageUid:{}},{collapsed:{type:Boolean,default:!1},collapsedModifiers:{}}),emits:[`update:collapsed`],setup(e){let t=e,n=Dr(e,`collapsed`),r=pi(()=>{let e=t.content?.length??0;return Dp?`Reference ${e} documents as reference`:`引用 ${e} 篇资料作为参考`});return(t,i)=>(V(),Gr(bGt,{collapsed:n.value,"onUpdate:collapsed":i[0]||=e=>n.value=e},{title:jn(()=>[Yr(`span`,TKt,[Xr(B(jp),{style:{"font-size":`12px`}})]),Yr(`span`,EKt,Oe(r.value),1)]),default:jn(()=>[Xr(LHt,{content:e.content||[]},null,8,[`content`])]),_:1},8,[`collapsed`]))}}),OKt=Qn({__name:`activity-message`,props:yr({activityType:{},content:{},id:{},messageId:{},name:{},role:{},status:{},uid:{},property:{}},{collapsed:{type:Boolean,default:!1},collapsedModifiers:{}}),emits:[`update:collapsed`],setup(e){let t={[bp.FlowAgent]:bKt,[bp.KnowledgeRag]:wKt,[bp.ReferenceDocument]:DKt},n=e,r=Dr(e,`collapsed`),i=pi(()=>t[n.activityType??``]);return(t,n)=>i.value?(V(),Gr(lr(i.value),{key:0,collapsed:r.value,"onUpdate:collapsed":n[0]||=e=>r.value=e,content:e.content,"message-uid":e.uid,status:e.status},null,40,[`collapsed`,`content`,`message-uid`,`status`])):ei(`v-if`,!0)}}),kKt={class:`toolcall-desc`},AKt={class:`desc-title`},jKt={class:`desc-panel`},MKt={class:`desc-label`},NKt={class:`desc-value`},PKt=Qn({__name:`desc-panel`,props:{desc:{},title:{}},setup(e){let t=e,n=pi(()=>{try{return JSON.parse(t.desc||``)}catch{return t.desc}});return(t,r)=>(V(),H(`div`,kKt,[Yr(`div`,AKt,Oe(e.title),1),Yr(`div`,jKt,[typeof n.value==`object`?(V(!0),H(Lr,{key:0},dr(n.value,(e,t)=>(V(),H(`div`,{key:t,class:`desc-panel-item`},[Yr(`span`,MKt,[Xr(B(V9),{text:t},null,8,[`text`]),r[0]||=$r(`:`,-1)]),Yr(`span`,NKt,[Xr(B(V9),{style:{"word-break":`break-all`},text:typeof e==`object`&&e?JSON.stringify(e):e},null,8,[`text`])])]))),128)):(V(),Gr(B(V9),{key:1,style:{wordBreak:`break-all`},text:n.value},null,8,[`text`]))])]))}}),FKt={class:`tool-message`},IKt=Qn({__name:`tool-message`,props:{duration:{},error:{type:[Boolean,String]},toolCallId:{},content:{},id:{},messageId:{},name:{},role:{},status:{},uid:{},property:{}},setup(e){return(t,n)=>(V(),H(`div`,FKt,[Xr(PKt,{desc:e.content||(typeof e.error==`string`?e.error:void 0),title:B(Op)(`返回内容`)},null,8,[`desc`,`title`])]))}}),LKt={class:`ai-toolcall-render`},RKt={class:`toolcall-header-title`},zKt={class:`toolcall-status-title`},BKt={key:1,class:`toolcall-duration`},VKt={class:`ai-toolcall-render-content`},HKt=Qn({__name:`toolcall-render`,props:{duration:{},status:{},toolCall:{}},setup(e){let t=e,n=sn(!0),r=sn(null),i=Vp(),{keywordMatched:a,keyword:o}=NDe(()=>[t.toolCall?.function.name,t.toolCall?.function.mcpName,t.toolCall?.function.description,t.toolCall?.function.arguments,t.toolCall?.id]),s=pi(()=>r.value===null?o?.value?.trim()?!a.value:n.value:r.value);function l(){n.value=!s.value,r.value=n.value}let u=pi(()=>{let e=t.toolCall?.function.mcpName||``,n=t.toolCall?.function.name||t.toolCall?.id||``;return e?`${e} / ${n}`:n}),d=pi(()=>{switch(t.status){default:case Sp.Pending:return Op(`调用中`);case Sp.Complete:case Sp.Success:return Op(`调用成功`);case Sp.Error||t.toolCall?.toolMessage?.error:return Op(`调用失败`)}}),f=pi(()=>{let e=t.duration||t.toolCall?.toolMessage?.duration;return e?ITe(e):``});return(t,n)=>(V(),H(`div`,LKt,[Yr(`div`,{class:be([`ai-toolcall-render-header`,`toolcall-status-${e.status}`]),onClick:l},[Xr(B(Mp),{class:be({"is-collapsed":s.value})},null,8,[`class`]),$r(` `+Oe(e.toolCall?.function.mcpName?B(Op)(`调用 MCP:`):B(Op)(`调用工具:`))+` `,1),Mn((V(),H(`span`,RKt,[Xr(B(V9),{text:u.value},null,8,[`text`])])),[[B(Hp),{...B(i),text:u.value,appendTo:`parent`}]]),Yr(`span`,zKt,[e.status===B(Sp).Pending||e.status===B(Sp).Streaming?(V(),Gr(B(Ql),{key:0,mode:`spin`,size:`mini`,theme:`primary`})):ei(`v-if`,!0),Xr(B(V9),{text:d.value},null,8,[`text`]),f.value?(V(),H(`span`,BKt,` (`+Oe(f.value)+`) `,1)):ei(`v-if`,!0)])],2),Mn(Yr(`div`,VKt,[Xr(PKt,{desc:e.toolCall?.function.description,title:B(Op)(`描述`)},null,8,[`desc`,`title`]),Xr(PKt,{desc:e.toolCall?.function.arguments,title:B(Op)(`参数`)},null,8,[`desc`,`title`]),e.toolCall?.toolMessage?(V(),Gr(IKt,xe(ii({key:0},e.toolCall.toolMessage)),null,16)):ei(`v-if`,!0)],512),[[Ti,!s.value]])]))}}),UKt={class:`ai-assistant-message`},WKt={key:0,class:`ai-assistant-message-content`},GKt=Qn({__name:`assistant-message`,props:{toolCalls:{},content:{},id:{},messageId:{},name:{},role:{},status:{},uid:{},property:{}},setup(e){return(t,n)=>(V(),H(`div`,UKt,[e.content?(V(),H(`div`,WKt,[pr(t.$slots,`default`,xe(Zr({content:e.content})),()=>[Xr(RHt,{content:e.content||``,status:e.status,type:B(bp).Text},null,8,[`content`,`status`,`type`])])])):ei(`v-if`,!0),e.toolCalls&&e.toolCalls.length>0?(V(!0),H(Lr,{key:1},dr(e.toolCalls,t=>(V(),Gr(HKt,{key:t.id,status:t.toolMessage?.status??e.status,"tool-call":t},null,8,[`status`,`tool-call`]))),128)):ei(`v-if`,!0)]))}}),KKt={class:`info-message`},qKt=Qn({__name:`info-message`,props:{content:{},id:{},messageId:{},name:{},role:{},status:{},uid:{},property:{}},setup(e){return(t,n)=>(V(),H(`div`,KKt,[(V(!0),H(Lr,null,dr(Array.isArray(e.content)?e.content:[e.content],(e,t)=>(V(),H(`div`,{key:t,class:`info-message-content`},Oe(e),1))),128))]))}}),JKt={class:`ai-loading-message`},YKt=Qn({__name:`loading-message`,setup(e){return(e,t)=>(V(),H(`div`,JKt,[Xr(Ip,{size:18}),pr(e.$slots,`default`,{},()=>[$r(Oe(B(Op)(`请求中...`)),1)])]))}}),XKt={class:`ai-reasoning-message`},ZKt={key:0,class:`ai-reasoning-message-title-icon`},QKt={class:`ai-reasoning-message-title-text`},$Kt={class:`ai-reasoning-message-content`},eqt=Qn({__name:`reasoning-message`,props:yr({duration:{},content:{},id:{},messageId:{},name:{},role:{},status:{},uid:{},property:{}},{collapsed:{type:Boolean,default:!1},collapsedModifiers:{}}),emits:[`update:collapsed`],setup(e){let t=e,n=Dr(e,`collapsed`),{stop:r}=Ln(()=>t.duration,async e=>{e&&(n.value=!0,await En(),r?.())},{immediate:!0}),i=pi(()=>{switch(t.status){case Sp.Pending:return Op(`思考中`);case Sp.Success:case Sp.Complete:return Op(`已思考完成`)+(t.duration?` (${Op(`耗时`)} :${ITe(t.duration)})`:``);case Sp.Error:return Op(`思考失败`);default:return Op(`思考中`)}});return(t,r)=>(V(),H(`div`,XKt,[Yr(`div`,{class:be([`ai-reasoning-message-title`,{"ai-reasoning-message-title-collapsed":n.value,"is-thinking":e.status===B(Sp).Pending||e.status===B(Sp).Streaming,"is-complete":e.status===B(Sp).Complete||e.status===B(Sp).Success,"is-error":e.status===B(Sp).Error}]),onClick:r[0]||=e=>n.value=!n.value},[e.status===B(Sp).Pending||e.status===B(Sp).Streaming?(V(),H(`span`,ZKt,[Xr(Ip)])):ei(`v-if`,!0),Yr(`span`,QKt,Oe(i.value),1),ei(` <template v-if="status === MessageStatus.Pending || status === MessageStatus.Streaming">
3491
3491
  <ContentLoadingIcon
3492
3492
  v-for="i in 3"
3493
3493
  :key="i"
@@ -3487,7 +3487,7 @@ Input "@" to trigger tool and MCP
3487
3487
  Use Shift + Enter to enter a new line`:`输入 "/" 唤出 Skill
3488
3488
  输入 "\\" 唤出 Prompt
3489
3489
  输入 "@" 唤出 工具和 MCP
3490
- 通过 Shift + Enter 进行换行输入`},prompts:{default:()=>[]},resources:{default:()=>[]},shortcutId:{},shortcuts:{},skills:{default:()=>[]},supportUpload:{type:Boolean,default:!0},tippyOptions:{}},{cite:{required:!1,default:``},citeModifiers:{}}),emits:(0,t.mergeModels)([`selectShortcut`,`deleteShortcut`,`update:modelValue`],[`update:cite`]),setup(e,{expose:n,emit:r}){let i=(0,t.useTemplateRef)(`aiSlashInputRef`),a=(0,t.useTemplateRef)(`filesRef`),o=(0,t.useModel)(e,`cite`),s=(0,t.shallowRef)(200),l=e,u=r,d=(0,t.ref)(l.defaultUploadFiles||[]),f=(0,t.computed)(()=>l.shortcuts?.find(e=>e.id===l.shortcutId)),p=(0,t.computed)(()=>l.messageStatus&&[hu.Pending,hu.Streaming,hu.Fetching].includes(l.messageStatus)?l.messageStatus:l.modelValue?.length<1||Array.isArray(l.modelValue)&&!i9(l.modelValue).trim()?hu.Disabled:l.messageStatus);(0,t.watchPostEffect)(()=>{let e=l.inputMaxHeight||200;if(d.value.length<1||!a.value){s.value=e;return}s.value=e+(a.value?.clientHeight||0)});let m=async()=>{try{i.value?.cleanup?.();let e;d.value?.length?(e=d.value?.slice().map(e=>({type:pu.Binary,url:e.url,mimeType:e.file?.type||``,filename:e.file?.name||``})),l.modelValue&&e.push({type:pu.Text,text:i9(l.modelValue)})):e=typeof l.modelValue==`string`?l.modelValue:i9(l.modelValue),l.onSendMessage?.(e,l.modelValue),d.value=[]}catch(e){console.error(e)}},h=e=>{if(e.key===`Enter`||e.key===`NumpadEnter`){if(e.shiftKey||p.value===hu.Disabled||p.value===hu.Fetching)return;m()}},g=async()=>{try{l.onStopSending?.()}catch(e){console.error(e)}},_=()=>{o.value=``},v=e=>{u(`selectShortcut`,e)},y=()=>{u(`deleteShortcut`)},b=e=>`${e.name}_${e.size}_${e.lastModified}`,x=(Tye/(1024*1024)).toFixed(1),S=async e=>{if(!l.supportUpload)return;if(d.value.length>=3){e.length>0&&bc({message:gu(e.length,x,bu),theme:`error`});return}let t=new Set(d.value.map(e=>e.file?b(e.file):``)),n=0;for(let r=0;r<e.length;r++){let i=e[r];if(d.value.length>=3){n+=e.length-r;break}let a=b(i);if(t.has(a)){n+=1;continue}if(i.size<=0||i.size>=2516582.4){n+=1;continue}t.add(a);let o={file:i,status:E9.Pending};d.value.push(o),l.onUpload?.(i).then(e=>{if(e&&typeof e==`object`&&`download_url`in e){o.url=e.download_url,o.status=E9.Success;return}o.status=E9.Error}).catch(()=>{o.status=E9.Error})}n>0&&bc({message:gu(n,x,bu),theme:`error`})},C=e=>{d.value=d.value.filter(t=>t.file?t.file!==e.file:t.url?t.url!==e.url:t.filename?t.filename!==e.filename:!0)},w=(e,t)=>{u(`update:modelValue`,e,t)};return n({focus:()=>{i.value?.focus?.()},triggerSendMessage:m}),(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{class:`chat-input-container`,style:(0,t.normalizeStyle)({"--chat-z-index":(0,t.unref)(vye)})},[(0,t.renderSlot)(n.$slots,`top`),(0,t.createElementVNode)(`div`,{class:`chat-input`,style:(0,t.normalizeStyle)({maxHeight:s.value+`px`})},[(0,t.renderSlot)(n.$slots,`input-header`,{},()=>[o.value?((0,t.openBlock)(),(0,t.createBlock)(IPt,{key:0,class:`chat-input-cite`,content:o.value,onClose:_},null,8,[`content`])):(0,t.createCommentVNode)(`v-if`,!0)]),(0,t.renderSlot)(n.$slots,`files`,(0,t.normalizeProps)((0,t.guardReactiveProps)({files:d.value})),()=>[d.value.length?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:0,ref_key:`filesRef`,ref:a,class:`chat-input-files`},[(0,t.createVNode)(O9,{files:d.value,onDeleteFile:C},null,8,[`files`])],512)):(0,t.createCommentVNode)(`v-if`,!0)]),(0,t.createVNode)(FFt,{ref_key:`aiSlashInputRef`,ref:i,"model-value":e.modelValue,placeholder:e.placeholder,prompts:e.prompts,resources:e.resources,skills:e.skills,onKeydown:h,"onUpdate:modelValue":w,onUpload:S},null,8,[`model-value`,`placeholder`,`prompts`,`resources`,`skills`]),(0,t.createVNode)(LFt,{"message-state":p.value,"tippy-options":e.tippyOptions,onSendMessage:m,onStopSending:g},{default:(0,t.withCtx)(()=>[e.supportUpload?((0,t.openBlock)(),(0,t.createBlock)(NPt,{key:0,"tippy-options":e.tippyOptions,onUpload:S},null,8,[`tippy-options`])):(0,t.createCommentVNode)(`v-if`,!0),e.supportUpload&&(e.shortcuts?.length||f.value)?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,RFt)):(0,t.createCommentVNode)(`v-if`,!0),(0,t.renderSlot)(n.$slots,`attachment`,{},()=>[e.shortcuts&&!f.value?((0,t.openBlock)(),(0,t.createBlock)(jbe,{key:0,shortcuts:e.shortcuts,onSelectShortcut:v},null,8,[`shortcuts`])):(0,t.createCommentVNode)(`v-if`,!0),f.value?((0,t.openBlock)(),(0,t.createBlock)(Au,{key:1,class:`selected-shortcut-btn`,shortcut:f.value},{append:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(Ou),{onClick:y})]),_:1},8,[`shortcut`])):(0,t.createCommentVNode)(`v-if`,!0)])]),"send-icon":(0,t.withCtx)(()=>[(0,t.renderSlot)(n.$slots,`send-icon`)]),_:3},8,[`message-state`,`tippy-options`])],4)],4))}}),BFt={class:`ai-delete-confirm`},VFt={class:`ai-delete-confirm__title`},HFt={class:`ai-delete-confirm__desc`},UFt={class:`ai-delete-confirm__actions`},WFt=(0,t.defineComponent)({__name:`delete-tool`,props:{description:{},id:{},name:{},disabled:{type:Boolean},tippyOptions:{}},emits:[`confirm`,`cancel`],setup(e,{emit:n}){let r=e,i=n,a=(0,t.useTemplateRef)(`tippyRef`),o=(0,t.computed)(()=>({id:r.id,name:r.name,description:r.description,disabled:r.disabled,tippyOptions:r.tippyOptions})),s=(0,t.computed)(()=>({arrow:!1,interactive:!0,offset:[0,6],theme:`ai-chat-box-light light`,trigger:`click`,appendTo:()=>document.body,...r.tippyOptions||{}})),l=()=>{if(r.disabled)return!1},u=()=>{a.value?.hide?.()},d=()=>{u(),i(`confirm`)},f=()=>{u(),i(`cancel`)};return(0,t.onUnmounted)(()=>{u()}),(e,n)=>((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(uu),(0,t.mergeProps)({ref_key:`tippyRef`,ref:a},s.value,{onShow:l}),{content:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,BFt,[(0,t.createElementVNode)(`div`,VFt,(0,t.toDisplayString)((0,t.unref)(xu)(`确认删除该回答?`)),1),(0,t.createElementVNode)(`div`,HFt,(0,t.toDisplayString)((0,t.unref)(xu)(`删除操作无法撤回,请谨慎操作!`)),1),(0,t.createElementVNode)(`div`,UFt,[(0,t.createVNode)((0,t.unref)(Go),{size:`small`,theme:`danger`,onClick:d},{default:(0,t.withCtx)(()=>[(0,t.createTextVNode)((0,t.toDisplayString)((0,t.unref)(xu)(`删除`)),1)]),_:1}),(0,t.createVNode)((0,t.unref)(Go),{size:`small`,onClick:f},{default:(0,t.withCtx)(()=>[(0,t.createTextVNode)((0,t.toDisplayString)((0,t.unref)(xu)(`取消`)),1)]),_:1})])])]),default:(0,t.withCtx)(()=>[(0,t.createVNode)(Iu,(0,t.normalizeProps)((0,t.guardReactiveProps)(o.value)),null,16)]),_:1},16))}}),GFt={class:`ai-feedback-title`},KFt={class:`ai-feedback-reason-list`},qFt=[`onClick`],JFt={class:`ai-feedback-other`},YFt={class:`ai-feedback-footer`},XFt=(0,t.defineComponent)({__name:`user-feedback`,props:{loading:{type:Boolean},reasonList:{},title:{}},emits:[`submit`,`cancel`],setup(e,{emit:n}){let r=n,i=(0,t.shallowRef)(``),a=(0,t.shallowRef)([]),o=e=>{a.value.includes(e)?a.value=a.value.filter(t=>t!==e):a.value=[...a.value,e]},s=()=>{r(`submit`,a.value,i.value)},l=()=>{a.value=[],i.value=``,r(`cancel`)};return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{class:`ai-user-feedback`,onMouseenter:r[1]||=(0,t.withModifiers)(()=>{},[`stop`,`prevent`])},[(0,t.createElementVNode)(`div`,GFt,(0,t.toDisplayString)(e.title),1),(0,t.createElementVNode)(`div`,KFt,[e.loading?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:0},(0,t.renderList)(8,e=>(0,t.createElementVNode)(`div`,{key:e,class:`reason-item ai-skeleton-element`})),64)):((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,{key:1},(0,t.renderList)(e.reasonList,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:e,class:(0,t.normalizeClass)([`reason-item`,{"is-active":a.value.includes(e)}]),onClick:t=>o(e)},(0,t.toDisplayString)(e),11,qFt))),128))]),(0,t.createElementVNode)(`div`,JFt,[(0,t.createVNode)((0,t.unref)(ns),{modelValue:i.value,"onUpdate:modelValue":r[0]||=e=>i.value=e,placeholder:(0,t.unref)(xu)(`说出您的想法`),rows:3,type:`textarea`},null,8,[`modelValue`,`placeholder`])]),(0,t.createElementVNode)(`div`,YFt,[(0,t.createVNode)((0,t.unref)(Go),{class:`custom-btn`,disabled:!i.value&&a.value.length===0,size:`small`,theme:`primary`,onClick:s},{default:(0,t.withCtx)(()=>[(0,t.createTextVNode)((0,t.toDisplayString)((0,t.unref)(xu)(`提交`)),1)]),_:1},8,[`disabled`]),(0,t.createVNode)((0,t.unref)(Go),{class:`custom-btn`,size:`small`,width:`80px`,onClick:l},{default:(0,t.withCtx)(()=>[(0,t.createTextVNode)((0,t.toDisplayString)((0,t.unref)(xu)(`取消`)),1)]),_:1})])],32))}}),ZFt={ref:`messageToolsRef`,class:`message-tools-container`},QFt={class:`message-tools`,style:{"margin-right":`8px`}},$Ft={key:0,class:`ai-divider`,style:{"margin-right":`8px`}},eIt={class:`message-tools`},tIt=(0,t.defineComponent)({__name:`message-tools`,props:{messageTools:{default:()=>Sye},messageToolsStatus:{},onAction:{},tippyOptions:{},updateTools:{default:()=>wye}},emits:[`feedback`],setup(e,{emit:n}){let r=e,i=n,a=(0,t.useTemplateRef)(`feedbackTippyRef`),o=(0,t.shallowRef)(!1),s=(0,t.shallowRef)([]),l=(0,t.shallowRef)(null),u=(0,t.computed)(()=>({arrow:!1,interactive:!0,offset:[0,6],theme:`ai-chat-box-light light`,trigger:`click`,appendTo:()=>document.body,...r.tippyOptions||{}})),d=async e=>{if(e.id===`like`||e.id===`unlike`){try{o.value=!0,s.value=[],s.value=await r.onAction?.(e)||[]}finally{o.value=!1}return}await r.onAction?.(e)},f=async e=>{await r.onAction?.(e)},p=()=>{a.value?.forEach(e=>e?.hide?.())},m=e=>l.value?l.value===`like`&&e===`like`?`activeLike`:l.value===`unlike`&&e===`unlike`?`activeUnLike`:e:e,h=e=>{let t=m(e);return t===`activeLike`?xu(`取消满意`):t===`activeUnLike`?xu(`取消不满意`):r.updateTools?.find(e=>e.id===t)?.description||``},g=(e,t,n)=>{p(),l.value===e.id?l.value=null:l.value=e.id,i(`feedback`,e,t,n)},_=e=>{if(r.messageToolsStatus===D9.Disabled)return!1;if(l.value&&l.value===e)return l.value=null,!1};return(0,t.onUnmounted)(()=>{p(),s.value=[]}),(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,ZFt,[(0,t.createElementVNode)(`div`,QFt,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.messageTools,n=>((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:n.id},[n.id===`delete`?((0,t.openBlock)(),(0,t.createBlock)(WFt,(0,t.mergeProps)({key:0,ref_for:!0},n,{disabled:e.messageToolsStatus===(0,t.unref)(D9).Disabled,"tippy-options":e.tippyOptions,onConfirm:e=>f(n)}),null,16,[`disabled`,`tippy-options`,`onConfirm`])):((0,t.openBlock)(),(0,t.createBlock)(Iu,(0,t.mergeProps)({key:1,ref_for:!0},n,{disabled:e.messageToolsStatus===(0,t.unref)(D9).Disabled,"tippy-options":e.tippyOptions,onClick:e=>d(n)}),null,16,[`disabled`,`tippy-options`,`onClick`]))],64))),128))]),e.updateTools.length>0?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,$Ft)):(0,t.createCommentVNode)(`v-if`,!0),(0,t.createElementVNode)(`div`,eIt,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.updateTools,n=>((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:n.id},[n.id===`like`||n.id===`unlike`?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(uu),(0,t.mergeProps)({key:0,ref_for:!0,ref_key:`feedbackTippyRef`,ref:a},{ref_for:!0},u.value,{onShow:e=>_(n.id)}),{content:(0,t.withCtx)(()=>[(0,t.createVNode)(XFt,{loading:o.value,"reason-list":s.value,title:n.id===`like`?(0,t.unref)(xu)(`什么原因让你满意?`):(0,t.unref)(xu)(`什么原因让你不满意?`),onCancel:p,onSubmit:(e,t)=>g(n,e,t)},null,8,[`loading`,`reason-list`,`title`,`onSubmit`])]),default:(0,t.withCtx)(()=>[(0,t.createVNode)(Iu,(0,t.mergeProps)({ref_for:!0},n,{id:m(n.id),active:l.value===n.id,disabled:e.messageToolsStatus===(0,t.unref)(D9).Disabled,"tippy-options":{...e.tippyOptions,content:h(n.id)},onClick:e=>d(n)}),null,16,[`id`,`active`,`disabled`,`tippy-options`,`onClick`])]),_:2},1040,[`onShow`])):n.id===`delete`?((0,t.openBlock)(),(0,t.createBlock)(WFt,(0,t.mergeProps)({key:1,ref_for:!0},n,{disabled:e.messageToolsStatus===(0,t.unref)(D9).Disabled,"tippy-options":e.tippyOptions,onConfirm:e=>f(n)}),null,16,[`disabled`,`tippy-options`,`onConfirm`])):((0,t.openBlock)(),(0,t.createBlock)(Iu,(0,t.mergeProps)({key:2,ref_for:!0},n,{disabled:e.messageToolsStatus===(0,t.unref)(D9).Disabled,"tippy-options":e.tippyOptions,onClick:e=>d(n)}),null,16,[`disabled`,`tippy-options`,`onClick`]))],64))),128))])],512))}}),k9=(0,t.defineComponent)({name:`HighlightKeyword`,props:{text:{type:String,required:!0}},setup(e){let n=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),r=dxe(),i=(0,t.computed)(()=>{if(!e.text||!r?.value)return e.text;let i=r.value.trim();if(!i)return e.text;let a=RegExp(`(${n(i)})`,`ig`),o=e.text?.toString().split(a);return o.length<=1?e.text:o.map(e=>a.test(e)?(0,t.h)(`span`,{class:Eye},e):e)});return()=>(0,t.h)(`span`,i.value)}}),nIt={class:`ai-activity-message`},rIt={class:`ai-activity-message-content`},A9=(0,t.defineComponent)({__name:`activity-layout`,props:(0,t.mergeModels)({activityType:{}},{collapsed:{type:Boolean,default:!1},collapsedModifiers:{}}),emits:[`update:collapsed`],setup(e){let n=(0,t.useModel)(e,`collapsed`);return(r,i)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,nIt,[(0,t.createElementVNode)(`div`,{class:`ai-activity-message-title`,onClick:i[0]||=e=>n.value=!n.value},[(0,t.renderSlot)(r.$slots,`title`,(0,t.normalizeProps)((0,t.guardReactiveProps)({collapsed:n.value}))),e.activityType===(0,t.unref)(pu).FlowAgent?(0,t.createCommentVNode)(`v-if`,!0):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:0,class:(0,t.normalizeClass)([`ai-activity-message-title-icon collapsed-icon`,{"is-collapsed":n.value}])},[(0,t.createVNode)((0,t.unref)(Du))],2))]),(0,t.withDirectives)((0,t.createElementVNode)(`div`,rIt,[(0,t.renderSlot)(r.$slots,`default`)],512),[[t.vShow,!n.value]])]))}}),j9=[{color:`#3A84FF`,icon:null,key:`running`,label:xu(`执行中`),rawStates:[`CREATED`,`LOOP_READY`,`READY`,`RUNNING`,`BLOCKED`,`ROLLING_BACK`,`ROLL_BACK_SUCCESS`]},{color:`#65C389`,icon:Lye,key:`success`,label:xu(`成功`),rawStates:[`FINISHED`]},{color:`#EA3636`,icon:Rye,key:`failed`,label:xu(`失败`),rawStates:[`FAILED`,`REVOKED`,`ROLL_BACK_FAILED`]},{color:`#F59500`,icon:zye,key:`suspended`,label:xu(`挂起`),rawStates:[`SUSPENDED`]},{color:`#4D4F56`,dotColor:`#DCDEE5`,icon:Bye,key:`pending`,label:xu(`待执行`),rawStates:[`PENDING`]},{color:`#5B7290`,icon:Vye,key:`skipped`,label:xu(`跳过`),rawStates:[`SKIPPED`]}],M9=Object.fromEntries(j9.map(e=>[e.key,e])),iIt=Object.fromEntries(j9.flatMap(e=>e.rawStates.map(t=>[t,e.key]))),N9=e=>iIt[e]??`running`,aIt=e=>M9[e].dotColor??M9[e].color,oIt=e=>{let n=M9[e].icon;return n?(0,t.cloneVNode)(n):null},sIt=e=>{let n=(0,t.computed)(()=>Array.isArray(e.value)?e.value:[e.value??{}]),r=(0,t.shallowRef)({}),i=e=>r.value[e.task_id]!==!1;return{isTaskExpanded:i,taskList:n,toggleTaskExpanded:e=>{r.value={...r.value,[e.task_id]:!i(e)}},viewTasks:(0,t.computed)(()=>n.value.map(e=>{let t=Object.values(e.nodes??{}).map(e=>{let t=N9(e.state);return{convergedState:t,dotColor:aIt(t),elapsedTimeText:gye(e.elapsed_time),id:e.id,name:e.name,raw:e}}),n=t.reduce((e,t)=>e+t.raw.elapsed_time,0),r=N9(e.task_state??``);return{convergedState:r,hasConfidence:!!e.has_confidence,confidenceTitle:e.confidence_title,isActive:!!e.is_active,nodes:t,raw:e,stateIcon:oIt(r),taskId:e.task_id,taskName:e.task_name,totalTimeText:gye(n)}})),visibleStats:(0,t.computed)(()=>{let e={};for(let t of j9)e[t.key]=0;for(let t of n.value)for(let[n,r]of Object.entries(t.statistics?.state_counts??{}))e[N9(n)]+=r;return j9.filter(t=>e[t.key]>0).map(t=>({color:t.color,display:e[t.key]>99?`99+`:String(e[t.key]),dotColor:aIt(t.key),key:t.key,label:t.label}))})}},cIt={class:`ai-detail-section`},lIt={class:`section-heading`},uIt={class:`section-text`},P9=(0,t.defineComponent)({__name:`detail-section`,props:{title:{}},setup(e){return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,cIt,[(0,t.createElementVNode)(`div`,lIt,[r[0]||=(0,t.createElementVNode)(`span`,{class:`section-bar`},null,-1),(0,t.createElementVNode)(`span`,uIt,(0,t.toDisplayString)(e.title),1)]),(0,t.renderSlot)(n.$slots,`default`)]))}}),dIt={class:`ai-simple-table`},fIt={key:0},pIt=[`colspan`],F9=(0,t.defineComponent)({__name:`simple-table`,props:{columns:{},data:{}},setup(e){return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`table`,dIt,[(0,t.createElementVNode)(`thead`,null,[(0,t.createElementVNode)(`tr`,null,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.columns,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`th`,{key:e.key},(0,t.toDisplayString)(e.label),1))),128))])]),(0,t.createElementVNode)(`tbody`,null,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.data,(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`tr`,{key:r},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.columns,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`td`,{key:e.key,class:(0,t.normalizeClass)({"is-break-all":e.breakAll})},(0,t.toDisplayString)(n[e.key]??`--`),3))),128))]))),128)),e.data.length?(0,t.createCommentVNode)(`v-if`,!0):((0,t.openBlock)(),(0,t.createElementBlock)(`tr`,fIt,[(0,t.createElementVNode)(`td`,{class:`is-empty`,colspan:e.columns.length},` -- `,8,pIt)]))])]))}}),mIt={class:`flow-agent-node-detail`},hIt={class:`detail-title`},gIt={key:1,class:`detail-title-content`},_It={class:`detail-tab-bar`},vIt=[`onClick`],yIt={class:`detail-body`},bIt={class:`skeleton-section`},xIt={class:`skeleton-section`},SIt={class:`info-form`},CIt={class:`info-label`},wIt={class:`info-value`},TIt={class:`info-row`},EIt={class:`info-label`},DIt={class:`info-value`},OIt={key:0,class:`failure-item`},kIt={key:1,class:`failure-item`},AIt={class:`info-row`},jIt={class:`info-label`},MIt={class:`info-value`},NIt={key:0,class:`skeleton-section`},I9=function(e){return e.Config=`config`,e.Output=`output`,e}(I9||{}),PIt=(0,t.defineComponent)({__name:`flow-agent-node-detail`,props:{data:{},has_confidence:{type:Boolean},loading:{type:Boolean},node_id:{},node_name:{},task_id:{},task_name:{}},setup(e){let n=[{key:I9.Config,label:xu(`节点配置`)},{key:I9.Output,label:xu(`节点输出`)}],r=[{key:`key`,label:xu(`参数名`)},{breakAll:!0,key:`value`,label:xu(`参数值`)}],i=[{key:`name`,label:xu(`名称`)},{key:`description`,label:xu(`变量说明`)},{key:`key`,label:`KEY`}],a=[{key:`key`,label:xu(`参数名`)},{breakAll:!0,key:`value`,label:xu(`参数值`)}],o={forced_fail:bu?`Force Fail`:`强制失败`},s=e,l=(0,t.shallowRef)(I9.Config),u=(0,t.computed)(()=>s.data?.basic_info),d=(0,t.computed)(()=>{let e=u.value;return e?[{label:xu(`流程模板`),value:e.template_name||`--`},{label:xu(`节点名称`),value:e.node_name||`--`},{label:xu(`步骤名称`),value:e.stage_name||`--`},{label:xu(`是否可选`),value:e.optional?xu(`是`):xu(`否`)}]:[]}),f=(0,t.computed)(()=>{let e=u.value;return e?.skippable||e?.auto_retry?.enable}),p=(0,t.computed)(()=>{let e=u.value?.auto_retry;return e?.enable?bu?`In ${e.interval} seconds, auto retry ${e.times} times`:`在 ${e.interval} 秒后,自动重试 ${e.times} 次`:``}),m=(0,t.computed)(()=>{let e=u.value?.timeout_config;if(!e?.enable)return`--`;let t=o[e.action]??e.action;return bu?`Timeout ${e.seconds} seconds later, ${t}`:`超时 ${e.seconds} 秒后则${t}`}),h=(0,t.computed)(()=>Object.entries(s.data?.inputs??{}).map(([e,t])=>({key:e,value:v(t)}))),g=(0,t.computed)(()=>(s.data?.plugin_output??[]).map(e=>({description:e.schema?.description||`--`,name:e.name,key:e.key}))),_=(0,t.computed)(()=>(s.data?.outputs??[]).map(e=>({key:e.key,value:v(e.value)}))),v=e=>e==null?`--`:typeof e==`object`?JSON.stringify(e):String(e);return(o,s)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,mIt,[(0,t.createElementVNode)(`h3`,hIt,[e.loading?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:0},[(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)((0,t.unref)(xu)(`节点`))+`:`,1),s[0]||=(0,t.createElementVNode)(`span`,{class:`skeleton-title ai-skeleton-element`},null,-1)],64)):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,gIt,(0,t.toDisplayString)((0,t.unref)(xu)(`节点`))+`:`+(0,t.toDisplayString)(u.value?.node_name),1)),(0,t.renderSlot)(o.$slots,`locateButton`)]),(0,t.createElementVNode)(`div`,_It,[((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(n,e=>(0,t.createElementVNode)(`div`,{key:e.key,class:(0,t.normalizeClass)([`detail-tab`,{"is-active":l.value===e.key}]),onClick:t=>l.value=e.key},[((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(e.key===I9.Config?(0,t.unref)(Uye):(0,t.unref)(Eu)),{class:`detail-tab-icon`})),(0,t.createTextVNode)(` `+(0,t.toDisplayString)(e.label),1)],10,vIt)),64))]),(0,t.createElementVNode)(`div`,yIt,[l.value===I9.Config?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:0},[e.loading?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:0},[(0,t.createElementVNode)(`div`,bIt,[s[1]||=(0,t.createElementVNode)(`div`,{class:`skeleton-heading ai-skeleton-element`},null,-1),((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(6,e=>(0,t.createElementVNode)(`div`,{key:e,class:`skeleton-row ai-skeleton-element`})),64))]),(0,t.createElementVNode)(`div`,xIt,[s[2]||=(0,t.createElementVNode)(`div`,{class:`skeleton-heading ai-skeleton-element`},null,-1),((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(4,e=>(0,t.createElementVNode)(`div`,{key:e,class:`skeleton-row ai-skeleton-element`})),64))])],64)):((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:1},[(0,t.createVNode)(P9,{title:(0,t.unref)(xu)(`基础信息`)},{default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,SIt,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(d.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:e.label,class:`info-row`},[(0,t.createElementVNode)(`div`,CIt,(0,t.toDisplayString)(e.label),1),(0,t.createElementVNode)(`div`,wIt,(0,t.toDisplayString)(e.value),1)]))),128)),(0,t.createElementVNode)(`div`,TIt,[(0,t.createElementVNode)(`div`,EIt,(0,t.toDisplayString)((0,t.unref)(xu)(`失败处理`)),1),(0,t.createElementVNode)(`div`,DIt,[f.value?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:0},[u.value?.skippable?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,OIt,[s[3]||=(0,t.createElementVNode)(`span`,{class:`tag-badge`},`MS`,-1),(0,t.createTextVNode)(` `+(0,t.toDisplayString)((0,t.unref)(xu)(`手动跳过`))+(0,t.toDisplayString)(u.value?.auto_retry?.enable?`;`:``),1)])):(0,t.createCommentVNode)(`v-if`,!0),u.value?.auto_retry?.enable?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,kIt,[s[4]||=(0,t.createElementVNode)(`span`,{class:`tag-badge`},`AR`,-1),(0,t.createTextVNode)(` `+(0,t.toDisplayString)(p.value),1)])):(0,t.createCommentVNode)(`v-if`,!0)],64)):((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:1},[(0,t.createTextVNode)(`--`)],64))])]),(0,t.createElementVNode)(`div`,AIt,[(0,t.createElementVNode)(`div`,jIt,(0,t.toDisplayString)((0,t.unref)(xu)(`超时控制`)),1),(0,t.createElementVNode)(`div`,MIt,(0,t.toDisplayString)(m.value),1)])])]),_:1},8,[`title`]),(0,t.createVNode)(P9,{title:(0,t.unref)(xu)(`输入参数`)},{default:(0,t.withCtx)(()=>[(0,t.createVNode)(F9,{columns:r,data:h.value},null,8,[`data`])]),_:1},8,[`title`]),(0,t.createVNode)(P9,{title:(0,t.unref)(xu)(`输出参数`)},{default:(0,t.withCtx)(()=>[(0,t.createVNode)(F9,{columns:i,data:g.value},null,8,[`data`])]),_:1},8,[`title`])],64))],64)):((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:1},[e.loading?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,NIt,[s[5]||=(0,t.createElementVNode)(`div`,{class:`skeleton-heading ai-skeleton-element`},null,-1),((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(5,e=>(0,t.createElementVNode)(`div`,{key:e,class:`skeleton-row ai-skeleton-element`})),64))])):((0,t.openBlock)(),(0,t.createBlock)(P9,{key:1,title:(0,t.unref)(xu)(`结构化输出`)},{default:(0,t.withCtx)(()=>[(0,t.createVNode)(F9,{columns:a,data:_.value},null,8,[`data`])]),_:1},8,[`title`]))],64))])]))}}),L9=e=>e.task_id==null?``:`${e.task_id}`,R9=L9,z9=(e,t)=>e.task_id==null?``:`${e.task_id}|${t.id}|${t.name}`,FIt=e=>{let{messageUid:n,taskList:r}=e,i=Jbe(),a=Wbe(),o=(0,t.computed)(()=>i.selectedTab.value?.name??``),s=(0,t.shallowRef)(!1),l=()=>{s.value=!0},u=(0,t.computed)(()=>{if(s.value)return o.value;let e=r.value.find(e=>e.is_active);return e?.task_id==null?o.value:L9(e)}),d=e=>{let t=u.value;return t===L9(e)||t===R9(e)},f=(e,t)=>u.value===z9(e,t),p=(e,t)=>{let r=e.task_id;r!=null&&(l(),i.addCustomTab?.({label:t.name,name:z9(e,t),data:{component:PIt,messageUid:n.value,props:{data:{},loading:!0,node_id:t.id,node_name:t.name,task_id:r,task_name:e.task_name}}}))},m=e=>{let t=e?.task_id;t&&(l(),i.addCustomTab?.({label:xu(`有效证据`),name:R9(e),data:{component:PIt,messageUid:n.value,props:{data:{},has_confidence:e.has_confidence,loading:!0,task_id:t,task_name:e.task_name}}}))};return(0,t.watch)(o,(e,t)=>{t!==void 0&&l()}),(0,t.onMounted)(()=>{a?.value&&m(r.value.find(e=>e.is_active&&e.has_confidence))}),(0,t.onUnmounted)(()=>{if(a?.value)for(let e of r.value){i.removeCustomTab?.(L9(e)),i.removeCustomTab?.(R9(e));for(let t of Object.values(e.nodes??{}))i.removeCustomTab?.(z9(e,t))}}),{displaySelectedTabName:u,isNodeSelected:f,isTaskSelected:d,markUserTabSelection:l,openConfidence:m,openNodeDetail:p}},IIt={class:`ai-activity-message-title-text`},LIt={class:`flow-agent-title-label`},RIt={class:`flow-agent-stat-tooltip`},zIt={class:`flow-agent-stat-tooltip-status`},BIt={class:`flow-agent-stat-tooltip-label`},VIt={class:`flow-agent-task-state-icon`},HIt={class:`flow-agent-task-name`},UIt={key:0,class:`flow-agent-task-trailing`},WIt={class:`flow-agent-task-time`},GIt=[`onClick`],KIt={class:`flow-agent-task-nodes`},qIt={class:`flow-agent-node-status`},JIt=[`title`],YIt={key:0,class:`flow-agent-node-trailing`},XIt={class:`flow-agent-node-time`},ZIt=[`onClick`],QIt=(0,t.defineComponent)({__name:`flow-agent-content`,props:(0,t.mergeModels)({content:{},messageUid:{},status:{}},{collapsed:{type:Boolean,default:!1},collapsedModifiers:{}}),emits:[`update:collapsed`],setup(e){let n=e,r=Pu(),i=(0,t.useModel)(e,`collapsed`),a=lxe(),o=(0,t.computed)(()=>a.value!==Su.Share),s=(0,t.computed)(()=>n.status===hu.Pending||n.status===hu.Streaming),{isTaskExpanded:l,taskList:u,toggleTaskExpanded:d,viewTasks:f,visibleStats:p}=sIt((0,t.toRef)(n,`content`)),{isNodeSelected:m,isTaskSelected:h,openConfidence:g,openNodeDetail:_}=FIt({messageUid:(0,t.toRef)(n,`messageUid`),taskList:u});return(e,n)=>((0,t.openBlock)(),(0,t.createBlock)(A9,{collapsed:i.value,"onUpdate:collapsed":n[0]||=e=>i.value=e,"activity-type":(0,t.unref)(pu).FlowAgent,class:`flow-agent-activity`},{title:(0,t.withCtx)(()=>[(0,t.createCommentVNode)(` hover 整条执行情况栏展示统计 tooltip(设计稿 annotation) `),(0,t.createVNode)((0,t.unref)(uu),(0,t.mergeProps)({class:`flow-agent-title-bar`,theme:`ai-chat-box-light light`},{...(0,t.unref)(r),tag:`div`,arrow:!0,followCursor:!1,offset:[0,10]}),{content:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,RIt,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)((0,t.unref)(p),e=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:e.key,class:`flow-agent-stat-tooltip-item`},[(0,t.createElementVNode)(`span`,zIt,[e.key===`running`?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(Lo),{key:0,mode:`spin`,size:`mini`,theme:`primary`})):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:1,class:`flow-agent-stat-dot`,style:(0,t.normalizeStyle)({borderColor:e.dotColor})},null,4))]),(0,t.createElementVNode)(`span`,BIt,(0,t.toDisplayString)(e.label)+`:`,1),(0,t.createElementVNode)(`span`,{class:`flow-agent-stat-tooltip-count`,style:(0,t.normalizeStyle)({color:e.color})},(0,t.toDisplayString)(e.display),5)]))),128))])]),default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`span`,{class:(0,t.normalizeClass)([`ai-activity-message-title-icon`,{"icon-collapsed":i.value}])},[s.value?((0,t.openBlock)(),(0,t.createBlock)(ku,{key:0,size:12})):((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(Tu),{key:1}))],2),(0,t.createElementVNode)(`span`,IIt,[(0,t.createElementVNode)(`span`,LIt,(0,t.toDisplayString)((0,t.unref)(xu)(`执行情况`))+`:`,1),((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)((0,t.unref)(p),e=>((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:e.key,class:`flow-agent-stat-item`},[e.key===`running`?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(Lo),{key:0,class:`flow-agent-stat-loading`,mode:`spin`,size:`mini`,theme:`primary`})):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:1,class:`flow-agent-stat-dot`,style:(0,t.normalizeStyle)({borderColor:e.dotColor})},null,4)),(0,t.createElementVNode)(`span`,{class:`flow-agent-stat-count`,style:(0,t.normalizeStyle)({color:e.color})},(0,t.toDisplayString)(e.display),5)]))),128))])]),_:1},16)]),default:(0,t.withCtx)(()=>[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)((0,t.unref)(f),e=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:e.taskId,class:`flow-agent-task-group`},[(0,t.createElementVNode)(`div`,{class:(0,t.normalizeClass)([`flow-agent-task-header`,{"has-confidence":e.hasConfidence,"is-selected":(0,t.unref)(h)(e.raw)}])},[(0,t.createElementVNode)(`span`,{class:(0,t.normalizeClass)([`flow-agent-task-arrow`,{"is-expanded":(0,t.unref)(l)(e.raw)}])},[(0,t.createVNode)((0,t.unref)(Tu),{onClick:(0,t.withModifiers)(n=>(0,t.unref)(d)(e.raw),[`stop`])},null,8,[`onClick`])],2),(0,t.createElementVNode)(`span`,VIt,[e.convergedState===`running`?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(Lo),{key:0,mode:`spin`,size:`mini`,theme:`primary`})):((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(e.stateIcon),{key:1}))]),(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createElementBlock)(`span`,HIt,[(0,t.createVNode)((0,t.unref)(k9),{text:e.taskName},null,8,[`text`])])),[[(0,t.unref)(Fu),{...(0,t.unref)(r)}]]),o.value?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,UIt,[(0,t.createElementVNode)(`span`,WIt,(0,t.toDisplayString)(e.totalTimeText),1),e.hasConfidence?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:0,class:`flow-agent-task-action-btn flow-agent-task-confidence-btn`,onClick:(0,t.withModifiers)(n=>(0,t.unref)(g)(e.raw),[`stop`])},[(0,t.createVNode)((0,t.unref)(Eu)),(0,t.createTextVNode)(` `+(0,t.toDisplayString)(e.confidenceTitle??(0,t.unref)(xu)(`有效证据`)),1)],8,GIt)):(0,t.createCommentVNode)(`v-if`,!0)])):(0,t.createCommentVNode)(`v-if`,!0)],2),(0,t.withDirectives)((0,t.createElementVNode)(`div`,KIt,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.nodes,n=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:n.id,class:(0,t.normalizeClass)([`flow-agent-node-item`,{"is-selected":(0,t.unref)(m)(e.raw,n.raw)}])},[(0,t.createElementVNode)(`span`,qIt,[n.convergedState===`running`?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(Lo),{key:0,mode:`spin`,size:`mini`,theme:`primary`})):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:1,class:`flow-agent-status-dot`,style:(0,t.normalizeStyle)({borderColor:n.dotColor})},null,4))]),(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{class:`flow-agent-node-name`,title:n.name},[(0,t.createVNode)((0,t.unref)(k9),{text:n.name},null,8,[`text`])],8,JIt)),[[(0,t.unref)(Fu),{...(0,t.unref)(r)}]]),o.value?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,YIt,[(0,t.createElementVNode)(`span`,XIt,(0,t.toDisplayString)(n.elapsedTimeText),1),(0,t.createElementVNode)(`span`,{class:`flow-agent-node-detail-btn`,onClick:(0,t.withModifiers)(r=>(0,t.unref)(_)(e.raw,n.raw),[`stop`])},[(0,t.createVNode)((0,t.unref)(Eu)),(0,t.createTextVNode)(` `+(0,t.toDisplayString)((0,t.unref)(xu)(`详情`)),1)],8,ZIt)])):(0,t.createCommentVNode)(`v-if`,!0)],2))),128))],512),[[t.vShow,(0,t.unref)(l)(e.raw)]])]))),128))]),_:1},8,[`collapsed`,`activity-type`]))}}),$It={class:`ai-activity-message-title-icon`},eLt={class:`ai-activity-message-title-text`},tLt={class:`knowledge-rag-content`},nLt=(0,t.defineComponent)({__name:`knowledge-rag-content`,props:(0,t.mergeModels)({content:{},messageUid:{},status:{}},{collapsed:{type:Boolean,default:!1},collapsedModifiers:{}}),emits:[`update:collapsed`],setup(e){let n=e,r=(0,t.useModel)(e,`collapsed`),i=(0,t.computed)(()=>n.status===hu.Pending||n.status===hu.Streaming),a=(0,t.computed)(()=>i.value?xu(`检索中`):xu(`检索完成`));return(n,o)=>((0,t.openBlock)(),(0,t.createBlock)(A9,{collapsed:r.value,"onUpdate:collapsed":o[0]||=e=>r.value=e},{title:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`span`,$It,[i.value?((0,t.openBlock)(),(0,t.createBlock)(ku,{key:0})):((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(wu),{key:1,style:{"font-size":`12px`}}))]),(0,t.createElementVNode)(`span`,eLt,(0,t.toDisplayString)(a.value),1)]),default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,tLt,[(0,t.createVNode)(Q7,{content:e.content?.content||``},null,8,[`content`])]),(0,t.createVNode)($7,{content:e.content?.referenceDocument||[]},null,8,[`content`])]),_:1},8,[`collapsed`]))}}),rLt={class:`ai-activity-message-title-icon`},iLt={class:`ai-activity-message-title-text`},aLt=(0,t.defineComponent)({__name:`reference-doc-content`,props:(0,t.mergeModels)({content:{},messageUid:{}},{collapsed:{type:Boolean,default:!1},collapsedModifiers:{}}),emits:[`update:collapsed`],setup(e){let n=e,r=(0,t.useModel)(e,`collapsed`),i=(0,t.computed)(()=>{let e=n.content?.length??0;return bu?`Reference ${e} documents as reference`:`引用 ${e} 篇资料作为参考`});return(n,a)=>((0,t.openBlock)(),(0,t.createBlock)(A9,{collapsed:r.value,"onUpdate:collapsed":a[0]||=e=>r.value=e},{title:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`span`,rLt,[(0,t.createVNode)((0,t.unref)(wu),{style:{"font-size":`12px`}})]),(0,t.createElementVNode)(`span`,iLt,(0,t.toDisplayString)(i.value),1)]),default:(0,t.withCtx)(()=>[(0,t.createVNode)($7,{content:e.content||[]},null,8,[`content`])]),_:1},8,[`collapsed`]))}}),oLt=(0,t.defineComponent)({__name:`activity-message`,props:(0,t.mergeModels)({activityType:{},content:{},id:{},messageId:{},name:{},role:{},status:{},uid:{},property:{}},{collapsed:{type:Boolean,default:!1},collapsedModifiers:{}}),emits:[`update:collapsed`],setup(e){let n={[pu.FlowAgent]:QIt,[pu.KnowledgeRag]:nLt,[pu.ReferenceDocument]:aLt},r=e,i=(0,t.useModel)(e,`collapsed`),a=(0,t.computed)(()=>n[r.activityType??``]);return(n,r)=>a.value?((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(a.value),{key:0,collapsed:i.value,"onUpdate:collapsed":r[0]||=e=>i.value=e,content:e.content,"message-uid":e.uid,status:e.status},null,40,[`collapsed`,`content`,`message-uid`,`status`])):(0,t.createCommentVNode)(`v-if`,!0)}}),sLt={class:`toolcall-desc`},cLt={class:`desc-title`},lLt={class:`desc-panel`},uLt={class:`desc-label`},dLt={class:`desc-value`},B9=(0,t.defineComponent)({__name:`desc-panel`,props:{desc:{},title:{}},setup(e){let n=e,r=(0,t.computed)(()=>{try{return JSON.parse(n.desc||``)}catch{return n.desc}});return(n,i)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,sLt,[(0,t.createElementVNode)(`div`,cLt,(0,t.toDisplayString)(e.title),1),(0,t.createElementVNode)(`div`,lLt,[typeof r.value==`object`?((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,{key:0},(0,t.renderList)(r.value,(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:n,class:`desc-panel-item`},[(0,t.createElementVNode)(`span`,uLt,[(0,t.createVNode)((0,t.unref)(k9),{text:n},null,8,[`text`]),i[0]||=(0,t.createTextVNode)(`:`,-1)]),(0,t.createElementVNode)(`span`,dLt,[(0,t.createVNode)((0,t.unref)(k9),{style:{"word-break":`break-all`},text:typeof e==`object`&&e?JSON.stringify(e):e},null,8,[`text`])])]))),128)):((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(k9),{key:1,style:{wordBreak:`break-all`},text:r.value},null,8,[`text`]))])]))}}),fLt={class:`tool-message`},pLt=(0,t.defineComponent)({__name:`tool-message`,props:{duration:{},error:{type:[Boolean,String]},toolCallId:{},content:{},id:{},messageId:{},name:{},role:{},status:{},uid:{},property:{}},setup(e){return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,fLt,[(0,t.createVNode)(B9,{desc:e.content||(typeof e.error==`string`?e.error:void 0),title:(0,t.unref)(xu)(`返回内容`)},null,8,[`desc`,`title`])]))}}),mLt={class:`ai-toolcall-render`},hLt={class:`toolcall-header-title`},gLt={class:`toolcall-status-title`},_Lt={key:1,class:`toolcall-duration`},vLt={class:`ai-toolcall-render-content`},yLt=(0,t.defineComponent)({__name:`toolcall-render`,props:{duration:{},status:{},toolCall:{}},setup(e){let n=e,r=(0,t.shallowRef)(!0),i=(0,t.shallowRef)(null),a=Pu(),{keywordMatched:o,keyword:s}=fxe(()=>[n.toolCall?.function.name,n.toolCall?.function.mcpName,n.toolCall?.function.description,n.toolCall?.function.arguments,n.toolCall?.id]),l=(0,t.computed)(()=>i.value===null?s?.value?.trim()?!o.value:r.value:i.value);function u(){r.value=!l.value,i.value=r.value}let d=(0,t.computed)(()=>{let e=n.toolCall?.function.mcpName||``,t=n.toolCall?.function.name||n.toolCall?.id||``;return e?`${e} / ${t}`:t}),f=(0,t.computed)(()=>{switch(n.status){default:case hu.Pending:return xu(`调用中`);case hu.Complete:case hu.Success:return xu(`调用成功`);case hu.Error||n.toolCall?.toolMessage?.error:return xu(`调用失败`)}}),p=(0,t.computed)(()=>{let e=n.duration||n.toolCall?.toolMessage?.duration;return e?hye(e):``});return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,mLt,[(0,t.createElementVNode)(`div`,{class:(0,t.normalizeClass)([`ai-toolcall-render-header`,`toolcall-status-${e.status}`]),onClick:u},[(0,t.createVNode)((0,t.unref)(Tu),{class:(0,t.normalizeClass)({"is-collapsed":l.value})},null,8,[`class`]),(0,t.createTextVNode)(` `+(0,t.toDisplayString)(e.toolCall?.function.mcpName?(0,t.unref)(xu)(`调用 MCP:`):(0,t.unref)(xu)(`调用工具:`))+` `,1),(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createElementBlock)(`span`,hLt,[(0,t.createVNode)((0,t.unref)(k9),{text:d.value},null,8,[`text`])])),[[(0,t.unref)(Fu),{...(0,t.unref)(a),text:d.value,appendTo:`parent`}]]),(0,t.createElementVNode)(`span`,gLt,[e.status===(0,t.unref)(hu).Pending||e.status===(0,t.unref)(hu).Streaming?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(Lo),{key:0,mode:`spin`,size:`mini`,theme:`primary`})):(0,t.createCommentVNode)(`v-if`,!0),(0,t.createVNode)((0,t.unref)(k9),{text:f.value},null,8,[`text`]),p.value?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,_Lt,` (`+(0,t.toDisplayString)(p.value)+`) `,1)):(0,t.createCommentVNode)(`v-if`,!0)])],2),(0,t.withDirectives)((0,t.createElementVNode)(`div`,vLt,[(0,t.createVNode)(B9,{desc:e.toolCall?.function.description,title:(0,t.unref)(xu)(`描述`)},null,8,[`desc`,`title`]),(0,t.createVNode)(B9,{desc:e.toolCall?.function.arguments,title:(0,t.unref)(xu)(`参数`)},null,8,[`desc`,`title`]),e.toolCall?.toolMessage?((0,t.openBlock)(),(0,t.createBlock)(pLt,(0,t.normalizeProps)((0,t.mergeProps)({key:0},e.toolCall.toolMessage)),null,16)):(0,t.createCommentVNode)(`v-if`,!0)],512),[[t.vShow,!l.value]])]))}}),bLt={class:`ai-assistant-message`},xLt={class:`ai-assistant-message-content`},SLt=(0,t.defineComponent)({__name:`assistant-message`,props:{toolCalls:{},content:{},id:{},messageId:{},name:{},role:{},status:{},uid:{},property:{}},setup(e){return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,bLt,[(0,t.createElementVNode)(`div`,xLt,[(0,t.renderSlot)(n.$slots,`default`,(0,t.normalizeProps)((0,t.guardReactiveProps)({content:e.content})),()=>[(0,t.createVNode)(e9,{content:e.content||``,status:e.status,type:(0,t.unref)(pu).Text},null,8,[`content`,`status`,`type`])])]),e.toolCalls&&e.toolCalls.length>0?((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,{key:0},(0,t.renderList)(e.toolCalls,n=>((0,t.openBlock)(),(0,t.createBlock)(yLt,{key:n.id,status:e.status,"tool-call":n},null,8,[`status`,`tool-call`]))),128)):(0,t.createCommentVNode)(`v-if`,!0)]))}}),CLt={class:`info-message`},wLt=(0,t.defineComponent)({__name:`info-message`,props:{content:{},id:{},messageId:{},name:{},role:{},status:{},uid:{},property:{}},setup(e){return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,CLt,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(Array.isArray(e.content)?e.content:[e.content],(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:n,class:`info-message-content`},(0,t.toDisplayString)(e),1))),128))]))}}),TLt={class:`ai-loading-message`},ELt=(0,t.defineComponent)({__name:`loading-message`,setup(e){return(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,TLt,[(0,t.createVNode)(ku,{size:18}),(0,t.renderSlot)(e.$slots,`default`,{},()=>[(0,t.createTextVNode)((0,t.toDisplayString)((0,t.unref)(xu)(`请求中...`)),1)])]))}}),DLt={class:`ai-reasoning-message`},OLt={key:0,class:`ai-reasoning-message-title-icon`},kLt={class:`ai-reasoning-message-title-text`},ALt={class:`ai-reasoning-message-content`},jLt=(0,t.defineComponent)({__name:`reasoning-message`,props:(0,t.mergeModels)({duration:{},content:{},id:{},messageId:{},name:{},role:{},status:{},uid:{},property:{}},{collapsed:{type:Boolean,default:!1},collapsedModifiers:{}}),emits:[`update:collapsed`],setup(e){let n=e,r=(0,t.useModel)(e,`collapsed`),{stop:i}=(0,t.watch)(()=>n.duration,async e=>{e&&(r.value=!0,await(0,t.nextTick)(),i?.())},{immediate:!0}),a=(0,t.computed)(()=>{switch(n.status){case hu.Pending:return xu(`思考中`);case hu.Success:case hu.Complete:return xu(`已思考完成`)+(n.duration?` (${xu(`耗时`)} :${hye(n.duration)})`:``);case hu.Error:return xu(`思考失败`);default:return xu(`思考中`)}});return(n,i)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,DLt,[(0,t.createElementVNode)(`div`,{class:(0,t.normalizeClass)([`ai-reasoning-message-title`,{"ai-reasoning-message-title-collapsed":r.value,"is-thinking":e.status===(0,t.unref)(hu).Pending||e.status===(0,t.unref)(hu).Streaming,"is-complete":e.status===(0,t.unref)(hu).Complete||e.status===(0,t.unref)(hu).Success,"is-error":e.status===(0,t.unref)(hu).Error}]),onClick:i[0]||=e=>r.value=!r.value},[e.status===(0,t.unref)(hu).Pending||e.status===(0,t.unref)(hu).Streaming?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,OLt,[(0,t.createVNode)(ku)])):(0,t.createCommentVNode)(`v-if`,!0),(0,t.createElementVNode)(`span`,kLt,(0,t.toDisplayString)(a.value),1),(0,t.createCommentVNode)(` <template v-if="status === MessageStatus.Pending || status === MessageStatus.Streaming">
3490
+ 通过 Shift + Enter 进行换行输入`},prompts:{default:()=>[]},resources:{default:()=>[]},shortcutId:{},shortcuts:{},skills:{default:()=>[]},supportUpload:{type:Boolean,default:!0},tippyOptions:{}},{cite:{required:!1,default:``},citeModifiers:{}}),emits:(0,t.mergeModels)([`selectShortcut`,`deleteShortcut`,`update:modelValue`],[`update:cite`]),setup(e,{expose:n,emit:r}){let i=(0,t.useTemplateRef)(`aiSlashInputRef`),a=(0,t.useTemplateRef)(`filesRef`),o=(0,t.useModel)(e,`cite`),s=(0,t.shallowRef)(200),l=e,u=r,d=(0,t.ref)(l.defaultUploadFiles||[]),f=(0,t.computed)(()=>l.shortcuts?.find(e=>e.id===l.shortcutId)),p=(0,t.computed)(()=>l.messageStatus&&[hu.Pending,hu.Streaming,hu.Fetching].includes(l.messageStatus)?l.messageStatus:l.modelValue?.length<1||Array.isArray(l.modelValue)&&!i9(l.modelValue).trim()?hu.Disabled:l.messageStatus);(0,t.watchPostEffect)(()=>{let e=l.inputMaxHeight||200;if(d.value.length<1||!a.value){s.value=e;return}s.value=e+(a.value?.clientHeight||0)});let m=async()=>{try{i.value?.cleanup?.();let e;d.value?.length?(e=d.value?.slice().map(e=>({type:pu.Binary,url:e.url,mimeType:e.file?.type||``,filename:e.file?.name||``})),l.modelValue&&e.push({type:pu.Text,text:i9(l.modelValue)})):e=typeof l.modelValue==`string`?l.modelValue:i9(l.modelValue),l.onSendMessage?.(e,l.modelValue),d.value=[]}catch(e){console.error(e)}},h=e=>{if(e.key===`Enter`||e.key===`NumpadEnter`){if(e.shiftKey||p.value===hu.Disabled||p.value===hu.Fetching)return;m()}},g=async()=>{try{l.onStopSending?.()}catch(e){console.error(e)}},_=()=>{o.value=``},v=e=>{u(`selectShortcut`,e)},y=()=>{u(`deleteShortcut`)},b=e=>`${e.name}_${e.size}_${e.lastModified}`,x=(Tye/(1024*1024)).toFixed(1),S=async e=>{if(!l.supportUpload)return;if(d.value.length>=3){e.length>0&&bc({message:gu(e.length,x,bu),theme:`error`});return}let t=new Set(d.value.map(e=>e.file?b(e.file):``)),n=0;for(let r=0;r<e.length;r++){let i=e[r];if(d.value.length>=3){n+=e.length-r;break}let a=b(i);if(t.has(a)){n+=1;continue}if(i.size<=0||i.size>=2516582.4){n+=1;continue}t.add(a);let o={file:i,status:E9.Pending};d.value.push(o),l.onUpload?.(i).then(e=>{if(e&&typeof e==`object`&&`download_url`in e){o.url=e.download_url,o.status=E9.Success;return}o.status=E9.Error}).catch(()=>{o.status=E9.Error})}n>0&&bc({message:gu(n,x,bu),theme:`error`})},C=e=>{d.value=d.value.filter(t=>t.file?t.file!==e.file:t.url?t.url!==e.url:t.filename?t.filename!==e.filename:!0)},w=(e,t)=>{u(`update:modelValue`,e,t)};return n({focus:()=>{i.value?.focus?.()},triggerSendMessage:m}),(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{class:`chat-input-container`,style:(0,t.normalizeStyle)({"--chat-z-index":(0,t.unref)(vye)})},[(0,t.renderSlot)(n.$slots,`top`),(0,t.createElementVNode)(`div`,{class:`chat-input`,style:(0,t.normalizeStyle)({maxHeight:s.value+`px`})},[(0,t.renderSlot)(n.$slots,`input-header`,{},()=>[o.value?((0,t.openBlock)(),(0,t.createBlock)(IPt,{key:0,class:`chat-input-cite`,content:o.value,onClose:_},null,8,[`content`])):(0,t.createCommentVNode)(`v-if`,!0)]),(0,t.renderSlot)(n.$slots,`files`,(0,t.normalizeProps)((0,t.guardReactiveProps)({files:d.value})),()=>[d.value.length?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:0,ref_key:`filesRef`,ref:a,class:`chat-input-files`},[(0,t.createVNode)(O9,{files:d.value,onDeleteFile:C},null,8,[`files`])],512)):(0,t.createCommentVNode)(`v-if`,!0)]),(0,t.createVNode)(FFt,{ref_key:`aiSlashInputRef`,ref:i,"model-value":e.modelValue,placeholder:e.placeholder,prompts:e.prompts,resources:e.resources,skills:e.skills,onKeydown:h,"onUpdate:modelValue":w,onUpload:S},null,8,[`model-value`,`placeholder`,`prompts`,`resources`,`skills`]),(0,t.createVNode)(LFt,{"message-state":p.value,"tippy-options":e.tippyOptions,onSendMessage:m,onStopSending:g},{default:(0,t.withCtx)(()=>[e.supportUpload?((0,t.openBlock)(),(0,t.createBlock)(NPt,{key:0,"tippy-options":e.tippyOptions,onUpload:S},null,8,[`tippy-options`])):(0,t.createCommentVNode)(`v-if`,!0),e.supportUpload&&(e.shortcuts?.length||f.value)?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,RFt)):(0,t.createCommentVNode)(`v-if`,!0),(0,t.renderSlot)(n.$slots,`attachment`,{},()=>[e.shortcuts&&!f.value?((0,t.openBlock)(),(0,t.createBlock)(jbe,{key:0,shortcuts:e.shortcuts,onSelectShortcut:v},null,8,[`shortcuts`])):(0,t.createCommentVNode)(`v-if`,!0),f.value?((0,t.openBlock)(),(0,t.createBlock)(Au,{key:1,class:`selected-shortcut-btn`,shortcut:f.value},{append:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(Ou),{onClick:y})]),_:1},8,[`shortcut`])):(0,t.createCommentVNode)(`v-if`,!0)])]),"send-icon":(0,t.withCtx)(()=>[(0,t.renderSlot)(n.$slots,`send-icon`)]),_:3},8,[`message-state`,`tippy-options`])],4)],4))}}),BFt={class:`ai-delete-confirm`},VFt={class:`ai-delete-confirm__title`},HFt={class:`ai-delete-confirm__desc`},UFt={class:`ai-delete-confirm__actions`},WFt=(0,t.defineComponent)({__name:`delete-tool`,props:{description:{},id:{},name:{},disabled:{type:Boolean},tippyOptions:{}},emits:[`confirm`,`cancel`],setup(e,{emit:n}){let r=e,i=n,a=(0,t.useTemplateRef)(`tippyRef`),o=(0,t.computed)(()=>({id:r.id,name:r.name,description:r.description,disabled:r.disabled,tippyOptions:r.tippyOptions})),s=(0,t.computed)(()=>({arrow:!1,interactive:!0,offset:[0,6],theme:`ai-chat-box-light light`,trigger:`click`,appendTo:()=>document.body,...r.tippyOptions||{}})),l=()=>{if(r.disabled)return!1},u=()=>{a.value?.hide?.()},d=()=>{u(),i(`confirm`)},f=()=>{u(),i(`cancel`)};return(0,t.onUnmounted)(()=>{u()}),(e,n)=>((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(uu),(0,t.mergeProps)({ref_key:`tippyRef`,ref:a},s.value,{onShow:l}),{content:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,BFt,[(0,t.createElementVNode)(`div`,VFt,(0,t.toDisplayString)((0,t.unref)(xu)(`确认删除该回答?`)),1),(0,t.createElementVNode)(`div`,HFt,(0,t.toDisplayString)((0,t.unref)(xu)(`删除操作无法撤回,请谨慎操作!`)),1),(0,t.createElementVNode)(`div`,UFt,[(0,t.createVNode)((0,t.unref)(Go),{size:`small`,theme:`danger`,onClick:d},{default:(0,t.withCtx)(()=>[(0,t.createTextVNode)((0,t.toDisplayString)((0,t.unref)(xu)(`删除`)),1)]),_:1}),(0,t.createVNode)((0,t.unref)(Go),{size:`small`,onClick:f},{default:(0,t.withCtx)(()=>[(0,t.createTextVNode)((0,t.toDisplayString)((0,t.unref)(xu)(`取消`)),1)]),_:1})])])]),default:(0,t.withCtx)(()=>[(0,t.createVNode)(Iu,(0,t.normalizeProps)((0,t.guardReactiveProps)(o.value)),null,16)]),_:1},16))}}),GFt={class:`ai-feedback-title`},KFt={class:`ai-feedback-reason-list`},qFt=[`onClick`],JFt={class:`ai-feedback-other`},YFt={class:`ai-feedback-footer`},XFt=(0,t.defineComponent)({__name:`user-feedback`,props:{loading:{type:Boolean},reasonList:{},title:{}},emits:[`submit`,`cancel`],setup(e,{emit:n}){let r=n,i=(0,t.shallowRef)(``),a=(0,t.shallowRef)([]),o=e=>{a.value.includes(e)?a.value=a.value.filter(t=>t!==e):a.value=[...a.value,e]},s=()=>{r(`submit`,a.value,i.value)},l=()=>{a.value=[],i.value=``,r(`cancel`)};return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{class:`ai-user-feedback`,onMouseenter:r[1]||=(0,t.withModifiers)(()=>{},[`stop`,`prevent`])},[(0,t.createElementVNode)(`div`,GFt,(0,t.toDisplayString)(e.title),1),(0,t.createElementVNode)(`div`,KFt,[e.loading?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:0},(0,t.renderList)(8,e=>(0,t.createElementVNode)(`div`,{key:e,class:`reason-item ai-skeleton-element`})),64)):((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,{key:1},(0,t.renderList)(e.reasonList,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:e,class:(0,t.normalizeClass)([`reason-item`,{"is-active":a.value.includes(e)}]),onClick:t=>o(e)},(0,t.toDisplayString)(e),11,qFt))),128))]),(0,t.createElementVNode)(`div`,JFt,[(0,t.createVNode)((0,t.unref)(ns),{modelValue:i.value,"onUpdate:modelValue":r[0]||=e=>i.value=e,placeholder:(0,t.unref)(xu)(`说出您的想法`),rows:3,type:`textarea`},null,8,[`modelValue`,`placeholder`])]),(0,t.createElementVNode)(`div`,YFt,[(0,t.createVNode)((0,t.unref)(Go),{class:`custom-btn`,disabled:!i.value&&a.value.length===0,size:`small`,theme:`primary`,onClick:s},{default:(0,t.withCtx)(()=>[(0,t.createTextVNode)((0,t.toDisplayString)((0,t.unref)(xu)(`提交`)),1)]),_:1},8,[`disabled`]),(0,t.createVNode)((0,t.unref)(Go),{class:`custom-btn`,size:`small`,width:`80px`,onClick:l},{default:(0,t.withCtx)(()=>[(0,t.createTextVNode)((0,t.toDisplayString)((0,t.unref)(xu)(`取消`)),1)]),_:1})])],32))}}),ZFt={ref:`messageToolsRef`,class:`message-tools-container`},QFt={class:`message-tools`,style:{"margin-right":`8px`}},$Ft={key:0,class:`ai-divider`,style:{"margin-right":`8px`}},eIt={class:`message-tools`},tIt=(0,t.defineComponent)({__name:`message-tools`,props:{messageTools:{default:()=>Sye},messageToolsStatus:{},onAction:{},tippyOptions:{},updateTools:{default:()=>wye}},emits:[`feedback`],setup(e,{emit:n}){let r=e,i=n,a=(0,t.useTemplateRef)(`feedbackTippyRef`),o=(0,t.shallowRef)(!1),s=(0,t.shallowRef)([]),l=(0,t.shallowRef)(null),u=(0,t.computed)(()=>({arrow:!1,interactive:!0,offset:[0,6],theme:`ai-chat-box-light light`,trigger:`click`,appendTo:()=>document.body,...r.tippyOptions||{}})),d=async e=>{if(e.id===`like`||e.id===`unlike`){try{o.value=!0,s.value=[],s.value=await r.onAction?.(e)||[]}finally{o.value=!1}return}await r.onAction?.(e)},f=async e=>{await r.onAction?.(e)},p=()=>{a.value?.forEach(e=>e?.hide?.())},m=e=>l.value?l.value===`like`&&e===`like`?`activeLike`:l.value===`unlike`&&e===`unlike`?`activeUnLike`:e:e,h=e=>{let t=m(e);return t===`activeLike`?xu(`取消满意`):t===`activeUnLike`?xu(`取消不满意`):r.updateTools?.find(e=>e.id===t)?.description||``},g=(e,t,n)=>{p(),l.value===e.id?l.value=null:l.value=e.id,i(`feedback`,e,t,n)},_=e=>{if(r.messageToolsStatus===D9.Disabled)return!1;if(l.value&&l.value===e)return l.value=null,!1};return(0,t.onUnmounted)(()=>{p(),s.value=[]}),(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,ZFt,[(0,t.createElementVNode)(`div`,QFt,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.messageTools,n=>((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:n.id},[n.id===`delete`?((0,t.openBlock)(),(0,t.createBlock)(WFt,(0,t.mergeProps)({key:0,ref_for:!0},n,{disabled:e.messageToolsStatus===(0,t.unref)(D9).Disabled,"tippy-options":e.tippyOptions,onConfirm:e=>f(n)}),null,16,[`disabled`,`tippy-options`,`onConfirm`])):((0,t.openBlock)(),(0,t.createBlock)(Iu,(0,t.mergeProps)({key:1,ref_for:!0},n,{disabled:e.messageToolsStatus===(0,t.unref)(D9).Disabled,"tippy-options":e.tippyOptions,onClick:e=>d(n)}),null,16,[`disabled`,`tippy-options`,`onClick`]))],64))),128))]),e.updateTools.length>0?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,$Ft)):(0,t.createCommentVNode)(`v-if`,!0),(0,t.createElementVNode)(`div`,eIt,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.updateTools,n=>((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:n.id},[n.id===`like`||n.id===`unlike`?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(uu),(0,t.mergeProps)({key:0,ref_for:!0,ref_key:`feedbackTippyRef`,ref:a},{ref_for:!0},u.value,{onShow:e=>_(n.id)}),{content:(0,t.withCtx)(()=>[(0,t.createVNode)(XFt,{loading:o.value,"reason-list":s.value,title:n.id===`like`?(0,t.unref)(xu)(`什么原因让你满意?`):(0,t.unref)(xu)(`什么原因让你不满意?`),onCancel:p,onSubmit:(e,t)=>g(n,e,t)},null,8,[`loading`,`reason-list`,`title`,`onSubmit`])]),default:(0,t.withCtx)(()=>[(0,t.createVNode)(Iu,(0,t.mergeProps)({ref_for:!0},n,{id:m(n.id),active:l.value===n.id,disabled:e.messageToolsStatus===(0,t.unref)(D9).Disabled,"tippy-options":{...e.tippyOptions,content:h(n.id)},onClick:e=>d(n)}),null,16,[`id`,`active`,`disabled`,`tippy-options`,`onClick`])]),_:2},1040,[`onShow`])):n.id===`delete`?((0,t.openBlock)(),(0,t.createBlock)(WFt,(0,t.mergeProps)({key:1,ref_for:!0},n,{disabled:e.messageToolsStatus===(0,t.unref)(D9).Disabled,"tippy-options":e.tippyOptions,onConfirm:e=>f(n)}),null,16,[`disabled`,`tippy-options`,`onConfirm`])):((0,t.openBlock)(),(0,t.createBlock)(Iu,(0,t.mergeProps)({key:2,ref_for:!0},n,{disabled:e.messageToolsStatus===(0,t.unref)(D9).Disabled,"tippy-options":e.tippyOptions,onClick:e=>d(n)}),null,16,[`disabled`,`tippy-options`,`onClick`]))],64))),128))])],512))}}),k9=(0,t.defineComponent)({name:`HighlightKeyword`,props:{text:{type:String,required:!0}},setup(e){let n=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),r=dxe(),i=(0,t.computed)(()=>{if(!e.text||!r?.value)return e.text;let i=r.value.trim();if(!i)return e.text;let a=RegExp(`(${n(i)})`,`ig`),o=e.text?.toString().split(a);return o.length<=1?e.text:o.map(e=>a.test(e)?(0,t.h)(`span`,{class:Eye},e):e)});return()=>(0,t.h)(`span`,i.value)}}),nIt={class:`ai-activity-message`},rIt={class:`ai-activity-message-content`},A9=(0,t.defineComponent)({__name:`activity-layout`,props:(0,t.mergeModels)({activityType:{}},{collapsed:{type:Boolean,default:!1},collapsedModifiers:{}}),emits:[`update:collapsed`],setup(e){let n=(0,t.useModel)(e,`collapsed`);return(r,i)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,nIt,[(0,t.createElementVNode)(`div`,{class:`ai-activity-message-title`,onClick:i[0]||=e=>n.value=!n.value},[(0,t.renderSlot)(r.$slots,`title`,(0,t.normalizeProps)((0,t.guardReactiveProps)({collapsed:n.value}))),e.activityType===(0,t.unref)(pu).FlowAgent?(0,t.createCommentVNode)(`v-if`,!0):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:0,class:(0,t.normalizeClass)([`ai-activity-message-title-icon collapsed-icon`,{"is-collapsed":n.value}])},[(0,t.createVNode)((0,t.unref)(Du))],2))]),(0,t.withDirectives)((0,t.createElementVNode)(`div`,rIt,[(0,t.renderSlot)(r.$slots,`default`)],512),[[t.vShow,!n.value]])]))}}),j9=[{color:`#3A84FF`,icon:null,key:`running`,label:xu(`执行中`),rawStates:[`CREATED`,`LOOP_READY`,`READY`,`RUNNING`,`BLOCKED`,`ROLLING_BACK`,`ROLL_BACK_SUCCESS`]},{color:`#65C389`,icon:Lye,key:`success`,label:xu(`成功`),rawStates:[`FINISHED`]},{color:`#EA3636`,icon:Rye,key:`failed`,label:xu(`失败`),rawStates:[`FAILED`,`REVOKED`,`ROLL_BACK_FAILED`]},{color:`#F59500`,icon:zye,key:`suspended`,label:xu(`挂起`),rawStates:[`SUSPENDED`]},{color:`#4D4F56`,dotColor:`#DCDEE5`,icon:Bye,key:`pending`,label:xu(`待执行`),rawStates:[`PENDING`]},{color:`#5B7290`,icon:Vye,key:`skipped`,label:xu(`跳过`),rawStates:[`SKIPPED`]}],M9=Object.fromEntries(j9.map(e=>[e.key,e])),iIt=Object.fromEntries(j9.flatMap(e=>e.rawStates.map(t=>[t,e.key]))),N9=e=>iIt[e]??`running`,aIt=e=>M9[e].dotColor??M9[e].color,oIt=e=>{let n=M9[e].icon;return n?(0,t.cloneVNode)(n):null},sIt=e=>{let n=(0,t.computed)(()=>Array.isArray(e.value)?e.value:[e.value??{}]),r=(0,t.shallowRef)({}),i=e=>r.value[e.task_id]!==!1;return{isTaskExpanded:i,taskList:n,toggleTaskExpanded:e=>{r.value={...r.value,[e.task_id]:!i(e)}},viewTasks:(0,t.computed)(()=>n.value.map(e=>{let t=Object.values(e.nodes??{}).map(e=>{let t=N9(e.state);return{convergedState:t,dotColor:aIt(t),elapsedTimeText:gye(e.elapsed_time),id:e.id,name:e.name,raw:e}}),n=t.reduce((e,t)=>e+t.raw.elapsed_time,0),r=N9(e.task_state??``);return{convergedState:r,hasConfidence:!!e.has_confidence,confidenceTitle:e.confidence_title,isActive:!!e.is_active,nodes:t,raw:e,stateIcon:oIt(r),taskId:e.task_id,taskName:e.task_name,totalTimeText:gye(n)}})),visibleStats:(0,t.computed)(()=>{let e={};for(let t of j9)e[t.key]=0;for(let t of n.value)for(let[n,r]of Object.entries(t.statistics?.state_counts??{}))e[N9(n)]+=r;return j9.filter(t=>e[t.key]>0).map(t=>({color:t.color,display:e[t.key]>99?`99+`:String(e[t.key]),dotColor:aIt(t.key),key:t.key,label:t.label}))})}},cIt={class:`ai-detail-section`},lIt={class:`section-heading`},uIt={class:`section-text`},P9=(0,t.defineComponent)({__name:`detail-section`,props:{title:{}},setup(e){return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,cIt,[(0,t.createElementVNode)(`div`,lIt,[r[0]||=(0,t.createElementVNode)(`span`,{class:`section-bar`},null,-1),(0,t.createElementVNode)(`span`,uIt,(0,t.toDisplayString)(e.title),1)]),(0,t.renderSlot)(n.$slots,`default`)]))}}),dIt={class:`ai-simple-table`},fIt={key:0},pIt=[`colspan`],F9=(0,t.defineComponent)({__name:`simple-table`,props:{columns:{},data:{}},setup(e){return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`table`,dIt,[(0,t.createElementVNode)(`thead`,null,[(0,t.createElementVNode)(`tr`,null,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.columns,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`th`,{key:e.key},(0,t.toDisplayString)(e.label),1))),128))])]),(0,t.createElementVNode)(`tbody`,null,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.data,(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`tr`,{key:r},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.columns,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`td`,{key:e.key,class:(0,t.normalizeClass)({"is-break-all":e.breakAll})},(0,t.toDisplayString)(n[e.key]??`--`),3))),128))]))),128)),e.data.length?(0,t.createCommentVNode)(`v-if`,!0):((0,t.openBlock)(),(0,t.createElementBlock)(`tr`,fIt,[(0,t.createElementVNode)(`td`,{class:`is-empty`,colspan:e.columns.length},` -- `,8,pIt)]))])]))}}),mIt={class:`flow-agent-node-detail`},hIt={class:`detail-title`},gIt={key:1,class:`detail-title-content`},_It={class:`detail-tab-bar`},vIt=[`onClick`],yIt={class:`detail-body`},bIt={class:`skeleton-section`},xIt={class:`skeleton-section`},SIt={class:`info-form`},CIt={class:`info-label`},wIt={class:`info-value`},TIt={class:`info-row`},EIt={class:`info-label`},DIt={class:`info-value`},OIt={key:0,class:`failure-item`},kIt={key:1,class:`failure-item`},AIt={class:`info-row`},jIt={class:`info-label`},MIt={class:`info-value`},NIt={key:0,class:`skeleton-section`},I9=function(e){return e.Config=`config`,e.Output=`output`,e}(I9||{}),PIt=(0,t.defineComponent)({__name:`flow-agent-node-detail`,props:{data:{},has_confidence:{type:Boolean},loading:{type:Boolean},node_id:{},node_name:{},task_id:{},task_name:{}},setup(e){let n=[{key:I9.Config,label:xu(`节点配置`)},{key:I9.Output,label:xu(`节点输出`)}],r=[{key:`key`,label:xu(`参数名`)},{breakAll:!0,key:`value`,label:xu(`参数值`)}],i=[{key:`name`,label:xu(`名称`)},{key:`description`,label:xu(`变量说明`)},{key:`key`,label:`KEY`}],a=[{key:`key`,label:xu(`参数名`)},{breakAll:!0,key:`value`,label:xu(`参数值`)}],o={forced_fail:bu?`Force Fail`:`强制失败`},s=e,l=(0,t.shallowRef)(I9.Config),u=(0,t.computed)(()=>s.data?.basic_info),d=(0,t.computed)(()=>{let e=u.value;return e?[{label:xu(`流程模板`),value:e.template_name||`--`},{label:xu(`节点名称`),value:e.node_name||`--`},{label:xu(`步骤名称`),value:e.stage_name||`--`},{label:xu(`是否可选`),value:e.optional?xu(`是`):xu(`否`)}]:[]}),f=(0,t.computed)(()=>{let e=u.value;return e?.skippable||e?.auto_retry?.enable}),p=(0,t.computed)(()=>{let e=u.value?.auto_retry;return e?.enable?bu?`In ${e.interval} seconds, auto retry ${e.times} times`:`在 ${e.interval} 秒后,自动重试 ${e.times} 次`:``}),m=(0,t.computed)(()=>{let e=u.value?.timeout_config;if(!e?.enable)return`--`;let t=o[e.action]??e.action;return bu?`Timeout ${e.seconds} seconds later, ${t}`:`超时 ${e.seconds} 秒后则${t}`}),h=(0,t.computed)(()=>Object.entries(s.data?.inputs??{}).map(([e,t])=>({key:e,value:v(t)}))),g=(0,t.computed)(()=>(s.data?.plugin_output??[]).map(e=>({description:e.schema?.description||`--`,name:e.name,key:e.key}))),_=(0,t.computed)(()=>(s.data?.outputs??[]).map(e=>({key:e.key,value:v(e.value)}))),v=e=>e==null?`--`:typeof e==`object`?JSON.stringify(e):String(e);return(o,s)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,mIt,[(0,t.createElementVNode)(`h3`,hIt,[e.loading?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:0},[(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)((0,t.unref)(xu)(`节点`))+`:`,1),s[0]||=(0,t.createElementVNode)(`span`,{class:`skeleton-title ai-skeleton-element`},null,-1)],64)):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,gIt,(0,t.toDisplayString)((0,t.unref)(xu)(`节点`))+`:`+(0,t.toDisplayString)(u.value?.node_name),1)),(0,t.renderSlot)(o.$slots,`locateButton`)]),(0,t.createElementVNode)(`div`,_It,[((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(n,e=>(0,t.createElementVNode)(`div`,{key:e.key,class:(0,t.normalizeClass)([`detail-tab`,{"is-active":l.value===e.key}]),onClick:t=>l.value=e.key},[((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(e.key===I9.Config?(0,t.unref)(Uye):(0,t.unref)(Eu)),{class:`detail-tab-icon`})),(0,t.createTextVNode)(` `+(0,t.toDisplayString)(e.label),1)],10,vIt)),64))]),(0,t.createElementVNode)(`div`,yIt,[l.value===I9.Config?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:0},[e.loading?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:0},[(0,t.createElementVNode)(`div`,bIt,[s[1]||=(0,t.createElementVNode)(`div`,{class:`skeleton-heading ai-skeleton-element`},null,-1),((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(6,e=>(0,t.createElementVNode)(`div`,{key:e,class:`skeleton-row ai-skeleton-element`})),64))]),(0,t.createElementVNode)(`div`,xIt,[s[2]||=(0,t.createElementVNode)(`div`,{class:`skeleton-heading ai-skeleton-element`},null,-1),((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(4,e=>(0,t.createElementVNode)(`div`,{key:e,class:`skeleton-row ai-skeleton-element`})),64))])],64)):((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:1},[(0,t.createVNode)(P9,{title:(0,t.unref)(xu)(`基础信息`)},{default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,SIt,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(d.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:e.label,class:`info-row`},[(0,t.createElementVNode)(`div`,CIt,(0,t.toDisplayString)(e.label),1),(0,t.createElementVNode)(`div`,wIt,(0,t.toDisplayString)(e.value),1)]))),128)),(0,t.createElementVNode)(`div`,TIt,[(0,t.createElementVNode)(`div`,EIt,(0,t.toDisplayString)((0,t.unref)(xu)(`失败处理`)),1),(0,t.createElementVNode)(`div`,DIt,[f.value?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:0},[u.value?.skippable?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,OIt,[s[3]||=(0,t.createElementVNode)(`span`,{class:`tag-badge`},`MS`,-1),(0,t.createTextVNode)(` `+(0,t.toDisplayString)((0,t.unref)(xu)(`手动跳过`))+(0,t.toDisplayString)(u.value?.auto_retry?.enable?`;`:``),1)])):(0,t.createCommentVNode)(`v-if`,!0),u.value?.auto_retry?.enable?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,kIt,[s[4]||=(0,t.createElementVNode)(`span`,{class:`tag-badge`},`AR`,-1),(0,t.createTextVNode)(` `+(0,t.toDisplayString)(p.value),1)])):(0,t.createCommentVNode)(`v-if`,!0)],64)):((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:1},[(0,t.createTextVNode)(`--`)],64))])]),(0,t.createElementVNode)(`div`,AIt,[(0,t.createElementVNode)(`div`,jIt,(0,t.toDisplayString)((0,t.unref)(xu)(`超时控制`)),1),(0,t.createElementVNode)(`div`,MIt,(0,t.toDisplayString)(m.value),1)])])]),_:1},8,[`title`]),(0,t.createVNode)(P9,{title:(0,t.unref)(xu)(`输入参数`)},{default:(0,t.withCtx)(()=>[(0,t.createVNode)(F9,{columns:r,data:h.value},null,8,[`data`])]),_:1},8,[`title`]),(0,t.createVNode)(P9,{title:(0,t.unref)(xu)(`输出参数`)},{default:(0,t.withCtx)(()=>[(0,t.createVNode)(F9,{columns:i,data:g.value},null,8,[`data`])]),_:1},8,[`title`])],64))],64)):((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:1},[e.loading?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,NIt,[s[5]||=(0,t.createElementVNode)(`div`,{class:`skeleton-heading ai-skeleton-element`},null,-1),((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(5,e=>(0,t.createElementVNode)(`div`,{key:e,class:`skeleton-row ai-skeleton-element`})),64))])):((0,t.openBlock)(),(0,t.createBlock)(P9,{key:1,title:(0,t.unref)(xu)(`结构化输出`)},{default:(0,t.withCtx)(()=>[(0,t.createVNode)(F9,{columns:a,data:_.value},null,8,[`data`])]),_:1},8,[`title`]))],64))])]))}}),L9=e=>e.task_id==null?``:`${e.task_id}`,R9=L9,z9=(e,t)=>e.task_id==null?``:`${e.task_id}|${t.id}|${t.name}`,FIt=e=>{let{messageUid:n,taskList:r}=e,i=Jbe(),a=Wbe(),o=(0,t.computed)(()=>i.selectedTab.value?.name??``),s=(0,t.shallowRef)(!1),l=()=>{s.value=!0},u=(0,t.computed)(()=>{if(s.value)return o.value;let e=r.value.find(e=>e.is_active);return e?.task_id==null?o.value:L9(e)}),d=e=>{let t=u.value;return t===L9(e)||t===R9(e)},f=(e,t)=>u.value===z9(e,t),p=(e,t)=>{let r=e.task_id;r!=null&&(l(),i.addCustomTab?.({label:t.name,name:z9(e,t),data:{component:PIt,messageUid:n.value,props:{data:{},loading:!0,node_id:t.id,node_name:t.name,task_id:r,task_name:e.task_name}}}))},m=e=>{let t=e?.task_id;t&&(l(),i.addCustomTab?.({label:xu(`有效证据`),name:R9(e),data:{component:PIt,messageUid:n.value,props:{data:{},has_confidence:e.has_confidence,loading:!0,task_id:t,task_name:e.task_name}}}))};return(0,t.watch)(o,(e,t)=>{t!==void 0&&l()}),(0,t.onMounted)(()=>{a?.value&&m(r.value.find(e=>e.is_active&&e.has_confidence))}),(0,t.onUnmounted)(()=>{if(a?.value)for(let e of r.value){i.removeCustomTab?.(L9(e)),i.removeCustomTab?.(R9(e));for(let t of Object.values(e.nodes??{}))i.removeCustomTab?.(z9(e,t))}}),{displaySelectedTabName:u,isNodeSelected:f,isTaskSelected:d,markUserTabSelection:l,openConfidence:m,openNodeDetail:p}},IIt={class:`ai-activity-message-title-text`},LIt={class:`flow-agent-title-label`},RIt={class:`flow-agent-stat-tooltip`},zIt={class:`flow-agent-stat-tooltip-status`},BIt={class:`flow-agent-stat-tooltip-label`},VIt={class:`flow-agent-task-state-icon`},HIt={class:`flow-agent-task-name`},UIt={key:0,class:`flow-agent-task-trailing`},WIt={class:`flow-agent-task-time`},GIt=[`onClick`],KIt={class:`flow-agent-task-nodes`},qIt={class:`flow-agent-node-status`},JIt=[`title`],YIt={key:0,class:`flow-agent-node-trailing`},XIt={class:`flow-agent-node-time`},ZIt=[`onClick`],QIt=(0,t.defineComponent)({__name:`flow-agent-content`,props:(0,t.mergeModels)({content:{},messageUid:{},status:{}},{collapsed:{type:Boolean,default:!1},collapsedModifiers:{}}),emits:[`update:collapsed`],setup(e){let n=e,r=Pu(),i=(0,t.useModel)(e,`collapsed`),a=lxe(),o=(0,t.computed)(()=>a.value!==Su.Share),s=(0,t.computed)(()=>n.status===hu.Pending||n.status===hu.Streaming),{isTaskExpanded:l,taskList:u,toggleTaskExpanded:d,viewTasks:f,visibleStats:p}=sIt((0,t.toRef)(n,`content`)),{isNodeSelected:m,isTaskSelected:h,openConfidence:g,openNodeDetail:_}=FIt({messageUid:(0,t.toRef)(n,`messageUid`),taskList:u});return(e,n)=>((0,t.openBlock)(),(0,t.createBlock)(A9,{collapsed:i.value,"onUpdate:collapsed":n[0]||=e=>i.value=e,"activity-type":(0,t.unref)(pu).FlowAgent,class:`flow-agent-activity`},{title:(0,t.withCtx)(()=>[(0,t.createCommentVNode)(` hover 整条执行情况栏展示统计 tooltip(设计稿 annotation) `),(0,t.createVNode)((0,t.unref)(uu),(0,t.mergeProps)({class:`flow-agent-title-bar`,theme:`ai-chat-box-light light`},{...(0,t.unref)(r),tag:`div`,arrow:!0,followCursor:!1,offset:[0,10]}),{content:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,RIt,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)((0,t.unref)(p),e=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:e.key,class:`flow-agent-stat-tooltip-item`},[(0,t.createElementVNode)(`span`,zIt,[e.key===`running`?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(Lo),{key:0,mode:`spin`,size:`mini`,theme:`primary`})):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:1,class:`flow-agent-stat-dot`,style:(0,t.normalizeStyle)({borderColor:e.dotColor})},null,4))]),(0,t.createElementVNode)(`span`,BIt,(0,t.toDisplayString)(e.label)+`:`,1),(0,t.createElementVNode)(`span`,{class:`flow-agent-stat-tooltip-count`,style:(0,t.normalizeStyle)({color:e.color})},(0,t.toDisplayString)(e.display),5)]))),128))])]),default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`span`,{class:(0,t.normalizeClass)([`ai-activity-message-title-icon`,{"icon-collapsed":i.value}])},[s.value?((0,t.openBlock)(),(0,t.createBlock)(ku,{key:0,size:12})):((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(Tu),{key:1}))],2),(0,t.createElementVNode)(`span`,IIt,[(0,t.createElementVNode)(`span`,LIt,(0,t.toDisplayString)((0,t.unref)(xu)(`执行情况`))+`:`,1),((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)((0,t.unref)(p),e=>((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:e.key,class:`flow-agent-stat-item`},[e.key===`running`?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(Lo),{key:0,class:`flow-agent-stat-loading`,mode:`spin`,size:`mini`,theme:`primary`})):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:1,class:`flow-agent-stat-dot`,style:(0,t.normalizeStyle)({borderColor:e.dotColor})},null,4)),(0,t.createElementVNode)(`span`,{class:`flow-agent-stat-count`,style:(0,t.normalizeStyle)({color:e.color})},(0,t.toDisplayString)(e.display),5)]))),128))])]),_:1},16)]),default:(0,t.withCtx)(()=>[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)((0,t.unref)(f),e=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:e.taskId,class:`flow-agent-task-group`},[(0,t.createElementVNode)(`div`,{class:(0,t.normalizeClass)([`flow-agent-task-header`,{"has-confidence":e.hasConfidence,"is-selected":(0,t.unref)(h)(e.raw)}])},[(0,t.createElementVNode)(`span`,{class:(0,t.normalizeClass)([`flow-agent-task-arrow`,{"is-expanded":(0,t.unref)(l)(e.raw)}])},[(0,t.createVNode)((0,t.unref)(Tu),{onClick:(0,t.withModifiers)(n=>(0,t.unref)(d)(e.raw),[`stop`])},null,8,[`onClick`])],2),(0,t.createElementVNode)(`span`,VIt,[e.convergedState===`running`?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(Lo),{key:0,mode:`spin`,size:`mini`,theme:`primary`})):((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(e.stateIcon),{key:1}))]),(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createElementBlock)(`span`,HIt,[(0,t.createVNode)((0,t.unref)(k9),{text:e.taskName},null,8,[`text`])])),[[(0,t.unref)(Fu),{...(0,t.unref)(r)}]]),o.value?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,UIt,[(0,t.createElementVNode)(`span`,WIt,(0,t.toDisplayString)(e.totalTimeText),1),e.hasConfidence?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:0,class:`flow-agent-task-action-btn flow-agent-task-confidence-btn`,onClick:(0,t.withModifiers)(n=>(0,t.unref)(g)(e.raw),[`stop`])},[(0,t.createVNode)((0,t.unref)(Eu)),(0,t.createTextVNode)(` `+(0,t.toDisplayString)(e.confidenceTitle??(0,t.unref)(xu)(`有效证据`)),1)],8,GIt)):(0,t.createCommentVNode)(`v-if`,!0)])):(0,t.createCommentVNode)(`v-if`,!0)],2),(0,t.withDirectives)((0,t.createElementVNode)(`div`,KIt,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.nodes,n=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:n.id,class:(0,t.normalizeClass)([`flow-agent-node-item`,{"is-selected":(0,t.unref)(m)(e.raw,n.raw)}])},[(0,t.createElementVNode)(`span`,qIt,[n.convergedState===`running`?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(Lo),{key:0,mode:`spin`,size:`mini`,theme:`primary`})):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:1,class:`flow-agent-status-dot`,style:(0,t.normalizeStyle)({borderColor:n.dotColor})},null,4))]),(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{class:`flow-agent-node-name`,title:n.name},[(0,t.createVNode)((0,t.unref)(k9),{text:n.name},null,8,[`text`])],8,JIt)),[[(0,t.unref)(Fu),{...(0,t.unref)(r)}]]),o.value?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,YIt,[(0,t.createElementVNode)(`span`,XIt,(0,t.toDisplayString)(n.elapsedTimeText),1),(0,t.createElementVNode)(`span`,{class:`flow-agent-node-detail-btn`,onClick:(0,t.withModifiers)(r=>(0,t.unref)(_)(e.raw,n.raw),[`stop`])},[(0,t.createVNode)((0,t.unref)(Eu)),(0,t.createTextVNode)(` `+(0,t.toDisplayString)((0,t.unref)(xu)(`详情`)),1)],8,ZIt)])):(0,t.createCommentVNode)(`v-if`,!0)],2))),128))],512),[[t.vShow,(0,t.unref)(l)(e.raw)]])]))),128))]),_:1},8,[`collapsed`,`activity-type`]))}}),$It={class:`ai-activity-message-title-icon`},eLt={class:`ai-activity-message-title-text`},tLt={class:`knowledge-rag-content`},nLt=(0,t.defineComponent)({__name:`knowledge-rag-content`,props:(0,t.mergeModels)({content:{},messageUid:{},status:{}},{collapsed:{type:Boolean,default:!1},collapsedModifiers:{}}),emits:[`update:collapsed`],setup(e){let n=e,r=(0,t.useModel)(e,`collapsed`),i=(0,t.computed)(()=>n.status===hu.Pending||n.status===hu.Streaming),a=(0,t.computed)(()=>i.value?xu(`检索中`):xu(`检索完成`));return(n,o)=>((0,t.openBlock)(),(0,t.createBlock)(A9,{collapsed:r.value,"onUpdate:collapsed":o[0]||=e=>r.value=e},{title:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`span`,$It,[i.value?((0,t.openBlock)(),(0,t.createBlock)(ku,{key:0})):((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(wu),{key:1,style:{"font-size":`12px`}}))]),(0,t.createElementVNode)(`span`,eLt,(0,t.toDisplayString)(a.value),1)]),default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,tLt,[(0,t.createVNode)(Q7,{content:e.content?.content||``},null,8,[`content`])]),(0,t.createVNode)($7,{content:e.content?.referenceDocument||[]},null,8,[`content`])]),_:1},8,[`collapsed`]))}}),rLt={class:`ai-activity-message-title-icon`},iLt={class:`ai-activity-message-title-text`},aLt=(0,t.defineComponent)({__name:`reference-doc-content`,props:(0,t.mergeModels)({content:{},messageUid:{}},{collapsed:{type:Boolean,default:!1},collapsedModifiers:{}}),emits:[`update:collapsed`],setup(e){let n=e,r=(0,t.useModel)(e,`collapsed`),i=(0,t.computed)(()=>{let e=n.content?.length??0;return bu?`Reference ${e} documents as reference`:`引用 ${e} 篇资料作为参考`});return(n,a)=>((0,t.openBlock)(),(0,t.createBlock)(A9,{collapsed:r.value,"onUpdate:collapsed":a[0]||=e=>r.value=e},{title:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`span`,rLt,[(0,t.createVNode)((0,t.unref)(wu),{style:{"font-size":`12px`}})]),(0,t.createElementVNode)(`span`,iLt,(0,t.toDisplayString)(i.value),1)]),default:(0,t.withCtx)(()=>[(0,t.createVNode)($7,{content:e.content||[]},null,8,[`content`])]),_:1},8,[`collapsed`]))}}),oLt=(0,t.defineComponent)({__name:`activity-message`,props:(0,t.mergeModels)({activityType:{},content:{},id:{},messageId:{},name:{},role:{},status:{},uid:{},property:{}},{collapsed:{type:Boolean,default:!1},collapsedModifiers:{}}),emits:[`update:collapsed`],setup(e){let n={[pu.FlowAgent]:QIt,[pu.KnowledgeRag]:nLt,[pu.ReferenceDocument]:aLt},r=e,i=(0,t.useModel)(e,`collapsed`),a=(0,t.computed)(()=>n[r.activityType??``]);return(n,r)=>a.value?((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(a.value),{key:0,collapsed:i.value,"onUpdate:collapsed":r[0]||=e=>i.value=e,content:e.content,"message-uid":e.uid,status:e.status},null,40,[`collapsed`,`content`,`message-uid`,`status`])):(0,t.createCommentVNode)(`v-if`,!0)}}),sLt={class:`toolcall-desc`},cLt={class:`desc-title`},lLt={class:`desc-panel`},uLt={class:`desc-label`},dLt={class:`desc-value`},B9=(0,t.defineComponent)({__name:`desc-panel`,props:{desc:{},title:{}},setup(e){let n=e,r=(0,t.computed)(()=>{try{return JSON.parse(n.desc||``)}catch{return n.desc}});return(n,i)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,sLt,[(0,t.createElementVNode)(`div`,cLt,(0,t.toDisplayString)(e.title),1),(0,t.createElementVNode)(`div`,lLt,[typeof r.value==`object`?((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,{key:0},(0,t.renderList)(r.value,(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:n,class:`desc-panel-item`},[(0,t.createElementVNode)(`span`,uLt,[(0,t.createVNode)((0,t.unref)(k9),{text:n},null,8,[`text`]),i[0]||=(0,t.createTextVNode)(`:`,-1)]),(0,t.createElementVNode)(`span`,dLt,[(0,t.createVNode)((0,t.unref)(k9),{style:{"word-break":`break-all`},text:typeof e==`object`&&e?JSON.stringify(e):e},null,8,[`text`])])]))),128)):((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(k9),{key:1,style:{wordBreak:`break-all`},text:r.value},null,8,[`text`]))])]))}}),fLt={class:`tool-message`},pLt=(0,t.defineComponent)({__name:`tool-message`,props:{duration:{},error:{type:[Boolean,String]},toolCallId:{},content:{},id:{},messageId:{},name:{},role:{},status:{},uid:{},property:{}},setup(e){return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,fLt,[(0,t.createVNode)(B9,{desc:e.content||(typeof e.error==`string`?e.error:void 0),title:(0,t.unref)(xu)(`返回内容`)},null,8,[`desc`,`title`])]))}}),mLt={class:`ai-toolcall-render`},hLt={class:`toolcall-header-title`},gLt={class:`toolcall-status-title`},_Lt={key:1,class:`toolcall-duration`},vLt={class:`ai-toolcall-render-content`},yLt=(0,t.defineComponent)({__name:`toolcall-render`,props:{duration:{},status:{},toolCall:{}},setup(e){let n=e,r=(0,t.shallowRef)(!0),i=(0,t.shallowRef)(null),a=Pu(),{keywordMatched:o,keyword:s}=fxe(()=>[n.toolCall?.function.name,n.toolCall?.function.mcpName,n.toolCall?.function.description,n.toolCall?.function.arguments,n.toolCall?.id]),l=(0,t.computed)(()=>i.value===null?s?.value?.trim()?!o.value:r.value:i.value);function u(){r.value=!l.value,i.value=r.value}let d=(0,t.computed)(()=>{let e=n.toolCall?.function.mcpName||``,t=n.toolCall?.function.name||n.toolCall?.id||``;return e?`${e} / ${t}`:t}),f=(0,t.computed)(()=>{switch(n.status){default:case hu.Pending:return xu(`调用中`);case hu.Complete:case hu.Success:return xu(`调用成功`);case hu.Error||n.toolCall?.toolMessage?.error:return xu(`调用失败`)}}),p=(0,t.computed)(()=>{let e=n.duration||n.toolCall?.toolMessage?.duration;return e?hye(e):``});return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,mLt,[(0,t.createElementVNode)(`div`,{class:(0,t.normalizeClass)([`ai-toolcall-render-header`,`toolcall-status-${e.status}`]),onClick:u},[(0,t.createVNode)((0,t.unref)(Tu),{class:(0,t.normalizeClass)({"is-collapsed":l.value})},null,8,[`class`]),(0,t.createTextVNode)(` `+(0,t.toDisplayString)(e.toolCall?.function.mcpName?(0,t.unref)(xu)(`调用 MCP:`):(0,t.unref)(xu)(`调用工具:`))+` `,1),(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createElementBlock)(`span`,hLt,[(0,t.createVNode)((0,t.unref)(k9),{text:d.value},null,8,[`text`])])),[[(0,t.unref)(Fu),{...(0,t.unref)(a),text:d.value,appendTo:`parent`}]]),(0,t.createElementVNode)(`span`,gLt,[e.status===(0,t.unref)(hu).Pending||e.status===(0,t.unref)(hu).Streaming?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(Lo),{key:0,mode:`spin`,size:`mini`,theme:`primary`})):(0,t.createCommentVNode)(`v-if`,!0),(0,t.createVNode)((0,t.unref)(k9),{text:f.value},null,8,[`text`]),p.value?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,_Lt,` (`+(0,t.toDisplayString)(p.value)+`) `,1)):(0,t.createCommentVNode)(`v-if`,!0)])],2),(0,t.withDirectives)((0,t.createElementVNode)(`div`,vLt,[(0,t.createVNode)(B9,{desc:e.toolCall?.function.description,title:(0,t.unref)(xu)(`描述`)},null,8,[`desc`,`title`]),(0,t.createVNode)(B9,{desc:e.toolCall?.function.arguments,title:(0,t.unref)(xu)(`参数`)},null,8,[`desc`,`title`]),e.toolCall?.toolMessage?((0,t.openBlock)(),(0,t.createBlock)(pLt,(0,t.normalizeProps)((0,t.mergeProps)({key:0},e.toolCall.toolMessage)),null,16)):(0,t.createCommentVNode)(`v-if`,!0)],512),[[t.vShow,!l.value]])]))}}),bLt={class:`ai-assistant-message`},xLt={key:0,class:`ai-assistant-message-content`},SLt=(0,t.defineComponent)({__name:`assistant-message`,props:{toolCalls:{},content:{},id:{},messageId:{},name:{},role:{},status:{},uid:{},property:{}},setup(e){return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,bLt,[e.content?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,xLt,[(0,t.renderSlot)(n.$slots,`default`,(0,t.normalizeProps)((0,t.guardReactiveProps)({content:e.content})),()=>[(0,t.createVNode)(e9,{content:e.content||``,status:e.status,type:(0,t.unref)(pu).Text},null,8,[`content`,`status`,`type`])])])):(0,t.createCommentVNode)(`v-if`,!0),e.toolCalls&&e.toolCalls.length>0?((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,{key:1},(0,t.renderList)(e.toolCalls,n=>((0,t.openBlock)(),(0,t.createBlock)(yLt,{key:n.id,status:n.toolMessage?.status??e.status,"tool-call":n},null,8,[`status`,`tool-call`]))),128)):(0,t.createCommentVNode)(`v-if`,!0)]))}}),CLt={class:`info-message`},wLt=(0,t.defineComponent)({__name:`info-message`,props:{content:{},id:{},messageId:{},name:{},role:{},status:{},uid:{},property:{}},setup(e){return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,CLt,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(Array.isArray(e.content)?e.content:[e.content],(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:n,class:`info-message-content`},(0,t.toDisplayString)(e),1))),128))]))}}),TLt={class:`ai-loading-message`},ELt=(0,t.defineComponent)({__name:`loading-message`,setup(e){return(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,TLt,[(0,t.createVNode)(ku,{size:18}),(0,t.renderSlot)(e.$slots,`default`,{},()=>[(0,t.createTextVNode)((0,t.toDisplayString)((0,t.unref)(xu)(`请求中...`)),1)])]))}}),DLt={class:`ai-reasoning-message`},OLt={key:0,class:`ai-reasoning-message-title-icon`},kLt={class:`ai-reasoning-message-title-text`},ALt={class:`ai-reasoning-message-content`},jLt=(0,t.defineComponent)({__name:`reasoning-message`,props:(0,t.mergeModels)({duration:{},content:{},id:{},messageId:{},name:{},role:{},status:{},uid:{},property:{}},{collapsed:{type:Boolean,default:!1},collapsedModifiers:{}}),emits:[`update:collapsed`],setup(e){let n=e,r=(0,t.useModel)(e,`collapsed`),{stop:i}=(0,t.watch)(()=>n.duration,async e=>{e&&(r.value=!0,await(0,t.nextTick)(),i?.())},{immediate:!0}),a=(0,t.computed)(()=>{switch(n.status){case hu.Pending:return xu(`思考中`);case hu.Success:case hu.Complete:return xu(`已思考完成`)+(n.duration?` (${xu(`耗时`)} :${hye(n.duration)})`:``);case hu.Error:return xu(`思考失败`);default:return xu(`思考中`)}});return(n,i)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,DLt,[(0,t.createElementVNode)(`div`,{class:(0,t.normalizeClass)([`ai-reasoning-message-title`,{"ai-reasoning-message-title-collapsed":r.value,"is-thinking":e.status===(0,t.unref)(hu).Pending||e.status===(0,t.unref)(hu).Streaming,"is-complete":e.status===(0,t.unref)(hu).Complete||e.status===(0,t.unref)(hu).Success,"is-error":e.status===(0,t.unref)(hu).Error}]),onClick:i[0]||=e=>r.value=!r.value},[e.status===(0,t.unref)(hu).Pending||e.status===(0,t.unref)(hu).Streaming?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,OLt,[(0,t.createVNode)(ku)])):(0,t.createCommentVNode)(`v-if`,!0),(0,t.createElementVNode)(`span`,kLt,(0,t.toDisplayString)(a.value),1),(0,t.createCommentVNode)(` <template v-if="status === MessageStatus.Pending || status === MessageStatus.Streaming">
3491
3491
  <ContentLoadingIcon
3492
3492
  v-for="i in 3"
3493
3493
  :key="i"
@@ -3480,7 +3480,7 @@ Input "@" to trigger tool and MCP
3480
3480
  Use Shift + Enter to enter a new line`:`输入 "/" 唤出 Skill
3481
3481
  输入 "\\" 唤出 Prompt
3482
3482
  输入 "@" 唤出 工具和 MCP
3483
- 通过 Shift + Enter 进行换行输入`},prompts:{default:()=>[]},resources:{default:()=>[]},shortcutId:{},shortcuts:{},skills:{default:()=>[]},supportUpload:{type:Boolean,default:!0},tippyOptions:{}},{cite:{required:!1,default:``},citeModifiers:{}}),emits:(0,t.mergeModels)([`selectShortcut`,`deleteShortcut`,`update:modelValue`],[`update:cite`]),setup(e,{expose:n,emit:r}){let i=(0,t.useTemplateRef)(`aiSlashInputRef`),a=(0,t.useTemplateRef)(`filesRef`),o=(0,t.useModel)(e,`cite`),s=(0,t.shallowRef)(200),l=e,u=r,d=(0,t.ref)(l.defaultUploadFiles||[]),f=(0,t.computed)(()=>l.shortcuts?.find(e=>e.id===l.shortcutId)),p=(0,t.computed)(()=>l.messageStatus&&[Q8.Pending,Q8.Streaming,Q8.Fetching].includes(l.messageStatus)?l.messageStatus:l.modelValue?.length<1||Array.isArray(l.modelValue)&&!L7(l.modelValue).trim()?Q8.Disabled:l.messageStatus);(0,t.watchPostEffect)(()=>{let e=l.inputMaxHeight||200;if(d.value.length<1||!a.value){s.value=e;return}s.value=e+(a.value?.clientHeight||0)});let m=function(){var e=g5(function*(){try{var e,t,n,r;(e=i.value)==null||(t=e.cleanup)==null||t.call(e);let a;(n=d.value)!=null&&n.length?(a=d.value?.slice().map(e=>({type:X8.Binary,url:e.url,mimeType:e.file?.type||``,filename:e.file?.name||``})),l.modelValue&&a.push({type:X8.Text,text:L7(l.modelValue)})):a=typeof l.modelValue==`string`?l.modelValue:L7(l.modelValue),(r=l.onSendMessage)==null||r.call(l,a,l.modelValue),d.value=[]}catch(e){console.error(e)}});return function(){return e.apply(this,arguments)}}(),h=e=>{if(e.key===`Enter`||e.key===`NumpadEnter`){if(e.shiftKey||p.value===Q8.Disabled||p.value===Q8.Fetching)return;m()}},g=function(){var e=g5(function*(){try{var e;(e=l.onStopSending)==null||e.call(l)}catch(e){console.error(e)}});return function(){return e.apply(this,arguments)}}(),_=()=>{o.value=``},v=e=>{u(`selectShortcut`,e)},y=()=>{u(`deleteShortcut`)},b=e=>`${e.name}_${e.size}_${e.lastModified}`,x=(LDt/(1024*1024)).toFixed(1),S=function(){var e=g5(function*(e){if(!l.supportUpload)return;if(d.value.length>=3){e.length>0&&ac({message:$8(e.length,x,r5),theme:`error`});return}let t=new Set(d.value.map(e=>e.file?b(e.file):``)),n=0;for(let i=0;i<e.length;i++){var r;let a=e[i];if(d.value.length>=3){n+=e.length-i;break}let o=b(a);if(t.has(o)){n+=1;continue}if(a.size<=0||a.size>=2516582.4){n+=1;continue}t.add(o);let s={file:a,status:a9.Pending};d.value.push(s),(r=l.onUpload)==null||r.call(l,a).then(e=>{if(e&&typeof e==`object`&&`download_url`in e){s.url=e.download_url,s.status=a9.Success;return}s.status=a9.Error}).catch(()=>{s.status=a9.Error})}n>0&&ac({message:$8(n,x,r5),theme:`error`})});return function(t){return e.apply(this,arguments)}}(),C=e=>{d.value=d.value.filter(t=>t.file?t.file!==e.file:t.url?t.url!==e.url:t.filename?t.filename!==e.filename:!0)},w=(e,t)=>{u(`update:modelValue`,e,t)};return n({focus:()=>{var e,t;(e=i.value)==null||(t=e.focus)==null||t.call(e)},triggerSendMessage:m}),(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{class:`chat-input-container`,style:(0,t.normalizeStyle)({"--chat-z-index":(0,t.unref)(ADt)})},[(0,t.renderSlot)(n.$slots,`top`),(0,t.createElementVNode)(`div`,{class:`chat-input`,style:(0,t.normalizeStyle)({maxHeight:s.value+`px`})},[(0,t.renderSlot)(n.$slots,`input-header`,{},()=>[o.value?((0,t.openBlock)(),(0,t.createBlock)(qPt,{key:0,class:`chat-input-cite`,content:o.value,onClose:_},null,8,[`content`])):(0,t.createCommentVNode)(``,!0)]),(0,t.renderSlot)(n.$slots,`files`,(0,t.normalizeProps)((0,t.guardReactiveProps)({files:d.value})),()=>[d.value.length?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:0,ref_key:`filesRef`,ref:a,class:`chat-input-files`},[(0,t.createVNode)(c9,{files:d.value,onDeleteFile:C},null,8,[`files`])],512)):(0,t.createCommentVNode)(``,!0)]),(0,t.createVNode)(GFt,{ref_key:`aiSlashInputRef`,ref:i,"model-value":e.modelValue,placeholder:e.placeholder,prompts:e.prompts,resources:e.resources,skills:e.skills,onKeydown:h,"onUpdate:modelValue":w,onUpload:S},null,8,[`model-value`,`placeholder`,`prompts`,`resources`,`skills`]),(0,t.createVNode)(qFt,{"message-state":p.value,"tippy-options":e.tippyOptions,onSendMessage:m,onStopSending:g},{default:(0,t.withCtx)(()=>{var r;return[e.supportUpload?((0,t.openBlock)(),(0,t.createBlock)(WPt,{key:0,"tippy-options":e.tippyOptions,onUpload:S},null,8,[`tippy-options`])):(0,t.createCommentVNode)(``,!0),e.supportUpload&&((r=e.shortcuts)!=null&&r.length||f.value)?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,JFt)):(0,t.createCommentVNode)(``,!0),(0,t.renderSlot)(n.$slots,`attachment`,{},()=>[e.shortcuts&&!f.value?((0,t.openBlock)(),(0,t.createBlock)(qOt,{key:0,shortcuts:e.shortcuts,onSelectShortcut:v},null,8,[`shortcuts`])):(0,t.createCommentVNode)(``,!0),f.value?((0,t.openBlock)(),(0,t.createBlock)(_5,{key:1,class:`selected-shortcut-btn`,shortcut:f.value},{append:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(m5),{onClick:y})]),_:1},8,[`shortcut`])):(0,t.createCommentVNode)(``,!0)])]}),"send-icon":(0,t.withCtx)(()=>[(0,t.renderSlot)(n.$slots,`send-icon`)]),_:3},8,[`message-state`,`tippy-options`])],4)],4))}}),XFt={class:`ai-delete-confirm`},ZFt={class:`ai-delete-confirm__title`},QFt={class:`ai-delete-confirm__desc`},$Ft={class:`ai-delete-confirm__actions`},eIt=(0,t.defineComponent)({__name:`delete-tool`,props:{description:{},id:{},name:{},disabled:{type:Boolean},tippyOptions:{}},emits:[`confirm`,`cancel`],setup(e,{emit:n}){let r=e,i=n,a=(0,t.useTemplateRef)(`tippyRef`),o=(0,t.computed)(()=>({id:r.id,name:r.name,description:r.description,disabled:r.disabled,tippyOptions:r.tippyOptions})),s=(0,t.computed)(()=>l5({arrow:!1,interactive:!0,offset:[0,6],theme:`ai-chat-box-light light`,trigger:`click`,appendTo:()=>document.body},r.tippyOptions||{})),l=()=>{if(r.disabled)return!1},u=()=>{var e,t;(e=a.value)==null||(t=e.hide)==null||t.call(e)},d=()=>{u(),i(`confirm`)},f=()=>{u(),i(`cancel`)};return(0,t.onUnmounted)(()=>{u()}),(e,n)=>((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(Yl),(0,t.mergeProps)({ref_key:`tippyRef`,ref:a},s.value,{onShow:l}),{content:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,XFt,[(0,t.createElementVNode)(`div`,ZFt,(0,t.toDisplayString)((0,t.unref)(i5)(`确认删除该回答?`)),1),(0,t.createElementVNode)(`div`,QFt,(0,t.toDisplayString)((0,t.unref)(i5)(`删除操作无法撤回,请谨慎操作!`)),1),(0,t.createElementVNode)(`div`,$Ft,[(0,t.createVNode)((0,t.unref)(Ko),{size:`small`,theme:`danger`,onClick:d},{default:(0,t.withCtx)(()=>[(0,t.createTextVNode)((0,t.toDisplayString)((0,t.unref)(i5)(`删除`)),1)]),_:1}),(0,t.createVNode)((0,t.unref)(Ko),{size:`small`,onClick:f},{default:(0,t.withCtx)(()=>[(0,t.createTextVNode)((0,t.toDisplayString)((0,t.unref)(i5)(`取消`)),1)]),_:1})])])]),default:(0,t.withCtx)(()=>[(0,t.createVNode)(w5,(0,t.normalizeProps)((0,t.guardReactiveProps)(o.value)),null,16)]),_:1},16))}}),tIt={class:`ai-feedback-title`},nIt={class:`ai-feedback-reason-list`},rIt=[`onClick`],iIt={class:`ai-feedback-other`},aIt={class:`ai-feedback-footer`},oIt=(0,t.defineComponent)({__name:`user-feedback`,props:{loading:{type:Boolean},reasonList:{},title:{}},emits:[`submit`,`cancel`],setup(e,{emit:n}){let r=n,i=(0,t.shallowRef)(``),a=(0,t.shallowRef)([]),o=e=>{a.value.includes(e)?a.value=a.value.filter(t=>t!==e):a.value=[...a.value,e]},s=()=>{r(`submit`,a.value,i.value)},l=()=>{a.value=[],i.value=``,r(`cancel`)};return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{class:`ai-user-feedback`,onMouseenter:r[1]||=(0,t.withModifiers)(()=>{},[`stop`,`prevent`])},[(0,t.createElementVNode)(`div`,tIt,(0,t.toDisplayString)(e.title),1),(0,t.createElementVNode)(`div`,nIt,[e.loading?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:0},(0,t.renderList)(8,e=>(0,t.createElementVNode)(`div`,{key:e,class:`reason-item ai-skeleton-element`})),64)):((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,{key:1},(0,t.renderList)(e.reasonList,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:e,class:(0,t.normalizeClass)([`reason-item`,{"is-active":a.value.includes(e)}]),onClick:t=>o(e)},(0,t.toDisplayString)(e),11,rIt))),128))]),(0,t.createElementVNode)(`div`,iIt,[(0,t.createVNode)((0,t.unref)(rs),{modelValue:i.value,"onUpdate:modelValue":r[0]||=e=>i.value=e,placeholder:(0,t.unref)(i5)(`说出您的想法`),rows:3,type:`textarea`},null,8,[`modelValue`,`placeholder`])]),(0,t.createElementVNode)(`div`,aIt,[(0,t.createVNode)((0,t.unref)(Ko),{class:`custom-btn`,disabled:!i.value&&a.value.length===0,size:`small`,theme:`primary`,onClick:s},{default:(0,t.withCtx)(()=>[(0,t.createTextVNode)((0,t.toDisplayString)((0,t.unref)(i5)(`提交`)),1)]),_:1},8,[`disabled`]),(0,t.createVNode)((0,t.unref)(Ko),{class:`custom-btn`,size:`small`,width:`80px`,onClick:l},{default:(0,t.withCtx)(()=>[(0,t.createTextVNode)((0,t.toDisplayString)((0,t.unref)(i5)(`取消`)),1)]),_:1})])],32))}}),sIt={ref:`messageToolsRef`,class:`message-tools-container`},cIt={class:`message-tools`,style:{"margin-right":`8px`}},lIt={key:0,class:`ai-divider`,style:{"margin-right":`8px`}},uIt={class:`message-tools`},dIt=(0,t.defineComponent)({__name:`message-tools`,props:{messageTools:{default:()=>PDt},messageToolsStatus:{},onAction:{},tippyOptions:{},updateTools:{default:()=>IDt}},emits:[`feedback`],setup(e,{emit:n}){let r=e,i=n,a=(0,t.useTemplateRef)(`feedbackTippyRef`),o=(0,t.shallowRef)(!1),s=(0,t.shallowRef)([]),l=(0,t.shallowRef)(null),u=(0,t.computed)(()=>l5({arrow:!1,interactive:!0,offset:[0,6],theme:`ai-chat-box-light light`,trigger:`click`,appendTo:()=>document.body},r.tippyOptions||{})),d=function(){var e=g5(function*(e){if(e.id===`like`||e.id===`unlike`){try{o.value=!0,s.value=[],s.value=(yield r.onAction?.call(r,e))||[]}finally{o.value=!1}return}yield r.onAction?.call(r,e)});return function(t){return e.apply(this,arguments)}}(),f=function(){var e=g5(function*(e){yield r.onAction?.call(r,e)});return function(t){return e.apply(this,arguments)}}(),p=()=>{var e;(e=a.value)==null||e.forEach(e=>{var t;return e==null||(t=e.hide)==null?void 0:t.call(e)})},m=e=>l.value?l.value===`like`&&e===`like`?`activeLike`:l.value===`unlike`&&e===`unlike`?`activeUnLike`:e:e,h=e=>{var t;let n=m(e);return n===`activeLike`?i5(`取消满意`):n===`activeUnLike`?i5(`取消不满意`):((t=r.updateTools)==null||(t=t.find(e=>e.id===n))==null?void 0:t.description)||``},g=(e,t,n)=>{p(),l.value===e.id?l.value=null:l.value=e.id,i(`feedback`,e,t,n)},_=e=>{if(r.messageToolsStatus===o9.Disabled)return!1;if(l.value&&l.value===e)return l.value=null,!1};return(0,t.onUnmounted)(()=>{p(),s.value=[]}),(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,sIt,[(0,t.createElementVNode)(`div`,cIt,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.messageTools,n=>((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:n.id},[n.id===`delete`?((0,t.openBlock)(),(0,t.createBlock)(eIt,(0,t.mergeProps)({key:0,ref_for:!0},n,{disabled:e.messageToolsStatus===(0,t.unref)(o9).Disabled,"tippy-options":e.tippyOptions,onConfirm:e=>f(n)}),null,16,[`disabled`,`tippy-options`,`onConfirm`])):((0,t.openBlock)(),(0,t.createBlock)(w5,(0,t.mergeProps)({key:1,ref_for:!0},n,{disabled:e.messageToolsStatus===(0,t.unref)(o9).Disabled,"tippy-options":e.tippyOptions,onClick:e=>d(n)}),null,16,[`disabled`,`tippy-options`,`onClick`]))],64))),128))]),e.updateTools.length>0?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,lIt)):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`div`,uIt,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.updateTools,n=>((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:n.id},[n.id===`like`||n.id===`unlike`?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(Yl),(0,t.mergeProps)({key:0,ref_for:!0,ref_key:`feedbackTippyRef`,ref:a},{ref_for:!0},u.value,{onShow:e=>_(n.id)}),{content:(0,t.withCtx)(()=>[(0,t.createVNode)(oIt,{loading:o.value,"reason-list":s.value,title:n.id===`like`?(0,t.unref)(i5)(`什么原因让你满意?`):(0,t.unref)(i5)(`什么原因让你不满意?`),onCancel:p,onSubmit:(e,t)=>g(n,e,t)},null,8,[`loading`,`reason-list`,`title`,`onSubmit`])]),default:(0,t.withCtx)(()=>[(0,t.createVNode)(w5,(0,t.mergeProps)({ref_for:!0},n,{id:m(n.id),active:l.value===n.id,disabled:e.messageToolsStatus===(0,t.unref)(o9).Disabled,"tippy-options":l5(l5({},e.tippyOptions),{},{content:h(n.id)}),onClick:e=>d(n)}),null,16,[`id`,`active`,`disabled`,`tippy-options`,`onClick`])]),_:2},1040,[`onShow`])):n.id===`delete`?((0,t.openBlock)(),(0,t.createBlock)(eIt,(0,t.mergeProps)({key:1,ref_for:!0},n,{disabled:e.messageToolsStatus===(0,t.unref)(o9).Disabled,"tippy-options":e.tippyOptions,onConfirm:e=>f(n)}),null,16,[`disabled`,`tippy-options`,`onConfirm`])):((0,t.openBlock)(),(0,t.createBlock)(w5,(0,t.mergeProps)({key:2,ref_for:!0},n,{disabled:e.messageToolsStatus===(0,t.unref)(o9).Disabled,"tippy-options":e.tippyOptions,onClick:e=>d(n)}),null,16,[`disabled`,`tippy-options`,`onClick`]))],64))),128))])],512))}}),l9=(0,t.defineComponent)({name:`HighlightKeyword`,props:{text:{type:String,required:!0}},setup(e){let n=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),r=jkt(),i=(0,t.computed)(()=>{if(!e.text||!(r!=null&&r.value))return e.text;let i=r.value.trim();if(!i)return e.text;let a=RegExp(`(${n(i)})`,`ig`),o=e.text?.toString().split(a);return o.length<=1?e.text:o.map(e=>a.test(e)?(0,t.h)(`span`,{class:RDt},e):e)});return()=>(0,t.h)(`span`,i.value)}}),fIt={class:`ai-activity-message`},pIt={class:`ai-activity-message-content`},u9=(0,t.defineComponent)({__name:`activity-layout`,props:(0,t.mergeModels)({activityType:{}},{collapsed:l5({type:Boolean},{default:!1}),collapsedModifiers:{}}),emits:[`update:collapsed`],setup(e){let n=(0,t.useModel)(e,`collapsed`);return(r,i)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,fIt,[(0,t.createElementVNode)(`div`,{class:`ai-activity-message-title`,onClick:i[0]||=e=>n.value=!n.value},[(0,t.renderSlot)(r.$slots,`title`,(0,t.normalizeProps)((0,t.guardReactiveProps)({collapsed:n.value}))),e.activityType===(0,t.unref)(X8).FlowAgent?(0,t.createCommentVNode)(``,!0):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:0,class:(0,t.normalizeClass)([`ai-activity-message-title-icon collapsed-icon`,{"is-collapsed":n.value}])},[(0,t.createVNode)((0,t.unref)(p5))],2))]),(0,t.withDirectives)((0,t.createElementVNode)(`div`,pIt,[(0,t.renderSlot)(r.$slots,`default`)],512),[[t.vShow,!n.value]])]))}}),d9=[{color:`#3A84FF`,icon:null,key:`running`,label:i5(`执行中`),rawStates:[`CREATED`,`LOOP_READY`,`READY`,`RUNNING`,`BLOCKED`,`ROLLING_BACK`,`ROLL_BACK_SUCCESS`]},{color:`#65C389`,icon:ZDt,key:`success`,label:i5(`成功`),rawStates:[`FINISHED`]},{color:`#EA3636`,icon:QDt,key:`failed`,label:i5(`失败`),rawStates:[`FAILED`,`REVOKED`,`ROLL_BACK_FAILED`]},{color:`#F59500`,icon:$Dt,key:`suspended`,label:i5(`挂起`),rawStates:[`SUSPENDED`]},{color:`#4D4F56`,dotColor:`#DCDEE5`,icon:eOt,key:`pending`,label:i5(`待执行`),rawStates:[`PENDING`]},{color:`#5B7290`,icon:tOt,key:`skipped`,label:i5(`跳过`),rawStates:[`SKIPPED`]}],f9=Object.fromEntries(d9.map(e=>[e.key,e])),mIt=Object.fromEntries(d9.flatMap(e=>e.rawStates.map(t=>[t,e.key]))),p9=e=>mIt[e]??`running`,hIt=e=>f9[e].dotColor??f9[e].color,gIt=e=>{let n=f9[e].icon;return n?(0,t.cloneVNode)(n):null},_It=e=>{let n=(0,t.computed)(()=>Array.isArray(e.value)?e.value:[e.value??{}]),r=(0,t.shallowRef)({}),i=e=>r.value[e.task_id]!==!1;return{isTaskExpanded:i,taskList:n,toggleTaskExpanded:e=>{r.value=l5(l5({},r.value),{},{[e.task_id]:!i(e)})},viewTasks:(0,t.computed)(()=>n.value.map(e=>{let t=Object.values(e.nodes??{}).map(e=>{let t=p9(e.state);return{convergedState:t,dotColor:hIt(t),elapsedTimeText:ODt(e.elapsed_time),id:e.id,name:e.name,raw:e}}),n=t.reduce((e,t)=>e+t.raw.elapsed_time,0),r=p9(e.task_state??``);return{convergedState:r,hasConfidence:!!e.has_confidence,confidenceTitle:e.confidence_title,isActive:!!e.is_active,nodes:t,raw:e,stateIcon:gIt(r),taskId:e.task_id,taskName:e.task_name,totalTimeText:ODt(n)}})),visibleStats:(0,t.computed)(()=>{let e={};for(let t of d9)e[t.key]=0;for(let t of n.value)for(let[n,r]of Object.entries(t.statistics?.state_counts??{}))e[p9(n)]+=r;return d9.filter(t=>e[t.key]>0).map(t=>({color:t.color,display:e[t.key]>99?`99+`:String(e[t.key]),dotColor:hIt(t.key),key:t.key,label:t.label}))})}},vIt={class:`ai-detail-section`},yIt={class:`section-heading`},bIt={class:`section-text`},m9=(0,t.defineComponent)({__name:`detail-section`,props:{title:{}},setup(e){return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,vIt,[(0,t.createElementVNode)(`div`,yIt,[r[0]||=(0,t.createElementVNode)(`span`,{class:`section-bar`},null,-1),(0,t.createElementVNode)(`span`,bIt,(0,t.toDisplayString)(e.title),1)]),(0,t.renderSlot)(n.$slots,`default`)]))}}),xIt={class:`ai-simple-table`},SIt={key:0},CIt=[`colspan`],h9=(0,t.defineComponent)({__name:`simple-table`,props:{columns:{},data:{}},setup(e){return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`table`,xIt,[(0,t.createElementVNode)(`thead`,null,[(0,t.createElementVNode)(`tr`,null,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.columns,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`th`,{key:e.key},(0,t.toDisplayString)(e.label),1))),128))])]),(0,t.createElementVNode)(`tbody`,null,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.data,(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`tr`,{key:r},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.columns,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`td`,{key:e.key,class:(0,t.normalizeClass)({"is-break-all":e.breakAll})},(0,t.toDisplayString)(n[e.key]??`--`),3))),128))]))),128)),e.data.length?(0,t.createCommentVNode)(``,!0):((0,t.openBlock)(),(0,t.createElementBlock)(`tr`,SIt,[(0,t.createElementVNode)(`td`,{class:`is-empty`,colspan:e.columns.length},` -- `,8,CIt)]))])]))}}),wIt={class:`flow-agent-node-detail`},TIt={class:`detail-title`},EIt={key:1,class:`detail-title-content`},DIt={class:`detail-tab-bar`},OIt=[`onClick`],kIt={class:`detail-body`},AIt={class:`skeleton-section`},jIt={class:`skeleton-section`},MIt={class:`info-form`},NIt={class:`info-label`},PIt={class:`info-value`},FIt={class:`info-row`},IIt={class:`info-label`},LIt={class:`info-value`},RIt={key:0,class:`failure-item`},zIt={key:1,class:`failure-item`},BIt={class:`info-row`},VIt={class:`info-label`},HIt={class:`info-value`},UIt={key:0,class:`skeleton-section`},g9=function(e){return e.Config=`config`,e.Output=`output`,e}(g9||{}),WIt=(0,t.defineComponent)({__name:`flow-agent-node-detail`,props:{data:{},has_confidence:{type:Boolean},loading:{type:Boolean},node_id:{},node_name:{},task_id:{},task_name:{}},setup(e){let n=[{key:g9.Config,label:i5(`节点配置`)},{key:g9.Output,label:i5(`节点输出`)}],r=[{key:`key`,label:i5(`参数名`)},{breakAll:!0,key:`value`,label:i5(`参数值`)}],i=[{key:`name`,label:i5(`名称`)},{key:`description`,label:i5(`变量说明`)},{key:`key`,label:`KEY`}],a=[{key:`key`,label:i5(`参数名`)},{breakAll:!0,key:`value`,label:i5(`参数值`)}],o={forced_fail:r5?`Force Fail`:`强制失败`},s=e,l=(0,t.shallowRef)(g9.Config),u=(0,t.computed)(()=>s.data?.basic_info),d=(0,t.computed)(()=>{let e=u.value;return e?[{label:i5(`流程模板`),value:e.template_name||`--`},{label:i5(`节点名称`),value:e.node_name||`--`},{label:i5(`步骤名称`),value:e.stage_name||`--`},{label:i5(`是否可选`),value:e.optional?i5(`是`):i5(`否`)}]:[]}),f=(0,t.computed)(()=>{var e;let t=u.value;return t?.skippable||(t==null||(e=t.auto_retry)==null?void 0:e.enable)}),p=(0,t.computed)(()=>{let e=u.value?.auto_retry;return e!=null&&e.enable?r5?`In ${e.interval} seconds, auto retry ${e.times} times`:`在 ${e.interval} 秒后,自动重试 ${e.times} 次`:``}),m=(0,t.computed)(()=>{let e=u.value?.timeout_config;if(!(e!=null&&e.enable))return`--`;let t=o[e.action]??e.action;return r5?`Timeout ${e.seconds} seconds later, ${t}`:`超时 ${e.seconds} 秒后则${t}`}),h=(0,t.computed)(()=>Object.entries(s.data?.inputs??{}).map(([e,t])=>({key:e,value:v(t)}))),g=(0,t.computed)(()=>(s.data?.plugin_output??[]).map(e=>({description:e.schema?.description||`--`,name:e.name,key:e.key}))),_=(0,t.computed)(()=>(s.data?.outputs??[]).map(e=>({key:e.key,value:v(e.value)}))),v=e=>e==null?`--`:typeof e==`object`?JSON.stringify(e):String(e);return(o,s)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,wIt,[(0,t.createElementVNode)(`h3`,TIt,[e.loading?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:0},[(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)((0,t.unref)(i5)(`节点`))+`:`,1),s[0]||=(0,t.createElementVNode)(`span`,{class:`skeleton-title ai-skeleton-element`},null,-1)],64)):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,EIt,(0,t.toDisplayString)((0,t.unref)(i5)(`节点`))+`:`+(0,t.toDisplayString)(u.value?.node_name),1)),(0,t.renderSlot)(o.$slots,`locateButton`)]),(0,t.createElementVNode)(`div`,DIt,[((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(n,e=>(0,t.createElementVNode)(`div`,{key:e.key,class:(0,t.normalizeClass)([`detail-tab`,{"is-active":l.value===e.key}]),onClick:t=>l.value=e.key},[((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(e.key===g9.Config?(0,t.unref)(rOt):(0,t.unref)(f5)),{class:`detail-tab-icon`})),(0,t.createTextVNode)(` `+(0,t.toDisplayString)(e.label),1)],10,OIt)),64))]),(0,t.createElementVNode)(`div`,kIt,[l.value===g9.Config?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:0},[e.loading?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:0},[(0,t.createElementVNode)(`div`,AIt,[s[1]||=(0,t.createElementVNode)(`div`,{class:`skeleton-heading ai-skeleton-element`},null,-1),((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(6,e=>(0,t.createElementVNode)(`div`,{key:e,class:`skeleton-row ai-skeleton-element`})),64))]),(0,t.createElementVNode)(`div`,jIt,[s[2]||=(0,t.createElementVNode)(`div`,{class:`skeleton-heading ai-skeleton-element`},null,-1),((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(4,e=>(0,t.createElementVNode)(`div`,{key:e,class:`skeleton-row ai-skeleton-element`})),64))])],64)):((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:1},[(0,t.createVNode)(m9,{title:(0,t.unref)(i5)(`基础信息`)},{default:(0,t.withCtx)(()=>{var e,n,r;return[(0,t.createElementVNode)(`div`,MIt,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(d.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:e.label,class:`info-row`},[(0,t.createElementVNode)(`div`,NIt,(0,t.toDisplayString)(e.label),1),(0,t.createElementVNode)(`div`,PIt,(0,t.toDisplayString)(e.value),1)]))),128)),(0,t.createElementVNode)(`div`,FIt,[(0,t.createElementVNode)(`div`,IIt,(0,t.toDisplayString)((0,t.unref)(i5)(`失败处理`)),1),(0,t.createElementVNode)(`div`,LIt,[f.value?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:0},[(e=u.value)!=null&&e.skippable?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,RIt,[s[3]||=(0,t.createElementVNode)(`span`,{class:`tag-badge`},`MS`,-1),(0,t.createTextVNode)(` `+(0,t.toDisplayString)((0,t.unref)(i5)(`手动跳过`))+(0,t.toDisplayString)(!((n=u.value)==null||(n=n.auto_retry)==null)&&n.enable?`;`:``),1)])):(0,t.createCommentVNode)(``,!0),!((r=u.value)==null||(r=r.auto_retry)==null)&&r.enable?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,zIt,[s[4]||=(0,t.createElementVNode)(`span`,{class:`tag-badge`},`AR`,-1),(0,t.createTextVNode)(` `+(0,t.toDisplayString)(p.value),1)])):(0,t.createCommentVNode)(``,!0)],64)):((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:1},[(0,t.createTextVNode)(`--`)],64))])]),(0,t.createElementVNode)(`div`,BIt,[(0,t.createElementVNode)(`div`,VIt,(0,t.toDisplayString)((0,t.unref)(i5)(`超时控制`)),1),(0,t.createElementVNode)(`div`,HIt,(0,t.toDisplayString)(m.value),1)])])]}),_:1},8,[`title`]),(0,t.createVNode)(m9,{title:(0,t.unref)(i5)(`输入参数`)},{default:(0,t.withCtx)(()=>[(0,t.createVNode)(h9,{columns:r,data:h.value},null,8,[`data`])]),_:1},8,[`title`]),(0,t.createVNode)(m9,{title:(0,t.unref)(i5)(`输出参数`)},{default:(0,t.withCtx)(()=>[(0,t.createVNode)(h9,{columns:i,data:g.value},null,8,[`data`])]),_:1},8,[`title`])],64))],64)):((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:1},[e.loading?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,UIt,[s[5]||=(0,t.createElementVNode)(`div`,{class:`skeleton-heading ai-skeleton-element`},null,-1),((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(5,e=>(0,t.createElementVNode)(`div`,{key:e,class:`skeleton-row ai-skeleton-element`})),64))])):((0,t.openBlock)(),(0,t.createBlock)(m9,{key:1,title:(0,t.unref)(i5)(`结构化输出`)},{default:(0,t.withCtx)(()=>[(0,t.createVNode)(h9,{columns:a,data:_.value},null,8,[`data`])]),_:1},8,[`title`]))],64))])]))}}),_9=e=>e.task_id==null?``:`${e.task_id}`,v9=_9,y9=(e,t)=>e.task_id==null?``:`${e.task_id}|${t.id}|${t.name}`,GIt=e=>{let{messageUid:n,taskList:r}=e,i=pkt(),a=lkt(),o=(0,t.computed)(()=>i.selectedTab.value?.name??``),s=(0,t.shallowRef)(!1),l=()=>{s.value=!0},u=(0,t.computed)(()=>{if(s.value)return o.value;let e=r.value.find(e=>e.is_active);return e?.task_id==null?o.value:_9(e)}),d=e=>{let t=u.value;return t===_9(e)||t===v9(e)},f=(e,t)=>u.value===y9(e,t),p=(e,t)=>{var r;let a=e.task_id;a!=null&&(l(),(r=i.addCustomTab)==null||r.call(i,{label:t.name,name:y9(e,t),data:{component:WIt,messageUid:n.value,props:{data:{},loading:!0,node_id:t.id,node_name:t.name,task_id:a,task_name:e.task_name}}}))},m=e=>{var t;let r=e?.task_id;r&&(l(),(t=i.addCustomTab)==null||t.call(i,{label:i5(`有效证据`),name:v9(e),data:{component:WIt,messageUid:n.value,props:{data:{},has_confidence:e.has_confidence,loading:!0,task_id:r,task_name:e.task_name}}}))};return(0,t.watch)(o,(e,t)=>{t!==void 0&&l()}),(0,t.onMounted)(()=>{a!=null&&a.value&&m(r.value.find(e=>e.is_active&&e.has_confidence))}),(0,t.onUnmounted)(()=>{if(a!=null&&a.value)for(let a of r.value){var e,t;(e=i.removeCustomTab)==null||e.call(i,_9(a)),(t=i.removeCustomTab)==null||t.call(i,v9(a));for(let e of Object.values(a.nodes??{})){var n;(n=i.removeCustomTab)==null||n.call(i,y9(a,e))}}}),{displaySelectedTabName:u,isNodeSelected:f,isTaskSelected:d,markUserTabSelection:l,openConfidence:m,openNodeDetail:p}},KIt={class:`ai-activity-message-title-text`},qIt={class:`flow-agent-title-label`},JIt={class:`flow-agent-stat-tooltip`},YIt={class:`flow-agent-stat-tooltip-status`},XIt={class:`flow-agent-stat-tooltip-label`},ZIt={class:`flow-agent-task-state-icon`},QIt={class:`flow-agent-task-name`},$It={key:0,class:`flow-agent-task-trailing`},eLt={class:`flow-agent-task-time`},tLt=[`onClick`],nLt={class:`flow-agent-task-nodes`},rLt={class:`flow-agent-node-status`},iLt=[`title`],aLt={key:0,class:`flow-agent-node-trailing`},oLt={class:`flow-agent-node-time`},sLt=[`onClick`],cLt=(0,t.defineComponent)({__name:`flow-agent-content`,props:(0,t.mergeModels)({content:{},messageUid:{},status:{}},{collapsed:l5({type:Boolean},{default:!1}),collapsedModifiers:{}}),emits:[`update:collapsed`],setup(e){let n=e,r=S5(),i=(0,t.useModel)(e,`collapsed`),a=kkt(),o=(0,t.computed)(()=>a.value!==a5.Share),s=(0,t.computed)(()=>n.status===Q8.Pending||n.status===Q8.Streaming),{isTaskExpanded:l,taskList:u,toggleTaskExpanded:d,viewTasks:f,visibleStats:p}=_It((0,t.toRef)(n,`content`)),{isNodeSelected:m,isTaskSelected:h,openConfidence:g,openNodeDetail:_}=GIt({messageUid:(0,t.toRef)(n,`messageUid`),taskList:u});return(e,n)=>((0,t.openBlock)(),(0,t.createBlock)(u9,{collapsed:i.value,"onUpdate:collapsed":n[0]||=e=>i.value=e,"activity-type":(0,t.unref)(X8).FlowAgent,class:`flow-agent-activity`},{title:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(Yl),(0,t.mergeProps)({class:`flow-agent-title-bar`,theme:`ai-chat-box-light light`},l5(l5({},(0,t.unref)(r)),{},{tag:`div`,arrow:!0,followCursor:!1,offset:[0,10]})),{content:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,JIt,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)((0,t.unref)(p),e=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:e.key,class:`flow-agent-stat-tooltip-item`},[(0,t.createElementVNode)(`span`,YIt,[e.key===`running`?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(Lo),{key:0,mode:`spin`,size:`mini`,theme:`primary`})):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:1,class:`flow-agent-stat-dot`,style:(0,t.normalizeStyle)({borderColor:e.dotColor})},null,4))]),(0,t.createElementVNode)(`span`,XIt,(0,t.toDisplayString)(e.label)+`:`,1),(0,t.createElementVNode)(`span`,{class:`flow-agent-stat-tooltip-count`,style:(0,t.normalizeStyle)({color:e.color})},(0,t.toDisplayString)(e.display),5)]))),128))])]),default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`span`,{class:(0,t.normalizeClass)([`ai-activity-message-title-icon`,{"icon-collapsed":i.value}])},[s.value?((0,t.openBlock)(),(0,t.createBlock)(h5,{key:0,size:12})):((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(d5),{key:1}))],2),(0,t.createElementVNode)(`span`,KIt,[(0,t.createElementVNode)(`span`,qIt,(0,t.toDisplayString)((0,t.unref)(i5)(`执行情况`))+`:`,1),((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)((0,t.unref)(p),e=>((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:e.key,class:`flow-agent-stat-item`},[e.key===`running`?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(Lo),{key:0,class:`flow-agent-stat-loading`,mode:`spin`,size:`mini`,theme:`primary`})):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:1,class:`flow-agent-stat-dot`,style:(0,t.normalizeStyle)({borderColor:e.dotColor})},null,4)),(0,t.createElementVNode)(`span`,{class:`flow-agent-stat-count`,style:(0,t.normalizeStyle)({color:e.color})},(0,t.toDisplayString)(e.display),5)]))),128))])]),_:1},16)]),default:(0,t.withCtx)(()=>[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)((0,t.unref)(f),e=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:e.taskId,class:`flow-agent-task-group`},[(0,t.createElementVNode)(`div`,{class:(0,t.normalizeClass)([`flow-agent-task-header`,{"has-confidence":e.hasConfidence,"is-selected":(0,t.unref)(h)(e.raw)}])},[(0,t.createElementVNode)(`span`,{class:(0,t.normalizeClass)([`flow-agent-task-arrow`,{"is-expanded":(0,t.unref)(l)(e.raw)}])},[(0,t.createVNode)((0,t.unref)(d5),{onClick:(0,t.withModifiers)(n=>(0,t.unref)(d)(e.raw),[`stop`])},null,8,[`onClick`])],2),(0,t.createElementVNode)(`span`,ZIt,[e.convergedState===`running`?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(Lo),{key:0,mode:`spin`,size:`mini`,theme:`primary`})):((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(e.stateIcon),{key:1}))]),(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createElementBlock)(`span`,QIt,[(0,t.createVNode)((0,t.unref)(l9),{text:e.taskName},null,8,[`text`])])),[[(0,t.unref)(C5),l5({},(0,t.unref)(r))]]),o.value?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,$It,[(0,t.createElementVNode)(`span`,eLt,(0,t.toDisplayString)(e.totalTimeText),1),e.hasConfidence?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:0,class:`flow-agent-task-action-btn flow-agent-task-confidence-btn`,onClick:(0,t.withModifiers)(n=>(0,t.unref)(g)(e.raw),[`stop`])},[(0,t.createVNode)((0,t.unref)(f5)),(0,t.createTextVNode)(` `+(0,t.toDisplayString)(e.confidenceTitle??(0,t.unref)(i5)(`有效证据`)),1)],8,tLt)):(0,t.createCommentVNode)(``,!0)])):(0,t.createCommentVNode)(``,!0)],2),(0,t.withDirectives)((0,t.createElementVNode)(`div`,nLt,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.nodes,n=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:n.id,class:(0,t.normalizeClass)([`flow-agent-node-item`,{"is-selected":(0,t.unref)(m)(e.raw,n.raw)}])},[(0,t.createElementVNode)(`span`,rLt,[n.convergedState===`running`?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(Lo),{key:0,mode:`spin`,size:`mini`,theme:`primary`})):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:1,class:`flow-agent-status-dot`,style:(0,t.normalizeStyle)({borderColor:n.dotColor})},null,4))]),(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{class:`flow-agent-node-name`,title:n.name},[(0,t.createVNode)((0,t.unref)(l9),{text:n.name},null,8,[`text`])],8,iLt)),[[(0,t.unref)(C5),l5({},(0,t.unref)(r))]]),o.value?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,aLt,[(0,t.createElementVNode)(`span`,oLt,(0,t.toDisplayString)(n.elapsedTimeText),1),(0,t.createElementVNode)(`span`,{class:`flow-agent-node-detail-btn`,onClick:(0,t.withModifiers)(r=>(0,t.unref)(_)(e.raw,n.raw),[`stop`])},[(0,t.createVNode)((0,t.unref)(f5)),(0,t.createTextVNode)(` `+(0,t.toDisplayString)((0,t.unref)(i5)(`详情`)),1)],8,sLt)])):(0,t.createCommentVNode)(``,!0)],2))),128))],512),[[t.vShow,(0,t.unref)(l)(e.raw)]])]))),128))]),_:1},8,[`collapsed`,`activity-type`]))}}),lLt={class:`ai-activity-message-title-icon`},uLt={class:`ai-activity-message-title-text`},dLt={class:`knowledge-rag-content`},fLt=(0,t.defineComponent)({__name:`knowledge-rag-content`,props:(0,t.mergeModels)({content:{},messageUid:{},status:{}},{collapsed:l5({type:Boolean},{default:!1}),collapsedModifiers:{}}),emits:[`update:collapsed`],setup(e){let n=e,r=(0,t.useModel)(e,`collapsed`),i=(0,t.computed)(()=>n.status===Q8.Pending||n.status===Q8.Streaming),a=(0,t.computed)(()=>i.value?i5(`检索中`):i5(`检索完成`));return(n,o)=>((0,t.openBlock)(),(0,t.createBlock)(u9,{collapsed:r.value,"onUpdate:collapsed":o[0]||=e=>r.value=e},{title:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`span`,lLt,[i.value?((0,t.openBlock)(),(0,t.createBlock)(h5,{key:0})):((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(u5),{key:1,style:{"font-size":`12px`}}))]),(0,t.createElementVNode)(`span`,uLt,(0,t.toDisplayString)(a.value),1)]),default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,dLt,[(0,t.createVNode)(j7,{content:e.content?.content||``},null,8,[`content`])]),(0,t.createVNode)(M7,{content:e.content?.referenceDocument||[]},null,8,[`content`])]),_:1},8,[`collapsed`]))}}),pLt={class:`ai-activity-message-title-icon`},mLt={class:`ai-activity-message-title-text`},hLt=(0,t.defineComponent)({__name:`reference-doc-content`,props:(0,t.mergeModels)({content:{},messageUid:{}},{collapsed:l5({type:Boolean},{default:!1}),collapsedModifiers:{}}),emits:[`update:collapsed`],setup(e){let n=e,r=(0,t.useModel)(e,`collapsed`),i=(0,t.computed)(()=>{let e=n.content?.length??0;return r5?`Reference ${e} documents as reference`:`引用 ${e} 篇资料作为参考`});return(n,a)=>((0,t.openBlock)(),(0,t.createBlock)(u9,{collapsed:r.value,"onUpdate:collapsed":a[0]||=e=>r.value=e},{title:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`span`,pLt,[(0,t.createVNode)((0,t.unref)(u5),{style:{"font-size":`12px`}})]),(0,t.createElementVNode)(`span`,mLt,(0,t.toDisplayString)(i.value),1)]),default:(0,t.withCtx)(()=>[(0,t.createVNode)(M7,{content:e.content||[]},null,8,[`content`])]),_:1},8,[`collapsed`]))}}),gLt=(0,t.defineComponent)({__name:`activity-message`,props:(0,t.mergeModels)({activityType:{},content:{},id:{},messageId:{},name:{},role:{},status:{},uid:{},property:{}},{collapsed:l5({type:Boolean},{default:!1}),collapsedModifiers:{}}),emits:[`update:collapsed`],setup(e){let n={[X8.FlowAgent]:cLt,[X8.KnowledgeRag]:fLt,[X8.ReferenceDocument]:hLt},r=e,i=(0,t.useModel)(e,`collapsed`),a=(0,t.computed)(()=>n[r.activityType??``]);return(n,r)=>a.value?((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(a.value),{key:0,collapsed:i.value,"onUpdate:collapsed":r[0]||=e=>i.value=e,content:e.content,"message-uid":e.uid,status:e.status},null,40,[`collapsed`,`content`,`message-uid`,`status`])):(0,t.createCommentVNode)(``,!0)}}),_Lt={class:`toolcall-desc`},vLt={class:`desc-title`},yLt={class:`desc-panel`},bLt={class:`desc-label`},xLt={class:`desc-value`},b9=(0,t.defineComponent)({__name:`desc-panel`,props:{desc:{},title:{}},setup(e){let n=e,r=(0,t.computed)(()=>{try{return JSON.parse(n.desc||``)}catch{return n.desc}});return(n,i)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,_Lt,[(0,t.createElementVNode)(`div`,vLt,(0,t.toDisplayString)(e.title),1),(0,t.createElementVNode)(`div`,yLt,[typeof r.value==`object`?((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,{key:0},(0,t.renderList)(r.value,(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:n,class:`desc-panel-item`},[(0,t.createElementVNode)(`span`,bLt,[(0,t.createVNode)((0,t.unref)(l9),{text:n},null,8,[`text`]),i[0]||=(0,t.createTextVNode)(`:`,-1)]),(0,t.createElementVNode)(`span`,xLt,[(0,t.createVNode)((0,t.unref)(l9),{style:{"word-break":`break-all`},text:typeof e==`object`&&e?JSON.stringify(e):e},null,8,[`text`])])]))),128)):((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(l9),{key:1,style:{wordBreak:`break-all`},text:r.value},null,8,[`text`]))])]))}}),SLt={class:`tool-message`},CLt=(0,t.defineComponent)({__name:`tool-message`,props:{duration:{},error:{type:[Boolean,String]},toolCallId:{},content:{},id:{},messageId:{},name:{},role:{},status:{},uid:{},property:{}},setup(e){return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,SLt,[(0,t.createVNode)(b9,{desc:e.content||(typeof e.error==`string`?e.error:void 0),title:(0,t.unref)(i5)(`返回内容`)},null,8,[`desc`,`title`])]))}}),wLt={class:`ai-toolcall-render`},TLt={class:`toolcall-header-title`},ELt={class:`toolcall-status-title`},DLt={key:1,class:`toolcall-duration`},OLt={class:`ai-toolcall-render-content`},kLt=(0,t.defineComponent)({__name:`toolcall-render`,props:{duration:{},status:{},toolCall:{}},setup(e){let n=e,r=(0,t.shallowRef)(!0),i=(0,t.shallowRef)(null),a=S5(),{keywordMatched:o,keyword:s}=Mkt(()=>[n.toolCall?.function.name,n.toolCall?.function.mcpName,n.toolCall?.function.description,n.toolCall?.function.arguments,n.toolCall?.id]),l=(0,t.computed)(()=>{var e;return i.value===null?!(s==null||(e=s.value)==null)&&e.trim()?!o.value:r.value:i.value});function u(){r.value=!l.value,i.value=r.value}let d=(0,t.computed)(()=>{let e=n.toolCall?.function.mcpName||``,t=n.toolCall?.function.name||n.toolCall?.id||``;return e?`${e} / ${t}`:t}),f=(0,t.computed)(()=>{var e;switch(n.status){default:case Q8.Pending:return i5(`调用中`);case Q8.Complete:case Q8.Success:return i5(`调用成功`);case Q8.Error||((e=n.toolCall)==null||(e=e.toolMessage)==null?void 0:e.error):return i5(`调用失败`)}}),p=(0,t.computed)(()=>{var e;let t=n.duration||((e=n.toolCall)==null||(e=e.toolMessage)==null?void 0:e.duration);return t?DDt(t):``});return(n,r)=>{var i,o;return(0,t.openBlock)(),(0,t.createElementBlock)(`div`,wLt,[(0,t.createElementVNode)(`div`,{class:(0,t.normalizeClass)([`ai-toolcall-render-header`,`toolcall-status-${e.status}`]),onClick:u},[(0,t.createVNode)((0,t.unref)(d5),{class:(0,t.normalizeClass)({"is-collapsed":l.value})},null,8,[`class`]),(0,t.createTextVNode)(` `+(0,t.toDisplayString)((i=e.toolCall)!=null&&i.function.mcpName?(0,t.unref)(i5)(`调用 MCP:`):(0,t.unref)(i5)(`调用工具:`))+` `,1),(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createElementBlock)(`span`,TLt,[(0,t.createVNode)((0,t.unref)(l9),{text:d.value},null,8,[`text`])])),[[(0,t.unref)(C5),l5(l5({},(0,t.unref)(a)),{},{text:d.value,appendTo:`parent`})]]),(0,t.createElementVNode)(`span`,ELt,[e.status===(0,t.unref)(Q8).Pending||e.status===(0,t.unref)(Q8).Streaming?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(Lo),{key:0,mode:`spin`,size:`mini`,theme:`primary`})):(0,t.createCommentVNode)(``,!0),(0,t.createVNode)((0,t.unref)(l9),{text:f.value},null,8,[`text`]),p.value?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,DLt,` (`+(0,t.toDisplayString)(p.value)+`) `,1)):(0,t.createCommentVNode)(``,!0)])],2),(0,t.withDirectives)((0,t.createElementVNode)(`div`,OLt,[(0,t.createVNode)(b9,{desc:e.toolCall?.function.description,title:(0,t.unref)(i5)(`描述`)},null,8,[`desc`,`title`]),(0,t.createVNode)(b9,{desc:e.toolCall?.function.arguments,title:(0,t.unref)(i5)(`参数`)},null,8,[`desc`,`title`]),(o=e.toolCall)!=null&&o.toolMessage?((0,t.openBlock)(),(0,t.createBlock)(CLt,(0,t.normalizeProps)((0,t.mergeProps)({key:0},e.toolCall.toolMessage)),null,16)):(0,t.createCommentVNode)(``,!0)],512),[[t.vShow,!l.value]])])}}}),ALt={class:`ai-assistant-message`},jLt={class:`ai-assistant-message-content`},MLt=(0,t.defineComponent)({__name:`assistant-message`,props:{toolCalls:{},content:{},id:{},messageId:{},name:{},role:{},status:{},uid:{},property:{}},setup(e){return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,ALt,[(0,t.createElementVNode)(`div`,jLt,[(0,t.renderSlot)(n.$slots,`default`,(0,t.normalizeProps)((0,t.guardReactiveProps)({content:e.content})),()=>[(0,t.createVNode)(N7,{content:e.content||``,status:e.status,type:(0,t.unref)(X8).Text},null,8,[`content`,`status`,`type`])])]),e.toolCalls&&e.toolCalls.length>0?((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,{key:0},(0,t.renderList)(e.toolCalls,n=>((0,t.openBlock)(),(0,t.createBlock)(kLt,{key:n.id,status:e.status,"tool-call":n},null,8,[`status`,`tool-call`]))),128)):(0,t.createCommentVNode)(``,!0)]))}}),NLt={class:`info-message`},PLt=(0,t.defineComponent)({__name:`info-message`,props:{content:{},id:{},messageId:{},name:{},role:{},status:{},uid:{},property:{}},setup(e){return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,NLt,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(Array.isArray(e.content)?e.content:[e.content],(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:n,class:`info-message-content`},(0,t.toDisplayString)(e),1))),128))]))}}),FLt={class:`ai-loading-message`},ILt=(0,t.defineComponent)({__name:`loading-message`,setup(e){return(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,FLt,[(0,t.createVNode)(h5,{size:18}),(0,t.renderSlot)(e.$slots,`default`,{},()=>[(0,t.createTextVNode)((0,t.toDisplayString)((0,t.unref)(i5)(`请求中...`)),1)])]))}}),LLt={class:`ai-reasoning-message`},RLt={key:0,class:`ai-reasoning-message-title-icon`},zLt={class:`ai-reasoning-message-title-text`},BLt={class:`ai-reasoning-message-content`},VLt=(0,t.defineComponent)({__name:`reasoning-message`,props:(0,t.mergeModels)({duration:{},content:{},id:{},messageId:{},name:{},role:{},status:{},uid:{},property:{}},{collapsed:l5({type:Boolean},{default:!1}),collapsedModifiers:{}}),emits:[`update:collapsed`],setup(e){let n=e,r=(0,t.useModel)(e,`collapsed`),{stop:i}=(0,t.watch)(()=>n.duration,function(){var e=g5(function*(e){e&&(r.value=!0,yield(0,t.nextTick)(),i?.())});return function(t){return e.apply(this,arguments)}}(),{immediate:!0}),a=(0,t.computed)(()=>{switch(n.status){case Q8.Pending:return i5(`思考中`);case Q8.Success:case Q8.Complete:return i5(`已思考完成`)+(n.duration?` (${i5(`耗时`)} :${DDt(n.duration)})`:``);case Q8.Error:return i5(`思考失败`);default:return i5(`思考中`)}});return(n,i)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,LLt,[(0,t.createElementVNode)(`div`,{class:(0,t.normalizeClass)([`ai-reasoning-message-title`,{"ai-reasoning-message-title-collapsed":r.value,"is-thinking":e.status===(0,t.unref)(Q8).Pending||e.status===(0,t.unref)(Q8).Streaming,"is-complete":e.status===(0,t.unref)(Q8).Complete||e.status===(0,t.unref)(Q8).Success,"is-error":e.status===(0,t.unref)(Q8).Error}]),onClick:i[0]||=e=>r.value=!r.value},[e.status===(0,t.unref)(Q8).Pending||e.status===(0,t.unref)(Q8).Streaming?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,RLt,[(0,t.createVNode)(h5)])):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`span`,zLt,(0,t.toDisplayString)(a.value),1),(0,t.createElementVNode)(`span`,{class:(0,t.normalizeClass)([`ai-reasoning-message-title-icon collapsed-icon`,{"is-collapsed":r.value}])},[(0,t.createVNode)((0,t.unref)(p5))],2)],2),(0,t.withDirectives)((0,t.createElementVNode)(`div`,BLt,[e.status===(0,t.unref)(Q8).Error?((0,t.openBlock)(),(0,t.createBlock)(DNt,{key:0,content:e.content?.join(`
3483
+ 通过 Shift + Enter 进行换行输入`},prompts:{default:()=>[]},resources:{default:()=>[]},shortcutId:{},shortcuts:{},skills:{default:()=>[]},supportUpload:{type:Boolean,default:!0},tippyOptions:{}},{cite:{required:!1,default:``},citeModifiers:{}}),emits:(0,t.mergeModels)([`selectShortcut`,`deleteShortcut`,`update:modelValue`],[`update:cite`]),setup(e,{expose:n,emit:r}){let i=(0,t.useTemplateRef)(`aiSlashInputRef`),a=(0,t.useTemplateRef)(`filesRef`),o=(0,t.useModel)(e,`cite`),s=(0,t.shallowRef)(200),l=e,u=r,d=(0,t.ref)(l.defaultUploadFiles||[]),f=(0,t.computed)(()=>l.shortcuts?.find(e=>e.id===l.shortcutId)),p=(0,t.computed)(()=>l.messageStatus&&[Q8.Pending,Q8.Streaming,Q8.Fetching].includes(l.messageStatus)?l.messageStatus:l.modelValue?.length<1||Array.isArray(l.modelValue)&&!L7(l.modelValue).trim()?Q8.Disabled:l.messageStatus);(0,t.watchPostEffect)(()=>{let e=l.inputMaxHeight||200;if(d.value.length<1||!a.value){s.value=e;return}s.value=e+(a.value?.clientHeight||0)});let m=function(){var e=g5(function*(){try{var e,t,n,r;(e=i.value)==null||(t=e.cleanup)==null||t.call(e);let a;(n=d.value)!=null&&n.length?(a=d.value?.slice().map(e=>({type:X8.Binary,url:e.url,mimeType:e.file?.type||``,filename:e.file?.name||``})),l.modelValue&&a.push({type:X8.Text,text:L7(l.modelValue)})):a=typeof l.modelValue==`string`?l.modelValue:L7(l.modelValue),(r=l.onSendMessage)==null||r.call(l,a,l.modelValue),d.value=[]}catch(e){console.error(e)}});return function(){return e.apply(this,arguments)}}(),h=e=>{if(e.key===`Enter`||e.key===`NumpadEnter`){if(e.shiftKey||p.value===Q8.Disabled||p.value===Q8.Fetching)return;m()}},g=function(){var e=g5(function*(){try{var e;(e=l.onStopSending)==null||e.call(l)}catch(e){console.error(e)}});return function(){return e.apply(this,arguments)}}(),_=()=>{o.value=``},v=e=>{u(`selectShortcut`,e)},y=()=>{u(`deleteShortcut`)},b=e=>`${e.name}_${e.size}_${e.lastModified}`,x=(LDt/(1024*1024)).toFixed(1),S=function(){var e=g5(function*(e){if(!l.supportUpload)return;if(d.value.length>=3){e.length>0&&ac({message:$8(e.length,x,r5),theme:`error`});return}let t=new Set(d.value.map(e=>e.file?b(e.file):``)),n=0;for(let i=0;i<e.length;i++){var r;let a=e[i];if(d.value.length>=3){n+=e.length-i;break}let o=b(a);if(t.has(o)){n+=1;continue}if(a.size<=0||a.size>=2516582.4){n+=1;continue}t.add(o);let s={file:a,status:a9.Pending};d.value.push(s),(r=l.onUpload)==null||r.call(l,a).then(e=>{if(e&&typeof e==`object`&&`download_url`in e){s.url=e.download_url,s.status=a9.Success;return}s.status=a9.Error}).catch(()=>{s.status=a9.Error})}n>0&&ac({message:$8(n,x,r5),theme:`error`})});return function(t){return e.apply(this,arguments)}}(),C=e=>{d.value=d.value.filter(t=>t.file?t.file!==e.file:t.url?t.url!==e.url:t.filename?t.filename!==e.filename:!0)},w=(e,t)=>{u(`update:modelValue`,e,t)};return n({focus:()=>{var e,t;(e=i.value)==null||(t=e.focus)==null||t.call(e)},triggerSendMessage:m}),(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{class:`chat-input-container`,style:(0,t.normalizeStyle)({"--chat-z-index":(0,t.unref)(ADt)})},[(0,t.renderSlot)(n.$slots,`top`),(0,t.createElementVNode)(`div`,{class:`chat-input`,style:(0,t.normalizeStyle)({maxHeight:s.value+`px`})},[(0,t.renderSlot)(n.$slots,`input-header`,{},()=>[o.value?((0,t.openBlock)(),(0,t.createBlock)(qPt,{key:0,class:`chat-input-cite`,content:o.value,onClose:_},null,8,[`content`])):(0,t.createCommentVNode)(``,!0)]),(0,t.renderSlot)(n.$slots,`files`,(0,t.normalizeProps)((0,t.guardReactiveProps)({files:d.value})),()=>[d.value.length?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:0,ref_key:`filesRef`,ref:a,class:`chat-input-files`},[(0,t.createVNode)(c9,{files:d.value,onDeleteFile:C},null,8,[`files`])],512)):(0,t.createCommentVNode)(``,!0)]),(0,t.createVNode)(GFt,{ref_key:`aiSlashInputRef`,ref:i,"model-value":e.modelValue,placeholder:e.placeholder,prompts:e.prompts,resources:e.resources,skills:e.skills,onKeydown:h,"onUpdate:modelValue":w,onUpload:S},null,8,[`model-value`,`placeholder`,`prompts`,`resources`,`skills`]),(0,t.createVNode)(qFt,{"message-state":p.value,"tippy-options":e.tippyOptions,onSendMessage:m,onStopSending:g},{default:(0,t.withCtx)(()=>{var r;return[e.supportUpload?((0,t.openBlock)(),(0,t.createBlock)(WPt,{key:0,"tippy-options":e.tippyOptions,onUpload:S},null,8,[`tippy-options`])):(0,t.createCommentVNode)(``,!0),e.supportUpload&&((r=e.shortcuts)!=null&&r.length||f.value)?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,JFt)):(0,t.createCommentVNode)(``,!0),(0,t.renderSlot)(n.$slots,`attachment`,{},()=>[e.shortcuts&&!f.value?((0,t.openBlock)(),(0,t.createBlock)(qOt,{key:0,shortcuts:e.shortcuts,onSelectShortcut:v},null,8,[`shortcuts`])):(0,t.createCommentVNode)(``,!0),f.value?((0,t.openBlock)(),(0,t.createBlock)(_5,{key:1,class:`selected-shortcut-btn`,shortcut:f.value},{append:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(m5),{onClick:y})]),_:1},8,[`shortcut`])):(0,t.createCommentVNode)(``,!0)])]}),"send-icon":(0,t.withCtx)(()=>[(0,t.renderSlot)(n.$slots,`send-icon`)]),_:3},8,[`message-state`,`tippy-options`])],4)],4))}}),XFt={class:`ai-delete-confirm`},ZFt={class:`ai-delete-confirm__title`},QFt={class:`ai-delete-confirm__desc`},$Ft={class:`ai-delete-confirm__actions`},eIt=(0,t.defineComponent)({__name:`delete-tool`,props:{description:{},id:{},name:{},disabled:{type:Boolean},tippyOptions:{}},emits:[`confirm`,`cancel`],setup(e,{emit:n}){let r=e,i=n,a=(0,t.useTemplateRef)(`tippyRef`),o=(0,t.computed)(()=>({id:r.id,name:r.name,description:r.description,disabled:r.disabled,tippyOptions:r.tippyOptions})),s=(0,t.computed)(()=>l5({arrow:!1,interactive:!0,offset:[0,6],theme:`ai-chat-box-light light`,trigger:`click`,appendTo:()=>document.body},r.tippyOptions||{})),l=()=>{if(r.disabled)return!1},u=()=>{var e,t;(e=a.value)==null||(t=e.hide)==null||t.call(e)},d=()=>{u(),i(`confirm`)},f=()=>{u(),i(`cancel`)};return(0,t.onUnmounted)(()=>{u()}),(e,n)=>((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(Yl),(0,t.mergeProps)({ref_key:`tippyRef`,ref:a},s.value,{onShow:l}),{content:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,XFt,[(0,t.createElementVNode)(`div`,ZFt,(0,t.toDisplayString)((0,t.unref)(i5)(`确认删除该回答?`)),1),(0,t.createElementVNode)(`div`,QFt,(0,t.toDisplayString)((0,t.unref)(i5)(`删除操作无法撤回,请谨慎操作!`)),1),(0,t.createElementVNode)(`div`,$Ft,[(0,t.createVNode)((0,t.unref)(Ko),{size:`small`,theme:`danger`,onClick:d},{default:(0,t.withCtx)(()=>[(0,t.createTextVNode)((0,t.toDisplayString)((0,t.unref)(i5)(`删除`)),1)]),_:1}),(0,t.createVNode)((0,t.unref)(Ko),{size:`small`,onClick:f},{default:(0,t.withCtx)(()=>[(0,t.createTextVNode)((0,t.toDisplayString)((0,t.unref)(i5)(`取消`)),1)]),_:1})])])]),default:(0,t.withCtx)(()=>[(0,t.createVNode)(w5,(0,t.normalizeProps)((0,t.guardReactiveProps)(o.value)),null,16)]),_:1},16))}}),tIt={class:`ai-feedback-title`},nIt={class:`ai-feedback-reason-list`},rIt=[`onClick`],iIt={class:`ai-feedback-other`},aIt={class:`ai-feedback-footer`},oIt=(0,t.defineComponent)({__name:`user-feedback`,props:{loading:{type:Boolean},reasonList:{},title:{}},emits:[`submit`,`cancel`],setup(e,{emit:n}){let r=n,i=(0,t.shallowRef)(``),a=(0,t.shallowRef)([]),o=e=>{a.value.includes(e)?a.value=a.value.filter(t=>t!==e):a.value=[...a.value,e]},s=()=>{r(`submit`,a.value,i.value)},l=()=>{a.value=[],i.value=``,r(`cancel`)};return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{class:`ai-user-feedback`,onMouseenter:r[1]||=(0,t.withModifiers)(()=>{},[`stop`,`prevent`])},[(0,t.createElementVNode)(`div`,tIt,(0,t.toDisplayString)(e.title),1),(0,t.createElementVNode)(`div`,nIt,[e.loading?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:0},(0,t.renderList)(8,e=>(0,t.createElementVNode)(`div`,{key:e,class:`reason-item ai-skeleton-element`})),64)):((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,{key:1},(0,t.renderList)(e.reasonList,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:e,class:(0,t.normalizeClass)([`reason-item`,{"is-active":a.value.includes(e)}]),onClick:t=>o(e)},(0,t.toDisplayString)(e),11,rIt))),128))]),(0,t.createElementVNode)(`div`,iIt,[(0,t.createVNode)((0,t.unref)(rs),{modelValue:i.value,"onUpdate:modelValue":r[0]||=e=>i.value=e,placeholder:(0,t.unref)(i5)(`说出您的想法`),rows:3,type:`textarea`},null,8,[`modelValue`,`placeholder`])]),(0,t.createElementVNode)(`div`,aIt,[(0,t.createVNode)((0,t.unref)(Ko),{class:`custom-btn`,disabled:!i.value&&a.value.length===0,size:`small`,theme:`primary`,onClick:s},{default:(0,t.withCtx)(()=>[(0,t.createTextVNode)((0,t.toDisplayString)((0,t.unref)(i5)(`提交`)),1)]),_:1},8,[`disabled`]),(0,t.createVNode)((0,t.unref)(Ko),{class:`custom-btn`,size:`small`,width:`80px`,onClick:l},{default:(0,t.withCtx)(()=>[(0,t.createTextVNode)((0,t.toDisplayString)((0,t.unref)(i5)(`取消`)),1)]),_:1})])],32))}}),sIt={ref:`messageToolsRef`,class:`message-tools-container`},cIt={class:`message-tools`,style:{"margin-right":`8px`}},lIt={key:0,class:`ai-divider`,style:{"margin-right":`8px`}},uIt={class:`message-tools`},dIt=(0,t.defineComponent)({__name:`message-tools`,props:{messageTools:{default:()=>PDt},messageToolsStatus:{},onAction:{},tippyOptions:{},updateTools:{default:()=>IDt}},emits:[`feedback`],setup(e,{emit:n}){let r=e,i=n,a=(0,t.useTemplateRef)(`feedbackTippyRef`),o=(0,t.shallowRef)(!1),s=(0,t.shallowRef)([]),l=(0,t.shallowRef)(null),u=(0,t.computed)(()=>l5({arrow:!1,interactive:!0,offset:[0,6],theme:`ai-chat-box-light light`,trigger:`click`,appendTo:()=>document.body},r.tippyOptions||{})),d=function(){var e=g5(function*(e){if(e.id===`like`||e.id===`unlike`){try{o.value=!0,s.value=[],s.value=(yield r.onAction?.call(r,e))||[]}finally{o.value=!1}return}yield r.onAction?.call(r,e)});return function(t){return e.apply(this,arguments)}}(),f=function(){var e=g5(function*(e){yield r.onAction?.call(r,e)});return function(t){return e.apply(this,arguments)}}(),p=()=>{var e;(e=a.value)==null||e.forEach(e=>{var t;return e==null||(t=e.hide)==null?void 0:t.call(e)})},m=e=>l.value?l.value===`like`&&e===`like`?`activeLike`:l.value===`unlike`&&e===`unlike`?`activeUnLike`:e:e,h=e=>{var t;let n=m(e);return n===`activeLike`?i5(`取消满意`):n===`activeUnLike`?i5(`取消不满意`):((t=r.updateTools)==null||(t=t.find(e=>e.id===n))==null?void 0:t.description)||``},g=(e,t,n)=>{p(),l.value===e.id?l.value=null:l.value=e.id,i(`feedback`,e,t,n)},_=e=>{if(r.messageToolsStatus===o9.Disabled)return!1;if(l.value&&l.value===e)return l.value=null,!1};return(0,t.onUnmounted)(()=>{p(),s.value=[]}),(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,sIt,[(0,t.createElementVNode)(`div`,cIt,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.messageTools,n=>((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:n.id},[n.id===`delete`?((0,t.openBlock)(),(0,t.createBlock)(eIt,(0,t.mergeProps)({key:0,ref_for:!0},n,{disabled:e.messageToolsStatus===(0,t.unref)(o9).Disabled,"tippy-options":e.tippyOptions,onConfirm:e=>f(n)}),null,16,[`disabled`,`tippy-options`,`onConfirm`])):((0,t.openBlock)(),(0,t.createBlock)(w5,(0,t.mergeProps)({key:1,ref_for:!0},n,{disabled:e.messageToolsStatus===(0,t.unref)(o9).Disabled,"tippy-options":e.tippyOptions,onClick:e=>d(n)}),null,16,[`disabled`,`tippy-options`,`onClick`]))],64))),128))]),e.updateTools.length>0?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,lIt)):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`div`,uIt,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.updateTools,n=>((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:n.id},[n.id===`like`||n.id===`unlike`?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(Yl),(0,t.mergeProps)({key:0,ref_for:!0,ref_key:`feedbackTippyRef`,ref:a},{ref_for:!0},u.value,{onShow:e=>_(n.id)}),{content:(0,t.withCtx)(()=>[(0,t.createVNode)(oIt,{loading:o.value,"reason-list":s.value,title:n.id===`like`?(0,t.unref)(i5)(`什么原因让你满意?`):(0,t.unref)(i5)(`什么原因让你不满意?`),onCancel:p,onSubmit:(e,t)=>g(n,e,t)},null,8,[`loading`,`reason-list`,`title`,`onSubmit`])]),default:(0,t.withCtx)(()=>[(0,t.createVNode)(w5,(0,t.mergeProps)({ref_for:!0},n,{id:m(n.id),active:l.value===n.id,disabled:e.messageToolsStatus===(0,t.unref)(o9).Disabled,"tippy-options":l5(l5({},e.tippyOptions),{},{content:h(n.id)}),onClick:e=>d(n)}),null,16,[`id`,`active`,`disabled`,`tippy-options`,`onClick`])]),_:2},1040,[`onShow`])):n.id===`delete`?((0,t.openBlock)(),(0,t.createBlock)(eIt,(0,t.mergeProps)({key:1,ref_for:!0},n,{disabled:e.messageToolsStatus===(0,t.unref)(o9).Disabled,"tippy-options":e.tippyOptions,onConfirm:e=>f(n)}),null,16,[`disabled`,`tippy-options`,`onConfirm`])):((0,t.openBlock)(),(0,t.createBlock)(w5,(0,t.mergeProps)({key:2,ref_for:!0},n,{disabled:e.messageToolsStatus===(0,t.unref)(o9).Disabled,"tippy-options":e.tippyOptions,onClick:e=>d(n)}),null,16,[`disabled`,`tippy-options`,`onClick`]))],64))),128))])],512))}}),l9=(0,t.defineComponent)({name:`HighlightKeyword`,props:{text:{type:String,required:!0}},setup(e){let n=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),r=jkt(),i=(0,t.computed)(()=>{if(!e.text||!(r!=null&&r.value))return e.text;let i=r.value.trim();if(!i)return e.text;let a=RegExp(`(${n(i)})`,`ig`),o=e.text?.toString().split(a);return o.length<=1?e.text:o.map(e=>a.test(e)?(0,t.h)(`span`,{class:RDt},e):e)});return()=>(0,t.h)(`span`,i.value)}}),fIt={class:`ai-activity-message`},pIt={class:`ai-activity-message-content`},u9=(0,t.defineComponent)({__name:`activity-layout`,props:(0,t.mergeModels)({activityType:{}},{collapsed:l5({type:Boolean},{default:!1}),collapsedModifiers:{}}),emits:[`update:collapsed`],setup(e){let n=(0,t.useModel)(e,`collapsed`);return(r,i)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,fIt,[(0,t.createElementVNode)(`div`,{class:`ai-activity-message-title`,onClick:i[0]||=e=>n.value=!n.value},[(0,t.renderSlot)(r.$slots,`title`,(0,t.normalizeProps)((0,t.guardReactiveProps)({collapsed:n.value}))),e.activityType===(0,t.unref)(X8).FlowAgent?(0,t.createCommentVNode)(``,!0):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:0,class:(0,t.normalizeClass)([`ai-activity-message-title-icon collapsed-icon`,{"is-collapsed":n.value}])},[(0,t.createVNode)((0,t.unref)(p5))],2))]),(0,t.withDirectives)((0,t.createElementVNode)(`div`,pIt,[(0,t.renderSlot)(r.$slots,`default`)],512),[[t.vShow,!n.value]])]))}}),d9=[{color:`#3A84FF`,icon:null,key:`running`,label:i5(`执行中`),rawStates:[`CREATED`,`LOOP_READY`,`READY`,`RUNNING`,`BLOCKED`,`ROLLING_BACK`,`ROLL_BACK_SUCCESS`]},{color:`#65C389`,icon:ZDt,key:`success`,label:i5(`成功`),rawStates:[`FINISHED`]},{color:`#EA3636`,icon:QDt,key:`failed`,label:i5(`失败`),rawStates:[`FAILED`,`REVOKED`,`ROLL_BACK_FAILED`]},{color:`#F59500`,icon:$Dt,key:`suspended`,label:i5(`挂起`),rawStates:[`SUSPENDED`]},{color:`#4D4F56`,dotColor:`#DCDEE5`,icon:eOt,key:`pending`,label:i5(`待执行`),rawStates:[`PENDING`]},{color:`#5B7290`,icon:tOt,key:`skipped`,label:i5(`跳过`),rawStates:[`SKIPPED`]}],f9=Object.fromEntries(d9.map(e=>[e.key,e])),mIt=Object.fromEntries(d9.flatMap(e=>e.rawStates.map(t=>[t,e.key]))),p9=e=>mIt[e]??`running`,hIt=e=>f9[e].dotColor??f9[e].color,gIt=e=>{let n=f9[e].icon;return n?(0,t.cloneVNode)(n):null},_It=e=>{let n=(0,t.computed)(()=>Array.isArray(e.value)?e.value:[e.value??{}]),r=(0,t.shallowRef)({}),i=e=>r.value[e.task_id]!==!1;return{isTaskExpanded:i,taskList:n,toggleTaskExpanded:e=>{r.value=l5(l5({},r.value),{},{[e.task_id]:!i(e)})},viewTasks:(0,t.computed)(()=>n.value.map(e=>{let t=Object.values(e.nodes??{}).map(e=>{let t=p9(e.state);return{convergedState:t,dotColor:hIt(t),elapsedTimeText:ODt(e.elapsed_time),id:e.id,name:e.name,raw:e}}),n=t.reduce((e,t)=>e+t.raw.elapsed_time,0),r=p9(e.task_state??``);return{convergedState:r,hasConfidence:!!e.has_confidence,confidenceTitle:e.confidence_title,isActive:!!e.is_active,nodes:t,raw:e,stateIcon:gIt(r),taskId:e.task_id,taskName:e.task_name,totalTimeText:ODt(n)}})),visibleStats:(0,t.computed)(()=>{let e={};for(let t of d9)e[t.key]=0;for(let t of n.value)for(let[n,r]of Object.entries(t.statistics?.state_counts??{}))e[p9(n)]+=r;return d9.filter(t=>e[t.key]>0).map(t=>({color:t.color,display:e[t.key]>99?`99+`:String(e[t.key]),dotColor:hIt(t.key),key:t.key,label:t.label}))})}},vIt={class:`ai-detail-section`},yIt={class:`section-heading`},bIt={class:`section-text`},m9=(0,t.defineComponent)({__name:`detail-section`,props:{title:{}},setup(e){return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,vIt,[(0,t.createElementVNode)(`div`,yIt,[r[0]||=(0,t.createElementVNode)(`span`,{class:`section-bar`},null,-1),(0,t.createElementVNode)(`span`,bIt,(0,t.toDisplayString)(e.title),1)]),(0,t.renderSlot)(n.$slots,`default`)]))}}),xIt={class:`ai-simple-table`},SIt={key:0},CIt=[`colspan`],h9=(0,t.defineComponent)({__name:`simple-table`,props:{columns:{},data:{}},setup(e){return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`table`,xIt,[(0,t.createElementVNode)(`thead`,null,[(0,t.createElementVNode)(`tr`,null,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.columns,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`th`,{key:e.key},(0,t.toDisplayString)(e.label),1))),128))])]),(0,t.createElementVNode)(`tbody`,null,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.data,(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`tr`,{key:r},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.columns,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`td`,{key:e.key,class:(0,t.normalizeClass)({"is-break-all":e.breakAll})},(0,t.toDisplayString)(n[e.key]??`--`),3))),128))]))),128)),e.data.length?(0,t.createCommentVNode)(``,!0):((0,t.openBlock)(),(0,t.createElementBlock)(`tr`,SIt,[(0,t.createElementVNode)(`td`,{class:`is-empty`,colspan:e.columns.length},` -- `,8,CIt)]))])]))}}),wIt={class:`flow-agent-node-detail`},TIt={class:`detail-title`},EIt={key:1,class:`detail-title-content`},DIt={class:`detail-tab-bar`},OIt=[`onClick`],kIt={class:`detail-body`},AIt={class:`skeleton-section`},jIt={class:`skeleton-section`},MIt={class:`info-form`},NIt={class:`info-label`},PIt={class:`info-value`},FIt={class:`info-row`},IIt={class:`info-label`},LIt={class:`info-value`},RIt={key:0,class:`failure-item`},zIt={key:1,class:`failure-item`},BIt={class:`info-row`},VIt={class:`info-label`},HIt={class:`info-value`},UIt={key:0,class:`skeleton-section`},g9=function(e){return e.Config=`config`,e.Output=`output`,e}(g9||{}),WIt=(0,t.defineComponent)({__name:`flow-agent-node-detail`,props:{data:{},has_confidence:{type:Boolean},loading:{type:Boolean},node_id:{},node_name:{},task_id:{},task_name:{}},setup(e){let n=[{key:g9.Config,label:i5(`节点配置`)},{key:g9.Output,label:i5(`节点输出`)}],r=[{key:`key`,label:i5(`参数名`)},{breakAll:!0,key:`value`,label:i5(`参数值`)}],i=[{key:`name`,label:i5(`名称`)},{key:`description`,label:i5(`变量说明`)},{key:`key`,label:`KEY`}],a=[{key:`key`,label:i5(`参数名`)},{breakAll:!0,key:`value`,label:i5(`参数值`)}],o={forced_fail:r5?`Force Fail`:`强制失败`},s=e,l=(0,t.shallowRef)(g9.Config),u=(0,t.computed)(()=>s.data?.basic_info),d=(0,t.computed)(()=>{let e=u.value;return e?[{label:i5(`流程模板`),value:e.template_name||`--`},{label:i5(`节点名称`),value:e.node_name||`--`},{label:i5(`步骤名称`),value:e.stage_name||`--`},{label:i5(`是否可选`),value:e.optional?i5(`是`):i5(`否`)}]:[]}),f=(0,t.computed)(()=>{var e;let t=u.value;return t?.skippable||(t==null||(e=t.auto_retry)==null?void 0:e.enable)}),p=(0,t.computed)(()=>{let e=u.value?.auto_retry;return e!=null&&e.enable?r5?`In ${e.interval} seconds, auto retry ${e.times} times`:`在 ${e.interval} 秒后,自动重试 ${e.times} 次`:``}),m=(0,t.computed)(()=>{let e=u.value?.timeout_config;if(!(e!=null&&e.enable))return`--`;let t=o[e.action]??e.action;return r5?`Timeout ${e.seconds} seconds later, ${t}`:`超时 ${e.seconds} 秒后则${t}`}),h=(0,t.computed)(()=>Object.entries(s.data?.inputs??{}).map(([e,t])=>({key:e,value:v(t)}))),g=(0,t.computed)(()=>(s.data?.plugin_output??[]).map(e=>({description:e.schema?.description||`--`,name:e.name,key:e.key}))),_=(0,t.computed)(()=>(s.data?.outputs??[]).map(e=>({key:e.key,value:v(e.value)}))),v=e=>e==null?`--`:typeof e==`object`?JSON.stringify(e):String(e);return(o,s)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,wIt,[(0,t.createElementVNode)(`h3`,TIt,[e.loading?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:0},[(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)((0,t.unref)(i5)(`节点`))+`:`,1),s[0]||=(0,t.createElementVNode)(`span`,{class:`skeleton-title ai-skeleton-element`},null,-1)],64)):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,EIt,(0,t.toDisplayString)((0,t.unref)(i5)(`节点`))+`:`+(0,t.toDisplayString)(u.value?.node_name),1)),(0,t.renderSlot)(o.$slots,`locateButton`)]),(0,t.createElementVNode)(`div`,DIt,[((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(n,e=>(0,t.createElementVNode)(`div`,{key:e.key,class:(0,t.normalizeClass)([`detail-tab`,{"is-active":l.value===e.key}]),onClick:t=>l.value=e.key},[((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(e.key===g9.Config?(0,t.unref)(rOt):(0,t.unref)(f5)),{class:`detail-tab-icon`})),(0,t.createTextVNode)(` `+(0,t.toDisplayString)(e.label),1)],10,OIt)),64))]),(0,t.createElementVNode)(`div`,kIt,[l.value===g9.Config?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:0},[e.loading?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:0},[(0,t.createElementVNode)(`div`,AIt,[s[1]||=(0,t.createElementVNode)(`div`,{class:`skeleton-heading ai-skeleton-element`},null,-1),((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(6,e=>(0,t.createElementVNode)(`div`,{key:e,class:`skeleton-row ai-skeleton-element`})),64))]),(0,t.createElementVNode)(`div`,jIt,[s[2]||=(0,t.createElementVNode)(`div`,{class:`skeleton-heading ai-skeleton-element`},null,-1),((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(4,e=>(0,t.createElementVNode)(`div`,{key:e,class:`skeleton-row ai-skeleton-element`})),64))])],64)):((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:1},[(0,t.createVNode)(m9,{title:(0,t.unref)(i5)(`基础信息`)},{default:(0,t.withCtx)(()=>{var e,n,r;return[(0,t.createElementVNode)(`div`,MIt,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(d.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:e.label,class:`info-row`},[(0,t.createElementVNode)(`div`,NIt,(0,t.toDisplayString)(e.label),1),(0,t.createElementVNode)(`div`,PIt,(0,t.toDisplayString)(e.value),1)]))),128)),(0,t.createElementVNode)(`div`,FIt,[(0,t.createElementVNode)(`div`,IIt,(0,t.toDisplayString)((0,t.unref)(i5)(`失败处理`)),1),(0,t.createElementVNode)(`div`,LIt,[f.value?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:0},[(e=u.value)!=null&&e.skippable?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,RIt,[s[3]||=(0,t.createElementVNode)(`span`,{class:`tag-badge`},`MS`,-1),(0,t.createTextVNode)(` `+(0,t.toDisplayString)((0,t.unref)(i5)(`手动跳过`))+(0,t.toDisplayString)(!((n=u.value)==null||(n=n.auto_retry)==null)&&n.enable?`;`:``),1)])):(0,t.createCommentVNode)(``,!0),!((r=u.value)==null||(r=r.auto_retry)==null)&&r.enable?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,zIt,[s[4]||=(0,t.createElementVNode)(`span`,{class:`tag-badge`},`AR`,-1),(0,t.createTextVNode)(` `+(0,t.toDisplayString)(p.value),1)])):(0,t.createCommentVNode)(``,!0)],64)):((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:1},[(0,t.createTextVNode)(`--`)],64))])]),(0,t.createElementVNode)(`div`,BIt,[(0,t.createElementVNode)(`div`,VIt,(0,t.toDisplayString)((0,t.unref)(i5)(`超时控制`)),1),(0,t.createElementVNode)(`div`,HIt,(0,t.toDisplayString)(m.value),1)])])]}),_:1},8,[`title`]),(0,t.createVNode)(m9,{title:(0,t.unref)(i5)(`输入参数`)},{default:(0,t.withCtx)(()=>[(0,t.createVNode)(h9,{columns:r,data:h.value},null,8,[`data`])]),_:1},8,[`title`]),(0,t.createVNode)(m9,{title:(0,t.unref)(i5)(`输出参数`)},{default:(0,t.withCtx)(()=>[(0,t.createVNode)(h9,{columns:i,data:g.value},null,8,[`data`])]),_:1},8,[`title`])],64))],64)):((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:1},[e.loading?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,UIt,[s[5]||=(0,t.createElementVNode)(`div`,{class:`skeleton-heading ai-skeleton-element`},null,-1),((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(5,e=>(0,t.createElementVNode)(`div`,{key:e,class:`skeleton-row ai-skeleton-element`})),64))])):((0,t.openBlock)(),(0,t.createBlock)(m9,{key:1,title:(0,t.unref)(i5)(`结构化输出`)},{default:(0,t.withCtx)(()=>[(0,t.createVNode)(h9,{columns:a,data:_.value},null,8,[`data`])]),_:1},8,[`title`]))],64))])]))}}),_9=e=>e.task_id==null?``:`${e.task_id}`,v9=_9,y9=(e,t)=>e.task_id==null?``:`${e.task_id}|${t.id}|${t.name}`,GIt=e=>{let{messageUid:n,taskList:r}=e,i=pkt(),a=lkt(),o=(0,t.computed)(()=>i.selectedTab.value?.name??``),s=(0,t.shallowRef)(!1),l=()=>{s.value=!0},u=(0,t.computed)(()=>{if(s.value)return o.value;let e=r.value.find(e=>e.is_active);return e?.task_id==null?o.value:_9(e)}),d=e=>{let t=u.value;return t===_9(e)||t===v9(e)},f=(e,t)=>u.value===y9(e,t),p=(e,t)=>{var r;let a=e.task_id;a!=null&&(l(),(r=i.addCustomTab)==null||r.call(i,{label:t.name,name:y9(e,t),data:{component:WIt,messageUid:n.value,props:{data:{},loading:!0,node_id:t.id,node_name:t.name,task_id:a,task_name:e.task_name}}}))},m=e=>{var t;let r=e?.task_id;r&&(l(),(t=i.addCustomTab)==null||t.call(i,{label:i5(`有效证据`),name:v9(e),data:{component:WIt,messageUid:n.value,props:{data:{},has_confidence:e.has_confidence,loading:!0,task_id:r,task_name:e.task_name}}}))};return(0,t.watch)(o,(e,t)=>{t!==void 0&&l()}),(0,t.onMounted)(()=>{a!=null&&a.value&&m(r.value.find(e=>e.is_active&&e.has_confidence))}),(0,t.onUnmounted)(()=>{if(a!=null&&a.value)for(let a of r.value){var e,t;(e=i.removeCustomTab)==null||e.call(i,_9(a)),(t=i.removeCustomTab)==null||t.call(i,v9(a));for(let e of Object.values(a.nodes??{})){var n;(n=i.removeCustomTab)==null||n.call(i,y9(a,e))}}}),{displaySelectedTabName:u,isNodeSelected:f,isTaskSelected:d,markUserTabSelection:l,openConfidence:m,openNodeDetail:p}},KIt={class:`ai-activity-message-title-text`},qIt={class:`flow-agent-title-label`},JIt={class:`flow-agent-stat-tooltip`},YIt={class:`flow-agent-stat-tooltip-status`},XIt={class:`flow-agent-stat-tooltip-label`},ZIt={class:`flow-agent-task-state-icon`},QIt={class:`flow-agent-task-name`},$It={key:0,class:`flow-agent-task-trailing`},eLt={class:`flow-agent-task-time`},tLt=[`onClick`],nLt={class:`flow-agent-task-nodes`},rLt={class:`flow-agent-node-status`},iLt=[`title`],aLt={key:0,class:`flow-agent-node-trailing`},oLt={class:`flow-agent-node-time`},sLt=[`onClick`],cLt=(0,t.defineComponent)({__name:`flow-agent-content`,props:(0,t.mergeModels)({content:{},messageUid:{},status:{}},{collapsed:l5({type:Boolean},{default:!1}),collapsedModifiers:{}}),emits:[`update:collapsed`],setup(e){let n=e,r=S5(),i=(0,t.useModel)(e,`collapsed`),a=kkt(),o=(0,t.computed)(()=>a.value!==a5.Share),s=(0,t.computed)(()=>n.status===Q8.Pending||n.status===Q8.Streaming),{isTaskExpanded:l,taskList:u,toggleTaskExpanded:d,viewTasks:f,visibleStats:p}=_It((0,t.toRef)(n,`content`)),{isNodeSelected:m,isTaskSelected:h,openConfidence:g,openNodeDetail:_}=GIt({messageUid:(0,t.toRef)(n,`messageUid`),taskList:u});return(e,n)=>((0,t.openBlock)(),(0,t.createBlock)(u9,{collapsed:i.value,"onUpdate:collapsed":n[0]||=e=>i.value=e,"activity-type":(0,t.unref)(X8).FlowAgent,class:`flow-agent-activity`},{title:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(Yl),(0,t.mergeProps)({class:`flow-agent-title-bar`,theme:`ai-chat-box-light light`},l5(l5({},(0,t.unref)(r)),{},{tag:`div`,arrow:!0,followCursor:!1,offset:[0,10]})),{content:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,JIt,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)((0,t.unref)(p),e=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:e.key,class:`flow-agent-stat-tooltip-item`},[(0,t.createElementVNode)(`span`,YIt,[e.key===`running`?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(Lo),{key:0,mode:`spin`,size:`mini`,theme:`primary`})):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:1,class:`flow-agent-stat-dot`,style:(0,t.normalizeStyle)({borderColor:e.dotColor})},null,4))]),(0,t.createElementVNode)(`span`,XIt,(0,t.toDisplayString)(e.label)+`:`,1),(0,t.createElementVNode)(`span`,{class:`flow-agent-stat-tooltip-count`,style:(0,t.normalizeStyle)({color:e.color})},(0,t.toDisplayString)(e.display),5)]))),128))])]),default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`span`,{class:(0,t.normalizeClass)([`ai-activity-message-title-icon`,{"icon-collapsed":i.value}])},[s.value?((0,t.openBlock)(),(0,t.createBlock)(h5,{key:0,size:12})):((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(d5),{key:1}))],2),(0,t.createElementVNode)(`span`,KIt,[(0,t.createElementVNode)(`span`,qIt,(0,t.toDisplayString)((0,t.unref)(i5)(`执行情况`))+`:`,1),((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)((0,t.unref)(p),e=>((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:e.key,class:`flow-agent-stat-item`},[e.key===`running`?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(Lo),{key:0,class:`flow-agent-stat-loading`,mode:`spin`,size:`mini`,theme:`primary`})):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:1,class:`flow-agent-stat-dot`,style:(0,t.normalizeStyle)({borderColor:e.dotColor})},null,4)),(0,t.createElementVNode)(`span`,{class:`flow-agent-stat-count`,style:(0,t.normalizeStyle)({color:e.color})},(0,t.toDisplayString)(e.display),5)]))),128))])]),_:1},16)]),default:(0,t.withCtx)(()=>[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)((0,t.unref)(f),e=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:e.taskId,class:`flow-agent-task-group`},[(0,t.createElementVNode)(`div`,{class:(0,t.normalizeClass)([`flow-agent-task-header`,{"has-confidence":e.hasConfidence,"is-selected":(0,t.unref)(h)(e.raw)}])},[(0,t.createElementVNode)(`span`,{class:(0,t.normalizeClass)([`flow-agent-task-arrow`,{"is-expanded":(0,t.unref)(l)(e.raw)}])},[(0,t.createVNode)((0,t.unref)(d5),{onClick:(0,t.withModifiers)(n=>(0,t.unref)(d)(e.raw),[`stop`])},null,8,[`onClick`])],2),(0,t.createElementVNode)(`span`,ZIt,[e.convergedState===`running`?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(Lo),{key:0,mode:`spin`,size:`mini`,theme:`primary`})):((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(e.stateIcon),{key:1}))]),(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createElementBlock)(`span`,QIt,[(0,t.createVNode)((0,t.unref)(l9),{text:e.taskName},null,8,[`text`])])),[[(0,t.unref)(C5),l5({},(0,t.unref)(r))]]),o.value?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,$It,[(0,t.createElementVNode)(`span`,eLt,(0,t.toDisplayString)(e.totalTimeText),1),e.hasConfidence?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:0,class:`flow-agent-task-action-btn flow-agent-task-confidence-btn`,onClick:(0,t.withModifiers)(n=>(0,t.unref)(g)(e.raw),[`stop`])},[(0,t.createVNode)((0,t.unref)(f5)),(0,t.createTextVNode)(` `+(0,t.toDisplayString)(e.confidenceTitle??(0,t.unref)(i5)(`有效证据`)),1)],8,tLt)):(0,t.createCommentVNode)(``,!0)])):(0,t.createCommentVNode)(``,!0)],2),(0,t.withDirectives)((0,t.createElementVNode)(`div`,nLt,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.nodes,n=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:n.id,class:(0,t.normalizeClass)([`flow-agent-node-item`,{"is-selected":(0,t.unref)(m)(e.raw,n.raw)}])},[(0,t.createElementVNode)(`span`,rLt,[n.convergedState===`running`?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(Lo),{key:0,mode:`spin`,size:`mini`,theme:`primary`})):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:1,class:`flow-agent-status-dot`,style:(0,t.normalizeStyle)({borderColor:n.dotColor})},null,4))]),(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{class:`flow-agent-node-name`,title:n.name},[(0,t.createVNode)((0,t.unref)(l9),{text:n.name},null,8,[`text`])],8,iLt)),[[(0,t.unref)(C5),l5({},(0,t.unref)(r))]]),o.value?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,aLt,[(0,t.createElementVNode)(`span`,oLt,(0,t.toDisplayString)(n.elapsedTimeText),1),(0,t.createElementVNode)(`span`,{class:`flow-agent-node-detail-btn`,onClick:(0,t.withModifiers)(r=>(0,t.unref)(_)(e.raw,n.raw),[`stop`])},[(0,t.createVNode)((0,t.unref)(f5)),(0,t.createTextVNode)(` `+(0,t.toDisplayString)((0,t.unref)(i5)(`详情`)),1)],8,sLt)])):(0,t.createCommentVNode)(``,!0)],2))),128))],512),[[t.vShow,(0,t.unref)(l)(e.raw)]])]))),128))]),_:1},8,[`collapsed`,`activity-type`]))}}),lLt={class:`ai-activity-message-title-icon`},uLt={class:`ai-activity-message-title-text`},dLt={class:`knowledge-rag-content`},fLt=(0,t.defineComponent)({__name:`knowledge-rag-content`,props:(0,t.mergeModels)({content:{},messageUid:{},status:{}},{collapsed:l5({type:Boolean},{default:!1}),collapsedModifiers:{}}),emits:[`update:collapsed`],setup(e){let n=e,r=(0,t.useModel)(e,`collapsed`),i=(0,t.computed)(()=>n.status===Q8.Pending||n.status===Q8.Streaming),a=(0,t.computed)(()=>i.value?i5(`检索中`):i5(`检索完成`));return(n,o)=>((0,t.openBlock)(),(0,t.createBlock)(u9,{collapsed:r.value,"onUpdate:collapsed":o[0]||=e=>r.value=e},{title:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`span`,lLt,[i.value?((0,t.openBlock)(),(0,t.createBlock)(h5,{key:0})):((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(u5),{key:1,style:{"font-size":`12px`}}))]),(0,t.createElementVNode)(`span`,uLt,(0,t.toDisplayString)(a.value),1)]),default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,dLt,[(0,t.createVNode)(j7,{content:e.content?.content||``},null,8,[`content`])]),(0,t.createVNode)(M7,{content:e.content?.referenceDocument||[]},null,8,[`content`])]),_:1},8,[`collapsed`]))}}),pLt={class:`ai-activity-message-title-icon`},mLt={class:`ai-activity-message-title-text`},hLt=(0,t.defineComponent)({__name:`reference-doc-content`,props:(0,t.mergeModels)({content:{},messageUid:{}},{collapsed:l5({type:Boolean},{default:!1}),collapsedModifiers:{}}),emits:[`update:collapsed`],setup(e){let n=e,r=(0,t.useModel)(e,`collapsed`),i=(0,t.computed)(()=>{let e=n.content?.length??0;return r5?`Reference ${e} documents as reference`:`引用 ${e} 篇资料作为参考`});return(n,a)=>((0,t.openBlock)(),(0,t.createBlock)(u9,{collapsed:r.value,"onUpdate:collapsed":a[0]||=e=>r.value=e},{title:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`span`,pLt,[(0,t.createVNode)((0,t.unref)(u5),{style:{"font-size":`12px`}})]),(0,t.createElementVNode)(`span`,mLt,(0,t.toDisplayString)(i.value),1)]),default:(0,t.withCtx)(()=>[(0,t.createVNode)(M7,{content:e.content||[]},null,8,[`content`])]),_:1},8,[`collapsed`]))}}),gLt=(0,t.defineComponent)({__name:`activity-message`,props:(0,t.mergeModels)({activityType:{},content:{},id:{},messageId:{},name:{},role:{},status:{},uid:{},property:{}},{collapsed:l5({type:Boolean},{default:!1}),collapsedModifiers:{}}),emits:[`update:collapsed`],setup(e){let n={[X8.FlowAgent]:cLt,[X8.KnowledgeRag]:fLt,[X8.ReferenceDocument]:hLt},r=e,i=(0,t.useModel)(e,`collapsed`),a=(0,t.computed)(()=>n[r.activityType??``]);return(n,r)=>a.value?((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(a.value),{key:0,collapsed:i.value,"onUpdate:collapsed":r[0]||=e=>i.value=e,content:e.content,"message-uid":e.uid,status:e.status},null,40,[`collapsed`,`content`,`message-uid`,`status`])):(0,t.createCommentVNode)(``,!0)}}),_Lt={class:`toolcall-desc`},vLt={class:`desc-title`},yLt={class:`desc-panel`},bLt={class:`desc-label`},xLt={class:`desc-value`},b9=(0,t.defineComponent)({__name:`desc-panel`,props:{desc:{},title:{}},setup(e){let n=e,r=(0,t.computed)(()=>{try{return JSON.parse(n.desc||``)}catch{return n.desc}});return(n,i)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,_Lt,[(0,t.createElementVNode)(`div`,vLt,(0,t.toDisplayString)(e.title),1),(0,t.createElementVNode)(`div`,yLt,[typeof r.value==`object`?((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,{key:0},(0,t.renderList)(r.value,(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:n,class:`desc-panel-item`},[(0,t.createElementVNode)(`span`,bLt,[(0,t.createVNode)((0,t.unref)(l9),{text:n},null,8,[`text`]),i[0]||=(0,t.createTextVNode)(`:`,-1)]),(0,t.createElementVNode)(`span`,xLt,[(0,t.createVNode)((0,t.unref)(l9),{style:{"word-break":`break-all`},text:typeof e==`object`&&e?JSON.stringify(e):e},null,8,[`text`])])]))),128)):((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(l9),{key:1,style:{wordBreak:`break-all`},text:r.value},null,8,[`text`]))])]))}}),SLt={class:`tool-message`},CLt=(0,t.defineComponent)({__name:`tool-message`,props:{duration:{},error:{type:[Boolean,String]},toolCallId:{},content:{},id:{},messageId:{},name:{},role:{},status:{},uid:{},property:{}},setup(e){return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,SLt,[(0,t.createVNode)(b9,{desc:e.content||(typeof e.error==`string`?e.error:void 0),title:(0,t.unref)(i5)(`返回内容`)},null,8,[`desc`,`title`])]))}}),wLt={class:`ai-toolcall-render`},TLt={class:`toolcall-header-title`},ELt={class:`toolcall-status-title`},DLt={key:1,class:`toolcall-duration`},OLt={class:`ai-toolcall-render-content`},kLt=(0,t.defineComponent)({__name:`toolcall-render`,props:{duration:{},status:{},toolCall:{}},setup(e){let n=e,r=(0,t.shallowRef)(!0),i=(0,t.shallowRef)(null),a=S5(),{keywordMatched:o,keyword:s}=Mkt(()=>[n.toolCall?.function.name,n.toolCall?.function.mcpName,n.toolCall?.function.description,n.toolCall?.function.arguments,n.toolCall?.id]),l=(0,t.computed)(()=>{var e;return i.value===null?!(s==null||(e=s.value)==null)&&e.trim()?!o.value:r.value:i.value});function u(){r.value=!l.value,i.value=r.value}let d=(0,t.computed)(()=>{let e=n.toolCall?.function.mcpName||``,t=n.toolCall?.function.name||n.toolCall?.id||``;return e?`${e} / ${t}`:t}),f=(0,t.computed)(()=>{var e;switch(n.status){default:case Q8.Pending:return i5(`调用中`);case Q8.Complete:case Q8.Success:return i5(`调用成功`);case Q8.Error||((e=n.toolCall)==null||(e=e.toolMessage)==null?void 0:e.error):return i5(`调用失败`)}}),p=(0,t.computed)(()=>{var e;let t=n.duration||((e=n.toolCall)==null||(e=e.toolMessage)==null?void 0:e.duration);return t?DDt(t):``});return(n,r)=>{var i,o;return(0,t.openBlock)(),(0,t.createElementBlock)(`div`,wLt,[(0,t.createElementVNode)(`div`,{class:(0,t.normalizeClass)([`ai-toolcall-render-header`,`toolcall-status-${e.status}`]),onClick:u},[(0,t.createVNode)((0,t.unref)(d5),{class:(0,t.normalizeClass)({"is-collapsed":l.value})},null,8,[`class`]),(0,t.createTextVNode)(` `+(0,t.toDisplayString)((i=e.toolCall)!=null&&i.function.mcpName?(0,t.unref)(i5)(`调用 MCP:`):(0,t.unref)(i5)(`调用工具:`))+` `,1),(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createElementBlock)(`span`,TLt,[(0,t.createVNode)((0,t.unref)(l9),{text:d.value},null,8,[`text`])])),[[(0,t.unref)(C5),l5(l5({},(0,t.unref)(a)),{},{text:d.value,appendTo:`parent`})]]),(0,t.createElementVNode)(`span`,ELt,[e.status===(0,t.unref)(Q8).Pending||e.status===(0,t.unref)(Q8).Streaming?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(Lo),{key:0,mode:`spin`,size:`mini`,theme:`primary`})):(0,t.createCommentVNode)(``,!0),(0,t.createVNode)((0,t.unref)(l9),{text:f.value},null,8,[`text`]),p.value?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,DLt,` (`+(0,t.toDisplayString)(p.value)+`) `,1)):(0,t.createCommentVNode)(``,!0)])],2),(0,t.withDirectives)((0,t.createElementVNode)(`div`,OLt,[(0,t.createVNode)(b9,{desc:e.toolCall?.function.description,title:(0,t.unref)(i5)(`描述`)},null,8,[`desc`,`title`]),(0,t.createVNode)(b9,{desc:e.toolCall?.function.arguments,title:(0,t.unref)(i5)(`参数`)},null,8,[`desc`,`title`]),(o=e.toolCall)!=null&&o.toolMessage?((0,t.openBlock)(),(0,t.createBlock)(CLt,(0,t.normalizeProps)((0,t.mergeProps)({key:0},e.toolCall.toolMessage)),null,16)):(0,t.createCommentVNode)(``,!0)],512),[[t.vShow,!l.value]])])}}}),ALt={class:`ai-assistant-message`},jLt={key:0,class:`ai-assistant-message-content`},MLt=(0,t.defineComponent)({__name:`assistant-message`,props:{toolCalls:{},content:{},id:{},messageId:{},name:{},role:{},status:{},uid:{},property:{}},setup(e){return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,ALt,[e.content?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,jLt,[(0,t.renderSlot)(n.$slots,`default`,(0,t.normalizeProps)((0,t.guardReactiveProps)({content:e.content})),()=>[(0,t.createVNode)(N7,{content:e.content||``,status:e.status,type:(0,t.unref)(X8).Text},null,8,[`content`,`status`,`type`])])])):(0,t.createCommentVNode)(``,!0),e.toolCalls&&e.toolCalls.length>0?((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,{key:1},(0,t.renderList)(e.toolCalls,n=>((0,t.openBlock)(),(0,t.createBlock)(kLt,{key:n.id,status:n.toolMessage?.status??e.status,"tool-call":n},null,8,[`status`,`tool-call`]))),128)):(0,t.createCommentVNode)(``,!0)]))}}),NLt={class:`info-message`},PLt=(0,t.defineComponent)({__name:`info-message`,props:{content:{},id:{},messageId:{},name:{},role:{},status:{},uid:{},property:{}},setup(e){return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,NLt,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(Array.isArray(e.content)?e.content:[e.content],(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:n,class:`info-message-content`},(0,t.toDisplayString)(e),1))),128))]))}}),FLt={class:`ai-loading-message`},ILt=(0,t.defineComponent)({__name:`loading-message`,setup(e){return(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,FLt,[(0,t.createVNode)(h5,{size:18}),(0,t.renderSlot)(e.$slots,`default`,{},()=>[(0,t.createTextVNode)((0,t.toDisplayString)((0,t.unref)(i5)(`请求中...`)),1)])]))}}),LLt={class:`ai-reasoning-message`},RLt={key:0,class:`ai-reasoning-message-title-icon`},zLt={class:`ai-reasoning-message-title-text`},BLt={class:`ai-reasoning-message-content`},VLt=(0,t.defineComponent)({__name:`reasoning-message`,props:(0,t.mergeModels)({duration:{},content:{},id:{},messageId:{},name:{},role:{},status:{},uid:{},property:{}},{collapsed:l5({type:Boolean},{default:!1}),collapsedModifiers:{}}),emits:[`update:collapsed`],setup(e){let n=e,r=(0,t.useModel)(e,`collapsed`),{stop:i}=(0,t.watch)(()=>n.duration,function(){var e=g5(function*(e){e&&(r.value=!0,yield(0,t.nextTick)(),i?.())});return function(t){return e.apply(this,arguments)}}(),{immediate:!0}),a=(0,t.computed)(()=>{switch(n.status){case Q8.Pending:return i5(`思考中`);case Q8.Success:case Q8.Complete:return i5(`已思考完成`)+(n.duration?` (${i5(`耗时`)} :${DDt(n.duration)})`:``);case Q8.Error:return i5(`思考失败`);default:return i5(`思考中`)}});return(n,i)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,LLt,[(0,t.createElementVNode)(`div`,{class:(0,t.normalizeClass)([`ai-reasoning-message-title`,{"ai-reasoning-message-title-collapsed":r.value,"is-thinking":e.status===(0,t.unref)(Q8).Pending||e.status===(0,t.unref)(Q8).Streaming,"is-complete":e.status===(0,t.unref)(Q8).Complete||e.status===(0,t.unref)(Q8).Success,"is-error":e.status===(0,t.unref)(Q8).Error}]),onClick:i[0]||=e=>r.value=!r.value},[e.status===(0,t.unref)(Q8).Pending||e.status===(0,t.unref)(Q8).Streaming?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,RLt,[(0,t.createVNode)(h5)])):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`span`,zLt,(0,t.toDisplayString)(a.value),1),(0,t.createElementVNode)(`span`,{class:(0,t.normalizeClass)([`ai-reasoning-message-title-icon collapsed-icon`,{"is-collapsed":r.value}])},[(0,t.createVNode)((0,t.unref)(p5))],2)],2),(0,t.withDirectives)((0,t.createElementVNode)(`div`,BLt,[e.status===(0,t.unref)(Q8).Error?((0,t.openBlock)(),(0,t.createBlock)(DNt,{key:0,content:e.content?.join(`
3484
3484
  `)||``},null,8,[`content`])):((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,{key:1},(0,t.renderList)(Array.isArray(e.content)?e.content:[e.content],e=>((0,t.openBlock)(),(0,t.createBlock)(j7,{key:e,content:e},null,8,[`content`]))),128))],512),[[t.vShow,!r.value]])]))}}),HLt={class:`ai-key-value-content`},ULt={key:0,class:`ai-key-value-title`},WLt={class:`ai-key-value-content`},GLt={class:`item-key`},KLt={class:`item-value`},qLt=(0,t.defineComponent)({__name:`key-value-content`,props:{content:{},title:{}},setup(e){return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,HLt,[e.title?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,ULt,[(0,t.createVNode)((0,t.unref)(xOt)),(0,t.createTextVNode)(` `+(0,t.toDisplayString)(e.title),1)])):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`div`,WLt,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.content,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:e.key,class:`key-value-item`},[(0,t.createElementVNode)(`div`,GLt,(0,t.toDisplayString)(e.key),1),r[0]||=(0,t.createTextVNode)(` : `,-1),(0,t.createElementVNode)(`div`,KLt,(0,t.toDisplayString)(e.value),1)]))),128))])]))}}),JLt={class:`ai-user-message`},YLt={key:0,class:`ai-user-message-binary-files`},XLt={key:1,class:`ai-user-message-content`},ZLt={class:`user-edit-footer`},QLt=(0,t.defineComponent)({__name:`user-message`,props:{content:{},id:{},messageId:{},name:{},role:{},status:{},uid:{},property:{},onAction:{type:Function},tippyOptions:{},messageToolsStatus:{},onInputConfirm:{type:Function},onShortcutConfirm:{type:Function}},setup(e){let n=e,r=_kt(),{copy:i}=y5(),a=(0,t.shallowRef)(!1),o=(0,t.shallowRef)(``),s=(0,t.useTemplateRef)(`chatInputRef`),l=(0,t.computed)(()=>{var e;let t=(e=n.property)==null||(e=e.extra)==null?void 0:e.cite;if(!(!t||typeof t==`string`))return t.title}),u=(0,t.computed)(()=>{var e;let t=(e=n.property)==null||(e=e.extra)==null?void 0:e.cite;return!t||typeof t==`string`?t:t.data}),d=(0,t.computed)(()=>{var e,t;if(!((e=n.property)!=null&&e.extra))return null;let{extra:r}=n.property,{shortcut:i,cite:a,context:o}=r||{};if(i)return i;if(a&&typeof a==`object`&&(t=a.data)!=null&&t.length){let e=[];for(let t of a.data){let n=o?.find(e=>e.__label===t.key);n!=null&&n.__key&&e.push({formItemProps:{label:n.__label,required:!!n.fillBack},props:{default:n.__value},key:n.__key,type:`textarea`})}return{components:e,name:a.title}}return null}),f=e=>!!e.url||aDt(e.mimeType||e.file?.type),p=(0,t.computed)(()=>Array.isArray(n.content)?n.content?.filter(e=>e.type===X8.Binary):[]),m=(0,t.computed)(()=>p.value.filter(e=>f(e))),h=(0,t.computed)(()=>p.value.filter(e=>!f(e))),g=(0,t.computed)(()=>n.content?typeof n.content==`string`?n.content:n.content?.filter(e=>{var t;return e.type===X8.Text&&!!((t=e.text)!=null&&t.trim())}):``),_=function(){var e=g5(function*(e){if(e.id===`edit`){if(typeof n.content==`string`&&(o.value=n.content,a.value=!0),typeof g.value==`string`&&(o.value=g.value,a.value=!0),Array.isArray(g.value)){let e=g.value.at(0);o.value=typeof e==`string`?e:e?.text||``,a.value=!0}p.value.length&&(a.value=!0)}else e.id===`copy`&&i(typeof n.content==`string`?n.content:JSON.stringify(n.content||``));yield n.onAction?.call(n,e)});return function(t){return e.apply(this,arguments)}}(),v=function(){var e=g5(function*(){var e,t;yield(e=s.value)==null||(t=e.triggerSendMessage)==null?void 0:t.call(e),a.value=!1});return function(){return e.apply(this,arguments)}}(),y=()=>{a.value=!1},b=()=>{a.value=!1},x=function(){var e=g5(function*(e){var t;(t=n.onShortcutConfirm)==null||t.call(n,e),a.value=!1});return function(t){return e.apply(this,arguments)}}(),S=function(){var e=g5(function*(e,t){var r;(r=n.onInputConfirm)==null||r.call(n,e,t),a.value=!1});return function(t,n){return e.apply(this,arguments)}}();return(n,i)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,JLt,[u.value&&typeof u.value==`string`?((0,t.openBlock)(),(0,t.createBlock)(qPt,{key:0,class:`ai-user-message-cite`,content:u.value},null,8,[`content`])):(0,t.createCommentVNode)(``,!0),a.value?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:2},[d.value?((0,t.openBlock)(),(0,t.createBlock)(rkt,(0,t.mergeProps)({key:0},d.value,{class:`user-shortcut-render`,onClose:b,onSubmit:x}),null,16)):((0,t.openBlock)(),(0,t.createBlock)(YFt,{key:1,ref_key:`chatInputRef`,ref:s,modelValue:o.value,"onUpdate:modelValue":i[0]||=e=>o.value=e,class:`user-edit-input`,"default-upload-files":p.value,"on-send-message":S,"support-upload":(0,t.unref)(r)?.supportUpload.value??!1},{"send-icon":(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,ZLt,[(0,t.createVNode)((0,t.unref)(Ko),{size:`small`,onClick:y},{default:(0,t.withCtx)(()=>[(0,t.createTextVNode)((0,t.toDisplayString)((0,t.unref)(i5)(`取消`)),1)]),_:1}),(0,t.createVNode)((0,t.unref)(Ko),{size:`small`,theme:`primary`,onClick:v},{default:(0,t.withCtx)(()=>[(0,t.createTextVNode)((0,t.toDisplayString)((0,t.unref)(i5)(`发送`)),1)]),_:1})])]),_:1},8,[`modelValue`,`default-upload-files`,`support-upload`]))],64)):((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:1},[p.value.length?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:0},[m.value.length?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,YLt,[(0,t.createVNode)(c9,{files:m.value,readonly:!0},null,8,[`files`])])):(0,t.createCommentVNode)(``,!0),((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(h.value,(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:e.url??n,class:`ai-user-message-binary-files`},[(0,t.createVNode)(c9,{files:[e],readonly:!0},null,8,[`files`])]))),128))],64)):(0,t.createCommentVNode)(``,!0),(u.value||g.value).length?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,XLt,[Array.isArray(u.value)?((0,t.openBlock)(),(0,t.createBlock)(qLt,{key:0,content:u.value,title:l.value},null,8,[`content`,`title`])):e.content?((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,{key:1},(0,t.renderList)(Array.isArray(g.value)?g.value:[g.value],(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:n},[typeof e==`string`?((0,t.openBlock)(),(0,t.createBlock)(j7,{key:0,content:e},null,8,[`content`])):e.type===(0,t.unref)(X8).Text?((0,t.openBlock)(),(0,t.createBlock)(j7,{key:1,content:e.text},null,8,[`content`])):(0,t.createCommentVNode)(``,!0)],64))),128)):(0,t.createCommentVNode)(``,!0)])):(0,t.createCommentVNode)(``,!0),e.messageToolsStatus===(0,t.unref)(o9).Hidden?(0,t.createCommentVNode)(``,!0):((0,t.openBlock)(),(0,t.createBlock)(dIt,{key:2,class:`ai-user-message-tools`,"message-tools":(0,t.unref)(FDt),"message-tools-status":e.messageToolsStatus,"on-action":_,"tippy-options":e.tippyOptions,"update-tools":[]},null,8,[`message-tools`,`message-tools-status`,`tippy-options`]))],64))]))}}),x9=(0,t.defineComponent)({__name:`message-render`,props:{messageToolsStatus:{},onInputConfirm:{type:Function},onShortcutConfirm:{type:Function},onAction:{type:Function},tippyOptions:{},message:{}},setup(e){let n=e,r=(0,t.useSlots)(),i=(0,t.computed)(()=>{switch(n.message.role){case Z8.User:return(0,t.h)(QLt,l5(l5({},n.message),{},{onAction:n.onAction,onInputConfirm:n.onInputConfirm,onShortcutConfirm:n.onShortcutConfirm,messageToolsStatus:n.messageToolsStatus,tippyOptions:n.tippyOptions}));case Z8.Assistant:return(0,t.h)(MLt,n.message,{default:e=>(0,t.renderSlot)(r,`default`,e,()=>[(0,t.h)(N7,{content:n.message.content||``,status:n.message.status},r.codeHeader?{codeHeader:e=>r.codeHeader?.call(r,e)}:void 0)])});case Z8.Info:return(0,t.h)(PLt,n.message);case Z8.Reasoning:return(0,t.h)(VLt,n.message);case Z8.Tool:return(0,t.h)(CLt,n.message);case Z8.Activity:return console.log(`props.message`,n.message.content),(0,t.h)(gLt,n.message);case Z8.Loading:return(0,t.h)(ILt,n.message);default:return null}});return(e,n)=>((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(i.value)))}}),$Lt=[`id`,`onMouseenter`,`onMouseleave`],eRt={class:`ai-message-fixed-bottom`},tRt=(0,t.defineComponent)({__name:`message-container`,props:(0,t.mergeModels)({enableSelection:{type:Boolean,default:!1},messageGroups:{},messages:{},messageStatus:{},messageToolsStatus:{},messageToolsTippyOptions:{},onAgentAction:{},onAgentFeedback:{},onUserAction:{},renderMode:{},onUserInputConfirm:{},onUserShortcutConfirm:{}},{selectedUserMessages:{required:!1},selectedUserMessagesModifiers:{}}),emits:(0,t.mergeModels)([`stopStreaming`],[`update:selectedUserMessages`]),setup(e){let n=e,r=(0,t.useModel)(e,`selectedUserMessages`),i=(0,t.useTemplateRef)(`messageContainerRef`),a=(0,t.useTemplateRef)(`messageContainerBottomRef`),{toScrollBottom:o,debouncedShowScrollBottomBtn:s}=ckt(i,a),{copy:l}=y5(),u=(0,t.computed)(()=>PDt.filter(e=>n.renderMode!==a5.Test||e.id!==`share`)),d=e=>{e.isHover=!0},f=(e,t)=>{let n=t.toElement??t.relatedTarget;n instanceof Element&&n.classList.contains(`ai-user-feedback`)||(e.isHover=!1)},p=(e,t)=>{var i;let a=e.type===Z8.User;(i=n.messageGroups)==null||i.forEach((r,i)=>{if(r===e){r.checked=t;let e=a?n.messageGroups.at(i+1):n.messageGroups.at(i-1);e&&(e.checked=t)}}),r.value=n.messageGroups?.filter(e=>e.checked).map(e=>e.messages).flat()},m=function(){var e=g5(function*(e,t){return e.id===`copy`&&l(t.filter(e=>e.role!==Z8.Reasoning).map(e=>typeof e.content==`string`?e.content:JSON.stringify(e.content||``)).join(`
3485
3485
  `)),n.onAgentAction?.call(n,e,t)});return function(t,n){return e.apply(this,arguments)}}(),h=function(){var e=g5(function*(e,t){var r;(r=n.onUserAction)==null||r.call(n,e,t)});return function(t,n){return e.apply(this,arguments)}}(),g=function(){var e=g5(function*(e,t,r){var i;(i=n.onUserInputConfirm)==null||i.call(n,e,t,r)});return function(t,n,r){return e.apply(this,arguments)}}(),_=function(){var e=g5(function*(e,t){var r;(r=n.onUserShortcutConfirm)==null||r.call(n,e,t)});return function(t,n){return e.apply(this,arguments)}}();return(r,l)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{ref_key:`messageContainerRef`,ref:i,class:`ai-message-container`},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.messageGroups,(i,a)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{id:i.uid,key:a,class:`message-group`,style:(0,t.normalizeStyle)({backgroundColor:i.checked?`#f5f7fa`:`transparent`}),onMouseenter:e=>d(i),onMouseleave:e=>f(i,e)},[e.enableSelection&&i.type!==(0,t.unref)(Z8).Loading?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(us),{key:0,class:`message-group-checkbox`,"model-value":i.checked,"onUpdate:modelValue":e=>p(i,e)},null,8,[`model-value`,`onUpdate:modelValue`])):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`div`,{class:(0,t.normalizeClass)([`message-group-messages`,{"message-group-enabled-selection":e.renderMode===(0,t.unref)(a5).Share||e.enableSelection&&i.type!==(0,t.unref)(Z8).Loading}]),style:(0,t.normalizeStyle)({width:e.enableSelection&&i.type!==(0,t.unref)(Z8).Loading?`calc(100% - 16px)`:`100%`})},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(i.messages,(n,i)=>(0,t.renderSlot)(r.$slots,`default`,(0,t.mergeProps)({key:i,ref_for:!0},{message:n,messageToolsStatus:e.messageToolsStatus}),()=>[((0,t.openBlock)(),(0,t.createBlock)(x9,{key:i,message:n,"message-tools-status":e.messageToolsStatus,"on-action":e=>h(e,n),"on-input-confirm":(e,t)=>g(n,e,t),"on-shortcut-confirm":e=>_(n,e),"tippy-options":e.messageToolsTippyOptions},null,8,[`message`,`message-tools-status`,`on-action`,`on-input-confirm`,`on-shortcut-confirm`,`tippy-options`]))])),128)),e.renderMode!==(0,t.unref)(a5).Share&&!(e.enableSelection&&i.type!==(0,t.unref)(Z8).Loading)&&!i.pause&&i.type===(0,t.unref)(Z8).Assistant&&e.messageToolsStatus!==(0,t.unref)(o9).Hidden?((0,t.openBlock)(),(0,t.createBlock)(dIt,{key:0,"message-tools":u.value,"message-tools-status":e.messageToolsStatus,"on-action":e=>m(e,i.messages),style:(0,t.normalizeStyle)({visibility:i.isHover?`visible`:`hidden`}),"tippy-options":n.messageToolsTippyOptions,onFeedback:(e,t,r)=>n.onAgentFeedback?.call(n,e,i.messages,t,r)},null,8,[`message-tools`,`message-tools-status`,`on-action`,`style`,`tippy-options`,`onFeedback`])):(0,t.createCommentVNode)(``,!0)],6)],44,$Lt))),128)),(0,t.createElementVNode)(`div`,{ref_key:`messageContainerBottomRef`,ref:a,class:`message-container-bottom`,tabindex:`0`},null,512),(0,t.createElementVNode)(`div`,eRt,[(0,t.withDirectives)((0,t.createVNode)(MOt,{loading:e.messageStatus===(0,t.unref)(Q8).StopLoading,title:e.messageStatus===(0,t.unref)(Q8).StopLoading?(0,t.unref)(i5)(`正在停止`):(0,t.unref)(i5)(`停止生成`),onClick:l[0]||=e=>r.$emit(`stopStreaming`)},{icon:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(hOt))]),_:1},8,[`loading`,`title`]),[[t.vShow,e.messageStatus===(0,t.unref)(Q8).Streaming||e.messageStatus===(0,t.unref)(Q8).StopLoading||e.messageStatus===(0,t.unref)(Q8).Fetching||e.messageStatus===(0,t.unref)(Q8).Pending]]),(0,t.withDirectives)((0,t.createVNode)(MOt,{title:(0,t.unref)(i5)(`返回底部`),onClick:(0,t.unref)(o)},{icon:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(COt))]),_:1},8,[`title`,`onClick`]),[[t.vShow,(0,t.unref)(s)]])])],512))}}),nRt={class:`execution-summary`},rRt={class:`execution-summary-header`},iRt={class:`execution-summary-content`},aRt=[`onMouseenter`],oRt={class:`content-item-header`},sRt={class:`content-item-title`},cRt={class:`content-item-messages`},lRt={key:0,class:`timeline-line`},uRt={key:1,class:`execution-summary-content-empty`},dRt={class:`execution-summary-content-empty-text`},fRt=(0,t.defineComponent)({__name:`execution-summary`,props:{messageGroups:{}},emits:[`locateMessageGroup`,`updateKeyword`],setup(e,{emit:n}){let r=n,i=S5(),{keyword:a}=Dkt(),o=(0,t.shallowRef)(void 0),s=e=>{if(!e)return``;let t=new Date(e),n=e=>String(e).padStart(2,`0`);return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())} ${n(t.getHours())}:${n(t.getMinutes())}:${n(t.getSeconds())}`},l=e=>{r(`locateMessageGroup`,e.uid,e)},u=()=>{a.value=``,r(`updateKeyword`,``)};return(n,d)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,nRt,[(0,t.createElementVNode)(`div`,rRt,[(0,t.createVNode)((0,t.unref)(rs),{modelValue:(0,t.unref)(a),"onUpdate:modelValue":[d[0]||=e=>(0,t.isRef)(a)?a.value=e:null,d[1]||=e=>r(`updateKeyword`,e)],class:`execution-summary-header-input`,clearable:``,placeholder:(0,t.unref)(i5)(`搜索 关键字`)},null,8,[`modelValue`,`placeholder`])]),(0,t.createElementVNode)(`div`,iRt,[e.messageGroups.length?((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,{key:0},(0,t.renderList)(e.messageGroups,(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:n.uid,class:`execution-summary-content-item`,onMouseenter:e=>o.value=n.uid,onMouseleave:d[2]||=e=>o.value=void 0},[(0,t.createElementVNode)(`div`,oRt,[d[3]||=(0,t.createElementVNode)(`span`,{class:`timeline-dot`},null,-1),(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createElementBlock)(`span`,sRt,[(0,t.createTextVNode)((0,t.toDisplayString)(typeof n.userMessageTitle==`number`?s(n.userMessageTitle):n.userMessageTitle),1)])),[[(0,t.unref)(C5),l5({},(0,t.unref)(i))]]),(0,t.withDirectives)((0,t.createVNode)((0,t.unref)(Ko),{class:`content-item-locate`,text:``,theme:`primary`,onClick:e=>l(n)},{default:(0,t.withCtx)(()=>[(0,t.createTextVNode)((0,t.toDisplayString)((0,t.unref)(i5)(`在对话中定位`)),1)]),_:1},8,[`onClick`]),[[t.vShow,o.value===n.uid]])]),(0,t.createElementVNode)(`div`,cRt,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(n.messages,(e,n)=>((0,t.openBlock)(),(0,t.createBlock)(x9,{key:n,message:e},null,8,[`message`]))),128))]),r<e.messageGroups.length-1?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,lRt)):(0,t.createCommentVNode)(``,!0)],40,aRt))),128)):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,uRt,[(0,t.createVNode)((0,t.unref)(Zs),{class:`empty-exception`,type:`empty`}),(0,t.createElementVNode)(`div`,dRt,[(0,t.createTextVNode)((0,t.toDisplayString)((0,t.unref)(a)?(0,t.unref)(i5)(`搜索结果为空`):(0,t.unref)(i5)(`暂无数据`))+` `,1),(0,t.unref)(a)?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(Ko),{key:0,text:``,theme:`primary`,onClick:u},{default:(0,t.withCtx)(()=>[(0,t.createTextVNode)((0,t.toDisplayString)((0,t.unref)(i5)(`清空搜索`)),1)]),_:1})):(0,t.createCommentVNode)(``,!0)])]))])]))}}),pRt=[`class`,`style`],mRt={class:`ai-message-loading-row`},hRt={class:`ai-message-loading-icon-wrap`},gRt={key:0,class:`ai-message-loading-text ai-message-loading-text-custom`},_Rt={key:1,"aria-live":`polite`,class:`ai-message-loading-text`},vRt=(0,t.defineComponent)(l5(l5({},{name:`MessageLoading`,inheritAttrs:!1}),{},{__name:`message-loading`,props:{duration:{default:1.8},gap:{default:8},iconSize:{default:32},stagger:{default:.135},text:{default:`加载中...`}},setup(e){let n=e,r=(0,t.useAttrs)(),i=(0,t.computed)(()=>{let{class:e,style:t}=r;return v5(r,pRt)}),a=(0,t.computed)(()=>({display:`block`,width:`${n.iconSize}px`,height:`${n.iconSize}px`})),o=(0,t.computed)(()=>[...n.text]),s=(0,t.computed)(()=>{let e=r.style,t={"--ai-message-loading-duration":`${n.duration}s`,"--ai-message-loading-stagger":`${n.stagger}s`,"--ai-message-loading-gap":`${n.gap}px`};return e&&typeof e==`object`&&!Array.isArray(e)?l5(l5({},t),e):t});return(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,(0,t.mergeProps)({class:[`ai-message-loading`,(0,t.unref)(r).class],style:s.value},i.value),[(0,t.createElementVNode)(`div`,mRt,[(0,t.createElementVNode)(`span`,hRt,[(0,t.renderSlot)(e.$slots,`icon`,{},()=>[(0,t.createVNode)((0,t.unref)(GDt),{class:`ai-message-loading-icon-svg`,style:(0,t.normalizeStyle)(a.value)},null,8,[`style`])])]),e.$slots.text?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,gRt,[(0,t.renderSlot)(e.$slots,`text`)])):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,_Rt,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(o.value,(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:`${n}-${e}`,class:`ai-message-loading-char`,style:(0,t.normalizeStyle)({"--char-index":n})},(0,t.toDisplayString)(e),5))),128))]))])],16))}})),yRt={class:`ai-selection-footer`},bRt={class:`ai-selection-footer-left`},xRt={class:`select-all-text`},SRt={class:`ai-selection-footer-right`},CRt=(0,t.defineComponent)({__name:`selection-footer`,props:{isAllSelected:{type:Boolean},loading:{type:Boolean},selectedCount:{}},emits:[`cancel`,`confirm`,`toggle-all`],setup(e,{emit:n}){let r=n;return(n,i)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,yRt,[(0,t.createElementVNode)(`div`,bRt,[(0,t.createVNode)((0,t.unref)(us),{"model-value":e.isAllSelected,"onUpdate:modelValue":i[0]||=e=>r(`toggle-all`,e)},null,8,[`model-value`]),(0,t.createElementVNode)(`span`,xRt,(0,t.toDisplayString)((0,t.unref)(i5)(`全选`)),1)]),(0,t.createElementVNode)(`div`,SRt,[(0,t.createVNode)((0,t.unref)(Ko),{disabled:e.loading,onClick:i[1]||=e=>r(`cancel`)},{default:(0,t.withCtx)(()=>[(0,t.createTextVNode)((0,t.toDisplayString)((0,t.unref)(i5)(`取消`)),1)]),_:1},8,[`disabled`]),(0,t.createVNode)((0,t.unref)(Ko),{disabled:e.selectedCount===0,loading:e.loading,theme:`primary`,onClick:i[2]||=e=>r(`confirm`)},{default:(0,t.withCtx)(()=>[(0,t.createTextVNode)((0,t.toDisplayString)((0,t.unref)(i5)(`确定`)),1)]),_:1},8,[`disabled`,`loading`])])]))}}),wRt={key:0,class:`ai-chat-container-loading`},TRt={class:`screen-wrapper`},ERt={key:1,class:`ai-welcome-content`},DRt={class:`ai-welcome-title`},ORt={key:0,class:`ai-welcome-remark`},kRt=(0,t.defineComponent)({__name:`chat-container`,props:(0,t.mergeModels)({chatLoading:{type:Boolean},commonTippyOptions:{},getSideRenderComponent:{},getSideTabRenderComponent:{},onCustomTabChange:{},openingRemark:{},placement:{default:`left`},resizeProps:{},welcomeTitle:{},defaultUploadFiles:{},inputMaxHeight:{},messageStatus:{},modelValue:{},onSendMessage:{},onStopSending:{},onUpload:{},placeholder:{},prompts:{},resources:{},shortcutId:{},shortcuts:{},skills:{},supportUpload:{type:Boolean},tippyOptions:{},messages:{},messageToolsStatus:{},onAgentAction:{},onAgentFeedback:{},onUserAction:{},renderMode:{},onUserInputConfirm:{},onUserShortcutConfirm:{}},{renderMode:{required:!1,default:a5.Chat},renderModeModifiers:{},selectedShortcut:{required:!1},selectedShortcutModifiers:{},cite:{required:!1,default:``},citeModifiers:{}}),emits:(0,t.mergeModels)([`selectShortcut`,`deleteShortcut`,`update:modelValue`,`stopStreaming`,`shortcutClose`,`shortcutSubmit`,`confirmShare`,`collapseChange`],[`update:renderMode`,`update:selectedShortcut`,`update:cite`]),setup(e,{expose:n,emit:r}){let i=phe.TabPanel,a=e,o=(0,t.useModel)(e,`renderMode`),s=(0,t.useTemplateRef)(`fullScreenRef`),{isFullScreen:l,enter:u,exit:d}=mkt(s);Okt({renderMode:o});let f=(0,t.computed)(()=>l5(l5({collapsible:!1,immediate:!0,min:400},a.resizeProps),{},{placement:a.placement})),p=(0,t.computed)(()=>a.getSideRenderComponent?.call(a,t.h,v.value.data?.props??{})??v.value.data?.component);gkt({supportUpload:(0,t.computed)(()=>a.supportUpload??!1)});let m=(0,t.useModel)(e,`selectedShortcut`),h=(0,t.useModel)(e,`cite`),g=r;Akt({tippyOptions:(0,t.computed)(()=>a.commonTippyOptions??{})});let{tabs:_,selectedTab:v,isCollapse:y,addCustomTab:b,removeCustomTab:x,selectCustomTab:S,resetCustomTab:C}=fkt({onTabChange:function(){var e=g5(function*(e){let t=v.value.data?.props||{loading:!0,data:{}};v.value.data=l5(l5({},v.value.data),{},{props:t});let n=yield a.onCustomTabChange?.call(a,e);v.value.data=l5(l5({},v.value.data),{},{props:l5(l5({},t),{},{loading:!1,data:n})})});return function(t){return e.apply(this,arguments)}}()}),w=(0,t.shallowRef)(``),T=(0,t.ref)([]),E=(0,t.shallowRef)(400),D=(0,t.computed)(()=>`calc(100% - ${E.value}px)`),{messageGroups:O,executionGroups:k,isShareMode:A,isAllSelected:j,onToggleShareAll:M,onCancelShare:N,onConfirmShare:P}=Skt({keyword:w,messages:(0,t.computed)(()=>a.messages),selectedUserMessages:T});(0,t.watch)(y,e=>{e&&(w.value=``,E.value=0),g(`collapseChange`,e,E.value)}),(0,t.watch)(()=>k.value,e=>{!e.length&&!w.value&&C()},{immediate:!0,deep:!1});let F=(0,t.computed)(()=>{var e;return a.messageStatus===Q8.StopLoading?Q8.StopLoading:(e=O.value)!=null&&e.some(e=>e.messages.some(e=>e.id===`__loading__`))?Q8.Fetching:a.messageStatus}),I=()=>{m.value=null,g(`shortcutClose`)},L=e=>{g(`shortcutSubmit`,e)},R=()=>{g(`deleteShortcut`)},ee=e=>{g(`selectShortcut`,e)},z=(e,t)=>{g(`update:modelValue`,e,t)},B=()=>{y.value=!y.value},V=e=>{if(!e)return;let t=document.getElementById(e);if(!t){let t=O.value.find(t=>t.messages.some(t=>t.uid===e));if(t){var n;(n=document.getElementById(t.uid))==null||n.scrollIntoView({behavior:`smooth`})}return}t.scrollIntoView({behavior:`smooth`})},te=e=>{S(_.value.find(t=>t.name===e))},ne=e=>{w.value=e},re=function(){var e=g5(function*(e,t){if(e.id===`share`){A.value=!0;return}return a.onAgentAction?.call(a,e,t)});return function(t,n){return e.apply(this,arguments)}}(),ie=()=>{g(`confirmShare`,P()),(0,t.nextTick)(()=>{A.value=!1,T.value=[]})},ae=e=>{E.value=e};return(0,t.onUnmounted)(()=>{C()}),n({selectedTab:v,addCustomTab:b,removeCustomTab:x,selectCustomTab:S,enterShareMode:()=>{A.value=!0},exitShareMode:()=>{N()}}),(n,r)=>{var a;return(0,t.openBlock)(),(0,t.createElementBlock)(`div`,{class:`ai-chat-container`,style:(0,t.normalizeStyle)({"--resize-main-width":D.value,borderTopColor:(0,t.unref)(y)?`transparent`:`#eaebf0`})},[e.chatLoading?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,wRt,[(0,t.createVNode)(vRt)])):((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)($me),(0,t.mergeProps)({key:1,class:[`ai-chat-container-resize-layout`,{"ai-is-collapse":(0,t.unref)(y)||!((a=w.value)!=null&&a.length)&&(0,t.unref)(k)?.length<1||o.value===(0,t.unref)(a5).Share}]},f.value,{onResizing:ae}),{aside:(0,t.withCtx)(()=>{var n,a,f,m;return[!(0,t.unref)(y)&&((n=(0,t.unref)(k))!=null&&n.length||(a=w.value)!=null&&a.length)&&o.value!==(0,t.unref)(a5).Share?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:0,ref_key:`fullScreenRef`,ref:s,class:`ai-full-screen-wrapper`},[(0,t.createVNode)((0,t.unref)(phe),{active:(0,t.unref)(v).name,class:`ai-chat-container-tab`,"label-height":40,type:`unborder-card`,onChange:te},{setting:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,TRt,[(0,t.createVNode)(w5,{class:`screen-btn`,"tippy-options":l5(l5({},e.commonTippyOptions),{},{appendTo:(0,t.unref)(l)?s.value:e.commonTippyOptions?.appendTo,content:(0,t.unref)(l)?(0,t.unref)(i5)(`退出全屏`):(0,t.unref)(i5)(`全屏`)})},{default:(0,t.withCtx)(()=>[(0,t.unref)(l)?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(TOt),{key:1,onClick:(0,t.unref)(d)},null,8,[`onClick`])):((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(wOt),{key:0,onClick:(0,t.unref)(u)},null,8,[`onClick`]))]),_:1},8,[`tippy-options`])])]),default:(0,t.withCtx)(()=>[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)((0,t.unref)(_),n=>((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(i),{key:n.name,class:`ai-chat-container-tab-panel`,label:()=>(0,t.h)(`div`,{class:`ai-execution-summary-label`,onVnodeMounted:e=>{if((0,t.unref)(v).name===n.name){var r;(r=e.el)==null||r.scrollIntoView({behavior:`smooth`})}}},e.getSideTabRenderComponent?.call(e,t.h,n,{removeCustomTab:(0,t.unref)(x)})??[(0,t.h)(n.name===(0,t.unref)(`execution`)?(0,t.unref)(nOt):(0,t.unref)(rOt),{class:`ai-execution-summary-icon`}),(0,t.withDirectives)((0,t.h)(`span`,{class:`ai-execution-summary-label-text`},n.label??``),[[(0,t.unref)(C5),l5(l5({},e.commonTippyOptions),{},{text:n.label??``})]]),n.name===(0,t.unref)(`execution`)?null:(0,t.h)((0,t.unref)(m5),{class:`ai-execution-close-icon`,onClick:()=>{(0,t.unref)(x)(n.name)}})]),name:n.name},null,8,[`label`,`name`]))),128))]),_:1},8,[`active`]),(0,t.unref)(v)?.name===(0,t.unref)(`execution`)?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:0},[(0,t.unref)(y)?(0,t.createCommentVNode)(``,!0):((0,t.openBlock)(),(0,t.createBlock)(fRt,{key:0,"message-groups":(0,t.unref)(k),style:{height:`calc(100% - 40px)`},onLocateMessageGroup:V,onUpdateKeyword:ne},null,8,[`message-groups`]))],64)):(0,t.createCommentVNode)(``,!0),(0,t.unref)(v)?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:(0,t.unref)(v).name,class:`ai-chat-container-message-slot`},[((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(p.value),(0,t.mergeProps)({key:(0,t.unref)(v).name},(f=(0,t.unref)(v))==null||(f=f.data)==null?void 0:f.props),{locateButton:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(Ko),{class:`ai-locate-button`,size:`small`,text:``,theme:`primary`,onClick:r[0]||=e=>{var n;return V((n=(0,t.unref)(v))==null||(n=n.data)==null?void 0:n.messageUid)}},{default:(0,t.withCtx)(()=>[(0,t.createTextVNode)((0,t.toDisplayString)((0,t.unref)(i5)(`在对话中定位`)),1)]),_:1})]),_:1},16))])):(0,t.createCommentVNode)(``,!0)],512)):(0,t.createCommentVNode)(``,!0),(m=(0,t.unref)(k))!=null&&m.length&&o.value!==(0,t.unref)(a5).Share?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:1,class:(0,t.normalizeClass)([`collapse-button`,{"is-right":e.placement===`right`,"is-collapsed":(0,t.unref)(y)}]),onClick:B},[(0,t.createVNode)((0,t.unref)(p5))],2)):(0,t.createCommentVNode)(``,!0)]}),main:(0,t.withCtx)(()=>{var i,a;return[(i=e.messages)!=null&&i.length?(0,t.renderSlot)(n.$slots,`default`,(0,t.normalizeProps)((0,t.mergeProps)({key:0},{messages:e.messages,messageStatus:e.messageStatus,messageGroups:(0,t.unref)(O),selectedUserMessages:T.value,messageToolsStatus:e.messageToolsStatus,isShareMode:(0,t.unref)(A),commonTippyOptions:e.commonTippyOptions,handleAgentAction:re,onAgentFeedback:e.onAgentFeedback,onUserAction:e.onUserAction,onUserInputConfirm:e.onUserInputConfirm,onUserShortcutConfirm:e.onUserShortcutConfirm})),()=>{var i;return[(i=e.messages)!=null&&i.length?((0,t.openBlock)(),(0,t.createBlock)(tRt,{key:0,"selected-user-messages":T.value,"onUpdate:selectedUserMessages":r[1]||=e=>T.value=e,"enable-selection":(0,t.unref)(A),"message-groups":(0,t.unref)(O),"message-status":F.value,"message-tools-status":e.messageToolsStatus,"message-tools-tippy-options":e.commonTippyOptions,messages:e.messages,"on-agent-action":re,"on-agent-feedback":e.onAgentFeedback,"on-user-action":e.onUserAction,"on-user-input-confirm":e.onUserInputConfirm,"on-user-shortcut-confirm":e.onUserShortcutConfirm,"render-mode":o.value,onStopStreaming:r[2]||=e=>g(`stopStreaming`)},{default:(0,t.withCtx)(({message:e,messageToolsStatus:r})=>[(0,t.renderSlot)(n.$slots,`message`,(0,t.normalizeProps)((0,t.guardReactiveProps)({message:e,messageToolsStatus:r})))]),_:3},8,[`selected-user-messages`,`enable-selection`,`message-groups`,`message-status`,`message-tools-status`,`message-tools-tippy-options`,`messages`,`on-agent-feedback`,`on-user-action`,`on-user-input-confirm`,`on-user-shortcut-confirm`,`render-mode`])):(0,t.createCommentVNode)(``,!0)]}):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,ERt,[(0,t.renderSlot)(n.$slots,`welcome`,(0,t.normalizeProps)((0,t.guardReactiveProps)({openingRemark:e.openingRemark,welcomeTitle:e.welcomeTitle})),()=>[(0,t.createVNode)((0,t.unref)(KDt)),(0,t.createElementVNode)(`h2`,DRt,(0,t.toDisplayString)(e.welcomeTitle??(0,t.unref)(i5)(`你好,我是小鲸`)),1),e.openingRemark?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,ORt,[(0,t.createVNode)(N7,{content:e.openingRemark},null,8,[`content`])])):(0,t.createCommentVNode)(``,!0)])])),o.value===(0,t.unref)(a5).Share?(0,t.createCommentVNode)(``,!0):((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:2},[(0,t.unref)(A)?((0,t.openBlock)(),(0,t.createBlock)(CRt,{key:0,"is-all-selected":(0,t.unref)(j),loading:!1,"selected-count":T.value.length,onCancel:(0,t.unref)(N),onConfirm:ie,onToggleAll:(0,t.unref)(M)},null,8,[`is-all-selected`,`selected-count`,`onCancel`,`onToggleAll`])):!((a=m.value)==null||(a=a.components)==null)&&a.length?((0,t.openBlock)(),(0,t.createBlock)(rkt,(0,t.mergeProps)({key:1},m.value,{onClose:I,onSubmit:L}),null,16)):((0,t.openBlock)(),(0,t.createBlock)(YFt,{key:2,cite:h.value,"onUpdate:cite":r[3]||=e=>h.value=e,"message-status":F.value,"model-value":e.modelValue,"on-send-message":e.onSendMessage,"on-stop-sending":e.onStopSending,"on-upload":e.onUpload,placeholder:e.placeholder,prompts:e.prompts,resources:e.resources,"shortcut-id":m.value?.id,shortcuts:e.shortcuts,skills:e.skills,"support-upload":e.supportUpload,"tippy-options":e.commonTippyOptions,onDeleteShortcut:R,onSelectShortcut:ee,"onUpdate:modelValue":z},null,8,[`cite`,`message-status`,`model-value`,`on-send-message`,`on-stop-sending`,`on-upload`,`placeholder`,`prompts`,`resources`,`shortcut-id`,`shortcuts`,`skills`,`support-upload`,`tippy-options`]))],64))]}),_:3},16,[`class`]))],4)}}}),ARt={class:`ai-image-preview-group`};l5(l5({},{name:`ImagePreviewGroup`}),{},{__name:`image-preview-group`,props:{maskClosable:{type:Boolean,default:!0},onDownload:{type:Function,default:void 0},showInfo:{type:Boolean,default:!1}},setup(e){let n=new Map,r=(0,t.shallowRef)(!1),i=(0,t.shallowRef)([]),a=(0,t.shallowRef)(0);return(0,t.provide)(VPt,{register:(e,t)=>{n.set(e,t)},unregister:e=>{n.delete(e)},preview:e=>{let t=[...n.keys()],o=t.map(e=>n.get(e)()),s=t.indexOf(e);i.value=o,a.value=s>=0?s:0,r.value=!0}}),(n,o)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,ARt,[(0,t.renderSlot)(n.$slots,`default`),r.value?((0,t.openBlock)(),(0,t.createBlock)(s9,{key:0,current:a.value,"onUpdate:current":o[0]||=e=>a.value=e,visible:r.value,"onUpdate:visible":o[1]||=e=>r.value=e,images:i.value,"mask-closable":e.maskClosable,"on-download":e.onDownload,"show-info":e.showInfo},(0,t.createSlots)({_:2},[n.$slots.extra?{name:`extra`,fn:(0,t.withCtx)(()=>[(0,t.renderSlot)(n.$slots,`extra`)]),key:`0`}:void 0]),1032,[`current`,`visible`,`images`,`mask-closable`,`on-download`,`show-info`])):(0,t.createCommentVNode)(``,!0)]))}});var jRt=[`alt`,`src`],MRt={key:1,class:`ai-image-error`};l5(l5({},{name:`AiImage`}),{},{__name:`image`,props:{alt:{default:``},height:{default:void 0},lazy:{type:Boolean,default:!1},onDownload:{},preview:{type:Boolean,default:!0},previewProps:{default:void 0},showInfo:{type:Boolean,default:!1},src:{},width:{default:void 0}},emits:[`load`,`error`,`preview`],setup(e,{expose:n,emit:r}){let i=e,a=r,o=Symbol(),s=(0,t.inject)(VPt,null),l=(0,t.ref)(),u=(0,t.shallowRef)(`loading`),d=(0,t.shallowRef)(!1),f=(0,t.shallowRef)(!i.lazy),p=null,m=(0,t.computed)(()=>i.previewProps?.src||i.src),h=()=>{let e=i.previewProps;return{url:m.value,name:e?.name,width:e?.width,height:e?.height,resolution:e?.resolution,downloadUrl:e?.downloadUrl}},g=(0,t.shallowRef)(0),_=(0,t.computed)(()=>{if(!i.lazy||f.value){let e=i.src;return g.value===0?e:`${e}${e.includes(`?`)?`&`:`?`}_t=${g.value}`}return``}),v=(0,t.computed)(()=>[h()]),y=(0,t.computed)(()=>{let e={};return i.width&&(e.width=typeof i.width==`number`?`${i.width}px`:i.width),i.height&&(e.height=typeof i.height==`number`?`${i.height}px`:i.height),e}),b={width:`100%`,height:`100%`,objectFit:`cover`},x=e=>{u.value=`loaded`,a(`load`,e)},S=e=>{u.value=`error`,a(`error`,e)},C=()=>{u.value=`loading`,g.value=Date.now()},w=()=>{!i.preview||u.value!==`loaded`||(s?s.preview(o):d.value=!0,a(`preview`))},T=()=>{!i.lazy||!l.value||(p=new IntersectionObserver(e=>{var t;(t=e[0])!=null&&t.isIntersecting&&(f.value=!0,p?.disconnect(),p=null)},{rootMargin:`200px`}),p.observe(l.value))},E=()=>{p?.disconnect(),p=null};return(0,t.onMounted)(()=>{T(),s?.register(o,h)}),(0,t.onBeforeUnmount)(()=>{E(),s?.unregister(o)}),n({previewVisible:d}),(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{ref_key:`containerRef`,ref:l,class:(0,t.normalizeClass)([`ai-image`,{"ai-image--error":u.value===`error`,"ai-image--preview":e.preview&&u.value===`loaded`}]),style:(0,t.normalizeStyle)(y.value),onClick:w},[u.value!==`error`&&_.value?((0,t.openBlock)(),(0,t.createElementBlock)(`img`,{key:0,alt:e.alt,class:`ai-image-inner`,src:_.value,style:b,onError:S,onLoad:x},null,40,jRt)):(0,t.createCommentVNode)(``,!0),u.value===`error`?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,MRt,[(0,t.createVNode)((0,t.unref)(XDt),{class:`ai-image-error-icon`})])):(0,t.createCommentVNode)(``,!0),u.value===`error`?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:2,class:`ai-image-error-overlay`,onClick:C},[(0,t.createVNode)((0,t.unref)(fOt),{class:`ai-image-reload-icon`}),(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)((0,t.unref)(i5)(`重新加载`)),1)])):(0,t.createCommentVNode)(``,!0),(0,t.renderSlot)(n.$slots,`default`),!(0,t.unref)(s)&&e.preview&&d.value?((0,t.openBlock)(),(0,t.createBlock)(s9,{key:3,visible:d.value,"onUpdate:visible":r[0]||=e=>d.value=e,images:v.value,"on-download":e.onDownload,"show-info":e.showInfo},(0,t.createSlots)({_:2},[n.$slots.extra?{name:`extra`,fn:(0,t.withCtx)(()=>[(0,t.renderSlot)(n.$slots,`extra`)]),key:`0`}:void 0]),1032,[`visible`,`images`,`on-download`,`show-info`])):(0,t.createCommentVNode)(``,!0)],6))}});var NRt=`data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAYAAAGVn0euAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAYKADAAQAAAABAAAAYAAAAACpM19OAAAj4UlEQVR4Ae1dB4AURbqu7pnZyOICShIVBI5TDPgwR0yn5yknKigIy+5KMCJ4ohgQMGdP8BQDsAsqHsZTnnqcPlEU1DNwnnqKYATxRDIsuxO63/f91dXTMzuzzBLEd28Leqq66q+//lR/he7qVWpbh35lsYVBnHbwJpjuPqB2Be/3s9X+jH9TFnMZZwxdBkVXdhkc+02w8E8VifoVOg+Kurze/tRxuw2OuodU1tUHMlgI2GdczH1/kSPXR1847ieLE+6AC2uk0v7DoxKn8DDkt7aaMOFOtWaNq8YjXr/WVS3DupEehXHBLRWInXc/rXbV22/NU+vWOurNN+epmnWoENEV9g9WWDIjzyoOuWo9AG694xlVi/ihe55SsfUJtOAI5h5FCYnD8oufj6ryrVcLNrknHmyrkO2qSEgpx3ZUK7SAf5Y11rIIKz+mEuM/jNzgtgDdpd4l6ZCjGO99Vat68MG6v5R09/61NfVoGe/6+vITBqg2HLoJevnK3DO+61v3CXPvi7VbpVsSj8XW7b2HUsNPDamrQ3VuKXRzVlF+wYhJVj9TwRcTtT1rbBgyVyqM3BBS190VVS0i7psfRMNHLnwwT2CFpD3LYmM6trXU8lWuWvzlCrV6jaO+/GqFumpoRLUMOUfu72mZrdgdyzd1tFz3liP3sdRaGNuI84eoDYiHDhuqatdrTRvDYwWfpIMr6tzKk21VBLoLYRqFaJvxFwuiqhtaOHZsiyRJrEmbef31mIoCa3yDqxIbHOXiYr4BTmmBNxeN2PgWbOjwUtoOACklY1c9r2npU0PYX07YYrL69nXzrKJ4ncfKglnVkcOZ3nNgbNyXj0YmGBZzauCSo39yPUBHWRZ0Y/We9HrLFwwSNlZYGFuUb1l7FECxBTCqAmWPu6E6dH2DDRjfYxCZ2EatAstV/6zOt24uc1vZduKnMVW0V6VeqUwsOWFqqLOBzdiAQdyji6VuroSRaz+miJiB5j1kQlQaKYArem5yoY+n7Xnx73+YEm4vgPjxC0yGQT71ct2PCEDENthmHMIF4pF2JT3pATQEof1pYrF10sW1IsqX7ytgNQnSmzsPqluOakXIac7cy84KqR/Q74jswvLTBbBqxrPSaQcO7CP3Tz/+jJTT65ILhgPQY8jty/pWfv2WDOWkkl3s4tNtQUjJRnAxTl5oHBxFIKu3X9EcjLqtuTXzOnRqwPWfsBN+dfD9EccGZh1SWesU2Mp65sWEOvUoW5DHIY48tJxQDly/gtMHIGKKjRyw3zNg7FgOBtrpO/3rtxTMZLo/xkBygsZExrSaQogieM+05LHMdh4+7roWwy0LN03hP0cCvXq5vhVm4yqrFWWrYPL7DY5ehM55H+9tK97piarCr01Zo+J9zqkd0X1A9C5W6n5u3d6YXc4zCG4sjz9k0oyPw0zzlLL45GDeZjkYAVcNF60mvt7KMm574hs7p9TrPzB2IvrDnHxgLgBsAfxFfjjcavwUa1UKYLBlk24/zC0q3BR7Bfc90XFnLnk0r9yUpcf3VsTdfHSz86voVHTwEybDxJg7TwFspbkPxnnorEUF8fbvP1S8/Nby+DfwIhddMS08+6+D3OKTZlgbg7AZGzCOzwCOHRhSR3S31FPzHDXjpYTnMuBGLGvBq4/ky1BpYNPjeg0Ekb94M8YEz7NwRktgXptqXXXZ7THto2znlKceKH6JiNtVxh+37dAVyx6xlvKewfOD+ib4y4nbhk1KbajVVw1iIubFSvdeERG3XmRbL5p6rSNO/11Cse/MPeOUBgz1V/UPqfVEjmvjJlfVeohr0Yi5YlGFaZr2tCNH1owksnYRR7XFhCoYUhowBe1aErmrNgLx0PIKHymRDyqrUDGsQ+pQdkllnioSl+7cw7ptMDa0Cev1hMHlDZnRtSaDMSmnzC/2hktyEAYpZd5wGfXuuUThYMOxgkFTn5kDjsUyHhOwBgjqsFBrvlML3kq6DhyVlur7GKZbnHIlAFPozWYJR+rTRSQccLg08o+AmjqIIgHKrr1hiozDMn8DR3fcPAVjsQPEmH9x8Mb/QsCbQb9dXir1bNTXARvJt1VdEXJehL1TDJpSxi4oxhQaiB0o14nhQtrFxSGTdRgy6cBvgACfVucVcBzeuC6h4kBEpDE0RFHIhTzGDi4XaRfK1uN2UgdtvcUj8THU8+eg6B5Mm0bNmx9X+3a2VBtYVAKiCIEUh8pELMtJxOtWOUJ9Pohi2HtM/Tk+qtYPfS+oeRrWcQYtJN/SEyuxFpokZY58mU3gPh/3wkXY6tfr2tIn07FlbMAAjbx0o0vqfORAXIAlcSEUzOmiXGwAejBw+cr9qNtVrWQnwuBpipsksF0l0Lfcbbs1DcCud1zoNzjmWm58OeKjs1HR4TwXniR72GEMXFQRf5Bzt50xrLVS6m+j+rqF6WTuPyh6futobGV6fvC+QT8UBGwofeqp2OiDM+UQi/D3F2Y3P/i001bt7jrhb3SexXHpsednlwxMx1N9Xnzw4Cnh6mB+X0g9EY+v5KYkXJysESPKemBKdfjCIBzT24SBINJ7enw/G7uO7wPxWEw2mg1/v339LbpghbT05Zh5WnZ8acSySkk8xyq5gBAMnfeHqvDUYJWtYqDzoNizGNn0JkAQa+Z03Lat47+ojryRqfiWytgJV02NcP7uh8cqEj9hht7KKrBL+t1vbfALAolGM4B5DXeZKZycAzc7/P0H2JpOu5fPn1ogS6Zby9zdlZV4dUx1uGs60oWVsWN7TI28lp5v7nNmwEzITEUT331BSO3bKTMazskYGI15IK6+/I7EY/MEGWQihHSerapfmFxYTrgtCV4T2at2Hlh3O3rn6CDEeb+11WmHYYtFz4L8Iq8Tc74kRBsGCMCGvEmmuvTmqDDiawWMzLy/KIWWzkOjj6Pr9zfIFz9MtuuHjJkGrPPA2DPYNdMbW17mo1fVmwL6jHBzjQh5CfFkBDf01YxNGVF9vthRz74Y88yJGsETi0nFBJFw5IWYlQbCm/fn+2WBbMEZvPfTXc51m7t2LGU1MnmkNn0j+SBRJi3EAksmwrUGkkz+6zM8l3krrvfkQB40Er3zj8VcxKszR2yCM9M0u2jw6YnJ7UyfSCTqi9MrBfH/HQQ893hbllMmj6gfuf8u9e78eSZLTX/8WV/6LL9v0t1qfqD8mT/rcs2cq7p2stR7C3Sf4MYiGMgzyNpiESmjBzJkkDEFabHPALZLX4bcTkor9293b20JA5QwJckrSDwBudoykmd5kHiWc6Fk6pJBEs2FqXRozQDBJMjaxdMAirIG0iNhyYz8k5FY592mRELMx45eX8I0uZDldd3ND/twRcUlKooyvZrTK7k7bnvILy9GeRyLLC7E9AoPMRZeXFVwycKLzJjQFktIMiFXnn6KZ8qCMQVRL3QeGK2C/gYn/beW0nm/C6FD6s0JI0nCUAoSI22hnD2FwmMscF5MibNBA8t6781N9Ujn39KcIOr5CWuwoyxJ1HJV73Gl+oaFgeCbUCBPebtY5T3Koz3gqz8Udwcks16Oq95HhVR+hESAGAhMVpxAzR0JwtETcS9bd3fYL5vlJSFpQpQ1pqIiecGPNGMTKPlgJzb56XFGBgzQwqq8hScMc0vjTt0aujkCv4blMhs67pAQYpCBtDFVGaKNUbIMgWWOEKalT3gyJaWIuSDlkw/BL/lwPhBN+7C7m2O73wkSV62SOMMPquQWThu+aQEIP1QaA5HB0bRjB1vtglk7GRNzwg81YMxL5+vnJ9Qc82vwLHz9DwlNOOxMM6HUqeN3shvzQCBnBgybZRfXnI3GniBRhgkjPeb5aVTg85aUPJZT2syX2AIOzZDGpfsP02SU9SO2NXa/MS1uNO2nxwDdujBm1IZRIGgCCCrRxCYZEyKEqQBjICwMIzGM+oQDjszQTIVB1vOYJUynK/5vPOHfOmk21W6SQJMEmiTQKAmcUxE7vFEVMgBjqNhxwXGsR/HmiJk2bREhO4yBfoPjWO+6nfCOzepslHcZXNc9W5nJb3AyZ4C2ZXxmeW3XsGP/DXPWPTy8JdwjxQyvfNb00HRM//QsEIWuY41ANLyh9n92DTxdVfCFsynyK+yHck9U7azjG2dND1cHiSfRWBkMO3BwvDfT2QJmGVsZ8CZf90XRhUDUPJyX12NhlbXGYNzn3Lo/YzpzMt7JOfNfjxek7LoR5iY8IQfR114zLXSTqWPiY8pif4kotze2GNVL1ZwNZQ5ZCzKD18897dT1eOHGxYt+GlVBYbPwk09aCWz4rkNeCWugXM2erVdaQQzTKhPjK6aGxgfzmO4D4tGze8vkEPfs5TU14SLgxVPa1LDVfaDTOkhZWZdqtBDouuinI3utPslZFxPi9dIls5zauPafDDnnVLi7hZ34KBA0SmarQCU7FRCMzFiLEzXXDI4vjoTcC8ZNDb/KRQ/rZsZssDYynrjf0g4JO4QNRHc+OtfckQvbX9NIFOryisTFIdedJNNqVGZMDWAV+83GjqEu48dbXPj5YZswgLdFT8ALoIOA9Rhc7XCth2i+sFzr+ZrC8L3fP2Q1aov9wWFupCaaiAoToBD94O4hU0N/8KkOJLaYgT3PrdsXT9Q/BK6cBiLsVsxePCP/tEDbfvLWisTwMdNCD/oZSMysdNu7bmJZWFnf9JsW6hgsC6YbzUC3cza2j0ci3wJJToSbxrgCo0fBKmvmwur8ASb/lor42SjCK8bWJ0Uldk+8PVxnyuZUJlbN393eGWaTdWOoUQxgs/dy9J07TAO5xGzALB8DS05nwdR8XwC3Do6vyLdCXUcFXDBxf1jpnnvAVOuxhtqhmeUU8HzgA3iUAzIBQ7Cq8mRb7benpbp1sNRK7O99vhQbsm846gt5JpDcdeA6OWxb9rFDat2CRKz1S9NKVuDl+EPTiWc7zVw1J1N7wbycNADiq1GpLFiR6b12xztjF/uC9IsNUjLG9Cdf4TjBw9yFTmpDXCNc1YsPJt9p9RE0ImHaylqly6C6vtiSmpUOwPeiigtSc0lwMPDWXMy/c3pcLfrK8bdaZNsF+15PT+b2VmrYdYjbIeHE30Xnn7t8ap7fZ1KhchgHMj1aehabKMFgCOdzAyEYP4wZGHN/1NzPfTehnn81AW2wU3OLhVpRMx+7vyiFyC5Dk4dWMK7MXPJwZiagxOyhc1m03vzliWvDKoahhBcf9/GqwztEvOJIx7FJKjHTuGKY7sRAC6840kf9l6326ojRFS2b/R+kMbVODcXYqW7mXSWh+uUGukEGIKTjDSDjS88ICYGG8CiI5kVmgsRGQSwvEpzwyshYzGNy8BlhjKz6wYY2I1edP2LjC8G2SvA6WDPvKoamsoWsDOw5MOrNb5JV6WUo6SDhRhuUtJF8AsTyMmWSj3qOl58A7KAzI2I+NCPp0Mo9NdkSPJBIn7FSZCZbyMoA7Fqe4ZqKfMRkJBsFAeYyJqI1kNQG7yl9wwzjOI5WkXjmt9tF74vqPgAm0FHG42VV014zdOtivF7Fi8xkC1kZQIUUz3DIr/EEDg3L5Wnh3z/+pC4cUqEm3nOXL32jBcY//rhCVVRUqNvvvMsnPMjYrnhsRemTeGoi2myjr/ViDL6mD/D8VbaQ6k6yQSGfhAcDOb/sgiGStQAnwFwM9hdefJlsr/N5AMuHDx8q5TwhBpNXl43Q5XywwfK9u4XU2yvxqBVpMSPL5errFlZCx0WV7IQThsHXANzl2sBV71lZ0O6NlDUK/fv2/HkBG9fmEyx/E8fdHJiQXBAGTaoFnhppDfgDXFdTJ+iF2A+yhaAGmmcDYj41QH9PXIgQ15cOvQysQS68mMlqKYG2z1zC8FlaMSyefUBLX7bcuUyWQA+URJF1LifaM3Ugk1S7NwWM6VH4ZIVvX7JzpJO3E96UpXQlH1ymC41vzrpogeXGxEhWYDATZpAlgX1AXoA1GVlivx0nkeicBQYEw3OgcRmMIGXTEflo1YTLx9wm3oVEJgiDi49WTZhwNcuJB0x6poQXdaUD66m2ZsbAsw/440ADXsg3oa8eL/wGfYBe4F6DhLE31Kt16zGw4KUwStB0wutvmQ5z0B0SypE+QPuiVGgmf7yjSqflnoSna4BPZMx0Qo8HAJUgJiTGytt0fWsY/voa4A1eQZ4ITXREEgZjiNcNzP0Ap/jEh2s/rn28SWviKGGHFyWM2KXNk2iROmLmMR0oMwOZ54XYrAR23FzGAV8DpiI1gXSk8yC3dcSK/ttoYMVKEgWx4r8RjKyTeM8MXxOQFns77qUESa01aEhyMLcFcUamMpUAjG4HCS+Q+FxCigaCFZbMsH7kAKMRc6TEcbG3cCyLNg4J+hfmPEFps1xLmbE2K1OuIH1yQc0wzbGDEgyakaFB+oA3mdvSkRjvfFtHknCeKGMjUbzM8ekizQQJdUCIeB4QYswmJZ8Eg1kRvUPz0UzxsT6ZcPDuBPHLSAz82DrxQ8o4EFLL/YK0RFYNEO69KZG3MGtcTuKlIZjFMuzDffElvDyIE+KFEWohQBzyDJHa/j27J0PeRfNb96P3oBt4iZ/eyAR04lWcD/FqbrkHm/z0OGl06SWB+5OG1bqyMEeemcMX422SnvuG5IE0Hq2Lq+U4gfbkbX1KhmlzRDI9TdjvPo5JvaCp/n5C5pc6gCpjqNeJM0E1L84vim6qrdG2qideCdj+hwsTqrTEUp12gyuFG4Gc9XsQtHMiApHsz3InHdvcK7X0c/26Gbda9OqMDCc1wFq5BEGfC+BpmOoWh2s3pmgCDZpOzljMAMgEBvfBMuYJsYgFVspNfU08NRGynKtsJ/TUseN3WpwLXTkzYJBVXFzzAwho4zPiESSmRYbEcyFOY8T4ec1UJubABIWQyvjKvGiL9t3HW1HTfnrcaAaI4PxLag6O2O47WqqGGB2LObBDGu0gTaJ8M6EmPK+WnRlqgtqh1rDeDsWa7T+6bcpBOMMI+1qjw+RJRe9OuhevSFqJVnB9L4uXEsl53gTEa/eoGfGZAoxI2GPOeB4hVBjVBBvC89A/yORObvj1RhPZVKFJAk0SaJJAkwSaJNAkgSYJbE8JDBjgtsBEH1OVHRe2aCa348jdti3Hw/ELzh6cSHmutW1b2Dy2/7cKwBtid2O5exMWwI+eXR6VDz9sXlypELtvgx60Q7tfKjvb/45L+qLa+Fg4Hb70EtyBYuNxfMJo9J+r8v6YKyU4pVOG9eKixY/lvZ1rnXS4/3gFlJe7pQkr1s1NWMfjWMtQbPt0pBB4ModH6+qllfWVYzkTsXP7Wl048vWTD1kpxwClAn743ZySTbGlWNgv/df0vP1MfmPj/3gFZBLImIr4EMj+ITAPA5aA50DuKbdNi/w1E3x63uHYsnes2KchZeE8CR9VWZ9YdvjAuVUWto0bF34RCjjijI34YKZ1vU+6Z5mw2K9DcXX0G38p+s4vQ+LIPhtOVrb9HEw4X/I9a0aER3fW0fOeKXorCJ8pfTfO64fjic8xDnx5SVXoUPP2YybYZJ5rnVSWeATbPZXUHAdQ9ADFJ1+M8X/ck9WRJB/JillTvwgFDDpxzWoQUso9YWFDYtJM8pDnWsNmvFL6MHPKTljzBB7Nne2XMdPAMbbcp2fMaXGWZG/m5+nz3CPwBctvT59mpSg4WI2fQmvdMVZmu9YECBwH5TzBoy2mpQdA83hZU+5DklaLbVuNundaCAeBTScLYk2mfxEKGNbTjbQJ//siHDA9GRw1c1zXsW27peM4e6NngDcw59oHgZcT8EDlFrBLvqLIXohixC5PLa62HPfh8e+2nZ1kr/Epjhm2XdcmlAgfCJxHwbrPgXXvJMIOCFnf621oipjb0RRmUkHsFdZ3IP55fNNoTsgNLY5H1LIxaWPKL0IBDYnpNVjgNz8umw93g89jqUPB7MTyz3Yb3VCd7VE2Hm/fWk6iCgI+0RcyNGRTKZCi5IFAGMQsFbWHjnjMqveSSSa6dqgCOuJzPKFErB+8TD+YDx/epU8NM9GcKY8PPd4B/8/godfjfCycCWhzeTeWubsWbVKrLsvwar+pOwvnfFY3S7yKT4IeQ6F7gzAVUD1oWqjcwOUa/6wK2LOs9leWa08AcfDh0mNzpbNRcLRIPghF9CYeb4/9uCoyd3MIbocx4LtwH+DVgRXhhH346LSvIabXf7YicQXw30afj0d5fU6ZEn4uHSaXe+DYvqHLwFgvDJo416Fab8+WIAdxA/6giG5FvwxLxSVuYi3Gjf7vTS14KUjHbXAtGGt6w1ffAFCeQmL4Cou1a2wr9PqVU63vdVb93zfPS8zAGLHo8KmhG+qX5pazXRTAz4knYvFpmNWcmRsZWw5FgcurAeCEzKR8JyKlTCuEMDiUU11YmDf8pcDhBFJw6+DERbbtfsNvgvJ+c+GzSvdAwHz+66nW+s3BZivfpgroibMuazfF/hu++MRsDWbK79nVUr32t9Vhe+PzTXjVEPUzBhLLMkM002vA+oJPHDX/n476x2L9qQdt+VAMyvEVKc8dmcFSK0wU5aoFdmHBsemKQLWfLRhetrpBfEvmRojmmlwQtcNXJIecYit+5X5LQ7oyiIduiBr6+6eOmjnHUStWOvKijCyaUCaKQQx3k0yjCl4CuPy5yUUpb1YT388RSPJWhe593Wa1BfHPwPmum0N06qG2GgrBY5GyRQFykykfYxIuAmfsYTMxM5h28JLPrL/G1et/TySniiiQxRLdEy6TxmC9NhJ39noUnyf20GWMeI4ERw7+gUJ8uSQlrMLLWvsHPwKcUprlxqc5S3mD2V0H1e2FTRQS0+D08bf4ix38YyIiOLTImIECNHk6J/NvkEimteCJhEuyYGzKNB5Tj/Gzf0uo+R9AEUjrebtxSWkKse1jq+4rnKsx1P/de1gdBmW7Xf0S5jjLP30ov33mssy5hsbMpQ3k4ot+x0F8rzYAolrjz17cVBGSt3sbgksvCxJl3AphdD78vGf6Wvgm34sBZOqnx7U4D/jgo1G1Bp+BpOWzBxBGjxlUjB4foNZeD08qfD2dLt4fdH4dVt0aM1foTDNmYPrdB/TfD5CMHH4MjTmAJkG6nFvTwbXDXyOH0+2MoXN7S/Ej4Y0JJEYIwo8mTAuIOPx88Orx78Hoew1v6jUcz3gqqpb/QGFrgcuADATY1cQ/GR/iiTxn18l3ltRb0B17Ib4j5jWmoXmrM6iI1+5v3Bm+nF6wTBcihD8DeVmly8OIo/D3L9IPqJBM7TA0RqbpErgJRyY8NjwL9/mUfI/nFOH7ecDBtK8Y3HCgJQa6G/o5bbUa54A+EfXs7Jhatky7IYIEZ07YuwnnRa2nkH00rpTA9+eTlGp8ehORYLonpFTYzE2jh0PtelSvbHgphDLslvBsFs9imZjpOi+PMS++t89zW3xnn2ex5NAZ3k/Wx/uQx/zghTJzyoJ1dZnGo48K6jTfvuW9/ya61DNnAuCpgfPEY3DqDtybNxP51qG8eYheIW8jhtRR+ExVyt/iIs98+5wvcPPiQTYTywk95DU2NL4HWO6QhhR98kG2yseXEdOtn4TR0hholatW/aTGXTlKbdyQuoYpblaibrr9HtWqpV6UGgthXW3h2gJZf/Toy+rVb4b6d995t9oZ9dkOJkK6F7BhyIc46GZI44E9Quqjf3Bg1j2BbckFGIlthw/s57CqCTz+iKdlEihu0mXEznRjg4eqEdVcdVhD0Lvtog82meOSJvYtWSxcqRuuGV1PeMRLhYy/erT0ClqwtnTPsr3ewvyrr7oiY/0NqH8lysx5DMZx9Aj2CjkF4+FgL2iDz0On9wDpFRCy7h32Mem80gWZHsDzF0z7Bwu3RQ/AeaWv0GjH9IZzvW+Nl/yN9XNyoH2wthTjo5m3ds3qrCjXoIyCF2sFDm21AWtGHmGyhdWrV8sRDG3xADZ0oAKt1OArxV9BoqBphRwD2DMkDQK9wbjelFLOUAFfpmBmR5nKsuVlcEH8WzXundkqbC5/FQ6V7cyPvXgMYZ0gzJBxBjJIt7C5QMv1FQhg1qer0C7FYMuOheMKDFkWfZydUGZUfHrMt8nrT0mNS3LhqFKDPnWUrf1cOEvFR3mkhCUzIncB/eMpmTnekKxlK+iC6DI4COJvZiE27kcPtvr+gIOOyor1wIOPkh7Ak008niinoBDzyKO4FqQPAUy2cNghR8qBOgeno+iuzAkpcxiJdOiDeMlX+vkqf3AglrR039RWxN3ADWlXhHPN4pLM4exU2FzusqlS7VlWNwAPuB/LFYnZZ2mPBXq/XtgERj9nN2YD5iIuwxPz1q1doWY/N0Mt+eJjFqkuXfdRv+8zSLUs3dl3E6auxPhJ3rtq9dqV6qmnZ6jPF+n6v/5Vd3XOmWWo3yq1vldPWxutm1hAG7rDvDlR6ZWkSy7ks9ykL7k19dtNVWPxV9y8oDkkj8RHjK4qvyH51908sAYjXbMBkM5ldXwA/iBw75QORoYMobKnAo6YdzR2NvfaA2UB0gzTLDeNsi7TcgXSzNdzd42DrEkesrUQk3WC+aYe26LyGUy5aSf9/p3/ierNORRo2rRL8sYAZT5TLMjw89Q4fK5YFEgSOU4Bkr7SC2dt65NuS6bn82EKL9VpwKY9LDt0Os5U9Uezh/gbWSjjBpth4J2PcAIOfwOoDV59Ja3Mp3WIXPFjhKEztJAoGPLBP7BHdgwMDyczzTzioZeVaaAHxLPtUo6G8Lk0D1bHxCnwqCMB9wa3pFCHc34svAKDsFY22+KYkx64DtAjEWmkmvQoRzhNeXqNhu8zDMLZK3hnie8FxL3dB9dNA/HlevagiTVpxq+966gj8OeHO+DbEJppMOZJmRH+S6CCKCTDKhlnGfNZk72I/8XKdFLxoCiScglKpImBeRKzMu71e88QkxRo8Zh2BBTKxd83kHpUhKGLZ9SEDo1QQM0PzzGn9gCPNgDodgxkbnGjFBBE+Ul1fsWB5bV7gvqjzSyCDGjLQYzEe/9MqG9b2OrQ/bRP5clbwiCSmII3TBuGtcVSmPyH4PUAMifwQgQQeEI2eRS2EQBFzbTpUewlgh91+f4KlWNguQ4Qny8xe4K2a21MKeqSlnn6l/UzhizZGWG9TNK1xeG9qoJjMFuYLIsZYNInH71DhsDKE5Fr8aep58xLqK+/Q2f1FkFyEB1pakIOoyOW49MyY2EaLFJLkK5MR5lmnl+OviFpNMJ8agGxzHI4w/HSrE84gSEcLrZpMQZc3UZHaNQHHfU3RPgn2/SWBGdF7IO6H6GGBMyCZpqFV3pcElYzDVyuMc1hq0OvIXVnwV8+qZf0tHZt6VwY0r9yY8xYWUtMEvbqHFIR/MkbWj/E4lkd4HBnegTT4oJokahPixVrQexbJ2RjdjSJh+W8fFiDD3RIHuoGcS5bFFdxbG5qGtl2kk7jTvtcjw+9sxsGwtLbVnYIh9TtyOrFdoF1LvaeruhwZaulAbCckuRzm4Tx+Kbou9/XPYlB9AwjCApTLiMc3qM15pHBEpzW3Q2PNpqXMDcgQA+GhBGW7BsB0q+IcJChFUuh6ktgpQ4Uxhi/FCplZJTC/GiNo376Fr6cikUhnoYB1msfAEEafzeucV/aB/pGBdKzTUPfivW7OPmRl6CInsIcWmAjZMpYrhkzmE/rE4YJg4xm+FM5zfENgQKsQcPoJXnwBxGMVDzNLo8yIUxjnYIXP75VCw4tfFMm7iyOP+JY46oaPIjh31RkO7pN0/u0Uv38QPlJ40rReVN7AJrZZoF0bqfgWgMu2nQLxqwrjTBoZWaQEwGgIFUpWpgGhmVaKNo10GKTCjMWq63XWDHbSsGJDKnH2GufbVOmHE9ThM720mg0yjY48UrLGiB6BXB/sWO1zxw4vnF/iCxd2KR3u4fykatLw4m8m8HwcDFkj1EzLlAIRujiCuAvjIUGy9KFEbz3BUlXIvg9KxfcWvimPdOWESpdlVas7j1GMb7CDL2QlOA2+BnDKODmPsSHZXp33ZFjQGO0OGLExp6Ya18EIfcH4/IMj8IQy/St1BMk8ikQ42a0gjzhIp+CkzIKEbBaaIwJwx6TqkxRrNdWUtnJtpLlyCN+GkMK3tReLOWe0kHLqE6jW+V8xAnohU7GOzzw4/bdO9QcELLdY7DSwqMSaxf4/J0hfHyr0N0FwigUJXHwxVQRjLsUkBE40m7SOkVIWERDiFSAWKkuFyXRlbE+3BAV5Slf18e9pzhdXyuL31GTb6kBFjVdfY/miQO4OMYTz6rdRrdqhWRTaJJAkwSaJNAkgSYJNEmgSQJNEmhQAv8Lix8k/gNx6O4AAAAASUVORK5CYII=`,PRt=e=>({conversationSettings:{openingRemark:e?.conversation_settings?.opening_remark,predefinedQuestions:e?.conversation_settings?.predefined_questions,commands:e?.conversation_settings?.commands?.map(e=>({id:e.id,name:e.name,alias:e.alias,icon:e.icon,components:e.components.map(e=>({type:e.type,name:e.name,key:e.key,placeholder:e.placeholder,default:e.default,required:e.required,fillBack:e.fill_back,fillRegx:e.fill_regx,rows:e.rows,min:e.min,max:e.max,options:e.options})),content:e.content,agentId:e.agent_id,status:e.status,supportUpload:e.support_upload})),enableChatSession:e?.conversation_settings?.enable_chat_session},promptSetting:e?.prompt_setting?{content:e.prompt_setting.content,supportUpload:e.prompt_setting.support_upload}:void 0,agentName:e?.agent_name,relatedSkills:e?.related_skills?.map(e=>({id:e.id,skill_name:e.skill_name,skill_code:e.skill_code,description:e.description,icon:e.icon})),chatGroup:e?.chat_group?{enabled:e.chat_group.enabled,staff:e.chat_group.staff,username:e.chat_group.username}:void 0,saasUrl:e?.saas_url,resources:e?.resources}),S9=function(e){return e.FlowAgent=`flow_agent`,e.KnowledgeRag=`knowledge_rag`,e.ReferenceDocument=`reference_document`,e}({}),C9=function(e){return e.Activity=`activity`,e.Assistant=`assistant`,e.Developer=`developer`,e.Guide=`guide`,e.Hidden=`hidden`,e.HiddenAssistant=`hidden-assistant`,e.HiddenGuide=`hidden-guide`,e.HiddenSystem=`hidden-system`,e.HiddenUser=`hidden-user`,e.Info=`info`,e.Pause=`pause`,e.Placeholder=`placeholder`,e.Reasoning=`reasoning`,e.System=`system`,e.TemplateAssistant=`template-assistant`,e.TemplateGuide=`template-guide`,e.TemplateHidden=`template-hidden`,e.TemplateSystem=`template-system`,e.TemplateUser=`template-user`,e.Tool=`tool`,e.User=`user`,e}({}),w9=function(e){return e.Complete=`complete`,e.Error=`error`,e.Pending=`pending`,e.Stop=`stop`,e.Streaming=`streaming`,e}({}),T9=function(e){return e.Binary=`binary`,e.Function=`function`,e.Text=`text`,e}({}),E9=e=>{let t={id:e.id,messageId:e.message_id,name:e.name,role:e.role,sessionCode:e.session_code,status:e.status};switch(e.role){case C9.Activity:{let n=e,r=e=>e.map(e=>({name:e.name,originFileUrl:e.origin_file_url,url:e.url})),i;switch(n.activity_type){case S9.ReferenceDocument:i=r(n.content);break;case S9.KnowledgeRag:{let e=n.content;i={content:e.content,referenceDocument:r(e.reference_document)};break}case S9.FlowAgent:default:i=n.content;break}return{...t,activityType:n.activity_type,content:i,role:n.role}}case C9.Assistant:{let n=e;return{...t,content:n.content,property:n.property,role:n.role,toolCalls:n.tool_calls?.map(e=>({function:{arguments:e.function.arguments,name:e.function.name,description:e.function.description,mcpName:e.function.mcp_name},id:e.id,type:e.type}))}}case C9.Developer:{let n=e;return{...t,content:n.content,role:n.role}}case C9.Guide:{let n=e;return{...t,content:n.content,role:n.role}}case C9.Hidden:{let n=e;return{...t,content:n.content,role:n.role}}case C9.HiddenAssistant:{let n=e;return{...t,content:n.content,role:n.role}}case C9.HiddenGuide:{let n=e;return{...t,content:n.content,role:n.role}}case C9.HiddenSystem:{let n=e;return{...t,content:n.content,role:n.role}}case C9.HiddenUser:{let n=e;return{...t,content:n.content,role:n.role}}case C9.Info:{let n=e;return{...t,content:n.content,role:n.role}}case C9.Pause:{let n=e;return{...t,content:n.content,role:n.role}}case C9.Placeholder:{let n=e;return{...t,content:n.content,role:n.role}}case C9.Reasoning:{let n=e;return{...t,content:n.content,duration:n.duration,role:n.role}}case C9.System:{let n=e;return{...t,content:n.content,role:n.role}}case C9.TemplateAssistant:{let n=e;return{...t,content:n.content,role:n.role}}case C9.TemplateGuide:{let n=e;return{...t,content:n.content,role:n.role}}case C9.TemplateHidden:{let n=e;return{...t,content:n.content,role:n.role}}case C9.TemplateSystem:{let n=e;return{...t,content:n.content,role:n.role}}case C9.TemplateUser:{let n=e;return{...t,content:n.content,role:n.role}}case C9.Tool:{let n=e;return{...t,content:n.content,duration:n.duration,error:n.error,role:n.role,toolCallId:n.tool_call_id}}case C9.User:{let n=e,r=n.content;return{...t,content:Array.isArray(r)?r.map(e=>{if(e.type===T9.Binary){let t=e;return{data:t.data,filename:t.filename,id:t.id,mimeType:t.mime_type,type:t.type,url:t.url}}return e}):r,property:n.property,role:n.role}}}},FRt=e=>{let t={id:e.id,message_id:e.messageId,name:e.name,role:e.role,session_code:e.sessionCode,status:e.status};switch(e.role){case C9.Activity:{let n=e,r=e=>e.map(e=>({name:e.name,origin_file_url:e.originFileUrl,url:e.url})),i;switch(n.activityType){case S9.ReferenceDocument:i=r(n.content);break;case S9.KnowledgeRag:{let e=n.content;i={content:e.content,reference_document:r(e.referenceDocument)};break}case S9.FlowAgent:default:i=n.content;break}return{...t,activity_type:n.activityType,content:i,role:n.role}}case C9.Assistant:{let n=e;return{...t,property:n.property,content:n.content,role:n.role,tool_calls:n.toolCalls?.map(e=>({function:{arguments:e.function.arguments,name:e.function.name,description:e.function.description,mcp_name:e.function.mcpName},id:e.id,type:e.type}))}}case C9.Developer:{let n=e;return{...t,content:n.content,role:n.role}}case C9.Guide:{let n=e;return{...t,content:n.content,role:n.role}}case C9.Hidden:{let n=e;return{...t,content:n.content,role:n.role}}case C9.HiddenAssistant:{let n=e;return{...t,content:n.content,role:n.role}}case C9.HiddenGuide:{let n=e;return{...t,content:n.content,role:n.role}}case C9.HiddenSystem:{let n=e;return{...t,content:n.content,role:n.role}}case C9.HiddenUser:{let n=e;return{...t,content:n.content,role:n.role}}case C9.Info:{let n=e;return{...t,content:n.content,role:n.role}}case C9.Pause:{let n=e;return{...t,content:n.content,role:n.role}}case C9.Placeholder:{let n=e;return{...t,content:n.content,role:n.role}}case C9.Reasoning:{let n=e;return{...t,content:n.content,duration:n.duration,role:n.role}}case C9.System:{let n=e;return{...t,content:n.content,role:n.role}}case C9.TemplateAssistant:{let n=e;return{...t,content:n.content,role:n.role}}case C9.TemplateGuide:{let n=e;return{...t,content:n.content,role:n.role}}case C9.TemplateHidden:{let n=e;return{...t,content:n.content,role:n.role}}case C9.TemplateSystem:{let n=e;return{...t,content:n.content,role:n.role}}case C9.TemplateUser:{let n=e;return{...t,content:n.content,role:n.role}}case C9.Tool:{let n=e;return{...t,content:n.content,duration:n.duration,error:n.error,role:n.role,tool_call_id:n.toolCallId}}case C9.User:{let n=e,r=n.content;return{...t,content:Array.isArray(r)?r.map(e=>{if(e.type===T9.Binary){let t=e;return{data:t.data,filename:t.filename,id:t.id,mime_type:t.mimeType,type:t.type,url:t.url}}return e}):r,property:n.property,role:n.role}}}},D9=e=>({sessionCode:e.session_code,sessionContentCount:e.session_content_count,sessionName:e.session_name,isTemporary:e.is_temporary,model:e.model,comment:e.comment,rate:e.rate,updatedAt:e.updated_at,createdAt:e.created_at,status:e.status,roleInfo:e.role_info?{collectionId:e.role_info.collection_id,collectionName:e.role_info.collection_name,content:e.role_info.content,variables:e.role_info.variables}:void 0,sessionProperty:{isAutoClear:e.session_property?.is_auto_clear,isAutoCalcPrompt:e.session_property?.is_auto_clac_prompt,labels:e.session_property?.labels}}),IRt=e=>({session_code:e.sessionCode,session_content_count:e.sessionContentCount,session_name:e.sessionName,is_temporary:e.isTemporary,model:e.model,comment:e.comment,rate:e.rate,updated_at:e.updatedAt,created_at:e.createdAt,status:e.status,role_info:e.roleInfo?{collection_id:e.roleInfo.collectionId,collection_name:e.roleInfo.collectionName,content:e.roleInfo.content,variables:e.roleInfo.variables}:void 0,session_property:{is_auto_clear:e.sessionProperty?.isAutoClear,is_auto_clac_prompt:e.sessionProperty?.isAutoCalcPrompt,labels:e.sessionProperty?.labels}}),LRt=e=>({session_code:e.sessionCode,session_content_ids:e.sessionContentIds,rate:e.rate,comment:e.comment,labels:e.labels}),RRt=e=>({sessionCode:e.session_code,sessionContentIds:e.session_content_ids,rate:e.rate,comment:e.comment,labels:e.lables}),zRt=()=>`temp_${Date.now()}_${Math.random().toString(36).slice(2,9)}`,BRt=e=>{let n=(0,t.ref)([]),r=(0,t.ref)(!1),i=(0,t.ref)(!1),a=t=>(r.value=!0,e.http?.message.getMessages(t).then(e=>{n.value=e}).finally(()=>{r.value=!1})),o=()=>p(n.value),s=e=>{n.value=n.value.map(t=>t.messageId===e.messageId?e:t)},l=e=>{n.value.push(e)},u=()=>n.value.findLast(e=>[w9.Pending,w9.Streaming].includes(e.status)),d=e=>n.value.find(t=>t.messageId===e),f=async t=>{let r=zRt(),i={...t,id:r,messageId:r};n.value.push(i);try{let i=await e.http?.message.plusMessage(t);if(i){let e=n.value.findIndex(e=>e.messageId===r);if(e!==-1){let r={...i,...`property`in t&&t.property?{property:t.property}:{}};n.value[e]=r}}}catch(e){let t=n.value.findIndex(e=>e.messageId===r);throw t!==-1&&(n.value[t]={...n.value[t],status:w9.Error}),e}},p=async t=>{let r=t.reduce((e,t)=>(t.role===C9.User&&e.push(t.id),e),[]);if(r.length<=0)return;let a=[...n.value];n.value=n.value.filter(e=>!t.includes(e)),i.value=!0;try{await e.http?.message.batchDeleteMessages(r)}catch(e){throw n.value=a,e}finally{i.value=!1}};return{list:n,isListLoading:r,isDeleteLoading:i,getMessages:a,clearMessages:o,getCurrentLoadingMessage:u,getMessageByMessageId:d,modifyMessage:s,plusMessage:l,createAndPlusMessage:f,deleteMessages:p,shareMessages:async(t,n,r)=>{let i=n.reduce((e,t)=>(t.role===C9.User&&e.push(t.id),e),[]);if(!(i.length<=0))return e.http?.message.shareMessages(t,i,r)},getFlowAgentTaskInfo:t=>e.http?.message.getFlowAgentTaskInfo(t),getFlowAgentTaskNodeInfo:(t,n)=>e.http?.message.getFlowAgentTaskNodeInfo(t,n),reset:()=>{n.value=[],r.value=!1,i.value=!1}}},O9=function(e){return e.FlowAgentEnd=`flow_agent_end`,e.FlowAgentResult=`flow_agent_result`,e.FlowAgentStart=`flow_agent_start`,e.KnowledgeRagEnd=`knowledge_rag_end`,e.KnowledgeRagResult=`knowledge_rag_result`,e.KnowledgeRagStart=`knowledge_rag_start`,e.KnowledgeRagTextContent=`knowledge_rag_text_content`,e.ReferenceDocument=`reference_document`,e.TempMessage=`temp_message`,e}({}),k9=function(e){return e.ActivityDelta=`ACTIVITY_DELTA`,e.ActivitySnapshot=`ACTIVITY_SNAPSHOT`,e.Custom=`CUSTOM`,e.MessagesSnapshot=`MESSAGES_SNAPSHOT`,e.Raw=`RAW`,e.RunError=`RUN_ERROR`,e.RunFinished=`RUN_FINISHED`,e.RunStarted=`RUN_STARTED`,e.StateDelta=`STATE_DELTA`,e.StateSnapshot=`STATE_SNAPSHOT`,e.StepFinished=`STEP_FINISHED`,e.StepStarted=`STEP_STARTED`,e.TextMessageChunk=`TEXT_MESSAGE_CHUNK`,e.TextMessageContent=`TEXT_MESSAGE_CONTENT`,e.TextMessageEnd=`TEXT_MESSAGE_END`,e.TextMessageStart=`TEXT_MESSAGE_START`,e.ThinkingEnd=`THINKING_END`,e.ThinkingStart=`THINKING_START`,e.ThinkingTextMessageContent=`THINKING_TEXT_MESSAGE_CONTENT`,e.ThinkingTextMessageEnd=`THINKING_TEXT_MESSAGE_END`,e.ThinkingTextMessageStart=`THINKING_TEXT_MESSAGE_START`,e.ToolCallArgs=`TOOL_CALL_ARGS`,e.ToolCallChunk=`TOOL_CALL_CHUNK`,e.ToolCallEnd=`TOOL_CALL_END`,e.ToolCallResult=`TOOL_CALL_RESULT`,e.ToolCallStart=`TOOL_CALL_START`,e}({}),VRt=function(e){return e.Blocked=`BLOCKED`,e.Created=`CREATED`,e.Failed=`FAILED`,e.Finished=`FINISHED`,e.LoopReady=`LOOP_READY`,e.Ready=`READY`,e.Revoked=`REVOKED`,e.RollBackFailed=`ROLL_BACK_FAILED`,e.RollBackSuccess=`ROLL_BACK_SUCCESS`,e.RollingBack=`ROLLING_BACK`,e.Running=`RUNNING`,e.Suspended=`SUSPENDED`,e}({}),A9=class{messageModule;onDoneCallback;onErrorCallback;onMessageCallback;onStartCallback;constructor(e){this.onDoneCallback=e?.onDone,this.onErrorCallback=e?.onError,this.onMessageCallback=e?.onMessage,this.onStartCallback=e?.onStart}handleActivityDeltaEvent(e){}handleActivitySnapshotEvent(e){}handleCustomEvent(e){switch(e.name){case O9.FlowAgentStart:this.handleFlowAgentStartCustomEvent(e);break;case O9.FlowAgentResult:this.handleFlowAgentResultCustomEvent(e);break;case O9.FlowAgentEnd:this.handleFlowAgentEndCustomEvent(e);break;case O9.ReferenceDocument:this.handleReferenceDocumentCustomEvent(e);break;case O9.KnowledgeRagStart:this.handleKnowledgeRagStartCustomEvent(e);break;case O9.KnowledgeRagTextContent:this.handleKnowledgeRagTextContentCustomEvent(e);break;case O9.KnowledgeRagResult:this.handleKnowledgeRagResultCustomEvent(e);break;case O9.KnowledgeRagEnd:this.handleKnowledgeRagEndCustomEvent(e);break;case O9.TempMessage:this.handleTempMessageCustomEvent(e);break;default:break}}handleFlowAgentEndCustomEvent(e){let t=this.messageModule.getCurrentLoadingMessage();if(t&&t.role===C9.Activity&&t.activityType===S9.FlowAgent){t.status=w9.Complete;let n=e.value;this.messageModule.plusMessage({role:C9.Assistant,content:n.map(e=>e.task_outputs.join(`
3486
3486
  `)).join(`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blueking/ai-blueking",
3
- "version": "2.1.4-beta.23",
3
+ "version": "2.1.4-beta.24",
4
4
  "description": "AI 小鲸 V2 - 基于新架构的智能对话组件",
5
5
  "license": "MIT",
6
6
  "author": "Tencent BlueKing",
@@ -66,8 +66,8 @@
66
66
  "tippy.js": "^6.3.7",
67
67
  "vue-draggable-resizable": "^3.0.0",
68
68
  "vue-tippy": "^6.7.1",
69
- "@blueking/chat-x": "0.0.43",
70
- "@blueking/chat-helper": "0.0.12-beta.1"
69
+ "@blueking/chat-helper": "0.0.12-beta.1",
70
+ "@blueking/chat-x": "0.0.45-beta.6"
71
71
  },
72
72
  "devDependencies": {
73
73
  "@types/node": "^25.0.1",