var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
    function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
    var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
    var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
    var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
    var _, done = false;
    for (var i = decorators.length - 1; i >= 0; i--) {
        var context = {};
        for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
        for (var p in contextIn.access) context.access[p] = contextIn.access[p];
        context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
        var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
        if (kind === "accessor") {
            if (result === void 0) continue;
            if (result === null || typeof result !== "object") throw new TypeError("Object expected");
            if (_ = accept(result.get)) descriptor.get = _;
            if (_ = accept(result.set)) descriptor.set = _;
            if (_ = accept(result.init)) initializers.unshift(_);
        }
        else if (_ = accept(result)) {
            if (kind === "field") initializers.unshift(_);
            else descriptor[key] = _;
        }
    }
    if (target) Object.defineProperty(target, contextIn.name, descriptor);
    done = true;
};
var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
    var useValue = arguments.length > 2;
    for (var i = 0; i < initializers.length; i++) {
        value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
    }
    return useValue ? value : void 0;
};
import { DeesElement, customElement, html, css, cssManager, property, } from '@design.estate/dees-element';
import './sz-status-grid-cluster.js';
import './sz-status-grid-services.js';
import './sz-status-grid-network.js';
import './sz-status-grid-infra.js';
let SzDashboardView = (() => {
    let _classDecorators = [customElement('sz-dashboard-view')];
    let _classDescriptor;
    let _classExtraInitializers = [];
    let _classThis;
    let _classSuper = DeesElement;
    let _data_decorators;
    let _data_initializers = [];
    let _data_extraInitializers = [];
    var SzDashboardView = class extends _classSuper {
        static { _classThis = this; }
        static {
            const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
            _data_decorators = [property({ type: Object })];
            __esDecorate(this, null, _data_decorators, { kind: "accessor", name: "data", static: false, private: false, access: { has: obj => "data" in obj, get: obj => obj.data, set: (obj, value) => { obj.data = value; } }, metadata: _metadata }, _data_initializers, _data_extraInitializers);
            __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
            SzDashboardView = _classThis = _classDescriptor.value;
            if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
        }
        static demo = () => html `
    <div style="padding: 24px; max-width: 1400px;">
      <sz-dashboard-view
        .data=${{
            cluster: {
                totalServices: 7,
                running: 7,
                stopped: 0,
                dockerStatus: 'running',
            },
            resourceUsage: {
                cpu: 0.5,
                memoryUsed: '191 MB',
                memoryTotal: '429.2 GB',
                networkIn: '38.9 KB/s',
                networkOut: '1.7 KB/s',
                topConsumers: [
                    { name: 'test-nginx', memory: '32.1 MB' },
                    { name: 'test-v2', memory: '31.7 MB' },
                ],
            },
            platformServices: [
                { name: 'MongoDB', status: '1 DB', running: true },
                { name: 'S3 Storage (MinIO)', status: '1 bucket', running: true },
                { name: 'Caddy Reverse Proxy', status: 'Running', running: true },
                { name: 'ClickHouse', status: '1 DB', running: true },
            ],
            traffic: {
                requests: 1250,
                errors: 15,
                errorPercent: 1.2,
                avgResponse: 145,
                reqPerMin: 21,
                status2xx: 85,
                status3xx: 5,
                status4xx: 8,
                status5xx: 2,
            },
            proxy: {
                httpPort: '80',
                httpsPort: '443',
                httpActive: true,
                httpsActive: true,
                routeCount: '12',
            },
            certificates: {
                valid: 8,
                expiring: 2,
                expired: 0,
            },
            dnsConfigured: true,
            acmeConfigured: true,
            quickActions: [
                { label: 'Deploy Service', icon: 'plus', primary: true },
                { label: 'View All Services' },
                { label: 'Platform Services' },
                { label: 'Manage Domains' },
            ],
        }}
      ></sz-dashboard-view>
    </div>
  `;
        #data_accessor_storage = __runInitializers(this, _data_initializers, {
            cluster: {
                totalServices: 0,
                running: 0,
                stopped: 0,
                dockerStatus: 'stopped',
            },
            resourceUsage: {
                cpu: 0,
                memoryUsed: '0 MB',
                memoryTotal: '0 GB',
                networkIn: '0 KB/s',
                networkOut: '0 KB/s',
                topConsumers: [],
            },
            platformServices: [],
            traffic: {
                requests: 0,
                errors: 0,
                errorPercent: 0,
                avgResponse: 0,
                reqPerMin: 0,
                status2xx: 0,
                status3xx: 0,
                status4xx: 0,
                status5xx: 0,
            },
            proxy: {
                httpPort: '80',
                httpsPort: '443',
                httpActive: false,
                httpsActive: false,
                routeCount: '0',
            },
            certificates: {
                valid: 0,
                expiring: 0,
                expired: 0,
            },
            dnsConfigured: false,
            acmeConfigured: false,
            quickActions: [],
        });
        get data() { return this.#data_accessor_storage; }
        set data(value) { this.#data_accessor_storage = value; }
        static styles = [
            cssManager.defaultStyles,
            css `
      :host {
        display: block;
      }

      .dashboard {
        display: flex;
        flex-direction: column;
        gap: 24px;
      }

      .section-title {
        font-size: 18px;
        font-weight: 600;
        color: ${cssManager.bdTheme('#18181b', '#fafafa')};
        margin-bottom: 12px;
      }

      .section {
        display: flex;
        flex-direction: column;
      }
    `,
        ];
        render() {
            return html `
      <div class="dashboard">
        <section class="section">
          <h2 class="section-title">Cluster Overview</h2>
          <sz-status-grid-cluster
            .stats=${this.data.cluster}
          ></sz-status-grid-cluster>
        </section>

        <section class="section">
          <h2 class="section-title">Services & Resources</h2>
          <sz-status-grid-services
            .resourceUsage=${this.data.resourceUsage}
            .platformServices=${this.data.platformServices}
          ></sz-status-grid-services>
        </section>

        <section class="section">
          <h2 class="section-title">Network & Traffic</h2>
          <sz-status-grid-network
            .traffic=${this.data.traffic}
            .proxy=${this.data.proxy}
            .certificates=${this.data.certificates}
          ></sz-status-grid-network>
        </section>

        <section class="section">
          <h2 class="section-title">Infrastructure</h2>
          <sz-status-grid-infra
            ?dnsConfigured=${this.data.dnsConfigured}
            ?acmeConfigured=${this.data.acmeConfigured}
            .actions=${this.data.quickActions}
            @action-click=${(e) => this.dispatchEvent(new CustomEvent('action-click', { detail: e.detail, bubbles: true, composed: true }))}
          ></sz-status-grid-infra>
        </section>
      </div>
    `;
        }
        constructor() {
            super(...arguments);
            __runInitializers(this, _data_extraInitializers);
        }
        static {
            __runInitializers(_classThis, _classExtraInitializers);
        }
    };
    return SzDashboardView = _classThis;
})();
export { SzDashboardView };
//# sourceMappingURL=data:application/json;base64, 