@next-bricks/ai-portal 0.63.4 → 0.63.6

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 (40) hide show
  1. package/dist/bricks.json +54 -54
  2. package/dist/chunks/{1447.1763ddd6.js → 1447.32e6384d.js} +2 -2
  3. package/dist/chunks/1447.32e6384d.js.map +1 -0
  4. package/dist/chunks/4820.2f5fb327.js +2 -0
  5. package/dist/chunks/4820.2f5fb327.js.map +1 -0
  6. package/dist/chunks/7059.912e3307.js +3 -0
  7. package/dist/chunks/7059.912e3307.js.map +1 -0
  8. package/dist/chunks/9273.a031c62f.js +2 -0
  9. package/dist/chunks/9273.a031c62f.js.map +1 -0
  10. package/dist/chunks/chat-input.eb5871d4.js +3 -0
  11. package/dist/chunks/chat-input.eb5871d4.js.map +1 -0
  12. package/dist/chunks/chat-panel.d783204f.js +2 -0
  13. package/dist/chunks/chat-panel.d783204f.js.map +1 -0
  14. package/dist/chunks/{main.98f78384.js → main.ae8bf1bb.js} +2 -2
  15. package/dist/chunks/{main.98f78384.js.map → main.ae8bf1bb.js.map} +1 -1
  16. package/dist/chunks/page-container.2185f2e0.js +2 -0
  17. package/dist/chunks/page-container.2185f2e0.js.map +1 -0
  18. package/dist/examples.json +20 -20
  19. package/dist/{index.0a95c745.js → index.49603b89.js} +2 -2
  20. package/dist/{index.0a95c745.js.map → index.49603b89.js.map} +1 -1
  21. package/dist/manifest.json +434 -430
  22. package/dist/types.json +1307 -1261
  23. package/dist-types/chat-input/index.d.ts +2 -0
  24. package/dist-types/elevo-sidebar/SpaceNav.d.ts +4 -0
  25. package/package.json +2 -2
  26. package/dist/chunks/1447.1763ddd6.js.map +0 -1
  27. package/dist/chunks/4820.b37e15a6.js +0 -2
  28. package/dist/chunks/4820.b37e15a6.js.map +0 -1
  29. package/dist/chunks/7059.bdb0d78e.js +0 -3
  30. package/dist/chunks/7059.bdb0d78e.js.map +0 -1
  31. package/dist/chunks/9273.fbb69eb2.js +0 -2
  32. package/dist/chunks/9273.fbb69eb2.js.map +0 -1
  33. package/dist/chunks/chat-input.4f3de173.js +0 -3
  34. package/dist/chunks/chat-input.4f3de173.js.map +0 -1
  35. package/dist/chunks/chat-panel.e7f29b08.js +0 -2
  36. package/dist/chunks/chat-panel.e7f29b08.js.map +0 -1
  37. package/dist/chunks/page-container.068df693.js +0 -2
  38. package/dist/chunks/page-container.068df693.js.map +0 -1
  39. /package/dist/chunks/{7059.bdb0d78e.js.LICENSE.txt → 7059.912e3307.js.LICENSE.txt} +0 -0
  40. /package/dist/chunks/{chat-input.4f3de173.js.LICENSE.txt → chat-input.eb5871d4.js.LICENSE.txt} +0 -0
