| 
									
										
										
										
											2018-11-13 14:41:12 +08:00
										 |  |  | /*! | 
					
						
							| 
									
										
										
										
											2022-12-25 00:37:22 +08:00
										 |  |  |   * Bootstrap tooltip.js v5.3.0-alpha1 (https://getbootstrap.com/)
 | 
					
						
							| 
									
										
										
										
											2022-05-13 14:07:23 +08:00
										 |  |  |   * Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
 | 
					
						
							| 
									
										
										
										
											2020-06-17 02:50:01 +08:00
										 |  |  |   * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
 | 
					
						
							| 
									
										
										
										
											2018-11-13 14:41:12 +08:00
										 |  |  |   */ | 
					
						
							| 
									
										
										
										
											2018-07-24 08:51:14 +08:00
										 |  |  | (function (global, factory) { | 
					
						
							| 
									
										
										
										
											2022-12-25 00:37:22 +08:00
										 |  |  |   typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('@popperjs/core'), require('./util/index.js'), require('./util/sanitizer.js'), require('./dom/event-handler.js'), require('./dom/manipulator.js'), require('./base-component.js'), require('./util/template-factory.js')) : | 
					
						
							| 
									
										
										
										
											2022-05-13 14:07:23 +08:00
										 |  |  |   typeof define === 'function' && define.amd ? define(['@popperjs/core', './util/index', './util/sanitizer', './dom/event-handler', './dom/manipulator', './base-component', './util/template-factory'], factory) : | 
					
						
							|  |  |  |   (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Tooltip = factory(global["@popperjs/core"], global.Index, global.Sanitizer, global.EventHandler, global.Manipulator, global.BaseComponent, global.TemplateFactory)); | 
					
						
							| 
									
										
										
										
											2022-12-25 00:37:22 +08:00
										 |  |  | })(this, (function (Popper, index_js, sanitizer_js, EventHandler, Manipulator, BaseComponent, TemplateFactory) { 'use strict'; | 
					
						
							| 
									
										
										
										
											2019-03-02 00:31:34 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-12-25 00:37:22 +08:00
										 |  |  |   function _interopNamespaceDefault(e) { | 
					
						
							| 
									
										
										
										
											2022-05-13 14:07:23 +08:00
										 |  |  |     const n = Object.create(null, { [Symbol.toStringTag]: { value: 'Module' } }); | 
					
						
							| 
									
										
										
										
											2020-12-07 23:50:24 +08:00
										 |  |  |     if (e) { | 
					
						
							| 
									
										
										
										
											2021-10-05 23:50:18 +08:00
										 |  |  |       for (const k in e) { | 
					
						
							| 
									
										
										
										
											2020-12-07 23:50:24 +08:00
										 |  |  |         if (k !== 'default') { | 
					
						
							| 
									
										
										
										
											2021-10-05 23:50:18 +08:00
										 |  |  |           const d = Object.getOwnPropertyDescriptor(e, k); | 
					
						
							| 
									
										
										
										
											2020-12-07 23:50:24 +08:00
										 |  |  |           Object.defineProperty(n, k, d.get ? d : { | 
					
						
							|  |  |  |             enumerable: true, | 
					
						
							| 
									
										
										
										
											2021-10-05 23:50:18 +08:00
										 |  |  |             get: () => e[k] | 
					
						
							| 
									
										
										
										
											2020-12-07 23:50:24 +08:00
										 |  |  |           }); | 
					
						
							|  |  |  |         } | 
					
						
							| 
									
										
										
										
											2021-10-05 23:50:18 +08:00
										 |  |  |       } | 
					
						
							| 
									
										
										
										
											2020-12-07 23:50:24 +08:00
										 |  |  |     } | 
					
						
							| 
									
										
										
										
											2021-10-05 23:50:18 +08:00
										 |  |  |     n.default = e; | 
					
						
							| 
									
										
										
										
											2020-12-07 23:50:24 +08:00
										 |  |  |     return Object.freeze(n); | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-12-25 00:37:22 +08:00
										 |  |  |   const Popper__namespace = /*#__PURE__*/_interopNamespaceDefault(Popper); | 
					
						
							| 
									
										
										
										
											2021-02-11 00:14:51 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-02-14 00:01:40 +08:00
										 |  |  |   /** | 
					
						
							|  |  |  |    * -------------------------------------------------------------------------- | 
					
						
							| 
									
										
										
										
											2022-12-25 00:37:22 +08:00
										 |  |  |    * Bootstrap (v5.3.0-alpha1): tooltip.js | 
					
						
							| 
									
										
										
										
											2020-06-17 02:50:01 +08:00
										 |  |  |    * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
 | 
					
						
							| 
									
										
										
										
											2019-03-02 00:31:34 +08:00
										 |  |  |    * -------------------------------------------------------------------------- | 
					
						
							|  |  |  |    */ | 
					
						
							| 
									
										
										
										
											2022-12-25 00:37:22 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-03-02 00:31:34 +08:00
										 |  |  |   /** | 
					
						
							| 
									
										
										
										
											2020-12-03 22:18:59 +08:00
										 |  |  |    * Constants | 
					
						
							|  |  |  |    */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-03-24 00:26:54 +08:00
										 |  |  |   const NAME = 'tooltip'; | 
					
						
							|  |  |  |   const DISALLOWED_ATTRIBUTES = new Set(['sanitize', 'allowList', 'sanitizeFn']); | 
					
						
							| 
									
										
										
										
											2022-05-13 14:07:23 +08:00
										 |  |  |   const CLASS_NAME_FADE = 'fade'; | 
					
						
							|  |  |  |   const CLASS_NAME_MODAL = 'modal'; | 
					
						
							|  |  |  |   const CLASS_NAME_SHOW = 'show'; | 
					
						
							|  |  |  |   const SELECTOR_TOOLTIP_INNER = '.tooltip-inner'; | 
					
						
							|  |  |  |   const SELECTOR_MODAL = `.${CLASS_NAME_MODAL}`; | 
					
						
							|  |  |  |   const EVENT_MODAL_HIDE = 'hide.bs.modal'; | 
					
						
							|  |  |  |   const TRIGGER_HOVER = 'hover'; | 
					
						
							|  |  |  |   const TRIGGER_FOCUS = 'focus'; | 
					
						
							|  |  |  |   const TRIGGER_CLICK = 'click'; | 
					
						
							|  |  |  |   const TRIGGER_MANUAL = 'manual'; | 
					
						
							|  |  |  |   const EVENT_HIDE = 'hide'; | 
					
						
							|  |  |  |   const EVENT_HIDDEN = 'hidden'; | 
					
						
							|  |  |  |   const EVENT_SHOW = 'show'; | 
					
						
							|  |  |  |   const EVENT_SHOWN = 'shown'; | 
					
						
							|  |  |  |   const EVENT_INSERTED = 'inserted'; | 
					
						
							|  |  |  |   const EVENT_CLICK = 'click'; | 
					
						
							|  |  |  |   const EVENT_FOCUSIN = 'focusin'; | 
					
						
							|  |  |  |   const EVENT_FOCUSOUT = 'focusout'; | 
					
						
							|  |  |  |   const EVENT_MOUSEENTER = 'mouseenter'; | 
					
						
							|  |  |  |   const EVENT_MOUSELEAVE = 'mouseleave'; | 
					
						
							| 
									
										
										
										
											2021-03-24 00:26:54 +08:00
										 |  |  |   const AttachmentMap = { | 
					
						
							| 
									
										
										
										
											2018-11-13 14:41:12 +08:00
										 |  |  |     AUTO: 'auto', | 
					
						
							|  |  |  |     TOP: 'top', | 
					
						
							| 
									
										
										
										
											2022-12-25 00:37:22 +08:00
										 |  |  |     RIGHT: index_js.isRTL() ? 'left' : 'right', | 
					
						
							| 
									
										
										
										
											2018-11-13 14:41:12 +08:00
										 |  |  |     BOTTOM: 'bottom', | 
					
						
							| 
									
										
										
										
											2022-12-25 00:37:22 +08:00
										 |  |  |     LEFT: index_js.isRTL() ? 'right' : 'left' | 
					
						
							| 
									
										
										
										
											2018-11-13 14:41:12 +08:00
										 |  |  |   }; | 
					
						
							| 
									
										
										
										
											2021-03-24 00:26:54 +08:00
										 |  |  |   const Default = { | 
					
						
							| 
									
										
										
										
											2022-12-25 00:37:22 +08:00
										 |  |  |     allowList: sanitizer_js.DefaultAllowlist, | 
					
						
							| 
									
										
										
										
											2018-11-13 14:41:12 +08:00
										 |  |  |     animation: true, | 
					
						
							| 
									
										
										
										
											2022-07-19 23:43:58 +08:00
										 |  |  |     boundary: 'clippingParents', | 
					
						
							|  |  |  |     container: false, | 
					
						
							|  |  |  |     customClass: '', | 
					
						
							| 
									
										
										
										
											2018-11-13 14:41:12 +08:00
										 |  |  |     delay: 0, | 
					
						
							| 
									
										
										
										
											2022-07-19 23:43:58 +08:00
										 |  |  |     fallbackPlacements: ['top', 'right', 'bottom', 'left'], | 
					
						
							| 
									
										
										
										
											2018-11-13 14:41:12 +08:00
										 |  |  |     html: false, | 
					
						
							| 
									
										
										
										
											2021-02-11 00:14:51 +08:00
										 |  |  |     offset: [0, 0], | 
					
						
							| 
									
										
										
										
											2022-07-19 23:43:58 +08:00
										 |  |  |     placement: 'top', | 
					
						
							|  |  |  |     popperConfig: null, | 
					
						
							| 
									
										
										
										
											2019-02-14 00:01:40 +08:00
										 |  |  |     sanitize: true, | 
					
						
							|  |  |  |     sanitizeFn: null, | 
					
						
							| 
									
										
										
										
											2022-07-19 23:43:58 +08:00
										 |  |  |     selector: false, | 
					
						
							|  |  |  |     template: '<div class="tooltip" role="tooltip">' + '<div class="tooltip-arrow"></div>' + '<div class="tooltip-inner"></div>' + '</div>', | 
					
						
							|  |  |  |     title: '', | 
					
						
							|  |  |  |     trigger: 'hover focus' | 
					
						
							| 
									
										
										
										
											2018-11-13 14:41:12 +08:00
										 |  |  |   }; | 
					
						
							| 
									
										
										
										
											2022-05-13 14:07:23 +08:00
										 |  |  |   const DefaultType = { | 
					
						
							| 
									
										
										
										
											2022-07-19 23:43:58 +08:00
										 |  |  |     allowList: 'object', | 
					
						
							| 
									
										
										
										
											2022-05-13 14:07:23 +08:00
										 |  |  |     animation: 'boolean', | 
					
						
							| 
									
										
										
										
											2022-07-19 23:43:58 +08:00
										 |  |  |     boundary: '(string|element)', | 
					
						
							|  |  |  |     container: '(string|element|boolean)', | 
					
						
							|  |  |  |     customClass: '(string|function)', | 
					
						
							| 
									
										
										
										
											2022-05-13 14:07:23 +08:00
										 |  |  |     delay: '(number|object)', | 
					
						
							| 
									
										
										
										
											2022-07-19 23:43:58 +08:00
										 |  |  |     fallbackPlacements: 'array', | 
					
						
							| 
									
										
										
										
											2022-05-13 14:07:23 +08:00
										 |  |  |     html: 'boolean', | 
					
						
							|  |  |  |     offset: '(array|string|function)', | 
					
						
							| 
									
										
										
										
											2022-07-19 23:43:58 +08:00
										 |  |  |     placement: '(string|function)', | 
					
						
							|  |  |  |     popperConfig: '(null|object|function)', | 
					
						
							| 
									
										
										
										
											2022-05-13 14:07:23 +08:00
										 |  |  |     sanitize: 'boolean', | 
					
						
							|  |  |  |     sanitizeFn: '(null|function)', | 
					
						
							| 
									
										
										
										
											2022-07-19 23:43:58 +08:00
										 |  |  |     selector: '(string|boolean)', | 
					
						
							|  |  |  |     template: 'string', | 
					
						
							|  |  |  |     title: '(string|element|function)', | 
					
						
							|  |  |  |     trigger: 'string' | 
					
						
							| 
									
										
										
										
											2018-11-13 14:41:12 +08:00
										 |  |  |   }; | 
					
						
							| 
									
										
										
										
											2022-12-25 00:37:22 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-10-08 14:39:10 +08:00
										 |  |  |   /** | 
					
						
							| 
									
										
										
										
											2022-05-13 14:07:23 +08:00
										 |  |  |    * Class definition | 
					
						
							| 
									
										
										
										
											2019-10-08 14:39:10 +08:00
										 |  |  |    */ | 
					
						
							| 
									
										
										
										
											2018-11-13 14:41:12 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-12-25 00:37:22 +08:00
										 |  |  |   class Tooltip extends BaseComponent { | 
					
						
							| 
									
										
										
										
											2021-03-24 00:26:54 +08:00
										 |  |  |     constructor(element, config) { | 
					
						
							| 
									
										
										
										
											2020-12-07 23:50:24 +08:00
										 |  |  |       if (typeof Popper__namespace === 'undefined') { | 
					
						
							| 
									
										
										
										
											2020-11-23 21:17:16 +08:00
										 |  |  |         throw new TypeError('Bootstrap\'s tooltips require Popper (https://popper.js.org)'); | 
					
						
							| 
									
										
										
										
											2020-12-03 22:18:59 +08:00
										 |  |  |       } | 
					
						
							| 
									
										
										
										
											2022-12-25 00:37:22 +08:00
										 |  |  |       super(element, config); | 
					
						
							| 
									
										
										
										
											2017-10-30 07:19:14 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-12-25 00:37:22 +08:00
										 |  |  |       // Private
 | 
					
						
							| 
									
										
										
										
											2021-03-24 00:26:54 +08:00
										 |  |  |       this._isEnabled = true; | 
					
						
							|  |  |  |       this._timeout = 0; | 
					
						
							| 
									
										
										
										
											2022-09-07 23:31:39 +08:00
										 |  |  |       this._isHovered = null; | 
					
						
							| 
									
										
										
										
											2021-03-24 00:26:54 +08:00
										 |  |  |       this._activeTrigger = {}; | 
					
						
							| 
									
										
										
										
											2022-05-13 14:07:23 +08:00
										 |  |  |       this._popper = null; | 
					
						
							| 
									
										
										
										
											2022-07-19 23:43:58 +08:00
										 |  |  |       this._templateFactory = null; | 
					
						
							| 
									
										
										
										
											2022-12-25 00:37:22 +08:00
										 |  |  |       this._newContent = null; | 
					
						
							| 
									
										
										
										
											2015-05-12 14:32:37 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-12-25 00:37:22 +08:00
										 |  |  |       // Protected
 | 
					
						
							| 
									
										
										
										
											2021-03-24 00:26:54 +08:00
										 |  |  |       this.tip = null; | 
					
						
							|  |  |  |       this._setListeners(); | 
					
						
							| 
									
										
										
										
											2022-10-03 15:44:02 +08:00
										 |  |  |       if (!this._config.selector) { | 
					
						
							|  |  |  |         this._fixTitle(); | 
					
						
							|  |  |  |       } | 
					
						
							| 
									
										
										
										
											2022-12-25 00:37:22 +08:00
										 |  |  |     } | 
					
						
							| 
									
										
										
										
											2015-08-13 12:12:03 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-12-25 00:37:22 +08:00
										 |  |  |     // Getters
 | 
					
						
							| 
									
										
										
										
											2021-03-24 00:26:54 +08:00
										 |  |  |     static get Default() { | 
					
						
							|  |  |  |       return Default; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     static get DefaultType() { | 
					
						
							|  |  |  |       return DefaultType; | 
					
						
							| 
									
										
										
										
											2022-05-13 14:07:23 +08:00
										 |  |  |     } | 
					
						
							|  |  |  |     static get NAME() { | 
					
						
							|  |  |  |       return NAME; | 
					
						
							| 
									
										
										
										
											2022-12-25 00:37:22 +08:00
										 |  |  |     } | 
					
						
							| 
									
										
										
										
											2021-03-24 00:26:54 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-12-25 00:37:22 +08:00
										 |  |  |     // Public
 | 
					
						
							| 
									
										
										
										
											2021-03-24 00:26:54 +08:00
										 |  |  |     enable() { | 
					
						
							| 
									
										
										
										
											2018-11-13 14:41:12 +08:00
										 |  |  |       this._isEnabled = true; | 
					
						
							| 
									
										
										
										
											2021-03-24 00:26:54 +08:00
										 |  |  |     } | 
					
						
							|  |  |  |     disable() { | 
					
						
							| 
									
										
										
										
											2018-11-13 14:41:12 +08:00
										 |  |  |       this._isEnabled = false; | 
					
						
							| 
									
										
										
										
											2021-03-24 00:26:54 +08:00
										 |  |  |     } | 
					
						
							|  |  |  |     toggleEnabled() { | 
					
						
							| 
									
										
										
										
											2018-11-13 14:41:12 +08:00
										 |  |  |       this._isEnabled = !this._isEnabled; | 
					
						
							| 
									
										
										
										
											2021-03-24 00:26:54 +08:00
										 |  |  |     } | 
					
						
							| 
									
										
										
										
											2022-10-03 15:44:02 +08:00
										 |  |  |     toggle() { | 
					
						
							| 
									
										
										
										
											2018-11-13 14:41:12 +08:00
										 |  |  |       if (!this._isEnabled) { | 
					
						
							|  |  |  |         return; | 
					
						
							|  |  |  |       } | 
					
						
							| 
									
										
										
										
											2022-10-03 15:44:02 +08:00
										 |  |  |       this._activeTrigger.click = !this._activeTrigger.click; | 
					
						
							| 
									
										
										
										
											2022-05-13 14:07:23 +08:00
										 |  |  |       if (this._isShown()) { | 
					
						
							|  |  |  |         this._leave(); | 
					
						
							|  |  |  |         return; | 
					
						
							| 
									
										
										
										
											2018-11-13 14:41:12 +08:00
										 |  |  |       } | 
					
						
							| 
									
										
										
										
											2022-05-13 14:07:23 +08:00
										 |  |  |       this._enter(); | 
					
						
							| 
									
										
										
										
											2021-03-24 00:26:54 +08:00
										 |  |  |     } | 
					
						
							|  |  |  |     dispose() { | 
					
						
							| 
									
										
										
										
											2018-11-13 14:41:12 +08:00
										 |  |  |       clearTimeout(this._timeout); | 
					
						
							| 
									
										
										
										
											2022-12-25 00:37:22 +08:00
										 |  |  |       EventHandler.off(this._element.closest(SELECTOR_MODAL), EVENT_MODAL_HIDE, this._hideModalHandler); | 
					
						
							| 
									
										
										
										
											2022-10-03 15:44:02 +08:00
										 |  |  |       if (this._element.getAttribute('data-bs-original-title')) { | 
					
						
							|  |  |  |         this._element.setAttribute('title', this._element.getAttribute('data-bs-original-title')); | 
					
						
							| 
									
										
										
										
											2022-09-07 23:31:39 +08:00
										 |  |  |       } | 
					
						
							| 
									
										
										
										
											2021-09-07 23:37:44 +08:00
										 |  |  |       this._disposePopper(); | 
					
						
							| 
									
										
										
										
											2021-03-24 00:26:54 +08:00
										 |  |  |       super.dispose(); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     show() { | 
					
						
							| 
									
										
										
										
											2020-12-03 22:18:59 +08:00
										 |  |  |       if (this._element.style.display === 'none') { | 
					
						
							| 
									
										
										
										
											2018-11-13 14:41:12 +08:00
										 |  |  |         throw new Error('Please use show on visible elements'); | 
					
						
							|  |  |  |       } | 
					
						
							| 
									
										
										
										
											2022-05-13 14:07:23 +08:00
										 |  |  |       if (!(this._isWithContent() && this._isEnabled)) { | 
					
						
							| 
									
										
										
										
											2021-02-11 00:14:51 +08:00
										 |  |  |         return; | 
					
						
							|  |  |  |       } | 
					
						
							| 
									
										
										
										
											2022-12-25 00:37:22 +08:00
										 |  |  |       const showEvent = EventHandler.trigger(this._element, this.constructor.eventName(EVENT_SHOW)); | 
					
						
							|  |  |  |       const shadowRoot = index_js.findShadowRoot(this._element); | 
					
						
							| 
									
										
										
										
											2022-05-13 14:07:23 +08:00
										 |  |  |       const isInTheDom = (shadowRoot || this._element.ownerDocument.documentElement).contains(this._element); | 
					
						
							| 
									
										
										
										
											2021-02-11 00:14:51 +08:00
										 |  |  |       if (showEvent.defaultPrevented || !isInTheDom) { | 
					
						
							|  |  |  |         return; | 
					
						
							| 
									
										
										
										
											2022-12-25 00:37:22 +08:00
										 |  |  |       } | 
					
						
							| 
									
										
										
										
											2022-07-19 23:43:58 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-12-25 00:37:22 +08:00
										 |  |  |       // todo v6 remove this OR make it optional
 | 
					
						
							| 
									
										
										
										
											2022-11-22 02:19:01 +08:00
										 |  |  |       this._disposePopper(); | 
					
						
							| 
									
										
										
										
											2022-05-13 14:07:23 +08:00
										 |  |  |       const tip = this._getTipElement(); | 
					
						
							|  |  |  |       this._element.setAttribute('aria-describedby', tip.getAttribute('id')); | 
					
						
							| 
									
										
										
										
											2021-05-14 00:22:20 +08:00
										 |  |  |       const { | 
					
						
							|  |  |  |         container | 
					
						
							|  |  |  |       } = this._config; | 
					
						
							| 
									
										
										
										
											2021-02-11 00:14:51 +08:00
										 |  |  |       if (!this._element.ownerDocument.documentElement.contains(this.tip)) { | 
					
						
							| 
									
										
										
										
											2021-08-04 23:41:51 +08:00
										 |  |  |         container.append(tip); | 
					
						
							| 
									
										
										
										
											2022-12-25 00:37:22 +08:00
										 |  |  |         EventHandler.trigger(this._element, this.constructor.eventName(EVENT_INSERTED)); | 
					
						
							| 
									
										
										
										
											2021-03-24 00:26:54 +08:00
										 |  |  |       } | 
					
						
							| 
									
										
										
										
											2022-11-22 02:19:01 +08:00
										 |  |  |       this._popper = this._createPopper(tip); | 
					
						
							| 
									
										
										
										
											2022-12-25 00:37:22 +08:00
										 |  |  |       tip.classList.add(CLASS_NAME_SHOW); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |       // If this is a touch-enabled device we add extra
 | 
					
						
							| 
									
										
										
										
											2021-02-11 00:14:51 +08:00
										 |  |  |       // empty mouseover listeners to the body's immediate children;
 | 
					
						
							|  |  |  |       // only needed because of broken event delegation on iOS
 | 
					
						
							|  |  |  |       // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html
 | 
					
						
							|  |  |  |       if ('ontouchstart' in document.documentElement) { | 
					
						
							| 
									
										
										
										
											2022-05-13 14:07:23 +08:00
										 |  |  |         for (const element of [].concat(...document.body.children)) { | 
					
						
							| 
									
										
										
										
											2022-12-25 00:37:22 +08:00
										 |  |  |           EventHandler.on(element, 'mouseover', index_js.noop); | 
					
						
							| 
									
										
										
										
											2022-05-13 14:07:23 +08:00
										 |  |  |         } | 
					
						
							| 
									
										
										
										
											2021-02-11 00:14:51 +08:00
										 |  |  |       } | 
					
						
							| 
									
										
										
										
											2021-03-24 00:26:54 +08:00
										 |  |  |       const complete = () => { | 
					
						
							| 
									
										
										
										
											2022-12-25 00:37:22 +08:00
										 |  |  |         EventHandler.trigger(this._element, this.constructor.eventName(EVENT_SHOWN)); | 
					
						
							| 
									
										
										
										
											2022-09-07 23:31:39 +08:00
										 |  |  |         if (this._isHovered === false) { | 
					
						
							| 
									
										
										
										
											2022-05-13 14:07:23 +08:00
										 |  |  |           this._leave(); | 
					
						
							| 
									
										
										
										
											2015-05-12 14:32:37 +08:00
										 |  |  |         } | 
					
						
							| 
									
										
										
										
											2022-09-07 23:31:39 +08:00
										 |  |  |         this._isHovered = false; | 
					
						
							| 
									
										
										
										
											2021-02-11 00:14:51 +08:00
										 |  |  |       }; | 
					
						
							| 
									
										
										
										
											2022-05-13 14:07:23 +08:00
										 |  |  |       this._queueCallback(complete, this.tip, this._isAnimated()); | 
					
						
							| 
									
										
										
										
											2021-03-24 00:26:54 +08:00
										 |  |  |     } | 
					
						
							|  |  |  |     hide() { | 
					
						
							| 
									
										
										
										
											2022-05-13 14:07:23 +08:00
										 |  |  |       if (!this._isShown()) { | 
					
						
							| 
									
										
										
										
											2020-09-29 23:33:00 +08:00
										 |  |  |         return; | 
					
						
							|  |  |  |       } | 
					
						
							| 
									
										
										
										
											2022-12-25 00:37:22 +08:00
										 |  |  |       const hideEvent = EventHandler.trigger(this._element, this.constructor.eventName(EVENT_HIDE)); | 
					
						
							| 
									
										
										
										
											2019-03-02 00:31:34 +08:00
										 |  |  |       if (hideEvent.defaultPrevented) { | 
					
						
							| 
									
										
										
										
											2018-11-13 14:41:12 +08:00
										 |  |  |         return; | 
					
						
							|  |  |  |       } | 
					
						
							| 
									
										
										
										
											2022-05-13 14:07:23 +08:00
										 |  |  |       const tip = this._getTipElement(); | 
					
						
							| 
									
										
										
										
											2022-12-25 00:37:22 +08:00
										 |  |  |       tip.classList.remove(CLASS_NAME_SHOW); | 
					
						
							| 
									
										
										
										
											2022-05-13 14:07:23 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-12-25 00:37:22 +08:00
										 |  |  |       // If this is a touch-enabled device we remove the extra
 | 
					
						
							| 
									
										
										
										
											2018-11-13 14:41:12 +08:00
										 |  |  |       // empty mouseover listeners we added for iOS support
 | 
					
						
							|  |  |  |       if ('ontouchstart' in document.documentElement) { | 
					
						
							| 
									
										
										
										
											2022-05-13 14:07:23 +08:00
										 |  |  |         for (const element of [].concat(...document.body.children)) { | 
					
						
							| 
									
										
										
										
											2022-12-25 00:37:22 +08:00
										 |  |  |           EventHandler.off(element, 'mouseover', index_js.noop); | 
					
						
							| 
									
										
										
										
											2022-05-13 14:07:23 +08:00
										 |  |  |         } | 
					
						
							| 
									
										
										
										
											2018-11-13 14:41:12 +08:00
										 |  |  |       } | 
					
						
							| 
									
										
										
										
											2020-03-28 18:29:08 +08:00
										 |  |  |       this._activeTrigger[TRIGGER_CLICK] = false; | 
					
						
							|  |  |  |       this._activeTrigger[TRIGGER_FOCUS] = false; | 
					
						
							|  |  |  |       this._activeTrigger[TRIGGER_HOVER] = false; | 
					
						
							| 
									
										
										
										
											2022-09-07 23:31:39 +08:00
										 |  |  |       this._isHovered = null; // it is a trick to support manual triggering
 | 
					
						
							| 
									
										
										
										
											2017-10-01 05:28:03 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-05-13 14:07:23 +08:00
										 |  |  |       const complete = () => { | 
					
						
							|  |  |  |         if (this._isWithActiveTrigger()) { | 
					
						
							|  |  |  |           return; | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |         if (!this._isHovered) { | 
					
						
							| 
									
										
										
										
											2022-11-22 02:19:01 +08:00
										 |  |  |           this._disposePopper(); | 
					
						
							| 
									
										
										
										
											2022-05-13 14:07:23 +08:00
										 |  |  |         } | 
					
						
							|  |  |  |         this._element.removeAttribute('aria-describedby'); | 
					
						
							| 
									
										
										
										
											2022-12-25 00:37:22 +08:00
										 |  |  |         EventHandler.trigger(this._element, this.constructor.eventName(EVENT_HIDDEN)); | 
					
						
							| 
									
										
										
										
											2022-05-13 14:07:23 +08:00
										 |  |  |       }; | 
					
						
							|  |  |  |       this._queueCallback(complete, this.tip, this._isAnimated()); | 
					
						
							| 
									
										
										
										
											2021-03-24 00:26:54 +08:00
										 |  |  |     } | 
					
						
							|  |  |  |     update() { | 
					
						
							| 
									
										
										
										
											2022-05-13 14:07:23 +08:00
										 |  |  |       if (this._popper) { | 
					
						
							| 
									
										
										
										
											2020-12-07 23:50:24 +08:00
										 |  |  |         this._popper.update(); | 
					
						
							| 
									
										
										
										
											2018-11-13 14:41:12 +08:00
										 |  |  |       } | 
					
						
							| 
									
										
										
										
											2022-12-25 00:37:22 +08:00
										 |  |  |     } | 
					
						
							| 
									
										
										
										
											2021-03-24 00:26:54 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-12-25 00:37:22 +08:00
										 |  |  |     // Protected
 | 
					
						
							| 
									
										
										
										
											2022-05-13 14:07:23 +08:00
										 |  |  |     _isWithContent() { | 
					
						
							|  |  |  |       return Boolean(this._getTitle()); | 
					
						
							| 
									
										
										
										
											2021-03-24 00:26:54 +08:00
										 |  |  |     } | 
					
						
							| 
									
										
										
										
											2022-05-13 14:07:23 +08:00
										 |  |  |     _getTipElement() { | 
					
						
							|  |  |  |       if (!this.tip) { | 
					
						
							| 
									
										
										
										
											2022-07-19 23:43:58 +08:00
										 |  |  |         this.tip = this._createTipElement(this._newContent || this._getContentForTemplate()); | 
					
						
							| 
									
										
										
										
											2019-03-02 00:31:34 +08:00
										 |  |  |       } | 
					
						
							| 
									
										
										
										
											2018-11-13 14:41:12 +08:00
										 |  |  |       return this.tip; | 
					
						
							| 
									
										
										
										
											2021-03-24 00:26:54 +08:00
										 |  |  |     } | 
					
						
							| 
									
										
										
										
											2022-05-13 14:07:23 +08:00
										 |  |  |     _createTipElement(content) { | 
					
						
							| 
									
										
										
										
											2022-12-25 00:37:22 +08:00
										 |  |  |       const tip = this._getTemplateFactory(content).toHtml(); | 
					
						
							| 
									
										
										
										
											2021-08-04 23:41:51 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-12-25 00:37:22 +08:00
										 |  |  |       // todo: remove this check on v6
 | 
					
						
							| 
									
										
										
										
											2022-05-13 14:07:23 +08:00
										 |  |  |       if (!tip) { | 
					
						
							|  |  |  |         return null; | 
					
						
							|  |  |  |       } | 
					
						
							| 
									
										
										
										
											2022-12-25 00:37:22 +08:00
										 |  |  |       tip.classList.remove(CLASS_NAME_FADE, CLASS_NAME_SHOW); | 
					
						
							|  |  |  |       // todo: on v6 the following can be achieved with CSS only
 | 
					
						
							| 
									
										
										
										
											2022-05-13 14:07:23 +08:00
										 |  |  |       tip.classList.add(`bs-${this.constructor.NAME}-auto`); | 
					
						
							| 
									
										
										
										
											2022-12-25 00:37:22 +08:00
										 |  |  |       const tipId = index_js.getUID(this.constructor.NAME).toString(); | 
					
						
							| 
									
										
										
										
											2022-05-13 14:07:23 +08:00
										 |  |  |       tip.setAttribute('id', tipId); | 
					
						
							|  |  |  |       if (this._isAnimated()) { | 
					
						
							|  |  |  |         tip.classList.add(CLASS_NAME_FADE); | 
					
						
							| 
									
										
										
										
											2019-03-02 00:31:34 +08:00
										 |  |  |       } | 
					
						
							| 
									
										
										
										
											2022-05-13 14:07:23 +08:00
										 |  |  |       return tip; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     setContent(content) { | 
					
						
							| 
									
										
										
										
											2022-07-19 23:43:58 +08:00
										 |  |  |       this._newContent = content; | 
					
						
							|  |  |  |       if (this._isShown()) { | 
					
						
							|  |  |  |         this._disposePopper(); | 
					
						
							| 
									
										
										
										
											2022-05-13 14:07:23 +08:00
										 |  |  |         this.show(); | 
					
						
							| 
									
										
										
										
											2018-11-13 14:41:12 +08:00
										 |  |  |       } | 
					
						
							| 
									
										
										
										
											2021-03-24 00:26:54 +08:00
										 |  |  |     } | 
					
						
							| 
									
										
										
										
											2022-05-13 14:07:23 +08:00
										 |  |  |     _getTemplateFactory(content) { | 
					
						
							|  |  |  |       if (this._templateFactory) { | 
					
						
							|  |  |  |         this._templateFactory.changeContent(content); | 
					
						
							|  |  |  |       } else { | 
					
						
							| 
									
										
										
										
											2022-12-25 00:37:22 +08:00
										 |  |  |         this._templateFactory = new TemplateFactory({ | 
					
						
							|  |  |  |           ...this._config, | 
					
						
							| 
									
										
										
										
											2022-05-13 14:07:23 +08:00
										 |  |  |           // the `content` var has to be after `this._config`
 | 
					
						
							|  |  |  |           // to override config.content in case of popover
 | 
					
						
							|  |  |  |           content, | 
					
						
							|  |  |  |           extraClass: this._resolvePossibleFunction(this._config.customClass) | 
					
						
							|  |  |  |         }); | 
					
						
							|  |  |  |       } | 
					
						
							|  |  |  |       return this._templateFactory; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     _getContentForTemplate() { | 
					
						
							|  |  |  |       return { | 
					
						
							|  |  |  |         [SELECTOR_TOOLTIP_INNER]: this._getTitle() | 
					
						
							|  |  |  |       }; | 
					
						
							| 
									
										
										
										
											2021-03-24 00:26:54 +08:00
										 |  |  |     } | 
					
						
							| 
									
										
										
										
											2022-05-13 14:07:23 +08:00
										 |  |  |     _getTitle() { | 
					
						
							| 
									
										
										
										
											2022-10-03 15:44:02 +08:00
										 |  |  |       return this._resolvePossibleFunction(this._config.title) || this._element.getAttribute('data-bs-original-title'); | 
					
						
							| 
									
										
										
										
											2022-12-25 00:37:22 +08:00
										 |  |  |     } | 
					
						
							| 
									
										
										
										
											2020-12-03 21:08:31 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-12-25 00:37:22 +08:00
										 |  |  |     // Private
 | 
					
						
							| 
									
										
										
										
											2022-05-13 14:07:23 +08:00
										 |  |  |     _initializeOnDelegatedTarget(event) { | 
					
						
							|  |  |  |       return this.constructor.getOrCreateInstance(event.delegateTarget, this._getDelegateConfig()); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     _isAnimated() { | 
					
						
							|  |  |  |       return this._config.animation || this.tip && this.tip.classList.contains(CLASS_NAME_FADE); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     _isShown() { | 
					
						
							|  |  |  |       return this.tip && this.tip.classList.contains(CLASS_NAME_SHOW); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     _createPopper(tip) { | 
					
						
							| 
									
										
										
										
											2022-12-25 00:37:22 +08:00
										 |  |  |       const placement = index_js.execute(this._config.placement, [this, tip, this._element]); | 
					
						
							| 
									
										
										
										
											2022-05-13 14:07:23 +08:00
										 |  |  |       const attachment = AttachmentMap[placement.toUpperCase()]; | 
					
						
							| 
									
										
										
										
											2022-07-19 23:43:58 +08:00
										 |  |  |       return Popper__namespace.createPopper(this._element, tip, this._getPopperConfig(attachment)); | 
					
						
							| 
									
										
										
										
											2021-03-24 00:26:54 +08:00
										 |  |  |     } | 
					
						
							|  |  |  |     _getOffset() { | 
					
						
							|  |  |  |       const { | 
					
						
							|  |  |  |         offset | 
					
						
							| 
									
										
										
										
											2021-05-14 00:22:20 +08:00
										 |  |  |       } = this._config; | 
					
						
							| 
									
										
										
										
											2021-02-11 00:14:51 +08:00
										 |  |  |       if (typeof offset === 'string') { | 
					
						
							| 
									
										
										
										
											2022-05-13 14:07:23 +08:00
										 |  |  |         return offset.split(',').map(value => Number.parseInt(value, 10)); | 
					
						
							| 
									
										
										
										
											2020-12-07 23:50:24 +08:00
										 |  |  |       } | 
					
						
							| 
									
										
										
										
											2021-02-11 00:14:51 +08:00
										 |  |  |       if (typeof offset === 'function') { | 
					
						
							| 
									
										
										
										
											2021-03-24 00:26:54 +08:00
										 |  |  |         return popperData => offset(popperData, this._element); | 
					
						
							| 
									
										
										
										
											2021-02-11 00:14:51 +08:00
										 |  |  |       } | 
					
						
							|  |  |  |       return offset; | 
					
						
							| 
									
										
										
										
											2021-03-24 00:26:54 +08:00
										 |  |  |     } | 
					
						
							| 
									
										
										
										
											2022-05-13 14:07:23 +08:00
										 |  |  |     _resolvePossibleFunction(arg) { | 
					
						
							| 
									
										
										
										
											2022-12-25 00:37:22 +08:00
										 |  |  |       return index_js.execute(arg, [this._element]); | 
					
						
							| 
									
										
										
										
											2021-08-04 23:41:51 +08:00
										 |  |  |     } | 
					
						
							| 
									
										
										
										
											2021-03-24 00:26:54 +08:00
										 |  |  |     _getPopperConfig(attachment) { | 
					
						
							|  |  |  |       const defaultBsPopperConfig = { | 
					
						
							| 
									
										
										
										
											2019-08-27 21:03:21 +08:00
										 |  |  |         placement: attachment, | 
					
						
							| 
									
										
										
										
											2021-02-11 00:14:51 +08:00
										 |  |  |         modifiers: [{ | 
					
						
							|  |  |  |           name: 'flip', | 
					
						
							|  |  |  |           options: { | 
					
						
							| 
									
										
										
										
											2021-05-14 00:22:20 +08:00
										 |  |  |             fallbackPlacements: this._config.fallbackPlacements | 
					
						
							| 
									
										
										
										
											2021-02-11 00:14:51 +08:00
										 |  |  |           } | 
					
						
							|  |  |  |         }, { | 
					
						
							|  |  |  |           name: 'offset', | 
					
						
							|  |  |  |           options: { | 
					
						
							|  |  |  |             offset: this._getOffset() | 
					
						
							|  |  |  |           } | 
					
						
							|  |  |  |         }, { | 
					
						
							| 
									
										
										
										
											2020-12-07 23:50:24 +08:00
										 |  |  |           name: 'preventOverflow', | 
					
						
							|  |  |  |           options: { | 
					
						
							| 
									
										
										
										
											2021-05-14 00:22:20 +08:00
										 |  |  |             boundary: this._config.boundary | 
					
						
							| 
									
										
										
										
											2020-12-07 23:50:24 +08:00
										 |  |  |           } | 
					
						
							|  |  |  |         }, { | 
					
						
							|  |  |  |           name: 'arrow', | 
					
						
							|  |  |  |           options: { | 
					
						
							| 
									
										
										
										
											2021-03-24 00:26:54 +08:00
										 |  |  |             element: `.${this.constructor.NAME}-arrow` | 
					
						
							| 
									
										
										
										
											2019-08-27 21:03:21 +08:00
										 |  |  |           } | 
					
						
							| 
									
										
										
										
											2020-12-07 23:50:24 +08:00
										 |  |  |         }, { | 
					
						
							| 
									
										
										
										
											2022-05-13 14:07:23 +08:00
										 |  |  |           name: 'preSetPlacement', | 
					
						
							| 
									
										
										
										
											2020-12-07 23:50:24 +08:00
										 |  |  |           enabled: true, | 
					
						
							| 
									
										
										
										
											2022-05-13 14:07:23 +08:00
										 |  |  |           phase: 'beforeMain', | 
					
						
							|  |  |  |           fn: data => { | 
					
						
							|  |  |  |             // Pre-set Popper's placement attribute in order to read the arrow sizes properly.
 | 
					
						
							|  |  |  |             // Otherwise, Popper mixes up the width and height dimensions since the initial arrow style is for top placement
 | 
					
						
							|  |  |  |             this._getTipElement().setAttribute('data-popper-placement', data.state.placement); | 
					
						
							| 
									
										
										
										
											2019-08-27 21:03:21 +08:00
										 |  |  |           } | 
					
						
							| 
									
										
										
										
											2022-05-13 14:07:23 +08:00
										 |  |  |         }] | 
					
						
							| 
									
										
										
										
											2019-08-27 21:03:21 +08:00
										 |  |  |       }; | 
					
						
							| 
									
										
										
										
											2022-12-25 00:37:22 +08:00
										 |  |  |       return { | 
					
						
							|  |  |  |         ...defaultBsPopperConfig, | 
					
						
							|  |  |  |         ...index_js.execute(this._config.popperConfig, [defaultBsPopperConfig]) | 
					
						
							| 
									
										
										
										
											2021-03-24 00:26:54 +08:00
										 |  |  |       }; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     _setListeners() { | 
					
						
							| 
									
										
										
										
											2021-05-14 00:22:20 +08:00
										 |  |  |       const triggers = this._config.trigger.split(' '); | 
					
						
							| 
									
										
										
										
											2022-05-13 14:07:23 +08:00
										 |  |  |       for (const trigger of triggers) { | 
					
						
							| 
									
										
										
										
											2018-11-13 14:41:12 +08:00
										 |  |  |         if (trigger === 'click') { | 
					
						
							| 
									
										
										
										
											2022-12-25 00:37:22 +08:00
										 |  |  |           EventHandler.on(this._element, this.constructor.eventName(EVENT_CLICK), this._config.selector, event => { | 
					
						
							| 
									
										
										
										
											2022-10-03 15:44:02 +08:00
										 |  |  |             const context = this._initializeOnDelegatedTarget(event); | 
					
						
							|  |  |  |             context.toggle(); | 
					
						
							|  |  |  |           }); | 
					
						
							| 
									
										
										
										
											2020-03-28 18:29:08 +08:00
										 |  |  |         } else if (trigger !== TRIGGER_MANUAL) { | 
					
						
							| 
									
										
										
										
											2022-05-13 14:07:23 +08:00
										 |  |  |           const eventIn = trigger === TRIGGER_HOVER ? this.constructor.eventName(EVENT_MOUSEENTER) : this.constructor.eventName(EVENT_FOCUSIN); | 
					
						
							|  |  |  |           const eventOut = trigger === TRIGGER_HOVER ? this.constructor.eventName(EVENT_MOUSELEAVE) : this.constructor.eventName(EVENT_FOCUSOUT); | 
					
						
							| 
									
										
										
										
											2022-12-25 00:37:22 +08:00
										 |  |  |           EventHandler.on(this._element, eventIn, this._config.selector, event => { | 
					
						
							| 
									
										
										
										
											2022-05-13 14:07:23 +08:00
										 |  |  |             const context = this._initializeOnDelegatedTarget(event); | 
					
						
							|  |  |  |             context._activeTrigger[event.type === 'focusin' ? TRIGGER_FOCUS : TRIGGER_HOVER] = true; | 
					
						
							|  |  |  |             context._enter(); | 
					
						
							|  |  |  |           }); | 
					
						
							| 
									
										
										
										
											2022-12-25 00:37:22 +08:00
										 |  |  |           EventHandler.on(this._element, eventOut, this._config.selector, event => { | 
					
						
							| 
									
										
										
										
											2022-05-13 14:07:23 +08:00
										 |  |  |             const context = this._initializeOnDelegatedTarget(event); | 
					
						
							|  |  |  |             context._activeTrigger[event.type === 'focusout' ? TRIGGER_FOCUS : TRIGGER_HOVER] = context._element.contains(event.relatedTarget); | 
					
						
							|  |  |  |             context._leave(); | 
					
						
							|  |  |  |           }); | 
					
						
							| 
									
										
										
										
											2017-09-06 12:05:12 +08:00
										 |  |  |         } | 
					
						
							| 
									
										
										
										
											2022-05-13 14:07:23 +08:00
										 |  |  |       } | 
					
						
							| 
									
										
										
										
											2021-03-24 00:26:54 +08:00
										 |  |  |       this._hideModalHandler = () => { | 
					
						
							|  |  |  |         if (this._element) { | 
					
						
							|  |  |  |           this.hide(); | 
					
						
							| 
									
										
										
										
											2018-11-13 14:41:12 +08:00
										 |  |  |         } | 
					
						
							| 
									
										
										
										
											2019-07-13 05:56:26 +08:00
										 |  |  |       }; | 
					
						
							| 
									
										
										
										
											2022-12-25 00:37:22 +08:00
										 |  |  |       EventHandler.on(this._element.closest(SELECTOR_MODAL), EVENT_MODAL_HIDE, this._hideModalHandler); | 
					
						
							| 
									
										
										
										
											2021-03-24 00:26:54 +08:00
										 |  |  |     } | 
					
						
							|  |  |  |     _fixTitle() { | 
					
						
							| 
									
										
										
										
											2022-10-03 15:44:02 +08:00
										 |  |  |       const title = this._element.getAttribute('title'); | 
					
						
							| 
									
										
										
										
											2022-05-13 14:07:23 +08:00
										 |  |  |       if (!title) { | 
					
						
							|  |  |  |         return; | 
					
						
							| 
									
										
										
										
											2018-11-13 14:41:12 +08:00
										 |  |  |       } | 
					
						
							| 
									
										
										
										
											2022-07-19 23:43:58 +08:00
										 |  |  |       if (!this._element.getAttribute('aria-label') && !this._element.textContent.trim()) { | 
					
						
							| 
									
										
										
										
											2022-05-13 14:07:23 +08:00
										 |  |  |         this._element.setAttribute('aria-label', title); | 
					
						
							| 
									
										
										
										
											2018-11-13 14:41:12 +08:00
										 |  |  |       } | 
					
						
							| 
									
										
										
										
											2022-10-03 15:44:02 +08:00
										 |  |  |       this._element.setAttribute('data-bs-original-title', title); // DO NOT USE IT. Is only for backwards compatibility
 | 
					
						
							| 
									
										
										
										
											2022-05-13 14:07:23 +08:00
										 |  |  |       this._element.removeAttribute('title'); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     _enter() { | 
					
						
							|  |  |  |       if (this._isShown() || this._isHovered) { | 
					
						
							|  |  |  |         this._isHovered = true; | 
					
						
							| 
									
										
										
										
											2018-11-13 14:41:12 +08:00
										 |  |  |         return; | 
					
						
							|  |  |  |       } | 
					
						
							| 
									
										
										
										
											2022-05-13 14:07:23 +08:00
										 |  |  |       this._isHovered = true; | 
					
						
							|  |  |  |       this._setTimeout(() => { | 
					
						
							|  |  |  |         if (this._isHovered) { | 
					
						
							|  |  |  |           this.show(); | 
					
						
							| 
									
										
										
										
											2015-05-12 14:32:37 +08:00
										 |  |  |         } | 
					
						
							| 
									
										
										
										
											2022-05-13 14:07:23 +08:00
										 |  |  |       }, this._config.delay.show); | 
					
						
							| 
									
										
										
										
											2021-03-24 00:26:54 +08:00
										 |  |  |     } | 
					
						
							| 
									
										
										
										
											2022-05-13 14:07:23 +08:00
										 |  |  |     _leave() { | 
					
						
							|  |  |  |       if (this._isWithActiveTrigger()) { | 
					
						
							| 
									
										
										
										
											2018-11-13 14:41:12 +08:00
										 |  |  |         return; | 
					
						
							|  |  |  |       } | 
					
						
							| 
									
										
										
										
											2022-05-13 14:07:23 +08:00
										 |  |  |       this._isHovered = false; | 
					
						
							|  |  |  |       this._setTimeout(() => { | 
					
						
							|  |  |  |         if (!this._isHovered) { | 
					
						
							|  |  |  |           this.hide(); | 
					
						
							| 
									
										
										
										
											2015-05-12 14:32:37 +08:00
										 |  |  |         } | 
					
						
							| 
									
										
										
										
											2022-05-13 14:07:23 +08:00
										 |  |  |       }, this._config.delay.hide); | 
					
						
							| 
									
										
										
										
											2021-03-24 00:26:54 +08:00
										 |  |  |     } | 
					
						
							| 
									
										
										
										
											2022-05-13 14:07:23 +08:00
										 |  |  |     _setTimeout(handler, timeout) { | 
					
						
							|  |  |  |       clearTimeout(this._timeout); | 
					
						
							|  |  |  |       this._timeout = setTimeout(handler, timeout); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     _isWithActiveTrigger() { | 
					
						
							|  |  |  |       return Object.values(this._activeTrigger).includes(true); | 
					
						
							| 
									
										
										
										
											2021-03-24 00:26:54 +08:00
										 |  |  |     } | 
					
						
							|  |  |  |     _getConfig(config) { | 
					
						
							| 
									
										
										
										
											2022-12-25 00:37:22 +08:00
										 |  |  |       const dataAttributes = Manipulator.getDataAttributes(this._element); | 
					
						
							| 
									
										
										
										
											2022-05-13 14:07:23 +08:00
										 |  |  |       for (const dataAttribute of Object.keys(dataAttributes)) { | 
					
						
							|  |  |  |         if (DISALLOWED_ATTRIBUTES.has(dataAttribute)) { | 
					
						
							|  |  |  |           delete dataAttributes[dataAttribute]; | 
					
						
							| 
									
										
										
										
											2019-02-14 00:01:40 +08:00
										 |  |  |         } | 
					
						
							| 
									
										
										
										
											2022-05-13 14:07:23 +08:00
										 |  |  |       } | 
					
						
							| 
									
										
										
										
											2022-12-25 00:37:22 +08:00
										 |  |  |       config = { | 
					
						
							|  |  |  |         ...dataAttributes, | 
					
						
							| 
									
										
										
										
											2021-03-24 00:26:54 +08:00
										 |  |  |         ...(typeof config === 'object' && config ? config : {}) | 
					
						
							|  |  |  |       }; | 
					
						
							| 
									
										
										
										
											2022-05-13 14:07:23 +08:00
										 |  |  |       config = this._mergeConfigObj(config); | 
					
						
							|  |  |  |       config = this._configAfterMerge(config); | 
					
						
							|  |  |  |       this._typeCheckConfig(config); | 
					
						
							|  |  |  |       return config; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     _configAfterMerge(config) { | 
					
						
							| 
									
										
										
										
											2022-12-25 00:37:22 +08:00
										 |  |  |       config.container = config.container === false ? document.body : index_js.getElement(config.container); | 
					
						
							| 
									
										
										
										
											2018-11-13 14:41:12 +08:00
										 |  |  |       if (typeof config.delay === 'number') { | 
					
						
							|  |  |  |         config.delay = { | 
					
						
							|  |  |  |           show: config.delay, | 
					
						
							|  |  |  |           hide: config.delay | 
					
						
							|  |  |  |         }; | 
					
						
							|  |  |  |       } | 
					
						
							|  |  |  |       if (typeof config.title === 'number') { | 
					
						
							|  |  |  |         config.title = config.title.toString(); | 
					
						
							|  |  |  |       } | 
					
						
							|  |  |  |       if (typeof config.content === 'number') { | 
					
						
							|  |  |  |         config.content = config.content.toString(); | 
					
						
							|  |  |  |       } | 
					
						
							|  |  |  |       return config; | 
					
						
							| 
									
										
										
										
											2021-03-24 00:26:54 +08:00
										 |  |  |     } | 
					
						
							|  |  |  |     _getDelegateConfig() { | 
					
						
							|  |  |  |       const config = {}; | 
					
						
							| 
									
										
										
										
											2022-12-25 00:37:22 +08:00
										 |  |  |       for (const [key, value] of Object.entries(this._config)) { | 
					
						
							|  |  |  |         if (this.constructor.Default[key] !== value) { | 
					
						
							|  |  |  |           config[key] = value; | 
					
						
							| 
									
										
										
										
											2015-05-12 14:32:37 +08:00
										 |  |  |         } | 
					
						
							| 
									
										
										
										
											2022-10-03 15:44:02 +08:00
										 |  |  |       } | 
					
						
							|  |  |  |       config.selector = false; | 
					
						
							| 
									
										
										
										
											2022-12-25 00:37:22 +08:00
										 |  |  |       config.trigger = 'manual'; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |       // In the future can be replaced with:
 | 
					
						
							| 
									
										
										
										
											2021-08-04 23:41:51 +08:00
										 |  |  |       // const keysWithDifferentValues = Object.entries(this._config).filter(entry => this.constructor.Default[entry[0]] !== this._config[entry[0]])
 | 
					
						
							|  |  |  |       // `Object.fromEntries(keysWithDifferentValues)`
 | 
					
						
							| 
									
										
										
										
											2018-11-13 14:41:12 +08:00
										 |  |  |       return config; | 
					
						
							| 
									
										
										
										
											2021-03-24 00:26:54 +08:00
										 |  |  |     } | 
					
						
							| 
									
										
										
										
											2021-09-07 23:37:44 +08:00
										 |  |  |     _disposePopper() { | 
					
						
							|  |  |  |       if (this._popper) { | 
					
						
							|  |  |  |         this._popper.destroy(); | 
					
						
							|  |  |  |         this._popper = null; | 
					
						
							|  |  |  |       } | 
					
						
							| 
									
										
										
										
											2022-11-22 02:19:01 +08:00
										 |  |  |       if (this.tip) { | 
					
						
							|  |  |  |         this.tip.remove(); | 
					
						
							|  |  |  |         this.tip = null; | 
					
						
							|  |  |  |       } | 
					
						
							| 
									
										
										
										
											2022-12-25 00:37:22 +08:00
										 |  |  |     } | 
					
						
							| 
									
										
										
										
											2021-03-24 00:26:54 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-12-25 00:37:22 +08:00
										 |  |  |     // Static
 | 
					
						
							| 
									
										
										
										
											2021-03-24 00:26:54 +08:00
										 |  |  |     static jQueryInterface(config) { | 
					
						
							| 
									
										
										
										
											2018-11-13 14:41:12 +08:00
										 |  |  |       return this.each(function () { | 
					
						
							| 
									
										
										
										
											2021-06-23 02:29:16 +08:00
										 |  |  |         const data = Tooltip.getOrCreateInstance(this, config); | 
					
						
							| 
									
										
										
										
											2022-05-13 14:07:23 +08:00
										 |  |  |         if (typeof config !== 'string') { | 
					
						
							|  |  |  |           return; | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |         if (typeof data[config] === 'undefined') { | 
					
						
							|  |  |  |           throw new TypeError(`No method named "${config}"`); | 
					
						
							| 
									
										
										
										
											2018-07-24 08:51:14 +08:00
										 |  |  |         } | 
					
						
							| 
									
										
										
										
											2022-05-13 14:07:23 +08:00
										 |  |  |         data[config](); | 
					
						
							| 
									
										
										
										
											2018-11-13 14:41:12 +08:00
										 |  |  |       }); | 
					
						
							| 
									
										
										
										
											2021-03-24 00:26:54 +08:00
										 |  |  |     } | 
					
						
							|  |  |  |   } | 
					
						
							| 
									
										
										
										
											2022-12-25 00:37:22 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-11-13 14:41:12 +08:00
										 |  |  |   /** | 
					
						
							|  |  |  |    * jQuery | 
					
						
							|  |  |  |    */ | 
					
						
							| 
									
										
										
										
											2015-05-12 14:32:37 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-12-25 00:37:22 +08:00
										 |  |  |   index_js.defineJQueryPlugin(Tooltip); | 
					
						
							| 
									
										
										
										
											2015-05-12 14:32:37 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |   return Tooltip; | 
					
						
							| 
									
										
										
										
											2018-07-24 08:51:14 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-10-05 23:50:18 +08:00
										 |  |  | })); | 
					
						
							| 
									
										
										
										
											2018-07-24 08:51:14 +08:00
										 |  |  | //# sourceMappingURL=tooltip.js.map
 |