import { ChangeDetectionStrategy, Component, Input, EventEmitter, Output, } from '@angular/core';
import * as i0 from "@angular/core";
const _c0 = function (a0) { return { folded: a0 }; };
const _c1 = ["*"];
export class FoldableBlockComponent {
    constructor() {
        this.folded = true;
        this.isDisabled = false;
        this.tooltip = '';
        this.foldedChange = new EventEmitter();
        this.toggleFoldable = () => {
            this.folded = !this.folded;
            this.foldedChange.emit(this.folded);
        };
    }
}
FoldableBlockComponent.ɵfac = function FoldableBlockComponent_Factory(t) { return new (t || FoldableBlockComponent)(); };
FoldableBlockComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: FoldableBlockComponent, selectors: [["acl-foldable-block"]], inputs: { hint: "hint", folded: "folded", isDisabled: "isDisabled", tooltip: "tooltip" }, outputs: { foldedChange: "foldedChange" }, ngContentSelectors: _c1, decls: 8, vars: 16, consts: [[1, "foldable", 3, "ngClass"], [1, "foldable-content", 3, "hidden"], [3, "isAllowed", "isDisabled", "tooltip"], ["aui-button", "primary", "size", "mini", "type", "button", 3, "ngClass", "round", "plain", "click"], [3, "icon"]], template: function FoldableBlockComponent_Template(rf, ctx) { if (rf & 1) {
        i0.ɵɵprojectionDef();
        i0.ɵɵelementStart(0, "div", 0)(1, "div", 1);
        i0.ɵɵprojection(2);
        i0.ɵɵelementEnd();
        i0.ɵɵelementStart(3, "acl-disabled-container", 2)(4, "button", 3);
        i0.ɵɵlistener("click", function FoldableBlockComponent_Template_button_click_4_listener() { return ctx.toggleFoldable(); });
        i0.ɵɵtext(5);
        i0.ɵɵpipe(6, "translate");
        i0.ɵɵelement(7, "aui-icon", 4);
        i0.ɵɵelementEnd()()();
    } if (rf & 2) {
        i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(12, _c0, ctx.folded));
        i0.ɵɵadvance(1);
        i0.ɵɵproperty("hidden", ctx.folded);
        i0.ɵɵadvance(2);
        i0.ɵɵproperty("isAllowed", true)("isDisabled", ctx.isDisabled)("tooltip", ctx.tooltip);
        i0.ɵɵadvance(1);
        i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(14, _c0, !ctx.folded))("round", true)("plain", ctx.folded);
        i0.ɵɵadvance(1);
        i0.ɵɵtextInterpolate1(" ", ctx.hint || i0.ɵɵpipeBind1(6, 10, ctx.folded ? "more" : "collapse"), " ");
        i0.ɵɵadvance(2);
        i0.ɵɵproperty("icon", ctx.folded ? "basic:angle_double_down" : "basic:angle_double_up");
    } }, styles: [".foldable[_ngcontent-%COMP%]{min-height:20px;background:rgb(var(--aui-color-n-9));padding:12px 12px 22px;border-radius:4px;margin-bottom:10px;border:1px solid rgb(var(--aui-color-primary));position:relative}.foldable.folded[_ngcontent-%COMP%]{padding:0;height:20px;border:unset}.foldable-content[_ngcontent-%COMP%]{border-radius:4px;background:rgb(var(--aui-color-n-10));padding:20px}.foldable[_ngcontent-%COMP%]   .aui-button[_ngcontent-%COMP%]{height:24px;font-size:12px;position:absolute;left:20px;bottom:-12px;border:2px solid rgb(var(--aui-color-n-10))}[_nghost-%COMP%]     .aui-button__content{padding:0 16px}"], changeDetection: 0 });
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(FoldableBlockComponent, [{
        type: Component,
        args: [{ selector: 'acl-foldable-block', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n  class=\"foldable\"\n  [ngClass]=\"{ folded: folded }\"\n>\n  <div\n    [hidden]=\"folded\"\n    class=\"foldable-content\"\n  >\n    <ng-content></ng-content>\n  </div>\n  <acl-disabled-container\n    [isAllowed]=\"true\"\n    [isDisabled]=\"isDisabled\"\n    [tooltip]=\"tooltip\"\n  >\n    <button\n      (click)=\"toggleFoldable()\"\n      [ngClass]=\"{ folded: !folded }\"\n      aui-button=\"primary\"\n      [round]=\"true\"\n      [plain]=\"folded\"\n      size=\"mini\"\n      type=\"button\"\n    >\n      {{ hint || ((folded ? 'more' : 'collapse') | translate) }}\n      <aui-icon\n        [icon]=\"folded ? 'basic:angle_double_down' : 'basic:angle_double_up'\"\n      ></aui-icon>\n    </button>\n  </acl-disabled-container>\n</div>\n", styles: [".foldable{min-height:20px;background:rgb(var(--aui-color-n-9));padding:12px 12px 22px;border-radius:4px;margin-bottom:10px;border:1px solid rgb(var(--aui-color-primary));position:relative}.foldable.folded{padding:0;height:20px;border:unset}.foldable-content{border-radius:4px;background:rgb(var(--aui-color-n-10));padding:20px}.foldable .aui-button{height:24px;font-size:12px;position:absolute;left:20px;bottom:-12px;border:2px solid rgb(var(--aui-color-n-10))}:host ::ng-deep .aui-button__content{padding:0 16px}\n"] }]
    }], null, { hint: [{
            type: Input
        }], folded: [{
            type: Input
        }], isDisabled: [{
            type: Input
        }], tooltip: [{
            type: Input
        }], foldedChange: [{
            type: Output
        }] }); })();
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vbGlicy9jb21tb24vc3JjL3dpZGdldC9mb2xkYWJsZS1ibG9jay9jb21wb25lbnQudHMiLCIuLi8uLi8uLi8uLi8uLi8uLi9saWJzL2NvbW1vbi9zcmMvd2lkZ2V0L2ZvbGRhYmxlLWJsb2NrL3RlbXBsYXRlLmh0bWwiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUNMLHVCQUF1QixFQUN2QixTQUFTLEVBQ1QsS0FBSyxFQUNMLFlBQVksRUFDWixNQUFNLEdBQ1AsTUFBTSxlQUFlLENBQUM7Ozs7QUFRdkIsTUFBTSxPQUFPLHNCQUFzQjtJQU5uQztRQVVXLFdBQU0sR0FBRyxJQUFJLENBQUM7UUFFZCxlQUFVLEdBQUcsS0FBSyxDQUFDO1FBRW5CLFlBQU8sR0FBRyxFQUFFLENBQUM7UUFFWixpQkFBWSxHQUFHLElBQUksWUFBWSxFQUFXLENBQUM7UUFFckQsbUJBQWMsR0FBRyxHQUFHLEVBQUU7W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