1function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,_toPropertyKey(i.key),i)}}function _createClass(e,t,n){return t&&_defineProperties(e.prototype,t),n&&_defineProperties(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(e){e=_toPrimitive(e,"string");return"symbol"==_typeof(e)?e:e+""}function _toPrimitive(e,t){if("object"!=_typeof(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);n=n.call(e,t||"default");if("object"!=_typeof(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}function _callSuper(e,t,n){return t=_getPrototypeOf(t),_possibleConstructorReturn(e,_isNativeReflectConstruct()?Reflect.construct(t,n||[],_getPrototypeOf(e).constructor):t.apply(e,n))}function _possibleConstructorReturn(e,t){if(t&&("object"==_typeof(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(e)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(_isNativeReflectConstruct=function(){return!!e})()}function _superPropGet(e,t,n,i){var o=_get(_getPrototypeOf(1&i?e.prototype:e),t,n);return 2&i&&"function"==typeof o?function(e){return o.apply(n,e)}:o}function _get(){return(_get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var i=_superPropBase(e,t);if(i)return(i=Object.getOwnPropertyDescriptor(i,t)).get?i.get.call(arguments.length<3?e:n):i.value}).apply(null,arguments)}function _superPropBase(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=_getPrototypeOf(e)););return e}function _getPrototypeOf(e){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_setPrototypeOf(e,t)}function _setPrototypeOf(e,t){return(_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}import BaseComponent from"./base-component.js";import EventHandler from"./dom/event-handler.js";import SelectorEngine from"./dom/selector-engine.js";import Backdrop from"./util/backdrop.js";import{enableDismissTrigger}from"./util/component-functions.js";import FocusTrap from"./util/focustrap.js";import{defineJQueryPlugin,isRTL,isVisible,reflow}from"./util/index.js";import ScrollBarHelper from"./util/scrollbar.js";var NAME="modal",DATA_KEY="bs.modal",EVENT_KEY=".".concat(DATA_KEY),DATA_API_KEY=".data-api",ESCAPE_KEY="Escape",EVENT_HIDE="hide".concat(EVENT_KEY),EVENT_HIDE_PREVENTED="hidePrevented".concat(EVENT_KEY),EVENT_HIDDEN="hidden".concat(EVENT_KEY),EVENT_SHOW="show".concat(EVENT_KEY),EVENT_SHOWN="shown".concat(EVENT_KEY),EVENT_RESIZE="resize".concat(EVENT_KEY),EVENT_CLICK_DISMISS="click.dismiss".concat(EVENT_KEY),EVENT_MOUSEDOWN_DISMISS="mousedown.dismiss".concat(EVENT_KEY),EVENT_KEYDOWN_DISMISS="keydown.dismiss".concat(EVENT_KEY),EVENT_CLICK_DATA_API="click".concat(EVENT_KEY).concat(DATA_API_KEY),CLASS_NAME_OPEN="modal-open",CLASS_NAME_FADE="fade",CLASS_NAME_SHOW="show",CLASS_NAME_STATIC="modal-static",OPEN_SELECTOR=".modal.show",SELECTOR_DIALOG=".modal-dialog",SELECTOR_MODAL_BODY=".modal-body",SELECTOR_DATA_TOGGLE='[data-bs-toggle="modal"]',Default={backdrop:!0,focus:!0,keyboard:!0},DefaultType={backdrop:"(boolean|string)",focus:"boolean",keyboard:"boolean"}
1,Modal=(()=>{function i(e,t){return _classCallCheck(this,i),(e=_callSuper(this,i,[e,t]))._dialog=SelectorEngine.findOne(SELECTOR_DIALOG,e._element),e._backdrop=e._initializeBackDrop(),e._focustrap=e._initializeFocusTrap(),e._isShown=!1,e._isTransitioning=!1,e._scrollBar=new ScrollBarHelper,e._addEventListeners(),e}return _inherits(i,BaseComponent),_createClass(i,[{key:"toggle",value:function(e){return this._isShown?this.hide():this.show(e)}},{key:"show",value:function(e){var t=this;this._isShown||this._isTransitioning||EventHandler.trigger(this._element,EVENT_SHOW,{relatedTarget:e}).defaultPrevented||(this._isShown=!0,this._isTransitioning=!0,this._scrollBar.hide(),document.body.classList.add(CLASS_NAME_OPEN),this._adjustDialog(),this._backdrop.show(function(){return t._showElement(e)}))}},{key:"hide",value:function(){var e=this;!this._isShown||this._isTransitioning||EventHandler.trigger(this._element,EVENT_HIDE).defaultPrevented||(this._isShown=!1,this._isTransitioning=!0,this._focustrap.deactivate(),this._element.classList.remove(CLASS_NAME_SHOW),this._queueCallback(function(){return e._hideModal()},this._element,this._isAnimated()))}},{key:"dispose",value:function(){EventHandler.off(window,EVENT_KEY),EventHandler.off(this._dialog,EVENT_KEY),this._backdrop.dispose(),this._focustrap.deactivate(),_superPropGet(i,"dispose",this,3)([])}},{key:"handleUpdate",value:function(){this._adjustDialog()}},{key:"_initializeBackDrop",value:function(){return new Backdrop({isVisible:Boolean(this._config.backdrop),isAnimated:this._isAnimated()})}},{key:"_initializeFocusTrap",value:function(){return new FocusTrap({trapElement:this._element})}},{key:"_showElement",value:function(e){var t=this,n=(document.body.contains(this._element)||document.body.append(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.scrollTop=0,SelectorEngine.findOne(SELECTOR_MODAL_BODY,this._dialog));n&&(n.scrollTop=0),reflow(this._element),this._element.classList.add(CLASS_NAME_SHOW);this._queueCallback(function(){t._config.focus&&t._focustrap.activate(),t._isTransitioning=!1,EventHandler.trigger(t._element,EVENT_SHOWN,{relatedTarget:e})},this._dialog,this._isAnimated())}},{key:"_addEventListeners",value:function(){var n=this;EventHandler.on(this._element,EVENT_KEYDOWN_DISMISS,function(e){e.key===ESCAPE_KEY&&(n._config.keyboard?n.hide():n._triggerBackdropTransition())}),EventHandler.on(window,EVENT_RESIZE,function(){n._isShown&&!n._isTransitioning&&n._adjustDialog()}),EventHandler.on(this._element,EVENT_MOUSEDOWN_DISMISS,function(t){EventHandler.one(n._element,EVENT_CLICK_DISMISS,function(e){n._element===t.target&&n._element===e.target&&("static"===n._config.backdrop?n._triggerBackdropTransition():n._config.backdrop&&n.hide())})})}},{key:"_hideModal",value:function(){var e=this;this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._isTransitioning=!1,this._backdrop.hide(function(){document.body.classList.remove(CLASS_NAME_OPEN),e._resetAdjustments(),e._scrollBar.reset(),EventHandler.trigger(e._element,EVENT_HIDDEN)})}},{key:"_isAnimated",value:function(){return this._element.classList.contains(CLASS_NAME_FADE)}},{key:"_triggerBackdropTransition",value:function(){var e,t,n=this;EventHandler.trigger(this._element,EVENT_HIDE_PREVENTED).defaultPrevented||(e=this._element.scrollHeight>document.documentElement.clientHeight,"hidden"===(t=this._element.style.overflowY))||this._element.classList.contains(CLASS_NAME_STATIC)||(e||(this._element.style.overflowY="hidden"),this._element.classList.add(CLASS_NAME_STATIC),this._queueCallback(function(){n._element.classList.remove(CLASS_NAME_STATIC),n._queueCallback(function(){n._element.style.overflowY=t},n._dialog)},this._dialog),this._element.focus())}},{key:"_adjustDialog",value:function(){var e,t=this._element.scrollHeight>document.documentElement.clientHeight,n=this._scrollBar.getWidth(),i=0<n;i&&!t&&(e=isRTL()?"paddingLeft":"paddingRight",this._element.style[e]="".concat(n,"px")),!i&&t&&(e=isRTL()?"paddingRight":"paddingLeft",this._element.style[e]="".concat(n,"px"))}},{key:"_resetAdjustments",value:function(){this._element.style.paddingLeft="",this._element.style.paddingRight=""}}],[{key:"Default",get:function(){return Default}},{key:"DefaultType",get:function(){return DefaultType}},{key:"NAME",get:function(){return NAME}},{key:"jQueryInterface",value:function(t,n){return this.each(function(){var e=i.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t])throw new TypeError('No method n
1amed "'.concat(t,'"'));e[t](n)}})}}])})();EventHandler.on(document,EVENT_CLICK_DATA_API,SELECTOR_DATA_TOGGLE,function(e){var t=this,n=SelectorEngine.getElementFromSelector(this),e=(["A","AREA"].includes(this.tagName)&&e.preventDefault(),EventHandler.one(n,EVENT_SHOW,function(e){e.defaultPrevented||EventHandler.one(n,EVENT_HIDDEN,function(){isVisible(t)&&t.focus()})}),SelectorEngine.findOne(OPEN_SELECTOR));e&&Modal.getInstance(e).hide(),Modal.getOrCreateInstance(n).toggle(this)}),enableDismissTrigger(Modal),defineJQueryPlugin(Modal);export default Modal; 2//# sourceMappingURL=modal.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.