import { Component, Input, Output, EventEmitter, ViewEncapsulation } from '@angular/core';
import { Metadata } from '@memberjunction/core';
import { UserViewEngine } from '@memberjunction/core-entities';
import { Subject } from 'rxjs';
import { UUIDsEqual } from '@memberjunction/global';
import * as i0 from "@angular/core";
import * as i1 from "@angular/forms";
const _forTrack0 = ($index, $item) => $item.id;
function ViewSelectorComponent_Conditional_1_Template(rf, ctx) { if (rf & 1) {
    const _r1 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "div", 16);
    i0.ɵɵlistener("click", function ViewSelectorComponent_Conditional_1_Template_div_click_0_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.closeDropdown()); });
    i0.ɵɵelementEnd();
} }
function ViewSelectorComponent_Conditional_7_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "span", 6);
    i0.ɵɵtext(1, "\u2022");
    i0.ɵɵelementEnd();
} }
function ViewSelectorComponent_Conditional_9_Conditional_5_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "span", 20);
    i0.ɵɵtext(1);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext(2);
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate(ctx_r1.entity.DisplayNameOrName);
} }
function ViewSelectorComponent_Conditional_9_Conditional_18_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "i", 32);
} }
function ViewSelectorComponent_Conditional_9_Conditional_19_For_8_Conditional_6_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "span", 44);
    i0.ɵɵtext(1, "Default");
    i0.ɵɵelementEnd();
} }
function ViewSelectorComponent_Conditional_9_Conditional_19_For_8_Conditional_7_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 45);
    i0.ɵɵtext(1);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const view_r5 = i0.ɵɵnextContext().$implicit;
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate(view_r5.entity.Description);
} }
function ViewSelectorComponent_Conditional_9_Conditional_19_For_8_Conditional_8_Conditional_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "span");
    i0.ɵɵelement(1, "i", 54);
    i0.ɵɵtext(2);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const view_r5 = i0.ɵɵnextContext(2).$implicit;
    const ctx_r1 = i0.ɵɵnextContext(3);
    i0.ɵɵadvance(2);
    i0.ɵɵtextInterpolate2(" ", ctx_r1.getViewFilterCount(view_r5), " filter", ctx_r1.getViewFilterCount(view_r5) !== 1 ? "s" : "");
} }
function ViewSelectorComponent_Conditional_9_Conditional_19_For_8_Conditional_8_Conditional_2_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "span");
    i0.ɵɵelement(1, "i", 55);
    i0.ɵɵtext(2);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const view_r5 = i0.ɵɵnextContext(2).$implicit;
    const ctx_r1 = i0.ɵɵnextContext(3);
    i0.ɵɵadvance(2);
    i0.ɵɵtextInterpolate2(" ", ctx_r1.getViewColumnCount(view_r5), " col", ctx_r1.getViewColumnCount(view_r5) !== 1 ? "s" : "");
} }
function ViewSelectorComponent_Conditional_9_Conditional_19_For_8_Conditional_8_Conditional_3_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "span");
    i0.ɵɵelement(1, "i", 56);
    i0.ɵɵtext(2);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const view_r5 = i0.ɵɵnextContext(2).$implicit;
    const ctx_r1 = i0.ɵɵnextContext(3);
    i0.ɵɵadvance(2);
    i0.ɵɵtextInterpolate1(" ", ctx_r1.getViewSortInfo(view_r5));
} }
function ViewSelectorComponent_Conditional_9_Conditional_19_For_8_Conditional_8_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 46);
    i0.ɵɵconditionalCreate(1, ViewSelectorComponent_Conditional_9_Conditional_19_For_8_Conditional_8_Conditional_1_Template, 3, 2, "span");
    i0.ɵɵconditionalCreate(2, ViewSelectorComponent_Conditional_9_Conditional_19_For_8_Conditional_8_Conditional_2_Template, 3, 2, "span");
    i0.ɵɵconditionalCreate(3, ViewSelectorComponent_Conditional_9_Conditional_19_For_8_Conditional_8_Conditional_3_Template, 3, 1, "span");
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const view_r5 = i0.ɵɵnextContext().$implicit;
    const ctx_r1 = i0.ɵɵnextContext(3);
    i0.ɵɵadvance();
    i0.ɵɵconditional(ctx_r1.getViewFilterCount(view_r5) > 0 ? 1 : -1);
    i0.ɵɵadvance();
    i0.ɵɵconditional(ctx_r1.getViewColumnCount(view_r5) > 0 ? 2 : -1);
    i0.ɵɵadvance();
    i0.ɵɵconditional(ctx_r1.getViewSortInfo(view_r5) ? 3 : -1);
} }
function ViewSelectorComponent_Conditional_9_Conditional_19_For_8_Conditional_16_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "i", 32);
} }
function ViewSelectorComponent_Conditional_9_Conditional_19_For_8_Template(rf, ctx) { if (rf & 1) {
    const _r4 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "div", 27);
    i0.ɵɵlistener("click", function ViewSelectorComponent_Conditional_9_Conditional_19_For_8_Template_div_click_0_listener() { const view_r5 = i0.ɵɵrestoreView(_r4).$implicit; const ctx_r1 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r1.selectView(view_r5)); });
    i0.ɵɵelementStart(1, "div", 28);
    i0.ɵɵelement(2, "i", 43);
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(3, "div", 30)(4, "div", 31);
    i0.ɵɵtext(5);
    i0.ɵɵconditionalCreate(6, ViewSelectorComponent_Conditional_9_Conditional_19_For_8_Conditional_6_Template, 2, 0, "span", 44);
    i0.ɵɵelementEnd();
    i0.ɵɵconditionalCreate(7, ViewSelectorComponent_Conditional_9_Conditional_19_For_8_Conditional_7_Template, 2, 1, "div", 45);
    i0.ɵɵconditionalCreate(8, ViewSelectorComponent_Conditional_9_Conditional_19_For_8_Conditional_8_Template, 4, 3, "div", 46);
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(9, "div", 47)(10, "button", 48);
    i0.ɵɵlistener("click", function ViewSelectorComponent_Conditional_9_Conditional_19_For_8_Template_button_click_10_listener($event) { const view_r5 = i0.ɵɵrestoreView(_r4).$implicit; const ctx_r1 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r1.onDuplicateView(view_r5.id, $event)); });
    i0.ɵɵelement(11, "i", 49);
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(12, "button", 50);
    i0.ɵɵlistener("click", function ViewSelectorComponent_Conditional_9_Conditional_19_For_8_Template_button_click_12_listener($event) { const view_r5 = i0.ɵɵrestoreView(_r4).$implicit; const ctx_r1 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r1.onConfigureViewById(view_r5.id, $event)); });
    i0.ɵɵelement(13, "i", 51);
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(14, "button", 52);
    i0.ɵɵlistener("click", function ViewSelectorComponent_Conditional_9_Conditional_19_For_8_Template_button_click_14_listener($event) { const view_r5 = i0.ɵɵrestoreView(_r4).$implicit; const ctx_r1 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r1.onOpenViewInTab(view_r5.id, $event)); });
    i0.ɵɵelement(15, "i", 53);
    i0.ɵɵelementEnd()();
    i0.ɵɵconditionalCreate(16, ViewSelectorComponent_Conditional_9_Conditional_19_For_8_Conditional_16_Template, 1, 0, "i", 32);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const view_r5 = ctx.$implicit;
    const ctx_r1 = i0.ɵɵnextContext(3);
    i0.ɵɵclassProp("active", ctx_r1.selectedViewId === view_r5.id);
    i0.ɵɵadvance();
    i0.ɵɵclassProp("active", ctx_r1.selectedViewId === view_r5.id);
    i0.ɵɵadvance(4);
    i0.ɵɵtextInterpolate1(" ", view_r5.name, " ");
    i0.ɵɵadvance();
    i0.ɵɵconditional(view_r5.isDefault ? 6 : -1);
    i0.ɵɵadvance();
    i0.ɵɵconditional(view_r5.entity.Description ? 7 : -1);
    i0.ɵɵadvance();
    i0.ɵɵconditional(ctx_r1.getViewFilterCount(view_r5) > 0 || ctx_r1.getViewColumnCount(view_r5) > 0 || ctx_r1.getViewSortInfo(view_r5) ? 8 : -1);
    i0.ɵɵadvance(8);
    i0.ɵɵconditional(ctx_r1.selectedViewId === view_r5.id ? 16 : -1);
} }
function ViewSelectorComponent_Conditional_9_Conditional_19_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 26)(1, "div", 39);
    i0.ɵɵelement(2, "i", 40);
    i0.ɵɵelementStart(3, "span");
    i0.ɵɵtext(4, "My Views");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(5, "span", 41);
    i0.ɵɵtext(6);
    i0.ɵɵelementEnd()();
    i0.ɵɵrepeaterCreate(7, ViewSelectorComponent_Conditional_9_Conditional_19_For_8_Template, 17, 9, "div", 42, _forTrack0);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext(2);
    i0.ɵɵadvance(6);
    i0.ɵɵtextInterpolate(ctx_r1.filteredMyViews.length);
    i0.ɵɵadvance();
    i0.ɵɵrepeater(ctx_r1.filteredMyViews);
} }
function ViewSelectorComponent_Conditional_9_Conditional_20_For_8_Conditional_6_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "span", 60);
    i0.ɵɵtext(1, "View Only");
    i0.ɵɵelementEnd();
} }
function ViewSelectorComponent_Conditional_9_Conditional_20_For_8_Conditional_7_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "span", 61);
    i0.ɵɵtext(1, "Can Edit");
    i0.ɵɵelementEnd();
} }
function ViewSelectorComponent_Conditional_9_Conditional_20_For_8_Conditional_8_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 45);
    i0.ɵɵtext(1);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const view_r7 = i0.ɵɵnextContext().$implicit;
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate(view_r7.entity.Description);
} }
function ViewSelectorComponent_Conditional_9_Conditional_20_For_8_Conditional_9_Conditional_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "span");
    i0.ɵɵelement(1, "i", 54);
    i0.ɵɵtext(2);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const view_r7 = i0.ɵɵnextContext(2).$implicit;
    const ctx_r1 = i0.ɵɵnextContext(3);
    i0.ɵɵadvance(2);
    i0.ɵɵtextInterpolate2(" ", ctx_r1.getViewFilterCount(view_r7), " filter", ctx_r1.getViewFilterCount(view_r7) !== 1 ? "s" : "");
} }
function ViewSelectorComponent_Conditional_9_Conditional_20_For_8_Conditional_9_Conditional_2_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "span");
    i0.ɵɵelement(1, "i", 55);
    i0.ɵɵtext(2);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const view_r7 = i0.ɵɵnextContext(2).$implicit;
    const ctx_r1 = i0.ɵɵnextContext(3);
    i0.ɵɵadvance(2);
    i0.ɵɵtextInterpolate2(" ", ctx_r1.getViewColumnCount(view_r7), " col", ctx_r1.getViewColumnCount(view_r7) !== 1 ? "s" : "");
} }
function ViewSelectorComponent_Conditional_9_Conditional_20_For_8_Conditional_9_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 46);
    i0.ɵɵconditionalCreate(1, ViewSelectorComponent_Conditional_9_Conditional_20_For_8_Conditional_9_Conditional_1_Template, 3, 2, "span");
    i0.ɵɵconditionalCreate(2, ViewSelectorComponent_Conditional_9_Conditional_20_For_8_Conditional_9_Conditional_2_Template, 3, 2, "span");
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const view_r7 = i0.ɵɵnextContext().$implicit;
    const ctx_r1 = i0.ɵɵnextContext(3);
    i0.ɵɵadvance();
    i0.ɵɵconditional(ctx_r1.getViewFilterCount(view_r7) > 0 ? 1 : -1);
    i0.ɵɵadvance();
    i0.ɵɵconditional(ctx_r1.getViewColumnCount(view_r7) > 0 ? 2 : -1);
} }
function ViewSelectorComponent_Conditional_9_Conditional_20_For_8_Conditional_13_Template(rf, ctx) { if (rf & 1) {
    const _r8 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "button", 50);
    i0.ɵɵlistener("click", function ViewSelectorComponent_Conditional_9_Conditional_20_For_8_Conditional_13_Template_button_click_0_listener($event) { i0.ɵɵrestoreView(_r8); const view_r7 = i0.ɵɵnextContext().$implicit; const ctx_r1 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r1.onConfigureViewById(view_r7.id, $event)); });
    i0.ɵɵelement(1, "i", 51);
    i0.ɵɵelementEnd();
} }
function ViewSelectorComponent_Conditional_9_Conditional_20_For_8_Conditional_14_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "i", 32);
} }
function ViewSelectorComponent_Conditional_9_Conditional_20_For_8_Template(rf, ctx) { if (rf & 1) {
    const _r6 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "div", 27);
    i0.ɵɵlistener("click", function ViewSelectorComponent_Conditional_9_Conditional_20_For_8_Template_div_click_0_listener() { const view_r7 = i0.ɵɵrestoreView(_r6).$implicit; const ctx_r1 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r1.selectView(view_r7)); });
    i0.ɵɵelementStart(1, "div", 58);
    i0.ɵɵelement(2, "i", 59);
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(3, "div", 30)(4, "div", 31);
    i0.ɵɵtext(5);
    i0.ɵɵconditionalCreate(6, ViewSelectorComponent_Conditional_9_Conditional_20_For_8_Conditional_6_Template, 2, 0, "span", 60)(7, ViewSelectorComponent_Conditional_9_Conditional_20_For_8_Conditional_7_Template, 2, 0, "span", 61);
    i0.ɵɵelementEnd();
    i0.ɵɵconditionalCreate(8, ViewSelectorComponent_Conditional_9_Conditional_20_For_8_Conditional_8_Template, 2, 1, "div", 45);
    i0.ɵɵconditionalCreate(9, ViewSelectorComponent_Conditional_9_Conditional_20_For_8_Conditional_9_Template, 3, 2, "div", 46);
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(10, "div", 47)(11, "button", 62);
    i0.ɵɵlistener("click", function ViewSelectorComponent_Conditional_9_Conditional_20_For_8_Template_button_click_11_listener($event) { const view_r7 = i0.ɵɵrestoreView(_r6).$implicit; const ctx_r1 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r1.onDuplicateView(view_r7.id, $event)); });
    i0.ɵɵelement(12, "i", 49);
    i0.ɵɵelementEnd();
    i0.ɵɵconditionalCreate(13, ViewSelectorComponent_Conditional_9_Conditional_20_For_8_Conditional_13_Template, 2, 0, "button", 63);
    i0.ɵɵelementEnd();
    i0.ɵɵconditionalCreate(14, ViewSelectorComponent_Conditional_9_Conditional_20_For_8_Conditional_14_Template, 1, 0, "i", 32);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const view_r7 = ctx.$implicit;
    const ctx_r1 = i0.ɵɵnextContext(3);
    i0.ɵɵclassProp("active", ctx_r1.selectedViewId === view_r7.id);
    i0.ɵɵadvance(5);
    i0.ɵɵtextInterpolate1(" ", view_r7.name, " ");
    i0.ɵɵadvance();
    i0.ɵɵconditional(!view_r7.userCanEdit ? 6 : 7);
    i0.ɵɵadvance(2);
    i0.ɵɵconditional(view_r7.entity.Description ? 8 : -1);
    i0.ɵɵadvance();
    i0.ɵɵconditional(ctx_r1.getViewFilterCount(view_r7) > 0 || ctx_r1.getViewColumnCount(view_r7) > 0 ? 9 : -1);
    i0.ɵɵadvance(4);
    i0.ɵɵconditional(view_r7.userCanEdit ? 13 : -1);
    i0.ɵɵadvance();
    i0.ɵɵconditional(ctx_r1.selectedViewId === view_r7.id ? 14 : -1);
} }
function ViewSelectorComponent_Conditional_9_Conditional_20_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 26)(1, "div", 39);
    i0.ɵɵelement(2, "i", 57);
    i0.ɵɵelementStart(3, "span");
    i0.ɵɵtext(4, "Shared With Me");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(5, "span", 41);
    i0.ɵɵtext(6);
    i0.ɵɵelementEnd()();
    i0.ɵɵrepeaterCreate(7, ViewSelectorComponent_Conditional_9_Conditional_20_For_8_Template, 15, 8, "div", 42, _forTrack0);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext(2);
    i0.ɵɵadvance(6);
    i0.ɵɵtextInterpolate(ctx_r1.filteredSharedViews.length);
    i0.ɵɵadvance();
    i0.ɵɵrepeater(ctx_r1.filteredSharedViews);
} }
function ViewSelectorComponent_Conditional_9_Conditional_21_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 33);
    i0.ɵɵelement(1, "i", 64);
    i0.ɵɵelementStart(2, "div", 65)(3, "strong");
    i0.ɵɵtext(4, "No saved views yet");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(5, "span");
    i0.ɵɵtext(6, "Save your current configuration as a view");
    i0.ɵɵelementEnd()()();
} }
function ViewSelectorComponent_Conditional_9_Conditional_22_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 33);
    i0.ɵɵelement(1, "i", 66);
    i0.ɵɵelementStart(2, "span");
    i0.ɵɵtext(3);
    i0.ɵɵelementEnd()();
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext(2);
    i0.ɵɵadvance(3);
    i0.ɵɵtextInterpolate1("No views match \"", ctx_r1.searchText, "\"");
} }
function ViewSelectorComponent_Conditional_9_Conditional_23_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 34);
    i0.ɵɵelement(1, "i", 67);
    i0.ɵɵelementStart(2, "span");
    i0.ɵɵtext(3, "Loading views...");
    i0.ɵɵelementEnd()();
} }
function ViewSelectorComponent_Conditional_9_Template(rf, ctx) { if (rf & 1) {
    const _r3 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "div", 8)(1, "div", 17);
    i0.ɵɵelement(2, "i", 18);
    i0.ɵɵelementStart(3, "span", 19);
    i0.ɵɵtext(4, "Views");
    i0.ɵɵelementEnd();
    i0.ɵɵconditionalCreate(5, ViewSelectorComponent_Conditional_9_Conditional_5_Template, 2, 1, "span", 20);
    i0.ɵɵelementStart(6, "button", 21);
    i0.ɵɵlistener("click", function ViewSelectorComponent_Conditional_9_Template_button_click_6_listener() { i0.ɵɵrestoreView(_r3); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.closeDropdown()); });
    i0.ɵɵelement(7, "i", 22);
    i0.ɵɵelementEnd()();
    i0.ɵɵelementStart(8, "div", 23)(9, "input", 24);
    i0.ɵɵtwoWayListener("ngModelChange", function ViewSelectorComponent_Conditional_9_Template_input_ngModelChange_9_listener($event) { i0.ɵɵrestoreView(_r3); const ctx_r1 = i0.ɵɵnextContext(); i0.ɵɵtwoWayBindingSet(ctx_r1.searchText, $event) || (ctx_r1.searchText = $event); return i0.ɵɵresetView($event); });
    i0.ɵɵlistener("keydown.escape", function ViewSelectorComponent_Conditional_9_Template_input_keydown_escape_9_listener() { i0.ɵɵrestoreView(_r3); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.searchText = ""); });
    i0.ɵɵelementEnd()();
    i0.ɵɵelementStart(10, "div", 25)(11, "div", 26)(12, "div", 27);
    i0.ɵɵlistener("click", function ViewSelectorComponent_Conditional_9_Template_div_click_12_listener() { i0.ɵɵrestoreView(_r3); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.selectDefault()); });
    i0.ɵɵelementStart(13, "div", 28);
    i0.ɵɵelement(14, "i", 29);
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(15, "div", 30)(16, "div", 31);
    i0.ɵɵtext(17, "(Default)");
    i0.ɵɵelementEnd()();
    i0.ɵɵconditionalCreate(18, ViewSelectorComponent_Conditional_9_Conditional_18_Template, 1, 0, "i", 32);
    i0.ɵɵelementEnd()();
    i0.ɵɵconditionalCreate(19, ViewSelectorComponent_Conditional_9_Conditional_19_Template, 9, 1, "div", 26);
    i0.ɵɵconditionalCreate(20, ViewSelectorComponent_Conditional_9_Conditional_20_Template, 9, 1, "div", 26);
    i0.ɵɵconditionalCreate(21, ViewSelectorComponent_Conditional_9_Conditional_21_Template, 7, 0, "div", 33);
    i0.ɵɵconditionalCreate(22, ViewSelectorComponent_Conditional_9_Conditional_22_Template, 4, 1, "div", 33);
    i0.ɵɵconditionalCreate(23, ViewSelectorComponent_Conditional_9_Conditional_23_Template, 4, 0, "div", 34);
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(24, "div", 35)(25, "button", 36);
    i0.ɵɵlistener("click", function ViewSelectorComponent_Conditional_9_Template_button_click_25_listener() { i0.ɵɵrestoreView(_r3); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.onQuickSave()); });
    i0.ɵɵelement(26, "i", 13);
    i0.ɵɵelementStart(27, "span");
    i0.ɵɵtext(28, "New View");
    i0.ɵɵelementEnd()();
    i0.ɵɵelementStart(29, "button", 37);
    i0.ɵɵlistener("click", function ViewSelectorComponent_Conditional_9_Template_button_click_29_listener() { i0.ɵɵrestoreView(_r3); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.onResetToDefault()); });
    i0.ɵɵelement(30, "i", 38);
    i0.ɵɵelementStart(31, "span");
    i0.ɵɵtext(32, "Reset to Default");
    i0.ɵɵelementEnd()()()();
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext();
    i0.ɵɵadvance(5);
    i0.ɵɵconditional(ctx_r1.entity ? 5 : -1);
    i0.ɵɵadvance(4);
    i0.ɵɵtwoWayProperty("ngModel", ctx_r1.searchText);
    i0.ɵɵadvance(3);
    i0.ɵɵclassProp("active", !ctx_r1.selectedViewId);
    i0.ɵɵadvance();
    i0.ɵɵclassProp("active", !ctx_r1.selectedViewId);
    i0.ɵɵadvance(5);
    i0.ɵɵconditional(!ctx_r1.selectedViewId ? 18 : -1);
    i0.ɵɵadvance();
    i0.ɵɵconditional(ctx_r1.filteredMyViews.length > 0 ? 19 : -1);
    i0.ɵɵadvance();
    i0.ɵɵconditional(ctx_r1.filteredSharedViews.length > 0 ? 20 : -1);
    i0.ɵɵadvance();
    i0.ɵɵconditional(!ctx_r1.hasViews && !ctx_r1.isLoading ? 21 : -1);
    i0.ɵɵadvance();
    i0.ɵɵconditional(ctx_r1.hasViews && ctx_r1.filteredMyViews.length === 0 && ctx_r1.filteredSharedViews.length === 0 && ctx_r1.searchText ? 22 : -1);
    i0.ɵɵadvance();
    i0.ɵɵconditional(ctx_r1.isLoading ? 23 : -1);
} }
function ViewSelectorComponent_Conditional_10_Template(rf, ctx) { if (rf & 1) {
    const _r9 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "button", 68);
    i0.ɵɵlistener("click", function ViewSelectorComponent_Conditional_10_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r9); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.onOpenInTab()); });
    i0.ɵɵelement(1, "i", 69);
    i0.ɵɵelementEnd();
} }
/**
 * ViewSelectorComponent - Dropdown for selecting saved views
 *
 * Features:
 * - Shows "(Default)" option when no view is selected
 * - Groups views into "My Views" and "Shared Views"
 * - "Save Current View" and "Manage Views" actions
 * - "Open in Tab" button for saved views
 */
