@axiom-lattice/gateway 4.3.2 → 4.4.0
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.
- package/dist/{a2a-standard-ALXWP7V6.mjs → a2a-standard-P7JDL6ZA.mjs} +63 -35
- package/dist/a2a-standard-P7JDL6ZA.mjs.map +1 -0
- package/dist/{registerExposedPlugins-63EUF4VS.mjs → chunk-3XIIQ6EK.mjs} +62 -18
- package/dist/chunk-3XIIQ6EK.mjs.map +1 -0
- package/dist/chunk-526UYVNQ.mjs +157 -0
- package/dist/chunk-526UYVNQ.mjs.map +1 -0
- package/dist/chunk-73QZQQOT.mjs +43 -0
- package/dist/chunk-73QZQQOT.mjs.map +1 -0
- package/dist/{chunk-GF4GGTWJ.mjs → chunk-HVIKCUOF.mjs} +10 -7
- package/dist/chunk-HVIKCUOF.mjs.map +1 -0
- package/dist/embed/embed-page-AgentDetailSideApp-PSRQVFNR.js +1 -0
- package/dist/embed/{embed-page-AgentGovernanceWorkbench-ZNW72EEJ.js → embed-page-AgentGovernanceWorkbench-UPQHJZD7.js} +1 -1
- package/dist/embed/embed-page-MessageGraph-PDNQ67T4.js +6 -0
- package/dist/embed/{embed-page-TasksSideApp-F4XUHPTG.css → embed-page-MessageGraph-UT2TCPSO.css} +1 -1
- package/dist/embed/{embed-page-ReactChart-XS7D26VP.js → embed-page-ReactChart-25KAFLQ3.js} +1 -1
- package/dist/embed/embed-page-ReactChart-MXGF35OQ.css +1 -0
- package/dist/embed/embed-page-SkillFlow-TKBMB5VV.js +1 -0
- package/dist/embed/{embed-page-TasksSideApp-MQTUCJO4.js → embed-page-TasksSideApp-DLH5LRMS.js} +1 -1
- package/dist/embed/{embed-page-TopologyRuntimeView-2NQ3OOYI.css → embed-page-TasksSideApp-HV6DKQ26.css} +1 -1
- package/dist/embed/{embed-page-TeamWorkspace-7T2HRXLG.js → embed-page-TeamWorkspace-2WJJWF25.js} +1 -1
- package/dist/embed/{embed-page-TeamWorkspace-DXKGNQ3C.css → embed-page-TeamWorkspace-YQFWXDLI.css} +1 -1
- package/dist/embed/{embed-page-MessageGraph-TYOOATYV.css → embed-page-TopologyRuntimeView-CWOXLVFW.css} +1 -1
- package/dist/embed/{embed-page-TopologyRuntimeView-PU2D7VZ7.js → embed-page-TopologyRuntimeView-WDQRHDMO.js} +1 -1
- package/dist/embed/{embed-page-WorkflowAutomationView-ST76M33F.js → embed-page-WorkflowAutomationView-BAMJ2WVB.js} +1 -1
- package/dist/embed/embed-page-WorkflowAutomationView-YQFB3CTV.css +1 -0
- package/dist/embed/{embed-page-chunk-T25T2YE6.js → embed-page-chunk-HMTKPZ5B.js} +7 -5
- package/dist/embed/{embed-page-chunk-ZKJ7Z7P3.js → embed-page-chunk-LOXLXZNP.js} +1 -1
- package/dist/embed/{embed-page-chunk-Z4S4OYA4.js → embed-page-chunk-MQDYZS3S.js} +1 -1
- package/dist/embed/embed-page-chunk-OBM5EUWZ.js +6974 -0
- package/dist/embed/{embed-page-chunk-RLP3BC7G.js → embed-page-chunk-SSC7ANWV.js} +2 -2
- package/dist/embed/embed-page-chunk-TL2AYM76.js +2 -0
- package/dist/embed/{embed-page-chunk-LE6OFJ7R.js → embed-page-chunk-XVUA7UHE.js} +1 -1
- package/dist/embed/embed-page.js +1 -1
- package/dist/index.js +5103 -3988
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1566 -411
- package/dist/index.mjs.map +1 -1
- package/dist/{open-HH7RKGML.mjs → open-AMEMJOFJ.mjs} +99 -14
- package/dist/open-AMEMJOFJ.mjs.map +1 -0
- package/dist/{open-catalog-WYS2AENM.mjs → open-catalog-SZQ435AY.mjs} +34 -3
- package/dist/open-catalog-SZQ435AY.mjs.map +1 -0
- package/dist/{open-exposure-FK4G6O6L.mjs → open-exposure-I44Q4M3T.mjs} +37 -7
- package/dist/open-exposure-I44Q4M3T.mjs.map +1 -0
- package/dist/{open-files-GVRMK5PL.mjs → open-files-EJ6O2SGX.mjs} +4 -4
- package/dist/{open-session-3VN65PRR.mjs → open-session-LBTCU3AE.mjs} +4 -4
- package/dist/{openLattice-GAAGQJST.mjs → openLattice-Q6M5S6CY.mjs} +4 -2
- package/dist/registerExposedPlugins-6GCOE64C.mjs +11 -0
- package/dist/{resources-JFKAPS45.mjs → resources-DXPXAXEZ.mjs} +16 -9
- package/dist/{resources-JFKAPS45.mjs.map → resources-DXPXAXEZ.mjs.map} +1 -1
- package/package.json +11 -8
- package/dist/a2a-standard-ALXWP7V6.mjs.map +0 -1
- package/dist/chunk-GF4GGTWJ.mjs.map +0 -1
- package/dist/chunk-QKPZWWHH.mjs +0 -433
- package/dist/chunk-QKPZWWHH.mjs.map +0 -1
- package/dist/embed/embed-page-AgentDetailSideApp-7PQ2JKG6.js +0 -1
- package/dist/embed/embed-page-MessageGraph-P7DBTZCL.js +0 -6
- package/dist/embed/embed-page-ReactChart-VBM467ER.css +0 -1
- package/dist/embed/embed-page-SkillFlow-HPH37PZH.js +0 -1
- package/dist/embed/embed-page-WorkflowAutomationView-MAYS27YJ.css +0 -1
- package/dist/embed/embed-page-chunk-4ZSGPIBZ.js +0 -1
- package/dist/embed/embed-page-chunk-BRETUPSG.js +0 -4094
- package/dist/embed/embed-page-chunk-I42T7B7V.js +0 -2415
- package/dist/embed/embed-page-chunk-VRV57DFE.js +0 -466
- package/dist/embed/embed-page-chunk-ZXFZANZM.js +0 -1
- package/dist/mcp-configs-WCY5EXCW.mjs +0 -30
- package/dist/open-HH7RKGML.mjs.map +0 -1
- package/dist/open-catalog-WYS2AENM.mjs.map +0 -1
- package/dist/open-exposure-FK4G6O6L.mjs.map +0 -1
- package/dist/registerExposedPlugins-63EUF4VS.mjs.map +0 -1
- /package/dist/{open-files-GVRMK5PL.mjs.map → open-files-EJ6O2SGX.mjs.map} +0 -0
- /package/dist/{open-session-3VN65PRR.mjs.map → open-session-LBTCU3AE.mjs.map} +0 -0
- /package/dist/{mcp-configs-WCY5EXCW.mjs.map → openLattice-Q6M5S6CY.mjs.map} +0 -0
- /package/dist/{openLattice-GAAGQJST.mjs.map → registerExposedPlugins-6GCOE64C.mjs.map} +0 -0
|
@@ -1,2415 +0,0 @@
|
|
|
1
|
-
import{a as Lr}from"./embed-page-chunk-ZXFZANZM.js";import{$ as kr,Aa as Er,B as hr,Da as Nr,Ea as Mr,Ja as Br,K as Oo,Ka as Bt,L as br,La as Dr,Ma as C,Na as Fr,O as vr,Oa as Se,P as xr,Q as st,Qa as no,R as Wo,Ra as tt,Sa as Ko,Ta as lt,Ua as ke,Va as ro,W as wr,Wa as zr,Xa as io,Y as kt,Z as Cr,_ as Sr,a as at,c as Gt,d as Yn,e as Xn,ea as to,eb as Dt,f as Zn,g as jo,h as et,i as Zt,ia as Rr,k as gr,ka as oo,la as Tr,nb as jr,o as Nt,pa as Pr,q as fr,qa as Ve,rb as $r,sa as Uo,t as yr,ta as Ir,tb as _r,u as eo,ua as Ar,vb as qo,w as Mt,za as Ho}from"./embed-page-chunk-BRETUPSG.js";import{f as Qn,j as Oe,l as Jn,n as er,p as tr,q as Ce,r as ue}from"./embed-page-chunk-T25T2YE6.js";import{a as i}from"./embed-page-chunk-MB65DZAX.js";import{$ as Vt,$b as ar,Ac as dr,Ca as Vn,Eb as Qt,Fa as Ct,Gc as pr,Ia as be,Ic as mr,Ja as Le,Kc as Xt,La as P,Lc as Jt,Ma as Gn,Nc as ur,Tb as ir,V as Et,Va as $o,W as z,Y as Fo,Z as xe,_ as Me,aa as je,bc as sr,fc as lr,ia as _e,la as qn,mb as St,mc as Yt,na as zo,oa as de,ob as or,pa as qe,qb as nr,rc as yt,sb as _o,ta as K,tb as rr,va as re,wa as Pe,xa as q,ya as me,yb as Lo,yc as cr}from"./embed-page-chunk-O4QK5LWZ.js";import{a as w}from"./embed-page-chunk-4BKXE5ON.js";import{e as n}from"./embed-page-chunk-6Y3UYJ6Z.js";var Or=n(i()),xa=C(({token:e,css:t})=>({button:t`
|
|
2
|
-
display: inline-flex;
|
|
3
|
-
align-items: center;
|
|
4
|
-
justify-content: center;
|
|
5
|
-
width: 32px;
|
|
6
|
-
height: 32px;
|
|
7
|
-
border-radius: 8px;
|
|
8
|
-
border: 1px solid transparent;
|
|
9
|
-
background: transparent;
|
|
10
|
-
color: inherit;
|
|
11
|
-
transition: all 0.2s ease;
|
|
12
|
-
|
|
13
|
-
&:hover {
|
|
14
|
-
background: ${e.colorBgTextHover};
|
|
15
|
-
border-color: ${e.colorBorderSecondary};
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
&[aria-pressed="true"] {
|
|
19
|
-
background: ${e.colorBgTextHover};
|
|
20
|
-
border-color: ${e.colorBorderSecondary};
|
|
21
|
-
}
|
|
22
|
-
`})),Rt=({ariaLabel:e,icon:t,onClick:o,pressed:r=!1})=>{let{styles:s}=xa();return(0,Or.jsx)(z,{type:"text",size:"small",className:s.button,icon:t,onClick:o,"aria-label":e,"aria-pressed":r})};var Vo=n(i()),Go=()=>{let{toolsVisible:e,toggleTools:t}=ke();return(0,Vo.jsx)(Rt,{ariaLabel:"Toggle file directory",icon:(0,Vo.jsx)(st,{size:16}),onClick:t,pressed:e})};var he=n(w());var Ue=n(w());var ao=n(w());function ot(e){let[t,o]=(0,ao.useState)(()=>typeof window<"u"?window.matchMedia(e).matches:!1);return(0,ao.useEffect)(()=>{let r=window.matchMedia(e),s=a=>{o(a.matches)};return r.addEventListener("change",s),()=>r.removeEventListener("change",s)},[e]),t}var Te=n(i()),ht=({main:e,detail:t,tools:o,logo:r,menu:s,header:a,mainStyle:d})=>{let{styles:c}=ro(),{detailVisible:p,detailSize:u,detailSelectedCard:b,toolsVisible:x,toolSelectedCard:v,contentAppSelectedCard:g,menuCollapsed:m,setMenuCollapsed:f,closeDetail:W,closeTools:j}=ke(),A=ot("(max-width: 768px)"),X=ot("(max-width: 1100px)"),ee=p||(m??A),pe=p&&!A,Q=ee?"collapsed":"expanded",S=p||x,B=x&&(u||"large")==="large"?"middle":u||"large";return(0,Te.jsxs)("div",{className:`fina_chat ${c.layout}`,children:[s&&(0,Te.jsxs)("div",{className:`${c.menu} ${Q} ${pe?c.menuSnap:""}`,children:[r,s]}),(0,Te.jsxs)("div",{className:c.contentArea,children:[(a||A&&s)&&(0,Te.jsxs)("div",{className:c.header,children:[A&&s?(0,Te.jsx)("button",{className:c.mobileMenuToggle,onClick:()=>f(!ee),"aria-label":"Toggle menu",children:(0,Te.jsx)(Tr,{size:18})}):null,a]}),(0,Te.jsxs)("div",{className:c.columns,style:{gap:S?void 0:0},children:[(0,Te.jsx)("div",{className:`${c.mainContent} ${S?"open":""}`,children:(0,Te.jsx)("div",{className:`${c.chat} ${g?"full_content_width":""}`,style:d,children:e})}),(0,Te.jsxs)("div",{className:`${c.detailPanel} ${p?`open ${B}`:""}`,children:[p&&A&&(0,Te.jsx)("button",{className:c.mobilePanelClose,onClick:W,"aria-label":"Close detail panel",children:(0,Te.jsx)(Bt,{size:20})}),p&&b&&t?(0,Te.jsx)("div",{className:c.detailContent,children:t}):null]}),(0,Te.jsxs)("div",{className:`${c.toolPanel} ${x?"open":""}`,children:[x&&X&&(0,Te.jsx)("button",{className:c.mobilePanelClose,onClick:j,"aria-label":"Close tool panel",children:(0,Te.jsx)(Bt,{size:20})}),x&&o?(0,Te.jsx)("div",{className:c.detailContent,children:o}):null]})]})]})]})};var Ie=n(w());var N=n(i()),Wr={wrapper:{background:"transparent",borderRadius:"0 24px 24px 0"},content:{background:"rgba(255, 255, 255, 0.72)",backdropFilter:"blur(20px) saturate(180%)",WebkitBackdropFilter:"blur(20px) saturate(180%)"},header:{background:"transparent",borderBottom:"1px solid rgba(0, 0, 0, 0.06)"},body:{padding:0}},wa=C(({token:e,css:t})=>({sidebar:t`
|
|
23
|
-
display: flex;
|
|
24
|
-
flex-direction: column;
|
|
25
|
-
height: 100%;
|
|
26
|
-
width: 100%;
|
|
27
|
-
position: relative;
|
|
28
|
-
background: transparent;
|
|
29
|
-
border-radius: ${e.borderRadiusLG}px;
|
|
30
|
-
overflow: visible;
|
|
31
|
-
padding: 0px ${e.paddingSM}px;
|
|
32
|
-
`,buttonContainer:t`
|
|
33
|
-
display: flex;
|
|
34
|
-
flex-direction: column;
|
|
35
|
-
gap: ${e.marginSM}px;
|
|
36
|
-
align-items: center;
|
|
37
|
-
`,actionButton:t`
|
|
38
|
-
display: flex;
|
|
39
|
-
align-items: center;
|
|
40
|
-
justify-content: center;
|
|
41
|
-
width: 40px;
|
|
42
|
-
height: 40px;
|
|
43
|
-
border-radius: ${e.borderRadius}px;
|
|
44
|
-
border: none;
|
|
45
|
-
background: ${e.colorBgContainer};
|
|
46
|
-
color: ${e.colorTextSecondary};
|
|
47
|
-
transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
|
|
48
|
-
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
|
|
49
|
-
|
|
50
|
-
&:hover {
|
|
51
|
-
background: ${e.colorPrimaryBg};
|
|
52
|
-
color: ${e.colorPrimary};
|
|
53
|
-
transform: translateY(-1px);
|
|
54
|
-
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
&:active {
|
|
58
|
-
transform: translateY(0);
|
|
59
|
-
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
.lucide {
|
|
63
|
-
width: 22px;
|
|
64
|
-
height: 22px;
|
|
65
|
-
}
|
|
66
|
-
`})),Ca=e=>{let t=new Map;return e.forEach(o=>{let r=o.group||null;t.has(r)||t.set(r,[]),t.get(r).push(o)}),Array.from(t.entries()).map(([o,r])=>({group:o,items:r.sort((s,a)=>(s.order??0)-(a.order??0))})).sort((o,r)=>{if(o.group===null)return-1;if(r.group===null)return 1;let s=o.items[0]?.order??0,a=r.items[0]?.order??0;return s-a})},so=({items:e,onItemClick:t,logo:o,logoIcon:r,logoText:s="Menu",showBranding:a=!0,showToggle:d=!0,showNewAnalysis:c=!1,onNewAnalysis:p,defaultExpanded:u=!0,forceIconMode:b=!1,collapsed:x,onCollapsedChange:v,className:g,style:m,footer:f,getContextMenuItems:W})=>{let{styles:j}=wa(),{styles:A}=ro(),X=x!==void 0,[ee,pe]=(0,Ie.useState)(!u),Q=X?x:ee;(0,Ie.useEffect)(()=>{X||v?.(Q)},[]);let[S,B]=(0,Ie.useState)({}),[J,Z]=(0,Ie.useState)(()=>{let k=new Set;return e.forEach(ne=>{ne.type==="drawer"&&ne.inline&&ne.inlineDefaultExpanded&&k.add(ne.id)}),k}),E=Q||b,D=!!E,$=(0,Ie.useMemo)(()=>Ca(e),[e]),le=(0,Ie.useCallback)(k=>{t?.(k),k.type==="drawer"&&((k.inline??!1)&&!E?Z(F=>{let U=new Set(F);return U.has(k.id)?U.delete(k.id):U.add(k.id),U}):B(F=>({...F,[k.id]:!0})))},[t,E]),L=(0,Ie.useCallback)(k=>{B(ne=>({...ne,[k]:!1}))},[]),R=(0,Ie.useMemo)(()=>e.filter(k=>k.type==="drawer"&&S[k.id]).map(k=>k.id),[e,S]);(0,Ie.useEffect)(()=>{if(R.length===0)return;let k=ne=>{let F=ne.target;!F||typeof F.closest!="function"||R.forEach(U=>{F.closest(`.menu-drawer-${U}`)||L(U)})};return document.addEventListener("mousedown",k),()=>document.removeEventListener("mousedown",k)},[R,L]);let I=(0,Ie.useCallback)(()=>{if(!b){let k=!Q;X?v?.(k):pe(k)}},[b,Q,X,v]);return(0,N.jsxs)(N.Fragment,{children:[E?(0,N.jsxs)("div",{className:`${j.sidebar} ${A.iconMode} ${g||""}`,style:m,children:[a?(0,N.jsx)("div",{className:A.iconModeLogo,children:o||r||(0,N.jsx)(Oo,{size:28,color:"#1677ff"})}):null,(0,N.jsx)("div",{className:A.iconModeContainer,children:$.map(({group:k,items:ne},F)=>(0,N.jsxs)(Ie.default.Fragment,{children:[F>0&&(0,N.jsx)("div",{className:A.iconModeDivider}),(0,N.jsx)("div",{className:A.iconModeGroup,children:ne.map(U=>{let We=W?.(U),He=U.badge!==void 0&&U.badge!==!1&&U.badge!==0,Ze=(0,N.jsxs)("button",{className:A.iconModeButton,onClick:()=>le(U),title:U.name,"aria-label":U.name,style:{position:"relative"},children:[(0,N.jsx)("span",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",height:"100%"},children:U.icon}),He&&(0,N.jsx)("span",{style:{position:"absolute",top:2,right:2,minWidth:typeof U.badge=="number"?16:8,height:typeof U.badge=="number"?16:8,borderRadius:typeof U.badge=="number"?8:4,background:"#ef4444",color:"#fff",fontSize:10,fontWeight:600,display:"flex",alignItems:"center",justifyContent:"center",lineHeight:1,padding:typeof U.badge=="number"?"0 3px":0},children:typeof U.badge=="number"?U.badge>99?"99+":U.badge:null})]},U.id);return We?(0,N.jsx)(qe,{menu:{items:We},trigger:["contextMenu"],children:Ze},U.id):Ze})})]},k||`group-${F}`))}),d&&(0,N.jsx)("button",{className:A.iconModeButton,onClick:I,title:"Expand sidebar","aria-label":"Expand sidebar",style:{marginTop:"auto"},children:(0,N.jsx)("span",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",height:"100%"},children:(0,N.jsx)(Mt,{size:22})})}),f&&(0,N.jsx)("div",{style:{marginTop:"auto",paddingTop:8},children:typeof f=="function"?f({isIconMode:E}):f})]}):(0,N.jsxs)("div",{className:`${j.sidebar} ${A.expandedMenu} ${g||""}`,style:m,children:[a?(0,N.jsxs)("div",{className:`${A.expandedMenuLogo} ${D?"collapsed":""}`,children:[(0,N.jsx)("div",{className:"logo-icon",children:o||r||(0,N.jsx)(Oo,{size:28,color:"#1677ff"})}),(0,N.jsx)("span",{className:"logo-text",children:s}),d&&!b&&(0,N.jsx)("button",{className:A.collapseBtn,onClick:I,title:"Collapse sidebar","aria-label":"Collapse sidebar",children:(0,N.jsx)(oo,{size:18})})]}):d&&!b?(0,N.jsx)("button",{className:A.collapseBtn,onClick:I,title:"Collapse sidebar","aria-label":"Collapse sidebar",style:{alignSelf:"flex-end",marginBottom:8},children:(0,N.jsx)(oo,{size:18})}):null,c&&(0,N.jsxs)("button",{className:`${A.newAnalysisBtn} ${D?"collapsed":""}`,onClick:p,children:[(0,N.jsx)(Ir,{size:18}),(0,N.jsx)("span",{className:"btn-text",children:"New Thread"})]}),(0,N.jsx)("div",{className:A.buttonContainerExpanded,children:$.map(({group:k,items:ne})=>(0,N.jsxs)("div",{className:A.menuGroup,children:[k&&(0,N.jsx)("div",{className:`${A.menuGroupTitle} ${D?"collapsed":""}`,children:k}),ne.map(F=>{let U=F.inline??!1,We=J.has(F.id),He=W?.(F),Ze=F.badge!==void 0&&F.badge!==!1&&F.badge!==0,ft=(0,N.jsxs)("button",{className:`${A.menuItemExpanded} ${D?"collapsed":""} ${We?A.menuItemExpandedActive:""}`,onClick:()=>le(F),title:D?F.name:void 0,"aria-label":F.name,"aria-expanded":We,children:[(0,N.jsx)("span",{className:"menu-icon",children:F.icon}),(0,N.jsx)("span",{className:"menu-label",children:F.name}),Ze&&(0,N.jsx)("span",{style:{marginLeft:"auto",minWidth:typeof F.badge=="number"?18:8,height:typeof F.badge=="number"?18:8,borderRadius:typeof F.badge=="number"?9:4,background:"#ef4444",color:"#fff",fontSize:11,fontWeight:600,display:"flex",alignItems:"center",justifyContent:"center",lineHeight:1,padding:typeof F.badge=="number"?"0 4px":0},children:typeof F.badge=="number"?F.badge>99?"99+":F.badge:null}),U&&!D&&(0,N.jsx)("span",{className:A.inlineDrawerIndicator,children:We?(0,N.jsx)(eo,{size:16}):(0,N.jsx)(Mt,{size:16})})]}),rt=He?(0,N.jsx)(qe,{menu:{items:He},trigger:["contextMenu"],children:ft},F.id):(0,N.jsx)(Ie.default.Fragment,{children:ft},F.id);return(0,N.jsxs)(Ie.default.Fragment,{children:[rt,U&&We&&!D&&(0,N.jsx)("div",{className:A.inlineDrawerContainer,children:F.content})]},F.id)})]},k||"ungrouped"))}),f&&(0,N.jsx)("div",{style:{marginTop:"auto",paddingTop:16,borderTop:"1px solid rgba(0, 0, 0, 0.06)"},children:typeof f=="function"?f({isIconMode:E}):f})]}),e.filter(k=>k.type==="drawer").map(k=>(0,N.jsx)(zo,{rootClassName:`menu-drawer-${k.id}`,title:(0,N.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%"},children:[(0,N.jsx)("span",{style:{fontSize:16,fontWeight:600,textTransform:"uppercase",letterSpacing:.5},children:k.title||k.name}),(0,N.jsx)("button",{onClick:()=>L(k.id),style:{display:"flex",alignItems:"center",justifyContent:"center",width:36,height:36,borderRadius:8,border:"1px solid rgba(0, 0, 0, 0.1)",background:"rgba(255, 255, 255, 0.5)",cursor:"pointer"},children:(0,N.jsx)(oo,{size:24})})]}),open:S[k.id]||!1,onClose:()=>L(k.id),placement:"left",width:k.width||600,styles:{...Wr,header:{padding:"16px 20px",borderBottom:"1px solid rgba(0, 0, 0, 0.04)"},content:{...Wr.content,borderRadius:"0 24px 24px 0",overflow:"hidden"}},closable:!1,mask:!1,destroyOnClose:!0,children:k.content},k.id))]})};var Ur=n(w());var Hr=n(i()),{TextArea:jl}=K;var Kr=n(w());var qr=n(i());var Vr=n(i());var Tt=n(w());var Qo=class{apps=new Map;defaultId=void 0;register(t){if(!t.id)throw new Error("App must have an id");this.apps.set(t.id,t),this.defaultId===void 0&&(this.defaultId=t.id)}get(t){return this.apps.get(t)}list(){return Array.from(this.apps.values())}getDefaultId(){return this.defaultId}setDefault(t){if(!this.apps.has(t))throw new Error(`Cannot set default to unregistered app: ${t}`);this.defaultId=t}getCurrentId(){return this.currentId}setCurrent(t){if(!this.apps.has(t))throw new Error(`Cannot set current to unregistered app: ${t}`);this.currentId=t}resetCurrent(){this.currentId=void 0}currentId=void 0},ka=new Qo;var Ra=n(i()),Gl=(0,Tt.createContext)(null);var Qr=n(i()),Jl=C(({token:e})=>({container:{display:"flex",flexDirection:"column",gap:e.padding,padding:e.padding},header:{fontSize:e.fontSizeHeading5,fontWeight:600,color:e.colorText,paddingBottom:e.paddingSM,borderBottom:`1px solid ${e.colorBorderSecondary}`},grid:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(120px, 1fr))",gap:e.padding},card:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:e.paddingXS,padding:e.paddingLG,borderRadius:e.borderRadiusLG,border:`1px solid ${e.colorBorder}`,cursor:"pointer",transition:"all 0.2s",background:e.colorBgContainer,"&:hover":{borderColor:e.colorPrimary,background:e.colorPrimaryBg}},activeCard:{borderColor:e.colorPrimary,background:e.colorPrimaryBg},icon:{fontSize:28,lineHeight:1},name:{fontSize:e.fontSize,fontWeight:500,color:e.colorText,textAlign:"center"},activeName:{color:e.colorPrimary}}));var gi=n(w());var Ea=n(w());var Yo=n(i());var Yr=n(i());var ct=n(w());var Ma=n(i());var yc=300*1e3,hc=(0,ct.createContext)(null);var Ba=n(i());var pn=n(w());var Jo=n(w());var Da=n(w());var Fa=n(i());var Jr=n(i()),Nc=C(({token:e,css:t})=>({container:t`
|
|
67
|
-
display: flex;
|
|
68
|
-
flex-direction: column;
|
|
69
|
-
height: 100%;
|
|
70
|
-
`,loading:t`
|
|
71
|
-
display: flex;
|
|
72
|
-
align-items: center;
|
|
73
|
-
justify-content: center;
|
|
74
|
-
padding: 24px;
|
|
75
|
-
`,searchWrapper:t`
|
|
76
|
-
padding: 12px 16px;
|
|
77
|
-
border-bottom: 1px solid ${e.colorBorderSecondary};
|
|
78
|
-
`,searchInput:t`
|
|
79
|
-
border-radius: 20px;
|
|
80
|
-
background: ${e.colorFillQuaternary};
|
|
81
|
-
`,group:t`
|
|
82
|
-
margin-bottom: 4px;
|
|
83
|
-
`,groupHeader:t`
|
|
84
|
-
display: flex;
|
|
85
|
-
align-items: center;
|
|
86
|
-
justify-content: space-between;
|
|
87
|
-
padding: 8px 16px;
|
|
88
|
-
cursor: pointer;
|
|
89
|
-
font-size: 12px;
|
|
90
|
-
font-weight: 600;
|
|
91
|
-
color: ${e.colorTextSecondary};
|
|
92
|
-
text-transform: uppercase;
|
|
93
|
-
letter-spacing: 0.5px;
|
|
94
|
-
user-select: none;
|
|
95
|
-
|
|
96
|
-
&:hover {
|
|
97
|
-
color: ${e.colorText};
|
|
98
|
-
}
|
|
99
|
-
`,listItem:t`
|
|
100
|
-
display: flex;
|
|
101
|
-
align-items: center;
|
|
102
|
-
gap: 12px;
|
|
103
|
-
padding: 12px 16px;
|
|
104
|
-
cursor: pointer;
|
|
105
|
-
transition: all 0.15s ease;
|
|
106
|
-
border-left: 3px solid transparent;
|
|
107
|
-
border-radius: 10px;
|
|
108
|
-
|
|
109
|
-
&:hover {
|
|
110
|
-
background: ${e.colorFillSecondary};
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
&.selected {
|
|
114
|
-
background: ${e.colorPrimaryBg};
|
|
115
|
-
border-left-color: ${e.colorPrimary};
|
|
116
|
-
}
|
|
117
|
-
`,avatarWrapper:t`
|
|
118
|
-
position: relative;
|
|
119
|
-
flex-shrink: 0;
|
|
120
|
-
`,avatar:t`
|
|
121
|
-
width: 44px;
|
|
122
|
-
height: 44px;
|
|
123
|
-
border-radius: 10px;
|
|
124
|
-
background: linear-gradient(135deg, #6366f1, #8b5cf6);
|
|
125
|
-
color: white;
|
|
126
|
-
font-weight: 600;
|
|
127
|
-
font-size: 14px;
|
|
128
|
-
display: flex;
|
|
129
|
-
align-items: center;
|
|
130
|
-
justify-content: center;
|
|
131
|
-
flex-shrink: 0;
|
|
132
|
-
`,contentWrapper:t`
|
|
133
|
-
flex: 1;
|
|
134
|
-
min-width: 0;
|
|
135
|
-
`,roomName:t`
|
|
136
|
-
display: block;
|
|
137
|
-
font-size: 14px;
|
|
138
|
-
font-weight: 500;
|
|
139
|
-
color: ${e.colorText};
|
|
140
|
-
white-space: nowrap;
|
|
141
|
-
overflow: hidden;
|
|
142
|
-
text-overflow: ellipsis;
|
|
143
|
-
margin: 0;
|
|
144
|
-
`,lastMessage:t`
|
|
145
|
-
display: block;
|
|
146
|
-
font-size: 12px;
|
|
147
|
-
color: ${e.colorTextSecondary};
|
|
148
|
-
white-space: nowrap;
|
|
149
|
-
overflow: hidden;
|
|
150
|
-
text-overflow: ellipsis;
|
|
151
|
-
margin: 2px 0 0 0;
|
|
152
|
-
`,metaWrapper:t`
|
|
153
|
-
flex-shrink: 0;
|
|
154
|
-
display: flex;
|
|
155
|
-
flex-direction: column;
|
|
156
|
-
align-items: flex-end;
|
|
157
|
-
gap: 4px;
|
|
158
|
-
`,time:t`
|
|
159
|
-
font-size: 11px;
|
|
160
|
-
color: ${e.colorTextTertiary};
|
|
161
|
-
`,memberCount:t`
|
|
162
|
-
font-size: 11px;
|
|
163
|
-
color: ${e.colorTextTertiary};
|
|
164
|
-
display: flex;
|
|
165
|
-
align-items: center;
|
|
166
|
-
gap: 2px;
|
|
167
|
-
`,emptyContainer:t`
|
|
168
|
-
padding: 24px 16px;
|
|
169
|
-
`}));var Ya=n(w());var dt=n(w());var za=n(i());var Xc=(0,dt.createContext)(null);var Ot=n(w());var Ae=n(w());var M=n(i()),ja=C(({token:e,css:t})=>({container:t`
|
|
170
|
-
display: flex;
|
|
171
|
-
flex-direction: column;
|
|
172
|
-
height: 100%;
|
|
173
|
-
position: relative;
|
|
174
|
-
overflow: hidden;
|
|
175
|
-
`,header:t`
|
|
176
|
-
position: relative;
|
|
177
|
-
display: flex;
|
|
178
|
-
align-items: center;
|
|
179
|
-
padding: ${e.paddingSM}px ${e.padding}px;
|
|
180
|
-
background: ${e.colorBgContainer};
|
|
181
|
-
border-bottom: 1px solid ${e.colorBorder};
|
|
182
|
-
gap: ${e.paddingSM}px;
|
|
183
|
-
z-index: 10;
|
|
184
|
-
`,tabsStrip:t`
|
|
185
|
-
flex: 1;
|
|
186
|
-
display: flex;
|
|
187
|
-
align-items: center;
|
|
188
|
-
gap: 4px;
|
|
189
|
-
overflow-x: auto;
|
|
190
|
-
overflow-y: hidden;
|
|
191
|
-
padding: 4px;
|
|
192
|
-
scrollbar-width: none;
|
|
193
|
-
&::-webkit-scrollbar {
|
|
194
|
-
display: none;
|
|
195
|
-
}
|
|
196
|
-
`,tab:t`
|
|
197
|
-
position: relative;
|
|
198
|
-
display: flex;
|
|
199
|
-
align-items: center;
|
|
200
|
-
gap: 6px;
|
|
201
|
-
padding: 6px 14px;
|
|
202
|
-
border-radius: 9999px;
|
|
203
|
-
cursor: pointer;
|
|
204
|
-
transition: all 0.25s cubic-bezier(0.4, 0.0, 0.2, 1);
|
|
205
|
-
white-space: nowrap;
|
|
206
|
-
font-size: 13px;
|
|
207
|
-
font-weight: 500;
|
|
208
|
-
color: ${e.colorTextSecondary};
|
|
209
|
-
background: transparent;
|
|
210
|
-
max-width: 180px;
|
|
211
|
-
min-width: 80px;
|
|
212
|
-
user-select: none;
|
|
213
|
-
|
|
214
|
-
&:hover {
|
|
215
|
-
color: ${e.colorText};
|
|
216
|
-
background: ${e.colorBgTextHover};
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
&.active {
|
|
220
|
-
color: ${e.colorWhite};
|
|
221
|
-
background: ${e.colorPrimary};
|
|
222
|
-
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
|
|
223
|
-
}
|
|
224
|
-
`,tabLabel:t`
|
|
225
|
-
flex: 1;
|
|
226
|
-
overflow: hidden;
|
|
227
|
-
text-overflow: ellipsis;
|
|
228
|
-
white-space: nowrap;
|
|
229
|
-
padding-right: 4px;
|
|
230
|
-
`,closeIndicator:t`
|
|
231
|
-
display: flex;
|
|
232
|
-
align-items: center;
|
|
233
|
-
justify-content: center;
|
|
234
|
-
width: 16px;
|
|
235
|
-
height: 16px;
|
|
236
|
-
border-radius: 4px;
|
|
237
|
-
opacity: 0;
|
|
238
|
-
transform: scale(0.8);
|
|
239
|
-
transition: all 0.15s cubic-bezier(0.4, 0.0, 0.2, 1);
|
|
240
|
-
color: ${e.colorTextTertiary};
|
|
241
|
-
|
|
242
|
-
&:hover {
|
|
243
|
-
background: ${e.colorFillSecondary};
|
|
244
|
-
color: ${e.colorError};
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
&.always-visible {
|
|
248
|
-
opacity: 1;
|
|
249
|
-
transform: scale(1);
|
|
250
|
-
}
|
|
251
|
-
`,actions:t`
|
|
252
|
-
display: flex;
|
|
253
|
-
align-items: center;
|
|
254
|
-
gap: ${e.paddingXS}px;
|
|
255
|
-
flex-shrink: 0;
|
|
256
|
-
padding-left: ${e.paddingSM}px;
|
|
257
|
-
border-left: 1px solid ${e.colorBorder};
|
|
258
|
-
`,actionBtn:t`
|
|
259
|
-
display: flex;
|
|
260
|
-
align-items: center;
|
|
261
|
-
justify-content: center;
|
|
262
|
-
width: 32px;
|
|
263
|
-
height: 32px;
|
|
264
|
-
border-radius: ${e.borderRadiusSM}px;
|
|
265
|
-
border: none;
|
|
266
|
-
background: transparent;
|
|
267
|
-
color: ${e.colorTextSecondary};
|
|
268
|
-
cursor: pointer;
|
|
269
|
-
transition: all 0.15s cubic-bezier(0.4, 0.0, 0.2, 1);
|
|
270
|
-
|
|
271
|
-
&:hover {
|
|
272
|
-
background: ${e.colorBgTextHover};
|
|
273
|
-
color: ${e.colorText};
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
&:active {
|
|
277
|
-
background: ${e.colorFillSecondary};
|
|
278
|
-
}
|
|
279
|
-
`,content:t`
|
|
280
|
-
flex: 1;
|
|
281
|
-
overflow: auto;
|
|
282
|
-
background: ${e.colorBgContainer};
|
|
283
|
-
position: relative;
|
|
284
|
-
`,emptyState:t`
|
|
285
|
-
display: flex;
|
|
286
|
-
flex-direction: column;
|
|
287
|
-
align-items: center;
|
|
288
|
-
justify-content: center;
|
|
289
|
-
height: 100%;
|
|
290
|
-
gap: ${e.padding}px;
|
|
291
|
-
color: ${e.colorTextTertiary};
|
|
292
|
-
font-size: 14px;
|
|
293
|
-
|
|
294
|
-
.icon {
|
|
295
|
-
font-size: 48px;
|
|
296
|
-
opacity: 0.3;
|
|
297
|
-
}
|
|
298
|
-
`,tabCounter:t`
|
|
299
|
-
display: flex;
|
|
300
|
-
align-items: center;
|
|
301
|
-
justify-content: center;
|
|
302
|
-
min-width: 20px;
|
|
303
|
-
height: 20px;
|
|
304
|
-
padding: 0 6px;
|
|
305
|
-
border-radius: 9999px;
|
|
306
|
-
background: ${e.colorFillSecondary};
|
|
307
|
-
font-size: 11px;
|
|
308
|
-
font-weight: 600;
|
|
309
|
-
color: ${e.colorTextSecondary};
|
|
310
|
-
`,compactWrapper:t`
|
|
311
|
-
position: absolute;
|
|
312
|
-
top: 0;
|
|
313
|
-
left: 0;
|
|
314
|
-
right: 0;
|
|
315
|
-
z-index: 20;
|
|
316
|
-
display: flex;
|
|
317
|
-
flex-direction: column;
|
|
318
|
-
align-items: center;
|
|
319
|
-
`,compactPill:t`
|
|
320
|
-
display: flex;
|
|
321
|
-
align-items: center;
|
|
322
|
-
gap: 4px;
|
|
323
|
-
padding: 2px 10px;
|
|
324
|
-
border-radius: 6px;
|
|
325
|
-
font-size: 11px;
|
|
326
|
-
font-weight: 500;
|
|
327
|
-
color: ${e.colorTextQuaternary};
|
|
328
|
-
background: ${e.colorBgContainer}cc;
|
|
329
|
-
backdrop-filter: blur(8px);
|
|
330
|
-
-webkit-backdrop-filter: blur(8px);
|
|
331
|
-
box-shadow: ${e.boxShadowSecondary};
|
|
332
|
-
max-width: 90%;
|
|
333
|
-
cursor: default;
|
|
334
|
-
transition: all 0.2s ease;
|
|
335
|
-
margin-top: 0;
|
|
336
|
-
|
|
337
|
-
&:hover {
|
|
338
|
-
color: ${e.colorText};
|
|
339
|
-
background: ${e.colorBgContainer}f2;
|
|
340
|
-
}
|
|
341
|
-
`,compactPillLabel:t`
|
|
342
|
-
flex: 1;
|
|
343
|
-
overflow: hidden;
|
|
344
|
-
text-overflow: ellipsis;
|
|
345
|
-
white-space: nowrap;
|
|
346
|
-
`,floatingHeader:t`
|
|
347
|
-
display: flex;
|
|
348
|
-
align-items: center;
|
|
349
|
-
background: ${e.colorBgContainer}f2;
|
|
350
|
-
backdrop-filter: blur(8px);
|
|
351
|
-
-webkit-backdrop-filter: blur(8px);
|
|
352
|
-
border-radius: 0 0 ${e.borderRadiusLG}px ${e.borderRadiusLG}px;
|
|
353
|
-
box-shadow: ${e.boxShadowSecondary};
|
|
354
|
-
border: 1px solid ${e.colorBorder};
|
|
355
|
-
border-top: none;
|
|
356
|
-
padding: 4px 8px;
|
|
357
|
-
gap: 4px;
|
|
358
|
-
width: 100%;
|
|
359
|
-
animation: floatIn 0.2s ease;
|
|
360
|
-
transition: background 0.2s ease;
|
|
361
|
-
|
|
362
|
-
@keyframes floatIn {
|
|
363
|
-
from {
|
|
364
|
-
opacity: 0;
|
|
365
|
-
transform: translateY(-4px);
|
|
366
|
-
}
|
|
367
|
-
to {
|
|
368
|
-
opacity: 1;
|
|
369
|
-
transform: translateY(0);
|
|
370
|
-
}
|
|
371
|
-
}
|
|
372
|
-
`,floatingHeaderPeek:t`
|
|
373
|
-
background: ${e.colorBgContainer}cc;
|
|
374
|
-
`,floatingHeaderLeaving:t`
|
|
375
|
-
animation: floatOut 0.2s ease forwards;
|
|
376
|
-
|
|
377
|
-
@keyframes floatOut {
|
|
378
|
-
from {
|
|
379
|
-
opacity: 1;
|
|
380
|
-
transform: translateY(0);
|
|
381
|
-
}
|
|
382
|
-
to {
|
|
383
|
-
opacity: 0;
|
|
384
|
-
transform: translateY(-4px);
|
|
385
|
-
}
|
|
386
|
-
}
|
|
387
|
-
`,floatingTabsStrip:t`
|
|
388
|
-
flex: 1;
|
|
389
|
-
min-width: 0;
|
|
390
|
-
display: flex;
|
|
391
|
-
align-items: center;
|
|
392
|
-
gap: 4px;
|
|
393
|
-
overflow-x: auto;
|
|
394
|
-
overflow-y: hidden;
|
|
395
|
-
padding: 2px 0;
|
|
396
|
-
scrollbar-width: none;
|
|
397
|
-
&::-webkit-scrollbar {
|
|
398
|
-
display: none;
|
|
399
|
-
}
|
|
400
|
-
`,contentWrapper:t`
|
|
401
|
-
height: 100%;
|
|
402
|
-
animation: fadeIn 0.3s ease;
|
|
403
|
-
|
|
404
|
-
@keyframes fadeIn {
|
|
405
|
-
from {
|
|
406
|
-
opacity: 0;
|
|
407
|
-
transform: translateY(4px);
|
|
408
|
-
}
|
|
409
|
-
to {
|
|
410
|
-
opacity: 1;
|
|
411
|
-
transform: translateY(0);
|
|
412
|
-
}
|
|
413
|
-
}
|
|
414
|
-
`})),$a=({component_key:e,data:t})=>t?.component?(0,M.jsx)(M.Fragment,{children:t.component}):(0,M.jsxs)("div",{children:[(0,M.jsx)("p",{children:"Component view not found"}),(0,M.jsx)("pre",{children:JSON.stringify({component_key:e,data:t},null,2)})]}),co=e=>(0,M.jsx)($o,{style:{fontSize:12,opacity:.6}}),po=({region:e="side",compact:t=!0,showCloseButton:o=!0})=>{let{styles:r}=ja(),{sideAppSelectedCard:s,contentAppSelectedCard:a,closeSideApp:d,closeContentApp:c,openSideApp:p,openContentApp:u}=ke(),b=e==="side"?s:a,x=e==="side"?d:c,v=e==="side"?p:u,[g,m]=(0,Ae.useState)(JSON.stringify(b)),[f,W]=(0,Ae.useState)(null),[j,A]=(0,Ae.useState)([]),[X,ee]=(0,Ae.useState)(!1),[pe,Q]=(0,Ae.useState)(!1),[S,B]=(0,Ae.useState)(!1),J=(0,Ae.useRef)(null),Z=(0,Ae.useCallback)(()=>{J.current&&(clearTimeout(J.current),J.current=null),Q(!1),B(!1),ee(!0)},[]),E=(0,Ae.useCallback)(()=>{J.current=setTimeout(()=>{Q(!0)},150)},[]),se=(0,Ae.useCallback)(()=>{pe&&(ee(!1),Q(!1))},[pe]),D=(T,ce,k,ne)=>{let F=[...j,{label:ce,children:k,key:T,componentKey:ne}];A(F),m(T)},$=T=>{let ce=g,k=j.findIndex(F=>F.key===T),ne=j.filter(F=>F.key!==T);if(ne.length===0){x();return}ce===T&&(k>0?ce=j[k-1].key:ce=ne[0].key),A(ne),m(ce)},le=T=>{m(T)};(0,Ae.useEffect)(()=>{if(!b)return;let T=JSON.stringify(b);if(j.find(k=>k.key===T)){m(T),setTimeout(()=>{document.querySelector(`[data-tab-key="${T}"]`)?.scrollIntoView({behavior:"smooth",inline:"center"})},100);return}let ce=qo(b?.component_key)?.side_app_view||$a;D(T,b?.message||b?.data?.message||"Unnamed",(0,M.jsx)(ce,{component_key:b?.component_key||"",data:b?.data,context:b?.context}),b?.component_key),J.current&&clearTimeout(J.current),ee(!0),Q(!1),B(!0),J.current=setTimeout(()=>{Q(!0)},1500)},[b]);let L=j.find(T=>T.key===g),R=j.map(T=>({key:T.key,label:(0,M.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"4px 0"},children:[co(T.componentKey),(0,M.jsx)("span",{style:{flex:1},children:T.label}),(0,M.jsx)(St,{style:{fontSize:10,opacity:.5},onClick:ce=>{ce.stopPropagation(),$(T.key)}})]}),onClick:()=>le(T.key)})),I=(0,Ae.useMemo)(()=>({openApp:v}),[v]);return(0,M.jsxs)("div",{className:r.container,children:[t&&j.length>0&&(0,M.jsx)("div",{className:r.compactWrapper,onMouseEnter:Z,onMouseLeave:E,children:X?(0,M.jsxs)("div",{className:`${r.floatingHeader} ${S?r.floatingHeaderPeek:""} ${pe?r.floatingHeaderLeaving:""}`,onAnimationEnd:se,children:[(0,M.jsx)("div",{className:r.floatingTabsStrip,children:j.map(T=>(0,M.jsx)(je,{title:T.label,placement:"bottom",children:(0,M.jsxs)("div",{"data-tab-key":T.key,className:`${r.tab} ${T.key===g?"active":""}`,onClick:()=>le(T.key),onMouseEnter:()=>W(T.key),onMouseLeave:()=>W(null),children:[co(T.componentKey),(0,M.jsx)("span",{className:r.tabLabel,children:T.label}),(0,M.jsx)("span",{className:`${r.closeIndicator} ${f===T.key||T.key===g?"always-visible":""}`,onClick:ce=>{ce.stopPropagation(),$(T.key)},children:(0,M.jsx)(St,{style:{fontSize:10}})})]})},T.key))}),j.length>1&&(0,M.jsx)(qe,{menu:{items:R},placement:"bottomRight",trigger:["click"],children:(0,M.jsx)("button",{className:r.actionBtn,title:"All tabs",children:(0,M.jsx)(yt,{})})}),o&&(0,M.jsx)(je,{title:"Close",children:(0,M.jsx)("button",{className:r.actionBtn,onClick:x,children:(0,M.jsx)(St,{})})})]}):L&&(0,M.jsxs)("div",{className:r.compactPill,children:[co(L.componentKey),(0,M.jsx)("span",{className:r.compactPillLabel,children:L.label})]})}),!t&&(0,M.jsxs)("div",{className:r.header,children:[(0,M.jsx)("div",{className:r.tabsStrip,children:j.map(T=>(0,M.jsx)(je,{title:T.label,placement:"bottom",children:(0,M.jsxs)("div",{"data-tab-key":T.key,className:`${r.tab} ${T.key===g?"active":""}`,onClick:()=>le(T.key),onMouseEnter:()=>W(T.key),onMouseLeave:()=>W(null),children:[co(T.componentKey),(0,M.jsx)("span",{className:r.tabLabel,children:T.label}),(0,M.jsx)("span",{className:`${r.closeIndicator} ${f===T.key||T.key===g?"always-visible":""}`,onClick:ce=>{ce.stopPropagation(),$(T.key)},children:(0,M.jsx)(St,{style:{fontSize:10}})})]})},T.key))}),(0,M.jsxs)("div",{className:r.actions,children:[j.length>0&&(0,M.jsx)("div",{className:r.tabCounter,children:j.length}),j.length>1&&(0,M.jsx)(qe,{menu:{items:R},placement:"bottomRight",trigger:["click"],children:(0,M.jsx)("button",{className:r.actionBtn,title:"All tabs",children:(0,M.jsx)(yt,{})})}),o&&(0,M.jsx)(je,{title:"Close",children:(0,M.jsx)("button",{className:r.actionBtn,onClick:x,children:(0,M.jsx)(St,{})})})]})]}),(0,M.jsx)("div",{className:r.content,style:t&&j.length>0?{paddingTop:10}:void 0,children:(0,M.jsx)(io.Provider,{value:I,children:L?(0,M.jsx)("div",{className:r.contentWrapper,children:L.children},L.key):(0,M.jsxs)("div",{className:r.emptyState,children:[(0,M.jsx)($o,{className:"icon"}),(0,M.jsx)("span",{children:"Select an app to start"})]})})})]})};var zt=n(w());var Zo=n(w());var en=n(i());var md=C(({token:e,css:t})=>({content:t`
|
|
415
|
-
display: flex;
|
|
416
|
-
flex-direction: column;
|
|
417
|
-
gap: 4px;
|
|
418
|
-
min-width: 0;
|
|
419
|
-
`,author:t`
|
|
420
|
-
font-size: 12px;
|
|
421
|
-
font-weight: 600;
|
|
422
|
-
color: ${e.colorTextSecondary};
|
|
423
|
-
`,mentions:t`
|
|
424
|
-
display: flex;
|
|
425
|
-
flex-wrap: wrap;
|
|
426
|
-
gap: 4px;
|
|
427
|
-
`,mention:t`
|
|
428
|
-
display: inline-flex;
|
|
429
|
-
align-items: center;
|
|
430
|
-
padding: 1px 8px;
|
|
431
|
-
border-radius: 9999px;
|
|
432
|
-
background: ${e.colorFillTertiary};
|
|
433
|
-
color: ${e.colorPrimary};
|
|
434
|
-
font-size: 12px;
|
|
435
|
-
`,quote:t`
|
|
436
|
-
display: flex;
|
|
437
|
-
flex-direction: column;
|
|
438
|
-
gap: 2px;
|
|
439
|
-
padding: 6px 10px;
|
|
440
|
-
margin-bottom: 6px;
|
|
441
|
-
border-left: 3px solid ${e.colorBorder};
|
|
442
|
-
background: ${e.colorFillQuaternary};
|
|
443
|
-
border-radius: 6px;
|
|
444
|
-
max-width: 100%;
|
|
445
|
-
`,quoteAuthor:t`
|
|
446
|
-
font-size: 12px;
|
|
447
|
-
font-weight: 600;
|
|
448
|
-
color: ${e.colorTextSecondary};
|
|
449
|
-
`,quoteText:t`
|
|
450
|
-
font-size: 13px;
|
|
451
|
-
color: ${e.colorTextTertiary};
|
|
452
|
-
white-space: nowrap;
|
|
453
|
-
overflow: hidden;
|
|
454
|
-
text-overflow: ellipsis;
|
|
455
|
-
`,dispatchNotice:t`
|
|
456
|
-
display: flex;
|
|
457
|
-
align-items: center;
|
|
458
|
-
gap: 8px;
|
|
459
|
-
margin-top: 4px;
|
|
460
|
-
padding: 4px 8px;
|
|
461
|
-
border-radius: 6px;
|
|
462
|
-
background: ${e.colorWarningBg};
|
|
463
|
-
color: ${e.colorWarningText};
|
|
464
|
-
font-size: 12px;
|
|
465
|
-
`,sentRow:t`
|
|
466
|
-
display: flex;
|
|
467
|
-
justify-content: flex-end;
|
|
468
|
-
margin-top: 2px;
|
|
469
|
-
color: ${e.colorTextTertiary};
|
|
470
|
-
`,actions:t`
|
|
471
|
-
display: flex;
|
|
472
|
-
align-items: center;
|
|
473
|
-
gap: 4px;
|
|
474
|
-
margin-top: 2px;
|
|
475
|
-
`,notice:t`
|
|
476
|
-
display: flex;
|
|
477
|
-
align-items: center;
|
|
478
|
-
gap: 8px;
|
|
479
|
-
font-size: 13px;
|
|
480
|
-
color: ${e.colorTextSecondary};
|
|
481
|
-
padding: 4px 0;
|
|
482
|
-
`}));var Zr=n(i());var bd=C(({token:e,css:t})=>({row:t`
|
|
483
|
-
display: flex;
|
|
484
|
-
align-items: center;
|
|
485
|
-
gap: 8px;
|
|
486
|
-
width: 100%;
|
|
487
|
-
max-width: 440px;
|
|
488
|
-
min-width: 0;
|
|
489
|
-
padding: 3px 6px;
|
|
490
|
-
margin: 1px 0;
|
|
491
|
-
border: none;
|
|
492
|
-
border-radius: 8px;
|
|
493
|
-
background: transparent;
|
|
494
|
-
text-align: left;
|
|
495
|
-
color: inherit;
|
|
496
|
-
transition: background 0.15s ease;
|
|
497
|
-
|
|
498
|
-
&:not(:disabled) {
|
|
499
|
-
cursor: pointer;
|
|
500
|
-
}
|
|
501
|
-
|
|
502
|
-
&:hover:not(:disabled) {
|
|
503
|
-
background: ${e.colorFillQuaternary};
|
|
504
|
-
|
|
505
|
-
.lattice-task-open-hint {
|
|
506
|
-
opacity: 1;
|
|
507
|
-
}
|
|
508
|
-
}
|
|
509
|
-
`,dot:t`
|
|
510
|
-
width: 8px;
|
|
511
|
-
height: 8px;
|
|
512
|
-
border-radius: 50%;
|
|
513
|
-
flex-shrink: 0;
|
|
514
|
-
`,label:t`
|
|
515
|
-
flex-shrink: 0;
|
|
516
|
-
font-size: 12px;
|
|
517
|
-
font-weight: 400;
|
|
518
|
-
color: ${e.colorTextSecondary};
|
|
519
|
-
`,title:t`
|
|
520
|
-
min-width: 0;
|
|
521
|
-
font-size: 13px;
|
|
522
|
-
font-weight: 600;
|
|
523
|
-
color: ${e.colorText};
|
|
524
|
-
white-space: nowrap;
|
|
525
|
-
overflow: hidden;
|
|
526
|
-
text-overflow: ellipsis;
|
|
527
|
-
`,spacer:t`
|
|
528
|
-
flex: 1;
|
|
529
|
-
min-width: 4px;
|
|
530
|
-
`,openHint:t`
|
|
531
|
-
flex-shrink: 0;
|
|
532
|
-
display: inline-flex;
|
|
533
|
-
color: ${e.colorTextTertiary};
|
|
534
|
-
opacity: 0;
|
|
535
|
-
transition: opacity 0.15s ease;
|
|
536
|
-
`}));var ei=n(i());var Md=5*6e4,Bd=C(({token:e,css:t})=>({root:t`
|
|
537
|
-
flex: 1;
|
|
538
|
-
min-height: 0;
|
|
539
|
-
overflow-y: auto;
|
|
540
|
-
overscroll-behavior: contain;
|
|
541
|
-
position: relative;
|
|
542
|
-
`,loadOlder:t`
|
|
543
|
-
display: flex;
|
|
544
|
-
align-items: center;
|
|
545
|
-
justify-content: center;
|
|
546
|
-
gap: 8px;
|
|
547
|
-
padding: 8px 0;
|
|
548
|
-
`,error:t`
|
|
549
|
-
padding: 8px 12px;
|
|
550
|
-
color: ${e.colorErrorText};
|
|
551
|
-
`,state:t`
|
|
552
|
-
padding: 24px;
|
|
553
|
-
text-align: center;
|
|
554
|
-
color: ${e.colorTextSecondary};
|
|
555
|
-
`,jump:t`
|
|
556
|
-
position: absolute;
|
|
557
|
-
bottom: 12px;
|
|
558
|
-
left: 50%;
|
|
559
|
-
transform: translateX(-50%);
|
|
560
|
-
`,list:t`
|
|
561
|
-
padding: 0 12px;
|
|
562
|
-
`,divider:t`
|
|
563
|
-
display: flex;
|
|
564
|
-
justify-content: center;
|
|
565
|
-
margin: 8px 0 4px;
|
|
566
|
-
`,dividerText:t`
|
|
567
|
-
font-size: 12px;
|
|
568
|
-
color: ${e.colorTextTertiary};
|
|
569
|
-
`}));var jt=n(w());var ti=n(i());var ip=C(({token:e,css:t})=>({root:t`
|
|
570
|
-
flex-shrink: 0;
|
|
571
|
-
background: ${e.colorBgContainer};
|
|
572
|
-
padding: 8px 12px max(8px, env(safe-area-inset-bottom));
|
|
573
|
-
|
|
574
|
-
@media (max-width: 768px) {
|
|
575
|
-
/* Nearly full-bleed on phones: the Sender already brings its own inner
|
|
576
|
-
padding, so extra host padding just wastes scarce width. */
|
|
577
|
-
padding: 4px 6px max(6px, env(safe-area-inset-bottom));
|
|
578
|
-
}
|
|
579
|
-
`,reply:t`
|
|
580
|
-
display: flex;
|
|
581
|
-
align-items: center;
|
|
582
|
-
justify-content: space-between;
|
|
583
|
-
gap: 8px;
|
|
584
|
-
margin-bottom: 8px;
|
|
585
|
-
font-size: 13px;
|
|
586
|
-
color: ${e.colorTextSecondary};
|
|
587
|
-
`,blocked:t`
|
|
588
|
-
margin-bottom: 8px;
|
|
589
|
-
font-size: 13px;
|
|
590
|
-
color: ${e.colorTextSecondary};
|
|
591
|
-
`,error:t`
|
|
592
|
-
margin-top: 8px;
|
|
593
|
-
font-size: 13px;
|
|
594
|
-
color: ${e.colorErrorText};
|
|
595
|
-
`}));var La=n(w());var oi=n(i());var cp=C(({token:e,css:t})=>({root:t`
|
|
596
|
-
display: flex;
|
|
597
|
-
align-items: center;
|
|
598
|
-
gap: 12px;
|
|
599
|
-
width: 100%;
|
|
600
|
-
min-width: 0;
|
|
601
|
-
`,leading:t`
|
|
602
|
-
display: flex;
|
|
603
|
-
align-items: center;
|
|
604
|
-
flex-shrink: 0;
|
|
605
|
-
`,title:t`
|
|
606
|
-
margin: 0;
|
|
607
|
-
min-width: 0;
|
|
608
|
-
flex: 1 1 auto;
|
|
609
|
-
font-size: 15px;
|
|
610
|
-
font-weight: 600;
|
|
611
|
-
color: ${e.colorText};
|
|
612
|
-
white-space: nowrap;
|
|
613
|
-
overflow: hidden;
|
|
614
|
-
text-overflow: ellipsis;
|
|
615
|
-
`,trailing:t`
|
|
616
|
-
display: flex;
|
|
617
|
-
align-items: center;
|
|
618
|
-
gap: 6px;
|
|
619
|
-
flex-shrink: 0;
|
|
620
|
-
margin-left: auto;
|
|
621
|
-
`}));var $t=n(w());var mo=[{role:"owner",label:"Owner",description:"Full control: settings, members, and messages."},{role:"admin",label:"Admin",description:"Manage settings and members; can send messages."},{role:"member",label:"Member",description:"Send messages and work in the project."},{role:"viewer",label:"Viewer",description:"Read-only access."}];var on=n(i());var Cp=mo.map(({role:e,label:t,description:o})=>({value:e,label:t,description:o}));var Sp=C(({token:e,css:t})=>({root:t`
|
|
622
|
-
display: flex;
|
|
623
|
-
flex-direction: column;
|
|
624
|
-
height: 100%;
|
|
625
|
-
min-height: 0;
|
|
626
|
-
overflow-y: auto;
|
|
627
|
-
padding: ${e.padding}px;
|
|
628
|
-
`,header:t`
|
|
629
|
-
display: flex;
|
|
630
|
-
align-items: center;
|
|
631
|
-
justify-content: space-between;
|
|
632
|
-
gap: 12px;
|
|
633
|
-
padding-bottom: ${e.padding}px;
|
|
634
|
-
`,titleSection:t`
|
|
635
|
-
display: flex;
|
|
636
|
-
align-items: center;
|
|
637
|
-
gap: 8px;
|
|
638
|
-
`,title:t`
|
|
639
|
-
margin: 0;
|
|
640
|
-
font-size: 16px;
|
|
641
|
-
font-weight: 600;
|
|
642
|
-
color: ${e.colorText};
|
|
643
|
-
`,search:t`
|
|
644
|
-
padding-bottom: ${e.padding}px;
|
|
645
|
-
margin-bottom: ${e.padding}px;
|
|
646
|
-
border-bottom: 1px solid ${e.colorBorderSecondary};
|
|
647
|
-
`,section:t`
|
|
648
|
-
margin-bottom: ${e.paddingLG}px;
|
|
649
|
-
`,sectionTitle:t`
|
|
650
|
-
display: flex;
|
|
651
|
-
align-items: center;
|
|
652
|
-
gap: 6px;
|
|
653
|
-
font-size: 12px;
|
|
654
|
-
font-weight: 600;
|
|
655
|
-
color: ${e.colorTextSecondary};
|
|
656
|
-
text-transform: uppercase;
|
|
657
|
-
letter-spacing: 0.5px;
|
|
658
|
-
margin: 0 0 8px 0;
|
|
659
|
-
`,sectionCount:t`
|
|
660
|
-
font-weight: 500;
|
|
661
|
-
color: ${e.colorTextTertiary};
|
|
662
|
-
`,list:t`
|
|
663
|
-
list-style: none;
|
|
664
|
-
padding: 0;
|
|
665
|
-
margin: 0;
|
|
666
|
-
`,row:t`
|
|
667
|
-
display: flex;
|
|
668
|
-
align-items: center;
|
|
669
|
-
gap: 10px;
|
|
670
|
-
padding: 6px 8px;
|
|
671
|
-
border-radius: ${e.borderRadius}px;
|
|
672
|
-
transition: background-color 150ms;
|
|
673
|
-
|
|
674
|
-
&:hover {
|
|
675
|
-
background-color: ${e.colorBgTextHover};
|
|
676
|
-
}
|
|
677
|
-
`,identity:t`
|
|
678
|
-
display: flex;
|
|
679
|
-
flex-direction: column;
|
|
680
|
-
flex: 1;
|
|
681
|
-
min-width: 0;
|
|
682
|
-
`,name:t`
|
|
683
|
-
font-size: 14px;
|
|
684
|
-
font-weight: 500;
|
|
685
|
-
color: ${e.colorText};
|
|
686
|
-
white-space: nowrap;
|
|
687
|
-
overflow: hidden;
|
|
688
|
-
text-overflow: ellipsis;
|
|
689
|
-
`,meta:t`
|
|
690
|
-
font-size: 12px;
|
|
691
|
-
color: ${e.colorTextSecondary};
|
|
692
|
-
white-space: nowrap;
|
|
693
|
-
overflow: hidden;
|
|
694
|
-
text-overflow: ellipsis;
|
|
695
|
-
`,avatarWrap:t`
|
|
696
|
-
position: relative;
|
|
697
|
-
display: inline-flex;
|
|
698
|
-
flex-shrink: 0;
|
|
699
|
-
`,presenceDot:t`
|
|
700
|
-
position: absolute;
|
|
701
|
-
right: -1px;
|
|
702
|
-
bottom: -1px;
|
|
703
|
-
width: 10px;
|
|
704
|
-
height: 10px;
|
|
705
|
-
border-radius: 50%;
|
|
706
|
-
border: 2px solid ${e.colorBgContainer};
|
|
707
|
-
box-sizing: content-box;
|
|
708
|
-
`,botBadge:t`
|
|
709
|
-
position: absolute;
|
|
710
|
-
left: -4px;
|
|
711
|
-
top: -4px;
|
|
712
|
-
display: inline-flex;
|
|
713
|
-
align-items: center;
|
|
714
|
-
justify-content: center;
|
|
715
|
-
width: 14px;
|
|
716
|
-
height: 14px;
|
|
717
|
-
border-radius: 50%;
|
|
718
|
-
color: #fff;
|
|
719
|
-
border: 1.5px solid ${e.colorBgContainer};
|
|
720
|
-
`,action:t`
|
|
721
|
-
flex-shrink: 0;
|
|
722
|
-
color: ${e.colorTextTertiary};
|
|
723
|
-
|
|
724
|
-
&:hover {
|
|
725
|
-
color: ${e.colorText};
|
|
726
|
-
}
|
|
727
|
-
`,empty:t`
|
|
728
|
-
color: ${e.colorTextSecondary};
|
|
729
|
-
font-size: 13px;
|
|
730
|
-
font-style: italic;
|
|
731
|
-
padding: 8px 0;
|
|
732
|
-
`,historical:t`
|
|
733
|
-
opacity: 0.7;
|
|
734
|
-
`,error:t`
|
|
735
|
-
margin-bottom: 12px;
|
|
736
|
-
`}));var _t=n(w());var ni=n(i()),Bp=C(({token:e,css:t})=>({root:t`
|
|
737
|
-
display: flex;
|
|
738
|
-
flex-direction: column;
|
|
739
|
-
height: 100%;
|
|
740
|
-
overflow-y: auto;
|
|
741
|
-
padding: 8px;
|
|
742
|
-
`,empty:t`
|
|
743
|
-
margin: auto;
|
|
744
|
-
color: ${e.colorTextSecondary};
|
|
745
|
-
font-size: 14px;
|
|
746
|
-
`,list:t`
|
|
747
|
-
list-style: none;
|
|
748
|
-
margin: 0;
|
|
749
|
-
padding: 0;
|
|
750
|
-
display: flex;
|
|
751
|
-
flex-direction: column;
|
|
752
|
-
gap: 8px;
|
|
753
|
-
`,item:t`
|
|
754
|
-
display: flex;
|
|
755
|
-
`,open:t`
|
|
756
|
-
width: 100%;
|
|
757
|
-
display: flex;
|
|
758
|
-
flex-direction: column;
|
|
759
|
-
gap: 6px;
|
|
760
|
-
text-align: left;
|
|
761
|
-
padding: 10px 12px;
|
|
762
|
-
border: 1px solid ${e.colorBorderSecondary};
|
|
763
|
-
border-radius: ${e.borderRadiusLG}px;
|
|
764
|
-
background: ${e.colorBgContainer};
|
|
765
|
-
cursor: pointer;
|
|
766
|
-
transition: all 0.15s ease;
|
|
767
|
-
|
|
768
|
-
&:hover {
|
|
769
|
-
background: ${e.colorFillQuaternary};
|
|
770
|
-
border-color: ${e.colorBorder};
|
|
771
|
-
}
|
|
772
|
-
`,title:t`
|
|
773
|
-
font-size: 14px;
|
|
774
|
-
font-weight: 500;
|
|
775
|
-
color: ${e.colorText};
|
|
776
|
-
overflow: hidden;
|
|
777
|
-
text-overflow: ellipsis;
|
|
778
|
-
white-space: nowrap;
|
|
779
|
-
`,meta:t`
|
|
780
|
-
display: flex;
|
|
781
|
-
align-items: center;
|
|
782
|
-
flex-wrap: wrap;
|
|
783
|
-
gap: 8px;
|
|
784
|
-
font-size: 12px;
|
|
785
|
-
color: ${e.colorTextSecondary};
|
|
786
|
-
`}));var dn=n(w());var ie=n(w());var nn=e=>{if(!e)return"";let t=e.split("/").filter(Boolean);return t[t.length-1]??""},ri=(e,t)=>{if(t==="name")return null;let o=t==="created"?e.created_at:e.modified_at;if(!o)return null;let r=Date.parse(o);return Number.isNaN(r)?null:r};function Lt(e,t="name",o="asc"){return[...e].sort((r,s)=>{if(!!r.is_dir!=!!s.is_dir)return r.is_dir?-1:1;if(t==="name"){let c=nn(r.path),p=nn(s.path);return o==="asc"?c.localeCompare(p):p.localeCompare(c)}let a=ri(r,t),d=ri(s,t);return a===null&&d===null?0:a===null?1:d===null?-1:o==="asc"?a-d:d-a})}function ii(e,t){let o=t.trim().toLowerCase();return o?e.filter(r=>{let s=(r.path||"").toLowerCase(),a=nn(r.path).toLowerCase();return s.includes(o)||a.includes(o)}):e}function ai(e){let t=[];return e.forEach(o=>{let r=(o.path||"").split("/").filter(Boolean);if(r.length===0)return;let s=t;r.forEach((a,d)=>{let c=d===r.length-1,p="/"+r.slice(0,d+1).join("/"),u=s.find(b=>b.path===p);u||(u=c?{...o,path:p,name:a}:{path:p,name:a,is_dir:!0,children:[]},s.push(u)),c||(s=u.children??(u.children=[]))})}),t}function rn(e,t="name",o="asc"){return Lt(e,t,o).map(r=>r.children?{...r,children:rn(r.children,t,o)}:r)}var h=n(i()),Ua=C(({token:e,css:t})=>({container:t`
|
|
787
|
-
height: 100%;
|
|
788
|
-
overflow-y: auto;
|
|
789
|
-
overflow-x: hidden;
|
|
790
|
-
padding: 12px;
|
|
791
|
-
font-size: 13px;
|
|
792
|
-
background: transparent;
|
|
793
|
-
`,header:t`
|
|
794
|
-
display: flex;
|
|
795
|
-
align-items: center;
|
|
796
|
-
gap: 8px;
|
|
797
|
-
margin-bottom: 12px;
|
|
798
|
-
padding: 0 4px;
|
|
799
|
-
font-size: 15px;
|
|
800
|
-
line-height: 1.4;
|
|
801
|
-
font-weight: 600;
|
|
802
|
-
color: ${e.colorText};
|
|
803
|
-
letter-spacing: -0.01em;
|
|
804
|
-
padding-bottom: 8px;
|
|
805
|
-
border-bottom: 1px solid ${e.colorBorderSecondary};
|
|
806
|
-
|
|
807
|
-
svg {
|
|
808
|
-
width: 16px;
|
|
809
|
-
height: 16px;
|
|
810
|
-
color: ${e.colorTextSecondary};
|
|
811
|
-
}
|
|
812
|
-
`,toolbar:t`
|
|
813
|
-
display: flex;
|
|
814
|
-
flex-direction: column;
|
|
815
|
-
gap: 6px;
|
|
816
|
-
margin-bottom: 12px;
|
|
817
|
-
`,toolbarRow:t`
|
|
818
|
-
display: flex;
|
|
819
|
-
align-items: center;
|
|
820
|
-
gap: 6px;
|
|
821
|
-
`,section:t`
|
|
822
|
-
margin-bottom: 12px;
|
|
823
|
-
`,sectionHeader:t`
|
|
824
|
-
display: flex;
|
|
825
|
-
align-items: center;
|
|
826
|
-
justify-content: space-between;
|
|
827
|
-
margin-bottom: 8px;
|
|
828
|
-
padding: 0 4px;
|
|
829
|
-
`,sectionTitle:t`
|
|
830
|
-
font-size: 10px;
|
|
831
|
-
font-weight: 600;
|
|
832
|
-
letter-spacing: 0.05em;
|
|
833
|
-
color: ${e.colorTextSecondary};
|
|
834
|
-
text-transform: uppercase;
|
|
835
|
-
cursor: pointer;
|
|
836
|
-
user-select: none;
|
|
837
|
-
transition: color 0.15s ease;
|
|
838
|
-
|
|
839
|
-
&:hover {
|
|
840
|
-
color: ${e.colorPrimary};
|
|
841
|
-
}
|
|
842
|
-
`,badge:t`
|
|
843
|
-
display: flex;
|
|
844
|
-
align-items: center;
|
|
845
|
-
justify-content: center;
|
|
846
|
-
min-width: 16px;
|
|
847
|
-
height: 16px;
|
|
848
|
-
padding: 0 4px;
|
|
849
|
-
border-radius: 8px;
|
|
850
|
-
background: ${e.colorFillSecondary};
|
|
851
|
-
font-size: 10px;
|
|
852
|
-
font-weight: 500;
|
|
853
|
-
color: ${e.colorTextSecondary};
|
|
854
|
-
`,assetList:t`
|
|
855
|
-
display: flex;
|
|
856
|
-
flex-direction: column;
|
|
857
|
-
gap: 2px;
|
|
858
|
-
`,assetItem:t`
|
|
859
|
-
display: flex;
|
|
860
|
-
align-items: center;
|
|
861
|
-
gap: 8px;
|
|
862
|
-
flex: 1;
|
|
863
|
-
min-width: 0;
|
|
864
|
-
padding: 5px 8px;
|
|
865
|
-
border-radius: 4px;
|
|
866
|
-
cursor: pointer;
|
|
867
|
-
transition: all 0.15s ease;
|
|
868
|
-
border: none;
|
|
869
|
-
background: transparent;
|
|
870
|
-
text-align: left;
|
|
871
|
-
|
|
872
|
-
&:hover {
|
|
873
|
-
background: ${e.colorBgTextHover};
|
|
874
|
-
}
|
|
875
|
-
`,treeRow:t`
|
|
876
|
-
display: flex;
|
|
877
|
-
align-items: center;
|
|
878
|
-
gap: 8px;
|
|
879
|
-
width: 100%;
|
|
880
|
-
`,treeIndent:t`
|
|
881
|
-
flex-shrink: 0;
|
|
882
|
-
width: 12px;
|
|
883
|
-
`,treeToggle:t`
|
|
884
|
-
display: inline-flex;
|
|
885
|
-
align-items: center;
|
|
886
|
-
justify-content: center;
|
|
887
|
-
width: 18px;
|
|
888
|
-
height: 18px;
|
|
889
|
-
padding: 0;
|
|
890
|
-
border: none;
|
|
891
|
-
border-radius: 4px;
|
|
892
|
-
background: transparent;
|
|
893
|
-
color: ${e.colorTextSecondary};
|
|
894
|
-
cursor: pointer;
|
|
895
|
-
|
|
896
|
-
&:hover {
|
|
897
|
-
background: ${e.colorBgTextHover};
|
|
898
|
-
color: ${e.colorText};
|
|
899
|
-
}
|
|
900
|
-
`,treeSpacer:t`
|
|
901
|
-
flex-shrink: 0;
|
|
902
|
-
width: 18px;
|
|
903
|
-
height: 18px;
|
|
904
|
-
`,assetIcon:t`
|
|
905
|
-
display: flex;
|
|
906
|
-
align-items: center;
|
|
907
|
-
justify-content: center;
|
|
908
|
-
width: 20px;
|
|
909
|
-
height: 20px;
|
|
910
|
-
border-radius: 4px;
|
|
911
|
-
background: rgba(0, 0, 0, 0.04);
|
|
912
|
-
|
|
913
|
-
svg {
|
|
914
|
-
width: 14px;
|
|
915
|
-
height: 14px;
|
|
916
|
-
}
|
|
917
|
-
`,assetInfo:t`
|
|
918
|
-
flex: 1;
|
|
919
|
-
min-width: 0;
|
|
920
|
-
`,assetName:t`
|
|
921
|
-
font-size: 12px;
|
|
922
|
-
font-weight: 500;
|
|
923
|
-
color: ${e.colorText};
|
|
924
|
-
white-space: nowrap;
|
|
925
|
-
overflow: hidden;
|
|
926
|
-
text-overflow: ellipsis;
|
|
927
|
-
`,assetMeta:t`
|
|
928
|
-
font-size: 10px;
|
|
929
|
-
color: ${e.colorTextSecondary};
|
|
930
|
-
`,treeChildren:t`
|
|
931
|
-
display: flex;
|
|
932
|
-
flex-direction: column;
|
|
933
|
-
gap: 2px;
|
|
934
|
-
`,emptyState:t`
|
|
935
|
-
padding: 12px;
|
|
936
|
-
text-align: center;
|
|
937
|
-
color: ${e.colorTextSecondary};
|
|
938
|
-
font-size: 12px;
|
|
939
|
-
`,loading:t`
|
|
940
|
-
padding: 12px;
|
|
941
|
-
text-align: center;
|
|
942
|
-
color: ${e.colorTextSecondary};
|
|
943
|
-
font-size: 12px;
|
|
944
|
-
`,uploadBtn:t`
|
|
945
|
-
display: flex;
|
|
946
|
-
align-items: center;
|
|
947
|
-
justify-content: center;
|
|
948
|
-
gap: 6px;
|
|
949
|
-
width: 100%;
|
|
950
|
-
padding: 8px;
|
|
951
|
-
margin-top: 6px;
|
|
952
|
-
border-radius: 6px;
|
|
953
|
-
border: 1px dashed ${e.colorBorder};
|
|
954
|
-
background: transparent;
|
|
955
|
-
cursor: pointer;
|
|
956
|
-
transition: all 0.15s ease;
|
|
957
|
-
font-size: 11px;
|
|
958
|
-
color: ${e.colorTextSecondary};
|
|
959
|
-
|
|
960
|
-
&:hover {
|
|
961
|
-
background: ${e.colorBgTextHover};
|
|
962
|
-
border-color: ${e.colorPrimary};
|
|
963
|
-
color: ${e.colorPrimary};
|
|
964
|
-
}
|
|
965
|
-
|
|
966
|
-
&:disabled {
|
|
967
|
-
cursor: not-allowed;
|
|
968
|
-
opacity: 0.5;
|
|
969
|
-
}
|
|
970
|
-
|
|
971
|
-
svg {
|
|
972
|
-
width: 14px;
|
|
973
|
-
height: 14px;
|
|
974
|
-
}
|
|
975
|
-
`})),si=e=>{if(!e)return"";let t=new Date(e);return Number.isNaN(t.getTime())?"":t.toLocaleString()},Ha=e=>{if(!e)return"";let t=e.split(/[/\\]/);return t[t.length-1]},an=e=>Ha(e.name||e.path),Ka=e=>(0,h.jsxs)("div",{children:[(0,h.jsx)("div",{style:{fontWeight:600},children:an(e)}),e.created_at?(0,h.jsxs)("div",{children:["Created: ",si(e.created_at)]}):null,e.modified_at?(0,h.jsxs)("div",{children:["Modified: ",si(e.modified_at)]}):null]}),qa={display:"flex",flexDirection:"column",gap:12},sn=({workspaceId:e,projectId:t,resourceFolders:o,folderEntries:r,folderLoading:s,directoryChildren:a,directoryLoading:d,directoryExpanded:c,uploadingFolder:p,onRefreshFolder:u,onUploadFolder:b,onToggleDirectory:x,onAssetClick:v})=>{let{styles:g}=Ua(),{message:m}=Fo.useApp(),{currentAssistant:f}=et(),{getFileDownloadUrl:W,downloadFolder:j,getDirectFileUrl:A,listPathByFolder:X}=Se(),{openSideApp:ee}=ke(),{currentTenant:pe}=Oe(),Q=pe?.id||"",[S,B]=(0,ie.useState)(null),[J,Z]=(0,ie.useState)(null),{check:E,pin:se,unpin:D,enableCustomMenu:$,get:le}=uo(),L=ln(),[R,I]=(0,ie.useState)(L);(0,ie.useEffect)(()=>{I(L)},[L]);let[T,ce]=(0,ie.useState)({}),[k,ne]=(0,ie.useState)(null),[F,U]=(0,ie.useState)(""),[We,He]=(0,ie.useState)(""),[Ze,ft]=(0,ie.useState)(!1),[rt,O]=(0,ie.useState)(""),[fe,it]=(0,ie.useState)("name"),[Ye,fa]=(0,ie.useState)("asc"),[Ht,No]=(0,ie.useState)(null),[ya,Mo]=(0,ie.useState)(!1);(0,ie.useEffect)(()=>{k&&cn(le).then(y=>{I(Array.from(new Set([...L,...y])).sort())})},[k]),(0,ie.useEffect)(()=>{let y=rt.trim();if(!y){No(null),Mo(!1);return}let Y=!1;return Mo(!0),$r(X,o.map(H=>H.name),f?.id).then(H=>{Y||No(ii(H,y))}).catch(()=>{Y||No([])}).finally(()=>{Y||Mo(!1)}),()=>{Y=!0}},[rt,X,o,f?.id]);let Bo=(0,ie.useMemo)(()=>Ht?rn(ai(Ht),fe,Ye):null,[Ht,fe,Ye]),Kt=(0,ie.useCallback)((y,Y)=>{if(!Y||!$)return;ce(_=>_[y]?_:{..._,[y]:{isPinned:!1,pinnedId:null,loading:!0}});let H={contentType:"file",contentConfig:{resourcePath:y,tenantId:Q,workspaceId:e||"",projectId:t||"",assistantId:f?.id||"",fileName:y.split("/").pop()||y},isMatch:_=>_.resourcePath===y};E(H).then(_=>{ce(Ke=>({...Ke,[y]:{..._,loading:!1}}))}).catch(()=>{ce(_=>({..._,[y]:{isPinned:!1,pinnedId:null,loading:!1}}))})},[$,E,f?.id]),ha=async()=>{if(!k||!F.trim()){m.warning("Please enter a menu name");return}ft(!0);try{let y=k.split("/").pop()||k;await se({contentType:"file",name:F.trim(),group:We.trim()||void 0,contentConfig:{resourcePath:k,tenantId:Q,workspaceId:e||"",projectId:t||"",assistantId:f?.id||"",fileName:y},isMatch:Y=>Y.resourcePath===k}),m.success("Pinned to menu"),window.dispatchEvent(new CustomEvent("menu:refresh")),ne(null),U(""),He(""),ce(Y=>{let H={...Y};return delete H[k],H})}catch(y){m.error(y.message||"Failed to pin")}finally{ft(!1)}},qt=(0,ie.useCallback)(async(y,Y)=>{ce(H=>({...H,[y]:{...H[y],loading:!0}}));try{await D(Y),m.success("Unpinned from menu"),window.dispatchEvent(new CustomEvent("menu:refresh")),ce(H=>({...H,[y]:{isPinned:!1,pinnedId:null,loading:!1}}))}catch(H){m.error(H.message||"Failed to unpin"),ce(_=>({..._,[y]:{..._[y],loading:!1}}))}},[D,m]),Hn=(0,ie.useCallback)(async y=>{Z(y);try{let Y=await j(y,f?.id),H=URL.createObjectURL(Y),_=document.createElement("a");_.href=H;let Ke=y.replace(/\/$/,"").split("/").pop()||"folder";_.download=`${Ke}.zip`,_.click(),window.setTimeout(()=>URL.revokeObjectURL(H),0)}catch(Y){m.error(Y instanceof Error?Y.message:"Failed to download folder")}finally{Z(null)}},[j,f?.id,m]),Do=ie.default.useCallback((y,Y)=>{let H=an(y);if(y.is_dir){let _=c[y.path]||!1,Ke=a[y.path]||[],ba=d[y.path]||!1;return(0,h.jsxs)("div",{className:g.treeChildren,children:[(0,h.jsxs)("div",{className:g.treeRow,children:[Array.from({length:Y}).map((Xe,va)=>(0,h.jsx)("span",{className:g.treeIndent},`${y.path}-indent-${va}`)),(0,h.jsx)("button",{type:"button",className:g.treeToggle,"aria-label":`${_?"collapse":"expand"} ${H}`,onClick:()=>void x(y.path),children:(0,h.jsx)(Mt,{size:14,style:{transform:_?"rotate(90deg)":void 0}})}),(0,h.jsxs)("button",{type:"button",className:g.assetItem,"aria-label":`toggle ${H}`,onClick:()=>void x(y.path),title:H,children:[(0,h.jsx)("div",{className:g.assetIcon,children:(0,h.jsx)(st,{size:14})}),(0,h.jsx)("div",{className:g.assetInfo,children:(0,h.jsx)("div",{className:g.assetName,children:H})})]}),(0,h.jsx)(qe,{trigger:["click"],onOpenChange:Xe=>Kt(y.path,Xe),menu:{items:[...$?T[y.path]?.isPinned?[{key:"unpin",icon:(0,h.jsx)(Ve,{size:14}),label:"Unpin from Menu",onClick:()=>{let Xe=T[y.path];Xe?.pinnedId&&qt(y.path,Xe.pinnedId)}}]:[{key:"pin",icon:(0,h.jsx)(Ve,{size:14}),label:"Pin to Menu",onClick:()=>{ne(y.path),U(H),He("")}}]:[],{key:"preview",icon:(0,h.jsx)(Qt,{}),label:"Preview",onClick:()=>{let Xe=A(y.path);Xe&&ee({component_key:"attachments",data:{file_id:y.path,url:Xe},message:H})}},{key:"share",icon:(0,h.jsx)(Yt,{}),label:"Share",onClick:()=>B(y.path)},{key:"download-folder",icon:(0,h.jsx)(Lo,{}),label:"Download",disabled:J===y.path,onClick:()=>{Hn(y.path)}}]},children:(0,h.jsx)(z,{type:"text",size:"small",icon:(0,h.jsx)(yt,{})})})]}),_?ba?(0,h.jsx)("div",{className:g.loading,children:(0,h.jsx)(re,{size:"small"})}):Ke.length>0?Lt(Ke,fe,Ye).map(Xe=>Do(Xe,Y+1)):(0,h.jsx)("div",{className:g.emptyState,children:"No files in this folder"}):null]},y.path)}return(0,h.jsxs)("div",{className:g.treeRow,children:[Array.from({length:Y}).map((_,Ke)=>(0,h.jsx)("span",{className:g.treeIndent},`${y.path}-indent-${Ke}`)),(0,h.jsx)("span",{className:g.treeSpacer}),(0,h.jsx)(je,{title:Ka(y),placement:"rightTop",children:(0,h.jsxs)("button",{type:"button",className:g.assetItem,onClick:()=>v(y),"aria-label":`open ${H}`,children:[(0,h.jsx)("div",{className:g.assetIcon,children:jr(H)}),(0,h.jsx)("div",{className:g.assetInfo,children:(0,h.jsx)("div",{className:g.assetName,children:H})})]})}),(0,h.jsx)(qe,{trigger:["click"],onOpenChange:_=>Kt(y.path,_),menu:{items:[...$?T[y.path]?.isPinned?[{key:"unpin",icon:(0,h.jsx)(Ve,{size:14}),label:"Unpin from Menu",onClick:()=>{let _=T[y.path];_?.pinnedId&&qt(y.path,_.pinnedId)}}]:[{key:"pin",icon:(0,h.jsx)(Ve,{size:14}),label:"Pin to Menu",onClick:()=>{ne(y.path),U(""),He("")}}]:[],{key:"preview",icon:(0,h.jsx)(Qt,{}),label:"Preview",onClick:()=>v(y)},{key:"download",icon:(0,h.jsx)(Lo,{}),label:"Download",onClick:()=>{let _=W(y.path,f?.id);window.open(_,"_blank")}},{key:"share",icon:(0,h.jsx)(Yt,{}),label:"Share",onClick:()=>B(y.path)}]},children:(0,h.jsx)(z,{type:"text",size:"small",icon:(0,h.jsx)(yt,{})})})]},y.path)},[a,c,d,v,x,g,W,j,f?.id,$,T,Kt,qt,J,Hn,fe,Ye]),Kn=(y,Y)=>{if(!y.is_dir)return Do(y,Y);let H=an(y);return(0,h.jsxs)("div",{className:g.treeChildren,children:[(0,h.jsxs)("div",{className:g.treeRow,children:[Array.from({length:Y}).map((_,Ke)=>(0,h.jsx)("span",{className:g.treeIndent},`${y.path}-indent-${Ke}`)),(0,h.jsx)("span",{className:g.treeSpacer}),(0,h.jsxs)("button",{type:"button",className:g.assetItem,title:H,children:[(0,h.jsx)("div",{className:g.assetIcon,children:(0,h.jsx)(st,{size:14})}),(0,h.jsx)("div",{className:g.assetInfo,children:(0,h.jsx)("div",{className:g.assetName,children:H})})]}),(0,h.jsx)(qe,{trigger:["click"],onOpenChange:_=>Kt(y.path,_),menu:{items:[...$?T[y.path]?.isPinned?[{key:"unpin",icon:(0,h.jsx)(Ve,{size:14}),label:"Unpin from Menu",onClick:()=>{let _=T[y.path];_?.pinnedId&&qt(y.path,_.pinnedId)}}]:[{key:"pin",icon:(0,h.jsx)(Ve,{size:14}),label:"Pin to Menu",onClick:()=>{ne(y.path),U(H),He("")}}]:[],{key:"preview",icon:(0,h.jsx)(Qt,{}),label:"Preview",onClick:()=>{let _=A(y.path);_&&ee({component_key:"attachments",data:{file_id:y.path,url:_},message:H})}},{key:"share",icon:(0,h.jsx)(Yt,{}),label:"Share",onClick:()=>B(y.path)}]},children:(0,h.jsx)(z,{type:"text",size:"small",icon:(0,h.jsx)(yt,{})})})]}),y.children&&y.children.length>0?Lt(y.children,fe,Ye).map(_=>Kn(_,Y+1)):null]},y.path)};return t?(0,h.jsxs)("div",{className:g.container,children:[(0,h.jsxs)("h3",{className:g.header,children:[(0,h.jsx)(st,{size:16}),(0,h.jsx)("span",{children:"Files"})]}),(0,h.jsxs)("div",{className:g.toolbar,children:[(0,h.jsx)(K,{size:"small",placeholder:"Search files\u2026",allowClear:!0,value:rt,onChange:y=>O(y.target.value)}),(0,h.jsxs)("div",{className:g.toolbarRow,children:[(0,h.jsx)(Me,{size:"small",style:{flex:1,minWidth:0},value:fe,onChange:y=>it(y),options:[{value:"name",label:"Name"},{value:"created",label:"Created"},{value:"modified",label:"Modified"}]}),(0,h.jsx)(z,{size:"small",icon:Ye==="asc"?(0,h.jsx)(Xt,{}):(0,h.jsx)(Jt,{}),onClick:()=>fa(y=>y==="asc"?"desc":"asc"),title:Ye==="asc"?"Ascending":"Descending"})]})]}),Ht!==null?(0,h.jsx)("div",{className:g.assetList,children:ya?(0,h.jsx)("div",{className:g.loading,children:(0,h.jsx)(re,{size:"small"})}):Bo&&Bo.length>0?Bo.map(y=>Kn(y,0)):(0,h.jsxs)("div",{className:g.emptyState,children:['No files match "',rt.trim(),'"']})}):o.map(y=>{let Y=r[y.name]||[],H=s[y.name]||!1,_=Y.length;return(0,h.jsxs)("div",{className:g.section,children:[(0,h.jsxs)("div",{className:g.sectionHeader,children:[(0,h.jsx)("span",{className:g.sectionTitle,onClick:()=>void u(y),title:"Click to refresh",children:y.displayName||y.name}),(0,h.jsx)("span",{className:g.badge,children:_})]}),H?(0,h.jsx)("div",{className:g.loading,children:(0,h.jsx)(re,{size:"small"})}):(0,h.jsxs)("div",{className:g.assetList,children:[Lt(Y,fe,Ye).map(Ke=>Do(Ke,0)),Y.length===0?(0,h.jsx)("div",{className:g.emptyState,children:"No files in this folder"}):null,y.allowUpload?(0,h.jsx)("button",{type:"button",className:g.uploadBtn,onClick:()=>void b(y.name),disabled:!e||!t||p===y.name,children:p===y.name?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(re,{size:"small"}),(0,h.jsx)("span",{children:"Uploading..."})]}):(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(Mr,{size:14}),(0,h.jsx)("span",{children:"Upload"})]})}):null]})]},y.name)}),S&&(0,h.jsx)(zr,{open:!!S,filePath:S,assistantId:f?.id,fileName:S.split("/").pop(),onClose:()=>B(null)}),(0,h.jsx)(me,{title:"Pin to Menu",open:!!k,onOk:ha,onCancel:()=>ne(null),confirmLoading:Ze,okText:"Pin",children:(0,h.jsxs)("div",{style:qa,children:[(0,h.jsx)(K,{placeholder:"Menu name (required)",value:F,onChange:y=>U(y.target.value)}),(0,h.jsx)(Vt,{placeholder:"Group (optional, select or type new)",value:We,options:R.map(y=>({value:y})),onChange:y=>He(y),filterOption:(y,Y)=>Y?.value?.toUpperCase().includes(y.toUpperCase())??!1})]})})]}):(0,h.jsx)("div",{className:g.emptyState,children:"Please select a project to browse files"})};var li=n(i());var nm=C(({token:e,css:t})=>({root:t`
|
|
976
|
-
display: flex;
|
|
977
|
-
flex-direction: column;
|
|
978
|
-
height: 100%;
|
|
979
|
-
overflow: hidden;
|
|
980
|
-
`,header:t`
|
|
981
|
-
display: flex;
|
|
982
|
-
align-items: center;
|
|
983
|
-
gap: 8px;
|
|
984
|
-
padding: 12px 12px 0 12px;
|
|
985
|
-
font-size: 15px;
|
|
986
|
-
line-height: 1.4;
|
|
987
|
-
font-weight: 600;
|
|
988
|
-
color: ${e.colorText};
|
|
989
|
-
letter-spacing: -0.01em;
|
|
990
|
-
|
|
991
|
-
svg {
|
|
992
|
-
width: 16px;
|
|
993
|
-
height: 16px;
|
|
994
|
-
color: ${e.colorTextSecondary};
|
|
995
|
-
}
|
|
996
|
-
`,content:t`
|
|
997
|
-
flex: 1;
|
|
998
|
-
min-height: 0;
|
|
999
|
-
overflow: hidden;
|
|
1000
|
-
`}));var ci=n(i());var Im=C(({token:e,css:t})=>({root:t`
|
|
1001
|
-
display: flex;
|
|
1002
|
-
flex-direction: column;
|
|
1003
|
-
height: 100%;
|
|
1004
|
-
min-height: 0;
|
|
1005
|
-
min-width: 0;
|
|
1006
|
-
overflow: hidden;
|
|
1007
|
-
background: ${e.colorBgContainer};
|
|
1008
|
-
`,liveRegion:t`
|
|
1009
|
-
position: absolute;
|
|
1010
|
-
width: 1px;
|
|
1011
|
-
height: 1px;
|
|
1012
|
-
margin: -1px;
|
|
1013
|
-
padding: 0;
|
|
1014
|
-
overflow: hidden;
|
|
1015
|
-
clip: rect(0 0 0 0);
|
|
1016
|
-
white-space: nowrap;
|
|
1017
|
-
border: 0;
|
|
1018
|
-
`,loading:t`
|
|
1019
|
-
flex: 1;
|
|
1020
|
-
display: flex;
|
|
1021
|
-
flex-direction: column;
|
|
1022
|
-
align-items: center;
|
|
1023
|
-
justify-content: center;
|
|
1024
|
-
gap: 14px;
|
|
1025
|
-
padding: 24px;
|
|
1026
|
-
`,loadingDots:t`
|
|
1027
|
-
display: inline-flex;
|
|
1028
|
-
align-items: center;
|
|
1029
|
-
gap: 6px;
|
|
1030
|
-
|
|
1031
|
-
span {
|
|
1032
|
-
width: 8px;
|
|
1033
|
-
height: 8px;
|
|
1034
|
-
border-radius: 50%;
|
|
1035
|
-
background: ${e.colorPrimary};
|
|
1036
|
-
animation: room-loading-pulse 1.2s ease-in-out infinite;
|
|
1037
|
-
|
|
1038
|
-
&:nth-child(2) {
|
|
1039
|
-
animation-delay: 0.15s;
|
|
1040
|
-
}
|
|
1041
|
-
|
|
1042
|
-
&:nth-child(3) {
|
|
1043
|
-
animation-delay: 0.3s;
|
|
1044
|
-
}
|
|
1045
|
-
}
|
|
1046
|
-
|
|
1047
|
-
@keyframes room-loading-pulse {
|
|
1048
|
-
0%,
|
|
1049
|
-
80%,
|
|
1050
|
-
100% {
|
|
1051
|
-
opacity: 0.25;
|
|
1052
|
-
transform: translateY(0);
|
|
1053
|
-
}
|
|
1054
|
-
|
|
1055
|
-
40% {
|
|
1056
|
-
opacity: 1;
|
|
1057
|
-
transform: translateY(-4px);
|
|
1058
|
-
}
|
|
1059
|
-
}
|
|
1060
|
-
`,loadingText:t`
|
|
1061
|
-
font-size: 13px;
|
|
1062
|
-
color: ${e.colorTextSecondary};
|
|
1063
|
-
`,main:t`
|
|
1064
|
-
display: flex;
|
|
1065
|
-
flex-direction: column;
|
|
1066
|
-
flex: 1;
|
|
1067
|
-
min-height: 0;
|
|
1068
|
-
min-width: 0;
|
|
1069
|
-
`,thinking:t`
|
|
1070
|
-
display: flex;
|
|
1071
|
-
align-items: center;
|
|
1072
|
-
gap: 8px;
|
|
1073
|
-
padding: 2px 12px 6px;
|
|
1074
|
-
font-size: 12px;
|
|
1075
|
-
color: ${e.colorTextSecondary};
|
|
1076
|
-
`,backButton:t`
|
|
1077
|
-
width: 40px;
|
|
1078
|
-
height: 40px;
|
|
1079
|
-
display: flex;
|
|
1080
|
-
align-items: center;
|
|
1081
|
-
justify-content: center;
|
|
1082
|
-
border: none;
|
|
1083
|
-
background: transparent;
|
|
1084
|
-
color: ${e.colorText};
|
|
1085
|
-
cursor: pointer;
|
|
1086
|
-
padding: 0;
|
|
1087
|
-
margin-left: -8px;
|
|
1088
|
-
`}));var Xa=n(i()),zm=C(({css:e})=>({wrapper:e`
|
|
1089
|
-
height: 100%;
|
|
1090
|
-
width: 100%;
|
|
1091
|
-
overflow: hidden;
|
|
1092
|
-
`}));var di=n(i()),qm=C(({token:e,css:t})=>({menuList:t`
|
|
1093
|
-
height: 100%;
|
|
1094
|
-
overflow-y: auto;
|
|
1095
|
-
`,empty:t`
|
|
1096
|
-
display: flex;
|
|
1097
|
-
flex-direction: column;
|
|
1098
|
-
align-items: center;
|
|
1099
|
-
justify-content: center;
|
|
1100
|
-
height: 100%;
|
|
1101
|
-
color: ${e.colorTextSecondary};
|
|
1102
|
-
font-size: 14px;
|
|
1103
|
-
gap: 8px;
|
|
1104
|
-
`,mobileRoot:t`
|
|
1105
|
-
display: flex;
|
|
1106
|
-
flex-direction: column;
|
|
1107
|
-
height: 100%;
|
|
1108
|
-
overflow: hidden;
|
|
1109
|
-
`,mobileBody:t`
|
|
1110
|
-
flex: 1;
|
|
1111
|
-
min-height: 0;
|
|
1112
|
-
overflow: hidden;
|
|
1113
|
-
`}));var ui=n(w());var mn=n(w());var pi=n(i()),eu=C(({token:e,css:t})=>({container:t`
|
|
1114
|
-
display: flex;
|
|
1115
|
-
flex-direction: column;
|
|
1116
|
-
height: 100%;
|
|
1117
|
-
`,loading:t`
|
|
1118
|
-
display: flex;
|
|
1119
|
-
align-items: center;
|
|
1120
|
-
justify-content: center;
|
|
1121
|
-
padding: 24px;
|
|
1122
|
-
`,group:t`
|
|
1123
|
-
margin-bottom: 8px;
|
|
1124
|
-
`,groupTitle:t`
|
|
1125
|
-
padding: 8px 16px;
|
|
1126
|
-
font-size: 12px;
|
|
1127
|
-
font-weight: 600;
|
|
1128
|
-
color: ${e.colorTextSecondary};
|
|
1129
|
-
text-transform: uppercase;
|
|
1130
|
-
letter-spacing: 0.5px;
|
|
1131
|
-
`,list:t`
|
|
1132
|
-
display: flex;
|
|
1133
|
-
flex-direction: column;
|
|
1134
|
-
`,item:t`
|
|
1135
|
-
display: flex;
|
|
1136
|
-
align-items: center;
|
|
1137
|
-
gap: 12px;
|
|
1138
|
-
padding: 10px 16px;
|
|
1139
|
-
cursor: pointer;
|
|
1140
|
-
transition: background 0.15s ease;
|
|
1141
|
-
border-left: 3px solid transparent;
|
|
1142
|
-
|
|
1143
|
-
&:hover {
|
|
1144
|
-
background: ${e.colorFillSecondary};
|
|
1145
|
-
}
|
|
1146
|
-
|
|
1147
|
-
&.selected {
|
|
1148
|
-
background: ${e.colorPrimaryBg};
|
|
1149
|
-
border-left-color: ${e.colorPrimary};
|
|
1150
|
-
}
|
|
1151
|
-
`,avatar:t`
|
|
1152
|
-
width: 40px;
|
|
1153
|
-
height: 40px;
|
|
1154
|
-
border-radius: 10px;
|
|
1155
|
-
display: flex;
|
|
1156
|
-
align-items: center;
|
|
1157
|
-
justify-content: center;
|
|
1158
|
-
flex-shrink: 0;
|
|
1159
|
-
background: ${e.colorFillSecondary};
|
|
1160
|
-
color: ${e.colorTextSecondary};
|
|
1161
|
-
`,avatarBot:t`
|
|
1162
|
-
background: ${e.colorInfoBg};
|
|
1163
|
-
color: ${e.colorInfo};
|
|
1164
|
-
`,avatarMember:t`
|
|
1165
|
-
background: ${e.colorSuccessBg};
|
|
1166
|
-
color: ${e.colorSuccess};
|
|
1167
|
-
`,itemContent:t`
|
|
1168
|
-
flex: 1;
|
|
1169
|
-
min-width: 0;
|
|
1170
|
-
overflow: hidden;
|
|
1171
|
-
`,itemName:t`
|
|
1172
|
-
margin: 0 0 2px 0;
|
|
1173
|
-
font-size: 14px;
|
|
1174
|
-
font-weight: 500;
|
|
1175
|
-
color: ${e.colorText};
|
|
1176
|
-
white-space: nowrap;
|
|
1177
|
-
overflow: hidden;
|
|
1178
|
-
text-overflow: ellipsis;
|
|
1179
|
-
`,itemRole:t`
|
|
1180
|
-
margin: 0;
|
|
1181
|
-
font-size: 12px;
|
|
1182
|
-
color: ${e.colorTextSecondary};
|
|
1183
|
-
white-space: nowrap;
|
|
1184
|
-
overflow: hidden;
|
|
1185
|
-
text-overflow: ellipsis;
|
|
1186
|
-
`,itemMeta:t`
|
|
1187
|
-
display: flex;
|
|
1188
|
-
align-items: center;
|
|
1189
|
-
gap: 4px;
|
|
1190
|
-
font-size: 11px;
|
|
1191
|
-
color: ${e.colorTextTertiary};
|
|
1192
|
-
flex-shrink: 0;
|
|
1193
|
-
`,chatIcon:t`
|
|
1194
|
-
display: flex;
|
|
1195
|
-
align-items: center;
|
|
1196
|
-
justify-content: center;
|
|
1197
|
-
color: ${e.colorPrimary};
|
|
1198
|
-
`,emptyContainer:t`
|
|
1199
|
-
padding: 24px 16px;
|
|
1200
|
-
`}));var mi=n(i()),nu=C(({token:e,css:t})=>({container:t`
|
|
1201
|
-
display: flex;
|
|
1202
|
-
flex-direction: column;
|
|
1203
|
-
height: 100%;
|
|
1204
|
-
background: ${e.colorBgContainer};
|
|
1205
|
-
`,header:t`
|
|
1206
|
-
display: flex;
|
|
1207
|
-
align-items: flex-start;
|
|
1208
|
-
justify-content: space-between;
|
|
1209
|
-
padding: 24px;
|
|
1210
|
-
border-bottom: 1px solid ${e.colorBorderSecondary};
|
|
1211
|
-
`,headerInfo:t`
|
|
1212
|
-
display: flex;
|
|
1213
|
-
gap: 16px;
|
|
1214
|
-
align-items: center;
|
|
1215
|
-
`,avatar:t`
|
|
1216
|
-
width: 64px;
|
|
1217
|
-
height: 64px;
|
|
1218
|
-
border-radius: 16px;
|
|
1219
|
-
display: flex;
|
|
1220
|
-
align-items: center;
|
|
1221
|
-
justify-content: center;
|
|
1222
|
-
flex-shrink: 0;
|
|
1223
|
-
`,avatarBot:t`
|
|
1224
|
-
background: ${e.colorInfoBg};
|
|
1225
|
-
color: ${e.colorInfo};
|
|
1226
|
-
`,avatarMember:t`
|
|
1227
|
-
background: ${e.colorSuccessBg};
|
|
1228
|
-
color: ${e.colorSuccess};
|
|
1229
|
-
`,headerText:t`
|
|
1230
|
-
display: flex;
|
|
1231
|
-
flex-direction: column;
|
|
1232
|
-
gap: 6px;
|
|
1233
|
-
`,name:t`
|
|
1234
|
-
margin: 0;
|
|
1235
|
-
font-size: 20px;
|
|
1236
|
-
font-weight: 600;
|
|
1237
|
-
color: ${e.colorText};
|
|
1238
|
-
`,subtitle:t`
|
|
1239
|
-
margin: 0;
|
|
1240
|
-
font-size: 14px;
|
|
1241
|
-
color: ${e.colorTextSecondary};
|
|
1242
|
-
`,description:t`
|
|
1243
|
-
margin: 4px 0 0 0;
|
|
1244
|
-
font-size: 13px;
|
|
1245
|
-
color: ${e.colorTextSecondary};
|
|
1246
|
-
max-width: 420px;
|
|
1247
|
-
`,statusActive:t`
|
|
1248
|
-
background: ${e.colorSuccessBg};
|
|
1249
|
-
color: ${e.colorSuccess};
|
|
1250
|
-
border-color: ${e.colorSuccess};
|
|
1251
|
-
`,statusPaused:t`
|
|
1252
|
-
background: ${e.colorWarningBg};
|
|
1253
|
-
color: ${e.colorWarning};
|
|
1254
|
-
border-color: ${e.colorWarning};
|
|
1255
|
-
`,statusRemoved:t`
|
|
1256
|
-
background: ${e.colorErrorBg};
|
|
1257
|
-
color: ${e.colorError};
|
|
1258
|
-
border-color: ${e.colorError};
|
|
1259
|
-
`,closeButton:t`
|
|
1260
|
-
padding: 8px;
|
|
1261
|
-
border: none;
|
|
1262
|
-
background: transparent;
|
|
1263
|
-
color: ${e.colorTextSecondary};
|
|
1264
|
-
cursor: pointer;
|
|
1265
|
-
border-radius: 8px;
|
|
1266
|
-
display: flex;
|
|
1267
|
-
align-items: center;
|
|
1268
|
-
justify-content: center;
|
|
1269
|
-
&:hover {
|
|
1270
|
-
background: ${e.colorFillQuaternary};
|
|
1271
|
-
color: ${e.colorText};
|
|
1272
|
-
}
|
|
1273
|
-
`,content:t`
|
|
1274
|
-
flex: 1;
|
|
1275
|
-
padding: 24px;
|
|
1276
|
-
overflow-y: auto;
|
|
1277
|
-
display: flex;
|
|
1278
|
-
flex-direction: column;
|
|
1279
|
-
gap: 24px;
|
|
1280
|
-
`,sectionTitle:t`
|
|
1281
|
-
font-size: 13px;
|
|
1282
|
-
font-weight: 600;
|
|
1283
|
-
color: ${e.colorTextSecondary};
|
|
1284
|
-
text-transform: uppercase;
|
|
1285
|
-
letter-spacing: 0.5px;
|
|
1286
|
-
margin-bottom: 12px;
|
|
1287
|
-
`,footer:t`
|
|
1288
|
-
padding: 16px 24px;
|
|
1289
|
-
border-top: 1px solid ${e.colorBorderSecondary};
|
|
1290
|
-
display: flex;
|
|
1291
|
-
flex-direction: column;
|
|
1292
|
-
gap: 12px;
|
|
1293
|
-
`}));var un=n(i()),fu=C(({token:e,css:t})=>({menuList:t`
|
|
1294
|
-
height: 100%;
|
|
1295
|
-
overflow-y: auto;
|
|
1296
|
-
`,header:t`
|
|
1297
|
-
display: flex;
|
|
1298
|
-
align-items: center;
|
|
1299
|
-
gap: 8px;
|
|
1300
|
-
padding: 0 4px;
|
|
1301
|
-
`,headerTitle:t`
|
|
1302
|
-
margin: 0;
|
|
1303
|
-
font-size: 15px;
|
|
1304
|
-
font-weight: 600;
|
|
1305
|
-
color: ${e.colorText};
|
|
1306
|
-
white-space: nowrap;
|
|
1307
|
-
overflow: hidden;
|
|
1308
|
-
text-overflow: ellipsis;
|
|
1309
|
-
`,empty:t`
|
|
1310
|
-
display: flex;
|
|
1311
|
-
flex-direction: column;
|
|
1312
|
-
align-items: center;
|
|
1313
|
-
justify-content: center;
|
|
1314
|
-
height: 100%;
|
|
1315
|
-
color: ${e.colorTextSecondary};
|
|
1316
|
-
font-size: 14px;
|
|
1317
|
-
gap: 8px;
|
|
1318
|
-
`,mobileRoot:t`
|
|
1319
|
-
display: flex;
|
|
1320
|
-
flex-direction: column;
|
|
1321
|
-
height: 100%;
|
|
1322
|
-
overflow: hidden;
|
|
1323
|
-
`,mobileHeader:t`
|
|
1324
|
-
display: flex;
|
|
1325
|
-
align-items: center;
|
|
1326
|
-
gap: 4px;
|
|
1327
|
-
flex-shrink: 0;
|
|
1328
|
-
min-height: 48px;
|
|
1329
|
-
padding: 0 8px;
|
|
1330
|
-
border-bottom: 1px solid ${e.colorBorderSecondary};
|
|
1331
|
-
`,backButton:t`
|
|
1332
|
-
width: 44px;
|
|
1333
|
-
height: 44px;
|
|
1334
|
-
display: flex;
|
|
1335
|
-
align-items: center;
|
|
1336
|
-
justify-content: center;
|
|
1337
|
-
border: none;
|
|
1338
|
-
background: transparent;
|
|
1339
|
-
color: ${e.colorText};
|
|
1340
|
-
cursor: pointer;
|
|
1341
|
-
`,mobileBody:t`
|
|
1342
|
-
flex: 1;
|
|
1343
|
-
min-height: 0;
|
|
1344
|
-
overflow: hidden;
|
|
1345
|
-
`}));var fi=n(i()),Eu=C(({token:e,css:t})=>({outer:t`
|
|
1346
|
-
display: flex;
|
|
1347
|
-
flex-direction: column;
|
|
1348
|
-
height: 100%;
|
|
1349
|
-
width: 100%;
|
|
1350
|
-
min-height: 0;
|
|
1351
|
-
overflow: hidden;
|
|
1352
|
-
`,inner:t`
|
|
1353
|
-
flex: 1;
|
|
1354
|
-
min-height: 0;
|
|
1355
|
-
overflow: hidden;
|
|
1356
|
-
`,iconNav:t`
|
|
1357
|
-
display: flex;
|
|
1358
|
-
flex-direction: column;
|
|
1359
|
-
align-items: center;
|
|
1360
|
-
gap: 8px;
|
|
1361
|
-
height: 100%;
|
|
1362
|
-
width: 100%;
|
|
1363
|
-
`,logo:t`
|
|
1364
|
-
width: 40px;
|
|
1365
|
-
height: 40px;
|
|
1366
|
-
border-radius: 10px;
|
|
1367
|
-
background: linear-gradient(135deg, #6366f1 0%, #818cf8 100%);
|
|
1368
|
-
display: flex;
|
|
1369
|
-
align-items: center;
|
|
1370
|
-
justify-content: center;
|
|
1371
|
-
color: #fff;
|
|
1372
|
-
font-weight: 600;
|
|
1373
|
-
font-size: 16px;
|
|
1374
|
-
margin-bottom: 8px;
|
|
1375
|
-
`,iconButton:t`
|
|
1376
|
-
width: 40px;
|
|
1377
|
-
height: 40px;
|
|
1378
|
-
border-radius: 10px;
|
|
1379
|
-
display: flex;
|
|
1380
|
-
align-items: center;
|
|
1381
|
-
justify-content: center;
|
|
1382
|
-
cursor: pointer;
|
|
1383
|
-
transition: all 0.15s ease;
|
|
1384
|
-
color: ${e.colorTextSecondary};
|
|
1385
|
-
|
|
1386
|
-
&:hover {
|
|
1387
|
-
background: ${e.colorFillSecondary};
|
|
1388
|
-
color: ${e.colorText};
|
|
1389
|
-
}
|
|
1390
|
-
|
|
1391
|
-
&.active {
|
|
1392
|
-
background: ${e.colorPrimaryBg};
|
|
1393
|
-
color: ${e.colorPrimary};
|
|
1394
|
-
}
|
|
1395
|
-
`,page:t`
|
|
1396
|
-
height: 100%;
|
|
1397
|
-
width: 100%;
|
|
1398
|
-
overflow: hidden;
|
|
1399
|
-
`,mobileRoot:t`
|
|
1400
|
-
display: flex;
|
|
1401
|
-
flex-direction: column;
|
|
1402
|
-
height: 100%;
|
|
1403
|
-
width: 100%;
|
|
1404
|
-
overflow: hidden;
|
|
1405
|
-
`,mobilePage:t`
|
|
1406
|
-
flex: 1;
|
|
1407
|
-
min-height: 0;
|
|
1408
|
-
overflow: hidden;
|
|
1409
|
-
`,tabBar:t`
|
|
1410
|
-
display: flex;
|
|
1411
|
-
flex-shrink: 0;
|
|
1412
|
-
border-top: 1px solid ${e.colorBorderSecondary};
|
|
1413
|
-
background: ${e.colorBgContainer};
|
|
1414
|
-
padding-bottom: env(safe-area-inset-bottom);
|
|
1415
|
-
`,tabButton:t`
|
|
1416
|
-
flex: 1;
|
|
1417
|
-
min-height: 48px;
|
|
1418
|
-
display: flex;
|
|
1419
|
-
flex-direction: column;
|
|
1420
|
-
align-items: center;
|
|
1421
|
-
justify-content: center;
|
|
1422
|
-
gap: 2px;
|
|
1423
|
-
border: none;
|
|
1424
|
-
background: transparent;
|
|
1425
|
-
cursor: pointer;
|
|
1426
|
-
color: ${e.colorTextSecondary};
|
|
1427
|
-
font-size: 11px;
|
|
1428
|
-
|
|
1429
|
-
&.active {
|
|
1430
|
-
color: ${e.colorPrimary};
|
|
1431
|
-
}
|
|
1432
|
-
`}));var ls=n(i());var Wt=n(w());var go=18,Uu={agent:Wt.default.createElement(Nt,{size:go}),html:Wt.default.createElement(wr,{size:go}),custom:Wt.default.createElement(Ar,{size:go}),file:Wt.default.createElement(vr,{size:go})};var xs=n(w());var cs=n(w());var yi=n(i());var Ii=n(w());var fo=n(w());var pt=n(w());function hi(e){let{get:t}=ue(),[o,r]=(0,pt.useState)(null),[s,a]=(0,pt.useState)(!0),[d,c]=(0,pt.useState)(!1);(0,pt.useEffect)(()=>{let b=!0,x=e||"/api/middleware-types";return a(!0),c(!1),r(null),t(x).then(v=>{if(!b)return;if(!Array.isArray(v)||v.length===0){c(!0);return}let g=v.map(m=>({type:m.type,name:m.name,description:m.description,icon:m.icon,tools:Array.isArray(m.tools)?m.tools.map(f=>({id:f.name,name:f.name,description:f.description})):[],schema:m.configSchema,defaultConfig:m.defaultConfig||{},category:m.category,capabilityBundleEligible:m.capabilityBundleEligible===!0,connectionSchema:m.connectionSchema?{fields:m.connectionSchema.fields,hasTest:m.connectionSchema.hasTest,hasDiscover:m.connectionSchema.hasDiscover,resourceLabel:m.connectionSchema.resourceLabel}:void 0}));r(g)}).catch(()=>{b&&c(!0)}).finally(()=>{b&&a(!1)}),()=>{b=!1}},[e,t]);let p=new Set(["topology"]);return{middlewareTypes:(0,pt.useMemo)(()=>(o||er).filter(b=>!p.has(b.type)),[o]),isLoading:s,isFallback:d}}var bi=C(({token:e,css:t})=>({nav:t`
|
|
1433
|
-
width: clamp(180px, 20vw, 240px);
|
|
1434
|
-
flex-shrink: 0;
|
|
1435
|
-
border-right: 1px solid ${e.colorBorderSecondary};
|
|
1436
|
-
padding: 24px 16px;
|
|
1437
|
-
display: flex;
|
|
1438
|
-
flex-direction: column;
|
|
1439
|
-
gap: 4px;
|
|
1440
|
-
background: ${e.colorBgContainer};
|
|
1441
|
-
overflow-y: auto;
|
|
1442
|
-
|
|
1443
|
-
@media (max-width: 720px) {
|
|
1444
|
-
width: 100%;
|
|
1445
|
-
flex-direction: row;
|
|
1446
|
-
padding: 10px 12px;
|
|
1447
|
-
border-right: 0;
|
|
1448
|
-
border-bottom: 1px solid ${e.colorBorderSecondary};
|
|
1449
|
-
overflow-x: auto;
|
|
1450
|
-
overflow-y: hidden;
|
|
1451
|
-
}
|
|
1452
|
-
`,navItem:t`
|
|
1453
|
-
display: flex;
|
|
1454
|
-
align-items: center;
|
|
1455
|
-
gap: 12px;
|
|
1456
|
-
padding: 12px 14px;
|
|
1457
|
-
border-radius: 10px;
|
|
1458
|
-
cursor: pointer;
|
|
1459
|
-
transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
|
|
1460
|
-
border-left: 3px solid transparent;
|
|
1461
|
-
color: ${e.colorTextSecondary};
|
|
1462
|
-
font-size: 14px;
|
|
1463
|
-
width: 100%;
|
|
1464
|
-
text-align: left;
|
|
1465
|
-
background: transparent;
|
|
1466
|
-
border-top: 0;
|
|
1467
|
-
border-right: 0;
|
|
1468
|
-
border-bottom: 0;
|
|
1469
|
-
|
|
1470
|
-
@media (max-width: 720px) {
|
|
1471
|
-
width: auto;
|
|
1472
|
-
flex-shrink: 0;
|
|
1473
|
-
white-space: nowrap;
|
|
1474
|
-
border-left: 0;
|
|
1475
|
-
border-bottom: 3px solid transparent;
|
|
1476
|
-
|
|
1477
|
-
&.active {
|
|
1478
|
-
border-left-color: transparent;
|
|
1479
|
-
border-bottom-color: ${e.colorPrimary};
|
|
1480
|
-
}
|
|
1481
|
-
}
|
|
1482
|
-
|
|
1483
|
-
&:hover {
|
|
1484
|
-
background: ${e.colorFillTertiary};
|
|
1485
|
-
color: ${e.colorText};
|
|
1486
|
-
}
|
|
1487
|
-
|
|
1488
|
-
&.active {
|
|
1489
|
-
background: ${e.colorPrimaryBg};
|
|
1490
|
-
border-left-color: ${e.colorPrimary};
|
|
1491
|
-
color: ${e.colorPrimary};
|
|
1492
|
-
font-weight: 500;
|
|
1493
|
-
}
|
|
1494
|
-
`,navBadge:t`
|
|
1495
|
-
margin-left: auto;
|
|
1496
|
-
`,navSub:t`
|
|
1497
|
-
display: flex;
|
|
1498
|
-
flex-direction: column;
|
|
1499
|
-
gap: 2px;
|
|
1500
|
-
margin: 2px 0 6px;
|
|
1501
|
-
|
|
1502
|
-
@media (max-width: 720px) {
|
|
1503
|
-
flex-direction: row;
|
|
1504
|
-
flex-shrink: 0;
|
|
1505
|
-
}
|
|
1506
|
-
`,navGroupLabel:t`
|
|
1507
|
-
font-size: 12px;
|
|
1508
|
-
color: ${e.colorTextTertiary};
|
|
1509
|
-
padding: 8px 14px 2px 28px;
|
|
1510
|
-
white-space: nowrap;
|
|
1511
|
-
overflow: hidden;
|
|
1512
|
-
text-overflow: ellipsis;
|
|
1513
|
-
`,navSubItem:t`
|
|
1514
|
-
display: flex;
|
|
1515
|
-
align-items: center;
|
|
1516
|
-
gap: 8px;
|
|
1517
|
-
padding: 7px 14px 7px 28px;
|
|
1518
|
-
border-radius: 8px;
|
|
1519
|
-
cursor: pointer;
|
|
1520
|
-
font-size: 13px;
|
|
1521
|
-
color: ${e.colorTextSecondary};
|
|
1522
|
-
transition: all 0.15s ease;
|
|
1523
|
-
white-space: nowrap;
|
|
1524
|
-
overflow: hidden;
|
|
1525
|
-
text-overflow: ellipsis;
|
|
1526
|
-
width: 100%;
|
|
1527
|
-
text-align: left;
|
|
1528
|
-
background: transparent;
|
|
1529
|
-
border: 0;
|
|
1530
|
-
|
|
1531
|
-
&:hover {
|
|
1532
|
-
background: ${e.colorFillTertiary};
|
|
1533
|
-
color: ${e.colorText};
|
|
1534
|
-
}
|
|
1535
|
-
|
|
1536
|
-
&.active {
|
|
1537
|
-
background: ${e.colorPrimaryBg};
|
|
1538
|
-
color: ${e.colorPrimary};
|
|
1539
|
-
font-weight: 500;
|
|
1540
|
-
}
|
|
1541
|
-
`,navStatusDot:t`
|
|
1542
|
-
width: 6px;
|
|
1543
|
-
height: 6px;
|
|
1544
|
-
border-radius: 9999px;
|
|
1545
|
-
flex-shrink: 0;
|
|
1546
|
-
`}));var vi=n(i()),{Text:tg}=P;var ge=n(w());var mt=n(w());var $e=n(i()),{Text:xi}=P,wi=({connectionType:e,value:t=[],onChange:o})=>{let{token:r}=Le.useToken(),{get:s}=ue(),[a,d]=(0,mt.useState)([]),[c,p]=(0,mt.useState)(!0),u=(0,mt.useRef)(e),b=(0,mt.useRef)(o);b.current=o,(0,mt.useEffect)(()=>{let v=!0;return u.current!==e&&(u.current=e,b.current([])),d([]),p(!0),s(`/api/connections?type=${encodeURIComponent(e)}`).then(g=>{v&&(Array.isArray(g)?d(g):g?.data?.records&&d(g.data.records))}).catch(()=>{v&&d([])}).finally(()=>{v&&p(!1)}),()=>{v=!1}},[e,s]);let x=new Set(t);return c?(0,$e.jsx)("div",{style:{textAlign:"center",padding:20},children:(0,$e.jsx)(re,{size:"small"})}):a.length===0?(0,$e.jsx)(xe,{description:`No "${e}" connections`,image:xe.PRESENTED_IMAGE_SIMPLE}):(0,$e.jsxs)("div",{children:[(0,$e.jsxs)(de,{style:{marginBottom:8},children:[(0,$e.jsx)(z,{size:"small",onClick:()=>o(a.map(v=>v.key)),children:"Select All"}),(0,$e.jsx)(z,{size:"small",onClick:()=>o([]),children:"Deselect All"})]}),(0,$e.jsx)(Pe,{size:"small",style:{maxHeight:"30vh",overflowY:"auto"},children:a.map(v=>(0,$e.jsx)(Pe.Item,{style:{padding:"6px 8px",cursor:"pointer",borderRadius:r.borderRadius,backgroundColor:x.has(v.key)?r.colorPrimaryBg:"transparent",border:`1px solid ${x.has(v.key)?r.colorPrimary:"transparent"}`,marginBottom:4},onClick:()=>{x.has(v.key)?o(t.filter(g=>g!==v.key)):o([...t,v.key])},children:(0,$e.jsx)(Pe.Item.Meta,{avatar:(0,$e.jsx)(_e,{checked:x.has(v.key)}),title:(0,$e.jsx)(xi,{style:{fontSize:12},children:v.name}),description:v.description?(0,$e.jsx)(xi,{type:"secondary",style:{fontSize:10},children:v.description}):void 0})},v.key))})]})};var l=n(i()),{Text:we}=P,gn=C(({token:e,css:t})=>({pageHeader:t`
|
|
1547
|
-
display: flex;
|
|
1548
|
-
align-items: center;
|
|
1549
|
-
gap: 16px;
|
|
1550
|
-
padding-bottom: 20px;
|
|
1551
|
-
border-bottom: 1px solid ${e.colorBorderSecondary};
|
|
1552
|
-
margin-bottom: 24px;
|
|
1553
|
-
`,pageIcon:t`
|
|
1554
|
-
width: 48px;
|
|
1555
|
-
height: 48px;
|
|
1556
|
-
border-radius: 12px;
|
|
1557
|
-
background: ${e.colorPrimaryBg};
|
|
1558
|
-
display: flex;
|
|
1559
|
-
align-items: center;
|
|
1560
|
-
justify-content: center;
|
|
1561
|
-
font-size: 22px;
|
|
1562
|
-
flex-shrink: 0;
|
|
1563
|
-
`,pageName:t`
|
|
1564
|
-
font-size: 20px;
|
|
1565
|
-
font-weight: 600;
|
|
1566
|
-
color: ${e.colorText};
|
|
1567
|
-
margin: 0;
|
|
1568
|
-
`,pageDesc:t`
|
|
1569
|
-
font-size: 13px;
|
|
1570
|
-
color: ${e.colorTextSecondary};
|
|
1571
|
-
margin: 4px 0 0;
|
|
1572
|
-
`,blockTitle:t`
|
|
1573
|
-
font-size: 14px;
|
|
1574
|
-
font-weight: 600;
|
|
1575
|
-
color: ${e.colorTextSecondary};
|
|
1576
|
-
margin: 0;
|
|
1577
|
-
`,selectedCard:t`
|
|
1578
|
-
border-color: ${e.colorPrimary} !important;
|
|
1579
|
-
background: ${e.colorPrimaryBg} !important;
|
|
1580
|
-
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
|
|
1581
|
-
`,dataSection:t`
|
|
1582
|
-
border-top: 1px solid ${e.colorBorderSecondary};
|
|
1583
|
-
margin-top: 16px;
|
|
1584
|
-
padding-top: 16px;
|
|
1585
|
-
`,dataSectionHeader:t`
|
|
1586
|
-
display: flex;
|
|
1587
|
-
align-items: center;
|
|
1588
|
-
justify-content: space-between;
|
|
1589
|
-
gap: 8px;
|
|
1590
|
-
margin-bottom: 10px;
|
|
1591
|
-
`,dataList:t`
|
|
1592
|
-
max-height: 240px;
|
|
1593
|
-
overflow-y: auto;
|
|
1594
|
-
border-radius: 10px;
|
|
1595
|
-
background: ${e.colorFillQuaternary};
|
|
1596
|
-
padding: 4px 8px;
|
|
1597
|
-
`,toolsGrid:t`
|
|
1598
|
-
display: grid;
|
|
1599
|
-
grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
|
|
1600
|
-
gap: 8px;
|
|
1601
|
-
align-items: start;
|
|
1602
|
-
`,toolDesc:t`
|
|
1603
|
-
font-size: 13px;
|
|
1604
|
-
line-height: 1.5;
|
|
1605
|
-
color: ${e.colorTextSecondary};
|
|
1606
|
-
display: -webkit-box;
|
|
1607
|
-
-webkit-line-clamp: 1;
|
|
1608
|
-
-webkit-box-orient: vertical;
|
|
1609
|
-
overflow: hidden;
|
|
1610
|
-
`,configGrid:t`
|
|
1611
|
-
display: grid;
|
|
1612
|
-
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
1613
|
-
gap: 12px 16px;
|
|
1614
|
-
padding: 8px 0;
|
|
1615
|
-
`})),yo=({title:e,selectedCount:t,totalCount:o,searchPlaceholder:r,searchText:s,onSearchChange:a,onSelectAll:d,onClearAll:c,children:p,styles:u})=>{let b=o>0&&t===o;return(0,l.jsxs)("div",{className:u.dataSection,children:[(0,l.jsxs)("div",{className:u.dataSectionHeader,children:[(0,l.jsxs)(we,{strong:!0,style:{fontSize:13},children:[e,(0,l.jsxs)(we,{type:"secondary",style:{fontSize:12,marginLeft:8},children:[t," / ",o," selected"]})]}),(0,l.jsx)(de,{size:4,children:(0,l.jsx)(z,{type:"link",size:"small",onClick:b?c:d,children:b?"Clear":"Select All"})})]}),(0,l.jsx)("div",{style:{marginBottom:10},children:(0,l.jsx)(K,{size:"small",allowClear:!0,prefix:(0,l.jsx)(pr,{style:{fontSize:12}}),placeholder:r,value:s,onChange:x=>a(x.target.value),style:{width:"100%"}})}),(0,l.jsx)("div",{className:u.dataList,children:p})]})},ds=({text:e,className:t})=>(0,l.jsx)(je,{title:e,placement:"topLeft",children:(0,l.jsx)("div",{className:t,children:e})}),ps=({tools:e,selectedToolNames:t,allToolNames:o,onChange:r,styles:s})=>{let a=e.length>0&&t.length===o.length,d=c=>{if(t.includes(c)){let p=t.filter(u=>u!==c);r(p.length===0?void 0:p)}else{let p=[...t,c];r(p.length===o.length&&o.every(u=>p.includes(u))?void 0:p)}};return(0,l.jsxs)("div",{className:s.dataSection,children:[(0,l.jsxs)("div",{className:s.dataSectionHeader,children:[(0,l.jsxs)(we,{strong:!0,style:{fontSize:13},children:["Tools",(0,l.jsxs)(we,{type:"secondary",style:{fontSize:12,marginLeft:8},children:[t.length," / ",o.length," selected"]})]}),(0,l.jsx)(de,{size:4,children:(0,l.jsx)(z,{type:"link",size:"small",onClick:()=>r(a?[]:void 0),children:a?"Clear":"Select All"})})]}),(0,l.jsx)("div",{className:s.toolsGrid,children:e.map(c=>{let p=t.includes(c.name);return(0,l.jsx)(Dt,{item:c,dense:!0,className:p?s.selectedCard:void 0,onClick:()=>d(c.name),renderIcon:()=>(0,l.jsx)("span",{style:{fontSize:14,fontWeight:600},children:c.name.charAt(0).toUpperCase()}),renderPrimary:()=>c.name,renderDetails:()=>(0,l.jsx)(ds,{text:c.description,className:s.toolDesc}),renderHeaderActions:()=>(0,l.jsx)(_e,{checked:p,onClick:u=>u.stopPropagation(),onChange:()=>d(c.name)})},c.id)})})]})},ms=({value:e,onChange:t,token:o,styles:r})=>{let[s,a]=(0,ge.useState)([]),[d,c]=(0,ge.useState)(!1),[p,u]=(0,ge.useState)(""),{get:b}=ue(),x=(0,ge.useRef)(!1);(0,ge.useEffect)(()=>{if(x.current)return;x.current=!0,(async()=>{c(!0);try{let f=await b("/api/skills");f.success&&f.data&&Array.isArray(f.data.records)&&a(f.data.records)}catch(f){console.error("Failed to fetch skills:",f)}finally{c(!1)}})()},[b]);let v=Array.isArray(e)?e:[],g=s.filter(m=>m.name.toLowerCase().includes(p.toLowerCase())||m.description.toLowerCase().includes(p.toLowerCase()));return(0,l.jsx)(yo,{title:"Skill Library",selectedCount:v.length,totalCount:s.length,searchPlaceholder:"Search skills\u2026",searchText:p,onSearchChange:u,onSelectAll:()=>t(s.map(m=>m.id)),onClearAll:()=>t([]),styles:r,children:d?(0,l.jsx)("div",{style:{textAlign:"center",padding:20},children:(0,l.jsx)(re,{size:"small"})}):g.length===0?(0,l.jsx)(xe,{description:"No skills available",image:xe.PRESENTED_IMAGE_SIMPLE,style:{padding:12}}):(0,l.jsx)(Pe,{dataSource:g,split:!1,size:"small",renderItem:m=>{let f=v.includes(m.id);return(0,l.jsx)(Pe.Item,{style:{padding:"6px 8px",cursor:"pointer",borderRadius:o.borderRadius,backgroundColor:f?o.colorSuccessBg:"transparent",border:`1px solid ${f?o.colorSuccess:"transparent"}`,marginBottom:4,transition:"all 0.15s ease"},onClick:()=>t(f?v.filter(W=>W!==m.id):[...v,m.id]),children:(0,l.jsx)(Pe.Item.Meta,{avatar:(0,l.jsx)(_e,{checked:f}),title:(0,l.jsx)(we,{strong:f,style:{fontSize:13},children:m.name}),description:(0,l.jsx)(we,{type:"secondary",style:{fontSize:12},ellipsis:!0,children:m.description})})},m.id)}})})},us=({value:e,onChange:t,token:o,styles:r})=>{let[s,a]=(0,ge.useState)([]),[d,c]=(0,ge.useState)(!1),[p,u]=(0,ge.useState)(""),{get:b}=ue(),x=(0,ge.useRef)(!1);(0,ge.useEffect)(()=>{if(x.current)return;x.current=!0,(async()=>{c(!0);try{let f=await b("/api/database-configs");f.success&&f.data&&Array.isArray(f.data.records)&&a(f.data.records)}catch(f){console.error("Failed to fetch database configs:",f)}finally{c(!1)}})()},[b]);let v=Array.isArray(e)?e:[],g=s.filter(m=>(m.name||m.key).toLowerCase().includes(p.toLowerCase())||(m.description||"").toLowerCase().includes(p.toLowerCase()));return(0,l.jsx)(yo,{title:"Databases",selectedCount:v.length,totalCount:s.length,searchPlaceholder:"Search databases\u2026",searchText:p,onSearchChange:u,onSelectAll:()=>t(s.map(m=>m.key)),onClearAll:()=>t([]),styles:r,children:d?(0,l.jsx)("div",{style:{textAlign:"center",padding:20},children:(0,l.jsx)(re,{size:"small"})}):g.length===0?(0,l.jsx)(xe,{description:"No databases available",image:xe.PRESENTED_IMAGE_SIMPLE,style:{padding:12}}):(0,l.jsx)(Pe,{dataSource:g,split:!1,size:"small",renderItem:m=>{let f=v.includes(m.key);return(0,l.jsx)(Pe.Item,{style:{padding:"6px 8px",cursor:"pointer",borderRadius:o.borderRadius,backgroundColor:f?o.colorSuccessBg:"transparent",border:`1px solid ${f?o.colorSuccess:"transparent"}`,marginBottom:4,transition:"all 0.15s ease"},onClick:()=>t(f?v.filter(W=>W!==m.key):[...v,m.key]),children:(0,l.jsx)(Pe.Item.Meta,{avatar:(0,l.jsx)(_e,{checked:f}),title:(0,l.jsx)(we,{strong:f,style:{fontSize:13},children:m.name||m.key}),description:m.description?(0,l.jsx)(we,{type:"secondary",style:{fontSize:12},ellipsis:!0,children:m.description}):void 0})},m.key)}})})},gs=({value:e,onChange:t,token:o,styles:r})=>{let[s,a]=(0,ge.useState)([]),[d,c]=(0,ge.useState)(!1),[p,u]=(0,ge.useState)(""),{get:b}=ue(),x=(0,ge.useRef)(!1);(0,ge.useEffect)(()=>{if(x.current)return;x.current=!0,(async()=>{c(!0);try{let f=await b("/api/metrics-configs");f.success&&f.data&&Array.isArray(f.data.records)&&a(f.data.records)}catch(f){console.error("Failed to fetch metrics configs:",f)}finally{c(!1)}})()},[b]);let v=Array.isArray(e)?e:[],g=s.filter(m=>(m.name||m.key).toLowerCase().includes(p.toLowerCase())||(m.description||"").toLowerCase().includes(p.toLowerCase()));return(0,l.jsx)(yo,{title:"Metrics Servers",selectedCount:v.length,totalCount:s.length,searchPlaceholder:"Search servers\u2026",searchText:p,onSearchChange:u,onSelectAll:()=>t(s.map(m=>m.key)),onClearAll:()=>t([]),styles:r,children:d?(0,l.jsx)("div",{style:{textAlign:"center",padding:20},children:(0,l.jsx)(re,{size:"small"})}):g.length===0?(0,l.jsx)(xe,{description:"No servers available",image:xe.PRESENTED_IMAGE_SIMPLE,style:{padding:12}}):(0,l.jsx)(Pe,{dataSource:g,split:!1,size:"small",renderItem:m=>{let f=v.includes(m.key);return(0,l.jsx)(Pe.Item,{style:{padding:"6px 8px",cursor:"pointer",borderRadius:o.borderRadius,backgroundColor:f?o.colorSuccessBg:"transparent",border:`1px solid ${f?o.colorSuccess:"transparent"}`,marginBottom:4,transition:"all 0.15s ease"},onClick:()=>t(f?v.filter(W=>W!==m.key):[...v,m.key]),children:(0,l.jsx)(Pe.Item.Meta,{avatar:(0,l.jsx)(_e,{checked:f}),title:(0,l.jsx)(we,{strong:f,style:{fontSize:13},children:m.name||m.key}),description:m.description?(0,l.jsx)(we,{type:"secondary",style:{fontSize:12},ellipsis:!0,children:m.description}):void 0})},m.key)}})})},fs=({value:e,onChange:t,token:o,styles:r})=>{let[s,a]=(0,ge.useState)([]),[d,c]=(0,ge.useState)(!1),[p,u]=(0,ge.useState)(""),{get:b}=ue(),x=(0,ge.useRef)(!1);(0,ge.useEffect)(()=>{x.current||(x.current=!0,c(!0),b("/api/collections").then(m=>{m.success&&a(m.data.records)}).catch(()=>{}).finally(()=>c(!1)))},[b]);let v=Array.isArray(e)?e:[],g=s.filter(m=>(m.label||m.name).toLowerCase().includes(p.toLowerCase())||m.name.toLowerCase().includes(p.toLowerCase()));return(0,l.jsx)(yo,{title:"Collections",selectedCount:v.length,totalCount:s.length,searchPlaceholder:"Search collections\u2026",searchText:p,onSearchChange:u,onSelectAll:()=>t(s.map(m=>m.name)),onClearAll:()=>t([]),styles:r,children:d?(0,l.jsx)("div",{style:{textAlign:"center",padding:20},children:(0,l.jsx)(re,{size:"small"})}):g.length===0?(0,l.jsx)(xe,{description:"No collections available",image:xe.PRESENTED_IMAGE_SIMPLE,style:{padding:12}}):(0,l.jsx)(Pe,{dataSource:g,split:!1,size:"small",renderItem:m=>{let f=v.includes(m.name);return(0,l.jsx)(Pe.Item,{style:{padding:"6px 8px",cursor:"pointer",borderRadius:o.borderRadius,backgroundColor:f?o.colorSuccessBg:"transparent",border:`1px solid ${f?o.colorSuccess:"transparent"}`,marginBottom:4,transition:"all 0.15s ease"},onClick:()=>t(f?v.filter(W=>W!==m.name):[...v,m.name]),children:(0,l.jsx)(Pe.Item.Meta,{avatar:(0,l.jsx)(_e,{checked:f}),title:(0,l.jsx)(we,{strong:f,style:{fontSize:13},children:m.label||m.name}),description:(0,l.jsx)(we,{type:"secondary",style:{fontSize:12},ellipsis:!0,children:m.name})})},m.name)}})})},ys=({value:e,onChange:t,token:o,styles:r})=>{let s=Array.isArray(e)?e:[],[a,d]=(0,ge.useState)({from:"",to:"",purpose:""}),c=()=>{!a.from.trim()||!a.to.trim()||!a.purpose.trim()||(t([...s,{...a}]),d({from:"",to:"",purpose:""}))};return(0,l.jsxs)("div",{className:r.dataSection,children:[(0,l.jsx)("div",{className:r.dataSectionHeader,children:(0,l.jsxs)(we,{strong:!0,style:{fontSize:13},children:["Dependencies",(0,l.jsxs)(we,{type:"secondary",style:{fontSize:12,marginLeft:8},children:[s.length," edges"]})]})}),(0,l.jsx)("div",{className:r.dataList,children:s.length===0?(0,l.jsx)(xe,{description:"No dependencies defined yet",image:xe.PRESENTED_IMAGE_SIMPLE,style:{padding:12}}):s.map((p,u)=>(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,padding:"6px 10px",marginBottom:4,borderRadius:o.borderRadius,backgroundColor:o.colorBgContainer,border:`1px solid ${o.colorBorderSecondary}`},children:[(0,l.jsx)(be,{color:"blue",style:{margin:0,fontSize:11},children:p.from}),(0,l.jsx)(we,{type:"secondary",style:{fontSize:12},children:"\u2192"}),(0,l.jsx)(be,{color:"green",style:{margin:0,fontSize:11},children:p.to}),(0,l.jsx)(we,{style:{fontSize:12,flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:p.purpose}),(0,l.jsx)(z,{type:"text",size:"small",danger:!0,icon:(0,l.jsx)(rr,{}),onClick:()=>t(s.filter((b,x)=>x!==u))})]},u))}),(0,l.jsxs)("div",{style:{borderTop:`1px solid ${o.colorBorderSecondary}`,paddingTop:12,marginTop:12},children:[(0,l.jsx)(we,{strong:!0,style:{fontSize:13,display:"block",marginBottom:8},children:"Add Dependency"}),(0,l.jsxs)(de,{direction:"vertical",size:6,style:{width:"100%"},children:[(0,l.jsx)(K,{size:"small",placeholder:"Source Agent ID",value:a.from,onChange:p=>d({...a,from:p.target.value})}),(0,l.jsx)(K,{size:"small",placeholder:"Target Agent ID",value:a.to,onChange:p=>d({...a,to:p.target.value})}),(0,l.jsx)(K,{size:"small",placeholder:"Purpose (e.g. classify invoice fields)",value:a.purpose,onChange:p=>d({...a,purpose:p.target.value}),onPressEnter:c}),(0,l.jsx)(z,{type:"dashed",size:"small",icon:(0,l.jsx)(cr,{}),onClick:c,disabled:!a.from.trim()||!a.to.trim()||!a.purpose.trim(),block:!0,children:"Add Edge"})]})]})]})},Ci=(e,t,o,r,s)=>{let a=t.title||e,d=t.description?(0,l.jsx)(je,{title:t.description,children:(0,l.jsx)(dr,{style:{color:s.colorTextSecondary,cursor:"pointer"}})}):null;if(t.widget==="switch"||!t.widget&&t.type==="boolean")return{row:(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:16,padding:"8px 0"},children:[(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6},children:[(0,l.jsx)(we,{style:{fontSize:13},children:a}),d]}),(0,l.jsx)(Ct,{size:"small",checked:o,onChange:r})]},e),gridItem:null};if(t.widget==="segmented"){let u=t.enum?.map(b=>({value:b,label:{global:"Global",agent:"Agent",project:"Project"}[b]||b}))||[];return{row:(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:16,padding:"8px 0"},children:[(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6},children:[(0,l.jsx)(we,{style:{fontSize:13},children:a}),d]}),(0,l.jsx)(qn,{size:"small",value:o,onChange:r,options:u})]},e),gridItem:null}}let c=(0,l.jsxs)("span",{children:[a,d&&(0,l.jsxs)(l.Fragment,{children:["\xA0",d]})]}),p;if(t.type==="number"||t.type==="integer")p=(0,l.jsx)(K,{size:"small",type:"number",value:o,onChange:u=>r(parseFloat(u.target.value)||t.default),min:t.minimum,max:t.maximum,style:{width:"100%"}});else if(t.widget==="select"||t.enum&&!t.widget){let u=t.enumLabels,b=u?Object.entries(u).map(([x,v])=>({value:x,label:v})):t.enum?.map(x=>({value:x,label:x}))||[];p=(0,l.jsx)(Me,{size:"small",value:o,onChange:r,options:b,style:{width:"100%"}})}else t.widget==="textarea"?p=(0,l.jsx)(K.TextArea,{size:"small",value:o,onChange:u=>r(u.target.value),placeholder:t.default,autoSize:{minRows:2,maxRows:4}}):p=(0,l.jsx)(K,{size:"small",value:o,onChange:u=>r(u.target.value),placeholder:t.default});return{row:null,gridItem:(0,l.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[(0,l.jsx)(we,{style:{fontSize:12,color:s.colorTextSecondary},children:c}),p]},e)}},Si=({type:e})=>{let{token:t}=Le.useToken();switch(e){case"browser":return(0,l.jsx)(sr,{style:{color:t.colorPrimary}});case"sql":return(0,l.jsx)(_o,{style:{color:t.colorWarning}});case"skill":return(0,l.jsx)(ur,{style:{color:t.colorSuccess}});case"filesystem":return(0,l.jsx)(ar,{style:{color:t.colorInfo}});case"code_eval":return(0,l.jsx)(or,{style:{color:t.colorError}});case"metrics":return(0,l.jsx)(Zt,{size:20,style:{color:t.colorWarning}});case"topology":return(0,l.jsx)(mr,{style:{color:t.colorPrimary}});case"document-parser":return(0,l.jsx)(ir,{style:{color:t.colorSuccess}});case"collection":return(0,l.jsx)(_o,{style:{color:t.colorInfo}});default:return(0,l.jsx)(lr,{style:{color:t.colorWarning}})}},hs=({middleware:e,middlewareType:t,onToggle:o,onConfigChange:r,onAllowedToolsChange:s,enabledAriaLabel:a,sectionTitles:d,headerActions:c,token:p,styles:u,renderListSubSection:b})=>{let x=t?.schema?.properties??{},v=Object.keys(x),g=v.filter(S=>{let B=x[S];return B.widget==="skillSelect"||B.widget==="databaseSelect"||B.widget==="metricsSelect"||B.widget==="collectionSelect"||B.widget==="connectionSelect"||B.widget==="topologyEdgeBuilder"}),m=v.filter(S=>{let B=x[S];return g.includes(S)?!1:B.widget==="switch"||B.widget==="segmented"}),f=v.filter(S=>!(g.includes(S)||m.includes(S)||S==="vmIsolation")),W=g.filter(S=>{let B=x[S];return S==="skills"&&e.config.readAll===!0||S==="serverKeys"&&e.config.connectAll===!0||S==="collectionKeys"&&e.config.connectAll===!0||S==="connections"&&e.config.connectAll===!0?!1:!!B.widget}),j=()=>(0,l.jsxs)(l.Fragment,{children:[m.map(S=>{let B=x[S],{row:J}=Ci(S,B,e.config[S]??B.default,Z=>r({[S]:Z}),p);return(0,l.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:2},children:J},S)}),f.length>0&&(0,l.jsx)("div",{className:u.configGrid,children:f.map(S=>{let B=x[S],{gridItem:J}=Ci(S,B,e.config[S]??B.default,Z=>r({[S]:Z}),p);return J})})]}),A=t?.tools,X=A?.map(S=>S.name)??[],ee=e.allowedTools??X,pe=A&&A.length>0,Q=m.length>0||f.length>0;return(0,l.jsxs)("div",{style:{maxWidth:960},children:[(0,l.jsxs)("div",{className:u.pageHeader,children:[(0,l.jsx)("div",{className:u.pageIcon,children:(0,l.jsx)(Si,{type:e.type})}),(0,l.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,l.jsx)("h2",{className:u.pageName,children:e.name}),(0,l.jsx)("p",{className:u.pageDesc,children:e.description})]}),(0,l.jsxs)(de,{size:10,children:[c,(0,l.jsx)(be,{color:e.enabled?"success":"default",style:{margin:0,fontSize:11},children:e.enabled?"Enabled":"Disabled"}),(0,l.jsx)(Ct,{"aria-label":a,checked:e.enabled,onChange:S=>{if(o(),S){let B=t;B?.defaultConfig&&!e.config&&r(B.defaultConfig)}}})]})]}),Q&&(0,l.jsxs)("div",{children:[(0,l.jsx)("h3",{className:u.blockTitle,children:d?.config??"Config"}),(0,l.jsx)("div",{style:{marginTop:12},children:j()})]}),W.length>0&&(0,l.jsxs)("div",{style:{marginTop:24},children:[(0,l.jsx)("h3",{className:u.blockTitle,style:{marginBottom:4},children:d?.resources??"Resources Permission"}),W.map(S=>{let B=x[S],J=e.config[S]??B.default??[];return b(S,B,J,Z=>r({[S]:Z}),e.type)})]}),pe&&A&&(0,l.jsxs)("div",{style:{marginTop:24},children:[(0,l.jsx)("h3",{className:u.blockTitle,style:{marginBottom:4},children:d?.tools??"Tools Permission"}),(0,l.jsx)(ps,{tools:A,selectedToolNames:ee,allToolNames:X,onChange:s,styles:u})]})]})},bs=e=>{let{token:t}=Le.useToken(),{styles:o}=gn();return(0,l.jsx)(hs,{...e,token:t,styles:o,renderListSubSection:(s,a,d,c,p)=>{switch(a.widget){case"skillSelect":return(0,l.jsx)(ms,{value:d,onChange:c,token:t,styles:o},s);case"databaseSelect":return(0,l.jsx)(us,{value:d,onChange:c,token:t,styles:o},s);case"metricsSelect":return(0,l.jsx)(gs,{value:d,onChange:c,token:t,styles:o},s);case"collectionSelect":return(0,l.jsx)(fs,{value:d,onChange:c,token:t,styles:o},s);case"connectionSelect":return(0,l.jsxs)("div",{className:o.dataSection,children:[(0,l.jsx)("div",{className:o.dataSectionHeader,children:(0,l.jsx)(we,{strong:!0,style:{fontSize:13},children:a.title||"Connections"})}),(0,l.jsx)(wi,{connectionType:a.connectionType??(s==="connections"?p:""),value:d||[],onChange:c})]},s);case"topologyEdgeBuilder":return(0,l.jsx)(ys,{value:d,onChange:c,token:t,styles:o},s);default:return null}}})};var ki=n(i()),{Text:Sg}=P,kg=C(({css:e,token:t})=>({toolRow:e`
|
|
1616
|
-
width: 100%;
|
|
1617
|
-
background: ${t.colorFillQuaternary};
|
|
1618
|
-
border-color: ${t.colorBorderSecondary};
|
|
1619
|
-
`,toolRowOn:e`
|
|
1620
|
-
width: 100%;
|
|
1621
|
-
background: color-mix(in srgb, ${t.colorPrimary} 8%, transparent);
|
|
1622
|
-
border-color: ${t.colorPrimaryBorder};
|
|
1623
|
-
`,toolName:e`
|
|
1624
|
-
font-weight: 600;
|
|
1625
|
-
font-size: 13px;
|
|
1626
|
-
`}));var Ri=n(i()),{Text:Ig}=P,Ag=C(({css:e,token:t})=>({diagram:e`
|
|
1627
|
-
display: flex;
|
|
1628
|
-
flex-direction: column;
|
|
1629
|
-
gap: 0;
|
|
1630
|
-
align-items: stretch;
|
|
1631
|
-
`,figure:e`
|
|
1632
|
-
border: 1.5px dashed ${t.colorWarningBorder};
|
|
1633
|
-
border-radius: ${t.borderRadius}px;
|
|
1634
|
-
background: ${t.colorWarningBg};
|
|
1635
|
-
padding: 10px 12px;
|
|
1636
|
-
margin-bottom: 12px;
|
|
1637
|
-
`,figureHeader:e`
|
|
1638
|
-
display: flex;
|
|
1639
|
-
align-items: center;
|
|
1640
|
-
gap: 8px;
|
|
1641
|
-
margin-bottom: 6px;
|
|
1642
|
-
`,svg:e`
|
|
1643
|
-
display: block;
|
|
1644
|
-
width: 100%;
|
|
1645
|
-
height: auto;
|
|
1646
|
-
`,notesRow:e`
|
|
1647
|
-
display: grid;
|
|
1648
|
-
grid-template-columns: repeat(3, 1fr);
|
|
1649
|
-
gap: 8px;
|
|
1650
|
-
@media (max-width: 720px) {
|
|
1651
|
-
grid-template-columns: 1fr;
|
|
1652
|
-
}
|
|
1653
|
-
`,note:e`
|
|
1654
|
-
border: 1px solid ${t.colorBorderSecondary};
|
|
1655
|
-
border-radius: ${t.borderRadius}px;
|
|
1656
|
-
background: ${t.colorFillQuaternary};
|
|
1657
|
-
padding: 8px 12px;
|
|
1658
|
-
font-size: 12px;
|
|
1659
|
-
line-height: 1.5;
|
|
1660
|
-
color: ${t.colorTextSecondary};
|
|
1661
|
-
`}));var Ti=n(w());var Pi=n(i());var ho=n(w());var fn=n(i()),_g=mo.map(({role:e,label:t,description:o})=>({value:e,label:t,description:o})),Lg=C(({token:e,css:t})=>({root:t`
|
|
1662
|
-
display: flex;
|
|
1663
|
-
flex-direction: column;
|
|
1664
|
-
gap: 24px;
|
|
1665
|
-
max-width: 720px;
|
|
1666
|
-
`,section:t`
|
|
1667
|
-
display: flex;
|
|
1668
|
-
flex-direction: column;
|
|
1669
|
-
gap: 8px;
|
|
1670
|
-
`,sectionHeader:t`
|
|
1671
|
-
display: flex;
|
|
1672
|
-
align-items: center;
|
|
1673
|
-
justify-content: space-between;
|
|
1674
|
-
gap: 8px;
|
|
1675
|
-
padding-bottom: 6px;
|
|
1676
|
-
border-bottom: 1px solid ${e.colorBorderSecondary};
|
|
1677
|
-
`,sectionTitle:t`
|
|
1678
|
-
margin: 0;
|
|
1679
|
-
font-size: 14px;
|
|
1680
|
-
font-weight: 600;
|
|
1681
|
-
color: ${e.colorText};
|
|
1682
|
-
`,sectionHint:t`
|
|
1683
|
-
font-size: 12px;
|
|
1684
|
-
color: ${e.colorTextTertiary};
|
|
1685
|
-
`,row:t`
|
|
1686
|
-
display: flex;
|
|
1687
|
-
align-items: center;
|
|
1688
|
-
gap: 10px;
|
|
1689
|
-
padding: 6px 4px;
|
|
1690
|
-
border-radius: ${e.borderRadius}px;
|
|
1691
|
-
|
|
1692
|
-
&:hover {
|
|
1693
|
-
background: ${e.colorFillQuaternary};
|
|
1694
|
-
}
|
|
1695
|
-
`,identity:t`
|
|
1696
|
-
flex: 1;
|
|
1697
|
-
min-width: 0;
|
|
1698
|
-
display: flex;
|
|
1699
|
-
flex-direction: column;
|
|
1700
|
-
`,name:t`
|
|
1701
|
-
font-size: 14px;
|
|
1702
|
-
color: ${e.colorText};
|
|
1703
|
-
white-space: nowrap;
|
|
1704
|
-
overflow: hidden;
|
|
1705
|
-
text-overflow: ellipsis;
|
|
1706
|
-
`,meta:t`
|
|
1707
|
-
font-size: 12px;
|
|
1708
|
-
color: ${e.colorTextTertiary};
|
|
1709
|
-
white-space: nowrap;
|
|
1710
|
-
overflow: hidden;
|
|
1711
|
-
text-overflow: ellipsis;
|
|
1712
|
-
`}));var yn=n(i()),{Text:af,Title:sf}=P,lf=C(({css:e,token:t})=>({layout:e`
|
|
1713
|
-
display: flex;
|
|
1714
|
-
height: 100%;
|
|
1715
|
-
gap: 20px;
|
|
1716
|
-
@media (max-width: 720px) {
|
|
1717
|
-
flex-direction: column;
|
|
1718
|
-
}
|
|
1719
|
-
`,content:e`
|
|
1720
|
-
flex: 1;
|
|
1721
|
-
min-width: 0;
|
|
1722
|
-
overflow-y: auto;
|
|
1723
|
-
padding-right: 4px;
|
|
1724
|
-
@media (max-width: 720px) {
|
|
1725
|
-
padding-right: 0;
|
|
1726
|
-
}
|
|
1727
|
-
`,layer:e`
|
|
1728
|
-
border: 1px solid ${t.colorBorderSecondary};
|
|
1729
|
-
border-radius: ${t.borderRadiusLG}px;
|
|
1730
|
-
padding: 14px 16px;
|
|
1731
|
-
margin-bottom: 16px;
|
|
1732
|
-
background: ${t.colorBgContainer};
|
|
1733
|
-
`,layerHeader:e`
|
|
1734
|
-
display: flex;
|
|
1735
|
-
align-items: center;
|
|
1736
|
-
gap: 8px;
|
|
1737
|
-
margin-bottom: 12px;
|
|
1738
|
-
`,layerStep:e`
|
|
1739
|
-
background: ${t.colorPrimaryBg};
|
|
1740
|
-
color: ${t.colorPrimary};
|
|
1741
|
-
border-radius: ${t.borderRadiusSM}px;
|
|
1742
|
-
font-size: 13px;
|
|
1743
|
-
font-weight: 600;
|
|
1744
|
-
padding: 2px 8px;
|
|
1745
|
-
`}));var hn=n(i());var Ai=n(i());var Ei=n(w());var bn=n(i()),{Text:Nf}=P,{TextArea:Mf}=K,{useToken:Bf}=Le;var Ni=n(w());var xn=n(i()),{Text:Lf}=P,{TextArea:Of}=K,Wf=C(({token:e,css:t})=>({container:t`
|
|
1746
|
-
height: 100%;
|
|
1747
|
-
display: flex;
|
|
1748
|
-
flex-direction: column;
|
|
1749
|
-
background: rgba(250, 250, 252, 0.6);
|
|
1750
|
-
overflow: hidden;
|
|
1751
|
-
`,header:t`
|
|
1752
|
-
padding: 16px;
|
|
1753
|
-
border-bottom: 1px solid rgba(0, 0, 0, 0.04);
|
|
1754
|
-
background: rgba(255, 255, 255, 0.5);
|
|
1755
|
-
`,headerContent:t`
|
|
1756
|
-
display: flex;
|
|
1757
|
-
justify-content: space-between;
|
|
1758
|
-
align-items: center;
|
|
1759
|
-
`,title:t`
|
|
1760
|
-
font-size: 16px;
|
|
1761
|
-
font-weight: 600;
|
|
1762
|
-
color: ${e.colorText};
|
|
1763
|
-
`,content:t`
|
|
1764
|
-
flex: 1;
|
|
1765
|
-
overflow-y: auto;
|
|
1766
|
-
padding: 16px;
|
|
1767
|
-
`,configList:t`
|
|
1768
|
-
display: flex;
|
|
1769
|
-
flex-direction: column;
|
|
1770
|
-
gap: 12px;
|
|
1771
|
-
`,emptyState:t`
|
|
1772
|
-
display: flex;
|
|
1773
|
-
flex-direction: column;
|
|
1774
|
-
align-items: center;
|
|
1775
|
-
justify-content: center;
|
|
1776
|
-
padding: 60px 20px;
|
|
1777
|
-
color: ${e.colorTextSecondary};
|
|
1778
|
-
`,emptyIcon:t`
|
|
1779
|
-
width: 64px;
|
|
1780
|
-
height: 64px;
|
|
1781
|
-
border-radius: 16px;
|
|
1782
|
-
background: rgba(0, 0, 0, 0.04);
|
|
1783
|
-
display: flex;
|
|
1784
|
-
align-items: center;
|
|
1785
|
-
justify-content: center;
|
|
1786
|
-
margin-bottom: 16px;
|
|
1787
|
-
`,emptyText:t`
|
|
1788
|
-
font-size: 14px;
|
|
1789
|
-
font-weight: 500;
|
|
1790
|
-
`,emptySubtext:t`
|
|
1791
|
-
font-size: 13px;
|
|
1792
|
-
color: ${e.colorTextSecondary};
|
|
1793
|
-
margin-top: 8px;
|
|
1794
|
-
`}));var vo=n(w());var Mi=n(w());var wn=n(i()),{Text:Qf}=P,Yf=C(({css:e})=>({formField:e`
|
|
1795
|
-
margin-bottom: 16px;
|
|
1796
|
-
`,fieldLabel:e`
|
|
1797
|
-
display: block;
|
|
1798
|
-
margin-bottom: 6px;
|
|
1799
|
-
font-weight: 500;
|
|
1800
|
-
font-size: 13px;
|
|
1801
|
-
`}));var Cs=n(i()),{Text:iy}=P;var Di=n(w());var Ss=n(w());var Bi=n(i());var Cn=n(i()),{Text:yy}=P,{TextArea:hy}=K,{useToken:by}=Le,{Panel:vy}=Et;var xt=n(w());var Sn=n(i()),Py=(0,xt.lazy)(()=>import("./embed-page-SkillFlow-HPH37PZH.js")),{Text:Iy}=P,{TextArea:Ay}=K;var Fi=n(w());var Rn=n(w());var Tn=n(i()),{Text:jy,Paragraph:$y}=P,_y=C(({token:e,css:t})=>({root:t`
|
|
1802
|
-
height: 100%;
|
|
1803
|
-
display: flex;
|
|
1804
|
-
flex-direction: column;
|
|
1805
|
-
background: ${e.colorBgContainer};
|
|
1806
|
-
`,toolbar:t`
|
|
1807
|
-
display: flex;
|
|
1808
|
-
align-items: center;
|
|
1809
|
-
justify-content: space-between;
|
|
1810
|
-
padding: 12px 16px;
|
|
1811
|
-
border-bottom: 1px solid ${e.colorBorderSecondary};
|
|
1812
|
-
flex-shrink: 0;
|
|
1813
|
-
`,toolbarLeft:t`
|
|
1814
|
-
display: flex;
|
|
1815
|
-
align-items: center;
|
|
1816
|
-
gap: 8px;
|
|
1817
|
-
`,toolbarRight:t`
|
|
1818
|
-
display: flex;
|
|
1819
|
-
align-items: center;
|
|
1820
|
-
gap: 8px;
|
|
1821
|
-
`,body:t`
|
|
1822
|
-
flex: 1;
|
|
1823
|
-
overflow: auto;
|
|
1824
|
-
& .ant-table-row .entry-row-actions {
|
|
1825
|
-
opacity: 0;
|
|
1826
|
-
transition: opacity 0.15s;
|
|
1827
|
-
@media (hover: none) {
|
|
1828
|
-
opacity: 1;
|
|
1829
|
-
}
|
|
1830
|
-
}
|
|
1831
|
-
& .ant-table-row:hover .entry-row-actions {
|
|
1832
|
-
opacity: 1;
|
|
1833
|
-
}
|
|
1834
|
-
`,countTag:t`
|
|
1835
|
-
font-size: 12px;
|
|
1836
|
-
color: ${e.colorTextTertiary};
|
|
1837
|
-
background: ${e.colorFillSecondary};
|
|
1838
|
-
padding: 1px 8px;
|
|
1839
|
-
border-radius: 10px;
|
|
1840
|
-
`,emptyWrap:t`
|
|
1841
|
-
display: flex;
|
|
1842
|
-
flex-direction: column;
|
|
1843
|
-
align-items: center;
|
|
1844
|
-
justify-content: center;
|
|
1845
|
-
padding: 48px 0;
|
|
1846
|
-
gap: 8px;
|
|
1847
|
-
`,contentClamp:t`
|
|
1848
|
-
display: -webkit-box;
|
|
1849
|
-
-webkit-box-orient: vertical;
|
|
1850
|
-
overflow: hidden;
|
|
1851
|
-
line-height: 1.55;
|
|
1852
|
-
font-size: 13px;
|
|
1853
|
-
word-break: break-word;
|
|
1854
|
-
`,expandToggle:t`
|
|
1855
|
-
display: inline-flex;
|
|
1856
|
-
align-items: center;
|
|
1857
|
-
gap: 2px;
|
|
1858
|
-
font-size: 12px;
|
|
1859
|
-
color: ${e.colorPrimary};
|
|
1860
|
-
cursor: pointer;
|
|
1861
|
-
user-select: none;
|
|
1862
|
-
margin-top: 2px;
|
|
1863
|
-
line-height: 1;
|
|
1864
|
-
padding: 1px 4px;
|
|
1865
|
-
border-radius: 4px;
|
|
1866
|
-
transition: background 0.15s;
|
|
1867
|
-
&:hover {
|
|
1868
|
-
background: ${e.colorPrimaryBg};
|
|
1869
|
-
}
|
|
1870
|
-
`,expandedRow:t`
|
|
1871
|
-
& td {
|
|
1872
|
-
background: ${e.colorPrimaryBg} !important;
|
|
1873
|
-
transition: background 0.25s;
|
|
1874
|
-
}
|
|
1875
|
-
`}));var In=n(i()),{Text:Gy}=P,Qy=C(({token:e,css:t})=>({container:t`
|
|
1876
|
-
padding: ${e.paddingLG}px;
|
|
1877
|
-
height: 100%;
|
|
1878
|
-
overflow-y: auto;
|
|
1879
|
-
`,header:t`
|
|
1880
|
-
display: flex;
|
|
1881
|
-
justify-content: space-between;
|
|
1882
|
-
align-items: center;
|
|
1883
|
-
margin-bottom: ${e.marginLG}px;
|
|
1884
|
-
`,fieldRow:t`
|
|
1885
|
-
display: flex;
|
|
1886
|
-
gap: ${e.marginSM}px;
|
|
1887
|
-
margin-bottom: ${e.marginSM}px;
|
|
1888
|
-
align-items: center;
|
|
1889
|
-
`}));var An=n(w());var zi=n(i());var ji=n(w());var $i=n(i()),{Text:ih,Title:ah}=P;var wo=n(w());var xo=n(w());var _i=n(w());var Li=n(i()),{Text:fh}=P;var Oi=n(i()),{Text:kh}=P;var En=n(w());var Nn=n(i()),{Text:Dh,Paragraph:Fh}=P;var Mn=n(i()),{Text:qh}=P;var Bn=n(w());var Wi=n(i()),{Text:Xh}=P;var Dn=n(w());var Co=n(w());var Ui=n(w());var Hi=n(i()),{Text:lb}=P;var Fn=n(i()),{Text:bb}=P;var ko=n(w());var So=n(w());var Pt=n(i()),Rs=(0,So.lazy)(()=>import("./embed-page-TasksSideApp-MQTUCJO4.js").then(e=>({default:e.TasksSideApp}))),zn=()=>{let{openSideApp:e,sideAppVisible:t,sideAppSelectedCard:o}=ke(),r=t&&o?.component_key==="tasks_side_app_pin";return(0,Pt.jsx)(Rt,{ariaLabel:"Open tasks",icon:(0,Pt.jsx)(to,{size:16}),onClick:()=>{r||e({component_key:"tasks_side_app_pin",message:"Tasks",data:{component:(0,Pt.jsx)(So.Suspense,{fallback:(0,Pt.jsx)(re,{style:{display:"block",margin:"auto"}}),children:(0,Pt.jsx)(Rs,{showProjectFilter:!1})})}})}})};var Ut=n(w());var jn=n(i()),{Text:Mb}=P;var Bb=C(({css:e,token:t})=>({body:e`
|
|
1890
|
-
display: flex;
|
|
1891
|
-
height: 460px;
|
|
1892
|
-
`,leftPanel:e`
|
|
1893
|
-
width: 240px;
|
|
1894
|
-
flex-shrink: 0;
|
|
1895
|
-
display: flex;
|
|
1896
|
-
flex-direction: column;
|
|
1897
|
-
overflow: hidden;
|
|
1898
|
-
`,leftHeader:e`
|
|
1899
|
-
padding: 14px 16px 10px;
|
|
1900
|
-
flex-shrink: 0;
|
|
1901
|
-
`,leftHeaderText:e`
|
|
1902
|
-
font-size: 12px;
|
|
1903
|
-
font-weight: 600;
|
|
1904
|
-
color: ${t.colorTextSecondary};
|
|
1905
|
-
text-transform: uppercase;
|
|
1906
|
-
letter-spacing: 0.5px;
|
|
1907
|
-
`,channelList:e`
|
|
1908
|
-
flex: 1;
|
|
1909
|
-
overflow-y: auto;
|
|
1910
|
-
padding: 0 8px;
|
|
1911
|
-
`,channelItem:e`
|
|
1912
|
-
display: flex;
|
|
1913
|
-
align-items: center;
|
|
1914
|
-
gap: 10px;
|
|
1915
|
-
padding: 10px 12px;
|
|
1916
|
-
border-radius: 10px;
|
|
1917
|
-
cursor: pointer;
|
|
1918
|
-
transition: background 0.15s;
|
|
1919
|
-
margin-bottom: 2px;
|
|
1920
|
-
position: relative;
|
|
1921
|
-
&:hover {
|
|
1922
|
-
background: ${t.colorBgTextHover};
|
|
1923
|
-
}
|
|
1924
|
-
`,channelItemSelected:e`
|
|
1925
|
-
background: ${t.colorPrimaryBg};
|
|
1926
|
-
&::before {
|
|
1927
|
-
content: '';
|
|
1928
|
-
position: absolute;
|
|
1929
|
-
left: 0;
|
|
1930
|
-
top: 50%;
|
|
1931
|
-
transform: translateY(-50%);
|
|
1932
|
-
width: 3px;
|
|
1933
|
-
height: 28px;
|
|
1934
|
-
background: ${t.colorPrimary};
|
|
1935
|
-
border-radius: 0 3px 3px 0;
|
|
1936
|
-
}
|
|
1937
|
-
`,channelAvatar:e`
|
|
1938
|
-
width: 36px;
|
|
1939
|
-
height: 36px;
|
|
1940
|
-
border-radius: 50%;
|
|
1941
|
-
color: #fff;
|
|
1942
|
-
display: flex;
|
|
1943
|
-
align-items: center;
|
|
1944
|
-
justify-content: center;
|
|
1945
|
-
font-size: 16px;
|
|
1946
|
-
font-weight: 600;
|
|
1947
|
-
flex-shrink: 0;
|
|
1948
|
-
`,channelInfo:e`
|
|
1949
|
-
flex: 1;
|
|
1950
|
-
min-width: 0;
|
|
1951
|
-
`,channelName:e`
|
|
1952
|
-
font-size: 13px;
|
|
1953
|
-
font-weight: 500;
|
|
1954
|
-
color: ${t.colorText};
|
|
1955
|
-
overflow: hidden;
|
|
1956
|
-
text-overflow: ellipsis;
|
|
1957
|
-
white-space: nowrap;
|
|
1958
|
-
`,channelType:e`
|
|
1959
|
-
font-size: 11px;
|
|
1960
|
-
color: ${t.colorTextTertiary};
|
|
1961
|
-
`,channelDisabled:e`
|
|
1962
|
-
opacity: 0.45;
|
|
1963
|
-
`,statusDot:e`
|
|
1964
|
-
width: 8px;
|
|
1965
|
-
height: 8px;
|
|
1966
|
-
border-radius: 50%;
|
|
1967
|
-
flex-shrink: 0;
|
|
1968
|
-
margin-left: auto;
|
|
1969
|
-
transition: background 0.2s;
|
|
1970
|
-
`,addChannelBtn:e`
|
|
1971
|
-
margin: 8px;
|
|
1972
|
-
flex-shrink: 0;
|
|
1973
|
-
`,rightPanel:e`
|
|
1974
|
-
flex: 1;
|
|
1975
|
-
display: flex;
|
|
1976
|
-
flex-direction: column;
|
|
1977
|
-
overflow: hidden;
|
|
1978
|
-
`,rightBody:e`
|
|
1979
|
-
flex: 1;
|
|
1980
|
-
padding: 20px 24px;
|
|
1981
|
-
overflow-y: auto;
|
|
1982
|
-
`,emptyState:e`
|
|
1983
|
-
display: flex;
|
|
1984
|
-
flex-direction: column;
|
|
1985
|
-
align-items: center;
|
|
1986
|
-
justify-content: center;
|
|
1987
|
-
height: 100%;
|
|
1988
|
-
text-align: center;
|
|
1989
|
-
`,formSectionTitle:e`
|
|
1990
|
-
font-size: 14px;
|
|
1991
|
-
font-weight: 600;
|
|
1992
|
-
margin-bottom: 16px;
|
|
1993
|
-
`,bindingSection:e`
|
|
1994
|
-
margin-top: 20px;
|
|
1995
|
-
padding: 14px;
|
|
1996
|
-
border: 1px dashed ${t.colorBorder};
|
|
1997
|
-
border-radius: ${t.borderRadius}px;
|
|
1998
|
-
background: ${t.colorBgLayout};
|
|
1999
|
-
`,bindingHeader:e`
|
|
2000
|
-
font-size: 13px;
|
|
2001
|
-
font-weight: 600;
|
|
2002
|
-
margin-bottom: 4px;
|
|
2003
|
-
`,bindingHint:e`
|
|
2004
|
-
font-size: 12px;
|
|
2005
|
-
color: ${t.colorTextTertiary};
|
|
2006
|
-
margin-bottom: 10px;
|
|
2007
|
-
`,contactItem:e`
|
|
2008
|
-
display: flex;
|
|
2009
|
-
align-items: center;
|
|
2010
|
-
gap: 10px;
|
|
2011
|
-
padding: 8px 10px;
|
|
2012
|
-
border-radius: 8px;
|
|
2013
|
-
transition: background 0.15s;
|
|
2014
|
-
&:hover {
|
|
2015
|
-
background: ${t.colorBgTextHover};
|
|
2016
|
-
}
|
|
2017
|
-
`,contactAvatar:e`
|
|
2018
|
-
width: 32px;
|
|
2019
|
-
height: 32px;
|
|
2020
|
-
border-radius: 50%;
|
|
2021
|
-
background: ${t.colorFill};
|
|
2022
|
-
color: ${t.colorTextSecondary};
|
|
2023
|
-
display: flex;
|
|
2024
|
-
align-items: center;
|
|
2025
|
-
justify-content: center;
|
|
2026
|
-
flex-shrink: 0;
|
|
2027
|
-
`,contactInfo:e`
|
|
2028
|
-
flex: 1;
|
|
2029
|
-
min-width: 0;
|
|
2030
|
-
`,contactName:e`
|
|
2031
|
-
font-size: 13px;
|
|
2032
|
-
color: ${t.colorText};
|
|
2033
|
-
`,contactId:e`
|
|
2034
|
-
font-size: 11px;
|
|
2035
|
-
color: ${t.colorTextTertiary};
|
|
2036
|
-
`,addBindingRow:e`
|
|
2037
|
-
display: flex;
|
|
2038
|
-
gap: 8px;
|
|
2039
|
-
align-items: center;
|
|
2040
|
-
margin-top: 8px;
|
|
2041
|
-
`,footer:e`
|
|
2042
|
-
display: flex;
|
|
2043
|
-
justify-content: space-between;
|
|
2044
|
-
align-items: center;
|
|
2045
|
-
padding: 12px 24px;
|
|
2046
|
-
border-top: 1px solid ${t.colorBorderSecondary};
|
|
2047
|
-
flex-shrink: 0;
|
|
2048
|
-
`}));var $n=n(i()),{Title:Xb,Text:Jb,Paragraph:Zb}=P,ev=C(({css:e,token:t})=>({container:e` display: flex; flex-direction: column; height: 100%; padding: 24px; overflow-y: auto; `,setupWrap:e` max-width: 520px; margin: 30px auto 0; `,card:e` border-radius: ${t.borderRadiusLG}px; `,statusCard:e` max-width: 560px; margin: 40px auto 0; border-radius: ${t.borderRadiusLG}px; `,loadingWrap:e` display: flex; align-items: center; justify-content: center; height: 100%; `,avatar:e`
|
|
2049
|
-
width: 56px; height: 56px; border-radius: ${t.borderRadiusLG}px;
|
|
2050
|
-
background: linear-gradient(135deg, ${t.colorPrimary}, ${t.colorPrimaryActive});
|
|
2051
|
-
color: #fff; display: flex; align-items: center; justify-content: center; font-size: 26px; margin: 0 auto 12px;
|
|
2052
|
-
`,stepDot:e` width: 8px; height: 8px; border-radius: 50%; transition: all 0.3s; `,stepDotActive:e` width: 28px; border-radius: 4px; background: ${t.colorPrimary}; `,stepDotDone:e` background: ${t.colorPrimary}; opacity: 0.5; `,stepDotPending:e` background: ${t.colorBorder}; `,stepIndicator:e` display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 24px; `,personalityGrid:e` display: flex; flex-direction: column; gap: 10px; `,personalityOption:e`
|
|
2053
|
-
display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px;
|
|
2054
|
-
border: 2px solid ${t.colorBorder}; border-radius: ${t.borderRadius}px; cursor: pointer;
|
|
2055
|
-
transition: all 0.2s;
|
|
2056
|
-
&:hover { border-color: ${t.colorPrimaryBorder}; }
|
|
2057
|
-
`,personalityOptionSelected:e` border-color: ${t.colorPrimary}; background: ${t.colorPrimaryBg}; `,personalityIcon:e`
|
|
2058
|
-
flex-shrink: 0; width: 40px; height: 40px; border-radius: 10px;
|
|
2059
|
-
display: flex; align-items: center; justify-content: center; margin-top: 2px;
|
|
2060
|
-
`,chatRoot:e` display: flex; flex-direction: column; height: 100%; min-height: 0; `,chatBar:e`
|
|
2061
|
-
display: flex; align-items: center; justify-content: space-between;
|
|
2062
|
-
padding: 8px 16px; border-bottom: 1px solid ${t.colorBorderSecondary}; flex-shrink: 0;
|
|
2063
|
-
`,chatFill:e` flex: 1; min-height: 0; `}));var Xi=n(w());var Qi=n(w());var ve=n(w());function Vi(e,t){let o=t.trim().toLowerCase();return o?e.filter(r=>(r.label||"").toLowerCase().includes(o)):e}var qi=(e,t)=>{let o=t==="created"?e.createdAt:e.updatedAt;if(!o)return null;let r=Date.parse(o);return Number.isNaN(r)?null:r};function Gi(e,t="updated",o="desc"){return[...e].sort((r,s)=>{if(t==="name"){let c=r.label||"",p=s.label||"";return o==="asc"?c.localeCompare(p):p.localeCompare(c)}let a=qi(r,t),d=qi(s,t);return a===null&&d===null?0:a===null?1:d===null?-1:o==="asc"?a-d:d-a})}var V=n(i()),Ts=C(({token:e,css:t})=>({container:t`
|
|
2064
|
-
padding: 4px;
|
|
2065
|
-
font-size: 13px;
|
|
2066
|
-
background: transparent;
|
|
2067
|
-
`,toolbar:t`
|
|
2068
|
-
display: flex;
|
|
2069
|
-
flex-direction: column;
|
|
2070
|
-
gap: 6px;
|
|
2071
|
-
margin-bottom: 12px;
|
|
2072
|
-
`,toolbarRow:t`
|
|
2073
|
-
display: flex;
|
|
2074
|
-
align-items: center;
|
|
2075
|
-
gap: 6px;
|
|
2076
|
-
`,threadList:t`
|
|
2077
|
-
display: flex;
|
|
2078
|
-
flex-direction: column;
|
|
2079
|
-
gap: 2px;
|
|
2080
|
-
`,threadItem:t`
|
|
2081
|
-
display: flex;
|
|
2082
|
-
align-items: center;
|
|
2083
|
-
gap: 8px;
|
|
2084
|
-
padding: 8px;
|
|
2085
|
-
border-radius: 6px;
|
|
2086
|
-
cursor: pointer;
|
|
2087
|
-
transition: all 0.15s ease;
|
|
2088
|
-
|
|
2089
|
-
&:hover {
|
|
2090
|
-
background: ${e.colorBgTextHover};
|
|
2091
|
-
|
|
2092
|
-
button {
|
|
2093
|
-
opacity: 1;
|
|
2094
|
-
}
|
|
2095
|
-
}
|
|
2096
|
-
|
|
2097
|
-
&.active {
|
|
2098
|
-
background: ${e.colorPrimaryBg};
|
|
2099
|
-
}
|
|
2100
|
-
`,threadIcon:t`
|
|
2101
|
-
display: flex;
|
|
2102
|
-
align-items: center;
|
|
2103
|
-
justify-content: center;
|
|
2104
|
-
width: 16px;
|
|
2105
|
-
height: 16px;
|
|
2106
|
-
color: ${e.colorTextSecondary};
|
|
2107
|
-
flex-shrink: 0;
|
|
2108
|
-
|
|
2109
|
-
svg {
|
|
2110
|
-
width: 14px;
|
|
2111
|
-
height: 14px;
|
|
2112
|
-
}
|
|
2113
|
-
`,threadName:t`
|
|
2114
|
-
font-size: 12px;
|
|
2115
|
-
font-weight: 500;
|
|
2116
|
-
color: ${e.colorText};
|
|
2117
|
-
flex: 1;
|
|
2118
|
-
overflow: hidden;
|
|
2119
|
-
text-overflow: ellipsis;
|
|
2120
|
-
white-space: nowrap;
|
|
2121
|
-
`,threadNameActive:t`
|
|
2122
|
-
font-size: 12px;
|
|
2123
|
-
font-weight: 600;
|
|
2124
|
-
color: ${e.colorPrimary};
|
|
2125
|
-
flex: 1;
|
|
2126
|
-
overflow: hidden;
|
|
2127
|
-
text-overflow: ellipsis;
|
|
2128
|
-
white-space: nowrap;
|
|
2129
|
-
`,actionBtn:t`
|
|
2130
|
-
display: flex;
|
|
2131
|
-
align-items: center;
|
|
2132
|
-
justify-content: center;
|
|
2133
|
-
width: 24px;
|
|
2134
|
-
height: 24px;
|
|
2135
|
-
border-radius: 4px;
|
|
2136
|
-
border: none;
|
|
2137
|
-
background: transparent;
|
|
2138
|
-
color: ${e.colorTextSecondary};
|
|
2139
|
-
cursor: pointer;
|
|
2140
|
-
opacity: 0;
|
|
2141
|
-
transition: all 0.15s ease;
|
|
2142
|
-
|
|
2143
|
-
&:hover {
|
|
2144
|
-
background: ${e.colorPrimaryBg};
|
|
2145
|
-
color: ${e.colorPrimary};
|
|
2146
|
-
}
|
|
2147
|
-
|
|
2148
|
-
&:disabled {
|
|
2149
|
-
cursor: not-allowed;
|
|
2150
|
-
opacity: 0.4;
|
|
2151
|
-
|
|
2152
|
-
&:hover {
|
|
2153
|
-
background: transparent;
|
|
2154
|
-
color: ${e.colorTextSecondary};
|
|
2155
|
-
}
|
|
2156
|
-
}
|
|
2157
|
-
|
|
2158
|
-
svg {
|
|
2159
|
-
width: 16px;
|
|
2160
|
-
height: 16px;
|
|
2161
|
-
}
|
|
2162
|
-
`,actionBtnVisible:t`
|
|
2163
|
-
opacity: 1;
|
|
2164
|
-
`,renameInput:t`
|
|
2165
|
-
flex: 1;
|
|
2166
|
-
min-width: 0;
|
|
2167
|
-
font-size: 12px;
|
|
2168
|
-
font-weight: 500;
|
|
2169
|
-
color: ${e.colorText};
|
|
2170
|
-
padding: 2px 6px;
|
|
2171
|
-
border: 1px solid ${e.colorPrimary};
|
|
2172
|
-
border-radius: 4px;
|
|
2173
|
-
background: ${e.colorBgContainer};
|
|
2174
|
-
box-sizing: border-box;
|
|
2175
|
-
|
|
2176
|
-
&:focus {
|
|
2177
|
-
outline: none;
|
|
2178
|
-
box-shadow: 0 0 0 2px ${e.colorPrimaryBg};
|
|
2179
|
-
}
|
|
2180
|
-
`,emptyState:t`
|
|
2181
|
-
padding: 16px;
|
|
2182
|
-
text-align: center;
|
|
2183
|
-
color: ${e.colorTextSecondary};
|
|
2184
|
-
font-size: 12px;
|
|
2185
|
-
`,loading:t`
|
|
2186
|
-
padding: 16px;
|
|
2187
|
-
text-align: center;
|
|
2188
|
-
color: ${e.colorTextSecondary};
|
|
2189
|
-
font-size: 12px;
|
|
2190
|
-
`})),_n=()=>{let{styles:e}=Ts(),{threads:t,threadId:o,selectThread:r,deleteThread:s,updateThread:a,isLoading:d}=tt(),[c,p]=(0,ve.useState)(null),[u,b]=(0,ve.useState)(!1),[x,v]=(0,ve.useState)(null),[g,m]=(0,ve.useState)(""),[f,W]=(0,ve.useState)(!1),[j,A]=(0,ve.useState)(""),[X,ee]=(0,ve.useState)("updated"),[pe,Q]=(0,ve.useState)("desc"),S=(0,ve.useRef)(!1),B=(0,ve.useRef)(!1),J=(0,ve.useCallback)((R,I)=>{R.stopPropagation(),p(I)},[]),Z=(0,ve.useCallback)(async()=>{if(c){b(!0);try{await s(c),q.success("Conversation deleted"),p(null)}catch{q.error("Failed to delete conversation")}finally{b(!1)}}},[c,s]),E=(0,ve.useCallback)((R,I)=>{R.stopPropagation(),v(I.id),m(I.label)},[]),se=(0,ve.useCallback)(async R=>{if(B.current)return;let I=g.trim();if(!I||I===R.label){v(null);return}B.current=!0,W(!0);try{await a({...R,label:I}),q.success("Conversation renamed")}catch{q.error("Failed to rename conversation")}finally{B.current=!1,W(!1),v(null)}},[g,a]),D=(0,ve.useCallback)(()=>{S.current=!0,v(null)},[]),$=(0,ve.useCallback)(R=>{R.key==="Enter"?(R.preventDefault(),R.currentTarget.blur()):R.key==="Escape"&&(R.preventDefault(),D())},[D]),le=(0,ve.useCallback)(R=>{if(S.current){S.current=!1;return}se(R)},[se]),L=ve.default.useMemo(()=>Gi(Vi(t,j),X,pe),[t,j,X,pe]);return(0,V.jsxs)("div",{className:e.container,children:[(0,V.jsxs)("div",{className:e.toolbar,children:[(0,V.jsx)(K,{size:"small",placeholder:"Search conversations\u2026",allowClear:!0,value:j,onChange:R=>A(R.target.value)}),(0,V.jsxs)("div",{className:e.toolbarRow,children:[(0,V.jsx)(Me,{size:"small",style:{flex:1,minWidth:0},value:X,onChange:R=>ee(R),options:[{value:"name",label:"Name"},{value:"updated",label:"Updated"},{value:"created",label:"Created"}]}),(0,V.jsx)(z,{size:"small",icon:pe==="asc"?(0,V.jsx)(Xt,{}):(0,V.jsx)(Jt,{}),onClick:()=>Q(R=>R==="asc"?"desc":"asc"),title:pe==="asc"?"Ascending":"Descending"})]})]}),d?(0,V.jsx)("div",{className:e.loading,children:"Loading conversations..."}):L.length===0?(0,V.jsx)("div",{className:e.emptyState,children:j.trim()?`No conversations match "${j.trim()}"`:"No conversations yet"}):(0,V.jsx)("div",{className:e.threadList,children:L.map(R=>(0,V.jsxs)("div",{className:`${e.threadItem} ${R.id===o?"active":""}`,onClick:()=>r(R.id),title:R.label,children:[(0,V.jsx)("div",{className:e.threadIcon,children:(0,V.jsx)(Rr,{size:14})}),x===R.id?(0,V.jsx)("input",{className:e.renameInput,"aria-label":"Conversation name",value:g,autoFocus:!0,disabled:f,onClick:I=>I.stopPropagation(),onFocus:I=>I.target.select(),onChange:I=>m(I.target.value),onKeyDown:I=>$(I),onBlur:()=>le(R)}):(0,V.jsx)("div",{className:R.id===o?e.threadNameActive:e.threadName,children:R.label}),x===R.id?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)("button",{className:`${e.actionBtn} ${e.actionBtnVisible}`,title:"Save name",disabled:f,onMouseDown:I=>I.preventDefault(),onClick:I=>{I.stopPropagation(),se(R)},children:(0,V.jsx)(yr,{size:12})}),(0,V.jsx)("button",{className:`${e.actionBtn} ${e.actionBtnVisible}`,title:"Cancel rename",disabled:f,onMouseDown:I=>I.preventDefault(),onClick:I=>{I.stopPropagation(),D()},children:(0,V.jsx)(Bt,{size:12})})]}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)("button",{className:e.actionBtn,onClick:I=>E(I,R),title:"Rename conversation",children:(0,V.jsx)(Pr,{size:12})}),(0,V.jsx)("button",{className:e.actionBtn,onClick:I=>J(I,R.id),title:"Delete conversation",children:(0,V.jsx)(Nr,{size:12})})]})]},R.id))}),(0,V.jsx)(me,{title:"Delete Conversation",open:c!==null,onCancel:()=>p(null),onOk:Z,okText:"Delete",okButtonProps:{danger:!0,loading:u},cancelText:"Cancel",children:(0,V.jsx)("p",{children:"Are you sure you want to delete this conversation? This action cannot be undone."})})]})};var Yi=n(i());var Ji=n(i());var Zi=n(w());var ea=n(i()),{Text:$v}=P;var Ms=n(w());var Ln=n(w());var ta=n(i()),{Text:Hv}=P;var Ns=n(w());var Es=n(w());var On=n(i());var Wn=n(i()),{Dragger:Zv}=Gn,{Text:ex,Title:tx}=P;var oa=n(i()),{Title:cx,Text:dx}=P;var ye=n(i()),na=[{id:"personal_assistant",type:"route",name:"Personal Assistant",icon:(0,ye.jsx)(Nt,{size:20}),order:-10},{id:"workspace_projects",type:"route",name:"Projects",icon:(0,ye.jsx)(st,{size:20}),order:0},{id:"metrics",builtin:"metrics",type:"route",name:"Metrics",icon:(0,ye.jsx)(Zt,{size:20}),order:10,group:"DataSource"},{id:"database",builtin:"database",type:"route",name:"Database",icon:(0,ye.jsx)(br,{size:20}),order:20,group:"DataSource"},{id:"connections",builtin:"connections",type:"route",name:"Plugins",icon:(0,ye.jsx)(Uo,{size:20}),order:21},{id:"topology-runtimes",type:"route",name:"Runtime",icon:(0,ye.jsx)(kt,{size:20}),order:26,group:"Process"},{id:"topology-inbox",type:"route",name:"Inbox",icon:(0,ye.jsx)(Cr,{size:20}),order:27,group:"Process"},{id:"workflows",type:"route",name:"Automations",icon:(0,ye.jsx)(Ho,{size:20}),order:25,group:"Process"},{id:"shares",type:"route",name:"Shares",icon:(0,ye.jsx)(Ho,{size:20}),order:55,group:"Settings"},{id:"workspace_migration",type:"route",name:"Migration",icon:(0,ye.jsx)(gr,{size:20}),order:56,group:"Settings"},{id:"eval",type:"route",name:"Eval",icon:(0,ye.jsx)(xr,{size:20}),order:28,group:"Process"},{id:"assistants",builtin:"assistants",type:"route",name:"Assistants",icon:(0,ye.jsx)(Nt,{size:20}),order:30,group:"Settings"},{id:"skills",builtin:"skills",type:"route",name:"Skills",icon:(0,ye.jsx)(Dr,{size:20}),order:35,group:"Settings"},{id:"collections",type:"route",name:"Collections",icon:(0,ye.jsx)(kr,{size:20}),order:29,group:"Knowledge"},{id:"mcp",builtin:"mcp",type:"route",name:"MCP",icon:(0,ye.jsx)(Uo,{size:20}),order:40,group:"Settings"},{id:"a2a-keys",type:"route",name:"API Keys",icon:(0,ye.jsx)(Sr,{size:20}),order:45,group:"Settings"},{id:"open-audit",type:"route",name:"Audit Log",icon:(0,ye.jsx)(kt,{size:20}),order:47,group:"Settings"},{id:"capability-bundles",type:"route",name:"Runtime Profiles",icon:(0,ye.jsx)(Er,{size:20}),order:46,group:"Settings"},{id:"tools",builtin:"tools",type:"route",name:"Tools",icon:(0,ye.jsx)(Br,{size:20}),order:50,group:"Settings"},{id:"tasks",type:"route",name:"Tasks",icon:(0,ye.jsx)(to,{size:20}),order:100}];var Iw=(0,Ue.lazy)(()=>import("./embed-page-AgentGovernanceWorkbench-ZNW72EEJ.js").then(e=>({default:e.AgentGovernanceWorkbench}))),Aw=(0,Ue.lazy)(()=>import("./embed-page-TopologyRuntimeView-PU2D7VZ7.js").then(e=>({default:e.TopologyRuntimeView}))),Ew=(0,Ue.lazy)(()=>import("./embed-page-WorkflowAutomationView-ST76M33F.js").then(e=>({default:e.WorkflowAutomationView}))),Nw=(0,Ue.lazy)(()=>import("./embed-page-TasksSideApp-MQTUCJO4.js").then(e=>({default:e.TasksSideApp}))),Mw=(0,Ue.lazy)(()=>import("./embed-page-AgentDetailSideApp-7PQ2JKG6.js").then(e=>({default:e.AgentDetailSideApp})));var Be=n(i());function Bs(e){let{contentType:t,assistantId:o,contentConfig:r,workspaceId:s,projectId:a}=e;return t==="agent"?{agentId:o,workspaceId:s||void 0,projectId:a||void 0}:{...r,workspaceId:s||void 0,projectId:a||void 0}}async function Ds(e,t,o){let{contentType:r,assistantId:s,contentConfig:a,isMatch:d}=t;if(!(r==="agent"?!!s:!!a)||!o)return{isPinned:!1,pinnedId:null};let p=await e("/api/menu-items?menuTarget=workspace");if(p.success&&p.data?.records){let u=d??(x=>r==="agent"&&x.agentId===s),b=p.data.records.find(x=>x.contentType===r&&u(x.contentConfig));if(b)return{isPinned:!0,pinnedId:b.id}}return{isPinned:!1,pinnedId:null}}async function Fs(e,t){let{contentType:o,name:r,group:s}=t,a=Bs(t),d={menuTarget:"workspace",contentType:o,contentConfig:a,group:s?.trim()||void 0,name:r.trim(),sortOrder:0},c=await e("/api/menu-items",d);if(!c.success)throw new Error(c.message||"Failed to pin");return{id:c.data.id}}async function zs(e,t){let o=await e(`/api/menu-items/${t}`);if(!o.success)throw new Error(o.message||"Failed to unpin")}function uo(){let e=he.default.useContext(Fr),{config:t}=Ce(),{post:o,get:r,del:s}=ue(),a=t.enableCustomMenu??!1,d=(0,he.useCallback)(async u=>Ds(r,u,a),[r,a]),c=(0,he.useCallback)(async u=>Fs(o,{...u,workspaceId:e?.workspaceId,projectId:e?.projectId}),[o,e]),p=(0,he.useCallback)(async u=>zs(s,u),[s]);return{check:d,pin:c,unpin:p,enableCustomMenu:a,get:r}}function ra(e){let t=new Set;for(let o of e)o.group?.trim()&&t.add(o.group.trim());return Array.from(t).sort()}function ln(){let{config:e}=Ce(),t=he.default.useMemo(()=>ra(na),[]),o=he.default.useMemo(()=>ra(e.workspaceMenuItems??[]),[e.workspaceMenuItems]);return he.default.useMemo(()=>Array.from(new Set([...t,...o])).sort(),[t,o])}async function cn(e){let t=await e("/api/menu-items?menuTarget=workspace");if(t.success&&t.data?.records){let o=new Set;for(let r of t.data.records)r.group?.trim()&&o.add(r.group.trim());return Array.from(o).sort()}return[]}var js={display:"flex",flexDirection:"column",gap:12},Pn=({assistantId:e,contentType:t="agent",contentConfig:o,isMatch:r,size:s="small",label:a,block:d})=>{let{check:c,pin:p,unpin:u,enableCustomMenu:b,get:x}=uo(),[v,g]=(0,he.useState)(!1),[m,f]=(0,he.useState)(""),[W,j]=(0,he.useState)(""),[A,X]=(0,he.useState)(!1),[ee,pe]=(0,he.useState)(!1),[Q,S]=(0,he.useState)(null),[B,J]=(0,he.useState)(!0),Z=ln(),[E,se]=(0,he.useState)(Z);(0,he.useEffect)(()=>{se(Z)},[Z]),(0,he.useEffect)(()=>{v&&cn(x).then(I=>{se(Array.from(new Set([...Z,...I])).sort())})},[v]);let D=t==="agent"?!!e:!!o,$=(0,he.useCallback)(async()=>{if(!D||!b){J(!1);return}J(!0);try{let I=await c({contentType:t,assistantId:e,contentConfig:o,isMatch:r});pe(I.isPinned),S(I.pinnedId)}catch{}finally{J(!1)}},[D,b,c,t,e,o,r]);if((0,he.useEffect)(()=>{$()},[$]),!D||!b)return null;let le=async()=>{if(!W.trim()){q.warning("Please enter a menu name");return}X(!0);try{await p({contentType:t,assistantId:e,contentConfig:o,isMatch:r,name:W.trim(),group:m.trim()||void 0}),q.success("Pinned to menu"),window.dispatchEvent(new CustomEvent("menu:refresh")),g(!1),f(""),j(""),$()}catch(I){q.error(I.message||"Failed to pin to menu")}finally{X(!1)}},L=async()=>{if(Q){X(!0);try{await u(Q),q.success("Unpinned from menu"),window.dispatchEvent(new CustomEvent("menu:refresh")),pe(!1),S(null)}catch(I){q.error(I.message||"Failed to unpin from menu")}finally{X(!1)}}},R=()=>{ee?L():g(!0)};return(0,Be.jsxs)(Be.Fragment,{children:[(0,Be.jsx)(je,{title:ee?"Unpin from Menu":"Pin to Menu",children:a?(0,Be.jsx)(z,{type:"text",size:s,block:d,icon:ee?(0,Be.jsx)(Ve,{size:14,fill:"currentColor"}):(0,Be.jsx)(Ve,{size:14}),onClick:R,loading:B||A&&ee,children:a}):(0,Be.jsx)(z,{type:"text",size:s,block:d,icon:ee?(0,Be.jsx)(Ve,{size:14,fill:"currentColor"}):(0,Be.jsx)(Ve,{size:14}),onClick:R,loading:B||A&&ee})}),(0,Be.jsx)(me,{title:"Pin to Menu",open:v,onOk:le,onCancel:()=>g(!1),confirmLoading:A,okText:"Pin",children:(0,Be.jsxs)("div",{style:js,children:[(0,Be.jsx)(K,{placeholder:"Menu name (required)",value:W,onChange:I=>j(I.target.value)}),(0,Be.jsx)(Vt,{placeholder:"Group (optional, select or type new)",value:m,options:E.map(I=>({value:I})),onChange:I=>f(I),filterOption:(I,T)=>T?.value?.toUpperCase().includes(I.toUpperCase())??!1})]})})]})};var ae=n(w());var G=n(i()),Un=50,$s=C(({token:e,css:t})=>({container:t`
|
|
2191
|
-
position: relative;
|
|
2192
|
-
`,projectTrigger:t`
|
|
2193
|
-
display: flex;
|
|
2194
|
-
align-items: center;
|
|
2195
|
-
gap: 8px;
|
|
2196
|
-
cursor: pointer;
|
|
2197
|
-
padding: 4px 4px;
|
|
2198
|
-
border-radius: 8px;
|
|
2199
|
-
transition: all 0.2s ease;
|
|
2200
|
-
border: 1px solid transparent;
|
|
2201
|
-
background: transparent;
|
|
2202
|
-
|
|
2203
|
-
&:hover {
|
|
2204
|
-
background: ${e.colorBgTextHover};
|
|
2205
|
-
border-color: ${e.colorBorder};
|
|
2206
|
-
}
|
|
2207
|
-
`,projectTriggerIcon:t`
|
|
2208
|
-
display: flex;
|
|
2209
|
-
align-items: center;
|
|
2210
|
-
justify-content: center;
|
|
2211
|
-
width: 24px;
|
|
2212
|
-
height: 24px;
|
|
2213
|
-
border-radius: 6px;
|
|
2214
|
-
background: ${e.colorPrimaryBg};
|
|
2215
|
-
|
|
2216
|
-
svg {
|
|
2217
|
-
width: 14px;
|
|
2218
|
-
height: 14px;
|
|
2219
|
-
color: ${e.colorPrimary};
|
|
2220
|
-
}
|
|
2221
|
-
`,projectTriggerInfo:t`
|
|
2222
|
-
flex: 1;
|
|
2223
|
-
min-width: 0;
|
|
2224
|
-
`,projectTriggerName:t`
|
|
2225
|
-
font-size: 14px;
|
|
2226
|
-
font-weight: 600;
|
|
2227
|
-
color: ${e.colorText};
|
|
2228
|
-
white-space: nowrap;
|
|
2229
|
-
overflow: hidden;
|
|
2230
|
-
text-overflow: ellipsis;
|
|
2231
|
-
`,projectTriggerArrow:t`
|
|
2232
|
-
display: flex;
|
|
2233
|
-
align-items: center;
|
|
2234
|
-
|
|
2235
|
-
svg {
|
|
2236
|
-
width: 14px;
|
|
2237
|
-
height: 14px;
|
|
2238
|
-
color: ${e.colorTextSecondary};
|
|
2239
|
-
transition: transform 0.2s ease;
|
|
2240
|
-
}
|
|
2241
|
-
|
|
2242
|
-
&.expanded svg {
|
|
2243
|
-
transform: rotate(180deg);
|
|
2244
|
-
}
|
|
2245
|
-
`,sectionAction:t`
|
|
2246
|
-
display: flex;
|
|
2247
|
-
align-items: center;
|
|
2248
|
-
justify-content: center;
|
|
2249
|
-
width: 20px;
|
|
2250
|
-
height: 20px;
|
|
2251
|
-
border-radius: 4px;
|
|
2252
|
-
border: none;
|
|
2253
|
-
background: transparent;
|
|
2254
|
-
cursor: pointer;
|
|
2255
|
-
transition: all 0.15s ease;
|
|
2256
|
-
|
|
2257
|
-
&:hover {
|
|
2258
|
-
background: ${e.colorBgTextHover};
|
|
2259
|
-
}
|
|
2260
|
-
|
|
2261
|
-
&:disabled {
|
|
2262
|
-
cursor: not-allowed;
|
|
2263
|
-
opacity: 0.5;
|
|
2264
|
-
}
|
|
2265
|
-
|
|
2266
|
-
svg {
|
|
2267
|
-
width: 14px;
|
|
2268
|
-
height: 14px;
|
|
2269
|
-
color: ${e.colorTextSecondary};
|
|
2270
|
-
}
|
|
2271
|
-
`,workspaceButton:t`
|
|
2272
|
-
display: flex;
|
|
2273
|
-
align-items: center;
|
|
2274
|
-
justify-content: center;
|
|
2275
|
-
gap: 8px;
|
|
2276
|
-
cursor: pointer;
|
|
2277
|
-
padding: 4px 4px;
|
|
2278
|
-
border-radius: 8px;
|
|
2279
|
-
transition: all 0.2s ease;
|
|
2280
|
-
border: 1px solid transparent;
|
|
2281
|
-
background: transparent;
|
|
2282
|
-
|
|
2283
|
-
&:hover {
|
|
2284
|
-
background: ${e.colorBgTextHover};
|
|
2285
|
-
border-color: ${e.colorBorder};
|
|
2286
|
-
}
|
|
2287
|
-
`,workspaceButtonIcon:t`
|
|
2288
|
-
display: flex;
|
|
2289
|
-
align-items: center;
|
|
2290
|
-
justify-content: center;
|
|
2291
|
-
width: 24px;
|
|
2292
|
-
height: 24px;
|
|
2293
|
-
border-radius: 6px;
|
|
2294
|
-
background: ${e.colorPrimaryBg};
|
|
2295
|
-
|
|
2296
|
-
svg {
|
|
2297
|
-
width: 14px;
|
|
2298
|
-
height: 14px;
|
|
2299
|
-
color: ${e.colorPrimary};
|
|
2300
|
-
}
|
|
2301
|
-
`,workspaceButtonName:t`
|
|
2302
|
-
font-size: 14px;
|
|
2303
|
-
font-weight: 600;
|
|
2304
|
-
color: ${e.colorText};
|
|
2305
|
-
white-space: nowrap;
|
|
2306
|
-
overflow: hidden;
|
|
2307
|
-
text-overflow: ellipsis;
|
|
2308
|
-
`,selectorWrapper:t`
|
|
2309
|
-
display: flex;
|
|
2310
|
-
align-items: center;
|
|
2311
|
-
gap: 8px;
|
|
2312
|
-
`,divider:t`
|
|
2313
|
-
font-size: 14px;
|
|
2314
|
-
color: ${e.colorTextQuaternary};
|
|
2315
|
-
user-select: none;
|
|
2316
|
-
`,projectDropdown:t`
|
|
2317
|
-
position: absolute;
|
|
2318
|
-
top: 100%;
|
|
2319
|
-
left: 0;
|
|
2320
|
-
right: auto;
|
|
2321
|
-
min-width: 220px;
|
|
2322
|
-
margin-top: 4px;
|
|
2323
|
-
display: flex;
|
|
2324
|
-
flex-direction: column;
|
|
2325
|
-
gap: 2px;
|
|
2326
|
-
padding: 4px;
|
|
2327
|
-
background: color-mix(in srgb, ${e.colorBgContainer} 72%, transparent);
|
|
2328
|
-
backdrop-filter: blur(12px) saturate(150%);
|
|
2329
|
-
-webkit-backdrop-filter: blur(12px) saturate(150%);
|
|
2330
|
-
border-radius: 8px;
|
|
2331
|
-
border: 1px solid color-mix(in srgb, ${e.colorBorder} 60%, transparent);
|
|
2332
|
-
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
|
|
2333
|
-
z-index: 100;
|
|
2334
|
-
max-height: 300px;
|
|
2335
|
-
overflow-y: auto;
|
|
2336
|
-
white-space: nowrap;
|
|
2337
|
-
`,projectDropdownItem:t`
|
|
2338
|
-
display: flex;
|
|
2339
|
-
align-items: center;
|
|
2340
|
-
gap: 8px;
|
|
2341
|
-
padding: 8px 10px;
|
|
2342
|
-
border-radius: 6px;
|
|
2343
|
-
cursor: pointer;
|
|
2344
|
-
transition: all 0.15s ease;
|
|
2345
|
-
|
|
2346
|
-
&:hover {
|
|
2347
|
-
background: ${e.colorBgTextHover};
|
|
2348
|
-
}
|
|
2349
|
-
|
|
2350
|
-
&.active {
|
|
2351
|
-
background: ${e.colorPrimaryBg};
|
|
2352
|
-
}
|
|
2353
|
-
`,projectDropdownItemIcon:t`
|
|
2354
|
-
display: flex;
|
|
2355
|
-
align-items: center;
|
|
2356
|
-
justify-content: center;
|
|
2357
|
-
width: 20px;
|
|
2358
|
-
height: 20px;
|
|
2359
|
-
border-radius: 4px;
|
|
2360
|
-
|
|
2361
|
-
svg {
|
|
2362
|
-
width: 14px;
|
|
2363
|
-
height: 14px;
|
|
2364
|
-
color: ${e.colorTextSecondary};
|
|
2365
|
-
}
|
|
2366
|
-
`,projectDropdownItemName:t`
|
|
2367
|
-
font-size: 13px;
|
|
2368
|
-
font-weight: 500;
|
|
2369
|
-
color: ${e.colorText};
|
|
2370
|
-
flex: 1;
|
|
2371
|
-
`,projectDropdownItemNameActive:t`
|
|
2372
|
-
font-size: 13px;
|
|
2373
|
-
font-weight: 600;
|
|
2374
|
-
color: ${e.colorPrimary};
|
|
2375
|
-
flex: 1;
|
|
2376
|
-
`,emptyState:t`
|
|
2377
|
-
padding: 12px;
|
|
2378
|
-
text-align: center;
|
|
2379
|
-
color: ${e.colorTextSecondary};
|
|
2380
|
-
font-size: 12px;
|
|
2381
|
-
`,modalWrap:t`
|
|
2382
|
-
.ant-modal-content {
|
|
2383
|
-
border-radius: 12px;
|
|
2384
|
-
}
|
|
2385
|
-
`,modalFooter:t`
|
|
2386
|
-
display: flex;
|
|
2387
|
-
justify-content: flex-end;
|
|
2388
|
-
gap: 8px;
|
|
2389
|
-
`})),Ro=({disableDropdown:e=!0,showWorkspace:t=!0,value:o,onChange:r,kind:s})=>{let{styles:a}=$s(),{workspaceId:d,workspaces:c,projectId:p,projects:u,trainingProjects:b=[],personalProjects:x=[],setWorkspace:v,setProject:g,createProject:m}=Se(),[f,W]=(0,ae.useState)(!1),j=(0,ae.useRef)(null),A=(0,ae.useRef)(null),[X,ee]=(0,ae.useState)(!1),[pe,Q]=(0,ae.useState)(!1),[S,B]=(0,ae.useState)(""),[J,Z]=(0,ae.useState)(null),[E,se]=(0,ae.useState)(!1),D=(0,ae.useRef)(null),$=o!==void 0,le=$?o:p,L=(0,ae.useMemo)(()=>{if(s==="business")return u;if(s==="training")return b;if(s==="personal")return x;let O=new Map;for(let fe of[...u,...b,...x])O.has(fe.id)||O.set(fe.id,fe);return Array.from(O.values())},[s,u,b,x]);(0,ae.useEffect)(()=>{let O=fe=>{A.current&&!A.current.contains(fe.target)&&(ee(!1),W(!1))};return document.addEventListener("mousedown",O),()=>document.removeEventListener("mousedown",O)},[]);let R=(0,ae.useMemo)(()=>L.find(O=>O.id===le),[L,le]),I=(0,ae.useMemo)(()=>c.find(O=>O.id===d),[c,d]),T=(0,ae.useCallback)(O=>{$?r?.(O):g(O),ee(!1)},[$,r,g]),ce=(0,ae.useCallback)(()=>{$?r?.(null):g(null)},[$,r,g]),k=(0,ae.useCallback)(()=>{ee(O=>!O)},[]),ne=(0,ae.useCallback)(()=>{W(O=>!O)},[]),F=(0,ae.useCallback)(O=>{let fe=O.trim();return fe?fe.length>Un?`Name must be ${Un} characters or less`:null:"Project name is required"},[]),U=(0,ae.useCallback)(O=>{if(O.stopPropagation(),!d){q.warning("Please select a workspace first");return}B(""),Z(null),Q(!0),setTimeout(()=>D.current?.input?.focus(),100)},[d]),We=(0,ae.useCallback)(()=>{Q(!1),B(""),Z(null)},[]),He=O=>{let fe=O.target.value;B(fe),Z(F(fe))},Ze=(0,ae.useCallback)(async()=>{if(!d)return;let O=S.trim(),fe=F(O);if(fe){Z(fe);return}se(!0),Z(null);try{let it=await m(d,{name:O});Q(!1),B(""),Z(null),$?r?.(it.id):g(it.id),q.success(`Project "${it.name}" created`)}catch(it){let Ye=it instanceof Error?it.message:"Failed to create project";Z(Ye)}finally{se(!1)}},[d,S,F,m,g,$,r]),ft=O=>{O.key==="Enter"&&!O.shiftKey&&(O.preventDefault(),F(S.trim())||Ze())},rt=!F(S.trim());return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)("div",{className:a.container,ref:A,children:(0,G.jsxs)("div",{className:a.selectorWrapper,children:[t&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)("div",{style:{position:"relative"},ref:j,children:(0,G.jsx)("button",{className:a.workspaceButton,onClick:ce,title:I?.name||"Select Workspace",children:(0,G.jsx)("div",{className:a.workspaceButtonIcon,children:(0,G.jsx)(fr,{size:16})})})}),(0,G.jsx)("span",{className:a.divider,children:"/"})]}),(0,G.jsxs)("div",{className:a.projectTrigger,onClick:e?void 0:k,style:{cursor:e?"default":"pointer"},children:[(0,G.jsx)("div",{className:a.projectTriggerIcon,children:(0,G.jsx)(Wo,{size:16})}),(0,G.jsx)("div",{className:a.projectTriggerInfo,children:(0,G.jsx)("div",{className:a.projectTriggerName,children:R?.name||"Select Project"})}),!e&&(0,G.jsx)("div",{className:`${a.projectTriggerArrow} ${X?"expanded":""}`,children:(0,G.jsx)(eo,{size:14})})]}),!e&&X&&(0,G.jsxs)("div",{className:a.projectDropdown,children:[L.map(O=>(0,G.jsxs)("div",{className:`${a.projectDropdownItem} ${O.id===le?"active":""}`,onClick:()=>T(O.id),children:[(0,G.jsx)("div",{className:a.projectDropdownItemIcon,children:(0,G.jsx)(Wo,{size:14})}),(0,G.jsx)("div",{className:O.id===le?a.projectDropdownItemNameActive:a.projectDropdownItemName,children:O.name})]},O.id)),L.length===0&&(0,G.jsx)("div",{className:a.emptyState,children:"No projects"})]})]})}),(0,G.jsxs)(me,{title:"Create New Project",open:pe,onCancel:We,wrapClassName:a.modalWrap,centered:!0,destroyOnClose:!0,maskClosable:!E,keyboard:!0,closable:!0,footer:(0,G.jsxs)("div",{className:a.modalFooter,children:[(0,G.jsx)(z,{onClick:We,disabled:E,children:"Cancel"}),(0,G.jsx)(z,{type:"primary",onClick:Ze,loading:E,disabled:!rt,children:"Create"})]}),children:[(0,G.jsx)(K,{ref:D,value:S,onChange:He,onKeyDown:ft,placeholder:"Enter project name",maxLength:Un+10,status:J?"error":void 0}),J&&(0,G.jsx)("div",{style:{color:"#ff4d4f",fontSize:"12px",marginTop:"4px"},children:J})]})]})};var De=n(w());var aa=n(i()),ia=()=>{let{config:e}=Ce(),{openSideApp:t}=ke(),{workspaceId:o,projectId:r,listPath:s,listPathByFolder:a,getFileViewUrl:d,getFileDownloadUrl:c,uploadFileToFolder:p}=Se(),{currentAssistant:u}=et(),[b,x]=(0,De.useState)({}),[v,g]=(0,De.useState)({}),[m,f]=(0,De.useState)({}),[W,j]=(0,De.useState)({}),[A,X]=(0,De.useState)({}),[ee,pe]=(0,De.useState)(null),Q=(0,De.useMemo)(()=>e.resourceFolders&&e.resourceFolders.length>0?e.resourceFolders:[{name:"/",displayName:"Project Assets",allowUpload:!0}],[e.resourceFolders]),S=(0,De.useCallback)(async(E,se=!0)=>{if(!o||!r){x(D=>({...D,[E.name]:[]}));return}g(D=>({...D,[E.name]:!0}));try{let D=await a(E.name,u?.id);if(x($=>({...$,[E.name]:D})),se){let $=E.name==="/"?"/":E.name.replace(/\/$/,"");f(le=>{let L={...le};return Object.keys(L).forEach(R=>{(R===$||R.startsWith(`${$}/`))&&delete L[R]}),L}),X(le=>{let L={...le};return Object.keys(L).forEach(R=>{(R===$||R.startsWith(`${$}/`))&&delete L[R]}),L})}}catch(D){console.error(`Failed to load assets for folder ${E.name}:`,D),x($=>({...$,[E.name]:[]}))}finally{g(D=>({...D,[E.name]:!1}))}},[o,r,a,u?.id]),B=(0,De.useCallback)(async E=>{if(A[E]||!1){X(D=>({...D,[E]:!1}));return}X(D=>({...D,[E]:!0})),j(D=>({...D,[E]:!0}));try{let D=await s(E,u?.id);f($=>({...$,[E]:D}))}catch(D){console.error(`Failed to load directory ${E}:`,D),f($=>({...$,[E]:[]}))}finally{j(D=>({...D,[E]:!1}))}},[A,s,u?.id]);(0,De.useEffect)(()=>{Q.forEach(E=>{S(E,!1)})},[Q,S]);let J=(0,De.useCallback)(E=>{let se=d(E.path,u?.id),D=c(E.path,u?.id);if(!se||!D){q.warning("Please select a workspace and project first.");return}t({component_key:"attachments",data:{file_id:E.path,message:`Preview: ${E.name||E.path}`,full_url:se,download_url:D},message:`Preview: ${E.name||E.path}`})},[d,c,t,u?.id]),Z=(0,De.useCallback)(async E=>{if(!o||!r){q.warning("Please select a workspace and project before uploading.");return}let se=document.createElement("input");se.type="file",se.onchange=async D=>{let le=D.target?.files?.[0];if(le){pe(E);try{await p(E,le,u?.id),q.success(`Uploaded "${le.name}" successfully`);let L=Q.find(R=>R.name===E);L&&await S(L)}catch(L){let R=L instanceof Error?L.message:"Failed to upload file";q.error(R)}finally{pe(null),se.remove()}}},se.click()},[o,r,p,Q,S,u?.id]);return(0,aa.jsx)(sn,{workspaceId:o,projectId:r,resourceFolders:Q,folderEntries:b,folderLoading:v,directoryChildren:m,directoryLoading:W,directoryExpanded:A,uploadingFolder:ee,onRefreshFolder:S,onUploadFolder:Z,onToggleDirectory:B,onAssetClick:J})};var To=n(w());var Qe=n(i()),{Text:_s,Paragraph:Ls}=P,sa={185:"Maximum update depth exceeded \u2014 likely an infinite re-render loop",31:"Objects are not valid as a React child",130:"Element type is invalid \u2014 check render method",152:"Too many re-renders \u2014 React limits renders to prevent an infinite loop",301:"Rendered fewer hooks than expected",306:"Rendered more hooks than during the previous render",310:"Rendered more hooks than during the previous render",321:"Invalid hook call \u2014 hooks can only be called inside function components",418:"Hydration failed because the server rendered content didn't match the client",423:"Hydration error \u2014 server/client mismatch in suspense boundary",424:"Could not find recovery element for hydrated instance",425:"Text content doesn't match server-rendered HTML"};function Os(e){if(!e)return"";let t=e.message?.match(/Minified React error #(\d+)/);return t&&sa[t[1]]?`${e.name}: Minified React error #${t[1]} \u2014 ${sa[t[1]]}`:`${e.name}: ${e.message}`}var gt=class extends To.Component{constructor(t){super(t),this.state={hasError:!1,error:null,errorInfo:null,retryKey:0}}static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t,o){let r=this.props.name||"ChatErrorBoundary";console.error(`[${r}] Caught rendering error:`,t,o),this.setState({errorInfo:o}),this.props.onError?.(t,o)}handleRetry=()=>{this.setState(t=>({hasError:!1,error:null,errorInfo:null,retryKey:t.retryKey+1}))};handleCopyError=()=>{let{error:t,errorInfo:o}=this.state,s=[`[${this.props.name||"ChatErrorBoundary"}]`,`Error: ${t?.name}: ${t?.message}`,`Stack: ${t?.stack}`,`Component Stack: ${o?.componentStack}`].join(`
|
|
2390
|
-
|
|
2391
|
-
`);navigator.clipboard.writeText(s).then(()=>{q.success("Error details copied")}).catch(()=>{q.error("Failed to copy")})};render(){if(this.state.hasError){if(this.props.fallback)return this.props.fallback;let{error:t,errorInfo:o}=this.state,r=this.props.name||"this section";return(0,Qe.jsx)(Vn,{status:"error",title:`Failed to render ${r}`,subTitle:(0,Qe.jsxs)(de,{direction:"vertical",size:"small",style:{textAlign:"left"},children:[(0,Qe.jsx)(_s,{type:"danger",strong:!0,children:Os(t)}),(t?.stack||o?.componentStack)&&(0,Qe.jsx)(Et,{size:"small",ghost:!0,items:[{key:"details",label:"Error details",children:(0,Qe.jsxs)(Ls,{code:!0,style:{maxHeight:200,overflow:"auto",whiteSpace:"pre-wrap",fontSize:12},children:[t?.stack||"",t?.stack&&o?.componentStack?`
|
|
2392
|
-
|
|
2393
|
-
`:"",o?.componentStack||""]})}]})]}),extra:[(0,Qe.jsx)(z,{icon:(0,Qe.jsx)(nr,{}),onClick:this.handleCopyError,children:"Copy Details"},"copy"),(0,Qe.jsx)(z,{type:"primary",onClick:this.handleRetry,children:"Retry"},"retry")]})}return(0,Qe.jsx)(To.default.Fragment,{children:this.props.children},this.state.retryKey)}};var oe=n(i()),Ws=C(({css:e})=>({wrapper:e`
|
|
2394
|
-
display: flex;
|
|
2395
|
-
flex-direction: column;
|
|
2396
|
-
width: 100%;
|
|
2397
|
-
height: 100%;
|
|
2398
|
-
`,headerBar:e`
|
|
2399
|
-
display: flex;
|
|
2400
|
-
align-items: center;
|
|
2401
|
-
justify-content: space-between;
|
|
2402
|
-
gap: 12px;
|
|
2403
|
-
width: 100%;
|
|
2404
|
-
`,headerLeft:e`
|
|
2405
|
-
display: flex;
|
|
2406
|
-
align-items: center;
|
|
2407
|
-
min-width: 0;
|
|
2408
|
-
flex: 1;
|
|
2409
|
-
`,headerRight:e`
|
|
2410
|
-
display: flex;
|
|
2411
|
-
align-items: center;
|
|
2412
|
-
justify-content: flex-end;
|
|
2413
|
-
flex-shrink: 0;
|
|
2414
|
-
`})),Us=e=>{let{assistant_id:t,thread_id:o="",menu:r,header:s,headerRight:a,showProjectSelector:d,headerSelector:c,emptyPlaceholder:p,...u}=e,{config:b}=Ce(),{styles:x}=Ws(),v=d??b.enableWorkspace,g=(0,oe.jsxs)("div",{className:x.headerBar,children:[(0,oe.jsx)("div",{className:x.headerLeft,children:c??(v?(0,oe.jsx)(Ro,{}):null)}),(0,oe.jsx)("div",{className:x.headerRight,children:a!==void 0?a:(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(Pn,{assistantId:t}),(0,oe.jsx)(zn,{}),(0,oe.jsx)(Go,{})]})})]});return(0,oe.jsxs)("div",{className:x.wrapper,children:[s,(0,oe.jsx)(ht,{menu:r?(0,oe.jsx)(gt,{name:"Sidebar",children:r}):void 0,header:g,main:(0,oe.jsx)(gt,{name:"Chat panel",children:o?(0,oe.jsx)(_r,{...u}):p??(0,oe.jsx)("div",{children:"Please create a conversation first"})}),detail:(0,oe.jsx)(gt,{name:"Detail panel",children:(0,oe.jsx)(po,{})}),tools:(0,oe.jsx)(gt,{name:"Tools panel",children:(0,oe.jsx)(ia,{})})})]})},Po=e=>(0,oe.jsx)(gt,{name:"Thread",children:(0,oe.jsx)(Ko,{assistantId:e.assistant_id,threadId:e.thread_id||"",options:{streaming:!0,enableReturnStateWhenStreamCompleted:!0,enableResumeStream:!0},children:(0,oe.jsx)(io.Provider,{value:null,children:(0,oe.jsx)(lt,{children:(0,oe.jsx)(Us,{...e})})})})});var nt=n(i()),Hs=({thread_id:e,name:t,description:o,headerSelector:r,...s})=>{let{currentAssistant:a}=et(),{thread:d}=tt(),c=e??d?.id??"";return c?(0,nt.jsx)(Po,{thread_id:c,name:t??a?.name,description:o??a?.description,headerSelector:r??(0,nt.jsx)(Ro,{showWorkspace:!1,disableDropdown:!1}),...s}):(0,nt.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"},children:(0,nt.jsx)(re,{tip:"Creating conversation..."})})},Ki=({defaultWorkspaceId:e,defaultProjectId:t,assistant_id:o,...r})=>(0,nt.jsx)(Lr,{defaultWorkspaceId:e,defaultProjectId:t,children:(0,nt.jsx)(jo,{autoLoad:!0,initialAssistantId:o,children:(0,nt.jsx)(no,{children:(0,nt.jsx)(Hs,{assistant_id:o,...r})})})});var Ne=n(w());var Fe=class extends Error{code;retryable;status;constructor(t,o,r,s){super(o),this.name="AgentWebAppRuntimeClientError",this.code=t,this.retryable=r,this.status=s}};function wt(){return new Fe("STREAM_FAILED","Stream failed",!0)}var Ks=new Set(["WEB_APP_NOT_FOUND","WEB_APP_DISABLED","USER_ID_REQUIRED","INVALID_USER_ID","PROJECT_NOT_ALLOWED","PROJECT_SELECTOR_DISABLED","MODEL_NOT_ALLOWED","FEATURE_DISABLED","THREAD_NOT_FOUND","STREAM_CONFLICT","STREAM_FAILED","INVALID_REQUEST","INTERNAL_ERROR"]);function It(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Je(e,t){return Object.keys(e).length===t.length&&t.every(r=>r in e)}function qs(e){return It(e)&&Je(e,["code","message","retryable"])&&typeof e.code=="string"&&Ks.has(e.code)&&typeof e.message=="string"&&typeof e.retryable=="boolean"}function Vs(e){if(!It(e))return!1;let t=e.data===void 0?["id","type","prompt"]:["id","type","prompt","data"];return Je(e,t)&&typeof e.id=="string"&&typeof e.type=="string"&&typeof e.prompt=="string"&&(e.data===void 0||It(e.data))}var Gs=new Set([at.HUMAN,at.AI,at.TOOL,at.INTERRUPT,at.MESSAGE_COMPLETED,at.MESSAGE_FAILED,at.THREAD_IDLE]);function Qs(e,t){let o;try{o=JSON.parse(e)}catch{throw wt()}if(!It(o)||typeof o.type!="string")throw wt();if(Gs.has(o.type)||o.type==="error"&&It(o.data)&&!It(o.error)){let r=Xn(o,t);return r.length===0?[]:r}switch(o.type){case"message.delta":if(Je(o,["type","text"])&&typeof o.text=="string")return[o];break;case"message.completed":if(Je(o,["type","messageId"])&&typeof o.messageId=="string")return[o];break;case"tool.started":if(Je(o,["type","id","name"])&&typeof o.id=="string"&&typeof o.name=="string")return[o];break;case"tool.completed":if(Je(o,["type","id"])&&typeof o.id=="string")return[o];break;case"interrupt.created":if(Je(o,["type","interrupt"])&&Vs(o.interrupt))return[o];break;case"genui.render":if(Je(o,["type","block"])&&Gt(o.block))return[o];break;case"error":if(Je(o,["type","error"])&&qs(o.error))return[o];break;case"stream.completed":if(Je(o,["type"]))return[o];break}throw wt()}function Ys(e){return e instanceof Error&&e.name==="AbortError"}async function la(e,t){let o=Yn({allowGenUI:!0,allowInterrupts:!0}),r=e.getReader(),s=new TextDecoder,a="",d=!1,c=!1;try{for(;!d;){let p;try{p=await r.read()}catch(b){if(Ys(b))return;throw wt()}p.done&&(c=!0);try{a+=s.decode(p.value,{stream:!p.done})}catch{throw wt()}let u=a.split(/\r?\n\r?\n/);a=p.done?"":u.pop()??"";for(let b of u){let x=b.split(/\r?\n/).filter(v=>v==="data"||v.startsWith("data:")).map(v=>v==="data"?"":v.slice(5).replace(/^ /,""));if(x.length!==0){for(let v of Qs(x.join(`
|
|
2415
|
-
`),o))if(await t(v),d=v.type==="stream.completed",d)break;if(d)break}}if(p.done)break}if(!d)throw wt()}finally{if(!c)try{await r.cancel()}catch{}r.releaseLock()}}var Xs=new Set(["WEB_APP_NOT_FOUND","WEB_APP_DISABLED","USER_ID_REQUIRED","INVALID_USER_ID","PROJECT_NOT_ALLOWED","PROJECT_SELECTOR_DISABLED","MODEL_NOT_ALLOWED","FEATURE_DISABLED","THREAD_NOT_FOUND","STREAM_CONFLICT","STREAM_FAILED","INVALID_REQUEST","INTERNAL_ERROR"]);function Ee(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function ze(e,t,o=[]){let r=Object.keys(e);return t.every(s=>s in e)&&r.every(s=>t.includes(s)||o.includes(s))}function te(e){return typeof e=="string"}function Io(e){if(!Ee(e)||!ze(e,["id","projectId","createdAt","updatedAt"],["label"])||!te(e.id)||!te(e.projectId)||e.label!==void 0&&!te(e.label)||!te(e.createdAt)||!te(e.updatedAt))return;let t=new Date(e.createdAt),o=new Date(e.updatedAt);if(!(Number.isNaN(t.getTime())||Number.isNaN(o.getTime())))return{id:e.id,projectId:e.projectId,...e.label===void 0?{}:{label:e.label},createdAt:t,updatedAt:o}}function ca(e){if(!Ee(e)||e.success!==!1||!Ee(e.error))return!1;let t=e.error;return ze(e,["success","error"])&&ze(t,["code","message","retryable"])&&typeof t.code=="string"&&Xs.has(t.code)&&typeof t.message=="string"&&typeof t.retryable=="boolean"}function Js(e){if(!Ee(e))return!1;let t=["projectSelector","modelSelector","threadManagement","attachments","hitl","genUI"];return ze(e,t,["files"])&&t.every(o=>typeof e[o]=="boolean")&&(e.files===void 0||typeof e.files=="boolean")}function Zs(e){return Array.isArray(e)&&e.length<=6&&e.every(t=>Ee(t)&&ze(t,["label","text"])&&te(t.label)&&t.label.length>=1&&t.label.length<=40&&te(t.text)&&t.text.length>=1&&t.text.length<=500)}function el(e){return Ee(e)&&ze(e,[],["title","welcomeMessage","primaryColor","quickPrompts"])&&(e.title===void 0||te(e.title))&&(e.welcomeMessage===void 0||te(e.welcomeMessage))&&(e.primaryColor===void 0||te(e.primaryColor))&&(e.quickPrompts===void 0||Zs(e.quickPrompts))}function tl(e){if(!Ee(e)||!ze(e,["webApp","projects","models"],["thread"])||!Ee(e.webApp))return;let t=e.webApp;if(!ze(t,["id","name","assistant","defaultProjectId","features","appearance","identityAssurance"],["description","defaultModelKey"])||!te(t.id)||!te(t.name)||!te(t.defaultProjectId)||t.description!==void 0&&!te(t.description)||t.defaultModelKey!==void 0&&!te(t.defaultModelKey)||t.identityAssurance!=="unverified"||!Ee(t.assistant)||!ze(t.assistant,["id","name"],["description"])||!te(t.assistant.id)||!te(t.assistant.name)||t.assistant.description!==void 0&&!te(t.assistant.description)||!Js(t.features)||!el(t.appearance)||!Array.isArray(e.projects)||!e.projects.every(r=>Ee(r)&&ze(r,["id","name"])&&te(r.id)&&te(r.name))||!Array.isArray(e.models)||!e.models.every(r=>Ee(r)&&ze(r,["key","label"])&&te(r.key)&&te(r.label)))return;let o=e.thread===void 0?void 0:Io(e.thread);if(!(e.thread!==void 0&&!o))return{...e,...o?{thread:o}:{}}}function ol(e){if(!Ee(e)||!ze(e,["records","total"])||!Array.isArray(e.records)||typeof e.total!="number")return;let t=e.records.map(Io);return t.every(o=>o!==void 0)?{records:t,total:e.total}:void 0}function nl(e){return Ee(e)&&te(e.id)&&(e.role==="human"||e.role==="ai")&&(e.content===void 0||te(e.content)||Array.isArray(e.content)&&e.content.every(t=>Gt(t)!==void 0))}function rl(e){return Ee(e)&&ze(e,["messages"])&&Array.isArray(e.messages)&&e.messages.every(nl)?e:void 0}function il(e){return Ee(e)&&ze(e,["ref","name","mimeType","size"])&&te(e.ref)&&te(e.name)&&te(e.mimeType)&&typeof e.size=="number"?e:void 0}function da(e,t){return o=>Ee(o)&&ze(o,e)&&t(o)?o:void 0}var Ao=class{constructor(t){this.options=t;this.baseUrl=`${t.gatewayUrl.replace(/\/+$/,"")}/api/web-apps/${encodeURIComponent(t.webAppId)}/runtime`,this.fetchImplementation=t.fetch??globalThis.fetch.bind(globalThis)}baseUrl;fetchImplementation;async bootstrap(t={},o){return this.request("bootstrap",tl,{query:t,signal:o})}async listThreads(t={},o){return this.request("threads",ol,{query:t,signal:o})}async createThread(t={},o){return this.request("threads",Io,{method:"POST",body:t,signal:o})}async updateThread(t,o,r){return this.request(`threads/${encodeURIComponent(t)}`,Io,{method:"PATCH",body:o,signal:r})}async deleteThread(t,o={},r){await this.request(`threads/${encodeURIComponent(t)}`,da(["id"],s=>te(s.id)),{method:"DELETE",query:o,signal:r})}async getMessages(t,o={},r){return this.request(`threads/${encodeURIComponent(t)}/messages`,rl,{query:o,signal:r})}async streamMessage(t,o,r,s){return this.streamRequest(`threads/${encodeURIComponent(t)}/messages/stream`,o,r,s)}async resumeInterrupt(t,o,r,s,a){return this.streamRequest(`threads/${encodeURIComponent(t)}/interrupts/${encodeURIComponent(o)}/resume`,r,s,a)}async streamRequest(t,o,r,s){let a;try{a=await this.fetchRequest(t,{method:"POST",body:o,signal:s})}catch(d){throw pa(d)||d instanceof Fe?d:new Fe("STREAM_FAILED","Stream failed",!0)}if(a.ok||await this.throwResponseError(a),!a.body||!a.headers.get("content-type")?.toLowerCase().includes("text/event-stream")){if(a.body)try{await a.body.cancel()}catch{}throw new Fe("STREAM_FAILED","Stream failed",!0,a.status)}await la(a.body,r)}async abort(t,o={},r){await this.request(`threads/${encodeURIComponent(t)}/abort`,da(["aborted"],s=>typeof s.aborted=="boolean"),{method:"POST",query:o,signal:r})}async uploadAttachment(t,o,r={},s){let a=new FormData,d=typeof File<"u"&&o instanceof File?o.name:"attachment";return a.append("file",o,d),this.request(`threads/${encodeURIComponent(t)}/attachments`,il,{method:"POST",query:r,body:a,signal:s})}async request(t,o,r={}){let s;try{s=await this.fetchRequest(t,r)}catch(c){throw pa(c)||c instanceof Fe?c:new Fe("INTERNAL_ERROR","Request failed",!0)}let a;try{a=await s.json()}catch{throw this.internalError(s.status)}if(ca(a))throw new Fe(a.error.code,a.error.message,a.error.retryable,s.status);if(!s.ok||!Ee(a)||!ze(a,["success","data"])||a.success!==!0)throw this.internalError(s.status);let d=o(a.data);if(d===void 0)throw this.internalError(s.status);return d}async fetchRequest(t,o){let r=await this.options.identityProvider.getIdentity(o.signal),s=new URL(`${this.baseUrl}/${t}`);for(let[c,p]of Object.entries(o.query??{}))p!==void 0&&s.searchParams.set(c,p);let a=new Headers;r.bearerToken!==void 0?a.set("Authorization",`Bearer ${r.bearerToken}`):a.set("X-Axiom-External-User-Id",r.externalUserId??"");let d;return o.body instanceof FormData?d=o.body:o.body!==void 0&&(a.set("Content-Type","application/json"),d=JSON.stringify(o.body)),this.fetchImplementation(s,{method:o.method??"GET",headers:a,body:d,signal:o.signal,credentials:"omit"})}async throwResponseError(t){let o;try{o=await t.json()}catch{throw this.internalError(t.status)}throw ca(o)?new Fe(o.error.code,o.error.message,o.error.retryable,t.status):this.internalError(t.status)}internalError(t){return new Fe("INTERNAL_ERROR","Invalid server response",!1,t)}};function pa(e){return typeof e=="object"&&e!==null&&"name"in e&&e.name==="AbortError"}var Eo=n(w());var At=n(i());function ma(){let{createThread:e}=tt(),{menuCollapsed:t,setMenuCollapsed:o}=ke();(0,Eo.useEffect)(()=>{t===void 0&&o(!0)},[t,o]);let r=(0,Eo.useCallback)(async()=>{try{await e("New Thread")}catch(u){console.error("Failed to create new thread:",u)}},[e]),s=t??!0,p=[{id:"new-analysis",builtin:"new-analysis",type:"action",name:"New Thread",icon:(0,At.jsx)(hr,{size:20}),order:0},...s?[{id:"thread-history-toggle",type:"action",name:"History",icon:(0,At.jsx)(kt,{size:20}),order:1}]:[{id:"thread-history",builtin:"thread-history",type:"drawer",name:"History",icon:(0,At.jsx)(kt,{size:20}),order:1,title:"Conversation History",width:320,inline:!0,inlineDefaultExpanded:!0,content:(0,At.jsx)(_n,{})}]];return(0,At.jsx)(so,{items:p,showBranding:!1,showToggle:!0,showNewAnalysis:!1,defaultExpanded:!s,collapsed:s,onCollapsedChange:o,onNewAnalysis:r,onItemClick:u=>{u.type==="action"&&u.builtin==="new-analysis"?r():u.type==="action"&&u.id==="thread-history-toggle"&&o(!1)}},s?"agent-chat-sidebar-collapsed":"agent-chat-sidebar-expanded")}function ua(e){if(typeof window>"u"||typeof XMLHttpRequest>"u")return()=>{};let t=`${e.gatewayUrl.replace(/\/+$/,"")}/api/web-apps/${encodeURIComponent(e.webAppId)}/runtime/`,o=XMLHttpRequest.prototype.open,r=XMLHttpRequest.prototype.send,s=new WeakMap;return XMLHttpRequest.prototype.open=function(d,c){s.set(this,String(c)),o.call(this,d,c,!0)},XMLHttpRequest.prototype.send=function(d){let c=s.get(this)??"";if(!c.startsWith(t)||!/\/sandbox\/uploadfile$/.test(c)){r.call(this,d);return}if(e.identity.mode==="unverified"){this.setRequestHeader("X-Axiom-External-User-Id",e.identity.userId),r.call(this,d);return}e.identity.tokenProvider().then(p=>{this.setRequestHeader("Authorization",`Bearer ${p}`),r.call(this,d)}).catch(()=>{r.call(this,d)})},()=>{XMLHttpRequest.prototype.open=o,XMLHttpRequest.prototype.send=r}}var Re=n(i());function al(e,t){let r=ga(e.welcome)??ga(t.welcomeMessage),s=e.quickPrompts??t.quickPrompts??[];return{...r!==void 0?{welcome:r}:{},quickPrompts:s}}function ga(e){return typeof e=="string"&&e.length>0?e:void 0}function sl(e){if(!e.gatewayUrl.trim())throw new Error("AgentChatApp requires gatewayUrl");try{new URL(e.gatewayUrl)}catch{throw new Error("AgentChatApp gatewayUrl must be a valid URL")}if(!e.webAppId.trim())throw new Error("AgentChatApp requires webAppId");if(e.identity.mode==="unverified"){if(!e.identity.userId.trim())throw new Error("AgentChatApp requires identity.userId")}else if(typeof e.identity.tokenProvider!="function")throw new Error("AgentChatApp requires identity.tokenProvider");if(!e.fetch&&typeof globalThis.fetch!="function")throw new Error("AgentChatApp requires a fetch implementation")}function ll(e){return e instanceof Fe?e:new Fe("INTERNAL_ERROR","Request failed",!0)}function cl(e){return e.mode==="unverified"?`unverified:${e.userId}`:"verified:token"}function oS(e){sl(e);let t=`${e.gatewayUrl}\0${e.webAppId}\0${cl(e.identity)}`;return(0,Re.jsx)(dl,{...e},t)}function dl({gatewayUrl:e,webAppId:t,identity:o,onError:r,onChatReady:s,onChatMessage:a,fetch:d,className:c,welcome:p,quickPrompts:u}){let[b,x]=(0,Ne.useState)({status:"loading"}),v=(0,Ne.useRef)(o);v.current=o;let g=(0,Ne.useRef)(r);g.current=r;let m=(0,Ne.useRef)();return m.current||(m.current=new Ao({gatewayUrl:e,webAppId:t,identityProvider:{getIdentity:async()=>{let f=v.current;if(f.mode!=="verified")return{externalUserId:f.userId};try{return{bearerToken:await f.tokenProvider()}}catch{throw new Fe("USER_ID_REQUIRED","Identity token provider failed",!0)}}},...d?{fetch:d}:{}})),(0,Ne.useEffect)(()=>ua({gatewayUrl:e,webAppId:t,identity:o}),[e,t,o]),(0,Ne.useEffect)(()=>{let f=!1,W=m.current;return(async()=>{try{let j=await W.bootstrap({});if(f)return;x({status:"ready",bootstrap:j})}catch(j){if(f)return;let A=ll(j);x({status:"error",error:A}),g.current?.(A)}})(),()=>{f=!0}},[]),b.status==="loading"?(0,Re.jsx)("div",{className:c}):b.status==="error"?(0,Re.jsxs)("div",{className:c,role:"alert",children:[(0,Re.jsx)("strong",{children:"Unable to load the assistant"}),(0,Re.jsx)("div",{children:b.error.code}),(0,Re.jsx)("button",{type:"button",onClick:()=>x({status:"loading"}),children:"Retry"})]}):(0,Re.jsx)(ml,{className:c,gatewayUrl:e,webAppId:t,identity:o,bootstrap:b.bootstrap,onChatReady:s,onChatMessage:a,welcome:p,quickPrompts:u})}function pl(e){return{id:e.id,name:e.name,...e.description!==void 0?{description:e.description}:{},graphDefinition:void 0,createdAt:new Date(0),updatedAt:new Date(0)}}function ml({gatewayUrl:e,webAppId:t,identity:o,bootstrap:r,onChatReady:s,onChatMessage:a,className:d,welcome:c,quickPrompts:p}){let u=(0,Ne.useMemo)(()=>pl(r.webApp.assistant),[r.webApp.assistant]),b=(0,Ne.useMemo)(()=>al({welcome:c,quickPrompts:p},r.webApp.appearance),[c,p,r.webApp.appearance]),x=(0,Ne.useMemo)(()=>o.mode==="unverified"?{mode:"unverified",userId:o.userId}:{mode:"verified",tokenProvider:o.tokenProvider},[o]),v=(0,Ne.useCallback)(f=>new Qn({gatewayUrl:e,webAppId:t,identity:x,assistantId:f.assistantId,transport:f.transport,...f.timeout!==void 0?{timeout:f.timeout}:{},...f.headers!==void 0?{headers:f.headers}:{}}),[e,t,x]),g=(0,Ne.useMemo)(()=>({baseURL:`${e.replace(/\/$/,"")}/api/web-apps/${t}/runtime`,apiKey:"",transport:"sse",assistantId:u.id,enableSkillSlot:!1,enableDatabaseSlot:!1,enableAgentSlot:!1,enableMetricsDataSourceSlot:!1,enableModelSelector:!1,enableWorkspace:!1,enableCustomMenu:!1,showSideMenu:!1,enableAssistantCreation:!1,enableAssistantEditing:!1,enableThreadCreation:!0,enableThreadList:!0}),[u.id,e,t]),m=(0,Ne.useMemo)(()=>({assistants:[u],currentAssistant:u,isLoading:!1,error:null,listAssistants:async()=>{},getAssistant:async()=>u,createAssistant:async()=>{throw new Error("Not implemented in a Web App")},updateAssistant:async()=>{throw new Error("Not implemented in a Web App")},deleteAssistant:async()=>{},selectAssistant:async()=>{},clearCurrentAssistant:()=>{},refresh:async()=>{}}),[u]);return(0,Re.jsx)(Jn,{config:{baseURL:g.baseURL,apiKey:"",assistantId:"__BASE__",transport:"sse"},createClient:v,children:(0,Re.jsx)(tr,{initialConfig:g,persistToLocalStorage:!1,children:(0,Re.jsx)(Zn.Provider,{value:m,children:(0,Re.jsx)(no,{children:(0,Re.jsx)(ul,{className:d,onChatReady:s,onChatMessage:a,welcome:b.welcome,quickPrompts:b.quickPrompts})})})})})}function ul({className:e,onChatReady:t,onChatMessage:o,welcome:r,quickPrompts:s=[]}){let{threadId:a}=tt(),{currentAssistant:d}=et();if(!d)return null;let c=a??"";return c?(0,Re.jsx)("div",{className:e,children:(0,Re.jsx)(Po,{thread_id:c,assistant_id:d.id,name:d.name,description:d.description,menu:(0,Re.jsx)(ma,{}),showProjectSelector:!1,showSkillSlot:!1,showDatabaseSlot:!1,showAgentSlot:!1,showMetricsDataSourceSlot:!1,headerRight:null,emptyStateGreeting:r?(0,Re.jsx)("span",{children:r}):void 0,senderPromptsItems:s.length>0?s.map((p,u)=>({key:`quick-${u}`,label:p.label,description:p.text})):void 0,showSkillPrompts:!1,showQuickAnalysis:!1,onChatReady:t,onChatMessage:o})}):(0,Re.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"},children:(0,Re.jsx)(re,{tip:"Creating conversation..."})})}export{ot as a,hi as b,bi as c,ds as d,bs as e,Ro as f,Ki as g,oS as h};
|