buefy
Version:
Lightweight UI components for Vue.js (v3) based on Bulma
2 lines • 95.3 kB
JavaScript
/*! Buefy v3.0.2 | MIT License | github.com/buefy/buefy */
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vue")):"function"==typeof define&&define.amd?define(["exports","vue"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).Datetimepicker={},e.Vue)}(this,(function(e,t){"use strict";let i,s="mdi",a=null,n="chevron-left",o="chevron-right",l="on",r=null,d=null,c=null,u=!0,h=!0,m=!0,p=!0,f=!0,g=!0,y=!0,b=null,k=[-100,10],D=!0,v=!1,w=!1,B=!1,S=!0,C=!0,V=!0;const M={Android:function(){return"undefined"!=typeof window&&window.navigator.userAgent.match(/Android/i)},BlackBerry:function(){return"undefined"!=typeof window&&window.navigator.userAgent.match(/BlackBerry/i)},iOS:function(){return"undefined"!=typeof window&&(window.navigator.userAgent.match(/iPhone|iPad|iPod/i)||"MacIntel"===window.navigator.platform&&window.navigator.maxTouchPoints>1)},Opera:function(){return"undefined"!=typeof window&&window.navigator.userAgent.match(/Opera Mini/i)},Windows:function(){return"undefined"!=typeof window&&window.navigator.userAgent.match(/IEMobile/i)},any:function(){return M.Android()||M.BlackBerry()||M.iOS()||M.Opera()||M.Windows()}};function F(e,t){const i=t.match(e),s=e.toString().match(/<(.+?)>/g);if(null==s)throw new RangeError("pattern must contain at least one group");return s.map((e=>e.match(/<(.+)>/)[1])).reduce(((e,t,s)=>(i&&i.length>s?e[t]=i[s+1]:e[t]=null,e)),{})}const x=e=>void 0!==e;var N=t.defineComponent({name:"BFieldBody",inject:{parent:{from:"BField",default:null}},props:{message:{type:[String,Array]},type:{type:[String,Object]}},render(){let e=!0,i="function"==typeof this.$slots.default?this.$slots.default():this.$slots.default;return null!=i&&1===i.length&&i[0].type===t.Fragment&&(i=i[0].children),t.h("div",{class:"field-body"},{default:()=>null!=i&&i.map((i=>{if(i.type===t.Comment||i.type===t.Text)return i;let s;e&&(s=this.message,e=!1);const a=this.parent;return t.h(a?a.$.type:t.resolveComponent("b-field"),{type:this.type,message:s},(()=>i))}))})}});const T=t.defineComponent({name:"BField",components:{BFieldBody:N},provide(){return{BField:this}},inject:{parent:{from:"BField",default:!1}},props:{type:{type:[String,Object],default:void 0},label:String,labelFor:String,message:{type:[String,Array,Object],default:void 0},grouped:Boolean,groupMultiline:Boolean,position:String,expanded:Boolean,horizontal:Boolean,addons:{type:Boolean,default:!0},customClass:String,labelPosition:{type:String,default:()=>b}},data(){return{newType:this.type,newMessage:this.message,fieldLabelSize:null,numberInputClasses:[],_isField:!0}},computed:{rootClasses(){return[{"is-expanded":this.expanded,"is-horizontal":this.horizontal,"is-floating-in-label":this.hasLabel&&!this.horizontal&&"inside"===this.labelPosition,"is-floating-label":this.hasLabel&&!this.horizontal&&"on-border"===this.labelPosition},this.numberInputClasses]},innerFieldClasses(){return[this.fieldType(),this.newPosition,{"is-grouped-multiline":this.groupMultiline}]},hasInnerField(){return this.grouped||this.groupMultiline||this.hasAddons()},newPosition(){if(void 0===this.position)return;const e=this.position.split("-");if(e.length<1)return;const t=this.grouped?"is-grouped-":"has-addons-";return this.position?t+e[1]:void 0},formattedMessage(){const e=this.parent;if(e&&e.hasInnerField)return"";if("string"==typeof this.newMessage)return[this.newMessage];const t=[];if(Array.isArray(this.newMessage))this.newMessage.forEach((e=>{if("string"==typeof e)t.push(e);else for(const i in e)e[i]&&t.push(i)}));else for(const e in this.newMessage)this.newMessage[e]&&t.push(e);return t.filter((e=>!!e))},hasLabel(){return this.label||this.$slots.label},hasMessage(){const e=this.parent;return(!e||!e.hasInnerField)&&this.newMessage||this.$slots.message}},watch:{type(e){this.newType=e},message(e){JSON.stringify(e)!==JSON.stringify(this.newMessage)&&(this.newMessage=e)},newMessage(e){const t=this.parent;t&&t.hasInnerField&&(t.type||(t.newType=this.newType),t.message||(t.newMessage=e))}},methods:{fieldType(){return this.grouped?"is-grouped":this.hasAddons()?"has-addons":void 0},hasAddons(){let e=0;return this.$slots.default&&(e=this.$slots.default().reduce(((e,i)=>{return(s=i).type!==t.Comment&&s.type!==t.Text&&s.type!==t.Static?e+1:e;var s}),0)),e>1&&this.addons&&!this.horizontal},wrapNumberinput({controlsPosition:e,size:t}){const i=["has-numberinput"];e&&i.push(`has-numberinput-${e}`),t&&i.push(`has-numberinput-${t}`),this.numberInputClasses=i}},mounted(){if(this.horizontal){this.$el.querySelectorAll(".input, .select, .button, .textarea, .b-slider").length>0&&(this.fieldLabelSize="is-normal")}}});var O=(e,t)=>{const i=e.__vccOpts||e;for(const[e,s]of t)i[e]=s;return i};const E=["for"],$=["for"],A={key:3,class:"field-body"};var P=O(T,[["render",function(e,i,s,a,n,o){const l=t.resolveComponent("b-field-body"),r=t.resolveComponent("b-field");return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["field",e.rootClasses])},[e.horizontal?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(["field-label",[e.customClass,e.fieldLabelSize]])},[e.hasLabel?(t.openBlock(),t.createElementBlock("label",{key:0,for:e.labelFor,class:t.normalizeClass([e.customClass,"label"])},[e.$slots.label?t.renderSlot(e.$slots,"label",{key:0}):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createTextVNode(t.toDisplayString(e.label),1)],64))],10,E)):t.createCommentVNode("v-if",!0)],2)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[e.hasLabel?(t.openBlock(),t.createElementBlock("label",{key:0,for:e.labelFor,class:t.normalizeClass([e.customClass,"label"])},[e.$slots.label?t.renderSlot(e.$slots,"label",{key:0}):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createTextVNode(t.toDisplayString(e.label),1)],64))],10,$)):t.createCommentVNode("v-if",!0)],64)),e.horizontal?(t.openBlock(),t.createBlock(l,{key:2,message:e.newMessage?e.formattedMessage:"",type:e.newType},{default:t.withCtx((()=>[t.renderSlot(e.$slots,"default")])),_:3},8,["message","type"])):e.hasInnerField?(t.openBlock(),t.createElementBlock("div",A,[t.createVNode(r,{addons:!1,type:e.type,class:t.normalizeClass(e.innerFieldClasses)},{default:t.withCtx((()=>[t.renderSlot(e.$slots,"default")])),_:3},8,["type","class"])])):t.renderSlot(e.$slots,"default",{key:4}),e.hasMessage&&!e.horizontal?(t.openBlock(),t.createElementBlock("p",{key:5,class:t.normalizeClass(["help",e.newType])},[e.$slots.message?t.renderSlot(e.$slots,"message",{key:0,messages:e.formattedMessage}):(t.openBlock(!0),t.createElementBlock(t.Fragment,{key:1},t.renderList(e.formattedMessage,((i,s)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createTextVNode(t.toDisplayString(i)+" ",1),s+1<e.formattedMessage.length?(t.openBlock(),t.createElementBlock("br",{key:s})):t.createCommentVNode("v-if",!0)],64)))),256))],2)):t.createCommentVNode("v-if",!0)],2)}]]);const z=t.defineComponent({props:{size:String,expanded:Boolean,loading:Boolean,rounded:Boolean,icon:String,iconPack:String,maxlength:[Number,String],useHtml5Validation:{type:Boolean,default:()=>g},validationMessage:String,locale:{type:[String,Array],default:()=>i},statusIcon:{type:Boolean,default:()=>V}},emits:{blur:e=>!0,focus:e=>!0},data(){return{isValid:!0,isFocused:!1,newIconPack:this.iconPack||s,_elementRef:""}},computed:{parentField(){let e=this.$parent;for(let t=0;t<3;t++)e&&!e.$data._isField&&(e=e.$parent);return e},statusType(){const{newType:e}=this.parentField||{};if(e){if("string"==typeof e)return e;for(const t in e)if(e[t])return t}},statusMessage(){if(this.parentField)return this.parentField.newMessage||this.parentField.$slots.message},iconSize(){switch(this.size){case"is-small":return this.size;case"is-medium":return;case"is-large":return"mdi"===this.newIconPack?"is-medium":""}}},methods:{focus(){const e=this.getElement();void 0!==e&&this.$nextTick((()=>{e&&e.focus()}))},onBlur(e){this.isFocused=!1,this.$emit("blur",e),this.checkHtml5Validity()},onFocus(e){this.isFocused=!0,this.$emit("focus",e)},getElement(){let e=this.$refs[this.$data._elementRef];for(;null!=e&&"object"==typeof e&&"$refs"in e;){const t=e;e=t.$refs[t.$data._elementRef]}return e},setInvalid(){const e=this.validationMessage||this.getElement().validationMessage;this.setValidity("is-danger",e)},setValidity(e,t){this.$nextTick((()=>{this.parentField&&(this.parentField.type||(this.parentField.newType=e),this.parentField.message||(this.parentField.newMessage=t))}))},checkHtml5Validity(){if(!this.useHtml5Validation)return!1;const e=this.getElement();return null!=e&&(e.checkValidity()?(this.setValidity(null,null),this.isValid=!0):(this.setInvalid(),this.isValid=!1),this.isValid)}}}),I={sizes:{default:"mdi-24px","is-small":null,"is-medium":"mdi-36px","is-large":"mdi-48px"},iconPrefix:"mdi-"},Y=()=>{const e="fa-";return{sizes:{default:null,"is-small":null,"is-medium":e+"lg","is-large":e+"2x"},iconPrefix:e,internalIcons:{information:"info-circle",alert:"exclamation-triangle","alert-circle":"exclamation-circle","chevron-right":"angle-right","chevron-left":"angle-left","chevron-down":"angle-down","eye-off":"eye-slash","menu-down":"caret-down","menu-up":"caret-up","close-circle":"times-circle"}}};var H=O(t.defineComponent({name:"BIcon",props:{type:[String,Object],component:String,pack:String,icon:{type:String,required:!0},size:String,customSize:String,customClass:String,both:Boolean},computed:{iconConfig(){return{mdi:I,fa:Y(),fas:Y(),far:Y(),fad:Y(),fab:Y(),fal:Y(),"fa-solid":Y(),"fa-regular":Y(),"fa-light":Y(),"fa-thin":Y(),"fa-duotone":Y(),"fa-brands":Y()}[this.newPack]},iconPrefix(){return this.iconConfig&&this.iconConfig.iconPrefix?this.iconConfig.iconPrefix:""},newIcon(){return`${this.iconPrefix}${this.getEquivalentIconOf(this.icon)}`},newPack(){return this.pack||s},newType(){if(!this.type)return;let e=[];if("string"==typeof this.type)e=this.type.split("-");else for(const t in this.type)if(this.type[t]){e=t.split("-");break}if(e.length<=1)return;const[,...t]=e;return`has-text-${t.join("-")}`},newCustomSize(){return this.customSize||this.customSizeByPack},customSizeByPack(){if(this.iconConfig&&this.iconConfig.sizes){if(this.size&&void 0!==this.iconConfig.sizes[this.size])return this.iconConfig.sizes[this.size];if(this.iconConfig.sizes.default)return this.iconConfig.sizes.default}return null},useIconComponent(){return this.component||a}},methods:{getEquivalentIconOf(e){if(!this.both)return e;if(null==this.iconConfig)return e;const t=this.iconConfig;return t&&t.internalIcons&&t.internalIcons[e]?t.internalIcons[e]:e}}}),[["render",function(e,i,s,a,n,o){return t.openBlock(),t.createElementBlock("span",{class:t.normalizeClass(["icon",[e.newType,e.size]])},[e.useIconComponent?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.useIconComponent),{key:1,icon:[e.newPack,e.newIcon],size:e.newCustomSize,class:t.normalizeClass([e.customClass])},null,8,["icon","size","class"])):(t.openBlock(),t.createElementBlock("i",{key:0,class:t.normalizeClass([e.newPack,e.newIcon,e.newCustomSize,e.customClass])},null,2))],2)}]]),R=Object.getOwnPropertySymbols,L=Object.prototype.hasOwnProperty,W=Object.prototype.propertyIsEnumerable,j=t.defineComponent({inheritAttrs:!1,props:{compatFallthrough:{type:Boolean,default:()=>f}},computed:{rootAttrs(){return this.compatFallthrough?{class:this.$attrs.class,style:this.$attrs.style,id:this.$attrs.id}:{}},fallthroughAttrs(){if(this.compatFallthrough){const e=this.$attrs,{style:t,class:i,id:s}=e;return((e,t)=>{var i={};for(var s in e)L.call(e,s)&&t.indexOf(s)<0&&(i[s]=e[s]);if(null!=e&&R)for(var s of R(e))t.indexOf(s)<0&&W.call(e,s)&&(i[s]=e[s]);return i})(e,["style","class","id"])}return this.$attrs}}}),U=t.defineComponent({name:"BInput",components:{BIcon:H},mixins:[j,z],props:{modelValue:{type:[Number,String]},type:{type:String,default:"text"},lazy:{type:Boolean,default:!1},passwordReveal:Boolean,iconClickable:Boolean,hasCounter:{type:Boolean,default:()=>p},customClass:{type:String,default:""},iconRight:String,iconRightClickable:Boolean,iconRightType:String,autocomplete:String},emits:{"icon-click":e=>!0,"icon-right-click":e=>!0,"update:modelValue":e=>!0},data(){return{newValue:this.modelValue,newType:this.type,newAutocomplete:this.autocomplete||l,isPasswordVisible:!1,_elementRef:"textarea"===this.type?"textarea":"input"}},computed:{computedValue:{get(){return this.newValue},set(e){this.newValue=e,this.$emit("update:modelValue",e)}},rootClasses(){return[this.iconPosition,this.size,{"is-expanded":this.expanded,"is-loading":this.loading,"is-clearfix":!this.hasMessage}]},inputClasses(){return[this.statusType,this.size,{"is-rounded":this.rounded}]},hasIconRight(){return this.passwordReveal||this.loading||this.statusIcon&&this.statusTypeIcon||this.iconRight},rightIcon(){return this.passwordReveal?this.passwordVisibleIcon:this.iconRight?this.iconRight:this.statusTypeIcon},rightIconType(){return this.passwordReveal?"is-primary":this.iconRight?this.iconRightType||void 0:this.statusType},iconPosition(){let e="";return this.icon&&(e+="has-icons-left "),this.hasIconRight&&(e+="has-icons-right"),e},statusTypeIcon(){switch(this.statusType){case"is-success":return"check";case"is-danger":return"alert-circle";case"is-info":return"information";case"is-warning":return"alert";default:return}},hasMessage(){return!!this.statusMessage},passwordVisibleIcon(){return this.isPasswordVisible?"eye-off":"eye"},valueLength(){return"string"==typeof this.computedValue?Array.from(this.computedValue).length:"number"==typeof this.computedValue?this.computedValue.toString().length:0}},watch:{modelValue(e){const t=this.computedValue!=e;this.newValue=e,t&&this.$nextTick((()=>{!this.isValid&&this.checkHtml5Validity()}))},type(e){this.newType=e}},methods:{togglePasswordVisibility(){this.isPasswordVisible=!this.isPasswordVisible,this.newType=this.isPasswordVisible?"text":"password",this.$nextTick((()=>{this.focus()}))},iconClick(e,t){this.$emit(e,t),this.$nextTick((()=>{this.focus()}))},rightIconClick(e){this.passwordReveal?this.togglePasswordVisibility():this.iconRightClickable&&this.iconClick("icon-right-click",e)},onInput(){this.lazy||this.revalidate()},onChange(){this.lazy&&this.revalidate()},revalidate(){!this.isValid&&this.checkHtml5Validity()}}});const _=["type","autocomplete","maxlength"],K=["maxlength"],q=["type","autocomplete","maxlength"],J=["maxlength"];var X=O(U,[["render",function(e,i,s,a,n,o){const l=t.resolveComponent("b-icon");return t.openBlock(),t.createElementBlock("div",t.mergeProps({class:["control",e.rootClasses]},e.rootAttrs),[e.lazy?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},["textarea"!==e.type?t.withDirectives((t.openBlock(),t.createElementBlock("input",t.mergeProps({key:0,ref:"input",class:["input",[e.inputClasses,e.customClass]],type:e.newType,autocomplete:e.newAutocomplete,maxlength:e.maxlength,"onUpdate:modelValue":i[0]||(i[0]=t=>e.computedValue=t)},e.fallthroughAttrs,{onInput:i[1]||(i[1]=(...t)=>e.onInput&&e.onInput(...t)),onChange:i[2]||(i[2]=(...t)=>e.onChange&&e.onChange(...t)),onBlur:i[3]||(i[3]=(...t)=>e.onBlur&&e.onBlur(...t)),onFocus:i[4]||(i[4]=(...t)=>e.onFocus&&e.onFocus(...t))}),null,16,_)),[[t.vModelDynamic,e.computedValue,void 0,{lazy:!0}]]):t.withDirectives((t.openBlock(),t.createElementBlock("textarea",t.mergeProps({key:1,ref:"textarea",class:["textarea",[e.inputClasses,e.customClass]],maxlength:e.maxlength,"onUpdate:modelValue":i[5]||(i[5]=t=>e.computedValue=t)},e.fallthroughAttrs,{onInput:i[6]||(i[6]=(...t)=>e.onInput&&e.onInput(...t)),onChange:i[7]||(i[7]=(...t)=>e.onChange&&e.onChange(...t)),onBlur:i[8]||(i[8]=(...t)=>e.onBlur&&e.onBlur(...t)),onFocus:i[9]||(i[9]=(...t)=>e.onFocus&&e.onFocus(...t))}),null,16,K)),[[t.vModelText,e.computedValue,void 0,{lazy:!0}]])],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},["textarea"!==e.type?t.withDirectives((t.openBlock(),t.createElementBlock("input",t.mergeProps({key:0,ref:"input",class:["input",[e.inputClasses,e.customClass]],type:e.newType,autocomplete:e.newAutocomplete,maxlength:e.maxlength,"onUpdate:modelValue":i[10]||(i[10]=t=>e.computedValue=t)},e.fallthroughAttrs,{onInput:i[11]||(i[11]=(...t)=>e.onInput&&e.onInput(...t)),onChange:i[12]||(i[12]=(...t)=>e.onChange&&e.onChange(...t)),onBlur:i[13]||(i[13]=(...t)=>e.onBlur&&e.onBlur(...t)),onFocus:i[14]||(i[14]=(...t)=>e.onFocus&&e.onFocus(...t))}),null,16,q)),[[t.vModelDynamic,e.computedValue]]):t.withDirectives((t.openBlock(),t.createElementBlock("textarea",t.mergeProps({key:1,ref:"textarea",class:["textarea",[e.inputClasses,e.customClass]],maxlength:e.maxlength,"onUpdate:modelValue":i[15]||(i[15]=t=>e.computedValue=t)},e.fallthroughAttrs,{onInput:i[16]||(i[16]=(...t)=>e.onInput&&e.onInput(...t)),onChange:i[17]||(i[17]=(...t)=>e.onChange&&e.onChange(...t)),onBlur:i[18]||(i[18]=(...t)=>e.onBlur&&e.onBlur(...t)),onFocus:i[19]||(i[19]=(...t)=>e.onFocus&&e.onFocus(...t))}),null,16,J)),[[t.vModelText,e.computedValue]])],64)),e.icon?(t.openBlock(),t.createBlock(l,{key:2,class:t.normalizeClass(["is-left",{"is-clickable":e.iconClickable}]),icon:e.icon,pack:e.iconPack,size:e.iconSize,onClick:i[20]||(i[20]=t=>e.iconClick("icon-click",t))},null,8,["class","icon","pack","size"])):t.createCommentVNode("v-if",!0),!e.loading&&e.hasIconRight&&e.rightIcon?(t.openBlock(),t.createBlock(l,{key:3,class:t.normalizeClass(["is-right",{"is-clickable":e.passwordReveal||e.iconRightClickable}]),icon:e.rightIcon,pack:e.iconPack,size:e.iconSize,type:e.rightIconType,both:"",onClick:e.rightIconClick},null,8,["class","icon","pack","size","type","onClick"])):t.createCommentVNode("v-if",!0),e.maxlength&&e.hasCounter&&"number"!==e.type?(t.openBlock(),t.createElementBlock("small",{key:4,class:t.normalizeClass(["help counter",{"is-invisible":!e.isFocused}])},t.toDisplayString(e.valueLength)+" / "+t.toDisplayString(e.maxlength),3)):t.createCommentVNode("v-if",!0)],16)}]]);const G=(e,t=!1)=>e?t?e.querySelectorAll('*[tabindex="-1"]'):e.querySelectorAll('a[href]:not([tabindex="-1"]),\n area[href],\n input:not([disabled]),\n select:not([disabled]),\n textarea:not([disabled]),\n button:not([disabled]),\n iframe,\n object,\n embed,\n *[tabindex]:not([tabindex="-1"]),\n *[contenteditable]'):null;let Q;const Z={beforeMount:(e,{value:t=!0})=>{if(t){let t=G(e),i=G(e,!0);t&&t.length>0&&(Q=s=>{t=G(e),i=G(e,!0);const a=t[0],n=t[t.length-1];s.target===a&&s.shiftKey&&"Tab"===s.key?(s.preventDefault(),n.focus()):(s.target===n||Array.from(i).indexOf(s.target)>=0)&&!s.shiftKey&&"Tab"===s.key&&(s.preventDefault(),a.focus())},e.addEventListener("keydown",Q))}},unmounted:e=>{e.removeEventListener("keydown",Q)}},ee=["escape","outside"],te=Symbol("bdropdown");var ie=t.defineComponent({name:"BDropdown",directives:{trapFocus:Z},provide(){return{[te]:this}},props:{modelValue:{type:[String,Number,Boolean,Object,Array,Function],default:null},disabled:Boolean,inline:Boolean,scrollable:Boolean,maxHeight:{type:[String,Number],default:200},position:{type:String,validator:e=>["is-top-right","is-top-left","is-bottom-left","is-bottom-right"].indexOf(e)>-1},triggers:{type:Array,default:()=>["click"]},mobileModal:{type:Boolean,default:()=>y},ariaRole:{type:String,validator:e=>["menu","list","dialog"].indexOf(e)>-1,default:null},animation:{type:String,default:"fade"},multiple:Boolean,trapFocus:{type:Boolean,default:()=>C},closeOnClick:{type:Boolean,default:!0},canClose:{type:[Array,Boolean],default:!0},expanded:Boolean,appendToBody:Boolean,appendToBodyCopyParent:Boolean,triggerTabindex:{type:Number,default:0}},emits:{"active-change":e=>!0,change:e=>!0,"update:modelValue":e=>!0},data(){return{selected:this.modelValue,style:{},isActive:!1,isHoverable:!1,maybeTap:!1,isTouchEnabled:!1,_bodyEl:void 0,timeOutID:void 0,timeOutID2:void 0}},computed:{rootClasses(){return[this.position,{"is-disabled":this.disabled,"is-hoverable":this.hoverable,"is-inline":this.inline,"is-active":this.isActive||this.inline,"is-mobile-modal":this.isMobileModal,"is-expanded":this.expanded,"is-touch-enabled":this.isTouchEnabled}]},isMobileModal(){return this.mobileModal&&!this.inline},cancelOptions(){return"boolean"==typeof this.canClose?this.canClose?ee:[]:this.canClose},contentStyle(){var e,t;return{maxHeight:this.scrollable&&null!=(t=this.maxHeight,e=void 0===t?null:isNaN(+t)?`${t}`:t+"px")?e:void 0,overflow:this.scrollable?"auto":void 0}},hoverable(){return this.triggers.indexOf("hover")>=0}},watch:{modelValue(e){this.selected=e},isActive(e){this.$emit("active-change",e),e||(this.timeOutID=setTimeout((()=>{this.isActive||(this.isTouchEnabled=!1)}),250)),this.handleScroll(),this.appendToBody&&this.$nextTick((()=>{this.updateAppendToBody()}))},isHoverable(e){this.hoverable&&this.$emit("active-change",e)}},methods:{handleScroll(){"undefined"!=typeof window&&this.isMobileModal&&(this.isActive?document.documentElement.classList.add("is-clipped-touch"):document.documentElement.classList.remove("is-clipped-touch"))},selectItem(e){if(this.multiple){if(this.selected){const t=this.selected;-1===t.indexOf(e)?this.selected=[...t,e]:this.selected=t.filter((t=>t!==e))}else this.selected=[e];this.$emit("change",this.selected)}else this.selected!==e&&(this.selected=e,this.$emit("change",this.selected));this.$emit("update:modelValue",this.selected),this.multiple||(this.isActive=!this.closeOnClick,this.hoverable&&this.closeOnClick&&(this.isHoverable=!1))},isInWhiteList(e){if(e===this.$refs.dropdownMenu)return!0;if(e===this.$refs.trigger)return!0;if(null!=this.$refs.dropdownMenu){const t=this.$refs.dropdownMenu.querySelectorAll("*");for(const i of t)if(e===i)return!0}if(null!=this.$refs.trigger){const t=this.$refs.trigger.querySelectorAll("*");for(const i of t)if(e===i)return!0}return!1},clickedOutside(e){if(this.cancelOptions.indexOf("outside")<0)return;if(this.inline)return;const t=null!=(i=this).$root&&"shadowRoot"in i.$root.$options?e.composedPath()[0]:e.target;var i;this.isInWhiteList(t)||(this.isActive=!1)},keyPress({key:e}){if(this.isActive&&("Escape"===e||"Esc"===e)){if(this.cancelOptions.indexOf("escape")<0)return;this.isActive=!1}},onClick(){-1===this.triggers.indexOf("hover")&&(this.triggers.indexOf("click")<0||this.toggle())},onContextMenu(){this.triggers.indexOf("contextmenu")<0||this.toggle()},onHover(){this.triggers.indexOf("hover")<0||this.isTouchEnabled||(this.isHoverable=!0)},onTouchStart(){this.maybeTap=!0},onTouchMove(){this.maybeTap=!1},onTouchEnd(e){-1!==this.triggers.indexOf("hover")&&this.maybeTap&&(e.preventDefault(),this.maybeTap=!1,this.isTouchEnabled=!0,this.toggle())},onFocus(){this.triggers.indexOf("focus")<0||this.toggle()},toggle(){this.disabled||(this.isActive?this.isActive=!this.isActive:this.timeOutID2=setTimeout((()=>{const e=!this.isActive;this.isActive=e})))},updateAppendToBody(){const e=this.$refs.dropdown,t=this.$refs.dropdownMenu,i=this.$refs.trigger;if(t&&i){const s=this.$data._bodyEl.children[0];if(s.classList.forEach((e=>s.classList.remove(e))),s.classList.add("dropdown"),s.classList.add("dropdown-menu-animation"),this.rootClasses.forEach((e=>{if(e&&"object"==typeof e)for(const t in e)e[t]&&s.classList.add(t)})),this.appendToBodyCopyParent){const e=this.$refs.dropdown.parentNode,t=this.$data._bodyEl;t.classList.forEach((e=>t.classList.remove(e))),e.classList.forEach((e=>{t.classList.add(e)}))}const a=i.getBoundingClientRect();let n=a.top+window.scrollY,o=a.left+window.scrollX;!this.position||this.position.indexOf("bottom")>=0?n+=i.clientHeight:n-=t.clientHeight,this.position&&this.position.indexOf("left")>=0&&(o-=t.clientWidth-i.clientWidth),this.style={position:"absolute",top:`${n}px`,left:`${o}px`,zIndex:"99",width:this.expanded?`${e.offsetWidth}px`:void 0}}}},mounted(){this.appendToBody&&(this.$data._bodyEl=function(e){const t=document.createElement("div");t.style.position="absolute",t.style.left="0px",t.style.top="0px",t.style.width="100%";const i=document.createElement("div");return t.appendChild(i),i.appendChild(e),document.body.appendChild(t),t}(this.$refs.dropdownMenu),this.updateAppendToBody())},created(){"undefined"!=typeof window&&(document.addEventListener("click",this.clickedOutside),document.addEventListener("keyup",this.keyPress))},beforeUnmount(){var e;"undefined"!=typeof window&&(document.removeEventListener("click",this.clickedOutside),document.removeEventListener("keyup",this.keyPress)),this.appendToBody&&(void 0!==(e=this.$data._bodyEl).remove?e.remove():void 0!==e.parentNode&&null!==e.parentNode&&e.parentNode.removeChild(e)),clearTimeout(this.timeOutID),clearTimeout(this.timeOutID2)}});const se=["tabindex"],ae=["aria-hidden"],ne=["aria-hidden"],oe=["role","aria-modal"];var le=O(ie,[["render",function(e,i,s,a,n,o){const l=t.resolveDirective("trap-focus");return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["dropdown dropdown-menu-animation",e.rootClasses]),ref:"dropdown",onMouseleave:i[7]||(i[7]=t=>e.isHoverable=!1)},[e.inline?t.createCommentVNode("v-if",!0):(t.openBlock(),t.createElementBlock("div",{key:0,tabindex:e.disabled?void 0:e.triggerTabindex,ref:"trigger",class:"dropdown-trigger",onClick:i[0]||(i[0]=(...t)=>e.onClick&&e.onClick(...t)),onContextmenu:i[1]||(i[1]=t.withModifiers(((...t)=>e.onContextMenu&&e.onContextMenu(...t)),["prevent"])),onMouseenter:i[2]||(i[2]=(...t)=>e.onHover&&e.onHover(...t)),onFocusCapture:i[3]||(i[3]=(...t)=>e.onFocus&&e.onFocus(...t)),onTouchstart:i[4]||(i[4]=(...t)=>e.onTouchStart&&e.onTouchStart(...t)),onTouchmove:i[5]||(i[5]=(...t)=>e.onTouchMove&&e.onTouchMove(...t)),onTouchend:i[6]||(i[6]=(...t)=>e.onTouchEnd&&e.onTouchEnd(...t)),"aria-haspopup":"true"},[t.renderSlot(e.$slots,"trigger",{active:e.isActive})],40,se)),t.createVNode(t.Transition,{name:e.animation},{default:t.withCtx((()=>[e.isMobileModal?t.withDirectives((t.openBlock(),t.createElementBlock("div",{key:0,class:"background","aria-hidden":!e.isActive},null,8,ae)),[[t.vShow,e.isActive]]):t.createCommentVNode("v-if",!0)])),_:1},8,["name"]),t.createVNode(t.Transition,{name:e.animation,persisted:""},{default:t.withCtx((()=>[t.withDirectives((t.openBlock(),t.createElementBlock("div",{ref:"dropdownMenu",class:"dropdown-menu",style:t.normalizeStyle(e.style),"aria-hidden":!e.isActive},[t.createElementVNode("div",{class:"dropdown-content",role:e.ariaRole,"aria-modal":!e.inline,style:t.normalizeStyle(e.contentStyle)},[t.renderSlot(e.$slots,"default")],12,oe)],12,ne)),[[t.vShow,!e.disabled&&(e.isActive||e.isHoverable)||e.inline],[l,e.trapFocus]])])),_:3},8,["name"])],34)}]]),re=t.defineComponent({name:"BDropdownItem",inject:{parent:{from:te,default:void 0}},props:{value:{type:[String,Number,Boolean,Object,Array,Function],default:null},separator:Boolean,disabled:Boolean,custom:Boolean,focusable:{type:Boolean,default:!0},paddingless:Boolean,hasLink:Boolean,ariaRole:{type:String,default:""}},emits:{click:()=>!0},computed:{anchorClasses(){return{"is-disabled":this.parent.disabled||this.disabled,"is-paddingless":this.paddingless,"is-active":this.isActive}},itemClasses(){return{"dropdown-item":!this.hasLink,"is-disabled":this.disabled,"is-paddingless":this.paddingless,"is-active":this.isActive,"has-link":this.hasLink}},ariaRoleItem(){return"menuitem"===this.ariaRole||"listitem"===this.ariaRole?this.ariaRole:void 0},isClickable(){return!(this.parent.disabled||this.separator||this.disabled||this.custom)},isActive(){return null!==this.parent.selected&&(this.parent.multiple?this.parent.selected.indexOf(this.value)>=0:this.value===this.parent.selected)},isFocusable(){return!this.hasLink&&this.focusable}},methods:{selectItem(){this.isClickable&&(this.parent.selectItem(this.value),this.$emit("click"))}}});const de={key:0,class:"dropdown-divider"},ce=["role","tabindex"],ue=["role","tabindex"];var he=O(re,[["render",function(e,i,s,a,n,o){return e.separator?(t.openBlock(),t.createElementBlock("hr",de)):e.custom||e.hasLink?(t.openBlock(),t.createElementBlock("div",{key:2,class:t.normalizeClass(e.itemClasses),onClick:i[1]||(i[1]=(...t)=>e.selectItem&&e.selectItem(...t)),role:e.ariaRoleItem,tabindex:e.isFocusable?0:void 0},[t.renderSlot(e.$slots,"default")],10,ue)):(t.openBlock(),t.createElementBlock("a",{key:1,class:t.normalizeClass(["dropdown-item",e.anchorClasses]),onClick:i[0]||(i[0]=(...t)=>e.selectItem&&e.selectItem(...t)),role:e.ariaRoleItem,tabindex:e.isFocusable?0:void 0},[t.renderSlot(e.$slots,"default")],10,ce))}]]),me=t.defineComponent({name:"BSelect",components:{BIcon:H},mixins:[j,z],props:{modelValue:{type:[String,Number,Boolean,Object,Array,Function,Date,null],default:null},placeholder:String,multiple:Boolean,nativeSize:[String,Number]},emits:{blur:e=>!0,focus:e=>!0,"update:modelValue":e=>!0},data(){return{selected:this.modelValue,_elementRef:"select"}},computed:{computedValue:{get(){return this.selected},set(e){this.selected=e,this.$emit("update:modelValue",e),!this.isValid&&this.checkHtml5Validity()}},spanClasses(){return[this.size,this.statusType,{"is-fullwidth":this.expanded,"is-loading":this.loading,"is-multiple":this.multiple,"is-rounded":this.rounded,"is-empty":null===this.selected}]}},watch:{modelValue(e){this.selected=e,!this.isValid&&this.checkHtml5Validity()}}});const pe=["multiple","size"],fe={key:0,value:null,disabled:"",hidden:""};var ge=O(me,[["render",function(e,i,s,a,n,o){const l=t.resolveComponent("b-icon");return t.openBlock(),t.createElementBlock("div",t.mergeProps({class:["control",{"is-expanded":e.expanded,"has-icons-left":e.icon}]},e.rootAttrs),[t.createElementVNode("span",{class:t.normalizeClass(["select",e.spanClasses])},[t.withDirectives(t.createElementVNode("select",t.mergeProps({"onUpdate:modelValue":i[0]||(i[0]=t=>e.computedValue=t),ref:"select",multiple:e.multiple,size:e.nativeSize},e.fallthroughAttrs,{onBlur:i[1]||(i[1]=(...t)=>e.onBlur&&e.onBlur(...t)),onFocus:i[2]||(i[2]=t=>e.$emit("focus",t))}),[e.placeholder?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[null==e.computedValue?(t.openBlock(),t.createElementBlock("option",fe,t.toDisplayString(e.placeholder),1)):t.createCommentVNode("v-if",!0)],64)):t.createCommentVNode("v-if",!0),t.renderSlot(e.$slots,"default")],16,pe),[[t.vModelSelect,e.computedValue]])],2),e.icon?(t.openBlock(),t.createBlock(l,{key:0,class:"is-left",icon:e.icon,pack:e.iconPack,size:e.iconSize},null,8,["icon","pack","size"])):t.createCommentVNode("v-if",!0)],16)}]]),ye=t.defineComponent({name:"BDatepickerTableRow",inject:{$datepicker:{name:"$datepicker",default:!1}},props:{selectedDate:{type:[Date,Array]},hoveredDateRange:Array,day:{type:Number},week:{type:Array,required:!0},month:{type:Number,required:!0},minDate:[Date,null],maxDate:[Date,null],disabled:Boolean,unselectableDates:[Array,Function,null],unselectableDaysOfWeek:[Array,null],selectableDates:[Array,Function,null],events:Array,indicators:String,dateCreator:Function,nearbyMonthDays:Boolean,nearbySelectableMonthDays:Boolean,showWeekNumber:Boolean,weekNumberClickable:Boolean,range:Boolean,multiple:Boolean,rulesForFirstWeek:Number,firstDayOfWeek:[Number,null]},emits:{"change-focus":e=>!0,rangeHoverEndDate:e=>!0,select:e=>!0},watch:{day(e){const t=`day-${this.month}-${e}`;this.$nextTick((()=>{let e;e=Array.isArray(this.$refs[t])?this.$refs[t][0]:this.$refs[t],e&&e.focus()}))}},methods:{firstWeekOffset(e,t,i){const s=7+t-i;return-((7+new Date(e,0,s).getDay()-t)%7)+s-1},daysInYear(e){return this.isLeapYear(e)?366:365},isLeapYear:e=>e%4==0&&e%100!=0||e%400==0,getSetDayOfYear:e=>Math.round((+e-+new Date(e.getFullYear(),0,1))/864e5)+1,weeksInYear(e,t,i){const s=this.firstWeekOffset(e,t,i),a=this.firstWeekOffset(e+1,t,i);return(this.daysInYear(e)-s+a)/7},getWeekNumber(e){const t=this.firstDayOfWeek,i=this.rulesForFirstWeek,s=this.firstWeekOffset(e.getFullYear(),t,i),a=Math.floor((this.getSetDayOfYear(e)-s-1)/7)+1;let n,o;return a<1?(o=e.getFullYear()-1,n=a+this.weeksInYear(o,t,i)):a>this.weeksInYear(e.getFullYear(),t,i)?(n=a-this.weeksInYear(e.getFullYear(),t,i),o=e.getFullYear()+1):(o=e.getFullYear(),n=a),{week:n,year:o}},clickWeekNumber(e){this.weekNumberClickable&&this.$datepicker.$emit("week-number-click",e.week,e.year)},selectableDate(e){const t=[];if(this.minDate&&t.push(e>=this.minDate),this.maxDate&&t.push(e<=this.maxDate),this.nearbyMonthDays&&!this.nearbySelectableMonthDays&&t.push(e.getMonth()===this.month),this.selectableDates)if("function"==typeof this.selectableDates){if(this.selectableDates(e))return!0;t.push(!1)}else for(let i=0;i<this.selectableDates.length;i++){const s=this.selectableDates[i];if(e.getDate()===s.getDate()&&e.getFullYear()===s.getFullYear()&&e.getMonth()===s.getMonth())return!0;t.push(!1)}if(this.unselectableDates)if("function"==typeof this.unselectableDates)t.push(!this.unselectableDates(e));else for(let i=0;i<this.unselectableDates.length;i++){const s=this.unselectableDates[i];t.push(e.getDate()!==s.getDate()||e.getFullYear()!==s.getFullYear()||e.getMonth()!==s.getMonth())}if(this.unselectableDaysOfWeek)for(let i=0;i<this.unselectableDaysOfWeek.length;i++){const s=this.unselectableDaysOfWeek[i];t.push(e.getDay()!==s)}return t.indexOf(!1)<0},emitChosenDate(e){this.disabled||this.selectableDate(e)&&this.$emit("select",e)},eventsDateMatch(e){if(!this.events||!this.events.length)return!1;const t=[];for(let i=0;i<this.events.length;i++)this.events[i].date.getDay()===e.getDay()&&t.push(this.events[i]);return!!t.length&&t},classObject(e){function t(e,t,i){return!(!e||!t||i)&&(Array.isArray(t)?t.some((t=>e.getDate()===t.getDate()&&e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth())):e.getDate()===t.getDate()&&e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth())}function i(e,t,i){return!(!Array.isArray(t)||i)&&(e>t[0]&&e<t[1])}return{"is-selected":t(e,this.selectedDate)||i(e,this.selectedDate,this.multiple),"is-first-selected":t(e,Array.isArray(this.selectedDate)?this.selectedDate[0]:void 0,this.multiple),"is-within-selected":i(e,this.selectedDate,this.multiple),"is-last-selected":t(e,Array.isArray(this.selectedDate)?this.selectedDate[1]:void 0,this.multiple),"is-within-hovered-range":this.hoveredDateRange&&2===this.hoveredDateRange.length&&(t(e,this.hoveredDateRange)||i(e,this.hoveredDateRange)),"is-first-hovered":t(e,Array.isArray(this.hoveredDateRange)?this.hoveredDateRange[0]:void 0),"is-within-hovered":i(e,this.hoveredDateRange),"is-last-hovered":t(e,Array.isArray(this.hoveredDateRange)?this.hoveredDateRange[1]:void 0),"is-today":t(e,this.dateCreator()),"is-selectable":this.selectableDate(e)&&!this.disabled,"is-unselectable":!this.selectableDate(e)||this.disabled,"is-invisible":!this.nearbyMonthDays&&e.getMonth()!==this.month,"is-nearby":this.nearbySelectableMonthDays&&e.getMonth()!==this.month,"has-event":this.eventsDateMatch(e),[this.indicators]:this.eventsDateMatch(e)}},setRangeHoverEndDate(e){this.range&&this.$emit("rangeHoverEndDate",e)},manageKeydown(e,t){const{key:i}=e;let s=!0;switch(i){case"Tab":s=!1;break;case" ":case"Space":case"Spacebar":case"Enter":this.emitChosenDate(t);break;case"ArrowLeft":case"Left":this.changeFocus(t,-1);break;case"ArrowRight":case"Right":this.changeFocus(t,1);break;case"ArrowUp":case"Up":this.changeFocus(t,-7);break;case"ArrowDown":case"Down":this.changeFocus(t,7)}s&&e.preventDefault()},changeFocus(e,t){const i=new Date(e.getTime());for(i.setDate(e.getDate()+t);(!this.minDate||i>this.minDate)&&(!this.maxDate||i<this.maxDate)&&!this.selectableDate(i);)i.setDate(i.getDate()+Math.sign(t));this.setRangeHoverEndDate(i),this.$emit("change-focus",i)}}});const be={class:"datepicker-row"},ke=["disabled","onClick","onMouseenter","onKeydown","tabindex"],De={key:0,class:"events"},ve={key:0,class:"events"};var we=O(ye,[["render",function(e,i,s,a,n,o){return t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createCommentVNode(" eslint-disable max-len "),t.createElementVNode("div",be,[e.showWeekNumber?(t.openBlock(),t.createElementBlock("a",{key:0,class:t.normalizeClass(["datepicker-cell is-week-number",{"is-clickable":e.weekNumberClickable}]),onClick:i[0]||(i[0]=t.withModifiers((t=>e.clickWeekNumber(e.getWeekNumber(e.week[6]))),["prevent"]))},[t.createElementVNode("span",null,t.toDisplayString(e.getWeekNumber(e.week[6]).week),1)],2)):t.createCommentVNode("v-if",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.week,((i,s)=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:s},[e.selectableDate(i)&&!e.disabled?(t.openBlock(),t.createElementBlock("a",{key:0,ref_for:!0,ref:`day-${i.getMonth()}-${i.getDate()}`,class:t.normalizeClass([e.classObject(i),"datepicker-cell"]),role:"button",href:"#",disabled:e.disabled||void 0,onClick:t.withModifiers((t=>e.emitChosenDate(i)),["prevent"]),onMouseenter:t=>e.setRangeHoverEndDate(i),onKeydown:t=>e.manageKeydown(t,i),tabindex:e.day===i.getDate()&&e.month===i.getMonth()?void 0:-1},[t.createElementVNode("span",null,t.toDisplayString(i.getDate()),1),e.eventsDateMatch(i)?(t.openBlock(),t.createElementBlock("div",De,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.eventsDateMatch(i),((e,i)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["event",e.type]),key:i},null,2)))),128))])):t.createCommentVNode("v-if",!0)],42,ke)):(t.openBlock(),t.createElementBlock("div",{key:1,class:t.normalizeClass([e.classObject(i),"datepicker-cell"])},[t.createElementVNode("span",null,t.toDisplayString(i.getDate()),1),e.eventsDateMatch(i)?(t.openBlock(),t.createElementBlock("div",ve,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.eventsDateMatch(i),((e,i)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["event",e.type]),key:i},null,2)))),128))])):t.createCommentVNode("v-if",!0)],2))],64)))),128))]),t.createCommentVNode(" eslint-enable max-len ")],2112)}]]),Be=t.defineComponent({name:"BDatepickerTable",components:{BDatepickerTableRow:we},props:{modelValue:{type:[Date,Array,null]},dayNames:[Array,null],monthNames:[Array,null],firstDayOfWeek:[Number,null],events:Array,indicators:String,minDate:[Date,null],maxDate:[Date,null],focused:Object,disabled:Boolean,dateCreator:Function,unselectableDates:[Array,Function,null],unselectableDaysOfWeek:[Array,null],selectableDates:[Array,Function,null],nearbyMonthDays:Boolean,nearbySelectableMonthDays:Boolean,showWeekNumber:Boolean,weekNumberClickable:Boolean,rulesForFirstWeek:Number,range:Boolean,multiple:Boolean},emits:{"range-end":e=>!0,"range-start":e=>!0,"update:focused":e=>!0,"update:modelValue":e=>!0},data:()=>({selectedBeginDate:void 0,selectedEndDate:void 0,hoveredEndDate:void 0}),computed:{multipleSelectedDates:{get(){return this.multiple&&this.modelValue?this.modelValue:[]},set(e){this.$emit("update:modelValue",e)}},visibleDayNames(){const e=[];let t=this.firstDayOfWeek;for(;e.length<this.dayNames.length;){const i=this.dayNames[t%this.dayNames.length];e.push(i),t++}return this.showWeekNumber&&e.unshift(""),e},hasEvents(){return this.events&&this.events.length},eventsInThisMonth(){if(!this.events)return[];const e=[];for(let t=0;t<this.events.length;t++){let i=this.events[t];Object.prototype.hasOwnProperty.call(i,"date")||(i={date:i,type:"is-primary"}),Object.prototype.hasOwnProperty.call(i,"type")||(i.type="is-primary"),i.date.getMonth()===this.focused.month&&i.date.getFullYear()===this.focused.year&&e.push(i)}return e},weeksInThisMonth(){this.validateFocusedDay();const e=this.focused.month,t=this.focused.year,i=[];let s=1;for(;i.length<6;){const a=this.weekBuilder(s,e,t);i.push(a),s+=7}return i},hoveredDateRange(){var e,t;return this.range&&isNaN(null!=(t=null==(e=this.selectedEndDate)?void 0:e.valueOf())?t:NaN)?this.hoveredEndDate<this.selectedBeginDate?[this.hoveredEndDate,this.selectedBeginDate].filter(x):[this.selectedBeginDate,this.hoveredEndDate].filter(x):[]},disabledOrUndefined(){return this.disabled||void 0}},methods:{updateSelectedDate(e){this.range||this.multiple?this.range?this.handleSelectRangeDate(e):this.multiple&&this.handleSelectMultipleDates(e):this.$emit("update:modelValue",e)},handleSelectRangeDate(e){this.selectedBeginDate&&this.selectedEndDate?(this.selectedBeginDate=e,this.selectedEndDate=void 0,this.$emit("range-start",e)):this.selectedBeginDate&&!this.selectedEndDate?(this.selectedBeginDate>e?(this.selectedEndDate=this.selectedBeginDate,this.selectedBeginDate=e):this.selectedEndDate=e,this.$emit("range-end",e),this.$emit("update:modelValue",[this.selectedBeginDate,this.selectedEndDate])):(this.selectedBeginDate=e,this.$emit("range-start",e))},handleSelectMultipleDates(e){this.multipleSelectedDates.filter((t=>t.getDate()===e.getDate()&&t.getFullYear()===e.getFullYear()&&t.getMonth()===e.getMonth())).length?this.multipleSelectedDates=this.multipleSelectedDates.filter((t=>t.getDate()!==e.getDate()||t.getFullYear()!==e.getFullYear()||t.getMonth()!==e.getMonth())):this.multipleSelectedDates=[...this.multipleSelectedDates,e]},weekBuilder(e,t,i){const s=new Date(i,t),a=[],n=new Date(i,t,e).getDay(),o=n>=this.firstDayOfWeek?n-this.firstDayOfWeek:7-this.firstDayOfWeek+n;let l=1;for(let t=0;t<o;t++)a.unshift(new Date(s.getFullYear(),s.getMonth(),e-l)),l++;a.push(new Date(i,t,e));let r=1;for(;a.length<7;)a.push(new Date(i,t,e+r)),r++;return a},validateFocusedDay(){const e=new Date(this.focused.year,this.focused.month,this.focused.day);if(this.selectableDate(e))return;let t=0;const i=new Date(this.focused.year,this.focused.month+1,0).getDate();let s=null;for(;!s&&++t<i;){const i=new Date(this.focused.year,this.focused.month,t);if(this.selectableDate(i)){s=e;const t={day:i.getDate(),month:i.getMonth(),year:i.getFullYear()};this.$emit("update:focused",t)}}},selectableDate(e){const t=[];if(this.minDate&&t.push(e>=this.minDate),this.maxDate&&t.push(e<=this.maxDate),this.nearbyMonthDays&&!this.nearbySelectableMonthDays&&t.push(e.getMonth()===this.focused.month),this.selectableDates)if("function"==typeof this.selectableDates){if(this.selectableDates(e))return!0;t.push(!1)}else for(let i=0;i<this.selectableDates.length;i++){const s=this.selectableDates[i];if(e.getDate()===s.getDate()&&e.getFullYear()===s.getFullYear()&&e.getMonth()===s.getMonth())return!0;t.push(!1)}if(this.unselectableDates)if("function"==typeof this.unselectableDates)t.push(!this.unselectableDates(e));else for(let i=0;i<this.unselectableDates.length;i++){const s=this.unselectableDates[i];t.push(e.getDate()!==s.getDate()||e.getFullYear()!==s.getFullYear()||e.getMonth()!==s.getMonth())}if(this.unselectableDaysOfWeek)for(let i=0;i<this.unselectableDaysOfWeek.length;i++){const s=this.unselectableDaysOfWeek[i];t.push(e.getDay()!==s)}return t.indexOf(!1)<0},eventsInThisWeek(e){return this.eventsInThisMonth.filter((t=>{const i=new Date(Date.parse(t.date+""));i.setHours(0,0,0,0);const s=i.getTime();return e.some((e=>e.getTime()===s))}))},setRangeHoverEndDate(e){this.hoveredEndDate=e},changeFocus(e){const t={day:e.getDate(),month:e.getMonth(),year:e.getFullYear()};this.$emit("update:focused",t)}}});const Se={class:"datepicker-table"},Ce={class:"datepicker-header"};var Ve=O(Be,[["render",function(e,i,s,a,n,o){const l=t.resolveComponent("b-datepicker-table-row");return t.openBlock(),t.createElementBlock("section",Se,[t.createElementVNode("header",Ce,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.visibleDayNames,((e,i)=>(t.openBlock(),t.createElementBlock("div",{key:i,class:"datepicker-cell"},[t.createElementVNode("span",null,t.toDisplayString(e),1)])))),128))]),t.createElementVNode("div",{class:t.normalizeClass(["datepicker-body",{"has-events":e.hasEvents}])},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.weeksInThisMonth,((i,s)=>(t.openBlock(),t.createBlock(l,{key:s,"selected-date":e.modelValue??void 0,day:e.focused.day,week:i,month:e.focused.month,"min-date":e.minDate,"max-date":e.maxDate,disabled:e.disabledOrUndefined,"unselectable-dates":e.unselectableDates,"unselectable-days-of-week":e.unselectableDaysOfWeek,"selectable-dates":e.selectableDates,events:e.eventsInThisWeek(i),indicators:e.indicators,"date-creator":e.dateCreator,"nearby-month-days":e.nearbyMonthDays,"nearby-selectable-month-days":e.nearbySelectableMonthDays,"show-week-number":e.showWeekNumber,"week-number-clickable":e.weekNumberClickable,"first-day-of-week":e.firstDayOfWeek,"rules-for-first-week":e.rulesForFirstWeek,range:e.range,"hovered-date-range":e.hoveredDateRange,onSelect:e.updateSelectedDate,onRangeHoverEndDate:e.setRangeHoverEndDate,multiple:e.multiple,onChangeFocus:e.changeFocus},null,8,["selected-date","day","week","month","min-date","max-date","disabled","unselectable-dates","unselectable-days-of-week","selectable-dates","events","indicators","date-creator","nearby-month-days","nearby-selectable-month-days","show-week-number","week-number-clickable","first-day-of-week","rules-for-first-week","range","hovered-date-range","onSelect","onRangeHoverEndDate","multiple","onChangeFocus"])))),128))],2)])}]]),Me=t.defineComponent({name:"BDatepickerMonth",props:{modelValue:{type:[Date,Array,null]},monthNames:[Array,null],events:Array,indicators:String,minDate:[Date,null],maxDate:[Date,null],focused:Object,disabled:Boolean,dateCreator:Function,unselectableDates:[Array,Function,null],unselectableDaysOfWeek:[Array,null],selectableDates:[Array,Function,null],range:Boolean,multiple:Boolean},emits:{"change-focus":e=>!0,"range-end":e=>!0,"range-start":e=>!0,"update:modelValue":e=>!0},data(){return{selectedBeginDate:void 0,selectedEndDate:void 0,hoveredEndDate:void 0,multipleSelectedDates:this.multiple&&this.modelValue?this.modelValue:[]}},computed:{hasEvents(){return this.events&&this.events.length},eventsInThisYear(){if(!this.events)return[];const e=[];for(let t=0;t<this.events.length;t++){let i=this.events[t];Object.prototype.hasOwnProperty.call(i,"date")||(i={date:i,type:"is-primary"}),Object.prototype.hasOwnProperty.call(i,"type")||(i.type="is-primary"),i.date.getFullYear()===this.focused.year&&e.push(i)}return e},monthDates(){const e=this.focused.year,t=[];for(let i=0;i<12;i++){const s=new Date(e,i,1);s.setHours(0,0,0,0),t.push(s)}return t},focusedMonth(){return this.focused.month},hoveredDateRange(){var e,t;return this.range&&isNaN(null!=(t=null==(e=this.selectedEndDate)?void 0:e.valueOf())?t:NaN)?this.hoveredEndDate<this.selectedBeginDate?[this.hoveredEndDate,this.selectedBeginDate].filter(x):[this.selectedBeginDate,this.hoveredEndDate].filter(x):[]},disabledOrUndefined(){return this.disabled||void 0}},watch:{focusedMonth(e){const t=`month-${e}`;this.$nextTick((()=>{let e;e=Array.isArray(this.$refs[t])?this.$refs[t][0]:this.$refs[t],e&&e.focus()}))}},methods:{selectMultipleDates(e){this.multipleSelectedDates.filter((t=>t.getDate()===e.getDate()&&t.getFullYear()===e.getFullYear()&&t.getMonth()===e.getMonth())).length?this.multipleSelectedDates=this.multipleSelectedDates.filter((t=>t.getDate()!==e.getDate()||t.getFullYear()!==e.getFullYear()||t.getMonth()!==e.getMonth())):this.multipleSelectedDates.push(e),this.$emit("update:modelValue",this.multipleSelectedDates)},selectableDate(e){const t=[];if(this.minDate&&t.push(e>=this.minDate),this.maxDate&&t.push(e<=this.maxDate),t.push(e.getFullYear()===this.focused.year),this.selectableDates)if("function"==typeof this.selectableDates){if(this.selectableDates(e))return!0;t.push(!1)}else for(let i=0;i<this.selectableDates.length;i++){const s=this.selectableDates[i];if(e.getFullYear()===s.getFullYear()&&e.getMonth()===s.getMonth())return!0;t.push(!1)}if(this.unselectableDates)if("function"==typeof this.unselectableDates)t.push(!this.unselectableDates(e));else for(let i=0;i<this.unselectableDates.length;i++){const s=this.unselectableDates[i];t.push(e.getFullYear()!==s.getFullYear()||e.getMonth()!==s.getMonth())}if(this.unselectableDaysOfWeek)for(let i=0;i<this.unselectableDaysOfWeek.length;i++){const s=this.unselectableDaysOfWeek[i];t.push(e.getDay()!==s)}return t.indexOf(!1)<0},eventsDateMatch(e){if(!this.eventsInThisYear.length)return!1;const t=[];for(let i=0;i<this.eventsInThisYear.length;i++)this.eventsInThisYear[i].date.getMonth()===e.getMonth()&&t.push(this.events[i]);return!!t.length&&t},classObject(e){function t(e,t,i){return!(!e||!t||i)&&(Array.isArray(t)?t.some((t=>e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth())):e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth())}function i(e,t,i){return!(!Array.isArray(t)||i)&&(e>t[0]&&e<t[1])}return{"is-selected":t(e,this.modelValue,this.multiple)||i(e,this.modelValue,this.multiple)||(s=e,a=this.multipleSelectedDates,n=this.multiple,!(!Array.isArray(a)||!n)&&a.some((e=>s.getDate()===e.getDate()&&s.getFullYear()===e.getFullYear()&&s.getMonth()===e.getMonth()))),"is-first-selected":t(e,Array.isArray(this.modelValue)?this.modelValue[0]:void 0,this.multiple),"is-within-selected":i(e,this.modelValue,this.multiple),"is-last-selected":t(e,Array.isArray(this.modelValue)?this.modelValue[1]:void 0,this.multiple),"is-within-hovered-range":this.hoveredDateRange&&2===this.hoveredDateRange.length&&(t(e,this.hoveredDateRange)||i(e,this.hoveredDateRange)),"is-first-hovered":t(e,Array.isArray(this.hoveredDateRange)?this.hoveredDateRange[0]:void 0),"is-within-hovered":i(e,this.hoveredDateRange),"is-last-hovered":t(e,Array.isArray(this.hoveredDateRange)?this.hoveredDateRange[1]:void 0),"is-today":t(e,this.dateCreator()),"is-selectable":this.selectableDate(e)&&!this.disabled,"is-unselectable":!this.selectableDate(e)||this.disabled};var s,a,n},manageKeydown({key:e},t){switch(e){case" ":case"Space":case"Spacebar":case"Enter":this.updateSelectedDate(t);break;case"ArrowLeft":case"Left":this.changeFocus(t,-1);break;case"ArrowRight":case"Right":this.changeFocus(t,1);break;case"ArrowUp":case"Up":this.changeFocus(t,-3);break;case"ArrowDown":case"Down":this.changeFocus(t,3)}},updateSelectedDate(e){this.range||this.multiple?this.range?thi