export class ViewSelectorComponent {
    cdr;
    /**
     * The entity to load views for
     */
    entity = null;
    /**
     * Currently selected view ID (null = default view)
     */
    selectedViewId = null;
    /**
     * Whether the current view has unsaved modifications
     */
    viewModified = false;
    /**
     * Emitted when a view is selected
     */
    viewSelected = new EventEmitter();
    /**
     * Emitted when user requests to save the current view
     */
    saveViewRequested = new EventEmitter();
    /**
     * Emitted when user wants to open the view management panel
     */
    manageViewsRequested = new EventEmitter();
    /**
     * Emitted when user wants to open the current view in its own tab
     */
    openInTabRequested = new EventEmitter();
    /**
     * Emitted when user wants to configure the current view
     */
    configureViewRequested = new EventEmitter();
    /**
     * Emitted when user wants to create a new record
     */
    createNewRecordRequested = new EventEmitter();
    /**
     * Emitted when user wants to export data to Excel
     */
    exportRequested = new EventEmitter();
    /**
     * Emitted when user wants to duplicate a view (F-005)
     */
    duplicateViewRequested = new EventEmitter();
    /**
     * Emitted when user wants to use the quick save dialog (F-001)
     * Emits true when user explicitly requested "Save As New", false for general save
     */
    quickSaveRequested = new EventEmitter();
    /**
     * Emitted when user wants to revert to saved state (F-007)
     */
    revertRequested = new EventEmitter();
    // Internal state
    isLoading = false;
    isDropdownOpen = false;
    myViews = [];
    sharedViews = [];
    selectedView = null;
    searchText = '';
    destroy$ = new Subject();
    metadata = new Metadata();
    constructor(cdr) {
        this.cdr = cdr;
    }
    ngOnChanges(changes) {
        if (changes['entity']) {
            if (this.entity) {
                this.loadViews();
            }
            else {
                this.myViews = [];
                this.sharedViews = [];
                this.selectedView = null;
            }
        }
        if (changes['selectedViewId'] && this.selectedViewId) {
            // If we have a selected view ID and it's in our lists, update selectedView
            this.updateSelectedViewFromId();
        }
    }
    ngOnDestroy() {
        this.destroy$.next();
        this.destroy$.complete();
    }
    /**
     * Load views for the current entity
     */
    async loadViews() {
        if (!this.entity) {
            return;
        }
        this.isLoading = true;
        this.cdr.detectChanges();
        try {
            const userId = this.metadata.CurrentUser?.ID;
            // Use UserViewEngine cache instead of a direct RunView to avoid redundant DB calls.
            // The engine is initialized once and caches all views; GetAccessibleViewsForEntity()
            // already filters by owned + shared and checks UserCanView.
            await UserViewEngine.Instance.Config(false);
            const accessibleViews = UserViewEngine.Instance.GetAccessibleViewsForEntity(this.entity.ID);
            // Separate into owned and shared
            this.myViews = accessibleViews
                .filter(v => UUIDsEqual(v.UserID, userId))
                .map(v => this.mapViewToListItem(v, true));
            this.sharedViews = accessibleViews
                .filter(v => !UUIDsEqual(v.UserID, userId))
                .map(v => this.mapViewToListItem(v, false));
            // Update selected view reference
            this.updateSelectedViewFromId();
        }
        catch (error) {
            console.error('Failed to load views:', error);
        }
        finally {
            this.isLoading = false;
            this.cdr.detectChanges();
        }
    }
    /**
     * Map a view entity to a list item
     */
    mapViewToListItem(view, isOwned) {
        return {
            id: view.ID,
            name: view.Name,
            isOwned,
            isShared: view.IsShared,
            isDefault: view.IsDefault,
            userCanEdit: view.UserCanEdit,
            entity: view
        };
    }
    /**
     * Update the selectedView reference based on selectedViewId
     */
    updateSelectedViewFromId() {
        if (!this.selectedViewId) {
            this.selectedView = null;
            return;
        }
        // Search in both lists
        const myView = this.myViews.find(v => v.id === this.selectedViewId);
        if (myView) {
            this.selectedView = myView.entity;
            return;
        }
        const sharedView = this.sharedViews.find(v => v.id === this.selectedViewId);
        if (sharedView) {
            this.selectedView = sharedView.entity;
            return;
        }
        // View not in lists yet - it might need to be loaded
        this.selectedView = null;
    }
    /**
     * Get the display name for the current selection
     */
    get displayName() {
        if (this.selectedView) {
            return this.selectedView.Name;
        }
        return '(Default)';
    }
    /**
     * Toggle dropdown open/closed
     */
    toggleDropdown() {
        this.isDropdownOpen = !this.isDropdownOpen;
        this.cdr.detectChanges();
    }
    /**
     * Close the dropdown
     */
    closeDropdown() {
        this.isDropdownOpen = false;
        this.searchText = '';
        this.cdr.detectChanges();
    }
    /**
     * Select the default view (no saved view)
     */
    selectDefault() {
        this.selectedView = null;
        this.viewSelected.emit({ viewId: null, view: null });
        this.closeDropdown();
    }
    /**
     * Select a view from the list
     */
    selectView(item) {
        this.selectedView = item.entity;
        this.viewSelected.emit({ viewId: item.id, view: item.entity });
        this.closeDropdown();
    }
    /**
     * Request to save the current view
     */
    onSaveView() {
        this.saveViewRequested.emit({ saveAsNew: false });
        this.closeDropdown();
    }
    /**
     * Request to save as a new view - opens Quick Save dialog in "Save As New" mode
     */
    onSaveAsNewView() {
        this.quickSaveRequested.emit(true);
        this.closeDropdown();
    }
    /**
     * Request to manage views
     */
    onManageViews() {
        this.manageViewsRequested.emit();
        this.closeDropdown();
    }
    /**
     * Request to open the current view in a tab
     */
    onOpenInTab() {
        if (this.selectedViewId) {
            this.openInTabRequested.emit(this.selectedViewId);
        }
    }
    /**
     * Request to configure the current view
     */
    onConfigureView() {
        this.configureViewRequested.emit();
    }
    /**
     * Request to create a new record
     */
    onCreateNewRecord() {
        this.createNewRecordRequested.emit();
    }
    /**
     * Request to export data to Excel
     */
    onExport() {
        this.exportRequested.emit();
    }
    /**
     * Request to duplicate a view (F-005)
     */
    onDuplicateView(viewId, event) {
        event.stopPropagation(); // Don't select the view
        this.duplicateViewRequested.emit(viewId);
        this.closeDropdown();
    }
    /**
     * Request to open the quick save dialog (F-001)
     */
    onQuickSave() {
        this.quickSaveRequested.emit(false);
        this.closeDropdown();
    }
    /**
     * Request to revert view to saved state (F-007)
     */
    onRevert() {
        this.revertRequested.emit();
    }
    /**
     * Check if there are any views to show
     */
    get hasViews() {
        return this.myViews.length > 0 || this.sharedViews.length > 0;
    }
    /**
     * Check if the current user can edit the selected view
     */
    get canEditSelectedView() {
        return this.selectedView?.UserCanEdit ?? false;
    }
    /**
     * Handle click outside to close dropdown
     */
    onClickOutside(event) {
        this.closeDropdown();
    }
    // ========================================
    // RICH VIEW PANEL: Search & Metadata
    // ========================================
    /**
     * My views filtered by search text
     */
    get filteredMyViews() {
        if (!this.searchText.trim())
            return this.myViews;
        const term = this.searchText.toLowerCase();
        return this.myViews.filter(v => v.name.toLowerCase().includes(term) ||
            (v.entity.Description || '').toLowerCase().includes(term));
    }
    /**
     * Shared views filtered by search text
     */
    get filteredSharedViews() {
        if (!this.searchText.trim())
            return this.sharedViews;
        const term = this.searchText.toLowerCase();
        return this.sharedViews.filter(v => v.name.toLowerCase().includes(term) ||
            (v.entity.Description || '').toLowerCase().includes(term));
    }
    /**
     * Get the number of filters configured in a view by parsing its FilterState
     */
    getViewFilterCount(view) {
        try {
            const filterState = view.entity.FilterState;
            if (!filterState)
                return 0;
            const parsed = JSON.parse(filterState);
            if (parsed?.filters?.length)
                return parsed.filters.length;
            // CompositeFilterDescriptor format
            if (parsed?.logic && parsed?.filters)
                return parsed.filters.length;
            return 0;
        }
        catch {
            return 0;
        }
    }
    /**
     * Get the number of visible columns in a view by parsing GridState
     */
    getViewColumnCount(view) {
        try {
            const gridState = view.entity.GridState;
            if (!gridState)
                return 0;
            const parsed = JSON.parse(gridState);
            if (Array.isArray(parsed)) {
                return parsed.filter((c) => !c['hidden']).length;
            }
            return 0;
        }
        catch {
            return 0;
        }
    }
    /**
     * Get sort info string from a view's SortState
     */
    getViewSortInfo(view) {
        try {
            const sortState = view.entity.SortState;
            if (!sortState)
                return '';
            const parsed = JSON.parse(sortState);
            if (Array.isArray(parsed) && parsed.length > 0) {
                return `${parsed.length} sort${parsed.length > 1 ? 's' : ''}`;
            }
            return '';
        }
        catch {
            return '';
        }
    }
    /**
     * Select a specific view and open the config panel for it
     */
    onConfigureViewById(viewId, event) {
        event.stopPropagation();
        // First select the view, then open config
        const item = this.myViews.find(v => v.id === viewId) || this.sharedViews.find(v => v.id === viewId);
        if (item) {
            this.selectedView = item.entity;
            this.viewSelected.emit({ viewId: item.id, view: item.entity });
        }
        this.configureViewRequested.emit();
        this.closeDropdown();
    }
    /**
     * Open a specific view in a new tab
     */
    onOpenViewInTab(viewId, event) {
        event.stopPropagation();
        this.openInTabRequested.emit(viewId);
        this.closeDropdown();
    }
    /**
     * Reset to default view (select no view)
     */
    onResetToDefault() {
        this.selectDefault();
    }
    static ɵfac = function ViewSelectorComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ViewSelectorComponent)(i0.ɵɵdirectiveInject(i0.ChangeDetectorRef)); };
    static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ViewSelectorComponent, selectors: [["mj-view-selector"]], inputs: { entity: "entity", selectedViewId: "selectedViewId", viewModified: "viewModified" }, outputs: { viewSelected: "viewSelected", saveViewRequested: "saveViewRequested", manageViewsRequested: "manageViewsRequested", openInTabRequested: "openInTabRequested", configureViewRequested: "configureViewRequested", createNewRecordRequested: "createNewRecordRequested", exportRequested: "exportRequested", duplicateViewRequested: "duplicateViewRequested", quickSaveRequested: "quickSaveRequested", revertRequested: "revertRequested" }, standalone: false, features: [i0.ɵɵNgOnChangesFeature], decls: 17, vars: 12, consts: [[1, "vs-container"], [1, "vs-backdrop"], [1, "vs-wrapper"], ["title", "Select a saved view", 1, "vs-button", 3, "click", "disabled"], [1, "fa-solid", "fa-layer-group", "vs-btn-icon"], [1, "vs-btn-name"], ["title", "View has unsaved changes", 1, "vs-modified-dot"], [1, "fa-solid", "fa-chevron-down", "vs-arrow"], [1, "vs-panel"], ["title", "Open this view in a new tab", 1, "vs-icon-btn"], ["title", "Configure view settings (columns, filters, sorting)", 1, "vs-icon-btn", 3, "click"], [1, "fa-solid", "fa-sliders-h"], ["title", "Create new record", 1, "vs-icon-btn", 3, "click"], [1, "fa-solid", "fa-plus"], ["title", "Export to Excel", 1, "vs-icon-btn", "vs-export-btn", 3, "click"], [1, "fa-solid", "fa-file-excel"], [1, "vs-backdrop", 3, "click"], [1, "vs-panel-header"], [1, "fa-solid", "fa-table-list", "vs-header-icon"], [1, "vs-panel-title"], [1, "vs-entity-badge"], ["title", "Close", 1, "vs-close-btn", 3, "click"], [1, "fa-solid", "fa-times"], [1, "vs-panel-search"], ["type", "text", "placeholder", "Search views...", 1, "vs-search-input", 3, "ngModelChange", "keydown.escape", "ngModel"], [1, "vs-panel-body"], [1, "vs-section"], [1, "vs-card", 3, "click"], [1, "vs-card-icon"], [1, "fa-solid", "fa-table"], [1, "vs-card-content"], [1, "vs-card-name"], [1, "fa-solid", "fa-check", "vs-card-check"], [1, "vs-empty-message"], [1, "vs-loading"], [1, "vs-panel-footer"], ["title", "Save current view configuration", 1, "vs-panel-btn", "primary", 3, "click"], ["title", "Reset to default view", 1, "vs-panel-btn", 3, "click"], [1, "fa-solid", "fa-arrow-rotate-left"], [1, "vs-section-header"], [1, "fa-solid", "fa-user"], [1, "vs-section-count"], [1, "vs-card", 3, "active"], [1, "fa-solid", "fa-table-list"], [1, "vs-default-badge"], [1, "vs-card-desc"], [1, "vs-card-meta"], [1, "vs-card-actions"], ["title", "Duplicate", 1, "vs-action-btn", 3, "click"], [1, "fa-regular", "fa-copy"], ["title", "Configure", 1, "vs-action-btn", 3, "click"], [1, "fa-solid", "fa-sliders"], ["title", "Open in Tab", 1, "vs-action-btn", 3, "click"], [1, "fa-solid", "fa-up-right-from-square"], [1, "fa-solid", "fa-filter"], [1, "fa-solid", "fa-table-columns"], [1, "fa-solid", "fa-arrow-down-short-wide"], [1, "fa-solid", "fa-share-nodes"], [1, "vs-card-icon", "shared"], [1, "fa-solid", "fa-users"], [1, "vs-shared-badge"], [1, "vs-shared-badge", "editable"], ["title", "Duplicate as My View", 1, "vs-action-btn", 3, "click"], ["title", "Configure", 1, "vs-action-btn"], [1, "fa-solid", "fa-bookmark"], [1, "vs-empty-text"], [1, "fa-solid", "fa-search"], [1, "fa-solid", "fa-spinner", "fa-spin"], ["title", "Open this view in a new tab", 1, "vs-icon-btn", 3, "click"], [1, "fa-solid", "fa-external-link-alt"]], template: function ViewSelectorComponent_Template(rf, ctx) { if (rf & 1) {
            i0.ɵɵelementStart(0, "div", 0);
            i0.ɵɵconditionalCreate(1, ViewSelectorComponent_Conditional_1_Template, 1, 0, "div", 1);
            i0.ɵɵelementStart(2, "div", 2)(3, "button", 3);
            i0.ɵɵlistener("click", function ViewSelectorComponent_Template_button_click_3_listener() { return ctx.toggleDropdown(); });
            i0.ɵɵelement(4, "i", 4);
            i0.ɵɵelementStart(5, "span", 5);
            i0.ɵɵtext(6);
            i0.ɵɵelementEnd();
            i0.ɵɵconditionalCreate(7, ViewSelectorComponent_Conditional_7_Template, 2, 0, "span", 6);
            i0.ɵɵelement(8, "i", 7);
            i0.ɵɵelementEnd();
            i0.ɵɵconditionalCreate(9, ViewSelectorComponent_Conditional_9_Template, 33, 12, "div", 8);
            i0.ɵɵelementEnd();
            i0.ɵɵconditionalCreate(10, ViewSelectorComponent_Conditional_10_Template, 2, 0, "button", 9);
            i0.ɵɵelementStart(11, "button", 10);
            i0.ɵɵlistener("click", function ViewSelectorComponent_Template_button_click_11_listener() { return ctx.onConfigureView(); });
            i0.ɵɵelement(12, "i", 11);
            i0.ɵɵelementEnd();
            i0.ɵɵelementStart(13, "button", 12);
            i0.ɵɵlistener("click", function ViewSelectorComponent_Template_button_click_13_listener() { return ctx.onCreateNewRecord(); });
            i0.ɵɵelement(14, "i", 13);
            i0.ɵɵelementEnd();
            i0.ɵɵelementStart(15, "button", 14);
            i0.ɵɵlistener("click", function ViewSelectorComponent_Template_button_click_15_listener() { return ctx.onExport(); });
            i0.ɵɵelement(16, "i", 15);
            i0.ɵɵelementEnd()();
        } if (rf & 2) {
            i0.ɵɵadvance();
            i0.ɵɵconditional(ctx.isDropdownOpen ? 1 : -1);
            i0.ɵɵadvance(2);
            i0.ɵɵclassProp("modified", ctx.viewModified)("open", ctx.isDropdownOpen);
            i0.ɵɵproperty("disabled", ctx.isLoading);
            i0.ɵɵadvance(3);
            i0.ɵɵtextInterpolate(ctx.displayName);
            i0.ɵɵadvance();
            i0.ɵɵconditional(ctx.viewModified ? 7 : -1);
            i0.ɵɵadvance();
            i0.ɵɵclassProp("rotated", ctx.isDropdownOpen);
            i0.ɵɵadvance();
            i0.ɵɵconditional(ctx.isDropdownOpen ? 9 : -1);
            i0.ɵɵadvance();
            i0.ɵɵconditional(ctx.selectedViewId ? 10 : -1);
        } }, dependencies: [i1.DefaultValueAccessor, i1.NgControlStatus, i1.NgModel], styles: ["/* ========================================\n   VIEW SELECTOR - All classes prefixed vs-\n   to avoid conflicts (ViewEncapsulation.None)\n   ======================================== */\n\n/* Container */\n.vs-container {\n  display: flex;\n  align-items: center;\n  gap: 4px;\n  position: relative;\n}\n\n/* Backdrop for closing panel */\n.vs-backdrop {\n  position: fixed;\n  top: 0;\n  left: 0;\n  right: 0;\n  bottom: 0;\n  z-index: 999;\n  background: transparent;\n}\n\n.vs-wrapper {\n  position: relative;\n}\n\n/* Main Button */\n.vs-button {\n  display: flex;\n  align-items: center;\n  gap: 8px;\n  padding: 6px 12px;\n  background: var(--mj-bg-surface-card);\n  border: 1px solid var(--mj-border-default);\n  border-radius: 4px;\n  cursor: pointer;\n  font-size: 13px;\n  font-weight: 500;\n  color: var(--mj-text-primary);\n  transition: all 0.15s ease;\n  min-width: 140px;\n  max-width: 280px;\n}\n\n.vs-button:hover {\n  border-color: var(--mj-brand-primary);\n  background: color-mix(in srgb, var(--mj-brand-primary) 5%, var(--mj-bg-surface));\n}\n\n.vs-button:disabled {\n  opacity: 0.6;\n  cursor: not-allowed;\n}\n\n.vs-button.open {\n  border-color: var(--mj-brand-primary);\n  background: color-mix(in srgb, var(--mj-brand-primary) 5%, var(--mj-bg-surface));\n}\n\n.vs-button.modified {\n  border-color: var(--mj-status-warning);\n}\n\n.vs-btn-icon {\n  color: var(--mj-brand-primary);\n  font-size: 12px;\n}\n\n.vs-btn-name {\n  flex: 1;\n  overflow: hidden;\n  text-overflow: ellipsis;\n  white-space: nowrap;\n  text-align: left;\n}\n\n.vs-modified-dot {\n  color: var(--mj-status-warning);\n  font-weight: bold;\n  font-size: 18px;\n  line-height: 1;\n}\n\n.vs-arrow {\n  color: var(--mj-text-muted);\n  font-size: 10px;\n  transition: transform 0.2s ease;\n}\n\n.vs-arrow.rotated {\n  transform: rotate(180deg);\n}\n\n/* ========================================\n   RICH VIEW PANEL\n   Styles ported directly from prototype\n   ======================================== */\n\n/* Reset inherited styles inside panel */\n.vs-panel,\n.vs-panel * {\n  box-sizing: border-box;\n  line-height: 1.5;\n  text-align: left;\n}\n\n.vs-panel {\n  position: absolute;\n  top: calc(100% + 4px);\n  left: 0;\n  width: 400px;\n  max-width: calc(100vw - 40px);\n  background: var(--mj-bg-surface);\n  border: 1px solid var(--mj-border-default);\n  border-radius: 12px;\n  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.16);\n  z-index: 1000;\n  overflow: hidden;\n  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;\n  font-size: 13px;\n  color: var(--mj-text-primary);\n}\n\n/* Panel Header */\n.vs-panel-header {\n  padding: 16px 20px;\n  display: flex;\n  align-items: center;\n  gap: 12px;\n  border-bottom: 1px solid var(--mj-border-default);\n}\n\n.vs-header-icon {\n  color: var(--mj-brand-primary);\n  font-size: 14px;\n}\n\n.vs-panel-title {\n  font-size: 15px;\n  font-weight: 600;\n  color: var(--mj-text-primary);\n}\n\n.vs-entity-badge {\n  font-size: 11px;\n  font-weight: 500;\n  background: color-mix(in srgb, var(--mj-brand-primary) 12%, var(--mj-bg-surface));\n  color: var(--mj-brand-primary);\n  padding: 2px 8px;\n  border-radius: 10px;\n}\n\n.vs-close-btn {\n  margin-left: auto;\n  background: none;\n  border: none;\n  cursor: pointer;\n  color: var(--mj-text-muted);\n  font-size: 16px;\n  padding: 4px;\n  display: flex;\n  align-items: center;\n  justify-content: center;\n}\n\n.vs-close-btn:hover {\n  color: var(--mj-text-primary);\n}\n\n/* Panel Search */\n.vs-panel-search {\n  padding: 12px 20px;\n  border-bottom: 1px solid var(--mj-border-default);\n}\n\n.vs-search-input {\n  width: 100%;\n  padding: 6px 12px 6px 32px;\n  border: 1px solid var(--mj-border-default);\n  border-radius: 4px;\n  font-size: 13px;\n  background: var(--mj-bg-surface-card) url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512' fill='%23999'%3E%3Cpath d='M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376c-34.4 25.2-76.8 40-122.7 40C93.1 416 0 322.9 0 208S93.1 0 208 0S416 93.1 416 208z'/%3E%3C/svg%3E\") no-repeat 10px center;\n  background-size: 14px;\n  box-sizing: border-box;\n  font-family: inherit;\n}\n\n.vs-search-input:focus {\n  outline: none;\n  border-color: var(--mj-brand-primary);\n}\n\n.vs-search-input::placeholder {\n  color: var(--mj-text-muted);\n}\n\n/* Panel Body */\n.vs-panel-body {\n  max-height: 400px;\n  overflow-y: auto;\n}\n\n/* View Section */\n.vs-section {\n  padding: 8px 0;\n}\n\n.vs-section-header {\n  padding: 6px 20px;\n  font-size: 11px;\n  font-weight: 700;\n  color: var(--mj-text-muted);\n  text-transform: uppercase;\n  letter-spacing: 0.5px;\n  display: flex;\n  align-items: center;\n  gap: 6px;\n}\n\n.vs-section-header i {\n  font-size: 10px;\n}\n\n.vs-section-count {\n  background: var(--mj-border-default);\n  padding: 0 6px;\n  border-radius: 8px;\n  font-size: 10px;\n}\n\n/* View Card */\n.vs-card {\n  padding: 10px 20px;\n  cursor: pointer;\n  transition: background 0.1s;\n  display: flex;\n  align-items: flex-start;\n  gap: 12px;\n}\n\n.vs-card:hover {\n  background: color-mix(in srgb, var(--mj-brand-primary) 5%, var(--mj-bg-surface));\n}\n\n.vs-card.active {\n  background: color-mix(in srgb, var(--mj-brand-primary) 12%, var(--mj-bg-surface));\n  border-left: 3px solid var(--mj-brand-primary);\n  padding-left: 17px;\n}\n\n/* View Card Icon */\n.vs-card-icon {\n  width: 32px;\n  height: 32px;\n  border-radius: 6px;\n  background: var(--mj-bg-surface-card);\n  display: flex;\n  align-items: center;\n  justify-content: center;\n  color: var(--mj-text-muted);\n  font-size: 14px;\n  flex-shrink: 0;\n  margin-top: 2px;\n}\n\n.vs-card-icon.active {\n  background: var(--mj-brand-primary);\n  color: var(--mj-text-inverse);\n}\n\n.vs-card-icon.shared {\n  background: var(--mj-bg-surface-card);\n  color: var(--mj-text-muted);\n}\n\n/* View Card Content */\n.vs-card-content {\n  flex: 1;\n  min-width: 0;\n  padding-top: 4px;\n}\n\n.vs-card-name {\n  font-size: 13px;\n  font-weight: 500;\n  color: var(--mj-text-primary);\n  display: flex;\n  align-items: center;\n  gap: 6px;\n}\n\n.vs-card.active .vs-card-name {\n  color: var(--mj-brand-primary);\n  font-weight: 600;\n}\n\n.vs-default-badge {\n  font-size: 9px;\n  font-weight: 600;\n  background: var(--mj-status-success-bg);\n  color: var(--mj-status-success-text);\n  padding: 1px 5px;\n  border-radius: 6px;\n  text-transform: uppercase;\n  letter-spacing: 0.3px;\n}\n\n.vs-shared-badge {\n  font-size: 9px;\n  font-weight: 600;\n  background: color-mix(in srgb, var(--mj-brand-primary) 12%, var(--mj-bg-surface));\n  color: var(--mj-brand-primary);\n  padding: 1px 5px;\n  border-radius: 6px;\n}\n\n.vs-shared-badge.editable {\n  background: var(--mj-status-success-bg);\n  color: var(--mj-status-success-text);\n}\n\n.vs-card-desc {\n  font-size: 12px;\n  color: var(--mj-text-muted);\n  margin-top: 2px;\n  display: -webkit-box;\n  -webkit-line-clamp: 2;\n  -webkit-box-orient: vertical;\n  overflow: hidden;\n}\n\n.vs-card-meta {\n  display: flex;\n  gap: 10px;\n  margin-top: 4px;\n  font-size: 11px;\n  color: var(--mj-text-muted);\n}\n\n.vs-card-meta span {\n  display: flex;\n  align-items: center;\n  gap: 3px;\n}\n\n.vs-card-meta i {\n  font-size: 10px;\n}\n\n/* View Card Check */\n.vs-card-check {\n  color: var(--mj-brand-primary);\n  font-size: 12px;\n  flex-shrink: 0;\n  margin-top: 2px;\n}\n\n/* View Card Actions (hover reveal) */\n.vs-card-actions {\n  display: flex;\n  gap: 2px;\n  opacity: 0;\n  transition: opacity 0.15s;\n  flex-shrink: 0;\n  margin-top: 2px;\n}\n\n.vs-card:hover .vs-card-actions {\n  opacity: 1;\n}\n\n.vs-action-btn {\n  width: 26px;\n  height: 26px;\n  border-radius: 4px;\n  border: none;\n  background: none;\n  cursor: pointer;\n  color: var(--mj-text-muted);\n  font-size: 12px;\n  display: flex;\n  align-items: center;\n  justify-content: center;\n}\n\n.vs-action-btn:hover {\n  background: var(--mj-bg-surface-card);\n  color: var(--mj-text-primary);\n}\n\n/* Empty State */\n.vs-empty-message {\n  display: flex;\n  align-items: center;\n  gap: 12px;\n  padding: 20px;\n  color: var(--mj-text-muted);\n  font-size: 13px;\n}\n\n.vs-empty-message i {\n  font-size: 16px;\n  opacity: 0.5;\n}\n\n.vs-empty-text {\n  display: flex;\n  flex-direction: column;\n  gap: 2px;\n}\n\n.vs-empty-text strong {\n  color: var(--mj-text-secondary);\n  font-size: 13px;\n}\n\n.vs-empty-text span {\n  font-size: 12px;\n}\n\n/* Loading */\n.vs-loading {\n  display: flex;\n  align-items: center;\n  justify-content: center;\n  gap: 8px;\n  padding: 20px;\n  color: var(--mj-text-muted);\n  font-size: 13px;\n  text-align: center;\n}\n\n/* Panel Footer */\n.vs-panel-footer {\n  padding: 12px 20px;\n  border-top: 1px solid var(--mj-border-default);\n  display: flex;\n  gap: 8px;\n}\n\n.vs-panel-btn {\n  flex: 1;\n  padding: 8px 12px;\n  border-radius: 4px;\n  border: 1px solid var(--mj-border-default);\n  background: var(--mj-bg-surface);\n  cursor: pointer;\n  font-size: 12px;\n  font-weight: 500;\n  color: var(--mj-text-secondary);\n  display: flex;\n  align-items: center;\n  justify-content: center;\n  gap: 6px;\n  transition: all 0.15s;\n  font-family: inherit;\n  text-align: center;\n}\n\n.vs-panel-btn:hover {\n  border-color: var(--mj-brand-primary);\n  color: var(--mj-brand-primary);\n}\n\n.vs-panel-btn.primary {\n  background: var(--mj-brand-primary);\n  color: var(--mj-text-inverse);\n  border-color: var(--mj-brand-primary);\n}\n\n.vs-panel-btn.primary:hover {\n  background: var(--mj-brand-primary-hover);\n}\n\n.vs-panel-btn i {\n  font-size: 11px;\n}\n\n/* ========================================\n   ICON BUTTONS (outside panel)\n   ======================================== */\n\n.vs-icon-btn {\n  display: flex;\n  align-items: center;\n  justify-content: center;\n  width: 32px;\n  height: 32px;\n  background: var(--mj-bg-surface-card);\n  border: 1px solid var(--mj-border-default);\n  border-radius: 6px;\n  cursor: pointer;\n  color: var(--mj-text-secondary);\n  transition: all 0.15s ease;\n}\n\n.vs-icon-btn:hover {\n  background: var(--mj-bg-surface-hover);\n  border-color: var(--mj-border-strong);\n  color: var(--mj-brand-primary);\n}\n\n.vs-icon-btn i {\n  font-size: 12px;\n}\n\n.vs-export-btn:hover {\n  color: var(--mj-status-success);\n}\n\n/* Responsive */\n@media (max-width: 768px) {\n  .vs-button {\n    min-width: 100px;\n    max-width: 180px;\n    padding: 6px 10px;\n  }\n\n  .vs-panel {\n    width: calc(100vw - 32px);\n    max-width: 400px;\n  }\n}\n"], encapsulation: 2 });
}
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ViewSelectorComponent, [{
        type: Component,
        args: [{ standalone: false, selector: 'mj-view-selector', encapsulation: ViewEncapsulation.None, template: "<div class=\"vs-container\">\n  <!-- Backdrop for closing panel -->\n  @if (isDropdownOpen) {\n    <div class=\"vs-backdrop\" (click)=\"closeDropdown()\"></div>\n  }\n\n  <!-- Main View Selector Button -->\n  <div class=\"vs-wrapper\">\n    <button\n      class=\"vs-button\"\n      [class.modified]=\"viewModified\"\n      [class.open]=\"isDropdownOpen\"\n      (click)=\"toggleDropdown()\"\n      [disabled]=\"isLoading\"\n      title=\"Select a saved view\">\n      <i class=\"fa-solid fa-layer-group vs-btn-icon\"></i>\n      <span class=\"vs-btn-name\">{{ displayName }}</span>\n      @if (viewModified) {\n        <span class=\"vs-modified-dot\" title=\"View has unsaved changes\">\u2022</span>\n      }\n      <i class=\"fa-solid fa-chevron-down vs-arrow\" [class.rotated]=\"isDropdownOpen\"></i>\n    </button>\n\n    <!-- Rich View Panel -->\n    @if (isDropdownOpen) {\n      <div class=\"vs-panel\">\n        <!-- Panel Header -->\n        <div class=\"vs-panel-header\">\n          <i class=\"fa-solid fa-table-list vs-header-icon\"></i>\n          <span class=\"vs-panel-title\">Views</span>\n          @if (entity) {\n            <span class=\"vs-entity-badge\">{{ entity.DisplayNameOrName }}</span>\n          }\n          <button class=\"vs-close-btn\" (click)=\"closeDropdown()\" title=\"Close\">\n            <i class=\"fa-solid fa-times\"></i>\n          </button>\n        </div>\n\n        <!-- Search -->\n        <div class=\"vs-panel-search\">\n          <input\n            type=\"text\"\n            class=\"vs-search-input\"\n            placeholder=\"Search views...\"\n            [(ngModel)]=\"searchText\"\n            (keydown.escape)=\"searchText = ''\"\n          />\n        </div>\n\n        <!-- Panel Body -->\n        <div class=\"vs-panel-body\">\n          <!-- Default Option -->\n          <div class=\"vs-section\">\n            <div\n              class=\"vs-card\"\n              [class.active]=\"!selectedViewId\"\n              (click)=\"selectDefault()\">\n              <div class=\"vs-card-icon\" [class.active]=\"!selectedViewId\">\n                <i class=\"fa-solid fa-table\"></i>\n              </div>\n              <div class=\"vs-card-content\">\n                <div class=\"vs-card-name\">(Default)</div>\n              </div>\n              @if (!selectedViewId) {\n                <i class=\"fa-solid fa-check vs-card-check\"></i>\n              }\n            </div>\n          </div>\n\n          <!-- My Views Section -->\n          @if (filteredMyViews.length > 0) {\n            <div class=\"vs-section\">\n              <div class=\"vs-section-header\">\n                <i class=\"fa-solid fa-user\"></i>\n                <span>My Views</span>\n                <span class=\"vs-section-count\">{{ filteredMyViews.length }}</span>\n              </div>\n              @for (view of filteredMyViews; track view.id) {\n                <div\n                  class=\"vs-card\"\n                  [class.active]=\"selectedViewId === view.id\"\n                  (click)=\"selectView(view)\">\n                  <div class=\"vs-card-icon\" [class.active]=\"selectedViewId === view.id\">\n                    <i class=\"fa-solid fa-table-list\"></i>\n                  </div>\n                  <div class=\"vs-card-content\">\n                    <div class=\"vs-card-name\">\n                      {{ view.name }}\n                      @if (view.isDefault) {\n                        <span class=\"vs-default-badge\">Default</span>\n                      }\n                    </div>\n                    @if (view.entity.Description) {\n                      <div class=\"vs-card-desc\">{{ view.entity.Description }}</div>\n                    }\n                    @if (getViewFilterCount(view) > 0 || getViewColumnCount(view) > 0 || getViewSortInfo(view)) {\n                      <div class=\"vs-card-meta\">\n                        @if (getViewFilterCount(view) > 0) {\n                          <span><i class=\"fa-solid fa-filter\"></i> {{ getViewFilterCount(view) }} filter{{ getViewFilterCount(view) !== 1 ? 's' : '' }}</span>\n                        }\n                        @if (getViewColumnCount(view) > 0) {\n                          <span><i class=\"fa-solid fa-table-columns\"></i> {{ getViewColumnCount(view) }} col{{ getViewColumnCount(view) !== 1 ? 's' : '' }}</span>\n                        }\n                        @if (getViewSortInfo(view)) {\n                          <span><i class=\"fa-solid fa-arrow-down-short-wide\"></i> {{ getViewSortInfo(view) }}</span>\n                        }\n                      </div>\n                    }\n                  </div>\n                  <div class=\"vs-card-actions\">\n                    <button\n                      class=\"vs-action-btn\"\n                      (click)=\"onDuplicateView(view.id, $event)\"\n                      title=\"Duplicate\">\n                      <i class=\"fa-regular fa-copy\"></i>\n                    </button>\n                    <button\n                      class=\"vs-action-btn\"\n                      (click)=\"onConfigureViewById(view.id, $event)\"\n                      title=\"Configure\">\n                      <i class=\"fa-solid fa-sliders\"></i>\n                    </button>\n                    <button\n                      class=\"vs-action-btn\"\n                      (click)=\"onOpenViewInTab(view.id, $event)\"\n                      title=\"Open in Tab\">\n                      <i class=\"fa-solid fa-up-right-from-square\"></i>\n                    </button>\n                  </div>\n                  @if (selectedViewId === view.id) {\n                    <i class=\"fa-solid fa-check vs-card-check\"></i>\n                  }\n                </div>\n              }\n            </div>\n          }\n\n          <!-- Shared Views Section -->\n          @if (filteredSharedViews.length > 0) {\n            <div class=\"vs-section\">\n              <div class=\"vs-section-header\">\n                <i class=\"fa-solid fa-share-nodes\"></i>\n                <span>Shared With Me</span>\n                <span class=\"vs-section-count\">{{ filteredSharedViews.length }}</span>\n              </div>\n              @for (view of filteredSharedViews; track view.id) {\n                <div\n                  class=\"vs-card\"\n                  [class.active]=\"selectedViewId === view.id\"\n                  (click)=\"selectView(view)\">\n                  <div class=\"vs-card-icon shared\">\n                    <i class=\"fa-solid fa-users\"></i>\n                  </div>\n                  <div class=\"vs-card-content\">\n                    <div class=\"vs-card-name\">\n                      {{ view.name }}\n                      @if (!view.userCanEdit) {\n                        <span class=\"vs-shared-badge\">View Only</span>\n                      } @else {\n                        <span class=\"vs-shared-badge editable\">Can Edit</span>\n                      }\n                    </div>\n                    @if (view.entity.Description) {\n                      <div class=\"vs-card-desc\">{{ view.entity.Description }}</div>\n                    }\n                    @if (getViewFilterCount(view) > 0 || getViewColumnCount(view) > 0) {\n                      <div class=\"vs-card-meta\">\n                        @if (getViewFilterCount(view) > 0) {\n                          <span><i class=\"fa-solid fa-filter\"></i> {{ getViewFilterCount(view) }} filter{{ getViewFilterCount(view) !== 1 ? 's' : '' }}</span>\n                        }\n                        @if (getViewColumnCount(view) > 0) {\n                          <span><i class=\"fa-solid fa-table-columns\"></i> {{ getViewColumnCount(view) }} col{{ getViewColumnCount(view) !== 1 ? 's' : '' }}</span>\n                        }\n                      </div>\n                    }\n                  </div>\n                  <div class=\"vs-card-actions\">\n                    <button\n                      class=\"vs-action-btn\"\n                      (click)=\"onDuplicateView(view.id, $event)\"\n                      title=\"Duplicate as My View\">\n                      <i class=\"fa-regular fa-copy\"></i>\n                    </button>\n                    @if (view.userCanEdit) {\n                      <button\n                        class=\"vs-action-btn\"\n                        (click)=\"onConfigureViewById(view.id, $event)\"\n                        title=\"Configure\">\n                        <i class=\"fa-solid fa-sliders\"></i>\n                      </button>\n                    }\n                  </div>\n                  @if (selectedViewId === view.id) {\n                    <i class=\"fa-solid fa-check vs-card-check\"></i>\n                  }\n                </div>\n              }\n            </div>\n          }\n\n          <!-- No Views Message -->\n          @if (!hasViews && !isLoading) {\n            <div class=\"vs-empty-message\">\n              <i class=\"fa-solid fa-bookmark\"></i>\n              <div class=\"vs-empty-text\">\n                <strong>No saved views yet</strong>\n                <span>Save your current configuration as a view</span>\n              </div>\n            </div>\n          }\n\n          <!-- No Search Results -->\n          @if (hasViews && filteredMyViews.length === 0 && filteredSharedViews.length === 0 && searchText) {\n            <div class=\"vs-empty-message\">\n              <i class=\"fa-solid fa-search\"></i>\n              <span>No views match \"{{ searchText }}\"</span>\n            </div>\n          }\n\n          <!-- Loading Indicator -->\n          @if (isLoading) {\n            <div class=\"vs-loading\">\n              <i class=\"fa-solid fa-spinner fa-spin\"></i>\n              <span>Loading views...</span>\n            </div>\n          }\n        </div>\n\n        <!-- Panel Footer -->\n        <div class=\"vs-panel-footer\">\n          <button\n            class=\"vs-panel-btn primary\"\n            (click)=\"onQuickSave()\"\n            title=\"Save current view configuration\">\n            <i class=\"fa-solid fa-plus\"></i>\n            <span>New View</span>\n          </button>\n          <button\n            class=\"vs-panel-btn\"\n            (click)=\"onResetToDefault()\"\n            title=\"Reset to default view\">\n            <i class=\"fa-solid fa-arrow-rotate-left\"></i>\n            <span>Reset to Default</span>\n          </button>\n        </div>\n      </div>\n    }\n  </div>\n\n  <!-- Open in Tab Button (only visible when a view is selected) -->\n  @if (selectedViewId) {\n    <button\n      class=\"vs-icon-btn\"\n      (click)=\"onOpenInTab()\"\n      title=\"Open this view in a new tab\">\n      <i class=\"fa-solid fa-external-link-alt\"></i>\n    </button>\n  }\n\n  <!-- Configure View Button -->\n  <button\n    class=\"vs-icon-btn\"\n    (click)=\"onConfigureView()\"\n    title=\"Configure view settings (columns, filters, sorting)\">\n    <i class=\"fa-solid fa-sliders-h\"></i>\n  </button>\n\n  <!-- Create New Record Button -->\n  <button\n    class=\"vs-icon-btn\"\n    (click)=\"onCreateNewRecord()\"\n    title=\"Create new record\">\n    <i class=\"fa-solid fa-plus\"></i>\n  </button>\n\n  <!-- Export Button -->\n  <button\n    class=\"vs-icon-btn vs-export-btn\"\n    (click)=\"onExport()\"\n    title=\"Export to Excel\">\n    <i class=\"fa-solid fa-file-excel\"></i>\n  </button>\n</div>\n", styles: ["/* ========================================\n   VIEW SELECTOR - All classes prefixed vs-\n   to avoid conflicts (ViewEncapsulation.None)\n   ======================================== */\n\n/* Container */\n.vs-container {\n  display: flex;\n  align-items: center;\n  gap: 4px;\n  position: relative;\n}\n\n/* Backdrop for closing panel */\n.vs-backdrop {\n  position: fixed;\n  top: 0;\n  left: 0;\n  right: 0;\n  bottom: 0;\n  z-index: 999;\n  background: transparent;\n}\n\n.vs-wrapper {\n  position: relative;\n}\n\n/* Main Button */\n.vs-button {\n  display: flex;\n  align-items: center;\n  gap: 8px;\n  padding: 6px 12px;\n  background: var(--mj-bg-surface-card);\n  border: 1px solid var(--mj-border-default);\n  border-radius: 4px;\n  cursor: pointer;\n  font-size: 13px;\n  font-weight: 500;\n  color: var(--mj-text-primary);\n  transition: all 0.15s ease;\n  min-width: 140px;\n  max-width: 280px;\n}\n\n.vs-button:hover {\n  border-color: var(--mj-brand-primary);\n  background: color-mix(in srgb, var(--mj-brand-primary) 5%, var(--mj-bg-surface));\n}\n\n.vs-button:disabled {\n  opacity: 0.6;\n  cursor: not-allowed;\n}\n\n.vs-button.open {\n  border-color: var(--mj-brand-primary);\n  background: color-mix(in srgb, var(--mj-brand-primary) 5%, var(--mj-bg-surface));\n}\n\n.vs-button.modified {\n  border-color: var(--mj-status-warning);\n}\n\n.vs-btn-icon {\n  color: var(--mj-brand-primary);\n  font-size: 12px;\n}\n\n.vs-btn-name {\n  flex: 1;\n  overflow: hidden;\n  text-overflow: ellipsis;\n  white-space: nowrap;\n  text-align: left;\n}\n\n.vs-modified-dot {\n  color: var(--mj-status-warning);\n  font-weight: bold;\n  font-size: 18px;\n  line-height: 1;\n}\n\n.vs-arrow {\n  color: var(--mj-text-muted);\n  font-size: 10px;\n  transition: transform 0.2s ease;\n}\n\n.vs-arrow.rotated {\n  transform: rotate(180deg);\n}\n\n/* ========================================\n   RICH VIEW PANEL\n   Styles ported directly from prototype\n   ======================================== */\n\n/* Reset inherited styles inside panel */\n.vs-panel,\n.vs-panel * {\n  box-sizing: border-box;\n  line-height: 1.5;\n  text-align: left;\n}\n\n.vs-panel {\n  position: absolute;\n  top: calc(100% + 4px);\n  left: 0;\n  width: 400px;\n  max-width: calc(100vw - 40px);\n  background: var(--mj-bg-surface);\n  border: 1px solid var(--mj-border-default);\n  border-radius: 12px;\n  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.16);\n  z-index: 1000;\n  overflow: hidden;\n  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;\n  font-size: 13px;\n  color: var(--mj-text-primary);\n}\n\n/* Panel Header */\n.vs-panel-header {\n  padding: 16px 20px;\n  display: flex;\n  align-items: center;\n  gap: 12px;\n  border-bottom: 1px solid var(--mj-border-default);\n}\n\n.vs-header-icon {\n  color: var(--mj-brand-primary);\n  font-size: 14px;\n}\n\n.vs-panel-title {\n  font-size: 15px;\n  font-weight: 600;\n  color: var(--mj-text-primary);\n}\n\n.vs-entity-badge {\n  font-size: 11px;\n  font-weight: 500;\n  background: color-mix(in srgb, var(--mj-brand-primary) 12%, var(--mj-bg-surface));\n  color: var(--mj-brand-primary);\n  padding: 2px 8px;\n  border-radius: 10px;\n}\n\n.vs-close-btn {\n  margin-left: auto;\n  background: none;\n  border: none;\n  cursor: pointer;\n  color: var(--mj-text-muted);\n  font-size: 16px;\n  padding: 4px;\n  display: flex;\n  align-items: center;\n  justify-content: center;\n}\n\n.vs-close-btn:hover {\n  color: var(--mj-text-primary);\n}\n\n/* Panel Search */\n.vs-panel-search {\n  padding: 12px 20px;\n  border-bottom: 1px solid var(--mj-border-default);\n}\n\n.vs-search-input {\n  width: 100%;\n  padding: 6px 12px 6px 32px;\n  border: 1px solid var(--mj-border-default);\n  border-radius: 4px;\n  font-size: 13px;\n  background: var(--mj-bg-surface-card) url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512' fill='%23999'%3E%3Cpath d='M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376c-34.4 25.2-76.8 40-122.7 40C93.1 416 0 322.9 0 208S93.1 0 208 0S416 93.1 416 208z'/%3E%3C/svg%3E\") no-repeat 10px center;\n  background-size: 14px;\n  box-sizing: border-box;\n  font-family: inherit;\n}\n\n.vs-search-input:focus {\n  outline: none;\n  border-color: var(--mj-brand-primary);\n}\n\n.vs-search-input::placeholder {\n  color: var(--mj-text-muted);\n}\n\n/* Panel Body */\n.vs-panel-body {\n  max-height: 400px;\n  overflow-y: auto;\n}\n\n/* View Section */\n.vs-section {\n  padding: 8px 0;\n}\n\n.vs-section-header {\n  padding: 6px 20px;\n  font-size: 11px;\n  font-weight: 700;\n  color: var(--mj-text-muted);\n  text-transform: uppercase;\n  letter-spacing: 0.5px;\n  display: flex;\n  align-items: center;\n  gap: 6px;\n}\n\n.vs-section-header i {\n  font-size: 10px;\n}\n\n.vs-section-count {\n  background: var(--mj-border-default);\n  padding: 0 6px;\n  border-radius: 8px;\n  font-size: 10px;\n}\n\n/* View Card */\n.vs-card {\n  padding: 10px 20px;\n  cursor: pointer;\n  transition: background 0.1s;\n  display: flex;\n  align-items: flex-start;\n  gap: 12px;\n}\n\n.vs-card:hover {\n  background: color-mix(in srgb, var(--mj-brand-primary) 5%, var(--mj-bg-surface));\n}\n\n.vs-card.active {\n  background: color-mix(in srgb, var(--mj-brand-primary) 12%, var(--mj-bg-surface));\n  border-left: 3px solid var(--mj-brand-primary);\n  padding-left: 17px;\n}\n\n/* View Card Icon */\n.vs-card-icon {\n  width: 32px;\n  height: 32px;\n  border-radius: 6px;\n  background: var(--mj-bg-surface-card);\n  display: flex;\n  align-items: center;\n  justify-content: center;\n  color: var(--mj-text-muted);\n  font-size: 14px;\n  flex-shrink: 0;\n  margin-top: 2px;\n}\n\n.vs-card-icon.active {\n  background: var(--mj-brand-primary);\n  color: var(--mj-text-inverse);\n}\n\n.vs-card-icon.shared {\n  background: var(--mj-bg-surface-card);\n  color: var(--mj-text-muted);\n}\n\n/* View Card Content */\n.vs-card-content {\n  flex: 1;\n  min-width: 0;\n  padding-top: 4px;\n}\n\n.vs-card-name {\n  font-size: 13px;\n  font-weight: 500;\n  color: var(--mj-text-primary);\n  display: flex;\n  align-items: center;\n  gap: 6px;\n}\n\n.vs-card.active .vs-card-name {\n  color: var(--mj-brand-primary);\n  font-weight: 600;\n}\n\n.vs-default-badge {\n  font-size: 9px;\n  font-weight: 600;\n  background: var(--mj-status-success-bg);\n  color: var(--mj-status-success-text);\n  padding: 1px 5px;\n  border-radius: 6px;\n  text-transform: uppercase;\n  letter-spacing: 0.3px;\n}\n\n.vs-shared-badge {\n  font-size: 9px;\n  font-weight: 600;\n  background: color-mix(in srgb, var(--mj-brand-primary) 12%, var(--mj-bg-surface));\n  color: var(--mj-brand-primary);\n  padding: 1px 5px;\n  border-radius: 6px;\n}\n\n.vs-shared-badge.editable {\n  background: var(--mj-status-success-bg);\n  color: var(--mj-status-success-text);\n}\n\n.vs-card-desc {\n  font-size: 12px;\n  color: var(--mj-text-muted);\n  margin-top: 2px;\n  display: -webkit-box;\n  -webkit-line-clamp: 2;\n  -webkit-box-orient: vertical;\n  overflow: hidden;\n}\n\n.vs-card-meta {\n  display: flex;\n  gap: 10px;\n  margin-top: 4px;\n  font-size: 11px;\n  color: var(--mj-text-muted);\n}\n\n.vs-card-meta span {\n  display: flex;\n  align-items: center;\n  gap: 3px;\n}\n\n.vs-card-meta i {\n  font-size: 10px;\n}\n\n/* View Card Check */\n.vs-card-check {\n  color: var(--mj-brand-primary);\n  font-size: 12px;\n  flex-shrink: 0;\n  margin-top: 2px;\n}\n\n/* View Card Actions (hover reveal) */\n.vs-card-actions {\n  display: flex;\n  gap: 2px;\n  opacity: 0;\n  transition: opacity 0.15s;\n  flex-shrink: 0;\n  margin-top: 2px;\n}\n\n.vs-card:hover .vs-card-actions {\n  opacity: 1;\n}\n\n.vs-action-btn {\n  width: 26px;\n  height: 26px;\n  border-radius: 4px;\n  border: none;\n  background: none;\n  cursor: pointer;\n  color: var(--mj-text-muted);\n  font-size: 12px;\n  display: flex;\n  align-items: center;\n  justify-content: center;\n}\n\n.vs-action-btn:hover {\n  background: var(--mj-bg-surface-card);\n  color: var(--mj-text-primary);\n}\n\n/* Empty State */\n.vs-empty-message {\n  display: flex;\n  align-items: center;\n  gap: 12px;\n  padding: 20px;\n  color: var(--mj-text-muted);\n  font-size: 13px;\n}\n\n.vs-empty-message i {\n  font-size: 16px;\n  opacity: 0.5;\n}\n\n.vs-empty-text {\n  display: flex;\n  flex-direction: column;\n  gap: 2px;\n}\n\n.vs-empty-text strong {\n  color: var(--mj-text-secondary);\n  font-size: 13px;\n}\n\n.vs-empty-text span {\n  font-size: 12px;\n}\n\n/* Loading */\n.vs-loading {\n  display: flex;\n  align-items: center;\n  justify-content: center;\n  gap: 8px;\n  padding: 20px;\n  color: var(--mj-text-muted);\n  font-size: 13px;\n  text-align: center;\n}\n\n/* Panel Footer */\n.vs-panel-footer {\n  padding: 12px 20px;\n  border-top: 1px solid var(--mj-border-default);\n  display: flex;\n  gap: 8px;\n}\n\n.vs-panel-btn {\n  flex: 1;\n  padding: 8px 12px;\n  border-radius: 4px;\n  border: 1px solid var(--mj-border-default);\n  background: var(--mj-bg-surface);\n  cursor: pointer;\n  font-size: 12px;\n  font-weight: 500;\n  color: var(--mj-text-secondary);\n  display: flex;\n  align-items: center;\n  justify-content: center;\n  gap: 6px;\n  transition: all 0.15s;\n  font-family: inherit;\n  text-align: center;\n}\n\n.vs-panel-btn:hover {\n  border-color: var(--mj-brand-primary);\n  color: var(--mj-brand-primary);\n}\n\n.vs-panel-btn.primary {\n  background: var(--mj-brand-primary);\n  color: var(--mj-text-inverse);\n  border-color: var(--mj-brand-primary);\n}\n\n.vs-panel-btn.primary:hover {\n  background: var(--mj-brand-primary-hover);\n}\n\n.vs-panel-btn i {\n  font-size: 11px;\n}\n\n/* ========================================\n   ICON BUTTONS (outside panel)\n   ======================================== */\n\n.vs-icon-btn {\n  display: flex;\n  align-items: center;\n  justify-content: center;\n  width: 32px;\n  height: 32px;\n  background: var(--mj-bg-surface-card);\n  border: 1px solid var(--mj-border-default);\n  border-radius: 6px;\n  cursor: pointer;\n  color: var(--mj-text-secondary);\n  transition: all 0.15s ease;\n}\n\n.vs-icon-btn:hover {\n  background: var(--mj-bg-surface-hover);\n  border-color: var(--mj-border-strong);\n  color: var(--mj-brand-primary);\n}\n\n.vs-icon-btn i {\n  font-size: 12px;\n}\n\n.vs-export-btn:hover {\n  color: var(--mj-status-success);\n}\n\n/* Responsive */\n@media (max-width: 768px) {\n  .vs-button {\n    min-width: 100px;\n    max-width: 180px;\n    padding: 6px 10px;\n  }\n\n  .vs-panel {\n    width: calc(100vw - 32px);\n    max-width: 400px;\n  }\n}\n"] }]
    }], () => [{ type: i0.ChangeDetectorRef }], { entity: [{
            type: Input
        }], selectedViewId: [{
            type: Input
        }], viewModified: [{
            type: Input
        }], viewSelected: [{
            type: Output
        }], saveViewRequested: [{
            type: Output
        }], manageViewsRequested: [{
            type: Output
        }], openInTabRequested: [{
            type: Output
        }], configureViewRequested: [{
            type: Output
        }], createNewRecordRequested: [{
            type: Output
        }], exportRequested: [{
            type: Output
        }], duplicateViewRequested: [{
            type: Output
        }], quickSaveRequested: [{
            type: Output
        }], revertRequested: [{
            type: Output
        }] }); })();
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ViewSelectorComponent, { className: "ViewSelectorComponent", filePath: "src/DataExplorer/components/view-selector/view-selector.component.ts", lineNumber: 53 }); })();
//# sourceMappingURL=view-selector.component.js.map