/*!
 * KoliBri - The accessible HTML-Standard
 */
"use strict";const componentNames=require("./component-names-4cf3e7f5.js"),index=require("./index-cb2ce614.js"),i18n=require("./i18n-c3fa5bd7.js");let initialized=!1;const bootstrap=async(t,e,n)=>{var i,o,s;await i18n.initI18n(null===(i=null==n?void 0:n.translation)||void 0===i?void 0:i.name),await i18n.configI18n(null!==(s=null===(o=null==n?void 0:n.translation)||void 0===o?void 0:o.name)&&void 0!==s?s:"de",null==n?void 0:n.translations),(null==n?void 0:n.transformTagName)&&componentNames.setCustomTagNames(null==n?void 0:n.transformTagName);const a=await index._(t,e,n);return initialized=!0,a},register=bootstrap,isInitialized=()=>initialized;class ToasterService{constructor(t,e){this.document=t,this.options=e,console.log("create",componentNames.KolToastContainerTag),console.trace(),this.toastContainerElement=this.document.createElement(componentNames.KolToastContainerTag),this.document.body.prepend(this.toastContainerElement)}static getInstance(t,e){if(!isInitialized())throw new Error("Toaster: Call KoliBri bootstrap/register method first.");let n=this.instances.get(t);return n||(n=new ToasterService(t,e),this.instances.set(t,n)),n}dispose(){const t=this.toastContainerElement;t?(this.toastContainerElement=void 0,t.remove()):console.warn("Toaster service is already disposed.")}enqueue(t){var e,n;if(this.toastContainerElement&&"function"==typeof this.toastContainerElement.enqueue)return!t.alertVariant&&(null===(e=this.options)||void 0===e?void 0:e.defaultAlertVariant)&&(t.alertVariant=null===(n=this.options)||void 0===n?void 0:n.defaultAlertVariant),this.toastContainerElement.enqueue(t)}closeAll(){this.toastContainerElement&&"function"==typeof this.toastContainerElement.closeAll&&this.toastContainerElement.closeAll()}}ToasterService.instances=new Map,exports.ToasterService=ToasterService,exports.bootstrap=bootstrap,exports.register=register;