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 { Component } from '@angular/core';
import { RegisterClass } from '@memberjunction/global';
import { BaseResourceComponent } from '@memberjunction/ng-shared';
import { RunView, CompositeKey } from '@memberjunction/core';
import * as i0 from "@angular/core";
import * as i1 from "@memberjunction/ng-shared";
import * as i2 from "@angular/common";
import * as i3 from "@memberjunction/ng-shared-generic";
import * as i4 from "@memberjunction/ng-ui-components";
function CommunicationProvidersResourceComponent_Conditional_8_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 5);
    i0.ɵɵelement(1, "mj-loading", 7);
    i0.ɵɵelementEnd();
} }
function CommunicationProvidersResourceComponent_Conditional_9_For_2_Conditional_19_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "span", 19);
    i0.ɵɵelement(1, "i", 28);
    i0.ɵɵtext(2, " Scheduled ");
    i0.ɵɵelementEnd();
} }
function CommunicationProvidersResourceComponent_Conditional_9_For_2_Conditional_20_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "span", 19);
    i0.ɵɵelement(1, "i", 28);
    i0.ɵɵtext(2, " Drafts ");
    i0.ɵɵelementEnd();
} }
function CommunicationProvidersResourceComponent_Conditional_9_For_2_Conditional_21_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "span", 19);
    i0.ɵɵelement(1, "i", 28);
    i0.ɵɵtext(2, " Forward ");
    i0.ɵɵelementEnd();
} }
function CommunicationProvidersResourceComponent_Conditional_9_For_2_Conditional_22_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "span", 19);
    i0.ɵɵelement(1, "i", 28);
    i0.ɵɵtext(2, " Reply ");
    i0.ɵɵelementEnd();
} }
function CommunicationProvidersResourceComponent_Conditional_9_For_2_Template(rf, ctx) { if (rf & 1) {
    const _r1 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "div", 9)(1, "div", 10)(2, "div", 11);
    i0.ɵɵelement(3, "i");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(4, "div", 12)(5, "div", 13);
    i0.ɵɵtext(6);
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(7, "div", 14);
    i0.ɵɵtext(8);
    i0.ɵɵelementEnd()();
    i0.ɵɵelementStart(9, "span", 15);
    i0.ɵɵtext(10);
    i0.ɵɵelementEnd()();
    i0.ɵɵelementStart(11, "div", 16)(12, "div", 17)(13, "span", 18);
    i0.ɵɵelement(14, "i");
    i0.ɵɵtext(15, " Sending ");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(16, "span", 18);
    i0.ɵɵelement(17, "i");
    i0.ɵɵtext(18, " Receiving ");
    i0.ɵɵelementEnd();
    i0.ɵɵconditionalCreate(19, CommunicationProvidersResourceComponent_Conditional_9_For_2_Conditional_19_Template, 3, 0, "span", 19);
    i0.ɵɵconditionalCreate(20, CommunicationProvidersResourceComponent_Conditional_9_For_2_Conditional_20_Template, 3, 0, "span", 19);
    i0.ɵɵconditionalCreate(21, CommunicationProvidersResourceComponent_Conditional_9_For_2_Conditional_21_Template, 3, 0, "span", 19);
    i0.ɵɵconditionalCreate(22, CommunicationProvidersResourceComponent_Conditional_9_For_2_Conditional_22_Template, 3, 0, "span", 19);
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(23, "div", 20)(24, "div", 21)(25, "div", 22);
    i0.ɵɵtext(26);
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(27, "div", 23);
    i0.ɵɵtext(28, "Sent (24h)");
    i0.ɵɵelementEnd()();
    i0.ɵɵelementStart(29, "div", 21)(30, "div", 22);
    i0.ɵɵtext(31);
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(32, "div", 23);
    i0.ɵɵtext(33, "Success");
    i0.ɵɵelementEnd()();
    i0.ɵɵelementStart(34, "div", 21)(35, "div", 22);
    i0.ɵɵtext(36);
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(37, "div", 23);
    i0.ɵɵtext(38, "Failed");
    i0.ɵɵelementEnd()()()();
    i0.ɵɵelementStart(39, "div", 24)(40, "button", 25);
    i0.ɵɵlistener("click", function CommunicationProvidersResourceComponent_Conditional_9_For_2_Template_button_click_40_listener() { const card_r2 = i0.ɵɵrestoreView(_r1).$implicit; const ctx_r2 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r2.configureProvider(card_r2.Entity)); });
    i0.ɵɵelement(41, "i", 26);
    i0.ɵɵtext(42, " Configure ");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(43, "button", 25);
    i0.ɵɵlistener("click", function CommunicationProvidersResourceComponent_Conditional_9_For_2_Template_button_click_43_listener() { const card_r2 = i0.ɵɵrestoreView(_r1).$implicit; const ctx_r2 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r2.viewProviderLogs(card_r2.Entity)); });
    i0.ɵɵelement(44, "i", 27);
    i0.ɵɵtext(45, " Analytics ");
    i0.ɵɵelementEnd()()();
} if (rf & 2) {
    const card_r2 = ctx.$implicit;
    i0.ɵɵclassProp("disabled", card_r2.Entity.Status === "Disabled");
    i0.ɵɵadvance(2);
    i0.ɵɵproperty("ngClass", card_r2.LogoClass);
    i0.ɵɵadvance();
    i0.ɵɵclassMap(card_r2.IconClass);
    i0.ɵɵadvance(3);
    i0.ɵɵtextInterpolate(card_r2.Entity.Name);
    i0.ɵɵadvance(2);
    i0.ɵɵtextInterpolate(card_r2.Entity.Description || "No description");
    i0.ɵɵadvance();
    i0.ɵɵproperty("ngClass", card_r2.Entity.Status.toLowerCase());
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate1(" ", card_r2.Entity.Status, " ");
    i0.ɵɵadvance(3);
    i0.ɵɵclassProp("supported", card_r2.Entity.SupportsSending)("unsupported", !card_r2.Entity.SupportsSending);
    i0.ɵɵadvance();
    i0.ɵɵclassMap(card_r2.Entity.SupportsSending ? "fa-solid fa-check" : "fa-solid fa-xmark");
    i0.ɵɵadvance(2);
    i0.ɵɵclassProp("supported", card_r2.Entity.SupportsReceiving)("unsupported", !card_r2.Entity.SupportsReceiving);
    i0.ɵɵadvance();
    i0.ɵɵclassMap(card_r2.Entity.SupportsReceiving ? "fa-solid fa-check" : "fa-solid fa-xmark");
    i0.ɵɵadvance(2);
    i0.ɵɵconditional(card_r2.Entity.SupportsScheduledSending ? 19 : -1);
    i0.ɵɵadvance();
    i0.ɵɵconditional(card_r2.Entity.SupportsDrafts ? 20 : -1);
    i0.ɵɵadvance();
    i0.ɵɵconditional(card_r2.Entity.SupportsForwarding ? 21 : -1);
    i0.ɵɵadvance();
    i0.ɵɵconditional(card_r2.Entity.SupportsReplying ? 22 : -1);
    i0.ɵɵadvance(4);
    i0.ɵɵtextInterpolate(card_r2.SentCount);
    i0.ɵɵadvance(5);
    i0.ɵɵtextInterpolate1("", card_r2.SuccessRate, "%");
    i0.ɵɵadvance(5);
    i0.ɵɵtextInterpolate(card_r2.FailedCount);
} }
function CommunicationProvidersResourceComponent_Conditional_9_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 6);
    i0.ɵɵrepeaterCreate(1, CommunicationProvidersResourceComponent_Conditional_9_For_2_Template, 46, 28, "div", 8, i0.ɵɵrepeaterTrackByIdentity);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r2 = i0.ɵɵnextContext();
    i0.ɵɵadvance();
    i0.ɵɵrepeater(ctx_r2.providerCards);
} }
let CommunicationProvidersResourceComponent = class CommunicationProvidersResourceComponent extends BaseResourceComponent {
    cdr;
    navService;
    isLoading = false;
    providerCards = [];
    constructor(cdr, navService) {
        super();
        this.cdr = cdr;
        this.navService = navService;
    }
    async ngOnInit() {
        super.ngOnInit();
        await this.loadData();
        this.NotifyLoadComplete();
    }
    ngOnDestroy() {
        super.ngOnDestroy();
    }
    async loadData() {
        try {
            this.isLoading = true;
            this.cdr.detectChanges();
            const rv = RunView.FromMetadataProvider(this.ProviderToUse);
            const yesterday = new Date();
            yesterday.setDate(yesterday.getDate() - 1);
            const yesterdayIso = yesterday.toISOString();
            const [providersResult, logsResult] = await Promise.all([
                rv.RunView({
                    EntityName: 'MJ: Communication Providers',
                    OrderBy: 'Name ASC',
                    ResultType: 'entity_object'
                }),
                rv.RunView({
                    EntityName: 'MJ: Communication Logs',
                    ExtraFilter: `MessageDate >= '${yesterdayIso}'`,
                    ResultType: 'entity_object'
                })
            ]);
            if (providersResult.Success) {
                const logs = logsResult.Success ? logsResult.Results : [];
                this.providerCards = providersResult.Results.map(p => this.buildProviderCard(p, logs));
            }
        }
        catch (error) {
            console.error('Error loading providers:', error);
        }
        finally {
            this.isLoading = false;
            this.cdr.detectChanges();
        }
    }
    buildProviderCard(provider, logs) {
        const providerLogs = logs.filter(l => l.CommunicationProvider === provider.Name);
        const sent = providerLogs.length;
        const failed = providerLogs.filter(l => l.Status === 'Failed').length;
        const rate = sent > 0 ? parseFloat(((sent - failed) / sent * 100).toFixed(1)) : 100;
        return {
            Entity: provider,
            SentCount: sent,
            SuccessRate: rate,
            FailedCount: failed,
            IconClass: this.getProviderIcon(provider.Name),
            LogoClass: this.getProviderLogoClass(provider.Name)
        };
    }
    getProviderIcon(name) {
        const n = name.toLowerCase();
        if (n.includes('sendgrid'))
            return 'fa-solid fa-envelope';
        if (n.includes('twilio'))
            return 'fa-solid fa-comment-sms';
        if (n.includes('gmail') || n.includes('google'))
            return 'fa-brands fa-google';
        if (n.includes('microsoft') || n.includes('graph') || n.includes('outlook'))
            return 'fa-brands fa-microsoft';
        if (n.includes('aws') || n.includes('ses'))
            return 'fa-brands fa-aws';
        if (n.includes('slack'))
            return 'fa-brands fa-slack';
        return 'fa-solid fa-server';
    }
    getProviderLogoClass(name) {
        const n = name.toLowerCase();
        if (n.includes('sendgrid'))
            return 'sendgrid';
        if (n.includes('twilio'))
            return 'twilio';
        if (n.includes('gmail') || n.includes('google'))
            return 'gmail';
        if (n.includes('microsoft') || n.includes('graph') || n.includes('outlook'))
            return 'msgraph';
        return '';
    }
    configureProvider(provider) {
        const pk = new CompositeKey();
        pk.LoadFromEntityInfoAndRecord(this.ProviderToUse.Entities.find(e => e.Name === 'MJ: Communication Providers'), provider);
        this.navService.OpenEntityRecord('MJ: Communication Providers', pk);
    }
    viewProviderLogs(provider) {
        console.log('View analytics for provider:', provider.Name);
    }
    addNewProvider() {
        this.navService.OpenEntityRecord('MJ: Communication Providers', new CompositeKey());
    }
    async GetResourceDisplayName(data) {
        return 'Providers';
    }
    async GetResourceIconClass(data) {
        return 'fa-solid fa-server';
    }
    static ɵfac = function CommunicationProvidersResourceComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || CommunicationProvidersResourceComponent)(i0.ɵɵdirectiveInject(i0.ChangeDetectorRef), i0.ɵɵdirectiveInject(i1.NavigationService)); };
    static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: CommunicationProvidersResourceComponent, selectors: [["mj-communication-providers-resource"]], standalone: false, features: [i0.ɵɵInheritDefinitionFeature], decls: 10, vars: 2, consts: [["Title", "Providers", "Icon", "fa-solid fa-server", "Subtitle", "Manage your messaging service integrations"], ["actions", ""], ["mjButton", "", "variant", "primary", "size", "sm", 3, "click"], [1, "fa-solid", "fa-plus"], [1, "action-btn-label"], [1, "loading-state"], [1, "providers-grid"], ["text", "Loading providers..."], [1, "provider-card", 3, "disabled"], [1, "provider-card"], [1, "provider-card-header"], [1, "provider-card-logo", 3, "ngClass"], [1, "provider-card-title"], [1, "provider-card-name"], [1, "provider-card-desc"], [1, "provider-card-status", 3, "ngClass"], [1, "provider-card-body"], [1, "provider-capabilities"], [1, "capability-chip"], [1, "capability-chip", "supported"], [1, "provider-card-stats"], [1, "provider-stat"], [1, "provider-stat-value"], [1, "provider-stat-label"], [1, "provider-card-footer"], [3, "click"], [1, "fa-solid", "fa-gear"], [1, "fa-solid", "fa-chart-line"], [1, "fa-solid", "fa-check"]], template: function CommunicationProvidersResourceComponent_Template(rf, ctx) { if (rf & 1) {
            i0.ɵɵelementStart(0, "mj-page-layout")(1, "mj-page-header", 0)(2, "div", 1)(3, "button", 2);
            i0.ɵɵlistener("click", function CommunicationProvidersResourceComponent_Template_button_click_3_listener() { return ctx.addNewProvider(); });
            i0.ɵɵelement(4, "i", 3);
            i0.ɵɵelementStart(5, "span", 4);
            i0.ɵɵtext(6, "Add Provider");
            i0.ɵɵelementEnd()()()();
            i0.ɵɵelementStart(7, "mj-page-body");
            i0.ɵɵconditionalCreate(8, CommunicationProvidersResourceComponent_Conditional_8_Template, 2, 0, "div", 5);
            i0.ɵɵconditionalCreate(9, CommunicationProvidersResourceComponent_Conditional_9_Template, 3, 0, "div", 6);
            i0.ɵɵelementEnd()();
        } if (rf & 2) {
            i0.ɵɵadvance(8);
            i0.ɵɵconditional(ctx.isLoading ? 8 : -1);
            i0.ɵɵadvance();
            i0.ɵɵconditional(!ctx.isLoading ? 9 : -1);
        } }, dependencies: [i2.NgClass, i3.LoadingComponent, i4.MJButtonDirective, i4.MJPageHeaderComponent, i4.MJPageLayoutComponent, i4.MJPageBodyComponent], styles: [".loading-state[_ngcontent-%COMP%] {\n        display: flex;\n        align-items: center;\n        justify-content: center;\n        padding: 80px 0;\n    }\n\n    \n\n    .providers-grid[_ngcontent-%COMP%] {\n        display: grid;\n        grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));\n        gap: 16px;\n    }\n    .provider-card[_ngcontent-%COMP%] {\n        background: var(--mj-bg-surface-card);\n        border: 1px solid var(--mj-border-default);\n        border-radius: 12px;\n        overflow: hidden;\n        transition: all 0.15s ease;\n    }\n    .provider-card[_ngcontent-%COMP%]:hover {\n        box-shadow: 0 2px 8px var(--mj-shadow-md);\n        border-color: var(--mj-border-strong);\n    }\n    .provider-card.disabled[_ngcontent-%COMP%] { opacity: 0.65; }\n\n    .provider-card-header[_ngcontent-%COMP%] {\n        display: flex;\n        align-items: center;\n        gap: 14px;\n        padding: 20px 20px 16px;\n    }\n    .provider-card-logo[_ngcontent-%COMP%] {\n        width: 48px; height: 48px;\n        border-radius: 12px;\n        display: flex; align-items: center; justify-content: center;\n        font-size: 22px; flex-shrink: 0;\n        background: var(--mj-bg-surface-sunken);\n    }\n    .provider-card-logo.sendgrid[_ngcontent-%COMP%] {\n        background: color-mix(in srgb, var(--mj-brand-primary) 15%, var(--mj-bg-surface));\n        color: var(--mj-brand-primary);\n    }\n    .provider-card-logo.twilio[_ngcontent-%COMP%] {\n        background: color-mix(in srgb, var(--mj-status-error) 15%, var(--mj-bg-surface));\n        color: var(--mj-status-error);\n    }\n    .provider-card-logo.gmail[_ngcontent-%COMP%] {\n        background: color-mix(in srgb, var(--mj-status-error) 15%, var(--mj-bg-surface));\n        color: var(--mj-status-error);\n    }\n    .provider-card-logo.msgraph[_ngcontent-%COMP%] {\n        background: color-mix(in srgb, var(--mj-brand-primary) 15%, var(--mj-bg-surface));\n        color: var(--mj-brand-primary);\n    }\n\n    .provider-card-title[_ngcontent-%COMP%] { flex: 1; min-width: 0; }\n    .provider-card-name[_ngcontent-%COMP%] {\n        font-size: 15px; font-weight: 700;\n        color: var(--mj-text-primary);\n        white-space: nowrap; overflow: hidden; text-overflow: ellipsis;\n    }\n    .provider-card-desc[_ngcontent-%COMP%] {\n        font-size: 12px;\n        color: var(--mj-text-muted);\n        margin-top: 2px;\n    }\n    .provider-card-status[_ngcontent-%COMP%] {\n        font-size: 10px; font-weight: 700;\n        text-transform: uppercase; letter-spacing: 0.5px;\n        padding: 3px 10px; border-radius: 10px;\n        flex-shrink: 0;\n    }\n    .provider-card-status.active[_ngcontent-%COMP%] {\n        background: color-mix(in srgb, var(--mj-status-success) 15%, var(--mj-bg-surface));\n        color: var(--mj-status-success);\n    }\n    .provider-card-status.disabled[_ngcontent-%COMP%] {\n        background: var(--mj-bg-surface-sunken);\n        color: var(--mj-text-muted);\n    }\n\n    .provider-card-body[_ngcontent-%COMP%] { padding: 0 20px 16px; }\n\n    .provider-capabilities[_ngcontent-%COMP%] {\n        display: flex; flex-wrap: wrap;\n        gap: 6px; margin-bottom: 16px;\n    }\n    .capability-chip[_ngcontent-%COMP%] {\n        display: inline-flex; align-items: center;\n        gap: 4px; padding: 4px 10px;\n        border-radius: 12px; font-size: 11px; font-weight: 500;\n    }\n    .capability-chip.supported[_ngcontent-%COMP%] {\n        background: color-mix(in srgb, var(--mj-status-success) 15%, var(--mj-bg-surface));\n        color: var(--mj-status-success);\n    }\n    .capability-chip.unsupported[_ngcontent-%COMP%] {\n        background: var(--mj-bg-surface-sunken);\n        color: var(--mj-text-muted);\n        text-decoration: line-through;\n    }\n\n    .provider-card-stats[_ngcontent-%COMP%] {\n        display: grid;\n        grid-template-columns: repeat(3, 1fr);\n        gap: 12px; padding: 12px;\n        background: var(--mj-bg-surface-sunken);\n        border-radius: 8px;\n    }\n    .provider-stat[_ngcontent-%COMP%] { text-align: center; }\n    .provider-stat-value[_ngcontent-%COMP%] {\n        font-size: 16px; font-weight: 800;\n        color: var(--mj-text-primary);\n    }\n    .provider-stat-label[_ngcontent-%COMP%] {\n        font-size: 10px;\n        color: var(--mj-text-muted);\n        text-transform: uppercase; letter-spacing: 0.3px;\n    }\n\n    .provider-card-footer[_ngcontent-%COMP%] {\n        display: flex;\n        border-top: 1px solid var(--mj-border-default);\n    }\n    .provider-card-footer[_ngcontent-%COMP%]   button[_ngcontent-%COMP%] {\n        flex: 1; padding: 12px;\n        border: none; background: transparent;\n        font-size: 12px; font-weight: 600;\n        color: var(--mj-brand-primary);\n        cursor: pointer; transition: background 0.15s;\n        font-family: inherit;\n        display: flex; align-items: center;\n        justify-content: center; gap: 6px;\n    }\n    .provider-card-footer[_ngcontent-%COMP%]   button[_ngcontent-%COMP%]:hover {\n        background: var(--mj-bg-surface-sunken);\n    }\n    .provider-card-footer[_ngcontent-%COMP%]   button[_ngcontent-%COMP%]    + button[_ngcontent-%COMP%] {\n        border-left: 1px solid var(--mj-border-default);\n    }"] });
};
CommunicationProvidersResourceComponent = __decorate([
    RegisterClass(BaseResourceComponent, 'CommunicationProvidersResource')
], CommunicationProvidersResourceComponent);
export { CommunicationProvidersResourceComponent };
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CommunicationProvidersResourceComponent, [{
        type: Component,
        args: [{ standalone: false, selector: 'mj-communication-providers-resource', template: `
    <mj-page-layout>
      <mj-page-header
        Title="Providers"
        Icon="fa-solid fa-server"
        Subtitle="Manage your messaging service integrations">
        <div actions>
          <button mjButton variant="primary" size="sm" (click)="addNewProvider()">
            <i class="fa-solid fa-plus"></i> <span class="action-btn-label">Add Provider</span>
          </button>
        </div>
      </mj-page-header>

      <mj-page-body>
      @if (isLoading) {
        <div class="loading-state">
          <mj-loading text="Loading providers..."></mj-loading>
        </div>
      }
    
      @if (!isLoading) {
        <div class="providers-grid">
          @for (card of providerCards; track card) {
            <div class="provider-card" [class.disabled]="card.Entity.Status === 'Disabled'">
              <div class="provider-card-header">
                <div class="provider-card-logo" [ngClass]="card.LogoClass">
                  <i [class]="card.IconClass"></i>
                </div>
                <div class="provider-card-title">
                  <div class="provider-card-name">{{card.Entity.Name}}</div>
                  <div class="provider-card-desc">{{card.Entity.Description || 'No description'}}</div>
                </div>
                <span class="provider-card-status" [ngClass]="card.Entity.Status.toLowerCase()">
                  {{card.Entity.Status}}
                </span>
              </div>
              <div class="provider-card-body">
                <div class="provider-capabilities">
                  <span class="capability-chip" [class.supported]="card.Entity.SupportsSending" [class.unsupported]="!card.Entity.SupportsSending">
                    <i [class]="card.Entity.SupportsSending ? 'fa-solid fa-check' : 'fa-solid fa-xmark'"></i> Sending
                  </span>
                  <span class="capability-chip" [class.supported]="card.Entity.SupportsReceiving" [class.unsupported]="!card.Entity.SupportsReceiving">
                    <i [class]="card.Entity.SupportsReceiving ? 'fa-solid fa-check' : 'fa-solid fa-xmark'"></i> Receiving
                  </span>
                  @if (card.Entity.SupportsScheduledSending) {
                    <span class="capability-chip supported">
                      <i class="fa-solid fa-check"></i> Scheduled
                    </span>
                  }
                  @if (card.Entity.SupportsDrafts) {
                    <span class="capability-chip supported">
                      <i class="fa-solid fa-check"></i> Drafts
                    </span>
                  }
                  @if (card.Entity.SupportsForwarding) {
                    <span class="capability-chip supported">
                      <i class="fa-solid fa-check"></i> Forward
                    </span>
                  }
                  @if (card.Entity.SupportsReplying) {
                    <span class="capability-chip supported">
                      <i class="fa-solid fa-check"></i> Reply
                    </span>
                  }
                </div>
                <div class="provider-card-stats">
                  <div class="provider-stat">
                    <div class="provider-stat-value">{{card.SentCount}}</div>
                    <div class="provider-stat-label">Sent (24h)</div>
                  </div>
                  <div class="provider-stat">
                    <div class="provider-stat-value">{{card.SuccessRate}}%</div>
                    <div class="provider-stat-label">Success</div>
                  </div>
                  <div class="provider-stat">
                    <div class="provider-stat-value">{{card.FailedCount}}</div>
                    <div class="provider-stat-label">Failed</div>
                  </div>
                </div>
              </div>
              <div class="provider-card-footer">
                <button (click)="configureProvider(card.Entity)">
                  <i class="fa-solid fa-gear"></i> Configure
                </button>
                <button (click)="viewProviderLogs(card.Entity)">
                  <i class="fa-solid fa-chart-line"></i> Analytics
                </button>
              </div>
            </div>
          }
        </div>
      }
      </mj-page-body>
    </mj-page-layout>
    `, styles: ["\n    .loading-state {\n        display: flex;\n        align-items: center;\n        justify-content: center;\n        padding: 80px 0;\n    }\n\n    /* GRID */\n    .providers-grid {\n        display: grid;\n        grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));\n        gap: 16px;\n    }\n    .provider-card {\n        background: var(--mj-bg-surface-card);\n        border: 1px solid var(--mj-border-default);\n        border-radius: 12px;\n        overflow: hidden;\n        transition: all 0.15s ease;\n    }\n    .provider-card:hover {\n        box-shadow: 0 2px 8px var(--mj-shadow-md);\n        border-color: var(--mj-border-strong);\n    }\n    .provider-card.disabled { opacity: 0.65; }\n\n    .provider-card-header {\n        display: flex;\n        align-items: center;\n        gap: 14px;\n        padding: 20px 20px 16px;\n    }\n    .provider-card-logo {\n        width: 48px; height: 48px;\n        border-radius: 12px;\n        display: flex; align-items: center; justify-content: center;\n        font-size: 22px; flex-shrink: 0;\n        background: var(--mj-bg-surface-sunken);\n    }\n    .provider-card-logo.sendgrid {\n        background: color-mix(in srgb, var(--mj-brand-primary) 15%, var(--mj-bg-surface));\n        color: var(--mj-brand-primary);\n    }\n    .provider-card-logo.twilio {\n        background: color-mix(in srgb, var(--mj-status-error) 15%, var(--mj-bg-surface));\n        color: var(--mj-status-error);\n    }\n    .provider-card-logo.gmail {\n        background: color-mix(in srgb, var(--mj-status-error) 15%, var(--mj-bg-surface));\n        color: var(--mj-status-error);\n    }\n    .provider-card-logo.msgraph {\n        background: color-mix(in srgb, var(--mj-brand-primary) 15%, var(--mj-bg-surface));\n        color: var(--mj-brand-primary);\n    }\n\n    .provider-card-title { flex: 1; min-width: 0; }\n    .provider-card-name {\n        font-size: 15px; font-weight: 700;\n        color: var(--mj-text-primary);\n        white-space: nowrap; overflow: hidden; text-overflow: ellipsis;\n    }\n    .provider-card-desc {\n        font-size: 12px;\n        color: var(--mj-text-muted);\n        margin-top: 2px;\n    }\n    .provider-card-status {\n        font-size: 10px; font-weight: 700;\n        text-transform: uppercase; letter-spacing: 0.5px;\n        padding: 3px 10px; border-radius: 10px;\n        flex-shrink: 0;\n    }\n    .provider-card-status.active {\n        background: color-mix(in srgb, var(--mj-status-success) 15%, var(--mj-bg-surface));\n        color: var(--mj-status-success);\n    }\n    .provider-card-status.disabled {\n        background: var(--mj-bg-surface-sunken);\n        color: var(--mj-text-muted);\n    }\n\n    .provider-card-body { padding: 0 20px 16px; }\n\n    .provider-capabilities {\n        display: flex; flex-wrap: wrap;\n        gap: 6px; margin-bottom: 16px;\n    }\n    .capability-chip {\n        display: inline-flex; align-items: center;\n        gap: 4px; padding: 4px 10px;\n        border-radius: 12px; font-size: 11px; font-weight: 500;\n    }\n    .capability-chip.supported {\n        background: color-mix(in srgb, var(--mj-status-success) 15%, var(--mj-bg-surface));\n        color: var(--mj-status-success);\n    }\n    .capability-chip.unsupported {\n        background: var(--mj-bg-surface-sunken);\n        color: var(--mj-text-muted);\n        text-decoration: line-through;\n    }\n\n    .provider-card-stats {\n        display: grid;\n        grid-template-columns: repeat(3, 1fr);\n        gap: 12px; padding: 12px;\n        background: var(--mj-bg-surface-sunken);\n        border-radius: 8px;\n    }\n    .provider-stat { text-align: center; }\n    .provider-stat-value {\n        font-size: 16px; font-weight: 800;\n        color: var(--mj-text-primary);\n    }\n    .provider-stat-label {\n        font-size: 10px;\n        color: var(--mj-text-muted);\n        text-transform: uppercase; letter-spacing: 0.3px;\n    }\n\n    .provider-card-footer {\n        display: flex;\n        border-top: 1px solid var(--mj-border-default);\n    }\n    .provider-card-footer button {\n        flex: 1; padding: 12px;\n        border: none; background: transparent;\n        font-size: 12px; font-weight: 600;\n        color: var(--mj-brand-primary);\n        cursor: pointer; transition: background 0.15s;\n        font-family: inherit;\n        display: flex; align-items: center;\n        justify-content: center; gap: 6px;\n    }\n    .provider-card-footer button:hover {\n        background: var(--mj-bg-surface-sunken);\n    }\n    .provider-card-footer button + button {\n        border-left: 1px solid var(--mj-border-default);\n    }\n  "] }]
    }], () => [{ type: i0.ChangeDetectorRef }, { type: i1.NavigationService }], null); })();
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CommunicationProvidersResourceComponent, { className: "CommunicationProvidersResourceComponent", filePath: "src/Communication/communication-providers-resource.component.ts", lineNumber: 258 }); })();
//# sourceMappingURL=communication-providers-resource.component.js.map