import { h as head, e as ensure_array_like, b as attr_class, c as attr_style, a as attr, s as stringify } from './index2-BuOY2QE4.js';
import { A as AgentSidebar, c as colorForAgent } from './AgentSidebar-BB_yQ9s0.js';
import { X as escape_html } from './context-zH5kvtGY.js';
import { g as getAgentsContext } from './agents-context-BrlIlkOW.js';
import './trpc-client-Bucti7HD.js';
import './index-DxaLoiKh.js';
import './Icon-BgknHaZs.js';
import '@trpc/client';

function AgentsFirstPage($$renderer, $$props) {
  $$renderer.component(($$renderer2) => {
    let { agents, currentAgent } = $$props;
    const agentName = (id) => id.split("/").at(-1) ?? id;
    $$renderer2.push(`<div class="agent-grid-container svelte-16acuk9"><div class="agent-grid svelte-16acuk9"><!--[-->`);
    const each_array = ensure_array_like(agents);
    for (let $$index = 0, $$length = each_array.length; $$index < $$length; $$index++) {
      let agent = each_array[$$index];
      $$renderer2.push(`<button${attr_class("agent-card svelte-16acuk9", void 0, { "active": agent === currentAgent })}${attr_style(`--agent-color: ${stringify(colorForAgent(agent))}`)}${attr("aria-label", `Open ${agentName(agent)}`)}><span class="agent-name svelte-16acuk9">${escape_html(agentName(agent))}</span></button>`);
    }
    $$renderer2.push(`<!--]--> <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 _page($$renderer, $$props) {
  $$renderer.component(($$renderer2) => {
    const { onAgentSelect } = getAgentsContext();
    let agents = [];
    head($$renderer2, ($$renderer3) => {
      $$renderer3.title(($$renderer4) => {
        $$renderer4.push(`<title>Recombine Agents Hub</title>`);
      });
    });
    $$renderer2.push(`<div class="flex h-screen">`);
    AgentSidebar($$renderer2, {
      className: "flex-none border-r-thin border-r-rc-gray-600",
      agents,
      currentAgent: "",
      onAgentClick: onAgentSelect,
      initiallyCollapsed: false,
      hoverCollapse: false
    });
    $$renderer2.push(`<!----> <div class="flex h-full min-w-0 flex-1 flex-col bg-rc-gray-980 py-3 pr-4"><div class="flex-1">`);
    AgentsFirstPage($$renderer2, { agents, currentAgent: "" });
    $$renderer2.push(`<!----></div></div></div>`);
  });
}

export { _page as default };
//# sourceMappingURL=_page.svelte-39hvC6-Q.js.map
