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 } from '@memberjunction/core';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
function CommunicationLogsResourceComponent_For_40_Conditional_19_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "span", 19);
    i0.ɵɵtext(1);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const log_r1 = i0.ɵɵnextContext().$implicit;
    i0.ɵɵproperty("title", log_r1.ErrorMessage);
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate1(" ", log_r1.ErrorMessage, " ");
} }
function CommunicationLogsResourceComponent_For_40_Conditional_20_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "span", 20);
    i0.ɵɵtext(1, "\u2014");
    i0.ɵɵelementEnd();
} }
function CommunicationLogsResourceComponent_For_40_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "tr")(1, "td")(2, "span", 16);
    i0.ɵɵelement(3, "i");
    i0.ɵɵtext(4);
    i0.ɵɵelementEnd()();
    i0.ɵɵelementStart(5, "td")(6, "span", 17);
    i0.ɵɵelement(7, "i");
    i0.ɵɵtext(8);
    i0.ɵɵelementEnd()();
    i0.ɵɵelementStart(9, "td")(10, "span", 18);
    i0.ɵɵelement(11, "i");
    i0.ɵɵtext(12);
    i0.ɵɵelementEnd()();
    i0.ɵɵelementStart(13, "td");
    i0.ɵɵtext(14);
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(15, "td");
    i0.ɵɵtext(16);
    i0.ɵɵpipe(17, "date");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(18, "td");
    i0.ɵɵconditionalCreate(19, CommunicationLogsResourceComponent_For_40_Conditional_19_Template, 2, 2, "span", 19);
    i0.ɵɵconditionalCreate(20, CommunicationLogsResourceComponent_For_40_Conditional_20_Template, 2, 0, "span", 20);
    i0.ɵɵelementEnd()();
} if (rf & 2) {
    const log_r1 = ctx.$implicit;
    const ctx_r1 = i0.ɵɵnextContext();
    i0.ɵɵadvance(2);
    i0.ɵɵproperty("ngClass", ctx_r1.getStatusClass(log_r1.Status));
    i0.ɵɵadvance();
    i0.ɵɵclassMap(ctx_r1.getStatusIcon(log_r1.Status));
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate1(" ", log_r1.Status, " ");
    i0.ɵɵadvance(2);
    i0.ɵɵproperty("ngClass", log_r1.Direction.toLowerCase());
    i0.ɵɵadvance();
    i0.ɵɵclassMap(log_r1.Direction === "Sending" ? "fa-solid fa-arrow-up-right" : "fa-solid fa-arrow-down-left");
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate1(" ", log_r1.Direction, " ");
    i0.ɵɵadvance(3);
    i0.ɵɵclassMap(ctx_r1.getProviderIcon(log_r1.CommunicationProvider));
    i0.ɵɵstyleProp("color", ctx_r1.getProviderColor(log_r1.CommunicationProvider));
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate1(" ", log_r1.CommunicationProvider, " ");
    i0.ɵɵadvance(2);
    i0.ɵɵtextInterpolate(log_r1.CommunicationProviderMessageType);
    i0.ɵɵadvance(2);
    i0.ɵɵtextInterpolate(i0.ɵɵpipeBind2(17, 17, log_r1.MessageDate, "medium"));
    i0.ɵɵadvance(3);
    i0.ɵɵconditional(log_r1.ErrorMessage ? 19 : -1);
    i0.ɵɵadvance();
    i0.ɵɵconditional(!log_r1.ErrorMessage ? 20 : -1);
} }
function CommunicationLogsResourceComponent_Conditional_41_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "tr")(1, "td", 21)(2, "div", 22);
    i0.ɵɵelement(3, "i", 23);
    i0.ɵɵelementStart(4, "p");
    i0.ɵɵtext(5, "No logs found matching your criteria");
    i0.ɵɵelementEnd()()()();
} }
let CommunicationLogsResourceComponent = class CommunicationLogsResourceComponent extends BaseResourceComponent {
    cdr;
    logs = [];
    filteredLogs = [];
    isLoading = false;
    statusFilter = '';
    searchTerm = '';
    constructor(cdr) {
        super();
        this.cdr = cdr;
    }
    async ngOnInit() {
        await this.loadData();
        this.NotifyLoadComplete();
    }
    ngOnDestroy() { }
    async loadData() {
        try {
            this.isLoading = true;
            this.cdr.detectChanges();
            const rv = new RunView();
            const result = await rv.RunView({
                EntityName: 'MJ: Communication Logs',
                OrderBy: 'MessageDate DESC',
                MaxRows: 200,
                ResultType: 'entity_object'
            });
            if (result.Success) {
                this.logs = result.Results;
                this.applyFilter();
            }
        }
        catch (error) {
            console.error('Error loading logs:', error);
        }
        finally {
            this.isLoading = false;
            this.cdr.detectChanges();
        }
    }
    onSearch(event) {
        this.searchTerm = event.target.value.toLowerCase();
        this.applyFilter();
    }
    onStatusFilter(status) {
        this.statusFilter = status;
        this.applyFilter();
    }
    getStatusClass(status) {
        const s = (status || '').toLowerCase();
        if (s === 'complete')
            return 'complete';
        if (s === 'failed')
            return 'failed';
        if (s === 'pending')
            return 'pending';
        if (s === 'in-progress')
            return 'in-progress';
        return '';
    }
    getStatusIcon(status) {
        const s = (status || '').toLowerCase();
        if (s === 'complete')
            return 'fa-solid fa-check';
        if (s === 'failed')
            return 'fa-solid fa-xmark';
        if (s === 'pending')
            return 'fa-solid fa-clock';
        if (s === 'in-progress')
            return 'fa-solid fa-spinner';
        return 'fa-solid fa-circle';
    }
    getProviderIcon(name) {
        if (!name)
            return 'fa-solid fa-server';
        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'))
            return 'fa-brands fa-microsoft';
        return 'fa-solid fa-server';
    }
    getProviderColor(name) {
        if (!name)
            return 'inherit';
        const n = name.toLowerCase();
        if (n.includes('sendgrid'))
            return '#1A82E2';
        if (n.includes('twilio'))
            return '#F22F46';
        if (n.includes('gmail') || n.includes('google'))
            return '#EA4335';
        if (n.includes('microsoft') || n.includes('graph'))
            return '#0078D4';
        return 'inherit';
    }
    applyFilter() {
        let filtered = this.logs;
        if (this.statusFilter) {
            filtered = filtered.filter(l => l.Status === this.statusFilter);
        }
        if (this.searchTerm) {
            filtered = filtered.filter(l => l.CommunicationProvider?.toLowerCase().includes(this.searchTerm) ||
                l.CommunicationProviderMessageType?.toLowerCase().includes(this.searchTerm) ||
                l.Status?.toLowerCase().includes(this.searchTerm) ||
                l.ErrorMessage?.toLowerCase().includes(this.searchTerm));
        }
        this.filteredLogs = filtered;
        this.cdr.detectChanges();
    }
    async GetResourceDisplayName(data) {
        return 'Message Logs';
    }
    async GetResourceIconClass(data) {
        return 'fa-solid fa-list-ul';
    }
    static ɵfac = function CommunicationLogsResourceComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || CommunicationLogsResourceComponent)(i0.ɵɵdirectiveInject(i0.ChangeDetectorRef)); };
    static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: CommunicationLogsResourceComponent, selectors: [["mj-communication-logs-resource"]], standalone: false, features: [i0.ɵɵInheritDefinitionFeature], decls: 42, vars: 11, consts: [[1, "logs-wrapper"], [1, "card"], [1, "logs-toolbar"], [1, "search-input-wrapper"], [1, "fa-solid", "fa-search"], ["type", "text", "placeholder", "Search messages, providers, recipients...", 3, "input"], [1, "filter-chip", 3, "click"], [1, "fa-solid", "fa-filter"], [1, "fa-solid", "fa-check-circle"], [1, "fa-solid", "fa-times-circle"], [1, "fa-solid", "fa-clock"], [1, "toolbar-spacer"], [1, "tb-btn", 3, "click"], [1, "fa-solid", "fa-rotate"], [1, "table-wrapper"], [1, "log-table"], [1, "log-status-badge", 3, "ngClass"], [1, "log-direction", 3, "ngClass"], [1, "log-provider-badge"], [1, "log-error-text", 3, "title"], [1, "no-error"], ["colspan", "6", 1, "no-data"], [1, "empty-state"], [1, "fa-solid", "fa-inbox"]], template: function CommunicationLogsResourceComponent_Template(rf, ctx) { if (rf & 1) {
            i0.ɵɵelementStart(0, "div", 0)(1, "div", 1)(2, "div", 2)(3, "div", 3);
            i0.ɵɵelement(4, "i", 4);
            i0.ɵɵelementStart(5, "input", 5);
            i0.ɵɵlistener("input", function CommunicationLogsResourceComponent_Template_input_input_5_listener($event) { return ctx.onSearch($event); });
            i0.ɵɵelementEnd()();
            i0.ɵɵelementStart(6, "div", 6);
            i0.ɵɵlistener("click", function CommunicationLogsResourceComponent_Template_div_click_6_listener() { return ctx.onStatusFilter(""); });
            i0.ɵɵelement(7, "i", 7);
            i0.ɵɵtext(8, " All ");
            i0.ɵɵelementEnd();
            i0.ɵɵelementStart(9, "div", 6);
            i0.ɵɵlistener("click", function CommunicationLogsResourceComponent_Template_div_click_9_listener() { return ctx.onStatusFilter("Complete"); });
            i0.ɵɵelement(10, "i", 8);
            i0.ɵɵtext(11, " Sent ");
            i0.ɵɵelementEnd();
            i0.ɵɵelementStart(12, "div", 6);
            i0.ɵɵlistener("click", function CommunicationLogsResourceComponent_Template_div_click_12_listener() { return ctx.onStatusFilter("Failed"); });
            i0.ɵɵelement(13, "i", 9);
            i0.ɵɵtext(14, " Failed ");
            i0.ɵɵelementEnd();
            i0.ɵɵelementStart(15, "div", 6);
            i0.ɵɵlistener("click", function CommunicationLogsResourceComponent_Template_div_click_15_listener() { return ctx.onStatusFilter("Pending"); });
            i0.ɵɵelement(16, "i", 10);
            i0.ɵɵtext(17, " Pending ");
            i0.ɵɵelementEnd();
            i0.ɵɵelement(18, "div", 11);
            i0.ɵɵelementStart(19, "button", 12);
            i0.ɵɵlistener("click", function CommunicationLogsResourceComponent_Template_button_click_19_listener() { return ctx.loadData(); });
            i0.ɵɵelement(20, "i", 13);
            i0.ɵɵtext(21, " Refresh ");
            i0.ɵɵelementEnd()();
            i0.ɵɵelementStart(22, "div", 14)(23, "table", 15)(24, "thead")(25, "tr")(26, "th");
            i0.ɵɵtext(27, "Status");
            i0.ɵɵelementEnd();
            i0.ɵɵelementStart(28, "th");
            i0.ɵɵtext(29, "Direction");
            i0.ɵɵelementEnd();
            i0.ɵɵelementStart(30, "th");
            i0.ɵɵtext(31, "Provider");
            i0.ɵɵelementEnd();
            i0.ɵɵelementStart(32, "th");
            i0.ɵɵtext(33, "Type");
            i0.ɵɵelementEnd();
            i0.ɵɵelementStart(34, "th");
            i0.ɵɵtext(35, "Date");
            i0.ɵɵelementEnd();
            i0.ɵɵelementStart(36, "th");
            i0.ɵɵtext(37, "Error");
            i0.ɵɵelementEnd()()();
            i0.ɵɵelementStart(38, "tbody");
            i0.ɵɵrepeaterCreate(39, CommunicationLogsResourceComponent_For_40_Template, 21, 20, "tr", null, i0.ɵɵrepeaterTrackByIdentity);
            i0.ɵɵconditionalCreate(41, CommunicationLogsResourceComponent_Conditional_41_Template, 6, 0, "tr");
            i0.ɵɵelementEnd()()()()();
        } if (rf & 2) {
            i0.ɵɵadvance(6);
            i0.ɵɵclassProp("active", ctx.statusFilter === "");
            i0.ɵɵadvance(3);
            i0.ɵɵclassProp("active", ctx.statusFilter === "Complete");
            i0.ɵɵadvance(3);
            i0.ɵɵclassProp("active", ctx.statusFilter === "Failed");
            i0.ɵɵadvance(3);
            i0.ɵɵclassProp("active", ctx.statusFilter === "Pending");
            i0.ɵɵadvance(5);
            i0.ɵɵclassProp("spinning", ctx.isLoading);
            i0.ɵɵadvance(19);
            i0.ɵɵrepeater(ctx.filteredLogs);
            i0.ɵɵadvance(2);
            i0.ɵɵconditional(ctx.filteredLogs.length === 0 && !ctx.isLoading ? 41 : -1);
        } }, dependencies: [i1.NgClass, i1.DatePipe], styles: [".logs-wrapper[_ngcontent-%COMP%] {\n        height: 100%;\n        padding: 24px;\n        background: var(--mj-bg-surface);\n    }\n    .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        display: flex;\n        flex-direction: column;\n        height: 100%;\n    }\n\n    \n\n    .logs-toolbar[_ngcontent-%COMP%] {\n        display: flex;\n        align-items: center;\n        gap: 8px;\n        padding: 12px 20px;\n        border-bottom: 1px solid var(--mj-border-default);\n        background: var(--mj-bg-surface-sunken);\n        flex-shrink: 0;\n    }\n    .search-input-wrapper[_ngcontent-%COMP%] {\n        display: flex;\n        align-items: center;\n        gap: 8px;\n        flex: 1;\n        max-width: 400px;\n        padding: 6px 12px;\n        border: 1px solid var(--mj-border-default);\n        border-radius: 8px;\n        background: var(--mj-bg-surface);\n        transition: border-color 0.15s, box-shadow 0.15s;\n    }\n    .search-input-wrapper[_ngcontent-%COMP%]:focus-within {\n        border-color: var(--mj-brand-primary);\n        box-shadow: 0 0 0 2px color-mix(in srgb, var(--mj-brand-primary) 15%, transparent);\n    }\n    .search-input-wrapper[_ngcontent-%COMP%]   i[_ngcontent-%COMP%] { color: var(--mj-text-muted); font-size: 12px; }\n    .search-input-wrapper[_ngcontent-%COMP%]   input[_ngcontent-%COMP%] {\n        flex: 1; border: none; outline: none;\n        background: transparent; font-size: 12px;\n        font-family: inherit; color: var(--mj-text-primary);\n    }\n    .search-input-wrapper[_ngcontent-%COMP%]   input[_ngcontent-%COMP%]::placeholder { color: var(--mj-text-muted); }\n\n    .filter-chip[_ngcontent-%COMP%] {\n        display: inline-flex; align-items: center;\n        gap: 4px; padding: 4px 10px;\n        border: 1px solid var(--mj-border-default);\n        border-radius: 16px;\n        background: var(--mj-bg-surface-card);\n        font-size: 11px; font-weight: 500;\n        color: var(--mj-text-secondary);\n        cursor: pointer; transition: all 0.15s;\n    }\n    .filter-chip[_ngcontent-%COMP%]:hover {\n        border-color: var(--mj-border-strong);\n        background: var(--mj-bg-surface-sunken);\n    }\n    .filter-chip.active[_ngcontent-%COMP%] {\n        border-color: var(--mj-brand-primary);\n        background: color-mix(in srgb, var(--mj-brand-primary) 15%, var(--mj-bg-surface));\n        color: var(--mj-brand-primary);\n    }\n    .filter-chip[_ngcontent-%COMP%]   i[_ngcontent-%COMP%] { font-size: 10px; }\n\n    .toolbar-spacer[_ngcontent-%COMP%] { flex: 1; }\n\n    .tb-btn[_ngcontent-%COMP%] {\n        display: inline-flex; align-items: center;\n        gap: 6px; padding: 6px 12px;\n        border: 1px solid var(--mj-border-default);\n        border-radius: 4px;\n        background: var(--mj-bg-surface-card);\n        color: var(--mj-text-secondary);\n        font-size: 12px; font-weight: 500;\n        cursor: pointer; transition: all 0.15s ease;\n        font-family: inherit;\n    }\n    .tb-btn[_ngcontent-%COMP%]:hover {\n        background: var(--mj-bg-surface-sunken);\n        border-color: var(--mj-border-strong);\n        color: var(--mj-text-primary);\n    }\n    .tb-btn[_ngcontent-%COMP%]   i[_ngcontent-%COMP%] { font-size: 12px; }\n\n    @keyframes _ngcontent-%COMP%_spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }\n    .spinning[_ngcontent-%COMP%] { animation: _ngcontent-%COMP%_spin 1s linear infinite; }\n\n    \n\n    .table-wrapper[_ngcontent-%COMP%] { flex: 1; overflow-y: auto; }\n\n    .log-table[_ngcontent-%COMP%] {\n        width: 100%;\n        border-collapse: collapse;\n        font-size: 12px;\n    }\n    .log-table[_ngcontent-%COMP%]   thead[_ngcontent-%COMP%] {\n        background: var(--mj-bg-surface-sunken);\n        position: sticky; top: 0; z-index: 1;\n    }\n    .log-table[_ngcontent-%COMP%]   th[_ngcontent-%COMP%] {\n        padding: 10px 16px;\n        text-align: left;\n        font-weight: 700; font-size: 10px;\n        text-transform: uppercase; letter-spacing: 0.5px;\n        color: var(--mj-text-muted);\n        border-bottom: 1px solid var(--mj-border-default);\n        white-space: nowrap;\n    }\n    .log-table[_ngcontent-%COMP%]   td[_ngcontent-%COMP%] {\n        padding: 12px 16px;\n        border-bottom: 1px solid var(--mj-border-default);\n        color: var(--mj-text-primary);\n        vertical-align: middle;\n    }\n    .log-table[_ngcontent-%COMP%]   tbody[_ngcontent-%COMP%]   tr[_ngcontent-%COMP%] { transition: background 0.15s; }\n    .log-table[_ngcontent-%COMP%]   tbody[_ngcontent-%COMP%]   tr[_ngcontent-%COMP%]:hover { background: var(--mj-bg-surface-sunken); }\n\n    .log-status-badge[_ngcontent-%COMP%] {\n        display: inline-flex; align-items: center;\n        gap: 4px; font-size: 11px; font-weight: 600;\n        padding: 3px 10px;\n        border-radius: 4px;\n    }\n    .log-status-badge.complete[_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    .log-status-badge.failed[_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    .log-status-badge.pending[_ngcontent-%COMP%] {\n        background: color-mix(in srgb, var(--mj-status-warning) 15%, var(--mj-bg-surface));\n        color: var(--mj-status-warning);\n    }\n    .log-status-badge.in-progress[_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    .log-direction[_ngcontent-%COMP%] {\n        display: flex; align-items: center;\n        gap: 4px; font-size: 11px;\n        color: var(--mj-text-muted);\n    }\n    .log-direction[_ngcontent-%COMP%]   i[_ngcontent-%COMP%] { font-size: 10px; }\n    .log-direction.sending[_ngcontent-%COMP%]   i[_ngcontent-%COMP%] { color: var(--mj-brand-primary); }\n    .log-direction.receiving[_ngcontent-%COMP%]   i[_ngcontent-%COMP%] { color: var(--mj-status-success); }\n\n    .log-provider-badge[_ngcontent-%COMP%] {\n        display: inline-flex; align-items: center;\n        gap: 6px; padding: 3px 10px;\n        border-radius: 4px;\n        background: var(--mj-bg-surface-sunken);\n        font-weight: 500;\n    }\n\n    .log-error-text[_ngcontent-%COMP%] {\n        color: var(--mj-status-error);\n        max-width: 200px;\n        overflow: hidden; text-overflow: ellipsis;\n        white-space: nowrap; font-size: 11px;\n        display: block;\n    }\n    .no-error[_ngcontent-%COMP%] { color: var(--mj-text-muted); }\n\n    .no-data[_ngcontent-%COMP%] { padding: 0 !important; }\n    .empty-state[_ngcontent-%COMP%] {\n        display: flex; flex-direction: column;\n        align-items: center; justify-content: center;\n        padding: 48px 0; color: var(--mj-text-muted);\n    }\n    .empty-state[_ngcontent-%COMP%]   i[_ngcontent-%COMP%] { font-size: 2rem; margin-bottom: 12px; opacity: 0.5; }\n    .empty-state[_ngcontent-%COMP%]   p[_ngcontent-%COMP%] { margin: 0; font-size: 13px; }"] });
};
CommunicationLogsResourceComponent = __decorate([
    RegisterClass(BaseResourceComponent, 'CommunicationLogsResource')
], CommunicationLogsResourceComponent);
export { CommunicationLogsResourceComponent };
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CommunicationLogsResourceComponent, [{
        type: Component,
        args: [{ standalone: false, selector: 'mj-communication-logs-resource', template: `
    <div class="logs-wrapper">
      <div class="card">
        <div class="logs-toolbar">
          <div class="search-input-wrapper">
            <i class="fa-solid fa-search"></i>
            <input type="text" placeholder="Search messages, providers, recipients..." (input)="onSearch($event)">
          </div>
          <div class="filter-chip" [class.active]="statusFilter === ''"
            (click)="onStatusFilter('')">
            <i class="fa-solid fa-filter"></i> All
          </div>
          <div class="filter-chip" [class.active]="statusFilter === 'Complete'"
            (click)="onStatusFilter('Complete')">
            <i class="fa-solid fa-check-circle"></i> Sent
          </div>
          <div class="filter-chip" [class.active]="statusFilter === 'Failed'"
            (click)="onStatusFilter('Failed')">
            <i class="fa-solid fa-times-circle"></i> Failed
          </div>
          <div class="filter-chip" [class.active]="statusFilter === 'Pending'"
            (click)="onStatusFilter('Pending')">
            <i class="fa-solid fa-clock"></i> Pending
          </div>
          <div class="toolbar-spacer"></div>
          <button class="tb-btn" (click)="loadData()">
            <i class="fa-solid fa-rotate" [class.spinning]="isLoading"></i> Refresh
          </button>
        </div>
        <div class="table-wrapper">
          <table class="log-table">
            <thead>
              <tr>
                <th>Status</th>
                <th>Direction</th>
                <th>Provider</th>
                <th>Type</th>
                <th>Date</th>
                <th>Error</th>
              </tr>
            </thead>
            <tbody>
              @for (log of filteredLogs; track log) {
                <tr>
                  <td>
                    <span class="log-status-badge" [ngClass]="getStatusClass(log.Status)">
                      <i [class]="getStatusIcon(log.Status)"></i>
                      {{log.Status}}
                    </span>
                  </td>
                  <td>
                    <span class="log-direction" [ngClass]="log.Direction.toLowerCase()">
                      <i [class]="log.Direction === 'Sending' ? 'fa-solid fa-arrow-up-right' : 'fa-solid fa-arrow-down-left'"></i>
                      {{log.Direction}}
                    </span>
                  </td>
                  <td>
                    <span class="log-provider-badge">
                      <i [class]="getProviderIcon(log.CommunicationProvider)" [style.color]="getProviderColor(log.CommunicationProvider)"></i>
                      {{log.CommunicationProvider}}
                    </span>
                  </td>
                  <td>{{log.CommunicationProviderMessageType}}</td>
                  <td>{{log.MessageDate | date:'medium'}}</td>
                  <td>
                    @if (log.ErrorMessage) {
                      <span class="log-error-text" [title]="log.ErrorMessage">
                        {{log.ErrorMessage}}
                      </span>
                    }
                    @if (!log.ErrorMessage) {
                      <span class="no-error">&mdash;</span>
                    }
                  </td>
                </tr>
              }
              @if (filteredLogs.length === 0 && !isLoading) {
                <tr>
                  <td colspan="6" class="no-data">
                    <div class="empty-state">
                      <i class="fa-solid fa-inbox"></i>
                      <p>No logs found matching your criteria</p>
                    </div>
                  </td>
                </tr>
              }
            </tbody>
          </table>
        </div>
      </div>
    </div>
    `, styles: ["\n    .logs-wrapper {\n        height: 100%;\n        padding: 24px;\n        background: var(--mj-bg-surface);\n    }\n    .card {\n        background: var(--mj-bg-surface-card);\n        border: 1px solid var(--mj-border-default);\n        border-radius: 12px;\n        overflow: hidden;\n        display: flex;\n        flex-direction: column;\n        height: 100%;\n    }\n\n    /* TOOLBAR */\n    .logs-toolbar {\n        display: flex;\n        align-items: center;\n        gap: 8px;\n        padding: 12px 20px;\n        border-bottom: 1px solid var(--mj-border-default);\n        background: var(--mj-bg-surface-sunken);\n        flex-shrink: 0;\n    }\n    .search-input-wrapper {\n        display: flex;\n        align-items: center;\n        gap: 8px;\n        flex: 1;\n        max-width: 400px;\n        padding: 6px 12px;\n        border: 1px solid var(--mj-border-default);\n        border-radius: 8px;\n        background: var(--mj-bg-surface);\n        transition: border-color 0.15s, box-shadow 0.15s;\n    }\n    .search-input-wrapper:focus-within {\n        border-color: var(--mj-brand-primary);\n        box-shadow: 0 0 0 2px color-mix(in srgb, var(--mj-brand-primary) 15%, transparent);\n    }\n    .search-input-wrapper i { color: var(--mj-text-muted); font-size: 12px; }\n    .search-input-wrapper input {\n        flex: 1; border: none; outline: none;\n        background: transparent; font-size: 12px;\n        font-family: inherit; color: var(--mj-text-primary);\n    }\n    .search-input-wrapper input::placeholder { color: var(--mj-text-muted); }\n\n    .filter-chip {\n        display: inline-flex; align-items: center;\n        gap: 4px; padding: 4px 10px;\n        border: 1px solid var(--mj-border-default);\n        border-radius: 16px;\n        background: var(--mj-bg-surface-card);\n        font-size: 11px; font-weight: 500;\n        color: var(--mj-text-secondary);\n        cursor: pointer; transition: all 0.15s;\n    }\n    .filter-chip:hover {\n        border-color: var(--mj-border-strong);\n        background: var(--mj-bg-surface-sunken);\n    }\n    .filter-chip.active {\n        border-color: var(--mj-brand-primary);\n        background: color-mix(in srgb, var(--mj-brand-primary) 15%, var(--mj-bg-surface));\n        color: var(--mj-brand-primary);\n    }\n    .filter-chip i { font-size: 10px; }\n\n    .toolbar-spacer { flex: 1; }\n\n    .tb-btn {\n        display: inline-flex; align-items: center;\n        gap: 6px; padding: 6px 12px;\n        border: 1px solid var(--mj-border-default);\n        border-radius: 4px;\n        background: var(--mj-bg-surface-card);\n        color: var(--mj-text-secondary);\n        font-size: 12px; font-weight: 500;\n        cursor: pointer; transition: all 0.15s ease;\n        font-family: inherit;\n    }\n    .tb-btn:hover {\n        background: var(--mj-bg-surface-sunken);\n        border-color: var(--mj-border-strong);\n        color: var(--mj-text-primary);\n    }\n    .tb-btn i { font-size: 12px; }\n\n    @keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }\n    .spinning { animation: spin 1s linear infinite; }\n\n    /* TABLE */\n    .table-wrapper { flex: 1; overflow-y: auto; }\n\n    .log-table {\n        width: 100%;\n        border-collapse: collapse;\n        font-size: 12px;\n    }\n    .log-table thead {\n        background: var(--mj-bg-surface-sunken);\n        position: sticky; top: 0; z-index: 1;\n    }\n    .log-table th {\n        padding: 10px 16px;\n        text-align: left;\n        font-weight: 700; font-size: 10px;\n        text-transform: uppercase; letter-spacing: 0.5px;\n        color: var(--mj-text-muted);\n        border-bottom: 1px solid var(--mj-border-default);\n        white-space: nowrap;\n    }\n    .log-table td {\n        padding: 12px 16px;\n        border-bottom: 1px solid var(--mj-border-default);\n        color: var(--mj-text-primary);\n        vertical-align: middle;\n    }\n    .log-table tbody tr { transition: background 0.15s; }\n    .log-table tbody tr:hover { background: var(--mj-bg-surface-sunken); }\n\n    .log-status-badge {\n        display: inline-flex; align-items: center;\n        gap: 4px; font-size: 11px; font-weight: 600;\n        padding: 3px 10px;\n        border-radius: 4px;\n    }\n    .log-status-badge.complete {\n        background: color-mix(in srgb, var(--mj-status-success) 15%, var(--mj-bg-surface));\n        color: var(--mj-status-success);\n    }\n    .log-status-badge.failed {\n        background: color-mix(in srgb, var(--mj-status-error) 15%, var(--mj-bg-surface));\n        color: var(--mj-status-error);\n    }\n    .log-status-badge.pending {\n        background: color-mix(in srgb, var(--mj-status-warning) 15%, var(--mj-bg-surface));\n        color: var(--mj-status-warning);\n    }\n    .log-status-badge.in-progress {\n        background: color-mix(in srgb, var(--mj-brand-primary) 15%, var(--mj-bg-surface));\n        color: var(--mj-brand-primary);\n    }\n\n    .log-direction {\n        display: flex; align-items: center;\n        gap: 4px; font-size: 11px;\n        color: var(--mj-text-muted);\n    }\n    .log-direction i { font-size: 10px; }\n    .log-direction.sending i { color: var(--mj-brand-primary); }\n    .log-direction.receiving i { color: var(--mj-status-success); }\n\n    .log-provider-badge {\n        display: inline-flex; align-items: center;\n        gap: 6px; padding: 3px 10px;\n        border-radius: 4px;\n        background: var(--mj-bg-surface-sunken);\n        font-weight: 500;\n    }\n\n    .log-error-text {\n        color: var(--mj-status-error);\n        max-width: 200px;\n        overflow: hidden; text-overflow: ellipsis;\n        white-space: nowrap; font-size: 11px;\n        display: block;\n    }\n    .no-error { color: var(--mj-text-muted); }\n\n    .no-data { padding: 0 !important; }\n    .empty-state {\n        display: flex; flex-direction: column;\n        align-items: center; justify-content: center;\n        padding: 48px 0; color: var(--mj-text-muted);\n    }\n    .empty-state i { font-size: 2rem; margin-bottom: 12px; opacity: 0.5; }\n    .empty-state p { margin: 0; font-size: 13px; }\n  "] }]
    }], () => [{ type: i0.ChangeDetectorRef }], null); })();
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CommunicationLogsResourceComponent, { className: "CommunicationLogsResourceComponent", filePath: "src/Communication/communication-logs-resource.component.ts", lineNumber: 285 }); })();
//# sourceMappingURL=communication-logs-resource.component.js.map