/* ===================== AUTOGENERATED SOURCE IMPORT ===================== */

import GlobalStyle from "/emcJS/util/html/template/CSSTemplate.js";

const STYLE = new GlobalStyle(`
    :host {
        cursor: pointer;
    }
`);

/* ======================================================================= */

import Message from "./Message.js";
// import TPL from "./ActionMessage.js.html" assert {type: "html"};

export default class ActionMessage extends Message {

    constructor(opts = {}) {
        super(opts);
        STYLE.apply(this.shadowRoot);
        /* --- */
        this.addEventListener("click", (event) => {
            event.stopPropagation();
            this.remove();
            this.dispatchEvent(new Event("action"));
        });
    }

}

customElements.define("emc-message-action", ActionMessage);
