/*
* # Fomantic UI - 2.9.2
* https://github.com/fomantic/Fomantic-UI
* https://fomantic-ui.com/
*
* Copyright 2023 Contributors
* Released under the MIT license
* https://opensource.org/licenses/MIT
*
*/
!function(oe,T,Y){"use strict";T=void 0!==T&&T.Math===Math?T:globalThis,oe.fn.calendar=function(m){var g,e=oe(this),y=oe(Y),D=e.selector||"",v=Date.now(),b=[],M=m,C="string"==typeof M,w=[].slice.call(arguments,1),x={5:{row:4,column:3},10:{row:3,column:2},15:{row:2,column:2},20:{row:3,column:1},30:{row:2,column:1}},re=["","one","two","three","four","five","six","seven","eight"];return e.each(function(){var p,e,z=oe.isPlainObject(m)?oe.extend(!0,{},oe.fn.calendar.settings,m):oe.extend({},oe.fn.calendar.settings),_=z.className,a=z.namespace,n=z.selector,Q=z.formatter,Z=z.parser,X=z.metadata,ee=x[z.minTimeGap],l=z.error,t="."+a,r="module-"+a,o=oe(this),i=o.find(n.input),s=o.find(n.activator),d=this,u=o.data(r),te=u&&u.popupId?y.find("#"+u.popupId):o.find(n.popup),c=!1,ae=o.hasClass(_.inverted),f=!1,h=!1,ne={initialize:function(){ne.debug("Initializing calendar for",d,o),p=ne.get.isTouch(),ne.setup.config(),ne.setup.popup(),ne.setup.inline(),ne.setup.input(),ne.setup.date(),ne.create.calendar(),ne.bind.events(),ne.observeChanges(),ne.instantiate()},instantiate:function(){ne.verbose("Storing instance of calendar"),u=ne,o.data(r,u)},destroy:function(){ne.verbose("Destroying previous calendar for",d),o.removeData(r),ne.unbind.events(),ne.disconnect.classObserver()},setup:{config:function(){null!==ne.get.minDate()&&ne.set.minDate(o.data(X.minDate)),null!==ne.get.maxDate()&&ne.set.maxDate(o.data(X.maxDate)),ne.setting("type",ne.get.type()),ne.setting("on",z.on||"click")},popup:function(){var e,t;z.inline||0===s.length&&0===(s=o.children().first()).length||(void 0===oe.fn.popup?ne.error(l.popup):((te=0===te.length?z.context?(ne.popupId=a+"_popup_"+(Math.random().toString(16)+"000000000").slice(2,10),oe("
",{id:ne.popupId}).addClass(_.popup).appendTo(y.find(z.context))):(e=0<(t=s.parent()).closest(n.append).length?"appendTo":"prependTo",oe("").addClass(_.popup)[e](t)):te).addClass(_.calendar),ae&&te.addClass(_.inverted),e=function(){return ne.refreshTooltips(),z.onVisible.apply(te,arguments)},0===i.length&&(te.attr("tabindex","0"),e=function(){return ne.refreshTooltips(),ne.focus(),z.onVisible.apply(te,arguments)}),t=ne.setting("on"),t=oe.extend({},z.popupOptions,{popup:te,movePopup:!z.context,on:t,hoverable:"hover"===t,closable:"click"===t,onShow:function(){return ne.set.focusDate(ne.get.date()),ne.set.mode(ne.get.validatedMode(z.startMode)),z.onShow.apply(te,arguments)},onVisible:e,onHide:z.onHide,onHidden:function(){return ne.blur(),z.onHidden.apply(te,arguments)}}),ne.popup(t)))},inline:function(){0").addClass(_.calendar).appendTo(o),0===i.length&&te.attr("tabindex","0"))},input:function(){z.touchReadonly&&0").addClass(_.grid).appendTo(D)),t=0;t").addClass(_.column).appendTo(j));var D,v=G+t,B=(new Date(h,v,1).getDay()-z.firstDayOfWeek%7+7)%7,b=(!z.constantHeight&&l&&(b=new Date(h,v+1,0).getDate()+B,P=Math.ceil(b/7)),i?10:s?1:0),M=l?1:0,C=d||u?1:0,w=d||u?f:1,x=new Date(h-b,v-M,w-C,c),M=new Date(h+b,v+M,w+C,c),w=i?new Date(10*Math.ceil(h/10)-9,0,0):s?new Date(h,0,0):l?new Date(h,v,0):new Date(h,v,f,-1),C=i?new Date(10*Math.ceil(h/10)+1,0,1):s?new Date(h+1,0,1):l?new Date(h,v+1,1):new Date(h,v,f+1),T=a,T=(l&&z.showWeekNumbers&&(T+=" andweek"),oe("").addClass(_.table).addClass(T).addClass(re[m]+" column").appendTo(D)),K=(ae&&T.addClass(_.inverted),m);if(!W){var U=oe("").appendTo(T),Y=oe("
").appendTo(U),O=oe(" | ").attr("colspan",""+m).appendTo(Y),k=i||s?new Date(h,0,1):l?new Date(h,v,1):new Date(h,v,f,c,p),A=oe("").addClass(_.link).appendTo(O),k=(A.text(ne.helper.dateFormat(Q[a+"Header"],k)),s?z.disableYear?"day":"year":l?z.disableMonth?"year":"month":"day");if(A.data(X.mode,k),0===t&&((A=oe("").addClass(_.prev).appendTo(O)).data(X.focusDate,x),A.toggleClass(_.disabledCell,!ne.helper.isDateInRange(w,a)),oe("").addClass(_.prevIcon).appendTo(A)),t===g-1&&((k=oe("").addClass(_.next).appendTo(O)).data(X.focusDate,M),k.toggleClass(_.disabledCell,!ne.helper.isDateInRange(C,a)),oe("").addClass(_.nextIcon).appendTo(k)),l)for(Y=oe("
").appendTo(U),z.showWeekNumbers&&((O=oe(" | ").appendTo(Y)).text(z.text.weekNo),O.addClass(_.weekCell),K--),N=0;N").appendTo(Y)).text(Q.dayColumnHeader((N+z.firstDayOfWeek)%7,z))}for(var J=oe("").appendTo(T),N=i?10*Math.ceil(h/10)-9:l?1-B:0,L=0;L").appendTo(J),l&&z.showWeekNumbers&&((O=oe(" | ").appendTo(Y)).text(ne.get.weekOfYear(h,v,N+1-z.firstDayOfWeek)),O.addClass(_.weekCell)),e=0;e").addClass(_.cell).appendTo(Y)).text(E),O.data(X.date,H),l&&H.getMonth()!==(v+12)%12),I=!z.selectAdjacentDays&&E||!ne.helper.isDateInRange(H,a)||z.isDisabled(H,a)||ne.helper.isDisabled(H,a)||!ne.helper.isEnabled(H,a),S=(I?(null!==(S=ne.helper.findDayAsObject(H,a,z.disabledDates))&&S[X.message]&&(O.attr("data-tooltip",S[X.message]),O.attr("data-position",S[X.position]||y),(S[X.inverted]||ae&&void 0===S[X.inverted])&&O.attr("data-inverted",""),S[X.variation])&&O.attr("data-variation",S[X.variation]),"hour"===a&&null!==(S=ne.helper.findHourAsObject(H,a,z.disabledHours))&&S[X.message]&&(O.attr("data-tooltip",S[X.message]),O.attr("data-position",S[X.position]||y),(S[X.inverted]||ae&&void 0===S[X.inverted])&&O.attr("data-inverted",""),S[X.variation])&&O.attr("data-variation",S[X.variation])):null!==(F=ne.helper.findDayAsObject(H,a,z.eventDates))&&(O.addClass(F[X.class]||z.eventClass),F[X.message])&&(O.attr("data-tooltip",F[X.message]),O.attr("data-position",F[X.position]||y),(F[X.inverted]||ae&&void 0===F[X.inverted])&&O.attr("data-inverted",""),F[X.variation])&&O.attr("data-variation",F[X.variation]),ne.helper.dateEqual(H,q,a)),$=ne.helper.dateEqual(H,n,a),E=(O.toggleClass(_.adjacentCell,E&&!F),O.toggleClass(_.disabledCell,I),O.toggleClass(_.activeCell,S&&!(E&&I)),d||u||O.toggleClass(_.todayCell,!E&&$),{mode:a,adjacent:E,disabled:I,active:S,today:$});Q.cell(O,H,E),ne.helper.dateEqual(H,r,a)&&ne.set.focusDate(H,!1,!1)}z.today&&(x=oe("
").appendTo(J),(w=oe(" | ").attr("colspan",""+m).addClass(_.today).appendTo(x)).text(Q.today(z)),w.data(X.date,n)),ne.update.focus(!1,T),z.inline&&ne.refreshTooltips()}}},update:{focus:function(e,t){t=t||te;var i=ne.get.mode(),a=ne.get.date(),s=ne.get.focusDate(),l=ne.get.startDate(),d=ne.get.endDate(),u=(e?s:null)||a||(p?null:s);t.find("td").each(function(){var e,t,a,n,r=oe(this),o=r.data(X.date);o&&(e=r.hasClass(_.disabledCell),t=r.hasClass(_.activeCell),a=r.hasClass(_.adjacentCell),n=ne.helper.dateEqual(o,s,i),o=!!u&&(!!l&&ne.helper.isDateInRange(o,i,l,u)||!!d&&ne.helper.isDateInRange(o,i,u,d)),r.toggleClass(_.focusCell,n&&(!p||c)&&(!a||z.selectAdjacentDays&&a)&&!e),ne.helper.isTodayButton(r)||r.toggleClass(_.rangeCell,o&&!t&&!e))})}},refresh:function(){ne.create.calendar()},refreshTooltips:function(){var n=oe(T).width();te.find("td[data-position]").each(function(){var e=oe(this),t=T.getComputedStyle(e[0],"::after").width.replace(/[^\d.]/g,""),a=e.attr("data-position"),t=n-e.width()-(parseInt(t,10)||250)>e.offset().left?"right":"left";-1===a.indexOf(t)&&e.attr("data-position",a.replace(/(left|right)/,t))})},bind:{events:function(){ne.debug("Binding events"),te.on("mousedown"+t,ne.event.mousedown),te.on("touchstart"+t,ne.event.mousedown),te.on("mouseup"+t,ne.event.mouseup),te.on("touchend"+t,ne.event.mouseup),te.on("mouseover"+t,ne.event.mouseover),(0=e?ne.verbose("Unable to set maxDate variable lower that minDate variable",e,z.minDate):(ne.setting("maxDate",e),ne.set.dataKeyValue(X.maxDate,e))},monthOffset:function(e,t){var a=Math.max(z.multiMonth,1);e=Math.max(1-a,Math.min(0,e)),ne.set.dataKeyValue(X.monthOffset,e,t)},mode:function(e,t){ne.set.dataKeyValue(X.mode,e,t)},dataKeyValue:function(e,t,a){var n=o.data(e),n=n===t||n<=t&&t<=n;return t?o.data(e,t):o.removeData(e),(a=!1!==a&&!n)&&ne.refresh(),!n}},selectDate:function(e,t){ne.verbose("New date selection",e);var a=ne.get.mode();t||"minute"===a||z.disableMinute&&"hour"===a||"date"===z.type&&"day"===a||"month"===z.type&&"month"===a||"year"===z.type&&"year"===a?!1!==ne.set.date(e)&&(h=!0,z.closable)&&(ne.popup("hide"),t=ne.get.calendarModule(z.endCalendar))&&(t.refresh(),"focus"!==t.setting("on")&&t.popup("show"),t.focus()):(t="year"===a?z.disableMonth?"day":"month":"month"===a?"day":"day"===a?"hour":"minute",ne.set.mode(t),"hour"===a||"day"===a&&ne.get.date()?ne.set.date(e,!0,!1):ne.set.focusDate(e))},changeDate:function(e){ne.set.date(e)},clear:function(){ne.set.date()},popup:function(){return s.popup.apply(s,arguments)},focus:function(){(0=t.centuryBreak&&a===y.length-1){n<=99&&(n+=t.currentCentury-100),h=n,y.splice(a,1);break}if(f<0)for(a=0;a