wi-chat 0.4.0 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/dist/core/index.cjs +1 -1
  2. package/dist/core/index.js +129 -123
  3. package/dist/core/useChat.d.ts +11 -3
  4. package/dist/index.cjs +1 -1
  5. package/dist/index.d.ts +5 -3
  6. package/dist/index.js +102 -74
  7. package/dist/mobile-ui/chat/ChatContainer.vue.d.ts +3 -3
  8. package/dist/mobile-ui/index.cjs +1 -1
  9. package/dist/mobile-ui/index.d.ts +1 -1
  10. package/dist/mobile-ui/index.js +89 -82
  11. package/dist/mobile-ui/inputbox/Inputbox.vue.d.ts +1 -1
  12. package/dist/mobile-ui/style.css +1 -1
  13. package/dist/page-context/extArgs.d.ts +46 -0
  14. package/dist/page-context/index.cjs +2 -0
  15. package/dist/page-context/index.d.ts +18 -0
  16. package/dist/page-context/index.js +48 -0
  17. package/dist/page-context/state.d.ts +10 -0
  18. package/dist/page-context/types.d.ts +218 -0
  19. package/dist/parser/answerCom/actionExecute/actionProtocol.d.ts +38 -0
  20. package/dist/parser/answerCom/actionExecute/clarification.d.ts +67 -0
  21. package/dist/parser/answerCom/actionExecute/parseActionExecute.d.ts +28 -0
  22. package/dist/parser/answerCom/actionExecute/types.d.ts +153 -0
  23. package/dist/parser/index.cjs +2 -2
  24. package/dist/parser/index.d.ts +9 -0
  25. package/dist/parser/index.js +537 -251
  26. package/dist/parser/registry.d.ts +8 -1
  27. package/dist/parser/title.d.ts +27 -0
  28. package/dist/renderers/clarification/ClarificationCard.vue.d.ts +19 -0
  29. package/dist/renderers/index.cjs +1 -1
  30. package/dist/renderers/index.d.ts +1 -0
  31. package/dist/renderers/index.js +641 -354
  32. package/dist/renderers/style.css +1 -1
  33. package/dist/right-panel/RightPanel.vue.d.ts +43 -0
  34. package/dist/right-panel/RightPanelIcon.vue.d.ts +38 -0
  35. package/dist/right-panel/RightPanelTabs.vue.d.ts +39 -0
  36. package/dist/right-panel/icons.d.ts +48 -0
  37. package/dist/right-panel/index.cjs +2 -0
  38. package/dist/right-panel/index.d.ts +43 -0
  39. package/dist/right-panel/index.js +1004 -0
  40. package/dist/right-panel/panels/index.d.ts +7 -0
  41. package/dist/right-panel/panels/newtab/NewTabPanel.vue.d.ts +27 -0
  42. package/dist/right-panel/panels/newtab/defaults.d.ts +6 -0
  43. package/dist/right-panel/panels/newtab/index.d.ts +4 -0
  44. package/dist/right-panel/panels/web/WebPanel.vue.d.ts +28 -0
  45. package/dist/right-panel/panels/web/index.d.ts +4 -0
  46. package/dist/right-panel/panels/web/useWebview.d.ts +59 -0
  47. package/dist/right-panel/registry.d.ts +24 -0
  48. package/dist/right-panel/runtime.d.ts +45 -0
  49. package/dist/right-panel/scope.d.ts +34 -0
  50. package/dist/right-panel/shared/BrowserToolbar.vue.d.ts +23 -0
  51. package/dist/right-panel/shared/RightPanelToolList.vue.d.ts +48 -0
  52. package/dist/right-panel/style.css +1 -0
  53. package/dist/right-panel/types.d.ts +363 -0
  54. package/dist/right-panel/useRightPanel.d.ts +39 -0
  55. package/dist/right-panel/useRightPanelTabs.d.ts +14 -0
  56. package/dist/tools/index.cjs +4 -4
  57. package/dist/tools/index.d.ts +1 -1
  58. package/dist/tools/index.js +200 -165
  59. package/dist/tools/markdown/index.d.ts +1 -1
  60. package/dist/tools/markdown/renderMarkdown.d.ts +25 -0
  61. package/dist/tools/useAutoScroll.d.ts +11 -3
  62. package/dist/web-ui/attach/AttachmentList.vue.d.ts +1 -1
  63. package/dist/web-ui/chat/ChatContainer.vue.d.ts +3 -3
  64. package/dist/web-ui/envswitch/EnvSwitch.vue.d.ts +2 -2
  65. package/dist/web-ui/index.cjs +1 -1
  66. package/dist/web-ui/index.d.ts +1 -1
  67. package/dist/web-ui/index.js +403 -392
  68. package/dist/web-ui/inputbox/Inputbox.vue.d.ts +4 -7
  69. package/dist/web-ui/style.css +1 -1
  70. package/package.json +13 -6
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const k=require("wi-chat/renderers"),e=require("vue"),N=require("element-plus"),F=require("wi-chat/parser"),L=require("wi-chat/tools"),I=r=>(e.pushScopeId("data-v-dc2d5f2b"),r=r(),e.popScopeId(),r),W={class:"wi-web-attach-card__icon"},H=I(()=>e.createElementVNode("div",{class:"wi-web-attach-card__image-fallback"},[e.createElementVNode("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"}),e.createElementVNode("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),e.createElementVNode("polyline",{points:"21 15 16 10 5 21"})])],-1)),K=I(()=>e.createElementVNode("div",{class:"wi-web-attach-card__image-fallback"},[e.createElementVNode("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"}),e.createElementVNode("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),e.createElementVNode("polyline",{points:"21 15 16 10 5 21"})])],-1)),Y={key:1,viewBox:"0 0 24 24",width:"20",height:"20",fill:"none",stroke:"currentColor","stroke-width":"2"},X=e.createStaticVNode('<rect x="3" y="3" width="18" height="18" rx="2" data-v-dc2d5f2b></rect><path d="M3 9h18" data-v-dc2d5f2b></path><path d="M3 15h18" data-v-dc2d5f2b></path><path d="M9 3v18" data-v-dc2d5f2b></path><path d="M15 3v18" data-v-dc2d5f2b></path>',5),Z=[X],G={key:2,viewBox:"0 0 24 24",width:"20",height:"20",fill:"none",stroke:"currentColor","stroke-width":"2"},J=I(()=>e.createElementVNode("path",{d:"M18 20V10"},null,-1)),ee=I(()=>e.createElementVNode("path",{d:"M12 20V4"},null,-1)),te=I(()=>e.createElementVNode("path",{d:"M6 20v-6"},null,-1)),oe=[J,ee,te],le={key:3,viewBox:"0 0 24 24",width:"20",height:"20",fill:"none",stroke:"currentColor","stroke-width":"2"},ne=e.createStaticVNode('<path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" data-v-dc2d5f2b></path><polyline points="14 2 14 8 20 8" data-v-dc2d5f2b></polyline><line x1="16" y1="13" x2="8" y2="13" data-v-dc2d5f2b></line><line x1="16" y1="17" x2="8" y2="17" data-v-dc2d5f2b></line><polyline points="10 9 9 9 8 9" data-v-dc2d5f2b></polyline>',5),ae=[ne],se={class:"wi-web-attach-card__info"},ie=["title"],re={key:0,class:"wi-web-attach-card__size"},ce={class:"wi-web-attach-card__actions"},de=I(()=>e.createElementVNode("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),e.createElementVNode("polyline",{points:"7 10 12 15 17 10"}),e.createElementVNode("line",{x1:"12",y1:"15",x2:"12",y2:"3"})],-1)),ue=[de],pe=e.defineComponent({__name:"AttachmentCard",props:{item:{},clickable:{type:Boolean,default:!1},removable:{type:Boolean,default:!1},downloadable:{type:Boolean,default:void 0},baseURL:{default:""},getFileUrl:{type:Function,default:void 0}},emits:["click","remove","download"],setup(r,{emit:g}){const n=r,a=g,u=e.computed(()=>{var o;return((o=n.item)==null?void 0:o.attachContent)||{}}),_=e.computed(()=>F.isImageAttachment(n.item)),v=e.computed(()=>F.resolveAttachPreviewUrl(n.item,n.baseURL,n.getFileUrl)),l=e.computed(()=>{if(n.removable)return!1;if(n.downloadable!==void 0)return n.downloadable;if(n.item.type&&n.item.type!=="file")return!1;const o=u.value;return!!(o.fileId||o.raw)}),i=()=>{a("click",n.item)},s=()=>{a("remove",n.item)},c=async()=>{a("download",n.item),await L.downloadAttachment(n.item,{baseURL:n.baseURL,getFileUrl:n.getFileUrl})};return(o,d)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["wi-web-attach-card",{"is-clickable":o.clickable||!!o.$attrs.onClick}]),onClick:i},[e.createElementVNode("div",W,[e.renderSlot(o.$slots,"icon",{item:o.item},()=>[_.value&&v.value?(e.openBlock(),e.createBlock(e.unref(N.ElImage),{key:0,src:v.value,"preview-src-list":[v.value],"zoom-rate":1.2,"preview-teleported":"",fit:"cover",class:"wi-web-attach-card__image",onClick:d[0]||(d[0]=e.withModifiers(()=>{},["stop"]))},{placeholder:e.withCtx(()=>[H]),error:e.withCtx(()=>[K]),_:1},8,["src","preview-src-list"])):o.item.type==="table"?(e.openBlock(),e.createElementBlock("svg",Y,Z)):o.item.type==="metric"?(e.openBlock(),e.createElementBlock("svg",G,oe)):(e.openBlock(),e.createElementBlock("svg",le,ae))],!0)]),e.createElementVNode("div",se,[e.createElementVNode("div",{class:"wi-web-attach-card__name",title:o.item.name},[e.renderSlot(o.$slots,"title",{item:o.item},()=>[e.createTextVNode(e.toDisplayString(o.item.name),1)],!0)],8,ie),o.item.description||o.$slots.description?(e.openBlock(),e.createElementBlock("div",re,[e.renderSlot(o.$slots,"description",{item:o.item},()=>[e.createTextVNode(e.toDisplayString(o.item.description),1)],!0)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",ce,[e.renderSlot(o.$slots,"actions",{item:o.item},()=>[l.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"wi-web-attach-card__action-btn wi-web-attach-card__download",title:"下载附件",onClick:e.withModifiers(c,["stop"])},ue)):e.createCommentVNode("",!0),o.removable?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"wi-web-attach-card__action-btn wi-web-attach-card__delete",title:"删除附件",onClick:e.withModifiers(s,["stop"])}," × ")):e.createCommentVNode("",!0)],!0)])],2))}}),S=(r,g)=>{const n=r.__vccOpts||r;for(const[a,u]of g)n[a]=u;return n},M=S(pe,[["__scopeId","data-v-dc2d5f2b"]]),me={key:0,class:"wi-web-attachment-list"},he=e.defineComponent({__name:"AttachmentList",props:{items:{default:()=>[]},removable:{type:Boolean,default:!1},downloadable:{type:Boolean,default:void 0},clickable:{type:Boolean,default:!1},baseURL:{default:""},getFileUrl:{type:Function,default:void 0}},emits:["remove","click","download"],setup(r,{emit:g}){const n=r,a=g,u=e.computed(()=>(n.items||[]).map((s,c)=>{var p,b;const o=F.normalizeAttachment(s),d=(p=o.attachContent)==null?void 0:p.raw,w=((b=o.attachContent)==null?void 0:b.fileId)||(d?`${d.name}_${d.size}_${c}`:`${o.name}_${c}`);return{...o,key:w}})),_=(i,s)=>{a("remove",i,s)},v=(i,s)=>{a("click",i,s)},l=(i,s)=>{a("download",i,s)};return(i,s)=>u.value.length>0?(e.openBlock(),e.createElementBlock("div",me,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,(c,o)=>(e.openBlock(),e.createBlock(M,{key:c.key||o,item:c,removable:i.removable,downloadable:i.downloadable,clickable:i.clickable||!!i.$attrs.onClick,"base-u-r-l":i.baseURL,"get-file-url":i.getFileUrl,onClick:d=>v(c,o),onRemove:d=>_(o,c),onDownload:d=>l(c,o)},{icon:e.withCtx(d=>[e.renderSlot(i.$slots,"icon",e.normalizeProps(e.guardReactiveProps(d)),void 0,!0)]),title:e.withCtx(d=>[e.renderSlot(i.$slots,"title",e.normalizeProps(e.guardReactiveProps(d)),void 0,!0)]),description:e.withCtx(d=>[e.renderSlot(i.$slots,"description",e.normalizeProps(e.guardReactiveProps(d)),void 0,!0)]),actions:e.withCtx(d=>[e.renderSlot(i.$slots,"actions",e.normalizeProps(e.guardReactiveProps(d)),void 0,!0)]),_:2},1032,["item","removable","downloadable","clickable","base-u-r-l","get-file-url","onClick","onRemove","onDownload"]))),128))])):e.createCommentVNode("",!0)}}),T=S(he,[["__scopeId","data-v-ff76d134"]]),V=r=>(e.pushScopeId("data-v-e3cdddb7"),r=r(),e.popScopeId(),r),we={class:"wi-web-inputbox"},_e={key:0,class:"wi-web-inputbox__top-bar"},ve={key:0,class:"wi-web-inputbox__agent-bar"},be={class:"wi-web-inputbox__agent-icon-wrapper"},fe=["src"],ge={key:1,class:"wi-web-inputbox__agent-svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},ke=V(()=>e.createElementVNode("circle",{cx:"12",cy:"8",r:"4"},null,-1)),ye=V(()=>e.createElementVNode("path",{d:"M4 20c0-4 4-6 8-6s8 2 8 6"},null,-1)),Be=[ke,ye],Ee={class:"wi-web-inputbox__agent-title"},Ve=V(()=>e.createElementVNode("path",{d:"M840.4 300H183.6c-19.7 0-30.7 22.7-18.5 37.1l328.4 388.7c9.5 11.2 27.5 11.2 37 0l328.4-388.7c12.2-14.4 1.2-37.1-18.5-37.1z",fill:"currentColor"},null,-1)),Ce=[Ve],Ne={class:"wi-web-agent-list"},$e=V(()=>e.createElementVNode("div",{class:"wi-web-agent-list__header"},"切换智能体",-1)),Se={key:0,class:"wi-web-agent-list__empty"},Ae=["onClick"],Ie={class:"wi-web-agent-item__left"},Ue=["src"],Fe={key:1,class:"wi-web-agent-item__avatar-fallback"},Pe=V(()=>e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("circle",{cx:"12",cy:"8",r:"4"}),e.createElementVNode("path",{d:"M4 20c0-4 4-6 8-6s8 2 8 6"})],-1)),Re=[Pe],Te={class:"wi-web-agent-item__title"},xe={key:0,class:"wi-web-agent-item__check"},ze={key:1,class:"wi-web-inputbox__options"},Le={class:"wi-web-inputbox__main"},Me={key:0,class:"wi-web-inputbox__attachments"},Oe={class:"wi-web-inputbox__footer"},De={class:"wi-web-inputbox__footer-left"},je={class:"wi-web-inputbox__footer-right"},Qe={key:0,class:"wi-web-inputbox__counter"},qe=V(()=>e.createElementVNode("svg",{viewBox:"0 0 1024 1024",width:"16",height:"16",fill:"currentColor"},[e.createElementVNode("path",{d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896z m0 85.333333a362.666667 362.666667 0 1 0 0 725.333334 362.666667 362.666667 0 0 0 0-725.333334z m120.746667 181.333334a42.666667 42.666667 0 0 1 54.826666 4.693333l5.546667 6.357334a42.666667 42.666667 0 0 1-4.693333 54.826666l-6.357334 5.546667-114.730666 114.773333 114.730666 114.730667a42.666667 42.666667 0 0 1 5.461334 54.826666l-5.461334 6.357334a42.666667 42.666667 0 0 1-54.826666 5.461333l-6.357334-5.461333-114.730666-114.730667-114.730667 114.730667a42.666667 42.666667 0 0 1-54.826667 5.461333l-6.357333-5.461333a42.666667 42.666667 0 0 1-5.461333-54.826667l5.461333-6.357333 114.730667-114.730667-114.730667-114.773333a42.666667 42.666667 0 0 1-5.461333-54.826667l5.461333-6.357333a42.666667 42.666667 0 0 1 54.826667-5.461334l6.357333 5.461334 114.730667 114.730666 114.730666-114.730666a42.666667 42.666667 0 0 1 24.32-11.434667z"})],-1)),We=[qe],He=["disabled"],Ke=V(()=>e.createElementVNode("svg",{viewBox:"0 0 24 24",width:"18",height:"18",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("path",{d:"M21.44 11.05l-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48"})],-1)),Ye=[Ke],Xe=["accept"],Ze=V(()=>e.createElementVNode("div",{class:"wi-web-inputbox__divider"},null,-1)),Ge=V(()=>e.createElementVNode("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"currentColor"},[e.createElementVNode("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"})],-1)),Je=[Ge],et=V(()=>e.createElementVNode("svg",{viewBox:"0 0 24 24",width:"18",height:"18",fill:"currentColor"},[e.createElementVNode("path",{d:"M2.01 21L23 12 2.01 3 2 10l15 2-15 2z"})],-1)),tt=[et],ot=e.defineComponent({__name:"Inputbox",props:{modelValue:{default:""},placeholder:{default:'"↑↓"切换历史输入,"⇧↵"换行'},disabled:{type:Boolean,default:!1},talking:{type:Boolean,default:!1},maxlength:{default:1024},autosize:{type:[Object,Boolean],default:()=>({minRows:3,maxRows:8})},showAgentBar:{type:Boolean,default:!0},showUpload:{type:Boolean,default:!0},showWordLimit:{type:Boolean,default:!0},accept:{default:".csv,.txt,.pdf,.doc,.docx,.xls,.xlsx,.png,.jpg,.jpeg,.gif,.mp4"},agentList:{default:()=>[]},currentAgent:{default:null},defaultAgentTitle:{default:"系统默认智能体"},baseURL:{default:""},getFileUrl:{type:Function,default:void 0},incPrevQuestion:{default:"Y"},showIncPrevQuestion:{type:Boolean,default:!0}},emits:["update:modelValue","submit","stop","selectAgent","update:files","update:attachments","update:incPrevQuestion"],setup(r,{expose:g,emit:n}){const a=r,u=n,_=e.ref(null),v=e.ref(null),l=e.ref(!1),i=t=>F.parseRealtimeAttachment(t),s=e.ref([]),c=e.computed(()=>!!!(a.modelValue&&a.modelValue.trim())),o=t=>t?a.getFileUrl?a.getFileUrl(t):F.resolveRemoteFileUrl(t,a.baseURL,"/algorithm/get_file_data"):"",d=t=>{u("selectAgent",t),l.value=!1},w=t=>{u("update:incPrevQuestion",t?"N":"Y")},p=()=>{u("update:modelValue","")},b=()=>{v.value&&(v.value.value="",v.value.click())},y=t=>{const h=t.target;if(h.files&&h.files.length>0){const m=Array.from(h.files);for(const f of m)s.value.some(U=>{var z;const R=((z=U.attachContent)==null?void 0:z.raw)||U.raw;return R&&R.name===f.name&&R.size===f.size&&R.lastModified===f.lastModified})||s.value.push(i(f));const E=s.value.map(f=>{var $;return(($=f.attachContent)==null?void 0:$.raw)||f.raw}).filter(Boolean);u("update:files",E),u("update:attachments",[...s.value])}},C=t=>{var f;const h=s.value.splice(t,1)[0],m=((f=h==null?void 0:h.attachContent)==null?void 0:f.url)||(h==null?void 0:h.url);m&&m.startsWith("blob:")&&URL.revokeObjectURL(m);const E=s.value.map($=>{var U;return((U=$.attachContent)==null?void 0:U.raw)||$.raw}).filter(Boolean);u("update:files",E),u("update:attachments",[...s.value])},A=()=>{s.value.forEach(t=>{var m;const h=((m=t==null?void 0:t.attachContent)==null?void 0:m.url)||(t==null?void 0:t.url);h&&h.startsWith("blob:")&&URL.revokeObjectURL(h)}),s.value=[],u("update:files",[]),u("update:attachments",[])},P=()=>{if(a.disabled||c.value)return;const t=a.modelValue||"",h=s.value.map(E=>{var f;return((f=E.attachContent)==null?void 0:f.raw)||E.raw}).filter(Boolean),m=[...s.value];u("submit",{text:t,files:h,attachments:m,agent:a.currentAgent}),s.value=[],u("update:files",[]),u("update:attachments",[])},B=t=>{t.isComposing||t.keyCode===229||(t.preventDefault(),P())};return e.onBeforeUnmount(()=>{A()}),g({clearFiles:A,getFiles:()=>s.value.map(t=>{var h;return((h=t.attachContent)==null?void 0:h.raw)||t.raw}).filter(Boolean),getAttachments:()=>s.value,focus:()=>{var t;(t=_.value)==null||t.focus()}}),(t,h)=>(e.openBlock(),e.createElementBlock("div",we,[t.showAgentBar||t.showIncPrevQuestion?(e.openBlock(),e.createElementBlock("div",_e,[t.showAgentBar?(e.openBlock(),e.createElementBlock("div",ve,[e.createVNode(e.unref(N.ElPopover),{visible:l.value,"onUpdate:visible":h[0]||(h[0]=m=>l.value=m),placement:"top-start",width:260,trigger:"click","popper-class":"wi-web-agent-popover"},{reference:e.withCtx(()=>{var m,E,f;return[e.createElementVNode("div",{class:e.normalizeClass(["wi-web-inputbox__agent-btn",{"is-disabled":t.disabled||t.talking}])},[e.createElementVNode("div",be,[(m=t.currentAgent)!=null&&m.image_id&&o(t.currentAgent.image_id)?(e.openBlock(),e.createElementBlock("img",{key:0,src:o(t.currentAgent.image_id),class:"wi-web-inputbox__agent-avatar"},null,8,fe)):(e.openBlock(),e.createElementBlock("svg",ge,Be))]),e.createElementVNode("span",Ee," @"+e.toDisplayString(((E=t.currentAgent)==null?void 0:E.entry_title)||((f=t.currentAgent)==null?void 0:f.entry_id)||t.defaultAgentTitle),1),(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["wi-web-inputbox__agent-arrow",{"is-active":l.value}]),viewBox:"0 0 1024 1024",width:"12",height:"12"},Ce,2))],2)]}),default:e.withCtx(()=>[e.createElementVNode("div",Ne,[$e,!t.agentList||t.agentList.length===0?(e.openBlock(),e.createElementBlock("div",Se," 暂无可选智能体 ")):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.agentList,m=>{var E,f;return e.openBlock(),e.createElementBlock("div",{key:m.entry_id,class:e.normalizeClass(["wi-web-agent-item",{"is-active":m.entry_id===((E=t.currentAgent)==null?void 0:E.entry_id)}]),onClick:$=>d(m)},[e.createElementVNode("div",Ie,[m.image_id&&o(m.image_id)?(e.openBlock(),e.createElementBlock("img",{key:0,src:o(m.image_id),class:"wi-web-agent-item__avatar"},null,8,Ue)):(e.openBlock(),e.createElementBlock("div",Fe,Re)),e.createElementVNode("span",Te,e.toDisplayString(m.entry_title||m.entry_id),1)]),m.entry_id===((f=t.currentAgent)==null?void 0:f.entry_id)?(e.openBlock(),e.createElementBlock("span",xe,"✓")):e.createCommentVNode("",!0)],10,Ae)}),128))])]),_:1},8,["visible"])])):e.createCommentVNode("",!0),t.showIncPrevQuestion?(e.openBlock(),e.createElementBlock("div",ze,[e.createVNode(e.unref(N.ElCheckbox),{class:"wi-web-inputbox__ignore-prev","model-value":t.incPrevQuestion==="N","onUpdate:modelValue":w},{default:e.withCtx(()=>[e.createTextVNode(" 忽略之前对话 ")]),_:1},8,["model-value"])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",Le,[s.value.length>0?(e.openBlock(),e.createElementBlock("div",Me,[e.createVNode(T,{items:s.value,"base-u-r-l":t.baseURL,"get-file-url":t.getFileUrl,removable:"",onRemove:C},null,8,["items","base-u-r-l","get-file-url"])])):e.createCommentVNode("",!0),e.createVNode(e.unref(N.ElInput),{ref_key:"textareaRef",ref:_,"model-value":t.modelValue,type:"textarea",resize:"none",maxlength:t.maxlength,autosize:t.autosize,placeholder:t.placeholder,disabled:t.disabled||t.talking,class:"wi-web-inputbox__textarea","onUpdate:modelValue":h[1]||(h[1]=m=>u("update:modelValue",m)),onKeydown:e.withKeys(e.withModifiers(B,["exact"]),["enter"])},null,8,["model-value","maxlength","autosize","placeholder","disabled","onKeydown"]),e.createElementVNode("div",Oe,[e.createElementVNode("div",De,[e.renderSlot(t.$slots,"footer-left",{},void 0,!0)]),e.createElementVNode("div",je,[t.showWordLimit?(e.openBlock(),e.createElementBlock("div",Qe,e.toDisplayString((t.modelValue||"").length)+"/"+e.toDisplayString(t.maxlength),1)):e.createCommentVNode("",!0),t.modelValue&&!t.disabled&&!t.talking?(e.openBlock(),e.createBlock(e.unref(N.ElTooltip),{key:1,content:"清除",placement:"top"},{default:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"wi-web-inputbox__icon-btn",onClick:p},We)]),_:1})):e.createCommentVNode("",!0),t.showUpload?(e.openBlock(),e.createBlock(e.unref(N.ElTooltip),{key:2,content:"上传附件",placement:"top"},{default:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"wi-web-inputbox__icon-btn",disabled:t.disabled||t.talking,onClick:b},Ye,8,He)]),_:1})):e.createCommentVNode("",!0),e.createElementVNode("input",{ref_key:"fileInputRef",ref:v,type:"file",multiple:"",accept:t.accept,class:"wi-web-inputbox__hidden-file",onChange:y},null,40,Xe),Ze,t.talking?(e.openBlock(),e.createBlock(e.unref(N.ElTooltip),{key:3,content:"停止生成",placement:"top"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:"wi-web-inputbox__action-btn wi-web-inputbox__action-btn--stop",onClick:h[2]||(h[2]=m=>u("stop"))},Je)]),_:1})):(e.openBlock(),e.createBlock(e.unref(N.ElTooltip),{key:4,content:"发送",placement:"top"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["wi-web-inputbox__action-btn wi-web-inputbox__action-btn--send",{"is-disabled":t.disabled||!t.talking&&c.value}]),onClick:P},tt,2)]),_:1}))])])])]))}}),O=S(ot,[["__scopeId","data-v-e3cdddb7"]]),lt=[{id:"recordset",answerType:"recordset",component:e.defineAsyncComponent(()=>Promise.resolve().then(()=>Ct))}],D=r=>k.createAnswerContentMap([...lt,...r??[]]),nt=r=>(e.pushScopeId("data-v-bcad9562"),r=r(),e.popScopeId(),r),at={key:0,class:"wi-web-chat-messages__loading"},st={key:1,class:"wi-web-chat-messages__empty"},it=nt(()=>e.createElementVNode("div",{class:"wi-web-chat-messages__empty-logo"},"WI",-1)),rt={class:"wi-web-chat-messages__empty-title"},ct={class:"wi-web-chat-messages__empty-description"},dt={key:0,class:"wi-web-chat-messages__user"},ut={class:"wi-web-chat-messages__user-wrapper"},pt={class:"wi-web-chat-messages__user-bubble"},mt={key:1,class:"wi-web-chat-messages__assistant"},ht=e.defineComponent({__name:"ChatMessagesView",props:{messages:{},parsers:{default:()=>[]},baseURL:{default:""},getFileUrl:{type:Function,default:void 0},outputFileConfig:{},loading:{type:Boolean,default:!1},emptyTitle:{default:"输入问题,开始与 AI 对话"},emptyDescription:{default:"回答内容由共享渲染层统一分发"}},emits:["loadOlder","updateThinkingExpanded"],setup(r,{expose:g,emit:n}){const a=r,u=n;k.provideOutputFileConfig(a.outputFileConfig??{getFileUrl:o=>{var d;return((d=a.getFileUrl)==null?void 0:d.call(a,o))??(a.baseURL?`${a.baseURL.replace(/\/$/,"")}/algorithm/get_file_data?file_id=${encodeURIComponent(o)}`:"")}});const _=e.ref(),{showScrollToBottom:v,forceScrollToBottom:l,requestScrollToBottom:i,onReachTop:s}=L.useAutoScroll(_),c=e.computed(()=>D(a.parsers));return e.watch(()=>a.messages[a.messages.length-1],()=>{i()},{deep:!0}),s(()=>u("loadOlder")),g({forceScrollToBottom:l,requestScrollToBottom:i}),(o,d)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"scrollEl",ref:_,class:"wi-web-chat-messages"},[o.loading?(e.openBlock(),e.createElementBlock("div",at,"历史加载中...")):o.messages.length===0?(e.openBlock(),e.createElementBlock("div",st,[it,e.createElementVNode("div",rt,e.toDisplayString(o.emptyTitle),1),e.createElementVNode("div",ct,e.toDisplayString(o.emptyDescription),1)])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.messages,w=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:w.id},[w.role==="user"?(e.openBlock(),e.createElementBlock("div",dt,[e.createElementVNode("div",ut,[w.attachments&&w.attachments.length>0?(e.openBlock(),e.createBlock(T,{key:0,class:"wi-web-chat-messages__attachments",items:w.attachments,"base-u-r-l":o.baseURL,"get-file-url":o.getFileUrl},null,8,["items","base-u-r-l","get-file-url"])):e.createCommentVNode("",!0),e.createElementVNode("div",pt,e.toDisplayString(w.content),1)])])):(e.openBlock(),e.createElementBlock("div",mt,[e.createVNode(e.unref(k.DeepThinkingSteps),{steps:w.thinking.steps,expanded:w.thinking.expanded,"onUpdate:expanded":p=>u("updateThinkingExpanded",w,p)},null,8,["steps","expanded","onUpdate:expanded"]),e.createVNode(e.unref(k.AiAnswerBubble),{answer:w.answer,error:w.error,stopped:w.stopped,"content-map":c.value},null,8,["answer","error","stopped","content-map"])]))],64))),128)),e.createVNode(e.Transition,{name:"wi-web-chat-messages-fade"},{default:e.withCtx(()=>[e.unref(v)?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"wi-web-chat-messages__bottom",onClick:d[0]||(d[0]=(...w)=>e.unref(l)&&e.unref(l)(...w))}," 回到底部 ")):e.createCommentVNode("",!0)]),_:1})],512))}}),j=S(ht,[["__scopeId","data-v-bcad9562"]]),wt={class:"wi-web-chat-container"},_t={class:"wi-web-chat-container__footer"},vt=e.defineComponent({__name:"ChatContainer",props:{messages:{},parsers:{default:()=>[]},baseURL:{default:""},getFileUrl:{type:Function,default:void 0},outputFileConfig:{},loading:{type:Boolean,default:!1},talking:{type:Boolean,default:!1},session:{default:""},question:{default:""},incPrevQuestion:{default:"Y"},agentList:{default:()=>[]},currentAgent:{default:null},placeholder:{default:"请输入问题,按 Enter 发送,Shift+Enter 换行"},hasMore:{type:Boolean,default:!0},emptyTitle:{default:"输入问题,开始与 AI 对话"},emptyDescription:{default:"回答内容由共享渲染层统一分发"},disabled:{type:Boolean,default:!1}},emits:["update:question","update:incPrevQuestion","submit","stop","selectAgent","loadOlder","updateThinkingExpanded"],setup(r,{emit:g}){const n=r,a=g,u=l=>{a("submit",l)},_=()=>{n.hasMore&&a("loadOlder")},v=l=>{a("selectAgent",l)};return(l,i)=>(e.openBlock(),e.createElementBlock("section",wt,[e.renderSlot(l.$slots,"messages",{},()=>[e.createVNode(j,{messages:l.messages,parsers:l.parsers,"base-u-r-l":l.baseURL,"get-file-url":l.getFileUrl,"output-file-config":l.outputFileConfig,loading:l.loading,"empty-title":l.emptyTitle,"empty-description":l.emptyDescription,onLoadOlder:_,onUpdateThinkingExpanded:i[0]||(i[0]=(s,c)=>a("updateThinkingExpanded",s,c))},null,8,["messages","parsers","base-u-r-l","get-file-url","output-file-config","loading","empty-title","empty-description"])],!0),e.renderSlot(l.$slots,"above-input",{},void 0,!0),e.createElementVNode("footer",_t,[e.createVNode(O,{"model-value":l.question,"onUpdate:modelValue":i[1]||(i[1]=s=>a("update:question",s)),"inc-prev-question":l.incPrevQuestion,"onUpdate:incPrevQuestion":i[2]||(i[2]=s=>a("update:incPrevQuestion",s)),"base-u-r-l":l.baseURL,disabled:l.disabled||!l.session,talking:l.talking,"agent-list":l.agentList,"current-agent":l.currentAgent,placeholder:l.placeholder,"get-file-url":l.getFileUrl,onSelectAgent:v,onSubmit:u,onStop:i[3]||(i[3]=s=>a("stop"))},null,8,["model-value","inc-prev-question","base-u-r-l","disabled","talking","agent-list","current-agent","placeholder","get-file-url"])])]))}}),bt=S(vt,[["__scopeId","data-v-8663b501"]]),Q=r=>(e.pushScopeId("data-v-96941d57"),r=r(),e.popScopeId(),r),ft={key:0,class:"wi-web-recordset"},gt={class:"wi-web-recordset__header"},kt={class:"wi-web-recordset__title"},yt=Q(()=>e.createElementVNode("button",{type:"button",class:"wi-web-recordset__columns-btn",title:"选择展示列"},[e.createElementVNode("svg",{class:"wi-web-recordset__columns-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"}),e.createElementVNode("path",{d:"M9 4v16M15 4v16"})]),e.createElementVNode("span",null,"列")],-1)),Bt={class:"wi-web-recordset__columns-panel"},Et=Q(()=>e.createElementVNode("div",{class:"wi-web-recordset__columns-panel-title"},"选择展示列",-1)),Vt=e.defineComponent({__name:"RecordsetTable",props:{report:{},maxHeight:{default:420}},setup(r){const g=r,n=e.computed(()=>{var p;return((p=g.report)==null?void 0:p.values)??{}}),a=e.computed(()=>n.value.chart==="table"),u=e.computed(()=>n.value.title??""),_=e.computed(()=>(Array.isArray(n.value.cols)?n.value.cols:[]).map((b,y)=>({key:`c${y}`,title:(b==null?void 0:b.title)||(b==null?void 0:b.name)||`列${y+1}`}))),v=e.computed(()=>{const p=Number(n.value.max_cols);return Number.isFinite(p)&&p>0?p:1/0}),l=e.computed(()=>_.value.length>v.value),i=e.ref([]),s=e.computed(()=>new Set(i.value)),c=e.computed(()=>_.value.filter(p=>s.value.has(p.key)));e.watch(()=>_.value.map(p=>p.key).join("|"),()=>{i.value=_.value.slice(0,v.value).map(p=>p.key)},{immediate:!0});const o=e.computed(()=>(Array.isArray(n.value.values)?n.value.values:[]).map(b=>{const y={};return _.value.forEach((C,A)=>{y[C.key]=Array.isArray(b)?b[A]:void 0}),y})),d=e.ref(!1),w=(p,b)=>{const y=new Set(i.value);b?y.add(p):y.delete(p),i.value=_.value.filter(C=>y.has(C.key)).map(C=>C.key)};return(p,b)=>{const y=e.resolveComponent("el-checkbox"),C=e.resolveComponent("el-popover"),A=e.resolveComponent("el-table-column"),P=e.resolveComponent("el-table");return a.value?(e.openBlock(),e.createElementBlock("div",ft,[e.createElementVNode("div",gt,[e.createElementVNode("div",kt,e.toDisplayString(u.value),1),l.value?(e.openBlock(),e.createBlock(C,{key:0,visible:d.value,"onUpdate:visible":b[0]||(b[0]=B=>d.value=B),placement:"bottom-end",width:220,trigger:"click","popper-class":"wi-web-recordset-columns-popper"},{reference:e.withCtx(()=>[yt]),default:e.withCtx(()=>[e.createElementVNode("div",Bt,[Et,(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.value,B=>(e.openBlock(),e.createBlock(y,{key:B.key,class:"wi-web-recordset__column-item","model-value":s.value.has(B.key),"onUpdate:modelValue":t=>w(B.key,!!t)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(B.title),1)]),_:2},1032,["model-value","onUpdate:modelValue"]))),128))])]),_:1},8,["visible"])):e.createCommentVNode("",!0)]),e.createVNode(P,{data:o.value,border:"",size:"small",class:"wi-web-recordset__table","max-height":p.maxHeight},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,B=>(e.openBlock(),e.createBlock(A,{key:B.key,prop:B.key,label:B.title,"min-width":"120","show-overflow-tooltip":""},null,8,["prop","label"]))),128))]),_:1},8,["data","max-height"])])):e.createCommentVNode("",!0)}}}),q=S(Vt,[["__scopeId","data-v-96941d57"]]),Ct=Object.freeze(Object.defineProperty({__proto__:null,default:q},Symbol.toStringTag,{value:"Module"})),x=r=>(e.pushScopeId("data-v-94659445"),r=r(),e.popScopeId(),r),Nt={class:"wi-web-env-switch__track"},$t={class:"wi-web-env-switch__items"},St=["disabled","onClick"],At={class:"wi-web-env-switch__icon"},It={key:0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"},Ut=x(()=>e.createElementVNode("path",{d:"M17.5 19a4.5 4.5 0 0 0 .6-8.96 6 6 0 0 0-11.63 1.4A3.8 3.8 0 0 0 7 19z"},null,-1)),Ft=[Ut],Pt={key:1,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round"},Rt=x(()=>e.createElementVNode("rect",{x:"2.5",y:"4",width:"19",height:"12",rx:"2","stroke-linejoin":"round"},null,-1)),Tt=x(()=>e.createElementVNode("path",{d:"M8.5 20h7M12 16v4"},null,-1)),xt=[Rt,Tt],zt={class:"wi-web-env-switch__label"},Lt={key:0,class:"wi-web-env-switch__hint"},Mt={class:"wi-web-env-switch__hint-text"},Ot={key:0,class:"wi-web-env-switch__hint-status"},Dt=e.defineComponent({__name:"EnvSwitch",props:{modelValue:{default:"local"},options:{default:()=>[]},disabled:{type:Boolean,default:!1},size:{default:"default"},showHint:{type:Boolean,default:!0}},emits:["update:modelValue","change"],setup(r,{emit:g}){const n=r,a=g,u=[{value:"local",label:"本地电脑",description:"在当前设备上执行,文件与终端直连本机",status:"已就绪",online:!0},{value:"cloud",label:"云电脑",description:"在云端环境中执行,算力与存储由服务端提供",status:"未连接",online:!1}],_={default:3,small:2},v=e.computed(()=>{const c=n.options??[];return c.length>0?c:u}),l=e.computed(()=>{if(!n.showHint)return null;const c=v.value;return c.find(o=>o.value===n.modelValue)??c[0]??null}),i=e.computed(()=>{const c=v.value,o=c.length||1,d=Math.max(c.findIndex(p=>p.value===n.modelValue),0),w=_[n.size]??_.default;return{width:`calc(${100/o}% - ${2*w/o}px)`,transform:`translateX(${d*100}%)`}}),s=c=>{n.disabled||c.disabled||c.value!==n.modelValue&&(a("update:modelValue",c.value),a("change",c))};return(c,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["wi-web-env-switch",[`is-${c.size}`,{"is-disabled":c.disabled}]])},[e.createElementVNode("div",Nt,[e.createElementVNode("span",{class:"wi-web-env-switch__thumb",style:e.normalizeStyle(i.value)},null,4),e.createElementVNode("div",$t,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,d=>(e.openBlock(),e.createElementBlock("button",{key:d.value,type:"button",class:e.normalizeClass(["wi-web-env-switch__item",{"is-active":d.value===c.modelValue,"is-disabled":d.disabled}]),disabled:c.disabled||d.disabled,onClick:w=>s(d)},[e.createElementVNode("span",At,[d.value==="cloud"?(e.openBlock(),e.createElementBlock("svg",It,Ft)):(e.openBlock(),e.createElementBlock("svg",Pt,xt))]),e.createElementVNode("span",zt,e.toDisplayString(d.label),1)],10,St))),128))])]),l.value?(e.openBlock(),e.createElementBlock("div",Lt,[e.createElementVNode("span",Mt,e.toDisplayString(l.value.description),1),l.value.status?(e.openBlock(),e.createElementBlock("span",Ot,[e.createElementVNode("i",{class:e.normalizeClass(["wi-web-env-switch__dot",{"is-online":l.value.online}])},null,2),e.createTextVNode(" "+e.toDisplayString(l.value.status),1)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],2))}}),jt=S(Dt,[["__scopeId","data-v-94659445"]]);Object.defineProperty(exports,"AiAnswerBubble",{enumerable:!0,get:()=>k.AiAnswerBubble});Object.defineProperty(exports,"DeepThinkingSteps",{enumerable:!0,get:()=>k.DeepThinkingSteps});Object.defineProperty(exports,"IframePage",{enumerable:!0,get:()=>k.IframePage});Object.defineProperty(exports,"KnowledgeStreamResult",{enumerable:!0,get:()=>k.KnowledgeStreamResult});Object.defineProperty(exports,"OutputFile",{enumerable:!0,get:()=>k.OutputFile});Object.defineProperty(exports,"createAnswerContentMap",{enumerable:!0,get:()=>k.createAnswerContentMap});Object.defineProperty(exports,"injectIframeResizerChild",{enumerable:!0,get:()=>k.injectIframeResizerChild});Object.defineProperty(exports,"provideIframePageConfig",{enumerable:!0,get:()=>k.provideIframePageConfig});Object.defineProperty(exports,"provideOutputFileConfig",{enumerable:!0,get:()=>k.provideOutputFileConfig});Object.defineProperty(exports,"resolveIframePlaceholders",{enumerable:!0,get:()=>k.resolveIframePlaceholders});Object.defineProperty(exports,"useIframePage",{enumerable:!0,get:()=>k.useIframePage});exports.AttachmentCard=M;exports.AttachmentList=T;exports.ChatContainer=bt;exports.ChatMessagesView=j;exports.EnvSwitch=jt;exports.Inputbox=O;exports.RecordsetTable=q;exports.createWebAnswerContentMap=D;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("wi-chat/renderers"),e=require("vue"),N=require("element-plus"),F=require("wi-chat/parser"),L=require("wi-chat/tools"),I=d=>(e.pushScopeId("data-v-dc2d5f2b"),d=d(),e.popScopeId(),d),W={class:"wi-web-attach-card__icon"},H=I(()=>e.createElementVNode("div",{class:"wi-web-attach-card__image-fallback"},[e.createElementVNode("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"}),e.createElementVNode("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),e.createElementVNode("polyline",{points:"21 15 16 10 5 21"})])],-1)),K=I(()=>e.createElementVNode("div",{class:"wi-web-attach-card__image-fallback"},[e.createElementVNode("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"}),e.createElementVNode("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),e.createElementVNode("polyline",{points:"21 15 16 10 5 21"})])],-1)),Y={key:1,viewBox:"0 0 24 24",width:"20",height:"20",fill:"none",stroke:"currentColor","stroke-width":"2"},X=e.createStaticVNode('<rect x="3" y="3" width="18" height="18" rx="2" data-v-dc2d5f2b></rect><path d="M3 9h18" data-v-dc2d5f2b></path><path d="M3 15h18" data-v-dc2d5f2b></path><path d="M9 3v18" data-v-dc2d5f2b></path><path d="M15 3v18" data-v-dc2d5f2b></path>',5),Z=[X],G={key:2,viewBox:"0 0 24 24",width:"20",height:"20",fill:"none",stroke:"currentColor","stroke-width":"2"},J=I(()=>e.createElementVNode("path",{d:"M18 20V10"},null,-1)),ee=I(()=>e.createElementVNode("path",{d:"M12 20V4"},null,-1)),te=I(()=>e.createElementVNode("path",{d:"M6 20v-6"},null,-1)),oe=[J,ee,te],le={key:3,viewBox:"0 0 24 24",width:"20",height:"20",fill:"none",stroke:"currentColor","stroke-width":"2"},ne=e.createStaticVNode('<path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" data-v-dc2d5f2b></path><polyline points="14 2 14 8 20 8" data-v-dc2d5f2b></polyline><line x1="16" y1="13" x2="8" y2="13" data-v-dc2d5f2b></line><line x1="16" y1="17" x2="8" y2="17" data-v-dc2d5f2b></line><polyline points="10 9 9 9 8 9" data-v-dc2d5f2b></polyline>',5),ae=[ne],se={class:"wi-web-attach-card__info"},ie=["title"],re={key:0,class:"wi-web-attach-card__size"},ce={class:"wi-web-attach-card__actions"},de=I(()=>e.createElementVNode("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),e.createElementVNode("polyline",{points:"7 10 12 15 17 10"}),e.createElementVNode("line",{x1:"12",y1:"15",x2:"12",y2:"3"})],-1)),ue=[de],pe=e.defineComponent({__name:"AttachmentCard",props:{item:{},clickable:{type:Boolean,default:!1},removable:{type:Boolean,default:!1},downloadable:{type:Boolean,default:void 0},baseURL:{default:""},getFileUrl:{type:Function,default:void 0}},emits:["click","remove","download"],setup(d,{emit:g}){const a=d,s=g,p=e.computed(()=>{var o;return((o=a.item)==null?void 0:o.attachContent)||{}}),w=e.computed(()=>F.isImageAttachment(a.item)),_=e.computed(()=>F.resolveAttachPreviewUrl(a.item,a.baseURL,a.getFileUrl)),l=e.computed(()=>{if(a.removable)return!1;if(a.downloadable!==void 0)return a.downloadable;if(a.item.type&&a.item.type!=="file")return!1;const o=p.value;return!!(o.fileId||o.raw)}),c=()=>{s("click",a.item)},i=()=>{s("remove",a.item)},u=async()=>{s("download",a.item),await L.downloadAttachment(a.item,{baseURL:a.baseURL,getFileUrl:a.getFileUrl})};return(o,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["wi-web-attach-card",{"is-clickable":o.clickable||!!o.$attrs.onClick}]),onClick:c},[e.createElementVNode("div",W,[e.renderSlot(o.$slots,"icon",{item:o.item},()=>[w.value&&_.value?(e.openBlock(),e.createBlock(e.unref(N.ElImage),{key:0,src:_.value,"preview-src-list":[_.value],"zoom-rate":1.2,"preview-teleported":"",fit:"cover",class:"wi-web-attach-card__image",onClick:n[0]||(n[0]=e.withModifiers(()=>{},["stop"]))},{placeholder:e.withCtx(()=>[H]),error:e.withCtx(()=>[K]),_:1},8,["src","preview-src-list"])):o.item.type==="table"?(e.openBlock(),e.createElementBlock("svg",Y,Z)):o.item.type==="metric"?(e.openBlock(),e.createElementBlock("svg",G,oe)):(e.openBlock(),e.createElementBlock("svg",le,ae))],!0)]),e.createElementVNode("div",se,[e.createElementVNode("div",{class:"wi-web-attach-card__name",title:o.item.name},[e.renderSlot(o.$slots,"title",{item:o.item},()=>[e.createTextVNode(e.toDisplayString(o.item.name),1)],!0)],8,ie),o.item.description||o.$slots.description?(e.openBlock(),e.createElementBlock("div",re,[e.renderSlot(o.$slots,"description",{item:o.item},()=>[e.createTextVNode(e.toDisplayString(o.item.description),1)],!0)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",ce,[e.renderSlot(o.$slots,"actions",{item:o.item},()=>[l.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"wi-web-attach-card__action-btn wi-web-attach-card__download",title:"下载附件",onClick:e.withModifiers(u,["stop"])},ue)):e.createCommentVNode("",!0),o.removable?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"wi-web-attach-card__action-btn wi-web-attach-card__delete",title:"删除附件",onClick:e.withModifiers(i,["stop"])}," × ")):e.createCommentVNode("",!0)],!0)])],2))}}),S=(d,g)=>{const a=d.__vccOpts||d;for(const[s,p]of g)a[s]=p;return a},M=S(pe,[["__scopeId","data-v-dc2d5f2b"]]),me={key:0,class:"wi-web-attachment-list"},he=e.defineComponent({__name:"AttachmentList",props:{items:{default:()=>[]},removable:{type:Boolean,default:!1},downloadable:{type:Boolean,default:void 0},clickable:{type:Boolean,default:!1},baseURL:{default:""},getFileUrl:{type:Function,default:void 0}},emits:["remove","click","download"],setup(d,{emit:g}){const a=d,s=g,p=e.computed(()=>(a.items||[]).map((i,u)=>{var r,v;const o=F.normalizeAttachment(i),n=(r=o.attachContent)==null?void 0:r.raw,k=((v=o.attachContent)==null?void 0:v.fileId)||(n?`${n.name}_${n.size}_${u}`:`${o.name}_${u}`);return{...o,key:k}})),w=(c,i)=>{s("remove",c,i)},_=(c,i)=>{s("click",c,i)},l=(c,i)=>{s("download",c,i)};return(c,i)=>p.value.length>0?(e.openBlock(),e.createElementBlock("div",me,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,(u,o)=>(e.openBlock(),e.createBlock(M,{key:u.key||o,item:u,removable:c.removable,downloadable:c.downloadable,clickable:c.clickable||!!c.$attrs.onClick,"base-u-r-l":c.baseURL,"get-file-url":c.getFileUrl,onClick:n=>_(u,o),onRemove:n=>w(o,u),onDownload:n=>l(u,o)},{icon:e.withCtx(n=>[e.renderSlot(c.$slots,"icon",e.normalizeProps(e.guardReactiveProps(n)),void 0,!0)]),title:e.withCtx(n=>[e.renderSlot(c.$slots,"title",e.normalizeProps(e.guardReactiveProps(n)),void 0,!0)]),description:e.withCtx(n=>[e.renderSlot(c.$slots,"description",e.normalizeProps(e.guardReactiveProps(n)),void 0,!0)]),actions:e.withCtx(n=>[e.renderSlot(c.$slots,"actions",e.normalizeProps(e.guardReactiveProps(n)),void 0,!0)]),_:2},1032,["item","removable","downloadable","clickable","base-u-r-l","get-file-url","onClick","onRemove","onDownload"]))),128))])):e.createCommentVNode("",!0)}}),T=S(he,[["__scopeId","data-v-ff76d134"]]),V=d=>(e.pushScopeId("data-v-c6f1253a"),d=d(),e.popScopeId(),d),we={class:"wi-web-inputbox"},_e={key:0,class:"wi-web-inputbox__top-bar"},ve={key:0,class:"wi-web-inputbox__agent-bar"},be={class:"wi-web-inputbox__agent-icon-wrapper"},fe=["src"],ge={key:1,class:"wi-web-inputbox__agent-svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},ke=V(()=>e.createElementVNode("circle",{cx:"12",cy:"8",r:"4"},null,-1)),ye=V(()=>e.createElementVNode("path",{d:"M4 20c0-4 4-6 8-6s8 2 8 6"},null,-1)),Be=[ke,ye],Ee={class:"wi-web-inputbox__agent-title"},Ve=V(()=>e.createElementVNode("path",{d:"M840.4 300H183.6c-19.7 0-30.7 22.7-18.5 37.1l328.4 388.7c9.5 11.2 27.5 11.2 37 0l328.4-388.7c12.2-14.4 1.2-37.1-18.5-37.1z",fill:"currentColor"},null,-1)),Ce=[Ve],Ne={class:"wi-web-agent-list"},$e=V(()=>e.createElementVNode("div",{class:"wi-web-agent-list__header"},"切换智能体",-1)),Se={key:0,class:"wi-web-agent-list__empty"},Ae=["onClick"],Ie={class:"wi-web-agent-item__left"},Ue=["src"],Fe={key:1,class:"wi-web-agent-item__avatar-fallback"},Pe=V(()=>e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("circle",{cx:"12",cy:"8",r:"4"}),e.createElementVNode("path",{d:"M4 20c0-4 4-6 8-6s8 2 8 6"})],-1)),Re=[Pe],Te={class:"wi-web-agent-item__title"},xe={key:0,class:"wi-web-agent-item__check"},ze={key:1,class:"wi-web-inputbox__options"},Le={class:"wi-web-inputbox__main"},Me={key:0,class:"wi-web-inputbox__attachments"},Oe={class:"wi-web-inputbox__footer"},De={class:"wi-web-inputbox__footer-left"},je={class:"wi-web-inputbox__footer-right"},Qe={key:0,class:"wi-web-inputbox__counter"},qe=V(()=>e.createElementVNode("svg",{viewBox:"0 0 1024 1024",width:"16",height:"16",fill:"currentColor"},[e.createElementVNode("path",{d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896z m0 85.333333a362.666667 362.666667 0 1 0 0 725.333334 362.666667 362.666667 0 0 0 0-725.333334z m120.746667 181.333334a42.666667 42.666667 0 0 1 54.826666 4.693333l5.546667 6.357334a42.666667 42.666667 0 0 1-4.693333 54.826666l-6.357334 5.546667-114.730666 114.773333 114.730666 114.730667a42.666667 42.666667 0 0 1 5.461334 54.826666l-5.461334 6.357334a42.666667 42.666667 0 0 1-54.826666 5.461333l-6.357334-5.461333-114.730666-114.730667-114.730667 114.730667a42.666667 42.666667 0 0 1-54.826667 5.461333l-6.357333-5.461333a42.666667 42.666667 0 0 1-5.461333-54.826667l5.461333-6.357333 114.730667-114.730667-114.730667-114.773333a42.666667 42.666667 0 0 1-5.461333-54.826667l5.461333-6.357333a42.666667 42.666667 0 0 1 54.826667-5.461334l6.357333 5.461334 114.730667 114.730666 114.730666-114.730666a42.666667 42.666667 0 0 1 24.32-11.434667z"})],-1)),We=[qe],He=["disabled"],Ke=V(()=>e.createElementVNode("svg",{viewBox:"0 0 24 24",width:"18",height:"18",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("path",{d:"M21.44 11.05l-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48"})],-1)),Ye=[Ke],Xe=["accept"],Ze=V(()=>e.createElementVNode("div",{class:"wi-web-inputbox__divider"},null,-1)),Ge=V(()=>e.createElementVNode("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"currentColor"},[e.createElementVNode("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"})],-1)),Je=[Ge],et=V(()=>e.createElementVNode("svg",{viewBox:"0 0 24 24",width:"18",height:"18",fill:"currentColor"},[e.createElementVNode("path",{d:"M2.01 21L23 12 2.01 3 2 10l15 2-15 2z"})],-1)),tt=[et],ot=e.defineComponent({__name:"Inputbox",props:{modelValue:{default:""},placeholder:{default:'"↑↓"切换历史输入,"⇧↵"换行'},disabled:{type:Boolean,default:!1},talking:{type:Boolean,default:!1},maxlength:{},autosize:{type:[Object,Boolean],default:()=>({minRows:3,maxRows:8})},showAgentBar:{type:Boolean,default:!0},showUpload:{type:Boolean,default:!0},showWordLimit:{type:Boolean,default:!0},accept:{default:".csv,.txt,.pdf,.doc,.docx,.xls,.xlsx,.png,.jpg,.jpeg,.gif,.mp4"},agentList:{default:()=>[]},currentAgent:{default:null},defaultAgentTitle:{default:"系统默认智能体"},baseURL:{default:""},getFileUrl:{type:Function,default:void 0},incPrevQuestion:{default:"Y"},showIncPrevQuestion:{type:Boolean,default:!0}},emits:["update:modelValue","submit","stop","selectAgent","update:files","update:attachments","update:incPrevQuestion"],setup(d,{expose:g,emit:a}){const s=d,p=a,w=e.ref(null),_=e.ref(null),l=e.ref(!1),c=t=>F.parseRealtimeAttachment(t),i=e.ref([]),u=e.computed(()=>!!!(s.modelValue&&s.modelValue.trim())),o=t=>t?s.getFileUrl?s.getFileUrl(t):F.resolveRemoteFileUrl(t,s.baseURL,"/algorithm/get_file_data"):"",n=t=>{p("selectAgent",t),l.value=!1},k=t=>{p("update:incPrevQuestion",t?"N":"Y")},r=()=>{p("update:modelValue","")},v=()=>{_.value&&(_.value.value="",_.value.click())},y=t=>{const h=t.target;if(h.files&&h.files.length>0){const m=Array.from(h.files);for(const b of m)i.value.some(U=>{var z;const R=((z=U.attachContent)==null?void 0:z.raw)||U.raw;return R&&R.name===b.name&&R.size===b.size&&R.lastModified===b.lastModified})||i.value.push(c(b));const E=i.value.map(b=>{var $;return(($=b.attachContent)==null?void 0:$.raw)||b.raw}).filter(Boolean);p("update:files",E),p("update:attachments",[...i.value])}},C=t=>{var b;const h=i.value.splice(t,1)[0],m=((b=h==null?void 0:h.attachContent)==null?void 0:b.url)||(h==null?void 0:h.url);m&&m.startsWith("blob:")&&URL.revokeObjectURL(m);const E=i.value.map($=>{var U;return((U=$.attachContent)==null?void 0:U.raw)||$.raw}).filter(Boolean);p("update:files",E),p("update:attachments",[...i.value])},A=()=>{i.value.forEach(t=>{var m;const h=((m=t==null?void 0:t.attachContent)==null?void 0:m.url)||(t==null?void 0:t.url);h&&h.startsWith("blob:")&&URL.revokeObjectURL(h)}),i.value=[],p("update:files",[]),p("update:attachments",[])},P=()=>{if(s.disabled||u.value)return;const t=s.modelValue||"",h=i.value.map(E=>{var b;return((b=E.attachContent)==null?void 0:b.raw)||E.raw}).filter(Boolean),m=[...i.value];p("submit",{text:t,files:h,attachments:m,agent:s.currentAgent}),i.value=[],p("update:files",[]),p("update:attachments",[])},B=t=>{t.isComposing||t.keyCode===229||(t.preventDefault(),P())};return e.onBeforeUnmount(()=>{A()}),g({clearFiles:A,getFiles:()=>i.value.map(t=>{var h;return((h=t.attachContent)==null?void 0:h.raw)||t.raw}).filter(Boolean),getAttachments:()=>i.value,focus:()=>{var t;(t=w.value)==null||t.focus()}}),(t,h)=>(e.openBlock(),e.createElementBlock("div",we,[t.showAgentBar||t.showIncPrevQuestion?(e.openBlock(),e.createElementBlock("div",_e,[t.showAgentBar?(e.openBlock(),e.createElementBlock("div",ve,[e.createVNode(e.unref(N.ElPopover),{visible:l.value,"onUpdate:visible":h[0]||(h[0]=m=>l.value=m),placement:"top-start",width:260,trigger:"click","popper-class":"wi-web-agent-popover"},{reference:e.withCtx(()=>{var m,E,b;return[e.createElementVNode("div",{class:e.normalizeClass(["wi-web-inputbox__agent-btn",{"is-disabled":t.disabled||t.talking}])},[e.createElementVNode("div",be,[(m=t.currentAgent)!=null&&m.image_id&&o(t.currentAgent.image_id)?(e.openBlock(),e.createElementBlock("img",{key:0,src:o(t.currentAgent.image_id),class:"wi-web-inputbox__agent-avatar"},null,8,fe)):(e.openBlock(),e.createElementBlock("svg",ge,Be))]),e.createElementVNode("span",Ee," @"+e.toDisplayString(((E=t.currentAgent)==null?void 0:E.entry_title)||((b=t.currentAgent)==null?void 0:b.entry_id)||t.defaultAgentTitle),1),(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["wi-web-inputbox__agent-arrow",{"is-active":l.value}]),viewBox:"0 0 1024 1024",width:"12",height:"12"},Ce,2))],2)]}),default:e.withCtx(()=>[e.createElementVNode("div",Ne,[$e,!t.agentList||t.agentList.length===0?(e.openBlock(),e.createElementBlock("div",Se," 暂无可选智能体 ")):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.agentList,m=>{var E,b;return e.openBlock(),e.createElementBlock("div",{key:m.entry_id,class:e.normalizeClass(["wi-web-agent-item",{"is-active":m.entry_id===((E=t.currentAgent)==null?void 0:E.entry_id)}]),onClick:$=>n(m)},[e.createElementVNode("div",Ie,[m.image_id&&o(m.image_id)?(e.openBlock(),e.createElementBlock("img",{key:0,src:o(m.image_id),class:"wi-web-agent-item__avatar"},null,8,Ue)):(e.openBlock(),e.createElementBlock("div",Fe,Re)),e.createElementVNode("span",Te,e.toDisplayString(m.entry_title||m.entry_id),1)]),m.entry_id===((b=t.currentAgent)==null?void 0:b.entry_id)?(e.openBlock(),e.createElementBlock("span",xe,"✓")):e.createCommentVNode("",!0)],10,Ae)}),128))])]),_:1},8,["visible"])])):e.createCommentVNode("",!0),t.showIncPrevQuestion?(e.openBlock(),e.createElementBlock("div",ze,[e.createVNode(e.unref(N.ElCheckbox),{class:"wi-web-inputbox__ignore-prev","model-value":t.incPrevQuestion==="N","onUpdate:modelValue":k},{default:e.withCtx(()=>[e.createTextVNode(" 忽略之前对话 ")]),_:1},8,["model-value"])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",Le,[i.value.length>0?(e.openBlock(),e.createElementBlock("div",Me,[e.createVNode(T,{items:i.value,"base-u-r-l":t.baseURL,"get-file-url":t.getFileUrl,removable:"",onRemove:C},null,8,["items","base-u-r-l","get-file-url"])])):e.createCommentVNode("",!0),e.createVNode(e.unref(N.ElInput),{ref_key:"textareaRef",ref:w,"model-value":t.modelValue,type:"textarea",resize:"none",maxlength:t.maxlength,autosize:t.autosize,placeholder:t.placeholder,disabled:t.disabled||t.talking,class:"wi-web-inputbox__textarea","onUpdate:modelValue":h[1]||(h[1]=m=>p("update:modelValue",m)),onKeydown:e.withKeys(e.withModifiers(B,["exact"]),["enter"])},null,8,["model-value","maxlength","autosize","placeholder","disabled","onKeydown"]),e.createElementVNode("div",Oe,[e.createElementVNode("div",De,[e.renderSlot(t.$slots,"footer-left",{},void 0,!0)]),e.createElementVNode("div",je,[t.showWordLimit?(e.openBlock(),e.createElementBlock("div",Qe,[e.createTextVNode(e.toDisplayString((t.modelValue||"").length),1),t.maxlength?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode("/"+e.toDisplayString(t.maxlength),1)],64)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),t.modelValue&&!t.disabled&&!t.talking?(e.openBlock(),e.createBlock(e.unref(N.ElTooltip),{key:1,content:"清除",placement:"top"},{default:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"wi-web-inputbox__icon-btn",onClick:r},We)]),_:1})):e.createCommentVNode("",!0),t.showUpload?(e.openBlock(),e.createBlock(e.unref(N.ElTooltip),{key:2,content:"上传附件",placement:"top"},{default:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"wi-web-inputbox__icon-btn",disabled:t.disabled||t.talking,onClick:v},Ye,8,He)]),_:1})):e.createCommentVNode("",!0),e.createElementVNode("input",{ref_key:"fileInputRef",ref:_,type:"file",multiple:"",accept:t.accept,class:"wi-web-inputbox__hidden-file",onChange:y},null,40,Xe),Ze,t.talking?(e.openBlock(),e.createBlock(e.unref(N.ElTooltip),{key:3,content:"停止生成",placement:"top"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:"wi-web-inputbox__action-btn wi-web-inputbox__action-btn--stop",onClick:h[2]||(h[2]=m=>p("stop"))},Je)]),_:1})):(e.openBlock(),e.createBlock(e.unref(N.ElTooltip),{key:4,content:"发送",placement:"top"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["wi-web-inputbox__action-btn wi-web-inputbox__action-btn--send",{"is-disabled":t.disabled||!t.talking&&u.value}]),onClick:P},tt,2)]),_:1}))])])])]))}}),O=S(ot,[["__scopeId","data-v-c6f1253a"]]),lt=[{id:"recordset",answerType:"recordset",component:e.defineAsyncComponent(()=>Promise.resolve().then(()=>Ct))}],D=d=>f.createAnswerContentMap([...lt,...d??[]]),nt=d=>(e.pushScopeId("data-v-c18f2f94"),d=d(),e.popScopeId(),d),at={key:0,class:"wi-web-chat-messages__loading"},st={key:1,class:"wi-web-chat-messages__empty"},it=nt(()=>e.createElementVNode("div",{class:"wi-web-chat-messages__empty-logo"},"WI",-1)),rt={class:"wi-web-chat-messages__empty-title"},ct={class:"wi-web-chat-messages__empty-description"},dt={key:0,class:"wi-web-chat-messages__user"},ut={class:"wi-web-chat-messages__user-wrapper"},pt={class:"wi-web-chat-messages__user-bubble"},mt={key:1,class:"wi-web-chat-messages__assistant"},ht=e.defineComponent({__name:"ChatMessagesView",props:{messages:{},parsers:{default:()=>[]},baseURL:{default:""},getFileUrl:{type:Function,default:void 0},outputFileConfig:{},loading:{type:Boolean,default:!1},emptyTitle:{default:"输入问题,开始与 AI 对话"},emptyDescription:{default:"回答内容由共享渲染层统一分发"}},emits:["loadOlder","updateThinkingExpanded"],setup(d,{expose:g,emit:a}){const s=d,p=a;f.provideOutputFileConfig(s.outputFileConfig??{getFileUrl:n=>{var k;return((k=s.getFileUrl)==null?void 0:k.call(s,n))??(s.baseURL?`${s.baseURL.replace(/\/$/,"")}/algorithm/get_file_data?file_id=${encodeURIComponent(n)}`:"")}});const w=e.ref(),{showScrollToBottom:_,forceScrollToBottom:l,requestScrollToBottom:c,resetScrollState:i,onReachTop:u}=L.useAutoScroll(w),o=e.computed(()=>D(s.parsers));return e.watch(()=>s.messages.length===0,n=>{n&&i()}),e.watch(()=>s.messages[s.messages.length-1],()=>{c()},{deep:!0}),u(()=>p("loadOlder")),g({forceScrollToBottom:l,requestScrollToBottom:c}),(n,k)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"scrollEl",ref:w,class:"wi-web-chat-messages"},[n.loading?(e.openBlock(),e.createElementBlock("div",at,"历史加载中...")):n.messages.length===0?(e.openBlock(),e.createElementBlock("div",st,[it,e.createElementVNode("div",rt,e.toDisplayString(n.emptyTitle),1),e.createElementVNode("div",ct,e.toDisplayString(n.emptyDescription),1)])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.messages,r=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:r.id},[r.role==="user"?(e.openBlock(),e.createElementBlock("div",dt,[e.createElementVNode("div",ut,[r.attachments&&r.attachments.length>0?(e.openBlock(),e.createBlock(T,{key:0,class:"wi-web-chat-messages__attachments",items:r.attachments,"base-u-r-l":n.baseURL,"get-file-url":n.getFileUrl},null,8,["items","base-u-r-l","get-file-url"])):e.createCommentVNode("",!0),e.createElementVNode("div",pt,e.toDisplayString(r.content),1)])])):(e.openBlock(),e.createElementBlock("div",mt,[e.createVNode(e.unref(f.DeepThinkingSteps),{steps:r.thinking.steps,expanded:r.thinking.expanded,"onUpdate:expanded":v=>p("updateThinkingExpanded",r,v)},null,8,["steps","expanded","onUpdate:expanded"]),e.createVNode(e.unref(f.AiAnswerBubble),{answer:r.answer,error:r.error,stopped:r.stopped,"content-map":o.value},null,8,["answer","error","stopped","content-map"])]))],64))),128)),e.createVNode(e.Transition,{name:"wi-web-chat-messages-fade"},{default:e.withCtx(()=>[e.unref(_)?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"wi-web-chat-messages__bottom",onClick:k[0]||(k[0]=(...r)=>e.unref(l)&&e.unref(l)(...r))}," 回到底部 ")):e.createCommentVNode("",!0)]),_:1})],512))}}),j=S(ht,[["__scopeId","data-v-c18f2f94"]]),wt={class:"wi-web-chat-container"},_t={class:"wi-web-chat-container__footer"},vt=e.defineComponent({__name:"ChatContainer",props:{messages:{},parsers:{default:()=>[]},baseURL:{default:""},getFileUrl:{type:Function,default:void 0},outputFileConfig:{},loading:{type:Boolean,default:!1},talking:{type:Boolean,default:!1},session:{default:""},question:{default:""},incPrevQuestion:{default:"Y"},agentList:{default:()=>[]},currentAgent:{default:null},placeholder:{default:"请输入问题,按 Enter 发送,Shift+Enter 换行"},hasMore:{type:Boolean,default:!0},emptyTitle:{default:"输入问题,开始与 AI 对话"},emptyDescription:{default:"回答内容由共享渲染层统一分发"},disabled:{type:Boolean,default:!1}},emits:["update:question","update:incPrevQuestion","submit","stop","selectAgent","loadOlder","updateThinkingExpanded"],setup(d,{emit:g}){const a=d,s=g,p=l=>{s("submit",l)},w=()=>{a.hasMore&&s("loadOlder")},_=l=>{s("selectAgent",l)};return(l,c)=>(e.openBlock(),e.createElementBlock("section",wt,[e.renderSlot(l.$slots,"messages",{},()=>[e.createVNode(j,{messages:l.messages,parsers:l.parsers,"base-u-r-l":l.baseURL,"get-file-url":l.getFileUrl,"output-file-config":l.outputFileConfig,loading:l.loading,"empty-title":l.emptyTitle,"empty-description":l.emptyDescription,onLoadOlder:w,onUpdateThinkingExpanded:c[0]||(c[0]=(i,u)=>s("updateThinkingExpanded",i,u))},null,8,["messages","parsers","base-u-r-l","get-file-url","output-file-config","loading","empty-title","empty-description"])],!0),e.renderSlot(l.$slots,"above-input",{},void 0,!0),e.createElementVNode("footer",_t,[e.createVNode(O,{"model-value":l.question,"onUpdate:modelValue":c[1]||(c[1]=i=>s("update:question",i)),"inc-prev-question":l.incPrevQuestion,"onUpdate:incPrevQuestion":c[2]||(c[2]=i=>s("update:incPrevQuestion",i)),"base-u-r-l":l.baseURL,disabled:l.disabled||!l.session,talking:l.talking,"agent-list":l.agentList,"current-agent":l.currentAgent,placeholder:l.placeholder,"get-file-url":l.getFileUrl,onSelectAgent:_,onSubmit:p,onStop:c[3]||(c[3]=i=>s("stop"))},null,8,["model-value","inc-prev-question","base-u-r-l","disabled","talking","agent-list","current-agent","placeholder","get-file-url"])])]))}}),bt=S(vt,[["__scopeId","data-v-8663b501"]]),Q=d=>(e.pushScopeId("data-v-96941d57"),d=d(),e.popScopeId(),d),ft={key:0,class:"wi-web-recordset"},gt={class:"wi-web-recordset__header"},kt={class:"wi-web-recordset__title"},yt=Q(()=>e.createElementVNode("button",{type:"button",class:"wi-web-recordset__columns-btn",title:"选择展示列"},[e.createElementVNode("svg",{class:"wi-web-recordset__columns-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"}),e.createElementVNode("path",{d:"M9 4v16M15 4v16"})]),e.createElementVNode("span",null,"列")],-1)),Bt={class:"wi-web-recordset__columns-panel"},Et=Q(()=>e.createElementVNode("div",{class:"wi-web-recordset__columns-panel-title"},"选择展示列",-1)),Vt=e.defineComponent({__name:"RecordsetTable",props:{report:{},maxHeight:{default:420}},setup(d){const g=d,a=e.computed(()=>{var r;return((r=g.report)==null?void 0:r.values)??{}}),s=e.computed(()=>a.value.chart==="table"),p=e.computed(()=>a.value.title??""),w=e.computed(()=>(Array.isArray(a.value.cols)?a.value.cols:[]).map((v,y)=>({key:`c${y}`,title:(v==null?void 0:v.title)||(v==null?void 0:v.name)||`列${y+1}`}))),_=e.computed(()=>{const r=Number(a.value.max_cols);return Number.isFinite(r)&&r>0?r:1/0}),l=e.computed(()=>w.value.length>_.value),c=e.ref([]),i=e.computed(()=>new Set(c.value)),u=e.computed(()=>w.value.filter(r=>i.value.has(r.key)));e.watch(()=>w.value.map(r=>r.key).join("|"),()=>{c.value=w.value.slice(0,_.value).map(r=>r.key)},{immediate:!0});const o=e.computed(()=>(Array.isArray(a.value.values)?a.value.values:[]).map(v=>{const y={};return w.value.forEach((C,A)=>{y[C.key]=Array.isArray(v)?v[A]:void 0}),y})),n=e.ref(!1),k=(r,v)=>{const y=new Set(c.value);v?y.add(r):y.delete(r),c.value=w.value.filter(C=>y.has(C.key)).map(C=>C.key)};return(r,v)=>{const y=e.resolveComponent("el-checkbox"),C=e.resolveComponent("el-popover"),A=e.resolveComponent("el-table-column"),P=e.resolveComponent("el-table");return s.value?(e.openBlock(),e.createElementBlock("div",ft,[e.createElementVNode("div",gt,[e.createElementVNode("div",kt,e.toDisplayString(p.value),1),l.value?(e.openBlock(),e.createBlock(C,{key:0,visible:n.value,"onUpdate:visible":v[0]||(v[0]=B=>n.value=B),placement:"bottom-end",width:220,trigger:"click","popper-class":"wi-web-recordset-columns-popper"},{reference:e.withCtx(()=>[yt]),default:e.withCtx(()=>[e.createElementVNode("div",Bt,[Et,(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value,B=>(e.openBlock(),e.createBlock(y,{key:B.key,class:"wi-web-recordset__column-item","model-value":i.value.has(B.key),"onUpdate:modelValue":t=>k(B.key,!!t)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(B.title),1)]),_:2},1032,["model-value","onUpdate:modelValue"]))),128))])]),_:1},8,["visible"])):e.createCommentVNode("",!0)]),e.createVNode(P,{data:o.value,border:"",size:"small",class:"wi-web-recordset__table","max-height":r.maxHeight},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,B=>(e.openBlock(),e.createBlock(A,{key:B.key,prop:B.key,label:B.title,"min-width":"120","show-overflow-tooltip":""},null,8,["prop","label"]))),128))]),_:1},8,["data","max-height"])])):e.createCommentVNode("",!0)}}}),q=S(Vt,[["__scopeId","data-v-96941d57"]]),Ct=Object.freeze(Object.defineProperty({__proto__:null,default:q},Symbol.toStringTag,{value:"Module"})),x=d=>(e.pushScopeId("data-v-94659445"),d=d(),e.popScopeId(),d),Nt={class:"wi-web-env-switch__track"},$t={class:"wi-web-env-switch__items"},St=["disabled","onClick"],At={class:"wi-web-env-switch__icon"},It={key:0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"},Ut=x(()=>e.createElementVNode("path",{d:"M17.5 19a4.5 4.5 0 0 0 .6-8.96 6 6 0 0 0-11.63 1.4A3.8 3.8 0 0 0 7 19z"},null,-1)),Ft=[Ut],Pt={key:1,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round"},Rt=x(()=>e.createElementVNode("rect",{x:"2.5",y:"4",width:"19",height:"12",rx:"2","stroke-linejoin":"round"},null,-1)),Tt=x(()=>e.createElementVNode("path",{d:"M8.5 20h7M12 16v4"},null,-1)),xt=[Rt,Tt],zt={class:"wi-web-env-switch__label"},Lt={key:0,class:"wi-web-env-switch__hint"},Mt={class:"wi-web-env-switch__hint-text"},Ot={key:0,class:"wi-web-env-switch__hint-status"},Dt=e.defineComponent({__name:"EnvSwitch",props:{modelValue:{default:"local"},options:{default:()=>[]},disabled:{type:Boolean,default:!1},size:{default:"default"},showHint:{type:Boolean,default:!0}},emits:["update:modelValue","change"],setup(d,{emit:g}){const a=d,s=g,p=[{value:"local",label:"本地电脑",description:"在当前设备上执行,文件与终端直连本机",status:"已就绪",online:!0},{value:"cloud",label:"云电脑",description:"在云端环境中执行,算力与存储由服务端提供",status:"未连接",online:!1}],w={default:3,small:2},_=e.computed(()=>{const u=a.options??[];return u.length>0?u:p}),l=e.computed(()=>{if(!a.showHint)return null;const u=_.value;return u.find(o=>o.value===a.modelValue)??u[0]??null}),c=e.computed(()=>{const u=_.value,o=u.length||1,n=Math.max(u.findIndex(r=>r.value===a.modelValue),0),k=w[a.size]??w.default;return{width:`calc(${100/o}% - ${2*k/o}px)`,transform:`translateX(${n*100}%)`}}),i=u=>{a.disabled||u.disabled||u.value!==a.modelValue&&(s("update:modelValue",u.value),s("change",u))};return(u,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["wi-web-env-switch",[`is-${u.size}`,{"is-disabled":u.disabled}]])},[e.createElementVNode("div",Nt,[e.createElementVNode("span",{class:"wi-web-env-switch__thumb",style:e.normalizeStyle(c.value)},null,4),e.createElementVNode("div",$t,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.value,n=>(e.openBlock(),e.createElementBlock("button",{key:n.value,type:"button",class:e.normalizeClass(["wi-web-env-switch__item",{"is-active":n.value===u.modelValue,"is-disabled":n.disabled}]),disabled:u.disabled||n.disabled,onClick:k=>i(n)},[e.createElementVNode("span",At,[n.value==="cloud"?(e.openBlock(),e.createElementBlock("svg",It,Ft)):(e.openBlock(),e.createElementBlock("svg",Pt,xt))]),e.createElementVNode("span",zt,e.toDisplayString(n.label),1)],10,St))),128))])]),l.value?(e.openBlock(),e.createElementBlock("div",Lt,[e.createElementVNode("span",Mt,e.toDisplayString(l.value.description),1),l.value.status?(e.openBlock(),e.createElementBlock("span",Ot,[e.createElementVNode("i",{class:e.normalizeClass(["wi-web-env-switch__dot",{"is-online":l.value.online}])},null,2),e.createTextVNode(" "+e.toDisplayString(l.value.status),1)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],2))}}),jt=S(Dt,[["__scopeId","data-v-94659445"]]);Object.defineProperty(exports,"AiAnswerBubble",{enumerable:!0,get:()=>f.AiAnswerBubble});Object.defineProperty(exports,"ClarificationCard",{enumerable:!0,get:()=>f.ClarificationCard});Object.defineProperty(exports,"DeepThinkingSteps",{enumerable:!0,get:()=>f.DeepThinkingSteps});Object.defineProperty(exports,"IframePage",{enumerable:!0,get:()=>f.IframePage});Object.defineProperty(exports,"KnowledgeStreamResult",{enumerable:!0,get:()=>f.KnowledgeStreamResult});Object.defineProperty(exports,"OutputFile",{enumerable:!0,get:()=>f.OutputFile});Object.defineProperty(exports,"createAnswerContentMap",{enumerable:!0,get:()=>f.createAnswerContentMap});Object.defineProperty(exports,"injectIframeResizerChild",{enumerable:!0,get:()=>f.injectIframeResizerChild});Object.defineProperty(exports,"provideIframePageConfig",{enumerable:!0,get:()=>f.provideIframePageConfig});Object.defineProperty(exports,"provideOutputFileConfig",{enumerable:!0,get:()=>f.provideOutputFileConfig});Object.defineProperty(exports,"resolveIframePlaceholders",{enumerable:!0,get:()=>f.resolveIframePlaceholders});Object.defineProperty(exports,"useIframePage",{enumerable:!0,get:()=>f.useIframePage});exports.AttachmentCard=M;exports.AttachmentList=T;exports.ChatContainer=bt;exports.ChatMessagesView=j;exports.EnvSwitch=jt;exports.Inputbox=O;exports.RecordsetTable=q;exports.createWebAnswerContentMap=D;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -10,5 +10,5 @@ export { default as RecordsetTable } from './recordset/RecordsetTable.vue';
10
10
  export { createWebAnswerContentMap } from './recordset/webAnswerContentMap';
11
11
  export { default as EnvSwitch } from './envswitch/EnvSwitch.vue';
12
12
  export type { ChatEnvType, ChatEnvOption } from './envswitch/types';
13
- export { AiAnswerBubble, createAnswerContentMap, DeepThinkingSteps, IframePage, injectIframeResizerChild, KnowledgeStreamResult, OutputFile, provideIframePageConfig, provideOutputFileConfig, resolveIframePlaceholders, useIframePage, } from 'wi-chat/renderers';
13
+ export { AiAnswerBubble, ClarificationCard, createAnswerContentMap, DeepThinkingSteps, IframePage, injectIframeResizerChild, KnowledgeStreamResult, OutputFile, provideIframePageConfig, provideOutputFileConfig, resolveIframePlaceholders, useIframePage, } from 'wi-chat/renderers';
14
14
  export type { AnswerContentMap, IframePageConfig, OutputFileConfig, OutputFilePreviewKind, OutputFilePreviewRequest, UseIframePageReturn, } from 'wi-chat/renderers';