import"../chunks/CWj6FrbW.js";import{s as w,o as N}from"../chunks/CB3MYTwM.js";import{e as F,p as _,k as S,f as m,s as b,b as d,c as A,d as o,r as l,t as j,h as c,i as q,j as H,m as M,$ as O,l as P}from"../chunks/BRMnbBOX.js";import{e as R,c as z,A as B}from"../chunks/BiBGf8wR.js";import{e as D,i as E}from"../chunks/D_iTaAhh.js";import{s as G,c as I}from"../chunks/3HVf2z3Q.js";import{s as J}from"../chunks/DMtzEpj5.js";import{g as K}from"../chunks/BmJonxL2.js";import{t as L}from"../chunks/BEJ5fU19.js";var Q=(g,e,n)=>e.onAgentClick(c(n),g),T=m('<button><span class="agent-name svelte-16acuk9"> </span></button>'),U=m('<div class="agent-grid-container svelte-16acuk9"><div class="agent-grid svelte-16acuk9"><!> <button class="agent-card new-agent svelte-16acuk9" aria-label="Create new agent"><span class="agent-name agent-name_new svelte-16acuk9">New Agent</span></button></div></div>');function V(g,e){_(e,!0),S(()=>{R(e.agents)});const n=a=>a.split("/").at(-1)??a;var r=U(),i=o(r),v=o(i);D(v,17,()=>e.agents,E,(a,t)=>{var s=T();let f;s.__click=[Q,e,t];var p=o(s),k=o(p,!0);l(p),l(s),j((h,x,y,C)=>{f=J(s,1,"agent-card svelte-16acuk9",null,f,h),G(s,`--agent-color: ${x??""}`),I(s,"aria-label",y),w(k,C)},[()=>({active:c(t)===e.currentAgent}),()=>z(c(t)),()=>`Open ${n(c(t))}`,()=>n(c(t))]),d(a,s)});var u=b(v,2);u.__click=function(...a){var t;(t=e.onNewAgent)==null||t.apply(this,a)},l(i),l(r),d(g,r),A()}F(["click"]);var W=m('<div class="flex h-screen"><!> <div class="flex h-full min-w-0 flex-1 flex-col bg-rc-gray-980 py-3 pr-4"><div class="flex-1"><!></div></div></div>');function re(g,e){_(e,!0);const{onAgentSelect:n}=K();let r=q(H([]));N(async()=>{P(r,await L.agents.list.query(),!0)});var i=W();M(s=>{O.title="Recombine Agents Hub"});var v=o(i);B(v,{className:"flex-none border-r-thin border-r-rc-gray-600",get agents(){return c(r)},currentAgent:"",get onAgentClick(){return n},initiallyCollapsed:!1,hoverCollapse:!1});var u=b(v,2),a=o(u),t=o(a);V(t,{get agents(){return c(r)},currentAgent:"",get onAgentClick(){return n}}),l(a),l(u),l(i),d(g,i),A()}export{re as component};
