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, state, } from '@design.estate/dees-element';
import './index.js';
let SzDemoViewRegistries = (() => {
    let _classDecorators = [customElement('sz-demo-view-registries')];
    let _classDescriptor;
    let _classExtraInitializers = [];
    let _classThis;
    let _classSuper = DeesElement;
    let _currentTab_decorators;
    let _currentTab_initializers = [];
    let _currentTab_extraInitializers = [];
    var SzDemoViewRegistries = class extends _classSuper {
        static { _classThis = this; }
        static {
            const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
            _currentTab_decorators = [state()];
            __esDecorate(this, null, _currentTab_decorators, { kind: "accessor", name: "currentTab", static: false, private: false, access: { has: obj => "currentTab" in obj, get: obj => obj.currentTab, set: (obj, value) => { obj.currentTab = value; } }, metadata: _metadata }, _currentTab_initializers, _currentTab_extraInitializers);
            __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
            SzDemoViewRegistries = _classThis = _classDescriptor.value;
            if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
        }
        appui = null;
        #currentTab_accessor_storage = __runInitializers(this, _currentTab_initializers, 'onebox');
        get currentTab() { return this.#currentTab_accessor_storage; }
        set currentTab(value) { this.#currentTab_accessor_storage = value; }
        async onActivate(context) {
            this.appui = context.appui;
            // Set up content tabs
            this.appui.setContentTabs([
                {
                    key: 'Onebox Registry',
                    action: () => {
                        this.currentTab = 'onebox';
                        this.updateSecondaryMenu();
                    },
                },
                {
                    key: 'External Registries',
                    action: () => {
                        this.currentTab = 'external';
                        this.updateSecondaryMenu();
                    },
                },
            ]);
            this.updateSecondaryMenu();
        }
        updateSecondaryMenu() {
            if (!this.appui)
                return;
            if (this.currentTab === 'onebox') {
                this.appui.setSecondaryMenu({
                    heading: 'Onebox Registry',
                    groups: [
                        {
                            name: 'Actions',
                            items: [
                                { type: 'action', key: 'Push Image', iconName: 'lucide:Upload', action: () => { console.log('Push image'); } },
                                { type: 'action', variant: 'danger', key: 'Garbage Collect', iconName: 'lucide:Trash2', action: () => { console.log('GC'); } },
                            ],
                        },
                        {
                            name: 'Statistics',
                            items: [
                                { type: 'header', label: '4 Images' },
                                { type: 'header', label: '640 MB Total' },
                            ],
                        },
                    ],
                });
            }
            else {
                this.appui.setSecondaryMenu({
                    heading: 'External Registries',
                    groups: [
                        {
                            name: 'Actions',
                            items: [
                                { type: 'action', key: 'Add Registry', iconName: 'lucide:Plus', action: () => { console.log('Add registry'); } },
                                { type: 'action', key: 'Test All', iconName: 'lucide:CheckCircle', action: () => { console.log('Test all'); } },
                            ],
                        },
                        {
                            name: 'Connected',
                            items: [
                                { key: 'Docker Hub', iconName: 'lucide:Box', action: () => { console.log('Docker Hub'); } },
                                { key: 'GHCR', iconName: 'lucide:Github', action: () => { console.log('GHCR'); } },
                            ],
                        },
                    ],
                });
            }
        }
        onDeactivate() {
            // Cleanup if needed
        }
        demoOneboxImages = (__runInitializers(this, _currentTab_extraInitializers), [
            { id: '1', name: 'api-gateway', tags: ['latest', 'v2.1.0', 'v2.0.0'], size: '256 MB', updated: '2024-01-20', pulls: 142 },
            { id: '2', name: 'frontend', tags: ['latest', 'v1.5.0'], size: '128 MB', updated: '2024-01-19', pulls: 89 },
            { id: '3', name: 'worker-service', tags: ['latest'], size: '64 MB', updated: '2024-01-18', pulls: 56 },
            { id: '4', name: 'admin-panel', tags: ['latest', 'v3.0.0', 'v2.9.0'], size: '192 MB', updated: '2024-01-17', pulls: 34 },
        ]);
        demoExternalRegistries = [
            { id: '1', name: 'Docker Hub', url: 'docker.io', status: 'connected', images: 12 },
            { id: '2', name: 'GitHub Container Registry', url: 'ghcr.io', status: 'connected', images: 8 },
            { id: '3', name: 'AWS ECR', url: '123456789.dkr.ecr.us-east-1.amazonaws.com', status: 'error', images: 0 },
        ];
        static styles = [
            cssManager.defaultStyles,
            css `
      :host {
        display: block;
        padding: 24px;
        height: 100%;
        overflow-y: auto;
        box-sizing: border-box;
      }

      .page-header {
        margin-bottom: 24px;
      }

      .page-title {
        font-size: 24px;
        font-weight: 700;
        color: ${cssManager.bdTheme('#18181b', '#fafafa')};
        margin: 0 0 8px 0;
      }

      .page-subtitle {
        font-size: 14px;
        color: ${cssManager.bdTheme('#71717a', '#a1a1aa')};
        margin: 0;
      }

      .tabs {
        display: flex;
        gap: 4px;
        margin-bottom: 24px;
        border-bottom: 1px solid ${cssManager.bdTheme('#e4e4e7', '#27272a')};
      }

      .tab {
        padding: 10px 16px;
        font-size: 14px;
        font-weight: 500;
        color: ${cssManager.bdTheme('#71717a', '#a1a1aa')};
        background: transparent;
        border: none;
        cursor: pointer;
        position: relative;
        transition: color 200ms ease;
      }

      .tab:hover {
        color: ${cssManager.bdTheme('#18181b', '#fafafa')};
      }

      .tab.active {
        color: ${cssManager.bdTheme('#18181b', '#fafafa')};
      }

      .tab.active::after {
        content: '';
        position: absolute;
        bottom: -1px;
        left: 0;
        right: 0;
        height: 2px;
        background: ${cssManager.bdTheme('#18181b', '#fafafa')};
        border-radius: 1px 1px 0 0;
      }
    `,
        ];
        render() {
            return html `
      ${this.currentTab === 'onebox' ? html `
        <sz-registry-onebox-view
          .images=${this.demoOneboxImages}
          .stats=${{
                totalImages: 4,
                totalSize: '640 MB',
                totalPulls: 321,
            }}
          @view-image=${(e) => console.log('View image:', e.detail)}
          @delete-image=${(e) => console.log('Delete image:', e.detail)}
          @delete-tag=${(e) => console.log('Delete tag:', e.detail)}
        ></sz-registry-onebox-view>
      ` : html `
        <sz-registry-external-view
          .registries=${this.demoExternalRegistries}
          @add-registry=${() => console.log('Add registry')}
          @edit-registry=${(e) => console.log('Edit registry:', e.detail)}
          @delete-registry=${(e) => console.log('Delete registry:', e.detail)}
          @test-connection=${(e) => console.log('Test connection:', e.detail)}
        ></sz-registry-external-view>
      `}
    `;
        }
        static {
            __runInitializers(_classThis, _classExtraInitializers);
        }
    };
    return SzDemoViewRegistries = _classThis;
})();
export { SzDemoViewRegistries };
//# sourceMappingURL=data:application/json;base64, 