import { __decorate, __param } from "tslib";
import { ChangeDetectionStrategy, Component, Optional, ViewEncapsulation } from '@angular/core';
import { BbDashboard } from '../dashboard/dashboard.component';
import { of } from 'rxjs';
let BbDashboardHeader = class BbDashboardHeader {
    constructor(_parent) {
        this._parent = _parent;
    }
    get isSidebarVisible() {
        return this._parent
            ? this._parent.visibility
            : of(false);
    }
    onToggleSidebarClicked() {
        // If the parent exists toggle the sidebar visibility.
        this._parent && this._parent.toggleSidebarVisibility();
    }
};
BbDashboardHeader.ctorParameters = () => [
    { type: BbDashboard, decorators: [{ type: Optional }] }
];
BbDashboardHeader = __decorate([
    Component({
        selector: 'bb-dashboard-header',
        template: "<!--\n    The button that toggles the sidebar.\n-->\n<button (click)=\"onToggleSidebarClicked()\"\n        [class.bb-dashboard-header-button--reversed]=\"isSidebarVisible | async\"\n        class=\"bb-dashboard-header-button\"\n        type=\"button\"\n        tabindex=\"0\"\n        role=\"switch\">\n    <svg xmlns=\"http://www.w3.org/2000/svg\"\n         viewBox=\"0 0 157 109\"\n         width=\"17\"\n         height=\"12\"\n         role=\"img\">\n        <title>\n            Toggle\n        </title>\n        <path fill=\"#fff\"\n              d=\"M82 42V11.2L30 54.5l52 43.3V67h75V42zM9.5 109h-2c-4.1 0-7.5-3.4-7.5-7.5v-94C0 3.4 3.4 0 7.5 0h2C13.6 0 17 3.4 17 7.5v94c0 4.1-3.4 7.5-7.5 7.5z\">\n        </path>\n    </svg>\n</button>\n\n<!--\n    The extra items of the header.\n-->\n<div class=\"bb-dashboard-header-items\">\n    <ng-content></ng-content>\n</div>",
        changeDetection: ChangeDetectionStrategy.OnPush,
        encapsulation: ViewEncapsulation.None,
        preserveWhitespaces: false,
        host: {
            'class': 'bb-dashboard-header'
        },
        styles: [".bb-dashboard-header{z-index:1;width:100%;color:#fff;height:50px;display:-webkit-box;display:-ms-flexbox;display:flex;padding:0 8px;min-height:50px;-webkit-box-align:center;-ms-flex-align:center;align-items:center;background-color:#5b53ff;border-bottom:1px solid #4d46d6}.bb-dashboard-header-button{width:68px;height:34px;border-radius:4px;-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;border:1px solid #4d46d6;background-color:transparent}.bb-dashboard-header-button>svg{height:100%;-webkit-transform:none;-ms-transform:none;transform:none;-webkit-transition:-webkit-transform .2s cubic-bezier(0,0,.2,1);transition:transform .2s cubic-bezier(0,0,.2,1);transition:transform .2s cubic-bezier(0,0,.2,1),-webkit-transform .2s cubic-bezier(0,0,.2,1)}.bb-dashboard-header-button--reversed>svg{-webkit-transform:rotateY(180deg);transform:rotateY(180deg)}.bb-dashboard-header-button:hover{background-color:rgba(0,0,0,.04)}.bb-dashboard-header-button:active{background-color:rgba(0,0,0,.08)}.bb-dashboard-header-items{display:-webkit-box;display:-ms-flexbox;display:flex;margin-left:auto;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.bb-dashboard-header-items>:not(:first-child){margin-left:8px}@media only screen and (min-width:768px){.bb-dashboard-header-button>svg{-webkit-transform:rotateY(180deg);transform:rotateY(180deg)}.bb-dashboard-header-button--reversed>svg{-webkit-transform:none;-ms-transform:none;transform:none}}"]
    }),
    __param(0, Optional())
], BbDashboardHeader);
export { BbDashboardHeader };
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGFzaGJvYXJkLWhlYWRlci5jb21wb25lbnQuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9AYnJhdm9iaXQvYmItZm91bmRhdGlvbi9kYXNoYm9hcmQvIiwic291cmNlcyI6WyJsaWIvZGFzaGJvYXJkLWhlYWRlci9kYXNoYm9hcmQtaGVhZGVyLmNvbXBvbmVudC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsT0FBTyxFQUFDLHVCQUF1QixFQUFFLFNBQVMsRUFBRSxRQUFRLEVBQUUsaUJBQWlCLEVBQUMsTUFB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