!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).Calendar=e()}(this,(function(){"use strict";"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function t(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var e={exports:{}};e.exports=function(){var t=1e3,e=6e4,n=36e5,a="millisecond",i="second",s="minute",o="hour",d="day",r="week",l="month",c="quarter",h="year",m="date",f="Invalid Date",p=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,u=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,v={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],n=t%100;return"["+t+(e[(n-20)%10]||e[n]||e[0])+"]"}},_=function(t,e,n){var a=String(t);return!a||a.length>=e?t:""+Array(e+1-a.length).join(n)+t},y={s:_,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),a=Math.floor(n/60),i=n%60;return(e<=0?"+":"-")+_(a,2,"0")+":"+_(i,2,"0")},m:function t(e,n){if(e.date()1)return t(o[0])}else{var d=e.name;E[d]=e,i=d}return!a&&i&&(g=i),i||!a&&g},k=function(t,e){if(w(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new T(n)},$=y;$.l=M,$.i=w,$.w=function(t,e){return k(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var T=function(){function v(t){this.$L=M(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[b]=!0}var _=v.prototype;return _.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if($.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var a=e.match(p);if(a){var i=a[2]-1||0,s=(a[7]||"0").substring(0,3);return n?new Date(Date.UTC(a[1],i,a[3]||1,a[4]||0,a[5]||0,a[6]||0,s)):new Date(a[1],i,a[3]||1,a[4]||0,a[5]||0,a[6]||0,s)}}return new Date(e)}(t),this.init()},_.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},_.$utils=function(){return $},_.isValid=function(){return!(this.$d.toString()===f)},_.isSame=function(t,e){var n=k(t);return this.startOf(e)<=n&&n<=this.endOf(e)},_.isAfter=function(t,e){return k(t)68?1900:2e3)},d=function(t){return function(e){this[t]=+e}},r=[/[+-]\d\d:?(\d\d)?|Z/,function(t){(this.zone||(this.zone={})).offset=function(t){if(!t)return 0;if("Z"===t)return 0;var e=t.match(/([+-]|\d\d)/g),n=60*e[1]+(+e[2]||0);return 0===n?0:"+"===e[0]?-n:n}(t)}],l=function(t){var e=s[t];return e&&(e.indexOf?e:e.s.concat(e.f))},c=function(t,e){var n,a=s.meridiem;if(a){for(var i=1;i<=24;i+=1)if(t.indexOf(a(i,0,e))>-1){n=i>12;break}}else n=t===(e?"pm":"PM");return n},h={A:[i,function(t){this.afternoon=c(t,!1)}],a:[i,function(t){this.afternoon=c(t,!0)}],S:[/\d/,function(t){this.milliseconds=100*+t}],SS:[n,function(t){this.milliseconds=10*+t}],SSS:[/\d{3}/,function(t){this.milliseconds=+t}],s:[a,d("seconds")],ss:[a,d("seconds")],m:[a,d("minutes")],mm:[a,d("minutes")],H:[a,d("hours")],h:[a,d("hours")],HH:[a,d("hours")],hh:[a,d("hours")],D:[a,d("day")],DD:[n,d("day")],Do:[i,function(t){var e=s.ordinal,n=t.match(/\d+/);if(this.day=n[0],e)for(var a=1;a<=31;a+=1)e(a).replace(/\[|\]/g,"")===t&&(this.day=a)}],M:[a,d("month")],MM:[n,d("month")],MMM:[i,function(t){var e=l("months"),n=(l("monthsShort")||e.map((function(t){return t.slice(0,3)}))).indexOf(t)+1;if(n<1)throw new Error;this.month=n%12||n}],MMMM:[i,function(t){var e=l("months").indexOf(t)+1;if(e<1)throw new Error;this.month=e%12||e}],Y:[/[+-]?\d+/,d("year")],YY:[n,function(t){this.year=o(t)}],YYYY:[/\d{4}/,d("year")],Z:r,ZZ:r};function m(n){var a,i;a=n,i=s&&s.formats;for(var o=(n=a.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(e,n,a){var s=a&&a.toUpperCase();return n||i[a]||t[a]||i[s].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(t,e,n){return e||n.slice(1)}))}))).match(e),d=o.length,r=0;r-1)return new Date(("X"===e?1e3:1)*t);var a=m(e)(t),i=a.year,s=a.month,o=a.day,d=a.hours,r=a.minutes,l=a.seconds,c=a.milliseconds,h=a.zone,f=new Date,p=o||(i||s?1:f.getDate()),u=i||f.getFullYear(),v=0;i&&!s||(v=s>0?s-1:f.getMonth());var _=d||0,y=r||0,g=l||0,E=c||0;return h?new Date(Date.UTC(u,v,p,_,y,g,E+60*h.offset*1e3)):n?new Date(Date.UTC(u,v,p,_,y,g,E)):new Date(u,v,p,_,y,g,E)}catch(b){return new Date("")}}(e,d,a),this.init(),h&&!0!==h&&(this.$L=this.locale(h).$L),c&&e!=this.format(d)&&(this.$d=new Date("")),s={}}else if(d instanceof Array)for(var f=d.length,p=1;p<=f;p+=1){o[1]=d[p-1];var u=n.apply(this,o);if(u.isValid()){this.$d=u.$d,this.$L=u.$L,this.init();break}p===f&&(this.$d=new Date(""))}else i.call(this,t)}}}()}(a);const i=t(a.exports);var s={exports:{}};!function(t,e){t.exports=function(t,e){e.prototype.isSameOrAfter=function(t,e){return this.isSame(t,e)||this.isAfter(t,e)}}}(s);const o=t(s.exports);var d={exports:{}};!function(t,e){t.exports=function(t,e){e.prototype.isSameOrBefore=function(t,e){return this.isSame(t,e)||this.isBefore(t,e)}}}(d);const r=t(d.exports);var l={exports:{}};!function(t,e){t.exports=function(t,e,n){var a=function(t,e){if(!e||!e.length||1===e.length&&!e[0]||1===e.length&&Array.isArray(e[0])&&!e[0].length)return null;var n;1===e.length&&e[0].length>0&&(e=e[0]),n=(e=e.filter((function(t){return t})))[0];for(var a=1;a{do{t+=Math.floor(1e6*Math.random())}while(document.getElementById(t));return t},m=()=>{const{jQuery:t}=window;return t&&!document.body.hasAttribute("data-mdb-no-jquery")?t:null};document.documentElement.dir;const f=t=>document.createElement(t),p=(()=>{const t={};let e=1;return{set(n,a,i){void 0===n[a]&&(n[a]={key:a,id:e},e++),t[n[a].id]=i},get(e,n){if(!e||void 0===e[n])return null;const a=e[n];return a.key===n?t[a.id]:null},delete(e,n){if(void 0===e[n])return;const a=e[n];a.key===n&&(delete t[a.id],delete e[n])}}})(),u={setData(t,e,n){p.set(t,e,n)},getData:(t,e)=>p.get(t,e),removeData(t,e){p.delete(t,e)}};let v=Element.prototype.querySelectorAll,_=Element.prototype.querySelector;const y=(()=>{const t=new CustomEvent("Bootstrap",{cancelable:!0}),e=document.createElement("div");return e.addEventListener("Bootstrap",(()=>null)),t.preventDefault(),e.dispatchEvent(t),t.defaultPrevented})(),g=/:scope\b/;(()=>{const t=document.createElement("div");try{t.querySelectorAll(":scope *")}catch(e){return!1}return!0})()||(v=function(t){if(!g.test(t))return this.querySelectorAll(t);const e=Boolean(this.id);e||(this.id=h("scope"));let n=null;try{t=t.replace(g,`#${this.id}`),n=this.querySelectorAll(t)}finally{e||this.removeAttribute("id")}return n},_=function(t){if(!g.test(t))return this.querySelector(t);const e=E.call(this,t);return void 0!==e[0]?e[0]:null});const E=v,b=_,w=m(),M=/[^.]*(?=\..*)\.|.*/,k=/\..*/,$=/::\d+$/,T={};let C=1;const D={mouseenter:"mouseover",mouseleave:"mouseout"},S=["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 L(t,e){return e&&`${e}::${C++}`||t.uidEvent||C++}function O(t){const e=L(t);return t.uidEvent=e,T[e]=T[e]||{},T[e]}function A(t,e,n=null){const a=Object.keys(t);for(let i=0,s=a.length;i-1||(s=t),[a,i,s]}function H(t,e,n,a,i){if("string"!=typeof e||!t)return;n||(n=a,a=null);const[s,o,d]=x(e,n,a),r=O(t),l=r[d]||(r[d]={}),c=A(l,o,s?n:null);if(c)return void(c.oneOff=c.oneOff&&i);const h=L(o,e.replace(M,"")),m=s?function(t,e,n){return function a(i){const s=t.querySelectorAll(e);for(let{target:e}=i;e&&e!==this;e=e.parentNode)for(let o=s.length;o--;"")if(s[o]===e)return a.oneOff&&B.off(t,i.type,n),n.apply(e,[i]);return null}}(t,n,a):function(t,e){return function n(a){return n.oneOff&&B.off(t,a.type,e),e.apply(t,[a])}}(t,n);m.delegationSelector=s?n:null,m.originalHandler=o,m.oneOff=i,m.uidEvent=h,l[h]=m,t.addEventListener(d,m,s)}function I(t,e,n,a,i){const s=A(e[n],a,i);s&&(t.removeEventListener(n,s,Boolean(i)),delete e[n][s.uidEvent])}const B={on(t,e,n,a){H(t,e,n,a,!1)},one(t,e,n,a){H(t,e,n,a,!0)},off(t,e,n,a){if("string"!=typeof e||!t)return;const[i,s,o]=x(e,n,a),d=o!==e,r=O(t),l="."===e.charAt(0);if(void 0!==s){if(!r||!r[o])return;return void I(t,r,o,s,i?n:null)}l&&Object.keys(r).forEach((n=>{!function(t,e,n,a){const i=e[n]||{};Object.keys(i).forEach((s=>{if(s.indexOf(a)>-1){const a=i[s];I(t,e,n,a.originalHandler,a.delegationSelector)}}))}(t,r,n,e.slice(1))}));const c=r[o]||{};Object.keys(c).forEach((n=>{const a=n.replace($,"");if(!d||e.indexOf(a)>-1){const e=c[n];I(t,r,o,e.originalHandler,e.delegationSelector)}}))},trigger(t,e,n){if("string"!=typeof e||!t)return null;const a=e.replace(k,""),i=e!==a,s=S.indexOf(a)>-1;let o,d=!0,r=!0,l=!1,c=null;return i&&w&&(o=w.Event(e,n),w(t).trigger(o),d=!o.isPropagationStopped(),r=!o.isImmediatePropagationStopped(),l=o.isDefaultPrevented()),s?(c=document.createEvent("HTMLEvents"),c.initEvent(a,d,!0)):c=new CustomEvent(e,{bubbles:d,cancelable:!0}),void 0!==n&&Object.keys(n).forEach((t=>{Object.defineProperty(c,t,{get:()=>n[t]})})),l&&(c.preventDefault(),y||Object.defineProperty(c,"defaultPrevented",{get:()=>!0})),r&&t.dispatchEvent(c),c.defaultPrevented&&void 0!==o&&o.preventDefault(),c}};function Y(t){return"true"===t||"false"!==t&&(t===Number(t).toString()?Number(t):""===t||"null"===t?null:t)}function N(t){return t.replace(/[A-Z]/g,(t=>`-${t.toLowerCase()}`))}const F={setDataAttribute(t,e,n){t.setAttribute(`data-mdb-${N(e)}`,n)},removeDataAttribute(t,e){t.removeAttribute(`data-mdb-${N(e)}`)},getDataAttributes(t){if(!t)return{};const e={...t.dataset};return Object.keys(e).filter((t=>t.startsWith("mdb"))).forEach((t=>{let n=t.replace(/^mdb/,"");n=n.charAt(0).toLowerCase()+n.slice(1,n.length),e[n]=Y(e[t])})),e},getDataAttribute:(t,e)=>Y(t.getAttribute(`data-mdb-${N(e)}`)),offset(t){const e=t.getBoundingClientRect();return{top:e.top+document.body.scrollTop,left:e.left+document.body.scrollLeft}},position:t=>({top:t.offsetTop,left:t.offsetLeft}),style(t,e){Object.assign(t.style,e)},toggleClass(t,e){t&&(t.classList.contains(e)?t.classList.remove(e):t.classList.add(e))},addClass(t,e){t.classList.contains(e)||t.classList.add(e)},addStyle(t,e){Object.keys(e).forEach((n=>{t.style[n]=e[n]}))},removeClass(t,e){t.classList.contains(e)&&t.classList.remove(e)},hasClass:(t,e)=>t.classList.contains(e)},j={closest:(t,e)=>t.closest(e),matches:(t,e)=>t.matches(e),find:(t,e=document.documentElement)=>[].concat(...E.call(e,t)),findOne:(t,e=document.documentElement)=>b.call(e,t),children:(t,e)=>[].concat(...t.children).filter((t=>t.matches(e))),parents(t,e){const n=[];let a=t.parentNode;for(;a&&a.nodeType===Node.ELEMENT_NODE&&3!==a.nodeType;)this.matches(a,e)&&n.push(a),a=a.parentNode;return n},prev(t,e){let n=t.previousElementSibling;for(;n;){if(n.matches(e))return[n];n=n.previousElementSibling}return[]},next(t,e){let n=t.nextElementSibling;for(;n;){if(this.matches(n,e))return[n];n=n.nextElementSibling}return[]}};function P(t){let e;return e=t.start.dateTime.isSame(t.end.dateTime,"day")&&t.start.dateTime.isSame(t.end.dateTime,"time")&&"12:00 AM"===t.start.dateTime.format("hh:mm A")?"one-day-event":t.start.dateTime.isSame(t.end.dateTime,"day")&&!t.start.dateTime.isSame(t.end.dateTime,"time")?"short-event":t.start.dateTime.isSame(t.end.dateTime,"day")||"12:00 AM"!==t.start.dateTime.format("hh:mm A")?"long-event-with-time":"long-event",e}function R(t,e){let n;return"long-event"===P(t)?n=`${t.start.dateTime.format(e.date)} -\n ${t.end.dateTime.format(e.date)}`:"long-event-with-time"===P(t)?n=`${t.start.dateTime.format(e.date)} ${t.start.dateTime.format(e.time)} -\n ${t.end.dateTime.format(e.date)} ${t.end.dateTime.format(e.time)}`:"one-day-event"===P(t)?n=`${t.start.dateTime.format(e.date)}`:"short-event"===P(t)&&(n=`${t.start.dateTime.format(e.date)} ${t.start.dateTime.format(e.time)} - ${t.end.dateTime.format(e.time)}`),n}class V{constructor(t,e,n){this._element=t,this._event=e,this._formats=n,this._content="",this.init()}init(){this._setContent(),this._initTooltip()}_setContent(){this._setSummary(),this._setDescription(),this._setTime()}_setSummary(){const t=`
${this._event.summary}
`;this._content+=t}_setDescription(){if(void 0!==this._event.description){const t=`

${this._event.description}

`;this._content+=t}}_setTime(){const t=`

\n \n ${R(this._event,this._formats)}

`;this._content+=t}_initTooltip(){F.setDataAttribute(this._element,"toggle","tooltip"),F.setDataAttribute(this._element,"offset",[0,10]),F.setDataAttribute(this._element,"html",!0),this._element.setAttribute("title",this._content)}}n.extend(i),n.extend(o),n.extend(r),n.extend(c);const W="calendar",U="mdb.calendar",J="day-field",Z="events-wrapper",q="active",z=`td.${q}`,K=".calendar-long-events-checkbox",Q="editEvent.mdb.calendar",X="valueChanged.mdb.timepicker",G="valueChanged.mdb.datepicker",tt="optionSelected.mdb.select",et={addEventCaption:"string",weekdays:"(array|string)",months:"(array|string)",monthsShort:"(array|string)",mondayFirst:"boolean",defaultView:"string",twelveHour:"boolean",defaultDate:"(object|string)",readonly:"boolean",todayCaption:"string",monthCaption:"string",weekCaption:"string",listCaption:"string",allDayCaption:"string",noEventsCaption:"string",summaryCaption:"string",descriptionCaption:"string",startCaption:"string",endCaption:"string",addCaption:"string",deleteCaption:"string",saveCaption:"string",closeCaption:"string",addEventModalCaption:"string",editEventModalCaption:"string",events:"array",tooltips:"boolean",navigation:"boolean",viewSelect:"boolean",addEventButton:"boolean",blur:"boolean",newEventAttributes:"function",datepickerOptions:"object",timepickerOptions:"object"},nt={addEventCaption:"Add event",weekdays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],mondayFirst:!1,defaultView:"month",twelveHour:!1,defaultDate:n().format("DD/MM/YYYY"),readonly:!1,todayCaption:"Today",monthCaption:"Month",weekCaption:"Week",allDayCaption:"All day event",listCaption:"List",noEventsCaption:"No events",summaryCaption:"Summary",descriptionCaption:"Description",startCaption:"Start",endCaption:"End",addCaption:"Add",deleteCaption:"Remove",saveCaption:"Save",closeCaption:"Close",addEventModalCaption:"Add an event",editEventModalCaption:"Edit an event",events:[],tooltips:!0,navigation:!0,viewSelect:!0,addEventButton:!0,blur:!1,newEventAttributes:t=>t,datepickerOptions:{},timepickerOptions:{}};class at{constructor(t,e={}){this._element=t,this._options=e,this.formats={date:"DD/MM/YYYY",dateTime:this.options.twelveHour?"DD/MM/YYYY hh:mm A":"DD/MM/YYYY HH:mm",time:this.options.twelveHour?"hh:mm A":"HH:mm"},this.view=this.options.defaultView,this.weekdays=[...this.options.weekdays],this.activeMoment=n(this.options.defaultDate,this.formats.date);const a=this.options.events.length>0?JSON.parse(JSON.stringify(this.options.events)):[];this._events=this._formatEvents(a),this._newEvent={},this._activeEvent={},this._addModalId=h("addModal"),this._editModalId=h("editModal"),this._table=null,this._tHead=null,this._tBody=null,this._addEventModal=null,this._editEventModal=null,this._tools=null,this._arrowLeft=null,this._arrowRight=null,this._pickedStartDate=null,this._addEventModalInstance=null,this._editEventModalInstance=null,this._colorDropdownInstances=[],this._inputInstances=[],this._tooltips=[],this._element&&u.setData(t,U,this),this.init()}get events(){return this._parseEvents(this._events)}get options(){const t={...nt,...F.getDataAttributes(this._element),...this._options};return((t,e,n)=>{Object.keys(n).forEach((a=>{const i=n[a],s=e[a],o=s&&((d=s)[0]||d).nodeType?"element":(t=>null==t?`${t}`:{}.toString.call(t).match(/\s([a-z]+)/i)[1].toLowerCase())(s);var d;if(!new RegExp(i).test(o))throw new Error(`${t.toUpperCase()}: Option "${a}" provided type "${o}" but expected type "${i}".`)}))})(W,t,et),"string"==typeof t.weekdays&&(t.weekdays=t.weekdays.split(", ")),"string"==typeof t.months&&(t.months=t.months.split(", ")),"string"==typeof t.monthsShort&&(t.monthsShort=t.monthsShort.split(", ")),t}get activeMomentCopy(){return n(this.activeMoment)}get activeEventIndex(){return this._activeEvent.key-1}init(){this._appendTemplate(),this._sortEvents(),this._addEventsKeys(),this._setEvents(),this._orderEvents(),this._setLongEventCaptions(),this._addListeners(),this._initTooltips(),this._initSelect(),this.options.readonly||(this._createAddEventModal(),this._createEditEventModal())}prev(){switch(this.view){case"month":this.activeMoment=this.activeMoment.startOf("month").subtract(1,"month");break;case"week":case"list":this.activeMoment=this.activeMoment.subtract(1,"week"),this._setTHeadCaptions();break;default:return}this._refreshTable(),this._triggerEvent("prev")}next(){switch(this.view){case"month":this.activeMoment=this.activeMoment.startOf("month").add(1,"month"),this._setTBody();break;case"week":case"list":this.activeMoment=this.activeMoment.add(1,"week"),this._setTHeadCaptions();break;default:return}this._refreshTable(),this._triggerEvent("next")}today(){switch(this.activeMoment=n(),this._setHeading(),this.view){case"month":this._setTBody();break;case"week":case"list":this._setTHeadCaptions();break;default:return}this._refreshTable(),this._triggerEvent("today")}changeView(t){this.view=t,this._setTHeadCaptions(),this._setHeading(),this._refreshTable(),this._updateSelectValue(),this._triggerEvent("viewChange")}refresh(){this._clearEvents(),this._sortEvents(),this._addEventsKeys(),this._setTBody(),this._setEvents(),this._orderEvents(),this._setLongEventCaptions(),this._initTooltips(),this._triggerEvent("update")}addEvents(t){const e=JSON.parse(JSON.stringify(t));this._events=this._formatEvents([...this._events,...e]),this.refresh()}removeEvents(){this._events=[],this.refresh()}dispose(){this.removeEvents(),this._removeListeners(),this._disposeModals(),u.removeData(this._element,U),this._element.innerHTML=null}_formatEvents(t){return t.map((t=>((t={...t}).created=t.created&&n(t.created,this.formats.dateTime),t.start.date=t.start.date&&n(t.start.date,this.formats.date),t.start.dateTime=t.start.dateTime?n(t.start.dateTime,this.formats.dateTime):n(t.start.date,this.formats.date),t.end.date=t.end.date&&n(t.end.date,this.formats.date),t.end.dateTime=t.end.dateTime?n(t.end.dateTime,this.formats.dateTime):n(t.end.date,this.formats.date),t.color=t.color||{},t)))}_updateSelectValue(){mdb.Select.getInstance(this._viewSelect).setValue(this.view)}_parseEvent(t){return{...t,start:{date:n(t.start.date).format(this.formats.date),dateTime:n(t.start.dateTime).format(this.formats.dateTime)},end:{date:n(t.end.date).format(this.formats.date),dateTime:n(t.end.dateTime).format(this.formats.dateTime)},created:t.created?n(t.created).format(this.formats.dateTime):void 0}}_parseEvents(t){return t.map((t=>this._parseEvent(t)))}_appendTemplate(){this._appendTools(),this._appendTable(),this.options.mondayFirst&&this.weekdays.push(this.weekdays.shift()),this._setTHeadCaptions(),this._setTBody()}_appendTable(){this._table=f("table"),this._element.append(this._table),this._tHead=f("thead"),this._table.append(this._tHead),this._tBody=f("tbody"),this._table.append(this._tBody);const t=f("tr");this._tHead.append(t)}_appendTools(){this._tools=f("div");const t=f("div"),e=f("div"),n=f("div");this._todayBtn=f("button"),this._arrowLeft=f("button"),this._arrowRight=f("button"),this._heading=f("span"),this._viewSelect=f("select"),this._newEventBtn=f("button"),F.addClass(this._tools,"calendar-tools"),F.addClass(this._heading,"calendar-heading"),F.addClass(t,"d-flex"),F.addClass(t,"flex-column"),F.addClass(t,"flex-lg-row"),F.addClass(t,"justify-content-center"),F.addClass(t,"align-items-center"),F.addClass(n,"my-2"),F.addClass(n,"me-2"),F.addClass(n,"my-lg-0"),F.addClass(n,"d-flex"),F.addClass(n,"justify-content-center"),F.addClass(e,"d-flex"),F.addClass(e,"justify-content-center"),F.addClass(this._viewSelect,"select"),F.addClass(this._newEventBtn,"btn"),F.addClass(this._newEventBtn,"btn-primary"),[this._arrowLeft,this._arrowRight,this._todayBtn].forEach((t=>{F.setDataAttribute(t,"ripple-color","dark")})),this._todayBtn.innerHTML=this.options.todayCaption,this._arrowLeft.innerHTML='',this._arrowRight.innerHTML='',this._viewSelect.innerHTML=``,this._newEventBtn.innerHTML=this.options.addEventCaption,["btn","btn-link"].forEach((t=>{F.addClass(this._arrowLeft,t),F.addClass(this._arrowRight,t),F.addClass(this._todayBtn,t)})),this._setHeading(),n.append(this._todayBtn),n.append(this._arrowLeft),n.append(this._arrowRight),this.options.navigation&&t.append(n),t.append(this._heading),this.options.viewSelect&&e.append(this._viewSelect),this.options.addEventButton&&!this.options.readonly&&e.append(this._newEventBtn),this._tools.append(t),this._tools.append(e),this._element.append(this._tools)}_setTHeadCaptions(){const t=j.findOne("tr",this._tHead);if(t.innerHTML="","month"===this.view)this.weekdays.forEach((e=>{const n=f("th");n.innerHTML=e,t.append(n)}));else if("week"===this.view){const e=f("th");t.append(e);for(let a=0;a<7;a++){const e=f("th");if(this.options.mondayFirst){const t=this.activeMomentCopy.startOf("week").add(a+1,"day");e.innerHTML=`
${this.weekdays[a]}
${t.format("DD")}
`,t.isSame(n(),"day")&&F.addClass(e,"today")}else{const t=this.activeMomentCopy.startOf("week").add(a,"day");e.innerHTML=`
${this.weekdays[a]}
${t.format("DD")}
`,t.isSame(n(),"day")&&F.addClass(e,"today")}t.append(e)}}}_setTBody(){switch(this._clearTBody(),F.addClass(this._table,this.view),this.view){case"month":this._appendWeekRows(),this._appendPrevMonthDays(),this._appendCurrentMonthDays(),this._appendNextMonthDays();break;case"week":this._appendLongEventSection(),this._appendHoursSection();break;default:return}}_appendWeekRows(){for(let t=0;t<6;t++){const t=f("tr");this._tBody.append(t)}}_appendPrevMonthDays(){const t=this.activeMomentCopy.startOf("month").day(),e=this._getArrayFromNumber(this.activeMomentCopy.subtract(1,"months").daysInMonth());let n;n=this.options.mondayFirst?0===t?e.reverse().splice(0,6).reverse():e.reverse().splice(0,t-1).reverse():e.reverse().splice(0,t).reverse(),n.forEach((t=>{this._appendPrevMonthDayFields(t)}))}_appendPrevMonthDayFields(t){const e=f("div"),n=f("td"),a=f("div"),i=f("div");F.addClass(e,Z),F.addClass(n,"disabled"),F.addClass(a,"day-field-wrapper"),F.addClass(i,J),a.append(i),n.append(a),n.append(e);const s=`${this._pad(t+1)}/${this._pad(this.activeMomentCopy.startOf("month").subtract(1,"month").month()+1)}/${this.activeMomentCopy.startOf("month").subtract(1,"month").year()}`;n.dataset.date=s,i.innerHTML=t+1,j.findOne("tr",this._tBody).append(n),this.options.readonly||this._addDayFieldListeners(n,s)}_addDayFieldListeners(t,e){B.on(t,"mousedown",(()=>this._setStartDate(e))),B.on(t,"mouseenter",(()=>this._highlightLongEventField(e))),B.on(t,"mouseup",(t=>this._toggleAddEventModal(t,e))),B.on(t,"dragenter",(t=>this._handleDragEnter(t))),B.on(t,"dragover",(t=>this._handleDragOver(t))),B.on(t,"dragleave",(t=>this._handleDragLeave(t))),B.on(t,"drop",(t=>this._handleDrop(t,e)))}_setStartDate(t){this._pickedStartDate=t}_highlightLongEventField(t){this._pickedStartDate&&j.find("td",this._tBody).forEach((e=>{let a,i,s;e.dataset.dateTime?(a=n(n(this._pickedStartDate).format(this.formats.dateTime),this.formats.dateTime),i=n(n(t).format(this.formats.dateTime),this.formats.dateTime),s=n(n(e.dataset.dateTime).format(this.formats.dateTime),this.formats.dateTime)):(a=n(this._pickedStartDate,this.formats.date),i=n(t,this.formats.date),s=n(e.dataset.date,this.formats.date)),s.isBefore(i,"minute")&&s.isAfter(a,"minute")||s.isAfter(i,"minute")&&s.isBefore(a,"minute")?F.addClass(e,q):F.removeClass(e,q)}))}_clearHighlight(){j.find(z,this._tBody).forEach((t=>{F.removeClass(t,q)}))}_toggleNewEventModal(){const t=n().format(this.formats.date);this._pickedStartDate=t;this._toggleAddEventModal({which:1},t)}_toggleAddEventModal(t,e){if(3===t.which)return;this._newEvent={};const a={},i={};a.date=n.min([n(this._pickedStartDate,this.formats.date),n(e,this.formats.date)]).startOf("day"),i.date=n.max([n(this._pickedStartDate,this.formats.date),n(e,this.formats.date)]).startOf("day"),n(this._pickedStartDate,this.formats.dateTime).isValid()&&n(e,this.formats.dateTime).isValid()?(a.dateTime=n.min([n(this._pickedStartDate,this.formats.dateTime),n(e,this.formats.dateTime)]),i.dateTime=n.max([n(this._pickedStartDate,this.formats.dateTime).add(1,"hour"),n(e,this.formats.dateTime).add(1,"hour")])):(a.dateTime=n.min([n(this._pickedStartDate,this.formats.date),n(e,this.formats.date)]),i.dateTime=n.max([n(this._pickedStartDate,this.formats.date),n(e,this.formats.date)])),this._setNewEvent(a,i),this._updateAddEventModalContent(),this._addEventModalInstance||(this._addEventModalInstance=new mdb.Modal(this._addEventModal)),this._addEventModalInstance.show(),this._initInputs(),this._initPickers(),this._initColorDropdowns(this._newEvent),this._addInputsListeners(),this._clearSelection(),setTimeout((()=>{const t=j.findOne(".calendar-summary-input",this._addEventModal);this._updateInputs(),t.focus()}),500)}_setNewEvent(t,e){this._newEvent={summary:"",description:"",start:{date:t.date,dateTime:t.dateTime},end:{date:e.date,dateTime:e.dateTime},color:{background:"#cfe0fc",foreground:"#0a47a9"}}}_clearSelection(){window.getSelection?window.getSelection().empty?window.getSelection().empty():window.getSelection().removeAllRanges&&window.getSelection().removeAllRanges():document.selection&&document.selection.empty(),this._pickedStartDate=null,this._clearHighlight()}_initInputs(){this._inputInstances=j.find(".form-outline",this._addEventModal).map((t=>new mdb.Input(t))),this._inputInstances.push(...j.find(".form-outline",this._editEventModal).map((t=>new mdb.Input(t))))}_initColorDropdowns(t){const e=[].slice.call(document.querySelectorAll(".color-dropdown-toggle"));this._colorDropdownInstances=e.map((e=>(t&&this._setDefaultDrodpownColor(e,t.color.background),new mdb.Dropdown(e))))}_setDefaultDrodpownColor(t,e){t.innerHTML=``}_updateInputs(){}_initPickers(){j.find(".datepicker",this._addEventModal).forEach((t=>{new mdb.Datepicker(t,this._options.datepickerOptions)})),j.find(".datepicker",this._editEventModal).forEach((t=>{new mdb.Datepicker(t,this._options.datepickerOptions)})),j.find(".timepicker",this._addEventModal).forEach((t=>{const e=j.findOne("input",t).value;new mdb.Timepicker(t,{defaultTime:e,format24:!this.options.twelveHour,...this._options.timepickerOptions})})),j.find(".timepicker",this._editEventModal).forEach((t=>{const e=j.findOne("input",t).value;new mdb.Timepicker(t,{defaultTime:e,format24:!this.options.twelveHour,...this._options.timepickerOptions})}))}_addInputsListeners(){j.find("input",this._addEventModal).forEach((t=>{B.on(t,"input",(t=>this._newEventUpdateData(t)))})),j.find("input",this._editEventModal).forEach((t=>{B.on(t,"input",(t=>this._editActiveEventData(t)))})),j.find("textarea",this._addEventModal).forEach((t=>{B.on(t,"input",(t=>this._newEventUpdateData(t)))})),j.find("textarea",this._editEventModal).forEach((t=>{B.on(t,"input",(t=>this._editActiveEventData(t)))})),j.find(".datepicker",this._addEventModal).forEach((t=>{const e={},n=j.findOne(".datepicker-toggle-button",t);e.target=j.findOne("input",t),B.on(t,G,(()=>{this._newEventUpdateData(e)})),B.on(n,"click",(t=>t.preventDefault()))})),j.find(".timepicker",this._addEventModal).forEach((t=>{const e={};e.target=j.findOne("input",t),B.on(t,X,(()=>{this._newEventUpdateData(e)}))})),j.find(".datepicker",this._editEventModal).forEach((t=>{const e={},n=j.findOne(".datepicker-toggle-button",t);e.target=j.findOne("input",t),B.on(t,G,(()=>{this._editActiveEventData(e)})),B.on(n,"click",(t=>t.preventDefault()))})),j.find(".timepicker",this._editEventModal).forEach((t=>{const e={};e.target=j.findOne("input",t),B.on(t,X,(()=>{this._editActiveEventData(e)}))})),j.find(".color-dropdown .dropdown-item",this._editEventModal).forEach((t=>{B.on(t,"click",(t=>this._editExistingEventColor(t)))})),j.find(".color-dropdown .dropdown-item",this._addEventModal).forEach((t=>{B.on(t,"click",(t=>this._editNewEventColor(t)))}))}_editExistingEventColor(t){t.preventDefault(),this._editActiveEventData(t),this._setDropdownActiveColor(t)}_editNewEventColor(t){t.preventDefault(),this._newEventUpdateData(t),this._setDropdownActiveColor(t)}_setDropdownActiveColor(t){j.findOne(".dropdown-toggle",j.closest(t.target,".dropdown")).innerHTML=``}_newEventUpdateData(t){switch(t.target.name){case"summary":this._newEvent.summary=t.target.value;break;case"description":this._newEvent.description=t.target.value;break;case"start.date":this._newEvent.start.date=n(t.target.value,this.formats.date),this._newEvent.start.dateTime=n(`${t.target.value} ${this._newEvent.start.dateTime.format(this.formats.date)}`,this.formats.date);break;case"end.date":this._newEvent.end.date=n(t.target.value,this.formats.date),this._newEvent.end.dateTime=n(`${t.target.value} ${this._newEvent.end.dateTime.format(this.formats.date)}`,this.formats.date);break;case"start.time":this._newEvent.start.dateTime=n(`${this._newEvent.start.date.format(this.formats.date)} ${t.target.value}`,this.formats.dateTime);break;case"end.time":this._newEvent.end.dateTime=n(`${this._newEvent.end.date.format(this.formats.date)} ${t.target.value}`,this.formats.dateTime);break;case"color":this._newEvent.color||(this._newEvent.color={}),this._newEvent.color.background=t.target.dataset.background,this._newEvent.color.foreground=t.target.dataset.foreground;break;default:return}this._clearValidation()}_editActiveEventData(t){switch(t.target.name){case"summary":this._activeEvent.summary=t.target.value;break;case"description":this._activeEvent.description=t.target.value;break;case"start.date":this._activeEvent.start.date=n(t.target.value,this.formats.date),this._activeEvent.start.dateTime=n(`${t.target.value} ${this._activeEvent.start.dateTime.format(this.formats.date)}`,this.formats.date);break;case"end.date":this._activeEvent.end.date=n(t.target.value,this.formats.date),this._activeEvent.end.dateTime=n(`${t.target.value} ${this._activeEvent.end.dateTime.format(this.formats.date)}`,this.formats.date);break;case"start.time":this._activeEvent.start.dateTime=n(`${this._activeEvent.start.date.format(this.formats.date)} ${t.target.value}`,this.formats.dateTime);break;case"end.time":this._activeEvent.end.dateTime=n(`${this._activeEvent.end.date.format(this.formats.date)} ${t.target.value}`,this.formats.dateTime);break;case"color":this._activeEvent.color||(this._activeEvent.color={}),this._activeEvent.color.background=t.target.dataset.background,this._activeEvent.color.foreground=t.target.dataset.foreground;break;default:return}this._clearValidation()}_toggleInfoEventModal(t){t.stopPropagation()}_toggleEditEventModal(t,e){this._clearSelection(),t.stopPropagation(),3===t.which||e.readonly||(this._setActiveEvent(e),this._updateEditEventModalContent(),this._editEventModalInstance||(this._editEventModalInstance=new mdb.Modal(this._editEventModal)),this._editEventModalInstance.show(),this._initInputs(),this._initPickers(),this._initColorDropdowns(e),this._addInputsListeners(),setTimeout((()=>{this._updateInputs()}),500))}_preventModalToggling(t){this._clearSelection(),t.stopPropagation()}_setActiveEvent(t){this._activeEvent={...t,start:{...t.start},end:{...t.end},color:{...t.color}}}_appendCurrentMonthDays(){const t=this.activeMomentCopy.startOf("month").day(),e=this._getArrayFromNumber(this.activeMomentCopy.daysInMonth()),n=[];if(this.options.mondayFirst){0===t?(n.push(e.slice(0,1)),n.push(e.slice(1,8-t))):n.push(e.slice(0,8-t));for(let a=7;a<=35;a+=7)n.push(e.slice(8-t+a-7,8-t+a))}else{n.push(e.slice(0,7-t));for(let a=7;a<=35;a+=7)n.push(e.slice(7-t+a-7,7-t+a))}this._createCurrentMonthDayFields(n)}_createCurrentMonthDayFields(t){for(let e=0;e<6;e++)for(let a=0;an(t.start.dateTime).diff(e.start.dateTime)))}_addEventsKeys(){this._events.forEach(((t,e)=>t.key=e+1))}_setEvents(){this._events.forEach(((t,e)=>{this._appendEvent(t,e)})),"list"===this.view&&this._appendEmptyList()}_appendEvent(t){switch(this.view){case"month":this._appendMonthEvent(t);break;case"week":this._appendWeekEvent(t);break;case"list":this._appendListEvent(t);break;default:return}}_appendMonthEvent(t){j.find("td",this._tBody).forEach((e=>{const a=n(e.dataset.date,this.formats.date),i=f("div");n(t.start.date).isSame(a)?this._appendEventFirstDay(i,t,e):n(t.start.dateTime).isBefore(a)&&n(t.end.dateTime).isSameOrAfter(a)&&this._appendEventContinuation(i,t,e),n(t.end.date).isAfter(a)||F.addClass(i,"event-end"),this.options.readonly||t.readonly?F.addClass(i,"event-readonly"):(i.setAttribute("draggable",!0),this._appendMonthListeners(i,t)),t.readonly&&this._appendReadonlyEventListener(i),this.options.blur&&n().isAfter(a,"day")&&F.addClass(i,"event-blur"),this._initTooltip(i,t)}))}_initTooltip(t,e){this.options.tooltips&&new V(t,e,this.formats)}_appendEventFirstDay(t,e,a){if(e.order=j.find(".event",a).length,F.style(t,{order:e.key}),F.addClass(t,"event"),F.addClass(t,`event-${e.key}`),F.setDataAttribute(t,"event-key",e.key),F.setDataAttribute(t,"event-order",e.order),e.start.dateTime.isSame(e.end.dateTime,"day")&&!e.start.dateTime.isSame(e.end.dateTime,"time")){const n=f("i");["fas","fa-circle","pe-1","event-circle"].forEach((t=>{F.addClass(n,t)})),F.addClass(t,"event-short"),F.style(n,{color:e.color&&e.color.background}),t.append(n)}else F.style(t,{background:e.color&&e.color.background,color:e.color&&e.color.foreground});const i=n(a.dataset.date,this.formats.date);n(e.end.date).isAfter(i)||F.addClass(t,"event-end"),t.append(e.summary),j.findOne(`.${Z}`,a).append(t)}_appendEventContinuation(t,e,n){t.innerHTML=" ",F.style(t,{order:e.key,background:e.color&&e.color.background,color:e.color&&e.color.foreground}),F.setDataAttribute(t,"event-key",e.key),F.setDataAttribute(t,"event-order",e.order),["event",`event-${e.key}`,"event-long"].forEach((e=>{F.addClass(t,e)})),j.findOne(`.${Z}`,n).append(t)}_appendMonthListeners(t,e){B.on(t,"dragstart",(t=>this._handleDragStart(t,e))),B.on(t,"dragend",(t=>this._handleDragEnd(t,e))),B.on(t,"mouseup",(t=>this._toggleEditEventModal(t,e))),B.on(t,"mouseenter",(()=>this._markEvent(e))),B.on(t,"mouseleave",(()=>this._unmarkEvent(e)))}_appendReadonlyEventListener(t){B.on(t,"mouseup",(t=>this._preventModalToggling(t)))}_markEvent(t){j.find(`.event-${t.key}`,this._tBody).forEach((t=>{F.addClass(t,q)}))}_unmarkEvent(t){j.find(`.event-${t.key}`,this._tBody).forEach((t=>{F.removeClass(t,q)}))}_handleDragStart(t,e){this._hideTooltip(t),this._clearSelection();j.find(`.event-${e.key}`,this._tBody).forEach((t=>{F.addClass(t,"dragging")})),t.dataTransfer.setData("text/plain",e.key)}_handleDragEnd(t,e){j.find(`.event-${e.key}`,this._tBody).forEach((t=>{F.removeClass(t,"dragging")}))}_handleDragOver(t){return t.preventDefault&&t.preventDefault(),!1}_handleDragEnter(t){F.addClass(t.target,"dragenter")}_handleDragLeave(t){F.removeClass(t.target,"dragenter")}_handleDrop(t,e){const a=parseInt(t.dataTransfer.getData("text/plain"),10),i=this._events[a-1],s=n(i.start.dateTime,this.formats.dateTime),o=n(i.start.dateTime).format(this.formats.time),d=n(i.end.dateTime,this.formats.dateTime),r=d.diff(s,"days"),l=d.diff(s,"minutes");i.start={date:n(e,this.formats.date),dateTime:n(`${e} ${o}`,this.formats.dateTime)},i.end={date:n(e,this.formats.date).add(r,"days"),dateTime:n(`${e} ${o}`,this.formats.dateTime).add(l,"minutes")},B.trigger(this._element,Q,{event:this._parseEvent(i)}),this.refresh()}_orderEvents(){j.find(`.${Z}`,this._tBody).forEach((t=>{const e=j.find(".event",t);for(let n=0;n<=e.length;n++){if(!e[n])return;let a=this._getAllPrevEl(e[n]).length{t.dataset.mdbEventOrdert.dataset.mdbEventOrder=e))})),a=this._getAllPrevEl(e[n]).length0&&this._appendEventsInRow(t[4],e),n>0&&this._appendEventsInRow(t[5],n,e)}_appendEventsInRow(t,e,n=0){for(let a=0;a{const i=this.options.mondayFirst?this.activeMomentCopy.startOf("week").add(a,"day").add(1,"day"):this.activeMomentCopy.startOf("week").add(a,"day"),s=f("div");if(n(t.start.date).isSame(i)){if(F.style(s,{order:t.key}),t.order=j.find(".event",e).length,F.addClass(s,"event"),F.addClass(s,`event-${t.key}`),F.setDataAttribute(s,"event-key",t.key),F.setDataAttribute(s,"event-order",t.order),t.start.dateTime.isSame(t.end.dateTime,"day")&&!t.start.dateTime.isSame(t.end.dateTime,"time")){const e=f("i");["fas","fa-circle","pe-1","event-circle"].forEach((t=>{F.addClass(e,t)})),F.addClass(s,"event-short"),F.style(e,{color:t.color&&t.color.background}),s.append(e)}else F.style(s,{background:t.color&&t.color.background,color:t.color&&t.color.foreground});s.append(t.summary),j.findOne(`.${Z}`,e).append(s),this.options.readonly||t.readonly?F.addClass(s,"event-readonly"):(s.setAttribute("draggable",!0),this._appendMonthListeners(s,t)),t.readonly&&this._appendReadonlyEventListener(s),this.options.blur&&n().isAfter(i,"day")&&F.addClass(s,"event-blur")}n(t.start.dateTime).isBefore(i)&&n(t.end.dateTime).isSameOrAfter(i)&&(s.innerHTML=" ",F.style(s,{order:t.key,background:t.color&&t.color.background,color:t.color&&t.color.foreground}),F.setDataAttribute(s,"event-key",t.key),F.setDataAttribute(s,"event-order",t.order),["event",`event-${t.key}`,"event-long"].forEach((t=>{F.addClass(s,t)})),j.findOne(`.${Z}`,e).append(s),this.options.readonly||t.readonly?F.addClass(s,"event-readonly"):(s.setAttribute("draggable",!0),this._appendMonthListeners(s,t)),t.readonly&&this._appendReadonlyEventListener(s),this.options.blur&&n().isAfter(i,"day")&&F.addClass(s,"event-blur")),n(t.end.date).isAfter(i)||F.addClass(s,"event-end"),this._initTooltip(s,t)}))}_appendDateTimeWeekEvent(t){t.start.dateTime.isSame(t.end.dateTime,"day")&&!t.start.dateTime.isSame(t.end.dateTime,"time")&&j.find("tr:not(.long-event-row) td",this._tBody).forEach((e=>{const a=n(e.dataset.dateTime,this.formats.dateTime);if(n(t.start.dateTime,this.formats.dateTime).minute(0).isSameOrBefore(a)&&!n(t.end.dateTime,this.formats.dateTime).isSameOrBefore(a)){const i=f("div");["event","event-short",`event-${t.key}`].forEach((t=>{F.addClass(i,t)})),i.innerHTML=`${t.summary}`,e.append(i),this.options.readonly||t.readonly?F.addClass(i,"event-readonly"):(i.setAttribute("draggable",!0),this._appendMonthListeners(i,t)),t.readonly&&this._appendReadonlyEventListener(i),this.options.blur&&n().isAfter(a,"day")&&F.addClass(i,"event-blur"),this._initTooltip(i,t)}}))}_appendEmptyList(){if(!j.find("td",this._tBody).length){const t=f("tr"),e=f("th");e.innerHTML=this.options.noEventsCaption,t.append(e),this._tBody.append(t)}}_appendListEvent(t){const e=this.activeMomentCopy.startOf("week"),a=this.activeMomentCopy.endOf("week");if(this.options.mondayFirst&&(e.add(1,"day"),a.add(1,"day")),n(t.start.dateTime).isBefore(a)&&(n(t.end.dateTime).isAfter(e)||n(t.end.dateTime).isSame(e))){const e=f("tr"),a=f("tr"),i=f("th"),s=f("td");i.innerHTML=R(t,this.formats);const o=t.color.background||"#cfe0fc";s.innerHTML=`${t.summary}`,e.append(i),a.append(s),this._tBody.append(e),this._tBody.append(a),t.description&&this._addListEventDescription(s,t.description),this.options.readonly||t.readonly?F.addClass(s,"td-readonly"):B.on(s,"mouseup",(e=>this._toggleEditEventModal(e,t))),t.readonly&&this._appendReadonlyEventListener(s),this.options.blur&&n().isAfter(t.end.dateTime,"day")&&F.addClass(s,"td-blur")}}_addListEventDescription(t,e){const n=f("p");F.addClass(n,"mb-0"),n.innerHTML=`${e}`,t.append(n)}_appendLongEventSection(){const t=f("tr");F.addClass(t,"long-event-row");const e=f("th");t.append(e);for(let a=0;a<7;a++){const e=f("td"),i=f("div");F.addClass(i,Z),e.append(i),t.append(e);const s=this.options.mondayFirst?this.activeMomentCopy.startOf("week").add(a+1,"day").format(this.formats.date):this.activeMomentCopy.startOf("week").add(a,"day").format(this.formats.date);e.dataset.date=s,n(s,this.formats.date).isSame(n(),"day")&&F.addClass(e,"today"),this.options.readonly||this._addDayFieldListeners(e,s)}this._tBody.append(t)}_appendHoursSection(){for(let t=0;t<23;t++){const e=f("tr"),n=f("th");F.addClass(n,"hour-field"),this.options.twelveHour?n.innerHTML=t>11?t-11+":00 pm":11===t?`${t+1}:00 pm`:`${t+1}:00 am`:n.innerHTML=`${t+1}:00`,e.append(n);for(let a=0;a<7;a++){const n=f("td"),i=this.options.mondayFirst?this.activeMomentCopy.startOf("week").add(a+1,"day").add(t+1,"hour").format(this.formats.dateTime):this.activeMomentCopy.startOf("week").add(a,"day").add(t+1,"hour").format(this.formats.dateTime);n.dataset.dateTime=i,e.append(n),this.options.readonly||this._addDayFieldListeners(n,i)}this._tBody.append(e)}}_setHeading(){switch(this._heading.innerHTML="",this.view){case"month":this._heading.innerHTML=`${this.options.months[this.activeMomentCopy.month()]} ${this.activeMomentCopy.year()}`;break;case"week":case"list":this._setWeekAndListHeading();break;default:return}}_setWeekAndListHeading(){const t=this.options.mondayFirst?this.activeMomentCopy.startOf("week").add(1,"day"):this.activeMomentCopy.startOf("week"),e=this.options.mondayFirst?this.activeMomentCopy.endOf("week").add(1,"day"):this.activeMomentCopy.endOf("week"),n=this.options.monthsShort[t.month()],a=this.options.monthsShort[e.month()];t.month()===e.month()?this._heading.innerHTML=`${this.options.months[t.month()]} ${t.year()}`:this._heading.innerHTML=`${n} - ${a}, ${t.year()}`}_clearTBody(){this._tBody.innerHTML="",this._table.className=""}_addListeners(){B.on(this._arrowLeft,"click",(()=>this.prev())),B.on(this._arrowRight,"click",(()=>this.next())),B.on(this._todayBtn,"click",(()=>this.today())),this.options.addEventButton&&!this.options.readonly&&B.on(this._newEventBtn,"click",(()=>this._toggleNewEventModal())),B.on(this._table,"mouseup",(()=>this._clearSelection())),this.options.viewSelect&&B.on(this._viewSelect,tt,(t=>this.changeView(t.value)))}_removeListeners(){B.off(this._arrowLeft,"click",this.prev),B.off(this._arrowRight,"click",this.next),B.off(this._todayBtn,"click",this.today),this.options.addEventButton&&!this.options.readonly&&B.off(this._newEventBtn,"click",this._toggleNewEventModal),this.options.viewSelect&&B.off(this._viewSelect,tt,this.changeView),B.off(this._table,"mouseup",this._clearSelection)}_getArrayFromNumber(t){return Array.from(Array(t).keys())}_getAllPrevEl(t){const e=[];let n=t.previousElementSibling;for(;n;)e.push(t),n=n.previousElementSibling;return e}_setLongEventCaptions(){"list"!==this.view&&j.find("tr",this._tBody).forEach((t=>{const e=j.findOne("td",t);j.find(".event",e).forEach((t=>{" "===t.innerHTML&&(t.innerHTML=this._events[parseInt(t.dataset.mdbEventKey,10)-1].summary,F.style(t,{paddingLeft:"7px"}))}))}))}_initTooltips(){this._tooltips=[...this._element.querySelectorAll('[data-mdb-toggle="tooltip"]')].map((t=>new mdb.Tooltip(t)))}_initSelect(){this._viewSelect&&this.options.viewSelect&&new mdb.Select(this._viewSelect)}_hideTooltip(t){this.options.tooltips&&mdb.Tooltip.getInstance(t.target).hide()}_refreshTable(){this._setTBody(),this._setHeading(),this._setEvents(),this._orderEvents(),this._setLongEventCaptions(),this._initTooltips()}_createAddEventModal(){this._addEventModal=f("div"),F.addClass(this._addEventModal,"modal"),F.addClass(this._addEventModal,"fade"),this._addEventModal.setAttribute("tabindex","-1"),this._addEventModal.setAttribute("aria-hidden","true"),document.body.appendChild(this._addEventModal)}_updateAddEventModalContent(){var t,e,a,i;this._addEventModal.innerHTML=(t=this.options,e=this._newEvent,a=this.formats,i=this._addModalId,`\n `);const s=j.findOne(K,this._addEventModal);B.on(s,"change",(t=>this._toggleLongEventMode(t))),this._editAddModalIfLongEvent(this._newEvent,s);const o=j.findOne("form",this._addEventModal);B.on(o,"submit",(t=>{this._addEvent(t)}))}_toggleLongEventMode(t){const e=t.target.checked,n=j.find(".long-event-section",this._addEventModal),a=j.find(".date-time-section",this._addEventModal);e?(n.forEach((t=>t.style.display="block")),a.forEach((t=>t.style.display="none"))):(n.forEach((t=>t.style.display="none")),a.forEach((t=>t.style.display="block"))),this._updateInputs()}_toggleLongEventModeInEditModal(t){const e=t.target.checked,a=j.find(".long-event-section",this._editEventModal),i=j.find(".date-time-section",this._editEventModal);e?(a.forEach((t=>t.style.display="block")),i.forEach((t=>{j.find(".timepicker-input",t).forEach((t=>{t.value="00:00",this._activeEvent.start.dateTime=n(this._activeEvent.start.dateTime).startOf("day"),this._activeEvent.end.dateTime=n(this._activeEvent.end.dateTime).startOf("day")})),t.style.display="none"}))):(a.forEach((t=>t.style.display="none")),i.forEach((t=>t.style.display="block"))),this._updateInputs()}_createEditEventModal(){this._editEventModal=f("div"),F.addClass(this._editEventModal,"modal"),F.addClass(this._editEventModal,"fade"),this._editEventModal.setAttribute("tabindex","-1"),this._editEventModal.setAttribute("aria-hidden","true"),document.body.appendChild(this._editEventModal)}_updateEditEventModalContent(){var t,e,a,i;this._editEventModal.innerHTML=(t=this.options,e=this._activeEvent,a=this.formats,i=this._editModalId,`\n \n `);const s=j.findOne(K,this._editEventModal);B.on(s,"change",(t=>this._toggleLongEventModeInEditModal(t))),this._editModalIfLongEvent(this._activeEvent,s);const o=j.findOne(".btn-save-event",this._editEventModal),d=j.findOne(".btn-delete-event",this._editEventModal);B.on(o,"click",(()=>{this._editEvent()})),B.on(d,"click",(()=>{this._deleteEvent()}))}_editAddModalIfLongEvent(t,e){if("short-event"===P(t)||"long-event-with-time"===P(t)){e.checked=!1;const t=j.find(".long-event-section",this._addEventModal),n=j.find(".date-time-section",this._addEventModal);t.forEach((t=>t.style.display="none")),n.forEach((t=>t.style.display="block"))}}_editModalIfLongEvent(t,e){if("short-event"===P(t)||"long-event-with-time"===P(t)){e.checked=!1;const t=j.find(".long-event-section",this._editEventModal),n=j.find(".date-time-section",this._editEventModal);t.forEach((t=>t.style.display="none")),n.forEach((t=>t.style.display="block"))}}_addEvent(t){if(t.preventDefault(),this._validateEvent(this._newEvent)){const t=this.options.newEventAttributes(this._newEvent);this._events.push({...t,summary:t.summary,start:t.start,end:t.end,color:t.color||{},description:t.description||""}),B.trigger(this._element,"addEvent.mdb.calendar",{event:this._parseEvent(t)}),this.refresh(),this._addEventModalInstance.hide()}else this._setInputsInvalid(this._newEvent)}_validateEvent(t){return!(!t.start.dateTime.isSameOrBefore(t.end.dateTime)||!t.summary)}_setInputsInvalid(t){t.end.dateTime.isBefore(t.start.dateTime)&&j.find(".calendar-date-input").forEach((t=>{F.addClass(t,"calendar-invalid-input"),F.addClass(t.parentNode.parentNode,"was-validated")})),""===t.summary&&j.find(".calendar-summary-input").forEach((t=>{F.addClass(t,"calendar-invalid-input"),F.addClass(t.parentNode.parentNode,"was-validated")}))}_clearValidation(){j.find(".calendar-date-input").forEach((t=>{F.removeClass(t,"calendar-invalid-input"),F.removeClass(t.parentNode.parentNode,"was-validated")})),j.find(".calendar-summary-input").forEach((t=>{F.removeClass(t,"calendar-invalid-input"),F.removeClass(t.parentNode.parentNode,"was-validated")}))}_editEvent(){this._validateEvent(this._activeEvent)?(this._events[this.activeEventIndex].summary=this._activeEvent.summary,this._events[this.activeEventIndex].start.date=this._activeEvent.start.date,this._events[this.activeEventIndex].start.dateTime=this._activeEvent.start.dateTime,this._events[this.activeEventIndex].end.date=this._activeEvent.end.date,this._events[this.activeEventIndex].end.dateTime=this._activeEvent.end.dateTime,this._events[this.activeEventIndex].description=this._activeEvent.description,this._events[this.activeEventIndex].color.background=this._activeEvent.color&&this._activeEvent.color.background,this._events[this.activeEventIndex].color.foreground=this._activeEvent.color.foreground,B.trigger(this._element,Q,{event:this._parseEvent(this._activeEvent)}),this.refresh(),this._editEventModalInstance.hide()):this._setInputsInvalid(this._activeEvent)}_deleteEvent(){B.trigger(this._element,"deleteEvent.mdb.calendar",{event:this._parseEvent(this._events[this.activeEventIndex])}),this._events.splice(this.activeEventIndex,1),this.refresh(),this._editEventModalInstance.hide()}_clearEvents(){j.find(".event",this._element).forEach((t=>{t.remove()}))}_triggerEvent(t){B.trigger(this._element,`${t}.mdb.calendar`)}_disposeModals(){this._addEventModalInstance&&this._addEventModalInstance.dispose(),this._addEventModal&&this._addEventModal.remove(),this._editEventModalInstance&&this._editEventModalInstance.dispose(),this._editEventModal&&this._editEventModal.remove()}static get NAME(){return W}static get dayjs(){return n}static getInstance(t){return u.getData(t,U)}static jQueryInterface(t,e){return this.each((function(){let n=u.getData(this,U);const a="object"==typeof t&&t;if((n||!/dispose/.test(t))&&(n||(n=new at(this,a)),"string"==typeof t)){if(void 0===n[t])throw new TypeError(`No method named "${t}"`);n[t](e)}}))}}var it;return it=()=>{const t=m();if(t){const e=t.fn[W];t.fn[W]=at.jQueryInterface,t.fn[W].Constructor=at,t.fn[W].noConflict=()=>(t.fn[W]=e,at.jQueryInterface)}},"loading"===document.readyState?document.addEventListener("DOMContentLoaded",it):it(),j.find("[data-mdb-calendar-init]").forEach((t=>new at(t))),at})); //# sourceMappingURL=calendar.min.js.map !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).Captcha=t()}(this,(function(){"use strict";const e=()=>{const{jQuery:e}=window;return e&&!document.body.hasAttribute("data-mdb-no-jquery")?e:null};document.documentElement.dir;const t=(()=>{const e={};let t=1;return{set(n,o,r){void 0===n[o]&&(n[o]={key:o,id:t},t++),e[n[o].id]=r},get(t,n){if(!t||void 0===t[n])return null;const o=t[n];return o.key===n?e[o.id]:null},delete(t,n){if(void 0===t[n])return;const o=t[n];o.key===n&&(delete e[o.id],delete t[n])}}})(),n={setData(e,n,o){t.set(e,n,o)},getData:(e,n)=>t.get(e,n),removeData(e,n){t.delete(e,n)}};function o(e){return"true"===e||"false"!==e&&(e===Number(e).toString()?Number(e):""===e||"null"===e?null:e)}function r(e){return e.replace(/[A-Z]/g,(e=>`-${e.toLowerCase()}`))}const i={setDataAttribute(e,t,n){e.setAttribute(`data-mdb-${r(t)}`,n)},removeDataAttribute(e,t){e.removeAttribute(`data-mdb-${r(t)}`)},getDataAttributes(e){if(!e)return{};const t={...e.dataset};return Object.keys(t).filter((e=>e.startsWith("mdb"))).forEach((e=>{let n=e.replace(/^mdb/,"");n=n.charAt(0).toLowerCase()+n.slice(1,n.length),t[n]=o(t[e])})),t},getDataAttribute:(e,t)=>o(e.getAttribute(`data-mdb-${r(t)}`)),offset(e){const t=e.getBoundingClientRect();return{top:t.top+document.body.scrollTop,left:t.left+document.body.scrollLeft}},position:e=>({top:e.offsetTop,left:e.offsetLeft}),style(e,t){Object.assign(e.style,t)},toggleClass(e,t){e&&(e.classList.contains(t)?e.classList.remove(t):e.classList.add(t))},addClass(e,t){e.classList.contains(t)||e.classList.add(t)},addStyle(e,t){Object.keys(t).forEach((n=>{e.style[n]=t[n]}))},removeClass(e,t){e.classList.contains(t)&&e.classList.remove(t)},hasClass:(e,t)=>e.classList.contains(t)},s=e(),a=/[^.]*(?=\..*)\.|.*/,c=/\..*/,l=/::\d+$/,u={};let d=1;const f={mouseenter:"mouseover",mouseleave:"mouseout"},p=["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 h(e,t){return t&&`${t}::${d++}`||e.uidEvent||d++}function g(e){const t=h(e);return e.uidEvent=t,u[t]=u[t]||{},u[t]}function m(e,t,n=null){const o=Object.keys(e);for(let r=0,i=o.length;r-1||(i=e),[o,r,i]}function y(e,t,n,o,r){if("string"!=typeof t||!e)return;n||(n=o,o=null);const[i,s,c]=b(t,n,o),l=g(e),u=l[c]||(l[c]={}),d=m(u,s,i?n:null);if(d)return void(d.oneOff=d.oneOff&&r);const f=h(s,t.replace(a,"")),p=i?function(e,t,n){return function o(r){const i=e.querySelectorAll(t);for(let{target:t}=r;t&&t!==this;t=t.parentNode)for(let s=i.length;s--;"")if(i[s]===t)return r.delegateTarget=t,o.oneOff&&E.off(e,r.type,n),n.apply(t,[r]);return null}}(e,n,o):function(e,t){return function n(o){return o.delegateTarget=e,n.oneOff&&E.off(e,o.type,t),t.apply(e,[o])}}(e,n);p.delegationSelector=i?n:null,p.originalHandler=s,p.oneOff=r,p.uidEvent=f,u[f]=p,e.addEventListener(c,p,i)}function v(e,t,n,o,r){const i=m(t[n],o,r);i&&(e.removeEventListener(n,i,Boolean(r)),delete t[n][i.uidEvent])}const E={on(e,t,n,o){y(e,t,n,o,!1)},one(e,t,n,o){y(e,t,n,o,!0)},off(e,t,n,o){if("string"!=typeof t||!e)return;const[r,i,s]=b(t,n,o),a=s!==t,c=g(e),u="."===t.charAt(0);if(void 0!==i){if(!c||!c[s])return;return void v(e,c,s,i,r?n:null)}u&&Object.keys(c).forEach((n=>{!function(e,t,n,o){const r=t[n]||{};Object.keys(r).forEach((i=>{if(i.indexOf(o)>-1){const o=r[i];v(e,t,n,o.originalHandler,o.delegationSelector)}}))}(e,c,n,t.slice(1))}));const d=c[s]||{};Object.keys(d).forEach((n=>{const o=n.replace(l,"");if(!a||t.indexOf(o)>-1){const t=d[n];v(e,c,s,t.originalHandler,t.delegationSelector)}}))},trigger(e,t,n){if("string"!=typeof t||!e)return null;const o=t.replace(c,""),r=t!==o,i=p.indexOf(o)>-1;let a,l=!0,u=!0,d=!1,f=null;return r&&s&&(a=s.Event(t,n),s(e).trigger(a),l=!a.isPropagationStopped(),u=!a.isImmediatePropagationStopped(),d=a.isDefaultPrevented()),i?(f=document.createEvent("HTMLEvents"),f.initEvent(o,l,!0)):f=new CustomEvent(t,{bubbles:l,cancelable:!0}),void 0!==n&&Object.keys(n).forEach((e=>{Object.defineProperty(f,e,{get:()=>n[e]})})),d&&f.preventDefault(),u&&e.dispatchEvent(f),f.defaultPrevented&&void 0!==a&&a.preventDefault(),f}},w={closest:(e,t)=>e.closest(t),matches:(e,t)=>e.matches(t),find:(e,t=document.documentElement)=>[].concat(...Element.prototype.querySelectorAll.call(t,e)),findOne:(e,t=document.documentElement)=>Element.prototype.querySelector.call(t,e),children:(e,t)=>[].concat(...e.children).filter((e=>e.matches(t))),parents(e,t){const n=[];let o=e.parentNode;for(;o&&o.nodeType===Node.ELEMENT_NODE&&3!==o.nodeType;)this.matches(o,t)&&n.push(o),o=o.parentNode;return n},prev(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return[n];n=n.previousElementSibling}return[]},next(e,t){let n=e.nextElementSibling;for(;n;){if(this.matches(n,t))return[n];n=n.nextElementSibling}return[]}},_="captcha",O="mdb.captcha",k=`.${O}`,S=`captchaExpire${k}`,x=`captchaError${k}`,L=`captchaSuccess${k}`,D={sitekey:"",theme:"light",size:"normal",tabindex:0,lang:"en"},C={sitekey:"string",theme:"string",size:"string",tabindex:"number",lang:"string"};class j{constructor(e,t={}){this._element=e,this._options=this._getConfig(t),this._element&&(n.setData(e,O,this),this._init())}_getConfig(e){const t={...D,...i.getDataAttributes(this._element),...e};return((e,t,n)=>{Object.keys(n).forEach((o=>{const r=n[o],i=t[o],s=i&&((a=i)[0]||a).nodeType?"element":(e=>null==e?`${e}`:{}.toString.call(e).match(/\s([a-z]+)/i)[1].toLowerCase())(i);var a;if(!new RegExp(r).test(s))throw new Error(`${e.toUpperCase()}: Option "${o}" provided type "${s}" but expected type "${r}".`)}))})(_,t,C),t}dispose(){n.removeData(this._element,O),this._element=null}reset(){null!==this._instance&&window.grecaptcha.reset(this._instance)}getResponse(){return null===this._instance?null:window.grecaptcha.getResponse(this._instance)}onExpire(){E.trigger(this._element,S)}onError(){E.trigger(this._element,x)}onSuccess(){E.trigger(this._element,L)}_init(){window.grecaptcha?window.grecaptcha.render?this._initRecaptcha():setTimeout((()=>{this._initRecaptcha()}),100):window.onloadCallback=()=>{this._initRecaptcha()}}_initRecaptcha(){this._instance=window.grecaptcha.render(this._element,{sitekey:this._options.sitekey,theme:this._options.theme,size:this._options.size,tabindex:this._options.tabindex,hl:this._options.lang,callback:()=>{this.onSuccess()},"expired-callback":()=>{this.onExpire()},"error-callback":()=>{this.onError()}})}static jQueryInterface(e,t){return this.each((function(){let o=n.getData(this,O);const r="object"==typeof e&&e;if((o||!/dispose/.test(e))&&(o||(o=new j(this,r)),"string"==typeof e)){if(void 0===o[e])throw new TypeError(`No method named "${e}"`);o[e](t)}}))}static get NAME(){return _}static getInstance(e){return n.getData(e,O)}}var $;return w.find("[data-mdb-captcha-init]").forEach((e=>{let t=j.getInstance(e);t||(t=new j(e))})),$=()=>{const t=e();if(t){const e=t.fn[_];t.fn[_]=j.jQueryInterface,t.fn[_].Constructor=j,t.fn[_].noConflict=()=>(t.fn[_]=e,j.jQueryInterface)}},"loading"===document.readyState?document.addEventListener("DOMContentLoaded",$):$(),j})); //# sourceMappingURL=captcha.min.js.map !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).ColorPicker=t()}(this,(function(){"use strict";const e=()=>{const{jQuery:e}=window;return e&&!document.body.hasAttribute("data-mdb-no-jquery")?e:null};document.documentElement.dir;const t=(()=>{const e={};let t=1;return{set(o,n,r){void 0===o[n]&&(o[n]={key:n,id:t},t++),e[o[n].id]=r},get(t,o){if(!t||void 0===t[o])return null;const n=t[o];return n.key===o?e[n.id]:null},delete(t,o){if(void 0===t[o])return;const n=t[o];n.key===o&&(delete e[n.id],delete t[o])}}})(),o={setData(e,o,n){t.set(e,o,n)},getData:(e,o)=>t.get(e,o),removeData(e,o){t.delete(e,o)}};function n(e){return"true"===e||"false"!==e&&(e===Number(e).toString()?Number(e):""===e||"null"===e?null:e)}function r(e){return e.replace(/[A-Z]/g,(e=>`-${e.toLowerCase()}`))}const s={setDataAttribute(e,t,o){e.setAttribute(`data-mdb-${r(t)}`,o)},removeDataAttribute(e,t){e.removeAttribute(`data-mdb-${r(t)}`)},getDataAttributes(e){if(!e)return{};const t={...e.dataset};return Object.keys(t).filter((e=>e.startsWith("mdb"))).forEach((e=>{let o=e.replace(/^mdb/,"");o=o.charAt(0).toLowerCase()+o.slice(1,o.length),t[o]=n(t[e])})),t},getDataAttribute:(e,t)=>n(e.getAttribute(`data-mdb-${r(t)}`)),offset(e){const t=e.getBoundingClientRect();return{top:t.top+document.body.scrollTop,left:t.left+document.body.scrollLeft}},position:e=>({top:e.offsetTop,left:e.offsetLeft}),style(e,t){Object.assign(e.style,t)},toggleClass(e,t){e&&(e.classList.contains(t)?e.classList.remove(t):e.classList.add(t))},addClass(e,t){e.classList.contains(t)||e.classList.add(t)},addStyle(e,t){Object.keys(t).forEach((o=>{e.style[o]=t[o]}))},removeClass(e,t){e.classList.contains(t)&&e.classList.remove(t)},hasClass:(e,t)=>e.classList.contains(t)};let i=Element.prototype.querySelectorAll,a=Element.prototype.querySelector;const l=(()=>{const e=new CustomEvent("Bootstrap",{cancelable:!0}),t=document.createElement("div");return t.addEventListener("Bootstrap",(()=>null)),e.preventDefault(),t.dispatchEvent(e),e.defaultPrevented})(),c=/:scope\b/;(()=>{const e=document.createElement("div");try{e.querySelectorAll(":scope *")}catch(t){return!1}return!0})()||(i=function(e){if(!c.test(e))return this.querySelectorAll(e);const t=Boolean(this.id);t||(this.id=(e=>{do{e+=Math.floor(1e6*Math.random())}while(document.getElementById(e));return e})("scope"));let o=null;try{e=e.replace(c,`#${this.id}`),o=this.querySelectorAll(e)}finally{t||this.removeAttribute("id")}return o},a=function(e){if(!c.test(e))return this.querySelector(e);const t=d.call(this,e);return void 0!==t[0]?t[0]:null});const d=i,h=a,u=e(),p=/[^.]*(?=\..*)\.|.*/,m=/\..*/,f=/::\d+$/,_={};let b=1;const g={mouseenter:"mouseover",mouseleave:"mouseout"},v=["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 k(e,t){return t&&`${t}::${b++}`||e.uidEvent||b++}function y(e){const t=k(e);return e.uidEvent=t,_[t]=_[t]||{},_[t]}function C(e,t,o=null){const n=Object.keys(e);for(let r=0,s=n.length;r-1||(s=e),[n,r,s]}function P(e,t,o,n,r){if("string"!=typeof t||!e)return;o||(o=n,n=null);const[s,i,a]=w(t,o,n),l=y(e),c=l[a]||(l[a]={}),d=C(c,i,s?o:null);if(d)return void(d.oneOff=d.oneOff&&r);const h=k(i,t.replace(p,"")),u=s?function(e,t,o){return function n(r){const s=e.querySelectorAll(t);for(let{target:t}=r;t&&t!==this;t=t.parentNode)for(let i=s.length;i--;"")if(s[i]===t)return n.oneOff&&$.off(e,r.type,o),o.apply(t,[r]);return null}}(e,o,n):function(e,t){return function o(n){return o.oneOff&&$.off(e,n.type,t),t.apply(e,[n])}}(e,o);u.delegationSelector=s?o:null,u.originalHandler=i,u.oneOff=r,u.uidEvent=h,c[h]=u,e.addEventListener(a,u,s)}function x(e,t,o,n,r){const s=C(t[o],n,r);s&&(e.removeEventListener(o,s,Boolean(r)),delete t[o][s.uidEvent])}const $={on(e,t,o,n){P(e,t,o,n,!1)},one(e,t,o,n){P(e,t,o,n,!0)},off(e,t,o,n){if("string"!=typeof t||!e)return;const[r,s,i]=w(t,o,n),a=i!==t,l=y(e),c="."===t.charAt(0);if(void 0!==s){if(!l||!l[i])return;return void x(e,l,i,s,r?o:null)}c&&Object.keys(l).forEach((o=>{!function(e,t,o,n){const r=t[o]||{};Object.keys(r).forEach((s=>{if(s.indexOf(n)>-1){const n=r[s];x(e,t,o,n.originalHandler,n.delegationSelector)}}))}(e,l,o,t.slice(1))}));const d=l[i]||{};Object.keys(d).forEach((o=>{const n=o.replace(f,"");if(!a||t.indexOf(n)>-1){const t=d[o];x(e,l,i,t.originalHandler,t.delegationSelector)}}))},trigger(e,t,o){if("string"!=typeof t||!e)return null;const n=t.replace(m,""),r=t!==n,s=v.indexOf(n)>-1;let i,a=!0,c=!0,d=!1,h=null;return r&&u&&(i=u.Event(t,o),u(e).trigger(i),a=!i.isPropagationStopped(),c=!i.isImmediatePropagationStopped(),d=i.isDefaultPrevented()),s?(h=document.createEvent("HTMLEvents"),h.initEvent(n,a,!0)):h=new CustomEvent(t,{bubbles:a,cancelable:!0}),void 0!==o&&Object.keys(o).forEach((e=>{Object.defineProperty(h,e,{get:()=>o[e]})})),d&&(h.preventDefault(),l||Object.defineProperty(h,"defaultPrevented",{get:()=>!0})),c&&e.dispatchEvent(h),h.defaultPrevented&&void 0!==i&&i.preventDefault(),h}},E={closest:(e,t)=>e.closest(t),matches:(e,t)=>e.matches(t),find:(e,t=document.documentElement)=>[].concat(...d.call(t,e)),findOne:(e,t=document.documentElement)=>h.call(t,e),children:(e,t)=>[].concat(...e.children).filter((e=>e.matches(t))),parents(e,t){const o=[];let n=e.parentNode;for(;n&&n.nodeType===Node.ELEMENT_NODE&&3!==n.nodeType;)this.matches(n,t)&&o.push(n),n=n.parentNode;return o},prev(e,t){let o=e.previousElementSibling;for(;o;){if(o.matches(t))return[o];o=o.previousElementSibling}return[]},next(e,t){let o=e.nextElementSibling;for(;o;){if(this.matches(o,t))return[o];o=o.nextElementSibling}return[]}},O=()=>'\n
\n
\n \n
\n ',D=()=>'\n
\n
\n
\n
\n
\n
\n
\n \n
\n
\n
\n \n
\n
\n
\n
\n ',F=()=>'
',A=e=>`\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n `,M=()=>'\n
\n \n \n
\n ',S=()=>'\n
\n \n \n
\n ',L=()=>'\n \n ',R=e=>{const t=e.length,o=document.createElement("div"),n=document.createElement("div");o.classList.add("color-picker-swatches","p-2"),n.classList.add("row");for(let r=0;r{const o=document.createElement("div");o.setAttribute("tabindex",1),o.classList.add("mb-1","color-picker-swatches-color"),o.style.backgroundColor=e,t.append(o)})),n.append(t)}return o.append(n),o},I=e=>{const t=document.createElement("div");t.classList.add("dropdown"),e.parentNode.insertBefore(t,e),e.classList.add("dropdown-menu"),t.appendChild(e),t.insertAdjacentHTML("afterbegin",'