@coreui/coreui-pro
Version:
The most popular front-end framework for developing responsive, mobile-first projects on the web rewritten by the CoreUI Team
6 lines • 221 kB
JavaScript
/*!
* CoreUI v5.24.0 (https://coreui.io)
* Copyright 2026 The CoreUI Team (https://github.com/orgs/coreui/people)
* Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
*/
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("@popperjs/core")):"function"==typeof define&&define.amd?define(["@popperjs/core"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).bootstrap=t(e.Popper)}(this,function(e){"use strict";function t(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const i in e)if("default"!==i){const n=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(t,i,n.get?n:{enumerable:!0,get:()=>e[i]})}return t.default=e,Object.freeze(t)}const i=t(e),n=new Map,s={set(e,t,i){n.has(e)||n.set(e,new Map);const s=n.get(e);s.has(t)||0===s.size?s.set(t,i):console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(s.keys())[0]}.`)},get:(e,t)=>n.has(e)&&n.get(e).get(t)||null,remove(e,t){if(!n.has(e))return;const i=n.get(e);i.delete(t),0===i.size&&n.delete(e)}},a="transitionend",o=e=>(e&&window.CSS&&window.CSS.escape&&(e=e.replace(/#([^\s"#']+)/g,(e,t)=>`#${CSS.escape(t)}`)),e),r=e=>null==e?`${e}`:Object.prototype.toString.call(e).match(/\s([a-z]+)/i)[1].toLowerCase(),l=e=>{do{e+=Math.floor(1e6*Math.random())}while(document.getElementById(e));return e},c=e=>{e.dispatchEvent(new Event(a))},h=e=>!(!e||"object"!=typeof e)&&(void 0!==e.jquery&&(e=e[0]),void 0!==e.nodeType),d=e=>h(e)?e.jquery?e[0]:e:"string"==typeof e&&e.length>0?document.querySelector(o(e)):null,u=e=>{if(!h(e)||0===e.getClientRects().length)return!1;const t="visible"===getComputedStyle(e).getPropertyValue("visibility"),i=e.closest("details:not([open])");if(!i)return t;if(i!==e){const t=e.closest("summary");if(t&&t.parentNode!==i)return!1;if(null===t)return!1}return t},_=e=>!e||e.nodeType!==Node.ELEMENT_NODE||!!e.classList.contains("disabled")||(void 0!==e.disabled?e.disabled:e.hasAttribute("disabled")&&"false"!==e.getAttribute("disabled")),g=e=>{if(!document.documentElement.attachShadow)return null;if("function"==typeof e.getRootNode){const t=e.getRootNode();return t instanceof ShadowRoot?t:null}return e instanceof ShadowRoot?e:e.parentNode?g(e.parentNode):null},p=()=>{},m=e=>{e.offsetHeight},f=()=>window.jQuery&&!document.body.hasAttribute("data-bs-no-jquery")?window.jQuery:null,b=[],v=()=>"rtl"===document.documentElement.dir,y=e=>{var t;t=()=>{const t=f();if(t){const i=e.NAME,n=t.fn[i];t.fn[i]=e.jQueryInterface,t.fn[i].Constructor=e,t.fn[i].noConflict=()=>(t.fn[i]=n,e.jQueryInterface)}},"loading"===document.readyState?(b.length||document.addEventListener("DOMContentLoaded",()=>{for(const e of b)e()}),b.push(t)):t()},w=(e,t=[],i=e)=>"function"==typeof e?e.call(...t):i,D=(e,t,i=!0)=>{if(!i)return void w(e);const n=(e=>{if(!e)return 0;let{transitionDuration:t,transitionDelay:i}=window.getComputedStyle(e);const n=Number.parseFloat(t),s=Number.parseFloat(i);return n||s?(t=t.split(",")[0],i=i.split(",")[0],1e3*(Number.parseFloat(t)+Number.parseFloat(i))):0})(t)+5;let s=!1;const o=({target:i})=>{i===t&&(s=!0,t.removeEventListener(a,o),w(e))};t.addEventListener(a,o),setTimeout(()=>{s||c(t)},n)},E=(e,t,i,n)=>{const s=e.length;let a=e.indexOf(t);return-1===a?!i&&n?e[s-1]:e[0]:(a+=i?1:-1,n&&(a=(a+s)%s),e[Math.max(0,Math.min(a,s-1))])},k=/[^.]*(?=\..*)\.|.*/,C=/\..*/,L=/::\d+$/,A={};let T=1;const S={mouseenter:"mouseover",mouseleave:"mouseout"},I=new Set(["click","dblclick","mouseup","mousedown","contextmenu","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","selectstart","selectend","keydown","keypress","keyup","orientationchange","touchstart","touchmove","touchend","touchcancel","pointerdown","pointermove","pointerup","pointerleave","pointercancel","gesturestart","gesturechange","gestureend","focus","blur","change","input","reset","select","submit","focusin","focusout","load","unload","beforeunload","resize","move","DOMContentLoaded","readystatechange","error","abort","scroll"]);function $(e,t){return t&&`${t}::${T++}`||e.uidEvent||T++}function O(e){const t=$(e);return e.uidEvent=t,A[t]=A[t]||{},A[t]}function x(e,t,i=null){return Object.values(e).find(e=>e.callable===t&&e.delegationSelector===i)}function N(e,t,i){const n="string"==typeof t,s=n?i:t||i;let a=B(e);return I.has(a)||(a=e),[n,s,a]}function M(e,t,i,n,s){if("string"!=typeof t||!e)return;let[a,o,r]=N(t,i,n);if(t in S){const e=e=>function(t){if(!t.relatedTarget||t.relatedTarget!==t.delegateTarget&&!t.delegateTarget.contains(t.relatedTarget))return e.call(this,t)};o=e(o)}const l=O(e),c=l[r]||(l[r]={}),h=x(c,o,a?i:null);if(h)return void(h.oneOff=h.oneOff&&s);const d=$(o,t.replace(k,"")),u=a?function(e,t,i){return function n(s){const a=e.querySelectorAll(t);for(let{target:o}=s;o&&o!==this;o=o.parentNode)for(const r of a)if(r===o)return z(s,{delegateTarget:o}),n.oneOff&&H.off(e,s.type,t,i),i.apply(o,[s])}}(e,i,o):function(e,t){return function i(n){return z(n,{delegateTarget:e}),i.oneOff&&H.off(e,n.type,t),t.apply(e,[n])}}(e,o);u.delegationSelector=a?i:null,u.callable=o,u.oneOff=s,u.uidEvent=d,c[d]=u,e.addEventListener(r,u,a)}function P(e,t,i,n,s){const a=x(t[i],n,s);a&&(e.removeEventListener(i,a,Boolean(s)),delete t[i][a.uidEvent])}function F(e,t,i,n){const s=t[i]||{};for(const[a,o]of Object.entries(s))a.includes(n)&&P(e,t,i,o.callable,o.delegationSelector)}function B(e){return e=e.replace(C,""),S[e]||e}const H={on(e,t,i,n){M(e,t,i,n,!1)},one(e,t,i,n){M(e,t,i,n,!0)},off(e,t,i,n){if("string"!=typeof t||!e)return;const[s,a,o]=N(t,i,n),r=o!==t,l=O(e),c=l[o]||{},h=t.startsWith(".");if(void 0===a){if(h)for(const i of Object.keys(l))F(e,l,i,t.slice(1));for(const[i,n]of Object.entries(c)){const s=i.replace(L,"");r&&!t.includes(s)||P(e,l,o,n.callable,n.delegationSelector)}}else{if(!Object.keys(c).length)return;P(e,l,o,a,s?i:null)}},trigger(e,t,i){if("string"!=typeof t||!e)return null;const n=f();let s=null,a=!0,o=!0,r=!1;t!==B(t)&&n&&(s=n.Event(t,i),n(e).trigger(s),a=!s.isPropagationStopped(),o=!s.isImmediatePropagationStopped(),r=s.isDefaultPrevented());const l=z(new Event(t,{bubbles:a,cancelable:!0}),i);return r&&l.preventDefault(),o&&e.dispatchEvent(l),l.defaultPrevented&&s&&s.preventDefault(),l}};function z(e,t={}){for(const[i,n]of Object.entries(t))try{e[i]=n}catch(t){Object.defineProperty(e,i,{configurable:!0,get:()=>n})}return e}function j(e){if("true"===e)return!0;if("false"===e)return!1;if(e===Number(e).toString())return Number(e);if(""===e||"null"===e)return null;if("string"!=typeof e)return e;try{return JSON.parse(decodeURIComponent(e))}catch(t){return e}}function V(e){return e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}const R={setDataAttribute(e,t,i){e.setAttribute(`data-bs-${V(t)}`,i)},removeDataAttribute(e,t){e.removeAttribute(`data-bs-${V(t)}`)},getDataAttributes(e){if(!e)return{};const t={},i=Object.keys(e.dataset).filter(e=>e.startsWith("bs")&&!e.startsWith("bsConfig"));for(const n of i){let i=n.replace(/^bs/,"");i=i.charAt(0).toLowerCase()+i.slice(1),t[i]=j(e.dataset[n])}return t},getDataAttribute:(e,t)=>j(e.getAttribute(`data-bs-${V(t)}`))};class q{static get Default(){return{}}static get DefaultType(){return{}}static get NAME(){throw new Error('You have to implement the static method "NAME", for each component!')}_getConfig(e){return e=this._mergeConfigObj(e),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}_configAfterMerge(e){return e}_mergeConfigObj(e,t){const i=h(t)?R.getDataAttribute(t,"config"):{};return{...this.constructor.Default,..."object"==typeof i?i:{},...h(t)?R.getDataAttributes(t):{},..."object"==typeof e?e:{}}}_typeCheckConfig(e,t=this.constructor.DefaultType){for(const[i,n]of Object.entries(t)){const t=e[i],s=h(t)?"element":r(t);if(!new RegExp(n).test(s))throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option "${i}" provided type "${s}" but expected type "${n}".`)}}}class Y extends q{constructor(e,t){super(),(e=d(e))&&(this._element=e,this._config=this._getConfig(t),s.set(this._element,this.constructor.DATA_KEY,this))}dispose(){s.remove(this._element,this.constructor.DATA_KEY),H.off(this._element,this.constructor.EVENT_KEY);for(const e of Object.getOwnPropertyNames(this))this[e]=null}_queueCallback(e,t,i=!0){D(e,t,i)}_getConfig(e){return e=this._mergeConfigObj(e,this._element),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}static getInstance(e){return s.get(d(e),this.DATA_KEY)}static getOrCreateInstance(e,t={}){return this.getInstance(e)||new this(e,"object"==typeof t?t:null)}static get VERSION(){return"5.24.0"}static get DATA_KEY(){return`bs.${this.NAME}`}static get EVENT_KEY(){return`.${this.DATA_KEY}`}static eventName(e){return`${e}${this.EVENT_KEY}`}}const W=e=>{let t=e.getAttribute("data-bs-target");if(!t||"#"===t){let i=e.getAttribute("href");if(!i||!i.includes("#")&&!i.startsWith("."))return null;i.includes("#")&&!i.startsWith("#")&&(i=`#${i.split("#")[1]}`),t=i&&"#"!==i?i.trim():null}return t?t.split(",").map(e=>o(e)).join(","):null},Q={find:(e,t=document.documentElement)=>[].concat(...Element.prototype.querySelectorAll.call(t,e)),findOne:(e,t=document.documentElement)=>Element.prototype.querySelector.call(t,e),children:(e,t)=>[].concat(...e.children).filter(e=>e.matches(t)),parents(e,t){const i=[];let n=e.parentNode.closest(t);for(;n;)i.push(n),n=n.parentNode.closest(t);return i},prev(e,t){let i=e.previousElementSibling;for(;i;){if(i.matches(t))return[i];i=i.previousElementSibling}return[]},next(e,t){let i=e.nextElementSibling;for(;i;){if(i.matches(t))return[i];i=i.nextElementSibling}return[]},focusableChildren(e){const t=["a","button","input","textarea","select","details","[tabindex]",'[contenteditable="true"]'].map(e=>`${e}:not([tabindex^="-"])`).join(",");return this.find(t,e).filter(e=>!_(e)&&u(e))},getSelectorFromElement(e){const t=W(e);return t&&Q.findOne(t)?t:null},getElementFromSelector(e){const t=W(e);return t?Q.findOne(t):null},getMultipleElementsFromSelector(e){const t=W(e);return t?Q.find(t):[]}},U=(e,t="hide")=>{const i=`click.dismiss${e.EVENT_KEY}`,n=e.NAME;H.on(document,i,`[data-bs-dismiss="${n}"]`,function(i){if(["A","AREA"].includes(this.tagName)&&i.preventDefault(),_(this))return;const s=Q.getElementFromSelector(this)||this.closest(`.${n}`);e.getOrCreateInstance(s)[t]()})},K=".bs.alert",G=`close${K}`,X=`closed${K}`;class J extends Y{static get NAME(){return"alert"}close(){if(H.trigger(this._element,G).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(),H.trigger(this._element,X),this.dispose()}static jQueryInterface(e){return this.each(function(){const t=J.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)}})}}U(J,"close"),y(J);const Z={"*":["class","dir","id","lang","role",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],dd:[],div:[],dl:[],dt:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","srcset","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},ee=new Set(["background","cite","href","itemtype","longdesc","poster","src","xlink:href"]),te=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i,ie=(e,t)=>{const i=e.nodeName.toLowerCase();return t.includes(i)?!ee.has(i)||Boolean(te.test(e.nodeValue)):t.filter(e=>e instanceof RegExp).some(e=>e.test(i))};function ne(e,t,i){if(!e.length)return e;if(i&&"function"==typeof i)return i(e);const n=(new window.DOMParser).parseFromString(e,"text/html"),s=[].concat(...n.body.querySelectorAll("*"));for(const e of s){const i=e.nodeName.toLowerCase();if(!Object.keys(t).includes(i)){e.remove();continue}const n=[].concat(...e.attributes),s=[].concat(t["*"]||[],t[i]||[]);for(const t of n)ie(t,s)||e.removeAttribute(t.nodeName)}return n.body.innerHTML}const se="bs.autocomplete",ae=`.${se}`,oe=".data-api",re="ArrowUp",le="ArrowDown",ce="Backspace",he="Delete",de="Enter",ue="Tab",_e=`blur${ae}`,ge=`changed${ae}`,pe=`click${ae}`,me=`hide${ae}`,fe=`hidden${ae}`,be=`input${ae}`,ve=`keydown${ae}`,ye=`keyup${ae}`,we=`show${ae}`,De=`shown${ae}`,Ee=`click${ae}${oe}`,ke=`keyup${ae}${oe}`,Ce=`load${ae}${oe}`,Le="disabled",Ae="autocomplete-input",Te="autocomplete-option",Se="selected",Ie="show",$e=`.autocomplete:not(.disabled).${Ie}`,Oe=".autocomplete-option",xe=".autocomplete-options-empty",Ne={allowList:Z,allowOnlyDefinedOptions:!1,ariaCleanerLabel:"Clear selection",ariaIndicatorLabel:"Toggle visibility of options menu",cleaner:!1,clearSearchOnSelect:!0,container:!1,disabled:!1,highlightOptionsOnSearch:!1,id:null,indicator:!1,invalid:!1,name:null,options:!1,optionsGroupsTemplate:null,optionsMaxHeight:"auto",optionsTemplate:null,placeholder:null,required:!1,sanitize:!0,sanitizeFn:null,search:null,searchNoResultsLabel:!1,showHints:!1,valid:!1,value:null},Me={allowList:"object",allowOnlyDefinedOptions:"boolean",ariaCleanerLabel:"string",ariaIndicatorLabel:"string",cleaner:"boolean",clearSearchOnSelect:"boolean",container:"(string|element|boolean)",disabled:"boolean",highlightOptionsOnSearch:"boolean",id:"(string|null)",indicator:"boolean",invalid:"boolean",name:"(string|null)",options:"(array|null)",optionsGroupsTemplate:"(function|null)",optionsMaxHeight:"(number|string)",optionsTemplate:"(function|null)",placeholder:"(string|null)",required:"boolean",sanitize:"boolean",sanitizeFn:"(null|function)",search:"(array|string|null)",searchNoResultsLabel:"boolean|string",showHints:"boolean",valid:"boolean",value:"(number|string|null)"};class Pe extends Y{constructor(e,t){var i;super(e,t),this._uniqueId=null!=(i=this._config.id)?i:l(`${this.constructor.NAME}`),this._indicatorElement=null,this._inputElement=null,this._inputHintElement=null,this._togglerElement=null,this._optionsElement=null,this._menu=null,this._selected=[],this._options=this._getOptionsFromConfig(),this._popper=null,this._search="",this._createAutocomplete(),this._addEventListeners(),s.set(this._element,se,this)}static get Default(){return Ne}static get DefaultType(){return Me}static get NAME(){return"autocomplete"}toggle(){return this._isShown()?this.hide():this.show()}show(){this._config.disabled||this._isShown()||(this._config.searchNoResultsLabel||0!==this._flattenOptions().filter(e=>e.label.toLowerCase().includes(this._search.toLowerCase())).length)&&(H.trigger(this._element,we),this._element.classList.add(Ie),this._inputElement.setAttribute("aria-expanded","true"),this._config.container&&(this._menu.style.minWidth=`${this._element.offsetWidth}px`,this._menu.classList.add(Ie)),H.trigger(this._element,De),this._createPopper())}hide(){H.trigger(this._element,me),this._popper&&this._popper.destroy(),this._element.classList.remove(Ie),this._inputElement.setAttribute("aria-expanded","false"),this._config.container&&this._menu.classList.remove(Ie),this._inputHintElement&&(this._inputHintElement.value=""),H.trigger(this._element,fe)}dispose(){this._popper&&this._popper.destroy(),super.dispose()}clear(){this.deselectAll(),this.search(""),this._filterOptionsList(),this._inputElement.value="",this._triggerChangeEvent(null)}search(e){this._search=e.length>0?e.toLowerCase():"",this._isExternalSearch()||this._filterOptionsList(),H.trigger(this._element,be,{value:e})}update(e){e.value&&this.deselectAll(),this._config={...this._config,...this._configAfterMerge(e)},this._options=this._getOptionsFromConfig(),this._optionsElement.innerHTML="",this._createOptions(this._optionsElement,this._options)}deselectAll(e=this._selected){if(0!==this._selected.length)for(const t of e)t.disabled||(Array.isArray(t.options)?this.deselectAll(t.options):(this._deselectOption(t.value),this._updateCleaner()))}_triggerChangeEvent(e){H.trigger(this._element,ge,{value:e})}_flattenOptions(e=this._options,t=[]){for(const i of e)i&&Array.isArray(i.options)?this._flattenOptions(i.options,t):t.push(i);return t}_getClassNames(){return this._element.classList.value.split(" ")}_highlightOption(e){const t=new RegExp(this._search,"gi");return e.replace(t,e=>`<strong>${e}</strong>`)}_isExternalSearch(){return Array.isArray(this._config.search)&&this._config.search.includes("external")}_isGlobalSearch(){return Array.isArray(this._config.search)&&this._config.search.includes("global")}_isVisible(e){return"none"!==window.getComputedStyle(e).display}_isShown(){return this._element.classList.contains(Ie)}_addEventListeners(){H.on(this._element,pe,e=>{this._config.disabled||e.target.closest(".autocomplete-indicator")||this.show()}),H.on(this._element,ve,e=>{if("Escape"===e.key)return this.hide(),void(this._config.allowOnlyDefinedOptions&&0===this._selected.length&&(this.search(""),this._inputElement.value=""));!this._isGlobalSearch()||1!==e.key.length&&e.key!==ce&&e.key!==he||this._inputElement.focus()}),H.on(this._menu,ve,e=>{!this._isGlobalSearch()||1!==e.key.length&&e.key!==ce&&e.key!==he||this._inputElement.focus()}),H.on(this._togglerElement,ve,e=>{if(!this._isShown()&&(e.key===de||e.key===le))return e.preventDefault(),void this.show();this._isShown()&&e.key===le&&(e.preventDefault(),this._selectMenuItem(e))}),H.on(this._indicatorElement,pe,e=>{e.preventDefault(),this.toggle()}),H.on(this._inputElement,_e,()=>{const e=this._inputElement.value;if(0===e.length)return;const t=e.toLowerCase(),i=this._flattenOptions().filter(e=>e.label.toLowerCase()===t);1!==i.length?this._config.allowOnlyDefinedOptions?this.clear():this._triggerChangeEvent(e):this._selectOption(i[0])}),H.on(this._inputElement,ve,e=>{if(this._isShown()||e.key===ue||this.show(),e.key!==le||this._inputElement.value.length!==this._inputElement.selectionStart){if(e.key===ue&&this._config.showHints&&this._inputElement.value.length>0){this._inputHintElement.value&&(e.preventDefault(),e.stopPropagation());const t=this._flattenOptions().filter(e=>e.label.toLowerCase().startsWith(this._inputElement.value.toLowerCase()));t.length>0&&this._selectOption(t[0])}if(e.key===de){if(e.preventDefault(),e.stopPropagation(),0===this._inputElement.value.length)return;const t=this._flattenOptions().filter(e=>e.label.toLowerCase()===this._inputElement.value.toLowerCase());t.length>0&&this._selectOption(t[0]),0!==t.length||this._config.allowOnlyDefinedOptions||(this._triggerChangeEvent(this._inputElement.value),this.hide(),this._config.clearSearchOnSelect&&this.search(""))}}else this._selectMenuItem(e)}),H.on(this._inputElement,ye,e=>{if(1===e.key.length||e.key===ce||e.key===he){const{value:t}=e.target;if(this.search(t),this._config.showHints){const e=t?this._flattenOptions().filter(e=>e.label.toLowerCase().startsWith(t.toLowerCase())):[];this._inputHintElement.value=e.length>0?`${t}${e[0].label.slice(t.length)}`:""}this._selected.length>0&&(this.deselectAll(),this._triggerChangeEvent(null))}}),H.on(this._optionsElement,pe,e=>{e.preventDefault(),e.stopPropagation(),this._onOptionsClick(e.target)}),H.on(this._cleanerElement,pe,e=>{this._config.disabled||(e.preventDefault(),e.stopPropagation(),this.clear())}),H.on(this._cleanerElement,ve,e=>{this._config.disabled||e.key!==de||(e.preventDefault(),e.stopPropagation(),this.clear())}),H.on(this._optionsElement,ve,e=>{e.key===de&&this._onOptionsClick(e.target),[re,le].includes(e.key)&&(e.preventDefault(),this._selectMenuItem(e))})}_getOptionsFromConfig(e=this._config.options){if(!e||!Array.isArray(e))return[];const t=[];for(const n of e){var i;if(n.options&&Array.isArray(n.options)){const e={...n};delete e.label,delete e.options,t.push({...e,label:n.label,options:this._getOptionsFromConfig(n.options)});continue}const e="string"==typeof n?n:n.label,s=null!=(i=n.value)?i:"string"==typeof n?n:n.label,a=n.selected||this._config.value&&this._config.value===s,o="object"==typeof n?{...n}:{};delete o.label,delete o.value,delete o.selected,delete o.disabled,t.push({...o,label:e,value:String(s),...a&&{selected:!0},...n.disabled&&{disabled:!0}}),a&&this._selected.push({label:n.label,value:String(s)})}return t}_createAutocomplete(){this._element.classList.add("autocomplete"),this._element.classList.toggle("is-invalid",this._config.invalid),this._element.classList.toggle("is-valid",this._config.valid),this._config.disabled&&this._element.classList.add(Le);for(const e of this._getClassNames())this._element.classList.add(e);this._createInputGroup(),this._createButtons(),this._createOptionsContainer(),this._updateOptionsList()}_createInputGroup(){var e;const t=document.createElement("div");if(t.classList.add("autocomplete-input-group"),this._togglerElement=t,this._config.search||this._config.disabled||(t.tabIndex=-1),!this._config.disabled&&this._config.showHints){const e=document.createElement("input");e.classList.add(Ae,"autocomplete-input-hint"),e.setAttribute("name",(this._config.name||`${this._uniqueId}-hint`).toString()),e.autocomplete="off",e.readOnly=!0,e.tabIndex=-1,e.setAttribute("aria-hidden",!0),t.append(e),this._inputHintElement=e}const i=document.createElement("input");i.classList.add(Ae),i.id=this._uniqueId,i.setAttribute("name",(this._config.name||this._uniqueId).toString()),i.autocomplete="off",i.placeholder=null!=(e=this._config.placeholder)?e:"",i.role="combobox",i.setAttribute("aria-autocomplete","list"),i.setAttribute("aria-expanded","false"),i.setAttribute("aria-haspopup","listbox"),this._config.disabled&&(i.setAttribute("disabled",!0),i.tabIndex=-1),this._config.required&&i.setAttribute("required",!0),t.append(i),this._inputElement=i,this._element.append(t)}_createButtons(){if(!this._config.cleaner&&!this._config.indicator)return;const e=document.createElement("div");if(e.classList.add("autocomplete-buttons"),!this._config.disabled&&this._config.cleaner){const t=document.createElement("button");t.type="button",t.classList.add("autocomplete-cleaner"),t.style.display="none",t.setAttribute("aria-label",this._config.ariaCleanerLabel),e.append(t),this._cleanerElement=t}if(this._config.indicator){const t=document.createElement("button");t.type="button",t.classList.add("autocomplete-indicator"),t.setAttribute("aria-label",this._config.ariaIndicatorLabel),this._config.disabled&&(t.tabIndex=-1),e.append(t),this._indicatorElement=t,this._indicatorElement=t}this._togglerElement.append(e),this._updateCleaner()}_createPopper(){if(void 0===i)throw new TypeError("CoreUI's Auto Complete component require Popper (https://popper.js.org)");const e={modifiers:[{name:"preventOverflow",options:{boundary:"clippingParents"}},{name:"offset",options:{offset:[0,2]}}],placement:v()?"bottom-end":"bottom-start"};this._popper=i.createPopper(this._togglerElement,this._menu,e)}_createOptionsContainer(){const e=document.createElement("div");e.classList.add("autocomplete-dropdown"),e.role="listbox",e.setAttribute("aria-labelledby",this._uniqueId),e.setAttribute("id",`${this._uniqueId}-listbox`);const t=document.createElement("div");t.classList.add("autocomplete-options"),"auto"!==this._config.optionsMaxHeight&&(t.style.maxHeight=`${this._config.optionsMaxHeight}px`,t.style.overflow="auto"),e.append(t);const{container:i}=this._config;i?(this._inputElement.setAttribute("aria-owns",`${this._uniqueId}-listbox`),e.id=`${this._uniqueId}-listbox`,i.append(e)):this._element.append(e),this._createOptions(t,this._options),this._optionsElement=t,this._menu=e}_createOptions(e,t){for(const i of t){if(Array.isArray(i.options)){const t=document.createElement("div");t.classList.add("autocomplete-optgroup"),t.setAttribute("role","group");const n=document.createElement("div");this._config.optionsGroupsTemplate&&"function"==typeof this._config.optionsGroupsTemplate?n.innerHTML=this._config.sanitize?ne(this._config.optionsGroupsTemplate(i),this._config.allowList,this._config.sanitizeFn):this._config.optionsGroupsTemplate(i):n.textContent=i.label,n.classList.add("autocomplete-optgroup-label"),t.append(n),this._createOptions(t,i.options),e.append(t);continue}const t=document.createElement("div");t.classList.add(Te),i.disabled&&(t.classList.add(Le),t.setAttribute("aria-disabled","true")),t.dataset.value=i.value,t.tabIndex=0,this._isExternalSearch()&&this._config.highlightOptionsOnSearch&&this._search?t.innerHTML=this._highlightOption(i.label):this._config.optionsTemplate&&"function"==typeof this._config.optionsTemplate?t.innerHTML=this._config.sanitize?ne(this._config.optionsTemplate(i),this._config.allowList,this._config.sanitizeFn):this._config.optionsTemplate(i):t.textContent=i.label,e.append(t)}}_onOptionsClick(e){if(e.classList.contains("label"))return;if(!e.classList.contains(Te)&&!(e=e.closest(Oe)))return;const{value:t}=e.dataset,i=this._findOptionByValue(t);i&&(this._selectOption(i),this._inputElement.focus())}_findOptionByValue(e,t=this._options){for(const i of t){if(i.value===e)return i;if(i.options&&Array.isArray(i.options)){const t=this._findOptionByValue(e,i.options);if(t)return t}}return null}_selectOption(e){this.deselectAll(),0===this._selected.filter(t=>t.value===e.value).length&&this._selected.push(e);const t=Q.findOne(`[data-value="${e.value}"]`,this._optionsElement);t&&(t.classList.add(Se),t.setAttribute("aria-selected",!0)),this._triggerChangeEvent(e),this._inputElement.value=e.label,this._config.showHints&&(this._inputHintElement.value=""),this.hide(),this._config.clearSearchOnSelect&&this.search(""),this._updateCleaner()}_deselectOption(e){this._selected=this._selected.filter(t=>t.value!==e);const t=Q.findOne(`[data-value="${e}"]`,this._optionsElement);t&&(t.classList.remove(Se),t.setAttribute("aria-selected",!1))}_updateCleaner(){this._config.cleaner&&null!==this._cleanerElement&&(this._selected.length>0?this._cleanerElement.style.removeProperty("display"):this._cleanerElement.style.display="none")}_updateOptionsList(e=this._options){for(const t of e)Array.isArray(t.options)?this._updateOptionsList(t.options):t.selected&&this._selectOption(t)}_filterOptionsList(){const e=Q.find(Oe,this._menu);let t=0;for(const i of e){-1===i.textContent.toLowerCase().indexOf(this._search)?i.style.display="none":(this._config.highlightOptionsOnSearch&&!this._config.optionsTemplate&&(i.innerHTML=this._highlightOption(i.textContent)),i.style.removeProperty("display"),t++);const e=i.closest(".autocomplete-optgroup");e&&(Q.children(e,Oe).filter(e=>this._isVisible(e)).length>0?e.style.removeProperty("display"):e.style.display="none")}if(t>0)Q.findOne(xe,this._menu)&&Q.findOne(xe,this._menu).remove();else if(0===t){if(this._config.searchNoResultsLabel){const e=document.createElement("div");return e.classList.add("autocomplete-options-empty"),e.innerHTML=this._config.searchNoResultsLabel,void(Q.findOne(xe,this._menu)||Q.findOne(".autocomplete-options",this._menu).append(e))}this.hide()}}_selectMenuItem({key:e,target:t}){const i=Q.find(".autocomplete-options .autocomplete-option:not(.disabled):not(:disabled)",this._menu).filter(e=>u(e));i.length&&E(i,t,e===le,!i.includes(t)).focus()}_configAfterMerge(e){return!0===e.container&&(e.container=document.body),"object"!=typeof e.container&&"string"!=typeof e.container||(e.container=d(e.container)),"string"==typeof e.options&&(e.options=e.options.split(/,\s*/).map(String)),"string"==typeof e.search&&(e.search=e.search.split(/,\s*/).map(String)),e}static autocompleteInterface(e,t){const i=Pe.getOrCreateInstance(e,t);if("string"==typeof t){if(void 0===i[t])throw new TypeError(`No method named "${t}"`);i[t]()}}static jQueryInterface(e){return this.each(function(){Pe.autocompleteInterface(this,e)})}static clearMenus(e){if(2===e.button||"keyup"===e.type&&e.key!==ue)return;const t=Q.find($e);for(const i of t){const t=Pe.getInstance(i);t&&(e.composedPath().includes(t._element)||(t._element,e.type,t.hide(),t.search(""),t._config.allowOnlyDefinedOptions&&0===t._selected.length&&(t._inputElement.value="")))}}}H.on(window,Ce,()=>{for(const e of Q.find('[data-bs-toggle="autocomplete"]:not(.disabled)'))Pe.autocompleteInterface(e)}),H.on(document,Ee,Pe.clearMenus),H.on(document,ke,Pe.clearMenus),y(Pe);const Fe='[data-bs-toggle="button"]';class Be extends Y{static get NAME(){return"button"}toggle(){this._element.setAttribute("aria-pressed",this._element.classList.toggle("active"))}static jQueryInterface(e){return this.each(function(){const t=Be.getOrCreateInstance(this);"toggle"===e&&t[e]()})}}H.on(document,"click.bs.button.data-api",Fe,e=>{e.preventDefault();const t=e.target.closest(Fe);Be.getOrCreateInstance(t).toggle()}),y(Be);let He,ze,je,Ve,Re,qe,Ye,We=e=>e;const Qe=(e,t)=>{const i=(e=>{const t=new Date(e,0,4),i=t.getDay(),n=0===i?6:i-1,s=new Date(t);return s.setDate(t.getDate()-n),s})(e),n=new Date(i);return n.setDate(i.getDate()+7*(t-1)),n},Ue=e=>12*e.getFullYear()+e.getMonth(),Ke=e=>{const t=Math.floor(e.getMonth()/3);return 4*e.getFullYear()+t},Ge=(e,t,i)=>null!==t&&e<t||null!==i&&e>i,Xe=(e,t)=>{let i=e.replaceAll(/[.*+?^${}()|[\\]\\]/g,"\\$&");return i=i.replace("2013",String.raw(ze||(ze=We`(?<year>\d{2,4})`))).replace("12",String.raw(je||(je=We`(?<month>\d{1,2})`))).replace("31",String.raw(Ve||(Ve=We`(?<day>\d{1,2})`))),t&&(i=i.replaceAll(/17|5/g,String.raw(Re||(Re=We`(?<hour>\d{1,2})`))).replace("19",String.raw(qe||(qe=We`(?<minute>\d{1,2})`))).replace("22",String.raw(Ye||(Ye=We`(?<second>\d{1,2})`))).replaceAll(/AM|PM/gi,"(?<ampm>[APap][Mm])")),i},Je=(e,t)=>{const i=Number.parseInt(e,10)-1,n=Number.parseInt(t,10);return i>=0&&i<=11&&n>=1&&n<=31},Ze=(e,t,i)=>{const n=((e,t)=>{const i=new Date(2013,11,31,17,19,22),n=[];try{const s=t?i.toLocaleString(e):i.toLocaleDateString(e);n.push(s)}catch(e){const s=t?i.toLocaleString("en-US"):i.toLocaleDateString("en-US");n.push(s)}const s=["/","-","."," "],a=n[0];let o="/";a.includes("/")?o="/":a.includes("-")?o="-":a.includes(".")&&(o=".");for(const e of s)if(e!==o){const t=o.replaceAll(/[.*+?^${}()|[\]\\]/g,String.raw(He||(He=We`\$&`))),i=a.replaceAll(new RegExp(t,"g"),e);n.push(i)}return n})(t,i),s=((e,t,i)=>{for(const n of t){const t=Xe(n,i),s=new RegExp(`^${t}$`),a=e.trim().match(s);if(null!=a&&a.groups)return a.groups}return null})(e,n,i);if(!s){const t=e.trim(),i=/[-/.:]/.test(t),s=t.split(/[-/.\s:]+/).filter(e=>e.length>0),a=(e=>0===e.length?3:e[0].split(/[-/.\s:]+/).filter(e=>e.length>0).length)(n),o=s.length>=a;return i&&o?et(e):null}if(!("year"in s&&"month"in s&&"day"in s))return null;{const{month:e,day:t}=s;if(!Je(e,t))return null}return i?(e=>{const{year:t,month:i,day:n,hour:s,minute:a,second:o,ampm:r}=e,l=pt(t),c=Number.parseInt(i,10)-1,h=Number.parseInt(n,10),d=((e,t)=>{const i=Number.parseInt(e,10);if(!t)return i;const n="pm"===t.toLowerCase();return n&&12!==i?i+12:n||12!==i?i:0})(s,r),u=Number.parseInt(null!=a?a:"0",10)||0,_=Number.parseInt(null!=o?o:"0",10)||0;return((e,t,i)=>e>=0&&e<=23&&t>=0&&t<=59&&i>=0&&i<=59)(d,u,_)?new Date(l,c,h,d,u,_):null})(s):(e=>{const{year:t,month:i,day:n}=e;if(!Je(i,n))return null;const s=pt(t),a=Number.parseInt(i,10)-1,o=Number.parseInt(n,10);return new Date(s,a,o)})(s)},et=e=>{const t=new Date(Date.parse(e));return Number.isNaN(t.getTime())?null:t},tt=(e,t,i="en-US",n=!1)=>{if(null===e)return null;if(e instanceof Date)return Number.isNaN(e.getTime())?null:e;const s=e;switch(t){case"week":return(e=>{const t=[/^(\d{4})-W(\d{1,2})$/,/^(\d{4})W(\d{1,2})$/,/^(\d{4})\s+W(\d{1,2})$/];for(const i of t){const t=e.trim().match(i);if(t){const e=pt(t[1]),i=Number.parseInt(t[2],10);return Qe(e,i)}}return(e=>{const[t,i]=e.split(/[Ww]/),n=pt(t),s=Number.parseInt(i,10);return Qe(n,s)})(e)})(s);case"month":return(e=>{const t=[/^(\d{2,4})[-/.\s](\d{1,2})$/,/^(\d{1,2})[-/.\s](\d{2,4})$/];for(const i of t){const t=e.trim().match(i);if(t){const e=t[1],i=t[2],n=Number.parseInt(e,10),s=Number.parseInt(i,10);let a,o;if(e.length>=3||n>=100?(a=pt(e),o=s-1):i.length>=3||s>=100?(a=pt(i),o=n-1):s>=1&&s<=12&&(n>12||n<1)?(a=pt(e),o=s-1):(a=pt(i),o=n-1),o>=0&&o<=11)return new Date(a,o,1)}}return null})(s);case"quarter":return(e=>{const t=[/^(\d{4})-Q(\d{1})$/,/^(\d{4})Q(\d{1})$/,/^(\d{4})\s+Q(\d{1})$/];for(const i of t){const t=e.trim().match(i);if(t){const e=pt(t[1]),i=Number.parseInt(t[2],10);if(i>=1&&i<=4)return new Date(e,3*(i-1),1)}}return null})(s);case"year":return(e=>{const t=String(e),i=t.trim().match(/^(\d{2,4})$/);if(i){const e={year:i[1]};return mt(e)}return et(t)})(s);default:return Ze(s,i,n)}},it=(e,t)=>{const i=Math.ceil(e.length/t);return Array.from({length:t}).fill("").map((t,n)=>e.slice(n*i,(n+1)*i))},nt=(e,t)=>{if(null===e)return null;if("week"===t){const{year:t,weekNumber:i}=st(e);return`${t}W${i.toString().padStart(2,"0")}`}if("month"===t){const t=`0${e.getMonth()+1}`.slice(-2);return`${e.getFullYear()}-${t}`}if("quarter"===t){const t=Math.floor(e.getMonth()/3)+1;return`${e.getFullYear()}Q${t}`}return"year"===t?`${e.getFullYear()}`:e},st=e=>{const t=new Date(e);t.setHours(0,0,0,0),t.setDate(t.getDate()+3-(t.getDay()+6)%7);const i=new Date(t.getFullYear(),0,4);return{weekNumber:1+Math.round((t.getTime()-i.getTime())/6048e5),year:t.getFullYear()}},at=(e,t,i,n)=>{if(t&&e<t)return!0;if(i&&e>i)return!0;if(void 0===n)return!1;if("function"==typeof n)return n(e);if(n instanceof Date&&dt(e,n))return!0;if(Array.isArray(n)&&n)for(const t of n){if("function"==typeof t&&t(e))return!0;if(Array.isArray(t)&&ot(e,t[0],t[1]))return!0;if(t instanceof Date&&dt(e,t))return!0}return!1},ot=(e,t,i)=>{const n=_t(e),s=t?_t(t):null,a=i?_t(i):null;return Boolean(s&&a&&s<=n&&n<=a)},rt=(e,t,i)=>!(null===t||!dt(t,e))||!(null===i||!dt(i,e)),lt=(e,t,i)=>{if(e&&t){const n=new Date(e);let s=!1;for(;n<t;)if(n.setDate(n.getDate()+1),at(n,null,null,i)){s=!0;break}return s}return!1},ct=(e,t,i)=>{const n=t?Ue(t):null,s=i?Ue(i):null,a=Ue(e);return Boolean(n&&s&&n<=a&&a<=s)},ht=(e,t,i)=>{const n=t?Ke(t):null,s=i?Ke(i):null,a=Ke(e);return Boolean(n&&s&&n<=a&&a<=s)},dt=(e,t)=>e instanceof Date&&t instanceof Date?e.getDate()===t.getDate()&&e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear():null===e&&null===t,ut=(e,t,i)=>{const n=e.getFullYear(),s=t?t.getFullYear():null,a=i?i.getFullYear():null;return Boolean(s&&a&&s<=n&&n<=a)},_t=e=>{const t=new Date(e);return t.setHours(0,0,0,0),t},gt=(e,t)=>{if(null===e)return null;if(!(t instanceof Date))return e;const i=new Date(e);return i.setHours(t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()),i},pt=e=>{let t=Number.parseInt(e,10);if(t<100){const e=(new Date).getFullYear();t=100*Math.floor(e/100)+t,t>e+50&&(t-=100)}return t},mt=e=>{const{year:t}=e,i=pt(t);return new Date(i,0,1)},ft=".bs.calendar",bt=".data-api",vt=new Set(["sanitize","allowList","sanitizeFn"]),yt="ArrowUp",wt="ArrowRight",Dt="ArrowDown",Et="ArrowLeft",kt=`blur${ft}`,Ct=`calendarDateChange${ft}`,Lt=`calendarMouseleave${ft}`,At=`calendarViewChange${ft}`,Tt=`cellHover${ft}`,St=`endDateChange${ft}`,It=`focus${ft}`,$t=`keydown${ft}`,Ot=`selectEndChange${ft}`,xt=`startDateChange${ft}`,Nt=`mouseenter${ft}`,Mt=`mouseleave${ft}`,Pt=`load${ft}${bt}`,Ft=`click${ft}${bt}`,Bt="calendar-cell",Ht="calendar-cell-inner",zt="calendar-row",jt=".btn-double-next",Vt=".btn-double-prev",Rt=".btn-month",qt=".btn-next",Yt=".btn-prev",Wt=".btn-year",Qt=".calendar-cell",Ut=`${Qt}[tabindex="0"]`,Kt=".calendar-row",Gt=`${Kt}[tabindex="0"]`,Xt={allowList:Z,ariaNavNextMonthLabel:"Next month",ariaNavNextYearLabel:"Next year",ariaNavPrevMonthLabel:"Previous month",ariaNavPrevYearLabel:"Previous year",calendarDate:null,calendars:1,dayFormat:"numeric",disabledDates:null,endDate:null,firstDayOfWeek:1,locale:"default",maxDate:null,minDate:null,monthFormat:"short",range:!1,renderDayCell:null,renderMonthCell:null,renderQuarterCell:null,renderYearCell:null,sanitize:!0,sanitizeFn:null,selectAdjacementDays:!1,selectEndDate:!1,selectionType:"day",showAdjacementDays:!0,showWeekNumber:!1,startDate:null,weekdayFormat:2,weekNumbersLabel:null,yearFormat:"numeric"},Jt={allowList:"object",ariaNavNextMonthLabel:"string",ariaNavNextYearLabel:"string",ariaNavPrevMonthLabel:"string",ariaNavPrevYearLabel:"string",calendarDate:"(date|number|string|null)",calendars:"number",dayFormat:"string",disabledDates:"(array|date|function|null)",endDate:"(date|number|string|null)",firstDayOfWeek:"number",locale:"string",maxDate:"(date|number|string|null)",minDate:"(date|number|string|null)",monthFormat:"string",range:"boolean",renderDayCell:"(function|null)",renderMonthCell:"(function|null)",renderQuarterCell:"(function|null)",renderYearCell:"(function|null)",sanitize:"boolean",sanitizeFn:"(null|function)",selectAdjacementDays:"boolean",selectEndDate:"boolean",selectionType:"string",showAdjacementDays:"boolean",showWeekNumber:"boolean",startDate:"(date|number|string|null)",weekdayFormat:"(number|string)",weekNumbersLabel:"(string|null)",yearFormat:"string"};class Zt extends Y{constructor(e,t){super(e),this._config=this._getConfig(t),this._initializeDates(),this._initializeView(),this._createCalendar(),this._addEventListeners()}static get Default(){return Xt}static get DefaultType(){return Jt}static get NAME(){return"calendar"}update(e){this._config=this._getConfig(e),this._initializeDates(),this._initializeView(),this._element.innerHTML="",this._createCalendar()}refresh(){this._element.innerHTML="",this._createCalendar()}_focusOnFirstAvailableCell(){const e=Q.findOne(Ut,this._element);e&&e.focus()}_getDate(e){if("week"===this._config.selectionType){const t=Q.findOne(Qt,e.closest(Kt));return new Date(R.getDataAttribute(t,"date"))}return new Date(R.getDataAttribute(e,"date"))}_handleCalendarClick(e){const t=e.target.closest(Qt),i=this._getDate(t),n=new Date(i),s=R.getDataAttribute(t.closest(".calendar"),"calendar-index");return"days"===this._view&&this._setCalendarDate(s?new Date(n.setMonth(n.getMonth()-s)):i),"months"===this._view&&"month"!==this._config.selectionType?(this._setCalendarDate(s?new Date(n.setMonth(n.getMonth()-s)):i,"days"),this._setCalendarView("days","cellClick"),void this._updateCalendar(this._focusOnFirstAvailableCell.bind(this))):"years"===this._view&&"year"!==this._config.selectionType?(this._setCalendarDate(s?new Date(n.setFullYear(n.getFullYear()-s)):i,"months"),this._setCalendarView("quarter"===this._config.selectionType?"quarters":"months","cellClick"),void this._updateCalendar(this._focusOnFirstAvailableCell.bind(this))):void(at(i,this._minDate,this._maxDate,this._config.disabledDates)||(this._hoverDate=null,this._selectDate(i),this._updateClassNamesAndAriaLabels()))}_handleCalendarKeydown(e){const t=this._getDate(e.target);if("Space"!==e.code&&"Enter"!==e.key||(e.preventDefault(),this._handleCalendarClick(e)),e.key===wt||e.key===Et||e.key===yt||e.key===Dt){if(e.preventDefault(),this._maxDate&&t>=tt(this._maxDate,this._config.selectionType)&&(e.key===wt||e.key===Dt))return;if(this._minDate&&t<=tt(this._minDate,this._config.selectionType)&&(e.key===Et||e.key===yt))return;let i=e.target;"week"===this._config.selectionType&&-1===i.tabIndex&&(i=i.closest(Gt));const n=Q.find("week"===this._config.selectionType?Gt:Ut,this._element),s=n.indexOf(i),a=0===s,o=s===n.length-1,r={start:s,end:n.length-(s+1)},l={ArrowRight:1,ArrowLeft:-1,ArrowUp:"week"===this._config.selectionType&&"days"===this._view?-1:"days"===this._view?-7:-3,ArrowDown:"week"===this._config.selectionType&&"days"===this._view?1:"days"===this._view?7:3};if(e.key===wt&&o||e.key===Dt&&r.end<l.ArrowDown||e.key===Et&&a||e.key===yt&&r.start<Math.abs(l.ArrowUp)){const t=e=>{const t=Q.find(`${Ut}, ${Gt}`,this._element);t.length&&e===wt&&t[0].focus(),t.length&&e===Et&&t[t.length-1].focus(),t.length&&e===Dt&&t[l.ArrowDown-(n.length-s)].focus(),t.length&&e===yt&&t[t.length-(Math.abs(l.ArrowUp)+1-(s+1))].focus()};return"days"===this._view&&this._modifyCalendarDate(0,e.key===wt||e.key===Dt?1:-1,t.bind(this,e.key)),"months"!==this._view&&"quarters"!==this._view||this._modifyCalendarDate(e.key===wt||e.key===Dt?1:-1,0,t.bind(this,e.key)),void("years"===this._view&&this._modifyCalendarDate(e.key===wt||e.key===Dt?10:-10,0,t.bind(this,e.key)))}if(0===n[s+l[e.key]].tabIndex)return void n[s+l[e.key]].focus();for(let t=s;t<n.length;e.key===wt||e.key===Dt?t++:t--)if(0===n[t+l[e.key]].tabIndex){n[t+l[e.key]].focus();break}}}_handleCalendarMouseEnter(e){const t=e.target.closest(Qt),i=this._getDate(t);at(i,this._minDate,this._maxDate,this._config.disabledDates)||(this._hoverDate=gt(i,this._selectEndDate?this._endDate:this._startDate),H.trigger(this._element,Tt,{date:nt(this._hoverDate,this._config.selectionType)}),this._updateClassNamesAndAriaLabels())}_handleCalendarMouseLeave(){this._hoverDate=null,H.trigger(this._element,Tt,{date:null}),this._updateClassNamesAndAriaLabels()}_addEventListeners(){H.on(this._element,Ft,Ut,e=>{this._handleCalendarClick(e)}),H.on(this._element,$t,Ut,e=>{this._handleCalendarKeydown(e)}),H.on(this._element,Nt,Ut,e=>{this._handleCalendarMouseEnter(e)}),H.on(this._element,Mt,Ut,()=>{this._handleCalendarMouseLeave()}),H.on(this._element,It,Ut,e=>{this._handleCalendarMouseEnter(e)}),H.on(this._element,kt,Ut,()=>{this._handleCalendarMouseLeave()}),H.on(this._element,Ft,Gt,e=>{this._handleCalendarClick(e)}),H.on(this._element,$t,Gt,e=>{this._handleCalendarKeydown(e)}),H.on(this._element,Nt,Gt,e=>{this._handleCalendarMouseEnter(e)}),H.on(this._element,Mt,Gt,()=>{this._handleCalendarMouseLeave()}),H.on(this._element,It,Gt,e=>{this._handleCalendarMouseEnter(e)}),H.on(this._element,kt,Gt,()=>{this._handleCalendarMouseLeave()}),this._addNavigationEventListeners(),H.on(this._element,Mt,"table",()=>{H.trigger(this._element,Lt)})}_addNavigationEventListeners(){const e={[Yt]:()=>this._modifyCalendarDate(0,-1),[Vt]:()=>this._modifyCalendarDate("years"===this._view?-10:-1),[qt]:()=>this._modifyCalendarDate(0,1),[jt]:()=>this._modifyCalendarDate("years"===this._view?10:1),[Rt]:()=>{this._setCalendarView("months","navigation"),this._updateCalendar()},[Wt]:()=>{this._setCalendarView("years","navigation"),this._updateCalendar()}};for(const[t,i]of Object.entries(e))H.on(this._element,Ft,t,e=>{e.preventDefault();const n=Q.find(t,this._element).indexOf(e.target.closest(t));i();const s=Q.find(t,this._element);s&&s[n]&&s[n].focus()})}_setCalendarDate(e,t=this._view){this._calendarDate=e,H.trigger(this._element,Ct,{date:e,view:t})}_setCalendarView(e,t){this._view=e,H.trigger(this._element,At,{view:e,source:t})}_modifyCalendarDate(e,t=0,i){const n=this._calendarDate.getFullYear(),s=this._calendarDate.getMonth(),a=new Date(n,s,1);e&&a.setFullYear(a.getFullYear()+e),t&&a.setMonth(a.getMonth()+t),this._calendarDate=a,H.trigger(this._element,Ct,{date:a,view:this._view}),this._updateCalendar(i)}_setEndDate(e){this._endDate=gt(e,this._endDate),H.trigger(this._element,St,{date:nt(this._endDate,this._config.selectionType)})}_setStartDate(e){this._startDate=gt(e,this._startDate),H.trigger(this._element,xt,{date:nt(this._startDate,this._config.selectionType)})}_setSelectEndDate(e){this._selectEndDate=e,H.trigger(this._element,Ot,{value:e})}_selectDate(e){if(!at(e,this._minDate,this._maxDate,this._config.disabledDates))return this._config.range?this._selectEndDate?(this._setSelectEndDate(!1),this._startDate&&this._startDate>e||lt(this._startDate,e,this._config.disabledDates)?(this._setStartDate(null),void this._setEndDate(null)):void this._setEndDate(e)):this._endDate&&this._endDate<e||lt(e,this._endDate,this._config.disabledDates)?(this._setStartDate(null),void this._setEndDate(null)):(this._setSelectEndDate(!0),void this._setStartDate(e)):void this._setStartDate(e)}_createCalendarPanel(e){var t;const i=((e,t,i)=>0!==t&&"days"===i?new Date(e.getFullYear(),e.getMonth()+t,1):0===t||"months"!==i&&"quarters"!==i?0!==t&&"years"===i?new Date(e.getFullYear()+12*t,e.getMonth(),1):e:new Date(e.getFullYear()+t,e.getMonth(),1))(this._calendarDate,e,this._view),n=i.getFullYear(),s=i.getMonth(),a=document.createElement("div");a.classList.add("calendar"),R.setDataAttribute(a,"calendar-index",e);const o=document.createElement("div");o.classList.add("calendar-nav"),o.innerHTML=`\n <div class="calendar-nav-prev">\n <button type="button" class="calendar-nav-btn btn-double-prev" aria-label="${this._config.ariaNavPrevYearLabel}">\n <span class="calendar-nav-icon calendar-nav-icon-double-prev"></span>\n </button>\n ${"days"===this._view?`<button type="button" class="calendar-nav-btn btn-prev" aria-label="${this._config.ariaNavPrevMonthLabel}">\n <span class="calendar-nav-icon calendar-nav-icon-prev"></span>\n </button>`:""}\n </div>\n <div class="calendar-nav-date" aria-live="polite">\n ${"days"===this._view?`<button type="button" class="calendar-nav-btn btn-sm btn-month">\n ${i.toLocaleDateString(this._config.locale,{month:"long"})}\n </button>`:""}\n <button type="button" class="calendar-nav-btn btn-year">\n ${i.toLocaleDateString(this._config.locale,{year:"numeric"})}\n </button>\n </div>\n <div class="calendar-nav-next">\n ${"days"===this._view?`<button type="button" class="calendar-nav-btn btn-next" aria-label="${this._config.ariaNavNextMonthLabel}">\n <span class="calendar-nav-icon calendar-nav-icon-next"></span>\n </button>`:""}\n <button type="button" class="calendar-nav-btn btn-double-next" aria-label="${this._config.ariaNavNextYearLabel}">\n <span class="calendar-nav-icon calendar-nav-icon-double-next"></span>\n </button>\n </div>\n `;const r=((e,t,i)=>{const n=((e,t,i)=>{const n=[],s=new Date(e,t),a=s.getFullYear(),o=s.getMonth();let r=6-(6-new Date(a,o,1).getDay())-i;i&&(r=r<0?7+r:r);for(let e=-1*r;e<0;e++)n.push({date:new Date(a,o,e+1),month:"previous"});return n})(e,t,i),s=((e,t)=>{const i=[],n=new Date(e,t+1,0).getDate();for(let s=1;s<=n;s++)i.push({date:new Date(e,t,s),month:"current"});return i})(e,t),a=((e,t,i,n)=>{const s=[],a=42-(i.length+n.length);for(let i=1;i<=a;i++)s.push({date:new Date(e,t+1,i),month:"next"});return s})(e,t,n,s),o=[...n,...s,...a],r=[];for(const[e,t]of o.entries()){if(e%7!=0&&0!==r.length||r.push({week:{number:0,year:0},days:[]}),(e+1)%7==0){const{weekNumber:e,year:i}=st(t.date),n=r.at(-1);n&&(n.week={number:e,year:i})}const i=r.at(-1);i&&i.days.push(t)}return r})(n,s,this._config.firstDayOfWeek),l=it(((e,t="short")=>Array.from({length:12},(i,n)=>new Date(2e3,n,1).toLocaleString(e,{month:t})))(this._config.locale,this._config.monthFormat),4),c=it(((e,t=6)=>Array.from({length:2*t},(i,n)=>e-t+n))(i.getFullYear()),4),h=r[0].days,d=document.createElement("table");return d.innerHTML=`\n ${"days"===this._view?`\n <thead>\n <tr>\n ${this._config.showWeekNumber?`<th class="${Bt}">\n <div class="calendar-header-cell-inner">\n ${null!=(t=this._config.weekNumbersLabel)?t:""}\n </div>\n </th>`:""}\n ${h.map(({date:e})=>`<th class="${Bt}" abbr="${e.toLocaleDateString(this._config.locale,{weekday:"long"})}">\n <div class="calendar-header-cell-inner">\n ${"string"==typeof this._config.weekdayFormat?e.toLocaleDateString(this._config.locale,{weekday:this._config.weekdayFormat}):e.toLocaleDateString(this._config.locale,{weekday:"long"}).slice(0,this._config.weekdayFormat)}\n </div>\n </th>`).join("")}\n </tr>\n </thead>`:""}\n <tbody>\n ${"days"===this._view?r.map(({week:e,days:t})=>{const{date:i}=t[0],n=this._rowWeekAttributes(i);return`<tr \n class="${n.className}"\n tabindex="${n.tabIndex}"\n ${n.ariaSelected?'aria-selected="true"':""}\n >\n ${this._config.showWeekNumber?`<th class="calendar-cell-week-number">${e.number}</td>`:""}\n ${t.map(({date:e,month:t})=>{const i=this._cellDayAttributes(e,t);return"current"===t||this._config.showAdjacementDays?`<td \n class="${i.className}"\n tabindex="${i.tabIndex}"\n ${i.ariaSelected?'aria-selected="true"':""}\n data-bs-date="${e}"\n >\n <div class="${Ht} day">\n ${this._config.renderDayCell?this._sanitizeHtml(this._config.renderDayCell(e,i.meta)):e.toLocaleDateString(this._config.locale,{day:this._config.dayFormat})}\n </div>\n </td>`:"<td></td>"}).join("")}</tr>`}).join(""):""}\n ${"months"===this._view?l.map((e,t)=>`<tr>\n ${e.map((e,n)=>{const s=new Date(i.getFullYear(),3*t+n,1),a=this._cellMonthAttributes(s);return`<td\n class="${a.className}"\n tabindex="${a.tabIndex}"\n ${a.ariaSelected?'aria-selected="true"':""}\n data-bs-date="${s.toDateString()}"\n >\n <div class="${Ht} month">\n ${this._config.renderMonthCell?this._sanitizeHtml(this._config.renderMonthCell(s,a.meta)):e}\n </div>\n </td>`}).join("")}\n </tr>`).join(""):""}\n ${"quarters"===this._view?`<tr>\n ${Array.from({length:4},(e,t)=>{const n=new Date(i.getFullYear(),3*t,1),s=this._cellQuarterAttributes(n);return`<td\n class="${s.className}"\n tabindex="${s.tabIndex}"\n ${s.ariaSelected?'aria-selected="true"':""}\n data-bs-date="${n.toDateString()}"\n >\n <div class="${Ht} quarter">\n ${this._config.renderQuarterCell?this._sanitizeHtml(this._config.renderQuarterCell(n,s.meta)):`Q${t+1}`}\n </div>\n </td>`}).join("")}\n </tr>`:""}\n ${"years"===this._view?c.map(e=>`<tr>\n ${e.map(e=>{const t=new Date(e,0,1),i=this._cellYearAttributes(t);return`<td\n class="${i.className}"\n tabindex="${i.tabIndex}"\n ${i.ariaSelected?'aria-selected="true"':""}\n data-bs-date="${t.toDateString()}"\n >\n <div class="${Ht} year"