{"version":3,"file":"alert.min.js","sources":["https:\/\/hivtrainingcdu.remote-learner.net\/theme\/boost\/amd\/src\/bootstrap\/alert.js"],"sourcesContent":["\/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.5.0): alert.js\n * Licensed under MIT (https:\/\/github.com\/twbs\/bootstrap\/blob\/master\/LICENSE)\n * --------------------------------------------------------------------------\n *\/\n\nimport $ from 'jquery'\nimport Util from '.\/util'\n\n\/**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n *\/\n\nconst NAME = 'alert'\nconst VERSION = '4.5.0'\nconst DATA_KEY = 'bs.alert'\nconst EVENT_KEY = `.${DATA_KEY}`\nconst DATA_API_KEY = '.data-api'\nconst JQUERY_NO_CONFLICT = $.fn[NAME]\n\nconst SELECTOR_DISMISS = '[data-dismiss=\"alert\"]'\n\nconst EVENT_CLOSE = `close${EVENT_KEY}`\nconst EVENT_CLOSED = `closed${EVENT_KEY}`\nconst EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`\n\nconst CLASS_NAME_ALERT = 'alert'\nconst CLASS_NAME_FADE = 'fade'\nconst CLASS_NAME_SHOW = 'show'\n\n\/**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n *\/\n\nclass Alert {\n constructor(element) {\n this._element = element\n }\n\n \/\/ Getters\n\n static get VERSION() {\n return VERSION\n }\n\n \/\/ Public\n\n close(element) {\n let rootElement = this._element\n if (element) {\n rootElement = this._getRootElement(element)\n }\n\n const customEvent = this._triggerCloseEvent(rootElement)\n\n if (customEvent.isDefaultPrevented()) {\n return\n }\n\n this._removeElement(rootElement)\n }\n\n dispose() {\n $.removeData(this._element, DATA_KEY)\n this._element = null\n }\n\n \/\/ Private\n\n _getRootElement(element) {\n const selector = Util.getSelectorFromElement(element)\n let parent = false\n\n if (selector) {\n parent = document.querySelector(selector)\n }\n\n if (!parent) {\n parent = $(element).closest(`.${CLASS_NAME_ALERT}`)[0]\n }\n\n return parent\n }\n\n _triggerCloseEvent(element) {\n const closeEvent = $.Event(EVENT_CLOSE)\n\n $(element).trigger(closeEvent)\n return closeEvent\n }\n\n _removeElement(element) {\n $(element).removeClass(CLASS_NAME_SHOW)\n\n if (!$(element).hasClass(CLASS_NAME_FADE)) {\n this._destroyElement(element)\n return\n }\n\n const transitionDuration = Util.getTransitionDurationFromElement(element)\n\n $(element)\n .one(Util.TRANSITION_END, (event) => this._destroyElement(element, event))\n .emulateTransitionEnd(transitionDuration)\n }\n\n _destroyElement(element) {\n $(element)\n .detach()\n .trigger(EVENT_CLOSED)\n .remove()\n }\n\n \/\/ Static\n\n static _jQueryInterface(config) {\n return this.each(function () {\n const $element = $(this)\n let data = $element.data(DATA_KEY)\n\n if (!data) {\n data = new Alert(this)\n $element.data(DATA_KEY, data)\n }\n\n if (config === 'close') {\n data[config](this)\n }\n })\n }\n\n static _handleDismiss(alertInstance) {\n return function (event) {\n if (event) {\n event.preventDefault()\n }\n\n alertInstance.close(this)\n }\n }\n}\n\n\/**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n *\/\n\n$(document).on(\n EVENT_CLICK_DATA_API,\n SELECTOR_DISMISS,\n Alert._handleDismiss(new Alert())\n)\n\n\/**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n *\/\n\n$.fn[NAME] = Alert._jQueryInterface\n$.fn[NAME].Constructor = Alert\n$.fn[NAME].noConflict = () => {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return Alert._jQueryInterface\n}\n\nexport default Alert\n"],"names":["EVENT_KEY","JQUERY_NO_CONFLICT","$","fn","EVENT_CLOSE","EVENT_CLOSED","EVENT_CLICK_DATA_API","Alert","element","_element","config","this","each","$element","data","alertInstance","event","preventDefault","close","rootElement","_getRootElement","_triggerCloseEvent","isDefaultPrevented","_removeElement","removeData","selector","Util","getSelectorFromElement","parent","document","querySelector","closest","closeEvent","Event","trigger","removeClass","hasClass","transitionDuration","getTransitionDurationFromElement","one","TRANSITION_END","_this","_destroyElement","emulateTransitionEnd","detach","remove","on","_handleDismiss","_jQueryInterface","Constructor","noConflict"],"mappings":"2mBAmBMA,qBADsB,YAGtBC,mBAAsBC,gBAAEC,GAAF,MAItBC,2BAA+BJ,WAC\/BK,6BAAgCL,WAChCM,oCAA+BN,kBAPT,aAmBtBO,gCACQC,0JACLC,SAAWD,wGAKlB,iBA7B0B,wCAuG1B,SAAwBE,eACfC,KAAKC,MAAK,eACTC,UAAW,mBAAEF,MACfG,KAAaD,SAASC,KAzGJ,YA2GjBA,OACHA,KAAO,IAAIP,MAAMI,MACjBE,SAASC,KA7GW,WA6GIA,OAGX,UAAXJ,QACFI,KAAKJ,QAAQC,uCAKnB,SAAsBI,sBACb,SAAUC,OACXA,OACFA,MAAMC,iBAGRF,cAAcG,MAAMP,0CA1FxB,SAAMH,aACAW,YAAcR,KAAKF,SACnBD,UACFW,YAAcR,KAAKS,gBAAgBZ,UAGjBG,KAAKU,mBAAmBF,aAE5BG,2BAIXC,eAAeJ,oCAGtB,2BACIK,WAAWb,KAAKF,SAlDM,iBAmDnBA,SAAW,oCAKlB,SAAgBD,aACRiB,SAAWC,cAAKC,uBAAuBnB,SACzCoB,QAAa,SAEbH,WACFG,OAASC,SAASC,cAAcL,WAG7BG,SACHA,QAAS,mBAAEpB,SAASuB,mBAtDD,UAsDiC,IAG\/CH,yCAGT,SAAmBpB,aACXwB,WAAa9B,gBAAE+B,MAAM7B,uCAEzBI,SAAS0B,QAAQF,YACZA,yCAGT,SAAexB,+CACXA,SAAS2B,YAlEU,SAoEhB,mBAAE3B,SAAS4B,SArEK,aA0EfC,mBAAqBX,cAAKY,iCAAiC9B,6BAE\/DA,SACC+B,IAAIb,cAAKc,gBAAgB,SAACxB,cAAUyB,MAAKC,gBAAgBlC,QAASQ,UAClE2B,qBAAqBN,8BARjBK,gBAAgBlC,wCAWzB,SAAgBA,6BACZA,SACCoC,SACAV,QAAQ7B,cACRwC,oNAsCLhB,UAAUiB,GACVxC,qBAnIuB,yBAqIvBC,MAAMwC,eAAe,IAAIxC,wBASzBJ,GAAF,MAAyBI,MAAMyC,iCAC7B7C,GAAF,MAAW8C,YAAc1C,sBACvBJ,GAAF,MAAW+C,WAAc,kCACrB\/C,GAAF,MAAaF,mBACNM,MAAMyC,+BAGAzC"}