'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

const core = require('./core-859ae5a6.js');

const ButtonCollapse = class {
    constructor(hostRef) {
        core.registerInstance(this, hostRef);
        this.expanded = true;
        /**
         * If true will render as a free button instead of the standard icon.
         */
        this.free = false;
        this.anjCollapse = core.createEvent(this, "anjCollapse", 7);
    }
    onClick() {
        if (this.context !== 'clear') {
            this.anjCollapse.emit(this.expanded);
        }
        this.expanded = !this.expanded;
    }
    render() {
        return (core.h("anj-button", { context: this.free ? 'free' : 'icon', onClick: () => this.onClick(), ariaLabel: this.expanded ? 'Collapse' : 'Expand' }, this.expanded
            ? core.h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24" }, core.h("path", { fill: "none", d: "M0 0h24v24H0V0z" }), core.h("path", { d: "M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6 1.41 1.41z" }))
            : core.h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24" }, core.h("path", { fill: "none", d: "M0 0h24v24H0V0z" }), core.h("path", { d: "M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z" }))));
    }
    static get style() { return ".sc-anj-button-collapse-h {\n  display: block;\n}\n[context=floating].sc-anj-button-collapse-h {\n  position: absolute;\n  right: 0.5rem;\n  top: 0.5rem;\n  z-index: 1;\n}"; }
};

exports.anj_button_collapse = ButtonCollapse;
