import { p as proxyCustomElement, H, h, f as forceUpdate } from './p-ac76a689.js';
import { E as EventBus } from './p-9d530225.js';
import { d as defineCustomElement$7 } from './p-644255f8.js';
import { d as defineCustomElement$6 } from './p-52db5b4c.js';
import { d as defineCustomElement$5 } from './p-07470759.js';
import { d as defineCustomElement$4 } from './p-67725a25.js';
import { d as defineCustomElement$3 } from './p-4d3d1dcb.js';
import { d as defineCustomElement$2 } from './p-a47dfa8e.js';

var TransactionToastEventsEnum;
(function (TransactionToastEventsEnum) {
    TransactionToastEventsEnum["CLOSE_TOAST"] = "CLOSE_TOAST";
    TransactionToastEventsEnum["TRANSACTION_TOAST_DATA_UPDATE"] = "TRANSACTION_TOAST_DATA_UPDATE";
})(TransactionToastEventsEnum || (TransactionToastEventsEnum = {}));

const transactionToastListCss = ".transaction-list{position:fixed;bottom:1rem;left:1rem;right:1rem;z-index:9999}@media (min-width: 760px){.transaction-list{right:2rem;bottom:2rem;width:22.5rem;left:auto}}";
const TransactionToastListStyle0 = transactionToastListCss;

const TransactionToastList$1 = /*@__PURE__*/ proxyCustomElement(class TransactionToastList extends H {
    constructor() {
        super();
        this.__registerHost();
        this.eventBus = new EventBus();
        this.data = undefined;
    }
    async getEventBus() {
        return this.eventBus;
    }
    render() {
        var _a;
        return (h("div", { key: 'cbb886c2570d601438560f97c09a41ef0523e495', class: "transaction-list", id: "transaction-list" }, (_a = this.data) === null || _a === void 0 ? void 0 : _a.map(toast => (h("transaction-toast", Object.assign({}, toast, { onHandleDeleteToast: () => this.eventBus.publish(TransactionToastEventsEnum.CLOSE_TOAST, toast.toastId) }))))));
    }
    dataUpdate(payload) {
        this.data = [...payload];
        forceUpdate(this);
    }
    componentDidLoad() {
        this.eventBus.subscribe(TransactionToastEventsEnum.TRANSACTION_TOAST_DATA_UPDATE, this.dataUpdate.bind(this));
    }
    static get style() { return TransactionToastListStyle0; }
}, [0, "transaction-toast-list", {
        "data": [16],
        "getEventBus": [64]
    }]);
function defineCustomElement$1() {
    if (typeof customElements === "undefined") {
        return;
    }
    const components = ["transaction-toast-list", "transaction-toast", "transaction-toast-content", "transaction-toast-details", "transaction-toast-details-body", "transaction-toast-progress", "transaction-toast-wrapper"];
    components.forEach(tagName => { switch (tagName) {
        case "transaction-toast-list":
            if (!customElements.get(tagName)) {
                customElements.define(tagName, TransactionToastList$1);
            }
            break;
        case "transaction-toast":
            if (!customElements.get(tagName)) {
                defineCustomElement$7();
            }
            break;
        case "transaction-toast-content":
            if (!customElements.get(tagName)) {
                defineCustomElement$6();
            }
            break;
        case "transaction-toast-details":
            if (!customElements.get(tagName)) {
                defineCustomElement$5();
            }
            break;
        case "transaction-toast-details-body":
            if (!customElements.get(tagName)) {
                defineCustomElement$4();
            }
            break;
        case "transaction-toast-progress":
            if (!customElements.get(tagName)) {
                defineCustomElement$3();
            }
            break;
        case "transaction-toast-wrapper":
            if (!customElements.get(tagName)) {
                defineCustomElement$2();
            }
            break;
    } });
}
defineCustomElement$1();

const TransactionToastList = TransactionToastList$1;
const defineCustomElement = defineCustomElement$1;

export { TransactionToastList, defineCustomElement };

//# sourceMappingURL=transaction-toast-list.js.map