mirror of https://github.com/twbs/bootstrap.git
7 lines
77 KiB
JavaScript
7 lines
77 KiB
JavaScript
/*!
|
||
* Bootstrap v5.3.8 (https://getbootstrap.com/)
|
||
* Copyright 2011-2026 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||
*/
|
||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("vanilla-calendar-pro"),require("@floating-ui/dom")):"function"==typeof define&&define.amd?define(["vanilla-calendar-pro","@floating-ui/dom"],e):(t="undefined"!=typeof globalThis?globalThis:t||self).bootstrap=e(t.vanillaCalendarPro,t.FloatingUIDOM)}(this,function(t,e){"use strict";const s=new Map,i={set(t,e,i){s.has(t)||s.set(t,new Map);const n=s.get(t);n.has(e)||0===n.size?n.set(e,i):console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(n.keys())[0]}.`)},get:(t,e)=>s.has(t)&&s.get(t).get(e)||null,remove(t,e){if(!s.has(t))return;const i=s.get(t);i.delete(e),0===i.size&&s.delete(t)}},n=/[^.]*(?=\..*)\.|.*/,o=/\..*/,r=/::\d+$/,a={};let l=1;const c={mouseenter:"mouseover",mouseleave:"mouseout"},h=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","reset","select","submit","focusin","focusout","load","unload","beforeunload","resize","move","DOMContentLoaded","readystatechange","error","abort","scroll"]);function u(t,e){return e&&`${e}::${l++}`||t.uidEvent||l++}function d(t){const e=u(t);return t.uidEvent=e,a[e]=a[e]||{},a[e]}function g(t,e,s=null){return Object.values(t).find(t=>t.callable===e&&t.delegationSelector===s)}function _(t,e,s){const i="string"==typeof e,n=i?s:e||s;let r=(a=(a=t).replace(o,""),c[a]||a);var a;return h.has(r)||(r=t),[i,n,r]}function m(t,e,s,i,o){if("string"!=typeof e||!t)return;let[r,a,l]=_(e,s,i);if(e in c){const t=t=>function(e){if(!e.relatedTarget||e.relatedTarget!==e.delegateTarget&&!e.delegateTarget.contains(e.relatedTarget))return t.call(this,e)};a=t(a)}const h=d(t),m=h[l]||(h[l]={}),f=g(m,a,r?s:null);if(f)return void(f.oneOff=f.oneOff&&o);const p=u(a,e.replace(n,"")),y=r?function(t,e,s){return function i(n){const o=t.querySelectorAll(e);for(let{target:r}=n;r&&r!==this;r=r.parentNode)for(const a of o)if(a===r)return v(n,{delegateTarget:r}),i.oneOff&&b.off(t,n.type,e,s),s.apply(r,[n])}}(t,s,a):function(t,e){return function s(i){return v(i,{delegateTarget:t}),s.oneOff&&b.off(t,i.type,e),e.apply(t,[i])}}(t,a);y.delegationSelector=r?s:null,y.callable=a,y.oneOff=o,y.uidEvent=p,m[p]=y,t.addEventListener(l,y,r)}function f(t,e,s,i,n){const o=g(e[s],i,n);o&&(t.removeEventListener(s,o,Boolean(n)),delete e[s][o.uidEvent])}function p(t,e,s,i){const n=e[s]||{};for(const[o,r]of Object.entries(n))o.includes(i)&&f(t,e,s,r.callable,r.delegationSelector)}const b={on(t,e,s,i){m(t,e,s,i,!1)},one(t,e,s,i){m(t,e,s,i,!0)},off(t,e,s,i){if("string"!=typeof e||!t)return;const[n,o,a]=_(e,s,i),l=a!==e,c=d(t),h=c[a]||{},u=e.startsWith(".");if(void 0===o){if(u)for(const s of Object.keys(c))p(t,c,s,e.slice(1));for(const[s,i]of Object.entries(h)){const n=s.replace(r,"");l&&!e.includes(n)||f(t,c,a,i.callable,i.delegationSelector)}}else{if(!Object.keys(h).length)return;f(t,c,a,o,n?s:null)}},trigger(t,e,s){if("string"!=typeof e||!t)return null;const i=v(new Event(e,{bubbles:!0,cancelable:!0}),s);return t.dispatchEvent(i),i}};function v(t,e={}){for(const[s,i]of Object.entries(e))try{t[s]=i}catch{Object.defineProperty(t,s,{configurable:!0,get:()=>i})}return t}function y(t){if("true"===t)return!0;if("false"===t)return!1;if(t===Number(t).toString())return Number(t);if(""===t||"null"===t)return null;if("string"!=typeof t)return t;try{return JSON.parse(decodeURIComponent(t))}catch{return t}}function w(t){return t.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}const A={setDataAttribute(t,e,s){t.setAttribute(`data-bs-${w(e)}`,s)},removeDataAttribute(t,e){t.removeAttribute(`data-bs-${w(e)}`)},getDataAttributes(t){if(!t)return{};const e={},s=Object.keys(t.dataset).filter(t=>t.startsWith("bs")&&!t.startsWith("bsConfig"));for(const i of s){let s=i.replace(/^bs/,"");s=s.charAt(0).toLowerCase()+s.slice(1),e[s]=y(t.dataset[i])}return e},getDataAttribute:(t,e)=>y(t.getAttribute(`data-bs-${w(e)}`))},C="transitionend",E=t=>(t&&window.CSS&&window.CSS.escape&&(t=t.replace(/#([^\s"#']+)/g,(t,e)=>`#${CSS.escape(e)}`)),t),T=t=>null==t?`${t}`:Object.prototype.toString.call(t).match(/\s([a-z]+)/i)[1].toLowerCase(),S=t=>{t.dispatchEvent(new Event(C))},k=t=>!(!t||"object"!=typeof t)&&void 0!==t.nodeType,D=t=>k(t)?t:"string"==typeof t&&t.length>0?document.querySelector(E(t)):null,$=t=>{if(!k(t)||0===t.getClientRects().length)return!1;const e="visible"===getComputedStyle(t).getPropertyValue("visibility"),s=t.closest("details:not([open])");if(!s)return e;if(s!==t){const e=t.closest("summary");if(e&&e.parentNode!==s)return!1;if(null===e)return!1}return e},L=t=>!t||t.nodeType!==Node.ELEMENT_NODE||!!t.classList.contains("disabled")||(void 0!==t.disabled?t.disabled:t.hasAttribute("disabled")&&"false"!==t.getAttribute("disabled")),x=t=>{if(!document.documentElement.attachShadow)return null;if("function"==typeof t.getRootNode){const e=t.getRootNode();return e instanceof ShadowRoot?e:null}return t instanceof ShadowRoot?t:t.parentNode?x(t.parentNode):null},I=()=>{},O=t=>{t.offsetHeight},M=()=>"rtl"===document.documentElement.dir,P=(t,e=[],s=t)=>"function"==typeof t?t.call(...e):s,F=(t,e,s=!0)=>{if(!s)return void P(t);const i=(t=>{if(!t)return 0;let{transitionDuration:e,transitionDelay:s}=window.getComputedStyle(t);const i=Number.parseFloat(e),n=Number.parseFloat(s);return i||n?(e=e.split(",")[0],s=s.split(",")[0],1e3*(Number.parseFloat(e)+Number.parseFloat(s))):0})(e)+5;let n=!1;const o=({target:s})=>{s===e&&(n=!0,e.removeEventListener(C,o),P(t))};e.addEventListener(C,o),setTimeout(()=>{n||S(e)},i)},N=(t,e,s,i)=>{const n=t.length;let o=t.indexOf(e);return-1===o?!s&&i?t[n-1]:t[0]:(o+=s?1:-1,i&&(o=(o+n)%n),t[Math.max(0,Math.min(o,n-1))])};class j{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(t){return t=this._mergeConfigObj(t),t=this._configAfterMerge(t),this._typeCheckConfig(t),t}_configAfterMerge(t){return t}_mergeConfigObj(t,e){const s=k(e)?A.getDataAttribute(e,"config"):{};return{...this.constructor.Default,..."object"==typeof s?s:{},...k(e)?A.getDataAttributes(e):{},..."object"==typeof t?t:{}}}_typeCheckConfig(t,e=this.constructor.DefaultType){for(const[s,i]of Object.entries(e)){const e=t[s],n=k(e)?"element":T(e);if(!new RegExp(i).test(n))throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option "${s}" provided type "${n}" but expected type "${i}".`)}}}class H extends j{constructor(t,e){super(),(t=D(t))&&(this._element=t,this._config=this._getConfig(e),i.set(this._element,this.constructor.DATA_KEY,this))}dispose(){i.remove(this._element,this.constructor.DATA_KEY),b.off(this._element,this.constructor.EVENT_KEY);for(const t of Object.getOwnPropertyNames(this))this[t]=null}_queueCallback(t,e,s=!0){F(t,e,s)}_getConfig(t){return t=this._mergeConfigObj(t,this._element),t=this._configAfterMerge(t),this._typeCheckConfig(t),t}static getInstance(t){return i.get(D(t),this.DATA_KEY)}static getOrCreateInstance(t,e={}){return this.getInstance(t)||new this(t,"object"==typeof e?e:null)}static get VERSION(){return"5.3.8"}static get DATA_KEY(){return`bs.${this.NAME}`}static get EVENT_KEY(){return`.${this.DATA_KEY}`}static eventName(t){return`${t}${this.EVENT_KEY}`}}const q=t=>{let e=t.getAttribute("data-bs-target");if(!e||"#"===e){let s=t.getAttribute("href");if(!s||!s.includes("#")&&!s.startsWith("."))return null;s.includes("#")&&!s.startsWith("#")&&(s=`#${s.split("#")[1]}`),e=s&&"#"!==s?s.trim():null}return e?e.split(",").map(t=>E(t)).join(","):null},z={find:(t,e=document.documentElement)=>[].concat(...Element.prototype.querySelectorAll.call(e,t)),findOne:(t,e=document.documentElement)=>Element.prototype.querySelector.call(e,t),children:(t,e)=>[].concat(...t.children).filter(t=>t.matches(e)),parents(t,e){const s=[];let i=t.parentNode.closest(e);for(;i;)s.push(i),i=i.parentNode.closest(e);return s},prev(t,e){let s=t.previousElementSibling;for(;s;){if(s.matches(e))return[s];s=s.previousElementSibling}return[]},next(t,e){let s=t.nextElementSibling;for(;s;){if(s.matches(e))return[s];s=s.nextElementSibling}return[]},focusableChildren(t){const e=["a","button","input","textarea","select","details","[tabindex]",'[contenteditable="true"]'].map(t=>`${t}:not([tabindex^="-"])`).join(",");return this.find(e,t).filter(t=>!L(t)&&$(t))},getSelectorFromElement(t){const e=q(t);return e&&z.findOne(e)?e:null},getElementFromSelector(t){const e=q(t);return e?z.findOne(e):null},getMultipleElementsFromSelector(t){const e=q(t);return e?z.find(e):[]}},W=(t,e="hide")=>{const s=`click.dismiss${t.EVENT_KEY}`,i=t.NAME;b.on(document,s,`[data-bs-dismiss="${i}"]`,function(s){if(["A","AREA"].includes(this.tagName)&&s.preventDefault(),L(this))return;const n=z.getElementFromSelector(this)||this.closest(`.${i}`);t.getOrCreateInstance(n)[e]()})},R=(t,e,s)=>{const i=`${e}:not(.disabled):not(:disabled)`;b.on(document,t,i,function(t){["A","AREA"].includes(this.tagName)&&t.preventDefault();const e=z.getSelectorFromElement(this),i=e?z.find(e):[this];s({targets:i,event:t})})},B=".bs.alert",U=`close${B}`,V=`closed${B}`;class K extends H{static get NAME(){return"alert"}close(){if(b.trigger(this._element,U).defaultPrevented)return;this._element.classList.remove("show");const t=this._element.classList.contains("fade");this._queueCallback(()=>this._destroyElement(),this._element,t)}_destroyElement(){this._element.remove(),b.trigger(this._element,V),this.dispose()}}W(K,"close");const Q='[data-bs-toggle="button"]';class X extends H{static get NAME(){return"button"}toggle(){this._element.setAttribute("aria-pressed",this._element.classList.toggle("active"))}}b.on(document,"click.bs.button.data-api",Q,t=>{t.preventDefault();const e=t.target.closest(Q);X.getOrCreateInstance(e).toggle()});const Y=".bs.swipe",G=`touchstart${Y}`,Z=`touchmove${Y}`,J=`touchend${Y}`,tt=`pointerdown${Y}`,et=`pointerup${Y}`,st={endCallback:null,leftCallback:null,rightCallback:null},it={endCallback:"(function|null)",leftCallback:"(function|null)",rightCallback:"(function|null)"};class nt extends j{constructor(t,e){super(),this._element=t,t&&nt.isSupported()&&(this._config=this._getConfig(e),this._deltaX=0,this._supportPointerEvents=Boolean(window.PointerEvent),this._initEvents())}static get Default(){return st}static get DefaultType(){return it}static get NAME(){return"swipe"}dispose(){b.off(this._element,Y)}_start(t){this._supportPointerEvents?this._eventIsPointerPenTouch(t)&&(this._deltaX=t.clientX):this._deltaX=t.touches[0].clientX}_end(t){this._eventIsPointerPenTouch(t)&&(this._deltaX=t.clientX-this._deltaX),this._handleSwipe(),P(this._config.endCallback)}_move(t){this._deltaX=t.touches&&t.touches.length>1?0:t.touches[0].clientX-this._deltaX}_handleSwipe(){const t=Math.abs(this._deltaX);if(t<=40)return;const e=t/this._deltaX;this._deltaX=0,e&&P(e>0?this._config.rightCallback:this._config.leftCallback)}_initEvents(){this._supportPointerEvents?(b.on(this._element,tt,t=>this._start(t)),b.on(this._element,et,t=>this._end(t)),this._element.classList.add("pointer-event")):(b.on(this._element,G,t=>this._start(t)),b.on(this._element,Z,t=>this._move(t)),b.on(this._element,J,t=>this._end(t)))}_eventIsPointerPenTouch(t){return this._supportPointerEvents&&("pen"===t.pointerType||"touch"===t.pointerType)}static isSupported(){return"ontouchstart"in document.documentElement||navigator.maxTouchPoints>0}}const ot=".bs.carousel",rt=".data-api",at="ArrowLeft",lt="ArrowRight",ct="next",ht="prev",ut="left",dt="right",gt=`slide${ot}`,_t=`slid${ot}`,mt=`keydown${ot}`,ft=`mouseenter${ot}`,pt=`mouseleave${ot}`,bt=`dragstart${ot}`,vt=`load${ot}${rt}`,yt=`click${ot}${rt}`,wt="carousel",At="active",Ct=".active",Et=".carousel-item",Tt=Ct+Et,St={[at]:dt,[lt]:ut},kt={interval:5e3,keyboard:!0,pause:"hover",ride:!1,touch:!0,wrap:!0},Dt={interval:"(number|boolean)",keyboard:"boolean",pause:"(string|boolean)",ride:"(boolean|string)",touch:"boolean",wrap:"boolean"};class $t extends H{constructor(t,e){super(t,e),this._interval=null,this._activeElement=null,this._isSliding=!1,this.touchTimeout=null,this._swipeHelper=null,this._indicatorsElement=z.findOne(".carousel-indicators",this._element),this._addEventListeners(),this._config.ride===wt&&this.cycle()}static get Default(){return kt}static get DefaultType(){return Dt}static get NAME(){return"carousel"}next(){this._slide(ct)}nextWhenVisible(){!document.hidden&&$(this._element)&&this.next()}prev(){this._slide(ht)}pause(){this._isSliding&&S(this._element),this._clearInterval()}cycle(){this._clearInterval(),this._updateInterval(),this._interval=setInterval(()=>this.nextWhenVisible(),this._config.interval)}_maybeEnableCycle(){this._config.ride&&(this._isSliding?b.one(this._element,_t,()=>this.cycle()):this.cycle())}to(t){const e=this._getItems();if(t>e.length-1||t<0)return;if(this._isSliding)return void b.one(this._element,_t,()=>this.to(t));const s=this._getItemIndex(this._getActive());if(s===t)return;const i=t>s?ct:ht;this._slide(i,e[t])}dispose(){this._swipeHelper&&this._swipeHelper.dispose(),super.dispose()}_configAfterMerge(t){return t.defaultInterval=t.interval,t}_addEventListeners(){this._config.keyboard&&b.on(this._element,mt,t=>this._keydown(t)),"hover"===this._config.pause&&(b.on(this._element,ft,()=>this.pause()),b.on(this._element,pt,()=>this._maybeEnableCycle())),this._config.touch&&nt.isSupported()&&this._addTouchEventListeners()}_addTouchEventListeners(){for(const t of z.find(".carousel-item img",this._element))b.on(t,bt,t=>t.preventDefault());const t={leftCallback:()=>this._slide(this._directionToOrder(ut)),rightCallback:()=>this._slide(this._directionToOrder(dt)),endCallback:()=>{"hover"===this._config.pause&&(this.pause(),this.touchTimeout&&clearTimeout(this.touchTimeout),this.touchTimeout=setTimeout(()=>this._maybeEnableCycle(),500+this._config.interval))}};this._swipeHelper=new nt(this._element,t)}_keydown(t){if(/input|textarea/i.test(t.target.tagName))return;const e=St[t.key];e&&(t.preventDefault(),this._slide(this._directionToOrder(e)))}_getItemIndex(t){return this._getItems().indexOf(t)}_setActiveIndicatorElement(t){if(!this._indicatorsElement)return;const e=z.findOne(Ct,this._indicatorsElement);e.classList.remove(At),e.removeAttribute("aria-current");const s=z.findOne(`[data-bs-slide-to="${t}"]`,this._indicatorsElement);s&&(s.classList.add(At),s.setAttribute("aria-current","true"))}_updateInterval(){const t=this._activeElement||this._getActive();if(!t)return;const e=Number.parseInt(t.getAttribute("data-bs-interval"),10);this._config.interval=e||this._config.defaultInterval}_slide(t,e=null){if(this._isSliding)return;const s=this._getActive(),i=t===ct,n=e||N(this._getItems(),s,i,this._config.wrap);if(n===s)return;const o=this._getItemIndex(n),r=e=>b.trigger(this._element,e,{relatedTarget:n,direction:this._orderToDirection(t),from:this._getItemIndex(s),to:o});if(r(gt).defaultPrevented)return;if(!s||!n)return;const a=Boolean(this._interval);this.pause(),this._isSliding=!0,this._setActiveIndicatorElement(o),this._activeElement=n;const l=i?"carousel-item-start":"carousel-item-end",c=i?"carousel-item-next":"carousel-item-prev";n.classList.add(c),O(n),s.classList.add(l),n.classList.add(l),this._queueCallback(()=>{n.classList.remove(l,c),n.classList.add(At),s.classList.remove(At,c,l),this._isSliding=!1,r(_t)},s,this._isAnimated()),a&&this.cycle()}_isAnimated(){return this._element.classList.contains("slide")}_getActive(){return z.findOne(Tt,this._element)}_getItems(){return z.find(Et,this._element)}_clearInterval(){this._interval&&(clearInterval(this._interval),this._interval=null)}_directionToOrder(t){return M()?t===ut?ht:ct:t===ut?ct:ht}_orderToDirection(t){return M()?t===ht?ut:dt:t===ht?dt:ut}}b.on(document,yt,"[data-bs-slide], [data-bs-slide-to]",function(t){const e=z.getElementFromSelector(this);if(!e||!e.classList.contains(wt))return;t.preventDefault();const s=$t.getOrCreateInstance(e),i=this.getAttribute("data-bs-slide-to");return i?(s.to(i),void s._maybeEnableCycle()):"next"===A.getDataAttribute(this,"slide")?(s.next(),void s._maybeEnableCycle()):(s.prev(),void s._maybeEnableCycle())}),b.on(window,vt,()=>{const t=z.find('[data-bs-ride="carousel"]');for(const e of t)$t.getOrCreateInstance(e)});const Lt=".bs.collapse",xt=`show${Lt}`,It=`shown${Lt}`,Ot=`hide${Lt}`,Mt=`hidden${Lt}`,Pt=`click${Lt}.data-api`,Ft="show",Nt="collapse",jt="collapsing",Ht=`:scope .${Nt} .${Nt}`,qt='[data-bs-toggle="collapse"]',zt={parent:null,toggle:!0},Wt={parent:"(null|element)",toggle:"boolean"};class Rt extends H{constructor(t,e){super(t,e),this._isTransitioning=!1,this._triggerArray=[];const s=z.find(qt);for(const t of s){const e=z.getSelectorFromElement(t),s=z.find(e).filter(t=>t===this._element);null!==e&&s.length&&this._triggerArray.push(t)}this._initializeChildren(),this._config.parent||this._addAriaAndCollapsedClass(this._triggerArray,this._isShown()),this._config.toggle&&this.toggle()}static get Default(){return zt}static get DefaultType(){return Wt}static get NAME(){return"collapse"}toggle(){this._isShown()?this.hide():this.show()}show(){if(this._isTransitioning||this._isShown())return;let t=[];if(this._config.parent&&(t=this._getFirstLevelChildren(".collapse.show, .collapse.collapsing").filter(t=>t!==this._element).map(t=>Rt.getOrCreateInstance(t,{toggle:!1}))),t.length&&t[0]._isTransitioning)return;if(b.trigger(this._element,xt).defaultPrevented)return;for(const e of t)e.hide();const e=this._getDimension();this._element.classList.remove(Nt),this._element.classList.add(jt),this._element.style[e]=0,this._addAriaAndCollapsedClass(this._triggerArray,!0),this._isTransitioning=!0;const s=`scroll${e[0].toUpperCase()+e.slice(1)}`;this._queueCallback(()=>{this._isTransitioning=!1,this._element.classList.remove(jt),this._element.classList.add(Nt,Ft),this._element.style[e]="",b.trigger(this._element,It)},this._element,!0),this._element.style[e]=`${this._element[s]}px`}hide(){if(this._isTransitioning||!this._isShown())return;if(b.trigger(this._element,Ot).defaultPrevented)return;const t=this._getDimension();this._element.style[t]=`${this._element.getBoundingClientRect()[t]}px`,O(this._element),this._element.classList.add(jt),this._element.classList.remove(Nt,Ft);for(const t of this._triggerArray){const e=z.getElementFromSelector(t);e&&!this._isShown(e)&&this._addAriaAndCollapsedClass([t],!1)}this._isTransitioning=!0,this._element.style[t]="",this._queueCallback(()=>{this._isTransitioning=!1,this._element.classList.remove(jt),this._element.classList.add(Nt),b.trigger(this._element,Mt)},this._element,!0)}_isShown(t=this._element){return t.classList.contains(Ft)}_configAfterMerge(t){return t.toggle=Boolean(t.toggle),t.parent=D(t.parent),t}_getDimension(){return this._element.classList.contains("collapse-horizontal")?"width":"height"}_initializeChildren(){if(!this._config.parent)return;const t=this._getFirstLevelChildren(qt);for(const e of t){const t=z.getElementFromSelector(e);t&&this._addAriaAndCollapsedClass([e],this._isShown(t))}}_getFirstLevelChildren(t){const e=z.find(Ht,this._config.parent);return z.find(t,this._config.parent).filter(t=>!e.includes(t))}_addAriaAndCollapsedClass(t,e){if(t.length)for(const s of t)s.classList.toggle("collapsed",!e),s.setAttribute("aria-expanded",e)}}b.on(document,Pt,qt,function(t){("A"===t.target.tagName||t.delegateTarget&&"A"===t.delegateTarget.tagName)&&t.preventDefault();for(const t of z.getMultipleElementsFromSelector(this))Rt.getOrCreateInstance(t,{toggle:!1}).toggle()});const Bt=".bs.datepicker",Ut=".data-api",Vt=`change${Bt}`,Kt=`show${Bt}`,Qt=`shown${Bt}`,Xt=`hide${Bt}`,Yt=`hidden${Bt}`,Gt=`click${Bt}${Ut}`,Zt=`focusin${Bt}${Ut}`,Jt='[data-bs-toggle="datepicker"]',te={datepickerTheme:null,dateMin:null,dateMax:null,dateFormat:null,displayElement:null,displayMonthsCount:1,firstWeekday:1,inline:!1,locale:"default",positionElement:null,selectedDates:[],selectionMode:"single",placement:"left",vcpOptions:{}},ee={datepickerTheme:"(null|string)",dateMin:"(null|string|number|object)",dateMax:"(null|string|number|object)",dateFormat:"(null|object|function)",displayElement:"(null|string|element|boolean)",displayMonthsCount:"number",firstWeekday:"number",inline:"boolean",locale:"string",positionElement:"(null|string|element)",selectedDates:"array",selectionMode:"string",placement:"string",vcpOptions:"object"};class se extends H{constructor(t,e){super(t,e),this._calendar=null,this._isShown=!1,this._initCalendar()}static get Default(){return te}static get DefaultType(){return ee}static get NAME(){return"datepicker"}toggle(){if(!this._config.inline)return this._isShown?this.hide():this.show()}show(){this._config.inline||!this._calendar||L(this._element)||this._isShown||b.trigger(this._element,Kt).defaultPrevented||(this._calendar.show(),this._isShown=!0,b.trigger(this._element,Qt))}hide(){this._config.inline||this._calendar&&this._isShown&&(b.trigger(this._element,Xt).defaultPrevented||(this._calendar.hide(),this._isShown=!1,b.trigger(this._element,Yt)))}dispose(){this._themeObserver&&(this._themeObserver.disconnect(),this._themeObserver=null),this._calendar&&this._calendar.destroy(),this._calendar=null,super.dispose()}getSelectedDates(){const t=this._calendar?.context?.selectedDates;return t?[...t]:[]}setSelectedDates(t){this._calendar&&this._calendar.set({selectedDates:t})}_initCalendar(){this._isInput="INPUT"===this._element.tagName,this._isInline=this._config.inline,this._isInline&&!this._isInput&&(this._boundInput=this._element.querySelector('input[type="hidden"], input[name]')),this._positionElement=this._resolvePositionElement(),this._displayElement=this._resolveDisplayElement();const e=this._buildCalendarOptions();this._calendar=new t.Calendar(this._positionElement,e),this._calendar.init(),this._setupThemeObserver(),this._isInput&&this._element.value&&this._parseInputValue(),this._updateDisplayWithSelectedDates()}_updateDisplayWithSelectedDates(){const{selectedDates:t}=this._config;if(!t||0===t.length)return;const e=this._formatDateForInput(t);this._isInput&&(this._element.value=e),this._boundInput&&(this._boundInput.value=t.join(",")),this._displayElement&&(this._displayElement.textContent=e)}_resolvePositionElement(){let{positionElement:t}=this._config;if("string"==typeof t&&(t=document.querySelector(t)),!t&&this._isInput&&!this._isInline){const e=this._element.closest(".form-adorn");e&&(t=e)}return t||this._element}_resolveDisplayElement(){const{displayElement:t}=this._config;return"string"==typeof t?document.querySelector(t):!0===t||null===t&&!this._isInput&&!this._isInline?this._element.querySelector("[data-bs-datepicker-display]")||this._element:t}_getThemeAncestor(){return this._element.closest("[data-bs-theme]")}_getEffectiveTheme(){const{datepickerTheme:t}=this._config;if(t)return t;const e=this._getThemeAncestor();return e?.getAttribute("data-bs-theme")||null}_syncThemeAttribute(t){if(!t)return;const e=this._getEffectiveTheme();e?t.setAttribute("data-bs-theme",e):t.removeAttribute("data-bs-theme")}_setupThemeObserver(){const t=this._getThemeAncestor();t&&!this._config.datepickerTheme&&(this._themeObserver=new MutationObserver(()=>{this._syncThemeAttribute(this._calendar?.context?.mainElement)}),this._themeObserver.observe(t,{attributes:!0,attributeFilter:["data-bs-theme"]}))}_buildCalendarOptions(){const t=this._getEffectiveTheme(),e=t&&"auto"!==t?t:"system",s={...this._config.vcpOptions,inputMode:!this._isInline,positionToInput:this._config.placement,firstWeekday:this._config.firstWeekday,locale:this._config.locale,selectionDatesMode:this._config.selectionMode,selectedDates:this._config.selectedDates,displayMonthsCount:this._config.displayMonthsCount,type:this._config.displayMonthsCount>1?"multiple":"default",selectedTheme:e,themeAttrDetect:"[data-bs-theme]",onClickDate:(t,e)=>this._handleDateClick(t,e),onInit:t=>{this._syncThemeAttribute(t.context.mainElement)},onShow:()=>{this._isShown=!0,this._syncThemeAttribute(this._calendar.context.mainElement)},onHide:()=>{this._isShown=!1}};if(this._config.selectedDates.length>0){const t=this._parseDate(this._config.selectedDates[0]);s.selectedMonth=t.getMonth(),s.selectedYear=t.getFullYear()}return this._config.dateMin&&(s.dateMin=this._config.dateMin),this._config.dateMax&&(s.dateMax=this._config.dateMax),s}_handleDateClick(t,e){const s=[...t.context.selectedDates];if(s.length>0){const t=this._formatDateForInput(s);this._isInput&&(this._element.value=t),this._boundInput&&(this._boundInput.value=s.join(",")),this._displayElement&&(this._displayElement.textContent=t)}b.trigger(this._element,Vt,{dates:s,event:e}),this._maybeHideAfterSelection(s)}_maybeHideAfterSelection(t){this._isInline||("single"===this._config.selectionMode&&t.length>0||"multiple-ranged"===this._config.selectionMode&&t.length>=2)&&setTimeout(()=>this.hide(),100)}_parseDate(t){const[e,s,i]=t.split("-");return new Date(e,s-1,i)}_formatDate(t){const e=this._parseDate(t),s="default"===this._config.locale?void 0:this._config.locale,{dateFormat:i}=this._config;return"function"==typeof i?i(e,s):i&&"object"==typeof i?new Intl.DateTimeFormat(s,i).format(e):e.toLocaleDateString(s)}_formatDateForInput(t){if(0===t.length)return"";if(1===t.length)return this._formatDate(t[0]);const e="multiple-ranged"===this._config.selectionMode?" – ":", ";return t.map(t=>this._formatDate(t)).join(e)}_parseInputValue(){const t=this._element.value.trim();if(!t)return;const e=new Date(t);if(!Number.isNaN(e.getTime())){const t=`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`;this._calendar.set({selectedDates:[t]})}}}b.on(document,Gt,Jt,function(t){"INPUT"!==this.tagName&&"true"!==this.dataset.bsInline&&(t.preventDefault(),se.getOrCreateInstance(this).toggle())}),b.on(document,Zt,Jt,function(){"INPUT"===this.tagName&&se.getOrCreateInstance(this).show()}),b.on(document,`DOMContentLoaded${Bt}${Ut}`,()=>{for(const t of document.querySelectorAll(`${Jt}[data-bs-inline="true"]`))se.getOrCreateInstance(t)});const ie=".bs.dialog",ne=`show${ie}`,oe=`shown${ie}`,re=`hide${ie}`,ae=`hidden${ie}`,le=`hidePrevented${ie}`,ce=`cancel${ie}`,he=`click${ie}.data-api`,ue="dialog-static",de="dialog-open",ge="dialog-nonmodal",_e={backdrop:!0,keyboard:!0,modal:!0},me={backdrop:"(boolean|string)",keyboard:"boolean",modal:"boolean"};class fe extends H{constructor(t,e){super(t,e),this._isTransitioning=!1,this._addEventListeners()}static get Default(){return _e}static get DefaultType(){return me}static get NAME(){return"dialog"}toggle(t){return this._element.open?this.hide():this.show(t)}show(t){this._element.open||this._isTransitioning||b.trigger(this._element,ne,{relatedTarget:t}).defaultPrevented||(this._isTransitioning=!0,this._config.modal?(this._element.showModal(),document.body.classList.add(de)):(this._element.classList.add(ge),this._element.show()),this._queueCallback(()=>{this._isTransitioning=!1,b.trigger(this._element,oe,{relatedTarget:t})},this._element,this._isAnimated()))}hide(){this._element.open&&!this._isTransitioning&&(b.trigger(this._element,re).defaultPrevented||(this._isTransitioning=!0,this._queueCallback(()=>this._hideDialog(),this._element,this._isAnimated())))}dispose(){b.off(this._element,ie),super.dispose()}handleUpdate(){}_hideDialog(){this._element.close(),this._element.classList.remove(ge),this._isTransitioning=!1,document.querySelector("dialog.dialog[open]:not(.dialog-nonmodal)")||document.body.classList.remove(de),b.trigger(this._element,ae)}_isAnimated(){return this._element.classList.contains("fade")}_triggerBackdropTransition(){b.trigger(this._element,le).defaultPrevented||(this._element.classList.add(ue),this._queueCallback(()=>{this._element.classList.remove(ue)},this._element))}_addEventListeners(){b.on(this._element,"cancel",t=>{t.preventDefault(),this._config.keyboard?(b.trigger(this._element,ce),this.hide()):this._triggerBackdropTransition()}),b.on(this._element,"keydown",t=>{"Escape"!==t.key||this._config.modal||(t.preventDefault(),this._config.keyboard&&(b.trigger(this._element,ce),this.hide()))}),b.on(this._element,"click",t=>{t.target===this._element&&this._config.modal&&("static"!==this._config.backdrop?this.hide():this._triggerBackdropTransition())})}}b.on(document,he,'[data-bs-toggle="dialog"]',function(t){const e=z.getElementFromSelector(this);["A","AREA"].includes(this.tagName)&&t.preventDefault(),b.one(e,ne,t=>{t.defaultPrevented||b.one(e,ae,()=>{$(this)&&this.focus()})});const s=A.getDataAttributes(this),i=this.closest("dialog[open]");if(i&&i!==e){fe.getOrCreateInstance(e,s).show(this);const t=fe.getInstance(i);return void(t&&t.hide())}fe.getOrCreateInstance(e,s).toggle(this)}),W(fe);const pe={sm:576,md:768,lg:1024,xl:1280,"2xl":1536},be=(t,e="bottom")=>{if(!t||!t.includes(":"))return null;const s=t.split(/\s+/),i={xs:e};for(const t of s)if(t.includes(":")){const[e,s]=t.split(":");void 0!==pe[e]&&(i[e]=s)}else i.xs=t;return i},ve=(t,e="bottom")=>{if(!t)return e;const s=window.innerWidth;let i=t.xs||e;const n=["sm","md","lg","xl","2xl"];for(const e of n)s>=pe[e]&&t[e]&&(i=t[e]);return i},ye=t=>{const e=[];for(const s of Object.keys(pe)){const i=pe[s],n=window.matchMedia(`(min-width: ${i}px)`);n.addEventListener("change",t),e.push({mql:n,handler:t})}return e},we=t=>{for(const{mql:e,handler:s}of t)e.removeEventListener("change",s)},Ae="dropdown",Ce=".bs.dropdown",Ee=".data-api",Te="ArrowUp",Se="ArrowDown",ke="ArrowLeft",De="ArrowRight",$e="Home",Le="End",xe="Enter",Ie=" ",Oe=`hide${Ce}`,Me=`hidden${Ce}`,Pe=`show${Ce}`,Fe=`shown${Ce}`,Ne=`click${Ce}${Ee}`,je=`keydown${Ce}${Ee}`,He=`keyup${Ce}${Ee}`,qe="show",ze='[data-bs-toggle="dropdown"]:not(.disabled):not(:disabled)',We=`${ze}.${qe}`,Re=".dropdown-menu",Be=".dropdown-submenu",Ue=".dropdown-submenu > .dropdown-item",Ve=".dropdown-item:not(.disabled):not(:disabled)",Ke="bottom-start",Qe=t=>M()?t.replace(/^start(?=-|$)/,"right").replace(/^end(?=-|$)/,"left"):t.replace(/^start(?=-|$)/,"left").replace(/^end(?=-|$)/,"right"),Xe=(t,e,s)=>(t.x-s.x)*(e.y-s.y)-(e.x-s.x)*(t.y-s.y),Ye={autoClose:!0,boundary:"clippingParents",display:"dynamic",offset:[0,2],floatingConfig:null,placement:Ke,reference:"toggle",submenuTrigger:"both",submenuDelay:100},Ge={autoClose:"(boolean|string)",boundary:"(string|element)",display:"string",offset:"(array|string|function)",floatingConfig:"(null|object|function)",placement:"string",reference:"(string|element|object)",submenuTrigger:"string",submenuDelay:"number"};class Ze extends H{constructor(t,s){if(void 0===e.computePosition)throw new TypeError("Bootstrap's dropdowns require Floating UI (https://floating-ui.com)");super(t,s),this._floatingCleanup=null,this._mediaQueryListeners=[],this._responsivePlacements=null,this._parent=this._element.parentNode,this._isSubmenu=this._parent.classList.contains("dropdown-submenu"),this._openSubmenus=new Map,this._submenuCloseTimeouts=new Map,this._hoverIntentData=null,this._menu=z.next(this._element,Re)[0]||z.prev(this._element,Re)[0]||z.findOne(Re,this._parent),this._parseResponsivePlacements(),this._setupSubmenuListeners()}static get Default(){return Ye}static get DefaultType(){return Ge}static get NAME(){return Ae}toggle(){return this._isShown()?this.hide():this.show()}show(){if(L(this._element)||this._isShown())return;const t={relatedTarget:this._element};if(!b.trigger(this._element,Pe,t).defaultPrevented){if(this._createFloating(),"ontouchstart"in document.documentElement&&!this._parent.closest(".navbar-nav"))for(const t of[].concat(...document.body.children))b.on(t,"mouseover",I);this._element.focus(),this._element.setAttribute("aria-expanded","true"),this._menu.classList.add(qe),this._element.classList.add(qe),this._parent.classList.add(qe),b.trigger(this._element,Fe,t)}}hide(){if(L(this._element)||!this._isShown())return;const t={relatedTarget:this._element};this._completeHide(t)}dispose(){this._disposeFloating(),this._disposeMediaQueryListeners(),this._closeAllSubmenus(),this._clearAllSubmenuTimeouts(),super.dispose()}update(){this._floatingCleanup&&this._updateFloatingPosition()}_completeHide(t){if(!b.trigger(this._element,Oe,t).defaultPrevented){if(this._closeAllSubmenus(),"ontouchstart"in document.documentElement)for(const t of[].concat(...document.body.children))b.off(t,"mouseover",I);this._disposeFloating(),this._menu.classList.remove(qe),this._element.classList.remove(qe),this._parent.classList.remove(qe),this._element.setAttribute("aria-expanded","false"),A.removeDataAttribute(this._menu,"placement"),A.removeDataAttribute(this._menu,"display"),b.trigger(this._element,Me,t)}}_getConfig(t){if("object"==typeof(t=super._getConfig(t)).reference&&!k(t.reference)&&"function"!=typeof t.reference.getBoundingClientRect)throw new TypeError(`${Ae.toUpperCase()}: Option "reference" provided type "object" without a required "getBoundingClientRect" method.`);return t}_createFloating(){if("static"===this._config.display)return void A.setDataAttribute(this._menu,"display","static");let t=this._element;"parent"===this._config.reference?t=this._parent:k(this._config.reference)?t=D(this._config.reference):"object"==typeof this._config.reference&&(t=this._config.reference),this._updateFloatingPosition(t),this._floatingCleanup=e.autoUpdate(t,this._menu,()=>this._updateFloatingPosition(t))}async _updateFloatingPosition(t=null){if(!this._menu)return;t||(t="parent"===this._config.reference?this._parent:k(this._config.reference)?D(this._config.reference):"object"==typeof this._config.reference?this._config.reference:this._element);const e=this._getPlacement(),s=this._getFloatingMiddleware(),i=this._getFloatingConfig(e,s);await this._applyFloatingPosition(t,this._menu,i.placement,i.middleware)}_isShown(){return this._menu.classList.contains(qe)}_getPlacement(){const t=this._responsivePlacements?ve(this._responsivePlacements,Ke):this._config.placement;return Qe(t)}_parseResponsivePlacements(){this._responsivePlacements=be(this._config.placement,Ke),this._responsivePlacements&&this._setupMediaQueryListeners()}_setupMediaQueryListeners(){this._disposeMediaQueryListeners(),this._mediaQueryListeners=ye(()=>{this._isShown()&&this._updateFloatingPosition()})}_disposeMediaQueryListeners(){we(this._mediaQueryListeners),this._mediaQueryListeners=[]}_getOffset(){const{offset:t}=this._config;return"string"==typeof t?t.split(",").map(t=>Number.parseInt(t,10)):"function"==typeof t?({placement:e,rects:s})=>t({placement:e,reference:s.reference,floating:s.floating},this._element):t}_getFloatingMiddleware(){const t=this._getOffset();return[e.offset("function"==typeof t?t:{mainAxis:t[1]||0,crossAxis:t[0]||0}),e.flip({fallbackPlacements:this._getFallbackPlacements()}),e.shift({boundary:"clippingParents"===this._config.boundary?"clippingAncestors":this._config.boundary})]}_getFallbackPlacements(){return{bottom:["top","bottom-start","bottom-end","top-start","top-end"],"bottom-start":["top-start","bottom-end","top-end"],"bottom-end":["top-end","bottom-start","top-start"],top:["bottom","top-start","top-end","bottom-start","bottom-end"],"top-start":["bottom-start","top-end","bottom-end"],"top-end":["bottom-end","top-start","bottom-start"],right:["left","right-start","right-end","left-start","left-end"],"right-start":["left-start","right-end","left-end","top-start","bottom-start"],"right-end":["left-end","right-start","left-start","top-end","bottom-end"],left:["right","left-start","left-end","right-start","right-end"],"left-start":["right-start","left-end","right-end","top-start","bottom-start"],"left-end":["right-end","left-start","right-start","top-end","bottom-end"]}[this._getPlacement()]||["top","bottom","right","left"]}_getFloatingConfig(t,e){const s={placement:t,middleware:e};return{...s,...P(this._config.floatingConfig,[void 0,s])}}_disposeFloating(){this._floatingCleanup&&(this._floatingCleanup(),this._floatingCleanup=null)}async _applyFloatingPosition(t,s,i,n){if(!s.isConnected)return null;const{x:o,y:r,placement:a}=await e.computePosition(t,s,{placement:i,middleware:n});return s.isConnected?(Object.assign(s.style,{position:"absolute",left:`${o}px`,top:`${r}px`,margin:"0"}),A.setDataAttribute(s,"placement",a),a):null}_setupSubmenuListeners(){"hover"!==this._config.submenuTrigger&&"both"!==this._config.submenuTrigger||(b.on(this._menu,"mouseenter",Ue,t=>{this._onSubmenuTriggerEnter(t)}),b.on(this._menu,"mouseleave",Be,t=>{this._onSubmenuLeave(t)}),b.on(this._menu,"mousemove",t=>{this._trackMousePosition(t)})),"click"!==this._config.submenuTrigger&&"both"!==this._config.submenuTrigger||b.on(this._menu,"click",Ue,t=>{this._onSubmenuTriggerClick(t)})}_onSubmenuTriggerEnter(t){const e=t.target.closest(Ue);if(!e)return;const s=e.closest(Be),i=z.findOne(Re,s);i&&(this._cancelSubmenuCloseTimeout(i),this._closeSiblingSubmenus(s),this._openSubmenu(e,i,s))}_onSubmenuLeave(t){const e=t.target.closest(Be),s=z.findOne(Re,e);s&&this._openSubmenus.has(s)&&(this._isMovingTowardSubmenu(t,s)||this._scheduleSubmenuClose(s,e))}_onSubmenuTriggerClick(t){const e=t.target.closest(Ue);if(!e)return;t.preventDefault(),t.stopPropagation();const s=e.closest(Be),i=z.findOne(Re,s);i&&(this._openSubmenus.has(i)?this._closeSubmenu(i,s):(this._closeSiblingSubmenus(s),this._openSubmenu(e,i,s)))}_openSubmenu(t,e,s){if(this._openSubmenus.has(e))return;t.setAttribute("aria-expanded","true"),t.setAttribute("aria-haspopup","true"),e.classList.add(qe),s.classList.add(qe);const i=this._createSubmenuFloating(t,e,s);this._openSubmenus.set(e,i),b.on(e,"mouseenter",()=>{this._cancelSubmenuCloseTimeout(e)})}_closeSubmenu(t,e){if(!this._openSubmenus.has(t))return;const s=z.find(`${Be} ${Re}.${qe}`,t);for(const t of s){const e=t.closest(Be);this._closeSubmenu(t,e)}const i=z.findOne(Ue,e),n=this._openSubmenus.get(t);n&&n(),this._openSubmenus.delete(t),b.off(t,"mouseenter"),i&&i.setAttribute("aria-expanded","false"),t.classList.remove(qe),e.classList.remove(qe),t.style.position="",t.style.left="",t.style.top="",t.style.margin=""}_closeAllSubmenus(){for(const[t]of this._openSubmenus){const e=t.closest(Be);this._closeSubmenu(t,e)}}_closeSiblingSubmenus(t){const e=t.parentNode,s=z.find(`${Be} > ${Re}.${qe}`,e);for(const e of s){const s=e.closest(Be);s!==t&&this._closeSubmenu(e,s)}}_createSubmenuFloating(t,s,i){const n=i,o=Qe("end-start"),r=[e.offset({mainAxis:0,crossAxis:-4}),e.flip({fallbackPlacements:[Qe("start-start"),Qe("end-end"),Qe("start-end")]}),e.shift({padding:8})],a=()=>this._applyFloatingPosition(n,s,o,r);return a(),e.autoUpdate(n,s,a)}_scheduleSubmenuClose(t,e){this._cancelSubmenuCloseTimeout(t);const s=setTimeout(()=>{this._closeSubmenu(t,e),this._submenuCloseTimeouts.delete(t)},this._config.submenuDelay);this._submenuCloseTimeouts.set(t,s)}_cancelSubmenuCloseTimeout(t){const e=this._submenuCloseTimeouts.get(t);e&&(clearTimeout(e),this._submenuCloseTimeouts.delete(t))}_clearAllSubmenuTimeouts(){for(const t of this._submenuCloseTimeouts.values())clearTimeout(t);this._submenuCloseTimeouts.clear()}_trackMousePosition(t){this._hoverIntentData={x:t.clientX,y:t.clientY,timestamp:Date.now()}}_isMovingTowardSubmenu(t,e){if(!this._hoverIntentData)return!1;const s=e.getBoundingClientRect(),i={x:t.clientX,y:t.clientY},n={x:this._hoverIntentData.x,y:this._hoverIntentData.y},o=M()?s.right:s.left,r={x:o,y:s.top},a={x:o,y:s.bottom};return this._pointInTriangle(i,n,r,a)}_pointInTriangle(t,e,s,i){const n=Xe(t,e,s),o=Xe(t,s,i),r=Xe(t,i,e);return!((n<0||o<0||r<0)&&(n>0||o>0||r>0))}_selectMenuItem({key:t,target:e}){const s=e.closest(Re)||this._menu,i=z.find(`:scope > li > ${Ve}, :scope > ${Ve}`,s).filter(t=>$(t));i.length&&N(i,e,t===Se,!i.includes(e)).focus()}_handleSubmenuKeydown(t){const{key:e,target:s}=t,i=M(),n=i?ke:De,o=i?De:ke,r=s.closest(Be),a=r&&s.matches(Ue);if((e===xe||e===Ie)&&a){t.preventDefault(),t.stopPropagation();const e=z.findOne(Re,r);return e&&(this._closeSiblingSubmenus(r),this._openSubmenu(s,e,r),requestAnimationFrame(()=>{const t=z.findOne(Ve,e);t&&t.focus()})),!0}if(e===n&&a){t.preventDefault(),t.stopPropagation();const e=z.findOne(Re,r);return e&&(this._closeSiblingSubmenus(r),this._openSubmenu(s,e,r),requestAnimationFrame(()=>{const t=z.findOne(Ve,e);t&&t.focus()})),!0}if(e===o){const e=s.closest(Re),i=e?.closest(Be);if(i){t.preventDefault(),t.stopPropagation();const s=z.findOne(Ue,i);return this._closeSubmenu(e,i),s&&s.focus(),!0}}if(e===$e||e===Le){t.preventDefault(),t.stopPropagation();const i=s.closest(Re),n=z.find(`:scope > li > ${Ve}, :scope > ${Ve}`,i).filter(t=>$(t));return n.length&&(e===$e?n[0]:n[n.length-1]).focus(),!0}return!1}static clearMenus(t){if(2===t.button||"keyup"===t.type&&"Tab"!==t.key)return;const e=z.find(We);for(const s of e){const e=Ze.getInstance(s);if(!e||!1===e._config.autoClose)continue;const i=t.composedPath(),n=i.includes(e._menu);if(i.includes(e._element)||"inside"===e._config.autoClose&&!n||"outside"===e._config.autoClose&&n)continue;if(e._menu.contains(t.target)&&("keyup"===t.type&&"Tab"===t.key||/input|select|option|textarea|form/i.test(t.target.tagName)))continue;const o={relatedTarget:e._element};"click"===t.type&&(o.clickEvent=t),e._completeHide(o)}}static dataApiKeydownHandler(t){const e=/input|textarea/i.test(t.target.tagName),s="Escape"===t.key,i=[Te,Se].includes(t.key),n=[ke,De].includes(t.key),o=[$e,Le].includes(t.key),r=[xe,Ie].includes(t.key),a=t.target.matches(Ue);if(!(i||s||n||o||r&&a))return;if(e&&!s)return;const l=this.matches(ze)?this:z.prev(this,ze)[0]||z.next(this,ze)[0]||z.findOne(ze,t.delegateTarget.parentNode);if(!l)return;const c=Ze.getOrCreateInstance(l);if(!(n||o||r&&a)||!c._handleSubmenuKeydown(t)){if(i)return t.preventDefault(),t.stopPropagation(),c.show(),void c._selectMenuItem(t);if(s&&c._isShown()){t.preventDefault(),t.stopPropagation();const e=t.target.closest(Re),s=e?.closest(Be);if(s&&c._openSubmenus.size>0){const t=z.findOne(Ue,s);return c._closeSubmenu(e,s),void(t&&t.focus())}c.hide(),l.focus()}}}}b.on(document,je,ze,Ze.dataApiKeydownHandler),b.on(document,je,Re,Ze.dataApiKeydownHandler),b.on(document,Ne,Ze.clearMenus),b.on(document,He,Ze.clearMenus),b.on(document,Ne,ze,function(t){t.preventDefault(),Ze.getOrCreateInstance(this).toggle()});const Je="backdrop",ts="show",es=`mousedown.bs.${Je}`,ss={className:"modal-backdrop",clickCallback:null,isAnimated:!1,isVisible:!0,rootElement:"body"},is={className:"string",clickCallback:"(function|null)",isAnimated:"boolean",isVisible:"boolean",rootElement:"(element|string)"};class ns extends j{constructor(t){super(),this._config=this._getConfig(t),this._isAppended=!1,this._element=null}static get Default(){return ss}static get DefaultType(){return is}static get NAME(){return Je}show(t){if(!this._config.isVisible)return void P(t);this._append();const e=this._getElement();this._config.isAnimated&&O(e),e.classList.add(ts),this._emulateAnimation(()=>{P(t)})}hide(t){this._config.isVisible?(this._getElement().classList.remove(ts),this._emulateAnimation(()=>{this.dispose(),P(t)})):P(t)}dispose(){this._isAppended&&(b.off(this._element,es),this._element.remove(),this._isAppended=!1)}_getElement(){if(!this._element){const t=document.createElement("div");t.className=this._config.className,this._config.isAnimated&&t.classList.add("fade"),this._element=t}return this._element}_configAfterMerge(t){return t.rootElement=D(t.rootElement),t}_append(){if(this._isAppended)return;const t=this._getElement();this._config.rootElement.append(t),b.on(t,es,()=>{P(this._config.clickCallback)}),this._isAppended=!0}_emulateAnimation(t){F(t,this._getElement(),this._config.isAnimated)}}const os=".bs.focustrap",rs=`focusin${os}`,as=`keydown.tab${os}`,ls="backward",cs={autofocus:!0,trapElement:null},hs={autofocus:"boolean",trapElement:"element"};class us extends j{constructor(t){super(),this._config=this._getConfig(t),this._isActive=!1,this._lastTabNavDirection=null}static get Default(){return cs}static get DefaultType(){return hs}static get NAME(){return"focustrap"}activate(){this._isActive||(this._config.autofocus&&this._config.trapElement.focus(),b.off(document,os),b.on(document,rs,t=>this._handleFocusin(t)),b.on(document,as,t=>this._handleKeydown(t)),this._isActive=!0)}deactivate(){this._isActive&&(this._isActive=!1,b.off(document,os))}_handleFocusin(t){const{trapElement:e}=this._config;if(t.target===document||t.target===e||e.contains(t.target))return;const s=z.focusableChildren(e);0===s.length?e.focus():this._lastTabNavDirection===ls?s[s.length-1].focus():s[0].focus()}_handleKeydown(t){"Tab"===t.key&&(this._lastTabNavDirection=t.shiftKey?ls:"forward")}}const ds=".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",gs=".sticky-top",_s="padding-right",ms="margin-right";class fs{constructor(){this._element=document.body}getWidth(){const t=document.documentElement.clientWidth;return Math.abs(window.innerWidth-t)}hide(){const t=this.getWidth();this._disableOverFlow(),this._setElementAttributes(this._element,_s,e=>e+t),this._setElementAttributes(ds,_s,e=>e+t),this._setElementAttributes(gs,ms,e=>e-t)}reset(){this._resetElementAttributes(this._element,"overflow"),this._resetElementAttributes(this._element,_s),this._resetElementAttributes(ds,_s),this._resetElementAttributes(gs,ms)}isOverflowing(){return this.getWidth()>0}_disableOverFlow(){this._saveInitialAttribute(this._element,"overflow"),this._element.style.overflow="hidden"}_setElementAttributes(t,e,s){const i=this.getWidth();this._applyManipulationCallback(t,t=>{if(t!==this._element&&window.innerWidth>t.clientWidth+i)return;this._saveInitialAttribute(t,e);const n=window.getComputedStyle(t).getPropertyValue(e);t.style.setProperty(e,`${s(Number.parseFloat(n))}px`)})}_saveInitialAttribute(t,e){const s=t.style.getPropertyValue(e);s&&A.setDataAttribute(t,e,s)}_resetElementAttributes(t,e){this._applyManipulationCallback(t,t=>{const s=A.getDataAttribute(t,e);null!==s?(A.removeDataAttribute(t,e),t.style.setProperty(e,s)):t.style.removeProperty(e)})}_applyManipulationCallback(t,e){if(k(t))e(t);else for(const s of z.find(t,this._element))e(s)}}const ps=".bs.offcanvas",bs=".data-api",vs=`load${ps}${bs}`,ys="show",ws="showing",As="hiding",Cs=".offcanvas.show",Es=`show${ps}`,Ts=`shown${ps}`,Ss=`hide${ps}`,ks=`hidePrevented${ps}`,Ds=`hidden${ps}`,$s=`resize${ps}`,Ls=`click${ps}${bs}`,xs=`keydown.dismiss${ps}`,Is={backdrop:!0,keyboard:!0,scroll:!1},Os={backdrop:"(boolean|string)",keyboard:"boolean",scroll:"boolean"};class Ms extends H{constructor(t,e){super(t,e),this._isShown=!1,this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._addEventListeners()}static get Default(){return Is}static get DefaultType(){return Os}static get NAME(){return"offcanvas"}toggle(t){return this._isShown?this.hide():this.show(t)}show(t){this._isShown||b.trigger(this._element,Es,{relatedTarget:t}).defaultPrevented||(this._isShown=!0,this._backdrop.show(),this._config.scroll||(new fs).hide(),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.classList.add(ws),this._queueCallback(()=>{this._config.scroll&&!this._config.backdrop||this._focustrap.activate(),this._element.classList.add(ys),this._element.classList.remove(ws),b.trigger(this._element,Ts,{relatedTarget:t})},this._element,!0))}hide(){this._isShown&&(b.trigger(this._element,Ss).defaultPrevented||(this._focustrap.deactivate(),this._element.blur(),this._isShown=!1,this._element.classList.add(As),this._backdrop.hide(),this._queueCallback(()=>{this._element.classList.remove(ys,As),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._config.scroll||(new fs).reset(),b.trigger(this._element,Ds)},this._element,!0)))}dispose(){this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}_initializeBackDrop(){const t=Boolean(this._config.backdrop);return new ns({className:"offcanvas-backdrop",isVisible:t,isAnimated:!0,rootElement:this._element.parentNode,clickCallback:t?()=>{"static"!==this._config.backdrop?this.hide():b.trigger(this._element,ks)}:null})}_initializeFocusTrap(){return new us({trapElement:this._element})}_addEventListeners(){b.on(this._element,xs,t=>{"Escape"===t.key&&(this._config.keyboard?this.hide():b.trigger(this._element,ks))})}}b.on(document,Ls,'[data-bs-toggle="offcanvas"]',function(t){const e=z.getElementFromSelector(this);if(["A","AREA"].includes(this.tagName)&&t.preventDefault(),L(this))return;b.one(e,Ds,()=>{$(this)&&this.focus()});const s=z.findOne(Cs);s&&s!==e&&Ms.getInstance(s).hide(),Ms.getOrCreateInstance(e).toggle(this)}),b.on(window,vs,()=>{for(const t of z.find(Cs))Ms.getOrCreateInstance(t).show()}),b.on(window,$s,()=>{for(const t of z.find("[aria-modal][class*=show][class*=offcanvas-]"))"fixed"!==getComputedStyle(t).position&&Ms.getOrCreateInstance(t).hide()}),W(Ms);const Ps=".bs.strength",Fs=`strengthChange${Ps}`,Ns=["weak","fair","good","strong"],js={input:null,minLength:8,messages:{weak:"Weak",fair:"Fair",good:"Good",strong:"Strong"},weights:{minLength:1,extraLength:1,lowercase:1,uppercase:1,numbers:1,special:1,multipleSpecial:1,longPassword:1},thresholds:[2,4,6],scorer:null},Hs={input:"(string|element|null)",minLength:"number",messages:"object",weights:"object",thresholds:"array",scorer:"(function|null)"};class qs extends H{constructor(t,e){super(t,e),this._input=this._getInput(),this._segments=z.find(".strength-segment",this._element),this._textElement=z.findOne(".strength-text",this._element.parentElement),this._currentStrength=null,this._input&&(this._addEventListeners(),this._evaluate())}static get Default(){return js}static get DefaultType(){return Hs}static get NAME(){return"strength"}getStrength(){return this._currentStrength}evaluate(){this._evaluate()}_getInput(){if(this._config.input)return"string"==typeof this._config.input?z.findOne(this._config.input):this._config.input;const t=this._element.parentElement;return z.findOne('input[type="password"]',t)}_addEventListeners(){b.on(this._input,"input",()=>this._evaluate()),b.on(this._input,"change",()=>this._evaluate())}_evaluate(){const t=this._input.value,e=this._calculateScore(t),s=this._scoreToStrength(e);s!==this._currentStrength&&(this._currentStrength=s,this._updateUI(s,e),b.trigger(this._element,Fs,{strength:s,score:e,password:t.length>0?"***":""}))}_calculateScore(t){if(!t)return 0;if("function"==typeof this._config.scorer)return this._config.scorer(t);const{weights:e}=this._config;let s=0;return t.length>=this._config.minLength&&(s+=e.minLength),t.length>=this._config.minLength+4&&(s+=e.extraLength),/[a-z]/.test(t)&&(s+=e.lowercase),/[A-Z]/.test(t)&&(s+=e.uppercase),/\d/.test(t)&&(s+=e.numbers),/[!@#$%^&*(),.?":{}|<>]/.test(t)&&(s+=e.special),/[!@#$%^&*(),.?":{}|<>].*[!@#$%^&*(),.?":{}|<>]/.test(t)&&(s+=e.multipleSpecial),t.length>=16&&(s+=e.longPassword),s}_scoreToStrength(t){if(0===t)return null;const[e,s,i]=this._config.thresholds;return t<=e?"weak":t<=s?"fair":t<=i?"good":"strong"}_updateUI(t){t?this._element.dataset.bsStrength=t:delete this._element.dataset.bsStrength;const e=t?Ns.indexOf(t):-1;for(const[t,s]of this._segments.entries())t<=e?s.classList.add("active"):s.classList.remove("active");if(this._textElement)if(t&&this._config.messages[t]){this._textElement.textContent=this._config.messages[t],this._textElement.dataset.bsStrength=t;const e={weak:"danger",fair:"warning",good:"info",strong:"success"};this._textElement.style.setProperty("--strength-color",`var(--${e[t]}-text)`)}else this._textElement.textContent="",delete this._textElement.dataset.bsStrength}}b.on(document,`DOMContentLoaded${Ps}.data-api`,()=>{for(const t of z.find("[data-bs-strength]"))qs.getOrCreateInstance(t)});const zs=".bs.otp-input",Ws=`complete${zs}`,Rs=`input${zs}`,Bs={length:6,mask:!1},Us={length:"number",mask:"boolean"};class Vs extends H{constructor(t,e){super(t,e),this._inputs=z.find("input",this._element),this._setupInputs(),this._addEventListeners()}static get Default(){return Bs}static get DefaultType(){return Us}static get NAME(){return"otpInput"}getValue(){return this._inputs.map(t=>t.value).join("")}setValue(t){const e=String(t).split("");for(const[t,s]of this._inputs.entries())s.value=e[t]||"";this._checkComplete()}clear(){for(const t of this._inputs)t.value="";this._inputs[0]?.focus()}focus(){const t=this._inputs.find(t=>!t.value);t?t.focus():this._inputs.at(-1)?.focus()}_setupInputs(){for(const t of this._inputs)t.setAttribute("maxlength","1"),t.setAttribute("inputmode","numeric"),t.setAttribute("pattern","\\d*"),t===this._inputs[0]?t.setAttribute("autocomplete","one-time-code"):t.setAttribute("autocomplete","off"),this._config.mask&&t.setAttribute("type","password")}_addEventListeners(){for(const[t,e]of this._inputs.entries())b.on(e,"input",e=>this._handleInput(e,t)),b.on(e,"keydown",e=>this._handleKeydown(e,t)),b.on(e,"paste",t=>this._handlePaste(t)),b.on(e,"focus",t=>this._handleFocus(t))}_handleInput(t,e){const s=t.target;/^\d*$/.test(s.value)||(s.value=s.value.replace(/\D/g,""));const{value:i}=s;if(i.length>1){const t=i.split("");s.value=t[0]||"";for(let s=1;s<t.length&&e+s<this._inputs.length;s++)this._inputs[e+s].value=t[s];const n=Math.min(e+t.length,this._inputs.length-1);this._inputs[n].focus()}else i&&e<this._inputs.length-1&&this._inputs[e+1].focus();b.trigger(this._element,Rs,{value:this.getValue(),index:e}),this._checkComplete()}_handleKeydown(t,e){const{key:s}=t;switch(s){case"Backspace":!this._inputs[e].value&&e>0&&(t.preventDefault(),this._inputs[e-1].value="",this._inputs[e-1].focus());break;case"Delete":t.preventDefault();for(let t=e;t<this._inputs.length-1;t++)this._inputs[t].value=this._inputs[t+1].value;this._inputs.at(-1).value="";break;case"ArrowLeft":e>0&&(t.preventDefault(),this._inputs[e-1].focus());break;case"ArrowRight":e<this._inputs.length-1&&(t.preventDefault(),this._inputs[e+1].focus())}}_handlePaste(t){t.preventDefault();const e=(t.clipboardData||window.clipboardData).getData("text").replace(/\D/g,"").slice(0,this._inputs.length);if(e){this.setValue(e);const t=Math.min(e.length,this._inputs.length)-1;this._inputs[t].focus()}}_handleFocus(t){t.target.select()}_checkComplete(){const t=this.getValue();t.length===this._inputs.length&&this._inputs.every(t=>""!==t.value)&&b.trigger(this._element,Ws,{value:t})}}b.on(document,`DOMContentLoaded${zs}.data-api`,()=>{for(const t of z.find("[data-bs-otp]"))Vs.getOrCreateInstance(t)});const Ks={"*":["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:[]},Qs=new Set(["background","cite","href","itemtype","longdesc","poster","src","xlink:href"]),Xs=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i,Ys=(t,e)=>{const s=t.nodeName.toLowerCase();return e.includes(s)?!Qs.has(s)||Boolean(Xs.test(t.nodeValue)):e.filter(t=>t instanceof RegExp).some(t=>t.test(s))},Gs={allowList:Ks,content:{},extraClass:"",html:!1,sanitize:!0,sanitizeFn:null,template:"<div></div>"},Zs={allowList:"object",content:"object",extraClass:"(string|function)",html:"boolean",sanitize:"boolean",sanitizeFn:"(null|function)",template:"string"},Js={entry:"(string|element|function|null)",selector:"(string|element)"};class ti extends j{constructor(t){super(),this._config=this._getConfig(t)}static get Default(){return Gs}static get DefaultType(){return Zs}static get NAME(){return"TemplateFactory"}getContent(){return Object.values(this._config.content).map(t=>this._resolvePossibleFunction(t)).filter(Boolean)}hasContent(){return this.getContent().length>0}changeContent(t){return this._checkContent(t),this._config.content={...this._config.content,...t},this}toHtml(){const t=document.createElement("div");t.innerHTML=this._maybeSanitize(this._config.template);for(const[e,s]of Object.entries(this._config.content))this._setContent(t,s,e);const e=t.children[0],s=this._resolvePossibleFunction(this._config.extraClass);return s&&e.classList.add(...s.split(" ")),e}_typeCheckConfig(t){super._typeCheckConfig(t),this._checkContent(t.content)}_checkContent(t){for(const[e,s]of Object.entries(t))super._typeCheckConfig({selector:e,entry:s},Js)}_setContent(t,e,s){const i=z.findOne(s,t);i&&((e=this._resolvePossibleFunction(e))?k(e)?this._putElementInTemplate(D(e),i):this._config.html?i.innerHTML=this._maybeSanitize(e):i.textContent=e:i.remove())}_maybeSanitize(t){return this._config.sanitize?function(t,e,s){if(!t.length)return t;if(s&&"function"==typeof s)return s(t);const i=(new window.DOMParser).parseFromString(t,"text/html"),n=[].concat(...i.body.querySelectorAll("*"));for(const t of n){const s=t.nodeName.toLowerCase();if(!Object.keys(e).includes(s)){t.remove();continue}const i=[].concat(...t.attributes),n=[].concat(e["*"]||[],e[s]||[]);for(const e of i)Ys(e,n)||t.removeAttribute(e.nodeName)}return i.body.innerHTML}(t,this._config.allowList,this._config.sanitizeFn):t}_resolvePossibleFunction(t){return P(t,[void 0,this])}_putElementInTemplate(t,e){if(this._config.html)return e.innerHTML="",void e.append(t);e.textContent=t.textContent}}const ei=new Set(["sanitize","allowList","sanitizeFn"]),si="fade",ii="show",ni=".tooltip-inner",oi=".modal",ri='[data-bs-toggle="tooltip"]',ai="hide.bs.modal",li="hover",ci="focus",hi="click",ui="focusin",di="mouseenter",gi={AUTO:"auto",TOP:"top",RIGHT:M()?"left":"right",BOTTOM:"bottom",LEFT:M()?"right":"left"},_i={allowList:Ks,animation:!0,boundary:"clippingParents",container:!1,customClass:"",delay:0,fallbackPlacements:["top","right","bottom","left"],html:!1,offset:[0,6],placement:"top",floatingConfig:null,sanitize:!0,sanitizeFn:null,selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',title:"",trigger:"hover focus"},mi={allowList:"object",animation:"boolean",boundary:"(string|element)",container:"(string|element|boolean)",customClass:"(string|function)",delay:"(number|object)",fallbackPlacements:"array",html:"boolean",offset:"(array|string|function)",placement:"(string|function)",floatingConfig:"(null|object|function)",sanitize:"boolean",sanitizeFn:"(null|function)",selector:"(string|boolean)",template:"string",title:"(string|element|function)",trigger:"string"};class fi extends H{constructor(t,s){if(void 0===e.computePosition)throw new TypeError("Bootstrap's tooltips require Floating UI (https://floating-ui.com)");super(t,s),this._isEnabled=!0,this._timeout=0,this._isHovered=null,this._activeTrigger={},this._floatingCleanup=null,this._templateFactory=null,this._newContent=null,this._mediaQueryListeners=[],this._responsivePlacements=null,this.tip=null,this._parseResponsivePlacements(),this._setListeners(),this._config.selector||this._fixTitle()}static get Default(){return _i}static get DefaultType(){return mi}static get NAME(){return"tooltip"}enable(){this._isEnabled=!0}disable(){this._isEnabled=!1}toggleEnabled(){this._isEnabled=!this._isEnabled}toggle(){this._isEnabled&&(this._isShown()?this._leave():this._enter())}dispose(){clearTimeout(this._timeout),b.off(this._element.closest(oi),ai,this._hideModalHandler),this._element.getAttribute("data-bs-original-title")&&this._element.setAttribute("title",this._element.getAttribute("data-bs-original-title")),this._disposeFloating(),this._disposeMediaQueryListeners(),super.dispose()}async show(){if("none"===this._element.style.display)throw new Error("Please use show on visible elements");if(!this._isWithContent()||!this._isEnabled)return;const t=b.trigger(this._element,this.constructor.eventName("show")),e=(x(this._element)||this._element.ownerDocument.documentElement).contains(this._element);if(t.defaultPrevented||!e)return;this._disposeFloating();const s=this._getTipElement();this._element.setAttribute("aria-describedby",s.getAttribute("id"));const{container:i}=this._config;if(this._element.ownerDocument.documentElement.contains(this.tip)||(i.append(s),b.trigger(this._element,this.constructor.eventName("inserted"))),await this._createFloating(s),s.classList.add(ii),"ontouchstart"in document.documentElement)for(const t of[].concat(...document.body.children))b.on(t,"mouseover",I);this._queueCallback(()=>{b.trigger(this._element,this.constructor.eventName("shown")),!1===this._isHovered&&this._leave(),this._isHovered=!1},this.tip,this._isAnimated())}hide(){if(this._isShown()&&!b.trigger(this._element,this.constructor.eventName("hide")).defaultPrevented){if(this._getTipElement().classList.remove(ii),"ontouchstart"in document.documentElement)for(const t of[].concat(...document.body.children))b.off(t,"mouseover",I);this._activeTrigger[hi]=!1,this._activeTrigger[ci]=!1,this._activeTrigger[li]=!1,this._isHovered=null,this._queueCallback(()=>{this._isWithActiveTrigger()||(this._isHovered||this._disposeFloating(),this._element.removeAttribute("aria-describedby"),b.trigger(this._element,this.constructor.eventName("hidden")))},this.tip,this._isAnimated())}}update(){this._floatingCleanup&&this.tip&&this._updateFloatingPosition()}_isWithContent(){return Boolean(this._getTitle())}_getTipElement(){return this.tip||(this.tip=this._createTipElement(this._newContent||this._getContentForTemplate())),this.tip}_createTipElement(t){const e=this._getTemplateFactory(t).toHtml();if(!e)return null;e.classList.remove(si,ii),e.classList.add(`bs-${this.constructor.NAME}-auto`);const s=(t=>{do{t+=Math.floor(1e6*Math.random())}while(document.getElementById(t));return t})(this.constructor.NAME).toString();return e.setAttribute("id",s),this._isAnimated()&&e.classList.add(si),e}setContent(t){this._newContent=t,this._isShown()&&(this._disposeFloating(),this.show())}_getTemplateFactory(t){return this._templateFactory?this._templateFactory.changeContent(t):this._templateFactory=new ti({...this._config,content:t,extraClass:this._resolvePossibleFunction(this._config.customClass)}),this._templateFactory}_getContentForTemplate(){return{[ni]:this._getTitle()}}_getTitle(){return this._resolvePossibleFunction(this._config.title)||this._element.getAttribute("data-bs-original-title")}_initializeOnDelegatedTarget(t){return this.constructor.getOrCreateInstance(t.delegateTarget,this._getDelegateConfig())}_isAnimated(){return this._config.animation||this.tip&&this.tip.classList.contains(si)}_isShown(){return this.tip&&this.tip.classList.contains(ii)}_getPlacement(t){if(this._responsivePlacements){const t=ve(this._responsivePlacements,"top");return gi[t.toUpperCase()]||t}const e=P(this._config.placement,[this,t,this._element]);return gi[e.toUpperCase()]||e}_parseResponsivePlacements(){"string"==typeof this._config.placement?(this._responsivePlacements=be(this._config.placement,"top"),this._responsivePlacements&&this._setupMediaQueryListeners()):this._responsivePlacements=null}_setupMediaQueryListeners(){this._disposeMediaQueryListeners(),this._mediaQueryListeners=ye(()=>{this._isShown()&&this._updateFloatingPosition()})}_disposeMediaQueryListeners(){we(this._mediaQueryListeners),this._mediaQueryListeners=[]}async _createFloating(t){const s=this._getPlacement(t),i=t.querySelector(`.${this.constructor.NAME}-arrow`);await this._updateFloatingPosition(t,s,i),this._floatingCleanup=e.autoUpdate(this._element,t,()=>this._updateFloatingPosition(t,null,i))}async _updateFloatingPosition(t=this.tip,s=null,i=null){if(!t)return;s||(s=this._getPlacement(t)),i||(i=t.querySelector(`.${this.constructor.NAME}-arrow`));const n=this._getFloatingMiddleware(i),o=this._getFloatingConfig(s,n),{x:r,y:a,placement:l,middlewareData:c}=await e.computePosition(this._element,t,o);if(Object.assign(t.style,{position:"absolute",left:`${r}px`,top:`${a}px`}),i&&(i.style.position="absolute"),A.setDataAttribute(t,"placement",l),i&&c.arrow){const{x:t,y:e}=c.arrow,s=l.startsWith("top")||l.startsWith("bottom");Object.assign(i.style,{left:s&&null!==t?`${t}px`:"",top:s||null===e?"":`${e}px`,right:"",bottom:""})}}_getOffset(){const{offset:t}=this._config;return"string"==typeof t?t.split(",").map(t=>Number.parseInt(t,10)):"function"==typeof t?({placement:e,rects:s})=>t({placement:e,reference:s.reference,floating:s.floating},this._element):t}_resolvePossibleFunction(t){return P(t,[this._element,this._element])}_getFloatingMiddleware(t){const s=this._getOffset(),i=[e.offset("function"==typeof s?s:{mainAxis:s[1]||0,crossAxis:s[0]||0}),e.flip({fallbackPlacements:this._config.fallbackPlacements}),e.shift({boundary:"clippingParents"===this._config.boundary?"clippingAncestors":this._config.boundary})];return t&&i.push(e.arrow({element:t})),i}_getFloatingConfig(t,e){const s={placement:t,middleware:e};return{...s,...P(this._config.floatingConfig,[void 0,s])}}_setListeners(){const t=this._config.trigger.split(" ");for(const e of t)if("click"===e)b.on(this._element,this.constructor.eventName("click"),this._config.selector,t=>{const e=this._initializeOnDelegatedTarget(t);e._activeTrigger[hi]=!(e._isShown()&&e._activeTrigger[hi]),e.toggle()});else if("manual"!==e){const t=e===li?this.constructor.eventName(di):this.constructor.eventName(ui),s=e===li?this.constructor.eventName("mouseleave"):this.constructor.eventName("focusout");b.on(this._element,t,this._config.selector,t=>{const e=this._initializeOnDelegatedTarget(t);e._activeTrigger["focusin"===t.type?ci:li]=!0,e._enter()}),b.on(this._element,s,this._config.selector,t=>{const e=this._initializeOnDelegatedTarget(t);e._activeTrigger["focusout"===t.type?ci:li]=e._element.contains(t.relatedTarget),e._leave()})}this._hideModalHandler=()=>{this._element&&this.hide()},b.on(this._element.closest(oi),ai,this._hideModalHandler)}_fixTitle(){const t=this._element.getAttribute("title");t&&(this._element.getAttribute("aria-label")||this._element.textContent.trim()||this._element.setAttribute("aria-label",t),this._element.setAttribute("data-bs-original-title",t),this._element.removeAttribute("title"))}_enter(){this._isShown()||this._isHovered?this._isHovered=!0:(this._isHovered=!0,this._setTimeout(()=>{this._isHovered&&this.show()},this._config.delay.show))}_leave(){this._isWithActiveTrigger()||(this._isHovered=!1,this._setTimeout(()=>{this._isHovered||this.hide()},this._config.delay.hide))}_setTimeout(t,e){clearTimeout(this._timeout),this._timeout=setTimeout(t,e)}_isWithActiveTrigger(){return Object.values(this._activeTrigger).includes(!0)}_getConfig(t){const e=A.getDataAttributes(this._element);for(const t of Object.keys(e))ei.has(t)&&delete e[t];return t={...e,..."object"==typeof t&&t?t:{}},t=this._mergeConfigObj(t),t=this._configAfterMerge(t),this._typeCheckConfig(t),t}_configAfterMerge(t){return t.container=!1===t.container?document.body:D(t.container),"number"==typeof t.delay&&(t.delay={show:t.delay,hide:t.delay}),"number"==typeof t.title&&(t.title=t.title.toString()),"number"==typeof t.content&&(t.content=t.content.toString()),t}_getDelegateConfig(){const t={};for(const[e,s]of Object.entries(this._config))this.constructor.Default[e]!==s&&(t[e]=s);return t.selector=!1,t.trigger="manual",t}_disposeFloating(){this._floatingCleanup&&(this._floatingCleanup(),this._floatingCleanup=null),this.tip&&(this.tip.remove(),this.tip=null)}}const pi=t=>{const e=t.target.closest(ri);if(!e)return;const s=fi.getOrCreateInstance(e);"focusin"===t.type&&(s._activeTrigger.focus=!0,s._enter())};b.on(document,ui,ri,pi),b.on(document,di,ri,pi);const bi=".popover-header",vi=".popover-body",yi='[data-bs-toggle="popover"]',wi={...fi.Default,content:"",offset:[0,8],placement:"right",template:'<div class="popover" role="tooltip"><div class="popover-arrow"></div><h3 class="popover-header"></h3><div class="popover-body"></div></div>',trigger:"click"},Ai={...fi.DefaultType,content:"(null|string|element|function)"};class Ci extends fi{static get Default(){return wi}static get DefaultType(){return Ai}static get NAME(){return"popover"}_isWithContent(){return this._getTitle()||this._getContent()}_getContentForTemplate(){return{[bi]:this._getTitle(),[vi]:this._getContent()}}_getContent(){return this._resolvePossibleFunction(this._config.content)}}const Ei=t=>{const e=t.target.closest(yi);if(!e)return;"click"===t.type&&t.preventDefault();const s=Ci.getOrCreateInstance(e);"click"===t.type?s.toggle():"focusin"===t.type&&(s._activeTrigger.focus=!0,s._enter())};b.on(document,"click",yi,Ei),b.on(document,"focusin",yi,Ei),b.on(document,"mouseenter",yi,Ei);const Ti=".bs.scrollspy",Si=`activate${Ti}`,ki=`click${Ti}`,Di=`load${Ti}.data-api`,$i="active",Li="[href]",xi=".nav-link",Ii=`${xi}, .nav-item > ${xi}, .list-group-item`,Oi={offset:null,rootMargin:"0px 0px -25%",smoothScroll:!1,target:null,threshold:[.1,.5,1]},Mi={offset:"(number|null)",rootMargin:"string",smoothScroll:"boolean",target:"element",threshold:"array"};class Pi extends H{constructor(t,e){super(t,e),this._targetLinks=new Map,this._observableSections=new Map,this._rootElement="visible"===getComputedStyle(this._element).overflowY?null:this._element,this._activeTarget=null,this._observer=null,this._previousScrollData={visibleEntryTop:0,parentScrollTop:0},this.refresh()}static get Default(){return Oi}static get DefaultType(){return Mi}static get NAME(){return"scrollspy"}refresh(){this._initializeTargetsAndObservables(),this._maybeEnableSmoothScroll(),this._observer?this._observer.disconnect():this._observer=this._getNewObserver();for(const t of this._observableSections.values())this._observer.observe(t)}dispose(){this._observer.disconnect(),super.dispose()}_configAfterMerge(t){return t.target=D(t.target)||document.body,t.rootMargin=t.offset?`${t.offset}px 0px -30%`:t.rootMargin,"string"==typeof t.threshold&&(t.threshold=t.threshold.split(",").map(t=>Number.parseFloat(t))),t}_maybeEnableSmoothScroll(){this._config.smoothScroll&&(b.off(this._config.target,ki),b.on(this._config.target,ki,Li,t=>{const e=this._observableSections.get(t.target.hash);if(e){t.preventDefault();const s=this._rootElement||window,i=e.offsetTop-this._element.offsetTop;if(s.scrollTo)return void s.scrollTo({top:i,behavior:"smooth"});s.scrollTop=i}}))}_getNewObserver(){const t={root:this._rootElement,threshold:this._config.threshold,rootMargin:this._config.rootMargin};return new IntersectionObserver(t=>this._observerCallback(t),t)}_observerCallback(t){const e=t=>this._targetLinks.get(`#${t.target.id}`),s=t=>{this._previousScrollData.visibleEntryTop=t.target.offsetTop,this._process(e(t))},i=(this._rootElement||document.documentElement).scrollTop,n=i>=this._previousScrollData.parentScrollTop;this._previousScrollData.parentScrollTop=i;for(const o of t){if(!o.isIntersecting){this._activeTarget=null,this._clearActiveClass(e(o));continue}const t=o.target.offsetTop>=this._previousScrollData.visibleEntryTop;if(n&&t){if(s(o),!i)return}else n||t||s(o)}}_initializeTargetsAndObservables(){this._targetLinks=new Map,this._observableSections=new Map;const t=z.find(Li,this._config.target);for(const e of t){if(!e.hash||L(e))continue;const t=z.findOne(decodeURI(e.hash),this._element);$(t)&&(this._targetLinks.set(decodeURI(e.hash),e),this._observableSections.set(e.hash,t))}}_process(t){this._activeTarget!==t&&(this._clearActiveClass(this._config.target),this._activeTarget=t,t.classList.add($i),this._activateParents(t),b.trigger(this._element,Si,{relatedTarget:t}))}_activateParents(t){if(t.classList.contains("dropdown-item"))z.findOne(".dropdown-toggle",t.closest(".dropdown")).classList.add($i);else for(const e of z.parents(t,".nav, .list-group"))for(const t of z.prev(e,Ii))t.classList.add($i)}_clearActiveClass(t){t.classList.remove($i);const e=z.find(`${Li}.${$i}`,t);for(const t of e)t.classList.remove($i)}}b.on(window,Di,()=>{for(const t of z.find('[data-bs-spy="scroll"]'))Pi.getOrCreateInstance(t)});const Fi=".bs.tab",Ni=`hide${Fi}`,ji=`hidden${Fi}`,Hi=`show${Fi}`,qi=`shown${Fi}`,zi=`click${Fi}`,Wi=`keydown${Fi}`,Ri=`load${Fi}`,Bi="ArrowLeft",Ui="ArrowRight",Vi="ArrowUp",Ki="ArrowDown",Qi="Home",Xi="End",Yi="active",Gi="fade",Zi="show",Ji=".dropdown-toggle",tn=`:not(${Ji})`,en='[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]',sn=`.nav-link${tn}, .list-group-item${tn}, [role="tab"]${tn}, ${en}`,nn=`.${Yi}[data-bs-toggle="tab"], .${Yi}[data-bs-toggle="pill"], .${Yi}[data-bs-toggle="list"]`;class on extends H{constructor(t){super(t),this._parent=this._element.closest('.list-group, .nav, [role="tablist"]'),this._parent&&(this._setInitialAttributes(this._parent,this._getChildren()),b.on(this._element,Wi,t=>this._keydown(t)))}static get NAME(){return"tab"}show(){const t=this._element;if(this._elemIsActive(t))return;const e=this._getActiveElem(),s=e?b.trigger(e,Ni,{relatedTarget:t}):null;b.trigger(t,Hi,{relatedTarget:e}).defaultPrevented||s&&s.defaultPrevented||(this._deactivate(e,t),this._activate(t,e))}_activate(t,e){t&&(t.classList.add(Yi),this._activate(z.getElementFromSelector(t)),this._queueCallback(()=>{"tab"===t.getAttribute("role")?(t.removeAttribute("tabindex"),t.setAttribute("aria-selected",!0),this._toggleDropDown(t,!0),b.trigger(t,qi,{relatedTarget:e})):t.classList.add(Zi)},t,t.classList.contains(Gi)))}_deactivate(t,e){t&&(t.classList.remove(Yi),t.blur(),this._deactivate(z.getElementFromSelector(t)),this._queueCallback(()=>{"tab"===t.getAttribute("role")?(t.setAttribute("aria-selected",!1),t.setAttribute("tabindex","-1"),this._toggleDropDown(t,!1),b.trigger(t,ji,{relatedTarget:e})):t.classList.remove(Zi)},t,t.classList.contains(Gi)))}_keydown(t){if(![Bi,Ui,Vi,Ki,Qi,Xi].includes(t.key))return;t.stopPropagation(),t.preventDefault();const e=this._getChildren().filter(t=>!L(t));let s;if([Qi,Xi].includes(t.key))s=e[t.key===Qi?0:e.length-1];else{const i=[Ui,Ki].includes(t.key);s=N(e,t.target,i,!0)}s&&(s.focus({preventScroll:!0}),on.getOrCreateInstance(s).show())}_getChildren(){return z.find(sn,this._parent)}_getActiveElem(){return this._getChildren().find(t=>this._elemIsActive(t))||null}_setInitialAttributes(t,e){this._setAttributeIfNotExists(t,"role","tablist");for(const t of e)this._setInitialAttributesOnChild(t)}_setInitialAttributesOnChild(t){t=this._getInnerElement(t);const e=this._elemIsActive(t),s=this._getOuterElement(t);t.setAttribute("aria-selected",e),s!==t&&this._setAttributeIfNotExists(s,"role","presentation"),e||t.setAttribute("tabindex","-1"),this._setAttributeIfNotExists(t,"role","tab"),this._setInitialAttributesOnTargetPanel(t)}_setInitialAttributesOnTargetPanel(t){const e=z.getElementFromSelector(t);e&&(this._setAttributeIfNotExists(e,"role","tabpanel"),t.id&&this._setAttributeIfNotExists(e,"aria-labelledby",`${t.id}`))}_toggleDropDown(t,e){const s=this._getOuterElement(t);if(!s.classList.contains("dropdown"))return;const i=(t,i)=>{const n=z.findOne(t,s);n&&n.classList.toggle(i,e)};i(Ji,Yi),i(".dropdown-menu",Zi),s.setAttribute("aria-expanded",e)}_setAttributeIfNotExists(t,e,s){t.hasAttribute(e)||t.setAttribute(e,s)}_elemIsActive(t){return t.classList.contains(Yi)}_getInnerElement(t){return t.matches(sn)?t:z.findOne(sn,t)}_getOuterElement(t){return t.closest(".nav-item, .list-group-item")||t}}b.on(document,zi,en,function(t){["A","AREA"].includes(this.tagName)&&t.preventDefault(),L(this)||on.getOrCreateInstance(this).show()}),b.on(window,Ri,()=>{for(const t of z.find(nn))on.getOrCreateInstance(t)});const rn=".bs.toast",an=`mouseover${rn}`,ln=`mouseout${rn}`,cn=`focusin${rn}`,hn=`focusout${rn}`,un=`hide${rn}`,dn=`hidden${rn}`,gn=`show${rn}`,_n=`shown${rn}`,mn="hide",fn="show",pn="showing",bn={animation:"boolean",autohide:"boolean",delay:"number"},vn={animation:!0,autohide:!0,delay:5e3};class yn extends H{constructor(t,e){super(t,e),this._timeout=null,this._hasMouseInteraction=!1,this._hasKeyboardInteraction=!1,this._setListeners()}static get Default(){return vn}static get DefaultType(){return bn}static get NAME(){return"toast"}show(){b.trigger(this._element,gn).defaultPrevented||(this._clearTimeout(),this._config.animation&&this._element.classList.add("fade"),this._element.classList.remove(mn),O(this._element),this._element.classList.add(fn,pn),this._queueCallback(()=>{this._element.classList.remove(pn),b.trigger(this._element,_n),this._maybeScheduleHide()},this._element,this._config.animation))}hide(){this.isShown()&&(b.trigger(this._element,un).defaultPrevented||(this._element.classList.add(pn),this._queueCallback(()=>{this._element.classList.add(mn),this._element.classList.remove(pn,fn),b.trigger(this._element,dn)},this._element,this._config.animation)))}dispose(){this._clearTimeout(),this.isShown()&&this._element.classList.remove(fn),super.dispose()}isShown(){return this._element.classList.contains(fn)}_maybeScheduleHide(){this._config.autohide&&(this._hasMouseInteraction||this._hasKeyboardInteraction||(this._timeout=setTimeout(()=>{this.hide()},this._config.delay)))}_onInteraction(t,e){switch(t.type){case"mouseover":case"mouseout":this._hasMouseInteraction=e;break;case"focusin":case"focusout":this._hasKeyboardInteraction=e}if(e)return void this._clearTimeout();const s=t.relatedTarget;this._element===s||this._element.contains(s)||this._maybeScheduleHide()}_setListeners(){b.on(this._element,an,t=>this._onInteraction(t,!0)),b.on(this._element,ln,t=>this._onInteraction(t,!1)),b.on(this._element,cn,t=>this._onInteraction(t,!0)),b.on(this._element,hn,t=>this._onInteraction(t,!1))}_clearTimeout(){clearTimeout(this._timeout),this._timeout=null}}W(yn);const wn=".bs.toggler",An=`toggle${wn}`,Cn=`toggled${wn}`,En={attribute:"string",value:"(string|number|boolean)"},Tn={attribute:"class",value:null};class Sn extends H{static get Default(){return Tn}static get DefaultType(){return En}static get NAME(){return"toggler"}toggle(){b.trigger(this._element,An).defaultPrevented||(this._execute(),b.trigger(this._element,Cn))}_execute(){const{attribute:t,value:e}=this._config;"id"!==t&&("class"!==t?this._element.getAttribute(t)!==String(e)?this._element.setAttribute(t,e):this._element.removeAttribute(t):this._element.classList.toggle(e))}}return((t,e,s,i,n=null)=>{R(`${"click"}.${t.NAME}`,s,e=>{const s=e.targets.filter(Boolean).map(e=>t.getOrCreateInstance(e));"function"==typeof n&&n({...e,instances:s});for(const t of s)t[i]()})})(Sn,0,'[data-bs-toggle="toggler"]',"toggle"),{Alert:K,Button:X,Carousel:$t,Collapse:Rt,Datepicker:se,Dialog:fe,Dropdown:Ze,Offcanvas:Ms,Strength:qs,OtpInput:Vs,Popover:Ci,ScrollSpy:Pi,Tab:on,Toast:yn,Toggler:Sn,Tooltip:fi}});
|
||
//# sourceMappingURL=bootstrap.min.js.map
|