text: /**
   * Minified by jsDelivr using Terser v3.14.1.
   * Original file: /npm/bootstrap@4.5.0/js/src/toast.js
   *
   * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
   */
  import $ from"jquery";import Util from"./util";const NAME="toast",VERSION="4.5.0",DATA_KEY="bs.toast",EVENT_KEY=`.${DATA_KEY}`,JQUERY_NO_CONFLICT=$.fn[NAME],EVENT_CLICK_DISMISS=`click.dismiss${EVENT_KEY}`,EVENT_HIDE=`hide${EVENT_KEY}`,EVENT_HIDDEN=`hidden${EVENT_KEY}`,EVENT_SHOW=`show${EVENT_KEY}`,EVENT_SHOWN=`shown${EVENT_KEY}`,CLASS_NAME_FADE="fade",CLASS_NAME_HIDE="hide",CLASS_NAME_SHOW="show",CLASS_NAME_SHOWING="showing",DefaultType={animation:"boolean",autohide:"boolean",delay:"number"},Default={animation:!0,autohide:!0,delay:500},SELECTOR_DATA_DISMISS='[data-dismiss="toast"]';class Toast{constructor(t,e){this._element=t,this._config=this._getConfig(e),this._timeout=null,this._setListeners()}static get VERSION(){return VERSION}static get DefaultType(){return DefaultType}static get Default(){return Default}show(){const t=$.Event(EVENT_SHOW);if($(this._element).trigger(t),t.isDefaultPrevented())return;this._config.animation&&this._element.classList.add(CLASS_NAME_FADE);const e=()=>{this._element.classList.remove(CLASS_NAME_SHOWING),this._element.classList.add(CLASS_NAME_SHOW),$(this._element).trigger(EVENT_SHOWN),this._config.autohide&&(this._timeout=setTimeout(()=>{this.hide()},this._config.delay))};if(this._element.classList.remove(CLASS_NAME_HIDE),Util.reflow(this._element),this._element.classList.add(CLASS_NAME_SHOWING),this._config.animation){const t=Util.getTransitionDurationFromElement(this._element);$(this._element).one(Util.TRANSITION_END,e).emulateTransitionEnd(t)}else e()}hide(){if(!this._element.classList.contains(CLASS_NAME_SHOW))return;const t=$.Event(EVENT_HIDE);$(this._element).trigger(t),t.isDefaultPrevented()||this._close()}dispose(){clearTimeout(this._timeout),this._timeout=null,this._element.classList.contains(CLASS_NAME_SHOW)&&this._element.classList.remove(CLASS_NAME_SHOW),$(this._element).off(EVENT_CLICK_DISMISS),$.removeData(this._element,DATA_KEY),this._element=null,this._config=null}_getConfig(t){return t={...Default,...$(this._element).data(),..."object"==typeof t&&t?t:{}},Util.typeCheckConfig(NAME,t,this.constructor.DefaultType),t}_setListeners(){$(this._element).on(EVENT_CLICK_DISMISS,SELECTOR_DATA_DISMISS,()=>this.hide())}_close(){const t=()=>{this._element.classList.add(CLASS_NAME_HIDE),$(this._element).trigger(EVENT_HIDDEN)};if(this._element.classList.remove(CLASS_NAME_SHOW),this._config.animation){const e=Util.getTransitionDurationFromElement(this._element);$(this._element).one(Util.TRANSITION_END,t).emulateTransitionEnd(e)}else t()}static _jQueryInterface(t){return this.each(function(){const e=$(this);let i=e.data(DATA_KEY);if(i||(i=new Toast(this,"object"==typeof t&&t),e.data(DATA_KEY,i)),"string"==typeof t){if(void 0===i[t])throw new TypeError(`No method named "${t}"`);i[t](this)}})}}$.fn[NAME]=Toast._jQueryInterface,$.fn[NAME].Constructor=Toast,$.fn[NAME].noConflict=(()=>($.fn[NAME]=JQUERY_NO_CONFLICT,Toast._jQueryInterface));export default Toast;
  //# sourceMappingURL=/sm/17d7c425a668ddaabd2300ab63eef6fd7e3d8677ebe98ae50ea5cb4688f0c2fc.map