/*!
 * EdGEL: The University of Edinburgh Design System v5.1.0-rc.1 (https://design-system.ed.ac.uk/)
 * Copyright 2014-2023 The University of Edinburgh
 *
 * Bootstrap  v5.3.2 (https://getbootstrap.com/)
 * Copyright 2011-2023 The Bootstrap Authors
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
 */
import{_ as e,E as t,x as s,c as i}from"./base-C0zcJIOm.js";import{E as r,i as o,S as l,d as n,B as a}from"./selector-engine-L8thDpCF.js";const c=".bs.alert",d=`close${c}`,h=`closed${c}`;class m extends a{static get NAME(){return"alert"}close(){if(r.trigger(this._element,d).defaultPrevented)return;this._element.classList.remove("show");const e=this._element.classList.contains("fade");this._queueCallback((()=>this._destroyElement()),this._element,e)}_destroyElement(){this._element.remove(),r.trigger(this._element,h),this.dispose()}static jQueryInterface(e){return this.each((function(){const t=m.getOrCreateInstance(this);if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError(`No method named "${e}"`);t[e](this)}}))}}((e,t="hide")=>{const s=`click.dismiss${e.EVENT_KEY}`,i=e.NAME;r.on(document,s,`[data-bs-dismiss="${i}"]`,(function(s){if(["A","AREA"].includes(this.tagName)&&s.preventDefault(),o(this))return;const r=l.getElementFromSelector(this)||this.closest(`.${i}`);e.getOrCreateInstance(r)[t]()}))})(m,"close"),n(m);let u,g,f=e=>e;const _="closed.bs.alert";class p extends t{constructor(){super(),this.colour="dark",this.dismiss=!1}_dismissAlert(){const e=this.shadowRoot.querySelector(".show");r.one(e,_,(()=>{r.trigger(this,_)}));m.getOrCreateInstance(e).close(e)}render(){let e,t=`alert alert-${this.colour}`;return this.dismiss&&(t=`${t} alert-dismissible fade show`,e=s(u||(u=f`
        <button type="button" class="btn-close" aria-label="Close" @click=${0}></button>
      `),this._dismissAlert)),s(g||(g=f`
      <div class=${0} role="alert">
        <slot></slot>
        ${0}
      </div>
    `),t,e)}}e(p,"properties",{colour:{type:String},dismiss:{type:Boolean}}),i("edgel-alert",p);
