var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; import { i18n } from "@mariozechner/mini-lit"; import { Button } from "@mariozechner/mini-lit/dist/Button.js"; import { html, LitElement } from "lit"; import { customElement, property } from "lit/decorators.js"; let CustomProviderCard = class CustomProviderCard extends LitElement { constructor() { super(...arguments); this.isAutoDiscovery = false; } createRenderRoot() { return this; } renderStatus() { if (!this.isAutoDiscovery) { return html `
${i18n("Models")}: ${this.provider.models?.length || 0}
`; } if (!this.status) return html ``; const statusIcon = this.status.status === "connected" ? html `` : this.status.status === "checking" ? html `` : html ``; const statusText = this.status.status === "connected" ? `${this.status.modelCount} ${i18n("models")}` : this.status.status === "checking" ? i18n("Checking...") : i18n("Disconnected"); return html `
${statusIcon} ${statusText}
`; } render() { return html `
${this.provider.name}
${this.provider.type} ${this.provider.baseUrl ? html ` • ${this.provider.baseUrl}` : ""}
${this.renderStatus()}
${this.isAutoDiscovery && this.onRefresh ? Button({ onClick: () => this.onRefresh?.(this.provider), variant: "ghost", size: "sm", children: i18n("Refresh"), }) : ""} ${this.onEdit ? Button({ onClick: () => this.onEdit?.(this.provider), variant: "ghost", size: "sm", children: i18n("Edit"), }) : ""} ${this.onDelete ? Button({ onClick: () => this.onDelete?.(this.provider), variant: "ghost", size: "sm", children: i18n("Delete"), }) : ""}
`; } }; __decorate([ property({ type: Object }) ], CustomProviderCard.prototype, "provider", void 0); __decorate([ property({ type: Boolean }) ], CustomProviderCard.prototype, "isAutoDiscovery", void 0); __decorate([ property({ type: Object }) ], CustomProviderCard.prototype, "status", void 0); __decorate([ property() ], CustomProviderCard.prototype, "onRefresh", void 0); __decorate([ property() ], CustomProviderCard.prototype, "onEdit", void 0); __decorate([ property() ], CustomProviderCard.prototype, "onDelete", void 0); CustomProviderCard = __decorate([ customElement("custom-provider-card") ], CustomProviderCard); export { CustomProviderCard }; //# sourceMappingURL=CustomProviderCard.js.map