!function(t){"function"==typeof define&&define.amd?define(["jquery","moment"],t):t(jQuery,moment)}(function(N,F){function t(t){V(rt,t)}function V(n){function t(t,e){N.isPlainObject(e)&&N.isPlainObject(n[t])&&!i(t)?n[t]=V({},n[t],e):void 0!==e&&(n[t]=e)}for(var e=1;e<arguments.length;e++)N.each(arguments[e],t);return n}function i(t){return/(Time|Duration)$/.test(t)}function L(t){var e=F.localeData||F.langData;return e.call(F,t)||e.call(F,"en")}function r(t,e){e.left&&t.css({"border-left-width":1,"margin-left":e.left-1}),e.right&&t.css({"border-right-width":1,"margin-right":e.right-1})}function s(t){t.css({"margin-left":"","margin-right":"","border-left-width":"","border-right-width":""})}function f(){N("body").addClass("fc-not-allowed")}function g(){N("body").removeClass("fc-not-allowed")}function n(r,t,e){var s=Math.floor(t/r.length),o=Math.floor(t-s*(r.length-1)),l=[],a=[],d=[],u=0;c(r),r.each(function(t,e){var n=t===r.length-1?o:s,i=N(e).outerHeight(!0);i<n?(l.push(e),a.push(i),d.push(N(e).height())):u+=i}),e&&(t-=u,s=Math.floor(t/l.length),o=Math.floor(t-s*(l.length-1))),N(l).each(function(t,e){var n=t===l.length-1?o:s,i=a[t],r=n-(i-d[t]);i<n&&N(e).height(r)})}function c(t){t.height("")}function e(t){var i=0;return t.find("> *").each(function(t,e){var n=N(e).outerWidth();i<n&&(i=n)}),i++,t.width(i),i}function o(t,e){return t.height(e).addClass("fc-scroller"),t[0].scrollHeight-1>t[0].clientHeight||(l(t),!1)}function l(t){t.height("").removeClass("fc-scroller")}function h(t){var e=t.css("position"),n=t.parents().filter(function(){var t=N(this);return/(auto|scroll)/.test(t.css("overflow")+t.css("overflow-y")+t.css("overflow-x"))}).eq(0);return"fixed"!==e&&n.length?n:N(t[0].ownerDocument||document)}function a(t){var e=t.offset().left,n=e+t.width(),i=t.children(),r=i.offset().left;return{left:r-e,right:n-(r+i.outerWidth())}}function d(t){return 1==t.which&&!t.ctrlKey}function u(t,e){var n,i,r,s,o=t.start,l=t.end,a=e.start,d=e.end;if(a<l&&o<d)return a<=o?(n=o.clone(),r=!0):(n=a.clone(),r=!1),l<=d?(i=l.clone(),s=!0):(i=d.clone(),s=!1),{start:n,end:i,isStart:r,isEnd:s}}function _(t,e){if(void 0!==(t=t||{})[e])return t[e];for(var n,i=e.split(/(?=[A-Z])/),r=i.length-1;0<=r;r--)if(void 0!==(n=t[i[r].toLowerCase()]))return n;return t.default}function z(t,e){return F.duration({days:t.clone().stripTime().diff(e.clone().stripTime(),"days"),ms:t.time()-e.time()})}function P(t,e){var n,i;for(n=0;n<pt.length&&!A(i=pt[n],t,e);n++);return i}function A(t,e,n){var i;return 1<=(i=null!=n?n.diff(e,t,!0):F.isDuration(e)?e.as(t):e.end.diff(e.start,t,!0))&&i%1==0&&i}function Y(t){return/^\d+\:\d+(?:\:\d+\.?(?:\d{3})?)?$/.test(t)}function O(t){var e=function(){};return e.prototype=t,new e}function p(t,e){for(var n in t)m(t,n)&&(e[n]=t[n])}function m(t,e){return mt.call(t,e)}function B(t,e,n){if(N.isFunction(t)&&(t=[t]),t){var i,r;for(i=0;i<t.length;i++)r=t[i].apply(e,n)||r;return r}}function W(){for(var t=0;t<arguments.length;t++)if(void 0!==arguments[t])return arguments[t]}function I(t){return(t+"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/'/g,"&#039;").replace(/"/g,"&quot;").replace(/\n/g,"<br />")}function v(t){return t.replace(/&.*?;/g,"")}function Z(t){return t.charAt(0).toUpperCase()+t.slice(1)}function y(t,e){return t-e}function j(e,n){var i,r,s,o,l=function(){var t=+new Date-o;t<n&&0<t?i=setTimeout(l,n-t):(i=null,e.apply(s,r),i||(s=r=null))};return function(){s=this,r=arguments,o=+new Date,i||(i=setTimeout(l,n))}}function w(t,e,n){var i,r,s,o,l,a=t[0],d=1==t.length&&"string"==typeof a;return F.isMoment(a)?E(a,o=F.apply(null,t)):(l=a,"[object Date]"===Object.prototype.toString.call(l)||l instanceof Date||void 0===a?o=F.apply(null,t):(r=i=!1,d?vt.test(a)?(t=[a+="-01"],r=i=!0):(s=yt.exec(a))&&(i=!s[5],r=!0):N.isArray(a)&&(r=!0),o=e||i?F.utc.apply(F,t):F.apply(null,t),i?(o._ambigTime=!0,o._ambigZone=!0):n&&(r?o._ambigZone=!0:d&&o.zone(a)))),o._fullCalendar=!0,o}function b(t,e){var n,i,r=!1,s=!1,o=t.length,l=[];for(n=0;n<o;n++)i=t[n],F.isMoment(i)||(i=ot.moment.parseZone(i)),r=r||i._ambigTime,s=s||i._ambigZone,l.push(i);for(n=0;n<o;n++)i=l[n],e||!r||i._ambigTime?s&&!i._ambigZone&&(l[n]=i.clone().stripZone()):l[n]=i.clone().stripTime();return l}function E(t,e){t._ambigTime?e._ambigTime=!0:e._ambigTime&&(e._ambigTime=!1),t._ambigZone?e._ambigZone=!0:e._ambigZone&&(e._ambigZone=!1)}function S(t,e){t.year(e[0]||0).month(e[1]||0).date(e[2]||0).hours(e[3]||0).minutes(e[4]||0).seconds(e[5]||0).milliseconds(e[6]||0)}function C(t,e){return bt.format.call(t,e)}function D(t,e){var n,i="";for(n=0;n<e.length;n++)i+=T(t,e[n]);return i}function T(t,e){var n,i;return"string"==typeof e?e:(n=e.token)?Et[n]?Et[n](t):C(t,n):e.maybe&&(i=D(t,e.maybe)).match(/[1-9]/)?i:""}function x(t,e,n,i,r){return i=i||" - ",function(t,e,n,i,r){var s,o,l,a,d="",u="",c="",h="",f="";for(o=0;o<n.length&&!1!==(s=H(t,e,n[o]));o++)d+=s;for(l=n.length-1;o<l&&!1!==(s=H(t,e,n[l]));l--)u=s+u;for(a=o;a<=l;a++)c+=T(t,n[a]),h+=T(e,n[a]);(c||h)&&(f=r?h+i+c:c+i+h);return d+f+u}(t=ot.moment.parseZone(t),e=ot.moment.parseZone(e),R(n=(t.localeData||t.lang).call(t).longDateFormat(n)||n),i,r)}function H(t,e,n){var i,r;return"string"==typeof n?n:!!((i=n.token)&&(r=St[i.charAt(0)])&&t.isSame(e,r))&&C(t,i)}function R(t){return t in Ct?Ct[t]:Ct[t]=function t(e){var n=[];var i=/\[([^\]]*)\]|\(([^\)]*)\)|(LT|(\w)\4*o?)|([^\w\[\(]+)/g;var r;for(;r=i.exec(e);)r[1]?n.push(r[1]):r[2]?n.push({maybe:t(r[2])}):r[3]?n.push({token:r[3]}):r[5]&&n.push(r[5]);return n}(t)}function k(){}function M(t,e){return!t&&!e||!(!t||!e)&&(t.grid===e.grid&&t.row===e.row&&t.col===e.col)}function G(t){return W((t.source||{}).rendering,t.rendering)}function X(t,e){return t.eventStartMS-e.eventStartMS}function U(t,e){return t.eventStartMS-e.eventStartMS||e.eventDurationMS-t.eventDurationMS||e.event.allDay-t.event.allDay||(t.event.title||"").localeCompare(e.event.title)}function $(t,e){var n,i;for(n=0;n<e.length;n++)if((i=e[n]).leftCol<=t.rightCol&&i.rightCol>=t.leftCol)return!0;return!1}function q(t,e){return t.leftCol-e.leftCol}function K(t){var e,n,i;if(t.sort(U),function(t){var e,n,i,r,s;for(e=0;e<t.length;e++)for(n=t[e],i=0;i<n.length;i++)for((r=n[i]).forwardSegs=[],s=e+1;s<t.length;s++)tt(r,t[s],r.forwardSegs)}(e=function(t){var e,n,i,r=[];for(e=0;e<t.length;e++){for(n=t[e],i=0;i<r.length&&tt(n,r[i]).length;i++);n.level=i,(r[i]||(r[i]=[])).push(n)}return r}(t)),n=e[0]){for(i=0;i<n.length;i++)Q(n[i]);for(i=0;i<n.length;i++)J(n[i],0,0)}}function Q(t){var e,n,i=t.forwardSegs,r=0;if(void 0===t.forwardPressure){for(e=0;e<i.length;e++)Q(n=i[e]),r=Math.max(r,1+n.forwardPressure);t.forwardPressure=r}}function J(t,e,n){var i,r=t.forwardSegs;if(void 0===t.forwardCoord)for(r.length?(r.sort(et),J(r[0],e+1,n),t.forwardCoord=r[0].backwardCoord):t.forwardCoord=1,t.backwardCoord=t.forwardCoord-(t.forwardCoord-n)/(e+1),i=0;i<r.length;i++)J(r[i],0,t.forwardCoord)}function tt(t,e,n){n=n||[];for(var i=0;i<e.length;i++)r=t,s=e[i],r.bottom>s.top&&r.top<s.bottom&&n.push(e[i]);var r,s;return n}function et(t,e){return e.forwardPressure-t.forwardPressure||(t.backwardCoord||0)-(e.backwardCoord||0)||U(t,e)}function nt(e,t){function i(){return e.is(":visible")}function r(t){var e,n;M++,S&&t&&S.type!==t&&(w.deactivateButton(S.type),h(),S.start&&S.destroyView(),S.el.remove(),S=null),!S&&t&&(n=s(e=t),(S=new n.class(p,n.options,e)).el=N("<div class='fc-view fc-"+t+"-view' />").appendTo(E),w.activateButton(t)),S&&(T=S.massageCurrentDate(T),S.start&&T.isWithin(S.intervalStart,S.intervalEnd)||i()&&(h(),S.start&&S.destroyView(),S.setDate(T),S.renderView(),f(),S.updateTitle(),w.updateTitle(S.title),p.getNow().isWithin(S.intervalStart,S.intervalEnd)?w.disableButton("today"):w.enableButton("today"),!m.lazyFetching||x(S.start,S.end)?c():u())),f(),M--}function s(t){function e(t){"function"==typeof t?i=t:"object"==typeof t&&N.extend(n,t)}var n,i,r,s,o,l,a=m.defaultButtonText||{},d=m.buttonText||{},u=m.views||{},c=t,h=[],f=!1;if(k[t])return k[t];for(;c&&!i;)n={},e(lt[c]),e(u[c]),h.unshift(n),c=n.type;return h.unshift({}),n=N.extend.apply(N,h),i?((r=n.duration||i.duration)&&(f=1===A(s=P(r=F.duration(r)),r)),f&&u[s]&&(n=N.extend({},u[s],n)),o=d[t]||(f?d[s]:null)||a[t]||(f?a[s]:null)||n.buttonText||i.buttonText||(r?((l=r).locale||l.lang).call(l,m.lang).humanize():null)||t,k[t]={class:i,options:n,buttonText:o}):void 0}function o(t){return Boolean(s(t))}function n(t){if(i())return t&&a(),M++,S.updateSize(!0),M--,!0}function l(){i()&&a()}function a(){C="number"==typeof m.contentHeight?m.contentHeight:"number"==typeof m.height?m.height-(b?b.outerHeight(!0):0):Math.round(E.width()/Math.max(m.aspectRatio,.5))}function d(t){!M&&t.target===window&&S.start&&n(!0)&&S.trigger("windowResize",R)}function u(){i()&&(h(),S.destroyViewEvents(),S.renderViewEvents(G),f())}function c(){H(S.start,S.end)}function h(){E.css({width:"100%",height:E.height(),overflow:"hidden"})}function f(){E.css({width:"",height:"",overflow:""})}var g,p=this,m=V({},rt,t=t||{});(g=m.lang in at?at[m.lang]:at[rt.lang])&&(m=V({},rt,g,t)),m.isRTL&&(m=V({},rt,st,g||{},t)),p.options=m,p.render=function(t){E?i()&&(l(),r(t)):(m.theme?"ui":"fc",e.addClass("fc"),m.isRTL?e.addClass("fc-rtl"):e.addClass("fc-ltr"),m.theme?e.addClass("ui-widget"):e.addClass("fc-unthemed"),E=N("<div class='fc-view-container'/>").prependTo(e),w=new function(m,v){function e(t){var n=N('<div class="ui_'+t+" fc-"+t+'"/>'),e=v.header[t];return e&&N.each(e.split(" "),function(t){var e,g=N(),p=!0;N.each(this.split(","),function(t,e){var n,i,r,s,o,l,a,d,u,c,h,f="button";"title"==e?(g=g.add(N("<h2>&nbsp;</h2>")),p=!1):((c=(v.customButtons||{})[e])?(n=function(t){c.click&&c.click.call(u[0],t)},o=c.text,h=c.html,f=c.type,c.container&&c.container):m[e]?n=function(){m[e]()}:m.isValidViewType(e)&&(n=function(){m.changeView(e)},w.push(e),o=m.getViewButtonText(e)),n&&(i=_(v.themeButtonIcons,e),r=_(v.buttonIcons,e),s=_(v.defaultButtonText,e),l=_(v.buttonText,e),customHtml=_(v.buttonHtml,e),a=o||l||customHtml||h?customHtml||h||I(o||l):i&&v.theme?"<span class='ui-icon ui-icon-"+i+"'></span>":r&&!v.theme?"<span class='fc-icon fc-icon-"+r+"'></span>":I(s||e),d=["ui_button","fc-"+e+"-button",y+"-button",y+"-state-default"],(u=N("button"===f?'<button type="button" aria-label="'+(o||l)+'" title="'+(o||l)+'" class="'+d.join(" ")+'">'+a+"</button>":a)).click(function(){u.hasClass(y+"-state-disabled")||(n(),(u.hasClass(y+"-state-active")||u.hasClass(y+"-state-disabled"))&&u.removeClass(y+"-state-hover"))}).mousedown(function(){u.not("."+y+"-state-active").not("."+y+"-state-disabled").addClass(y+"-state-down")}).mouseup(function(){u.removeClass(y+"-state-down")}).hover(function(){u.not("."+y+"-state-active").not("."+y+"-state-disabled").addClass(y+"-state-hover")},function(){u.removeClass(y+"-state-hover").removeClass(y+"-state-down")}),g=g.add(u)))}),p&&g.first().addClass(y+"-corner-left").end().last().addClass(y+"-corner-right").end(),1<g.length?(e=N("<div/>"),p&&e.addClass("ui_group fc-button-group"),e.append(g),n.append(e)):n.append(g)}),n}var t=this;t.render=function(){var t=v.header;if(y=v.theme?"ui":"fc",t){if(!v.toolbarLocation)return n=N("<div class='fc-toolbar'/>").append(e("left")).append(e("right")).append(e("center")).append('<div class="fc-clear"/>');N(v.toolbarLocation).addClass("fc-toolbar").append(e("left")).append(e("right")).append(e("center")).append('<div class="fc-clear"/>')}},t.destroy=function(){n.remove()},t.updateTitle=function(t){v.toolbarLocation?N(v.toolbarLocation).find("h2").text(t):N(".fc-toolbar").find("h2").text(t)},t.activateButton=function(t){n.find(".fc-"+t+"-button").addClass(y+"-state-active").addClass("ui_button--selected")},t.deactivateButton=function(t){n.find(".fc-"+t+"-button").removeClass(y+"-state-active").removeClass("ui_button--selected")},t.disableButton=function(t){n.find(".fc-"+t+"-button").attr("disabled","disabled").addClass(y+"-state-disabled").addClass("ui_button--disabled")},t.enableButton=function(t){n.find(".fc-"+t+"-button").removeAttr("disabled").removeClass(y+"-state-disabled").removeClass("ui_button--disabled")},t.getViewsWithButtons=function(){return w};var y,n=N(),w=[]}(p,m),(b=w.render())&&e.prepend(b),r(m.defaultView),m.handleWindowResize&&(D=j(d,m.windowResizeDelay),N(window).resize(D)))},p.destroy=function(){S&&S.destroyView(),w.destroy(),E.remove(),e.removeClass("fc fc-ltr fc-rtl fc-unthemed ui-widget"),N(window).unbind("resize",D)},p.refetchEvents=function(){h(),S.destroyViewEvents(),f(),c()},p.reportEvents=function(t){G=t,u()},p.reportEventChange=function(){u()},p.rerenderEvents=u,p.changeView=r,p.select=function(t,e){t=p.moment(t),e=e?p.moment(e):t.hasTime()?t.clone().add(p.defaultTimedEventDuration):t.clone().add(p.defaultAllDayEventDuration),S.select({start:t,end:e})},p.unselect=function(){S&&S.unselect()},p.prev=function(){T=S.computePrevDate(T),r()},p.next=function(){T=S.computeNextDate(T),r()},p.prevYear=function(){T.add(-1,"years"),r()},p.nextYear=function(){T.add(1,"years"),r()},p.today=function(){T=p.getNow(),r()},p.gotoDate=function(t){T=p.moment(t),r()},p.incrementDate=function(t){T.add(F.duration(t)),r()},p.zoomTo=function(t,e){var n,i;e&&o(e)||(e=e||"day",(i=(n=w.getViewsWithButtons().join(" ")).match(new RegExp("\\w+"+Z(e))))||(i=n.match(/\w+Day/)),e=i?i[0]:"agendaDay"),T=t,r(e)},p.getDate=function(){return T.clone()},p.getCalendar=function(){return p},p.getView=function(){return S},p.option=function(t,e){if(void 0===e)return m[t];"height"!=t&&"contentHeight"!=t&&"aspectRatio"!=t||(m[t]=e,n(!0))},p.trigger=function(t,e){if(m[t])return m[t].apply(e||R,Array.prototype.slice.call(arguments,2))},p.isValidViewType=o,p.getViewButtonText=function(t){var e=s(t);if(e)return e.buttonText};var v=O(L(m.lang));if(m.monthNames&&(v._months=m.monthNames),m.monthNamesShort&&(v._monthsShort=m.monthNamesShort),m.dayNames&&(v._weekdays=m.dayNames),m.dayNamesShort&&(v._weekdaysShort=m.dayNamesShort),null!=m.firstDay){var y=O(v._week);y.dow=m.firstDay,v._week=y}p.defaultAllDayEventDuration=F.duration(m.defaultAllDayEventDuration),p.defaultTimedEventDuration=F.duration(m.defaultTimedEventDuration),p.moment=function(){var t;return"local"===m.timezone?(t=ot.moment.apply(null,arguments)).hasTime()&&t.local():t="UTC"===m.timezone?ot.moment.utc.apply(null,arguments):ot.moment.parseZone.apply(null,arguments),"_locale"in t?t._locale=v:t._lang=v,t},p.getIsAmbigTimezone=function(){return"local"!==m.timezone&&"UTC"!==m.timezone},p.rezoneDate=function(t){return p.moment(t.toArray())},p.getNow=function(){var t=m.now;return"function"==typeof t&&(t=t()),p.moment(t)},p.calculateWeekNumber=function(t){var e=m.weekNumberCalculation;return"function"==typeof e?e(t):"local"===e?t.week():"ISO"===e.toUpperCase()?t.isoWeek():void 0},p.getEventEnd=function(t){return t.end?t.end.clone():p.getDefaultEventEnd(t.allDay,t.start)},p.getDefaultEventEnd=function(t,e){var n=e.clone();return t?n.stripTime().add(p.defaultAllDayEventDuration):n.add(p.defaultTimedEventDuration),p.getIsAmbigTimezone()&&n.stripZone(),n},function(m){function s(s,o){!function t(e,n){var i;var r=ot.sourceFetchers;var s;for(i=0;i<r.length;i++){if(!0===(s=r[i].call(C,e,D.clone(),T.clone(),m.timezone,n)))return;if("object"==typeof s)return void t(s,n)}var o=e.events;if(o)N.isFunction(o)?(y(),o.call(C,D.clone(),T.clone(),m.timezone,function(t){n(t),w()})):N.isArray(o)?n(o):n();else{var l=e.url;if(l){var a,d=e.success,u=e.error,c=e.complete;a=N.isFunction(e.data)?e.data():e.data;var h=N.extend({},a||{}),f=W(e.startParam,m.startParam),g=W(e.endParam,m.endParam),p=W(e.timezoneParam,m.timezoneParam);f&&(h[f]=D.format()),g&&(h[g]=T.format()),m.timezone&&"local"!=m.timezone&&(h[p]=m.timezone),y(),N.ajax(N.extend({},Vt,e,{data:h,success:function(t){t=t||[];var e=B(d,this,arguments);N.isArray(e)&&(t=e),n(t)},error:function(){B(u,this,arguments),n()},complete:function(){B(c,this,arguments),w()}}))}else n()}}(s,function(t){var e,n,i,r=N.isArray(s.events);if(o==R){if(t)for(e=0;e<t.length;e++)n=t[e],(i=r?n:b(n,s))&&G.push.apply(G,E(i));--k||p(G)}})}function i(t){var e,n,i=ot.sourceNormalizers;if(N.isFunction(t)||N.isArray(t)?e={events:t}:"string"==typeof t?e={url:t}:"object"==typeof t&&(e=N.extend({},t)),e){for(e.className?"string"==typeof e.className&&(e.className=e.className.split(/\s+/)):e.className=[],N.isArray(e.events)&&(e.origArray=e.events,e.events=N.map(e.events,function(t){return b(t,e)})),n=0;n<i.length;n++)i[n].call(C,e);return e}}function n(t,e){return t&&e&&r(t)==r(e)}function r(t){return("object"==typeof t?t.origArray||t.googleCalendarId||t.url||t.events:null)||t}function e(t){var i={};return N.each(t,function(t,e){var n;d(t)&&void 0!==e&&(n=e,/undefined|null|boolean|number|string/.test(N.type(n)))&&(i[t]=e)}),i}function d(t){return!/^_|^(id|allDay|start|end)$/.test(t)}function v(e){return N.isFunction(e)?N.grep(G,e):null!=e?(e+="",N.grep(G,function(t){return t._id==e})):G}function y(){M++||t("loading",null,!0,g())}function w(){--M||t("loading",null,!1,g())}function b(t,e){var n,i,r,s={};if(m.eventDataTransform&&(t=m.eventDataTransform(t)),e&&e.eventDataTransform&&(t=e.eventDataTransform(t)),N.extend(s,t),e&&(s.source=e),s._id=t._id||(void 0===t.id?"_fc"+Lt++:t.id+""),t.className?"string"==typeof t.className?s.className=t.className.split(/\s+/):s.className=t.className:s.className=[],n=t.start||t.date,i=t.end,Y(n)&&(n=F.duration(n)),Y(i)&&(i=F.duration(i)),t.dow||F.isDuration(n)||F.isDuration(i))s.start=n?F.duration(n):null,s.end=i?F.duration(i):null,s._recurring=!0;else{if(n&&!(n=C.moment(n)).isValid())return!1;i&&((i=C.moment(i)).isValid()||(i=null)),void 0===(r=t.allDay)&&(r=W(e?e.allDayDefault:void 0,m.allDayDefault)),f(n,i,r,s)}return s}function f(t,e,n,i){i.start=t,i.end=e,i.allDay=n,c(i),it(i)}function c(t){t.hasNoStart=!1,t.hasNoEnd=!1,null==t.allDay&&(t.allDay=!(t.start.hasTime()||t.end&&t.end.hasTime())),t.allDay?(t.start.stripTime(),t.end&&t.end.stripTime()):(t.start.hasTime()||(t.hasNoStart=!0,t.start=C.rezoneDate(t.start)),t.end&&!t.end.hasTime()&&(t.hasNoEnd=!0,t.end=C.rezoneDate(t.end))),t.end&&!t.end.isAfter(t.start)&&(t.end=null),t.end||(m.forceEventDuration?t.end=C.getDefaultEventEnd(t.allDay,t.start):t.end=null)}function o(t){var e;return t.end||(null==(e=t.allDay)&&(e=!t.start.hasTime()),t={start:t.start,end:C.getDefaultEventEnd(e,t.start)}),t}function E(t,e,n){var i,r,s,o,l,a,d,u,c,h=[];if(e=e||D,n=n||T,t)if(t._recurring){if(r=t.dow)for(i={},s=0;s<r.length;s++)i[r[s]]=!0;for(o=e.clone().stripTime();o.isBefore(n);)i&&!i[o.day()]||(l=t.start,a=t.end,d=o.clone(),u=null,l&&(d=d.time(l)),a&&(u=o.clone().time(a)),c=N.extend({},t),f(d,u,!l&&!a,c),h.push(c)),o.add(1,"days")}else h.push(t);return h}function l(t,e){var n,i,r,s,o,l,a={};return(e=e||{}).start||(e.start=t.start.clone()),void 0===e.end&&(e.end=t.end?t.end.clone():null),null==e.allDay&&(e.allDay=t.allDay),c(e),n=null!==t._end&&null===e.end,e.allDay?(o=e.start,l=t._start,i=F.duration({days:o.clone().stripTime().diff(l.clone().stripTime(),"days")})):i=z(e.start,t._start),!n&&e.end&&(r=z(e.end,e.start).subtract(z(t._end||C.getDefaultEventEnd(t._allDay,t._start),t._start))),N.each(e,function(t,e){d(t)&&void 0!==e&&(a[t]=e)}),s=function(t,r,s,o,l,a){var d=C.getIsAmbigTimezone(),u=[];o&&!o.valueOf()&&(o=null);l&&!l.valueOf()&&(l=null);return N.each(t,function(t,e){var n,i;n={start:e.start.clone(),end:e.end?e.end.clone():null,allDay:e.allDay},N.each(a,function(t){n[t]=e[t]}),i={start:e._start,end:e._end,allDay:e._allDay},r&&(i.end=null),i.allDay=s,c(i),o&&(i.start.add(o),i.end&&i.end.add(o)),l&&(i.end||(i.end=C.getDefaultEventEnd(i.allDay,i.start)),i.end.add(l)),d&&!i.allDay&&(o||l)&&(i.start.stripZone(),i.end&&i.end.stripZone()),N.extend(e,a,i),it(e),u.push(function(){N.extend(e,n),it(e)})}),function(){for(var t=0;t<u.length;t++)u[t]()}}(v(t._id),n,e.allDay,i,r,a),{dateDelta:i,durationDelta:r,undo:s}}function S(){var t,e=m.businessHours,n={className:"fc-nonbusiness",start:"09:00",end:"17:00",dow:[1,2,3,4,5],rendering:"inverse-background"},i=C.getView();return e&&(t="object"==typeof e?N.extend({},n,e):n),t?E(b(t),i.start,i.end):[]}function a(t,e){var n=e.source||{},i=W(e.constraint,n.constraint,m.eventConstraint),r=W(e.overlap,n.overlap,m.eventOverlap);return h(t=o(t),i,r,e)}function u(t){return h(t,m.selectConstraint,m.selectOverlap)}function h(t,e,n,i){var r,s,o,l,a,d,u,c,h,f,g,p,m;if(t={start:t.start.clone().stripZone(),end:t.end.clone().stripZone()},null!=e){for(r=function(t){if("businessHours"===t)return S();if("object"==typeof t)return E(b(t));return v(t)}(e),s=!1,o=0;o<r.length;o++)if(d=r[o],u=t,void 0,c=d.start.clone().stripZone(),h=C.getEventEnd(d).stripZone(),u.start>=c&&u.end<=h){s=!0;break}if(!s)return!1}for(o=0;o<G.length;o++)if(l=G[o],(!i||i._id!==l._id)&&(g=t,void 0,p=(f=l).start.clone().stripZone(),m=C.getEventEnd(f).stripZone(),g.start<m&&g.end>p)){if(!1===n)return!1;if("function"==typeof n&&!n(l,i))return!1;if(i){if(!1===(a=W(l.overlap,(l.source||{}).overlap)))return!1;if("function"==typeof a&&!a(i,l))return!1}}return!0}var C=this;C.isFetchNeeded=function(t,e){return!D||t.clone().stripZone()<D.clone().stripZone()||e.clone().stripZone()>T.clone().stripZone()},C.fetchEvents=function(t,e){D=t,T=e,G=[];var n=++R,i=H.length;k=i;for(var r=0;r<i;r++)s(H[r],n)},C.addEventSource=function(t){var e=i(t);e&&(H.push(e),k++,s(e,R))},C.removeEventSource=function(e){H=N.grep(H,function(t){return!n(t,e)}),G=N.grep(G,function(t){return!n(t.source,e)}),p(G)},C.updateEvent=function(t){t.start=C.moment(t.start),t.end?t.end=C.moment(t.end):t.end=null;l(t,e(t)),p(G)},C.renderEvent=function(t,e){var n,i,r,s=b(t);if(s){for(n=E(s),i=0;i<n.length;i++)(r=n[i]).source||(e&&(x.events.push(r),r.source=x),G.push(r));return p(G),n}return[]},C.removeEvents=function(t){var e,n;null==t?t=function(){return!0}:N.isFunction(t)||(e=t+"",t=function(t){return t._id==e});for(G=N.grep(G,t,!0),n=0;n<H.length;n++)N.isArray(H[n].events)&&(H[n].events=N.grep(H[n].events,t,!0));p(G)},C.clientEvents=v,C.mutateEvent=l,C.normalizeEventDateProps=c,C.ensureVisibleEventRange=o;var D,T,t=C.trigger,g=C.getView,p=C.reportEvents,x={events:[]},H=[x],R=0,k=0,M=0,G=[];N.each((m.events?[m.events]:[]).concat(m.eventSources||[]),function(t,e){var n=i(e);n&&H.push(n)}),C.getBusinessHoursEvents=S,C.isEventRangeAllowed=a,C.isSelectionRangeAllowed=u,C.isExternalDropRangeAllowed=function(t,e){var n,i;e&&(n=N.extend({},e,t),i=E(b(n))[0]);return i?a(t,i):u(t=o(t))}}.call(p,m);var w,b,E,S,C,D,T,x=p.isFetchNeeded,H=p.fetchEvents,R=e[0],k={},M=0,G=[];T=null!=m.defaultDate?p.moment(m.defaultDate):p.getNow(),p.getSuggestedViewHeight=function(){return void 0===C&&l(),C},p.isHeightAuto=function(){return"auto"===m.contentHeight||"auto"===m.height}}function it(t){t._allDay=t.allDay,t._start=t.start.clone(),t._end=t.end?t.end.clone():null}var rt={titleRangeSeparator:" — ",monthYearFormat:"MMMM YYYY",defaultTimedEventDuration:"02:00:00",defaultAllDayEventDuration:{days:1},forceEventDuration:!1,nextDayThreshold:"09:00:00",defaultView:"month",aspectRatio:1.35,header:{left:"title",center:"",right:"today prev,next"},weekends:!0,weekNumbers:!1,weekNumberTitle:"W",weekNumberCalculation:"local",lazyFetching:!0,startParam:"start",endParam:"end",timezoneParam:"timezone",timezone:!1,isRTL:!1,defaultButtonText:{prev:"prev",next:"next",prevYear:"prev year",nextYear:"next year",today:"today",month:"month",week:"week",day:"day"},buttonIcons:{prev:"left-single-arrow",next:"right-single-arrow",prevYear:"left-double-arrow",nextYear:"right-double-arrow"},theme:!1,themeButtonIcons:{prev:"circle-triangle-w",next:"circle-triangle-e",prevYear:"seek-prev",nextYear:"seek-next"},dragOpacity:.75,dragRevertDuration:500,dragScroll:!0,unselectAuto:!0,dropAccept:"*",eventLimit:!1,eventLimitText:"more",eventLimitClick:"popover",dayPopoverFormat:"LL",handleWindowResize:!0,windowResizeDelay:200},st={header:{left:"next,prev today",center:"",right:"title"},buttonIcons:{prev:"right-single-arrow",next:"left-single-arrow",prevYear:"right-double-arrow",nextYear:"left-double-arrow"},themeButtonIcons:{prev:"circle-triangle-e",next:"circle-triangle-w",nextYear:"seek-prev",prevYear:"seek-next"}},ot=N.fullCalendar={version:"2.2.6"},lt=ot.views={};N.fn.fullCalendar=function(s){var o=Array.prototype.slice.call(arguments,1),l=this;return this.each(function(t,e){var n,i=N(e),r=i.data("fullCalendar");"string"==typeof s?r&&N.isFunction(r[s])&&(n=r[s].apply(r,o),t||(l=n),"destroy"===s&&i.removeData("fullCalendar")):r||(r=new nt(i,s),i.data("fullCalendar",r),r.render())}),l};var at=ot.langs={};ot.datepickerLang=function(t,e,n){var i=at[t]||(at[t]={});i.isRTL=n.isRTL,i.weekNumberTitle=n.weekHeader,N.each(dt,function(t,e){i[t]=e(n)}),N.datepicker&&(N.datepicker.regional[e]=N.datepicker.regional[t]=n,N.datepicker.regional.en=N.datepicker.regional[""],N.datepicker.setDefaults(n))},ot.lang=function(t,e){var n,i;n=at[t]||(at[t]={}),e&&V(n,e),i=L(t),N.each(ut,function(t,e){void 0===n[t]&&(n[t]=e(i,n))}),rt.lang=t};var dt={defaultButtonText:function(t){return{prev:v(t.prevText),next:v(t.nextText),today:v(t.currentText)}},monthYearFormat:function(t){return t.showMonthAfterYear?"YYYY["+t.yearSuffix+"] MMMM":"MMMM YYYY["+t.yearSuffix+"]"}},ut={dayOfMonthFormat:function(t,e){var n=t.longDateFormat("l");return n=n.replace(/^Y+[^\w\s]*|[^\w\s]*Y+$/g,""),e.isRTL?n+=" ddd":n="ddd "+n,n},smallTimeFormat:function(t){return t.longDateFormat("LT").replace(":mm","(:mm)").replace(/(\Wmm)$/,"($1)").replace(/\s*a$/i,"a")},extraSmallTimeFormat:function(t){return t.longDateFormat("LT").replace(":mm","(:mm)").replace(/(\Wmm)$/,"($1)").replace(/\s*a$/i,"t")},noMeridiemTimeFormat:function(t){return t.longDateFormat("LT").replace(/\s*a$/i,"")}};ot.lang("en",{dayPopoverFormat:"dddd, MMMM D"}),ot.intersectionToSeg=u,ot.applyAll=B,ot.debounce=j;var ct,ht,ft,gt=["sun","mon","tue","wed","thu","fri","sat"],pt=["year","month","week","day","hour","minute","second","millisecond"],mt={}.hasOwnProperty,vt=/^\s*\d{4}-\d\d$/,yt=/^\s*\d{4}-(?:(\d\d-\d\d)|(W\d\d$)|(W\d\d-\d)|(\d\d\d))((T| )(\d\d(:\d\d(:\d\d(\.\d+)?)?)?)?)?$/,wt=F.fn,bt=N.extend({},wt);ot.moment=function(){return w(arguments)},ot.moment.utc=function(){var t=w(arguments,!0);return t.hasTime()&&t.utc(),t},ot.moment.parseZone=function(){return w(arguments,!0,!0)},wt.clone=function(){var t=bt.clone.apply(this,arguments);return E(this,t),this._fullCalendar&&(t._fullCalendar=!0),t},wt.time=function(t){if(!this._fullCalendar)return bt.time.apply(this,arguments);if(null==t)return F.duration({hours:this.hours(),minutes:this.minutes(),seconds:this.seconds(),milliseconds:this.milliseconds()});this._ambigTime=!1,F.isDuration(t)||F.isMoment(t)||(t=F.duration(t));var e=0;return F.isDuration(t)&&(e=24*Math.floor(t.asDays())),this.hours(e+t.hours()).minutes(t.minutes()).seconds(t.seconds()).milliseconds(t.milliseconds())},wt.stripTime=function(){var t;return this._ambigTime||(t=this.toArray(),this.utc(),ht(this,t.slice(0,3)),this._ambigTime=!0,this._ambigZone=!0),this},wt.hasTime=function(){return!this._ambigTime},wt.stripZone=function(){var t,e;return this._ambigZone||(t=this.toArray(),e=this._ambigTime,this.utc(),ht(this,t),e&&(this._ambigTime=!0),this._ambigZone=!0),this},wt.hasZone=function(){return!this._ambigZone},N.each(["utcOffset","zone"],function(t,e){bt[e]&&(wt[e]=function(t){return null!=t&&(this._ambigTime=!1,this._ambigZone=!1),bt[e].apply(this,arguments)})}),wt.local=function(){var t=this.toArray(),e=this._ambigZone;return bt.local.apply(this,arguments),e&&ft(this,t),this},wt.format=function(){return this._fullCalendar&&arguments[0]?(t=this,e=arguments[0],D(t,R(e))):this._ambigTime?C(this,"YYYY-MM-DD"):this._ambigZone?C(this,"YYYY-MM-DD[T]HH:mm:ss"):bt.format.apply(this,arguments);var t,e},wt.toISOString=function(){return this._ambigTime?C(this,"YYYY-MM-DD"):this._ambigZone?C(this,"YYYY-MM-DD[T]HH:mm:ss"):bt.toISOString.apply(this,arguments)},wt.isWithin=function(t,e){var n=b([this,t,e]);return n[0]>=n[1]&&n[0]<n[2]},wt.isSame=function(t,e){var n;return this._fullCalendar?e?(n=b([this,t],!0),bt.isSame.call(n[0],n[1],e)):(t=ot.moment.parseZone(t),bt.isSame.call(this,t)&&Boolean(this._ambigTime)===Boolean(t._ambigTime)&&Boolean(this._ambigZone)===Boolean(t._ambigZone)):bt.isSame.apply(this,arguments)},N.each(["isBefore","isAfter"],function(t,i){wt[i]=function(t,e){var n;return this._fullCalendar?(n=b([this,t]),bt[i].call(n[0],n[1],e)):bt[i].apply(this,arguments)}}),ct="_d"in F()&&"updateOffset"in F,ht=ct?function(t,e){t._d.setTime(Date.UTC.apply(Date,e)),F.updateOffset(t,!1)}:S,ft=ct?function(t,e){t._d.setTime(+new Date(e[0]||0,e[1]||0,e[2]||0,e[3]||0,e[4]||0,e[5]||0,e[6]||0)),F.updateOffset(t,!1)}:S;var Et={t:function(t){return C(t,"a").charAt(0)},T:function(t){return C(t,"A").charAt(0)}};ot.formatRange=x;var St={Y:"year",M:"month",D:"day",d:"day",A:"second",a:"second",T:"second",t:"second",H:"second",h:"second",m:"second",s:"second"},Ct={};(ot.Class=k).extend=function(t){var e,n=this;return m(t=t||{},"constructor")&&(e=t.constructor),"function"!=typeof e&&(e=t.constructor=function(){n.apply(this,arguments)}),e.prototype=O(n.prototype),p(t,e.prototype),p(n,e),e},k.mixin=function(t){p(t.prototype||t,this.prototype)};var Dt=k.extend({isHidden:!0,options:null,el:null,documentMousedownProxy:null,margin:10,constructor:function(t){this.options=t||{}},show:function(){this.isHidden&&(this.el||this.render(),this.el.show(),this.position(),this.isHidden=!1,this.trigger("show"))},hide:function(){this.isHidden||(this.el.hide(),this.isHidden=!0,this.trigger("hide"))},render:function(){var t=this,e=this.options;this.el=N('<div class="fc-popover"/>').addClass(e.className||"").css({top:0,left:0}).append(e.content).appendTo(e.parentEl),this.el.on("click",".fc-close",function(){t.hide()}),e.autoHide&&N(document).on("mousedown",this.documentMousedownProxy=N.proxy(this,"documentMousedown"))},documentMousedown:function(t){this.el&&!N(t.target).closest(this.el).length&&this.hide()},destroy:function(){this.hide(),this.el&&(this.el.remove(),this.el=null),N(document).off("mousedown",this.documentMousedownProxy)},position:function(){var t,e,n,i,r,s=this.options,o=this.el.offsetParent().offset(),l=this.el.outerWidth(),a=this.el.outerHeight(),d=N(window),u=h(this.el);i=s.top||0,r=void 0!==s.left?s.left:void 0!==s.right?s.right-l:0,u.is(window)||u.is(document)?(u=d,e=t=0):(t=(n=u.offset()).top,e=n.left),t+=d.scrollTop(),e+=d.scrollLeft(),!1!==s.viewportConstrain&&(i=Math.min(i,t+u.outerHeight()-a-this.margin),i=Math.max(i,t+this.margin),r=Math.min(r,e+u.outerWidth()-l-this.margin),r=Math.max(r,e+this.margin)),this.el.css({top:i-o.top,left:r-o.left})},trigger:function(t){this.options[t]&&this.options[t].apply(this,Array.prototype.slice.call(arguments,1))}}),Tt=k.extend({grid:null,rowCoords:null,colCoords:null,containerEl:null,minX:null,maxX:null,minY:null,maxY:null,constructor:function(t){this.grid=t},build:function(){this.rowCoords=this.grid.computeRowCoords(),this.colCoords=this.grid.computeColCoords(),this.computeBounds()},clear:function(){this.rowCoords=null,this.colCoords=null},getCell:function(t,e){var n,i,r,s=this.rowCoords,o=this.colCoords,l=null,a=null;if(this.inBounds(t,e)){for(n=0;n<s.length;n++)if(e>=(i=s[n]).top&&e<i.bottom){l=n;break}for(n=0;n<o.length;n++)if(t>=(i=o[n]).left&&t<i.right){a=n;break}if(null!==l&&null!==a)return(r=this.grid.getCell(l,a)).grid=this.grid,r}return null},computeBounds:function(){var t;this.containerEl&&(t=this.containerEl.offset(),this.minX=t.left,this.maxX=t.left+this.containerEl.outerWidth(),this.minY=t.top,this.maxY=t.top+this.containerEl.outerHeight())},inBounds:function(t,e){return!this.containerEl||t>=this.minX&&t<this.maxX&&e>=this.minY&&e<this.maxY}}),xt=k.extend({coordMaps:null,constructor:function(t){this.coordMaps=t},build:function(){var t,e=this.coordMaps;for(t=0;t<e.length;t++)e[t].build()},getCell:function(t,e){var n,i=this.coordMaps,r=null;for(n=0;n<i.length&&!r;n++)r=i[n].getCell(t,e);return r},clear:function(){var t,e=this.coordMaps;for(t=0;t<e.length;t++)e[t].clear()}}),Ht=k.extend({coordMap:null,options:null,isListening:!1,isDragging:!1,origCell:null,cell:null,mouseX0:null,mouseY0:null,mousemoveProxy:null,mouseupProxy:null,scrollEl:null,scrollBounds:null,scrollTopVel:null,scrollLeftVel:null,scrollIntervalId:null,scrollHandlerProxy:null,scrollSensitivity:30,scrollSpeed:200,scrollIntervalMs:50,constructor:function(t,e){this.coordMap=t,this.options=e||{}},mousedown:function(t){d(t)&&(t.preventDefault(),this.startListening(t),this.options.distance||this.startDrag(t))},startListening:function(t){var e,n;this.isListening||(t&&this.options.scroll&&((e=h(N(t.target))).is(window)||e.is(document)||(this.scrollEl=e,this.scrollHandlerProxy=j(N.proxy(this,"scrollHandler"),100),this.scrollEl.on("scroll",this.scrollHandlerProxy))),this.computeCoords(),t&&(n=this.getCell(t),this.origCell=n,this.mouseX0=t.pageX,this.mouseY0=t.pageY),N(document).on("mousemove",this.mousemoveProxy=N.proxy(this,"mousemove")).on("mouseup",this.mouseupProxy=N.proxy(this,"mouseup")).on("selectstart",this.preventDefault),this.isListening=!0,this.trigger("listenStart",t))},computeCoords:function(){this.coordMap.build(),this.computeScrollBounds()},mousemove:function(t){var e;this.isDragging||(e=this.options.distance||1)*e<=Math.pow(t.pageX-this.mouseX0,2)+Math.pow(t.pageY-this.mouseY0,2)&&this.startDrag(t),this.isDragging&&this.drag(t)},startDrag:function(t){var e;this.isListening||this.startListening(),this.isDragging||(this.isDragging=!0,this.trigger("dragStart",t),(e=this.getCell(t))&&this.cellOver(e))},drag:function(t){var e;this.isDragging&&(M(e=this.getCell(t),this.cell)||(this.cell&&this.cellOut(),e&&this.cellOver(e)),this.dragScroll(t))},cellOver:function(t){this.cell=t,this.trigger("cellOver",t,M(t,this.origCell))},cellOut:function(){this.cell&&(this.trigger("cellOut",this.cell),this.cell=null)},mouseup:function(t){this.stopDrag(t),this.stopListening(t)},stopDrag:function(t){this.isDragging&&(this.stopScrolling(),this.trigger("dragStop",t),this.isDragging=!1)},stopListening:function(t){this.isListening&&(this.scrollEl&&(this.scrollEl.off("scroll",this.scrollHandlerProxy),this.scrollHandlerProxy=null),N(document).off("mousemove",this.mousemoveProxy).off("mouseup",this.mouseupProxy).off("selectstart",this.preventDefault),this.mousemoveProxy=null,this.mouseupProxy=null,this.isListening=!1,this.trigger("listenStop",t),this.origCell=this.cell=null,this.coordMap.clear())},getCell:function(t){return this.coordMap.getCell(t.pageX,t.pageY)},trigger:function(t){this.options[t]&&this.options[t].apply(this,Array.prototype.slice.call(arguments,1))},preventDefault:function(t){t.preventDefault()},computeScrollBounds:function(){var t,e=this.scrollEl;e&&(t=e.offset(),this.scrollBounds={top:t.top,left:t.left,bottom:t.top+e.outerHeight(),right:t.left+e.outerWidth()})},dragScroll:function(t){var e,n,i,r,s=this.scrollSensitivity,o=this.scrollBounds,l=0,a=0;o&&(e=(s-(t.pageY-o.top))/s,n=(s-(o.bottom-t.pageY))/s,i=(s-(t.pageX-o.left))/s,r=(s-(o.right-t.pageX))/s,0<=e&&e<=1?l=e*this.scrollSpeed*-1:0<=n&&n<=1&&(l=n*this.scrollSpeed),0<=i&&i<=1?a=i*this.scrollSpeed*-1:0<=r&&r<=1&&(a=r*this.scrollSpeed)),this.setScrollVel(l,a)},setScrollVel:function(t,e){this.scrollTopVel=t,this.scrollLeftVel=e,this.constrainScrollVel(),!this.scrollTopVel&&!this.scrollLeftVel||this.scrollIntervalId||(this.scrollIntervalId=setInterval(N.proxy(this,"scrollIntervalFunc"),this.scrollIntervalMs))},constrainScrollVel:function(){var t=this.scrollEl;this.scrollTopVel<0?t.scrollTop()<=0&&(this.scrollTopVel=0):0<this.scrollTopVel&&t.scrollTop()+t[0].clientHeight>=t[0].scrollHeight&&(this.scrollTopVel=0),this.scrollLeftVel<0?t.scrollLeft()<=0&&(this.scrollLeftVel=0):0<this.scrollLeftVel&&t.scrollLeft()+t[0].clientWidth>=t[0].scrollWidth&&(this.scrollLeftVel=0)},scrollIntervalFunc:function(){var t=this.scrollEl,e=this.scrollIntervalMs/1e3;this.scrollTopVel&&t.scrollTop(t.scrollTop()+this.scrollTopVel*e),this.scrollLeftVel&&t.scrollLeft(t.scrollLeft()+this.scrollLeftVel*e),this.constrainScrollVel(),this.scrollTopVel||this.scrollLeftVel||this.stopScrolling()},stopScrolling:function(){this.scrollIntervalId&&(clearInterval(this.scrollIntervalId),this.scrollIntervalId=null,this.computeCoords())},scrollHandler:function(){this.scrollIntervalId||this.computeCoords()}}),Rt=k.extend({options:null,sourceEl:null,el:null,parentEl:null,top0:null,left0:null,mouseY0:null,mouseX0:null,topDelta:null,leftDelta:null,mousemoveProxy:null,isFollowing:!1,isHidden:!1,isAnimating:!1,constructor:function(t,e){this.options=e=e||{},this.sourceEl=t,this.parentEl=e.parentEl?N(e.parentEl):t.parent()},start:function(t){this.isFollowing||(this.isFollowing=!0,this.mouseY0=t.pageY,this.mouseX0=t.pageX,this.topDelta=0,this.leftDelta=0,this.isHidden||this.updatePosition(),N(document).on("mousemove",this.mousemoveProxy=N.proxy(this,"mousemove")))},stop:function(t,e){function n(){this.isAnimating=!1,i.destroyEl(),this.top0=this.left0=null,e&&e()}var i=this,r=this.options.revertDuration;this.isFollowing&&!this.isAnimating&&(this.isFollowing=!1,N(document).off("mousemove",this.mousemoveProxy),t&&r&&!this.isHidden?(this.isAnimating=!0,this.el.animate({top:this.top0,left:this.left0},{duration:r,complete:n})):n())},getEl:function(){var t=this.el;return t||(this.sourceEl.width(),t=this.el=this.sourceEl.clone().css({position:"absolute",visibility:"",display:this.isHidden?"none":"",margin:0,right:"auto",bottom:"auto",width:this.sourceEl.width(),height:this.sourceEl.height(),opacity:this.options.opacity||"",zIndex:this.options.zIndex}).appendTo(this.parentEl)),t},destroyEl:function(){this.el&&(this.el.remove(),this.el=null)},updatePosition:function(){var t,e;this.getEl(),null===this.top0&&(this.sourceEl.width(),t=this.sourceEl.offset(),e=this.el.offsetParent().offset(),this.top0=t.top-e.top,this.left0=t.left-e.left),this.el.css({top:this.top0+this.topDelta,left:this.left0+this.leftDelta})},mousemove:function(t){this.topDelta=t.pageY-this.mouseY0,this.leftDelta=t.pageX-this.mouseX0,this.isHidden||this.updatePosition()},hide:function(){this.isHidden||(this.isHidden=!0,this.el&&this.el.hide())},show:function(){this.isHidden&&(this.isHidden=!1,this.updatePosition(),this.getEl().show())}}),kt=k.extend({view:null,isRTL:null,cellHtml:"<td/>",constructor:function(t){this.view=t,this.isRTL=t.opt("isRTL")},rowHtml:function(t,e){var n,i=this.getHtmlRenderer("cell",t),r="";for(e=e||0,n=0;n<this.colCnt;n++)r+=i(this.getCell(e,n));return"<tr>"+(r=this.bookendCells(r,t,e))+"</tr>"},bookendCells:function(t,e,n){var i=this.getHtmlRenderer("intro",e)(n||0),r=this.getHtmlRenderer("outro",e)(n||0),s=this.isRTL?r:i,o=this.isRTL?i:r;return"string"==typeof t?s+t+o:t.prepend(s).append(o)},getHtmlRenderer:function(t,e){var n,i,r,s,o=this.view;return n=t+"Html",e&&(i=e+Z(t)+"Html"),i&&(s=o[i])?r=o:i&&(s=this[i])?r=this:(s=o[n])?r=o:(s=this[n])&&(r=this),"function"==typeof s?function(){return s.apply(r,arguments)||""}:function(){return s||""}}}),Mt=ot.Grid=kt.extend({start:null,end:null,rowCnt:0,colCnt:0,rowData:null,colData:null,el:null,coordMap:null,elsByFill:null,documentDragStartProxy:null,colHeadFormat:null,eventTimeFormat:null,displayEventEnd:null,constructor:function(){kt.apply(this,arguments),this.coordMap=new Tt(this),this.elsByFill={},this.documentDragStartProxy=N.proxy(this,"documentDragStart")},render:function(){this.bindHandlers()},destroy:function(){this.unbindHandlers()},computeColHeadFormat:function(){},computeEventTimeFormat:function(){return this.view.opt("smallTimeFormat")},computeDisplayEventEnd:function(){return!1},setRange:function(t){var e=this.view;this.start=t.start.clone(),this.end=t.end.clone(),this.rowData=[],this.colData=[],this.updateCells(),this.colHeadFormat=e.opt("columnFormat")||this.computeColHeadFormat(),this.eventTimeFormat=e.opt("timeFormat")||this.computeEventTimeFormat(),this.displayEventEnd=e.opt("displayEventEnd"),null==this.displayEventEnd&&(this.displayEventEnd=this.computeDisplayEventEnd())},updateCells:function(){},rangeToSegs:function(t){},getCell:function(t,e){var n;return null==e&&("number"==typeof t?(e=t%this.colCnt,t=Math.floor(t/this.colCnt)):(e=t.col,t=t.row)),n={row:t,col:e},N.extend(n,this.getRowData(t),this.getColData(e)),N.extend(n,this.computeCellRange(n)),n},computeCellRange:function(t){},getRowData:function(t){return this.rowData[t]||{}},getColData:function(t){return this.colData[t]||{}},getRowEl:function(t){},getColEl:function(t){},getCellDayEl:function(t){return this.getColEl(t.col)||this.getRowEl(t.row)},computeRowCoords:function(){var t,e,n,i=[];for(t=0;t<this.rowCnt;t++)n={top:(e=this.getRowEl(t)).offset().top},0<t&&(i[t-1].bottom=n.top),i.push(n);return n.bottom=n.top+e.outerHeight(),i},computeColCoords:function(){var t,e,n,i=[];for(t=0;t<this.colCnt;t++)n={left:(e=this.getColEl(t)).offset().left},0<t&&(i[t-1].right=n.left),i.push(n);return n.right=n.left+e.outerWidth(),i},bindHandlers:function(){var e=this;this.el.on("mousedown",function(t){N(t.target).is(".fc-event-container *, .fc-more")||N(t.target).closest(".fc-popover").length||e.dayMousedown(t)}),this.el.on("contextmenu",function(t){N(t.target).is(".fc-event-container *, .fc-more")||N(t.target).closest(".fc-popover").length||e.dayContext(t)}),this.bindSegHandlers(),N(document).on("dragstart",this.documentDragStartProxy)},unbindHandlers:function(){N(document).off("dragstart",this.documentDragStartProxy)},dayMousedown:function(t){var i,r,s=this,e=this.view,o=e.opt("selectable"),l=new Ht(this.coordMap,{scroll:e.opt("dragScroll"),dragStart:function(){e.unselect()},cellOver:function(t,e){var n=l.origCell;n&&(i=e?t:null,o&&((r=s.computeSelection(n,t))?s.renderSelection(r):f()))},cellOut:function(t){r=i=null,s.destroySelection(),g()},listenStop:function(t){i&&e.trigger("dayClick",s.getCellDayEl(i),i.start,t),r&&e.reportSelection(r,t),g()}});l.mousedown(t)},dayContext:function(t){var e,n=this.view;this.coordMap.build(),(e=this.coordMap.getCell(t.pageX,t.pageY))&&n.trigger("dayRightClick",this.getCellDayEl(e),e.start,t)},renderRangeHelper:function(t,e){var n;(n=e?O(e.event):{}).start=t.start.clone(),n.end=t.end?t.end.clone():null,n.allDay=null,this.view.calendar.normalizeEventDateProps(n),n.className=(n.className||[]).concat("fc-helper"),e||(n.editable=!1),this.renderHelper(n,e)},renderHelper:function(t,e){},destroyHelper:function(){},renderSelection:function(t){this.renderHighlight(t)},destroySelection:function(){this.destroyHighlight()},computeSelection:function(t,e){var n,i=[t.start,t.end,e.start,e.end];return i.sort(y),n={start:i[0].clone(),end:i[3].clone()},this.view.calendar.isSelectionRangeAllowed(n)?n:null},renderHighlight:function(t){this.renderFill("highlight",this.rangeToSegs(t))},destroyHighlight:function(){this.destroyFill("highlight")},highlightSegClasses:function(){return["fc-highlight"]},renderFill:function(t,e){},destroyFill:function(t){var e=this.elsByFill[t];e&&(e.remove(),delete this.elsByFill[t])},renderFillSegEls:function(t,r){var e,s=this,o=this[t+"SegEl"],n="",l=[];if(r.length){for(e=0;e<r.length;e++)n+=this.fillSegHtml(t,r[e]);N(n).each(function(t,e){var n=r[t],i=N(e);o&&(i=o.call(s,n,i)),i&&(i=N(i)).is(s.fillSegTag)&&(n.el=i,l.push(n))})}return l},fillSegTag:"div",fillSegHtml:function(t,e){var n=this[t+"SegClasses"],i=this[t+"SegStyles"],r=n?n.call(this,e):[],s=i?i.call(this,e):"";return"<"+this.fillSegTag+(r.length?' class="'+r.join(" ")+'"':"")+(s?' style="'+s+'"':"")+" />"},headHtml:function(){return'<div class="fc-row '+this.view.widgetHeaderClass+'"><table><thead>'+this.rowHtml("head")+"</thead></table></div>"},headCellHtml:function(t){var e=this.view,n=t.start;return'<th class="fc-day-header '+e.widgetHeaderClass+" fc-"+gt[n.day()]+'" scope="col">'+I(n.format(this.colHeadFormat))+"</th>"},bgCellHtml:function(t){var e=this.view,n=t.start,i=this.getDayClasses(n);return i.unshift("fc-day",e.widgetContentClass),'<td class="'+i.join(" ")+'" data-date="'+n.format("YYYY-MM-DD")+'"></td>'},getDayClasses:function(t){var e=this.view,n=e.calendar.getNow().stripTime(),i=["fc-"+gt[t.day()]];return"month"===e.name&&t.month()!=e.intervalStart.month()&&i.push("fc-other-month"),t.isSame(n,"day")?i.push("fc-today",e.highlightStateClass):t<n?i.push("fc-past"):i.push("fc-future"),i}});Mt.mixin({mousedOverSeg:null,isDraggingSeg:!1,isResizingSeg:!1,segs:null,renderEvents:function(t){var e,n,i,r,s=this.eventsToSegs(t),o=[],l=[];for(e=0;e<s.length;e++)n=s[e],i=n.event,void 0,"background"===(r=G(i))||"inverse-background"===r?o.push(n):l.push(n);o=this.renderBgSegs(o)||o,l=this.renderFgSegs(l)||l,this.segs=o.concat(l)},destroyEvents:function(){this.triggerSegMouseout(),this.destroyFgSegs(),this.destroyBgSegs(),this.segs=null},getEventSegs:function(){return this.segs||[]},renderFgSegs:function(t){},destroyFgSegs:function(){},renderFgSegEls:function(r,t){var e,s=this.view,n="",o=[];if(r.length){for(e=0;e<r.length;e++)n+=this.fgSegHtml(r[e],t);N(n).each(function(t,e){var n=r[t],i=s.resolveEventEl(n.event,N(e));i&&(i.data("fc-seg",n),n.el=i,o.push(n))})}return o},fgSegHtml:function(t,e){},renderBgSegs:function(t){return this.renderFill("bgEvent",t)},destroyBgSegs:function(){this.destroyFill("bgEvent")},bgEventSegEl:function(t,e){return this.view.resolveEventEl(t.event,e)},bgEventSegClasses:function(t){var e=t.event,n=e.source||{};return["fc-bgevent"].concat(e.className,n.className||[])},bgEventSegStyles:function(t){var e=this.view,n=t.event,i=n.source||{},r=n.color,s=i.color,o=e.opt("eventColor"),l=n.backgroundColor||r||i.backgroundColor||s||e.opt("eventBackgroundColor")||o;return l?"background-color:"+l:""},businessHoursSegClasses:function(t){return["fc-nonbusiness","fc-bgevent"]},bindSegHandlers:function(){var i=this,n=this.view;N.each({mouseenter:function(t,e){i.triggerSegMouseover(t,e)},mouseleave:function(t,e){i.triggerSegMouseout(t,e)},click:function(t,e){return n.trigger("eventClick",this,t.event,e)},mousedown:function(t,e){N(e.target).is(".fc-resizer")&&n.isEventResizable(t.event)?i.segResizeMousedown(t,e):n.isEventDraggable(t.event)&&i.segDragMousedown(t,e)},contextmenu:function(t,e){return n.trigger("eventRightClick",this,t.event,e)}},function(t,n){i.el.on(t,".fc-event-container > *",function(t){var e=N(this).data("fc-seg");if(e&&!i.isDraggingSeg&&!i.isResizingSeg)return n.call(this,e,t)})})},triggerSegMouseover:function(t,e){this.mousedOverSeg||(this.mousedOverSeg=t,this.view.trigger("eventMouseover",t.el[0],t.event,e))},triggerSegMouseout:function(t,e){e=e||{},this.mousedOverSeg&&(t=t||this.mousedOverSeg,this.mousedOverSeg=null,this.view.trigger("eventMouseout",t.el[0],t.event,e))},segDragMousedown:function(i,t){var r,s=this,o=this.view,e=i.el,l=i.event,a=new Rt(i.el,{parentEl:o.el,opacity:o.opt("dragOpacity"),revertDuration:o.opt("dragRevertDuration"),zIndex:2}),d=new Ht(o.coordMap,{distance:5,scroll:o.opt("dragScroll"),listenStart:function(t){a.hide(),a.start(t)},dragStart:function(t){s.triggerSegMouseout(i,t),s.isDraggingSeg=!0,o.hideEvent(l),o.trigger("eventDragStart",e[0],l,t,{})},cellOver:function(t,e){var n=i.cell||d.origCell;(r=s.computeEventDrop(n,t,l))?(o.renderDrag(r,i)?a.hide():a.show(),e&&(r=null)):(a.show(),f())},cellOut:function(){r=null,o.destroyDrag(),a.show(),g()},dragStop:function(t){a.stop(!r,function(){s.isDraggingSeg=!1,o.destroyDrag(),o.showEvent(l),o.trigger("eventDragStop",e[0],l,t,{}),r&&o.reportEventDrop(l,r,e,t)}),g()},listenStop:function(){a.stop()}});d.mousedown(t)},computeEventDrop:function(t,e,n){var i,r,s,o,l,a=t.start,d=e.start;return a.hasTime()===d.hasTime()?(i=z(d,a),r=n.start.clone().add(i),s=null===n.end?null:n.end.clone().add(i),o=n.allDay):(r=d.clone(),s=null,o=!d.hasTime()),l={start:r,end:s,allDay:o},this.view.calendar.isEventRangeAllowed(l,n)?l:null},documentDragStart:function(t,e){var n,i,r=this.view;r.opt("droppable")&&(n=N(t.target),i=r.opt("dropAccept"),(N.isFunction(i)?i.call(n[0],n):n.is(i))&&this.startExternalDrag(n,t,e))},startExternalDrag:function(n,t,e){var i,r,s,o,l,a,d,u,c=this,h=(i=n,(a=ot.dataAttrPrefix)&&(a+="-"),(r=i.data(a+"event")||null)&&(null==(s=(r="object"==typeof r?N.extend({},r):{}).start)&&(s=r.time),o=r.duration,l=r.stick,delete r.start,delete r.time,delete r.duration,delete r.stick),null==s&&(s=i.data(a+"start")),null==s&&(s=i.data(a+"time")),null==o&&(o=i.data(a+"duration")),null==l&&(l=i.data(a+"stick")),{eventProps:r,startTime:s=null!=s?F.duration(s):null,duration:o=null!=o?F.duration(o):null,stick:l=Boolean(l)});d=new Ht(this.coordMap,{cellOver:function(t){(u=c.computeExternalDrop(t,h))?c.renderDrag(u):f()},cellOut:function(){u=null,c.destroyDrag(),g()}}),N(document).one("dragstop",function(t,e){c.destroyDrag(),g(),u&&c.view.reportExternalDrop(h,u,n,t,e)}),d.startDrag(t)},computeExternalDrop:function(t,e){var n={start:t.start.clone(),end:null};return e.startTime&&!n.start.hasTime()&&n.start.time(e.startTime),e.duration&&(n.end=n.start.clone().add(e.duration)),this.view.calendar.isExternalDropRangeAllowed(n,e.eventProps)?n:null},renderDrag:function(t,e){},destroyDrag:function(){},segResizeMousedown:function(e,t){function n(){r.destroyEventResize(),s.showEvent(a),g()}var i,r=this,s=this.view,o=s.calendar,l=e.el,a=e.event,d=a.start,u=o.getEventEnd(a);new Ht(this.coordMap,{distance:5,scroll:s.opt("dragScroll"),dragStart:function(t){r.triggerSegMouseout(e,t),r.isResizingSeg=!0,s.trigger("eventResizeStart",l[0],a,t,{})},cellOver:function(t){(i=t.end).isAfter(d)||(i=d.clone().add(z(t.end,t.start))),i.isSame(u)?i=null:o.isEventRangeAllowed({start:d,end:i},a)?(r.renderEventResize({start:d,end:i},e),s.hideEvent(a)):(i=null,f())},cellOut:function(){i=null,n()},dragStop:function(t){r.isResizingSeg=!1,n(),s.trigger("eventResizeStop",l[0],a,t,{}),i&&s.reportEventResize(a,i,l,t)}}).mousedown(t)},renderEventResize:function(t,e){},destroyEventResize:function(){},getEventTimeText:function(t,e){return e=e||this.eventTimeFormat,t.end&&this.displayEventEnd?this.view.formatRange(t,e):t.start.format(e)},getSegClasses:function(t,e,n){var i=t.event,r=["fc-event",t.isStart?"fc-start":"fc-not-start",t.isEnd?"fc-end":"fc-not-end"].concat(i.className,i.source?i.source.className:[]);return e&&r.push("fc-draggable"),n&&r.push("fc-resizable"),r},getEventSkinCss:function(t){var e=this.view,n=t.source||{},i=t.color,r=n.color,s=e.opt("eventColor"),o=t.backgroundColor||i||n.backgroundColor||r||e.opt("eventBackgroundColor")||s,l=t.borderColor||i||n.borderColor||r||e.opt("eventBorderColor")||s,a=t.textColor||n.textColor||e.opt("eventTextColor"),d=[];return o&&d.push("background-color:"+o),l&&d.push("border-color:"+l),a&&d.push("color:"+a),d.join(";")},eventsToSegs:function(t,e){var n,i=this.eventsToRanges(t),r=[];for(n=0;n<i.length;n++)r.push.apply(r,this.eventRangeToSegs(i[n],e));return r},eventsToRanges:function(t){var n=this,e=function(t){var e,n,i={};for(e=0;e<t.length;e++)(i[(n=t[e])._id]||(i[n._id]=[])).push(n);return i}(t),i=[];return N.each(e,function(t,e){e.length&&i.push.apply(i,"inverse-background"===G(e[0])?n.eventsToInverseRanges(e):n.eventsToNormalRanges(e))}),i},eventsToNormalRanges:function(t){var e,n,i,r,s=this.view.calendar,o=[];for(e=0;e<t.length;e++)i=(n=t[e]).start.clone().stripZone(),r=s.getEventEnd(n).stripZone(),o.push({event:n,start:i,end:r,eventStartMS:+i,eventDurationMS:r-i});return o},eventsToInverseRanges:function(t){var e,n,i=this.view,r=i.start.clone().stripZone(),s=i.end.clone().stripZone(),o=this.eventsToNormalRanges(t),l=[],a=t[0],d=r;for(o.sort(X),e=0;e<o.length;e++)(n=o[e]).start>d&&l.push({event:a,start:d,end:n.start}),d=n.end;return d<s&&l.push({event:a,start:d,end:s}),l},eventRangeToSegs:function(t,e){var n,i,r;for(n=e?e(t):this.rangeToSegs(t),i=0;i<n.length;i++)(r=n[i]).event=t.event,r.eventStartMS=t.eventStartMS,r.eventDurationMS=t.eventDurationMS;return n}}),ot.compareSegs=U,ot.dataAttrPrefix="";var Gt=Mt.extend({numbersVisible:!1,bottomCoordPadding:0,breakOnDays:null,breakOnWeeks:null,cellDates:null,dayToCellOffsets:null,rowEls:null,dayEls:null,helperEls:null,render:function(t){var e,n,i,r=this.view,s=this.rowCnt,o=s*this.colCnt,l="";for(e=0;e<s;e++)l+=this.dayRowHtml(e,t);for(this.el.html(l),this.rowEls=this.el.find(".fc-row"),this.dayEls=this.el.find(".fc-day"),n=0;n<o;n++)i=this.getCell(n),r.trigger("dayRender",null,i.start,this.dayEls.eq(n));Mt.prototype.render.call(this)},destroy:function(){this.destroySegPopover(),Mt.prototype.destroy.call(this)},dayRowHtml:function(t,e){var n=this.view;if(this.breakOnDays)var i=["fc-row","fc-day",n.widgetContentClass];else i=["fc-row","fc-week",n.widgetContentClass];return e&&i.push("fc-rigid"),'<div class="'+i.join(" ")+'"><div class="fc-bg"><table>'+this.rowHtml("day",t)+'</table></div><div class="fc-content-skeleton"><table>'+(this.numbersVisible?"<thead>"+this.rowHtml("number",t)+"</thead>":"")+"</table></div></div>"},dayCellHtml:function(t){return this.bgCellHtml(t)},computeColHeadFormat:function(){return 1<this.rowCnt?"ddd":1<this.colCnt?this.view.opt("dayOfMonthFormat"):"dddd"},computeEventTimeFormat:function(){return this.view.opt("extraSmallTimeFormat")},computeDisplayEventEnd:function(){return 1==this.colCnt},updateCells:function(){var t,e,n,i;if(this.updateCellDates(),t=this.cellDates,this.breakOnDays)i=1,t.length,n=Math.ceil(t.length/i);else if(this.breakOnWeeks){for(e=t[0].day(),i=1;i<t.length&&t[i].day()!=e;i++);n=Math.ceil(t.length/i)}else n=1,i=t.length;this.rowCnt=n,this.colCnt=i},updateCellDates:function(){for(var t=this.view,e=this.start.clone(),n=[],i=-1,r=[];e.isBefore(this.end);)t.isHiddenDay(e)?r.push(i+.5):(i++,r.push(i),n.push(e.clone())),e.add(1,"days");this.cellDates=n,this.dayToCellOffsets=r},computeCellRange:function(t){var e=this.colCnt,n=t.row*e+(this.isRTL?e-t.col-1:t.col),i=this.cellDates[n].clone();return{start:i,end:i.clone().add(1,"day")}},getRowEl:function(t){return this.rowEls.eq(t)},getColEl:function(t){return this.dayEls.eq(t)},getCellDayEl:function(t){return this.dayEls.eq(t.row*this.colCnt+t.col)},computeRowCoords:function(){var t=Mt.prototype.computeRowCoords.call(this);return t[t.length-1].bottom+=this.bottomCoordPadding,t},rangeToSegs:function(t){var e,n,i,r,s,o,l,a,d,u,c=this.isRTL,h=this.rowCnt,f=this.colCnt,g=[];for(t=this.view.computeDayRange(t),e=this.dateToCellOffset(t.start),n=this.dateToCellOffset(t.end.subtract(1,"days")),i=0;i<h;i++)s=(r=i*f)+f-1,a=Math.max(r,e),d=Math.min(s,n),(a=Math.ceil(a))<=(d=Math.floor(d))&&(o=a===e,l=d===n,a-=r,d-=r,u={row:i,isStart:o,isEnd:l},c?(u.leftCol=f-d-1,u.rightCol=f-a-1):(u.leftCol=a,u.rightCol=d),g.push(u));return g},dateToCellOffset:function(t){var e=this.dayToCellOffsets,n=t.diff(this.start,"days");return n<0?e[0]-1:n>=e.length?e[e.length-1]+1:e[n]},renderDrag:function(t,e){var n;if(this.renderHighlight(this.view.calendar.ensureVisibleEventRange(t)),e&&!e.el.closest(this.el).length)return this.renderRangeHelper(t,e),void 0!==(n=this.view.opt("dragOpacity"))&&this.helperEls.css("opacity",n),!0},destroyDrag:function(){this.destroyHighlight(),this.destroyHelper()},renderEventResize:function(t,e){this.renderHighlight(t),this.renderRangeHelper(t,e)},destroyEventResize:function(){this.destroyHighlight(),this.destroyHelper()},renderHelper:function(t,s){var o,l=[],e=this.eventsToSegs([t]);e=this.renderFgSegEls(e),o=this.renderSegRows(e),this.rowEls.each(function(t,e){var n,i=N(e),r=N('<div class="fc-helper-skeleton"><table/></div>');n=s&&s.row===t?s.el.position().top:i.find(".fc-content-skeleton tbody").position().top,r.css("top",n).find("table").append(o[t].tbodyEl),i.append(r),l.push(r[0])}),this.helperEls=N(l)},destroyHelper:function(){this.helperEls&&(this.helperEls.remove(),this.helperEls=null)},fillSegTag:"td",renderFill:function(t,e){var n,i,r,s=[];for(e=this.renderFillSegEls(t,e),n=0;n<e.length;n++)i=e[n],r=this.renderFillRow(t,i),this.rowEls.eq(i.row).append(r),s.push(r[0]);return this.elsByFill[t]=N(s),e},renderFillRow:function(t,e){var n,i,r=this.colCnt,s=e.leftCol,o=e.rightCol+1;return i=(n=N('<div class="fc-'+t.toLowerCase()+'-skeleton"><table><tr/></table></div>')).find("tr"),0<s&&i.append('<td colspan="'+s+'"/>'),i.append(e.el.attr("colspan",o-s)),o<r&&i.append('<td colspan="'+(r-o)+'"/>'),this.bookendCells(i,t),n}});Gt.mixin({rowStructs:null,destroyEvents:function(){this.destroySegPopover(),Mt.prototype.destroyEvents.apply(this,arguments)},getEventSegs:function(){return Mt.prototype.getEventSegs.call(this).concat(this.popoverSegs||[])},renderBgSegs:function(t){var e=N.grep(t,function(t){return t.event.allDay});return Mt.prototype.renderBgSegs.call(this,e)},renderFgSegs:function(t){var n;return t=this.renderFgSegEls(t),n=this.rowStructs=this.renderSegRows(t),this.rowEls.each(function(t,e){N(e).find(".fc-content-skeleton > table").append(n[t].tbodyEl)}),t},destroyFgSegs:function(){for(var t,e=this.rowStructs||[];t=e.pop();)t.tbodyEl.remove();this.rowStructs=null},renderSegRows:function(t){var e,n,i=[];for(e=this.groupSegRows(t),n=0;n<e.length;n++)i.push(this.renderSegRow(n,e[n]));return i},fgSegHtml:function(t,e){var n,i=this.view,r=t.event,s=i.isEventDraggable(r),o=!e&&r.allDay&&t.isEnd&&i.isEventResizable(r),l=this.getSegClasses(t,s,o),a=this.getEventSkinCss(r),d="";return l.unshift("fc-day-grid-event"),d=r.allDay||!t.isStart&&!t.isEnd||!t.isStart&&r.hasNoEnd||!t.isEnd&&r.hasNoStart?'<span class="fc-time fc-allday">All Day</span>':!t.isEnd||t.isStart&&!r.hasNoStart||null==r.end?!t.isStart||t.isEnd&&!r.hasNoEnd?'<span class="fc-time">'+I(this.getEventTimeText(r))+"</span>":'<span class="fc-time">'+I(this.getEventTimeText({start:r.start}))+"</span>":'<span class="fc-time">Until '+I(this.getEventTimeText({start:r.end}))+"</span>",n='<span class="fc-title">'+(I(r.title||"")||"&nbsp;")+"</span>",'<a class="'+l.join(" ")+'"'+(r.url?' href="'+I(r.url)+'"':"")+(a?' style="'+a+'"':"")+'><div class="fc-content">'+(this.isRTL?n+" "+d:d+" "+n)+"</div>"+(o?'<div class="fc-resizer"/>':"")+"</a>"},renderSegRow:function(t,e){function n(t){for(;s<t;)(d=(m[i-1]||[])[s])?d.attr("rowspan",parseInt(d.attr("rowspan")||1,10)+1):(d=N("<td/>"),o.append(d)),p[i][s]=d,m[i][s]=d,s++}var i,r,s,o,l,a,d,u=this.colCnt,c=this.buildSegLevels(e),h=Math.max(1,c.length),f=N("<tbody/>"),g=[],p=[],m=[];for(i=0;i<h;i++){if(r=c[i],s=0,o=N("<tr/>"),g.push([]),p.push([]),m.push([]),r)for(l=0;l<r.length;l++){for(n((a=r[l]).leftCol),d=N('<td class="fc-event-container"/>').append(a.el),a.leftCol!=a.rightCol?d.attr("colspan",a.rightCol-a.leftCol+1):m[i][s]=d;s<=a.rightCol;)p[i][s]=d,g[i][s]=a,s++;o.append(d)}n(u),this.bookendCells(o,"eventSkeleton"),f.append(o)}return{row:t,tbodyEl:f,cellMatrix:p,segMatrix:g,segLevels:c,segs:e}},buildSegLevels:function(t){var e,n,i,r=[];for(t.sort(U),e=0;e<t.length;e++){for(n=t[e],i=0;i<r.length&&$(n,r[i]);i++);(r[n.level=i]||(r[i]=[])).push(n)}for(i=0;i<r.length;i++)r[i].sort(q);return r},groupSegRows:function(t){var e,n=[];for(e=0;e<this.rowCnt;e++)n.push([]);for(e=0;e<t.length;e++)n[t[e].row].push(t[e]);return n}}),Gt.mixin({segPopover:null,popoverSegs:null,destroySegPopover:function(){this.segPopover&&this.segPopover.hide()},limitRows:function(t){var e,n,i=this.rowStructs||[];for(e=0;e<i.length;e++)this.unlimitRow(e),!1!==(n=!!t&&("number"==typeof t?t:this.computeRowLevelLimit(e)))&&this.limitRow(e,n)},computeRowLevelLimit:function(t){var e,n,i=this.rowEls.eq(t).height(),r=this.rowStructs[t].tbodyEl.children();for(e=0;e<r.length;e++)if((n=r.eq(e).removeClass("fc-limited")).position().top+n.outerHeight()>i)return e;return!1},limitRow:function(e,n){function t(t){for(;S<t;)i=w.getCell(e,S),(d=w.getCellSegs(i,n)).length&&(h=s[n-1][S],y=w.renderMoreLink(i,d),v=N("<div/>").append(y),h.append(v),E.push(v[0])),S++}var i,r,s,o,l,a,d,u,c,h,f,g,p,m,v,y,w=this,b=this.rowStructs[e],E=[],S=0;if(n&&n<b.segLevels.length){for(r=b.segLevels[n-1],s=b.cellMatrix,o=b.tbodyEl.children().slice(n).addClass("fc-limited").get(),l=0;l<r.length;l++){for(t((a=r[l]).leftCol),c=[],u=0;S<=a.rightCol;)i=this.getCell(e,S),d=this.getCellSegs(i,n),c.push(d),u+=d.length,S++;if(u){for(f=(h=s[n-1][a.leftCol]).attr("rowspan")||1,g=[],p=0;p<c.length;p++)m=N('<td class="fc-more-cell"/>').attr("rowspan",f),d=c[p],i=this.getCell(e,a.leftCol+p),y=this.renderMoreLink(i,[a].concat(d)),v=N("<div/>").append(y),m.append(v),g.push(m[0]),E.push(m[0]);h.addClass("fc-limited").after(N(g)),o.push(h[0])}}t(this.colCnt),b.moreEls=N(E),b.limitedEls=N(o)}},unlimitRow:function(t){var e=this.rowStructs[t];e.moreEls&&(e.moreEls.remove(),e.moreEls=null),e.limitedEls&&(e.limitedEls.removeClass("fc-limited"),e.limitedEls=null)},renderMoreLink:function(a,d){var u=this,c=this.view;return N('<a class="fc-more"/>').text(this.getMoreLinkText(d.length)).on("click",function(t){var e=c.opt("eventLimitClick"),n=a.start,i=N(this),r=u.getCellDayEl(a),s=u.getCellSegs(a),o=u.resliceDaySegs(s,n),l=u.resliceDaySegs(d,n);"function"==typeof e&&(e=c.trigger("eventLimitClick",null,{date:n,dayEl:r,moreEl:i,segs:o,hiddenSegs:l},t)),"popover"===e?u.showSegPopover(a,i,o):"string"==typeof e&&c.calendar.zoomTo(n,e)})},showSegPopover:function(t,e,n){var i,r,s=this,o=this.view,l=e.parent();i=1==this.rowCnt?o.el:this.rowEls.eq(t.row),r={className:"fc-more-popover",content:this.renderSegPopoverContent(t,n),parentEl:this.el,top:i.offset().top,autoHide:!0,viewportConstrain:o.opt("popoverViewportConstrain"),hide:function(){s.segPopover.destroy(),s.segPopover=null,s.popoverSegs=null}},this.isRTL?r.right=l.offset().left+l.outerWidth()+1:r.left=l.offset().left-1,this.segPopover=new Dt(r),this.segPopover.show()},renderSegPopoverContent:function(t,e){var n,i=this.view,r=i.opt("theme"),s=t.start.format(i.opt("dayPopoverFormat")),o=N('<div class="fc-header '+i.widgetHeaderClass+'"><span class="fc-close '+(r?"ui-icon ui-icon-closethick":"fc-icon fc-icon-x")+'"></span><span class="fc-title">'+I(s)+'</span><div class="fc-clear"/></div><div class="fc-body '+i.widgetContentClass+'"><div class="fc-event-container"></div></div>'),l=o.find(".fc-event-container");for(e=this.renderFgSegEls(e,!0),this.popoverSegs=e,n=0;n<e.length;n++)e[n].cell=t,l.append(e[n].el);return o},resliceDaySegs:function(t,e){var n=N.map(t,function(t){return t.event}),i=e.clone().stripTime(),r={start:i,end:i.clone().add(1,"days")};return this.eventsToSegs(n,function(t){var e=u(t,r);return e?[e]:[]})},getMoreLinkText:function(t){var e=this.view.opt("eventLimitText");return"function"==typeof e?e(t):"+"+t+" "+e},getCellSegs:function(t,e){for(var n,i=this.rowStructs[t.row].segMatrix,r=e||0,s=[];r<i.length;)(n=i[r][t.col])&&s.push(n),r++;return s}});var Nt=Mt.extend({slotDuration:null,snapDuration:null,minTime:null,maxTime:null,axisFormat:null,dayEls:null,slatEls:null,slatTops:null,helperEl:null,businessHourSegs:null,constructor:function(){Mt.apply(this,arguments),this.processOptions()},render:function(){this.el.html(this.renderHtml()),this.dayEls=this.el.find(".fc-day"),this.slatEls=this.el.find(".fc-slats tr"),this.computeSlatTops(),this.renderBusinessHours(),Mt.prototype.render.call(this)},renderBusinessHours:function(){var t=this.view.calendar.getBusinessHoursEvents();this.businessHourSegs=this.renderFill("businessHours",this.eventsToSegs(t),"bgevent")},renderHtml:function(){return'<div class="fc-bg"><table>'+this.rowHtml("slotBg")+'</table></div><div class="fc-slats"><table>'+this.slatRowHtml()+"</table></div>"},slotBgCellHtml:function(t){return this.bgCellHtml(t)},slatRowHtml:function(){for(var t,e,n,i=this.view,r=this.isRTL,s="",o=this.slotDuration.asMinutes()%15==0,l=F.duration(+this.minTime);l<this.maxTime;)e=(t=this.start.clone().time(l)).minutes(),n='<td class="fc-axis fc-time '+i.widgetContentClass+'" '+i.axisStyleAttr()+">"+(o&&e?"":"<span>"+I(t.format(this.axisFormat))+"</span>")+"</td>",s+="<tr "+(e?'class="fc-minor"':"")+">"+(r?"":n)+'<td class="'+i.widgetContentClass+'"/>'+(r?n:"")+"</tr>",l.add(this.slotDuration);return s},processOptions:function(){var t=this.view,e=t.opt("slotDuration"),n=t.opt("snapDuration");e=F.duration(e),n=n?F.duration(n):e,this.slotDuration=e,this.snapDuration=n,this.minTime=F.duration(t.opt("minTime")),this.maxTime=F.duration(t.opt("maxTime")),this.axisFormat=t.opt("axisFormat")||t.opt("smallTimeFormat")},computeColHeadFormat:function(){return 1<this.colCnt?this.view.opt("dayOfMonthFormat"):"dddd"},computeEventTimeFormat:function(){return this.view.opt("noMeridiemTimeFormat")},computeDisplayEventEnd:function(){return!0},updateCells:function(){var t,e=this.view,n=[];for(t=this.start.clone();t.isBefore(this.end);)n.push({day:t.clone()}),t.add(1,"day"),t=e.skipHiddenDays(t);this.isRTL&&n.reverse(),this.colData=n,this.colCnt=n.length,this.rowCnt=Math.ceil((this.maxTime-this.minTime)/this.snapDuration)},computeCellRange:function(t){var e=this.computeSnapTime(t.row),n=this.view.calendar.rezoneDate(t.day).time(e);return{start:n,end:n.clone().add(this.snapDuration)}},getColEl:function(t){return this.dayEls.eq(t)},computeSnapTime:function(t){return F.duration(this.minTime+this.snapDuration*t)},rangeToSegs:function(t){var e,n,i,r=this.colCnt,s=[];for(t={start:t.start.clone().stripZone(),end:t.end.clone().stripZone()},n=0;n<r;n++)(e=u(t,{start:(i=this.colData[n].day).clone().time(this.minTime),end:i.clone().time(this.maxTime)}))&&(e.col=n,s.push(e));return s},resize:function(){this.computeSlatTops(),this.updateSegVerticals()},computeRowCoords:function(){var t,e,n=this.el.offset().top,i=[];for(t=0;t<this.rowCnt;t++)e={top:n+this.computeTimeTop(this.computeSnapTime(t))},0<t&&(i[t-1].bottom=e.top),i.push(e);return e.bottom=e.top+this.computeTimeTop(this.computeSnapTime(t)),i},computeDateTop:function(t,e){return this.computeTimeTop(F.duration(t.clone().stripZone()-e.clone().stripTime()))},computeTimeTop:function(t){var e,n,i,r=(t-this.minTime)/this.slotDuration;return r=Math.max(0,r),n=(r=Math.min(this.slatEls.length,r))-(e=Math.floor(r)),i=this.slatTops[e],n?i+(this.slatTops[e+1]-i)*n:i},computeSlatTops:function(){var n,i=[];this.slatEls.each(function(t,e){n=N(e).position().top,i.push(n)}),i.push(n+this.slatEls.last().outerHeight()),this.slatTops=i},renderDrag:function(t,e){var n;if(e)return this.renderRangeHelper(t,e),void 0!==(n=this.view.opt("dragOpacity"))&&this.helperEl.css("opacity",n),!0;this.renderHighlight(this.view.calendar.ensureVisibleEventRange(t))},destroyDrag:function(){this.destroyHelper(),this.destroyHighlight()},renderEventResize:function(t,e){this.renderRangeHelper(t,e)},destroyEventResize:function(){this.destroyHelper()},renderHelper:function(t,e){var n,i,r,s,o=this.eventsToSegs([t]);for(o=this.renderFgSegEls(o),n=this.renderSegTable(o),i=0;i<o.length;i++)r=o[i],e&&e.col===r.col&&(s=e.el,r.el.css({left:s.css("left"),right:s.css("right"),"margin-left":s.css("margin-left"),"margin-right":s.css("margin-right")}));this.helperEl=N('<div class="fc-helper-skeleton"/>').append(n).appendTo(this.el)},destroyHelper:function(){this.helperEl&&(this.helperEl.remove(),this.helperEl=null)},renderSelection:function(t){this.view.opt("selectHelper")?this.renderRangeHelper(t):this.renderHighlight(t)},destroySelection:function(){this.destroyHelper(),this.destroyHighlight()},renderFill:function(t,e,n){var i,r,s,o,l,a,d,u,c,h;if(e.length){for(e=this.renderFillSegEls(t,e),i=this.groupSegCols(e),n=n||t.toLowerCase(),s=(r=N('<div class="fc-'+n+'-skeleton"><table><tr/></table></div>')).find("tr"),o=0;o<i.length;o++)if(l=i[o],a=N("<td/>").appendTo(s),l.length)for(d=N('<div class="fc-'+n+'-container"/>').appendTo(a),u=this.colData[o].day,c=0;c<l.length;c++)h=l[c],d.append(h.el.css({top:this.computeDateTop(h.start,u),bottom:-this.computeDateTop(h.end,u)}));this.bookendCells(s,t),this.el.append(r),this.elsByFill[t]=r}return e}});Nt.mixin({eventSkeletonEl:null,renderFgSegs:function(t){return t=this.renderFgSegEls(t),this.el.append(this.eventSkeletonEl=N('<div class="fc-content-skeleton"/>').append(this.renderSegTable(t))),t},destroyFgSegs:function(t){this.eventSkeletonEl&&(this.eventSkeletonEl.remove(),this.eventSkeletonEl=null)},renderSegTable:function(t){var e,n,i,r,s,o,l=N("<table><tr/></table>"),a=l.find("tr");for(e=this.groupSegCols(t),this.computeSegVerticals(t),r=0;r<e.length;r++){for(K(s=e[r]),o=N('<div class="fc-event-container"/>'),n=0;n<s.length;n++)(i=s[n]).el.css(this.generateSegPositionCss(i)),i.bottom-i.top<30&&i.el.addClass("fc-short"),o.append(i.el);a.append(N("<td/>").append(o))}return this.bookendCells(a,"eventSkeleton"),l},updateSegVerticals:function(){var t,e=(this.segs||[]).concat(this.businessHourSegs||[]);for(this.computeSegVerticals(e),t=0;t<e.length;t++)e[t].el.css(this.generateSegVerticalCss(e[t]))},computeSegVerticals:function(t){var e,n;for(e=0;e<t.length;e++)(n=t[e]).top=this.computeDateTop(n.start,n.start),n.bottom=this.computeDateTop(n.end,n.start)},fgSegHtml:function(t,e){var n,i,r,s=this.view,o=t.event,l=s.isEventDraggable(o),a=!e&&t.isEnd&&s.isEventResizable(o),d=this.getSegClasses(t,l,a),u=this.getEventSkinCss(o);return d.unshift("fc-time-grid-event"),s.isMultiDayEvent(o)?(t.isStart||t.isEnd)&&(n=this.getEventTimeText(t),i=this.getEventTimeText(t,"LT"),r=this.getEventTimeText({start:t.start})):(n=this.getEventTimeText(o),i=this.getEventTimeText(o,"LT"),r=this.getEventTimeText({start:o.start})),'<a class="'+d.join(" ")+'"'+(o.url?' href="'+I(o.url)+'"':"")+(u?' style="'+u+'"':"")+'><div class="fc-content">'+(n?'<div class="fc-time" data-start="'+I(r)+'" data-full="'+I(i)+'"><span>'+I(n)+"</span></div>":"")+(o.title?'<div class="fc-title">'+I(o.title)+"</div>":"")+'</div><div class="fc-bg"/>'+(a?'<div class="fc-resizer"/>':"")+"</a>"},generateSegPositionCss:function(t){var e,n,i=this.view.opt("slotEventOverlap"),r=t.backwardCoord,s=t.forwardCoord,o=this.generateSegVerticalCss(t);return i&&(s=Math.min(1,r+2*(s-r))),this.isRTL?(e=1-s,n=r):(e=r,n=1-s),o.zIndex=t.level+1,o.left=100*e+"%",o.right=100*n+"%",i&&t.forwardPressure&&(o[this.isRTL?"marginLeft":"marginRight"]=20),o},generateSegVerticalCss:function(t){return{top:t.top,bottom:-t.bottom}},groupSegCols:function(t){var e,n=[];for(e=0;e<this.colCnt;e++)n.push([]);for(e=0;e<t.length;e++)n[t[e].col].push(t[e]);return n}});var Ft=ot.View=k.extend({type:null,name:null,title:null,calendar:null,options:null,coordMap:null,el:null,start:null,end:null,intervalStart:null,intervalEnd:null,intervalDuration:null,intervalUnit:null,isSelected:!1,scrollerEl:null,scrollTop:null,widgetHeaderClass:null,widgetContentClass:null,highlightStateClass:null,nextDayThreshold:null,isHiddenDayHash:null,documentMousedownProxy:null,constructor:function(t,e,n){this.calendar=t,this.options=e,this.type=this.name=n,this.nextDayThreshold=F.duration(this.opt("nextDayThreshold")),this.initTheming(),this.initHiddenDays(),this.documentMousedownProxy=N.proxy(this,"documentMousedown"),this.initialize()},initialize:function(){},opt:function(t){var e;return void 0!==(e=this.options[t])?e:(e=this.calendar.options[t],N.isPlainObject(e)&&!i(t)?_(e,this.type):e)},trigger:function(t,e){var n=this.calendar;return n.trigger.apply(n,[t,e||this].concat(Array.prototype.slice.call(arguments,2),[this]))},setDate:function(t){this.setRange(this.computeRange(t))},setRange:function(t){N.extend(this,t)},computeRange:function(t){var e,n,i=F.duration(this.opt("duration")||this.constructor.duration||{days:1}),r=P(i),s=t.clone().startOf(r),o=s.clone().add(i);return A("days",i)?(s.stripTime(),o.stripTime()):(s.hasTime()||(s=this.calendar.rezoneDate(s)),o.hasTime()||(o=this.calendar.rezoneDate(o))),e=s.clone(),e=this.skipHiddenDays(e),n=o.clone(),{intervalDuration:i,intervalUnit:r,intervalStart:s,intervalEnd:o,start:e,end:n=this.skipHiddenDays(n,-1,!0)}},computePrevDate:function(t){return this.massageCurrentDate(t.clone().startOf(this.intervalUnit).subtract(this.intervalDuration),-1)},computeNextDate:function(t){return this.massageCurrentDate(t.clone().startOf(this.intervalUnit).add(this.intervalDuration))},massageCurrentDate:function(t,e){return this.intervalDuration<=F.duration({days:1})&&this.isHiddenDay(t)&&(t=this.skipHiddenDays(t,e)).startOf("day"),t},updateTitle:function(){this.title=this.computeTitle()},computeTitle:function(){return 1==this.intervalDuration.as("months")&&(this.intervalEnd=this.intervalStart),this.formatRange({start:this.intervalStart,end:this.intervalEnd},this.opt("titleFormat")||this.computeTitleFormat(),this.opt("titleRangeSeparator"))},computeTitleFormat:function(){return"year"==this.intervalUnit?"YYYY":"month"==this.intervalUnit||1==this.intervalDuration.as("months")?this.opt("monthYearFormat"):1<this.intervalDuration.as("days")?"ll":"LL"},formatRange:function(t,e,n){var i=t.end;return i.hasTime()||(i=i.clone().subtract(1)),x(t.start,i,e,n,this.opt("isRTL"))},renderView:function(){this.render(),this.updateSize(),this.initializeScroll(),this.trigger("viewRender",this,this,this.el),N(document).on("mousedown",this.documentMousedownProxy)},render:function(){},destroyView:function(){this.unselect(),this.destroyViewEvents(),this.destroy(),this.trigger("viewDestroy",this,this,this.el),N(document).off("mousedown",this.documentMousedownProxy)},destroy:function(){this.el.empty()},initTheming:function(){var t=this.opt("theme")?"ui":"fc";this.widgetHeaderClass=t+"-widget-header",this.widgetContentClass=t+"-widget-content",this.highlightStateClass=t+"-state-highlight"},updateSize:function(t){t&&this.recordScroll(),this.updateHeight(),this.updateWidth()},updateWidth:function(){},updateHeight:function(){var t=this.calendar;this.setHeight(t.getSuggestedViewHeight(),t.isHeightAuto())},setHeight:function(t,e){},computeScrollerHeight:function(t,e){var n,i;return e=e||this.scrollerEl,(n=this.el.add(e)).css({position:"relative",left:-1}),i=this.el.outerHeight()-e.height(),n.css({position:"",left:""}),t-i},initializeScroll:function(){},recordScroll:function(){this.scrollerEl&&(this.scrollTop=this.scrollerEl.scrollTop())},restoreScroll:function(){null!==this.scrollTop&&this.scrollerEl.scrollTop(this.scrollTop)},renderViewEvents:function(t){this.renderEvents(t),this.eventSegEach(function(t){this.trigger("eventAfterRender",t.event,t.event,t.el)}),this.trigger("eventAfterAllRender")},renderEvents:function(){},destroyViewEvents:function(){this.eventSegEach(function(t){this.trigger("eventDestroy",t.event,t.event,t.el)}),this.destroyEvents()},destroyEvents:function(){},resolveEventEl:function(t,e){var n=this.trigger("eventRender",t,t,e);return!1===n?e=null:n&&!0!==n&&(e=N(n)),e},showEvent:function(t){this.eventSegEach(function(t){t.el.css("visibility","")},t)},hideEvent:function(t){this.eventSegEach(function(t){t.el.css("visibility","hidden")},t)},eventSegEach:function(t,e){var n,i=this.getEventSegs();for(n=0;n<i.length;n++)e&&i[n].event._id!==e._id||t.call(this,i[n])},getEventSegs:function(){return[]},isEventDraggable:function(t){var e=t.source||{};return W(t.startEditable,e.startEditable,this.opt("eventStartEditable"),t.editable,e.editable,this.opt("editable"))},reportEventDrop:function(t,e,n,i){var r=this.calendar,s=r.mutateEvent(t,e);this.triggerEventDrop(t,s.dateDelta,function(){s.undo(),r.reportEventChange()},n,i),r.reportEventChange()},triggerEventDrop:function(t,e,n,i,r){this.trigger("eventDrop",i[0],t,e,n,r,{})},reportExternalDrop:function(t,e,n,i,r){var s,o,l=t.eventProps;l&&(s=N.extend({},l,e),o=this.calendar.renderEvent(s,t.stick)[0]),this.triggerExternalDrop(o,e,n,i,r)},triggerExternalDrop:function(t,e,n,i,r){this.trigger("drop",n[0],e.start,i,r),t&&this.trigger("eventReceive",null,t)},renderDrag:function(t,e){},destroyDrag:function(){},isEventResizable:function(t){var e=t.source||{};return W(t.durationEditable,e.durationEditable,this.opt("eventDurationEditable"),t.editable,e.editable,this.opt("editable"))},reportEventResize:function(t,e,n,i){var r=this.calendar,s=r.mutateEvent(t,{end:e});this.triggerEventResize(t,s.durationDelta,function(){s.undo(),r.reportEventChange()},n,i),r.reportEventChange()},triggerEventResize:function(t,e,n,i,r){this.trigger("eventResize",i[0],t,e,n,r,{})},select:function(t,e){this.unselect(e),this.renderSelection(t),this.reportSelection(t,e)},renderSelection:function(t){},reportSelection:function(t,e){this.isSelected=!0,this.trigger("select",null,t.start,t.end,e)},unselect:function(t){this.isSelected&&(this.isSelected=!1,this.destroySelection(),this.trigger("unselect",null,t))},destroySelection:function(){},documentMousedown:function(t){var e;this.isSelected&&this.opt("unselectAuto")&&d(t)&&((e=this.opt("unselectCancel"))&&N(t.target).closest(e).length||this.unselect(t))},initHiddenDays:function(){var t,e=this.opt("hiddenDays")||[],n=[],i=0;for(!1===this.opt("weekends")&&e.push(0,6),t=0;t<7;t++)(n[t]=-1!==N.inArray(t,e))||i++;if(!i)throw"invalid hiddenDays";this.isHiddenDayHash=n},isHiddenDay:function(t){return F.isMoment(t)&&(t=t.day()),this.isHiddenDayHash[t]},skipHiddenDays:function(t,e,n){var i=t.clone();for(e=e||1;this.isHiddenDayHash[(i.day()+(n?e:0)+7)%7];)i.add(e,"days");return i},computeDayRange:function(t){var e,n=t.start.clone().stripTime(),i=t.end,r=null;return i&&(r=i.clone().stripTime(),(e=+i.time())&&e>=this.nextDayThreshold&&r.add(1,"days")),(!i||r<=n)&&(r=n.clone().add(1,"days")),{start:n,end:r}},isMultiDayEvent:function(t){var e=this.computeDayRange(t);return 1<e.end.diff(e.start,"days")}});ot.sourceNormalizers=[];var Vt={dataType:"json",cache:!(ot.sourceFetchers=[])},Lt=1,_t=lt.basic=Ft.extend({dayGrid:null,dayNumbersVisible:!1,weekNumbersVisible:!1,weekNumberWidth:null,headRowEl:null,initialize:function(){this.dayGrid=new Gt(this),this.coordMap=this.dayGrid.coordMap},setRange:function(t){Ft.prototype.setRange.call(this,t),this.dayGrid.breakOnWeeks=/year|month|week/.test(this.intervalUnit),this.dayGrid.setRange(t)},computeRange:function(t){var e=Ft.prototype.computeRange.call(this,t);return/year|month/.test(e.intervalUnit)&&(e.start.startOf("week"),e.start=this.skipHiddenDays(e.start),e.end.weekday()&&(e.end.add(1,"week").startOf("week"),e.end=this.skipHiddenDays(e.end,-1,!0))),e},render:function(){this.dayNumbersVisible=1<this.dayGrid.rowCnt,this.weekNumbersVisible=this.opt("weekNumbers"),this.dayGrid.numbersVisible=this.dayNumbersVisible||this.weekNumbersVisible,this.el.addClass("fc-basic-view").html(this.renderHtml()),this.headRowEl=this.el.find("thead .fc-row"),this.scrollerEl=this.el.find(".fc-day-grid-container"),this.dayGrid.coordMap.containerEl=this.scrollerEl,this.dayGrid.el=this.el.find(".fc-day-grid"),this.dayGrid.render(this.hasRigidRows())},destroy:function(){this.dayGrid.destroy(),Ft.prototype.destroy.call(this)},renderHtml:function(){return'<table><thead><tr><td class="'+this.widgetHeaderClass+'">'+this.dayGrid.headHtml()+'</td></tr></thead><tbody><tr><td class="'+this.widgetContentClass+'"><div class="fc-day-grid-container"><div class="fc-day-grid"/></div></td></tr></tbody></table>'},headIntroHtml:function(){if(this.weekNumbersVisible)return'<th class="fc-week-number '+this.widgetHeaderClass+'" '+this.weekNumberStyleAttr()+"><span>"+I(this.opt("weekNumberTitle"))+"</span></th>"},numberIntroHtml:function(t){if(this.weekNumbersVisible)return'<td class="fc-week-number" '+this.weekNumberStyleAttr()+"><span>"+this.calendar.calculateWeekNumber(this.dayGrid.getCell(t,0).start)+"</span></td>"},dayIntroHtml:function(){if(this.weekNumbersVisible)return'<td class="fc-week-number '+this.widgetContentClass+'" '+this.weekNumberStyleAttr()+"></td>"},introHtml:function(){if(this.weekNumbersVisible)return'<td class="fc-week-number" '+this.weekNumberStyleAttr()+"></td>"},numberCellHtml:function(t){var e,n=t.start;return this.dayNumbersVisible?((e=this.dayGrid.getDayClasses(n)).unshift("fc-day-number"),'<td class="'+e.join(" ")+'" data-date="'+n.format()+'">'+n.date()+"</td>"):"<td/>"},weekNumberStyleAttr:function(){return null!==this.weekNumberWidth?'style="width:'+this.weekNumberWidth+'px"':""},hasRigidRows:function(){var t=this.opt("eventLimit");return t&&"number"!=typeof t},updateWidth:function(){this.weekNumbersVisible&&(this.weekNumberWidth=e(this.el.find(".fc-week-number")))},setHeight:function(t,e){var n,i=this.opt("eventLimit");l(this.scrollerEl),s(this.headRowEl),this.dayGrid.destroySegPopover(),i&&"number"==typeof i&&this.dayGrid.limitRows(i),n=this.computeScrollerHeight(t),this.setGridHeight(n,e),i&&"number"!=typeof i&&this.dayGrid.limitRows(i),!e&&o(this.scrollerEl,n)&&(r(this.headRowEl,a(this.scrollerEl)),n=this.computeScrollerHeight(t),this.scrollerEl.height(n),this.restoreScroll())},setGridHeight:function(t,e){e?c(this.dayGrid.rowEls):n(this.dayGrid.rowEls,t,!0)},renderEvents:function(t){this.dayGrid.renderEvents(t),this.updateHeight()},getEventSegs:function(){return this.dayGrid.getEventSegs()},destroyEvents:function(){this.recordScroll(),this.dayGrid.destroyEvents()},renderDrag:function(t,e){return this.dayGrid.renderDrag(t,e)},destroyDrag:function(){this.dayGrid.destroyDrag()},renderSelection:function(t){this.dayGrid.renderSelection(t)},destroySelection:function(){this.dayGrid.destroySelection()}});t({fixedWeekCount:!0}),(lt.month=_t.extend({computeRange:function(t){var e,n=_t.prototype.computeRange.call(this,t);return this.isFixedWeeks()&&(e=Math.ceil(n.end.diff(n.start,"weeks",!0)),n.end.add(6-e,"weeks")),n},setGridHeight:function(t,e){(e=e||"variable"===this.opt("weekMode"))&&(t*=this.rowCnt/6),n(this.dayGrid.rowEls,t,!e)},isFixedWeeks:function(){var t=this.opt("weekMode");return t?"fixed"===t:this.opt("fixedWeekCount")}})).duration={months:1},lt.basicWeek={type:"basic",duration:{weeks:1}},lt.basicDay={type:"basic",duration:{days:1}};lt.list=Ft.extend({dayGrid:null,dayNumbersVisible:!1,weekNumbersVisible:!1,weekNumberWidth:null,headRowEl:null,initialize:function(){this.dayGrid=new Gt(this),this.coordMap=this.dayGrid.coordMap},setRange:function(t){Ft.prototype.setRange.call(this,t),this.dayGrid.breakOnDays=!0,this.dayGrid.setRange(t)},computeRange:function(t){var e=Ft.prototype.computeRange.call(this,t);return e.intervalUnit="days",e},render:function(){this.dayNumbersVisible=1<this.dayGrid.rowCnt,this.weekNumbersVisible=this.opt("weekNumbers"),this.dayGrid.numbersVisible=this.dayNumbersVisible||this.weekNumbersVisible,this.el.addClass("fc-list-view").html(this.renderHtml()),this.headRowEl=this.el.find("thead .fc-row"),this.scrollerEl=this.el.find(".fc-day-grid-container"),this.dayGrid.coordMap.containerEl=this.scrollerEl,this.dayGrid.el=this.el.find(".fc-day-grid"),this.dayGrid.render(this.hasRigidRows())},destroy:function(){this.dayGrid.destroy(),Ft.prototype.destroy.call(this)},renderHtml:function(){return'<table><tbody><tr><td class="'+this.widgetContentClass+'"><div class="fc-day-grid-container"><div class="fc-day-grid"/></div></td></tr></tbody></table>'},headIntroHtml:function(){if(this.weekNumbersVisible)return'<th class="fc-week-number '+this.widgetHeaderClass+'" '+this.weekNumberStyleAttr()+"><span>"+I(this.opt("weekNumberTitle"))+"</span></th>"},numberIntroHtml:function(t){if(this.weekNumbersVisible)return'<td class="fc-week-number" '+this.weekNumberStyleAttr()+"><span>"+this.calendar.calculateWeekNumber(this.dayGrid.getCell(t,0).start)+"</span></td>"},dayIntroHtml:function(){if(this.weekNumbersVisible)return'<td class="fc-week-number '+this.widgetContentClass+'" '+this.weekNumberStyleAttr()+"></td>"},introHtml:function(){if(this.weekNumbersVisible)return'<td class="fc-week-number" '+this.weekNumberStyleAttr()+"></td>"},numberCellHtml:function(t){var e,n=t.start;return this.dayNumbersVisible?((e=this.dayGrid.getDayClasses(n)).unshift("fc-day-number"),'<td class="'+e.join(" ")+'" data-date="'+n.format()+'"><div class="fc-day-wrapper"><a class="ui_anchor" name="'+n.format()+'"></a><span class="fc-day-name">'+n.format("dddd")+'</span><span class="fc-day-date">'+n.format("Do MMMM")+"</span></div></td>"):"<td/>"},weekNumberStyleAttr:function(){return null!==this.weekNumberWidth?'style="width:'+this.weekNumberWidth+'px"':""},hasRigidRows:function(){var t=this.opt("eventLimit");return t&&"number"!=typeof t},updateWidth:function(){this.weekNumbersVisible&&(this.weekNumberWidth=e(this.el.find(".fc-week-number")))},setHeight:function(t,e){var n,i=this.opt("eventLimit");l(this.scrollerEl),s(this.headRowEl),this.dayGrid.destroySegPopover(),i&&"number"==typeof i&&this.dayGrid.limitRows(i),n=this.computeScrollerHeight(t),this.setGridHeight(n,e),i&&"number"!=typeof i&&this.dayGrid.limitRows(i),!e&&o(this.scrollerEl,n)&&(r(this.headRowEl,a(this.scrollerEl)),n=this.computeScrollerHeight(t),this.scrollerEl.height(n),this.restoreScroll())},setGridHeight:function(t,e){e?c(this.dayGrid.rowEls):n(this.dayGrid.rowEls,t,!0)},renderEvents:function(t){this.dayGrid.renderEvents(t),this.updateHeight()},getEventSegs:function(){return this.dayGrid.getEventSegs()},destroyEvents:function(){this.recordScroll(),this.dayGrid.destroyEvents()},renderDrag:function(t,e){return this.dayGrid.renderDrag(t,e)},destroyDrag:function(){this.dayGrid.destroyDrag()},renderSelection:function(t){this.dayGrid.renderSelection(t)},destroySelection:function(){this.dayGrid.destroySelection()}});lt.listMonth={type:"list",duration:{months:1}},lt.listWeek={type:"list",duration:{weeks:1}},lt.listDay={type:"list",duration:{days:1}},t({allDaySlot:!0,allDayText:"all-day",scrollTime:"06:00:00",slotDuration:"00:30:00",minTime:"00:00:00",maxTime:"24:00:00",slotEventOverlap:!0});lt.agenda=Ft.extend({timeGrid:null,dayGrid:null,axisWidth:null,noScrollRowEls:null,bottomRuleEl:null,bottomRuleHeight:null,initialize:function(){this.timeGrid=new Nt(this),this.opt("allDaySlot")?(this.dayGrid=new Gt(this),this.coordMap=new xt([this.dayGrid.coordMap,this.timeGrid.coordMap])):this.coordMap=this.timeGrid.coordMap},setRange:function(t){Ft.prototype.setRange.call(this,t),this.timeGrid.setRange(t),this.dayGrid&&this.dayGrid.setRange(t)},render:function(){this.el.addClass("fc-agenda-view").html(this.renderHtml()),this.scrollerEl=this.el.find(".fc-time-grid-container"),this.timeGrid.coordMap.containerEl=this.scrollerEl,this.timeGrid.el=this.el.find(".fc-time-grid"),this.timeGrid.render(),this.bottomRuleEl=N('<hr class="'+this.widgetHeaderClass+'"/>').appendTo(this.timeGrid.el),this.dayGrid&&(this.dayGrid.el=this.el.find(".fc-day-grid"),this.dayGrid.render(),this.dayGrid.bottomCoordPadding=this.dayGrid.el.next("hr").outerHeight()),this.noScrollRowEls=this.el.find(".fc-row:not(.fc-scroller *)")},destroy:function(){this.timeGrid.destroy(),this.dayGrid&&this.dayGrid.destroy(),Ft.prototype.destroy.call(this)},renderHtml:function(){return'<table><thead><tr><td class="'+this.widgetHeaderClass+'">'+this.timeGrid.headHtml()+'</td></tr></thead><tbody><tr><td class="'+this.widgetContentClass+'">'+(this.dayGrid?'<div class="fc-day-grid"/><hr class="'+this.widgetHeaderClass+'"/>':"")+'<div class="fc-time-grid-container"><div class="fc-time-grid"/></div></td></tr></tbody></table>'},headIntroHtml:function(){var t,e,n,i;return this.opt("weekNumbers")?(t=this.timeGrid.getCell(0).start,e=this.calendar.calculateWeekNumber(t),n=this.opt("weekNumberTitle"),i=this.opt("isRTL")?e+n:n+e,'<th class="fc-axis fc-week-number '+this.widgetHeaderClass+'" '+this.axisStyleAttr()+"><span>"+I(i)+"</span></th>"):'<th class="fc-axis '+this.widgetHeaderClass+'" '+this.axisStyleAttr()+"></th>"},dayIntroHtml:function(){return'<td class="fc-axis '+this.widgetContentClass+'" '+this.axisStyleAttr()+"><span>"+(this.opt("allDayHtml")||I(this.opt("allDayText")))+"</span></td>"},slotBgIntroHtml:function(){return'<td class="fc-axis '+this.widgetContentClass+'" '+this.axisStyleAttr()+"></td>"},introHtml:function(){return'<td class="fc-axis" '+this.axisStyleAttr()+"></td>"},axisStyleAttr:function(){return null!==this.axisWidth?'style="width:'+this.axisWidth+'px"':""},updateSize:function(t){t&&this.timeGrid.resize(),Ft.prototype.updateSize.call(this,t)},updateWidth:function(){this.axisWidth=e(this.el.find(".fc-axis"))},setHeight:function(t,e){var n,i;null===this.bottomRuleHeight&&(this.bottomRuleHeight=this.bottomRuleEl.outerHeight()),this.bottomRuleEl.hide(),this.scrollerEl.css("overflow",""),l(this.scrollerEl),s(this.noScrollRowEls),this.dayGrid&&(this.dayGrid.destroySegPopover(),(n=this.opt("eventLimit"))&&"number"!=typeof n&&(n=5),n&&this.dayGrid.limitRows(n)),e||(i=this.computeScrollerHeight(t),o(this.scrollerEl,i)?(r(this.noScrollRowEls,a(this.scrollerEl)),i=this.computeScrollerHeight(t),this.scrollerEl.height(i),this.restoreScroll()):(this.scrollerEl.height(i).css("overflow","hidden"),this.bottomRuleEl.show()))},initializeScroll:function(){function t(){e.scrollerEl.scrollTop(i)}var e=this,n=F.duration(this.opt("scrollTime")),i=this.timeGrid.computeTimeTop(n);(i=Math.ceil(i))&&i++,t(),setTimeout(t,0)},renderEvents:function(t){var e,n=[],i=[];for(e=0;e<t.length;e++)t[e].allDay?n.push(t[e]):i.push(t[e]);this.timeGrid.renderEvents(i),this.dayGrid&&this.dayGrid.renderEvents(n),this.updateHeight()},getEventSegs:function(){return this.timeGrid.getEventSegs().concat(this.dayGrid?this.dayGrid.getEventSegs():[])},destroyEvents:function(){this.recordScroll(),this.timeGrid.destroyEvents(),this.dayGrid&&this.dayGrid.destroyEvents()},renderDrag:function(t,e){return t.start.hasTime()?this.timeGrid.renderDrag(t,e):this.dayGrid?this.dayGrid.renderDrag(t,e):void 0},destroyDrag:function(){this.timeGrid.destroyDrag(),this.dayGrid&&this.dayGrid.destroyDrag()},renderSelection:function(t){t.start.hasTime()||t.end.hasTime()?this.timeGrid.renderSelection(t):this.dayGrid&&this.dayGrid.renderSelection(t)},destroySelection:function(){this.timeGrid.destroySelection(),this.dayGrid&&this.dayGrid.destroySelection()}}),lt.agendaWeek={type:"agenda",duration:{weeks:1}},lt.agendaDay={type:"agenda",duration:{days:1}}});