PageSourceSearch

https://www.007icu.top/assets/AddGroupMemberModal-B1Pi_2rA.js

js 007icu.top collected 2026-10-09 04:35:06 UTC 7,215 bytes, 72 lines download raw bytes

1import{n as e,o as t}from"./rolldown-runtime-CMxvf4Kt.js";import{A as n,F as r,K as i,L as a,X as o,k as s}from"../vendor/vendor-data-runtime-nLFaCKB0.js";import{Yi as c}from"../vendor/vendor-ai-runtime-DrDK77gy.js";import{n as l,t as u}from"./agent-Doq2Q6Wt.js";import{Ao as d,Vn as f,jo as p}from"./app-const-BzFqCjOv.js";import{Fn as m,bo as h,vo as g,wo as _}from"./ScrollArea-CdDxdn_v.js";import{Ei as v,M as y,Sa as b,gi as x,n as S,qn as C,va as w}from"./es-D7HWafs1.js";import{jt as ee,n as te}from"./es-D3_QMuVV.js";import{et as ne,st as re}from"../vendor/vendor-icons-BXJMWD35.js";import{j as ie,w as ae}from"./keys-BAizXMAH.js";import{Ft as T,Mt as oe}from"./store-JX60g0Lu.js";import{i as E,t as se}from"./selectors-YrzAdmlx.js";import{G as ce,K as D,Ko as O,qo as k}from"./index-Doip7UYu.js";import{n as A,t as j}from"./AgentSelectionEmpty-BgO1RUg7.js";var M,N=e((()=>{M=(e,t)=>null})),P,F=e((()=>{s(),P=n((e,t)=>({clearSelection:()=>{e({selectedAgentIds:[]})},isSelected:e=>t().selectedAgentIds.includes(e),removeAgent:t=>{e(e=>({selectedAgentIds:e.selectedAgentIds.filter(e=>e!==t)}))},selectedAgentIds:[],setSelectedAgents:t=>{e({selectedAgentIds:t})},toggleAgent:t=>{e(e=>e.selectedAgentIds.includes(t)?{selectedAgentIds:e.selectedAgentIds.filter(e=>e!==t)}:{selectedAgentIds:[...e.selectedAgentIds,t]})}}))})),I,L,R,z,B=e((()=>{S(),x(),h(),ne(),I=t(p()),f(),F(),L=t(d()),R=_(({css:e,cssVar:t})=>({item:e`
2    cursor: pointer;
3
4    margin-block: 1px;
5    padding-block: 6px;
6    padding-inline: 8px;
7    border-radius: ${t.borderRadius};
8
9    transition: background 0.2s ease;
10
11    &:hover {
12      background: ${t.colorFillTertiary};
13    }
14  `,removeButton:e`
15    cursor: pointer;
16
17    display: flex;
18    align-items: center;
19    justify-content: center;
20
21    width: 20px;
22    height: 20px;
23    border-radius: 4px;
24
25    color: ${t.colorTextTertiary};
26
27    transition: all 0.2s ease;
28
29    &:hover {
30      color: ${t.colorText};
31      background: ${t.colorFillSecondary};
32    }
33  `,title:e`
34    overflow: hidden;
35    flex: 1;
36    text-overflow: ellipsis;
37    white-space: nowrap;
38  `})),z=(0,I.memo)(({agent:e,defaultTitle:t,showCheckbox:n,showRemove:r})=>{let i=(0,I.useRef)(null),a=v(i),o=P(t=>t.selectedAgentIds.includes(e.id)),s=P(e=>e.toggleAgent),c=P(e=>e.removeAgent),l=e.title||t,u=e.avatar||`/avatars/agent-default.png`,d=e.backgroundColor??void 0,f=()=>{s(e.id)};return(0,L.jsx)(`div`,{className:R.item,ref:i,style:{cursor:n?`pointer`:`default`},onClick:n?f:void 0,children:(0,L.jsxs)(g,{horizontal:!0,align:`center`,gap:8,width:`100%`,children:[n&&(0,L.jsx)(w,{checked:o,onChange:f,onClick:e=>{e.stopPropagation(),f()}}),(0,L.jsx)(b,{animation:a,avatar:u,background:d,shape:`circle`,size:28}),(0,L.jsx)(m,{ellipsis:!0,className:R.title,children:l}),r&&(0,L.jsx)(`div`,{className:R.removeButton,onClick:t=>{t.stopPropagation(),c(e.id)},children:(0,L.jsx)(re,{size:14})})]})})})})),V,H,U,W,G,le=e((()=>{S(),h(),V=t(c()),H=t(p()),r(),D(),A(),oe(),se(),B(),U=t(d()),W=_(({css:e,cssVar:t})=>({container:e`
39    user-select: none;
40
41    overflow: hidden;
42    display: flex;
43    flex: 1;
44    flex-direction: column;
45
46    padding-block: ${t.paddingSM}px 0;
47    padding-inline: ${t.paddingSM}px;
48  `,sectionHeader:e`
49    padding-block: 6px 4px;
50    padding-inline: 8px;
51    color: ${t.colorTextSecondary};
52  `})),G=(0,H.memo)(({agents:e,isLoading:t})=>{let{t:n}=a([`chat`,`common`]),[r,i]=(0,H.useState)(``),o=(0,H.useMemo)(()=>n(`defaultSession`,{ns:`common`}),[n]),s=T(E.privateAgentGroups,V.default),c=T(E.privateUngroupedAgents,V.default),l=(0,H.useMemo)(()=>{let e=new Set;for(let t of s)for(let n of t.items)e.add(n.id);for(let t of c)e.add(t.id);return e},[s,c]),u=(0,H.useCallback)(e=>{i(e.target.value)},[]),d=(0,H.useMemo)(()=>{if(!r.trim())return e;let t=r.toLowerCase();return e.filter(e=>{let n=e.title||``,r=e.description||``;return n.toLowerCase().includes(t)||r.toLowerCase().includes(t)})},[e,r]),f=(0,H.useMemo)(()=>{let e=[],t=[];for(let n of d)(l.has(n.id)?e:t).push(n);return e.length===0||t.length===0?d.map(e=>({agent:e,type:`agent`})):[{label:n(`mention.category.privateAgents`,{ns:`chat`}),type:`header`},...e.map(e=>({agent:e,type:`agent`})),{label:n(`mention.category.workspaceAgents`,{ns:`chat`}),type:`header`},...t.map(e=>({agent:e,type:`agent`}))]},[d,l,n]);return(0,U.jsxs)(g,{className:W.container,gap:12,children:[(0,U.jsx)(y,{allowClear:!0,placeholder:n(`memberSelection.searchAgents`),value:r,variant:`filled`,onChange:u}),(0,U.jsx)(g,{flex:1,style:{minHeight:0},children:t?(0,U.jsxs)(g,{gap:8,padding:8,children:[(0,U.jsx)(C,{active:!0,paragraph:{rows:1},title:!1}),(0,U.jsx)(C,{active:!0,paragraph:{rows:1},title:!1}),(0,U.jsx)(C,{active:!0,paragraph:{rows:1},title:!1})]}):d.length===0?(0,U.jsx)(j,{search:!!r,variant:r?`empty`:`noAvailable`}):(0,U.jsx)(ce,{style:{flex:1},totalCount:f.length,itemContent:e=>{let t=f[e];return t.type===`header`?(0,U.jsx)(m,{className:W.sectionHeader,fontSize:12,type:`secondary`,children:t.label}):(0,U.jsx)(z,{showCheckbox:!0,agent:t.agent,defaultTitle:o},t.agent.id)}})})]})})})),K,q,J,Y,ue=e((()=>
52{S(),h(),K=t(p()),r(),A(),B(),F(),q=t(d()),J=_(({css:e,cssVar:t})=>({container:e`
53    overflow-y: auto;
54    flex: 1;
55    padding: ${t.paddingSM}px;
56  `,title:e`
57    font-size: 12px;
58    font-weight: 500;
59    color: ${t.colorTextSecondary};
60  `})),Y=(0,K.memo)(({agents:e})=>{let{t}=a([`chat`,`common`]),n=P(e=>e.selectedAgentIds),r=(0,K.useMemo)(()=>t(`defaultSession`,{ns:`common`}),[t]),i=(0,K.useMemo)(()=>n.map(t=>e.find(e=>e.id===t)).filter(e=>e!==void 0),[e,n]);return i.length===0?(0,q.jsx)(g,{className:J.container,flex:1,children:(0,q.jsx)(j,{variant:`noSelected`})}):(0,q.jsxs)(g,{className:J.container,gap:4,children:[(0,q.jsx)(`div`,{className:J.title,children:t(`memberSelection.selectedAgents`,{count:i.length})}),(0,q.jsx)(g,{children:i.map(e=>(0,q.jsx)(z,{showRemove:!0,agent:e,defaultTitle:r},e.id))})]})})})),X,Z,Q,$,de=e((()=>{S(),te(),h(),X=t(p()),r(),i(),k(),ie(),l(),le(),ue(),F(),Z=t(d()),Q=_(({css:e,cssVar:t})=>({container:e`
61    display: flex;
62    flex-direction: row;
63
64    height: 500px;
65    padding: 12px;
66    border: 1px solid ${t.colorBorderSecondary};
67    border-radius: ${t.borderRadius}px;
68  `,rightColumn:e`
69    display: flex;
70    flex: 1;
71    flex-direction: column;
72  `})),$=(0,X.memo)(({existingMembers:e=[],onCancel:t,onConfirm:n,open:r})=>{let{t:i}=a([`chat`,`common`]),s=P(e=>e.selectedAgentIds),c=P(e=>e.clearSelection),{data:l=[],isLoading:d}=o(r?ae.queryAgents():null,()=>u.queryAgents()),f=(0,X.useMemo)(()=>l.filter(t=>!e.includes(t.id)),[l,e]);(0,X.useEffect)(()=>{r||c()},[r,c]);let[p,m]=(0,X.useState)(!1);return(0,Z.jsx)(O,{allowFullscreen:!0,okButtonProps:{disabled:s.length===0||p,loading:p},okText:`${i(`memberSelection.addMember`)} (${s.length})`,open:r,title:i(`memberSelection.addMember`),width:800,onCancel:()=>{c(),t()},onOk:async()=>{try{m(!0),await n(s),c()}catch(e){console.error(`Failed to add members:`,e)}finally{m(!1)}},children:(0,Z.jsxs)(g,{horizontal:!0,className:Q.container,gap:8,children:[(0,Z.jsx)(G,{agents:f,isLoading:d}),(0,Z.jsx)(ee,{orientation:`vertical`,style:{height:`100%`}}),(0,Z.jsx)(Y,{agents:l})]})})})}));export{M as i,de as n,N as r,$ as t};

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