@blueking/ai-blueking 2.2.0-beta.1 → 2.2.0-beta.2

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.
@@ -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:()=>[]},sendDisabledTip:{},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&&[e5.Pending,e5.Streaming,e5.Fetching].includes(l.messageStatus)?l.messageStatus:l.modelValue?.length<1||Array.isArray(l.modelValue)&&!N7(l.modelValue).trim()?e5.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=f5(function*(){try{var e,t,n,r;if(l.sendDisabledTip)return;(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:Q8.Binary,url:e.url,mimeType:e.file?.type||``,filename:e.file?.name||``})),l.modelValue&&a.push({type:Q8.Text,text:N7(l.modelValue)})):a=typeof l.modelValue==`string`?l.modelValue:N7(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===e5.Disabled||l.sendDisabledTip||p.value===e5.Fetching||p.value===e5.Streaming||p.value===e5.Pending)return;m()}},g=function(){var e=f5(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=(GDt/(1024*1024)).toFixed(1),S=function(){var e=f5(function*(e){if(!l.supportUpload)return;if(d.value.length>=3){e.length>0&&ic({message:W8(e.length,x,J8),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:t9.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=t9.Success;return}s.status=t9.Error}).catch(()=>{s.status=t9.Error})}n>0&&ic({message:W8(n,x,J8),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)(RDt)})},[(0,t.renderSlot)(n.$slots,`top`),(0,t.renderSlot)(n.$slots,`interrupt`),(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)(pFt,{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)(i9,{files:d.value,onDeleteFile:C},null,8,[`files`])],512)):(0,t.createCommentVNode)(``,!0)]),(0,t.createVNode)(fIt,{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)(mIt,{"message-state":p.value,"send-disabled-tip":e.sendDisabledTip,"tippy-options":e.tippyOptions,onSendMessage:m,onStopSending:g},{default:(0,t.withCtx)(()=>{var r;return[e.supportUpload?((0,t.openBlock)(),(0,t.createBlock)(uFt,{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`,hIt)):(0,t.createCommentVNode)(``,!0),(0,t.renderSlot)(n.$slots,`attachment`,{},()=>[e.shortcuts&&!f.value?((0,t.openBlock)(),(0,t.createBlock)(ukt,{key:0,shortcuts:e.shortcuts,onSelectShortcut:v},null,8,[`shortcuts`])):(0,t.createCommentVNode)(``,!0),f.value?((0,t.openBlock)(),(0,t.createBlock)(p5,{key:1,class:`selected-shortcut-btn`,shortcut:f.value},{append:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(u5),{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`,`send-disabled-tip`,`tippy-options`])],4)],4))}}),_It={class:`chat-input-info-alert`},vIt={class:`chat-input-info-alert__text`},yIt=(0,t.defineComponent)({__name:`input-info-alert`,props:{content:{}},setup(e){return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,_It,[(0,t.createVNode)((0,t.unref)(MOt),{class:`chat-input-info-alert__icon`}),(0,t.createElementVNode)(`span`,vIt,(0,t.toDisplayString)(e.content),1)]))}}),a9=`others`,bIt=e=>e<26?String.fromCharCode(65+e):String(e+1),xIt=e=>{let n=(0,t.computed)(()=>{var t;return((t=e())==null||(t=t.metadata)==null?void 0:t.questions)??[]}),r=(0,t.shallowRef)({}),i=e=>r.value[e],a=(e,t)=>{r.value=$($({},r.value),{},{[e]:t})},o=(0,t.computed)(()=>n.value.length),s=(0,t.computed)(()=>n.value.reduce((e,t,n)=>e+ +!!r.value[n],0)),l=(0,t.computed)(()=>o.value>0&&s.value===o.value),u=()=>n.value.map((e,t)=>r.value[t]??{question:e.question,answer:[]});return{questions:n,answeredCount:s,totalCount:o,completed:l,getAnswer:i,setAnswer:a,buildResolvePayload:()=>({interruptId:e()?.id??``,reason:Z8.UserQuestion,status:`resolved`,payload:{answers:u()}}),buildSkipPayload:()=>SIt(e())}},SIt=e=>({interruptId:e?.id??``,reason:Z8.UserQuestion,status:`cancelled`,payload:{answers:[]}}),CIt={class:`ai-user-question-answered`},wIt={class:`ai-user-question-answered__header`},TIt={class:`ai-user-question-answered__title-wrap`},EIt={class:`ai-user-question-answered__title`},DIt={class:`ai-user-question-answered__status`},OIt={class:`ai-user-question-answered__body`},kIt={class:`ai-user-question-answered__question`},AIt={class:`ai-user-question-answered__question-text`},jIt={key:0,class:`ai-user-question-answered__tag`},MIt=(0,t.defineComponent)({__name:`user-question-answered-card`,props:{answers:{},status:{default:`resolved`}},setup(e){let n=e,r=(0,t.computed)(()=>n.status===`cancelled`?Y8(`已取消`):Y8(`已回复`));return(n,i)=>((0,t.openBlock)(),(0,t.createElementBlock)(`section`,CIt,[(0,t.createElementVNode)(`header`,wIt,[(0,t.createElementVNode)(`div`,TIt,[(0,t.createVNode)((0,t.unref)(jOt),{class:`ai-user-question-answered__help-icon`}),(0,t.createElementVNode)(`span`,EIt,(0,t.toDisplayString)((0,t.unref)(Y8)(`回答内容`)),1)]),(0,t.createElementVNode)(`span`,DIt,(0,t.toDisplayString)(r.value),1)]),(0,t.createElementVNode)(`div`,OIt,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.answers,(r,i)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:i,class:`ai-user-question-answered__item`},[(0,t.createElementVNode)(`div`,kIt,[(0,t.createElementVNode)(`span`,AIt,(0,t.toDisplayString)(i+1)+`. `+(0,t.toDisplayString)(r.question),1),r.multiSelect===void 0?(0,t.createCommentVNode)(``,!0):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,jIt,(0,t.toDisplayString)(r.multiSelect?(0,t.unref)(Y8)(`多选`):(0,t.unref)(Y8)(`单选`)),1))]),(0,t.renderSlot)(n.$slots,`answer`,(0,t.mergeProps)({ref_for:!0},{item:r,index:i,status:e.status}),()=>[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(r.answer,(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`p`,{key:n,class:`ai-user-question-answered__answer`},(0,t.toDisplayString)(e.description||e.label),1))),128))])]))),128))])]))}}),NIt={class:`ai-user-question-option__badge`},PIt=[`placeholder`,`value`],FIt={key:1,class:`ai-user-question-option__text`},IIt=(0,t.defineComponent)({__name:`user-question-option`,props:{option:{},othersText:{},selected:{type:Boolean}},emits:[`confirm`,`select`,`update:othersText`],setup(e,{emit:n}){let r=e,i=n,a=()=>{i(`select`)},o=()=>{r.selected||i(`select`)},s=e=>{let t=e.target.value;i(`update:othersText`,t),r.selected||i(`select`)};return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{class:(0,t.normalizeClass)([`ai-user-question-option`,{"ai-user-question-option--selected":e.selected,"ai-user-question-option--others":e.option.isOthers}]),onClick:a},[(0,t.createElementVNode)(`span`,NIt,(0,t.toDisplayString)(e.option.letter),1),e.option.isOthers?((0,t.openBlock)(),(0,t.createElementBlock)(`input`,{key:0,class:`ai-user-question-option__input`,placeholder:(0,t.unref)(Y8)(`请输入...`),value:e.othersText,onClick:r[0]||=(0,t.withModifiers)(()=>{},[`stop`]),onFocus:o,onInput:s,onKeydown:r[1]||=(0,t.withKeys)((0,t.withModifiers)(e=>i(`confirm`),[`stop`]),[`enter`])},null,40,PIt)):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,FIt,(0,t.toDisplayString)(e.option.description),1))],2))}}),LIt={class:`ai-user-question-choice`},RIt=(0,t.defineComponent)({__name:`user-question-choice`,props:{question:{}},emits:[`answer`,`confirm`],setup(e,{emit:n}){let r=e,i=n,a=(0,t.shallowRef)([]),o=(0,t.shallowRef)(``),s=(0,t.computed)(()=>{let e=(r.question.options??[]).filter(e=>e.label!==a9).map((e,t)=>$($({},e),{},{isOthers:!1,letter:bIt(t)}));return e.push({label:a9,description:``,isOthers:!0,letter:bIt(e.length)}),e}),l=(0,t.computed)(()=>s.value.findIndex(e=>e.isOthers)),u=e=>a.value.includes(e),d=(0,t.computed)(()=>a.value.length?l.value>=0&&a.value.includes(l.value)?o.value.trim().length>0:!0:!1),f=()=>({question:r.question.question,multiSelect:r.question.multiSelect,answer:a.value.map(e=>{let t=s.value[e];return t!=null&&t.isOthers?{label:a9,description:o.value.trim()}:{label:t?.label??``,description:t?.description??``}})}),p=()=>i(`answer`,d.value?f():void 0),m=e=>{let t=a.value;a.value=r.question.multiSelect?t.includes(e)?t.filter(t=>t!==e):[...t,e]:[e],p()},h=e=>{o.value=e,p()};return(0,t.watch)(()=>r.question,()=>{a.value=[],o.value=``,p()}),(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,LIt,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(s.value,(e,r)=>((0,t.openBlock)(),(0,t.createBlock)(IIt,{key:r,option:e,"others-text":o.value,selected:u(r),onConfirm:n[0]||=e=>i(`confirm`),onSelect:e=>m(r),"onUpdate:othersText":h},null,8,[`option`,`others-text`,`selected`,`onSelect`]))),128))]))}}),zIt={class:`ai-user-question-card__title-wrap`},BIt={class:`ai-user-question-card__title`},VIt={class:`ai-user-question-card__counter-wrap`},HIt={class:`ai-user-question-card__counter`},UIt={class:`ai-user-question-card__body`},WIt={class:`ai-user-question-card__question-title`},GIt={class:`ai-user-question-card__question-text`},KIt={key:0,class:`ai-user-question-card__tag`},qIt={class:`ai-user-question-card__options`},JIt={class:`ai-user-question-card__footer`},YIt=(0,t.defineComponent)({__name:`user-question-card`,props:{interrupt:{},onResume:{type:Function}},setup(e){let n=e,r=v5(),i=(0,t.shallowRef)(!1),{questions:a,answeredCount:o,totalCount:s,completed:l,getAnswer:u,setAnswer:d,buildResolvePayload:f,buildSkipPayload:p}=xIt(()=>n.interrupt),m=(0,t.computed)(()=>{var e;return((e=n.interrupt.metadata)==null||(e=e.questions)==null||(e=e[0])==null?void 0:e.header)||n.interrupt.message||``}),h=()=>{i.value=!i.value},g=()=>{i.value&&=!1},_=()=>{var e;l.value&&((e=n.onResume)==null||e.call(n,f(),n.interrupt))},v=()=>{var e;(e=n.onResume)==null||e.call(n,p(),n.interrupt)};return(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`section`,{class:(0,t.normalizeClass)([`ai-user-question-card`,{"ai-user-question-card--collapsed":i.value}])},[(0,t.createElementVNode)(`header`,{class:`ai-user-question-card__header`,onClick:g},[(0,t.createElementVNode)(`div`,zIt,[(0,t.createVNode)((0,t.unref)(jOt),{class:`ai-user-question-card__help-icon`}),(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createElementBlock)(`span`,BIt,[(0,t.createTextVNode)((0,t.toDisplayString)(m.value),1)])),[[(0,t.unref)(y5),$({},(0,t.unref)(r))]])]),(0,t.createElementVNode)(`div`,VIt,[(0,t.createElementVNode)(`span`,HIt,(0,t.toDisplayString)((0,t.unref)(o))+` / `+(0,t.toDisplayString)((0,t.unref)(s)),1),(0,t.createVNode)((0,t.unref)(vOt),{class:`ai-user-question-card__arrow`,style:(0,t.normalizeStyle)({transform:i.value?`rotate(180deg)`:`rotate(-90deg)`}),onClick:(0,t.withModifiers)(h,[`stop`])},null,8,[`style`])])]),(0,t.withDirectives)((0,t.createElementVNode)(`div`,UIt,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)((0,t.unref)(a),(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:r,class:`ai-user-question-card__question`},[(0,t.createElementVNode)(`div`,WIt,[(0,t.createElementVNode)(`span`,GIt,(0,t.toDisplayString)(r+1)+`. `+(0,t.toDisplayString)(n.question),1),n.multiSelect===void 0?(0,t.createCommentVNode)(``,!0):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,KIt,(0,t.toDisplayString)(n.multiSelect?(0,t.unref)(Y8)(`多选`):(0,t.unref)(Y8)(`单选`)),1))]),(0,t.createElementVNode)(`div`,qIt,[(0,t.renderSlot)(e.$slots,`question`,(0,t.mergeProps)({ref_for:!0},{question:n,qIndex:r,answer:(0,t.unref)(u)(r),setAnswer:e=>(0,t.unref)(d)(r,e),confirm:_}),()=>[(0,t.createVNode)(RIt,{question:n,onAnswer:e=>(0,t.unref)(d)(r,e),onConfirm:_},null,8,[`question`,`onAnswer`])])])]))),128))],512),[[t.vShow,!i.value]]),(0,t.withDirectives)((0,t.createElementVNode)(`footer`,JIt,[(0,t.createVNode)((0,t.unref)(Go),{class:`ai-user-question-card__complete`,disabled:!(0,t.unref)(l),size:`small`,theme:`primary`,onClick:_},{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(NOt),{class:`ai-user-question-card__enter-icon`}),(0,t.createTextVNode)(` `+(0,t.toDisplayString)((0,t.unref)(Y8)(`完成`)),1)]),_:1},8,[`disabled`]),(0,t.createVNode)((0,t.unref)(Go),{class:`ai-user-question-card__skip`,size:`small`,text:``,onClick:v},{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(POt),{class:`ai-user-question-card__skip-icon`}),(0,t.createTextVNode)(` `+(0,t.toDisplayString)((0,t.unref)(Y8)(`跳过`)),1)]),_:1})],512),[[t.vShow,!i.value]])],2))}}),XIt={class:`ai-delete-confirm`},ZIt={class:`ai-delete-confirm__title`},QIt={class:`ai-delete-confirm__desc`},$It={class:`ai-delete-confirm__actions`},eLt=(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=()=>{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)(Jl),(0,t.mergeProps)({ref_key:`tippyRef`,ref:a},s.value,{onShow:l}),{content:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,XIt,[(0,t.createElementVNode)(`div`,ZIt,(0,t.toDisplayString)((0,t.unref)(Y8)(`确认删除该回答?`)),1),(0,t.createElementVNode)(`div`,QIt,(0,t.toDisplayString)((0,t.unref)(Y8)(`删除操作无法撤回,请谨慎操作!`)),1),(0,t.createElementVNode)(`div`,$It,[(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)(Y8)(`删除`)),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)(Y8)(`取消`)),1)]),_:1})])])]),default:(0,t.withCtx)(()=>[(0,t.createVNode)(b5,(0,t.normalizeProps)((0,t.guardReactiveProps)(o.value)),null,16)]),_:1},16))}}),tLt={class:`ai-feedback-title`},nLt={class:`ai-feedback-reason-list`},rLt=[`onClick`],iLt={class:`ai-feedback-other`},aLt={class:`ai-feedback-footer`},oLt=(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`,tLt,(0,t.toDisplayString)(e.title),1),(0,t.createElementVNode)(`div`,nLt,[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,rLt))),128))]),(0,t.createElementVNode)(`div`,iLt,[(0,t.createVNode)((0,t.unref)(ns),{modelValue:i.value,"onUpdate:modelValue":r[0]||=e=>i.value=e,placeholder:(0,t.unref)(Y8)(`说出您的想法`),rows:3,type:`textarea`},null,8,[`modelValue`,`placeholder`])]),(0,t.createElementVNode)(`div`,aLt,[(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)(Y8)(`提交`)),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)(Y8)(`取消`)),1)]),_:1})])],32))}}),sLt={ref:`messageToolsRef`,class:`message-tools-container`},cLt={class:`message-tools`,style:{"margin-right":`8px`}},lLt={key:0,class:`ai-divider`,style:{"margin-right":`8px`}},uLt={class:`message-tools`},dLt=(0,t.defineComponent)({__name:`message-tools`,props:{messageTools:{default:()=>HDt},messageToolsStatus:{},onAction:{},tippyOptions:{},updateTools:{default:()=>WDt}},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=function(){var e=f5(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=f5(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`?Y8(`取消满意`):n===`activeUnLike`?Y8(`取消不满意`):((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===n9.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`,sLt,[(0,t.createElementVNode)(`div`,cLt,[((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)(eLt,(0,t.mergeProps)({key:0,ref_for:!0},n,{disabled:e.messageToolsStatus===(0,t.unref)(n9).Disabled,"tippy-options":e.tippyOptions,onConfirm:e=>f(n)}),null,16,[`disabled`,`tippy-options`,`onConfirm`])):((0,t.openBlock)(),(0,t.createBlock)(b5,(0,t.mergeProps)({key:1,ref_for:!0},n,{disabled:e.messageToolsStatus===(0,t.unref)(n9).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`,lLt)):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`div`,uLt,[((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)(Jl),(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)(oLt,{loading:o.value,"reason-list":s.value,title:n.id===`like`?(0,t.unref)(Y8)(`什么原因让你满意?`):(0,t.unref)(Y8)(`什么原因让你不满意?`),onCancel:p,onSubmit:(e,t)=>g(n,e,t)},null,8,[`loading`,`reason-list`,`title`,`onSubmit`])]),default:(0,t.withCtx)(()=>[(0,t.createVNode)(b5,(0,t.mergeProps)({ref_for:!0},n,{id:m(n.id),active:l.value===n.id,disabled:e.messageToolsStatus===(0,t.unref)(n9).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)(eLt,(0,t.mergeProps)({key:1,ref_for:!0},n,{disabled:e.messageToolsStatus===(0,t.unref)(n9).Disabled,"tippy-options":e.tippyOptions,onConfirm:e=>f(n)}),null,16,[`disabled`,`tippy-options`,`onConfirm`])):((0,t.openBlock)(),(0,t.createBlock)(b5,(0,t.mergeProps)({key:2,ref_for:!0},n,{disabled:e.messageToolsStatus===(0,t.unref)(n9).Disabled,"tippy-options":e.tippyOptions,onClick:e=>d(n)}),null,16,[`disabled`,`tippy-options`,`onClick`]))],64))),128))])],512))}}),o9=(0,t.defineComponent)({name:`HighlightKeyword`,props:{text:{type:String,required:!0}},setup(e){let n=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),r=Zkt(),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:KDt},e):e)});return()=>(0,t.h)(`span`,i.value)}}),fLt={class:`ai-activity-message`},pLt={class:`ai-activity-message-content`},s9=(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`,fLt,[(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)(Q8).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)(l5))],2))]),(0,t.withDirectives)((0,t.createElementVNode)(`div`,pLt,[(0,t.renderSlot)(r.$slots,`default`)],512),[[t.vShow,!n.value]])]))}}),c9=[{color:`#3A84FF`,icon:null,key:`running`,label:Y8(`执行中`),rawStates:[`CREATED`,`LOOP_READY`,`READY`,`RUNNING`,`BLOCKED`,`ROLLING_BACK`,`ROLL_BACK_SUCCESS`]},{color:`#65C389`,icon:aOt,key:`success`,label:Y8(`成功`),rawStates:[`FINISHED`]},{color:`#EA3636`,icon:oOt,key:`failed`,label:Y8(`失败`),rawStates:[`FAILED`,`REVOKED`,`ROLL_BACK_FAILED`]},{color:`#F59500`,icon:sOt,key:`suspended`,label:Y8(`挂起`),rawStates:[`SUSPENDED`]},{color:`#4D4F56`,dotColor:`#DCDEE5`,icon:cOt,key:`pending`,label:Y8(`待执行`),rawStates:[`PENDING`]},{color:`#5B7290`,icon:lOt,key:`skipped`,label:Y8(`跳过`),rawStates:[`SKIPPED`]}],l9=Object.fromEntries(c9.map(e=>[e.key,e])),mLt=Object.fromEntries(c9.flatMap(e=>e.rawStates.map(t=>[t,e.key]))),u9=e=>mLt[e]??`running`,hLt=e=>l9[e].dotColor??l9[e].color,gLt=e=>{let n=l9[e].icon;return n?(0,t.cloneVNode)(n):null},_Lt=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=u9(e.state);return{convergedState:t,dotColor:hLt(t),elapsedTimeText:FDt(e.elapsed_time),id:e.id,name:e.name,raw:e,retryable:!!e.retryable,skippable:!!e.skippable}}),n=t.reduce((e,t)=>e+t.raw.elapsed_time,0),r=u9(e.task_state??``);return{convergedState:r,hasConfidence:!!e.has_confidence,confidenceTitle:e.confidence_title,isActive:!!e.is_active,nodes:t,raw:e,stateIcon:gLt(r),taskId:e.task_id,taskName:e.task_name,totalTimeText:FDt(n)}})),visibleStats:(0,t.computed)(()=>{let e={};for(let t of c9)e[t.key]=0;for(let t of n.value)for(let[n,r]of Object.entries(t.statistics?.state_counts??{}))e[u9(n)]+=r;return c9.filter(t=>e[t.key]>0).map(t=>({color:t.color,display:e[t.key]>99?`99+`:String(e[t.key]),dotColor:hLt(t.key),key:t.key,label:t.label}))})}},vLt=[{icon:KOt,id:t5.FlowNodeRetry,label:()=>Y8(`重试`),visible:e=>e.convergedState===`failed`&&e.retryable},{icon:POt,id:t5.FlowNodeSkip,label:()=>Y8(`跳过`),visible:e=>e.convergedState===`failed`&&e.skippable}],yLt=e=>{let{onInterruptResume:t,openNodeDetail:n}=e,r=(e,n,r)=>{var i;(i=t.value)==null||i.call(t,{payload:{node_id:r.id,task_id:n.task_id},operation:e})};return{getNodeActions:(e,t)=>{let i=vLt.filter(e=>e.visible(t)).map(n=>({icon:n.icon,id:n.id,label:n.label(),run:()=>r(n.id,e.raw,t.raw)}));return i.push({icon:c5,id:`detail`,label:Y8(`详情`),run:()=>n(e.raw,t.raw)}),i}}},bLt={class:`ai-detail-section`},xLt={class:`section-heading`},SLt={class:`section-text`},d9=(0,t.defineComponent)({__name:`detail-section`,props:{title:{}},setup(e){return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,bLt,[(0,t.createElementVNode)(`div`,xLt,[r[0]||=(0,t.createElementVNode)(`span`,{class:`section-bar`},null,-1),(0,t.createElementVNode)(`span`,SLt,(0,t.toDisplayString)(e.title),1)]),(0,t.renderSlot)(n.$slots,`default`)]))}}),CLt={class:`ai-simple-table`},wLt={key:0},TLt=[`colspan`],f9=(0,t.defineComponent)({__name:`simple-table`,props:{columns:{},data:{}},setup(e){return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`table`,CLt,[(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`,wLt,[(0,t.createElementVNode)(`td`,{class:`is-empty`,colspan:e.columns.length},` -- `,8,TLt)]))])]))}}),ELt={class:`flow-agent-node-detail`},DLt={class:`detail-title`},OLt={key:1,class:`detail-title-content`},kLt={class:`detail-tab-bar`},ALt=[`onClick`],jLt={class:`detail-body`},MLt={class:`skeleton-section`},NLt={class:`skeleton-section`},PLt={class:`info-form`},FLt={class:`info-label`},ILt={class:`info-value`},LLt={class:`info-row`},RLt={class:`info-label`},zLt={class:`info-value`},BLt={key:0,class:`failure-item`},VLt={key:1,class:`failure-item`},HLt={class:`info-row`},ULt={class:`info-label`},WLt={class:`info-value`},GLt={key:0,class:`skeleton-section`},p9=function(e){return e.Config=`config`,e.Output=`output`,e}(p9||{}),KLt=(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:p9.Config,label:Y8(`节点配置`)},{key:p9.Output,label:Y8(`节点输出`)}],r=[{key:`key`,label:Y8(`参数名`)},{breakAll:!0,key:`value`,label:Y8(`参数值`)}],i=[{key:`name`,label:Y8(`名称`)},{key:`description`,label:Y8(`变量说明`)},{key:`key`,label:`KEY`}],a=[{key:`key`,label:Y8(`参数名`)},{breakAll:!0,key:`value`,label:Y8(`参数值`)}],o={forced_fail:J8?`Force Fail`:`强制失败`},s=e,l=(0,t.shallowRef)(p9.Config),u=(0,t.computed)(()=>s.data?.basic_info),d=(0,t.computed)(()=>{let e=u.value;return e?[{label:Y8(`流程模板`),value:e.template_name||`--`},{label:Y8(`节点名称`),value:e.node_name||`--`},{label:Y8(`步骤名称`),value:e.stage_name||`--`},{label:Y8(`是否可选`),value:e.optional?Y8(`是`):Y8(`否`)}]:[]}),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?J8?`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 J8?`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`,ELt,[(0,t.createElementVNode)(`h3`,DLt,[e.loading?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:0},[(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)((0,t.unref)(Y8)(`节点`))+`:`,1),s[0]||=(0,t.createElementVNode)(`span`,{class:`skeleton-title ai-skeleton-element`},null,-1)],64)):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,OLt,(0,t.toDisplayString)((0,t.unref)(Y8)(`节点`))+`:`+(0,t.toDisplayString)(u.value?.node_name),1)),(0,t.renderSlot)(o.$slots,`locateButton`)]),(0,t.createElementVNode)(`div`,kLt,[((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===p9.Config?(0,t.unref)(dOt):(0,t.unref)(c5)),{class:`detail-tab-icon`})),(0,t.createTextVNode)(` `+(0,t.toDisplayString)(e.label),1)],10,ALt)),64))]),(0,t.createElementVNode)(`div`,jLt,[l.value===p9.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`,MLt,[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`,NLt,[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)(d9,{title:(0,t.unref)(Y8)(`基础信息`)},{default:(0,t.withCtx)(()=>{var e,n,r;return[(0,t.createElementVNode)(`div`,PLt,[((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`,FLt,(0,t.toDisplayString)(e.label),1),(0,t.createElementVNode)(`div`,ILt,(0,t.toDisplayString)(e.value),1)]))),128)),(0,t.createElementVNode)(`div`,LLt,[(0,t.createElementVNode)(`div`,RLt,(0,t.toDisplayString)((0,t.unref)(Y8)(`失败处理`)),1),(0,t.createElementVNode)(`div`,zLt,[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`,BLt,[s[3]||=(0,t.createElementVNode)(`span`,{class:`tag-badge`},`MS`,-1),(0,t.createTextVNode)(` `+(0,t.toDisplayString)((0,t.unref)(Y8)(`手动跳过`))+(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`,VLt,[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`,HLt,[(0,t.createElementVNode)(`div`,ULt,(0,t.toDisplayString)((0,t.unref)(Y8)(`超时控制`)),1),(0,t.createElementVNode)(`div`,WLt,(0,t.toDisplayString)(m.value),1)])])]}),_:1},8,[`title`]),(0,t.createVNode)(d9,{title:(0,t.unref)(Y8)(`输入参数`)},{default:(0,t.withCtx)(()=>[(0,t.createVNode)(f9,{columns:r,data:h.value},null,8,[`data`])]),_:1},8,[`title`]),(0,t.createVNode)(d9,{title:(0,t.unref)(Y8)(`输出参数`)},{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`,GLt,[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)(d9,{key:1,title:(0,t.unref)(Y8)(`结构化输出`)},{default:(0,t.withCtx)(()=>[(0,t.createVNode)(f9,{columns:a,data:_.value},null,8,[`data`])]),_:1},8,[`title`]))],64))])]))}}),m9=e=>e.task_id==null?``:`${e.task_id}`,h9=m9,g9=(e,t)=>e.task_id==null?``:`${e.task_id}|${t.id}|${t.name}`,qLt=e=>{let{messageUid:n,taskList:r}=e,i=Akt(),a=Ekt(),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:m9(e)}),d=e=>{let t=u.value;return t===m9(e)||t===h9(e)},f=(e,t)=>u.value===g9(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:g9(e,t),data:{component:KLt,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:Y8(`有效证据`),name:h9(e),data:{component:KLt,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,m9(a)),(t=i.removeCustomTab)==null||t.call(i,h9(a));for(let e of Object.values(a.nodes??{})){var n;(n=i.removeCustomTab)==null||n.call(i,g9(a,e))}}}),{displaySelectedTabName:u,isNodeSelected:f,isTaskSelected:d,markUserTabSelection:l,openConfidence:m,openNodeDetail:p}},JLt={class:`ai-activity-message-title-text`},YLt={class:`flow-agent-title-label`},XLt={class:`flow-agent-stat-tooltip`},ZLt={class:`flow-agent-stat-tooltip-status`},QLt={class:`flow-agent-stat-tooltip-label`},$Lt=[`onClick`],eRt={class:`flow-agent-task-state-icon`},tRt={class:`flow-agent-task-name`},nRt={key:0,class:`flow-agent-task-trailing`},rRt={class:`flow-agent-task-time`},iRt=[`onClick`],aRt={class:`flow-agent-task-nodes`},oRt={class:`flow-agent-node-status`},sRt=[`title`],cRt={key:0,class:`flow-agent-node-trailing`},lRt={class:`flow-agent-node-time`},uRt={class:`flow-agent-node-actions`},dRt=[`onClick`],fRt=(0,t.defineComponent)({__name:`flow-agent-content`,props:(0,t.mergeModels)({content:{},messageUid:{},onInterruptResume:{type:Function},status:{}},{collapsed:$({type:Boolean},{default:!1}),collapsedModifiers:{}}),emits:[`update:collapsed`],setup(e){let n=e,r=v5(),i=(0,t.useModel)(e,`collapsed`),a=Ykt(),o=(0,t.computed)(()=>a.value!==n5.Share),s=(0,t.computed)(()=>n.status===e5.Pending||n.status===e5.Streaming),{isTaskExpanded:l,taskList:u,toggleTaskExpanded:d,viewTasks:f,visibleStats:p}=_Lt((0,t.toRef)(n,`content`)),{isNodeSelected:m,isTaskSelected:h,openConfidence:g,openNodeDetail:_}=qLt({messageUid:(0,t.toRef)(n,`messageUid`),taskList:u}),{getNodeActions:v}=yLt({onInterruptResume:(0,t.toRef)(n,`onInterruptResume`),openNodeDetail:_});return(e,n)=>((0,t.openBlock)(),(0,t.createBlock)(s9,{collapsed:i.value,"onUpdate:collapsed":n[0]||=e=>i.value=e,"activity-type":(0,t.unref)(Q8).FlowAgent,class:`flow-agent-activity`},{title:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(Jl),(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`,XLt,[((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`,ZLt,[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`,QLt,(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)(d5,{key:0,size:12})):((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(s5),{key:1}))],2),(0,t.createElementVNode)(`span`,JLt,[(0,t.createElementVNode)(`span`,YLt,(0,t.toDisplayString)((0,t.unref)(Y8)(`执行情况`))+`:`,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)}]),onClick:(0,t.withModifiers)(n=>(0,t.unref)(d)(e.raw),[`stop`])},[(0,t.createVNode)((0,t.unref)(s5))],10,$Lt),(0,t.createElementVNode)(`span`,eRt,[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`,tRt,[(0,t.createVNode)((0,t.unref)(o9),{text:e.taskName},null,8,[`text`])])),[[(0,t.unref)(y5),$({},(0,t.unref)(r))]]),o.value?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,nRt,[(0,t.createElementVNode)(`span`,rRt,(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)(c5)),(0,t.createTextVNode)(` `+(0,t.toDisplayString)(e.confidenceTitle??(0,t.unref)(Y8)(`有效证据`)),1)],8,iRt)):(0,t.createCommentVNode)(``,!0)])):(0,t.createCommentVNode)(``,!0)],2),(0,t.withDirectives)((0,t.createElementVNode)(`div`,aRt,[((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`,oRt,[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)(o9),{text:n.name},null,8,[`text`])],8,sRt)),[[(0,t.unref)(y5),$({},(0,t.unref)(r))]]),o.value?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,cRt,[(0,t.createElementVNode)(`span`,lRt,(0,t.toDisplayString)(n.elapsedTimeText),1),(0,t.createElementVNode)(`span`,uRt,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)((0,t.unref)(v)(e,n),e=>((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:e.id,class:`flow-agent-node-action-btn`,onClick:(0,t.withModifiers)(t=>e.run(),[`stop`])},[((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(e.icon))),(0,t.createTextVNode)(` `+(0,t.toDisplayString)(e.label),1)],8,dRt))),128))])])):(0,t.createCommentVNode)(``,!0)],2))),128))],512),[[t.vShow,(0,t.unref)(l)(e.raw)]])]))),128))]),_:1},8,[`collapsed`,`activity-type`]))}}),pRt={class:`ai-activity-message-title-icon`},mRt={class:`ai-activity-message-title-text`},hRt={class:`knowledge-rag-content`},gRt=(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===e5.Pending||n.status===e5.Streaming),a=(0,t.computed)(()=>i.value?Y8(`检索中`):Y8(`检索完成`));return(n,o)=>((0,t.openBlock)(),(0,t.createBlock)(s9,{collapsed:r.value,"onUpdate:collapsed":o[0]||=e=>r.value=e},{title:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`span`,pRt,[i.value?((0,t.openBlock)(),(0,t.createBlock)(d5,{key:0})):((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(o5),{key:1,style:{"font-size":`12px`}}))]),(0,t.createElementVNode)(`span`,mRt,(0,t.toDisplayString)(a.value),1)]),default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,hRt,[(0,t.createVNode)(D7,{content:e.content?.content||``},null,8,[`content`])]),(0,t.createVNode)(O7,{content:e.content?.referenceDocument||[]},null,8,[`content`])]),_:1},8,[`collapsed`]))}}),_Rt={class:`ai-activity-message-title-icon`},vRt={class:`ai-activity-message-title-text`},yRt=(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 J8?`Reference ${e} documents as reference`:`引用 ${e} 篇资料作为参考`});return(n,a)=>((0,t.openBlock)(),(0,t.createBlock)(s9,{collapsed:r.value,"onUpdate:collapsed":a[0]||=e=>r.value=e},{title:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`span`,_Rt,[(0,t.createVNode)((0,t.unref)(o5),{style:{"font-size":`12px`}})]),(0,t.createElementVNode)(`span`,vRt,(0,t.toDisplayString)(i.value),1)]),default:(0,t.withCtx)(()=>[(0,t.createVNode)(O7,{content:e.content||[]},null,8,[`content`])]),_:1},8,[`collapsed`]))}}),bRt=(0,t.defineComponent)({__name:`activity-message`,props:(0,t.mergeModels)({activityType:{},content:{},id:{},messageId:{},name:{},role:{},status:{},uid:{},property:{},onInterruptResume:{type:Function}},{collapsed:$({type:Boolean},{default:!1}),collapsedModifiers:{}}),emits:[`update:collapsed`],setup(e){let n={[Q8.FlowAgent]:fRt,[Q8.KnowledgeRag]:gRt,[Q8.ReferenceDocument]:yRt},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,"on-interrupt-resume":e.onInterruptResume,status:e.status},null,40,[`collapsed`,`content`,`message-uid`,`on-interrupt-resume`,`status`])):(0,t.createCommentVNode)(``,!0)}}),xRt={class:`toolcall-desc`},SRt={class:`desc-title`},CRt={class:`desc-panel`},wRt={class:`desc-label`},TRt={class:`desc-value`},_9=(0,t.defineComponent)({__name:`desc-panel`,props:{desc:{},title:{}},setup(e){let n=e,r=e=>e==null?``:typeof e==`object`?JSON.stringify(e):String(e),i=(0,t.computed)(()=>{try{return JSON.parse(n.desc||``)}catch{return n.desc}});return(n,a)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,xRt,[(0,t.createElementVNode)(`div`,SRt,(0,t.toDisplayString)(e.title),1),(0,t.createElementVNode)(`div`,CRt,[i.value!==null&&typeof i.value==`object`?((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,{key:0},(0,t.renderList)(i.value,(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:n,class:`desc-panel-item`},[(0,t.createElementVNode)(`span`,wRt,[(0,t.createVNode)((0,t.unref)(o9),{text:String(n)},null,8,[`text`]),a[0]||=(0,t.createTextVNode)(`:`,-1)]),(0,t.createElementVNode)(`span`,TRt,[(0,t.createVNode)((0,t.unref)(o9),{style:{"word-break":`break-all`},text:r(e)},null,8,[`text`])])]))),128)):((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(o9),{key:1,style:{wordBreak:`break-all`},text:r(i.value)},null,8,[`text`]))])]))}}),ERt={class:`tool-message`},DRt=(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`,ERt,[(0,t.createVNode)(_9,{desc:e.content||(typeof e.error==`string`?e.error:void 0),title:(0,t.unref)(Y8)(`返回内容`)},null,8,[`desc`,`title`])]))}}),ORt={class:`ai-toolcall-render`},kRt={class:`toolcall-header-title`},ARt={class:`toolcall-status-title`},jRt={key:1,class:`toolcall-duration`},MRt={class:`ai-toolcall-render-content`},NRt=(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=v5(),{keywordMatched:o,keyword:s}=Qkt(()=>[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 e5.Pending:return Y8(`调用中`);case e5.Complete:case e5.Success:return Y8(`调用成功`);case e5.Error||((e=n.toolCall)==null||(e=e.toolMessage)==null?void 0:e.error):return Y8(`调用失败`)}}),p=(0,t.computed)(()=>{var e;let t=n.duration||((e=n.toolCall)==null||(e=e.toolMessage)==null?void 0:e.duration);return t?PDt(t):``});return(n,r)=>{var i,o;return(0,t.openBlock)(),(0,t.createElementBlock)(`div`,ORt,[(0,t.createElementVNode)(`div`,{class:(0,t.normalizeClass)([`ai-toolcall-render-header`,`toolcall-status-${e.status}`]),onClick:u},[(0,t.createVNode)((0,t.unref)(s5),{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)(Y8)(`调用 MCP:`):(0,t.unref)(Y8)(`调用工具:`))+` `,1),(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createElementBlock)(`span`,kRt,[(0,t.createVNode)((0,t.unref)(o9),{text:d.value},null,8,[`text`])])),[[(0,t.unref)(y5),$($({},(0,t.unref)(a)),{},{text:d.value,appendTo:`parent`})]]),(0,t.createElementVNode)(`span`,ARt,[e.status===(0,t.unref)(e5).Pending||e.status===(0,t.unref)(e5).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)(o9),{text:f.value},null,8,[`text`]),p.value?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,jRt,` (`+(0,t.toDisplayString)(p.value)+`) `,1)):(0,t.createCommentVNode)(``,!0)])],2),(0,t.withDirectives)((0,t.createElementVNode)(`div`,MRt,[(0,t.createVNode)(_9,{desc:e.toolCall?.function.description,title:(0,t.unref)(Y8)(`描述`)},null,8,[`desc`,`title`]),(0,t.createVNode)(_9,{desc:e.toolCall?.function.arguments,title:(0,t.unref)(Y8)(`参数`)},null,8,[`desc`,`title`]),(o=e.toolCall)!=null&&o.toolMessage?((0,t.openBlock)(),(0,t.createBlock)(DRt,(0,t.normalizeProps)((0,t.mergeProps)({key:0},e.toolCall.toolMessage)),null,16)):(0,t.createCommentVNode)(``,!0)],512),[[t.vShow,!l.value]])])}}}),PRt={class:`ai-assistant-message`},FRt={class:`ai-assistant-message-content`},IRt=(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`,PRt,[(0,t.createElementVNode)(`div`,FRt,[(0,t.renderSlot)(n.$slots,`default`,(0,t.normalizeProps)((0,t.guardReactiveProps)({content:e.content})),()=>[(0,t.createVNode)(k7,{content:e.content||``,status:e.status,type:(0,t.unref)(Q8).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)(NRt,{key:n.id,status:e.status,"tool-call":n},null,8,[`status`,`tool-call`]))),128)):(0,t.createCommentVNode)(``,!0)]))}}),LRt={class:`info-message`},RRt=(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`,LRt,[((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))]))}}),zRt={class:`ai-tool-approval-card`},BRt={class:`ai-tool-approval-card__header`},VRt={class:`ai-tool-approval-card__title-wrap`},HRt={class:`ai-tool-approval-card__title`},URt={class:`ai-tool-approval-card__fields`},WRt={class:`ai-tool-approval-card__field`},GRt={class:`ai-tool-approval-card__field`},KRt={class:`ai-tool-approval-card__processor`},qRt={class:`ai-tool-approval-card__processor-text`},JRt={class:`ai-tool-approval-card__actions`},YRt=(0,t.defineComponent)({__name:`tool-approval-card`,props:{interrupt:{},onInterruptResume:{type:Function},readonly:{type:Boolean}},setup(e){let n=e,r=v5(),{copy:i}=h5(),a=new Set([X8.PENDING,X8.DRAFT]),o=new Set([X8.ABANDONED,X8.CANCELLED,X8.EXPIRED,X8.REJECTED]),s=(0,t.computed)(()=>n.interrupt.metadata?.ticket??{approvers:[],sn:``,status:X8.PENDING,submit_time:``,title:``,url:``}),l=(0,t.computed)(()=>a.has(s.value.status)),u=(0,t.computed)(()=>l.value?`pending`:s.value.status),d=(0,t.computed)(()=>l.value?Y8(`评审中`):LDt[s.value.status]??s.value.status),f=(0,t.computed)(()=>s.value.approvers.filter(Boolean).join(`、`)||Y8(`无`)),p=(0,t.computed)(()=>s.value.url||s.value.sn),m=()=>{s.value.url&&window.open(s.value.url,`_blank`,`noopener`)},h=()=>{p.value&&i(p.value)},g=()=>{var e;(e=n.onInterruptResume)==null||e.call(n,{operation:t5.ApprovalCancel,payload:{interrupt_id:n.interrupt.id}},n.interrupt)};return(n,i)=>((0,t.openBlock)(),(0,t.createElementBlock)(`section`,zRt,[(0,t.createElementVNode)(`header`,BRt,[(0,t.createElementVNode)(`div`,VRt,[i[0]||=(0,t.createElementVNode)(`span`,{class:`ai-tool-approval-card__title-bar`},null,-1),(0,t.createElementVNode)(`span`,HRt,(0,t.toDisplayString)(s.value.title||(0,t.unref)(Y8)(`算法方案评审单`)),1),(0,t.withDirectives)((0,t.createVNode)((0,t.unref)(WOt),{class:(0,t.normalizeClass)([`ai-tool-approval-card__copy-icon`,{"is-disabled":!p.value}]),onClick:h},null,8,[`class`]),[[(0,t.unref)(Xl),$($({},(0,t.unref)(r)),{},{content:(0,t.unref)(Y8)(`复制单据链接`),theme:`ai-chat-box`,offset:[0,8]})]])]),(0,t.createElementVNode)(`span`,{class:(0,t.normalizeClass)([`ai-tool-approval-card__status`,`ai-tool-approval-card__status--${u.value}`])},[s.value.status===(0,t.unref)(X8).APPROVED?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(DOt),{key:0,class:`ai-tool-approval-card__status-icon`})):(0,t.unref)(o).has(s.value.status)?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(kOt),{key:1,class:`ai-tool-approval-card__status-icon`})):s.value.status===(0,t.unref)(X8).REVOKED?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(AOt),{key:2,class:(0,t.normalizeClass)([`ai-tool-approval-card__status-icon`,{"ai-tool-approval-card__status-icon--revoked":s.value.status===(0,t.unref)(X8).REVOKED}])},null,8,[`class`])):((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(Lo),{key:3,class:`ai-tool-approval-card__status-icon`,mode:`spin`,size:`mini`,theme:`primary`})),(0,t.createTextVNode)(` `+(0,t.toDisplayString)(d.value),1)],2)]),(0,t.createElementVNode)(`dl`,URt,[(0,t.createElementVNode)(`div`,WRt,[(0,t.createElementVNode)(`dt`,null,(0,t.toDisplayString)((0,t.unref)(Y8)(`单据编号`)),1),(0,t.createElementVNode)(`dd`,null,(0,t.toDisplayString)(s.value.sn||`--`),1)]),(0,t.createElementVNode)(`div`,GRt,[(0,t.createElementVNode)(`dt`,null,(0,t.toDisplayString)((0,t.unref)(Y8)(`提交时间`)),1),(0,t.createElementVNode)(`dd`,null,(0,t.toDisplayString)(s.value.submit_time||`--`),1)])]),(0,t.createElementVNode)(`div`,KRt,[(0,t.createVNode)((0,t.unref)(OOt),{class:`ai-tool-approval-card__processor-icon`}),(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createElementBlock)(`span`,qRt,[(0,t.createTextVNode)((0,t.toDisplayString)((0,t.unref)(Y8)(`当前处理人`))+`:`+(0,t.toDisplayString)(f.value),1)])),[[(0,t.unref)(y5),$({},(0,t.unref)(r))]])]),(0,t.createElementVNode)(`div`,JRt,[(0,t.createVNode)((0,t.unref)(Go),{class:`ai-tool-approval-card__detail`,disabled:!s.value.url,theme:`primary`,onClick:m},{default:(0,t.withCtx)(()=>[(0,t.createTextVNode)((0,t.toDisplayString)((0,t.unref)(Y8)(`查看单据详情`))+` `,1),i[1]||=(0,t.createElementVNode)(`span`,{class:`ai-tool-approval-card__detail-icon`},null,-1)]),_:1},8,[`disabled`]),l.value&&!e.readonly?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(Go),{key:0,class:`ai-tool-approval-card__cancel`,outline:``,theme:`primary`,onClick:g},{default:(0,t.withCtx)(()=>[(0,t.createTextVNode)((0,t.toDisplayString)((0,t.unref)(Y8)(`取消审批`)),1)]),_:1})):(0,t.createCommentVNode)(``,!0)])]))}}),XRt={class:`ai-interrupt-message`},ZRt={key:0,class:`ai-interrupt-message__content`},QRt={key:1,class:`ai-interrupt-message__fallback`},$Rt=(0,t.defineComponent)({__name:`interrupt-message`,props:{content:{},id:{},messageId:{},name:{},role:{},status:{},uid:{},property:{},onInterruptResume:{type:Function}},setup(e){let n={[Z8.AIDevToolApproval]:YRt},r=e=>({id:e.interruptId||e.id||``,reason:Z8.AIDevToolApproval,toolCallId:``,metadata:e.payload.metadata}),i={[Z8.AIDevToolApproval]:e=>({component:YRt,props:{interrupt:r(e),readonly:!0}}),[Z8.UserQuestion]:e=>({component:MIt,props:{answers:e.payload?.answers??[],status:e.status}})},a=new Set([Z8.UserQuestion]),o=e,s=(0,t.computed)(()=>{var e;return((e=o.content)==null||(e=e.outcome)==null?void 0:e.type)===`interrupt`?o.content.outcome.interrupts:[]}),l=(0,t.computed)(()=>o.content?.message),u=e=>n[e.reason],d=e=>a.has(e.reason),f=(0,t.computed)(()=>{var e;if(((e=o.content)==null||(e=e.outcome)==null?void 0:e.type)!==`success`)return;let t=o.content?.result;if(t)return i[t.reason]?.call(i,t)});return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,XRt,[l.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,ZRt,(0,t.toDisplayString)(l.value),1)):(0,t.createCommentVNode)(``,!0),((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(s.value,n=>((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:n.toolCallId},[u(n)?((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(u(n)),{key:0,interrupt:n,"on-interrupt-resume":e.onInterruptResume},null,40,[`interrupt`,`on-interrupt-resume`])):d(n)?(0,t.createCommentVNode)(``,!0):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,QRt,(0,t.toDisplayString)(n.message||(0,t.unref)(Y8)(`暂不支持的中断消息`)),1))],64))),128)),f.value?((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(f.value.component),(0,t.normalizeProps)((0,t.mergeProps)({key:1},f.value.props)),(0,t.createSlots)({_:2},[n.$slots.answeredQuestion?{name:`answer`,fn:(0,t.withCtx)(e=>[(0,t.renderSlot)(n.$slots,`answeredQuestion`,(0,t.normalizeProps)((0,t.guardReactiveProps)(e)))]),key:`0`}:void 0]),1040)):(0,t.createCommentVNode)(``,!0)]))}}),ezt={class:`ai-loading-message`},tzt=(0,t.defineComponent)({__name:`loading-message`,setup(e){return(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,ezt,[(0,t.createVNode)(d5,{size:18}),(0,t.renderSlot)(e.$slots,`default`,{},()=>[(0,t.createTextVNode)((0,t.toDisplayString)((0,t.unref)(Y8)(`请求中...`)),1)])]))}}),nzt={class:`ai-reasoning-message`},rzt={key:0,class:`ai-reasoning-message-title-icon`},izt={class:`ai-reasoning-message-title-text`},azt={class:`ai-reasoning-message-content`},ozt=(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,function(){var e=f5(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 e5.Pending:return Y8(`思考中`);case e5.Success:case e5.Complete:return Y8(`已思考完成`)+(n.duration?` (${Y8(`耗时`)} :${PDt(n.duration)})`:``);case e5.Error:return Y8(`思考失败`);default:return Y8(`思考中`)}});return(n,i)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,nzt,[(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)(e5).Pending||e.status===(0,t.unref)(e5).Streaming,"is-complete":e.status===(0,t.unref)(e5).Complete||e.status===(0,t.unref)(e5).Success,"is-error":e.status===(0,t.unref)(e5).Error}]),onClick:i[0]||=e=>r.value=!r.value},[e.status===(0,t.unref)(e5).Pending||e.status===(0,t.unref)(e5).Streaming?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,rzt,[(0,t.createVNode)(d5)])):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`span`,izt,(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)(l5))],2)],2),(0,t.withDirectives)((0,t.createElementVNode)(`div`,azt,[e.status===(0,t.unref)(e5).Error?((0,t.openBlock)(),(0,t.createBlock)(qNt,{key:0,content:e.content?.join(`
3483
+ 通过 Shift + Enter 进行换行输入`},prompts:{default:()=>[]},resources:{default:()=>[]},sendDisabledTip:{},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&&[e5.Pending,e5.Streaming,e5.Fetching].includes(l.messageStatus)?l.messageStatus:l.modelValue?.length<1||Array.isArray(l.modelValue)&&!N7(l.modelValue).trim()?e5.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=f5(function*(){try{var e,t,n,r;if(l.sendDisabledTip)return;(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:Q8.Binary,url:e.url,mimeType:e.file?.type||``,filename:e.file?.name||``})),l.modelValue&&a.push({type:Q8.Text,text:N7(l.modelValue)})):a=typeof l.modelValue==`string`?l.modelValue:N7(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===e5.Disabled||l.sendDisabledTip||p.value===e5.Fetching||p.value===e5.Streaming||p.value===e5.Pending)return;m()}},g=function(){var e=f5(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=(GDt/(1024*1024)).toFixed(1),S=function(){var e=f5(function*(e){if(!l.supportUpload)return;if(d.value.length>=3){e.length>0&&ic({message:W8(e.length,x,J8),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:t9.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=t9.Success;return}s.status=t9.Error}).catch(()=>{s.status=t9.Error})}n>0&&ic({message:W8(n,x,J8),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)(RDt)})},[(0,t.renderSlot)(n.$slots,`top`),(0,t.renderSlot)(n.$slots,`interrupt`),(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)(pFt,{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)(i9,{files:d.value,onDeleteFile:C},null,8,[`files`])],512)):(0,t.createCommentVNode)(``,!0)]),(0,t.createVNode)(fIt,{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)(mIt,{"message-state":p.value,"send-disabled-tip":e.sendDisabledTip,"tippy-options":e.tippyOptions,onSendMessage:m,onStopSending:g},{default:(0,t.withCtx)(()=>{var r;return[e.supportUpload?((0,t.openBlock)(),(0,t.createBlock)(uFt,{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`,hIt)):(0,t.createCommentVNode)(``,!0),(0,t.renderSlot)(n.$slots,`attachment`,{},()=>[e.shortcuts&&!f.value?((0,t.openBlock)(),(0,t.createBlock)(ukt,{key:0,shortcuts:e.shortcuts,onSelectShortcut:v},null,8,[`shortcuts`])):(0,t.createCommentVNode)(``,!0),f.value?((0,t.openBlock)(),(0,t.createBlock)(p5,{key:1,class:`selected-shortcut-btn`,shortcut:f.value},{append:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(u5),{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`,`send-disabled-tip`,`tippy-options`])],4)],4))}}),_It={class:`chat-input-info-alert`},vIt={class:`chat-input-info-alert__text`},yIt=(0,t.defineComponent)({__name:`input-info-alert`,props:{content:{}},setup(e){return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,_It,[(0,t.createVNode)((0,t.unref)(MOt),{class:`chat-input-info-alert__icon`}),(0,t.createElementVNode)(`span`,vIt,(0,t.toDisplayString)(e.content),1)]))}}),a9=`others`,bIt=e=>e<26?String.fromCharCode(65+e):String(e+1),xIt=e=>{let n=(0,t.computed)(()=>{var t;return((t=e())==null||(t=t.metadata)==null?void 0:t.questions)??[]}),r=(0,t.shallowRef)({}),i=e=>r.value[e],a=(e,t)=>{r.value=$($({},r.value),{},{[e]:t})},o=(0,t.computed)(()=>n.value.length),s=(0,t.computed)(()=>n.value.reduce((e,t,n)=>e+ +!!r.value[n],0)),l=(0,t.computed)(()=>o.value>0&&s.value===o.value),u=()=>n.value.map((e,t)=>r.value[t]??{question:e.question,answer:[]});return{questions:n,answeredCount:s,totalCount:o,completed:l,getAnswer:i,setAnswer:a,buildResolvePayload:()=>({interruptId:e()?.id??``,reason:Z8.UserQuestion,status:`resolved`,payload:{answers:u()}}),buildSkipPayload:()=>SIt(e())}},SIt=e=>({interruptId:e?.id??``,reason:Z8.UserQuestion,status:`cancelled`,payload:{answers:[]}}),CIt={class:`ai-user-question-answered`},wIt={class:`ai-user-question-answered__header`},TIt={class:`ai-user-question-answered__title-wrap`},EIt={class:`ai-user-question-answered__title`},DIt={class:`ai-user-question-answered__status`},OIt={class:`ai-user-question-answered__body`},kIt={class:`ai-user-question-answered__question`},AIt={class:`ai-user-question-answered__question-text`},jIt={key:0,class:`ai-user-question-answered__tag`},MIt=(0,t.defineComponent)({__name:`user-question-answered-card`,props:{answers:{},status:{default:`resolved`}},setup(e){let n=e,r=(0,t.computed)(()=>n.status===`cancelled`?Y8(`已取消`):Y8(`已回复`));return(n,i)=>((0,t.openBlock)(),(0,t.createElementBlock)(`section`,CIt,[(0,t.createElementVNode)(`header`,wIt,[(0,t.createElementVNode)(`div`,TIt,[(0,t.createVNode)((0,t.unref)(jOt),{class:`ai-user-question-answered__help-icon`}),(0,t.createElementVNode)(`span`,EIt,(0,t.toDisplayString)((0,t.unref)(Y8)(`回答内容`)),1)]),(0,t.createElementVNode)(`span`,DIt,(0,t.toDisplayString)(r.value),1)]),(0,t.createElementVNode)(`div`,OIt,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.answers,(r,i)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:i,class:`ai-user-question-answered__item`},[(0,t.createElementVNode)(`div`,kIt,[(0,t.createElementVNode)(`span`,AIt,(0,t.toDisplayString)(i+1)+`. `+(0,t.toDisplayString)(r.question),1),r.multiSelect===void 0?(0,t.createCommentVNode)(``,!0):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,jIt,(0,t.toDisplayString)(r.multiSelect?(0,t.unref)(Y8)(`多选`):(0,t.unref)(Y8)(`单选`)),1))]),(0,t.renderSlot)(n.$slots,`answer`,(0,t.mergeProps)({ref_for:!0},{item:r,index:i,status:e.status}),()=>[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(r.answer,(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`p`,{key:n,class:`ai-user-question-answered__answer`},(0,t.toDisplayString)(e.description||e.label),1))),128))])]))),128))])]))}}),NIt={class:`ai-user-question-option__badge`},PIt=[`placeholder`,`value`],FIt={key:1,class:`ai-user-question-option__text`},IIt=(0,t.defineComponent)({__name:`user-question-option`,props:{option:{},othersText:{},selected:{type:Boolean}},emits:[`confirm`,`select`,`update:othersText`],setup(e,{emit:n}){let r=e,i=n,a=()=>{i(`select`)},o=()=>{r.selected||i(`select`)},s=e=>{let t=e.target.value;i(`update:othersText`,t),r.selected||i(`select`)};return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{class:(0,t.normalizeClass)([`ai-user-question-option`,{"ai-user-question-option--selected":e.selected,"ai-user-question-option--others":e.option.isOthers}]),onClick:a},[(0,t.createElementVNode)(`span`,NIt,(0,t.toDisplayString)(e.option.letter),1),e.option.isOthers?((0,t.openBlock)(),(0,t.createElementBlock)(`input`,{key:0,class:`ai-user-question-option__input`,placeholder:(0,t.unref)(Y8)(`请输入...`),value:e.othersText,onClick:r[0]||=(0,t.withModifiers)(()=>{},[`stop`]),onFocus:o,onInput:s,onKeydown:r[1]||=(0,t.withKeys)((0,t.withModifiers)(e=>i(`confirm`),[`stop`]),[`enter`])},null,40,PIt)):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,FIt,(0,t.toDisplayString)(e.option.description),1))],2))}}),LIt={class:`ai-user-question-choice`},RIt=(0,t.defineComponent)({__name:`user-question-choice`,props:{question:{}},emits:[`answer`,`confirm`],setup(e,{emit:n}){let r=e,i=n,a=(0,t.shallowRef)([]),o=(0,t.shallowRef)(``),s=(0,t.computed)(()=>{let e=(r.question.options??[]).filter(e=>e.label!==a9).map((e,t)=>$($({},e),{},{isOthers:!1,letter:bIt(t)}));return e.push({label:a9,description:``,isOthers:!0,letter:bIt(e.length)}),e}),l=(0,t.computed)(()=>s.value.findIndex(e=>e.isOthers)),u=e=>a.value.includes(e),d=(0,t.computed)(()=>a.value.length?l.value>=0&&a.value.includes(l.value)?o.value.trim().length>0:!0:!1),f=()=>({question:r.question.question,multiSelect:r.question.multiSelect,answer:a.value.map(e=>{let t=s.value[e];return t!=null&&t.isOthers?{label:a9,description:o.value.trim()}:{label:t?.label??``,description:t?.description??``}})}),p=()=>i(`answer`,d.value?f():void 0),m=e=>{let t=a.value;a.value=r.question.multiSelect?t.includes(e)?t.filter(t=>t!==e):[...t,e]:[e],p()},h=e=>{o.value=e,p()};return(0,t.watch)(()=>r.question,()=>{a.value=[],o.value=``,p()}),(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,LIt,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(s.value,(e,r)=>((0,t.openBlock)(),(0,t.createBlock)(IIt,{key:r,option:e,"others-text":o.value,selected:u(r),onConfirm:n[0]||=e=>i(`confirm`),onSelect:e=>m(r),"onUpdate:othersText":h},null,8,[`option`,`others-text`,`selected`,`onSelect`]))),128))]))}}),zIt={class:`ai-user-question-card__title-wrap`},BIt={class:`ai-user-question-card__title`},VIt={class:`ai-user-question-card__counter-wrap`},HIt={class:`ai-user-question-card__counter`},UIt={class:`ai-user-question-card__body`},WIt={class:`ai-user-question-card__question-title`},GIt={class:`ai-user-question-card__question-text`},KIt={key:0,class:`ai-user-question-card__tag`},qIt={class:`ai-user-question-card__options`},JIt={class:`ai-user-question-card__footer`},YIt=(0,t.defineComponent)({__name:`user-question-card`,props:{interrupt:{},onResume:{type:Function}},setup(e){let n=e,r=v5(),i=(0,t.shallowRef)(!1),{questions:a,answeredCount:o,totalCount:s,completed:l,getAnswer:u,setAnswer:d,buildResolvePayload:f,buildSkipPayload:p}=xIt(()=>n.interrupt),m=(0,t.computed)(()=>{var e;return((e=n.interrupt.metadata)==null||(e=e.questions)==null||(e=e[0])==null?void 0:e.header)||n.interrupt.message||``}),h=()=>{i.value=!i.value},g=()=>{i.value&&=!1},_=(0,t.shallowRef)(null),v=()=>{var e;!l.value||_.value!==null||(_.value=`complete`,(e=n.onResume)==null||e.call(n,f(),n.interrupt))},y=()=>{var e;_.value===null&&(_.value=`skip`,(e=n.onResume)==null||e.call(n,p(),n.interrupt))};return(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`section`,{class:(0,t.normalizeClass)([`ai-user-question-card`,{"ai-user-question-card--collapsed":i.value}])},[(0,t.createElementVNode)(`header`,{class:`ai-user-question-card__header`,onClick:g},[(0,t.createElementVNode)(`div`,zIt,[(0,t.createVNode)((0,t.unref)(jOt),{class:`ai-user-question-card__help-icon`}),(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createElementBlock)(`span`,BIt,[(0,t.createTextVNode)((0,t.toDisplayString)(m.value),1)])),[[(0,t.unref)(y5),$({},(0,t.unref)(r))]])]),(0,t.createElementVNode)(`div`,VIt,[(0,t.createElementVNode)(`span`,HIt,(0,t.toDisplayString)((0,t.unref)(o))+` / `+(0,t.toDisplayString)((0,t.unref)(s)),1),(0,t.createVNode)((0,t.unref)(vOt),{class:`ai-user-question-card__arrow`,style:(0,t.normalizeStyle)({transform:i.value?`rotate(180deg)`:`rotate(-90deg)`}),onClick:(0,t.withModifiers)(h,[`stop`])},null,8,[`style`])])]),(0,t.withDirectives)((0,t.createElementVNode)(`div`,UIt,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)((0,t.unref)(a),(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:r,class:`ai-user-question-card__question`},[(0,t.createElementVNode)(`div`,WIt,[(0,t.createElementVNode)(`span`,GIt,(0,t.toDisplayString)(r+1)+`. `+(0,t.toDisplayString)(n.question),1),n.multiSelect===void 0?(0,t.createCommentVNode)(``,!0):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,KIt,(0,t.toDisplayString)(n.multiSelect?(0,t.unref)(Y8)(`多选`):(0,t.unref)(Y8)(`单选`)),1))]),(0,t.createElementVNode)(`div`,qIt,[(0,t.renderSlot)(e.$slots,`question`,(0,t.mergeProps)({ref_for:!0},{question:n,qIndex:r,answer:(0,t.unref)(u)(r),setAnswer:e=>(0,t.unref)(d)(r,e),confirm:v}),()=>[(0,t.createVNode)(RIt,{question:n,onAnswer:e=>(0,t.unref)(d)(r,e),onConfirm:v},null,8,[`question`,`onAnswer`])])])]))),128))],512),[[t.vShow,!i.value]]),(0,t.withDirectives)((0,t.createElementVNode)(`footer`,JIt,[(0,t.createVNode)((0,t.unref)(Go),{class:`ai-user-question-card__complete`,disabled:!(0,t.unref)(l)||_.value===`skip`,loading:_.value===`complete`,size:`small`,theme:`primary`,onClick:v},{default:(0,t.withCtx)(()=>[_.value===`complete`?(0,t.createCommentVNode)(``,!0):((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(NOt),{key:0,class:`ai-user-question-card__enter-icon`})),(0,t.createTextVNode)(` `+(0,t.toDisplayString)((0,t.unref)(Y8)(`完成`)),1)]),_:1},8,[`disabled`,`loading`]),(0,t.createVNode)((0,t.unref)(Go),{class:`ai-user-question-card__skip`,disabled:_.value===`complete`,loading:_.value===`skip`,size:`small`,text:``,onClick:y},{default:(0,t.withCtx)(()=>[_.value===`skip`?(0,t.createCommentVNode)(``,!0):((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(POt),{key:0,class:`ai-user-question-card__skip-icon`})),(0,t.createTextVNode)(` `+(0,t.toDisplayString)((0,t.unref)(Y8)(`跳过`)),1)]),_:1},8,[`disabled`,`loading`])],512),[[t.vShow,!i.value]])],2))}}),XIt={class:`ai-delete-confirm`},ZIt={class:`ai-delete-confirm__title`},QIt={class:`ai-delete-confirm__desc`},$It={class:`ai-delete-confirm__actions`},eLt=(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=()=>{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)(Jl),(0,t.mergeProps)({ref_key:`tippyRef`,ref:a},s.value,{onShow:l}),{content:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,XIt,[(0,t.createElementVNode)(`div`,ZIt,(0,t.toDisplayString)((0,t.unref)(Y8)(`确认删除该回答?`)),1),(0,t.createElementVNode)(`div`,QIt,(0,t.toDisplayString)((0,t.unref)(Y8)(`删除操作无法撤回,请谨慎操作!`)),1),(0,t.createElementVNode)(`div`,$It,[(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)(Y8)(`删除`)),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)(Y8)(`取消`)),1)]),_:1})])])]),default:(0,t.withCtx)(()=>[(0,t.createVNode)(b5,(0,t.normalizeProps)((0,t.guardReactiveProps)(o.value)),null,16)]),_:1},16))}}),tLt={class:`ai-feedback-title`},nLt={class:`ai-feedback-reason-list`},rLt=[`onClick`],iLt={class:`ai-feedback-other`},aLt={class:`ai-feedback-footer`},oLt=(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`,tLt,(0,t.toDisplayString)(e.title),1),(0,t.createElementVNode)(`div`,nLt,[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,rLt))),128))]),(0,t.createElementVNode)(`div`,iLt,[(0,t.createVNode)((0,t.unref)(ns),{modelValue:i.value,"onUpdate:modelValue":r[0]||=e=>i.value=e,placeholder:(0,t.unref)(Y8)(`说出您的想法`),rows:3,type:`textarea`},null,8,[`modelValue`,`placeholder`])]),(0,t.createElementVNode)(`div`,aLt,[(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)(Y8)(`提交`)),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)(Y8)(`取消`)),1)]),_:1})])],32))}}),sLt={ref:`messageToolsRef`,class:`message-tools-container`},cLt={class:`message-tools`,style:{"margin-right":`8px`}},lLt={key:0,class:`ai-divider`,style:{"margin-right":`8px`}},uLt={class:`message-tools`},dLt=(0,t.defineComponent)({__name:`message-tools`,props:{messageTools:{default:()=>HDt},messageToolsStatus:{},onAction:{},tippyOptions:{},updateTools:{default:()=>WDt}},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=function(){var e=f5(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=f5(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`?Y8(`取消满意`):n===`activeUnLike`?Y8(`取消不满意`):((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===n9.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`,sLt,[(0,t.createElementVNode)(`div`,cLt,[((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)(eLt,(0,t.mergeProps)({key:0,ref_for:!0},n,{disabled:e.messageToolsStatus===(0,t.unref)(n9).Disabled,"tippy-options":e.tippyOptions,onConfirm:e=>f(n)}),null,16,[`disabled`,`tippy-options`,`onConfirm`])):((0,t.openBlock)(),(0,t.createBlock)(b5,(0,t.mergeProps)({key:1,ref_for:!0},n,{disabled:e.messageToolsStatus===(0,t.unref)(n9).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`,lLt)):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`div`,uLt,[((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)(Jl),(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)(oLt,{loading:o.value,"reason-list":s.value,title:n.id===`like`?(0,t.unref)(Y8)(`什么原因让你满意?`):(0,t.unref)(Y8)(`什么原因让你不满意?`),onCancel:p,onSubmit:(e,t)=>g(n,e,t)},null,8,[`loading`,`reason-list`,`title`,`onSubmit`])]),default:(0,t.withCtx)(()=>[(0,t.createVNode)(b5,(0,t.mergeProps)({ref_for:!0},n,{id:m(n.id),active:l.value===n.id,disabled:e.messageToolsStatus===(0,t.unref)(n9).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)(eLt,(0,t.mergeProps)({key:1,ref_for:!0},n,{disabled:e.messageToolsStatus===(0,t.unref)(n9).Disabled,"tippy-options":e.tippyOptions,onConfirm:e=>f(n)}),null,16,[`disabled`,`tippy-options`,`onConfirm`])):((0,t.openBlock)(),(0,t.createBlock)(b5,(0,t.mergeProps)({key:2,ref_for:!0},n,{disabled:e.messageToolsStatus===(0,t.unref)(n9).Disabled,"tippy-options":e.tippyOptions,onClick:e=>d(n)}),null,16,[`disabled`,`tippy-options`,`onClick`]))],64))),128))])],512))}}),o9=(0,t.defineComponent)({name:`HighlightKeyword`,props:{text:{type:String,required:!0}},setup(e){let n=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),r=Zkt(),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:KDt},e):e)});return()=>(0,t.h)(`span`,i.value)}}),fLt={class:`ai-activity-message`},pLt={class:`ai-activity-message-content`},s9=(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`,fLt,[(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)(Q8).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)(l5))],2))]),(0,t.withDirectives)((0,t.createElementVNode)(`div`,pLt,[(0,t.renderSlot)(r.$slots,`default`)],512),[[t.vShow,!n.value]])]))}}),c9=[{color:`#3A84FF`,icon:null,key:`running`,label:Y8(`执行中`),rawStates:[`CREATED`,`LOOP_READY`,`READY`,`RUNNING`,`BLOCKED`,`ROLLING_BACK`,`ROLL_BACK_SUCCESS`]},{color:`#65C389`,icon:aOt,key:`success`,label:Y8(`成功`),rawStates:[`FINISHED`]},{color:`#EA3636`,icon:oOt,key:`failed`,label:Y8(`失败`),rawStates:[`FAILED`,`REVOKED`,`ROLL_BACK_FAILED`]},{color:`#F59500`,icon:sOt,key:`suspended`,label:Y8(`挂起`),rawStates:[`SUSPENDED`]},{color:`#4D4F56`,dotColor:`#DCDEE5`,icon:cOt,key:`pending`,label:Y8(`待执行`),rawStates:[`PENDING`]},{color:`#5B7290`,icon:lOt,key:`skipped`,label:Y8(`跳过`),rawStates:[`SKIPPED`]}],l9=Object.fromEntries(c9.map(e=>[e.key,e])),mLt=Object.fromEntries(c9.flatMap(e=>e.rawStates.map(t=>[t,e.key]))),u9=e=>mLt[e]??`running`,hLt=e=>l9[e].dotColor??l9[e].color,gLt=e=>{let n=l9[e].icon;return n?(0,t.cloneVNode)(n):null},_Lt=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=u9(e.state);return{convergedState:t,dotColor:hLt(t),elapsedTimeText:FDt(e.elapsed_time),id:e.id,name:e.name,raw:e,retryable:!!e.retryable,skippable:!!e.skippable}}),n=t.reduce((e,t)=>e+t.raw.elapsed_time,0),r=u9(e.task_state??``);return{convergedState:r,hasConfidence:!!e.has_confidence,confidenceTitle:e.confidence_title,isActive:!!e.is_active,nodes:t,raw:e,stateIcon:gLt(r),taskId:e.task_id,taskName:e.task_name,totalTimeText:FDt(n)}})),visibleStats:(0,t.computed)(()=>{let e={};for(let t of c9)e[t.key]=0;for(let t of n.value)for(let[n,r]of Object.entries(t.statistics?.state_counts??{}))e[u9(n)]+=r;return c9.filter(t=>e[t.key]>0).map(t=>({color:t.color,display:e[t.key]>99?`99+`:String(e[t.key]),dotColor:hLt(t.key),key:t.key,label:t.label}))})}},vLt=[{icon:KOt,id:t5.FlowNodeRetry,label:()=>Y8(`重试`),visible:e=>e.convergedState===`failed`&&e.retryable},{icon:POt,id:t5.FlowNodeSkip,label:()=>Y8(`跳过`),visible:e=>e.convergedState===`failed`&&e.skippable}],yLt=e=>{let{onInterruptResume:t,openNodeDetail:n}=e,r=(e,n,r)=>{var i;(i=t.value)==null||i.call(t,{payload:{node_id:r.id,task_id:n.task_id},operation:e})};return{getNodeActions:(e,t)=>{let i=vLt.filter(e=>e.visible(t)).map(n=>({icon:n.icon,id:n.id,label:n.label(),run:()=>r(n.id,e.raw,t.raw)}));return i.push({icon:c5,id:`detail`,label:Y8(`详情`),run:()=>n(e.raw,t.raw)}),i}}},bLt={class:`ai-detail-section`},xLt={class:`section-heading`},SLt={class:`section-text`},d9=(0,t.defineComponent)({__name:`detail-section`,props:{title:{}},setup(e){return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,bLt,[(0,t.createElementVNode)(`div`,xLt,[r[0]||=(0,t.createElementVNode)(`span`,{class:`section-bar`},null,-1),(0,t.createElementVNode)(`span`,SLt,(0,t.toDisplayString)(e.title),1)]),(0,t.renderSlot)(n.$slots,`default`)]))}}),CLt={class:`ai-simple-table`},wLt={key:0},TLt=[`colspan`],f9=(0,t.defineComponent)({__name:`simple-table`,props:{columns:{},data:{}},setup(e){return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`table`,CLt,[(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`,wLt,[(0,t.createElementVNode)(`td`,{class:`is-empty`,colspan:e.columns.length},` -- `,8,TLt)]))])]))}}),ELt={class:`flow-agent-node-detail`},DLt={class:`detail-title`},OLt={key:1,class:`detail-title-content`},kLt={class:`detail-tab-bar`},ALt=[`onClick`],jLt={class:`detail-body`},MLt={class:`skeleton-section`},NLt={class:`skeleton-section`},PLt={class:`info-form`},FLt={class:`info-label`},ILt={class:`info-value`},LLt={class:`info-row`},RLt={class:`info-label`},zLt={class:`info-value`},BLt={key:0,class:`failure-item`},VLt={key:1,class:`failure-item`},HLt={class:`info-row`},ULt={class:`info-label`},WLt={class:`info-value`},GLt={key:0,class:`skeleton-section`},p9=function(e){return e.Config=`config`,e.Output=`output`,e}(p9||{}),KLt=(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:p9.Config,label:Y8(`节点配置`)},{key:p9.Output,label:Y8(`节点输出`)}],r=[{key:`key`,label:Y8(`参数名`)},{breakAll:!0,key:`value`,label:Y8(`参数值`)}],i=[{key:`name`,label:Y8(`名称`)},{key:`description`,label:Y8(`变量说明`)},{key:`key`,label:`KEY`}],a=[{key:`key`,label:Y8(`参数名`)},{breakAll:!0,key:`value`,label:Y8(`参数值`)}],o={forced_fail:J8?`Force Fail`:`强制失败`},s=e,l=(0,t.shallowRef)(p9.Config),u=(0,t.computed)(()=>s.data?.basic_info),d=(0,t.computed)(()=>{let e=u.value;return e?[{label:Y8(`流程模板`),value:e.template_name||`--`},{label:Y8(`节点名称`),value:e.node_name||`--`},{label:Y8(`步骤名称`),value:e.stage_name||`--`},{label:Y8(`是否可选`),value:e.optional?Y8(`是`):Y8(`否`)}]:[]}),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?J8?`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 J8?`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`,ELt,[(0,t.createElementVNode)(`h3`,DLt,[e.loading?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:0},[(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)((0,t.unref)(Y8)(`节点`))+`:`,1),s[0]||=(0,t.createElementVNode)(`span`,{class:`skeleton-title ai-skeleton-element`},null,-1)],64)):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,OLt,(0,t.toDisplayString)((0,t.unref)(Y8)(`节点`))+`:`+(0,t.toDisplayString)(u.value?.node_name),1)),(0,t.renderSlot)(o.$slots,`locateButton`)]),(0,t.createElementVNode)(`div`,kLt,[((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===p9.Config?(0,t.unref)(dOt):(0,t.unref)(c5)),{class:`detail-tab-icon`})),(0,t.createTextVNode)(` `+(0,t.toDisplayString)(e.label),1)],10,ALt)),64))]),(0,t.createElementVNode)(`div`,jLt,[l.value===p9.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`,MLt,[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`,NLt,[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)(d9,{title:(0,t.unref)(Y8)(`基础信息`)},{default:(0,t.withCtx)(()=>{var e,n,r;return[(0,t.createElementVNode)(`div`,PLt,[((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`,FLt,(0,t.toDisplayString)(e.label),1),(0,t.createElementVNode)(`div`,ILt,(0,t.toDisplayString)(e.value),1)]))),128)),(0,t.createElementVNode)(`div`,LLt,[(0,t.createElementVNode)(`div`,RLt,(0,t.toDisplayString)((0,t.unref)(Y8)(`失败处理`)),1),(0,t.createElementVNode)(`div`,zLt,[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`,BLt,[s[3]||=(0,t.createElementVNode)(`span`,{class:`tag-badge`},`MS`,-1),(0,t.createTextVNode)(` `+(0,t.toDisplayString)((0,t.unref)(Y8)(`手动跳过`))+(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`,VLt,[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`,HLt,[(0,t.createElementVNode)(`div`,ULt,(0,t.toDisplayString)((0,t.unref)(Y8)(`超时控制`)),1),(0,t.createElementVNode)(`div`,WLt,(0,t.toDisplayString)(m.value),1)])])]}),_:1},8,[`title`]),(0,t.createVNode)(d9,{title:(0,t.unref)(Y8)(`输入参数`)},{default:(0,t.withCtx)(()=>[(0,t.createVNode)(f9,{columns:r,data:h.value},null,8,[`data`])]),_:1},8,[`title`]),(0,t.createVNode)(d9,{title:(0,t.unref)(Y8)(`输出参数`)},{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`,GLt,[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)(d9,{key:1,title:(0,t.unref)(Y8)(`结构化输出`)},{default:(0,t.withCtx)(()=>[(0,t.createVNode)(f9,{columns:a,data:_.value},null,8,[`data`])]),_:1},8,[`title`]))],64))])]))}}),m9=e=>e.task_id==null?``:`${e.task_id}`,h9=m9,g9=(e,t)=>e.task_id==null?``:`${e.task_id}|${t.id}|${t.name}`,qLt=e=>{let{messageUid:n,taskList:r}=e,i=Akt(),a=Ekt(),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:m9(e)}),d=e=>{let t=u.value;return t===m9(e)||t===h9(e)},f=(e,t)=>u.value===g9(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:g9(e,t),data:{component:KLt,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:Y8(`有效证据`),name:h9(e),data:{component:KLt,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,m9(a)),(t=i.removeCustomTab)==null||t.call(i,h9(a));for(let e of Object.values(a.nodes??{})){var n;(n=i.removeCustomTab)==null||n.call(i,g9(a,e))}}}),{displaySelectedTabName:u,isNodeSelected:f,isTaskSelected:d,markUserTabSelection:l,openConfidence:m,openNodeDetail:p}},JLt={class:`ai-activity-message-title-text`},YLt={class:`flow-agent-title-label`},XLt={class:`flow-agent-stat-tooltip`},ZLt={class:`flow-agent-stat-tooltip-status`},QLt={class:`flow-agent-stat-tooltip-label`},$Lt=[`onClick`],eRt={class:`flow-agent-task-state-icon`},tRt={class:`flow-agent-task-name`},nRt={key:0,class:`flow-agent-task-trailing`},rRt={class:`flow-agent-task-time`},iRt=[`onClick`],aRt={class:`flow-agent-task-nodes`},oRt={class:`flow-agent-node-status`},sRt=[`title`],cRt={key:0,class:`flow-agent-node-trailing`},lRt={class:`flow-agent-node-time`},uRt={class:`flow-agent-node-actions`},dRt=[`onClick`],fRt=(0,t.defineComponent)({__name:`flow-agent-content`,props:(0,t.mergeModels)({content:{},messageUid:{},onInterruptResume:{type:Function},status:{}},{collapsed:$({type:Boolean},{default:!1}),collapsedModifiers:{}}),emits:[`update:collapsed`],setup(e){let n=e,r=v5(),i=(0,t.useModel)(e,`collapsed`),a=Ykt(),o=(0,t.computed)(()=>a.value!==n5.Share),s=(0,t.computed)(()=>n.status===e5.Pending||n.status===e5.Streaming),{isTaskExpanded:l,taskList:u,toggleTaskExpanded:d,viewTasks:f,visibleStats:p}=_Lt((0,t.toRef)(n,`content`)),{isNodeSelected:m,isTaskSelected:h,openConfidence:g,openNodeDetail:_}=qLt({messageUid:(0,t.toRef)(n,`messageUid`),taskList:u}),{getNodeActions:v}=yLt({onInterruptResume:(0,t.toRef)(n,`onInterruptResume`),openNodeDetail:_});return(e,n)=>((0,t.openBlock)(),(0,t.createBlock)(s9,{collapsed:i.value,"onUpdate:collapsed":n[0]||=e=>i.value=e,"activity-type":(0,t.unref)(Q8).FlowAgent,class:`flow-agent-activity`},{title:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(Jl),(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`,XLt,[((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`,ZLt,[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`,QLt,(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)(d5,{key:0,size:12})):((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(s5),{key:1}))],2),(0,t.createElementVNode)(`span`,JLt,[(0,t.createElementVNode)(`span`,YLt,(0,t.toDisplayString)((0,t.unref)(Y8)(`执行情况`))+`:`,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)}]),onClick:(0,t.withModifiers)(n=>(0,t.unref)(d)(e.raw),[`stop`])},[(0,t.createVNode)((0,t.unref)(s5))],10,$Lt),(0,t.createElementVNode)(`span`,eRt,[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`,tRt,[(0,t.createVNode)((0,t.unref)(o9),{text:e.taskName},null,8,[`text`])])),[[(0,t.unref)(y5),$({},(0,t.unref)(r))]]),o.value?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,nRt,[(0,t.createElementVNode)(`span`,rRt,(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)(c5)),(0,t.createTextVNode)(` `+(0,t.toDisplayString)(e.confidenceTitle??(0,t.unref)(Y8)(`有效证据`)),1)],8,iRt)):(0,t.createCommentVNode)(``,!0)])):(0,t.createCommentVNode)(``,!0)],2),(0,t.withDirectives)((0,t.createElementVNode)(`div`,aRt,[((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`,oRt,[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)(o9),{text:n.name},null,8,[`text`])],8,sRt)),[[(0,t.unref)(y5),$({},(0,t.unref)(r))]]),o.value?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,cRt,[(0,t.createElementVNode)(`span`,lRt,(0,t.toDisplayString)(n.elapsedTimeText),1),(0,t.createElementVNode)(`span`,uRt,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)((0,t.unref)(v)(e,n),e=>((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:e.id,class:`flow-agent-node-action-btn`,onClick:(0,t.withModifiers)(t=>e.run(),[`stop`])},[((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(e.icon))),(0,t.createTextVNode)(` `+(0,t.toDisplayString)(e.label),1)],8,dRt))),128))])])):(0,t.createCommentVNode)(``,!0)],2))),128))],512),[[t.vShow,(0,t.unref)(l)(e.raw)]])]))),128))]),_:1},8,[`collapsed`,`activity-type`]))}}),pRt={class:`ai-activity-message-title-icon`},mRt={class:`ai-activity-message-title-text`},hRt={class:`knowledge-rag-content`},gRt=(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===e5.Pending||n.status===e5.Streaming),a=(0,t.computed)(()=>i.value?Y8(`检索中`):Y8(`检索完成`));return(n,o)=>((0,t.openBlock)(),(0,t.createBlock)(s9,{collapsed:r.value,"onUpdate:collapsed":o[0]||=e=>r.value=e},{title:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`span`,pRt,[i.value?((0,t.openBlock)(),(0,t.createBlock)(d5,{key:0})):((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(o5),{key:1,style:{"font-size":`12px`}}))]),(0,t.createElementVNode)(`span`,mRt,(0,t.toDisplayString)(a.value),1)]),default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,hRt,[(0,t.createVNode)(D7,{content:e.content?.content||``},null,8,[`content`])]),(0,t.createVNode)(O7,{content:e.content?.referenceDocument||[]},null,8,[`content`])]),_:1},8,[`collapsed`]))}}),_Rt={class:`ai-activity-message-title-icon`},vRt={class:`ai-activity-message-title-text`},yRt=(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 J8?`Reference ${e} documents as reference`:`引用 ${e} 篇资料作为参考`});return(n,a)=>((0,t.openBlock)(),(0,t.createBlock)(s9,{collapsed:r.value,"onUpdate:collapsed":a[0]||=e=>r.value=e},{title:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`span`,_Rt,[(0,t.createVNode)((0,t.unref)(o5),{style:{"font-size":`12px`}})]),(0,t.createElementVNode)(`span`,vRt,(0,t.toDisplayString)(i.value),1)]),default:(0,t.withCtx)(()=>[(0,t.createVNode)(O7,{content:e.content||[]},null,8,[`content`])]),_:1},8,[`collapsed`]))}}),bRt=(0,t.defineComponent)({__name:`activity-message`,props:(0,t.mergeModels)({activityType:{},content:{},id:{},messageId:{},name:{},role:{},status:{},uid:{},property:{},onInterruptResume:{type:Function}},{collapsed:$({type:Boolean},{default:!1}),collapsedModifiers:{}}),emits:[`update:collapsed`],setup(e){let n={[Q8.FlowAgent]:fRt,[Q8.KnowledgeRag]:gRt,[Q8.ReferenceDocument]:yRt},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,"on-interrupt-resume":e.onInterruptResume,status:e.status},null,40,[`collapsed`,`content`,`message-uid`,`on-interrupt-resume`,`status`])):(0,t.createCommentVNode)(``,!0)}}),xRt={class:`toolcall-desc`},SRt={class:`desc-title`},CRt={class:`desc-panel`},wRt={class:`desc-label`},TRt={class:`desc-value`},_9=(0,t.defineComponent)({__name:`desc-panel`,props:{desc:{},title:{}},setup(e){let n=e,r=e=>e==null?``:typeof e==`object`?JSON.stringify(e):String(e),i=(0,t.computed)(()=>{try{return JSON.parse(n.desc||``)}catch{return n.desc}});return(n,a)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,xRt,[(0,t.createElementVNode)(`div`,SRt,(0,t.toDisplayString)(e.title),1),(0,t.createElementVNode)(`div`,CRt,[i.value!==null&&typeof i.value==`object`?((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,{key:0},(0,t.renderList)(i.value,(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:n,class:`desc-panel-item`},[(0,t.createElementVNode)(`span`,wRt,[(0,t.createVNode)((0,t.unref)(o9),{text:String(n)},null,8,[`text`]),a[0]||=(0,t.createTextVNode)(`:`,-1)]),(0,t.createElementVNode)(`span`,TRt,[(0,t.createVNode)((0,t.unref)(o9),{style:{"word-break":`break-all`},text:r(e)},null,8,[`text`])])]))),128)):((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(o9),{key:1,style:{wordBreak:`break-all`},text:r(i.value)},null,8,[`text`]))])]))}}),ERt={class:`tool-message`},DRt=(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`,ERt,[(0,t.createVNode)(_9,{desc:e.content||(typeof e.error==`string`?e.error:void 0),title:(0,t.unref)(Y8)(`返回内容`)},null,8,[`desc`,`title`])]))}}),ORt={class:`ai-toolcall-render`},kRt={class:`toolcall-header-title`},ARt={class:`toolcall-status-title`},jRt={key:1,class:`toolcall-duration`},MRt={class:`ai-toolcall-render-content`},NRt=(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=v5(),{keywordMatched:o,keyword:s}=Qkt(()=>[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 e5.Pending:return Y8(`调用中`);case e5.Complete:case e5.Success:return Y8(`调用成功`);case e5.Error||((e=n.toolCall)==null||(e=e.toolMessage)==null?void 0:e.error):return Y8(`调用失败`)}}),p=(0,t.computed)(()=>{var e;let t=n.duration||((e=n.toolCall)==null||(e=e.toolMessage)==null?void 0:e.duration);return t?PDt(t):``});return(n,r)=>{var i,o;return(0,t.openBlock)(),(0,t.createElementBlock)(`div`,ORt,[(0,t.createElementVNode)(`div`,{class:(0,t.normalizeClass)([`ai-toolcall-render-header`,`toolcall-status-${e.status}`]),onClick:u},[(0,t.createVNode)((0,t.unref)(s5),{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)(Y8)(`调用 MCP:`):(0,t.unref)(Y8)(`调用工具:`))+` `,1),(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createElementBlock)(`span`,kRt,[(0,t.createVNode)((0,t.unref)(o9),{text:d.value},null,8,[`text`])])),[[(0,t.unref)(y5),$($({},(0,t.unref)(a)),{},{text:d.value,appendTo:`parent`})]]),(0,t.createElementVNode)(`span`,ARt,[e.status===(0,t.unref)(e5).Pending||e.status===(0,t.unref)(e5).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)(o9),{text:f.value},null,8,[`text`]),p.value?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,jRt,` (`+(0,t.toDisplayString)(p.value)+`) `,1)):(0,t.createCommentVNode)(``,!0)])],2),(0,t.withDirectives)((0,t.createElementVNode)(`div`,MRt,[(0,t.createVNode)(_9,{desc:e.toolCall?.function.description,title:(0,t.unref)(Y8)(`描述`)},null,8,[`desc`,`title`]),(0,t.createVNode)(_9,{desc:e.toolCall?.function.arguments,title:(0,t.unref)(Y8)(`参数`)},null,8,[`desc`,`title`]),(o=e.toolCall)!=null&&o.toolMessage?((0,t.openBlock)(),(0,t.createBlock)(DRt,(0,t.normalizeProps)((0,t.mergeProps)({key:0},e.toolCall.toolMessage)),null,16)):(0,t.createCommentVNode)(``,!0)],512),[[t.vShow,!l.value]])])}}}),PRt={class:`ai-assistant-message`},FRt={class:`ai-assistant-message-content`},IRt=(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`,PRt,[(0,t.createElementVNode)(`div`,FRt,[(0,t.renderSlot)(n.$slots,`default`,(0,t.normalizeProps)((0,t.guardReactiveProps)({content:e.content})),()=>[(0,t.createVNode)(k7,{content:e.content||``,status:e.status,type:(0,t.unref)(Q8).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)(NRt,{key:n.id,status:e.status,"tool-call":n},null,8,[`status`,`tool-call`]))),128)):(0,t.createCommentVNode)(``,!0)]))}}),LRt={class:`info-message`},RRt=(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`,LRt,[((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))]))}}),zRt={class:`ai-tool-approval-card`},BRt={class:`ai-tool-approval-card__header`},VRt={class:`ai-tool-approval-card__title-wrap`},HRt={class:`ai-tool-approval-card__title`},URt={class:`ai-tool-approval-card__fields`},WRt={class:`ai-tool-approval-card__field`},GRt={class:`ai-tool-approval-card__field`},KRt={class:`ai-tool-approval-card__processor`},qRt={class:`ai-tool-approval-card__processor-text`},JRt={class:`ai-tool-approval-card__actions`},YRt=(0,t.defineComponent)({__name:`tool-approval-card`,props:{interrupt:{},onInterruptResume:{type:Function},readonly:{type:Boolean}},setup(e){let n=e,r=v5(),i=Ykt(),a=(0,t.computed)(()=>i.value===n5.Share),{copy:o}=h5(),s=new Set([X8.PENDING,X8.DRAFT]),l=new Set([X8.ABANDONED,X8.CANCELLED,X8.EXPIRED,X8.REJECTED]),u=(0,t.computed)(()=>n.interrupt.metadata?.ticket??{approvers:[],sn:``,status:X8.PENDING,submit_time:``,title:``,url:``}),d=(0,t.computed)(()=>s.has(u.value.status)),f=(0,t.computed)(()=>d.value?`pending`:u.value.status),p=(0,t.computed)(()=>d.value?Y8(`评审中`):LDt[u.value.status]??u.value.status),m=(0,t.computed)(()=>u.value.approvers.filter(Boolean).join(`、`)||Y8(`无`)),h=(0,t.computed)(()=>u.value.url||u.value.sn),g=()=>{u.value.url&&window.open(u.value.url,`_blank`,`noopener`)},_=()=>{h.value&&o(h.value)},v=(0,t.shallowRef)(!1),y=()=>{var e;v.value||(v.value=!0,(e=n.onInterruptResume)==null||e.call(n,{operation:t5.ApprovalCancel,payload:{interrupt_id:n.interrupt.id}},n.interrupt))};return(n,i)=>((0,t.openBlock)(),(0,t.createElementBlock)(`section`,zRt,[(0,t.createElementVNode)(`header`,BRt,[(0,t.createElementVNode)(`div`,VRt,[i[0]||=(0,t.createElementVNode)(`span`,{class:`ai-tool-approval-card__title-bar`},null,-1),(0,t.createElementVNode)(`span`,HRt,(0,t.toDisplayString)(u.value.title||(0,t.unref)(Y8)(`算法方案评审单`)),1),(0,t.withDirectives)((0,t.createVNode)((0,t.unref)(WOt),{class:(0,t.normalizeClass)([`ai-tool-approval-card__copy-icon`,{"is-disabled":!h.value}]),onClick:_},null,8,[`class`]),[[(0,t.unref)(Xl),$($({},(0,t.unref)(r)),{},{content:(0,t.unref)(Y8)(`复制单据链接`),theme:`ai-chat-box`,offset:[0,8]})]])]),(0,t.createElementVNode)(`span`,{class:(0,t.normalizeClass)([`ai-tool-approval-card__status`,`ai-tool-approval-card__status--${f.value}`])},[u.value.status===(0,t.unref)(X8).APPROVED?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(DOt),{key:0,class:`ai-tool-approval-card__status-icon`})):(0,t.unref)(l).has(u.value.status)?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(kOt),{key:1,class:`ai-tool-approval-card__status-icon`})):u.value.status===(0,t.unref)(X8).REVOKED?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(AOt),{key:2,class:(0,t.normalizeClass)([`ai-tool-approval-card__status-icon`,{"ai-tool-approval-card__status-icon--revoked":u.value.status===(0,t.unref)(X8).REVOKED}])},null,8,[`class`])):((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(Lo),{key:3,class:`ai-tool-approval-card__status-icon`,mode:`spin`,size:`mini`,theme:`primary`})),(0,t.createTextVNode)(` `+(0,t.toDisplayString)(p.value),1)],2)]),(0,t.createElementVNode)(`dl`,URt,[(0,t.createElementVNode)(`div`,WRt,[(0,t.createElementVNode)(`dt`,null,(0,t.toDisplayString)((0,t.unref)(Y8)(`单据编号`)),1),(0,t.createElementVNode)(`dd`,null,(0,t.toDisplayString)(u.value.sn||`--`),1)]),(0,t.createElementVNode)(`div`,GRt,[(0,t.createElementVNode)(`dt`,null,(0,t.toDisplayString)((0,t.unref)(Y8)(`提交时间`)),1),(0,t.createElementVNode)(`dd`,null,(0,t.toDisplayString)(u.value.submit_time||`--`),1)])]),(0,t.createElementVNode)(`div`,KRt,[(0,t.createVNode)((0,t.unref)(OOt),{class:`ai-tool-approval-card__processor-icon`}),(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createElementBlock)(`span`,qRt,[(0,t.createTextVNode)((0,t.toDisplayString)((0,t.unref)(Y8)(`当前处理人`))+`:`+(0,t.toDisplayString)(m.value),1)])),[[(0,t.unref)(y5),$({},(0,t.unref)(r))]])]),(0,t.createElementVNode)(`div`,JRt,[(0,t.createVNode)((0,t.unref)(Go),{class:`ai-tool-approval-card__detail`,disabled:!u.value.url,theme:`primary`,onClick:g},{default:(0,t.withCtx)(()=>[(0,t.createTextVNode)((0,t.toDisplayString)((0,t.unref)(Y8)(`查看单据详情`))+` `,1),i[1]||=(0,t.createElementVNode)(`span`,{class:`ai-tool-approval-card__detail-icon`},null,-1)]),_:1},8,[`disabled`]),d.value&&!e.readonly?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(Go),{key:0,class:`ai-tool-approval-card__cancel`,disabled:v.value||a.value,loading:v.value,outline:``,theme:`primary`,onClick:y},{default:(0,t.withCtx)(()=>[(0,t.createTextVNode)((0,t.toDisplayString)((0,t.unref)(Y8)(`取消审批`)),1)]),_:1},8,[`disabled`,`loading`])):(0,t.createCommentVNode)(``,!0)])]))}}),XRt={class:`ai-interrupt-message`},ZRt={key:0,class:`ai-interrupt-message__content`},QRt={key:1,class:`ai-interrupt-message__fallback`},$Rt=(0,t.defineComponent)({__name:`interrupt-message`,props:{content:{},id:{},messageId:{},name:{},role:{},status:{},uid:{},property:{},onInterruptResume:{type:Function}},setup(e){let n={[Z8.AIDevToolApproval]:YRt},r=e=>({id:e.interruptId||e.id||``,reason:Z8.AIDevToolApproval,toolCallId:``,metadata:e.payload.metadata}),i={[Z8.AIDevToolApproval]:e=>({component:YRt,props:{interrupt:r(e),readonly:!0}}),[Z8.UserQuestion]:e=>({component:MIt,props:{answers:e.payload?.answers??[],status:e.status}})},a=new Set([Z8.UserQuestion]),o=e,s=(0,t.computed)(()=>{var e;return((e=o.content)==null||(e=e.outcome)==null?void 0:e.type)===`interrupt`?o.content.outcome.interrupts:[]}),l=(0,t.computed)(()=>o.content?.message),u=e=>n[e.reason],d=e=>a.has(e.reason),f=(0,t.computed)(()=>{var e;if(((e=o.content)==null||(e=e.outcome)==null?void 0:e.type)!==`success`)return;let t=o.content?.result;if(t)return i[t.reason]?.call(i,t)});return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,XRt,[l.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,ZRt,(0,t.toDisplayString)(l.value),1)):(0,t.createCommentVNode)(``,!0),((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(s.value,n=>((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:n.toolCallId},[u(n)?((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(u(n)),{key:0,interrupt:n,"on-interrupt-resume":e.onInterruptResume},null,40,[`interrupt`,`on-interrupt-resume`])):d(n)?(0,t.createCommentVNode)(``,!0):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,QRt,(0,t.toDisplayString)(n.message||(0,t.unref)(Y8)(`暂不支持的中断消息`)),1))],64))),128)),f.value?((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(f.value.component),(0,t.normalizeProps)((0,t.mergeProps)({key:1},f.value.props)),(0,t.createSlots)({_:2},[n.$slots.answeredQuestion?{name:`answer`,fn:(0,t.withCtx)(e=>[(0,t.renderSlot)(n.$slots,`answeredQuestion`,(0,t.normalizeProps)((0,t.guardReactiveProps)(e)))]),key:`0`}:void 0]),1040)):(0,t.createCommentVNode)(``,!0)]))}}),ezt={class:`ai-loading-message`},tzt=(0,t.defineComponent)({__name:`loading-message`,setup(e){return(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,ezt,[(0,t.createVNode)(d5,{size:18}),(0,t.renderSlot)(e.$slots,`default`,{},()=>[(0,t.createTextVNode)((0,t.toDisplayString)((0,t.unref)(Y8)(`请求中...`)),1)])]))}}),nzt={class:`ai-reasoning-message`},rzt={key:0,class:`ai-reasoning-message-title-icon`},izt={class:`ai-reasoning-message-title-text`},azt={class:`ai-reasoning-message-content`},ozt=(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,function(){var e=f5(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 e5.Pending:return Y8(`思考中`);case e5.Success:case e5.Complete:return Y8(`已思考完成`)+(n.duration?` (${Y8(`耗时`)} :${PDt(n.duration)})`:``);case e5.Error:return Y8(`思考失败`);default:return Y8(`思考中`)}});return(n,i)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,nzt,[(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)(e5).Pending||e.status===(0,t.unref)(e5).Streaming,"is-complete":e.status===(0,t.unref)(e5).Complete||e.status===(0,t.unref)(e5).Success,"is-error":e.status===(0,t.unref)(e5).Error}]),onClick:i[0]||=e=>r.value=!r.value},[e.status===(0,t.unref)(e5).Pending||e.status===(0,t.unref)(e5).Streaming?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,rzt,[(0,t.createVNode)(d5)])):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`span`,izt,(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)(l5))],2)],2),(0,t.withDirectives)((0,t.createElementVNode)(`div`,azt,[e.status===(0,t.unref)(e5).Error?((0,t.openBlock)(),(0,t.createBlock)(qNt,{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)(D7,{key:e,content:e},null,8,[`content`]))),128))],512),[[t.vShow,!r.value]])]))}}),szt={class:`ai-key-value-content`},czt={key:0,class:`ai-key-value-title`},lzt={class:`ai-key-value-content`},uzt={class:`item-key`},dzt={class:`item-value`},fzt=(0,t.defineComponent)({__name:`key-value-content`,props:{content:{},title:{}},setup(e){return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,szt,[e.title?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,czt,[(0,t.createVNode)((0,t.unref)(LOt)),(0,t.createTextVNode)(` `+(0,t.toDisplayString)(e.title),1)])):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`div`,lzt,[((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`,uzt,(0,t.toDisplayString)(e.key),1),r[0]||=(0,t.createTextVNode)(` : `,-1),(0,t.createElementVNode)(`div`,dzt,(0,t.toDisplayString)(e.value),1)]))),128))])]))}}),pzt={class:`ai-user-message`},mzt={key:0,class:`ai-user-message-binary-files`},hzt={key:1,class:`ai-user-message-content`},gzt={class:`user-edit-footer`},_zt=(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=Pkt(),{copy:i}=h5(),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||fDt(e.mimeType||e.file?.type),p=(0,t.computed)(()=>Array.isArray(n.content)?n.content?.filter(e=>e.type===Q8.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===Q8.Text&&!!((t=e.text)!=null&&t.trim())}):``),_=function(){var e=f5(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=f5(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=f5(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=f5(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`,pzt,[u.value&&typeof u.value==`string`?((0,t.openBlock)(),(0,t.createBlock)(pFt,{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)(bkt,(0,t.mergeProps)({key:0},d.value,{class:`user-shortcut-render`,onClose:b,onSubmit:x}),null,16)):((0,t.openBlock)(),(0,t.createBlock)(gIt,{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`,gzt,[(0,t.createVNode)((0,t.unref)(Go),{size:`small`,onClick:y},{default:(0,t.withCtx)(()=>[(0,t.createTextVNode)((0,t.toDisplayString)((0,t.unref)(Y8)(`取消`)),1)]),_:1}),(0,t.createVNode)((0,t.unref)(Go),{size:`small`,theme:`primary`,onClick:v},{default:(0,t.withCtx)(()=>[(0,t.createTextVNode)((0,t.toDisplayString)((0,t.unref)(Y8)(`发送`)),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`,mzt,[(0,t.createVNode)(i9,{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)(i9,{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`,hzt,[Array.isArray(u.value)?((0,t.openBlock)(),(0,t.createBlock)(fzt,{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)(D7,{key:0,content:e},null,8,[`content`])):e.type===(0,t.unref)(Q8).Text?((0,t.openBlock)(),(0,t.createBlock)(D7,{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)(n9).Hidden?(0,t.createCommentVNode)(``,!0):((0,t.openBlock)(),(0,t.createBlock)(dLt,{key:2,class:`ai-user-message-tools`,"message-tools":(0,t.unref)(UDt),"message-tools-status":e.messageToolsStatus,"on-action":_,"tippy-options":e.tippyOptions,"update-tools":[]},null,8,[`message-tools`,`message-tools-status`,`tippy-options`]))],64))]))}}),v9=(0,t.defineComponent)({__name:`message-render`,props:{messageToolsStatus:{},onInputConfirm:{type:Function},onShortcutConfirm:{type:Function},onAction:{type:Function},tippyOptions:{},message:{},onInterruptResume:{type:Function}},setup(e){let n=e,r=(0,t.useSlots)(),i=(0,t.computed)(()=>{switch(n.message.role){case $8.User:return(0,t.h)(_zt,$($({},n.message),{},{onAction:n.onAction,onInputConfirm:n.onInputConfirm,onShortcutConfirm:n.onShortcutConfirm,messageToolsStatus:n.messageToolsStatus,tippyOptions:n.tippyOptions}));case $8.Assistant:return(0,t.h)(IRt,n.message,{default:e=>(0,t.renderSlot)(r,`default`,e,()=>[(0,t.h)(k7,{content:n.message.content||``,status:n.message.status},r.codeHeader?{codeHeader:e=>r.codeHeader?.call(r,e)}:void 0)])});case $8.Info:return(0,t.h)(RRt,n.message);case $8.Reasoning:return(0,t.h)(ozt,n.message);case $8.Tool:return(0,t.h)(DRt,n.message);case $8.Activity:return(0,t.h)(bRt,$($({},n.message),{},{onInterruptResume:n.onInterruptResume}));case $8.Interrupt:return(0,t.h)($Rt,$($({},n.message),{},{onInterruptResume:n.onInterruptResume}),r.answeredQuestion?{answeredQuestion:e=>r.answeredQuestion?.call(r,e)}:void 0);case $8.Loading:return(0,t.h)(tzt,n.message);default:return null}});return(e,n)=>((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(i.value)))}}),vzt=[`id`,`onMouseenter`,`onMouseleave`],yzt={class:`ai-message-fixed-bottom`},bzt=(0,t.defineComponent)({__name:`message-container`,props:(0,t.mergeModels)({enableSelection:{type:Boolean,default:!1},messageGroups:{},messages:{},messageStatus:{},messageToolsStatus:{},messageToolsTippyOptions:{},onAgentAction:{},onAgentFeedback:{},onInterruptResume:{},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}=Tkt(i,a),{copy:l}=h5(),u=(0,t.computed)(()=>HDt.filter(e=>n.renderMode!==n5.Test||e.id!==`share`)),d=(0,t.computed)(()=>n.renderMode===n5.Share?n.messageGroups.filter(e=>e.type!==$8.Loading):n.messageGroups),f=e=>{e.messages?.at(-1)?.role!==$8.Interrupt&&(e.isHover=!0)},p=(e,t)=>{let n=t.toElement??t.relatedTarget;n instanceof Element&&n.classList.contains(`ai-user-feedback`)||(e.isHover=!1)},m=(e,t)=>{var i;let a=e.type===$8.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()},h=function(){var e=f5(function*(e,t){return e.id===`copy`&&l(t.filter(e=>e.role!==$8.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)}}(),g=function(){var e=f5(function*(e,t){var r;(r=n.onUserAction)==null||r.call(n,e,t)});return function(t,n){return e.apply(this,arguments)}}(),_=function(){var e=f5(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)}}(),v=function(){var e=f5(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)(d.value,(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=>f(i),onMouseleave:e=>p(i,e)},[(0,t.renderSlot)(r.$slots,`group`,(0,t.mergeProps)({ref_for:!0},{group:i}),()=>[e.enableSelection&&i.type!==(0,t.unref)($8).Loading?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(ls),{key:0,class:`message-group-checkbox`,"model-value":i.checked,"onUpdate:modelValue":e=>m(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)(n5).Share||e.enableSelection&&i.type!==(0,t.unref)($8).Loading}]),style:(0,t.normalizeStyle)({width:e.enableSelection&&i.type!==(0,t.unref)($8).Loading?`calc(100% - 16px)`:`100%`})},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(i.messages,(i,a)=>(0,t.renderSlot)(r.$slots,`default`,(0,t.mergeProps)({key:a,ref_for:!0},{message:i,messageToolsStatus:e.messageToolsStatus,onInterruptResume:n.onInterruptResume}),()=>[((0,t.openBlock)(),(0,t.createBlock)(v9,{key:a,message:i,"message-tools-status":e.messageToolsStatus,"on-action":e=>g(e,i),"on-input-confirm":(e,t)=>_(i,e,t),"on-interrupt-resume":n.onInterruptResume,"on-shortcut-confirm":e=>v(i,e),"tippy-options":e.messageToolsTippyOptions},(0,t.createSlots)({_:2},[r.$slots.answeredQuestion?{name:`answeredQuestion`,fn:(0,t.withCtx)(e=>[(0,t.renderSlot)(r.$slots,`answeredQuestion`,(0,t.mergeProps)({ref_for:!0},e))]),key:`0`}:void 0]),1032,[`message`,`message-tools-status`,`on-action`,`on-input-confirm`,`on-interrupt-resume`,`on-shortcut-confirm`,`tippy-options`]))])),128)),e.renderMode!==(0,t.unref)(n5).Share&&!(e.enableSelection&&i.type!==(0,t.unref)($8).Loading)&&!i.pause&&i.type===(0,t.unref)($8).Assistant&&e.messageToolsStatus!==(0,t.unref)(n9).Hidden?((0,t.openBlock)(),(0,t.createBlock)(dLt,{key:0,"message-tools":u.value,"message-tools-status":e.messageToolsStatus,"on-action":e=>h(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,vzt))),128)),(0,t.createElementVNode)(`div`,{ref_key:`messageContainerBottomRef`,ref:a,class:`message-container-bottom`,tabindex:`0`},null,512),(0,t.createElementVNode)(`div`,yzt,[(0,t.withDirectives)((0,t.createVNode)(YOt,{loading:e.messageStatus===(0,t.unref)(e5).StopLoading,title:e.messageStatus===(0,t.unref)(e5).StopLoading?(0,t.unref)(Y8)(`正在停止`):(0,t.unref)(Y8)(`停止生成`),onClick:l[0]||=e=>r.$emit(`stopStreaming`)},{icon:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(COt))]),_:1},8,[`loading`,`title`]),[[t.vShow,e.renderMode!==(0,t.unref)(n5).Share&&(e.messageStatus===(0,t.unref)(e5).Streaming||e.messageStatus===(0,t.unref)(e5).StopLoading||e.messageStatus===(0,t.unref)(e5).Fetching||e.messageStatus===(0,t.unref)(e5).Pending)]]),(0,t.withDirectives)((0,t.createVNode)(YOt,{title:(0,t.unref)(Y8)(`返回底部`),onClick:(0,t.unref)(o)},{icon:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(zOt))]),_:1},8,[`title`,`onClick`]),[[t.vShow,(0,t.unref)(s)]])])],512))}}),xzt={class:`execution-summary`},Szt={class:`execution-summary-header`},Czt={class:`execution-summary-content`},wzt=[`onMouseenter`],Tzt={class:`content-item-header`},Ezt={class:`content-item-title`},Dzt={class:`content-item-messages`},Ozt={key:0,class:`timeline-line`},kzt={key:1,class:`execution-summary-content-empty`},Azt={class:`execution-summary-content-empty-text`},jzt=(0,t.defineComponent)({__name:`execution-summary`,props:{messageGroups:{}},emits:[`locateMessageGroup`,`updateKeyword`],setup(e,{emit:n}){let r=n,i=v5(),{keyword:a}=qkt(),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`,xzt,[(0,t.createElementVNode)(`div`,Szt,[(0,t.createVNode)((0,t.unref)(ns),{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)(Y8)(`搜索 关键字`)},null,8,[`modelValue`,`placeholder`])]),(0,t.createElementVNode)(`div`,Czt,[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`,Tzt,[d[3]||=(0,t.createElementVNode)(`span`,{class:`timeline-dot`},null,-1),(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createElementBlock)(`span`,Ezt,[(0,t.createTextVNode)((0,t.toDisplayString)(typeof n.userMessageTitle==`number`?s(n.userMessageTitle):n.userMessageTitle),1)])),[[(0,t.unref)(y5),$({},(0,t.unref)(i))]]),(0,t.withDirectives)((0,t.createVNode)((0,t.unref)(Go),{class:`content-item-locate`,text:``,theme:`primary`,onClick:e=>l(n)},{default:(0,t.withCtx)(()=>[(0,t.createTextVNode)((0,t.toDisplayString)((0,t.unref)(Y8)(`在对话中定位`)),1)]),_:1},8,[`onClick`]),[[t.vShow,o.value===n.uid]])]),(0,t.createElementVNode)(`div`,Dzt,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(n.messages,(e,n)=>((0,t.openBlock)(),(0,t.createBlock)(v9,{key:n,message:e},null,8,[`message`]))),128))]),r<e.messageGroups.length-1?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,Ozt)):(0,t.createCommentVNode)(``,!0)],40,wzt))),128)):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,kzt,[(0,t.createVNode)((0,t.unref)(Xs),{class:`empty-exception`,type:`empty`}),(0,t.createElementVNode)(`div`,Azt,[(0,t.createTextVNode)((0,t.toDisplayString)((0,t.unref)(a)?(0,t.unref)(Y8)(`搜索结果为空`):(0,t.unref)(Y8)(`暂无数据`))+` `,1),(0,t.unref)(a)?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(Go),{key:0,text:``,theme:`primary`,onClick:u},{default:(0,t.withCtx)(()=>[(0,t.createTextVNode)((0,t.toDisplayString)((0,t.unref)(Y8)(`清空搜索`)),1)]),_:1})):(0,t.createCommentVNode)(``,!0)])]))])]))}}),Mzt=[`class`,`style`],Nzt={class:`ai-message-loading-row`},Pzt={class:`ai-message-loading-icon-wrap`},Fzt={key:0,class:`ai-message-loading-text ai-message-loading-text-custom`},Izt={key:1,"aria-live":`polite`,class:`ai-message-loading-text`},Lzt=(0,t.defineComponent)($($({},{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 m5(r,Mzt)}),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)?$($({},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`,Nzt,[(0,t.createElementVNode)(`span`,Pzt,[(0,t.renderSlot)(e.$slots,`icon`,{},()=>[(0,t.createVNode)((0,t.unref)($Dt),{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`,Fzt,[(0,t.renderSlot)(e.$slots,`text`)])):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,Izt,[((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))}})),Rzt={class:`ai-selection-footer`},zzt={class:`ai-selection-footer-left`},Bzt={class:`select-all-text`},Vzt={class:`ai-selection-footer-right`},Hzt=(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`,Rzt,[(0,t.createElementVNode)(`div`,zzt,[(0,t.createVNode)((0,t.unref)(ls),{"model-value":e.isAllSelected,"onUpdate:modelValue":i[0]||=e=>r(`toggle-all`,e)},null,8,[`model-value`]),(0,t.createElementVNode)(`span`,Bzt,(0,t.toDisplayString)((0,t.unref)(Y8)(`全选`)),1)]),(0,t.createElementVNode)(`div`,Vzt,[(0,t.createVNode)((0,t.unref)(Go),{disabled:e.loading,onClick:i[1]||=e=>r(`cancel`)},{default:(0,t.withCtx)(()=>[(0,t.createTextVNode)((0,t.toDisplayString)((0,t.unref)(Y8)(`取消`)),1)]),_:1},8,[`disabled`]),(0,t.createVNode)((0,t.unref)(Go),{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)(Y8)(`确定`)),1)]),_:1},8,[`disabled`,`loading`])])]))}}),Uzt=[`data-ai-size`],Wzt={key:0,class:`ai-chat-container-loading`},Gzt={class:`screen-wrapper`},Kzt={key:1,class:`ai-welcome-content`},qzt={class:`ai-welcome-title`},Jzt={key:0,class:`ai-welcome-remark`},Yzt=(0,t.defineComponent)({__name:`chat-container`,props:(0,t.mergeModels)({chatLoading:{type:Boolean},commonTippyOptions:{},getSideRenderComponent:{},getSideTabRenderComponent:{},onCustomTabChange:{},openingRemark:{},placement:{default:`left`},resizeProps:{},size:{default:`small`},welcomeTitle:{},defaultUploadFiles:{},inputMaxHeight:{},messageStatus:{},modelValue:{},onSendMessage:{},onStopSending:{},onUpload:{},placeholder:{},prompts:{},resources:{},sendDisabledTip:{},shortcutId:{},shortcuts:{},skills:{},supportUpload:{type:Boolean},tippyOptions:{},messages:{},messageToolsStatus:{},onAgentAction:{},onAgentFeedback:{},onInterruptResume:{},onUserAction:{},renderMode:{},onUserInputConfirm:{},onUserShortcutConfirm:{}},{renderMode:{required:!1,default:n5.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=mhe.TabPanel,a=e,o=(0,t.useModel)(e,`renderMode`),s=(0,t.useTemplateRef)(`fullScreenRef`),{isFullScreen:l,enter:u,exit:d}=jkt(s);Jkt({renderMode:o});let f=(0,t.computed)(()=>$($({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);Nkt({size:(0,t.computed)(()=>a.size??`small`),supportUpload:(0,t.computed)(()=>a.supportUpload??!1)}),(0,t.watch)(()=>a.size??`small`,e=>{typeof document<`u`&&(document.body.dataset.aiSize=e)},{immediate:!0});let m=(0,t.useModel)(e,`selectedShortcut`),h=(0,t.useModel)(e,`cite`),g=r;Xkt({tippyOptions:(0,t.computed)(()=>a.commonTippyOptions??{})});let{tabs:_,selectedTab:v,isCollapse:y,addCustomTab:b,removeCustomTab:x,selectCustomTab:S,resetCustomTab:C}=kkt({onTabChange:function(){var e=f5(function*(e){let t=v.value.data?.props||{loading:!0,data:{}};v.value.data=$($({},v.value.data),{},{props:t});let n=yield a.onCustomTabChange?.call(a,e);v.value.data=$($({},v.value.data),{},{props:$($({},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,pendingApprovalTipText:F,activeUserQuestionInterrupt:I}=Hkt({keyword:w,messages:(0,t.computed)(()=>a.messages),renderMode:(0,t.computed)(()=>o.value),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 L=(0,t.computed)(()=>{var e;return a.messageStatus===e5.StopLoading?e5.StopLoading:(e=O.value)!=null&&e.some(e=>e.messages.some(e=>e.id===`__loading__`))?e5.Fetching:a.messageStatus}),R=()=>{m.value=null,g(`shortcutClose`)},ee=e=>{g(`shortcutSubmit`,e)},z=()=>{g(`deleteShortcut`)},B=e=>{g(`selectShortcut`,e)},V=(e,t)=>{g(`update:modelValue`,e,t)},te=function(){var e=f5(function*(e,t){let n=I.value;return a.onSendMessage?.call(a,e,t,n?{payload:SIt(n),interrupt:n}:void 0)});return function(t,n){return e.apply(this,arguments)}}(),ne=()=>{y.value=!y.value},re=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`})},ie=e=>{S(_.value.find(t=>t.name===e))},ae=e=>{w.value=e},H=function(){var e=f5(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)}}(),oe=()=>{g(`confirmShare`,P()),(0,t.nextTick)(()=>{A.value=!1,T.value=[]})},se=e=>{E.value=e};return(0,t.onUnmounted)(()=>{C(),typeof document<`u`&&delete document.body.dataset.aiSize}),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`,"data-ai-size":e.size,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`,Wzt,[(0,t.createVNode)(Lzt)])):((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(ehe),(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)(n5).Share}]},f.value,{onResizing:se}),{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)(n5).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)(mhe),{active:(0,t.unref)(v).name,class:`ai-chat-container-tab`,"label-height":40,type:`unborder-card`,onChange:ie},{setting:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,Gzt,[(0,t.createVNode)(b5,{class:`screen-btn`,"tippy-options":$($({},e.commonTippyOptions),{},{appendTo:(0,t.unref)(l)?s.value:e.commonTippyOptions?.appendTo,content:(0,t.unref)(l)?(0,t.unref)(Y8)(`退出全屏`):(0,t.unref)(Y8)(`全屏`)})},{default:(0,t.withCtx)(()=>[(0,t.unref)(l)?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(VOt),{key:1,onClick:(0,t.unref)(d)},null,8,[`onClick`])):((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(BOt),{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)(uOt):(0,t.unref)(dOt),{class:`ai-execution-summary-icon`}),(0,t.withDirectives)((0,t.h)(`span`,{class:`ai-execution-summary-label-text`},n.label??``),[[(0,t.unref)(y5),$($({},e.commonTippyOptions),{},{text:n.label??``})]]),n.name===(0,t.unref)(`execution`)?null:(0,t.h)((0,t.unref)(u5),{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)(jzt,{key:0,"message-groups":(0,t.unref)(k),style:{height:`calc(100% - 40px)`},onLocateMessageGroup:re,onUpdateKeyword:ae},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)(Go),{class:`ai-locate-button`,size:`small`,text:``,theme:`primary`,onClick:r[0]||=e=>{var n;return re((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)(Y8)(`在对话中定位`)),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)(n5).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:ne},[(0,t.createVNode)((0,t.unref)(l5))],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:H,onAgentFeedback:e.onAgentFeedback,onInterruptResume:e.onInterruptResume,onUserAction:e.onUserAction,onUserInputConfirm:e.onUserInputConfirm,onUserShortcutConfirm:e.onUserShortcutConfirm})),()=>{var i;return[(i=e.messages)!=null&&i.length?((0,t.openBlock)(),(0,t.createBlock)(bzt,{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":L.value,"message-tools-status":e.messageToolsStatus,"message-tools-tippy-options":e.commonTippyOptions,messages:e.messages,"on-agent-action":H,"on-agent-feedback":e.onAgentFeedback,"on-interrupt-resume":e.onInterruptResume,"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`)},{group:(0,t.withCtx)(({group:e})=>[(0,t.renderSlot)(n.$slots,`group`,(0,t.normalizeProps)((0,t.guardReactiveProps)({group:e})))]),default:(0,t.withCtx)(({message:e,messageToolsStatus:r,onInterruptResume:i})=>[(0,t.renderSlot)(n.$slots,`message`,(0,t.normalizeProps)((0,t.guardReactiveProps)({message:e,messageToolsStatus:r,onInterruptResume:i})))]),_:3},8,[`selected-user-messages`,`enable-selection`,`message-groups`,`message-status`,`message-tools-status`,`message-tools-tippy-options`,`messages`,`on-agent-feedback`,`on-interrupt-resume`,`on-user-action`,`on-user-input-confirm`,`on-user-shortcut-confirm`,`render-mode`])):(0,t.createCommentVNode)(``,!0)]}):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,Kzt,[(0,t.renderSlot)(n.$slots,`welcome`,(0,t.normalizeProps)((0,t.guardReactiveProps)({openingRemark:e.openingRemark,welcomeTitle:e.welcomeTitle})),()=>[(0,t.createVNode)((0,t.unref)(eOt)),(0,t.createElementVNode)(`h2`,qzt,(0,t.toDisplayString)(e.welcomeTitle??(0,t.unref)(Y8)(`你好,我是小鲸`)),1),e.openingRemark?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,Jzt,[(0,t.createVNode)(k7,{content:e.openingRemark},null,8,[`content`])])):(0,t.createCommentVNode)(``,!0)])])),o.value===(0,t.unref)(n5).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)(Hzt,{key:0,"is-all-selected":(0,t.unref)(j),loading:!1,"selected-count":T.value.length,onCancel:(0,t.unref)(N),onConfirm:oe,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)(bkt,(0,t.mergeProps)({key:1},m.value,{onClose:R,onSubmit:ee}),null,16)):((0,t.openBlock)(),(0,t.createBlock)(gIt,{key:2,cite:h.value,"onUpdate:cite":r[3]||=e=>h.value=e,"message-status":L.value,"model-value":e.modelValue,"on-send-message":te,"on-stop-sending":e.onStopSending,"on-upload":e.onUpload,placeholder:e.placeholder,prompts:e.prompts,resources:e.resources,"send-disabled-tip":(0,t.unref)(F),"shortcut-id":m.value?.id,shortcuts:e.shortcuts,skills:e.skills,"support-upload":e.supportUpload,"tippy-options":e.commonTippyOptions,onDeleteShortcut:z,onSelectShortcut:B,"onUpdate:modelValue":V},{interrupt:(0,t.withCtx)(()=>[(0,t.unref)(I)?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(YIt),{key:0,interrupt:(0,t.unref)(I),"on-resume":e.onInterruptResume},{question:(0,t.withCtx)(({question:e,qIndex:r,answer:i,setAnswer:a,confirm:o})=>[(0,t.renderSlot)(n.$slots,`interruptQuestion`,(0,t.normalizeProps)((0,t.guardReactiveProps)({question:e,qIndex:r,answer:i,setAnswer:a,confirm:o})))]),_:3},8,[`interrupt`,`on-resume`])):(0,t.createCommentVNode)(``,!0),(0,t.unref)(F)?((0,t.openBlock)(),(0,t.createBlock)(yIt,{key:1,content:(0,t.unref)(F)},null,8,[`content`])):(0,t.createCommentVNode)(``,!0)]),_:3},8,[`cite`,`message-status`,`model-value`,`on-stop-sending`,`on-upload`,`placeholder`,`prompts`,`resources`,`send-disabled-tip`,`shortcut-id`,`shortcuts`,`skills`,`support-upload`,`tippy-options`]))],64))]}),_:3},16,[`class`]))],12,Uzt)}}}),Xzt={class:`ai-image-preview-group`};$($({},{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)(sFt,{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`,Xzt,[(0,t.renderSlot)(n.$slots,`default`),r.value?((0,t.openBlock)(),(0,t.createBlock)(r9,{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 Zzt=[`alt`,`src`],Qzt={key:1,class:`ai-image-error`};$($({},{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)(sFt,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,Zzt)):(0,t.createCommentVNode)(``,!0),u.value===`error`?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,Qzt,[(0,t.createVNode)((0,t.unref)(iOt),{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)(bOt),{class:`ai-image-reload-icon`}),(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)((0,t.unref)(Y8)(`重新加载`)),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)(r9,{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 $zt=`data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAYAAAGVn0euAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAYKADAAQAAAABAAAAYAAAAACpM19OAAAj4UlEQVR4Ae1dB4AURbqu7pnZyOICShIVBI5TDPgwR0yn5yknKigIy+5KMCJ4ohgQMGdP8BQDsAsqHsZTnnqcPlEU1DNwnnqKYATxRDIsuxO63/f91dXTMzuzzBLEd28Leqq66q+//lR/he7qVWpbh35lsYVBnHbwJpjuPqB2Be/3s9X+jH9TFnMZZwxdBkVXdhkc+02w8E8VifoVOg+Kurze/tRxuw2OuodU1tUHMlgI2GdczH1/kSPXR1847ieLE+6AC2uk0v7DoxKn8DDkt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9pzhdXyuL31GTb6kBFjVdfY/miQO4OMYTz6rdRrdqhWRTaJJAkwSaJNAkgSYJNEmgSQJNEmhQAv8Lix8k/gNx6O4AAAAASUVORK5CYII=`,eBt=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}),y9=function(e){return e.FlowAgent=`flow_agent`,e.KnowledgeRag=`knowledge_rag`,e.ReferenceDocument=`reference_document`,e}({}),b9=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.Interrupt=`interrupt`,e}({}),x9=function(e){return e.Complete=`complete`,e.Error=`error`,e.Pending=`pending`,e.Stop=`stop`,e.Streaming=`streaming`,e}({}),S9=function(e){return e.Binary=`binary`,e.Function=`function`,e.Text=`text`,e}({}),C9=function(e){return e.FlowNodeRetry=`flow_node_retry`,e.FlowNodeSkip=`flow_node_skip`,e.ApprovalCancel=`approval_cancel`,e}({}),w9=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 b9.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 y9.ReferenceDocument:i=r(n.content);break;case y9.KnowledgeRag:{let e=n.content;i={content:e.content,referenceDocument:r(e.reference_document)};break}case y9.FlowAgent:default:i=n.content;break}return{...t,activityType:n.activity_type,content:i,role:n.role}}case b9.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 b9.Developer:{let n=e;return{...t,content:n.content,role:n.role}}case b9.Guide:{let n=e;return{...t,content:n.content,role:n.role}}case b9.Hidden:{let n=e;return{...t,content:n.content,role:n.role}}case b9.HiddenAssistant:{let n=e;return{...t,content:n.content,role:n.role}}case b9.HiddenGuide:{let n=e;return{...t,content:n.content,role:n.role}}case b9.HiddenSystem:{let n=e;return{...t,content:n.content,role:n.role}}case b9.HiddenUser:{let n=e;return{...t,content:n.content,role:n.role}}case b9.Info:{let n=e;return{...t,content:n.content,role:n.role}}case b9.Pause:{let n=e;return{...t,content:n.content,role:n.role}}case b9.Placeholder:{let n=e;return{...t,content:n.content,role:n.role}}case b9.Reasoning:{let n=e;return{...t,content:n.content,duration:n.duration,role:n.role}}case b9.System:{let n=e;return{...t,content:n.content,role:n.role}}case b9.TemplateAssistant:{let n=e;return{...t,content:n.content,role:n.role}}case b9.TemplateGuide:{let n=e;return{...t,content:n.content,role:n.role}}case b9.TemplateHidden:{let n=e;return{...t,content:n.content,role:n.role}}case b9.TemplateSystem:{let n=e;return{...t,content:n.content,role:n.role}}case b9.TemplateUser:{let n=e;return{...t,content:n.content,role:n.role}}case b9.Tool:{let n=e;return{...t,content:n.content,duration:n.duration,error:n.error,role:n.role,toolCallId:n.tool_call_id}}case b9.User:{let n=e,r=n.content;return{...t,content:Array.isArray(r)?r.map(e=>{if(e.type===S9.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}}case b9.Interrupt:return{...t,...e}}},tBt=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 b9.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 y9.ReferenceDocument:i=r(n.content);break;case y9.KnowledgeRag:{let e=n.content;i={content:e.content,reference_document:r(e.referenceDocument)};break}case y9.FlowAgent:default:i=n.content;break}return{...t,activity_type:n.activityType,content:i,role:n.role}}case b9.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 b9.Developer:{let n=e;return{...t,content:n.content,role:n.role}}case b9.Guide:{let n=e;return{...t,content:n.content,role:n.role}}case b9.Hidden:{let n=e;return{...t,content:n.content,role:n.role}}case b9.HiddenAssistant:{let n=e;return{...t,content:n.content,role:n.role}}case b9.HiddenGuide:{let n=e;return{...t,content:n.content,role:n.role}}case b9.HiddenSystem:{let n=e;return{...t,content:n.content,role:n.role}}case b9.HiddenUser:{let n=e;return{...t,content:n.content,role:n.role}}case b9.Info:{let n=e;return{...t,content:n.content,role:n.role}}case b9.Pause:{let n=e;return{...t,content:n.content,role:n.role}}case b9.Placeholder:{let n=e;return{...t,content:n.content,role:n.role}}case b9.Reasoning:{let n=e;return{...t,content:n.content,duration:n.duration,role:n.role}}case b9.System:{let n=e;return{...t,content:n.content,role:n.role}}case b9.TemplateAssistant:{let n=e;return{...t,content:n.content,role:n.role}}case b9.TemplateGuide:{let n=e;return{...t,content:n.content,role:n.role}}case b9.TemplateHidden:{let n=e;return{...t,content:n.content,role:n.role}}case b9.TemplateSystem:{let n=e;return{...t,content:n.content,role:n.role}}case b9.TemplateUser:{let n=e;return{...t,content:n.content,role:n.role}}case b9.Tool:{let n=e;return{...t,content:n.content,duration:n.duration,error:n.error,role:n.role,tool_call_id:n.toolCallId}}case b9.User:{let n=e,r=n.content;return{...t,content:Array.isArray(r)?r.map(e=>{if(e.type===S9.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}}case b9.Interrupt:return{...t,...e}}},T9=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}}),nBt=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}}),rBt=e=>({session_code:e.sessionCode,session_content_ids:e.sessionContentIds,rate:e.rate,comment:e.comment,labels:e.labels}),iBt=e=>({sessionCode:e.session_code,sessionContentIds:e.session_content_ids,rate:e.rate,comment:e.comment,labels:e.lables}),aBt=()=>`temp_${Date.now()}_${Math.random().toString(36).slice(2,9)}`,oBt=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=>[x9.Pending,x9.Streaming].includes(e.status)),d=e=>n.value.find(t=>t.messageId===e),f=async t=>{let r=aBt(),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:x9.Error}),e}},p=async t=>{let r=t.reduce((e,t)=>(t.role===b9.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===b9.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}}},E9=function(e){return e.FlowAgentEnd=`flow_agent_end`,e.FlowAgentResult=`flow_agent_result`,e.FlowAgentStart=`flow_agent_start`,e.FlowAgentUpdate=`flow_agent_update`,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.ApprovalResult=`approval_result`,e}({}),D9=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}({}),sBt=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}({}),O9=function(e){return e.Success=`success`,e.Interrupt=`interrupt`,e}({}),cBt=function(e){return e.Abandoned=`abandoned`,e.Approved=`approved`,e.Cancelled=`cancelled`,e.Draft=`draft`,e.Expired=`expired`,e.Rejected=`rejected`,e.Pending=`pending`,e}({}),k9=function(e){return e.Resolved=`resolved`,e.Cancelled=`cancelled`,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 E9.FlowAgentStart:this.handleFlowAgentStartCustomEvent(e);break;case E9.FlowAgentResult:this.handleFlowAgentResultCustomEvent(e);break;case E9.FlowAgentEnd:this.handleFlowAgentEndCustomEvent(e);break;case E9.ReferenceDocument:this.handleReferenceDocumentCustomEvent(e);break;case E9.KnowledgeRagStart:this.handleKnowledgeRagStartCustomEvent(e);break;case E9.KnowledgeRagTextContent:this.handleKnowledgeRagTextContentCustomEvent(e);break;case E9.KnowledgeRagResult:this.handleKnowledgeRagResultCustomEvent(e);break;case E9.KnowledgeRagEnd:this.handleKnowledgeRagEndCustomEvent(e);break;case E9.TempMessage:this.handleTempMessageCustomEvent(e);break;case E9.ApprovalResult:this.handleApprovalResultCustomEvent(e);break;case E9.FlowAgentUpdate:this.handleFlowAgentUpdateCustomEvent(e);break;default:break}}handleFlowAgentEndCustomEvent(e){let t=this.messageModule.getCurrentLoadingMessage();if(t&&t.role===b9.Activity&&t.activityType===y9.FlowAgent){t.status=x9.Complete;let n=e.value;this.messageModule.plusMessage({role:b9.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.2.0-beta.1",
3
+ "version": "2.2.0-beta.2",
4
4
  "description": "AI 小鲸 V2 - 基于新架构的智能对话组件",
5
5
  "license": "MIT",
6
6
  "author": "Tencent BlueKing",
@@ -62,12 +62,12 @@
62
62
  "vue": "^3.5.24"
63
63
  },
64
64
  "dependencies": {
65
+ "@blueking/chat-helper": "0.0.10-dev.1",
66
+ "@blueking/chat-x": "0.0.46-beta.1",
65
67
  "bkui-vue": "2.0.2-beta.81",
66
68
  "tippy.js": "^6.3.7",
67
69
  "vue-draggable-resizable": "^3.0.0",
68
- "vue-tippy": "^6.7.1",
69
- "@blueking/chat-helper": "0.0.10-dev.1",
70
- "@blueking/chat-x": "0.0.45-beta.8"
70
+ "vue-tippy": "^6.7.1"
71
71
  },
72
72
  "devDependencies": {
73
73
  "@types/node": "^25.0.1",