import { h as head } from './index2-BpEbpEAf.js';
import { p as page, g as goto } from './index3-Cp9d5nmD.js';
import { g as getAgentsContext } from './agents-context-DJAK2Ml6.js';
import './trpc-client-Bucti7HD.js';
import { A as AgentSidebar } from './AgentSidebar-DqMxRWln.js';
import { T as Tabs, a as Tab } from './Tab-DMBlstpi.js';
import './context-B0vutJuA.js';
import './state.svelte-DbqYHGBV.js';
import './utils-KcIDVAAe.js';
import './index-BSa6KzSq.js';
import '@trpc/client';
import './Icon-SOvOgynh.js';
import './index-server-BI-Ep7Rw.js';

function _page($$renderer, $$props) {
  $$renderer.component(($$renderer2) => {
    const { onAgentSelect, onError } = getAgentsContext();
    let agents = [];
    const activeTopTab = (() => page.url.pathname.split("/")[1])();
    function handleTopTabChange({ value }) {
      if (value === activeTopTab) return;
      if (value === "edit") return goto();
      if (value === "view") return goto();
      goto();
    }
    function handleAgentClick(agentId) {
      onAgentSelect(agentId);
    }
    head($$renderer2, ($$renderer3) => {
      $$renderer3.title(($$renderer4) => {
        $$renderer4.push(`<title>Bosun: Edit</title>`);
      });
    });
    $$renderer2.push(`<div class="flex h-screen">`);
    AgentSidebar($$renderer2, {
      className: "flex-none",
      agents,
      currentAgent: "",
      onAgentClick: handleAgentClick
    });
    $$renderer2.push(`<!----> <div class="flex h-full min-w-0 flex-1 flex-col bg-rc-gray-980 pb-3 pr-4 pt-2"><nav class="flex flex-none items-center justify-center bg-rc-gray-980">`);
    Tabs($$renderer2, {
      value: activeTopTab,
      ariaLabel: "Top tabs",
      onChange: handleTopTabChange,
      children: ($$renderer3) => {
        Tab($$renderer3, {
          value: "edit",
          children: ($$renderer4) => {
            $$renderer4.push(`<!---->Edit`);
          }
        });
        $$renderer3.push(`<!----> `);
        Tab($$renderer3, {
          value: "view",
          children: ($$renderer4) => {
            $$renderer4.push(`<!---->View`);
          }
        });
        $$renderer3.push(`<!---->`);
      },
      $$slots: { default: true }
    });
    $$renderer2.push(`<!----></nav> <main class="flex-1 pr-80 pt-40"><div class="flex h-full items-start justify-center text-rc-gray-200">Select an agent on the left panel to start editing</div></main></div></div>`);
  });
}

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