fullcalendar.min.js
72.1 KB
/*!
* FullCalendar v2.1.1
* Docs & License: http://arshaw.com/fullcalendar/
* (c) 2013 Adam Shaw
*/
!function(a){"function"==typeof define&&define.amd?define(["jquery","moment"],a):a(jQuery,moment)}(function(a,b){function c(a,b){return b.longDateFormat("LT").replace(":mm","(:mm)").replace(/(\Wmm)$/,"($1)").replace(/\s*a$/i,"t")}function d(a,b){var c=b.longDateFormat("L");return c=c.replace(/^Y+[^\w\s]*|[^\w\s]*Y+$/g,""),a.isRTL?c+=" ddd":c="ddd "+c,c}function e(a){f(xb,a)}function f(b){function c(c,d){a.isPlainObject(d)&&a.isPlainObject(b[c])&&!g(c)?b[c]=f({},b[c],d):void 0!==d&&(b[c]=d)}for(var d=1;d<arguments.length;d++)a.each(arguments[d],c);return b}function g(a){return/(Time|Duration)$/.test(a)}function h(c,d){function e(a){var c=b.localeData||b.langData;return c.call(b,a)||c.call(b,"en")}function g(a){cb?l()&&(p(),n(a)):h()}function h(){db=Z.theme?"ui":"fc",c.addClass("fc"),c.addClass(Z.isRTL?"fc-rtl":"fc-ltr"),c.addClass(Z.theme?"ui-widget":"fc-unthemed"),cb=a("<div class='fc-view-container'/>").prependTo(c),ab=new i(X,Z),bb=ab.render(),bb&&c.prepend(bb),m(Z.defaultView),Z.handleWindowResize&&(gb=H(r,Z.windowResizeDelay),a(window).resize(gb))}function k(){eb&&eb.destroy(),ab.destroy(),cb.remove(),c.removeClass("fc fc-ltr fc-rtl fc-unthemed ui-widget"),a(window).unbind("resize",gb)}function l(){return c.is(":visible")}function m(a){n(0,a)}function n(b,c){lb++,eb&&c&&eb.name!==c&&(ab.deactivateButton(eb.name),R(),eb.start&&eb.destroy(),eb.el.remove(),eb=null),!eb&&c&&(eb=new Bb[c](X),eb.el=a("<div class='fc-view fc-"+c+"-view' />").appendTo(cb),ab.activateButton(c)),eb&&(b&&(hb=eb.incrementDate(hb,b)),eb.start&&!b&&hb.isWithin(eb.intervalStart,eb.intervalEnd)||l()&&(R(),eb.start&&eb.destroy(),eb.render(hb),S(),z(),B(),v())),S(),lb--}function o(a){return l()?(a&&q(),lb++,eb.updateSize(!0),lb--,!0):void 0}function p(){l()&&q()}function q(){fb="number"==typeof Z.contentHeight?Z.contentHeight:"number"==typeof Z.height?Z.height-(bb?bb.outerHeight(!0):0):Math.round(cb.width()/Math.max(Z.aspectRatio,.5))}function r(a){!lb&&a.target===window&&eb.start&&o(!0)&&eb.trigger("windowResize",kb)}function s(){u(),w()}function t(){l()&&(R(),eb.destroyEvents(),eb.renderEvents(mb),S())}function u(){R(),eb.destroyEvents(),S()}function v(){!Z.lazyFetching||ib(eb.start,eb.end)?w():t()}function w(){jb(eb.start,eb.end)}function x(a){mb=a,t()}function y(){t()}function z(){ab.updateTitle(eb.title)}function B(){var a=X.getNow();a.isWithin(eb.intervalStart,eb.intervalEnd)?ab.disableButton("today"):ab.enableButton("today")}function C(a,b){a=X.moment(a),b=b?X.moment(b):a.clone().add(a.hasTime()?X.defaultTimedEventDuration:X.defaultAllDayEventDuration),eb.select(a,b)}function D(){eb&&eb.unselect()}function E(){n(-1)}function F(){n(1)}function I(){hb.add(-1,"years"),n()}function J(){hb.add(1,"years"),n()}function K(){hb=X.getNow(),n()}function L(a){hb=X.moment(a),n()}function N(a){hb.add(b.duration(a)),n()}function O(a,b){var c,d;b&&void 0!==Bb[b]||(b=b||"day",c=ab.getViewsWithButtons().join(" "),d=c.match(new RegExp("\\w+"+G(b))),d||(d=c.match(/\w+Day/)),b=d?d[0]:"agendaDay"),hb=a,m(b)}function Q(){return hb.clone()}function R(){cb.css({width:"100%",height:cb.height(),overflow:"hidden"})}function S(){cb.css({width:"",height:"",overflow:""})}function T(){return X}function U(){return eb}function V(a,b){return void 0===b?Z[a]:void(("height"==a||"contentHeight"==a||"aspectRatio"==a)&&(Z[a]=b,o(!0)))}function W(a,b){return Z[a]?Z[a].apply(b||kb,Array.prototype.slice.call(arguments,2)):void 0}var X=this;d=d||{};var Y,Z=f({},xb,d);Y=Z.lang in yb?yb[Z.lang]:yb[xb.lang],Y&&(Z=f({},xb,Y,d)),Z.isRTL&&(Z=f({},xb,zb,Y||{},d)),X.options=Z,X.render=g,X.destroy=k,X.refetchEvents=s,X.reportEvents=x,X.reportEventChange=y,X.rerenderEvents=t,X.changeView=m,X.select=C,X.unselect=D,X.prev=E,X.next=F,X.prevYear=I,X.nextYear=J,X.today=K,X.gotoDate=L,X.incrementDate=N,X.zoomTo=O,X.getDate=Q,X.getCalendar=T,X.getView=U,X.option=V,X.trigger=W;var $=A(e(Z.lang));if(Z.monthNames&&($._months=Z.monthNames),Z.monthNamesShort&&($._monthsShort=Z.monthNamesShort),Z.dayNames&&($._weekdays=Z.dayNames),Z.dayNamesShort&&($._weekdaysShort=Z.dayNamesShort),null!=Z.firstDay){var _=A($._week);_.dow=Z.firstDay,$._week=_}X.defaultAllDayEventDuration=b.duration(Z.defaultAllDayEventDuration),X.defaultTimedEventDuration=b.duration(Z.defaultTimedEventDuration),X.moment=function(){var a;return"local"===Z.timezone?(a=Ab.moment.apply(null,arguments),a.hasTime()&&a.local()):a="UTC"===Z.timezone?Ab.moment.utc.apply(null,arguments):Ab.moment.parseZone.apply(null,arguments),"_locale"in a?a._locale=$:a._lang=$,a},X.getIsAmbigTimezone=function(){return"local"!==Z.timezone&&"UTC"!==Z.timezone},X.rezoneDate=function(a){return X.moment(a.toArray())},X.getNow=function(){var a=Z.now;return"function"==typeof a&&(a=a()),X.moment(a)},X.calculateWeekNumber=function(a){var b=Z.weekNumberCalculation;return"function"==typeof b?b(a):"local"===b?a.week():"ISO"===b.toUpperCase()?a.isoWeek():void 0},X.getEventEnd=function(a){return a.end?a.end.clone():X.getDefaultEventEnd(a.allDay,a.start)},X.getDefaultEventEnd=function(a,b){var c=b.clone();return a?c.stripTime().add(X.defaultAllDayEventDuration):c.add(X.defaultTimedEventDuration),X.getIsAmbigTimezone()&&c.stripZone(),c},X.formatRange=function(a,b,c){return"function"==typeof c&&(c=c.call(X,Z,$)),P(a,b,c,null,Z.isRTL)},X.formatDate=function(a,b){return"function"==typeof b&&(b=b.call(X,Z,$)),M(a,b)},j.call(X,Z);var ab,bb,cb,db,eb,fb,gb,hb,ib=X.isFetchNeeded,jb=X.fetchEvents,kb=c[0],lb=0,mb=[];hb=null!=Z.defaultDate?X.moment(Z.defaultDate):X.getNow(),X.getSuggestedViewHeight=function(){return void 0===fb&&p(),fb},X.isHeightAuto=function(){return"auto"===Z.contentHeight||"auto"===Z.height}}function i(b,c){function d(){var b=c.header;return n=c.theme?"ui":"fc",b?o=a("<div class='fc-toolbar'/>").append(f("left")).append(f("right")).append(f("center")).append('<div class="fc-clear"/>'):void 0}function e(){o.remove()}function f(d){var e=a('<div class="fc-'+d+'"/>'),f=c.header[d];return f&&a.each(f.split(" "),function(){var d,f=a(),g=!0;a.each(this.split(","),function(d,e){var h,i,j,k,l,m,o,q;"title"==e?(f=f.add(a("<h2> </h2>")),g=!1):(b[e]?h=function(){b[e]()}:Bb[e]&&(h=function(){b.changeView(e)},p.push(e)),h&&(i=w(c.themeButtonIcons,e),j=w(c.buttonIcons,e),k=w(c.defaultButtonText,e),l=w(c.buttonText,e),m=l?E(l):i&&c.theme?"<span class='ui-icon ui-icon-"+i+"'></span>":j&&!c.theme?"<span class='fc-icon fc-icon-"+j+"'></span>":E(k||e),o=["fc-"+e+"-button",n+"-button",n+"-state-default"],q=a('<button type="button" class="'+o.join(" ")+'">'+m+"</button>").click(function(){q.hasClass(n+"-state-disabled")||(h(),(q.hasClass(n+"-state-active")||q.hasClass(n+"-state-disabled"))&&q.removeClass(n+"-state-hover"))}).mousedown(function(){q.not("."+n+"-state-active").not("."+n+"-state-disabled").addClass(n+"-state-down")}).mouseup(function(){q.removeClass(n+"-state-down")}).hover(function(){q.not("."+n+"-state-active").not("."+n+"-state-disabled").addClass(n+"-state-hover")},function(){q.removeClass(n+"-state-hover").removeClass(n+"-state-down")}),f=f.add(q)))}),g&&f.first().addClass(n+"-corner-left").end().last().addClass(n+"-corner-right").end(),f.length>1?(d=a("<div/>"),g&&d.addClass("fc-button-group"),d.append(f),e.append(d)):e.append(f)}),e}function g(a){o.find("h2").text(a)}function h(a){o.find(".fc-"+a+"-button").addClass(n+"-state-active")}function i(a){o.find(".fc-"+a+"-button").removeClass(n+"-state-active")}function j(a){o.find(".fc-"+a+"-button").attr("disabled","disabled").addClass(n+"-state-disabled")}function k(a){o.find(".fc-"+a+"-button").removeAttr("disabled").removeClass(n+"-state-disabled")}function l(){return p}var m=this;m.render=d,m.destroy=e,m.updateTitle=g,m.activateButton=h,m.deactivateButton=i,m.disableButton=j,m.enableButton=k,m.getViewsWithButtons=l;var n,o=a(),p=[]}function j(b){function c(a,b){return!y||a.clone().stripZone()<y.clone().stripZone()||b.clone().stripZone()>z.clone().stripZone()}function d(a,b){y=a,z=b,L=[];var c=++I,d=H.length;J=d;for(var f=0;d>f;f++)e(H[f],c)}function e(b,c){f(b,function(d){var e,f,g=a.isArray(b.events);if(c==I){if(d)for(e=0;e<d.length;e++)f=d[e],g||(f=t(f,b)),f&&L.push(f);J--,J||E(L)}})}function f(c,d){var e,g,h=Ab.sourceFetchers;for(e=0;e<h.length;e++){if(g=h[e].call(w,c,y.clone(),z.clone(),b.timezone,d),g===!0)return;if("object"==typeof g)return void f(g,d)}var i=c.events;if(i)a.isFunction(i)?(r(),i.call(w,y.clone(),z.clone(),b.timezone,function(a){d(a),s()})):a.isArray(i)?d(i):d();else{var j=c.url;if(j){var k,l=c.success,m=c.error,n=c.complete;k=a.isFunction(c.data)?c.data():c.data;var o=a.extend({},k||{}),p=D(c.startParam,b.startParam),q=D(c.endParam,b.endParam),t=D(c.timezoneParam,b.timezoneParam);p&&(o[p]=y.format()),q&&(o[q]=z.format()),b.timezone&&"local"!=b.timezone&&(o[t]=b.timezone),r(),a.ajax(a.extend({},Cb,c,{data:o,success:function(b){b=b||[];var c=C(l,this,arguments);a.isArray(c)&&(b=c),d(b)},error:function(){C(m,this,arguments),d()},complete:function(){C(n,this,arguments),s()}}))}else d()}}function g(a){var b=h(a);b&&(H.push(b),J++,e(b,I))}function h(b){var c,d,e=Ab.sourceNormalizers;if(a.isFunction(b)||a.isArray(b)?c={events:b}:"string"==typeof b?c={url:b}:"object"==typeof b&&(c=a.extend({},b)),c){for(c.className?"string"==typeof c.className&&(c.className=c.className.split(/\s+/)):c.className=[],a.isArray(c.events)&&(c.origArray=c.events,c.events=a.map(c.events,function(a){return t(a,c)})),d=0;d<e.length;d++)e[d].call(w,c);return c}}function i(b){H=a.grep(H,function(a){return!j(a,b)}),L=a.grep(L,function(a){return!j(a.source,b)}),E(L)}function j(a,b){return a&&b&&l(a)==l(b)}function l(a){return("object"==typeof a?a.origArray||a.url||a.events:null)||a}function m(a){a.start=w.moment(a.start),a.end&&(a.end=w.moment(a.end)),u(a),n(a),E(L)}function n(a){var b,c,d,e;for(b=0;b<L.length;b++)if(c=L[b],c._id==a._id&&c!==a)for(d=0;d<M.length;d++)e=M[d],void 0!==a[e]&&(c[e]=a[e])}function o(a,b){var c=t(a);c&&(c.source||(b&&(G.events.push(c),c.source=G),L.push(c)),E(L))}function p(b){var c,d;for(null==b?b=function(){return!0}:a.isFunction(b)||(c=b+"",b=function(a){return a._id==c}),L=a.grep(L,b,!0),d=0;d<H.length;d++)a.isArray(H[d].events)&&(H[d].events=a.grep(H[d].events,b,!0));E(L)}function q(b){return a.isFunction(b)?a.grep(L,b):null!=b?(b+="",a.grep(L,function(a){return a._id==b})):L}function r(){K++||A("loading",null,!0,B())}function s(){--K||A("loading",null,!1,B())}function t(c,d){var e,f,g,h,i={};return b.eventDataTransform&&(c=b.eventDataTransform(c)),d&&d.eventDataTransform&&(c=d.eventDataTransform(c)),e=w.moment(c.start||c.date),e.isValid()&&(f=null,!c.end||(f=w.moment(c.end),f.isValid()))?(g=c.allDay,void 0===g&&(h=D(d?d.allDayDefault:void 0,b.allDayDefault),g=void 0!==h?h:!(e.hasTime()||f&&f.hasTime())),g?(e.hasTime()&&e.stripTime(),f&&f.hasTime()&&f.stripTime()):(e.hasTime()||(e=w.rezoneDate(e)),f&&!f.hasTime()&&(f=w.rezoneDate(f))),a.extend(i,c),d&&(i.source=d),i._id=c._id||(void 0===c.id?"_fc"+Db++:c.id+""),i.className=c.className?"string"==typeof c.className?c.className.split(/\s+/):c.className:[],i.allDay=g,i.start=e,i.end=f,b.forceEventDuration&&!i.end&&(i.end=F(i)),k(i),i):void 0}function u(a,b,c){var d,e,f,g,h=a._allDay,i=a._start,j=a._end,k=!1;return b||c||(b=a.start,c=a.end),d=a.allDay!=h?a.allDay:!(b||c).hasTime(),d&&(b&&(b=b.clone().stripTime()),c&&(c=c.clone().stripTime())),b&&(e=d?x(b,i.clone().stripTime()):x(b,i)),d!=h?k=!0:c&&(f=x(c||w.getDefaultEventEnd(d,b||i),b||i).subtract(x(j||w.getDefaultEventEnd(h,i),i))),g=v(q(a._id),k,d,e,f),{dateDelta:e,durationDelta:f,undo:g}}function v(c,d,e,f,g){var h=w.getIsAmbigTimezone(),i=[];return a.each(c,function(a,c){var j=c._allDay,l=c._start,m=c._end,n=null!=e?e:j,o=l.clone(),p=!d&&m?m.clone():null;n?(o.stripTime(),p&&p.stripTime()):(o.hasTime()||(o=w.rezoneDate(o)),p&&!p.hasTime()&&(p=w.rezoneDate(p))),p||!b.forceEventDuration&&!+g||(p=w.getDefaultEventEnd(n,o)),o.add(f),p&&p.add(f).add(g),h&&(+f||+g)&&(o.stripZone(),p&&p.stripZone()),c.allDay=n,c.start=o,c.end=p,k(c),i.push(function(){c.allDay=j,c.start=l,c.end=m,k(c)})}),function(){for(var a=0;a<i.length;a++)i[a]()}}var w=this;w.isFetchNeeded=c,w.fetchEvents=d,w.addEventSource=g,w.removeEventSource=i,w.updateEvent=m,w.renderEvent=o,w.removeEvents=p,w.clientEvents=q,w.mutateEvent=u;var y,z,A=w.trigger,B=w.getView,E=w.reportEvents,F=w.getEventEnd,G={events:[]},H=[G],I=0,J=0,K=0,L=[];a.each((b.events?[b.events]:[]).concat(b.eventSources||[]),function(a,b){var c=h(b);c&&H.push(c)});var M=["title","url","allDay","className","editable","color","backgroundColor","borderColor","textColor"]}function k(a){a._allDay=a.allDay,a._start=a.start.clone(),a._end=a.end?a.end.clone():null}function l(a,b){b.left&&a.css({"border-left-width":1,"margin-left":b.left-1}),b.right&&a.css({"border-right-width":1,"margin-right":b.right-1})}function m(a){a.css({"margin-left":"","margin-right":"","border-left-width":"","border-right-width":""})}function n(b,c,d){var e=Math.floor(c/b.length),f=Math.floor(c-e*(b.length-1)),g=[],h=[],i=[],j=0;o(b),b.each(function(c,d){var k=c===b.length-1?f:e,l=a(d).outerHeight(!0);k>l?(g.push(d),h.push(l),i.push(a(d).height())):j+=l}),d&&(c-=j,e=Math.floor(c/g.length),f=Math.floor(c-e*(g.length-1))),a(g).each(function(b,c){var d=b===g.length-1?f:e,j=h[b],k=i[b],l=d-(j-k);d>j&&a(c).height(l)})}function o(a){a.height("")}function p(b){var c=0;return b.find("> *").each(function(b,d){var e=a(d).outerWidth();e>c&&(c=e)}),c++,b.width(c),c}function q(a,b){return a.height(b).addClass("fc-scroller"),a[0].scrollHeight-1>a[0].clientHeight?!0:(r(a),!1)}function r(a){a.height("").removeClass("fc-scroller")}function s(b){var c=b.css("position"),d=b.parents().filter(function(){var b=a(this);return/(auto|scroll)/.test(b.css("overflow")+b.css("overflow-y")+b.css("overflow-x"))}).eq(0);return"fixed"!==c&&d.length?d:a(b[0].ownerDocument||document)}function t(a){var b=a.offset().left,c=b+a.width(),d=a.children(),e=d.offset().left,f=e+d.outerWidth();return{left:e-b,right:c-f}}function u(a){return 1==a.which&&!a.ctrlKey}function v(a,b,c,d){var e,f,g,h;return b>c&&d>a?(a>=c?(e=a.clone(),g=!0):(e=c.clone(),g=!1),d>=b?(f=b.clone(),h=!0):(f=d.clone(),h=!1),{start:e,end:f,isStart:g,isEnd:h}):void 0}function w(a,b){if(a=a||{},void 0!==a[b])return a[b];for(var c,d=b.split(/(?=[A-Z])/),e=d.length-1;e>=0;e--)if(c=a[d[e].toLowerCase()],void 0!==c)return c;return a["default"]}function x(a,c){return b.duration({days:a.clone().stripTime().diff(c.clone().stripTime(),"days"),ms:a.time()-c.time()})}function y(a){return"[object Date]"===Object.prototype.toString.call(a)||a instanceof Date}function z(a,b){return a-b}function A(a){var b=function(){};return b.prototype=a,new b}function B(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])}function C(b,c,d){if(a.isFunction(b)&&(b=[b]),b){var e,f;for(e=0;e<b.length;e++)f=b[e].apply(c,d)||f;return f}}function D(){for(var a=0;a<arguments.length;a++)if(void 0!==arguments[a])return arguments[a]}function E(a){return(a+"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/'/g,"'").replace(/"/g,""").replace(/\n/g,"<br />")}function F(a){return a.replace(/&.*?;/g,"")}function G(a){return a.charAt(0).toUpperCase()+a.slice(1)}function H(a,b){var c,d,e,f,g=function(){var h=+new Date-f;b>h&&h>0?c=setTimeout(g,b-h):(c=null,a.apply(e,d),c||(e=d=null))};return function(){e=this,d=arguments,f=+new Date,c||(c=setTimeout(g,b))}}function I(c,d,e){var f,g,h,i,j=c[0],k=1==c.length&&"string"==typeof j;return b.isMoment(j)?(i=b.apply(null,c),j._ambigTime&&(i._ambigTime=!0),j._ambigZone&&(i._ambigZone=!0)):y(j)||void 0===j?i=b.apply(null,c):(f=!1,g=!1,k?Fb.test(j)?(j+="-01",c=[j],f=!0,g=!0):(h=Gb.exec(j))&&(f=!h[5],g=!0):a.isArray(j)&&(g=!0),i=d?b.utc.apply(b,c):b.apply(null,c),f?(i._ambigTime=!0,i._ambigZone=!0):e&&(g?i._ambigZone=!0:k&&i.zone(j))),new J(i)}function J(a){B(this,a)}function K(a,b){var c,d=[],e=!1,f=!1;for(c=0;c<a.length;c++)d.push(Ab.moment.parseZone(a[c])),e=e||d[c]._ambigTime,f=f||d[c]._ambigZone;for(c=0;c<d.length;c++)e&&!b?d[c].stripTime():f&&d[c].stripZone();return d}function L(a,c){return b.fn.format.call(a,c)}function M(a,b){return N(a,S(b))}function N(a,b){var c,d="";for(c=0;c<b.length;c++)d+=O(a,b[c]);return d}function O(a,b){var c,d;return"string"==typeof b?b:(c=b.token)?Hb[c]?Hb[c](a):L(a,c):b.maybe&&(d=N(a,b.maybe),d.match(/[1-9]/))?d:""}function P(a,b,c,d,e){var f;return a=Ab.moment.parseZone(a),b=Ab.moment.parseZone(b),f=(a.localeData||a.lang).call(a),c=f.longDateFormat(c)||c,d=d||" - ",Q(a,b,S(c),d,e)}function Q(a,b,c,d,e){var f,g,h,i,j="",k="",l="",m="",n="";for(g=0;g<c.length&&(f=R(a,b,c[g]),f!==!1);g++)j+=f;for(h=c.length-1;h>g&&(f=R(a,b,c[h]),f!==!1);h--)k=f+k;for(i=g;h>=i;i++)l+=O(a,c[i]),m+=O(b,c[i]);return(l||m)&&(n=e?m+d+l:l+d+m),j+n+k}function R(a,b,c){var d,e;return"string"==typeof c?c:(d=c.token)&&(e=Ib[d.charAt(0)],e&&a.isSame(b,e))?L(a,d):!1}function S(a){return a in Jb?Jb[a]:Jb[a]=T(a)}function T(a){for(var b,c=[],d=/\[([^\]]*)\]|\(([^\)]*)\)|(LT|(\w)\4*o?)|([^\w\[\(]+)/g;b=d.exec(a);)b[1]?c.push(b[1]):b[2]?c.push({maybe:T(b[2])}):b[3]?c.push({token:b[3]}):b[5]&&c.push(b[5]);return c}function U(a){this.options=a||{}}function V(a){this.grid=a}function W(a){this.coordMaps=a}function X(a,b){this.coordMap=a,this.options=b||{}}function Y(a,b){return a||b?a&&b?a.grid===b.grid&&a.row===b.row&&a.col===b.col:!1:!0}function Z(b,c){this.options=c=c||{},this.sourceEl=b,this.parentEl=c.parentEl?a(c.parentEl):b.parent()}function $(a){this.view=a}function _(a){$.call(this,a),this.coordMap=new V(this)}function ab(a,b){return a.eventStartMS-b.eventStartMS||b.eventDurationMS-a.eventDurationMS||b.event.allDay-a.event.allDay||(a.event.title||"").localeCompare(b.event.title)}function bb(a){_.call(this,a)}function cb(a,b){var c,d;for(c=0;c<b.length;c++)if(d=b[c],d.leftCol<=a.rightCol&&d.rightCol>=a.leftCol)return!0;return!1}function db(a,b){return a.leftCol-b.leftCol}function eb(a){_.call(this,a)}function fb(a){var b,c,d;if(a.sort(ab),b=gb(a),hb(b),c=b[0]){for(d=0;d<c.length;d++)ib(c[d]);for(d=0;d<c.length;d++)jb(c[d],0,0)}}function gb(a){var b,c,d,e=[];for(b=0;b<a.length;b++){for(c=a[b],d=0;d<e.length&&kb(c,e[d]).length;d++);c.level=d,(e[d]||(e[d]=[])).push(c)}return e}function hb(a){var b,c,d,e,f;for(b=0;b<a.length;b++)for(c=a[b],d=0;d<c.length;d++)for(e=c[d],e.forwardSegs=[],f=b+1;f<a.length;f++)kb(e,a[f],e.forwardSegs)}function ib(a){var b,c,d=a.forwardSegs,e=0;if(void 0===a.forwardPressure){for(b=0;b<d.length;b++)c=d[b],ib(c),e=Math.max(e,1+c.forwardPressure);a.forwardPressure=e}}function jb(a,b,c){var d,e=a.forwardSegs;if(void 0===a.forwardCoord)for(e.length?(e.sort(mb),jb(e[0],b+1,c),a.forwardCoord=e[0].backwardCoord):a.forwardCoord=1,a.backwardCoord=a.forwardCoord-(a.forwardCoord-c)/(b+1),d=0;d<e.length;d++)jb(e[d],0,a.forwardCoord)}function kb(a,b,c){c=c||[];for(var d=0;d<b.length;d++)lb(a,b[d])&&c.push(b[d]);return c}function lb(a,b){return a.bottom>b.top&&a.top<b.bottom}function mb(a,b){return b.forwardPressure-a.forwardPressure||(a.backwardCoord||0)-(b.backwardCoord||0)||ab(a,b)}function nb(c){function d(b){var c=B[b];return a.isPlainObject(c)&&!g(b)?w(c,z.name):c}function e(a,b){return c.trigger.apply(c,[a,b||z].concat(Array.prototype.slice.call(arguments,2),[z]))}function f(a){var b=a.source||{};return D(a.startEditable,b.startEditable,d("eventStartEditable"),a.editable,b.editable,d("editable"))}function h(a){var b=a.source||{};return D(a.durationEditable,b.durationEditable,d("eventDurationEditable"),a.editable,b.editable,d("editable"))}function i(a,b,d,f){var g=c.mutateEvent(b,d,null);e("eventDrop",a,b,g.dateDelta,function(){g.undo(),A()},f,{}),A()}function j(a,b,d,f){var g=c.mutateEvent(b,null,d);e("eventResize",a,b,g.durationDelta,function(){g.undo(),A()},f,{}),A()}function k(a){return b.isMoment(a)&&(a=a.day()),G[a]}function l(){return E}function m(a,b,c){var d=a.clone();for(b=b||1;G[(d.day()+(c?b:0)+7)%7];)d.add(b,"days");return d}function n(){var a=o.apply(null,arguments),b=p(a),c=q(b);return c}function o(a,b){var c=z.colCnt,d=J?-1:1,e=J?c-1:0;"object"==typeof a&&(b=a.col,a=a.row);var f=a*c+(b*d+e);return f}function p(a){var b=z.start.day();return a+=H[b],7*Math.floor(a/E)+I[(a%E+E)%E]-b}function q(a){return z.start.clone().add(a,"days")}function r(a){var b=s(a),c=t(b),d=u(c);return d}function s(a){return a.clone().stripTime().diff(z.start,"days")}function t(a){var b=z.start.day();return a+=b,Math.floor(a/7)*E+H[(a%7+7)%7]-H[b]}function u(a){var b=z.colCnt,c=J?-1:1,d=J?b-1:0,e=Math.floor(a/b),f=(a%b+b)%b*c+d;return{row:e,col:f}}function v(a,b){for(var c=z.rowCnt,d=z.colCnt,e=[],f=x(a,b),g=s(f.start),h=s(f.end),i=t(g),j=t(h)-1,k=0;c>k;k++){var l=k*d,m=l+d-1,n=Math.max(i,l),o=Math.min(j,m);if(o>=n){var q=u(n),r=u(o),v=[q.col,r.col].sort(),w=p(n)==g,y=p(o)+1==h;e.push({row:k,leftCol:v[0],rightCol:v[1],isStart:w,isEnd:y})}}return e}function x(a,b){var c,d,e=a.clone().stripTime();return b&&(c=b.clone().stripTime(),d=+b.time(),d&&d>=C&&c.add(1,"days")),(!b||e>=c)&&(c=e.clone().add(1,"days")),{start:e,end:c}}function y(a){var b=x(a.start,a.end);return b.end.diff(b.start,"days")>1}var z=this;z.calendar=c,z.opt=d,z.trigger=e,z.isEventDraggable=f,z.isEventResizable=h,z.eventDrop=i,z.eventResize=j;var A=c.reportEventChange,B=c.options,C=b.duration(B.nextDayThreshold);z.init(),z.getEventTimeText=function(a,b){var e,f;return"object"==typeof a&&"object"==typeof b?(e=a,f=b,b=arguments[2]):(e=a.start,f=a.end),b=b||d("timeFormat"),f&&d("displayEventEnd")?c.formatRange(e,f,b):c.formatDate(e,b)},z.isHiddenDay=k,z.skipHiddenDays=m,z.getCellsPerWeek=l,z.dateToCell=r,z.dateToDayOffset=s,z.dayOffsetToCellOffset=t,z.cellOffsetToCell=u,z.cellToDate=n,z.cellToCellOffset=o,z.cellOffsetToDayOffset=p,z.dayOffsetToDate=q,z.rangeToSegments=v,z.isMultiDayEvent=y;var E,F=d("hiddenDays")||[],G=[],H=[],I=[],J=d("isRTL");!function(){d("weekends")===!1&&F.push(0,6);for(var b=0,c=0;7>b;b++)H[b]=c,G[b]=-1!=a.inArray(b,F),G[b]||(I[c]=b,c++);if(E=c,!E)throw"invalid hiddenDays"}()}function ob(a){nb.call(this,a),this.dayGrid=new bb(this),this.coordMap=this.dayGrid.coordMap}function pb(a){ob.call(this,a)}function qb(a){ob.call(this,a)}function rb(a){ob.call(this,a)}function sb(a,b){return b.longDateFormat("LT").replace(":mm","(:mm)").replace(/(\Wmm)$/,"($1)").replace(/\s*a$/i,"a")}function tb(a,b){return b.longDateFormat("LT").replace(/\s*a$/i,"")}function ub(a){nb.call(this,a),this.timeGrid=new eb(this),this.opt("allDaySlot")?(this.dayGrid=new bb(this),this.coordMap=new W([this.dayGrid.coordMap,this.timeGrid.coordMap])):this.coordMap=this.timeGrid.coordMap}function vb(a){ub.call(this,a)}function wb(a){ub.call(this,a)}var xb={lang:"en",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,titleFormat:{month:"MMMM YYYY",week:"ll",day:"LL"},columnFormat:{month:"ddd",week:d,day:"dddd"},timeFormat:{"default":c},displayEventEnd:{month:!1,basicWeek:!1,"default":!0},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},yb={en:{columnFormat:{week:"ddd M/D"},dayPopoverFormat:"dddd, MMMM D"}},zb={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"}},Ab=a.fullCalendar={version:"2.1.1"},Bb=Ab.views={};a.fn.fullCalendar=function(b){var c=Array.prototype.slice.call(arguments,1),d=this;return this.each(function(e,f){var g,i=a(f),j=i.data("fullCalendar");"string"==typeof b?j&&a.isFunction(j[b])&&(g=j[b].apply(j,c),e||(d=g),"destroy"===b&&i.removeData("fullCalendar")):j||(j=new h(i,b),i.data("fullCalendar",j),j.render())}),d},Ab.langs=yb,Ab.datepickerLang=function(b,c,d){var e=yb[b];e||(e=yb[b]={}),f(e,{isRTL:d.isRTL,weekNumberTitle:d.weekHeader,titleFormat:{month:d.showMonthAfterYear?"YYYY["+d.yearSuffix+"] MMMM":"MMMM YYYY["+d.yearSuffix+"]"},defaultButtonText:{prev:F(d.prevText),next:F(d.nextText),today:F(d.currentText)}}),a.datepicker&&(a.datepicker.regional[c]=a.datepicker.regional[b]=d,a.datepicker.regional.en=a.datepicker.regional[""],a.datepicker.setDefaults(d))},Ab.lang=function(a,b){var c;b&&(c=yb[a],c||(c=yb[a]={}),f(c,b||{})),xb.lang=a},Ab.sourceNormalizers=[],Ab.sourceFetchers=[];var Cb={dataType:"json",cache:!1},Db=1,Eb=["sun","mon","tue","wed","thu","fri","sat"];Ab.applyAll=C;var Fb=/^\s*\d{4}-\d\d$/,Gb=/^\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+)?)?)?)?)?$/;Ab.moment=function(){return I(arguments)},Ab.moment.utc=function(){var a=I(arguments,!0);return a.hasTime()&&a.utc(),a},Ab.moment.parseZone=function(){return I(arguments,!0,!0)},J.prototype=A(b.fn),J.prototype.clone=function(){return I([this])},J.prototype.time=function(a){if(null==a)return b.duration({hours:this.hours(),minutes:this.minutes(),seconds:this.seconds(),milliseconds:this.milliseconds()});delete this._ambigTime,b.isDuration(a)||b.isMoment(a)||(a=b.duration(a));var c=0;return b.isDuration(a)&&(c=24*Math.floor(a.asDays())),this.hours(c+a.hours()).minutes(a.minutes()).seconds(a.seconds()).milliseconds(a.milliseconds())},J.prototype.stripTime=function(){var a=this.toArray();return b.fn.utc.call(this),this.year(a[0]).month(a[1]).date(a[2]).hours(0).minutes(0).seconds(0).milliseconds(0),this._ambigTime=!0,this._ambigZone=!0,this},J.prototype.hasTime=function(){return!this._ambigTime},J.prototype.stripZone=function(){var a=this.toArray(),c=this._ambigTime;return b.fn.utc.call(this),this.year(a[0]).month(a[1]).date(a[2]).hours(a[3]).minutes(a[4]).seconds(a[5]).milliseconds(a[6]),c&&(this._ambigTime=!0),this._ambigZone=!0,this},J.prototype.hasZone=function(){return!this._ambigZone},J.prototype.zone=function(a){return null!=a&&(delete this._ambigTime,delete this._ambigZone),b.fn.zone.apply(this,arguments)},J.prototype.local=function(){var a=this.toArray(),c=this._ambigZone;return delete this._ambigTime,delete this._ambigZone,b.fn.local.apply(this,arguments),c&&this.year(a[0]).month(a[1]).date(a[2]).hours(a[3]).minutes(a[4]).seconds(a[5]).milliseconds(a[6]),this},J.prototype.utc=function(){return delete this._ambigTime,delete this._ambigZone,b.fn.utc.apply(this,arguments)},J.prototype.format=function(){return arguments[0]?M(this,arguments[0]):this._ambigTime?L(this,"YYYY-MM-DD"):this._ambigZone?L(this,"YYYY-MM-DD[T]HH:mm:ss"):L(this)},J.prototype.toISOString=function(){return this._ambigTime?L(this,"YYYY-MM-DD"):this._ambigZone?L(this,"YYYY-MM-DD[T]HH:mm:ss"):b.fn.toISOString.apply(this,arguments)},J.prototype.isWithin=function(a,b){var c=K([this,a,b]);return c[0]>=c[1]&&c[0]<c[2]},J.prototype.isSame=function(a,c){var d;return c?(d=K([this,a],!0),b.fn.isSame.call(d[0],d[1],c)):(a=Ab.moment.parseZone(a),b.fn.isSame.call(this,a)&&Boolean(this._ambigTime)===Boolean(a._ambigTime)&&Boolean(this._ambigZone)===Boolean(a._ambigZone))},a.each(["isBefore","isAfter"],function(a,c){J.prototype[c]=function(a,d){var e=K([this,a]);return b.fn[c].call(e[0],e[1],d)}});var Hb={t:function(a){return L(a,"a").charAt(0)},T:function(a){return L(a,"A").charAt(0)}};Ab.formatRange=P;var Ib={Y:"year",M:"month",D:"day",d:"day",A:"second",a:"second",T:"second",t:"second",H:"second",h:"second",m:"second",s:"second"},Jb={};U.prototype={isHidden:!0,options:null,el:null,documentMousedownProxy:null,margin:10,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 b=this,c=this.options;this.el=a('<div class="fc-popover"/>').addClass(c.className||"").css({top:0,left:0}).append(c.content).appendTo(c.parentEl),this.el.on("click",".fc-close",function(){b.hide()}),c.autoHide&&a(document).on("mousedown",this.documentMousedownProxy=a.proxy(this,"documentMousedown"))},documentMousedown:function(b){this.el&&!a(b.target).closest(this.el).length&&this.hide()},destroy:function(){this.hide(),this.el&&(this.el.remove(),this.el=null),a(document).off("mousedown",this.documentMousedownProxy)},position:function(){var b,c,d,e,f,g=this.options,h=this.el.offsetParent().offset(),i=this.el.outerWidth(),j=this.el.outerHeight(),k=a(window),l=s(this.el);e=g.top||0,f=void 0!==g.left?g.left:void 0!==g.right?g.right-i:0,l.is(window)||l.is(document)?(l=k,b=0,c=0):(d=l.offset(),b=d.top,c=d.left),b+=k.scrollTop(),c+=k.scrollLeft(),g.viewportConstrain!==!1&&(e=Math.min(e,b+l.outerHeight()-j-this.margin),e=Math.max(e,b+this.margin),f=Math.min(f,c+l.outerWidth()-i-this.margin),f=Math.max(f,c+this.margin)),this.el.css({top:e-h.top,left:f-h.left})},trigger:function(a){this.options[a]&&this.options[a].apply(this,Array.prototype.slice.call(arguments,1))}},V.prototype={grid:null,rows:null,cols:null,containerEl:null,minX:null,maxX:null,minY:null,maxY:null,build:function(){this.grid.buildCoords(this.rows=[],this.cols=[]),this.computeBounds()},getCell:function(a,b){var c,d=null,e=this.rows,f=this.cols,g=-1,h=-1;if(this.inBounds(a,b)){for(c=0;c<e.length;c++)if(b>=e[c][0]&&b<e[c][1]){g=c;break}for(c=0;c<f.length;c++)if(a>=f[c][0]&&a<f[c][1]){h=c;break}g>=0&&h>=0&&(d={row:g,col:h},d.grid=this.grid,d.date=this.grid.getCellDate(d))}return d},computeBounds:function(){var a;this.containerEl&&(a=this.containerEl.offset(),this.minX=a.left,this.maxX=a.left+this.containerEl.outerWidth(),this.minY=a.top,this.maxY=a.top+this.containerEl.outerHeight())},inBounds:function(a,b){return this.containerEl?a>=this.minX&&a<this.maxX&&b>=this.minY&&b<this.maxY:!0}},W.prototype={coordMaps:null,build:function(){var a,b=this.coordMaps;for(a=0;a<b.length;a++)b[a].build()},getCell:function(a,b){var c,d=this.coordMaps,e=null;for(c=0;c<d.length&&!e;c++)e=d[c].getCell(a,b);return e}},X.prototype={coordMap:null,options:null,isListening:!1,isDragging:!1,origCell:null,origDate:null,cell:null,date: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,mousedown:function(a){u(a)&&(a.preventDefault(),this.startListening(a),this.options.distance||this.startDrag(a))},startListening:function(b){var c,d;this.isListening||(b&&this.options.scroll&&(c=s(a(b.target)),c.is(window)||c.is(document)||(this.scrollEl=c,this.scrollHandlerProxy=H(a.proxy(this,"scrollHandler"),100),this.scrollEl.on("scroll",this.scrollHandlerProxy))),this.computeCoords(),b&&(d=this.getCell(b),this.origCell=d,this.origDate=d?d.date:null,this.mouseX0=b.pageX,this.mouseY0=b.pageY),a(document).on("mousemove",this.mousemoveProxy=a.proxy(this,"mousemove")).on("mouseup",this.mouseupProxy=a.proxy(this,"mouseup")).on("selectstart",this.preventDefault),this.isListening=!0,this.trigger("listenStart",b))},computeCoords:function(){this.coordMap.build(),this.computeScrollBounds()},mousemove:function(a){var b,c;this.isDragging||(b=this.options.distance||1,c=Math.pow(a.pageX-this.mouseX0,2)+Math.pow(a.pageY-this.mouseY0,2),c>=b*b&&this.startDrag(a)),this.isDragging&&this.drag(a)},startDrag:function(a){var b;this.isListening||this.startListening(),this.isDragging||(this.isDragging=!0,this.trigger("dragStart",a),b=this.getCell(a),b&&this.cellOver(b,!0))
},drag:function(a){var b;this.isDragging&&(b=this.getCell(a),Y(b,this.cell)||(this.cell&&this.cellOut(),b&&this.cellOver(b)),this.dragScroll(a))},cellOver:function(a){this.cell=a,this.date=a.date,this.trigger("cellOver",a,a.date)},cellOut:function(){this.cell&&(this.trigger("cellOut",this.cell),this.cell=null,this.date=null)},mouseup:function(a){this.stopDrag(a),this.stopListening(a)},stopDrag:function(a){this.isDragging&&(this.stopScrolling(),this.trigger("dragStop",a),this.isDragging=!1)},stopListening:function(b){this.isListening&&(this.scrollEl&&(this.scrollEl.off("scroll",this.scrollHandlerProxy),this.scrollHandlerProxy=null),a(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",b),this.origCell=this.cell=null,this.origDate=this.date=null)},getCell:function(a){return this.coordMap.getCell(a.pageX,a.pageY)},trigger:function(a){this.options[a]&&this.options[a].apply(this,Array.prototype.slice.call(arguments,1))},preventDefault:function(a){a.preventDefault()},computeScrollBounds:function(){var a,b=this.scrollEl;b&&(a=b.offset(),this.scrollBounds={top:a.top,left:a.left,bottom:a.top+b.outerHeight(),right:a.left+b.outerWidth()})},dragScroll:function(a){var b,c,d,e,f=this.scrollSensitivity,g=this.scrollBounds,h=0,i=0;g&&(b=(f-(a.pageY-g.top))/f,c=(f-(g.bottom-a.pageY))/f,d=(f-(a.pageX-g.left))/f,e=(f-(g.right-a.pageX))/f,b>=0&&1>=b?h=b*this.scrollSpeed*-1:c>=0&&1>=c&&(h=c*this.scrollSpeed),d>=0&&1>=d?i=d*this.scrollSpeed*-1:e>=0&&1>=e&&(i=e*this.scrollSpeed)),this.setScrollVel(h,i)},setScrollVel:function(b,c){this.scrollTopVel=b,this.scrollLeftVel=c,this.constrainScrollVel(),!this.scrollTopVel&&!this.scrollLeftVel||this.scrollIntervalId||(this.scrollIntervalId=setInterval(a.proxy(this,"scrollIntervalFunc"),this.scrollIntervalMs))},constrainScrollVel:function(){var a=this.scrollEl;this.scrollTopVel<0?a.scrollTop()<=0&&(this.scrollTopVel=0):this.scrollTopVel>0&&a.scrollTop()+a[0].clientHeight>=a[0].scrollHeight&&(this.scrollTopVel=0),this.scrollLeftVel<0?a.scrollLeft()<=0&&(this.scrollLeftVel=0):this.scrollLeftVel>0&&a.scrollLeft()+a[0].clientWidth>=a[0].scrollWidth&&(this.scrollLeftVel=0)},scrollIntervalFunc:function(){var a=this.scrollEl,b=this.scrollIntervalMs/1e3;this.scrollTopVel&&a.scrollTop(a.scrollTop()+this.scrollTopVel*b),this.scrollLeftVel&&a.scrollLeft(a.scrollLeft()+this.scrollLeftVel*b),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()}},Z.prototype={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,start:function(b){this.isFollowing||(this.isFollowing=!0,this.mouseY0=b.pageY,this.mouseX0=b.pageX,this.topDelta=0,this.leftDelta=0,this.isHidden||this.updatePosition(),a(document).on("mousemove",this.mousemoveProxy=a.proxy(this,"mousemove")))},stop:function(b,c){function d(){this.isAnimating=!1,e.destroyEl(),this.top0=this.left0=null,c&&c()}var e=this,f=this.options.revertDuration;this.isFollowing&&!this.isAnimating&&(this.isFollowing=!1,a(document).off("mousemove",this.mousemoveProxy),b&&f&&!this.isHidden?(this.isAnimating=!0,this.el.animate({top:this.top0,left:this.left0},{duration:f,complete:d})):d())},getEl:function(){var a=this.el;return a||(this.sourceEl.width(),a=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)),a},destroyEl:function(){this.el&&(this.el.remove(),this.el=null)},updatePosition:function(){var a,b;this.getEl(),null===this.top0&&(this.sourceEl.width(),a=this.sourceEl.offset(),b=this.el.offsetParent().offset(),this.top0=a.top-b.top,this.left0=a.left-b.left),this.el.css({top:this.top0+this.topDelta,left:this.left0+this.leftDelta})},mousemove:function(a){this.topDelta=a.pageY-this.mouseY0,this.leftDelta=a.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())}},$.prototype={view:null,cellHtml:"<td/>",rowHtml:function(a,b){var c,d,e=this.view,f=this.getHtmlRenderer("cell",a),g="";for(b=b||0,c=0;c<e.colCnt;c++)d=e.cellToDate(b,c),g+=f(b,c,d);return g=this.bookendCells(g,a,b),"<tr>"+g+"</tr>"},bookendCells:function(a,b,c){var d=this.view,e=this.getHtmlRenderer("intro",b)(c||0),f=this.getHtmlRenderer("outro",b)(c||0),g=d.opt("isRTL"),h=g?f:e,i=g?e:f;return"string"==typeof a?h+a+i:a.prepend(h).append(i)},getHtmlRenderer:function(a,b){var c,d,e,f,g=this.view;return c=a+"Html",b&&(d=b+G(a)+"Html"),d&&(f=g[d])?e=g:d&&(f=this[d])?e=this:(f=g[c])?e=g:(f=this[c])&&(e=this),"function"==typeof f?function(){return f.apply(e,arguments)||""}:function(){return f||""}}},_.prototype=A($.prototype),a.extend(_.prototype,{el:null,coordMap:null,cellDuration:null,render:function(){this.bindHandlers()},destroy:function(){},buildCoords:function(){},getCellDate:function(){},getCellDayEl:function(){},rangeToSegs:function(){},bindHandlers:function(){var b=this;this.el.on("mousedown",function(c){a(c.target).is(".fc-event-container *, .fc-more")||a(c.target).closest(".fc-popover").length||b.dayMousedown(c)}),this.bindSegHandlers()},dayMousedown:function(a){var b,c,d,e=this,f=this.view,g=f.opt("selectable"),h=null,i=new X(this.coordMap,{scroll:f.opt("dragScroll"),dragStart:function(){f.unselect()},cellOver:function(a,f){i.origDate&&(d=e.getCellDayEl(a),h=[f,i.origDate].sort(z),b=h[0],c=h[1].clone().add(e.cellDuration),g&&e.renderSelection(b,c))},cellOut:function(){h=null,e.destroySelection()},listenStop:function(a){h&&(h[0].isSame(h[1])&&f.trigger("dayClick",d[0],b,a),g&&f.reportSelection(b,c,a))}});i.mousedown(a)},renderDrag:function(){},destroyDrag:function(){},renderResize:function(){},destroyResize:function(){},renderRangeHelper:function(a,b,c){var d,e=this.view;!b&&e.opt("forceEventDuration")&&(b=e.calendar.getDefaultEventEnd(!a.hasTime(),a)),d=c?A(c.event):{},d.start=a,d.end=b,d.allDay=!(a.hasTime()||b&&b.hasTime()),d.className=(d.className||[]).concat("fc-helper"),c||(d.editable=!1),this.renderHelper(d,c)},renderHelper:function(){},destroyHelper:function(){},renderSelection:function(a,b){this.renderHighlight(a,b)},destroySelection:function(){this.destroyHighlight()},renderHighlight:function(){},destroyHighlight:function(){},headHtml:function(){return'<div class="fc-row '+this.view.widgetHeaderClass+'"><table><thead>'+this.rowHtml("head")+"</thead></table></div>"},headCellHtml:function(a,b,c){var d=this.view,e=d.calendar,f=d.opt("columnFormat");return'<th class="fc-day-header '+d.widgetHeaderClass+" fc-"+Eb[c.day()]+'">'+E(e.formatDate(c,f))+"</th>"},bgCellHtml:function(a,b,c){var d=this.view,e=this.getDayClasses(c);return e.unshift("fc-day",d.widgetContentClass),'<td class="'+e.join(" ")+'" data-date="'+c.format()+'"></td>'},getDayClasses:function(a){var b=this.view,c=b.calendar.getNow().stripTime(),d=["fc-"+Eb[a.day()]];return"month"===b.name&&a.month()!=b.intervalStart.month()&&d.push("fc-other-month"),a.isSame(c,"day")?d.push("fc-today",b.highlightStateClass):d.push(c>a?"fc-past":"fc-future"),d}}),a.extend(_.prototype,{mousedOverSeg:null,isDraggingSeg:!1,isResizingSeg:!1,renderEvents:function(){},getSegs:function(){},destroyEvents:function(){this.triggerSegMouseout()},renderSegs:function(b,c){var d,e=this.view,f="",g=[];for(d=0;d<b.length;d++)f+=this.renderSegHtml(b[d],c);return a(f).each(function(c,d){var f=b[c],h=e.resolveEventEl(f.event,a(d));h&&(h.data("fc-seg",f),f.el=h,g.push(f))}),g},renderSegHtml:function(){},eventsToSegs:function(b,c,d){var e=this;return a.map(b,function(a){return e.eventToSegs(a,c,d)})},eventToSegs:function(a,b,c){var d,e,f,g=a.start.clone().stripZone(),h=this.view.calendar.getEventEnd(a).stripZone();for(b&&c?(f=v(g,h,b,c),d=f?[f]:[]):d=this.rangeToSegs(g,h),e=0;e<d.length;e++)f=d[e],f.event=a,f.eventStartMS=+g,f.eventDurationMS=h-g;return d},bindSegHandlers:function(){var b=this,c=this.view;a.each({mouseenter:function(a,c){b.triggerSegMouseover(a,c)},mouseleave:function(a,c){b.triggerSegMouseout(a,c)},click:function(a,b){return c.trigger("eventClick",this,a.event,b)},mousedown:function(d,e){a(e.target).is(".fc-resizer")&&c.isEventResizable(d.event)?b.segResizeMousedown(d,e):c.isEventDraggable(d.event)&&b.segDragMousedown(d,e)}},function(c,d){b.el.on(c,".fc-event-container > *",function(c){var e=a(this).data("fc-seg");return!e||b.isDraggingSeg||b.isResizingSeg?void 0:d.call(this,e,c)})})},triggerSegMouseover:function(a,b){this.mousedOverSeg||(this.mousedOverSeg=a,this.view.trigger("eventMouseover",a.el[0],a.event,b))},triggerSegMouseout:function(a,b){b=b||{},this.mousedOverSeg&&(a=a||this.mousedOverSeg,this.mousedOverSeg=null,this.view.trigger("eventMouseout",a.el[0],a.event,b))},segDragMousedown:function(a,b){var c,d,e=this,f=this.view,g=a.el,h=a.event,i=new Z(a.el,{parentEl:f.el,opacity:f.opt("dragOpacity"),revertDuration:f.opt("dragRevertDuration"),zIndex:2}),j=new X(f.coordMap,{distance:5,scroll:f.opt("dragScroll"),listenStart:function(a){i.hide(),i.start(a)},dragStart:function(b){e.triggerSegMouseout(a,b),e.isDraggingSeg=!0,f.hideEvent(h),f.trigger("eventDragStart",g[0],h,b,{})},cellOver:function(b,g){var h=a.cellDate||j.origDate,k=e.computeDraggedEventDates(a,h,g);c=k.start,d=k.end,f.renderDrag(c,d,a)?i.hide():i.show()},cellOut:function(){c=null,f.destroyDrag(),i.show()},dragStop:function(a){var b=c&&!c.isSame(h.start);i.stop(!b,function(){e.isDraggingSeg=!1,f.destroyDrag(),f.showEvent(h),f.trigger("eventDragStop",g[0],h,a,{}),b&&f.eventDrop(g[0],h,c,a)})},listenStop:function(){i.stop()}});j.mousedown(b)},computeDraggedEventDates:function(a,b,c){var d,e,f,g=this.view,h=a.event,i=h.start,j=g.calendar.getEventEnd(h);return c.hasTime()===b.hasTime()?(d=x(c,b),e=i.clone().add(d),f=null===h.end?null:j.clone().add(d)):(e=c,f=null),{start:e,end:f}},segResizeMousedown:function(a,b){function c(){e.destroyResize(),f.showEvent(h)}var d,e=this,f=this.view,g=a.el,h=a.event,i=h.start,j=f.calendar.getEventEnd(h),k=null;d=new X(this.coordMap,{distance:5,scroll:f.opt("dragScroll"),dragStart:function(b){e.triggerSegMouseout(a,b),e.isResizingSeg=!0,f.trigger("eventResizeStart",g[0],h,b,{})},cellOver:function(b,d){d.isBefore(i)&&(d=i),k=d.clone().add(e.cellDuration),k.isSame(j)?(k=null,c()):(e.renderResize(i,k,a),f.hideEvent(h))},cellOut:function(){k=null,c()},dragStop:function(a){e.isResizingSeg=!1,c(),f.trigger("eventResizeStop",g[0],h,a,{}),k&&f.eventResize(g[0],h,k,a)}}),d.mousedown(b)},getSegClasses:function(a,b,c){var d=a.event,e=["fc-event",a.isStart?"fc-start":"fc-not-start",a.isEnd?"fc-end":"fc-not-end"].concat(d.className,d.source?d.source.className:[]);return b&&e.push("fc-draggable"),c&&e.push("fc-resizable"),e},getEventSkinCss:function(a){var b=this.view,c=a.source||{},d=a.color,e=c.color,f=b.opt("eventColor"),g=a.backgroundColor||d||c.backgroundColor||e||b.opt("eventBackgroundColor")||f,h=a.borderColor||d||c.borderColor||e||b.opt("eventBorderColor")||f,i=a.textColor||c.textColor||b.opt("eventTextColor"),j=[];return g&&j.push("background-color:"+g),h&&j.push("border-color:"+h),i&&j.push("color:"+i),j.join(";")}}),bb.prototype=A(_.prototype),a.extend(bb.prototype,{numbersVisible:!1,cellDuration:b.duration({days:1}),bottomCoordPadding:0,rowEls:null,dayEls:null,helperEls:null,highlightEls:null,render:function(b){var c,d=this.view,e="";for(c=0;c<d.rowCnt;c++)e+=this.dayRowHtml(c,b);this.el.html(e),this.rowEls=this.el.find(".fc-row"),this.dayEls=this.el.find(".fc-day"),this.dayEls.each(function(b,c){var e=d.cellToDate(Math.floor(b/d.colCnt),b%d.colCnt);d.trigger("dayRender",null,e,a(c))}),_.prototype.render.call(this)},destroy:function(){this.destroySegPopover()},dayRowHtml:function(a,b){var c=this.view,d=["fc-row","fc-week",c.widgetContentClass];return b&&d.push("fc-rigid"),'<div class="'+d.join(" ")+'"><div class="fc-bg"><table>'+this.rowHtml("day",a)+'</table></div><div class="fc-content-skeleton"><table>'+(this.numbersVisible?"<thead>"+this.rowHtml("number",a)+"</thead>":"")+"</table></div></div>"},dayCellHtml:function(a,b,c){return this.bgCellHtml(a,b,c)},buildCoords:function(b,c){var d,e,f,g=this.view.colCnt;this.dayEls.slice(0,g).each(function(b,g){d=a(g),e=d.offset().left,b&&(f[1]=e),f=[e],c[b]=f}),f[1]=e+d.outerWidth(),this.rowEls.each(function(c,g){d=a(g),e=d.offset().top,c&&(f[1]=e),f=[e],b[c]=f}),f[1]=e+d.outerHeight()+this.bottomCoordPadding},getCellDate:function(a){return this.view.cellToDate(a)},getCellDayEl:function(a){return this.dayEls.eq(a.row*this.view.colCnt+a.col)},rangeToSegs:function(a,b){return this.view.rangeToSegments(a,b)},renderDrag:function(a,b,c){var d;return this.renderHighlight(a,b||this.view.calendar.getDefaultEventEnd(!0,a)),c&&!c.el.closest(this.el).length?(this.renderRangeHelper(a,b,c),d=this.view.opt("dragOpacity"),void 0!==d&&this.helperEls.css("opacity",d),!0):void 0},destroyDrag:function(){this.destroyHighlight(),this.destroyHelper()},renderResize:function(a,b,c){this.renderHighlight(a,b),this.renderRangeHelper(a,b,c)},destroyResize:function(){this.destroyHighlight(),this.destroyHelper()},renderHelper:function(b,c){var d=[],e=this.renderEventRows([b]);this.rowEls.each(function(b,f){var g,h=a(f),i=a('<div class="fc-helper-skeleton"><table/></div>');g=c&&c.row===b?c.el.position().top:h.find(".fc-content-skeleton tbody").position().top,i.css("top",g).find("table").append(e[b].tbodyEl),h.append(i),d.push(i[0])}),this.helperEls=a(d)},destroyHelper:function(){this.helperEls&&(this.helperEls.remove(),this.helperEls=null)},renderHighlight:function(b,c){var d,e,f,g=this.rangeToSegs(b,c),h=[];for(d=0;d<g.length;d++)e=g[d],f=a(this.highlightSkeletonHtml(e.leftCol,e.rightCol+1)),f.appendTo(this.rowEls[e.row]),h.push(f[0]);this.highlightEls=a(h)},destroyHighlight:function(){this.highlightEls&&(this.highlightEls.remove(),this.highlightEls=null)},highlightSkeletonHtml:function(a,b){var c=this.view.colCnt,d="";return a>0&&(d+='<td colspan="'+a+'"/>'),b>a&&(d+='<td colspan="'+(b-a)+'" class="fc-highlight" />'),c>b&&(d+='<td colspan="'+(c-b)+'"/>'),d=this.bookendCells(d,"highlight"),'<div class="fc-highlight-skeleton"><table><tr>'+d+"</tr></table></div>"}}),a.extend(bb.prototype,{segs:null,rowStructs:null,renderEvents:function(b){var c=this.rowStructs=this.renderEventRows(b),d=[];this.rowEls.each(function(b,e){a(e).find(".fc-content-skeleton > table").append(c[b].tbodyEl),d.push.apply(d,c[b].segs)}),this.segs=d},getSegs:function(){return(this.segs||[]).concat(this.popoverSegs||[])},destroyEvents:function(){var a,b;for(_.prototype.destroyEvents.call(this),a=this.rowStructs||[];b=a.pop();)b.tbodyEl.remove();this.segs=null,this.destroySegPopover()},renderEventRows:function(a){var b,c,d=this.eventsToSegs(a),e=[];for(d=this.renderSegs(d),b=this.groupSegRows(d),c=0;c<b.length;c++)e.push(this.renderEventRow(c,b[c]));return e},renderSegHtml:function(a,b){var c,d=this.view,e=d.opt("isRTL"),f=a.event,g=d.isEventDraggable(f),h=!b&&f.allDay&&a.isEnd&&d.isEventResizable(f),i=this.getSegClasses(a,g,h),j=this.getEventSkinCss(f),k="";return i.unshift("fc-day-grid-event"),!f.allDay&&a.isStart&&(k='<span class="fc-time">'+E(d.getEventTimeText(f))+"</span>"),c='<span class="fc-title">'+(E(f.title||"")||" ")+"</span>",'<a class="'+i.join(" ")+'"'+(f.url?' href="'+E(f.url)+'"':"")+(j?' style="'+j+'"':"")+'><div class="fc-content">'+(e?c+" "+k:k+" "+c)+"</div>"+(h?'<div class="fc-resizer"/>':"")+"</a>"},renderEventRow:function(b,c){function d(b){for(;b>g;)k=(s[e-1]||[])[g],k?k.attr("rowspan",parseInt(k.attr("rowspan")||1,10)+1):(k=a("<td/>"),h.append(k)),r[e][g]=k,s[e][g]=k,g++}var e,f,g,h,i,j,k,l=this.view,m=l.colCnt,n=this.buildSegLevels(c),o=Math.max(1,n.length),p=a("<tbody/>"),q=[],r=[],s=[];for(e=0;o>e;e++){if(f=n[e],g=0,h=a("<tr/>"),q.push([]),r.push([]),s.push([]),f)for(i=0;i<f.length;i++){for(j=f[i],d(j.leftCol),k=a('<td class="fc-event-container"/>').append(j.el),j.leftCol!=j.rightCol?k.attr("colspan",j.rightCol-j.leftCol+1):s[e][g]=k;g<=j.rightCol;)r[e][g]=k,q[e][g]=j,g++;h.append(k)}d(m),this.bookendCells(h,"eventSkeleton"),p.append(h)}return{row:b,tbodyEl:p,cellMatrix:r,segMatrix:q,segLevels:n,segs:c}},buildSegLevels:function(a){var b,c,d,e=[];for(a.sort(ab),b=0;b<a.length;b++){for(c=a[b],d=0;d<e.length&&cb(c,e[d]);d++);c.level=d,(e[d]||(e[d]=[])).push(c)}for(d=0;d<e.length;d++)e[d].sort(db);return e},groupSegRows:function(a){var b,c=this.view,d=[];for(b=0;b<c.rowCnt;b++)d.push([]);for(b=0;b<a.length;b++)d[a[b].row].push(a[b]);return d}}),a.extend(bb.prototype,{segPopover:null,popoverSegs:null,destroySegPopover:function(){this.segPopover&&this.segPopover.hide()},limitRows:function(a){var b,c,d=this.rowStructs||[];for(b=0;b<d.length;b++)this.unlimitRow(b),c=a?"number"==typeof a?a:this.computeRowLevelLimit(b):!1,c!==!1&&this.limitRow(b,c)},computeRowLevelLimit:function(a){var b,c,d=this.rowEls.eq(a),e=d.height(),f=this.rowStructs[a].tbodyEl.children();for(b=0;b<f.length;b++)if(c=f.eq(b).removeClass("fc-limited"),c.position().top+c.outerHeight()>e)return b;return!1},limitRow:function(b,c){function d(d){for(;d>y;)e={row:b,col:y},k=u.getCellSegs(e,c),k.length&&(n=g[c-1][y],t=u.renderMoreLink(e,k),s=a("<div/>").append(t),n.append(s),x.push(s[0])),y++}var e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u=this,v=this.view,w=this.rowStructs[b],x=[],y=0;if(c&&c<w.segLevels.length){for(f=w.segLevels[c-1],g=w.cellMatrix,h=w.tbodyEl.children().slice(c).addClass("fc-limited").get(),i=0;i<f.length;i++){for(j=f[i],d(j.leftCol),m=[],l=0;y<=j.rightCol;)e={row:b,col:y},k=this.getCellSegs(e,c),m.push(k),l+=k.length,y++;if(l){for(n=g[c-1][j.leftCol],o=n.attr("rowspan")||1,p=[],q=0;q<m.length;q++)r=a('<td class="fc-more-cell"/>').attr("rowspan",o),k=m[q],e={row:b,col:j.leftCol+q},t=this.renderMoreLink(e,[j].concat(k)),s=a("<div/>").append(t),r.append(s),p.push(r[0]),x.push(r[0]);n.addClass("fc-limited").after(a(p)),h.push(n[0])}}d(v.colCnt),w.moreEls=a(x),w.limitedEls=a(h)}},unlimitRow:function(a){var b=this.rowStructs[a];b.moreEls&&(b.moreEls.remove(),b.moreEls=null),b.limitedEls&&(b.limitedEls.removeClass("fc-limited"),b.limitedEls=null)},renderMoreLink:function(b,c){var d=this,e=this.view;return a('<a class="fc-more"/>').text(this.getMoreLinkText(c.length)).on("click",function(f){var g=e.opt("eventLimitClick"),h=e.cellToDate(b),i=a(this),j=d.getCellDayEl(b),k=d.getCellSegs(b),l=d.resliceDaySegs(k,h),m=d.resliceDaySegs(c,h);"function"==typeof g&&(g=e.trigger("eventLimitClick",null,{date:h,dayEl:j,moreEl:i,segs:l,hiddenSegs:m},f)),"popover"===g?d.showSegPopover(h,b,i,l):"string"==typeof g&&e.calendar.zoomTo(h,g)})},showSegPopover:function(a,b,c,d){var e,f,g=this,h=this.view,i=c.parent();e=1==h.rowCnt?this.view.el:this.rowEls.eq(b.row),f={className:"fc-more-popover",content:this.renderSegPopoverContent(a,d),parentEl:this.el,top:e.offset().top,autoHide:!0,viewportConstrain:h.opt("popoverViewportConstrain"),hide:function(){g.segPopover.destroy(),g.segPopover=null,g.popoverSegs=null}},h.opt("isRTL")?f.right=i.offset().left+i.outerWidth()+1:f.left=i.offset().left-1,this.segPopover=new U(f),this.segPopover.show()},renderSegPopoverContent:function(b,c){var d,e=this.view,f=e.opt("theme"),g=b.format(e.opt("dayPopoverFormat")),h=a('<div class="fc-header '+e.widgetHeaderClass+'"><span class="fc-close '+(f?"ui-icon ui-icon-closethick":"fc-icon fc-icon-x")+'"></span><span class="fc-title">'+E(g)+'</span><div class="fc-clear"/></div><div class="fc-body '+e.widgetContentClass+'"><div class="fc-event-container"></div></div>'),i=h.find(".fc-event-container");for(c=this.renderSegs(c,!0),this.popoverSegs=c,d=0;d<c.length;d++)c[d].cellDate=b,i.append(c[d].el);return h},resliceDaySegs:function(b,c){var d=a.map(b,function(a){return a.event}),e=c.clone().stripTime(),f=e.clone().add(1,"days");return this.eventsToSegs(d,e,f)},getMoreLinkText:function(a){var b=this.view,c=b.opt("eventLimitText");return"function"==typeof c?c(a):"+"+a+" "+c},getCellSegs:function(a,b){for(var c,d=this.rowStructs[a.row].segMatrix,e=b||0,f=[];e<d.length;)c=d[e][a.col],c&&f.push(c),e++;return f}}),eb.prototype=A(_.prototype),a.extend(eb.prototype,{slotDuration:null,snapDuration:null,minTime:null,maxTime:null,dayEls:null,slatEls:null,slatTops:null,highlightEl:null,helperEl:null,render:function(){this.processOptions(),this.el.html(this.renderHtml()),this.dayEls=this.el.find(".fc-day"),this.slatEls=this.el.find(".fc-slats tr"),this.computeSlatTops(),_.prototype.render.call(this)},renderHtml:function(){return'<div class="fc-bg"><table>'+this.rowHtml("slotBg")+'</table></div><div class="fc-slats"><table>'+this.slatRowHtml()+"</table></div>"},slotBgCellHtml:function(a,b,c){return this.bgCellHtml(a,b,c)},slatRowHtml:function(){for(var a,c,d,e=this.view,f=e.calendar,g=e.opt("isRTL"),h="",i=this.slotDuration.asMinutes()%15===0,j=b.duration(+this.minTime);j<this.maxTime;)a=e.start.clone().time(j),c=a.minutes(),d='<td class="fc-axis fc-time '+e.widgetContentClass+'" '+e.axisStyleAttr()+">"+(i&&c?"":"<span>"+E(f.formatDate(a,e.opt("axisFormat")))+"</span>")+"</td>",h+="<tr "+(c?'class="fc-minor"':"")+">"+(g?"":d)+'<td class="'+e.widgetContentClass+'"/>'+(g?d:"")+"</tr>",j.add(this.slotDuration);return h},processOptions:function(){var a=this.view,c=a.opt("slotDuration"),d=a.opt("snapDuration");c=b.duration(c),d=d?b.duration(d):c,this.slotDuration=c,this.snapDuration=d,this.cellDuration=d,this.minTime=b.duration(a.opt("minTime")),this.maxTime=b.duration(a.opt("maxTime"))},rangeToSegs:function(a,b){var c,d,e,f,g,h=this.view,i=[];for(a=a.clone().stripZone(),b=b.clone().stripZone(),d=0;d<h.colCnt;d++)e=h.cellToDate(0,d),f=e.clone().time(this.minTime),g=e.clone().time(this.maxTime),c=v(a,b,f,g),c&&(c.col=d,i.push(c));return i},resize:function(){this.computeSlatTops(),this.updateSegVerticals()},buildCoords:function(c,d){var e,f,g=this.view.colCnt,h=this.el.offset().top,i=b.duration(+this.minTime),j=null;for(this.dayEls.slice(0,g).each(function(b,c){e=a(c),f=e.offset().left,j&&(j[1]=f),j=[f],d[b]=j}),j[1]=f+e.outerWidth(),j=null;i<this.maxTime;)f=h+this.computeTimeTop(i),j&&(j[1]=f),j=[f],c.push(j),i.add(this.snapDuration);j[1]=h+this.computeTimeTop(i)},getCellDate:function(a){var b=this.view,c=b.calendar;return c.rezoneDate(b.cellToDate(0,a.col).time(this.minTime+this.snapDuration*a.row))},getCellDayEl:function(a){return this.dayEls.eq(a.col)},computeDateTop:function(a,c){return this.computeTimeTop(b.duration(a.clone().stripZone()-c.clone().stripTime()))},computeTimeTop:function(a){var b,c,d,e,f=(a-this.minTime)/this.slotDuration;return f=Math.max(0,f),f=Math.min(this.slatEls.length,f),b=Math.floor(f),c=f-b,d=this.slatTops[b],c?(e=this.slatTops[b+1],d+(e-d)*c):d},computeSlatTops:function(){var b,c=[];this.slatEls.each(function(d,e){b=a(e).position().top,c.push(b)}),c.push(b+this.slatEls.last().outerHeight()),this.slatTops=c},renderDrag:function(a,b,c){var d;return c?(this.renderRangeHelper(a,b,c),d=this.view.opt("dragOpacity"),void 0!==d&&this.helperEl.css("opacity",d),!0):void this.renderHighlight(a,b||this.view.calendar.getDefaultEventEnd(!1,a))},destroyDrag:function(){this.destroyHelper(),this.destroyHighlight()},renderResize:function(a,b,c){this.renderRangeHelper(a,b,c)},destroyResize:function(){this.destroyHelper()},renderHelper:function(b,c){var d,e,f,g=this.renderEventTable([b]),h=g.tableEl,i=g.segs;for(d=0;d<i.length;d++)e=i[d],c&&c.col===e.col&&(f=c.el,e.el.css({left:f.css("left"),right:f.css("right"),"margin-left":f.css("margin-left"),"margin-right":f.css("margin-right")}));this.helperEl=a('<div class="fc-helper-skeleton"/>').append(h).appendTo(this.el)},destroyHelper:function(){this.helperEl&&(this.helperEl.remove(),this.helperEl=null)},renderSelection:function(a,b){this.view.opt("selectHelper")?this.renderRangeHelper(a,b):this.renderHighlight(a,b)},destroySelection:function(){this.destroyHelper(),this.destroyHighlight()},renderHighlight:function(b,c){this.highlightEl=a(this.highlightSkeletonHtml(b,c)).appendTo(this.el)},destroyHighlight:function(){this.highlightEl&&(this.highlightEl.remove(),this.highlightEl=null)},highlightSkeletonHtml:function(a,b){var c,d,e,f,g,h=this.view,i=this.rangeToSegs(a,b),j="",k=0;for(c=0;c<i.length;c++)d=i[c],k<d.col&&(j+='<td colspan="'+(d.col-k)+'"/>',k=d.col),e=h.cellToDate(0,k),f=this.computeDateTop(d.start,e),g=this.computeDateTop(d.end,e),j+='<td><div class="fc-highlight-container"><div class="fc-highlight" style="top:'+f+"px;bottom:-"+g+'px"/></div></td>',k++;return k<h.colCnt&&(j+='<td colspan="'+(h.colCnt-k)+'"/>'),j=this.bookendCells(j,"highlight"),'<div class="fc-highlight-skeleton"><table><tr>'+j+"</tr></table></div>"}}),a.extend(eb.prototype,{segs:null,eventSkeletonEl:null,renderEvents:function(b){var c=this.renderEventTable(b);this.eventSkeletonEl=a('<div class="fc-content-skeleton"/>').append(c.tableEl),this.el.append(this.eventSkeletonEl),this.segs=c.segs},getSegs:function(){return this.segs||[]},destroyEvents:function(){_.prototype.destroyEvents.call(this),this.eventSkeletonEl&&(this.eventSkeletonEl.remove(),this.eventSkeletonEl=null),this.segs=null},renderEventTable:function(b){var c,d,e,f,g,h,i=a("<table><tr/></table>"),j=i.find("tr"),k=this.eventsToSegs(b);for(k=this.renderSegs(k),c=this.groupSegCols(k),this.computeSegVerticals(k),f=0;f<c.length;f++){for(g=c[f],fb(g),h=a('<div class="fc-event-container"/>'),d=0;d<g.length;d++)e=g[d],e.el.css(this.generateSegPositionCss(e)),e.bottom-e.top<30&&e.el.addClass("fc-short"),h.append(e.el);j.append(a("<td/>").append(h))}return this.bookendCells(j,"eventSkeleton"),{tableEl:i,segs:k}},updateSegVerticals:function(){var a,b=this.segs;if(b)for(this.computeSegVerticals(b),a=0;a<b.length;a++)b[a].el.css(this.generateSegVerticalCss(b[a]))},computeSegVerticals:function(a){var b,c;for(b=0;b<a.length;b++)c=a[b],c.top=this.computeDateTop(c.start,c.start),c.bottom=this.computeDateTop(c.end,c.start)},renderSegHtml:function(a,b){var c,d,e,f=this.view,g=a.event,h=f.isEventDraggable(g),i=!b&&a.isEnd&&f.isEventResizable(g),j=this.getSegClasses(a,h,i),k=this.getEventSkinCss(g);return j.unshift("fc-time-grid-event"),f.isMultiDayEvent(g)?(a.isStart||a.isEnd)&&(c=f.getEventTimeText(a.start,a.end),d=f.getEventTimeText(a.start,a.end,"LT"),e=f.getEventTimeText(a.start,null)):(c=f.getEventTimeText(g),d=f.getEventTimeText(g,"LT"),e=f.getEventTimeText(g.start,null)),'<a class="'+j.join(" ")+'"'+(g.url?' href="'+E(g.url)+'"':"")+(k?' style="'+k+'"':"")+'><div class="fc-content">'+(c?'<div class="fc-time" data-start="'+E(e)+'" data-full="'+E(d)+'"><span>'+E(c)+"</span></div>":"")+(g.title?'<div class="fc-title">'+E(g.title)+"</div>":"")+'</div><div class="fc-bg"/>'+(i?'<div class="fc-resizer"/>':"")+"</a>"},generateSegPositionCss:function(a){var b,c,d=this.view,e=d.opt("isRTL"),f=d.opt("slotEventOverlap"),g=a.backwardCoord,h=a.forwardCoord,i=this.generateSegVerticalCss(a);return f&&(h=Math.min(1,g+2*(h-g))),e?(b=1-h,c=g):(b=g,c=1-h),i.zIndex=a.level+1,i.left=100*b+"%",i.right=100*c+"%",f&&a.forwardPressure&&(i[e?"marginLeft":"marginRight"]=20),i},generateSegVerticalCss:function(a){return{top:a.top,bottom:-a.bottom}},groupSegCols:function(a){var b,c=this.view,d=[];for(b=0;b<c.colCnt;b++)d.push([]);for(b=0;b<a.length;b++)d[a[b].col].push(a[b]);return d}}),nb.prototype={calendar:null,coordMap:null,el:null,start:null,end:null,intervalStart:null,intervalEnd:null,rowCnt:null,colCnt:null,isSelected:!1,scrollerEl:null,scrollTop:null,widgetHeaderClass:null,widgetContentClass:null,highlightStateClass:null,documentMousedownProxy:null,documentDragStartProxy:null,init:function(){var b=this.opt("theme")?"ui":"fc";this.widgetHeaderClass=b+"-widget-header",this.widgetContentClass=b+"-widget-content",this.highlightStateClass=b+"-state-highlight",this.documentMousedownProxy=a.proxy(this,"documentMousedown"),this.documentDragStartProxy=a.proxy(this,"documentDragStart")},render:function(){this.updateSize(),this.trigger("viewRender",this,this,this.el),a(document).on("mousedown",this.documentMousedownProxy).on("dragstart",this.documentDragStartProxy)},destroy:function(){this.unselect(),this.trigger("viewDestroy",this,this,this.el),this.destroyEvents(),this.el.empty(),a(document).off("mousedown",this.documentMousedownProxy).off("dragstart",this.documentDragStartProxy)},incrementDate:function(){},updateSize:function(a){a&&this.recordScroll(),this.updateHeight(),this.updateWidth()},updateWidth:function(){},updateHeight:function(){var a=this.calendar;this.setHeight(a.getSuggestedViewHeight(),a.isHeightAuto())},setHeight:function(){},computeScrollerHeight:function(a){var b,c=this.el.add(this.scrollerEl);return c.css({position:"relative",left:-1}),b=this.el.outerHeight()-this.scrollerEl.height(),c.css({position:"",left:""}),a-b},recordScroll:function(){this.scrollerEl&&(this.scrollTop=this.scrollerEl.scrollTop())},restoreScroll:function(){null!==this.scrollTop&&this.scrollerEl.scrollTop(this.scrollTop)},renderEvents:function(){this.segEach(function(a){this.trigger("eventAfterRender",a.event,a.event,a.el)}),this.trigger("eventAfterAllRender")},destroyEvents:function(){this.segEach(function(a){this.trigger("eventDestroy",a.event,a.event,a.el)})},resolveEventEl:function(b,c){var d=this.trigger("eventRender",b,b,c);return d===!1?c=null:d&&d!==!0&&(c=a(d)),c},showEvent:function(a){this.segEach(function(a){a.el.css("visibility","")},a)},hideEvent:function(a){this.segEach(function(a){a.el.css("visibility","hidden")},a)},segEach:function(a,b){var c,d=this.getSegs();for(c=0;c<d.length;c++)b&&d[c].event._id!==b._id||a.call(this,d[c])},getSegs:function(){},renderDrag:function(){},destroyDrag:function(){},documentDragStart:function(b){var c,d=this,e=null;this.opt("droppable")&&(c=new X(this.coordMap,{cellOver:function(a,b){e=b,d.renderDrag(b)},cellOut:function(){e=null,d.destroyDrag()}}),a(document).one("dragstop",function(a,b){d.destroyDrag(),e&&d.trigger("drop",a.target,e,a,b)}),c.startDrag(b))},select:function(a,b,c){this.unselect(c),this.renderSelection(a,b),this.reportSelection(a,b,c)},renderSelection:function(){},reportSelection:function(a,b,c){this.isSelected=!0,this.trigger("select",null,a,b,c)},unselect:function(a){this.isSelected&&(this.isSelected=!1,this.destroySelection(),this.trigger("unselect",null,a))},destroySelection:function(){},documentMousedown:function(b){var c;this.isSelected&&this.opt("unselectAuto")&&u(b)&&(c=this.opt("unselectCancel"),c&&a(b.target).closest(c).length||this.unselect(b))}},ob.prototype=A(nb.prototype),a.extend(ob.prototype,{dayGrid:null,dayNumbersVisible:!1,weekNumbersVisible:!1,weekNumberWidth:null,headRowEl:null,render:function(a,b,c){this.rowCnt=a,this.colCnt=b,this.dayNumbersVisible=c,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()),nb.prototype.render.call(this)},destroy:function(){this.dayGrid.destroy(),nb.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(){return this.weekNumbersVisible?'<th class="fc-week-number '+this.widgetHeaderClass+'" '+this.weekNumberStyleAttr()+"><span>"+E(this.opt("weekNumberTitle"))+"</span></th>":void 0
},numberIntroHtml:function(a){return this.weekNumbersVisible?'<td class="fc-week-number" '+this.weekNumberStyleAttr()+"><span>"+this.calendar.calculateWeekNumber(this.cellToDate(a,0))+"</span></td>":void 0},dayIntroHtml:function(){return this.weekNumbersVisible?'<td class="fc-week-number '+this.widgetContentClass+'" '+this.weekNumberStyleAttr()+"></td>":void 0},introHtml:function(){return this.weekNumbersVisible?'<td class="fc-week-number" '+this.weekNumberStyleAttr()+"></td>":void 0},numberCellHtml:function(a,b,c){var d;return this.dayNumbersVisible?(d=this.dayGrid.getDayClasses(c),d.unshift("fc-day-number"),'<td class="'+d.join(" ")+'" data-date="'+c.format()+'">'+c.date()+"</td>"):"<td/>"},weekNumberStyleAttr:function(){return null!==this.weekNumberWidth?'style="width:'+this.weekNumberWidth+'px"':""},hasRigidRows:function(){var a=this.opt("eventLimit");return a&&"number"!=typeof a},updateWidth:function(){this.weekNumbersVisible&&(this.weekNumberWidth=p(this.el.find(".fc-week-number")))},setHeight:function(a,b){var c,d=this.opt("eventLimit");r(this.scrollerEl),m(this.headRowEl),this.dayGrid.destroySegPopover(),d&&"number"==typeof d&&this.dayGrid.limitRows(d),c=this.computeScrollerHeight(a),this.setGridHeight(c,b),d&&"number"!=typeof d&&this.dayGrid.limitRows(d),!b&&q(this.scrollerEl,c)&&(l(this.headRowEl,t(this.scrollerEl)),c=this.computeScrollerHeight(a),this.scrollerEl.height(c),this.restoreScroll())},setGridHeight:function(a,b){b?o(this.dayGrid.rowEls):n(this.dayGrid.rowEls,a,!0)},renderEvents:function(a){this.dayGrid.renderEvents(a),this.updateHeight(),nb.prototype.renderEvents.call(this,a)},getSegs:function(){return this.dayGrid.getSegs()},destroyEvents:function(){nb.prototype.destroyEvents.call(this),this.recordScroll(),this.dayGrid.destroyEvents()},renderDrag:function(a,b,c){return this.dayGrid.renderDrag(a,b,c)},destroyDrag:function(){this.dayGrid.destroyDrag()},renderSelection:function(a,b){this.dayGrid.renderSelection(a,b)},destroySelection:function(){this.dayGrid.destroySelection()}}),e({fixedWeekCount:!0}),Bb.month=pb,pb.prototype=A(ob.prototype),a.extend(pb.prototype,{name:"month",incrementDate:function(a,b){return a.clone().stripTime().add(b,"months").startOf("month")},render:function(a){var b;this.intervalStart=a.clone().stripTime().startOf("month"),this.intervalEnd=this.intervalStart.clone().add(1,"months"),this.start=this.intervalStart.clone(),this.start=this.skipHiddenDays(this.start),this.start.startOf("week"),this.start=this.skipHiddenDays(this.start),this.end=this.intervalEnd.clone(),this.end=this.skipHiddenDays(this.end,-1,!0),this.end.add((7-this.end.weekday())%7,"days"),this.end=this.skipHiddenDays(this.end,-1,!0),b=Math.ceil(this.end.diff(this.start,"weeks",!0)),this.isFixedWeeks()&&(this.end.add(6-b,"weeks"),b=6),this.title=this.calendar.formatDate(this.intervalStart,this.opt("titleFormat")),ob.prototype.render.call(this,b,this.getCellsPerWeek(),!0)},setGridHeight:function(a,b){b=b||"variable"===this.opt("weekMode"),b&&(a*=this.rowCnt/6),n(this.dayGrid.rowEls,a,!b)},isFixedWeeks:function(){var a=this.opt("weekMode");return a?"fixed"===a:this.opt("fixedWeekCount")}}),Bb.basicWeek=qb,qb.prototype=A(ob.prototype),a.extend(qb.prototype,{name:"basicWeek",incrementDate:function(a,b){return a.clone().stripTime().add(b,"weeks").startOf("week")},render:function(a){this.intervalStart=a.clone().stripTime().startOf("week"),this.intervalEnd=this.intervalStart.clone().add(1,"weeks"),this.start=this.skipHiddenDays(this.intervalStart),this.end=this.skipHiddenDays(this.intervalEnd,-1,!0),this.title=this.calendar.formatRange(this.start,this.end.clone().subtract(1),this.opt("titleFormat")," — "),ob.prototype.render.call(this,1,this.getCellsPerWeek(),!1)}}),Bb.basicDay=rb,rb.prototype=A(ob.prototype),a.extend(rb.prototype,{name:"basicDay",incrementDate:function(a,b){var c=a.clone().stripTime().add(b,"days");return c=this.skipHiddenDays(c,0>b?-1:1)},render:function(a){this.start=this.intervalStart=a.clone().stripTime(),this.end=this.intervalEnd=this.start.clone().add(1,"days"),this.title=this.calendar.formatDate(this.start,this.opt("titleFormat")),ob.prototype.render.call(this,1,1,!1)}}),e({allDaySlot:!0,allDayText:"all-day",scrollTime:"06:00:00",slotDuration:"00:30:00",axisFormat:sb,timeFormat:{agenda:tb},minTime:"00:00:00",maxTime:"24:00:00",slotEventOverlap:!0});var Kb=5;ub.prototype=A(nb.prototype),a.extend(ub.prototype,{timeGrid:null,dayGrid:null,axisWidth:null,noScrollRowEls:null,bottomRuleEl:null,bottomRuleHeight:null,render:function(b){this.rowCnt=1,this.colCnt=b,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=a('<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 *)"),nb.prototype.render.call(this),this.resetScroll()},destroy:function(){this.timeGrid.destroy(),this.dayGrid&&this.dayGrid.destroy(),nb.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 a,b,c,d;return this.opt("weekNumbers")?(a=this.cellToDate(0,0),b=this.calendar.calculateWeekNumber(a),c=this.opt("weekNumberTitle"),d=this.opt("isRTL")?b+c:c+b,'<th class="fc-axis fc-week-number '+this.widgetHeaderClass+'" '+this.axisStyleAttr()+"><span>"+E(d)+"</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")||E(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(a){a&&this.timeGrid.resize(),nb.prototype.updateSize.call(this,a)},updateWidth:function(){this.axisWidth=p(this.el.find(".fc-axis"))},setHeight:function(a,b){var c,d;null===this.bottomRuleHeight&&(this.bottomRuleHeight=this.bottomRuleEl.outerHeight()),this.bottomRuleEl.hide(),this.scrollerEl.css("overflow",""),r(this.scrollerEl),m(this.noScrollRowEls),this.dayGrid&&(this.dayGrid.destroySegPopover(),c=this.opt("eventLimit"),c&&"number"!=typeof c&&(c=Kb),c&&this.dayGrid.limitRows(c)),b||(d=this.computeScrollerHeight(a),q(this.scrollerEl,d)?(l(this.noScrollRowEls,t(this.scrollerEl)),d=this.computeScrollerHeight(a),this.scrollerEl.height(d),this.restoreScroll()):(this.scrollerEl.height(d).css("overflow","hidden"),this.bottomRuleEl.show()))},resetScroll:function(){function a(){c.scrollerEl.scrollTop(e)}var c=this,d=b.duration(this.opt("scrollTime")),e=this.timeGrid.computeTimeTop(d);e=Math.ceil(e),e&&e++,a(),setTimeout(a,0)},renderEvents:function(a){var b,c,d=[],e=[],f=[];for(c=0;c<a.length;c++)a[c].allDay?d.push(a[c]):e.push(a[c]);b=this.timeGrid.renderEvents(e),this.dayGrid&&(f=this.dayGrid.renderEvents(d)),this.updateHeight(),nb.prototype.renderEvents.call(this,a)},getSegs:function(){return this.timeGrid.getSegs().concat(this.dayGrid?this.dayGrid.getSegs():[])},destroyEvents:function(){nb.prototype.destroyEvents.call(this),this.recordScroll(),this.timeGrid.destroyEvents(),this.dayGrid&&this.dayGrid.destroyEvents()},renderDrag:function(a,b,c){return a.hasTime()?this.timeGrid.renderDrag(a,b,c):this.dayGrid?this.dayGrid.renderDrag(a,b,c):void 0},destroyDrag:function(){this.timeGrid.destroyDrag(),this.dayGrid&&this.dayGrid.destroyDrag()},renderSelection:function(a,b){a.hasTime()||b.hasTime()?this.timeGrid.renderSelection(a,b):this.dayGrid&&this.dayGrid.renderSelection(a,b)},destroySelection:function(){this.timeGrid.destroySelection(),this.dayGrid&&this.dayGrid.destroySelection()}}),Bb.agendaWeek=vb,vb.prototype=A(ub.prototype),a.extend(vb.prototype,{name:"agendaWeek",incrementDate:function(a,b){return a.clone().stripTime().add(b,"weeks").startOf("week")},render:function(a){this.intervalStart=a.clone().stripTime().startOf("week"),this.intervalEnd=this.intervalStart.clone().add(1,"weeks"),this.start=this.skipHiddenDays(this.intervalStart),this.end=this.skipHiddenDays(this.intervalEnd,-1,!0),this.title=this.calendar.formatRange(this.start,this.end.clone().subtract(1),this.opt("titleFormat")," — "),ub.prototype.render.call(this,this.getCellsPerWeek())}}),Bb.agendaDay=wb,wb.prototype=A(ub.prototype),a.extend(wb.prototype,{name:"agendaDay",incrementDate:function(a,b){var c=a.clone().stripTime().add(b,"days");return c=this.skipHiddenDays(c,0>b?-1:1)},render:function(a){this.start=this.intervalStart=a.clone().stripTime(),this.end=this.intervalEnd=this.start.clone().add(1,"days"),this.title=this.calendar.formatDate(this.start,this.opt("titleFormat")),ub.prototype.render.call(this,1)}})});