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-traffic-card.js';
import './sz-reverse-proxy-card.js';
import './sz-certificates-card.js';
let SzStatusGridNetwork = (() => {
    let _classDecorators = [customElement('sz-status-grid-network')];
    let _classDescriptor;
    let _classExtraInitializers = [];
    let _classThis;
    let _classSuper = DeesElement;
    let _traffic_decorators;
    let _traffic_initializers = [];
    let _traffic_extraInitializers = [];
    let _proxy_decorators;
    let _proxy_initializers = [];
    let _proxy_extraInitializers = [];
    let _certificates_decorators;
    let _certificates_initializers = [];
    let _certificates_extraInitializers = [];
    var SzStatusGridNetwork = class extends _classSuper {
        static { _classThis = this; }
        static {
            const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
            _traffic_decorators = [property({ type: Object })];
            _proxy_decorators = [property({ type: Object })];
            _certificates_decorators = [property({ type: Object })];
            __esDecorate(this, null, _traffic_decorators, { kind: "accessor", name: "traffic", static: false, private: false, access: { has: obj => "traffic" in obj, get: obj => obj.traffic, set: (obj, value) => { obj.traffic = value; } }, metadata: _metadata }, _traffic_initializers, _traffic_extraInitializers);
            __esDecorate(this, null, _proxy_decorators, { kind: "accessor", name: "proxy", static: false, private: false, access: { has: obj => "proxy" in obj, get: obj => obj.proxy, set: (obj, value) => { obj.proxy = value; } }, metadata: _metadata }, _proxy_initializers, _proxy_extraInitializers);
            __esDecorate(this, null, _certificates_decorators, { kind: "accessor", name: "certificates", static: false, private: false, access: { has: obj => "certificates" in obj, get: obj => obj.certificates, set: (obj, value) => { obj.certificates = value; } }, metadata: _metadata }, _certificates_initializers, _certificates_extraInitializers);
            __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
            SzStatusGridNetwork = _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-status-grid-network
        .traffic=${{
            totalRequests: 125420,
            requestsPerMinute: 847,
            errorRate: 0.12,
            avgResponseTime: 45,
            statusDistribution: {
                '2xx': 95.2,
                '3xx': 2.1,
                '4xx': 2.3,
                '5xx': 0.4,
            },
        }}
        .proxy=${{
            httpPort: '80',
            httpsPort: '443',
            httpActive: true,
            httpsActive: true,
            routeCount: '12',
        }}
        .certificates=${{
            valid: 8,
            expiring: 2,
            expired: 0,
        }}
      ></sz-status-grid-network>
    </div>
  `;
        #traffic_accessor_storage = __runInitializers(this, _traffic_initializers, {
            requests: 0,
            errors: 0,
            errorPercent: 0,
            avgResponse: 0,
            reqPerMin: 0,
            status2xx: 0,
            status3xx: 0,
            status4xx: 0,
            status5xx: 0,
        });
        get traffic() { return this.#traffic_accessor_storage; }
        set traffic(value) { this.#traffic_accessor_storage = value; }
        #proxy_accessor_storage = (__runInitializers(this, _traffic_extraInitializers), __runInitializers(this, _proxy_initializers, {
            httpPort: '80',
            httpsPort: '443',
            httpActive: false,
            httpsActive: false,
            routeCount: '0',
        }));
        get proxy() { return this.#proxy_accessor_storage; }
        set proxy(value) { this.#proxy_accessor_storage = value; }
        #certificates_accessor_storage = (__runInitializers(this, _proxy_extraInitializers), __runInitializers(this, _certificates_initializers, {
            valid: 0,
            expiring: 0,
            expired: 0,
        }));
        get certificates() { return this.#certificates_accessor_storage; }
        set certificates(value) { this.#certificates_accessor_storage = value; }
        static styles = [
            cssManager.defaultStyles,
            css `
      :host {
        display: block;
      }

      .grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 16px;
        align-items: stretch;
      }

      .grid > * {
        height: 100%;
      }

      @media (min-width: 768px) {
        .grid {
          grid-template-columns: 1fr 1fr;
        }
      }

      @media (min-width: 1024px) {
        .grid {
          grid-template-columns: 2fr 1fr 1fr;
        }
      }
    `,
        ];
        render() {
            return html `
      <div class="grid">
        <sz-traffic-card
          .data=${this.traffic}
        ></sz-traffic-card>
        <sz-reverse-proxy-card
          httpPort="${this.proxy.httpPort}"
          httpsPort="${this.proxy.httpsPort}"
          ?httpActive=${this.proxy.httpActive}
          ?httpsActive=${this.proxy.httpsActive}
          routeCount="${this.proxy.routeCount}"
        ></sz-reverse-proxy-card>
        <sz-certificates-card
          valid="${this.certificates.valid}"
          expiring="${this.certificates.expiring}"
          expired="${this.certificates.expired}"
        ></sz-certificates-card>
      </div>
    `;
        }
        constructor() {
            super(...arguments);
            __runInitializers(this, _certificates_extraInitializers);
        }
        static {
            __runInitializers(_classThis, _classExtraInitializers);
        }
    };
    return SzStatusGridNetwork = _classThis;
})();
export { SzStatusGridNetwork };
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3otc3RhdHVzLWdyaWQtbmV0d29yay5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3RzX3dlYi9lbGVtZW50cy9zei1zdGF0dXMtZ3JpZC1uZXR3b3JrLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFBQSxPQUFPLEVBQ0wsV0FBVyxFQUNYLGFBQWEsRUFDYixJQUFJLEVBQ0osR0FBRyxFQUNILFVBQVUsRUFDVixRQUFRLEdBRVQsTUFBTSw2QkFBNkIsQ0FBQztBQUVyQyxPQUFPLHNCQUFzQixDQUFDO0FBQzlCLE9BQU8sNEJBQTRCLENBQUM7QUFDcEMsT0FBTywyQkFBMkIsQ0FBQztJQXlCdEIsbUJBQW1COzRCQUQvQixhQUFhLENBQUMsd0JBQXdCLENBQUM7Ozs7c0JBQ0MsV0FBVzs7Ozs7Ozs7OzttQ0FBbkIsU0FBUSxXQUFXOzs7O21DQWdDakQsUUFBUSxDQUFDLEVBQUUsSUFBSSxFQUFFLE1BQU0sRUFBRSxDQUFDO2lDQWExQixRQUFRLENBQUMsRUFBRSxJQUFJLEVBQUUsTUFBTSxFQUFFLENBQUM7d0NBUzFCLFFBQVEsQ0FBQyxFQUFFLElBQUksRUFBRSxNQUFNLEVBQUUsQ0FBQztZQXJCM0IsMEtBQWdCLE9BQU8sNkJBQVAsT0FBTyx5RkFVckI7WUFHRixvS0FBZ0IsS0FBSyw2QkFBTCxLQUFLLHFGQU1uQjtZQUdGLHlMQUFnQixZQUFZLDZCQU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