import { k as head, o as ensure_array_like } from './index-BHoOpAe1.js';
import { g as goto } from './client-Do_WijF3.js';
import { R as RefreshSvg, E as EmptyState, c as clearCache } from './cache-tQqq4VCX.js';
import { S as SettingsSvg } from './settings-Dv3Esboo.js';
import './markdown-W_mTBct0.js';
import { o as onDestroy } from './index-server-BVf8_1QW.js';
import { B as Button } from './Button-DPcpECFE.js';
import { I as Icon } from './Icon-C2-613_Z.js';
import { S as Shimmer } from './Shimmer-BrakrBeG.js';
import './root-CW7Ox2wn.js';
import './index2-CKh4I94n.js';
import './state.svelte-Cg5VK5nH.js';
import 'dompurify';
import 'marked';

function _page($$renderer, $$props) {
  $$renderer.component(($$renderer2) => {
    const CACHE_KEY = "shooter_terminals";
    let terminals = [];
    let loading = false;
    onDestroy(() => {
    });
    async function fetchTerminals() {
      {
        return;
      }
    }
    async function forceRefresh() {
      loading = true;
      clearCache(CACHE_KEY);
      await fetchTerminals();
    }
    function navigateToConfig() {
      void goto();
    }
    function handleNewTerminal() {
    }
    let $$settled = true;
    let $$inner_renderer;
    function $$render_inner($$renderer3) {
      head("1ewpmn2", $$renderer3, ($$renderer4) => {
        $$renderer4.title(($$renderer5) => {
          $$renderer5.push(`<title>Terminals - Shooter</title>`);
        });
        $$renderer4.push(`<meta name="description" content="Active terminal sessions on this machine"/>`);
      });
      $$renderer3.push(`<main class="main"><div class="page-header"><div class="page-header-content"><div><h1 class="page-title">Terminals</h1> <p class="page-description">Active terminal sessions on this machine</p></div> <div class="page-actions">`);
      Button($$renderer3, {
        classes: "btn-secondary",
        onclick: forceRefresh,
        disabled: loading,
        children: ($$renderer4) => {
          Icon($$renderer4, { svg: RefreshSvg, classes: "icon-14" });
          $$renderer4.push(`<!----> Refresh`);
        },
        $$slots: { default: true }
      });
      $$renderer3.push(`<!----> `);
      Button($$renderer3, {
        classes: "btn-primary",
        onclick: handleNewTerminal,
        children: ($$renderer4) => {
          $$renderer4.push(`<span class="plus-icon svelte-1ewpmn2">+</span> New Terminal`);
        },
        $$slots: { default: true }
      });
      $$renderer3.push(`<!----></div></div></div> `);
      {
        $$renderer3.push("<!--[-1-->");
      }
      $$renderer3.push(`<!--]--> `);
      if (loading && terminals.length === 0) {
        $$renderer3.push("<!--[0-->");
        $$renderer3.push(`<div class="loading-container"><!--[-->`);
        const each_array = ensure_array_like(Array(4));
        for (let i = 0, $$length = each_array.length; i < $$length; i++) {
          each_array[i];
          Shimmer($$renderer3, { classes: "shimmer-card" });
        }
        $$renderer3.push(`<!--]--></div>`);
      } else {
        $$renderer3.push("<!--[1-->");
        {
          let icon = function($$renderer4) {
            Icon($$renderer4, { svg: SettingsSvg, classes: "icon-24" });
          };
          EmptyState($$renderer3, {
            title: "Configuration Required",
            description: "Set up your API credentials to view terminal sessions",
            icon,
            children: ($$renderer4) => {
              Button($$renderer4, {
                classes: "btn-primary",
                onclick: navigateToConfig,
                text: "Configure Settings"
              });
            }
          });
        }
      }
      $$renderer3.push(`<!--]--></main> `);
      {
        $$renderer3.push("<!--[-1-->");
      }
      $$renderer3.push(`<!--]-->`);
    }
    do {
      $$settled = true;
      $$inner_renderer = $$renderer2.copy();
      $$render_inner($$inner_renderer);
    } while (!$$settled);
    $$renderer2.subsume($$inner_renderer);
  });
}

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