@@ -1,3 +0,0 @@
1
- /*! For license information please see 7059.bdb0d78e.js.LICENSE.txt */
2
- "use strict";(globalThis.webpackChunk_next_bricks_ai_portal=globalThis.webpackChunk_next_bricks_ai_portal||[]).push([[7059],{5813:(e,t,i)=>{i.d(t,{I:()=>c,K:()=>a,NS:()=>o,t:()=>s});var n=i(67177);let a=function(e){return e.NEW_CHAT="NEW_CHAT",e.LOGOUT="LOGOUT",e.TODAY="TODAY",e.YESTERDAY="YESTERDAY",e.PREVIOUS_7_DAYS="PREVIOUS_7_DAYS",e.PREVIOUS_30_DAYS="PREVIOUS_30_DAYS",e.SWITCH_LANGUAGE="SWITCH_LANGUAGE",e.MY="MY",e.PROJECTS="PROJECTS",e.HISTORY="HISTORY",e.CREATE_PROJECT="CREATE_PROJECT",e.MOVE_TO_PROJECT="MOVE_TO_PROJECT",e.UNTITLED="UNTITLED",e.UNNAMED="UNNAMED",e.BUSINESS_OBJECTS="BUSINESS_OBJECTS",e.BUSINESS_OBJECT_MODELS="BUSINESS_OBJECT_MODELS",e.SERVICEFLOWS="SERVICEFLOWS",e.COLLABORATION_SPACES="COLLABORATION_SPACES",e.CREATE_SERVICEFLOW="CREATE_SERVICEFLOW",e}({});const r={[a.NEW_CHAT]:"New chat",[a.LOGOUT]:"Logout",[a.TODAY]:"Today",[a.YESTERDAY]:"Yesterday",[a.PREVIOUS_7_DAYS]:"Previous 7 days",[a.PREVIOUS_30_DAYS]:"Previous 30 days",[a.SWITCH_LANGUAGE]:"中文",[a.MY]:"My",[a.PROJECTS]:"Projects",[a.HISTORY]:"Chats",[a.CREATE_PROJECT]:"Create project",[a.MOVE_TO_PROJECT]:"Move to project",[a.UNTITLED]:"Untitled",[a.UNNAMED]:"Unnamed",[a.BUSINESS_OBJECTS]:"Business objects",[a.SERVICEFLOWS]:"Serviceflows",[a.COLLABORATION_SPACES]:"Collaboration spaces",[a.CREATE_SERVICEFLOW]:"Create serviceflow",[a.BUSINESS_OBJECT_MODELS]:"Business object models"},l={[a.NEW_CHAT]:"新对话",[a.LOGOUT]:"登出",[a.TODAY]:"今天",[a.YESTERDAY]:"昨天",[a.PREVIOUS_7_DAYS]:"过去7天",[a.PREVIOUS_30_DAYS]:"过去30天",[a.SWITCH_LANGUAGE]:"English",[a.MY]:"我的",[a.PROJECTS]:"项目",[a.HISTORY]:"对话",[a.CREATE_PROJECT]:"创建项目",[a.MOVE_TO_PROJECT]:"移动到项目",[a.UNTITLED]:"无标题",[a.UNNAMED]:"未命名",[a.BUSINESS_OBJECTS]:"业务对象",[a.SERVICEFLOWS]:"业务流",[a.COLLABORATION_SPACES]:"协作空间",[a.CREATE_SERVICEFLOW]:"创建业务流",[a.BUSINESS_OBJECT_MODELS]:"业务对象模型"},o="bricks/ai-portal/elevo-sidebar",c={en:r,zh:l},s=n.i18n.getFixedT(null,o)},17452:(e,t,i)=>{i.d(t,{c:()=>n,w:()=>a});const n={lib:"fa",icon:"plus"},a={lib:"lucide",icon:"box"}},41938:(e,t,i)=>{i.d(t,{c:()=>g});var n=i(89575),a=i(18769),r=i.n(a),l=i(53373),o=i.n(l),c=i(60128),s=i(51578),d=i(5813),p=i(70579),u=i(94504),m=i(17452),E=i(84311);function g(e){let{returnUrl:t,introUrl:i,spaceDetail:l,spaceObjects:g,spaceServiceflows:h,spaceLinks:v,onAddServiceflow:f}=e;const x=(0,a.useRef)(null),[b,k]=(0,a.useState)(!1),[S,y]=(0,a.useState)(!1),T=(0,E.d)(i);return r().createElement(r().Fragment,null,r().createElement(p.EM,{url:t,className:"return-link"},r().createElement("div",{className:"heading"},r().createElement("div",{className:"title"},null==l?void 0:l.name),r().createElement("div",{className:"sub-title"},(0,d.t)(d.K.COLLABORATION_SPACES))),r().createElement(p.Bj,{className:"icon",lib:"lucide",icon:"arrow-left"})),r().createElement("div",{className:"divider"}),r().createElement("div",{className:"history",ref:x},g?r().createElement("div",{className:o()("section",{collapsed:b})},r().createElement(s._,{rootRef:x,title:(0,d.t)(d.K.BUSINESS_OBJECTS),collapsed:b,onToggle:()=>k((e=>!e))},r().createElement(p.Py,{icon:m.w,variant:"mini-light",tooltip:(0,d.t)(d.K.BUSINESS_OBJECT_MODELS),tooltipHoist:!0,className:"button",active:T,onClick:()=>(0,c.getHistory)().push(i)})),r().createElement("ul",{className:"items"},g.map(((e,t)=>r().createElement("li",{key:t},r().createElement(u.k,{url:e.url,activeIncludes:e.activeIncludes,render:t=>{let{active:i}=t;return r().createElement(p.EM,{className:o()("item",{active:i}),url:e.url},r().createElement("div",{className:"item-title"},e.title))}})))))):null,h?r().createElement("div",{className:o()("section",{collapsed:S})},r().createElement(s._,{rootRef:x,title:(0,d.t)(d.K.SERVICEFLOWS),collapsed:S,onToggle:()=>y((e=>!e))},r().createElement(p.Py,{icon:m.c,variant:"mini-light",tooltip:(0,d.t)(d.K.CREATE_SERVICEFLOW),tooltipHoist:!0,className:"button",onClick:f})),r().createElement("ul",{className:"items"},h.map(((e,t)=>r().createElement("li",{key:t},r().createElement(u.k,{url:e.url,activeIncludes:e.activeIncludes,render:t=>{let{active:i}=t;return r().createElement(p.EM,{className:o()("item",{active:i}),url:e.url},r().createElement("div",{className:"item-title"},e.title))}})))))):null,null!=v&&v.length?r().createElement("div",{className:"space-links"},v.map(((e,t)=>r().createElement(u.k,{key:t,url:e.url,activeIncludes:e.activeIncludes,render:i=>{let{active:a}=i;return r().createElement(p.EM,{key:t,className:o()("link",{active:a}),url:e.url},r().createElement(p.Bj,(0,n.A)({className:"icon"},e.icon)),r().createElement("span",{className:"title"},e.title))}})))):null))}},51578:(e,t,i)=>{i.d(t,{_:()=>s});var n=i(18769),a=i.n(n),r=i(41030),l=i(53373),o=i.n(l),c=i(70579);function s(e){let{rootRef:t,title:i,collapsed:l,children:s,onToggle:d}=e;const p=(0,n.useRef)(null),[u,m]=(0,n.useState)(!1);return(0,n.useEffect)((()=>{if(l)return void m(!1);const e=t.current,i=p.current,n=null==i?void 0:i.nextElementSibling;if(!e||!i||!n)return;const a=(0,r.throttle)((()=>{const e=i.getBoundingClientRect(),t=n.getBoundingClientRect().top-e.top-e.height;m(t<1)}),100);return e.addEventListener("scroll",a),()=>{e.removeEventListener("scroll",a)}}),[l,t]),a().createElement("div",{className:o()("section-title",{sticky:u}),ref:p},a().createElement("div",{className:"section-label",onClick:d},i,a().createElement(c.Bj,{lib:"fa",icon:"angle-down"})),s)}},61408:(e,t,i)=>{i.d(t,{A:()=>o});var n=i(36758),a=i.n(n),r=i(40935),l=i.n(r)()(a());l.push([e.id,':host{display:block}:host([hidden]){display:none}*{box-sizing:border-box}.sidebar{position:relative;z-index:2;width:260px;height:100%;background:rgba(246,247,249,0.5);border:1px solid rgba(255,255,255,0.3);border-radius:12px;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);padding:23px 11px 0;display:flex;flex-direction:column;transition:transform 0.3s ease-in-out}.logo-bar{display:flex;align-items:center;justify-content:space-between;margin-bottom:30px;margin-left:4px}.main{flex:1;min-height:0;display:flex;flex-direction:column}.divider{border-top:1px solid rgba(0,0,0,0.06);margin:16px 0}.logo-link::part(link){display:block}.logo{vertical-align:middle}.new-chat::part(link){display:flex;gap:0;align-items:center;color:var(--elevo-color-brand);font-size:14px;text-align:left;cursor:pointer}.sidebar .new-chat::part(link){background:#f0f4ff;border-radius:8px;border:1px solid #c9d7ff;padding:9px 13px;font-weight:500;margin-bottom:16px}.sidebar .new-chat::part(link):hover{background:rgba(201,215,255,0.5)}.new-chat-icon{font-size:16px;margin-right:5px}.footer{border-top:1px solid rgba(0,0,0,0.04);padding:9px 12px;margin:0 -12px}.dropdown{display:block}.account{background:none;border:none;border-radius:8px;padding:6px 10px;display:block;width:100%;text-align:left;cursor:pointer}.account:hover{background:rgba(0,0,0,0.04)}.alternative{position:fixed;top:8px;left:8px;padding:6px 10px 6px 8px;display:flex;align-items:center;opacity:0;z-index:2;transition:opacity 0.2s ease-in-out;background:rgba(255,255,255,0);border-radius:8px;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}.alternative .new-chat::part(link){padding:4px;margin-left:16px;font-size:12px}.alternative .new-chat::part(link):hover{color:#7891ff}.alternative .new-chat::part(link):active{color:#0911b3}.container{width:270px;padding:10px 0 10px 10px;height:100%;transition:width 0.3s ease-in-out,padding 0.3s ease-in-out}.container.collapsed{width:0;padding:10px 0;overflow:visible}.container.collapsed .sidebar{transform:translateX(-100%)}.container.collapsed .alternative{opacity:1}:host([behavior="drawer"]){z-index:2;width:0}:host(:not([behavior="drawer"])) .alternative .new-chat{display:none}.mask{position:fixed;top:0;right:0;bottom:0;left:0}.link{display:block}.link + .link{margin-top:4px}.link::part(link){display:flex;gap:0;align-items:center;padding:7px 10px;border-radius:8px;color:#000}.link.active::part(link),.link::part(link):hover{background:rgba(0,0,0,0.04)}.link .icon{font-size:16px;margin-right:10px}.link .title{flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.history{flex:1;min-height:0;overflow-y:auto;margin:0 -12px;padding:0 12px}.history ul{list-style:none;margin:0;padding:0}.history .section + .section{margin-top:14px}.history .section-title{display:flex;align-items:center;justify-content:space-between;height:30px;margin-bottom:6px;padding:0 8px;position:sticky;top:0}.history .section-title.sticky::before{content:"";position:absolute;top:0;right:0;bottom:0;left:0;background-color:rgb(229,228,234);border-radius:8px;z-index:-1}.history .section-label{display:flex;align-items:center;height:24px;padding:0 8px;margin-left:-8px;cursor:pointer;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:500;font-size:12px;color:#8c8c8c;border-radius:8px}.history .section-label eo-icon{vertical-align:middle;margin-left:6px;transition:transform 0.2s ease-in-out}.history .section-label:hover{background:rgba(0,0,0,0.04)}.history .collapsed > ul{display:none}.history .collapsed .section-label eo-icon{transform:rotate(-90deg)}.history .error,.history .loading{display:flex;align-items:center;height:36px;padding:0 8px}.history .loading{justify-content:center}.history .error{color:var(--color-error)}.history .group + .group{margin-top:15px}.history .group-title{font-weight:500;font-size:12px;color:#000;padding:8px;height:36px;line-height:20px}.history .item{display:block}.history .item::part(link){display:flex;align-items:center;padding:0 8px;height:36px;border-radius:8px;color:#000}.history .item.active::part(link){background:rgba(0,0,0,0.06)}.history .item.actions-active::part(link),.history .item::part(link):hover{background:rgba(0,0,0,0.04)}.history .item-title{flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.history .actions{cursor:auto}.history .item:not(:hover):not(.actions-active) .actions{display:none}.history .working{width:8px;height:8px;border-radius:8px;background:var(--elevo-color-brand);margin:0 7px}.history .item.actions-active .working,.history .item:hover .working,.history .item.active .working{display:none}.history .load-more{display:flex;justify-content:center;align-items:center;height:36px}.button{display:flex}.space-links{margin-top:16px}.return-link{display:block}.return-link .heading{display:flex;flex-direction:column;align-items:flex-start;gap:4px;flex:1;min-width:0}.return-link .title,.return-link .sub-title{width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.return-link .title{font-weight:500;font-size:18px}.return-link .sub-title{font-size:12px;color:#8c8c8c}.return-link .icon{font-size:16px;color:#8c8c8c}.return-link:not(:hover) .icon{display:none}.return-link::part(link){display:flex;align-items:center;justify-content:center;padding:6px 8px;border-radius:8px;color:#000}.return-link::part(link):hover{background:rgba(0,0,0,0.04)}',""]);const o=l.toString()},70579:(e,t,i)=>{i.d(t,{Bj:()=>a,EM:()=>r,JQ:()=>o,Py:()=>s,qb:()=>l,qu:()=>c});var n=i(30981);const a=(0,n.wrapBrick)("eo-icon"),r=(0,n.wrapBrick)("eo-link"),l=(0,n.wrapBrick)("eo-dropdown-actions",{onActionClick:"action.click",onVisibleChange:"visible.change"}),o=(0,n.wrapBrick)("eo-easyops-avatar"),c=(0,n.wrapBrick)("eo-mini-actions",{onActionClick:"action.click",onVisibleChange:"visible.change"}),s=(0,n.wrapBrick)("ai-portal.icon-button")},75197:(e,t,i)=>{i.d(t,{D:()=>f});var n=i(89575),a=i(18769),r=i.n(a),l=i(53373),o=i.n(l),c=i(22919);const s=async(e,t)=>(await c.http.get("api/gateway/logic.llm.aiops_service/api/v1/elevo/conversations",{...t,params:e})).data;var d=i(41030),p=i(5813),u=i(70579),m=i(40177),E=i(65549),g=i(94504),h=i(51578),v=i(17452);const f=(0,a.forwardRef)(x);function x(e,t){let{showProjects:i,historyActions:l,historyUrlTemplate:f,projectUrlTemplate:x,projectActions:b,canAddProject:k,myLinks:S,onActionClick:y,onHistoryClick:T,onProjectActionClick:O,onAddProject:C}=e;const N=(0,a.useRef)(null),[w,_]=(0,a.useState)(!1),[A,I]=(0,a.useState)(null),[R,P]=(0,a.useState)(!1),[B,L]=(0,a.useState)(!1),[U,j]=(0,a.useState)(null),[D,M]=(0,a.useState)(!1),[Y,V]=(0,a.useState)(),[J,H]=(0,a.useState)(),[W,z]=(0,a.useState)(!1),F=(0,a.useRef)(!0),[K,G]=(0,a.useState)([]),q=(0,a.useMemo)((()=>[...null!=l?l:[],{isDropdown:!0,text:(0,p.t)(p.K.MOVE_TO_PROJECT),disabled:!(null!=A&&A.length),items:null==A?void 0:A.map((e=>({event:"move",key:e.instanceId,text:e.name,project:e})))}]),[l,A]);(0,a.useEffect)((()=>{(async()=>{try{const e=await(async()=>(await c.http.get("api/gateway/logic.llm.aiops_service/api/v1/elevo/projects",{params:{page:1,page_size:3e3}})).data)();I(e.list)}catch(e){console.error("Error loading projects:",e),L(!0),I([])}})()}),[]),(0,a.useEffect)((()=>{Promise.all([s({token:J,limit:30,onlyOwner:!0,onlyUnrelatedProject:!0},{interceptorParams:{ignoreLoadingBar:!0}}),...F.current?[]:[new Promise((e=>setTimeout(e,500)))]]).then((e=>{let[t]=e;F.current=!1,j((e=>[...null!=e?e:[],...t.conversations])),V(t.nextToken)})).catch((e=>{console.error("Error loading chat history:",e),j([]),z(!0)}))}),[J]);const[Q,X]=(0,a.useState)(null),Z=(0,a.useRef)(null);(0,a.useEffect)((()=>{const e=Z.current,t=N.current;if(!e||!Y||!t||D)return;const i=new IntersectionObserver((e=>{for(const t of e)t.isIntersecting&&H(Y)}),{root:t});return i.observe(e),()=>{i.disconnect()}}),[Y,D]);const $=(0,a.useRef)(0),ee=(0,a.useCallback)((async()=>{try{const e=++$.current,t=await s({limit:30,onlyOwner:!0,onlyUnrelatedProject:!0},{interceptorParams:{ignoreLoadingBar:!0}});if(e!==$.current)return;j((e=>{const i=null!=e?e:[],n=t.conversations,a=new Set(n.map((e=>e.conversationId))),r=new Map(n.map((e=>[e.conversationId,e])));let l=!1,o=!1,c=!0;for(const e of i){const t=r.get(e.conversationId);if(!t)break;if(l=!0,o=c&&t!==n[0]||!(0,d.isEqual)(t,e),o)break;c=!1}return l?o?[...n,...i.filter((e=>!a.has(e.conversationId)))]:e:(V(t.nextToken),n)}))}catch(e){console.error("Error pulling chat history:",e)}}),[]);(0,a.useImperativeHandle)(t,(()=>({pull:ee,removeProject:e=>{I((t=>t?t.filter((t=>t.instanceId!==e)):t))},addProject:e=>{I((t=>t?[...t,e]:[e]))},moveConversation:e=>{G((t=>[...t,e]))}})),[ee]);const te=(0,a.useMemo)((()=>U&&U.length?U.filter((e=>!K.includes(e.conversationId))):U),[U,K]);return r().createElement("div",{className:"history",ref:N},null!=S&&S.length?r().createElement("div",{className:o()("section",{collapsed:w})},r().createElement(h._,{rootRef:N,title:(0,p.t)(p.K.MY),collapsed:w,onToggle:()=>_((e=>!e))}),r().createElement("ul",{className:"items"},S.map(((e,t)=>r().createElement("li",{key:t},r().createElement(g.k,{url:e.url,activeIncludes:e.activeIncludes,render:t=>{let{active:i}=t;return r().createElement(u.EM,{className:o()("item",{active:i}),url:e.url},r().createElement("div",{className:"item-title"},e.title))}})))))):null,i&&r().createElement("div",{className:o()("section",{collapsed:R})},r().createElement(h._,{rootRef:N,title:(0,p.t)(p.K.PROJECTS),collapsed:R,onToggle:()=>P((e=>!e))},k&&r().createElement(u.Py,{icon:v.c,variant:"mini-light",tooltip:(0,p.t)(p.K.CREATE_PROJECT),tooltipHoist:!0,className:"button",onClick:C})),r().createElement("ul",{className:"items"},B?r().createElement("li",{className:"error"},"Failed to load project"):A?A.map((e=>{const t=x?(0,E.Q)(x,e):void 0;return r().createElement("li",{key:e.instanceId},r().createElement(g.k,{url:t,render:i=>{let{active:a}=i;return r().createElement(u.EM,(0,n.A)({className:o()("item",{"actions-active":e.instanceId===Q,active:a}),onClick:T},t?{url:t}:null),r().createElement("div",{className:"item-title",title:e.name},e.name||(0,p.t)(p.K.UNNAMED)),r().createElement(u.qu,{className:"actions",actions:b,themeVariant:"elevo",onActionClick:t=>{O({action:t.detail,project:e})},onVisibleChange:t=>{X(t.detail?e.instanceId:null)}}))}}))})):r().createElement("li",{className:"loading"},r().createElement(u.Bj,{lib:"antd",theme:"outlined",icon:"loading-3-quarters",spinning:!0})))),r().createElement("div",{className:o()("section",{collapsed:D})},r().createElement(h._,{rootRef:N,title:(0,p.t)(p.K.HISTORY),collapsed:D,onToggle:()=>M((e=>!e))}),r().createElement("ul",{className:"items"},te?te.map((e=>{const t=f?(0,E.Q)(f,e):void 0;return r().createElement("li",{key:e.conversationId},r().createElement(g.k,{url:t,render:t=>{let{active:i}=t;return r().createElement(u.EM,(0,n.A)({className:o()("item",{"actions-active":e.conversationId===Q,active:i}),onClick:T},f?{url:(0,E.Q)(f,e)}:null),r().createElement("div",{className:"item-title",title:e.title},e.title||(0,p.t)(p.K.UNTITLED)),r().createElement(u.qu,{className:"actions",actions:q,onActionClick:t=>{y({action:t.detail,item:e,project:t.detail.project})},onVisibleChange:t=>{X(t.detail?e.conversationId:null)}}),!m.QB.includes(e.state)&&r().createElement("div",{className:"working"}))}}))})):r().createElement("li",{className:"loading"},r().createElement(u.Bj,{lib:"antd",theme:"outlined",icon:"loading-3-quarters",spinning:!0})),W?r().createElement("li",{className:"error"},"Failed to load chat history"):null),!D&&Y&&r().createElement("div",{className:"load-more",ref:Z},r().createElement(u.Bj,{lib:"antd",icon:"loading-3-quarters",spinning:!0}))))}},84311:(e,t,i)=>{i.d(t,{d:()=>r});var n=i(18769),a=i(60128);function r(e,t){const[i,r]=(0,n.useState)(!1);return(0,n.useEffect)((()=>{if(!e)return void r(!1);function i(i){for(const n of[e,...null!=t?t:[]])if((0,a.matchPath)(i.pathname,{path:n,exact:!1}))return void r(!0);r(!1)}const n=(0,a.getHistory)();return i(n.location),n.listen(i)}),[e,t]),i}},94504:(e,t,i)=>{i.d(t,{k:()=>a});var n=i(84311);function a(e){let{url:t,activeIncludes:i,render:a}=e;return a({active:(0,n.d)(t,i)})}}}]);
3
- //# sourceMappingURL=7059.bdb0d78e.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"chunks/7059.bdb0d78e.js","mappings":";qMAEO,IAAKA,EAAC,SAADA,GAAC,OAADA,EAAC,oBAADA,EAAC,gBAADA,EAAC,cAADA,EAAC,sBAADA,EAAC,kCAADA,EAAC,oCAADA,EAAC,kCAADA,EAAC,QAADA,EAAC,oBAADA,EAAC,kBAADA,EAAC,gCAADA,EAAC,kCAADA,EAAC,oBAADA,EAAC,kBAADA,EAAC,oCAADA,EAAC,gDAADA,EAAC,4BAADA,EAAC,4CAADA,EAAC,wCAADA,CAAC,MAsBb,MAAMC,EAAa,CACjB,CAACD,EAAEE,UAAW,WACd,CAACF,EAAEG,QAAS,SACZ,CAACH,EAAEI,OAAQ,QACX,CAACJ,EAAEK,WAAY,YACf,CAACL,EAAEM,iBAAkB,kBACrB,CAACN,EAAEO,kBAAmB,mBACtB,CAACP,EAAEQ,iBAA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ACpB,OAEJ0F,GAAoBE,GACpB/F,IAAAA,cAAA,OAAKG,UAAU,YAAYG,IAAKgI,GAC9BtI,IAAAA,cAACK,EAAAA,GAAW,CAAC1B,IAAI,OAAOC,KAAK,qBAAqBwM,UAAQ,MAMtE,8DCtgBO,SAASrL,EACdG,EACAwB,GAEA,MAAOT,EAAQuK,IAAa7L,EAAAA,EAAAA,WAAS,GAsBrC,OApBA0C,EAAAA,EAAAA,YAAU,KACR,IAAKnC,EAEH,YADAsL,GAAU,GAGZ,SAASC,EAAgBC,GACvB,IAAK,MAAMC,IAAQ,CAACzL,KAAUwB,QAAAA,EAAkB,IAE9C,IADgBkK,EAAAA,EAAAA,WAAUF,EAAIG,SAAU,CAAEF,OAAMG,OAAO,IAGrD,YADAN,GAAU,GAIdA,GAAU,EACZ,CACA,MAAMO,GAAU5K,EAAAA,EAAAA,cAEhB,OADAsK,EAAgBM,EAAQC,UACjBD,EAAQE,OAAOR,EAAgB,GACrC,CAACvL,EAAKwB,IAEFT,CACT,mDCtBO,SAASQ,EAAO1C,GAAgD,IAA/C,IAAEmB,EAAG,eAAEwB,EAAc,OAAEC,GAAsB5C,EAGnE,OAAO4C,EAAO,CAAEV,QAFDlB,EAAAA,EAAAA,GAAiBG,EAAKwB,IAGvC","sources":["webpack:///./src/elevo-sidebar/i18n.ts","webpack:///./src/elevo-sidebar/constants.ts","webpack:///./src/elevo-sidebar/SpaceNav.tsx","webpack:///./src/elevo-sidebar/SectionTitle.tsx","webpack:///./src/elevo-sidebar/styles.shadow.css","webpack:///./src/elevo-sidebar/bricks.ts","webpack:///../../node_modules/@next-api-sdk/llm-sdk/dist/esm/api/llm/elevo/getElevoProjects.js","webpack:///../../node_modules/@next-api-sdk/llm-sdk/dist/esm/api/llm/elevo/listElevoConversations.js","webpack:///./src/elevo-sidebar/ChatHistory.tsx","webpack:///./src/elevo-sidebar/useNavLinkActive.ts","webpack:///./src/elevo-sidebar/NavLink.tsx"],"sourcesContent":["import { i18n } from \"@next-core/i18n\";\n\nexport enum K {\n NEW_CHAT = \"NEW_CHAT\",\n LOGOUT = \"LOGOUT\",\n TODAY = \"TODAY\",\n YESTERDAY = \"YESTERDAY\",\n PREVIOUS_7_DAYS = \"PREVIOUS_7_DAYS\",\n PREVIOUS_30_DAYS = \"PREVIOUS_30_DAYS\",\n SWITCH_LANGUAGE = \"SWITCH_LANGUAGE\",\n MY = \"MY\",\n PROJECTS = \"PROJECTS\",\n HISTORY = \"HISTORY\",\n CREATE_PROJECT = \"CREATE_PROJECT\",\n MOVE_TO_PROJECT = \"MOVE_TO_PROJECT\",\n UNTITLED = \"UNTITLED\",\n UNNAMED = \"UNNAMED\",\n BUSINESS_OBJECTS = \"BUSINESS_OBJECTS\",\n BUSINESS_OBJECT_MODELS = \"BUSINESS_OBJECT_MODELS\",\n SERVICEFLOWS = \"SERVICEFLOWS\",\n COLLABORATION_SPACES = \"COLLABORATION_SPACES\",\n CREATE_SERVICEFLOW = \"CREATE_SERVICEFLOW\",\n}\n\nconst en: Locale = {\n [K.NEW_CHAT]: \"New chat\",\n [K.LOGOUT]: \"Logout\",\n [K.TODAY]: \"Today\",\n [K.YESTERDAY]: \"Yesterday\",\n [K.PREVIOUS_7_DAYS]: \"Previous 7 days\",\n [K.PREVIOUS_30_DAYS]: \"Previous 30 days\",\n [K.SWITCH_LANGUAGE]: \"中文\",\n [K.MY]: \"My\",\n [K.PROJECTS]: \"Projects\",\n [K.HISTORY]: \"Chats\",\n [K.CREATE_PROJECT]: \"Create project\",\n [K.MOVE_TO_PROJECT]: \"Move to project\",\n [K.UNTITLED]: \"Untitled\",\n [K.UNNAMED]: \"Unnamed\",\n [K.BUSINESS_OBJECTS]: \"Business objects\",\n [K.SERVICEFLOWS]: \"Serviceflows\",\n [K.COLLABORATION_SPACES]: \"Collaboration spaces\",\n [K.CREATE_SERVICEFLOW]: \"Create serviceflow\",\n [K.BUSINESS_OBJECT_MODELS]: \"Business object models\",\n};\n\nconst zh: Locale = {\n [K.NEW_CHAT]: \"新对话\",\n [K.LOGOUT]: \"登出\",\n [K.TODAY]: \"今天\",\n [K.YESTERDAY]: \"昨天\",\n [K.PREVIOUS_7_DAYS]: \"过去7天\",\n [K.PREVIOUS_30_DAYS]: \"过去30天\",\n [K.SWITCH_LANGUAGE]: \"English\",\n [K.MY]: \"我的\",\n [K.PROJECTS]: \"项目\",\n [K.HISTORY]: \"对话\",\n [K.CREATE_PROJECT]: \"创建项目\",\n [K.MOVE_TO_PROJECT]: \"移动到项目\",\n [K.UNTITLED]: \"无标题\",\n [K.UNNAMED]: \"未命名\",\n [K.BUSINESS_OBJECTS]: \"业务对象\",\n [K.SERVICEFLOWS]: \"业务流\",\n [K.COLLABORATION_SPACES]: \"协作空间\",\n [K.CREATE_SERVICEFLOW]: \"创建业务流\",\n [K.BUSINESS_OBJECT_MODELS]: \"业务对象模型\",\n};\n\nexport const NS = \"bricks/ai-portal/elevo-sidebar\";\n\nexport const locales = { en, zh };\n\nexport const t = i18n.getFixedT(null, NS);\n\ntype Locale = { [k in K]: string } & {\n [k in K as `${k}_plural`]?: string;\n};\n","import type { GeneralIconProps } from \"@next-bricks/icons/general-icon\";\n\nexport const ADD_ICON: GeneralIconProps = {\n lib: \"fa\",\n icon: \"plus\",\n};\n\nexport const MODEL_ICON: GeneralIconProps = {\n lib: \"lucide\",\n icon: \"box\",\n};\n","import React, { useRef, useState } from \"react\";\nimport classNames from \"classnames\";\nimport { getHistory } from \"@next-core/runtime\";\nimport { SectionTitle } from \"./SectionTitle.js\";\nimport { K, t } from \"./i18n.js\";\nimport { WrappedIcon, WrappedIconButton, WrappedLink } from \"./bricks.js\";\nimport { NavLink } from \"./NavLink.js\";\nimport type { SidebarLink } from \"./interfaces.js\";\nimport { ADD_ICON, MODEL_ICON } from \"./constants.js\";\nimport { useNavLinkActive } from \"./useNavLinkActive.js\";\n\nexport interface SpaceNavProps {\n returnUrl: string;\n introUrl: string;\n spaceDetail: {\n instanceId: string;\n name: string;\n };\n spaceObjects?: SidebarLink[];\n spaceServiceflows?: SidebarLink[];\n spaceLinks?: SidebarLink[];\n}\n\nexport interface SpaceNavComponentProps extends SpaceNavProps {\n onAddServiceflow?: () => void;\n}\n\nexport function SpaceNav({\n returnUrl,\n introUrl,\n spaceDetail,\n spaceObjects,\n spaceServiceflows,\n spaceLinks,\n onAddServiceflow,\n}: SpaceNavComponentProps) {\n const rootRef = useRef<HTMLDivElement | null>(null);\n const [objectsCollapsed, setObjectsCollapsed] = useState(false);\n const [serviceflowsCollapsed, setServiceflowsCollapsed] = useState(false);\n const introActive = useNavLinkActive(introUrl);\n\n return (\n <>\n <WrappedLink url={returnUrl} className=\"return-link\">\n <div className=\"heading\">\n <div className=\"title\">{spaceDetail?.name}</div>\n <div className=\"sub-title\">{t(K.COLLABORATION_SPACES)}</div>\n </div>\n <WrappedIcon className=\"icon\" lib=\"lucide\" icon=\"arrow-left\" />\n </WrappedLink>\n <div className=\"divider\" />\n <div className=\"history\" ref={rootRef}>\n {spaceObjects ? (\n <div\n className={classNames(\"section\", { collapsed: objectsCollapsed })}\n >\n <SectionTitle\n rootRef={rootRef}\n title={t(K.BUSINESS_OBJECTS)}\n collapsed={objectsCollapsed}\n onToggle={() => setObjectsCollapsed((prev) => !prev)}\n >\n <WrappedIconButton\n icon={MODEL_ICON}\n variant=\"mini-light\"\n tooltip={t(K.BUSINESS_OBJECT_MODELS)}\n tooltipHoist={true}\n className=\"button\"\n active={introActive}\n onClick={() => getHistory().push(introUrl)}\n />\n </SectionTitle>\n <ul className=\"items\">\n {spaceObjects.map((obj, index) => (\n <li key={index}>\n <NavLink\n url={obj.url}\n activeIncludes={obj.activeIncludes}\n render={({ active }) => (\n <WrappedLink\n className={classNames(\"item\", { active })}\n url={obj.url}\n >\n <div className=\"item-title\">{obj.title}</div>\n </WrappedLink>\n )}\n />\n </li>\n ))}\n </ul>\n </div>\n ) : null}\n {spaceServiceflows ? (\n <div\n className={classNames(\"section\", {\n collapsed: serviceflowsCollapsed,\n })}\n >\n <SectionTitle\n rootRef={rootRef}\n title={t(K.SERVICEFLOWS)}\n collapsed={serviceflowsCollapsed}\n onToggle={() => setServiceflowsCollapsed((prev) => !prev)}\n >\n <WrappedIconButton\n icon={ADD_ICON}\n variant=\"mini-light\"\n tooltip={t(K.CREATE_SERVICEFLOW)}\n tooltipHoist={true}\n className=\"button\"\n onClick={onAddServiceflow}\n />\n </SectionTitle>\n <ul className=\"items\">\n {spaceServiceflows.map((obj, index) => (\n <li key={index}>\n <NavLink\n url={obj.url}\n activeIncludes={obj.activeIncludes}\n render={({ active }) => (\n <WrappedLink\n className={classNames(\"item\", { active })}\n url={obj.url}\n >\n <div className=\"item-title\">{obj.title}</div>\n </WrappedLink>\n )}\n />\n </li>\n ))}\n </ul>\n </div>\n ) : null}\n {spaceLinks?.length ? (\n <div className=\"space-links\">\n {spaceLinks.map((link, index) => (\n <NavLink\n key={index}\n url={link.url}\n activeIncludes={link.activeIncludes}\n render={({ active }) => (\n <WrappedLink\n key={index}\n className={classNames(\"link\", { active })}\n url={link.url}\n >\n <WrappedIcon className=\"icon\" {...link.icon} />\n <span className=\"title\">{link.title}</span>\n </WrappedLink>\n )}\n />\n ))}\n </div>\n ) : null}\n </div>\n </>\n );\n}\n","import React, {\n useEffect,\n useRef,\n useState,\n type MutableRefObject,\n type PropsWithChildren,\n} from \"react\";\nimport { throttle } from \"lodash\";\nimport classNames from \"classnames\";\nimport { WrappedIcon } from \"./bricks.js\";\n\nexport interface SectionTitleProps {\n rootRef: MutableRefObject<HTMLDivElement | null>;\n title: string;\n collapsed: boolean;\n onToggle: () => void;\n}\n\nexport function SectionTitle({\n rootRef,\n title,\n collapsed,\n children,\n onToggle,\n}: PropsWithChildren<SectionTitleProps>) {\n const ref = useRef<HTMLDivElement | null>(null);\n const [stickyActive, setStickyActive] = useState(false);\n\n useEffect(() => {\n if (collapsed) {\n setStickyActive(false);\n return;\n }\n const parent = rootRef.current;\n const element = ref.current;\n const sibling = element?.nextElementSibling as HTMLElement | null;\n if (!parent || !element || !sibling) {\n return;\n }\n const onScroll = throttle(() => {\n const rect = element.getBoundingClientRect();\n const siblingRect = sibling.getBoundingClientRect();\n const diff = siblingRect.top - rect.top - rect.height;\n setStickyActive(diff < 1);\n }, 100);\n parent.addEventListener(\"scroll\", onScroll);\n return () => {\n parent.removeEventListener(\"scroll\", onScroll);\n };\n }, [collapsed, rootRef]);\n\n return (\n <div\n className={classNames(\"section-title\", { sticky: stickyActive })}\n ref={ref}\n >\n <div className=\"section-label\" onClick={onToggle}>\n {title}\n <WrappedIcon lib=\"fa\" icon=\"angle-down\" />\n </div>\n {children}\n </div>\n );\n}\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `:host{display:block}:host([hidden]){display:none}*{box-sizing:border-box}.sidebar{position:relative;z-index:2;width:260px;height:100%;background:rgba(246,247,249,0.5);border:1px solid rgba(255,255,255,0.3);border-radius:12px;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);padding:23px 11px 0;display:flex;flex-direction:column;transition:transform 0.3s ease-in-out}.logo-bar{display:flex;align-items:center;justify-content:space-between;margin-bottom:30px;margin-left:4px}.main{flex:1;min-height:0;display:flex;flex-direction:column}.divider{border-top:1px solid rgba(0,0,0,0.06);margin:16px 0}.logo-link::part(link){display:block}.logo{vertical-align:middle}.new-chat::part(link){display:flex;gap:0;align-items:center;color:var(--elevo-color-brand);font-size:14px;text-align:left;cursor:pointer}.sidebar .new-chat::part(link){background:#f0f4ff;border-radius:8px;border:1px solid #c9d7ff;padding:9px 13px;font-weight:500;margin-bottom:16px}.sidebar .new-chat::part(link):hover{background:rgba(201,215,255,0.5)}.new-chat-icon{font-size:16px;margin-right:5px}.footer{border-top:1px solid rgba(0,0,0,0.04);padding:9px 12px;margin:0 -12px}.dropdown{display:block}.account{background:none;border:none;border-radius:8px;padding:6px 10px;display:block;width:100%;text-align:left;cursor:pointer}.account:hover{background:rgba(0,0,0,0.04)}.alternative{position:fixed;top:8px;left:8px;padding:6px 10px 6px 8px;display:flex;align-items:center;opacity:0;z-index:2;transition:opacity 0.2s ease-in-out;background:rgba(255,255,255,0);border-radius:8px;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}.alternative .new-chat::part(link){padding:4px;margin-left:16px;font-size:12px}.alternative .new-chat::part(link):hover{color:#7891ff}.alternative .new-chat::part(link):active{color:#0911b3}.container{width:270px;padding:10px 0 10px 10px;height:100%;transition:width 0.3s ease-in-out,padding 0.3s ease-in-out}.container.collapsed{width:0;padding:10px 0;overflow:visible}.container.collapsed .sidebar{transform:translateX(-100%)}.container.collapsed .alternative{opacity:1}:host([behavior=\"drawer\"]){z-index:2;width:0}:host(:not([behavior=\"drawer\"])) .alternative .new-chat{display:none}.mask{position:fixed;top:0;right:0;bottom:0;left:0}.link{display:block}.link + .link{margin-top:4px}.link::part(link){display:flex;gap:0;align-items:center;padding:7px 10px;border-radius:8px;color:#000}.link.active::part(link),.link::part(link):hover{background:rgba(0,0,0,0.04)}.link .icon{font-size:16px;margin-right:10px}.link .title{flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.history{flex:1;min-height:0;overflow-y:auto;margin:0 -12px;padding:0 12px}.history ul{list-style:none;margin:0;padding:0}.history .section + .section{margin-top:14px}.history .section-title{display:flex;align-items:center;justify-content:space-between;height:30px;margin-bottom:6px;padding:0 8px;position:sticky;top:0}.history .section-title.sticky::before{content:\"\";position:absolute;top:0;right:0;bottom:0;left:0;background-color:rgb(229,228,234);border-radius:8px;z-index:-1}.history .section-label{display:flex;align-items:center;height:24px;padding:0 8px;margin-left:-8px;cursor:pointer;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:500;font-size:12px;color:#8c8c8c;border-radius:8px}.history .section-label eo-icon{vertical-align:middle;margin-left:6px;transition:transform 0.2s ease-in-out}.history .section-label:hover{background:rgba(0,0,0,0.04)}.history .collapsed > ul{display:none}.history .collapsed .section-label eo-icon{transform:rotate(-90deg)}.history .error,.history .loading{display:flex;align-items:center;height:36px;padding:0 8px}.history .loading{justify-content:center}.history .error{color:var(--color-error)}.history .group + .group{margin-top:15px}.history .group-title{font-weight:500;font-size:12px;color:#000;padding:8px;height:36px;line-height:20px}.history .item{display:block}.history .item::part(link){display:flex;align-items:center;padding:0 8px;height:36px;border-radius:8px;color:#000}.history .item.active::part(link){background:rgba(0,0,0,0.06)}.history .item.actions-active::part(link),.history .item::part(link):hover{background:rgba(0,0,0,0.04)}.history .item-title{flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.history .actions{cursor:auto}.history .item:not(:hover):not(.actions-active) .actions{display:none}.history .working{width:8px;height:8px;border-radius:8px;background:var(--elevo-color-brand);margin:0 7px}.history .item.actions-active .working,.history .item:hover .working,.history .item.active .working{display:none}.history .load-more{display:flex;justify-content:center;align-items:center;height:36px}.button{display:flex}.space-links{margin-top:16px}.return-link{display:block}.return-link .heading{display:flex;flex-direction:column;align-items:flex-start;gap:4px;flex:1;min-width:0}.return-link .title,.return-link .sub-title{width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.return-link .title{font-weight:500;font-size:18px}.return-link .sub-title{font-size:12px;color:#8c8c8c}.return-link .icon{font-size:16px;color:#8c8c8c}.return-link:not(:hover) .icon{display:none}.return-link::part(link){display:flex;align-items:center;justify-content:center;padding:6px 8px;border-radius:8px;color:#000}.return-link::part(link):hover{background:rgba(0,0,0,0.04)}`, \"\"]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___.toString();\n","import { wrapBrick } from \"@next-core/react-element\";\nimport type {\n GeneralIcon,\n GeneralIconProps,\n} from \"@next-bricks/icons/general-icon\";\nimport type { Link, LinkProps } from \"@next-bricks/basic/link\";\nimport type {\n EoDropdownActions,\n DropdownActionsProps,\n DropdownActionsEvents,\n DropdownActionsEventsMapping,\n} from \"@next-bricks/basic/dropdown-actions\";\nimport type {\n EoEasyopsAvatar,\n EoEasyopsAvatarProps,\n} from \"@next-bricks/basic/easyops-avatar\";\nimport type {\n EoMiniActions,\n EoMiniActionsEvents,\n EoMiniActionsEventsMapping,\n EoMiniActionsProps,\n} from \"@next-bricks/basic/mini-actions\";\nimport type { IconButton, IconButtonProps } from \"../icon-button\";\n\nexport const WrappedIcon = wrapBrick<GeneralIcon, GeneralIconProps>(\"eo-icon\");\nexport const WrappedLink = wrapBrick<Link, LinkProps>(\"eo-link\");\nexport const WrappedDropdownActions = wrapBrick<\n EoDropdownActions,\n DropdownActionsProps & { themeVariant?: \"default\" | \"elevo\" },\n DropdownActionsEvents,\n DropdownActionsEventsMapping\n>(\"eo-dropdown-actions\", {\n onActionClick: \"action.click\",\n onVisibleChange: \"visible.change\",\n});\nexport const WrappedEasyopsAvatar = wrapBrick<\n EoEasyopsAvatar,\n EoEasyopsAvatarProps\n>(\"eo-easyops-avatar\");\nexport const WrappedMiniActions = wrapBrick<\n EoMiniActions,\n EoMiniActionsProps & { themeVariant?: \"default\" | \"elevo\" },\n EoMiniActionsEvents,\n EoMiniActionsEventsMapping\n>(\"eo-mini-actions\", {\n onActionClick: \"action.click\",\n onVisibleChange: \"visible.change\",\n});\nexport const WrappedIconButton = wrapBrick<IconButton, IconButtonProps>(\n \"ai-portal.icon-button\"\n);\n","import { http } from \"@next-core/http\";\n/**\n * @description 获取elevo项目列表\n * @endpoint list /api/v1/elevo/projects\n */\nexport const ElevoApi_getElevoProjects = async (params, options) => /**! @contract easyops.api.llm.elevo.GetElevoProjects@1.0.0 */(await http.get(\"api/gateway/logic.llm.aiops_service/api/v1/elevo/projects\", {\n ...options,\n params\n})).data;\n//# sourceMappingURL=getElevoProjects.js.map","import { http } from \"@next-core/http\";\n/**\n * @description 获取elevo会话列表\n * @endpoint GET /api/v1/elevo/conversations\n */\nexport const ElevoApi_listElevoConversations = async (params, options) => /**! @contract easyops.api.llm.elevo.ListElevoConversations@1.0.0 */(await http.get(\"api/gateway/logic.llm.aiops_service/api/v1/elevo/conversations\", {\n ...options,\n params\n})).data;\n//# sourceMappingURL=listElevoConversations.js.map","import React, {\n forwardRef,\n useCallback,\n useEffect,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport classNames from \"classnames\";\nimport {\n ElevoApi_listElevoConversations,\n ElevoApi_getElevoProjects,\n type ElevoApi_ListElevoConversationsRequestParams,\n} from \"@next-api-sdk/llm-sdk\";\nimport type {\n ActionType,\n SimpleActionType,\n} from \"@next-bricks/basic/mini-actions\";\nimport { isEqual } from \"lodash\";\nimport { K, t } from \"./i18n.js\";\nimport {\n WrappedIcon,\n WrappedLink,\n WrappedMiniActions,\n WrappedIconButton,\n} from \"./bricks.js\";\nimport { DONE_STATES } from \"../shared/constants.js\";\nimport { parseTemplate } from \"../shared/parseTemplate.js\";\nimport type { ConversationState } from \"../shared/interfaces.js\";\nimport type { SidebarLink } from \"./interfaces.js\";\nimport { NavLink } from \"./NavLink.js\";\nimport { SectionTitle } from \"./SectionTitle.js\";\nimport { ADD_ICON } from \"./constants.js\";\n\nexport interface HistoryItem {\n conversationId: string;\n title: string;\n startTime: number;\n state?: ConversationState;\n}\n\nexport interface GroupedHistory {\n title: string;\n items: HistoryItem[];\n}\n\nexport interface ActionClickDetail {\n action: SimpleActionType & {\n project?: Project;\n };\n item: HistoryItem;\n project?: Project;\n}\n\nexport interface ProjectActionClickDetail {\n action: SimpleActionType;\n project: Project;\n}\n\nexport interface PersonalActionClickDetail {\n action: SimpleActionType;\n}\n\nexport interface Project {\n /** 实例ID */\n instanceId: string;\n /** 项目名称 */\n name: string;\n /** 项目描述 */\n description: string;\n /** 状态 */\n state: \"active\" | \"inactive\";\n /** 默认数字人ID */\n defaultAiEmployeeId: string;\n /** 创建者 */\n creator: string;\n /** 创建时间 */\n ctime: string;\n /** 修改时间 */\n mtime: string;\n /** 修改者 */\n modifier: string;\n}\n\nexport interface ChatHistoryProps {\n showProjects?: boolean;\n historyUrlTemplate?: string;\n historyActions?: ActionType[];\n projectUrlTemplate?: string;\n projectActions?: ActionType[];\n canAddProject?: boolean;\n myLinks?: SidebarLink[];\n onActionClick: (detail: ActionClickDetail) => void;\n onHistoryClick: () => void;\n onProjectActionClick: (detail: ProjectActionClickDetail) => void;\n onAddProject: () => void;\n}\n\nexport interface ChatHistoryRef {\n pull: () => void;\n removeProject?: (projectId: string) => void;\n addProject?: (project: Project) => void;\n moveConversation?: (conversationId: string) => void;\n}\n\nexport const ChatHistory = forwardRef(LowLevelChatHistory);\n\nexport function LowLevelChatHistory(\n {\n showProjects,\n historyActions,\n historyUrlTemplate,\n projectUrlTemplate,\n projectActions,\n canAddProject,\n myLinks,\n onActionClick,\n onHistoryClick,\n onProjectActionClick,\n onAddProject,\n }: ChatHistoryProps,\n ref: React.Ref<ChatHistoryRef>\n) {\n const rootRef = useRef<HTMLDivElement | null>(null);\n const [myCollapsed, setMyCollapsed] = useState(false);\n const [projects, setProjects] = useState<Project[] | null>(null);\n const [projectsCollapsed, setProjectsCollapsed] = useState(false);\n const [projectsError, setProjectsError] = useState(false);\n const [historyList, setHistoryList] = useState<HistoryItem[] | null>(null);\n const [historyCollapsed, setHistoryCollapsed] = useState(false);\n const [nextToken, setNextToken] = useState<string | undefined>();\n const [loadNextToken, setLoadNextToken] = useState<string | undefined>();\n const [historyError, setHistoryError] = useState(false);\n const initialRef = useRef(true);\n const [movedConversations, setMovedConversations] = useState<string[]>([]);\n\n const mergedHistoryActions = useMemo(\n () =>\n [\n ...(historyActions ?? []),\n {\n isDropdown: true,\n text: t(K.MOVE_TO_PROJECT),\n disabled: !projects?.length,\n items: projects?.map((project) => ({\n event: \"move\",\n key: project.instanceId,\n text: project.name,\n project,\n })),\n },\n ] as ActionType[],\n [historyActions, projects]\n );\n\n useEffect(() => {\n (async () => {\n try {\n const projects = await ElevoApi_getElevoProjects({\n page: 1,\n page_size: 3000,\n });\n setProjects(projects.list as Project[]);\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error(\"Error loading projects:\", error);\n setProjectsError(true);\n setProjects([]);\n }\n })();\n }, []);\n\n useEffect(() => {\n Promise.all([\n ElevoApi_listElevoConversations(\n {\n token: loadNextToken,\n limit: 30,\n onlyOwner: true,\n onlyUnrelatedProject: true,\n } as ElevoApi_ListElevoConversationsRequestParams,\n {\n interceptorParams: {\n ignoreLoadingBar: true,\n },\n }\n ),\n ...(initialRef.current\n ? []\n : [\n new Promise((resolve) => setTimeout(resolve, 500)), // Force a minimum delay\n ]),\n ])\n .then(([data]) => {\n initialRef.current = false;\n setHistoryList((prev) => [\n ...(prev ?? []),\n ...(data.conversations as HistoryItem[]),\n ]);\n setNextToken(data.nextToken);\n })\n .catch((error) => {\n // eslint-disable-next-line no-console\n console.error(\"Error loading chat history:\", error);\n setHistoryList([]);\n setHistoryError(true);\n });\n }, [loadNextToken]);\n\n const [actionsVisible, setActionsVisible] = useState<string | null>(null);\n\n const nextRef = useRef<HTMLDivElement | null>(null);\n\n useEffect(() => {\n const next = nextRef.current;\n const root = rootRef.current;\n if (!next || !nextToken || !root || historyCollapsed) {\n return;\n }\n const observer = new IntersectionObserver(\n (entries) => {\n for (const entry of entries) {\n if (entry.isIntersecting) {\n setLoadNextToken(nextToken);\n }\n }\n },\n { root }\n );\n observer.observe(next);\n return () => {\n observer.disconnect();\n };\n }, [nextToken, historyCollapsed]);\n\n const pullIdRef = useRef(0);\n\n const pull = useCallback(async () => {\n try {\n const pullId = ++pullIdRef.current;\n const tempList = await ElevoApi_listElevoConversations(\n {\n limit: 30,\n onlyOwner: true,\n onlyUnrelatedProject: true,\n } as ElevoApi_ListElevoConversationsRequestParams,\n {\n interceptorParams: {\n ignoreLoadingBar: true,\n },\n }\n );\n if (pullId !== pullIdRef.current) {\n // Ignore this pull if a newer one has been triggered\n return;\n }\n setHistoryList((prev) => {\n const prevList = prev ?? [];\n const newList = tempList.conversations as HistoryItem[];\n const newIds = new Set(newList.map((item) => item.conversationId));\n const newItemsMap = new Map(\n newList.map((item) => [item.conversationId, item])\n );\n\n let foundIntersection = false;\n let foundChanged = false;\n let isFirst = true;\n for (const item of prevList) {\n const newItem = newItemsMap.get(item.conversationId);\n if (newItem) {\n foundIntersection = true;\n foundChanged =\n (isFirst && newItem !== newList[0]) || !isEqual(newItem, item);\n if (foundChanged) {\n break;\n }\n } else {\n break;\n }\n isFirst = false;\n }\n\n if (!foundIntersection) {\n setNextToken(tempList.nextToken);\n return newList;\n }\n\n if (foundChanged) {\n return [\n ...newList,\n ...prevList.filter((item) => !newIds.has(item.conversationId)),\n ];\n }\n\n return prev;\n });\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error(\"Error pulling chat history:\", error);\n }\n }, []);\n\n useImperativeHandle(\n ref,\n () => ({\n pull,\n removeProject: (projectId: string) => {\n setProjects((prev) =>\n prev ? prev.filter((p) => p.instanceId !== projectId) : prev\n );\n },\n addProject: (project: Project) => {\n setProjects((prev) => (prev ? [...prev, project] : [project]));\n },\n moveConversation: (conversationId: string) => {\n setMovedConversations((prev) => [...prev, conversationId]);\n },\n }),\n [pull]\n );\n\n const filteredHistoryList = useMemo(() => {\n if (!historyList || !historyList.length) {\n return historyList;\n }\n return historyList.filter(\n (item) => !movedConversations.includes(item.conversationId)\n );\n }, [historyList, movedConversations]);\n\n return (\n <div className=\"history\" ref={rootRef}>\n {myLinks?.length ? (\n <div className={classNames(\"section\", { collapsed: myCollapsed })}>\n <SectionTitle\n rootRef={rootRef}\n title={t(K.MY)}\n collapsed={myCollapsed}\n onToggle={() => setMyCollapsed((prev) => !prev)}\n />\n <ul className=\"items\">\n {myLinks.map((link, index) => (\n <li key={index}>\n <NavLink\n url={link.url}\n activeIncludes={link.activeIncludes}\n render={({ active }) => (\n <WrappedLink\n className={classNames(\"item\", { active })}\n url={link.url}\n >\n <div className=\"item-title\">{link.title}</div>\n </WrappedLink>\n )}\n />\n </li>\n ))}\n </ul>\n </div>\n ) : null}\n {showProjects && (\n <div\n className={classNames(\"section\", { collapsed: projectsCollapsed })}\n >\n <SectionTitle\n rootRef={rootRef}\n title={t(K.PROJECTS)}\n collapsed={projectsCollapsed}\n onToggle={() => setProjectsCollapsed((prev) => !prev)}\n >\n {canAddProject && (\n <WrappedIconButton\n icon={ADD_ICON}\n variant=\"mini-light\"\n tooltip={t(K.CREATE_PROJECT)}\n tooltipHoist={true}\n className=\"button\"\n onClick={onAddProject}\n />\n )}\n </SectionTitle>\n <ul className=\"items\">\n {projectsError ? (\n <li className=\"error\">Failed to load project</li>\n ) : projects ? (\n projects.map((project) => {\n const url = projectUrlTemplate\n ? parseTemplate(projectUrlTemplate, project)\n : undefined;\n return (\n <li key={project.instanceId}>\n <NavLink\n url={url}\n render={({ active }) => (\n <WrappedLink\n className={classNames(\"item\", {\n \"actions-active\":\n project.instanceId === actionsVisible,\n active,\n })}\n onClick={onHistoryClick}\n {...(url ? { url } : null)}\n >\n <div className=\"item-title\" title={project.name}>\n {project.name || t(K.UNNAMED)}\n </div>\n <WrappedMiniActions\n className=\"actions\"\n actions={projectActions}\n themeVariant=\"elevo\"\n onActionClick={(e) => {\n onProjectActionClick({\n action: e.detail,\n project,\n });\n }}\n onVisibleChange={(e) => {\n setActionsVisible(\n e.detail ? project.instanceId : null\n );\n }}\n />\n </WrappedLink>\n )}\n />\n </li>\n );\n })\n ) : (\n <li className=\"loading\">\n <WrappedIcon\n lib=\"antd\"\n theme=\"outlined\"\n icon=\"loading-3-quarters\"\n spinning\n />\n </li>\n )}\n </ul>\n </div>\n )}\n <div className={classNames(\"section\", { collapsed: historyCollapsed })}>\n <SectionTitle\n rootRef={rootRef}\n title={t(K.HISTORY)}\n collapsed={historyCollapsed}\n onToggle={() => setHistoryCollapsed((prev) => !prev)}\n />\n <ul className=\"items\">\n {filteredHistoryList ? (\n filteredHistoryList.map((item) => {\n const url = historyUrlTemplate\n ? parseTemplate(historyUrlTemplate, item)\n : undefined;\n return (\n <li key={item.conversationId}>\n <NavLink\n url={url}\n render={({ active }) => (\n <WrappedLink\n className={classNames(\"item\", {\n \"actions-active\":\n item.conversationId === actionsVisible,\n active,\n })}\n onClick={onHistoryClick}\n {...(historyUrlTemplate\n ? { url: parseTemplate(historyUrlTemplate, item) }\n : null)}\n >\n <div className=\"item-title\" title={item.title}>\n {item.title || t(K.UNTITLED)}\n </div>\n <WrappedMiniActions\n className=\"actions\"\n actions={mergedHistoryActions}\n onActionClick={(e) => {\n onActionClick({\n action: e.detail,\n item,\n project: (e.detail as { project?: Project })\n .project,\n });\n }}\n onVisibleChange={(e) => {\n setActionsVisible(\n e.detail ? item.conversationId : null\n );\n }}\n />\n {!DONE_STATES.includes(item.state!) && (\n <div className=\"working\"></div>\n )}\n </WrappedLink>\n )}\n />\n </li>\n );\n })\n ) : (\n <li className=\"loading\">\n <WrappedIcon\n lib=\"antd\"\n theme=\"outlined\"\n icon=\"loading-3-quarters\"\n spinning\n />\n </li>\n )}\n {historyError ? (\n <li className=\"error\">Failed to load chat history</li>\n ) : null}\n </ul>\n {!historyCollapsed && nextToken && (\n <div className=\"load-more\" ref={nextRef}>\n <WrappedIcon lib=\"antd\" icon=\"loading-3-quarters\" spinning />\n </div>\n )}\n </div>\n </div>\n );\n}\n","import { useEffect, useState } from \"react\";\nimport { getHistory, matchPath } from \"@next-core/runtime\";\nimport type { Location } from \"history\";\n\nexport function useNavLinkActive(\n url: string | null | undefined,\n activeIncludes?: string[]\n) {\n const [active, setActive] = useState(false);\n\n useEffect(() => {\n if (!url) {\n setActive(false);\n return;\n }\n function checkLinkActive(loc: Location) {\n for (const path of [url!, ...(activeIncludes ?? [])]) {\n const matched = matchPath(loc.pathname, { path, exact: false });\n if (matched) {\n setActive(true);\n return;\n }\n }\n setActive(false);\n }\n const history = getHistory();\n checkLinkActive(history.location);\n return history.listen(checkLinkActive);\n }, [url, activeIncludes]);\n\n return active;\n}\n","import React from \"react\";\nimport { useNavLinkActive } from \"./useNavLinkActive\";\n\nexport interface NavLinkProps {\n url?: string;\n activeIncludes?: string[];\n render: (props: { active: boolean }) => React.ReactElement;\n}\n\nexport function NavLink({ url, activeIncludes, render }: NavLinkProps) {\n const active = useNavLinkActive(url, activeIncludes);\n\n return render({ active });\n}\n"],"names":["K","en","NEW_CHAT","LOGOUT","TODAY","YESTERDAY","PREVIOUS_7_DAYS","PREVIOUS_30_DAYS","SWITCH_LANGUAGE","MY","PROJECTS","HISTORY","CREATE_PROJECT","MOVE_TO_PROJECT","UNTITLED","UNNAMED","BUSINESS_OBJECTS","SERVICEFLOWS","COLLABORATION_SPACES","CREATE_SERVICEFLOW","BUSINESS_OBJECT_MODELS","zh","NS","locales","t","i18n","getFixedT","ADD_ICON","lib","icon","MODEL_ICON","SpaceNav","_ref","returnUrl","introUrl","spaceDetail","spaceObjects","spaceServiceflows","spaceLinks","onAddServiceflow","rootRef","useRef","objectsCollapsed","setObjectsCollapsed","useState","serviceflowsCollapsed","setServiceflowsCollapsed","introActive","useNavLinkActive","React","WrappedLink","url","className","name","WrappedIcon","ref","classNames","collapsed","SectionTitle","title","onToggle","prev","WrappedIconButton","variant","tooltip","tooltipHoist","active","onClick","getHistory","push","map","obj","index","key","NavLink","activeIncludes","render","_ref2","_ref3","length","link","_ref4","_extends","children","stickyActive","setStickyActive","useEffect","parent","current","element","sibling","nextElementSibling","onScroll","throttle","rect","getBoundingClientRect","diff","top","height","addEventListener","removeEventListener","sticky","___CSS_LOADER_EXPORT___","module","id","toString","wrapBrick","WrappedDropdownActions","onActionClick","onVisibleChange","WrappedEasyopsAvatar","WrappedMiniActions","ElevoApi_listElevoConversations","async","params","options","http","get","data","ChatHistory","forwardRef","LowLevelChatHistory","showProjects","historyActions","historyUrlTemplate","projectUrlTemplate","projectActions","canAddProject","myLinks","onHistoryClick","onProjectActionClick","onAddProject","myCollapsed","setMyCollapsed","projects","setProjects","projectsCollapsed","setProjectsCollapsed","projectsError","setProjectsError","historyList","setHistoryList","historyCollapsed","setHistoryCollapsed","nextToken","setNextToken","loadNextToken","setLoadNextToken","historyError","setHistoryError","initialRef","movedConversations","setMovedConversations","mergedHistoryActions","useMemo","isDropdown","text","disabled","items","project","event","instanceId","page","page_size","ElevoApi_getElevoProjects","list","error","console","Promise","all","token","limit","onlyOwner","onlyUnrelatedProject","interceptorParams","ignoreLoadingBar","resolve","setTimeout","then","conversations","catch","actionsVisible","setActionsVisible","nextRef","next","root","observer","IntersectionObserver","entries","entry","isIntersecting","observe","disconnect","pullIdRef","pull","useCallback","pullId","tempList","prevList","newList","newIds","Set","item","conversationId","newItemsMap","Map","foundIntersection","foundChanged","isFirst","newItem","isEqual","filter","has","useImperativeHandle","removeProject","projectId","p","addProject","moveConversation","filteredHistoryList","includes","parseTemplate","undefined","actions","themeVariant","e","action","detail","theme","spinning","_ref5","DONE_STATES","state","setActive","checkLinkActive","loc","path","matchPath","pathname","exact","history","location","listen"],"sourceRoot":""}
@@ -1,2 +0,0 @@
1
- "use strict";(globalThis.webpackChunk_next_bricks_ai_portal=globalThis.webpackChunk_next_bricks_ai_portal||[]).push([[9273],{9442:(e,t,a)=>{a.d(t,{A:()=>h});var n=a(72591),i=a.n(n),s=a(1740),r=a.n(s),l=a(88128),o=a.n(l),c=a(30855),d=a.n(c),m=a(93051),p=a.n(m),u=a(73656),b=a.n(u),f=a(86e3),g={};g.styleTagTransform=b(),g.setAttributes=d(),g.insert=o().bind(null,"head"),g.domAPI=r(),g.insertStyleElement=p(),i()(f.A,g);const h=f.A&&f.A.locals?f.A.locals:void 0},13330:(e,t,a)=>{a.d(t,{p:()=>r});var n=a(18769),i=a(50045),s=a(40177);function r(e,t,a,r,l,o,c){const d=null==c?void 0:c.showHumanActions,m=null==c?void 0:c.skipActivitySubTasks;return(0,n.useMemo)((()=>{if(!e)return{messages:[],lastDetail:null};const{chunks:n,jobMap:c}=(0,i.a)(a,r,l,o,m),p=[];let u={role:"assistant",chunks:[]},b=null;for(const e of n)if("job"===e.type){var f;const t=e.job;var g;t.toolCall&&!t.ignoreDetails&&(b={type:"job",id:t.id}),"completed"===t.state&&null!==(f=t.messages)&&void 0!==f&&f.length&&t.messages.every((e=>"user"===e.role))?(u.chunks.length>0&&p.push(u),p.push({role:"user",content:t.messages.flatMap((e=>e.parts.map((e=>"text"===e.type?e.text:"")))).join(""),cmd:t.cmd,mentionedAiEmployeeId:t.mentionedAiEmployeeId,fromSkippedSubTask:e.fromSkippedSubTask,files:null===(g=t.messages)||void 0===g?void 0:g.filter((e=>"user"===e.role)).flatMap((e=>e.parts)).filter((e=>"file"===e.type)).map((e=>e.file))}),u={role:"assistant",chunks:[]}):u.chunks.push(e),t.humanAction&&(u.chunks.length>0&&p.push(u),d&&p.push({role:"user",content:t.humanAction}),u={role:"assistant",chunks:[]})}else u.chunks.push(e),"error"!==e.type&&(b={type:e.type,id:e.task.id});let h=p.length>0&&!s.QB.includes(t);if(h&&"assistant"===u.role&&0===u.chunks.length){const e=p[p.length-1];"user"===e.role&&e.fromSkippedSubTask&&(h=!1)}return(u.chunks.length>0||h)&&p.push(u),{messages:p,jobMap:c,lastDetail:b}}),[e,t,a,l,o,r,d,m])}},17994:(e,t,a)=>{a.d(t,{A:()=>l});var n=a(36758),i=a.n(n),s=a(40935),r=a.n(s)()(i());r.push([e.id,".hil--e3zZFYQc{background:rgba(255,255,255,0.5);border-radius:8px;border:1px solid #ffffff;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);padding:13px 16px;margin-top:12px}.content--tmVj790o,\n.actions--wbNFKF3J{display:flex;align-items:center}.content--tmVj790o{gap:10px;flex-wrap:wrap}.actions--wbNFKF3J{justify-content:flex-end;margin-top:-3px}",""]),r.locals={hil:"hil--e3zZFYQc",content:"content--tmVj790o",actions:"actions--wbNFKF3J"};const l=r},26598:(e,t,a)=>{a.d(t,{A:()=>l});var n=a(36758),i=a.n(n),s=a(40935),r=a.n(s)()(i());r.push([e.id,".user--HjXM9OHW{background:rgba(255,255,255,0.6);border-radius:24px;padding:8px 16px;width:-moz-fit-content;width:fit-content;max-width:500px;margin-left:auto;overflow-wrap:break-word;white-space:pre-wrap;font-size:16px;line-height:26px}",""]),r.locals={user:"user--HjXM9OHW"};const l=r},30621:(e,t,a)=>{a.d(t,{R:()=>E});var n=a(18769),i=a.n(n),s=a(72591),r=a.n(s),l=a(1740),o=a.n(l),c=a(88128),d=a.n(c),m=a(30855),p=a.n(m),u=a(93051),b=a.n(u),f=a(73656),g=a.n(f),h=a(26598),v={};v.styleTagTransform=g(),v.setAttributes=p(),v.insert=d().bind(null,"head"),v.domAPI=o(),v.insertStyleElement=b(),r()(h.A,v);const k=h.A&&h.A.locals?h.A.locals:void 0;var A=a(77388),x=a(47760);function E(e){let{content:t,cmd:a,mentionedAiEmployeeId:n,files:s}=e;return i().createElement(i().Fragment,null,i().createElement("div",{className:k.user},(a||n)&&i().createElement(A._,{cmd:a,mentionedAiEmployeeId:n}),t),null!=s&&s.length?i().createElement(x.$,{files:s,ui:"chat"}):null)}},32360:(e,t,a)=>{e.exports=a.p+"images/72c24398.png"},35754:(e,t,a)=>{a.d(t,{A:()=>l});var n=a(36758),i=a.n(n),s=a(40935),r=a.n(s)()(i());r.push([e.id,'.assistant--CrlgPgYL{display:flex}.body--sAIo2dhL{flex:1;min-width:0;padding:3px 0 3px 16px}.texting--Rpmsbpca{position:relative}.texting--Rpmsbpca::after{content:" ";animation:texting--Rpmsbpca 2s infinite;white-space:pre}.avatar--jaJhEiSV{font-size:32px}@keyframes texting--Rpmsbpca{0%{content:"\\00a0\\00a0\\00a0"}25%{content:".\\00a0\\00a0"}50%{content:"..\\00a0"}75%{content:"..."}100%{content:"\\00a0\\00a0\\00a0"}}',""]),r.locals={assistant:"assistant--CrlgPgYL",body:"body--sAIo2dhL",texting:"texting--Rpmsbpca",avatar:"avatar--jaJhEiSV"};const l=r},40563:(e,t,a)=>{a.d(t,{i:()=>s});var n=a(18769),i=a(99126);function s(e,t,a){const s=(0,n.useRef)(!1),r=(0,n.useRef)(!1),[l,o]=(0,n.useState)(!1);return(0,n.useEffect)((()=>{const e=t.current,n=a.current;if(r.current||!e||!n)return;const l=()=>{o(e.scrollTop+e.clientHeight+24<e.scrollHeight),s.current&&(r.current=e.scrollTop+e.clientHeight+6<e.scrollHeight)};let c;e.addEventListener("scroll",l);const d=new i.A((()=>{r.current||(s.current=!1,e.scrollTo({top:n.scrollHeight,behavior:"instant"}),clearTimeout(c),c=setTimeout((()=>{s.current=!0}),100))}));return d.observe(n),()=>{d.disconnect(),e.removeEventListener("scroll",l)}}),[e]),{scrollable:l,scrollToBottom:(0,n.useCallback)((()=>{const e=t.current;null==e||e.scrollTo({top:null==e?void 0:e.scrollHeight,behavior:"instant"})}),[t])}}},48952:(e,t,a)=>{a.d(t,{I:()=>r,K:()=>i,NS:()=>s,t:()=>l});var n=a(67177);let i=function(e){return e.SWITCH_TO_CANVAS="SWITCH_TO_CANVAS",e.INITIATING_SERVICE_FLOW="INITIATING_SERVICE_FLOW",e.STARTING_SERVICE_FLOW_ACTIVITY="STARTING_SERVICE_FLOW_ACTIVITY",e.HIL_TIPS="HIL_TIPS",e}({});const s="bricks/ai-portal/chat-stream",r={en:{SWITCH_TO_CANVAS:"Switch to canvas",INITIATING_SERVICE_FLOW:"Initiating service flow: {{ name }}",STARTING_SERVICE_FLOW_ACTIVITY:"Starting service flow activity: {{ name }}",HIL_TIPS:"Triggered HIL rule, waiting for {{ name }} to process."},zh:{SWITCH_TO_CANVAS:"切换为画布",INITIATING_SERVICE_FLOW:"发起业务流:{{ name }}",STARTING_SERVICE_FLOW_ACTIVITY:"开始业务流活动:{{ name }}",HIL_TIPS:"触发 HIL 规则,等待 {{ name }} 处理。"}},l=n.i18n.getFixedT(null,s)},50094:(e,t,a)=>{a.d(t,{A:()=>l});var n=a(36758),i=a.n(n),s=a(40935),r=a.n(s)()(i());r.push([e.id,'.heading--lj5kJ2fg{display:flex;align-items:center;padding:5px 8px;margin:0 -8px 12px;cursor:pointer}.main--P8894aNV{font-size:16px;line-height:26px}.caret--XqX6mjyf{opacity:0;transition:transform 0.2s ease-in-out}.heading--lj5kJ2fg:hover{background:rgba(184,187,205,0.15);border-radius:8px}.heading--lj5kJ2fg:hover .caret--XqX6mjyf{opacity:1}.icon--l8SzaFlV{display:flex;align-items:center;margin-right:12px}.title--FZPCnJbE{color:#262626;font-weight:500;flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tool--ugqSpeIM{background:#e2e5ef;border:1px solid #d4d4de;border-radius:13px;line-height:24px;padding:0 12px;width:-moz-fit-content;width:fit-content;font-size:12px;color:rgba(0,0,0,0.65);cursor:pointer;display:flex;align-items:center;gap:7px;margin-bottom:12px}.tool--ugqSpeIM eo-icon{font-size:14px;color:#8c8c8c}.body--p3Zt_jA4{margin-bottom:20px}.heading--lj5kJ2fg + .body--p3Zt_jA4{padding-left:26px}.collapsed--cGSG2zk_ .body--p3Zt_jA4{display:none}.collapsed--cGSG2zk_ .caret--XqX6mjyf{transform:rotate(180deg);opacity:1}.content--pBkkWQ5e{margin-top:14px;font-size:16px;line-height:26px}.content--pBkkWQ5e .markdown--Ky2J85cs [class*="code-wrapper--"]::part(mermaid){background:rgba(255,255,255,0.6);border-radius:8px;border:1px solid rgba(0,0,0,0.1);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);padding:20px;min-width:var(--cruise-canvas-node-width-medium);width:auto;max-width:100%}.content--pBkkWQ5e:empty{display:none}.message--okEUzWzg:first-child > .message-part--kxjYnHz0:first-child > :first-child{margin-top:0}.icon--l8SzaFlV{color:#abaab7}.completed--JWq7E1Jw .icon--l8SzaFlV{color:#0fbe59}.failed--uk7jDD7K .icon--l8SzaFlV{color:#f24c25}.working--dZiN0y04 .icon--l8SzaFlV{color:var(--elevo-color-brand)}.input-required--JSuPr8br .icon--l8SzaFlV{color:#12aacc}.canceled--LyMjPJQd .icon--l8SzaFlV{color:#fcaa07}ai-portal\\.chat-stream[hide-mermaid] .content--pBkkWQ5e .markdown--Ky2J85cs .mermaid{display:none}.error--n_Of3DwP{color:var(--color-error);white-space:pre-wrap;word-break:break-word}',""]),r.locals={heading:"heading--lj5kJ2fg",main:"main--P8894aNV",caret:"caret--XqX6mjyf",icon:"icon--l8SzaFlV",title:"title--FZPCnJbE",tool:"tool--ugqSpeIM",body:"body--p3Zt_jA4",collapsed:"collapsed--cGSG2zk_",content:"content--pBkkWQ5e",markdown:"markdown--Ky2J85cs",message:"message--okEUzWzg","message-part":"message-part--kxjYnHz0",completed:"completed--JWq7E1Jw",failed:"failed--uk7jDD7K",working:"working--dZiN0y04","input-required":"input-required--JSuPr8br",canceled:"canceled--LyMjPJQd",error:"error--n_Of3DwP"};const l=r},51069:(e,t,a)=>{a.d(t,{W:()=>n});const n=(0,a(18769).createContext)({lastDetail:null,setUserClosedAside:()=>{}})},65438:(e,t,a)=>{a.d(t,{A:()=>l});var n=a(36758),i=a.n(n),s=a(40935),r=a.n(s)()(i());r.push([e.id,".view--O8CNDdS_{background:rgba(255,255,255,0.6);border-radius:8px;border:1px solid rgba(0,0,0,0.1);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);padding:12px 20px;width:var(--cruise-canvas-node-width-medium);max-width:100%;margin-top:14px}.large--jT3IWlRf{width:var(--cruise-canvas-node-width-large)}",""]),r.locals={view:"view--O8CNDdS_",large:"large--jT3IWlRf"};const l=r},84766:(e,t,a)=>{a.d(t,{G:()=>Y});var n=a(18769),i=a.n(n),s=a(72591),r=a.n(s),l=a(1740),o=a.n(l),c=a(88128),d=a.n(c),m=a(30855),p=a.n(m),u=a(93051),b=a.n(u),f=a(73656),g=a.n(f),h=a(35754),v={};v.styleTagTransform=g(),v.setAttributes=p(),v.insert=d().bind(null,"head"),v.domAPI=o(),v.insertStyleElement=b(),r()(h.A,v);const k=h.A&&h.A.locals?h.A.locals:void 0;var A=a(40177),x=a(30672),E=a(35430),w=a(89575),y=a(53373),I=a.n(y),S=a(41030),T=a(50094),N={};N.styleTagTransform=g(),N.setAttributes=p(),N.insert=d().bind(null,"head"),N.domAPI=o(),N.insertStyleElement=b(),r()(T.A,N);const _=T.A&&T.A.locals?T.A.locals:void 0;var j=a(36903),C=a(29386),V=a(42854),F=a(86976),W=a(65438),z={};z.styleTagTransform=g(),z.setAttributes=p(),z.insert=d().bind(null,"head"),z.domAPI=o(),z.insertStyleElement=b(),r()(W.A,z);const H=W.A&&W.A.locals?W.A.locals:void 0;function L(e){let{job:t}=e;const[a,s]=(0,n.useState)("medium"),r=(0,n.useCallback)((e=>{s(e)}),[]);return i().createElement("div",{className:I()(H.view,{[H.large]:"large"===a})},i().createElement(F.y,{job:t,onSizeChange:r}))}var R=a(76720),q=a(51069);function J(e,t){switch(e){case"completed":return{className:_.completed,icon:{lib:"antd",theme:"filled",icon:"check-circle"}};case"submitted":case"working":return"terminated"===t?{icon:{lib:"fa",prefix:"far",icon:"circle-stop"}}:{className:_.working,icon:{lib:"antd",theme:"outlined",icon:"loading-3-quarters",spinning:!0}};case"input-required":return{className:_["input-required"],icon:{lib:"fa",prefix:"far",icon:"circle-user"}};case"failed":return{className:_.failed,icon:{lib:"fa",prefix:"fas",icon:"xmark"}};case"canceled":case"terminated":return{className:_.canceled,icon:{lib:"fa",prefix:"far",icon:"circle-stop"}};case"skipped":return{icon:{lib:"fa",prefix:"fas",icon:"ban"}};default:return{icon:{lib:"fa",prefix:"far",icon:"clock"}}}}var O=a(47760);function P(e){var t,a;let{job:s,isSubTask:r}=e;const l=s.toolCall,o=(null==l||null===(t=l.annotations)||void 0===t?void 0:t.title)||(null==l?void 0:l.name),c=null==l?void 0:l.name,d=!!l,{conversationState:m,setActiveDetail:p,setSubActiveDetail:u}=(0,n.useContext)(R.j),{lastDetail:b,setUserClosedAside:f}=(0,n.useContext)(q.W),{className:g,icon:h}=(0,n.useMemo)((()=>J(s.state,m)),[s.state,m]),[v,k,E]=(0,n.useMemo)((()=>{var e;const t=[],a=[],n=[];let i="llm_answer"===c;return null===(e=s.messages)||void 0===e||e.forEach((e=>{if("tool"===e.role)for(const l of e.parts){var s;if("data"===l.type)switch(null===(s=l.data)||void 0===s?void 0:s.type){case"markdown":t.push(l.data.content);break;case"cmdb_instance_detail":var r;a.push(l.data),i||(i=Object.keys("object"===(null===(r=l.data)||void 0===r||null===(r=r.outputSchema)||void 0===r?void 0:r.type)?l.data.outputSchema.properties:l.data.detail).length>6)}else"file"===l.type&&n.push(l.file)}})),[t.join(""),a,n]}),[s.messages,c]),[y,T]=(0,n.useState)(!1),N=d||!!s.instruction;return i().createElement("div",{className:I()({[_.collapsed]:y})},N&&i().createElement("div",{className:I()(_.heading,g),onClick:()=>T((e=>!e))},i().createElement("div",{className:_.icon},i().createElement(x.Bj,h)),i().createElement("div",{className:_.title},s.instruction||o),i().createElement(x.Bj,(0,w.A)({className:_.caret},A.ae))),i().createElement("div",{className:_.body},d&&i().createElement("div",{className:_.tool,onClick:()=>{const e={type:"job",id:s.id};(r?u:p)((t=>(0,S.isEqual)(t,e)?t:e)),(0,S.isEqual)(e,b)&&f(!1)}},i().createElement(x.Bj,{lib:"lucide",icon:"square-chevron-right"}),o),i().createElement("div",{className:_.main},null===(a=s.messages)||void 0===a?void 0:a.map(((e,t)=>{var a;return"tool"===e.role?null:i().createElement("div",{key:t,className:I()(_.message,j.A.markdown)},null===(a=e.parts)||void 0===a?void 0:a.map(((e,t)=>i().createElement(i().Fragment,{key:t},"text"===e.type&&i().createElement(C.w,{className:I()(_["message-part"],j.A["markdown-wrapper"]),content:e.text})))))}))),i().createElement("div",{className:_.content},v&&i().createElement("div",{className:I()(_.markdown,j.A.markdown)},i().createElement(C.w,{className:j.A["markdown-wrapper"],content:v})),k.map(((e,t)=>i().createElement("div",{key:t,className:_.box},i().createElement(V.H,e)))),s.generatedView?i().createElement(L,{job:s}):null,E.length>0&&i().createElement(O.$,{files:E}))))}var G=a(48952);function D(e){let{chunk:t,isSubTask:a}=e;return"job"===t.type?i().createElement(P,{job:t.job,isSubTask:a}):"error"===t.type?i().createElement("div",{className:_.error},t.error):i().createElement(M,{chunk:t,isSubTask:a})}function M(e){let{chunk:t,isSubTask:a}=e;const{conversationState:s,setActiveDetail:r,setSubActiveDetail:l}=(0,n.useContext)(R.j),{setUserClosedAside:o,lastDetail:c}=(0,n.useContext)(q.W),[d,m]=(0,n.useState)(!1),{type:p,task:u}=t,{className:b,icon:f}=(0,n.useMemo)((()=>J("flow"===t.type?"completed":u.state,s)),[t.type,s,u.state]);return i().createElement("div",{className:I()({[_.collapsed]:d})},i().createElement("div",{className:I()(_.heading,b),onClick:()=>m((e=>!e))},i().createElement("div",{className:_.icon},i().createElement(x.Bj,f)),i().createElement("div",{className:_.title},"flow"===p?(0,G.t)(G.K.INITIATING_SERVICE_FLOW,{name:t.flow.name}):(0,G.t)(G.K.STARTING_SERVICE_FLOW_ACTIVITY,{name:t.activity.name})),i().createElement(x.Bj,(0,w.A)({className:_.caret},A.ae))),i().createElement("div",{className:_.body},i().createElement("div",{className:_.tool,onClick:()=>{const e={type:t.type,id:t.task.id};(a?l:r)((t=>(0,S.isEqual)(t,e)?t:e)),(0,S.isEqual)(e,c)&&o(!1)}},i().createElement(x.Bj,{lib:"lucide",icon:"route"}),"flow"===p?(0,G.t)(G.K.INITIATING_SERVICE_FLOW,{name:t.flow.name}):(0,G.t)(G.K.STARTING_SERVICE_FLOW_ACTIVITY,{name:t.activity.name}))))}var B=a(17994),K={};K.styleTagTransform=g(),K.setAttributes=p(),K.insert=d().bind(null,"head"),K.domAPI=o(),K.insertStyleElement=b(),r()(B.A,K);const Q=B.A&&B.A.locals?B.A.locals:void 0;function X(e){let{job:t}=e;return i().createElement("div",{className:Q.hil},i().createElement("div",{className:Q.content},i().createElement(x.Bj,{lib:"antd",icon:"exclamation-circle"}),(0,G.t)(G.K.HIL_TIPS,{name:t.hil.username})),t.requestHumanAction&&i().createElement("div",{className:Q.actions},i().createElement(E.n,{action:t.requestHumanAction,ui:"chat"})))}function Y(e){let{chunks:t,scopeState:a,isLatest:s,isSubTask:r}=e;const[l,o]=(0,n.useMemo)((()=>{const e=t[t.length-1];let n;if(e)switch(e.type){case"flow":case"activity":n=e.task.jobs[e.task.jobs.length-1];break;case"job":n=e.job;break;default:return[!1,void 0]}if(!s||A.Z5.includes(a))return[!1,n];for(const e of t)switch(e.type){case"flow":case"activity":if(e.task.jobs.some((e=>"input-required"===e.state)))return[!1,n];break;case"job":if("input-required"===e.job.state)return[!1,n]}return n&&"working"===n.state&&n.toolCall?[!1,n]:[!0,n]}),[s,t,a]);return i().createElement("div",{className:k.assistant},i().createElement(x.Bj,{lib:"easyops",category:"image",icon:"elevo-avatar-png",className:k.avatar}),i().createElement("div",{className:k.body},t.map(((e,t)=>i().createElement(D,{key:t,chunk:e,isSubTask:r}))),l&&i().createElement("div",{className:k.texting}),s&&o&&!A.X4.includes(a)&&("working"===o.state||"input-required"===o.state)&&!o.humanAction&&(o.hil?i().createElement(X,{job:o}):o.requestHumanAction&&i().createElement(E.n,{action:o.requestHumanAction,ui:"chat"}))))}},86e3:(e,t,a)=>{a.d(t,{A:()=>l});var n=a(36758),i=a.n(n),s=a(40935),r=a.n(s)()(i());r.push([e.id,".scroll-down--st4A5sQ4{position:absolute;left:50%;bottom:136px;transform:translateX(-50%);width:32px;height:32px;font-size:12px}",""]),r.locals={"scroll-down":"scroll-down--st4A5sQ4"};const l=r}}]);
2
- //# sourceMappingURL=9273.fbb69eb2.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"chunks/9273.fbb69eb2.js","mappings":"kSAWIA,EAAU,CAAC,EAEfA,EAAQC,kBAAoB,IAC5BD,EAAQE,cAAgB,IACxBF,EAAQG,OAAS,SAAc,KAAM,QACrCH,EAAQI,OAAS,IACjBJ,EAAQK,mBAAqB,IAEhB,IAAI,IAASL,GAKnB,QAAe,KAAW,IAAQM,OAAS,IAAQA,YAASC,C,wECV5D,SAASC,EACdC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAd,GAKA,MAAMe,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C,IAAI,UACJiF,SAAS,QACTlF,KAAK,mBACLlE,UAAWC,EAAOoJ,SAEpBtJ,IAAAA,cAAA,OAAKC,UAAWC,EAAO+G,MACpBzJ,EAAOoB,KAAI,CAACf,EAAOwJ,IAClBrH,IAAAA,cAAC+H,EAAS,CAACR,IAAKF,EAAOxJ,MAAOA,EAAOgH,UAAWA,MAEjDN,GAAWvE,IAAAA,cAAA,OAAKC,UAAWC,EAAOqJ,UAClCT,GACCC,IACCS,EAAAA,GAAoB9J,SAASmJ,KACX,YAAlBE,EAAQjM,OAAyC,mBAAlBiM,EAAQjM,SACvCiM,EAAQzJ,cACRyJ,EAAQT,IACPtI,IAAAA,cAACqI,EAAc,CAACrK,IAAK+K,IAErBA,EAAQP,oBACNxI,IAAAA,cAAC0I,EAAAA,EAAkB,CACjBC,OAAQI,EAAQP,mBAChBlI,GAAG,WAOnB,C,qECpGIV,E,MAA0B,GAA4B,KAE1DA,EAAwBpB,KAAK,CAACqB,EAAOzB,GAAI,mIAAoI,KAE7KwB,EAAwBlD,OAAS,CAChC,cAAe,yBAEhB,S","sources":["webpack:///./src/chat-stream/ScrollDownButton.module.css?e644","webpack:///./src/chat-stream/useConversationStream.ts","webpack:///./src/chat-stream/HumanInTheLoop/HumanInTheLoop.module.css","webpack:///./src/chat-stream/UserMessage/UserMessage.module.css","webpack:///./src/chat-stream/UserMessage/UserMessage.module.css?84b2","webpack:///./src/chat-stream/UserMessage/UserMessage.tsx","webpack:///./src/chat-stream/AssistantMessage/AssistantMessage.module.css","webpack:///./src/chat-stream/useAutoScroll.ts","webpack:///./src/chat-stream/i18n.ts","webpack:///./src/chat-stream/NodeChunk/NodeChunk.module.css","webpack:///./src/chat-stream/StreamContext.ts","webpack:///./src/chat-stream/NodeView/NodeView.module.css","webpack:///./src/chat-stream/AssistantMessage/AssistantMessage.module.css?a84b","webpack:///./src/chat-stream/NodeChunk/NodeChunk.module.css?1c0e","webpack:///./src/chat-stream/NodeView/NodeView.module.css?3001","webpack:///./src/chat-stream/NodeView/NodeView.tsx","webpack:///./src/chat-stream/NodeChunk/getStateDisplay.ts","webpack:///./src/chat-stream/NodeChunk/NodeJob.tsx","webpack:///./src/chat-stream/NodeChunk/NodeChunk.tsx","webpack:///./src/chat-stream/HumanInTheLoop/HumanInTheLoop.module.css?e637","webpack:///./src/chat-stream/HumanInTheLoop/HumanInTheLoop.tsx","webpack:///./src/chat-stream/AssistantMessage/AssistantMessage.tsx","webpack:///./src/chat-stream/ScrollDownButton.module.css"],"sourcesContent":["\n import API from \"!../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js\";\n import insertFn from \"!../../../../node_modules/style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js\";\n import insertStyleElement from \"!../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js\";\n import styleTagTransformFn from \"!../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js\";\n import content, * as namedExport from \"!!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!./ScrollDownButton.module.css\";\n \n \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!./ScrollDownButton.module.css\";\n export default content && content.locals ? content.locals : undefined;\n","import { useMemo } from \"react\";\nimport type { ChatMessage, MessageFromAssistant } from \"./interfaces.js\";\nimport type {\n ActiveDetail,\n ActivityWithFlow,\n ConversationError,\n ConversationState,\n ServiceFlowRun,\n Task,\n TaskState,\n} from \"../shared/interfaces.js\";\nimport { getFlatChunks } from \"../shared/getFlatChunks.js\";\nimport { DONE_STATES } from \"../shared/constants.js\";\n\nexport function useConversationStream(\n conversationAvailable: boolean,\n state: ConversationState | TaskState | undefined,\n tasks: Task[],\n errors: ConversationError[],\n flowMap?: Map<string, ServiceFlowRun>,\n activityMap?: Map<string, ActivityWithFlow>,\n options?: {\n showHumanActions?: boolean;\n skipActivitySubTasks?: boolean;\n }\n) {\n const showHumanActions = options?.showHumanActions;\n const skipActivitySubTasks = options?.skipActivitySubTasks;\n\n return useMemo(() => {\n if (!conversationAvailable) {\n return {\n messages: [],\n lastDetail: null,\n };\n }\n\n const { chunks, jobMap } = getFlatChunks(\n tasks,\n errors,\n flowMap,\n activityMap,\n skipActivitySubTasks\n );\n const messages: ChatMessage[] = [];\n\n let prevAssistantMessage: MessageFromAssistant = {\n role: \"assistant\",\n chunks: [],\n };\n let lastDetail: ActiveDetail | null = null;\n for (const chunk of chunks) {\n if (chunk.type === \"job\") {\n const job = chunk.job;\n if (job.toolCall && !job.ignoreDetails) {\n lastDetail = {\n type: \"job\",\n id: job.id,\n };\n }\n\n if (\n job.state === \"completed\" &&\n job.messages?.length &&\n job.messages.every((msg) => msg.role === \"user\")\n ) {\n if (prevAssistantMessage.chunks.length > 0) {\n messages.push(prevAssistantMessage);\n }\n messages.push({\n role: \"user\",\n content: job.messages\n .flatMap((msg) =>\n msg.parts.map((part) => (part.type === \"text\" ? part.text : \"\"))\n )\n .join(\"\"),\n cmd: job.cmd,\n mentionedAiEmployeeId: job.mentionedAiEmployeeId,\n fromSkippedSubTask: chunk.fromSkippedSubTask,\n files: job.messages\n ?.filter((msg) => msg.role === \"user\")\n .flatMap((msg) => msg.parts)\n .filter((part) => part.type === \"file\")\n .map((part) => part.file),\n });\n prevAssistantMessage = {\n role: \"assistant\",\n chunks: [],\n };\n } else {\n prevAssistantMessage.chunks.push(chunk);\n }\n\n if (job.humanAction) {\n if (prevAssistantMessage.chunks.length > 0) {\n messages.push(prevAssistantMessage);\n }\n if (showHumanActions) {\n messages.push({\n role: \"user\",\n content: job.humanAction,\n });\n }\n prevAssistantMessage = {\n role: \"assistant\",\n chunks: [],\n };\n }\n } else {\n prevAssistantMessage.chunks.push(chunk);\n if (chunk.type !== \"error\") {\n lastDetail = {\n type: chunk.type,\n id: chunk.task.id,\n };\n }\n }\n }\n\n let shouldAppendEmptyMessage =\n messages.length > 0 && !DONE_STATES.includes(state);\n if (\n shouldAppendEmptyMessage &&\n prevAssistantMessage.role === \"assistant\" &&\n prevAssistantMessage.chunks.length === 0\n ) {\n const lastMessage = messages[messages.length - 1];\n if (lastMessage.role === \"user\" && lastMessage.fromSkippedSubTask) {\n shouldAppendEmptyMessage = false;\n }\n }\n\n if (prevAssistantMessage.chunks.length > 0 || shouldAppendEmptyMessage) {\n messages.push(prevAssistantMessage);\n }\n\n return { messages, jobMap, lastDetail };\n }, [\n conversationAvailable,\n state,\n tasks,\n flowMap,\n activityMap,\n errors,\n showHumanActions,\n skipActivitySubTasks,\n ]);\n}\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../../node_modules/css-loader/dist/runtime/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.hil--e3zZFYQc{background:rgba(255,255,255,0.5);border-radius:8px;border:1px solid #ffffff;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);padding:13px 16px;margin-top:12px}.content--tmVj790o,\n.actions--wbNFKF3J{display:flex;align-items:center}.content--tmVj790o{gap:10px;flex-wrap:wrap}.actions--wbNFKF3J{justify-content:flex-end;margin-top:-3px}`, \"\"]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"hil\": `hil--e3zZFYQc`,\n\t\"content\": `content--tmVj790o`,\n\t\"actions\": `actions--wbNFKF3J`\n};\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../../node_modules/css-loader/dist/runtime/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.user--HjXM9OHW{background:rgba(255,255,255,0.6);border-radius:24px;padding:8px 16px;width:-moz-fit-content;width:fit-content;max-width:500px;margin-left:auto;overflow-wrap:break-word;white-space:pre-wrap;font-size:16px;line-height:26px}`, \"\"]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"user\": `user--HjXM9OHW`\n};\nexport default ___CSS_LOADER_EXPORT___;\n","\n import API from \"!../../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js\";\n import insertFn from \"!../../../../../node_modules/style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js\";\n import insertStyleElement from \"!../../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js\";\n import styleTagTransformFn from \"!../../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js\";\n import content, * as namedExport from \"!!../../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!./UserMessage.module.css\";\n \n \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!./UserMessage.module.css\";\n export default content && content.locals ? content.locals : undefined;\n","import React from \"react\";\nimport styles from \"./UserMessage.module.css\";\nimport type { CommandPayload, FileInfo } from \"../../shared/interfaces\";\nimport { ReadableCommand } from \"../../shared/ReadableCommand/ReadableCommand\";\nimport { FileList } from \"../../shared/FilePreview/FileList\";\n\nexport interface UserMessageProps {\n content: string;\n cmd?: CommandPayload;\n mentionedAiEmployeeId?: string;\n files?: FileInfo[];\n}\n\nexport function UserMessage({\n content,\n cmd,\n mentionedAiEmployeeId,\n files,\n}: UserMessageProps) {\n return (\n <>\n <div className={styles.user}>\n {(cmd || mentionedAiEmployeeId) && (\n <ReadableCommand\n cmd={cmd}\n mentionedAiEmployeeId={mentionedAiEmployeeId}\n />\n )}\n {content}\n </div>\n {files?.length ? <FileList files={files} ui=\"chat\" /> : null}\n </>\n );\n}\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../../node_modules/css-loader/dist/runtime/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.assistant--CrlgPgYL{display:flex}.body--sAIo2dhL{flex:1;min-width:0;padding:3px 0 3px 16px}.texting--Rpmsbpca{position:relative}.texting--Rpmsbpca::after{content:\" \";animation:texting--Rpmsbpca 2s infinite;white-space:pre}.avatar--jaJhEiSV{font-size:32px}@keyframes texting--Rpmsbpca{0%{content:\"\\\\00a0\\\\00a0\\\\00a0\"}25%{content:\".\\\\00a0\\\\00a0\"}50%{content:\"..\\\\00a0\"}75%{content:\"...\"}100%{content:\"\\\\00a0\\\\00a0\\\\00a0\"}}`, \"\"]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"assistant\": `assistant--CrlgPgYL`,\n\t\"body\": `body--sAIo2dhL`,\n\t\"texting\": `texting--Rpmsbpca`,\n\t\"avatar\": `avatar--jaJhEiSV`\n};\nexport default ___CSS_LOADER_EXPORT___;\n","import {\n useCallback,\n useEffect,\n useRef,\n useState,\n type RefObject,\n} from \"react\";\nimport ResizeObserver from \"resize-observer-polyfill\";\n\nexport function useAutoScroll(\n contentAvailable: boolean,\n scrollContainerRef: RefObject<HTMLDivElement>,\n scrollContentRef: RefObject<HTMLDivElement>\n) {\n const detectScrolledUpRef = useRef(false);\n const manualScrolledRef = useRef(false);\n const [scrollable, setScrollable] = useState(false);\n\n useEffect(() => {\n const scrollContainer = scrollContainerRef.current;\n const contentContainer = scrollContentRef.current;\n if (manualScrolledRef.current || !scrollContainer || !contentContainer) {\n return;\n }\n\n const handleScroll = () => {\n setScrollable(\n scrollContainer.scrollTop + scrollContainer.clientHeight! + 24 <\n scrollContainer.scrollHeight\n );\n if (!detectScrolledUpRef.current) {\n return;\n }\n manualScrolledRef.current =\n scrollContainer.scrollTop + scrollContainer.clientHeight! + 6 <\n scrollContainer.scrollHeight;\n };\n scrollContainer.addEventListener(\"scroll\", handleScroll);\n\n let timer: ReturnType<typeof setTimeout>;\n const observer = new ResizeObserver(() => {\n if (manualScrolledRef.current) {\n return;\n }\n detectScrolledUpRef.current = false;\n // Scroll to the bottom of the content container\n scrollContainer.scrollTo({\n top: contentContainer.scrollHeight,\n behavior: \"instant\",\n });\n clearTimeout(timer);\n timer = setTimeout(() => {\n detectScrolledUpRef.current = true;\n }, 100);\n });\n observer.observe(contentContainer);\n\n return () => {\n observer.disconnect();\n scrollContainer.removeEventListener(\"scroll\", handleScroll);\n };\n // Auto scroll after the conversation becomes available\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [contentAvailable]);\n\n const scrollToBottom = useCallback(() => {\n const scrollContainer = scrollContainerRef.current;\n scrollContainer?.scrollTo({\n top: scrollContainer?.scrollHeight,\n behavior: \"instant\",\n });\n }, [scrollContainerRef]);\n\n return { scrollable, scrollToBottom };\n}\n","import { i18n } from \"@next-core/i18n\";\n\nexport enum K {\n SWITCH_TO_CANVAS = \"SWITCH_TO_CANVAS\",\n INITIATING_SERVICE_FLOW = \"INITIATING_SERVICE_FLOW\",\n STARTING_SERVICE_FLOW_ACTIVITY = \"STARTING_SERVICE_FLOW_ACTIVITY\",\n HIL_TIPS = \"HIL_TIPS\",\n}\n\nconst en: Locale = {\n SWITCH_TO_CANVAS: \"Switch to canvas\",\n INITIATING_SERVICE_FLOW: \"Initiating service flow: {{ name }}\",\n STARTING_SERVICE_FLOW_ACTIVITY: \"Starting service flow activity: {{ name }}\",\n HIL_TIPS: \"Triggered HIL rule, waiting for {{ name }} to process.\",\n};\n\nconst zh: Locale = {\n SWITCH_TO_CANVAS: \"切换为画布\",\n INITIATING_SERVICE_FLOW: \"发起业务流:{{ name }}\",\n STARTING_SERVICE_FLOW_ACTIVITY: \"开始业务流活动:{{ name }}\",\n HIL_TIPS: \"触发 HIL 规则,等待 {{ name }} 处理。\",\n};\n\nexport const NS = \"bricks/ai-portal/chat-stream\";\n\nexport const locales = { en, zh };\n\nexport const t = i18n.getFixedT(null, NS);\n\ntype Locale = { [k in K]: string } & {\n [k in K as `${k}_plural`]?: string;\n};\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../../node_modules/css-loader/dist/runtime/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.heading--lj5kJ2fg{display:flex;align-items:center;padding:5px 8px;margin:0 -8px 12px;cursor:pointer}.main--P8894aNV{font-size:16px;line-height:26px}.caret--XqX6mjyf{opacity:0;transition:transform 0.2s ease-in-out}.heading--lj5kJ2fg:hover{background:rgba(184,187,205,0.15);border-radius:8px}.heading--lj5kJ2fg:hover .caret--XqX6mjyf{opacity:1}.icon--l8SzaFlV{display:flex;align-items:center;margin-right:12px}.title--FZPCnJbE{color:#262626;font-weight:500;flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tool--ugqSpeIM{background:#e2e5ef;border:1px solid #d4d4de;border-radius:13px;line-height:24px;padding:0 12px;width:-moz-fit-content;width:fit-content;font-size:12px;color:rgba(0,0,0,0.65);cursor:pointer;display:flex;align-items:center;gap:7px;margin-bottom:12px}.tool--ugqSpeIM eo-icon{font-size:14px;color:#8c8c8c}.body--p3Zt_jA4{margin-bottom:20px}.heading--lj5kJ2fg + .body--p3Zt_jA4{padding-left:26px}.collapsed--cGSG2zk_ .body--p3Zt_jA4{display:none}.collapsed--cGSG2zk_ .caret--XqX6mjyf{transform:rotate(180deg);opacity:1}.content--pBkkWQ5e{margin-top:14px;font-size:16px;line-height:26px}.content--pBkkWQ5e .markdown--Ky2J85cs [class*=\"code-wrapper--\"]::part(mermaid){background:rgba(255,255,255,0.6);border-radius:8px;border:1px solid rgba(0,0,0,0.1);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);padding:20px;min-width:var(--cruise-canvas-node-width-medium);width:auto;max-width:100%}.content--pBkkWQ5e:empty{display:none}.message--okEUzWzg:first-child > .message-part--kxjYnHz0:first-child > :first-child{margin-top:0}.icon--l8SzaFlV{color:#abaab7}.completed--JWq7E1Jw .icon--l8SzaFlV{color:#0fbe59}.failed--uk7jDD7K .icon--l8SzaFlV{color:#f24c25}.working--dZiN0y04 .icon--l8SzaFlV{color:var(--elevo-color-brand)}.input-required--JSuPr8br .icon--l8SzaFlV{color:#12aacc}.canceled--LyMjPJQd .icon--l8SzaFlV{color:#fcaa07}ai-portal\\\\.chat-stream[hide-mermaid] .content--pBkkWQ5e .markdown--Ky2J85cs .mermaid{display:none}.error--n_Of3DwP{color:var(--color-error);white-space:pre-wrap;word-break:break-word}`, \"\"]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"heading\": `heading--lj5kJ2fg`,\n\t\"main\": `main--P8894aNV`,\n\t\"caret\": `caret--XqX6mjyf`,\n\t\"icon\": `icon--l8SzaFlV`,\n\t\"title\": `title--FZPCnJbE`,\n\t\"tool\": `tool--ugqSpeIM`,\n\t\"body\": `body--p3Zt_jA4`,\n\t\"collapsed\": `collapsed--cGSG2zk_`,\n\t\"content\": `content--pBkkWQ5e`,\n\t\"markdown\": `markdown--Ky2J85cs`,\n\t\"message\": `message--okEUzWzg`,\n\t\"message-part\": `message-part--kxjYnHz0`,\n\t\"completed\": `completed--JWq7E1Jw`,\n\t\"failed\": `failed--uk7jDD7K`,\n\t\"working\": `working--dZiN0y04`,\n\t\"input-required\": `input-required--JSuPr8br`,\n\t\"canceled\": `canceled--LyMjPJQd`,\n\t\"error\": `error--n_Of3DwP`\n};\nexport default ___CSS_LOADER_EXPORT___;\n","import { createContext, type Dispatch } from \"react\";\nimport type { ActiveDetail } from \"../shared/interfaces\";\n\nexport interface StreamContextValue {\n lastDetail: ActiveDetail | null;\n setUserClosedAside: Dispatch<React.SetStateAction<boolean>>;\n}\n\nexport const StreamContext = createContext<StreamContextValue>({\n lastDetail: null,\n setUserClosedAside: () => {},\n});\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../../node_modules/css-loader/dist/runtime/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.view--O8CNDdS_{background:rgba(255,255,255,0.6);border-radius:8px;border:1px solid rgba(0,0,0,0.1);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);padding:12px 20px;width:var(--cruise-canvas-node-width-medium);max-width:100%;margin-top:14px}.large--jT3IWlRf{width:var(--cruise-canvas-node-width-large)}`, \"\"]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"view\": `view--O8CNDdS_`,\n\t\"large\": `large--jT3IWlRf`\n};\nexport default ___CSS_LOADER_EXPORT___;\n","\n import API from \"!../../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js\";\n import insertFn from \"!../../../../../node_modules/style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js\";\n import insertStyleElement from \"!../../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js\";\n import styleTagTransformFn from \"!../../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js\";\n import content, * as namedExport from \"!!../../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!./AssistantMessage.module.css\";\n \n \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!./AssistantMessage.module.css\";\n export default content && content.locals ? content.locals : undefined;\n","\n import API from \"!../../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js\";\n import insertFn from \"!../../../../../node_modules/style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js\";\n import insertStyleElement from \"!../../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js\";\n import styleTagTransformFn from \"!../../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js\";\n import content, * as namedExport from \"!!../../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!./NodeChunk.module.css\";\n \n \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!./NodeChunk.module.css\";\n export default content && content.locals ? content.locals : undefined;\n","\n import API from \"!../../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js\";\n import insertFn from \"!../../../../../node_modules/style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js\";\n import insertStyleElement from \"!../../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js\";\n import styleTagTransformFn from \"!../../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js\";\n import content, * as namedExport from \"!!../../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!./NodeView.module.css\";\n \n \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!./NodeView.module.css\";\n export default content && content.locals ? content.locals : undefined;\n","// istanbul ignore file: experimental\nimport React, { useCallback, useState } from \"react\";\nimport classNames from \"classnames\";\nimport { CreatedView } from \"../../shared/CreatedView/CreatedView\";\nimport type { Job } from \"../../shared/interfaces\";\nimport styles from \"./NodeView.module.css\";\n\nexport interface NodeViewProps {\n job: Job;\n}\n\nexport function NodeView({ job }: NodeViewProps): JSX.Element {\n const [size, setSize] = useState<\"medium\" | \"large\">(\"medium\");\n\n const handleSizeChange = useCallback((value: \"medium\" | \"large\") => {\n setSize(value);\n }, []);\n\n return (\n <div\n className={classNames(styles.view, {\n [styles.large]: size === \"large\",\n })}\n >\n <CreatedView job={job} onSizeChange={handleSizeChange} />\n </div>\n );\n}\n","import type { GeneralIconProps } from \"@next-bricks/icons/general-icon\";\nimport type {\n ConversationState,\n JobState,\n TaskState,\n} from \"../../shared/interfaces\";\nimport styles from \"./NodeChunk.module.css\";\n\nexport function getStateDisplay(\n state: JobState | TaskState | undefined,\n conversationState: ConversationState | undefined\n): {\n className?: string;\n icon: GeneralIconProps;\n} {\n switch (state) {\n case \"completed\":\n return {\n className: styles.completed,\n icon: {\n lib: \"antd\",\n theme: \"filled\",\n icon: \"check-circle\",\n },\n };\n case \"submitted\":\n case \"working\":\n if (conversationState === \"terminated\") {\n return {\n icon: {\n lib: \"fa\",\n prefix: \"far\",\n icon: \"circle-stop\",\n },\n };\n }\n return {\n className: styles.working,\n icon: {\n lib: \"antd\",\n theme: \"outlined\",\n icon: \"loading-3-quarters\",\n spinning: true,\n },\n };\n case \"input-required\":\n return {\n className: styles[\"input-required\"],\n icon: {\n lib: \"fa\",\n prefix: \"far\",\n icon: \"circle-user\",\n },\n };\n case \"failed\":\n return {\n className: styles.failed,\n icon: {\n lib: \"fa\",\n prefix: \"fas\",\n icon: \"xmark\",\n },\n };\n case \"canceled\":\n case \"terminated\" as JobState:\n return {\n className: styles.canceled,\n icon: {\n lib: \"fa\",\n prefix: \"far\",\n icon: \"circle-stop\",\n },\n };\n case \"skipped\":\n return {\n icon: {\n lib: \"fa\",\n prefix: \"fas\",\n icon: \"ban\",\n },\n };\n default:\n return {\n icon: {\n lib: \"fa\",\n prefix: \"far\",\n icon: \"clock\",\n },\n };\n }\n}\n","import React, { useContext, useMemo, useState } from \"react\";\nimport classNames from \"classnames\";\nimport { isEqual } from \"lodash\";\nimport type { CmdbInstanceDetailData } from \"../../cruise-canvas/interfaces.js\";\nimport styles from \"./NodeChunk.module.css\";\nimport sharedStyles from \"../../cruise-canvas/shared.module.css\";\nimport { WrappedIcon } from \"../../shared/bricks.js\";\nimport { EnhancedMarkdown } from \"../../cruise-canvas/EnhancedMarkdown/EnhancedMarkdown.js\";\nimport { CmdbInstanceDetail } from \"../../cruise-canvas/CmdbInstanceDetail/CmdbInstanceDetail.js\";\nimport { NodeView } from \"../NodeView/NodeView.js\";\nimport { TaskContext } from \"../../shared/TaskContext.js\";\nimport { StreamContext } from \"../StreamContext.js\";\nimport type { ActiveDetail, FileInfo, Job } from \"../../shared/interfaces.js\";\nimport { getStateDisplay } from \"./getStateDisplay.js\";\nimport { ICON_UP } from \"../../shared/constants.js\";\nimport { FileList } from \"../../shared/FilePreview/FileList.js\";\n\nexport interface NodeJobProps {\n job: Job;\n isSubTask?: boolean;\n}\n\nexport function NodeJob({ job, isSubTask }: NodeJobProps) {\n const toolCall = job.toolCall;\n const toolTitle = toolCall?.annotations?.title || toolCall?.name;\n const toolName = toolCall?.name;\n const showToolCall = !!toolCall;\n const { conversationState, setActiveDetail, setSubActiveDetail } =\n useContext(TaskContext);\n const { lastDetail, setUserClosedAside } = useContext(StreamContext);\n\n const { className, icon } = useMemo(() => {\n return getStateDisplay(job.state, conversationState);\n }, [job.state, conversationState]);\n\n const [toolMarkdownContent, cmdbInstanceDetails, files] = useMemo(() => {\n const contents: string[] = [];\n const instanceDetails: CmdbInstanceDetailData[] = [];\n const files: FileInfo[] = [];\n let large = toolName === \"llm_answer\";\n job.messages?.forEach((message) => {\n if (message.role === \"tool\") {\n for (const part of message.parts) {\n if (part.type === \"data\") {\n switch (part.data?.type) {\n case \"markdown\":\n contents.push(part.data.content);\n break;\n case \"cmdb_instance_detail\":\n instanceDetails.push(part.data as CmdbInstanceDetailData);\n if (!large) {\n large =\n Object.keys(\n part.data?.outputSchema?.type === \"object\"\n ? part.data.outputSchema.properties\n : part.data.detail\n ).length > 6;\n }\n break;\n }\n } else if (part.type === \"file\") {\n files.push(part.file);\n }\n }\n }\n });\n\n const markdownContent = contents.join(\"\");\n\n return [markdownContent, instanceDetails, files] as const;\n }, [job.messages, toolName]);\n\n const [collapsed, setCollapsed] = useState(false);\n const showHeading = showToolCall || !!job.instruction;\n\n return (\n <div className={classNames({ [styles.collapsed]: collapsed })}>\n {showHeading && (\n <div\n className={classNames(styles.heading, className)}\n onClick={() => setCollapsed((prev) => !prev)}\n >\n <div className={styles.icon}>\n <WrappedIcon {...icon} />\n </div>\n <div className={styles.title}>{job.instruction || toolTitle}</div>\n <WrappedIcon className={styles.caret} {...ICON_UP} />\n </div>\n )}\n <div className={styles.body}>\n {showToolCall && (\n <div\n className={styles.tool}\n onClick={() => {\n const detail: ActiveDetail = {\n type: \"job\",\n id: job.id,\n };\n (isSubTask ? setSubActiveDetail : setActiveDetail)((prev) =>\n isEqual(prev, detail) ? prev : detail\n );\n if (isEqual(detail, lastDetail)) {\n setUserClosedAside(false);\n }\n }}\n >\n <WrappedIcon lib=\"lucide\" icon=\"square-chevron-right\" />\n {toolTitle}\n </div>\n )}\n <div className={styles.main}>\n {job.messages?.map((message, index) =>\n message.role === \"tool\" ? null : (\n <div\n key={index}\n className={classNames(styles.message, sharedStyles.markdown)}\n >\n {message.parts?.map((part, partIndex) => (\n <React.Fragment key={partIndex}>\n {part.type === \"text\" && (\n <EnhancedMarkdown\n className={classNames(\n styles[\"message-part\"],\n sharedStyles[\"markdown-wrapper\"]\n )}\n content={part.text}\n />\n )}\n </React.Fragment>\n ))}\n </div>\n )\n )}\n </div>\n <div className={styles.content}>\n {toolMarkdownContent && (\n <div className={classNames(styles.markdown, sharedStyles.markdown)}>\n <EnhancedMarkdown\n className={sharedStyles[\"markdown-wrapper\"]}\n content={toolMarkdownContent}\n />\n </div>\n )}\n {cmdbInstanceDetails.map((detail, index) => (\n <div key={index} className={styles.box}>\n <CmdbInstanceDetail {...detail} />\n </div>\n ))}\n {job.generatedView ? <NodeView job={job} /> : null}\n {files.length > 0 && <FileList files={files} />}\n </div>\n </div>\n </div>\n );\n}\n","import React, { useContext, useMemo, useState } from \"react\";\nimport classNames from \"classnames\";\nimport { isEqual } from \"lodash\";\nimport styles from \"./NodeChunk.module.css\";\nimport type {\n MessageChunk,\n MessageChunkOfActivity,\n MessageChunkOfFlow,\n} from \"../interfaces.js\";\nimport { NodeJob } from \"./NodeJob.js\";\nimport { WrappedIcon } from \"../../shared/bricks\";\nimport { getStateDisplay } from \"./getStateDisplay.js\";\nimport { TaskContext } from \"../../shared/TaskContext\";\nimport { ICON_UP } from \"../../shared/constants\";\nimport { StreamContext } from \"../StreamContext\";\nimport { K, t } from \"../i18n\";\n\nexport interface NodeChunkProps {\n chunk: MessageChunk;\n isSubTask?: boolean;\n}\n\nexport function NodeChunk({ chunk, isSubTask }: NodeChunkProps) {\n if (chunk.type === \"job\") {\n return <NodeJob job={chunk.job} isSubTask={isSubTask} />;\n }\n\n if (chunk.type === \"error\") {\n return <div className={styles.error}>{chunk.error}</div>;\n }\n\n return <NodeTask chunk={chunk} isSubTask={isSubTask} />;\n}\n\ninterface NodeTaskProps {\n chunk: MessageChunkOfFlow | MessageChunkOfActivity;\n isSubTask?: boolean;\n}\n\nfunction NodeTask({ chunk, isSubTask }: NodeTaskProps) {\n const { conversationState, setActiveDetail, setSubActiveDetail } =\n useContext(TaskContext);\n const { setUserClosedAside, lastDetail } = useContext(StreamContext);\n const [collapsed, setCollapsed] = useState(false);\n const { type, task } = chunk;\n\n const { className, icon } = useMemo(() => {\n return getStateDisplay(\n chunk.type === \"flow\" ? \"completed\" : task.state,\n conversationState\n );\n }, [chunk.type, conversationState, task.state]);\n\n return (\n <div className={classNames({ [styles.collapsed]: collapsed })}>\n <div\n className={classNames(styles.heading, className)}\n onClick={() => setCollapsed((prev) => !prev)}\n >\n <div className={styles.icon}>\n <WrappedIcon {...icon} />\n </div>\n <div className={styles.title}>\n {type === \"flow\"\n ? t(K.INITIATING_SERVICE_FLOW, { name: chunk.flow.name })\n : t(K.STARTING_SERVICE_FLOW_ACTIVITY, {\n name: chunk.activity.name,\n })}\n </div>\n <WrappedIcon className={styles.caret} {...ICON_UP} />\n </div>\n <div className={styles.body}>\n <div\n className={styles.tool}\n onClick={() => {\n const detail = {\n type: chunk.type,\n id: chunk.task.id,\n };\n (isSubTask ? setSubActiveDetail : setActiveDetail)((prev) =>\n isEqual(prev, detail) ? prev : detail\n );\n if (isEqual(detail, lastDetail)) {\n setUserClosedAside(false);\n }\n }}\n >\n <WrappedIcon lib=\"lucide\" icon=\"route\" />\n {type === \"flow\"\n ? t(K.INITIATING_SERVICE_FLOW, { name: chunk.flow.name })\n : t(K.STARTING_SERVICE_FLOW_ACTIVITY, {\n name: chunk.activity.name,\n })}\n </div>\n </div>\n </div>\n );\n}\n","\n import API from \"!../../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js\";\n import insertFn from \"!../../../../../node_modules/style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js\";\n import insertStyleElement from \"!../../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js\";\n import styleTagTransformFn from \"!../../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js\";\n import content, * as namedExport from \"!!../../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!./HumanInTheLoop.module.css\";\n \n \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!./HumanInTheLoop.module.css\";\n export default content && content.locals ? content.locals : undefined;\n","import React from \"react\";\nimport { WrappedIcon } from \"../../shared/bricks\";\nimport type { Job } from \"../../shared/interfaces\";\nimport styles from \"./HumanInTheLoop.module.css\";\nimport { RequestHumanAction } from \"../../shared/RequestHumanAction/RequestHumanAction\";\nimport { K, t } from \"../i18n\";\n\nexport interface HumanInTheLoopProps {\n job: Job;\n}\n\nexport function HumanInTheLoop({ job }: HumanInTheLoopProps) {\n return (\n <div className={styles.hil}>\n <div className={styles.content}>\n <WrappedIcon lib=\"antd\" icon=\"exclamation-circle\" />\n {t(K.HIL_TIPS, { name: job.hil!.username })}\n </div>\n {job.requestHumanAction && (\n <div className={styles.actions}>\n <RequestHumanAction action={job.requestHumanAction} ui=\"chat\" />\n </div>\n )}\n </div>\n );\n}\n","import React, { useMemo } from \"react\";\nimport styles from \"./AssistantMessage.module.css\";\nimport {\n GENERAL_DONE_STATES,\n NON_WORKING_STATES,\n} from \"../../shared/constants.js\";\nimport type {\n ConversationState,\n Job,\n JobState,\n TaskState,\n} from \"../../shared/interfaces.js\";\nimport { WrappedIcon } from \"../../shared/bricks.js\";\nimport type { MessageChunk } from \"../interfaces\";\nimport { RequestHumanAction } from \"../../shared/RequestHumanAction/RequestHumanAction\";\nimport { NodeChunk } from \"../NodeChunk/NodeChunk\";\nimport { HumanInTheLoop } from \"../HumanInTheLoop/HumanInTheLoop\";\n\nexport interface AssistantMessageProps {\n chunks: MessageChunk[];\n scopeState: ConversationState | TaskState | JobState | undefined;\n isLatest?: boolean;\n isSubTask?: boolean;\n}\n\nexport function AssistantMessage({\n chunks,\n scopeState,\n isLatest,\n isSubTask,\n}: AssistantMessageProps) {\n const [working, lastJob] = useMemo(() => {\n const lastChunk = chunks[chunks.length - 1];\n let lastJob: Job | undefined;\n if (lastChunk) {\n switch (lastChunk.type) {\n case \"flow\":\n case \"activity\":\n lastJob = lastChunk.task.jobs[lastChunk.task.jobs.length - 1];\n break;\n case \"job\":\n lastJob = lastChunk.job;\n break;\n default:\n return [false, undefined];\n }\n }\n\n if (!isLatest || NON_WORKING_STATES.includes(scopeState!)) {\n return [false, lastJob];\n }\n for (const chunk of chunks) {\n switch (chunk.type) {\n case \"flow\":\n case \"activity\":\n if (chunk.task.jobs.some((job) => job.state === \"input-required\")) {\n return [false, lastJob];\n }\n break;\n case \"job\":\n if (chunk.job.state === \"input-required\") {\n return [false, lastJob];\n }\n }\n }\n if (lastJob && lastJob.state === \"working\" && lastJob.toolCall) {\n return [false, lastJob];\n }\n\n return [true, lastJob];\n }, [isLatest, chunks, scopeState]);\n\n return (\n <div className={styles.assistant}>\n <WrappedIcon\n lib=\"easyops\"\n category=\"image\"\n icon=\"elevo-avatar-png\"\n className={styles.avatar}\n />\n <div className={styles.body}>\n {chunks.map((chunk, index) => (\n <NodeChunk key={index} chunk={chunk} isSubTask={isSubTask} />\n ))}\n {working && <div className={styles.texting}></div>}\n {isLatest &&\n lastJob &&\n !GENERAL_DONE_STATES.includes(scopeState) &&\n (lastJob.state === \"working\" || lastJob.state === \"input-required\") &&\n !lastJob.humanAction &&\n (lastJob.hil ? (\n <HumanInTheLoop job={lastJob} />\n ) : (\n lastJob.requestHumanAction && (\n <RequestHumanAction\n action={lastJob.requestHumanAction}\n ui=\"chat\"\n />\n )\n ))}\n </div>\n </div>\n );\n}\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.scroll-down--st4A5sQ4{position:absolute;left:50%;bottom:136px;transform:translateX(-50%);width:32px;height:32px;font-size:12px}`, \"\"]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"scroll-down\": `scroll-down--st4A5sQ4`\n};\nexport default ___CSS_LOADER_EXPORT___;\n"],"names":["options","styleTagTransform","setAttributes","insert","domAPI","insertStyleElement","locals","undefined","useConversationStream","conversationAvailable","state","tasks","errors","flowMap","activityMap","showHumanActions","skipActivitySubTasks","useMemo","messages","lastDetail","chunks","jobMap","getFlatChunks","prevAssistantMessage","role","chunk","type","_job$messages","job","_job$messages2","toolCall","ignoreDetails","id","length","every","msg","push","content","flatMap","parts","map","part","text","join","cmd","mentionedAiEmployeeId","fromSkippedSubTask","files","filter","file","humanAction","task","shouldAppendEmptyMessage","DONE_STATES","includes","lastMessage","___CSS_LOADER_EXPORT___","module","UserMessage","_ref","React","className","styles","user","ReadableCommand","FileList","ui","useAutoScroll","contentAvailable","scrollContainerRef","scrollContentRef","detectScrolledUpRef","useRef","manualScrolledRef","scrollable","setScrollable","useState","useEffect","scrollContainer","current","contentContainer","handleScroll","scrollTop","clientHeight","scrollHeight","timer","addEventListener","observer","ResizeObserver","scrollTo","top","behavior","clearTimeout","setTimeout","observe","disconnect","removeEventListener","scrollToBottom","useCallback","K","NS","locales","en","SWITCH_TO_CANVAS","INITIATING_SERVICE_FLOW","STARTING_SERVICE_FLOW_ACTIVITY","HIL_TIPS","zh","t","i18n","getFixedT","StreamContext","createContext","setUserClosedAside","NodeView","size","setSize","handleSizeChange","value","classNames","view","large","CreatedView","onSizeChange","getStateDisplay","conversationState","completed","icon","lib","theme","prefix","working","spinning","failed","canceled","NodeJob","_toolCall$annotations","isSubTask","toolTitle","annotations","title","name","toolName","showToolCall","setActiveDetail","setSubActiveDetail","useContext","TaskContext","toolMarkdownContent","cmdbInstanceDetails","contents","instanceDetails","forEach","message","_part$data","data","_part$data2","Object","keys","outputSchema","properties","detail","collapsed","setCollapsed","showHeading","instruction","heading","onClick","prev","WrappedIcon","_extends","caret","ICON_UP","body","tool","isEqual","main","index","_message$parts","key","sharedStyles","markdown","partIndex","EnhancedMarkdown","box","CmdbInstanceDetail","generatedView","NodeChunk","error","NodeTask","_ref2","flow","activity","HumanInTheLoop","hil","username","requestHumanAction","actions","RequestHumanAction","action","AssistantMessage","scopeState","isLatest","lastJob","lastChunk","jobs","NON_WORKING_STATES","some","assistant","category","avatar","texting","GENERAL_DONE_STATES"],"sourceRoot":""}
@@ -1,3 +0,0 @@
1
- /*! For license information please see chat-input.4f3de173.js.LICENSE.txt */
2
- "use strict";(globalThis.webpackChunk_next_bricks_ai_portal=globalThis.webpackChunk_next_bricks_ai_portal||[]).push([[7218],{1740:e=>{e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var t=e.insertStyleElement(e);return{update:function(n){!function(e,t,n){var a="";n.supports&&(a+="@supports (".concat(n.supports,") {")),n.media&&(a+="@media ".concat(n.media," {"));var o=void 0!==n.layer;o&&(a+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),a+=n.css,o&&(a+="}"),n.media&&(a+="}"),n.supports&&(a+="}");var i=n.sourceMap;i&&"undefined"!=typeof btoa&&(a+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(i))))," */")),t.styleTagTransform(a,e,t.options)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},5536:(e,t,n)=>{n.d(t,{A:()=>o});var a=n(12559);function o(e,t,n){return n((0,a.A)(e,t))}},11879:(e,t,n)=>{n.d(t,{v:()=>o});var a=n(22919);const o=async(e,t)=>(await a.http.get("api/gateway/logic.llm.aiops_service/api/v1/elevo/ai-employees",{...t,params:e})).data},23396:(e,t,n)=>{n.d(t,{I:()=>l,K:()=>o,NS:()=>s,t:()=>c});var a=n(67177);let o=function(e){return e.TERMINATE_THE_TASK="TERMINATE_THE_TASK",e.COMMAND_TIPS="COMMAND_TIPS",e.SEARCH_COMMANDS_TIPS="SEARCH_COMMANDS_TIPS",e}({});const i={[o.TERMINATE_THE_TASK]:"Terminate the task",[o.COMMAND_TIPS]:"‘@’ AI Employee | ‘/’ Command",[o.SEARCH_COMMANDS_TIPS]:"Showing up to {{count}} items, type keywords to search"},r={[o.TERMINATE_THE_TASK]:"终止任务",[o.COMMAND_TIPS]:"‘@’ 数字人 | ‘/’ 命令",[o.SEARCH_COMMANDS_TIPS]:"最多显示 {{count}} 条数据,输入关键字搜索"},s="bricks/ai-portal/chat-input",l={en:i,zh:r},c=a.i18n.getFixedT(null,s)},24564:(e,t,n)=>{n.d(t,{v:()=>i});var a=n(11879);const o=new Map;function i(e){const t=o.get(e);if(t)return t;const n=async function(e){var t;const n=null===(t=(await(0,a.v)({employeeId:e})).list)||void 0===t?void 0:t[0];return(null==n?void 0:n.employeeId)===e?n:void 0}(e);return o.set(e,n),n}},30855:(e,t,n)=>{e.exports=function(e){var t=n.nc;t&&e.setAttribute("nonce",t)}},45962:(e,t,n)=>{n.r(t),n.d(t,{ChatInput:()=>fe,WrappedActions:()=>pe});var a,o=n(74635),i=n(70918),r=n(26902),s=n(5536),l=n(86121),c=n(70829),p=n(62740),d=n(18769),u=n.n(d),m=n(90870),f=n(30981),h=n(92879),g=(n(34419),n(67177)),b=n(99126),v=n(53373),x=n.n(v),A=n(23396),y=n(84479),w=n(45387),E=n(51020),k=n(45889),T=n(57227),S=n(21020),M=n(25292),C=n(59435);let N,_,I,P,F,D,O,R,W,K,B,H,j,$,z,q,L,U,G,Y,Z,J,V,Q,X,ee,te,ne,ae,oe,ie;(0,g.initializeI18n)(A.NS,A.I);const re={lib:"antd",icon:"loading-3-quarters",spinning:!0},se={lib:"fa",prefix:"far",icon:"circle-stop"},le=(0,f.wrapBrick)("eo-icon"),ce=(0,f.wrapBrick)("ai-portal.icon-button"),pe=(0,f.wrapBrick)("eo-actions",{onActionClick:"action.click",onItemDragEnd:"item.drag.end",onItemDragStart:"item.drag.start"}),{defineElement:de,property:ue,event:me}=(0,m.createDecorators)();let fe;var he=new WeakMap,ge=new WeakMap,be=new WeakMap,ve=new WeakMap,xe=new WeakMap,Ae=new WeakMap,ye=new WeakMap,we=new WeakMap,Ee=new WeakMap,ke=new WeakMap,Te=new WeakSet,Se=new WeakMap,Me=new WeakMap,Ce=new WeakMap,Ne=new WeakMap,_e=new WeakMap;class Ie extends f.ReactNextElement{constructor(){super(...arguments),(0,o.A)(this,Te),(0,i.A)(this,he,_(this)),(0,i.A)(this,ge,(I(this),P(this))),(0,i.A)(this,be,(F(this),D(this))),(0,i.A)(this,ve,(O(this),R(this))),(0,i.A)(this,xe,(W(this),K(this))),(0,i.A)(this,Ae,(B(this),H(this))),(0,i.A)(this,ye,(j(this),$(this))),(0,i.A)(this,we,(z(this),q(this))),(0,i.A)(this,Ee,(L(this),U(this))),(0,i.A)(this,ke,(G(this),Y(this))),(0,i.A)(this,Se,(V(this),e=>{(0,s.A)(Te,this,Z).emit(e)})),(0,i.A)(this,Me,Q(this)),(0,i.A)(this,Ce,(te(this),e=>{(0,s.A)(Te,this,X).emit(e)})),(0,i.A)(this,Ne,ne(this)),(0,i.A)(this,_e,(ie(this),()=>{(0,s.A)(Te,this,ae).emit()}))}get placeholder(){return(0,c.A)(he,this)}set placeholder(e){(0,l.A)(he,this,e)}get autoFocus(){return(0,c.A)(ge,this)}set autoFocus(e){(0,l.A)(ge,this,e)}get submitDisabled(){return(0,c.A)(be,this)}set submitDisabled(e){(0,l.A)(be,this,e)}get supportsTerminate(){return(0,c.A)(ve,this)}set supportsTerminate(e){(0,l.A)(ve,this,e)}get terminating(){return(0,c.A)(xe,this)}set terminating(e){(0,l.A)(xe,this,e)}get uploadOptions(){return(0,c.A)(Ae,this)}set uploadOptions(e){(0,l.A)(Ae,this,e)}get aiEmployees(){return(0,c.A)(ye,this)}set aiEmployees(e){(0,l.A)(ye,this,e)}get commands(){return(0,c.A)(we,this)}set commands(e){(0,l.A)(we,this,e)}get suggestionsPlacement(){return(0,c.A)(Ee,this)}set suggestionsPlacement(e){(0,l.A)(Ee,this,e)}render(){return u().createElement(Pe,{placeholder:this.placeholder,autoFocus:this.autoFocus,submitDisabled:this.submitDisabled,supportsTerminate:this.supportsTerminate,terminating:this.terminating,uploadOptions:this.uploadOptions,aiEmployees:this.aiEmployees,commands:this.commands,suggestionsPlacement:this.suggestionsPlacement,onMessageSubmit:(0,c.A)(Se,this),onChatSubmit:(0,c.A)(Ce,this),onTerminate:(0,c.A)(_e,this),root:this})}}function Pe(e){let{root:t,placeholder:n,autoFocus:a,submitDisabled:o,supportsTerminate:i,terminating:r,uploadOptions:s,aiEmployees:l,commands:c,suggestionsPlacement:p,onMessageSubmit:m,onChatSubmit:f,onTerminate:g}=e;const v=(0,d.useRef)(null),[y,E]=(0,d.useState)(!1),N=null==s?void 0:s.enabled,_=null==s?void 0:s.accept,{files:I,resetFiles:P,appendFiles:F,removeFile:D,hasFiles:O,allFilesDone:R,fileInfos:W,exceeded:K,paste:B}=(0,k.O)(s),H=(0,d.useRef)(null),{textareaRef:j,valueRef:$,value:z,setValue:q,selectionRef:L,mentioned:U,mentionedText:G,mentionPopover:Y,mentionOverlay:Z,mentionActiveKeys:J,handleMention:V,command:Q,commandText:X,commandPrefix:ee,commandPopover:te,commandOverlay:ne,commandActiveKeys:ae,handleSelectCommand:oe,handleChange:ie,handleKeyDown:de}=(0,M.F)({aiEmployees:l,commands:c,root:t,hasFiles:O,placement:p});(0,d.useEffect)((()=>{N||P()}),[N,P]),(0,d.useEffect)((()=>{var e;a&&!o&&(null===(e=j.current)||void 0===e||e.focus())}),[a,o,j]);const ue=!z||!R||!!G&&z.length<=G.length||!!X&&z.length<=X.length,me=(0,d.useCallback)((e=>{if(ue)return;const t=e.slice(X.length||G.length);m(t),f({content:t,files:W,cmd:Q,aiEmployeeId:U}),$.current="",q(""),P()}),[ue,m,f,W,P,$,q,U,G,Q,X]),fe=(0,d.useCallback)((e=>{e.currentTarget.value&&me(e.currentTarget.value)}),[me]),he=(0,d.useCallback)((()=>{me($.current)}),[me,$]);(0,d.useEffect)((()=>{if(O)return void E(!0);const e=null==v?void 0:v.current;if(!e)return;const t=new b.A((t=>{for(const n of t)n.target===e&&(n.contentBoxSize?n.contentBoxSize[0]?n.contentBoxSize[0].blockSize:n.contentBoxSize.blockSize:n.contentRect.height)>52&&E(!0)}));return t.observe(e),()=>{t.disconnect()}}),[O]),(0,d.useEffect)((()=>{z||O||E(!1)}),[z,O]);const ge=(0,d.useCallback)((e=>{var t;for(const t of e.nativeEvent.composedPath())if(t instanceof HTMLTextAreaElement||t instanceof HTMLButtonElement)return;null===(t=j.current)||void 0===t||t.focus()}),[j]),be=(0,d.useCallback)((e=>{var t;F(e),null===(t=j.current)||void 0===t||t.focus()}),[F,j]);return u().createElement(u().Fragment,null,u().createElement("div",{className:"container",onClick:ge},u().createElement("div",{className:x()("box",{wrap:y})},u().createElement("div",{className:"input",ref:v},u().createElement(h.e,{containerRef:v,ref:j,value:z,minRows:1,maxRows:4,borderSize:0,paddingSize:O?86:16,autoResize:!0,placeholder:n,submitWhen:"enter-without-shift",desiredSelectionRef:L,onSubmit:fe,onChange:ie,onKeyDown:de,onPaste:B,style:{paddingTop:O?78:8}}),O&&u().createElement(w.C,{files:I,className:"condensed",onRemove:(e,t)=>{D(e),null==t||t.abort()},onAdd:()=>{var e;null===(e=H.current)||void 0===e||e.requestUpload()}}),null==Z?void 0:Z.map(((e,t)=>u().createElement("div",{key:t,className:"mention-overlay",style:e}))),null==ne?void 0:ne.map(((e,t)=>u().createElement("div",{key:t,className:"mention-overlay",style:e}))),Y&&(0,C.createPortal)(u().createElement(pe,{actions:Y.actions,style:Y.style,activeKeys:J,footerTips:(0,A.t)(A.K.COMMAND_TIPS),onActionClick:e=>V(e.detail)}),document.body),te&&(0,C.createPortal)(u().createElement(pe,{actions:te.actions,style:te.style,activeKeys:ae,footerTips:"/"===ee?(0,A.t)(A.K.COMMAND_TIPS):(0,A.t)(A.K.SEARCH_COMMANDS_TIPS,{count:M.y}),onActionClick:e=>oe(e.detail)}),document.body)),u().createElement("div",{className:"toolbar"},N?u().createElement(u().Fragment,null,u().createElement(T.s,{ref:H,accept:_,disabled:K,onChange:e=>{var t;F(e),null===(t=j.current)||void 0===t||t.focus()}}),u().createElement("div",{className:"btn-divider"})):null,o&&i?u().createElement(u().Fragment,null,r?u().createElement(ce,{icon:re,disabled:!0}):u().createElement(ce,{icon:se,tooltip:(0,A.t)(A.K.TERMINATE_THE_TASK),onClick:g})):u().createElement("button",{className:"btn-send",disabled:o||!z||!R,onClick:he},u().createElement(le,{lib:"fa",icon:"arrow-up"}))))),u().createElement(S.A,{disabled:!N||K||(null==s?void 0:s.dragDisabled),uploadOptions:s,onFilesDropped:be}))}a=Ie,({e:[_,I,P,F,D,O,R,W,K,B,H,j,$,z,q,L,U,G,Y,Z,J,V,Q,X,ee,te,ne,ae,oe,ie],c:[fe,N]}=(0,p.A)(a,[de("ai-portal.chat-input",{styleTexts:[y.A,E.A],shadowOptions:{delegatesFocus:!0}})],[[ue(),1,"placeholder"],[ue({type:Boolean}),1,"autoFocus"],[ue({type:Boolean}),1,"submitDisabled"],[ue({type:Boolean}),1,"supportsTerminate"],[ue({type:Boolean}),1,"terminating"],[ue({attribute:!1}),1,"uploadOptions"],[ue({attribute:!1}),1,"aiEmployees"],[ue({attribute:!1}),1,"commands"],[ue(),1,"suggestionsPlacement"],[me({type:"message.submit"}),1,"messageSubmit",e=>(0,c.A)(ke,e),(e,t)=>(0,l.A)(ke,e,t)],[me({type:"chat.submit"}),1,"chatSubmit",e=>(0,c.A)(Me,e),(e,t)=>(0,l.A)(Me,e,t)],[me({type:"terminate"}),1,"terminate",e=>(0,c.A)(Ne,e),(e,t)=>(0,l.A)(Ne,e,t)]],0,(e=>_e.has((0,r.A)(e))),f.ReactNextElement)),N()},60136:(e,t,n)=>{n.d(t,{v7:()=>d,NL:()=>u,xf:()=>m});var a=n(61919);const o=n.p+"images/62542537.png",i=n.p+"images/94d7a053.png",r=n.p+"images/0e7e6764.png",s=n.p+"images/7944ebaf.png",l=n.p+"images/c7ec12fe.png",c=n.p+"images/3316492a.png",p=new Map([["md","text/markdown"],["pdf","application/pdf"],["doc","application/msword"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["txt","text/plain"],["csv","text/csv"],["xls","application/vnd.ms-excel"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["ppt","application/vnd.ms-powerpoint"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["jpg","image/jpeg"],["jpeg","image/jpeg"],["png","image/png"],["gif","image/gif"],["bmp","image/bmp"],["webp","image/webp"],["svg","image/svg+xml"]]);function d(e){const[t,n]=a.pipes.unitFormat(e,"bytes",1),o=+t;return`${o>100?Math.round(o):o} ${n}`}function u(e,t){const n=e||m(t);if(n.startsWith("image/"))return["Image",c];switch(n){case"text/markdown":case"text/x-markdown":return["Markdown",o];case"application/pdf":return["PDF",i];case"application/msword":case"application/vnd.openxmlformats-officedocument.wordprocessingml.document":return["Word",r];case"application/vnd.ms-excel":case"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":return["Excel",l];case"application/vnd.ms-powerpoint":case"application/vnd.openxmlformats-officedocument.presentationml.presentation":return["PowerPoint",s]}return n.startsWith("text/")?["Text",o]:["File",c]}function m(e){var t;let n="";const a=null==e?void 0:e.match(/\.([^.]+)$/);return a&&(n=a[1].toLowerCase()),null!==(t=p.get(n))&&void 0!==t?t:"unknown"}},72591:e=>{var t=[];function n(e){for(var n=-1,a=0;a<t.length;a++)if(t[a].identifier===e){n=a;break}return n}function a(e,a){for(var i={},r=[],s=0;s<e.length;s++){var l=e[s],c=a.base?l[0]+a.base:l[0],p=i[c]||0,d="".concat(c," ").concat(p);i[c]=p+1;var u=n(d),m={css:l[1],media:l[2],sourceMap:l[3],supports:l[4],layer:l[5]};if(-1!==u)t[u].references++,t[u].updater(m);else{var f=o(m,a);a.byIndex=s,t.splice(s,0,{identifier:d,updater:f,references:1})}r.push(d)}return r}function o(e,t){var n=t.domAPI(t);return n.update(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap&&t.supports===e.supports&&t.layer===e.layer)return;n.update(e=t)}else n.remove()}}e.exports=function(e,o){var i=a(e=e||[],o=o||{});return function(e){e=e||[];for(var r=0;r<i.length;r++){var s=n(i[r]);t[s].references--}for(var l=a(e,o),c=0;c<i.length;c++){var p=n(i[c]);0===t[p].references&&(t[p].updater(),t.splice(p,1))}i=l}}},73656:e=>{e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},74635:(e,t,n)=>{n.d(t,{A:()=>o});var a=n(72016);function o(e,t){(0,a.A)(e,t),t.add(e)}},77388:(e,t,n)=>{n.d(t,{_:()=>E,u:()=>k});var a=n(18769),o=n.n(a),i=n(53373),r=n.n(i),s=n(72591),l=n.n(s),c=n(1740),p=n.n(c),d=n(88128),u=n.n(d),m=n(30855),f=n.n(m),h=n(93051),g=n.n(h),b=n(73656),v=n.n(b),x=n(82674),A={};A.styleTagTransform=v(),A.setAttributes=f(),A.insert=u().bind(null,"head"),A.domAPI=p(),A.insertStyleElement=g(),l()(x.A,A);const y=x.A&&x.A.locals?x.A.locals:void 0;var w=n(24564);function E(e){let{cmd:t,mentionedAiEmployeeId:n}=e;const[i,s]=(0,a.useState)((()=>k(t,n)));return(0,a.useEffect)((()=>{if(s(k(t,n)),!t){let e=!1;return(async()=>{const t=await(0,w.v)(n);!e&&t&&s(`@${t.name}`)})(),()=>{e=!0}}}),[t,n]),o().createElement(o().Fragment,null,o().createElement("span",{className:r()(y.command,{[y.small]:!0})},i)," ")}function k(e,t){if(e)switch(e.type){case"serviceFlowStarting":return`/start serviceflow${[e.serviceFlowStarting.flowName,e.serviceFlowStarting.spaceName].filter(Boolean).slice(0,1).map((e=>`: ${e}`)).join("")}`;case"serviceflow-start":return`/start serviceflow${[e.payload.flowName,e.payload.spaceName].filter(Boolean).slice(0,1).map((e=>`: ${e}`)).join("")}`;case"serviceflow-edit":return`/edit serviceflow${[e.payload.flowName,e.payload.spaceName].filter(Boolean).slice(0,1).map((e=>`: ${e}`)).join("")}`;case"serviceflow-create":return`/create serviceflow${[e.payload.spaceName].filter(Boolean).slice(0,1).map((e=>`: ${e}`)).join("")}`;default:return`/${e.type}`}return`@${t}`}},82674:(e,t,n)=>{n.d(t,{A:()=>s});var a=n(36758),o=n.n(a),i=n(40935),r=n.n(i)()(o());r.push([e.id,".command--PjYZ4uqH{display:inline-block;background:rgba(37,64,255,0.06);border-radius:8px;color:#2540ff;padding:4px 6px;line-height:22px}.small--dUc9qGKv{padding:2px 6px}",""]),r.locals={command:"command--PjYZ4uqH",small:"small--dUc9qGKv"};const s=r},84479:(e,t,n)=>{n.d(t,{A:()=>s});var a=n(36758),o=n.n(a),i=n(40935),r=n.n(i)()(o());r.push([e.id,":host{display:block}:host([hidden]){display:none}*{box-sizing:border-box}button:focus,\ntextarea:focus{outline:none}button{margin:0;padding:0;font:inherit;background:none;border:none}.container{background-color:#fff;border:2px solid #7891ff;border-radius:12px;box-shadow:0px 9px 28px 8px rgba(0,0,0,0.05),0px 6px 16px 0px rgba(0,0,0,0.08),0px 3px 6px -4px rgba(0,0,0,0.12);cursor:text}.container:not(:has(textarea:focus)){background-color:rgba(255,255,255,0.5);border-color:#99c4ff;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}.box{display:flex;flex-wrap:wrap;border-radius:10px;padding:8px}.input{position:relative;min-width:0;flex:1}.wrap .input{flex-basis:100%}.input textarea{display:block;width:100%;padding:8px;font:inherit;font-size:16px;line-height:24px;color:var(--antd-input-color);border:none;background:none;height:24px;color:#262626}.input textarea::placeholder{color:#bfbfbf}.toolbar{padding:6px 0 6px 8px;margin-left:auto;display:flex;align-items:center;gap:12px}.btn-send{width:28px;height:28px;display:flex;align-items:center;justify-content:center;background:var(--elevo-color-brand);border-radius:8px;color:#fff}.btn-send:disabled{background:rgba(0,0,0,0.15)}.btn-send:not(:disabled){cursor:pointer}.btn-send:not(:disabled):hover{background:#5166ff}.btn-send:not(:disabled):active{background:#1e33cc}.btn-divider{width:1px;height:16px;background:rgba(0,0,0,0.1)}.files.condensed{top:2px;left:8px;right:8px}.mention-overlay{position:absolute;border-radius:4px;pointer-events:none;background:rgba(38,45,65,0.1)}",""]);const s=r.toString()},88128:e=>{var t={};e.exports=function(e,n){var a=function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}(e);if(!a)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");a.appendChild(n)}},89575:(e,t,n)=>{function a(){return a=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},a.apply(this,arguments)}n.d(t,{A:()=>a})},93051:e=>{e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}}}]);
3
- //# sourceMappingURL=chat-input.4f3de173.js.map