PageSourceSearch

https://smartguys.ai/_next/static/chunks/7632-2dc9a660069055bf.js

js smartguys.ai collected 2026-10-05 15:08:12 UTC 53,127 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7632],{19275:(e,t,l)=>{l.d(t,{A:()=>s});var n=l(98887),a=l(49711),i=l(30191);function s(e){let{value:t,onChange:l,options:s,disabled:r=!1}=e,[o,d]=(0,a.useState)(!1),c=(0,a.useRef)(null),u=(0,a.useRef)(null),p=(0,a.useRef)(null),[g,m]=(0,a.useState)({top:0,left:0}),x=s.find(e=>e.value===t)||s[0];(0,a.useEffect)(()=>{if(o&&u.current){let e=u.current.getBoundingClientRect();m({top:e.top,left:e.left})}},[o]),(0,a.useEffect)(()=>{let e=e=>{let t=e.target;c.current&&!c.current.contains(t)&&p.current&&!p.current.contains(t)&&d(!1)};return o&&document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[o]);let h=e=>{l(e.value),d(!1)};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{ref:c,className:"relative",children:(0,n.jsxs)("button",{ref:u,onClick:()=>!r&&d(!o),disabled:r,className:(0,i.cn)("flex items-center fz12-w400-goagent-natural-grey-title-85 border border-goagent-natural-grey-background-8 rounded-[8px] px-[16px] py-[8px] gap-[4px]","transition-all duration-200",r?"opacity-50 cursor-not-allowed":"cursor-pointer",o&&"bg-goagent-natural-grey-background-8"),children:[(0,n.jsx)("iconpark-icon",{name:"Chat-Noba-Size",width:"20",height:"20"}),(0,n.jsx)("span",{children:x.label})]})}),o&&(0,n.jsx)("div",{ref:p,className:"fixed border border-goagent-natural-grey-border-20 bg-goagent-natural-grey-background-8 rounded-[16px] overflow-hidden z-[1000] min-w-[160px] p-[10px]",style:{top:"".concat(g.top,"px"),left:"".concat(g.left,"px"),transform:"translateY(calc(-100% - 8px))"},children:s.map(e=>(0,n.jsxs)("button",{onClick:()=>h(e),className:(0,i.cn)("w-full flex items-center gap-[8px] px-[8px] py-[6px] cursor-pointer rounded-[8px]","text-left transition-colors",t===e.value?"bg-goagent-natural-grey-border-20":""),children:[(0,n.jsx)("span",{className:"flex-1 fz14-w500-goagent-natural-grey-title-85",children:e.label}),e.description&&(0,n.jsx)("span",{className:"fz14-w500-goagent-natural-grey-title-85",children:e.description})]},e.value))})]})}},90542:(e,t,l)=>{l.d(t,{A:()=>ef});var n=l(98887),a=l(84943),i=l(62504),s=l(89882),r=l(13291),o=l(78026),d=l(41073),c=l(30191),u=l(49711),p=l(25707),g=l(38833),m=l(76009),x=l(69671),h=l(94916),v=l(12267),f=l(97927),y=l(28135),_=l(20403),j=l(25012),w=l(51469),N=l(35494),S=l(70357),A=l(88316),E=l(6056),b=l(36550),I=l.n(b),R=l(1031),T=l(8080),P=l(52614),C=l(93539),k=l(65962),L=l(30677),M=l(53728),O=l(86833),z=l(33865),B=l(1088),K=l(79080),D=l(43927);let G=e=>{let t=String(e||"").trim();return/<(?:!doctype\s+html|html|head|body|style|script|section|div)\b/i.test(t)},F=e=>G(e.content)?e.content||"":G(e.result)&&e.result||"",U=(e,t)=>{var l,n,a;let i=Number(null!==(n=null!==(l=e.pageIndex)&&void 0!==l?l:e.page_index)&&void 0!==n?n:1),s=Number.isFinite(i)&&i>0?i:1,r=String(s).padStart(3,"0"),o=null!==(a=e.version)&&void 0!==a?a:t,d=void 0===o?void 0:String(o),c=e.path||(d&&/^\d+$/.test(String(d))?"".concat(d,"/pages/page_").concat(r,".html"):"ppt_project/pages/page_".concat(r,".html"));return{name:e.name||"page_".concat(r,".html"),path:c,content:e.content||"",title:e.title,page_index:s,version:d}},H=e=>(Array.isArray(e)?e:e?[e]:[]).filter(e=>!!e&&"object"==typeof e&&!!(String(e.path||"").trim()||String(e.name||"").trim()||String(e.s3_url||"").trim()||String(e.url||"").trim()||Array.isArray(e.list)&&e.list.length>0)),W=(0,c.cn)("w-full rounded-[8px] border px-3 py-2","bg-goagent-natural-grey-background-8 border-goagent-natural-grey-border-20","shadow-[0px_2px_8px_rgba(0,0,0,0.18)]","transition-colors duration-200","hover:border-[#5A5A5A] cursor-pointer","outline-none focus-visible:ring-2 focus-visible:ring-goagent-natural-grey-main-text-65/40");function J(e){var t;if(e.type===h.gW.TASK_PROGRESS)return!1;let l=e.contentItems;if(Array.isArray(l)&&l.length>0)return l.some(Y);let n=null!==(t=e.content)&&void 0!==t?t:e.reactContent;return null!=n&&""!==n&&("string"!=typeof n||n.trim().length>0)}function V(e){var t,l,n;if((null===(t=e.data)||void 0===t?void 0:t.tool_name)!==h.js.MESSAGE_USER||!J(e))return!1;let a=null===(n=e.data)||void 0===n?void 0:null===(l=n.tool_input)||void 0===l?void 0:l.wait_for_reply;return!0===a||"true"===a||1===a||"1"===a}function Q(e,t){return e===h.gW.TOOL_RESULT&&(null==t?void 0:t.tool_name)===h.js.ASK_USER_QUESTION&&"string"==typeof t.tool_call_id&&t.tool_call_id.trim()&&"string"==typeof t.result?{toolCallId:t.tool_call_id,result:t.result}:null}function Y(e){if((null==e?void 0:e.type)==="content")return!!Q(e.actionType,e.data)||"string"==typeof e.content&&e.content.trim().length>0&&" "!==e.content.trim();if((null==e?void 0:e.type)==="action"){var t;return null!=(t=e.action)&&!!t.type&&(0,N.VL)(t.type,t.data)}return!0}function $(e){let t=new Map;
1return e.forEach(e=>{let l=e.contentItems;if(Array.isArray(l)){l.forEach(e=>{let l=Q(e.actionType||e.messageActionType,e.data);l&&t.set(l.toolCallId,l.result)});return}let n=Q(e.type,e.data);n&&t.set(n.toolCallId,n.result)}),t}let X=e=>{var t;let{group:l,question:r,processToolResult:p,setShowProjectFiles:g,sendAskUserQuestionToolReply:m,canSubmitMessageRating:x=!1,optimisticRating:y=null,isSubmittingRating:b=!1,onMessageRatingSubmit:G,isLastAssistantGroup:X=!1,isGenerating:q=!1,hasFollowingUserMessage:Z=!1}=e,{t:ee}=(0,T.o)(),{userInfo:et}=(0,f.As)([f.P4.userInfo]),[el,en]=(0,u.useState)({}),[ea,ei]=(0,u.useState)(!0),es=l[0],{toolActionRunByStartIndex:er,coveredToolActionIndices:eo}=(0,u.useMemo)(()=>{let e=new Map,t=new Set,n=e=>{var t;let l=null===(t=e.data)||void 0===t?void 0:t.tool_name;return!!l&&l!==h.js.ASK_USER_QUESTION&&l!==h.js.MESSAGE_USER&&l!==h.js.INVITE_AGENT&&l!==h.js.REMOVE_AGENT&&l!==h.js.DISPATCH_TASK&&l!==h.js.CONTINUE_TASKS},a=e=>{var t;let l=null===(t=e.data)||void 0===t?void 0:t.tool_name;return!!(l&&(0,N.VL)(l,e.data))},i=0;for(;i<l.length;){if(!n(l[i])){i+=1;continue}let r=-1,o=[],d=[],c=new Map;for(;i<l.length&&n(l[i]);){var s;let e=l[i];if(!a(e)){i+=1;continue}-1===r&&(r=i);let t=null===(s=e.data)||void 0===s?void 0:s.tool_call_id;if("string"==typeof t&&t.trim()){let l=c.get(t);void 0===l?(c.set(t,o.length),o.push(e),d.push(i)):o[l].type!==h.gW.TOOL_RESULT&&e.type===h.gW.TOOL_RESULT&&(o[l]=e,d[l]=i)}else o.push(e),d.push(i);i+=1}r>=0&&o.length>0&&(e.set(r,o),d.slice(1).forEach(e=>t.add(e)))}return{toolActionRunByStartIndex:e,coveredToolActionIndices:t}},[l]),ed=(0,u.useMemo)(()=>{for(let t=l.length-1;t>=0;t--)if(l[t].type===h.gW.TASK_PROGRESS){var e;let n=null===(e=l[t].data)||void 0===e?void 0:e.steps;return Array.isArray(n)?n:null}return null},[l]),ec=!!ed&&ed.length>0,eu=(0,u.useMemo)(()=>l.some(e=>e.type===h.gW.COMPLETE||(0,z.sm)(e)),[l]),ep=(0,u.useMemo)(()=>l.some(e=>{var t;return e.type===h.gW.PAUSED||e.type===h.gW.SYSTEM&&(null===(t=e.data)||void 0===t?void 0:t.message)==="Query cancelled"}),[l]),eg=(0,u.useMemo)(()=>{for(let e=l.length-1;e>=0;e--)if(l[e].content)return e;return -1},[l]),em=(0,u.useMemo)(()=>{for(let e=l.length-1;e>=0;e--){let t=l[e];if((0,z.JF)(t))return t}},[l]),ex=(0,u.useMemo)(()=>ed&&0!==ed.length?eu||ed.every(e=>"completed"===e.status)?"completed":ed.some(e=>"paused"===e.status)?"paused":"in_progress":"pending",[ed,eu]),[eh,ev]=(0,u.useState)({}),ef=e=>ev(t=>({...t,[e]:!t[e]})),{tailRenderOrdered:ey,stepMessageMap:e_,flatNonTailIndices:ej}=(0,u.useMemo)(()=>{let e=-1;for(let t=l.length-1;t>=0;t--)if((0,z.sm)(l[t])){e=t;break}let t=-1;if(e>=0){for(let n=e-1;n>=0;n--)if(J(l[n])){t=n;break}-1===t&&(t=e)}let n=l.findIndex(V);n>=0&&(t=-1===t?n:Math.min(t,n));let a=[];if(t>=0)for(let e=t;e<l.length;e++)l[e].type!==h.gW.TASK_PROGRESS&&a.push(e);let i=new Set(a),s=(0,D.i9)(l),r=e=>(0,D.DB)(s,e),o=new Map,d=[],c=new Set;for(let e=0;e<l.length;e++){var u;if(i.has(e)||l[e].type===h.gW.TASK_PROGRESS)continue;let t=null===(u=l[e].data)||void 0===u?void 0:u.tool_name,n=J(l[e]);if(t&&(l[e].type===h.gW.TOOL_CALL||l[e].type===h.gW.TOOL_RESULT)&&!(0,N.VL)(t,l[e].data)&&!n)continue;let a=l[e],s=a.contentItems;if(Array.isArray(s)&&s.length>0)for(let t=0;t<s.length;t++)Y(s[t])&&(0,D.s0)(o,r((0,D.Y7)(s[t],a)),{messageIndex:e,itemIndex:t});else{if(!function(e){var t;let l=e.contentItems;if(Array.isArray(l))return l.some(Y);let n=null===(t=e.data)||void 0===t?void 0:t.tool_name;return n&&(e.type===h.gW.TOOL_CALL||e.type===h.gW.TOOL_RESULT)?(0,N.VL)(n,e.data)||J(e):J(e)||(0,z.sm)(e)}(a))continue;(0,D.s0)(o,r((0,D.fL)(a)),{messageIndex:e})}c.has(e)||(c.add(e),d.push(e))}return{tailRenderOrdered:a.map(e=>({kind:"full",messageIndex:e})),stepMessageMap:o,flatNonTailIndices:d}},[l]),{messages:ew,setIsPreviewExpanded:eN,setFinalResult:eS,isPPTGenerator:eA,selectedEmployee:eE,setPptVersion:eb,setPptHeaderName:eI,setPptMap:eR,pptMap:eT,sessionId:eP,pptHeaderName:eC,pptVersion:ek,pptVersions:eL,taskStatus:eM,setTaskTime:eO,setIsReplayAutoPlay:ez,getCurrentPreviewData:eB,setImages:eK,setImageAction:eD,setPreviewList:eG,setCurReplayIndex:eF}=(0,v.Y_)([v.pB.messages,v.pB.setIsPreviewExpanded,v.pB.setFinalResult,v.pB.isPPTGenerator,v.pB.selectedEmployee,v.pB.setPptVersion,v.pB.setPptHeaderName,v.pB.setPptMap,v.pB.pptMap,v.pB.sessionId,v.pB.pptHeaderName,v.pB.pptVersion,v.pB.pptVersions,v.pB.taskStatus,v.pB.setTaskTime,v.pB.fileResources,v.pB.setIsReplayAutoPlay,v.pB.getCurrentPreviewData,v.pB.setImages,v.pB.setImageAction,v.pB.setPreviewList,v.pB.setCurReplayIndex]),eU=(0,u.useMemo)(()=>{var e;if(!em||!(0,z.JF)(em))return null;let t=(0,z.Yf)(em),l=(null==y?void 0:y.messageId)===em.id&&null!==(e=null==y?void 0:y.rating)&&void 0!==e?e:null;return null!==(null!=l?l:t)||(0,z.Ki)(em)?{messageId:em.id,ratingEventId:(0,z._$)(em),serverRating:t,optimisticRating:l,interactive:x&&(0,z.Ki)(em)&&null===t}:null},[em,y,x,b]),{getParams:eH}=(0,L.P)(),{role:eW}=eH(),eJ=(0,u.useMemo)(()=>
1{if(!em)return -1;let e=em.id;for(let t=l.length-1;t>=0;t--)if(l[t].id===e&&(0,z.T7)(l[t],eW,null==eE?void 0:eE.code))return t;if(X&&q)return -1;for(let t=l.length-1;t>=0;t--)if(l[t].id===e)return t;return -1},[l,em,eW,null==eE?void 0:eE.code,X,q]),eV="string"==typeof(null==eE?void 0:eE.avatar)&&eE.avatar.trim()||"/gogo-profile/gogo-default.png",eQ=!(null==eE?void 0:eE.avatar)&&(!(null==eE?void 0:eE.code)||eE.code===d.JK.MR_GOGO_ASSISTANT||String(null==eE?void 0:eE.code).toLowerCase().includes("gogo")||String((null==eE?void 0:eE.name)||"").toLowerCase().includes("gogo"));null===(t=eB())||void 0===t||t.agentRole;let eY=(0,u.useCallback)(e=>{eS(e),eG([e]),eF(0)},[eF,eS,eG]),e$=async function(e,t){var l,n,a,i,s,r,o,d,c,u,p,g,m,x,h,f,y,_,w;let N=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];eN(!0);let S=H(e.finalResult)[0]||e.finalResult,A=(null==S?void 0:S.name)||(null===(l=e.finalResult)||void 0===l?void 0:l.name)||eC||"演示文稿";if(!eP||!A){R.o.warning("无法加载 PPT 文件");return}try{let l=(null==S?void 0:S.version)||e.version||(null===(n=e.finalResult)||void 0===n?void 0:n.version),E=v.Lo.getState()[v.pB.finalResult],b=E&&"object"==typeof E&&!Array.isArray(E)?E:null,I=N.map(t=>U({...t,content:F(t)},e.version||l||"")).sort((e,t)=>e.page_index-t.page_index);if((null==b?void 0:b.type)==="show"&&(b.name===A||!S)&&Array.isArray(b.list)&&b.list.length>0&&(!l||String(b.version||"")===String(l))){let e=[...b.list];I.forEach(t=>{let l=e.findIndex(e=>Number(e.page_index)===t.page_index);if(l>=0){var n;e[l]={...e[l],...t,content:t.content||(null===(n=e[l])||void 0===n?void 0:n.content)||""}}else e.push(t)}),e.sort((e,t)=>Number(e.page_index||0)-Number(t.page_index||0)),null!=t&&(b.focusPageIndex!==t||e.length!==b.list.length)&&eY({...b,list:e,path:(null===(a=e[0])||void 0===a?void 0:a.path)||b.path,total_pages:Math.max(Number(b.total_pages||0),e.length),focusPageIndex:t}),l&&eb(l);return}if(!S&&N.length>0){let l=(null===(i=I.find(e=>e.version))||void 0===i?void 0:i.version)||e.version||"";eY({name:A,path:(null===(s=I[0])||void 0===s?void 0:s.path)||"",content:"",size:0,type:"show",list:I,version:l,total_pages:I.length,pageDisplayMode:"index",focusPageIndex:t}),l&&eb(l);return}let T=!!(null==e?void 0:e.version_tag)||!!(null==e?void 0:e.version_dir_name)||(e=>{if(null==e)return!0;if("string"==typeof e){let t=e.trim();return"0"===t||!/^\d+$/.test(t)}return"number"!=typeof e||0===e})(l),P=null==S?void 0:S.isLegacyVersion,C=T||!0===P||"true"===P||1===P||"1"===P;if((null==S?void 0:S.type)==="show"||(null==S?void 0:S.total_pages)&&(null==S?void 0:S.path)){let l;if(C){let l=[];if((null==S?void 0:S.list)&&Array.isArray(S.list)?l=S.list:e.pptList&&Array.isArray(e.pptList)&&(l=e.pptList),0===l.length&&(null==S?void 0:S.total_pages)){let e=S.total_pages;l=Array.from({length:e},(e,t)=>{let l=String(t+1).padStart(3,"0");return{name:"page_".concat(l,".html"),path:"".concat("ppt_project/pages/","page_").concat(l,".html"),content:"",page_index:t+1}})}let n=new Set,a=await Promise.all(l.map(async e=>{var t,l,a,i,s,r;let o=e.content||"";if(!o&&eP){let i=e.path||"";if(!i){let n=void 0!==e.page_index?String(e.page_index).padStart(3,"0"):(null===(a=e.name)||void 0===a?void 0:null===(l=a.match(/page_(\d+)\.html$/))||void 0===l?void 0:null===(t=l[1])||void 0===t?void 0:t.padStart(3,"0"))||"001";i="ppt_project/pages/page_".concat(n,".html")}if(i.startsWith("/")&&(i=i.substring(1)),/^(\d+|base)\//.test(i)&&(i=i.replace(/^(\d+|base)\//,"")),!i.includes("ppt_project/pages/")){let t=i.split("/").pop()||"page_".concat(String(e.page_index||1).padStart(3,"0"),".html");i="ppt_project/pages/".concat(t)}let s="".concat(eP,":").concat(i);if(n.has(s))return{name:e.name||"page_".concat(e.page_index||0,".html"),path:i,content:"",page_index:void 0!==e.page_index?e.page_index:0};try{o=await (0,j.wS)({workspaceId:eP,filePath:i})}catch(e){e instanceof Error&&(e.message.includes("404")||e.message.includes("Failed to load file"))&&n.add(s)}}let d=e.path||"";if(!d){let t=void 0!==e.page_index?String(e.page_index).padStart(3,"0"):(null===(r=e.name)||void 0===r?void 0:null===(s=r.match(/page_(\d+)\.html$/))||void 0===s?void 0:null===(i=s[1])||void 0===i?void 0:i.padStart(3,"0"))||"001";d="ppt_project/pages/page_".concat(t,".html")}if(d.startsWith("/")&&(d=d.substring(1)),/^(\d+|base)\//.test(d)&&(d=d.replace(/^(\d+|base)\//,"")),!d.includes("ppt_project/pages/")){let t=d.split("/").pop()||"page_".concat(String(e.page_index||1).padStart(3,"0"),".html");d="ppt_project/pages/".concat(t)}return{name:e.name||"page_".concat(e.page_index||0,".html"),path:d,content:o,page_index:void 0!==e.page_index?e.page_index:0}}));a.sort((e,t)=>
1e.page_index-t.page_index);let i={name:A,path:(null===(g=a[0])||void 0===g?void 0:g.path)||"ppt_project/pages/page_001.html",content:"",size:(null==S?void 0:S.size)||(null===(m=e.finalResult)||void 0===m?void 0:m.size)||0,type:"show",list:a,version:(null==S?void 0:S.version)||"base",total_pages:a.length,isLegacyVersion:!0,focusPageIndex:t};eY(i),eb((null==S?void 0:S.version)||"base");return}let n=(null==S?void 0:S.version)||e.version||(null===(r=e.finalResult)||void 0===r?void 0:r.version);if(!n&&(null==S?void 0:S.path)){let e=/^(\d+)\//.exec(S.path);e&&(n=e[1])}if(!n){let e=await (0,j._H)({session_id:eP,file_name:A}),t=(null==e?void 0:e.versions)||[];if(0===t.length){R.o.warning("未找到版本信息");return}n=t[0]}let a=await (0,j._H)({session_id:eP,file_name:A}),i=(null==a?void 0:null===(o=a.total_pages)||void 0===o?void 0:o[n])||(null==S?void 0:S.total_pages);if(!i||0===i){R.o.warning("无法获取该版本的页数信息");return}let s=(null==S?void 0:null===(c=S.list)||void 0===c?void 0:null===(d=c[0])||void 0===d?void 0:d.path)||(null==S?void 0:S.path);if(s){/^(\d+)\/\1\//.exec(s)&&(s=s.replace(/^(\d+)\/\1\//,"$1/"));let e=/^(\d+)\/(.+?\/pages\/)page_\d+\.html$/.exec(s);if(e){let t=e[2].replace(/^ppt_project\//,"");/^(\d+)\//.exec(t)&&(t=t.replace(/^\d+\//,"")),l="".concat(e[1],"/").concat(t)}else l="".concat(n,"/pages/")}else l="".concat(n,"/pages/");let x=await Promise.all(Array.from({length:i},async(e,t)=>{let n=String(t+1).padStart(3,"0"),a="".concat(l,"page_").concat(n,".html");try{let e=await (0,j.wS)({workspaceId:eP,filePath:a});return{name:"page_".concat(n,".html"),path:a,content:e,page_index:t+1}}catch(e){return{name:"page_".concat(n,".html"),path:a,content:"",page_index:t+1}}}));x.sort((e,t)=>e.page_index-t.page_index);let h={name:A,path:(null===(u=x[0])||void 0===u?void 0:u.path)||"".concat(l,"page_001.html"),content:"",size:(null==S?void 0:S.size)||(null===(p=e.finalResult)||void 0===p?void 0:p.size)||0,type:"show",list:x,version:n,total_pages:i,focusPageIndex:t};eY(h),eb(n);return}if(eX.filter(t=>{var l;return t.page_index===(null===(l=e.pptList)||void 0===l?void 0:l.length)}),e.version){let l=(Array.isArray(e.pptList)?e.pptList:[]).filter(t=>t.version===e.version),n=function(e,t){for(let l in e)if(e[l][t])return e[l][t]}(eT,e.version),a=null==n?void 0:n.filter(e=>l.some(t=>t.index===e.page_index));if(a&&Array.isArray(a)&&a.length>0)try{let l=await Promise.all(a.map(async e=>{let t=e.content||"";if(!t&&e.path&&eP)try{t=await (0,j.wS)({workspaceId:eP,filePath:e.path,fileName:e.name||"",sessionId:eP})}catch(e){}return{name:e.name||"page_".concat(e.page_index||0,".html"),path:e.path||"",content:t,page_index:void 0!==e.page_index?e.page_index:0}}));l.sort((e,t)=>e.page_index-t.page_index);let n={name:(null===(x=e.finalResult)||void 0===x?void 0:x.name)||"演示文稿",path:(null===(h=l[0])||void 0===h?void 0:h.path)||"",content:"",size:(null===(f=e.finalResult)||void 0===f?void 0:f.size)||0,type:"show",list:l,version:e.version,total_pages:l.length,focusPageIndex:t};eY(n)}catch(n){let l={name:(null===(y=e.finalResult)||void 0===y?void 0:y.name)||"演示文稿",path:(null===(_=a[0])||void 0===_?void 0:_.path)||"",content:"",size:(null===(w=e.finalResult)||void 0===w?void 0:w.size)||0,type:"show",list:a.map(e=>({name:e.name||"page_".concat(e.page_index||0,".html"),path:e.path||"",content:e.content||"",page_index:void 0!==e.page_index?e.page_index:0})),version:e.version,total_pages:a.length,focusPageIndex:t};eY(l)}else eS(a);eb(e.version)}}catch(e){R.o.warning("加载 PPT 文件失败")}},eX=(0,u.useMemo)(()=>ew.filter(e=>e.pptTag),[ew]),eq=(0,u.useMemo)(()=>{let e=new Set;return $(ew).forEach((t,l)=>e.add(l)),e},[ew]),eZ=(0,u.useMemo)(()=>$(ew),[ew]);(0,u.useEffect)(()=>{if(!(null==eX?void 0:eX.length)||!eP)return;let e=new AbortController;(async()=>{try{let t=await Promise.allSettled(eX.map(async t=>{if(!t.file_path)return null;try{let l;if(t.version){let n=t.file_path.split("/").pop()||t.file_path;l=await (0,j.wS)({workspaceId:eP,filePath:t.file_path,sessionId:eP,fileName:n,signal:e.signal})}else l=await (0,j.wS)({workspaceId:eP,filePath:t.file_path,signal:e.signal});return{id:t.id,pptTag:!0,content:l,title:t.title,page_index:t.page_index,version:t.version}}catch(e){return e instanceof DOMException&&e.name,null}}));if(e.signal.aborted)return;let l=t.filter(e=>"fulfilled"===e.status&&null!==e.value).map(e=>e.value);eR(function(e,t){let l={};for(let n of e){let e=n.title||ee(P.g.未命名PPT),a=t?t(n):1,i="".concat(a);l[e]||(l[e]={}),l[e][i]||(l[e][i]=[]);let s=l[e][i],r=s.findIndex(e=>e.page_index===n.page_index);r>=0?s[r]=n:s.push(n)}for(let e in l)for(let t in l[e])l[e][t]=l[e][t].slice().sort((e,t)=>
1e.page_index-t.page_index);return l}(l,e=>e.version||1))}catch(e){if(e instanceof DOMException&&"AbortError"===e.name)return}})()},[eX,eP,eR,eA]),(0,u.useEffect)(()=>{if(eT&&eC&&eL){var e,t;let l=null==eT?void 0:null===(e=eT[eC])||void 0===e?void 0:e[eL[eC]];if(l&&l.length>0&&(eb(eL[eC]),eI(eC),eM===v.D.WAITING_USER||eM===v.D.FINISHED)){let e=v.Lo.getState()[v.pB.finalResult];if((0,K.ST)(e))return;eS({name:eC||"slides.pptx",path:(null===(t=l[0])||void 0===t?void 0:t.path)||"",content:"",size:0,type:"show",list:l.map(e=>U({page_index:e.page_index,version:e.version||eL[eC],path:e.path,content:e.content,title:e.title},eL[eC])),version:eL[eC],total_pages:l.length,pageDisplayMode:"index"}),eb(eL[eC]),eN(!0)}}},[eT,eC,ek,eL,eM]);let e0=e=>{var t;let l=I()(null==r?void 0:r.created_at).valueOf();eO(Math.round((Math.max(l,I()(null===(t=e[e.length-1])||void 0===t?void 0:t.created_at).valueOf())-l)/1e3))};return(0,n.jsxs)(i.P.div,{className:"flex flex-col items-start gap-[8px]",initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.2},children:[(0,n.jsxs)("div",{className:"flex",children:[(0,n.jsx)("div",{className:(0,c.cn)("overflow-hidden relative rounded-full mr-[12px]",eQ?"w-[50px] h-[50px]":"w-[40px] h-[40px]"),children:(0,n.jsx)(s.default,{src:eQ?"/gogo-profile/gogo.gif":eV,alt:"".concat((null==eE?void 0:eE.name)||ee(P.g.AI助手)),fill:!0,className:"object-cover"})}),(0,n.jsx)("div",{className:" items-center flex fz16-w600-goagent-natural-grey-title-85 mr-[8px]",children:null==eE?void 0:eE.title}),(0,n.jsx)("div",{className:"flex items-center fz14-w600-goagent-natural-grey-secondary-45",children:(null==eE?void 0:eE.name)||ee(P.g.AI助手)})]}),(0,n.jsx)("div",{className:"flex flex-col flex-auto w-full",children:(0,n.jsx)(i.P.div,{className:" !py-[12px] w-full min-w-0 max-w-[100%] fz16-w400-coldgrey-800  gap-[8px] flex flex-col",initial:{opacity:0,scale:.95,y:5},animate:{opacity:1,scale:1,y:0},transition:{duration:.3,ease:[.25,.46,.45,.94]},children:(()=>{let e=(e,t,a)=>{var r,c,u,x,f,y,j,I,T,L,B;if(eo.has(e))return null;let D=l[e];if(D.type===h.gW.COMPLETE&&!D.content&&!D.reactContent&&!D.finalResult)return null;let J=D.contentItems||[],V=void 0!==a?J.slice(a):void 0!==t?J.slice(t,t+1):J,$=V.filter(Y),ea=void 0!==t||void 0!==a,ei=H(D.finalResult),es=ei[0]||D.finalResult,ed=(eW===d.JK.PRESENTATION_GENERATOR||"presentation_generator"===eW||(null==eE?void 0:eE.code)===d.JK.PRESENTATION_GENERATOR||(null==eE?void 0:eE.code)==="presentation_generator")&&eW!==d.JK.IMAGE_AI_PPT&&"image_ai_ppt"!==eW&&(null==eE?void 0:eE.code)!==d.JK.IMAGE_AI_PPT&&(null==eE?void 0:eE.code)!=="image_ai_ppt",ec=eW===d.JK.IMAGE_AI_PPT||"image_ai_ppt"===eW||(null==eE?void 0:eE.code)===d.JK.IMAGE_AI_PPT||(null==eE?void 0:eE.code)==="image_ai_ppt"||!0===D.isImagePpt||(null==es?void 0:es.isImagePpt)===!0;ec&&((null==es?void 0:es.type)==="show"||null==es||es.total_pages);let eu=e=>{let t={...e||es};return!0===t.pptTag?U({page_index:t.page_index,version:t.version||D.version,path:t.path,content:t.content,title:t.title,name:t.name},D.version):(ed&&(t.isImagePpt=!1),(0,K.ST)(t)&&!String(t.name||"").trim()&&(t.name="slides.pptx"),t)},ep=e=>{if(!e||"object"!=typeof e)return"";let t=Array.isArray(e.list)?e.list.map((e,t)=>"".concat(t,":").concat((null==e?void 0:e.path)||"",":").concat((null==e?void 0:e.name)||"",":").concat((null==e?void 0:e.page_index)||"")).join("|"):"";return[e.name||"",e.path||"",e.version||"",e.type||"",e.agentRole||"",e.s3_url||"",t].join("::")},em=e=>{eN(!0);let t=eu(e);ep(v.Lo.getState()[v.pB.finalResult])!==ep(t)&&eS(t)},ex=X&&q&&!Z&&!!D.content&&e===eg;return(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"relative group",children:(0,n.jsxs)("div",{children:[$.length>0?$.map((e,l)=>{let i=void 0!==a?a+V.indexOf(e):void 0!==t?t:V.indexOf(e),s="".concat(D.id,"-").concat(i),r=Q(e.actionType,e.data);if("content"===e.type&&r)return(0,n.jsx)("div",{className:"text-left whitespace-pre-wrap fz16-w400-goagent-natural-grey-title-85",children:r.result},"item-".concat(i));if("content"===e.type)return(0,n.jsx)("div",{className:"relative group",children:(0,n.jsx)(C.A,{className:"fz16-w400-coldgrey-800",content:e.content,simulateStream:!!e.simulateStreamOnMount||ex&&l===$.length-1,streamResetKey:s})},"item-".concat(i));if("action"===e.type&&e.action){let t=e.action.type;return(0,N.VL)(t,e.action.data)?(0,n.jsx)("div",{className:"flex flex-wrap gap-[8px] max-w-[536px]",children:(0,n.jsx)(N.Ay,{type:t,value:e.action.data,selectedEmployee:eE,onClick:()=>{eS(null),p({data:{id:Math.random().toString(),type:e.actionType||D.type,content:e.action.data,version:D.version,created_at:D.created_at},actionType:o.XD.CLICK_ACTION})}})},"item-".concat(i)):null}return null}):D.content&&!ea?(0,n.jsx)(C.A,{className:"fz16-w400-coldgrey-800",content:D.content,simulateStream:ex,streamResetKey:D.id}):null,D.reactContent&&!ea&&(0,n.jsx)("div",{className:"fz16-w400-coldgrey-800",children:D.reactContent}),D.finalResult&&!ea&&(!D.isPPTGenerator||(0,K.ST)(es)||!((null===(r=D.pptList)||void 0===r?void 0:r.length)>
10))&&eW!==d.JK.IMAGE_PIXEL_MASTER&&(0,n.jsx)("div",{className:"w-[350px]",children:(0,n.jsx)("div",{className:"flex flex-col gap-2",children:(ei.length>0?ei:[es]).map((e,t)=>{var l,a;let i=(0,K.ST)(e),r=(null==e?void 0:e.name)||(null==e?void 0:null===(l=e.path)||void 0===l?void 0:l.split("/").pop())||ee(P.g.文件),o=i&&(null==r?void 0:r.split(".")[0])||r,d=ec&&i,c=i?"slides.pptx":r,u=/\.docx?$/i.test(String((null==e?void 0:e.name)||(null==e?void 0:e.path)||"")),p=ed&&u,g=()=>{if(p){if(!eP){R.o.warning(ee(P.g["没有可下载的文件"]));return}let t=(null==e?void 0:e.agentRole)||(null==e?void 0:e.role)||eW||(null==eE?void 0:eE.code);(0,w.PE)({path:(null==e?void 0:e.path)||r,name:r,agentRole:t,role:t},eP,{currentViewingRole:t});return}em(e)};return(0,n.jsx)("div",{role:"button",tabIndex:0,className:W,onClick:g,onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),g())},children:(0,n.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,n.jsx)("div",{className:"flex flex-none justify-center items-center p-1 rounded shrink-0",children:d?(0,n.jsx)(s.default,{src:k.A,alt:"PPT",width:28,height:30,className:"m-0"}):(0,n.jsx)(A.A,{type:"file",name:c,width:28,height:30,className:"m-0"})}),(0,n.jsxs)("div",{className:"flex overflow-hidden flex-col flex-1 min-w-0",children:[(0,n.jsx)(E.A,{title:r,children:(0,n.jsx)("div",{className:"leading-5 truncate fz14-w600-goagent-natural-grey-title-85",children:o})}),(0,n.jsx)("div",{className:"mt-0.5 truncate fz12-w400-goagent-natural-grey-main-text-65",children:i?(0,n.jsxs)(n.Fragment,{children:[ee(P.g.页数)," \xb7"," ",(null==e?void 0:e.total_pages)||(null==e?void 0:null===(a=e.list)||void 0===a?void 0:a.length)||0]}):(null==e?void 0:e.size)?(0,M.v7)(1024*e.size):null})]})]})},"".concat(r,"-").concat((null==e?void 0:e.path)||t))})})}),D.finalResult&&!ea&&eW===d.JK.IMAGE_PIXEL_MASTER&&D.finalResult.s3_url&&(0,n.jsx)(s.default,{src:D.finalResult.s3_url,alt:D.finalResult.name,className:"rounded-[12px] object-cover h-full w-full mt-[20px] cursor-pointer",width:D.finalResult.width,height:D.finalResult.height,onClick:()=>{eN(!0),eS(D.finalResult),eG([D.finalResult]),eK([D.finalResult]),eD(v.Xg.HISTORY)},style:{...(0,M.JM)({height:D.finalResult.height||0,width:D.finalResult.width||0,maxHeight:160,maxWidth:160})}}),D.isPPTGenerator&&!ea&&!(null===(c=D.finalResult)||void 0===c?void 0:c.type)&&(null==eE?void 0:eE.code)==d.JK.PRESENTATION_GENERATOR&&(null===(u=D.pptList)||void 0===u?void 0:u.length)>0&&(0,n.jsx)("div",{className:"max-w-[350px] w-full",children:(0,n.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,n.jsx)("div",{role:"button",tabIndex:0,className:W,onClick:()=>{(null==eE?void 0:eE.code)!==d.JK.PUBLIC_DOC_WRITER&&e$(D)},onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(null==eE?void 0:eE.code)!==d.JK.PUBLIC_DOC_WRITER&&e$(D)},children:(0,n.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,n.jsx)("div",{className:"flex flex-none justify-center items-center p-1 rounded shrink-0",children:(0,n.jsx)(A.A,{type:"file",name:null===(x=D.finalResult)||void 0===x?void 0:x.name,width:28,height:30,className:"m-0"})}),(0,n.jsxs)("div",{className:"flex overflow-hidden flex-col flex-1 min-w-0",children:[(0,n.jsx)(E.A,{title:ee(P.g.PPT文件),children:(0,n.jsx)("div",{className:"leading-5 truncate fz14-w600-goagent-natural-grey-title-85",children:D.pptName||(null===(f=D.finalResult)||void 0===f?void 0:f.name)})}),(0,n.jsxs)("div",{className:"mt-0.5 truncate fz12-w400-goagent-natural-grey-main-text-65",children:[ee(P.g.页数)," \xb7"," ",(null===(y=D.finalResult)||void 0===y?void 0:y.total_pages)||D.version&&Array.isArray(D.pptList)&&D.pptList.filter(e=>e.version===D.version).length||0]})]})]})}),(0,n.jsx)("div",{role:"button",tabIndex:0,className:W,onClick:()=>g(!0),onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&g(!0)},children:(0,n.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,n.jsx)("div",{className:"flex flex-none justify-center items-center p-1 rounded shrink-0",children:(0,n.jsx)(_.HKL,{className:"text-goagent-natural-grey-title-85 size-5"})}),(0,n.jsx)("div",{className:"overflow-hidden flex-1 min-w-0 leading-5 truncate fz14-w600-goagent-natural-grey-title-85",children:ee(P.g.查看所有档案)})]})})]})}),eJ===e&&!ea&&eU&&(0,n.jsx)("div",{className:"relative z-[1] w-full",onClick:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation(),children:(0,n.jsx)(z.Em,{...eU,isSubmittingRating:b,canRateSession:!!eP,onSubmit:async(e,t)=>{await (null==G?void 0:G(e,t))},t:ee})})]})}),(()=>{let t=er.get(e);if(!t)return null;let a=[h.js.INSERT_PAGE,h.js.UPDATE_PAGE],i=t.filter(e=>{var t;let l=null===(t=e.data)||void 0===t?void 0:t.tool_name;return l&&a.includes(l)}),s=t.filter(e=>{var t;let l=null===(t=e.data)||void 0===t?void 0:t.tool_name;return!l||!a.includes(l)}),r=i.map(e=>{var t,l;let n=e.data,a=(null==n?void 0:null===(t=n.tool_input)||void 0===t?void 0:t.page_index)||(()=>{let e=((null==n?void 0:n.result)||"").match(/第\s*(\d+)\s*页/);return e?parseInt(e[1],10):1})(),i=String(a).padStart(3,"0"),s=e.version||"";return{pageIndex:Number(a),version:s,toolCallId:(null==n?void 0:n.tool_call_id)||"",result:(null==n?void 0:n.result)||"",path:(null==n?void 0:n.file_path)||(null==n?void 0:null===(l=n.tool_input)||void 0===l?void 0:l.file_path)||(s&&/^\d+$/.test(String(s))?"".concat(s,"/pages/page_").concat(i,".html"):"ppt_project/pages/page_".concat(i,".html"))}}),d=l.find(e=>{let t=e.finalResult;return(null==t?void 0:t.type)==="show"||(null==t?void 0:t.total_pages)||Array.isArray(null==t?void 0:t.list)&&t.list.length>0})||D,c=e=>{var t;ez(!1),(null==l?void 0:l.length)&&(null===(t=l.filter(e=>e.created_at))||void 0===t?void 0:t.length)&&e0(l),eS(null),p({data:{id:Math.random().toString(),type:e.type,content:e.data,version:e.version,created_at:e.created_at},actionType:o.XD.CLICK_ACTION})};return(0,n.jsxs)(n.Fragment,{children:[s.length>0&&(0,n.jsx)("div",{className:"flex flex-wrap gap-[8px] max-w-[536px]",children:s.map((e,t)=>{var l;let a=null===(l=e.data)||void 0===l?void 0:l.tool_name;return a?(0,n.jsx)(N.Ay,{type:a,value:e.data,selectedEmployee:eE,onClick:()=>c(e)},"".concat(e.id,"-").concat(t)):null})}),r.length>0&&(0,n.jsx)(S.A,{pages:r,onClickPage:(e,t)=>
1{let l=r.map(l=>l.pageIndex===e&&t?{...l,content:F({content:t.content,result:l.result}),path:t.path||l.path}:l);e$(d,e,l)}})]})})(),D.type===h.gW.TOOL_CALL&&(null===(j=D.data)||void 0===j?void 0:j.tool_name)===h.js.ASK_USER_QUESTION&&D.data.tool_call_id&&Array.isArray(null===(I=D.data.tool_input)||void 0===I?void 0:I.questions)&&D.data.tool_input.questions.length>0&&(0,n.jsx)(O.A,{toolCallId:D.data.tool_call_id,questions:D.data.tool_input.questions,submitted:!!el[D.id]||eq.has(D.data.tool_call_id),resultText:eZ.get(D.data.tool_call_id),onSubmit:async e=>{en(e=>({...e,[D.id]:!0})),await m(e)}},D.data.tool_call_id),D.type===h.gW.TOOL_CALL&&(null===(T=D.data)||void 0===T?void 0:T.tool_name)===h.js.ASK_USER_QUESTION&&D.data.tool_call_id&&(()=>{let e=eZ.get(D.data.tool_call_id);return!!e&&e.split("\n").filter(Boolean).some(e=>!e.match(/^Q\d+\s*[::]\s*\(no selection\)\s*$/))})()&&(0,n.jsxs)("div",{className:"flex flex-col items-end w-full mt-[8px]",children:[(0,n.jsxs)("div",{className:"flex items-end flex-row-reverse gap-[12px]",children:[(0,n.jsx)("div",{className:"overflow-hidden flex flex-row-reverse relative w-[40px] h-[40px] rounded-full",children:(null==et?void 0:et.avatar)?(0,n.jsx)(s.default,{src:et.avatar,alt:et.name||"",fill:!0,className:"object-cover"}):(0,n.jsx)("div",{className:"flex justify-center items-center w-full h-full bg-goagent-primary",children:(0,n.jsx)("span",{className:"font-bold text-white",children:null==et?void 0:null===(B=et.name)||void 0===B?void 0:null===(L=B.slice(0,1))||void 0===L?void 0:L.toUpperCase()})})}),(0,n.jsx)("div",{className:"flex items-center fz16-w600-goagent-natural-grey-title-85",children:null==et?void 0:et.name})]}),(0,n.jsx)(i.P.div,{className:"!px-[20px] !py-[16px] shadow-sm bg-[#272727] border-none mt-[12px] max-w-[75%] self-end",style:{borderRadius:"8px",fontFamily:'PingFang SC, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", "Microsoft YaHei", sans-serif',fontSize:"16px",lineHeight:"150%",color:"#DCDCDC"},initial:{opacity:0,scale:.95,y:5},animate:{opacity:1,scale:1,y:0},transition:{duration:.3,ease:[.25,.46,.45,.94]},children:(0,n.jsx)("div",{className:"text-left whitespace-pre-wrap fz16-w400-goagent-natural-grey-title-85",children:eZ.get(D.data.tool_call_id)})})]})]},"".concat(D.id,"-").concat(e,"-").concat(null!=t?t:"all","-").concat(null!=a?a:"full"))},t="paused"===ex||ep||X&&eM===v.D.PAUSED;return(0,n.jsx)(n.Fragment,{children:ec?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"my-[2px]",children:(0,n.jsxs)("button",{type:"button",onClick:()=>ei(e=>!e),className:"flex items-center gap-[12px]  py-[6px] rounded-[100px] transition-colors cursor-pointer w-fit",children:["completed"===ex?(0,n.jsx)("iconpark-icon",{name:"completed",width:"20",height:"20",color:"#49AA19"}):t?(0,n.jsx)("iconpark-icon",{name:"status",width:"20",height:"20",color:"#D98614"}):(0,n.jsx)(_.xNY,{className:"w-[16px] h-[16px] text-goagent-natural-grey-main-text-65 animate-spin"}),(0,n.jsx)("span",{className:"fz14-w400-goagent-natural-grey-secondary-45-leading-20",children:"completed"===ex?ee(P.g["任务已完成"]):t?ee(P.g.暂停):ee(P.g.任务进行中)}),(0,n.jsx)(i.P.span,{animate:{rotate:180*!ea},transition:{duration:.22,ease:[.25,.46,.45,.94]},className:"inline-flex text-goagent-natural-grey-secondary-45",children:(0,n.jsx)(_.eQr,{className:"w-[16px] h-[16px]"})})]})},"stepper-header"),t&&ea&&(0,n.jsx)("div",{className:"self-start mt-2 w-full",children:(0,n.jsx)(B.v,{})}),(0,n.jsx)(a.N,{initial:!1,children:!ea&&(0,n.jsx)(i.P.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{height:{duration:.32,ease:[.25,.46,.45,.94]},opacity:{duration:.22,ease:[.25,.46,.45,.94]}},style:{overflow:"hidden"},className:"flex flex-col",children:ed.map((t,l)=>{var s,r;let o=null!==(s=e_.get(l))&&void 0!==s?s:[],d=l===ed.length-1,c="completed"===ex,u=c||"completed"===t.status,p=!c&&"in_progress"===t.status,g=!c&&"paused"===t.status,m=null===(r=eh[l])||void 0===r||r;return(0,n.jsxs)("div",{className:"relative z-[1] flex gap-[10px] ".concat(d?"":"mb-[12px]"),children:[(0,n.jsxs)("div",{className:"relative w-[20px] shrink-0 self-stretch",children:[(0,n.jsxs)("div",{className:"relative z-[2] mx-auto 
1size-[20px] rounded-full flex items-center justify-center shrink-0 ".concat(u?"text-#7E7E7E":g?"text-[#D98614]":p?"text-goagent-natural-grey-main-text-65":"border border-goagent-natural-grey-banned-30"),children:[u&&(0,n.jsx)("iconpark-icon",{name:"completed",width:"20",height:"20",color:"#7E7E7E"}),p&&(0,n.jsx)(_.xNY,{className:"w-[16px] h-[16px] text-goagent-natural-grey-main-text-65 animate-spin"}),g&&(0,n.jsx)("iconpark-icon",{name:"status",width:"20",height:"20",color:"#D98614"}),!u&&!p&&!g&&(0,n.jsx)("span",{className:"text-[9px] text-goagent-natural-grey-secondary-45",children:l+1})]}),!d&&(0,n.jsx)("div",{"aria-hidden":!0,className:"pointer-events-none absolute left-1/2 top-[20px] z-0 w-[1.5px] -translate-x-1/2 bg-[#7E7E7E]",style:{height:"calc(100% - 8px)"}})]}),(0,n.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,n.jsxs)("button",{type:"button",onClick:()=>o.length>0&&ef(l),className:"flex items-center gap-[4px] w-full text-left min-h-[24px] ".concat(o.length>0?"cursor-pointer":"cursor-default"),children:[(0,n.jsx)("span",{className:"fz14-w600-goagent-natural-grey-title-85 select-none leading-[20px]",children:t.step}),o.length>0&&(0,n.jsx)(i.P.span,{animate:{rotate:180*!m},transition:{duration:.2,ease:[.4,0,.2,1]},className:"inline-flex shrink-0 text-goagent-natural-grey-secondary-45",children:(0,n.jsx)(_.eQr,{className:"w-[14px] h-[14px]"})})]}),(0,n.jsx)(a.N,{initial:!1,children:o.length>0&&!m&&(0,n.jsx)(i.P.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{height:{duration:.26,ease:[.25,.46,.45,.94]},opacity:{duration:.18,ease:[.4,0,.2,1]}},style:{overflow:"hidden"},className:"flex flex-col gap-[8px] mt-[8px]",children:o.map(t=>e(t.messageIndex,t.itemIndex))},"step-body-".concat(l))})]})]},l)})},"stepper-expanded")}),ey.map(t=>"full"===t.kind?e(t.messageIndex):e(t.messageIndex,void 0,t.tailFromItem)),t&&!ea&&(0,n.jsx)("div",{className:"self-start mt-2 w-full",children:(0,n.jsx)(B.v,{})})]}):(0,n.jsxs)(n.Fragment,{children:[ej.map(t=>e(t)),ey.map(t=>"full"===t.kind?e(t.messageIndex):e(t.messageIndex,void 0,t.tailFromItem)),t&&(0,n.jsx)("div",{className:"self-start mt-2 w-full",children:(0,n.jsx)(B.v,{})})]})})})()})})]},"group-".concat(es.id))};var q=l(81585),Z=l(98557),ee=l(79068),et=l(37887),el=l(88199);let en=(0,u.memo)(e=>{let{messages:t,isLoading:l,messagesEndRef:a,messagesContainerRef:s,processToolResult:r,handleKeyDown:o,handleQuestionSubmit:_,isGenerating:j,handleEnhancePrompt:w,handleCancel:N,setShowProjectFiles:S,initSocket:A,sendAskUserQuestionToolReply:E}=e,{isPreviewExpanded:b,sessionId:I,shareData:R,suggestions:C,setChatMessage:k,setMessages:M,taskStatus:O,selectedTeam:B,selectedEmployee:K}=(0,v.Y_)([v.pB.isPreviewExpanded,v.pB.sessionId,v.pB.shareData,v.pB.suggestions,v.pB.setChatMessage,v.pB.setMessages,v.pB.taskStatus,v.pB.selectedTeam,v.pB.selectedEmployee]),{userInfo:D}=(0,f.As)([f.P4.userInfo]),{getParams:G}=(0,L.P)(),{role:F}=G(),{t:U}=(0,T.o)(),[H,W]=(0,u.useState)(!1),[J,V]=(0,u.useState)(null),Q=(0,u.useRef)(new Map),Y=(0,u.useRef)(0),$=(0,u.useRef)(null),[en,ea]=(0,u.useState)(null),[ei,es]=(0,u.useState)(null),er=(0,u.useMemo)(()=>{let e=t[t.length-1];if(!e)return"empty";let l=Array.isArray(e.contentItems)?e.contentItems.map(e=>{var t,l;let n="string"==typeof(null==e?void 0:e.content)?e.content.length:0,a="string"==typeof(null==e?void 0:null===(l=e.action)||void 0===l?void 0:null===(t=l.data)||void 0===t?void 0:t.result)?e.action.data.result.length:0;return"".concat((null==e?void 0:e.type)||"",":").concat(n,":").concat(a)}).join(","):"";return[t.length,e.id,e.type,"string"==typeof e.content?e.content.length:0,l,Array.isArray(e.finalResult)?e.finalResult.length:+!!e.finalResult].join("|")},[t]);(0,u.useEffect)(()=>{if(Date.now()<Y.current)return;let e=a.current;if(!e)return;let l=t=>{e.scrollIntoView({behavior:t,block:"end"})},n=requestAnimationFrame(()=>{l(t.length<=1?"auto":"smooth")}),i=window.setTimeout(()=>l("auto"),120);return()=>{cancelAnimationFrame(n),window.clearTimeout(i)}},[er,l,j,O,a]),(0,u.useEffect)(()=>()=>{$.current&&clearTimeout($.current)},[]);let eo=(0,u.useCallback)((e,t)=>{t?Q.current.set(e,t):Q.current.delete(e)},[]),ed=(0,u.useCallback)(e=>{let t=Q.current.get(e);t&&(Y.current=Date.now()+1200,ea(e),es(e),t.scrollIntoView({behavior:"smooth",block:"center"}),$.current&&clearTimeout($.current),$.current=setTimeout(()=>{es(t=>t===e?null:t)},1300))},[]),ec=(0,u.useCallback)(()=>{let e=null==s?void 0:s.current;if(!e)return;let t=e.getBoundingClientRect(),l=t.top+.38*t.height,n=null,a=Number.POSITIVE_INFINITY;Q.current.forEach((e,t)=>{let i=e.getBoundingClientRect(),s=Math.abs(i.top+i.height/2-l);s<a&&(a=s,n=t)}),n&&ea(n)},[s]);(0,u.useEffect)(()=>{let e=null==s?void 0:s.current;if(!e)return;let t=0,l=()=>{t&&cancelAnimationFrame(t),t=requestAnimationFrame(ec)};return ec(),e.addEventListener("scroll",l,{passive:!0}),()=>{t&&cancelAnimationFrame(t),e.removeEventListener("scroll",l)}},[er,s,ec]);let eu=!!(I&&!H);(0,u.useEffect)(()=>
1{if(!I){V(null);return}if(!J)return;let e=t.find(e=>e.id===J.messageId);e&&null!==(0,z.Yf)(e)&&V(null)},[I,t,J]);let ep=(0,u.useCallback)(async(e,l)=>{if(!e||!I||H)return;let n=(0,z.Eh)(e);if(!n)return;let a=t.find(t=>t.id===e||(0,z.Eh)((0,z._$)(t))===n||(0,z.Eh)(t.id)===n||(0,z.Eh)(t.event_id||"")===n);if(!a||(0,z.Ki)(a)&&null===(0,z.Yf)(a)){V({messageId:(null==a?void 0:a.id)||e,rating:l}),W(!0);try{await (0,et.bE)("/chat/events/rating",{session_id:I,id:a?(0,z.Eh)((0,z._$)(a)):n,rating:l}),M(t=>t.map(t=>{let i=(0,z.Eh)((0,z._$)(t));if(t.id!==(null==a?void 0:a.id)&&t.id!==e&&i!==n&&(0,z.Eh)(t.event_id||"")!==n)return t;let s={...t,rating:l};return t.data&&"object"==typeof t.data&&(s.data={...t.data,rating:l}),s})),V(null),(0,p.P)(l,U)}catch(t){V(t=>((null==t?void 0:t.messageId)===(null==a?void 0:a.id)||(null==t?void 0:t.messageId)===e)&&t.rating===l?null:t)}finally{W(!1)}}},[I,H,t,U,M]),eg=(0,u.useCallback)(e=>{let t=[],l=[],n=e=>{var t;return e.type===h.gW.TOOL_CALL&&(null===(t=e.data)||void 0===t?void 0:t.tool_name)===h.js.ASK_USER_QUESTION};return e.forEach((a,i)=>{let s=i>0?e[i-1]:null;!s||a.role!==s.role||a.isNewGroup||n(a)||n(s)&&!n(a)?(l.length>0&&t.push(l),l=[a]):l.push(a)}),l.length>0&&t.push(l),t},[]),em=(0,u.useMemo)(()=>t.filter(e=>!e.isHiddenFormReplyReceipt),[t]),ex=(0,u.useMemo)(()=>eg(em),[em,eg]),eh=(0,u.useMemo)(()=>{if(R||B||F===d.JK.IMAGE_PIXEL_MASTER||O!==v.D.PROCESSING||!l||0===t.length)return!1;let e=t[t.length-1];if((null==e?void 0:e.role)!=="user")return!1;let n=[...t].map(e=>e.role).lastIndexOf("user");return!t.slice(n+1).some(e=>"assistant"===e.role)},[l,t,F,K,B,R,O]),ev=(0,u.useMemo)(()=>{for(let t=ex.length-1;t>=0;t--){var e;if((null===(e=ex[t][0])||void 0===e?void 0:e.role)==="assistant")return t}return -1},[ex]),ef="max-w-[750px] w-[-webkit-fill-available] px-[24px]";return(0,n.jsxs)("div",{className:"flex flex-col items-center h-full",children:[(0,n.jsx)("div",{className:(0,c.cn)("flex overflow-y-auto  custom-scrollbar flex-1 justify-center w-full",b&&"mb-[20px]"),ref:s,children:(0,n.jsx)("div",{className:(0,c.cn)("flex flex-none pb-[84px]",ef),children:(0,n.jsxs)(i.P.div,{className:"relative pt-0 w-full",initial:{opacity:0}
1,animate:{opacity:1},transition:{delay:.2,duration:.3},children:[!b&&(0,n.jsx)(el.A,{messages:t,activeMessageId:en,onJump:ed}),ex.map((e,t)=>{var l;let a=e[0];return"user"===a.role?(0,n.jsx)(y.A,{group:e,userInfo:D,highlightedMessageId:ei,registerMessageElement:eo},"group-".concat(t,"-").concat(a.id)):(0,n.jsx)(X,{group:e,question:null===(l=ex[t-1])||void 0===l?void 0:l[0],processToolResult:r,setShowProjectFiles:S,isLastAssistantGroup:t===ev,isGenerating:j,sendAskUserQuestionToolReply:E,hasFollowingUserMessage:ex.slice(t+1).some(e=>{var t;return(null===(t=e[0])||void 0===t?void 0:t.role)==="user"}),canSubmitMessageRating:eu,optimisticRating:J,isSubmittingRating:H,onMessageRatingSubmit:ep},"group-".concat(t,"-").concat(a.id))}),eh&&(0,n.jsxs)(i.P.div,{className:"flex gap-[12px] items-start mb-4 w-full",initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{duration:.2},children:[(0,n.jsx)("div",{className:"overflow-hidden relative shrink-0 w-[50px] h-[50px] rounded-full",children:(0,n.jsx)("img",{src:"string"==typeof(null==K?void 0:K.avatar)&&K.avatar.trim()||"/gogo-profile/gogo.gif",alt:(null==K?void 0:K.name)||"assistant avatar",className:"object-cover w-full h-full"})}),(0,n.jsxs)("div",{className:"flex flex-col gap-[8px] pt-[4px] min-w-0",children:[(0,n.jsxs)("div",{className:"flex items-center gap-[8px]",children:[(0,n.jsx)("div",{className:"fz16-w600-goagent-natural-grey-title-85",children:(null==K?void 0:K.name)||"AI"}),(0,n.jsx)(Z.A,{text:U(P.g["Thinking..."]),className:"text-[13px] text-goagent-natural-grey-main-text-65"})]}),(0,n.jsx)("div",{className:"inline-flex items-center gap-[12px] px-[14px] py-[12px] rounded-[16px] rounded-tl-[4px] bg-white/[0.04] text-goagent-natural-grey-main-text-65 shadow-[0px_6px_24px_rgba(0,0,0,0.08)] backdrop-blur-[6px]",children:(0,n.jsx)(Z.A,{text:U(P.g.正在处理中),className:"text-[14px] leading-[20px]"})})]})]}),ev===ex.length-1&&(0,n.jsx)(ee.A,{suggestions:C,onSuggestionClick:e=>{k(e),_(e)}}),(0,n.jsx)("div",{ref:a})]})})}),(0,n.jsx)("div",{className:(0,c.cn)("flex flex-col-reverse flex-none justify-center w-full mt-[24px]",ef),children:(0,n.jsx)("div",{className:(0,c.cn)(R?"relative flex-auto pb-[12px] shrink-0":"pb-[12px]"),children:(0,n.jsx)("div",{className:(0,c.cn)("flex flex-col-reverse flex-auto relative h-full"),children:R?(0,n.jsx)(m.A,{}):F===d.JK.IMAGE_PIXEL_MASTER?(0,n.jsx)(x.A,{className:"w-full",isLoading:l,textareaClassName:"w-full resize-none overflow-hidden",handleKeyDown:o,handleSubmit:_,isGenerating:j,handleEnhancePrompt:w,handleCancel:N,initSocket:A}):(0,n.jsx)(g.A,{className:"w-full",isLoading:l,textareaClassName:"w-full resize-none overflow-hidden",handleKeyDown:o,handleSubmit:_,isGenerating:j,handleEnhancePrompt:w,handleCancel:N,initSocket:A})})})}),(0,n.jsx)(q.A,{})]})});en.displayName="ChatMessageV2";var ea=l(47337),ei=l(888),es=l(97892),er=l(47184),eo=l(3317),ed=l(87179),ec=l(48286),eu=l(94396),ep=l(97941),eg=l(45787),em=l(55153),ex=function(e){return e.SHARE="share",e.NEW="new",e.HISTORY="history",e.PROJECT="project",e}(ex||{});let eh=e=>{let{shareData:t,selectedTeam:l,selectedEmployee:a,handleViewChatHistory:i,getShowTopActionBarItems:r,isPreviewExpanded:o,t:d}=e,c=(0,eg.useRouter)(),u=(0,n.jsxs)("div",{className:"flex items-center gap-[12px]",children:[(0,n.jsx)(eu.A,{}),(0,n.jsx)("div",{className:"rounded-[8px] px-[10px] py-[6px] fz14-w400-white border-goagent-natural-grey-border-20 border cursor-pointer",onClick:()=>{c.push("/login")},children:d(P.g["登录"])}),(0,n.jsx)("div",{className:"rounded-[8px] px-[10px] py-[6px] fz14-w400-natural-grey-background-0 bg-white cursor-pointer",onClick:()=>{c.push("/login?content_type=register")},children:d(P.g["注册"])})]}),p=ep.S.get()?(0,n.jsx)(es.fG,{showItems:r()}):u;if(t){var g,m;return(0,n.jsx)("div",{className:"flex justify-between items-center h-[56px] px-[20px] w-full",children:o?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"w-1/2",children:(0,n.jsx)(ed.A,{className:"!h-[37px]",isGotoHome:!!t})}),(0,n.jsxs)("div",{className:"w-1/2 flex flex-row justify-between items-center pl-[16px]",children:[(0,n.jsx)("div",{className:"fz16-w600-white truncate",children:null==t?void 0:null===(g=t.session_info)||void 0===g?void 0:g.title}),p]})]}):(0,n.jsxs)("div",{className:"flex flex-row justify-between items-center w-full",children:[(0,n.jsx)(ed.A,{className:"!h-[37px]",isGotoHome:!!t}),(0,n.jsx)("div",{className:"fz16-w600-white truncate",children:null==t?void 0:null===(m=t.session_info)||void 0===m?void 0:m.title}),p]})})}return(0,n.jsxs)("div",{className:"flex justify-between items-center h-[56px] px-[20px] w-full",children:[(0,n.jsxs)("div",{className:"flex gap-6 items-center",children:[(0,n.jsx)(ec.T,{}),(0,n.jsxs)("div",{className:"flex gap-4 items-center",children:[(0,n.jsx)("div",{className:"overflow-hidden relative w-[24px] h-[24px]",children:l&&l.team_members&&l.team_members.length>0?(0,n.jsx)("div",{className:"grid grid-cols-2 gap-0.5 w-full h-full",children:l.team_members.slice(0,4).map((e,t)=>(0,n.jsx)("div",{className:"relative w-full h-full",children:(0,n.jsx)(s.default,{src:e.avatar||"/logo.png",alt:e.name,fill:!0,className:"object-cover"})},t))}):(0,n.jsx)(n.Fragment,{children:((null==l?void 0:l.team_avatar)||(null==a?void 0:a.avatar))&&(0,n.jsx)(s.default,{src:(null==l?void 0:l.team_avatar)||(null==a?void 0:a.avatar),alt:d(l?P.g.团队头像:P.g.AI助手头像),fill:!0,sizes:"32px",className:"object-cover"})})}),(0,n.jsx)("div",{className:"flex flex-col min-w-[120px]",children:(0,n.jsx)("div",{className:"flex gap-2 items-center",children:(0,n.jsx)("span",{className:"fz16-w600-white",children:l?l.team_name:a?a.name:"请选择AI助手"})})})]})]}),(0,n.jsx)(es.fG,{handleViewChatHistory:i,showItems:r()})]})},ev=e=>{let{sessionId:t,messages:l,isLoading:s,isGeneratingPrompt:r,isLoadingHistory:o,messagesEndRef:d,messagesContainerRef:c,handleKeyDown:u,handleQuestionSubmit:p,handleEnhancePrompt:g,handleCancel:m,processToolResult:x,setShowProjectFiles:h,initSocket:v,sendAskUserQuestionToolReply:f,t:y}=e;return(0,n.jsxs)("div",{className:"flex relative flex-col flex-1 h-full min-h-0",children:[(0,n.jsx)(en,{messages:l.filter(e=>!e.pptTag),isLoading:s,messagesEndRef:d,messagesContainerRef:c,handleKeyDown:u,handleQuestionSubmit:p,isGenerating:r,handleEnhancePrompt:g,handleCancel:m,processToolResult:x,setShowProjectFiles:h,initSocket:v,sendAskUserQuestionToolReply:f},t),(0,n.jsx)(a.N,{children:o&&(0,n.jsx)(i.P.div,{initial:{opacity:0}
1,animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},className:"absolute inset-0 z-20 flex items-center justify-center bg-goagent-natural-grey-background-4 backdrop-blur-[2px]",children:(0,n.jsxs)("div",{className:"flex flex-col justify-center items-center text-center",children:[(0,n.jsx)(_.Fat,{className:"w-7 h-7 animate-spin text-goagent-natural-grey-main-text-65"}),(0,n.jsx)("div",{className:"mt-2 text-sm font-medium text-goagent-natural-grey-main-text-65",children:y(P.g["我正在帮你切换会话,请稍等一下~"])})]})})})]})};function ef(){let{messages:e,isLoading:t,isGeneratingPrompt:l,showChatHistory:a,filteredSessions:s,isLoadingHistory:u,isLoadingMoreHistory:p,hasMoreSessions:g,sessionPaginationSkip:m,showProjectFiles:x,sessionToDelete:h,handleQuestionSubmit:f,handleKeyDown:y,handleCancelQuery:_,handleEnhancePrompt:j,processToolResult:w,handleViewChatHistory:N,loadMoreChatSessions:S,handleSelectSession:A,handleDeleteHistorySession:E,messagesEndRef:b,messagesContainerRef:I,handleConfirmDelete:R,handleCancelDelete:C,showDeleteConfirm:k,setShowChatHistory:M,setIsLoadingHistory:O,setShowProjectFiles:z,initSocket:B,sendQuery:K,sendAskUserQuestionToolReply:D}=(0,o.wS)(),{t:G}=(0,T.o)(),{getParams:F}=(0,L.P)(),{roleMap:U}=(0,d.zn)([d.oy.roleMap]),{role:H,id:W}=F(),{isPreviewExpanded:J,sessionId:V,selectedEmployee:Q,selectedTeam:Y,previewList:$,finalResult:X,shareData:q}=(0,v.Y_)([v.pB.isPreviewExpanded,v.pB.sessionId,v.pB.selectedEmployee,v.pB.selectedTeam,v.pB.previewList,v.pB.finalResult,v.pB.shareData]),Z=$.length>0||null!=X&&(!Array.isArray(X)||X.length>0),ee=(0,em.Z)(e,W||V),et=H===d.JK.IMAGE_PIXEL_MASTER&&J;return(0,n.jsxs)("div",{className:"flex overflow-hidden flex-col h-full bg-goagent-natural-grey-background-4",children:[(0,n.jsx)("div",{className:"flex flex-shrink-0",children:(0,n.jsx)(eh,{shareData:q,selectedTeam:Y,selectedEmployee:Q,handleViewChatHistory:N,getShowTopActionBarItems:()=>{if(q)return["project"];let e=["new","history","project"];return V&&e.unshift("share"),e},isPreviewExpanded:J,t:G})}),(0,n.jsx)("div",{className:"flex flex-1 min-h-0",children:et?(0,n.jsxs)(r.A,{style:{height:"100%",boxShadow:"0 0 10px rgba(0, 0, 0, 0.1)"},children:[(0,n.jsx)(r.A.Panel,{defaultSize:"50%",min:"30%",max:"70%",children:(0,n.jsx)("div",{className:"flex flex-col h-full",children:(0,n.jsx)(ev,{sessionId:V,messages:ee,isLoading:t,isGeneratingPrompt:l,isLoadingHistory:u,messagesEndRef:b,messagesContainerRef:I,handleKeyDown:y,handleQuestionSubmit:f,handleEnhancePrompt:j,handleCancel:_,processToolResult:w,setShowProjectFiles:z,initSocket:B,sendAskUserQuestionToolReply:D,t:G})})}),(0,n.jsx)(r.A.Panel,{children:(0,n.jsx)("div",{className:"flex overflow-hidden flex-col h-full",id:"splitter-panel-right-content",children:(0,n.jsx)(eo.A,{sendQuery:K})})})]}):(0,n.jsxs)(i.P.div,{initial:{opacity:0,y:30,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-20,scale:.95},transition:{type:"spring",stiffness:300,damping:30,mass:1},className:(0,c.cn)("flex flex-1 min-h-0 write-report",J?"flex-row":""),children:[(0,n.jsx)("div",{className:(0,c.cn)("flex flex-col flex-1 min-h-0",J&&""),children:(0,n.jsx)(ev,{sessionId:V,messages:ee,isLoading:t,isGeneratingPrompt:l,isLoadingHistory:u,messagesEndRef:b,messagesContainerRef:I,handleKeyDown:y,handleQuestionSubmit:f,handleEnhancePrompt:j,handleCancel:_,processToolResult:w,setShowProjectFiles:z,initSocket:B,sendAskUserQuestionToolReply:D,t:G})}),J&&Z&&(0,n.jsx)("div",{className:"flex flex-col flex-1 min-h-0 min-w-0 mb-[12px]",children:(0,n.jsx)(eo.A,{sendQuery:K})})]},"chat-view")}),(0,n.jsx)(er.A,{showChatHistory:a,setShowChatHistory:M,setIsLoadingHistory:O,isLoadingHistory:u,filteredSessions:s,roleMap:U,handleSelectSession:A,handleDeleteHistorySession:E,hasMoreSessions:g,isLoadingMoreSessions:p,onLoadMoreSessions:S,loadMoreCursor:m}),(0,n.jsx)(ea.T,{isOpen:k,title:G(P.g["删除会话"]),content:(0,n.jsxs)("div",{className:"space-y-4",children:[(0,n.jsx)("p",{className:"fz14-w400-goagent-natural-grey-main-text-65 leading-6",children:G(P.g["确定要删除会话 {{title}}吗?"],{title:(null==h?void 0:h.title)||G(P.g["未命名会话"])})}),(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsxs)("p",{className:"fz14-w400-goagent-natural-grey-title-85",children:["• ",G(P.g["会话记录将被删除"])]}),(0,n.jsxs)("p",{className:"fz14-w400-goagent-natural-grey-title-85",children:["• ",G(P.g["工作区文件将被删除且无法恢复"])]})]})]}),onConfirm:R,onCancel:C,confirmText:G(P.g["删除"]),cancelText:G(P.g["取消"])}),x&&(0,n.jsx)(ei.A,{autoOpen:!0,onClose:()=>z(!1)})]})}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.