import { NgTemplateOutlet } from '@angular/common';
import { booleanAttribute, ChangeDetectionStrategy, Component, inject, Input, ViewEncapsulation } from '@angular/core';
import { DomSanitizer } from '@angular/platform-browser';
import { KBQ_TITLE_TEXT_REF } from '@koobiq/components/core';
import { KbqDropdownItem } from '@koobiq/components/dropdown';
import { KbqIcon } from '@koobiq/components/icon';
import * as i0 from "@angular/core";
/** @docs-private */
export class KbqAppSwitcherListItem extends KbqDropdownItem {
    constructor() {
        super(...arguments);
        this.sanitizer = inject(DomSanitizer);
        this.toggle = false;
        this.collapsed = false;
    }
    clickHandler(event) {
        if (this.toggle) {
            event.stopPropagation();
            event.preventDefault();
            this.collapsed = !this.collapsed;
        }
    }
    getIcon(icon) {
        return this.sanitizer.bypassSecurityTrustHtml(icon || '');
    }
    /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: KbqAppSwitcherListItem, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
    /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: KbqAppSwitcherListItem, isStandalone: true, selector: "[kbq-app-switcher-list-item]", inputs: { app: "app", toggle: ["toggle", "toggle", booleanAttribute], collapsed: ["collapsed", "collapsed", booleanAttribute] }, host: { listeners: { "click": "clickHandler($event)" }, properties: { "class.kbq-dropdown-item": "false" }, classAttribute: "kbq-app-switcher-list-item" }, providers: [
            { provide: KBQ_TITLE_TEXT_REF, useExisting: KbqAppSwitcherListItem },
            { provide: KbqDropdownItem, useExisting: KbqAppSwitcherListItem }
        ], exportAs: ["kbqAppSwitcherApp"], usesInheritance: true, ngImport: i0, template: `
        <span class="kbq-app-switcher-list-item__icon" [innerHtml]="getIcon(app.icon)"></span>

        <div class="kbq-app-switcher-list-item__container">
            <div class="kbq-app-switcher-list-item__name">{{ app.name }}</div>
            @if (app.caption) {
                <div class="kbq-app-switcher-list-item__caption">{{ app.caption }}</div>
            }
        </div>

        @if (toggle) {
            <div class="kbq-app-switcher-list-item__toggle" [class.kbq-expanded]="!collapsed">
                <i kbq-icon="kbq-chevron-down-s_16" [color]="'contrast-fade'"></i>
            </div>
        }
    `, isInline: true, styles: ["@keyframes kbq-progress{0%{background-position:0 0}to{background-position:64px 0}}.kbq-progress{position:relative}.kbq-progress:after{content:\"\";position:absolute;border-radius:inherit;inset:0;background:linear-gradient(135deg,#0000000a 12px,#ffffff1a 12px 22px,#0000000a 22px 34px,#ffffff1a 34px) repeat;background-size:32px 32px;animation:kbq-progress 1s linear infinite}.kbq-group{display:flex;flex-direction:row}.kbq-group .kbq-group_justified>.kbq-group-item{width:100%}.kbq-group .kbq-group-item+.kbq-group-item{margin-left:calc(-1 * var(--kbq-size-border-width))}.kbq-group>.kbq-group-item:first-child:not(:last-child){border-bottom-right-radius:0;border-top-right-radius:0}.kbq-group>.kbq-group-item:first-child:not(:last-child)>.kbq-form-field__container{border-bottom-right-radius:0;border-top-right-radius:0}.kbq-group>.kbq-group-item:last-child:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0}.kbq-group>.kbq-group-item:last-child:not(:first-child)>.kbq-form-field__container{border-bottom-left-radius:0;border-top-left-radius:0}.kbq-group>.kbq-group-item:not(:first-child):not(:last-child){border-radius:0}.kbq-group>.kbq-group-item:not(:first-child):not(:last-child)>.kbq-form-field__container{border-radius:0}.kbq-vertical-group{display:flex;flex-direction:column}.kbq-vertical-group>.kbq-group-item:first-child:not(:last-child){border-bottom-right-radius:0;border-bottom-left-radius:0;border-top-right-radius:var(--kbq-size-border-radius)}.kbq-vertical-group>.kbq-group-item:first-child:not(:last-child)>.kbq-form-field__container{border-bottom-right-radius:0;border-bottom-left-radius:0}.kbq-vertical-group>.kbq-group-item:last-child:not(:first-child){border-top-right-radius:0;border-top-left-radius:0;border-bottom-left-radius:var(--kbq-size-border-radius)}.kbq-vertical-group>.kbq-group-item:last-child:not(:first-child)>.kbq-form-field__container{border-top-right-radius:0;border-top-left-radius:0}.kbq-vertical-group>.kbq-group-item:not(:first-child):not(:last-child){border-radius:0}.kbq-vertical-group>.kbq-group-item:not(:first-child):not(:last-child)>.kbq-form-field__container{border-radius:0}.kbq-vertical-group .kbq-group-item+.kbq-group-item{margin-top:calc(-1 * var(--kbq-size-border-width))}.kbq-truncate-line{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.kbq-no-select{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.kbq-app-switcher-list-item{position:relative;display:flex;flex-direction:row;max-width:100%;min-height:38px;border-radius:var(--kbq-size-s);padding:var(--kbq-size-xxs) var(--kbq-size-m) var(--kbq-size-xs) var(--kbq-size-m);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;text-decoration:none;box-sizing:border-box;outline:none;-webkit-tap-highlight-color:transparent;cursor:pointer}.kbq-app-switcher-list-item.kbq-app-switcher-site_nested{margin-left:var(--kbq-size-xxl);border-top-left-radius:unset;border-bottom-left-radius:unset}.kbq-app-switcher-list-item.kbq-app-switcher-site_nested:after{content:\"\";position:absolute;left:-1px;top:0;height:100%;border-left-width:1px;border-left-style:solid}.kbq-app-switcher-list-item.kbq-app-switcher-site_nested:has(+:not(.kbq-app-switcher-site_nested)),.kbq-app-switcher-list-item.kbq-app-switcher-site_nested:last-child{border-bottom-left-radius:var(--kbq-size-s)}.kbq-app-switcher-list-item.kbq-app-switcher-site_nested:has(+:not(.kbq-app-switcher-site_nested)):after,.kbq-app-switcher-list-item.kbq-app-switcher-site_nested:last-child:after{top:0;width:var(--kbq-size-m);height:var(--kbq-size-xxl);border-bottom-left-radius:var(--kbq-size-s);border-bottom-width:1px;border-bottom-style:solid}.kbq-app-switcher-list-item__toggle{position:absolute;display:none;align-items:center;justify-content:center;top:var(--kbq-size-m);left:var(--kbq-size-m);width:var(--kbq-size-xxl);height:var(--kbq-size-xxl);border-radius:var(--kbq-size-xxs)}.kbq-app-switcher-list-item__toggle .kbq-icon{transform:rotate(0)}.kbq-app-switcher-list-item__toggle.kbq-expanded .kbq-icon{transform:rotate(180deg)}.kbq-app-switcher-list-item__icon{padding-top:var(--kbq-size-s);padding-right:var(--kbq-size-m)}.kbq-app-switcher-list-item__container{max-width:100%;min-width:0;align-self:center}.kbq-app-switcher-list-item__container .kbq-app-switcher-list-item__name,.kbq-app-switcher-list-item__container .kbq-app-switcher-list-item__caption{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.kbq-app-switcher-site_nested:after{border-left-color:var(--kbq-line-contrast-less);border-bottom-color:var(--kbq-line-contrast-less)}.kbq-app-switcher-list-item__caption{color:var(--kbq-foreground-contrast-secondary)}.kbq-app-switcher-list-item{background:var(--kbq-list-default-container-background);color:var(--kbq-list-default-text-color)}.kbq-app-switcher-list-item:hover:has(.kbq-app-switcher-list-item__toggle) .kbq-app-switcher-list-item__icon,.kbq-app-switcher-list-item.kbq-hover:has(.kbq-app-switcher-list-item__toggle) .kbq-app-switcher-list-item__icon,.kbq-app-switcher-list-item.kbq-focused:has(.kbq-app-switcher-list-item__toggle) .kbq-app-switcher-list-item__icon{visibility:hidden}.kbq-app-switcher-list-item:hover .kbq-app-switcher-list-item__toggle,.kbq-app-switcher-list-item.kbq-hover .kbq-app-switcher-list-item__toggle,.kbq-app-switcher-list-item.kbq-focused .kbq-app-switcher-list-item__toggle{display:flex}.kbq-app-switcher-list-item:hover,.kbq-app-switcher-list-item.kbq-hover,.kbq-app-switcher-list-item:hover .kbq-app-switcher-list-item__toggle,.kbq-app-switcher-list-item.kbq-hover .kbq-app-switcher-list-item__toggle{background:var(--kbq-states-background-transparent-hover)}.kbq-app-switcher-list-item:active,.kbq-app-switcher-list-item.kbq-active{background:var(--kbq-states-background-transparent-active)}.kbq-app-switcher-list-item.kbq-selected{background:var(--kbq-background-theme-less)}.kbq-app-switcher-list-item.kbq-selected:hover,.kbq-app-switcher-list-item.kbq-selected.kbq-hover{background:var(--kbq-states-background-theme-less-hover)}.kbq-app-switcher-list-item.kbq-selected:active,.kbq-app-switcher-list-item.kbq-selected.kbq-active{background:var(--kbq-states-background-theme-less-active)}.kbq-app-switcher-list-item.cdk-keyboard-focused{outline:none;border-color:var(--kbq-list-states-focused-focus-outline-color)}.kbq-app-switcher-list-item__name{font-size:var(--kbq-typography-text-normal-medium-font-size);font-style:var(--kbq-typography-text-normal-medium-font-style);font-weight:var(--kbq-typography-text-normal-medium-font-weight);line-height:var(--kbq-typography-text-normal-medium-line-height);font-family:var(--kbq-typography-text-normal-medium-font-family);text-transform:var(--kbq-typography-text-normal-medium-text-transform);font-feature-settings:var(--kbq-typography-text-normal-medium-font-feature-settings);letter-spacing:var(--kbq-typography-text-normal-medium-letter-spacing)}.kbq-app-switcher-list-item__caption{font-size:var(--kbq-typography-text-compact-font-size);font-style:var(--kbq-typography-text-compact-font-style);font-weight:var(--kbq-typography-text-compact-font-weight);line-height:var(--kbq-typography-text-compact-line-height);font-family:var(--kbq-typography-text-compact-font-family);text-transform:var(--kbq-typography-text-compact-text-transform);font-feature-settings:var(--kbq-typography-text-compact-font-feature-settings);letter-spacing:var(--kbq-typography-text-compact-letter-spacing)}\n"], dependencies: [{ kind: "component", type: KbqIcon, selector: "[kbq-icon]", inputs: ["small", "autoColor", "kbq-icon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: KbqAppSwitcherListItem, decorators: [{
            type: Component,
            args: [{ standalone: true, selector: '[kbq-app-switcher-list-item]', exportAs: 'kbqAppSwitcherApp', template: `
        <span class="kbq-app-switcher-list-item__icon" [innerHtml]="getIcon(app.icon)"></span>

        <div class="kbq-app-switcher-list-item__container">
            <div class="kbq-app-switcher-list-item__name">{{ app.name }}</div>
            @if (app.caption) {
                <div class="kbq-app-switcher-list-item__caption">{{ app.caption }}</div>
            }
        </div>

        @if (toggle) {
            <div class="kbq-app-switcher-list-item__toggle" [class.kbq-expanded]="!collapsed">
                <i kbq-icon="kbq-chevron-down-s_16" [color]="'contrast-fade'"></i>
            </div>
        }
    `, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: {
                        class: 'kbq-app-switcher-list-item',
                        '[class.kbq-dropdown-item]': 'false',
                        '(click)': 'clickHandler($event)'
                    }, imports: [
                        KbqIcon,
                        NgTemplateOutlet
                    ], providers: [
                        { provide: KBQ_TITLE_TEXT_REF, useExisting: KbqAppSwitcherListItem },
                        { provide: KbqDropdownItem, useExisting: KbqAppSwitcherListItem }
                    ], styles: ["@keyframes kbq-progress{0%{background-position:0 0}to{background-position:64px 0}}.kbq-progress{position:relative}.kbq-progress:after{content:\"\";position:absolute;border-radius:inherit;inset:0;background:linear-gradient(135deg,#0000000a 12px,#ffffff1a 12px 22px,#0000000a 22px 34px,#ffffff1a 34px) repeat;background-size:32px 32px;animation:kbq-progress 1s linear infinite}.kbq-group{display:flex;flex-direction:row}.kbq-group .kbq-group_justified>.kbq-group-item{width:100%}.kbq-group .kbq-group-item+.kbq-group-item{margin-left:calc(-1 * var(--kbq-size-border-width))}.kbq-group>.kbq-group-item:first-child:not(:last-child){border-bottom-right-radius:0;border-top-right-radius:0}.kbq-group>.kbq-group-item:first-child:not(:last-child)>.kbq-form-field__container{border-bottom-right-radius:0;border-top-right-radius:0}.kbq-group>.kbq-group-item:last-child:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0}.kbq-group>.kbq-group-item:last-child:not(:first-child)>.kbq-form-field__container{border-bottom-left-radius:0;border-top-left-radius:0}.kbq-group>.kbq-group-item:not(:first-child):not(:last-child){border-radius:0}.kbq-group>.kbq-group-item:not(:first-child):not(:last-child)>.kbq-form-field__container{border-radius:0}.kbq-vertical-group{display:flex;flex-direction:column}.kbq-vertical-group>.kbq-group-item:first-child:not(:last-child){border-bottom-right-radius:0;border-bottom-left-radius:0;border-top-right-radius:var(--kbq-size-border-radius)}.kbq-vertical-group>.kbq-group-item:first-child:not(:last-child)>.kbq-form-field__container{border-bottom-right-radius:0;border-bottom-left-radius:0}.kbq-vertical-group>.kbq-group-item:last-child:not(:first-child){border-top-right-radius:0;border-top-left-radius:0;border-bottom-left-radius:var(--kbq-size-border-radius)}.kbq-vertical-group>.kbq-group-item:last-child:not(:first-child)>.kbq-form-field__container{border-top-right-radius:0;border-top-left-radius:0}.kbq-vertical-group>.kbq-group-item:not(:first-child):not(:last-child){border-radius:0}.kbq-vertical-group>.kbq-group-item:not(:first-child):not(:last-child)>.kbq-form-field__container{border-radius:0}.kbq-vertical-group .kbq-group-item+.kbq-group-item{margin-top:calc(-1 * var(--kbq-size-border-width))}.kbq-truncate-line{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.kbq-no-select{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.kbq-app-switcher-list-item{position:relative;display:flex;flex-direction:row;max-width:100%;min-height:38px;border-radius:var(--kbq-size-s);padding:var(--kbq-size-xxs) var(--kbq-size-m) var(--kbq-size-xs) var(--kbq-size-m);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;text-decoration:none;box-sizing:border-box;outline:none;-webkit-tap-highlight-color:transparent;cursor:pointer}.kbq-app-switcher-list-item.kbq-app-switcher-site_nested{margin-left:var(--kbq-size-xxl);border-top-left-radius:unset;border-bottom-left-radius:unset}.kbq-app-switcher-list-item.kbq-app-switcher-site_nested:after{content:\"\";position:absolute;left:-1px;top:0;height:100%;border-left-width:1px;border-left-style:solid}.kbq-app-switcher-list-item.kbq-app-switcher-site_nested:has(+:not(.kbq-app-switcher-site_nested)),.kbq-app-switcher-list-item.kbq-app-switcher-site_nested:last-child{border-bottom-left-radius:var(--kbq-size-s)}.kbq-app-switcher-list-item.kbq-app-switcher-site_nested:has(+:not(.kbq-app-switcher-site_nested)):after,.kbq-app-switcher-list-item.kbq-app-switcher-site_nested:last-child:after{top:0;width:var(--kbq-size-m);height:var(--kbq-size-xxl);border-bottom-left-radius:var(--kbq-size-s);border-bottom-width:1px;border-bottom-style:solid}.kbq-app-switcher-list-item__toggle{position:absolute;display:none;align-items:center;justify-content:center;top:var(--kbq-size-m);left:var(--kbq-size-m);width:var(--kbq-size-xxl);height:var(--kbq-size-xxl);border-radius:var(--kbq-size-xxs)}.kbq-app-switcher-list-item__toggle .kbq-icon{transform:rotate(0)}.kbq-app-switcher-list-item__toggle.kbq-expanded .kbq-icon{transform:rotate(180deg)}.kbq-app-switcher-list-item__icon{padding-top:var(--kbq-size-s);padding-right:var(--kbq-size-m)}.kbq-app-switcher-list-item__container{max-width:100%;min-width:0;align-self:center}.kbq-app-switcher-list-item__container .kbq-app-switcher-list-item__name,.kbq-app-switcher-list-item__container .kbq-app-switcher-list-item__caption{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.kbq-app-switcher-site_nested:after{border-left-color:var(--kbq-line-contrast-less);border-bottom-color:var(--kbq-line-contrast-less)}.kbq-app-switcher-list-item__caption{color:var(--kbq-foreground-contrast-secondary)}.kbq-app-switcher-list-item{background:var(--kbq-list-default-container-background);color:var(--kbq-list-default-text-color)}.kbq-app-switcher-list-item:hover:has(.kbq-app-switcher-list-item__toggle) .kbq-app-switcher-list-item__icon,.kbq-app-switcher-list-item.kbq-hover:has(.kbq-app-switcher-list-item__toggle) .kbq-app-switcher-list-item__icon,.kbq-app-switcher-list-item.kbq-focused:has(.kbq-app-switcher-list-item__toggle) .kbq-app-switcher-list-item__icon{visibility:hidden}.kbq-app-switcher-list-item:hover .kbq-app-switcher-list-item__toggle,.kbq-app-switcher-list-item.kbq-hover .kbq-app-switcher-list-item__toggle,.kbq-app-switcher-list-item.kbq-focused .kbq-app-switcher-list-item__toggle{display:flex}.kbq-app-switcher-list-item:hover,.kbq-app-switcher-list-item.kbq-hover,.kbq-app-switcher-list-item:hover .kbq-app-switcher-list-item__toggle,.kbq-app-switcher-list-item.kbq-hover .kbq-app-switcher-list-item__toggle{background:var(--kbq-states-background-transparent-hover)}.kbq-app-switcher-list-item:active,.kbq-app-switcher-list-item.kbq-active{background:var(--kbq-states-background-transparent-active)}.kbq-app-switcher-list-item.kbq-selected{background:var(--kbq-background-theme-less)}.kbq-app-switcher-list-item.kbq-selected:hover,.kbq-app-switcher-list-item.kbq-selected.kbq-hover{background:var(--kbq-states-background-theme-less-hover)}.kbq-app-switcher-list-item.kbq-selected:active,.kbq-app-switcher-list-item.kbq-selected.kbq-active{background:var(--kbq-states-background-theme-less-active)}.kbq-app-switcher-list-item.cdk-keyboard-focused{outline:none;border-color:var(--kbq-list-states-focused-focus-outline-color)}.kbq-app-switcher-list-item__name{font-size:var(--kbq-typography-text-normal-medium-font-size);font-style:var(--kbq-typography-text-normal-medium-font-style);font-weight:var(--kbq-typography-text-normal-medium-font-weight);line-height:var(--kbq-typography-text-normal-medium-line-height);font-family:var(--kbq-typography-text-normal-medium-font-family);text-transform:var(--kbq-typography-text-normal-medium-text-transform);font-feature-settings:var(--kbq-typography-text-normal-medium-font-feature-settings);letter-spacing:var(--kbq-typography-text-normal-medium-letter-spacing)}.kbq-app-switcher-list-item__caption{font-size:var(--kbq-typography-text-compact-font-size);font-style:var(--kbq-typography-text-compact-font-style);font-weight:var(--kbq-typography-text-compact-font-weight);line-height:var(--kbq-typography-text-compact-line-height);font-family:var(--kbq-typography-text-compact-font-family);text-transform:var(--kbq-typography-text-compact-text-transform);font-feature-settings:var(--kbq-typography-text-compact-font-feature-settings);letter-spacing:var(--kbq-typography-text-compact-letter-spacing)}\n"] }]
        }], propDecorators: { app: [{
                type: Input
            }], toggle: [{
                type: Input,
                args: [{ transform: booleanAttribute }]
            }], collapsed: [{
                type: Input,
                args: [{ transform: booleanAttribute }]
            }] } });
//# sourceMappingURL=data:application/json;base64, 