From df765f93b44b62d26cb8fb99fd80a3aabd04a985 Mon Sep 17 00:00:00 2001 From: Konrad Michalik Date: Fri, 15 Jan 2016 12:43:32 +0100 Subject: [PATCH 1/2] Fixes #2 replaced moment().zone by moment().utcOffset --- dist/fullcalendar.js | 6 +++--- dist/fullcalendar.min.js | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dist/fullcalendar.js b/dist/fullcalendar.js index 40c7a32900..70e4d4ec27 100644 --- a/dist/fullcalendar.js +++ b/dist/fullcalendar.js @@ -2694,7 +2694,7 @@ function makeMoment(args, parseAsUTC, parseZone) { output._ambigZone = true; } else if (isSingleString) { - output.zone(input); // if not a valid zone, will assign UTC + output.utcOffset(input); // if not a valid zone, will assign UTC } } } @@ -2832,7 +2832,7 @@ FCMoment.prototype.hasZone = function() { }; // this method implicitly marks a zone -FCMoment.prototype.zone = function(tzo) { +FCMoment.prototype.utcOffset = function(tzo) { if (tzo != null) { // FYI, the delete statements need to be before the .zone() call or else chaos ensues @@ -2841,7 +2841,7 @@ FCMoment.prototype.zone = function(tzo) { delete this._ambigZone; } - return moment.fn.zone.apply(this, arguments); + return moment.fn.utcOffset.apply(this, arguments); }; // this method implicitly marks a zone diff --git a/dist/fullcalendar.min.js b/dist/fullcalendar.min.js index 6574335d63..4120271a89 100644 --- a/dist/fullcalendar.min.js +++ b/dist/fullcalendar.min.js @@ -3,6 +3,6 @@ * Docs & License: http://arshaw.com/fullcalendar/ * (c) 2014 Adam Shaw, Sean Kenny */ -(function(e){"function"==typeof define&&define.amd?define(["jquery","moment"],e):e(jQuery,moment)})(function(e,t){function n(e,t){return t.longDateFormat("LT").replace(":mm","(:mm)").replace(/(\Wmm)$/,"($1)").replace(/\s*a$/i,"t")}function r(e,t){var n=t.longDateFormat("L");return n=n.replace(/^Y+[^\w\s]*|[^\w\s]*Y+$/g,""),e.isRTL?n+=" ddd":n="ddd "+n,n}function a(e){o(_t,e)}function o(t){function n(n,r){e.isPlainObject(r)&&e.isPlainObject(t[n])&&!i(n)?t[n]=o({},t[n],r):void 0!==r&&(t[n]=r)}for(var r=1;arguments.length>r;r++)e.each(arguments[r],n);return t}function i(e){return/(Time|Duration)$/.test(e)}function s(n,r){function a(e){var n=t.localeData||t.langData;return n.call(t,e)||n.call(t,"en")}function i(e){ct?h()&&(w(),D(e)):s()}function s(){dt=at.theme?"ui":"fc",n.addClass("fc"),at.isRTL?n.addClass("fc-rtl"):n.addClass("fc-ltr"),at.theme&&n.addClass("ui-widget"),ct=e("
").prependTo(n),st=new l(nt,at),lt=st.render(),lt&&n.prepend(lt),g(at.defaultView),at.handleWindowResize&&e(window).resize(E),p()||d()}function d(){setTimeout(function(){!ut.start&&p()&&y()},0)}function v(){ut&&(K("viewDestroy",ut,ut,ut.element),ut.triggerEventDestroy()),e(window).unbind("resize",E),at.droppable&&e(document).off("dragstart",et).off("dragstop",tt),ut.selectionManagerDestroy&&ut.selectionManagerDestroy(),st.destroy(),ct.remove(),n.removeClass("fc fc-ltr fc-rtl ui-widget")}function h(){return n.is(":visible")}function p(){return e("body").is(":visible")}function g(e){ut&&e==ut.name||m(e)}function m(t){bt++,ut&&(K("viewDestroy",ut,ut,ut.element),W(),ut.triggerEventDestroy(),V(),ut.element.remove(),st.deactivateButton(ut.name)),st.activateButton(t),ut=new Ot[t](e("
").appendTo(ct),nt),y(),G(),bt--}function y(e){ut.start&&!e&&ht.isWithin(ut.intervalStart,ut.intervalEnd)||h()&&D(e)}function D(e){bt++,ut.start&&(K("viewDestroy",ut,ut,ut.element),W(),R()),V(),e&&(ht=ut.incrementDate(ht,e)),ut.render(ht.clone()),T(),G(),(ut.afterRender||k)(),F(),O(),K("viewRender",ut,ut,ut.element),bt--,z()}function b(){h()&&(W(),R(),w(),T(),M())}function w(){vt=at.contentHeight?at.contentHeight:at.height?at.height-(lt?lt.height():0)-C(ct):Math.round(ct.width()/Math.max(at.aspectRatio,.5))}function T(){void 0===vt&&w(),bt++,ut.setHeight(vt),ut.setWidth(ct.width()),bt--,ft=n.outerWidth()}function E(e){if(!bt&&e.target===window)if(ut.start){var t=++Dt;setTimeout(function(){t==Dt&&!bt&&h()&&ft!=(ft=n.outerWidth())&&(bt++,b(),ut.trigger("windowResize",yt),bt--)},at.windowResizeDelay)}else d()}function S(){R(),_()}function x(e){R(),M(e)}function M(e){h()&&(ut.renderEvents(wt,e),ut.trigger("eventAfterAllRender"))}function R(){ut.triggerEventDestroy(),ut.clearEvents(),ut.clearEventData()}function z(){!at.lazyFetching||gt(ut.start,ut.end)?_():M()}function _(){mt(ut.start,ut.end)}function H(e){wt=e,M()}function N(e){x(e)}function F(){st.updateTitle(ut.title)}function O(){var e=nt.getNow();e.isWithin(ut.intervalStart,ut.intervalEnd)?st.disableButton("today"):st.enableButton("today")}function A(e,t){ut.select(e,t)}function W(){ut&&ut.unselect()}function Y(){y(-1)}function L(){y(1)}function Z(){ht.add("years",-1),y()}function B(){ht.add("years",1),y()}function j(){ht=nt.getNow(),y()}function I(e){ht=nt.moment(e),y()}function $(e){ht.add(t.duration(e)),y()}function X(){return ht.clone()}function V(){ct.css({width:"100%",height:ct.height(),overflow:"hidden"})}function G(){ct.css({width:"",height:"",overflow:""})}function U(){return nt}function Q(){return ut}function J(e,t){return void 0===t?at[e]:(("height"==e||"contentHeight"==e||"aspectRatio"==e)&&(at[e]=t,b()),void 0)}function K(e,t){return at[e]?at[e].apply(t||yt,Array.prototype.slice.call(arguments,2)):void 0}function et(t,n){var r=t.target,a=e(r);if(!a.parents(".fc").length){var o=at.dropAccept;(e.isFunction(o)?o.call(r,a):a.is(o))&&(pt=r,ut.dragStart(pt,t,n))}}function tt(e,t){pt&&(ut.dragStop(pt,e,t),pt=null)}var nt=this;r=r||{};var rt,at=o({},_t,r);rt=at.lang in Ht?Ht[at.lang]:Ht[_t.lang],rt&&(at=o({},_t,rt,r)),at.isRTL&&(at=o({},_t,Nt,rt||{},r)),nt.options=at,nt.render=i,nt.destroy=v,nt.refetchEvents=S,nt.reportEvents=H,nt.reportEventChange=N,nt.rerenderEvents=x,nt.changeView=g,nt.select=A,nt.unselect=W,nt.prev=Y,nt.next=L,nt.prevYear=Z,nt.nextYear=B,nt.today=j,nt.gotoDate=I,nt.incrementDate=$,nt.getDate=X,nt.getCalendar=U,nt.getView=Q,nt.option=J,nt.trigger=K;var ot=f(a(at.lang));if(at.monthNames&&(ot._months=at.monthNames),at.monthNamesShort&&(ot._monthsShort=at.monthNamesShort),at.dayNames&&(ot._weekdays=at.dayNames),at.dayNamesShort&&(ot._weekdaysShort=at.dayNamesShort),null!=at.firstDay){var it=f(ot._week);it.dow=at.firstDay,ot._week=it}nt.defaultAllDayEventDuration=t.duration(at.defaultAllDayEventDuration),nt.defaultTimedEventDuration=t.duration(at.defaultTimedEventDuration),nt.moment=function(){var e;return"local"===at.timezone?(e=Ft.moment.apply(null,arguments),e.hasTime()&&e.local()):e="UTC"===at.timezone?Ft.moment.utc.apply(null,arguments):Ft.moment.parseZone.apply(null,arguments),"_locale"in e?e._locale=ot:e._lang=ot,e},nt.getIsAmbigTimezone=function(){return"local"!==at.timezone&&"UTC"!==at.timezone},nt.rezoneDate=function(e){return nt.moment(e.toArray())},nt.getNow=function(){var e=at.now;return"function"==typeof e&&(e=e()),nt.moment(e)},nt.calculateWeekNumber=function(e){var t=at.weekNumberCalculation;return"function"==typeof t?t(e):"local"===t?e.week():"ISO"===t.toUpperCase()?e.isoWeek():void 0},nt.getEventEnd=function(e){return e.end?e.end.clone():nt.getDefaultEventEnd(e.allDay,e.start)},nt.getDefaultEventEnd=function(e,t){var n=t.clone();return e?n.stripTime().add(nt.defaultAllDayEventDuration):n.add(nt.defaultTimedEventDuration),nt.getIsAmbigTimezone()&&n.stripZone(),n},nt.formatRange=function(e,t,n){return"function"==typeof n&&(n=n.call(nt,at,ot)),q(e,t,n,null,at.isRTL)},nt.formatDate=function(e,t){return"function"==typeof t&&(t=t.call(nt,at,ot)),P(e,t)},c.call(nt,at),u.call(nt,at);var st,lt,ct,dt,ut,ft,vt,ht,pt,gt=nt.isFetchNeeded,mt=nt.fetchEvents,yt=n[0],Dt=0,bt=0,wt=[];ht=null!=at.defaultDate?nt.moment(at.defaultDate):nt.getNow(),at.droppable&&e(document).on("dragstart",et).on("dragstop",tt)}function l(t,n){function r(){f=n.theme?"ui":"fc";var t=n.header;return t?v=e("").append(e("").append(o("left")).append(o("center")).append(o("right"))):void 0}function a(){v.remove()}function o(r){var a=e("",ot&&(r+=""),e=0;U>e;e++)t=ut(0,e),r+="";return r+=""}function d(){var e,t,n,r=rt+"-widget-content",a="";for(a+="",e=0;G>e;e++){for(a+="",ot&&(n=ut(e,0),a+=""),t=0;U>t;t++)n=ut(e,t),a+=u(n);a+=""}return a+=""}function u(e){var t=H.intervalStart.month(),r=n.getNow().stripTime(),a="",o=rt+"-widget-content",i=["fc-day","fc-"+Yt[e.day()],o];return e.month()!=t&&i.push("fc-other-month"),e.isSame(r,"day")?i.push("fc-today",rt+"-state-highlight"):r>e?i.push("fc-past"):i.push("fc-future"),a+=""}function f(t){$=t;var n,r,a,o=Math.max($-A.height(),0);"variable"==it("weekMode")?n=r=Math.floor(o/(1==G?2:6)):(n=Math.floor(o/G),r=o-n*(G-1)),B.each(function(t,o){G>t&&(a=e(o),a.find("> div").css("min-height",(t==G-1?r:n)-C(a)))})}function v(e){q=e,tt.clear(),nt.clear(),V=0,ot&&(V=A.find("th.fc-week-number").outerWidth()),X=Math.floor((q-V)/U),m(W.slice(0,-1),X)}function h(e){e.click(p).mousedown(dt)}function p(t){if(!it("selectable")){var r=n.moment(e(this).data("date"));st("dayClick",this,r,t)}}function g(e,t,n){n&&J.build();for(var r=vt(e,t),a=0;r.length>a;a++){var o=r[a];h(y(o.row,o.leftCol,o.row,o.rightCol))}}function y(e,n,r,a){var o=J.rect(e,n,r,a,t);return lt(o,t)}function D(e){return e.clone().stripTime().add(1,"days")}function b(e,t){g(e,t,!0)}function w(){ct()}function T(e,t){var n=ft(e),r=Z[n.row*U+n.col];st("dayClick",r,e,t)}function E(e,t){K.start(function(e){if(ct(),e){var t=ut(e),r=t.clone().add(n.defaultAllDayEventDuration);g(t,r)}},t)}function S(e,t,n){var r=K.stop();ct(),r&&st("drop",e,ut(r),t,n)}function x(e){return tt.left(e)}function k(e){return tt.right(e)}function M(e){return nt.left(e)}function R(e){return nt.right(e)}function z(e){return L.eq(e)}var H=this;H.renderBasic=a,H.setHeight=f,H.setWidth=v,H.renderDayOverlay=g,H.defaultSelectionEnd=D,H.renderSelection=b,H.clearSelection=w,H.reportDayClick=T,H.dragStart=E,H.dragStop=S,H.getHoverListener=function(){return K},H.colLeft=x,H.colRight=k,H.colContentLeft=M,H.colContentRight=R,H.getIsCellAllDay=function(){return!0},H.allDayRow=z,H.getRowCnt=function(){return G},H.getColCnt=function(){return U},H.getColWidth=function(){return X},H.getDaySegmentContainer=function(){return I},bt.call(H,t,n,r),xt.call(H),St.call(H),et.call(H);var O,A,W,Y,L,Z,B,P,j,I,q,$,X,V,G,U,Q,J,K,tt,nt,rt,at,ot,it=H.opt,st=H.trigger,lt=H.renderOverlay,ct=H.clearOverlays,dt=H.daySelectionMousedown,ut=H.cellToDate,ft=H.dateToCell,vt=H.rangeToSegments,ht=n.formatDate,pt=n.calculateWeekNumber;N(t.addClass("fc-grid")),J=new kt(function(t,n){var r,a,o;W.each(function(t,i){r=e(i),a=r.offset().left,t&&(o[1]=a),o=[a],n[t]=o}),o[1]=a+r.outerWidth(),L.each(function(n,i){G>n&&(r=e(i),a=r.offset().top,n&&(o[1]=a),o=[a],t[n]=o)}),o[1]=a+r.outerHeight()}),K=new Mt(J),tt=new zt(function(e){return P.eq(e)}),nt=new zt(function(e){return j.eq(e)})}function et(){function e(e,t){n.renderDayEvents(e,t)}function t(){n.getDaySegmentContainer().empty()}var n=this;n.renderEvents=e,n.clearEvents=t,wt.call(n)}function tt(e,t){function n(e,t){return e.clone().stripTime().add("weeks",t).startOf("week")}function r(e){a.intervalStart=e.clone().stripTime().startOf("week"),a.intervalEnd=a.intervalStart.clone().add("weeks",1),a.start=a.skipHiddenDays(a.intervalStart),a.end=a.skipHiddenDays(a.intervalEnd,-1,!0),a.title=t.formatRange(a.start,a.end.clone().subtract(1),a.opt("titleFormat")," — "),a.renderAgenda(a.getCellsPerWeek())}var a=this;a.incrementDate=n,a.render=r,ot.call(a,e,t,"agendaWeek")}function nt(e,t){function n(e,t){var n=e.clone().stripTime().add(t,"days");return n=a.skipHiddenDays(n,0>t?-1:1)}function r(e){a.start=a.intervalStart=e.clone().stripTime(),a.end=a.intervalEnd=a.start.clone().add(1,"days"),a.title=t.formatDate(a.start,a.opt("titleFormat")),a.renderAgenda(1)}var a=this;a.incrementDate=n,a.render=r,ot.call(a,e,t,"agendaDay")}function rt(e,t){return t.longDateFormat("LT").replace(":mm","(:mm)").replace(/(\Wmm)$/,"($1)").replace(/\s*a$/i,"a")}function at(e,t){return t.longDateFormat("LT").replace(/\s*a$/i,"")}function ot(n,r,a){function o(e){Tt=e,i(),$?l():s()}function i(){Nt=Lt("theme")?"ui":"fc",Ft=Lt("isRTL"),Wt=Lt("columnFormat"),Ot=t.duration(Lt("minTime")),At=t.duration(Lt("maxTime")),gt=t.duration(Lt("slotDuration")),yt=Lt("snapDuration"),yt=yt?t.duration(yt):gt}function s(){var r,a,o,i,s=Nt+"-widget-header",c=Nt+"-widget-content",d=0===gt.asMinutes()%15;for(l(),tt=e("
").appendTo(n),Lt("allDaySlot")?(nt=e("
").appendTo(tt),r="
"),o=n.header[r];return o&&e.each(o.split(" "),function(r){r>0&&a.append("");var o;e.each(this.split(","),function(r,i){if("title"==i)a.append("

 

"),o&&o.addClass(f+"-corner-right"),o=null;else{var s;if(t[i]?s=t[i]:Ot[i]&&(s=function(){h.removeClass(f+"-state-hover"),t.changeView(i)}),s){var l,c=z(n.themeButtonIcons,i),d=z(n.buttonIcons,i),u=z(n.defaultButtonText,i),v=z(n.buttonText,i);l=v?_(v):c&&n.theme?"":d&&!n.theme?"":_(u||i);var h=e(""+l+"").click(function(){h.hasClass(f+"-state-disabled")||s()}).mousedown(function(){h.not("."+f+"-state-active").not("."+f+"-state-disabled").addClass(f+"-state-down")}).mouseup(function(){h.removeClass(f+"-state-down")}).hover(function(){h.not("."+f+"-state-active").not("."+f+"-state-disabled").addClass(f+"-state-hover")},function(){h.removeClass(f+"-state-hover").removeClass(f+"-state-down")}).appendTo(a);N(h),o||h.addClass(f+"-corner-left"),o=h}}}),o&&o.addClass(f+"-corner-right")}),a}function i(e){v.find("h2").html(e)}function s(e){v.find("span.fc-button-"+e).addClass(f+"-state-active")}function l(e){v.find("span.fc-button-"+e).removeClass(f+"-state-active")}function c(e){v.find("span.fc-button-"+e).addClass(f+"-state-disabled")}function d(e){v.find("span.fc-button-"+e).removeClass(f+"-state-disabled")}var u=this;u.render=r,u.destroy=a,u.updateTitle=i,u.activateButton=s,u.deactivateButton=l,u.disableButton=c,u.enableButton=d;var f,v=e([])}function c(t){function n(e,t){return!E||e.clone().stripZone()S.clone().stripZone()}function r(e,t){E=e,S=t,O=[];var n=++H,r=_.length;N=r;for(var o=0;r>o;o++)a(_[o],n)}function a(t,n){o(t,function(r){var a,o,i=e.isArray(t.events);if(n==H){if(r)for(a=0;r.length>a;a++)o=r[a],i||(o=b(o,t)),o&&O.push(o);N--,N||M(O)}})}function o(n,r){var a,i,s=Ft.sourceFetchers;for(a=0;s.length>a;a++){if(i=s[a].call(C,n,E.clone(),S.clone(),t.timezone,r),i===!0)return;if("object"==typeof i)return o(i,r),void 0}var l=n.events;if(l)e.isFunction(l)?(y(),l.call(C,E.clone(),S.clone(),t.timezone,function(e){r(e),D()})):e.isArray(l)?r(l):r();else{var c=n.url;if(c){var d,u=n.success,f=n.error,v=n.complete;d=e.isFunction(n.data)?n.data():n.data;var h=e.extend({},d||{}),p=W(n.startParam,t.startParam),g=W(n.endParam,t.endParam),m=W(n.timezoneParam,t.timezoneParam);p&&(h[p]=E.format()),g&&(h[g]=S.format()),t.timezone&&"local"!=t.timezone&&(h[m]=t.timezone),y(),e.ajax(e.extend({},At,n,{data:h,success:function(t){t=t||[];var n=A(u,this,arguments);e.isArray(n)&&(t=n),r(t)},error:function(){A(f,this,arguments),r()},complete:function(){A(v,this,arguments),D()}}))}else r()}}function i(e){var t=s(e);t&&(_.push(t),N++,a(t,H))}function s(t){var n,r,a=Ft.sourceNormalizers;if(e.isFunction(t)||e.isArray(t)?n={events:t}:"string"==typeof t?n={url:t}:"object"==typeof t&&(n=e.extend({},t),"string"==typeof n.className&&(n.className=n.className.split(/\s+/))),n){for(e.isArray(n.events)&&(n.origArray=n.events,n.events=e.map(n.events,function(e){return b(e,n)})),r=0;a.length>r;r++)a[r].call(C,n);return n}}function l(t){_=e.grep(_,function(e){return!c(e,t)}),O=e.grep(O,function(e){return!c(e.source,t)}),M(O)}function c(e,t){return e&&t&&u(e)==u(t)}function u(e){return("object"==typeof e?e.origArray||e.url||e.events:null)||e}function f(e){e.start=C.moment(e.start),e.end&&(e.end=C.moment(e.end)),w(e),v(e),M(O)}function v(e){var t,n,r,a;for(t=0;O.length>t;t++)if(n=O[t],n._id==e._id&&n!==e)for(r=0;Y.length>r;r++)a=Y[r],void 0!==e[a]&&(n[a]=e[a])}function p(e,t){var n=b(e);n&&(n.source||(t&&(z.events.push(n),n.source=z),O.push(n)),M(O))}function g(t){var n,r;for(null==t?t=function(){return!0}:e.isFunction(t)||(n=t+"",t=function(e){return e._id==n}),O=e.grep(O,t,!0),r=0;_.length>r;r++)e.isArray(_[r].events)&&(_[r].events=e.grep(_[r].events,t,!0));M(O)}function m(t){return e.isFunction(t)?e.grep(O,t):null!=t?(t+="",e.grep(O,function(e){return e._id==t})):O}function y(){F++||x("loading",null,!0,k())}function D(){--F||x("loading",null,!1,k())}function b(n,r){var a,o,i,s,l={};return t.eventDataTransform&&(n=t.eventDataTransform(n)),r&&r.eventDataTransform&&(n=r.eventDataTransform(n)),a=C.moment(n.start||n.date),a.isValid()&&(o=null,!n.end||(o=C.moment(n.end),o.isValid()))?(i=n.allDay,void 0===i&&(s=W(r?r.allDayDefault:void 0,t.allDayDefault),i=void 0!==s?s:!(a.hasTime()||o&&o.hasTime())),i?(a.hasTime()&&a.stripTime(),o&&o.hasTime()&&o.stripTime()):(a.hasTime()||(a=C.rezoneDate(a)),o&&!o.hasTime()&&(o=C.rezoneDate(o))),e.extend(l,n),r&&(l.source=r),l._id=n._id||(void 0===n.id?"_fc"+Wt++:n.id+""),l.className=n.className?"string"==typeof n.className?n.className.split(/\s+/):n.className:[],l.resources?("number"==typeof l.resources&&(l.resources=[l.resources]),"string"==typeof l.resources&&(l.resources=l.resources.split(/\s+/))):l.resources=[],l.allDay=i,l.start=a,l.end=o,t.forceEventDuration&&!l.end&&(l.end=R(l)),d(l),l):void 0}function w(e,t,n){var r,a,o,i,s=e._allDay,l=e._start,c=e._end,d=!1;return t||n||(t=e.start,n=e.end),r=e.allDay!=s?e.allDay:!(t||n).hasTime(),r&&(t&&(t=t.clone().stripTime()),n&&(n=n.clone().stripTime())),t&&(a=r?h(t,l.clone().stripTime()):h(t,l)),r!=s?d=!0:n&&(o=h(n||C.getDefaultEventEnd(r,t||l),t||l).subtract(h(c||C.getDefaultEventEnd(s,l),l))),i=T(m(e._id),d,r,a,o),{dateDelta:a,durationDelta:o,undo:i}}function T(n,r,a,o,i){var s=C.getIsAmbigTimezone(),l=[];return e.each(n,function(e,n){var c=n._allDay,u=n._start,f=n._end,v=null!=a?a:c,h=u.clone(),p=!r&&f?f.clone():null;v?(h.stripTime(),p&&p.stripTime()):(h.hasTime()||(h=C.rezoneDate(h)),p&&!p.hasTime()&&(p=C.rezoneDate(p))),p||!t.forceEventDuration&&!+i||(p=C.getDefaultEventEnd(v,h)),h.add(o),p&&p.add(o).add(i),s&&(+o||+i)&&(h.stripZone(),p&&p.stripZone()),n.allDay=v,n.start=h,n.end=p,d(n),l.push(function(){n.allDay=c,n.start=u,n.end=f,d(n)})}),function(){for(var e=0;l.length>e;e++)l[e]()}}var C=this;C.isFetchNeeded=n,C.fetchEvents=r,C.addEventSource=i,C.removeEventSource=l,C.updateEvent=f,C.renderEvent=p,C.removeEvents=g,C.clientEvents=m,C.mutateEvent=w;var E,S,x=C.trigger,k=C.getView,M=C.reportEvents,R=C.getEventEnd,z={events:[]},_=[z],H=0,N=0,F=0,O=[];e.each((t.events?[t.events]:[]).concat(t.eventSources||[]),function(e,t){var n=s(t);n&&_.push(n)});var Y=["title","url","allDay","className","editable","color","backgroundColor","borderColor","textColor"]}function d(e){e._allDay=e.allDay,e._start=e.start.clone(),e._end=e.end?e.end.clone():null}function u(t){function n(t){u=[];var n;if(e.isFunction(t))n={resources:t},u.push(n),c=void 0;else if("string"==typeof t)n={url:t},u.push(n),c=void 0;else if("object"==typeof t&&null!=t){for(var r=0;t.length>r;r++){var a=t[r];o(a),n={resources:a},u.push(n)}c=void 0}}function r(n,r){if(n=n!==void 0?n:!0,!n||void 0===c){c=[];for(var o=u.length,i=0;o>i;i++){var s=a(u[i],r);c=c.concat(s)}}return e.isFunction(t.resourceFilter)?e.grep(c,t.resourceFilter):c}function a(n,r){var a=n.resources;if(a){if(e.isFunction(a))return a()}else{var o=n.url;if(o){var i={};if("object"==typeof r){var s=t.startParam,l=t.endParam;s&&(i[s]=Math.round(+r.intervalStart/1e3)),l&&(i[l]=Math.round(+r.intervalEnd/1e3))}e.ajax(e.extend({},At,n,{data:i,dataType:"json",cache:!1,success:function(e){e=e||[],a=e},error:function(){},async:!1}))}}return a}function o(e){e.className?"string"==typeof e.className&&(e.className=e.className.split(/\s+/)):e.className=[];for(var t=Ft.sourceNormalizers,n=0;t.length>n;n++)t[n](e)}function i(e,t,n,r){var a,o,i,c,d=e._allDay,u=e._start,f=e._end,v=!1;return n||r||(n=e.start,r=e.end),a=e.allDay!=d?e.allDay:!(n||r).hasTime(),a&&(n&&(n=n.clone().stripTime()),r&&(r=r.clone().stripTime())),n&&(o=a?h(n,u.clone().stripTime()):h(n,u)),a!=d?v=!0:r&&(i=h(r||l.getDefaultEventEnd(a,n||u),n||u).subtract(h(f||l.getDefaultEventEnd(d,u),u))),c=s(l.clientEvents(e._id),v,a,o,i,t),{dateDelta:o,durationDelta:i,undo:c}}function s(n,r,a,o,i,s){var c=l.getIsAmbigTimezone(),u=[];return e.each(n,function(e,n){var f=n.resources,v=n._allDay,h=n._start,p=n._end,g=null!=a?a:v,m=h.clone(),y=!r&&p?p.clone():null;g?(m.stripTime(),y&&y.stripTime()):(m.hasTime()||(m=l.rezoneDate(m)),y&&!y.hasTime()&&(y=l.rezoneDate(y))),y||!t.forceEventDuration&&!+i||(y=l.getDefaultEventEnd(g,m)),m.add(o),y&&y.add(o).add(i),c&&(+o||+i)&&(m.stripZone(),y&&y.stripZone()),n.allDay=g,n.start=m,n.end=y,n.resources=s,d(n),u.push(function(){n.allDay=v,n.start=h,n.end=p,n.resources=f,d(n)})}),function(){for(var e=0;u.length>e;e++)u[e]()}}var l=this;l.fetchResources=r,l.setResources=n,l.mutateResourceEvent=i;var c,u=[];n(t.resources)}function f(e){var t=function(){};return t.prototype=e,new t}function v(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])}function h(e,n){return t.duration({days:e.clone().stripTime().diff(n.clone().stripTime(),"days"),ms:e.time()-n.time()})}function p(e){return"[object Date]"===Object.prototype.toString.call(e)||e instanceof Date}function g(t,n,r){t.unbind("mouseover").mouseover(function(t){for(var a,o,i,s=t.target;s!=this;)a=s,s=s.parentNode;void 0!==(o=a._fci)&&(a._fci=void 0,i=n[o],r(i.event,i.element,i),e(t.target).trigger(t)),t.stopPropagation()})}function m(t,n,r){for(var a,o=0;t.length>o;o++)a=e(t[o]),a.width(Math.max(0,n-D(a,r)))}function y(t,n,r){for(var a,o=0;t.length>o;o++)a=e(t[o]),a.height(Math.max(0,n-C(a,r)))}function D(e,t){return b(e)+T(e)+(t?w(e):0)}function b(t){return(parseFloat(e.css(t[0],"paddingLeft",!0))||0)+(parseFloat(e.css(t[0],"paddingRight",!0))||0)}function w(t){return(parseFloat(e.css(t[0],"marginLeft",!0))||0)+(parseFloat(e.css(t[0],"marginRight",!0))||0)}function T(t){return(parseFloat(e.css(t[0],"borderLeftWidth",!0))||0)+(parseFloat(e.css(t[0],"borderRightWidth",!0))||0)}function C(e,t){return E(e)+x(e)+(t?S(e):0)}function E(t){return(parseFloat(e.css(t[0],"paddingTop",!0))||0)+(parseFloat(e.css(t[0],"paddingBottom",!0))||0)}function S(t){return(parseFloat(e.css(t[0],"marginTop",!0))||0)+(parseFloat(e.css(t[0],"marginBottom",!0))||0)}function x(t){return(parseFloat(e.css(t[0],"borderTopWidth",!0))||0)+(parseFloat(e.css(t[0],"borderBottomWidth",!0))||0)}function k(){}function M(e,t){return e-t}function R(e){return Math.max.apply(Math,e)}function z(e,t){if(e=e||{},void 0!==e[t])return e[t];for(var n,r=t.split(/(?=[A-Z])/),a=r.length-1;a>=0;a--)if(n=e[r[a].toLowerCase()],void 0!==n)return n;return e["default"]}function _(e){return(e+"").replace(/&/g,"&").replace(//g,">").replace(/'/g,"'").replace(/"/g,""").replace(/\n/g,"
")}function H(e){return e.replace(/&.*?;/g,"")}function N(e){e.attr("unselectable","on").css("MozUserSelect","none").bind("selectstart.ui",function(){return!1})}function F(e){e.children().removeClass("fc-first fc-last").filter(":first-child").addClass("fc-first").end().filter(":last-child").addClass("fc-last")}function O(e,t){var n=e.source||{},r=e.color,a=n.color,o=t("eventColor"),i=e.backgroundColor||r||n.backgroundColor||a||t("eventBackgroundColor")||o,s=e.borderColor||r||n.borderColor||a||t("eventBorderColor")||o,l=e.textColor||n.textColor||t("eventTextColor"),c=[];return i&&c.push("background-color:"+i),s&&c.push("border-color:"+s),l&&c.push("color:"+l),c.join(";")}function A(t,n,r){if(e.isFunction(t)&&(t=[t]),t){var a,o;for(a=0;t.length>a;a++)o=t[a].apply(n,r)||o;return o}}function W(){for(var e=0;arguments.length>e;e++)if(void 0!==arguments[e])return arguments[e]}function Y(n,r,a){var o,i,s,l,c=n[0],d=1==n.length&&"string"==typeof c;return t.isMoment(c)?(l=t.apply(null,n),c._ambigTime&&(l._ambigTime=!0),c._ambigZone&&(l._ambigZone=!0)):p(c)||void 0===c?l=t.apply(null,n):(o=!1,i=!1,d?Lt.test(c)?(c+="-01",n=[c],o=!0,i=!0):(s=Zt.exec(c))&&(o=!s[5],i=!0):e.isArray(c)&&(i=!0),l=r?t.utc.apply(t,n):t.apply(null,n),o?(l._ambigTime=!0,l._ambigZone=!0):a&&(i?l._ambigZone=!0:d&&l.zone(c))),new L(l)}function L(e){v(this,e)}function Z(e){var t,n=[],r=!1,a=!1;for(t=0;e.length>t;t++)n.push(Ft.moment(e[t])),r=r||n[t]._ambigTime,a=a||n[t]._ambigZone;for(t=0;n.length>t;t++)r?n[t].stripTime():a&&n[t].stripZone();return n}function B(e,n){return t.fn.format.call(e,n)}function P(e,t){return j(e,V(t))}function j(e,t){var n,r="";for(n=0;t.length>n;n++)r+=I(e,t[n]);return r}function I(e,t){var n,r;return"string"==typeof t?t:(n=t.token)?Bt[n]?Bt[n](e):B(e,n):t.maybe&&(r=j(e,t.maybe),r.match(/[1-9]/))?r:""}function q(e,t,n,r,a){var o;return e=Ft.moment.parseZone(e),t=Ft.moment.parseZone(t),o=(e.localeData||e.lang).call(e),n=o.longDateFormat(n)||n,r=r||" - ",$(e,t,V(n),r,a)}function $(e,t,n,r,a){var o,i,s,l,c="",d="",u="",f="",v="";for(i=0;n.length>i&&(o=X(e,t,n[i]),o!==!1);i++)c+=o;for(s=n.length-1;s>i&&(o=X(e,t,n[s]),o!==!1);s--)d=o+d;for(l=i;s>=l;l++)u+=I(e,n[l]),f+=I(t,n[l]);return(u||f)&&(v=a?f+r+u:u+r+f),c+v+d}function X(e,t,n){var r,a;return"string"==typeof n?n:(r=n.token)&&(a=Pt[r.charAt(0)],a&&e.isSame(t,a))?B(e,r):!1}function V(e){return e in jt?jt[e]:jt[e]=G(e)}function G(e){for(var t,n=[],r=/\[([^\]]*)\]|\(([^\)]*)\)|(LT|(\w)\4*o?)|([^\w\[\(]+)/g;t=r.exec(e);)t[1]?n.push(t[1]):t[2]?n.push({maybe:G(t[2])}):t[3]?n.push({token:t[3]}):t[5]&&n.push(t[5]);return n}function U(e,t){function n(e,t){return e.clone().stripTime().add("months",t).startOf("month")}function r(e){a.intervalStart=e.clone().stripTime().startOf("month"),a.intervalEnd=a.intervalStart.clone().add("months",1),a.start=a.intervalStart.clone(),a.start=a.skipHiddenDays(a.start),a.start.startOf("week"),a.start=a.skipHiddenDays(a.start),a.end=a.intervalEnd.clone(),a.end=a.skipHiddenDays(a.end,-1,!0),a.end.add((7-a.end.weekday())%7,"days"),a.end=a.skipHiddenDays(a.end,-1,!0);var n=Math.ceil(a.end.diff(a.start,"weeks",!0));"fixed"==a.opt("weekMode")&&(a.end.add("weeks",6-n),n=6),a.title=t.formatDate(a.intervalStart,a.opt("titleFormat")),a.renderBasic(n,a.getCellsPerWeek(),!0)}var a=this;a.incrementDate=n,a.render=r,K.call(a,e,t,"month")}function Q(e,t){function n(e,t){return e.clone().stripTime().add("weeks",t).startOf("week")}function r(e){a.intervalStart=e.clone().stripTime().startOf("week"),a.intervalEnd=a.intervalStart.clone().add("weeks",1),a.start=a.skipHiddenDays(a.intervalStart),a.end=a.skipHiddenDays(a.intervalEnd,-1,!0),a.title=t.formatRange(a.start,a.end.clone().subtract(1),a.opt("titleFormat")," — "),a.renderBasic(1,a.getCellsPerWeek(),!1)}var a=this;a.incrementDate=n,a.render=r,K.call(a,e,t,"basicWeek")}function J(e,t){function n(e,t){var n=e.clone().stripTime().add(t,"days");return n=a.skipHiddenDays(n,0>t?-1:1)}function r(e){a.start=a.intervalStart=e.clone().stripTime(),a.end=a.intervalEnd=a.start.clone().add(1,"days"),a.title=t.formatDate(a.start,a.opt("titleFormat")),a.renderBasic(1,1,!1)}var a=this;a.incrementDate=n,a.render=r,K.call(a,e,t,"basicDay")}function K(t,n,r){function a(e,t,n){G=e,U=t,Q=n,o(),Y||i(),s()}function o(){rt=it("theme")?"ui":"fc",at=it("columnFormat"),ot=it("weekNumbers")}function i(){I=e("
").appendTo(t)}function s(){var n=l();O&&O.remove(),O=e(n).appendTo(t),A=O.find("thead"),W=A.find(".fc-day-header"),Y=O.find("tbody"),L=Y.find("tr"),Z=Y.find(".fc-day"),B=L.find("td:first-child"),P=L.eq(0).find(".fc-day > div"),j=L.eq(0).find(".fc-day-content > div"),F(A.add(A.find("tr"))),F(L),L.eq(0).addClass("fc-first"),L.filter(":last").addClass("fc-last"),Z.each(function(t,n){var r=ut(Math.floor(t/U),t%U);st("dayRender",H,r,e(n))}),h(Z)}function l(){var e=""+c()+d()+"
";return e}function c(){var e,t,n=rt+"-widget-header",r="";for(r+="
"+_(it("weekNumberTitle"))+""+_(ht(t,at))+"
"+"
"+_(pt(n))+"
"+"
"+"
",Q&&(a+="
"+e.date()+"
"),a+="
 
"+""+""+""+"
"+(Lt("allDayHTML")||_(Lt("allDayText")))+""+"
"+"
 
",rt=e(r).appendTo(tt),at=rt.find("tr"),g(at.find("td")),tt.append("
"+"
"+"
")):nt=e([]),ot=e("
").appendTo(tt),st=e("
").appendTo(ot),lt=e("
").appendTo(st),r="",a=t.duration(+Ot),Ct=0;At>a;)o=q.start.clone().time(a),i=o.minutes(),r+=""+""+""+"",a.add(gt),Ct++;r+="
"+(d&&i?" ":_(Ut(o,Lt("axisFormat"))))+""+"
 
"+"
",ct=e(r).appendTo(st),D(ct.find("td"))}function l(){var t=c();$&&$.remove(),$=e(t).appendTo(n),X=$.find("thead"),V=X.find("th").slice(1,-1),G=$.find("tbody"),U=G.find("td").slice(0,-1),Q=U.find("> div"),J=U.find(".fc-day-content > div"),K=U.eq(0),et=Q.eq(0),F(X.add(X.find("tr"))),F(G.add(G.find("tr")))}function c(){var e=""+d()+u()+"
";return e}function d(){var e,t,n,r=Nt+"-widget-header",a="";for(a+="",Lt("weekNumbers")?(e=Xt(0,0),t=Qt(e),Ft?t+=Lt("weekNumberTitle"):t=Lt("weekNumberTitle")+t,a+=""+_(t)+""):a+=" ",n=0;Tt>n;n++)e=Xt(0,n),a+=""+_(Ut(e,Wt))+"";return a+=" "+""+""}function u(){var e,t,n,a,o,i=Nt+"-widget-header",s=Nt+"-widget-content",l=r.getNow().stripTime(),c="";for(c+=" ",n="",t=0;Tt>t;t++)e=Xt(0,t),o=["fc-col"+t,"fc-"+Yt[e.day()],s],e.isSame(l,"day")?o.push(Nt+"-state-highlight","fc-today"):l>e?o.push("fc-past"):o.push("fc-future"),a=""+"
"+"
"+"
 
"+"
"+"
"+"",n+=a;return c+=n,c+=" "+""+""}function f(e){void 0===e&&(e=ft),ft=e,Jt={};var t=G.position().top,n=ot.position().top,r=Math.min(e-t,ct.height()+n+1);et.height(r-C(K)),tt.css("top",t),ot.height(r-n-1);var a=ct.find("tr:first").height()+1,o=ct.find("tr:eq(1)").height();mt=(a+o)/2,Dt=gt/yt,wt=mt/Dt}function v(t){ut=t,_t.clear(),Ht.clear();var n=X.find("th:first");rt&&(n=n.add(rt.find("th:first"))),n=n.add(ct.find("th:first")),vt=0,m(n.width("").each(function(t,n){vt=Math.max(vt,e(n).outerWidth())}),vt);var r=$.find(".fc-agenda-gutter");rt&&(r=r.add(rt.find("th.fc-agenda-gutter")));var a=ot[0].clientWidth;pt=ot.width()-a,pt?(m(r,pt),r.show().prev().removeClass("fc-last")):r.hide().prev().addClass("fc-last"),ht=Math.floor((a-vt)/Tt),m(V.slice(0,-1),ht)}function h(){function e(){ot.scrollTop(n)}var n=A(t.duration(Lt("scrollTime")))+1;e(),setTimeout(e,0)}function p(){h()}function g(e){e.click(b).mousedown(qt)}function D(e){e.click(b).mousedown(B)}function b(e){if(!Lt("selectable")){var t=Math.min(Tt-1,Math.floor((e.pageX-$.offset().left-vt)/ht)),n=Xt(0,t),a=this.parentNode.className.match(/fc-slot(\d+)/);if(a){var o=parseInt(a[1],10);n.add(Ot+o*gt),n=r.rezoneDate(n),Zt("dayClick",U[t],n,e)}else Zt("dayClick",U[t],n,e)}}function w(e,t,n){n&&Et.build();for(var r=Gt(e,t),a=0;r.length>a;a++){var o=r[a];g(T(o.row,o.leftCol,o.row,o.rightCol))}}function T(e,t,n,r){var a=Et.rect(e,t,n,r,tt);return Bt(a,tt)}function E(e,t){e=e.clone().stripZone(),t=t.clone().stripZone();for(var n=0;Tt>n;n++){var r=Xt(0,n),a=r.clone().add(1,"days"),o=e>r?e:r,i=t>a?a:t;if(i>o){var s=Et.rect(0,n,0,n,st),l=O(o,r),c=O(i,r);s.top=l,s.height=c-l,D(Bt(s,st))}}}function S(e){return _t.left(e)}function x(e){return Ht.left(e)}function k(e){return _t.right(e)}function R(e){return Ht.right(e)}function z(e){return Lt("allDaySlot")&&!e.row}function H(e){var n=Xt(0,e.col),a=e.row;return Lt("allDaySlot")&&a--,a>=0&&(n.time(t.duration(Ot+a*yt)),n=r.rezoneDate(n)),n}function O(e,n){return A(t.duration(e.clone().stripZone()-n.clone().stripTime()))}function A(e){if(Ot>e)return 0;if(e>=At)return ct.height();var t=(e-Ot)/gt,n=Math.floor(t),r=t-n,a=Jt[n];void 0===a&&(a=Jt[n]=ct.find("tr").eq(n).find("td div")[0].offsetTop); -var o=a-1+r*mt;return o=Math.max(o,0)}function W(e){return e.hasTime()?e.clone().add(gt):e.clone().add(1,"days")}function Y(e,t){e.hasTime()||t.hasTime()?L(e,t):Lt("allDaySlot")&&w(e,t,!0)}function L(t,n){var r=Lt("selectHelper");if(Et.build(),r){var a=Vt(t).col;if(a>=0&&Tt>a){var o=Et.rect(0,a,0,a,st),i=O(t,t),s=O(n,t);if(s>i){if(o.top=i,o.height=s-i,o.left+=2,o.width-=5,e.isFunction(r)){var l=r(t,n);l&&(o.position="absolute",dt=e(l).css(o).appendTo(st))}else o.isStart=!0,o.isEnd=!0,dt=e($t({title:"",start:t,end:n,className:["fc-select-helper"],editable:!1},o)),dt.css("opacity",Lt("dragOpacity"));dt&&(D(dt),st.append(dt),m(dt,o.width,!0),y(dt,o.height,!0))}}}else E(t,n)}function Z(){Pt(),dt&&(dt.remove(),dt=null)}function B(t){if(1==t.which&&Lt("selectable")){It(t);var n;Rt.start(function(e,t){if(Z(),e&&e.col==t.col&&!z(e)){var r=H(t),a=H(e);n=[r,r.clone().add(yt),a,a.clone().add(yt)].sort(M),L(n[0],n[3])}else n=null},t),e(document).one("mouseup",function(e){Rt.stop(),n&&(+n[0]==+n[1]&&P(n[0],e),jt(n[0],n[3],e))})}}function P(e,t){Zt("dayClick",U[Vt(e).col],e,t)}function j(e,t){Rt.start(function(e){if(Pt(),e){var t=H(e),n=t.clone();t.hasTime()?(n.add(r.defaultTimedEventDuration),E(t,n)):(n.add(r.defaultAllDayEventDuration),w(t,n))}},t)}function I(e,t,n){var r=Rt.stop();Pt(),r&&Zt("drop",e,H(r),t,n)}var q=this;q.renderAgenda=o,q.setWidth=v,q.setHeight=f,q.afterRender=p,q.computeDateTop=O,q.getIsCellAllDay=z,q.allDayRow=function(){return at},q.getCoordinateGrid=function(){return Et},q.getHoverListener=function(){return Rt},q.colLeft=S,q.colRight=k,q.colContentLeft=x,q.colContentRight=R,q.getDaySegmentContainer=function(){return nt},q.getSlotSegmentContainer=function(){return lt},q.getSlotContainer=function(){return st},q.getRowCnt=function(){return 1},q.getColCnt=function(){return Tt},q.getColWidth=function(){return ht},q.getSnapHeight=function(){return wt},q.getSnapDuration=function(){return yt},q.getSlotHeight=function(){return mt},q.getSlotDuration=function(){return gt},q.getMinTime=function(){return Ot},q.getMaxTime=function(){return At},q.defaultSelectionEnd=W,q.renderDayOverlay=w,q.renderSelection=Y,q.clearSelection=Z,q.reportDayClick=P,q.dragStart=j,q.dragStop=I,bt.call(q,n,r,a),xt.call(q),St.call(q),it.call(q);var $,X,V,G,U,Q,J,K,et,tt,nt,rt,at,ot,st,lt,ct,dt,ut,ft,vt,ht,pt,gt,mt,yt,Dt,wt,Tt,Ct,Et,Rt,_t,Ht,Nt,Ft,Ot,At,Wt,Lt=q.opt,Zt=q.trigger,Bt=q.renderOverlay,Pt=q.clearOverlays,jt=q.reportSelection,It=q.unselect,qt=q.daySelectionMousedown,$t=q.slotSegHtml,Xt=q.cellToDate,Vt=q.dateToCell,Gt=q.rangeToSegments,Ut=r.formatDate,Qt=r.calculateWeekNumber,Jt={};N(n.addClass("fc-agenda")),Et=new kt(function(t,n){function r(e){return Math.max(l,Math.min(c,e))}var a,o,i;V.each(function(t,r){a=e(r),o=a.offset().left,t&&(i[1]=o),i=[o],n[t]=i}),i[1]=o+a.outerWidth(),Lt("allDaySlot")&&(a=at,o=a.offset().top,t[0]=[o,o+a.outerHeight()]);for(var s=st.offset().top,l=ot.offset().top,c=l+ot.outerHeight(),d=0;Ct*Dt>d;d++)t.push([r(s+wt*d),r(s+wt*(d+1))])}),Rt=new Mt(Et),_t=new zt(function(e){return Q.eq(e)}),Ht=new zt(function(e){return J.eq(e)})}function it(){function n(e,t){var n,r=e.length,o=[],s=[];for(n=0;r>n;n++)e[n].allDay?o.push(e[n]):s.push(e[n]);v("allDaySlot")&&(X(o,t),w()),i(a(s),t)}function r(){T().empty(),E().empty()}function a(e){var t,n,r,a,i,s=H(),l=V(),c=G(),d=[];for(n=0;s>n;n++)for(t=z(0,n),i=o(e,t.clone().time(l),t.clone().time(c)),i=st(i),r=0;i.length>r;r++)a=i[r],a.col=n,d.push(a);return d}function o(e,t,n){t=t.clone().stripZone(),n=n.clone().stripZone();var r,a,o,i,s,l,c,d,u=[],f=e.length;for(r=0;f>r;r++)a=e[r],o=a.start.clone().stripZone(),i=J(a).stripZone(),i>t&&n>o&&(t>o?(s=t.clone(),c=!1):(s=o,c=!0),i>n?(l=n.clone(),d=!1):(l=i,d=!0),u.push({event:a,start:s,end:l,isStart:c,isEnd:d}));return u.sort(gt)}function i(t,n){var r,a,o,i,c,d,u,f,p,m,y,b,w,T,S,k,z=t.length,_="",H=E(),N=v("isRTL");for(r=0;z>r;r++)a=t[r],o=a.event,i=x(a.start,a.start),c=x(a.end,a.start),d=M(a.col),u=R(a.col),f=u-d,u-=.025*f,f=u-d,p=f*(a.forwardCoord-a.backwardCoord),v("slotEventOverlap")&&(p=Math.max(2*(p-10),p)),N?(y=u-a.backwardCoord*f,m=y-p):(m=d+a.backwardCoord*f,y=m+p),m=Math.max(m,d),y=Math.min(y,u),p=y-m,a.top=i,a.left=m,a.outerWidth=p,a.outerHeight=c-i,_+=s(o,a);for(H[0].innerHTML=_,b=H.children(),r=0;z>r;r++)a=t[r],o=a.event,w=e(b[r]),T=h("eventRender",o,o,w),T===!1?w.remove():(T&&T!==!0&&(w.remove(),w=e(T).css({position:"absolute",top:a.top,left:a.left}).appendTo(H)),a.element=w,o._id===n?l(o,w,a):w[0]._fci=r,Z(o,w));for(g(H,t,l),r=0;z>r;r++)a=t[r],(w=a.element)&&(a.vsides=C(w,!0),a.hsides=D(w,!0),S=w.find(".fc-event-title"),S.length&&(a.contentTop=S[0].offsetTop));for(r=0;z>r;r++)a=t[r],(w=a.element)&&(w[0].style.width=Math.max(0,a.outerWidth-a.hsides)+"px",k=Math.max(0,a.outerHeight-a.vsides),w[0].style.height=k+"px",o=a.event,void 0!==a.contentTop&&10>k-a.contentTop&&(w.find("div.fc-event-time").text(Q(o.start,v("timeFormat"))+" - "+o.title),w.find("div.fc-event-title").remove()),h("eventAfterRender",o,o,w))}function s(e,t){var n="<",r=e.url,a=O(e,v),o=["fc-event","fc-event-vert"];return p(e)&&o.push("fc-event-draggable"),t.isStart&&o.push("fc-event-start"),t.isEnd&&o.push("fc-event-end"),o=o.concat(e.className),e.source&&(o=o.concat(e.source.className||[])),n+=r?"a href='"+_(e.url)+"'":"div",n+=" class='"+o.join(" ")+"'"+" style="+"'"+"position:absolute;"+"top:"+t.top+"px;"+"left:"+t.left+"px;"+a+"'"+">"+"
"+"
"+_(f.getEventTimeText(e))+"
"+"
"+_(e.title||"")+"
"+"
"+"
",t.isEnd&&m(e)&&(n+="
=
"),n+=""}function l(e,t,n){var r=t.find("div.fc-event-time");p(e)&&d(e,t,r),n.isEnd&&m(e)&&u(e,t,r),b(e,t)}function c(e,n,r){function a(){c||(n.width(o).height("").draggable("option","grid",null),c=!0)}var o,i,s,l=r.isStart,c=!0,d=S(),u=N(),f=V(),p=Y(),g=W(),m=A(),D=F();n.draggable({opacity:v("dragOpacity","month"),revertDuration:v("dragRevertDuration"),start:function(t,r){h("eventDragStart",n[0],e,t,r),P(e,n),o=n.width(),d.start(function(t,r){if($(),t){i=!1;var o=z(0,r.col),d=z(0,t.col);s=d.diff(o,"days"),t.row?l?c&&(n.width(u-10),y(n,U.defaultTimedEventDuration/p*g),n.draggable("option","grid",[u,1]),c=!1):i=!0:(q(e.start.clone().add(s,"days"),J(e).add(s,"days")),a()),i=i||c&&!s}else a(),i=!0;n.draggable("option","revert",i)},t,"drag")},stop:function(r,o){if(d.stop(),$(),h("eventDragStop",n[0],e,r,o),i)a(),n.css("filter",""),B(e,n);else{var l,u,v=e.start.clone().add(s,"days");c||(u=Math.round((n.offset().top-L().offset().top)/D),l=t.duration(f+u*m),v=U.rezoneDate(v.clone().time(l))),j(n[0],e,v,r,o)}}})}function d(e,t,n){function r(){$(),s&&(c?(n.hide(),t.draggable("option","grid",null),q(D,b)):(a(),n.css("display",""),t.draggable("option","grid",[C,E])))}function a(){D&&n.text(f.getEventTimeText(D,e.end?b:null))}var o,i,s,l,c,d,u,p,g,m,y,D,b,w=f.getCoordinateGrid(),T=H(),C=N(),E=F(),S=A();t.draggable({scroll:!1,grid:[C,E],axis:1==T?"y":!1,opacity:v("dragOpacity"),revertDuration:v("dragRevertDuration"),start:function(n,r){h("eventDragStart",t[0],e,n,r),P(e,t),w.build(),o=t.position(),i=w.cell(n.pageX,n.pageY),s=l=!0,c=d=k(i),u=p=0,g=0,m=y=0,D=null,b=null},drag:function(n,a){var f=w.cell(n.pageX,n.pageY);if(s=!!f){if(c=k(f),u=Math.round((a.position.left-o.left)/C),u!=p){var v=z(0,i.col),h=i.col+u;h=Math.max(0,h),h=Math.min(T-1,h);var x=z(0,h);g=x.diff(v,"days")}c||(m=Math.round((a.position.top-o.top)/E))}(s!=l||c!=d||u!=p||m!=y)&&(c?(D=e.start.clone().stripTime().add(g,"days"),b=D.clone().add(U.defaultAllDayEventDuration)):(D=e.start.clone().add(m*S).add(g,"days"),b=J(e).add(m*S).add(g,"days")),r(),l=s,d=c,p=u,y=m),t.draggable("option","revert",!s)},stop:function(n,a){$(),h("eventDragStop",t[0],e,n,a),s&&(c||g||m)?j(t[0],e,D,n,a):(s=!0,c=!1,u=0,g=0,m=0,r(),t.css("filter",""),t.css(o),B(e,t))}})}function u(e,t,n){var r,a,o,i=F(),s=A();t.resizable({handles:{s:".ui-resizable-handle"},grid:i,start:function(n,o){r=a=0,P(e,t),h("eventResizeStart",t[0],e,n,o)},resize:function(l,c){if(r=Math.round((Math.max(i,t.height())-c.originalSize.height)/i),r!=a){o=J(e).add(s*r);var d;d=r?f.getEventTimeText(e.start,o):f.getEventTimeText(e),n.text(d),a=r}},stop:function(n,a){h("eventResizeStop",t[0],e,n,a),r?I(t[0],e,o,n,a):B(e,t)}})}var f=this;f.renderEvents=n,f.clearEvents=r,f.slotSegHtml=s,wt.call(f);var v=f.opt,h=f.trigger,p=f.isEventDraggable,m=f.isEventResizable,b=f.eventElementHandlers,w=f.setHeight,T=f.getDaySegmentContainer,E=f.getSlotSegmentContainer,S=f.getHoverListener,x=f.computeDateTop,k=f.getIsCellAllDay,M=f.colContentLeft,R=f.colContentRight,z=f.cellToDate,H=f.getColCnt,N=f.getColWidth,F=f.getSnapHeight,A=f.getSnapDuration,W=f.getSlotHeight,Y=f.getSlotDuration,L=f.getSlotContainer,Z=f.reportEventElement,B=f.showEvents,P=f.hideEvents,j=f.eventDrop,I=f.eventResize,q=f.renderDayOverlay,$=f.clearOverlays,X=f.renderDayEvents,V=f.getMinTime,G=f.getMaxTime,U=f.calendar,Q=U.formatDate,J=U.getEventEnd;f.draggableDayEvent=c}function st(e){var t,n=lt(e),r=n[0];if(ct(n),r){for(t=0;r.length>t;t++)dt(r[t]);for(t=0;r.length>t;t++)ut(r[t],0,0)}return ft(n)}function lt(e){var t,n,r,a=[];for(t=0;e.length>t;t++){for(n=e[t],r=0;a.length>r&&vt(n,a[r]).length;r++);(a[r]||(a[r]=[])).push(n)}return a}function ct(e){var t,n,r,a,o;for(t=0;e.length>t;t++)for(n=e[t],r=0;n.length>r;r++)for(a=n[r],a.forwardSegs=[],o=t+1;e.length>o;o++)vt(a,e[o],a.forwardSegs)}function dt(e){var t,n,r=e.forwardSegs,a=0;if(void 0===e.forwardPressure){for(t=0;r.length>t;t++)n=r[t],dt(n),a=Math.max(a,1+n.forwardPressure);e.forwardPressure=a}}function ut(e,t,n){var r,a=e.forwardSegs;if(void 0===e.forwardCoord)for(a.length?(a.sort(pt),ut(a[0],t+1,n),e.forwardCoord=a[0].backwardCoord):e.forwardCoord=1,e.backwardCoord=e.forwardCoord-(e.forwardCoord-n)/(t+1),r=0;a.length>r;r++)ut(a[r],0,e.forwardCoord)}function ft(e){var t,n,r,a=[];for(t=0;e.length>t;t++)for(n=e[t],r=0;n.length>r;r++)a.push(n[r]);return a}function vt(e,t,n){n=n||[];for(var r=0;t.length>r;r++)ht(e,t[r])&&n.push(t[r]);return n}function ht(e,t){return e.end>t.start&&e.startt?-1:1)}function r(e){a.start=a.intervalStart=e.clone().stripTime(),a.end=a.intervalEnd=a.start.clone().add(1,"days"),a.title=t.formatDate(a.start,a.opt("titleFormat")),a.renderResource(o().length)}var a=this;a.incrementDate=n,a.render=r,yt.call(a,e,t,"resourceDay");var o=a.getResources}function yt(n,r,a){function o(e){Rt=e,i(),G?l():s()}function i(){At=Pt("theme")?"ui":"fc",Wt=Pt("isRTL"),Bt=Pt("columnFormat"),Lt=t.duration(Pt("minTime")),Zt=t.duration(Pt("maxTime")),yt=t.duration(Pt("slotDuration")),Tt=Pt("snapDuration"),Tt=Tt?t.duration(Tt):yt}function s(){var r,a,o,i,s=At+"-widget-header",c=At+"-widget-content",d=0===yt.asMinutes()%15;for(l(),at=e("
").appendTo(n),Pt("allDaySlot")?(ot=e("
").appendTo(at),r=""+""+""+""+"
"+(Pt("allDayHTML")||_(Pt("allDayText")))+""+"
"+"
 
",it=e(r).appendTo(at),st=it.find("tr"),g(st.find("td")),at.append("
"+"
"+"
")):ot=e([]),lt=e("
").appendTo(at),ct=e("
").appendTo(lt),dt=e("
").appendTo(ct),r="",a=t.duration(+Lt),_t=0;Zt>a;)o=V.start.clone().time(a),i=o.minutes(),r+=""+""+""+"",a.add(yt),_t++;r+="
"+(d&&i?" ":_(Jt(o,Pt("axisFormat"))))+""+"
 
"+"
",ut=e(r).appendTo(ct),D(ut.find("td"))}function l(){var t=c();G&&G.remove(),G=e(t).appendTo(n),U=G.find("thead"),Q=U.find("th").slice(1,-1),J=G.find("tbody"),K=J.find("td").slice(0,-1),et=K.find("> div"),tt=K.find(".fc-day-content > div"),nt=K.eq(0),rt=et.eq(0),F(U.add(U.find("tr"))),F(J.add(J.find("tr")))}function c(){var e=""+d()+u()+"
";return e}function d(){var e,t,n,r=At+"-widget-header",a="";for(a+="",Pt("weekNumbers")?(e=Gt(0,0),t=Kt(e),Wt?t+=Pt("weekNumberTitle"):t=Pt("weekNumberTitle")+t,a+=""+_(t)+""):a+=" ",n=0;Rt>n;n++){var o=nn()[n],i=["fc-col"+n,o.className,r];a+=""+_(o.name)+""}return a+=" "+""+""}function u(){var e,t,n,a,o,i=At+"-widget-header",s=At+"-widget-content",l=r.getNow().stripTime(),c="";for(c+=" ",n="",t=0;(Rt||1)>t;t++){var d=nn()[t];e=V.intervalStart.clone(),o=["fc-col"+t,"fc-"+Yt[e.day()],s],d&&d.className&&o.push(d.className),e.isSame(l,"day")?o.push(At+"-state-highlight","fc-today"):l>e?o.push("fc-past"):o.push("fc-future"),a=""+"
"+"
"+"
 
"+"
"+"
"+"",n+=a}return c+=n,c+=" "+""+""}function f(e){void 0===e&&(e=ht),ht=e,tn={};var t=J.position().top,n=lt.position().top,r=Math.min(e-t,ut.height()+n+1);rt.height(r-C(nt)),at.css("top",t),lt.height(r-n-1);var a=ut.find("tr:first").height()+1,o=ut.find("tr:eq(1)").height();wt=(a+o)/2,Ct=yt/Tt,Et=wt/Ct}function v(t){vt=t,Ft.clear(),Ot.clear();var n=U.find("th:first");it&&(n=n.add(it.find("th:first"))),n=n.add(ut.find("th:first")),pt=0,m(n.width("").each(function(t,n){pt=Math.max(pt,e(n).outerWidth())}),pt);var r=G.find(".fc-agenda-gutter");it&&(r=r.add(it.find("th.fc-agenda-gutter")));var a=lt[0].clientWidth;mt=lt.width()-a,mt?(m(r,mt),r.show().prev().removeClass("fc-last")):r.hide().prev().addClass("fc-last"),gt=Math.floor((a-pt)/Rt),m(Q.slice(0,-1),gt)}function h(){function e(){lt.scrollTop(n)}var n=A(t.duration(Pt("scrollTime")))+1;e(),setTimeout(e,0)}function p(){h()}function g(e){e.click(b).mousedown(X)}function D(e){e.click(b).mousedown(B)}function b(e){if(!Pt("selectable")){var t=Math.min(Rt-1,Math.floor((e.pageX-G.offset().left-pt)/gt)),n=Gt(0,0),a=this.parentNode.className.match(/fc-slot(\d+)/);if(e.data=nn()[t],a){var o=parseInt(a[1],10);n.add(Lt+o*yt),n=r.rezoneDate(n),jt("dayClick",K[t],n,e)}else jt("dayClick",K[t],n,e)}}function w(e,t,n,r){n&&Ht.build();for(var a=Qt(e,t),o=0;a.length>o;o++){var i=a[o];g(T(i.row,r,i.row,r))}}function T(e,t,n,r){var a=Ht.rect(e,t,n,r,at);return It(a,at)}function E(e,t,n){e=e.clone().stripZone(),t=t.clone().stripZone();var r=Gt(0,0),a=r.clone().add(1,"days"),o=e>r?e:r,i=t>a?a:t;if(i>o){var s=Ht.rect(0,n,0,n,ct),l=O(o,r),c=O(i,r);s.top=l,s.height=c-l,D(It(s,ct))}}function S(e){return Ft.left(e)}function x(e){return Ot.left(e)}function k(e){return Ft.right(e)}function R(e){return Ot.right(e)}function z(e){return Pt("allDaySlot")&&!e.row}function H(e){var n=Gt(0,0),a=e.row;return Pt("allDaySlot")&&a--,a>=0&&(n.time(t.duration(Lt+a*Tt)),n=r.rezoneDate(n)),n}function O(e,n){return A(t.duration(e.clone().stripZone()-n.clone().stripTime()))}function A(e){if(Lt>e)return 0;if(e>=Zt)return ut.height();var t=(e-Lt)/yt,n=Math.floor(t),r=t-n,a=tn[n];void 0===a&&(a=tn[n]=ut.find("tr").eq(n).find("td div")[0].offsetTop);var o=a-1+r*wt;return o=Math.max(o,0)}function W(e){return e.hasTime()?e.clone().add(yt):e.clone().add(1,"days")}function Y(e,t,n){e.hasTime()||t.hasTime()?L(e,t):Pt("allDaySlot")&&w(e,t,!0,n)}function L(t,n,r){var a=Pt("selectHelper");if(Ht.build(),a){if(r=r||Ut(t).col,r>=0&&Rt>r){var o=Ht.rect(0,r,0,r,ct),i=O(t,t),s=O(n,t);if(s>i){if(o.top=i,o.height=s-i,o.left+=2,o.width-=5,e.isFunction(a)){var l=a(t,n);l&&(o.position="absolute",ft=e(l).css(o).appendTo(ct))}else o.isStart=!0,o.isEnd=!0,ft=e(Vt({title:"",start:t,end:n,className:["fc-select-helper"],editable:!1},o)),ft.css("opacity",Pt("dragOpacity"));ft&&(D(ft),ct.append(ft),m(ft,o.width,!0),y(ft,o.height,!0))}}}else E(t,n,r)}function Z(){qt(),ft&&(ft.remove(),ft=null)}function B(t){if(1==t.which&&Pt("selectable")){Xt(t);var n,r;Nt.start(function(e,t){if(Z(),e&&e.col==t.col&&!z(e)){r=e.col;var a=H(t),o=H(e);n=[a,a.clone().add(Tt),o,o.clone().add(Tt)].sort(M),L(n[0],n[3],e.col)}else n=null},t),e(document).one("mouseup",function(e){Nt.stop(),n&&(+n[0]==+n[1]&&P(n[0],e),e.data=nn()[r],$t(n[0],n[3],e))})}}function P(e,t){jt("dayClick",K[Ut(e).col],e,t)}function j(e,t,n,a,o,i){var s=r.mutateResourceEvent(t,n,a,null);jt("eventDrop",e,t,s.dateDelta,function(){s.undo(),en(t._id)},o,i),en(t._id)}function I(e,t,n,a,o){var i=r.mutateResourceEvent(t,t.resources,null,n);jt("eventResize",e,t,i.durationDelta,function(){i.undo(),en(t._id)},a,o),en(t._id)}function q(e,t){Nt.start(function(e){if(qt(),e){var t=H(e),n=t.clone();t.hasTime()?(n.add(r.defaultTimedEventDuration),E(t,n,e.col)):(n.add(r.defaultAllDayEventDuration),w(t,n,!0,e.col))}},t)}function $(e,t,n){var r=Nt.stop();qt(),r&&(t.data=nn()[r.col],jt("drop",e,H(r),t,n))}function X(t){var n,r=V.getIsCellAllDay,a=V.getHoverListener(),o=V.reportDayClick;if(1==t.which&&Pt("selectable")){Xt(t);var i;a.start(function(e,t){Z(),e&&r(e)?(n=e.col,i=[H(t),H(e)].sort(M),Y(i[0],i[1],n)):i=null},t),e(document).one("mouseup",function(e){a.stop(),i&&(+i[0]==+i[1]&&o(i[0],!0,e),e.data=nn()[n],$t(i[0],i[1],e))})}}var V=this;V.renderResource=o,V.setWidth=v,V.setHeight=f,V.afterRender=p,V.computeDateTop=O,V.getIsCellAllDay=z,V.allDayRow=function(){return st},V.getCoordinateGrid=function(){return Ht},V.getHoverListener=function(){return Nt},V.colLeft=S,V.colRight=k,V.colContentLeft=x,V.colContentRight=R,V.getDaySegmentContainer=function(){return ot},V.getSlotSegmentContainer=function(){return dt},V.getSlotContainer=function(){return ct},V.getRowCnt=function(){return 1},V.getColCnt=function(){return 1},V.getColWidth=function(){return gt},V.getSnapHeight=function(){return Et},V.getSnapDuration=function(){return Tt},V.getSlotHeight=function(){return wt},V.getSlotDuration=function(){return yt},V.getMinTime=function(){return Lt},V.getMaxTime=function(){return Zt},V.defaultSelectionEnd=W,V.renderDayOverlay=w,V.renderSelection=Y,V.clearSelection=Z,V.reportDayClick=P,V.dragStart=q,V.dragStop=$,V.getResources=r.fetchResources,bt.call(V,n,r,a),V.eventDrop=j,V.eventResize=I,xt.call(V),St.call(V),Dt.call(V);var G,U,Q,J,K,et,tt,nt,rt,at,ot,it,st,lt,ct,dt,ut,ft,vt,ht,pt,gt,mt,yt,wt,Tt,Ct,Et,Rt,_t,Ht,Nt,Ft,Ot,At,Wt,Lt,Zt,Bt,Pt=V.opt,jt=V.trigger,It=V.renderOverlay,qt=V.clearOverlays,$t=V.reportSelection,Xt=V.unselect,Vt=V.slotSegHtml,Gt=V.cellToDate,Ut=V.dateToCell,Qt=V.rangeToSegments,Jt=r.formatDate,Kt=r.calculateWeekNumber,en=r.reportEventChange,tn={},nn=V.getResources;N(n.addClass("fc-agenda")),Ht=new kt(function(t,n){function r(e){return Math.max(l,Math.min(c,e))}var a,o,i;Q.each(function(t,r){a=e(r),o=a.offset().left,t&&(i[1]=o),i=[o],n[t]=i}),i[1]=o+a.outerWidth(),Pt("allDaySlot")&&(a=st,o=a.offset().top,t[0]=[o,o+a.outerHeight()]);for(var s=ct.offset().top,l=lt.offset().top,c=l+lt.outerHeight(),d=0;_t*Ct>d;d++)t.push([r(s+Et*d),r(s+Et*(d+1))])}),Nt=new Mt(Ht),Ft=new zt(function(e){return et.eq(e)}),Ot=new zt(function(e){return tt.eq(e)})}function Dt(){function n(e,t){var n,r=e.length,o=[],i=[];for(n=0;r>n;n++)e[n].allDay?o.push(e[n]):i.push(e[n]);h("allDaySlot")&&(V(o,t),T()),s(a(i),t)}function r(){E().empty(),S().empty()}function a(e){var t,n,r,a,s,l=N(),c=G(),d=U(),u=[];for(n=0;l>n;n++){t=H(0,0);var f=i(et()[n],e);for(s=o(f,t.clone().time(c),t.clone().time(d)),s=st(s),r=0;s.length>r;r++)a=s[r],a.col=n,u.push(a)}return u}function o(e,t,n){t=t.clone().stripZone(),n=n.clone().stripZone();var r,a,o,i,s,l,c,d,u=[],f=e.length;for(r=0;f>r;r++)a=e[r],o=a.start.clone().stripZone(),i=K(a).stripZone(),i>t&&n>o&&(t>o?(s=t.clone(),c=!1):(s=o,c=!0),i>n?(l=n.clone(),d=!1):(l=i,d=!0),u.push({event:a,start:s,end:l,isStart:c,isEnd:d}));return u.sort(gt)}function i(t,n){for(var r=[],a=function(n){return n.resources&&e.grep(n.resources,function(e){return e==t.id}).length},o=0;n.length>o;o++)a(n[o])&&r.push(n[o]);return r}function s(t,n){var r,a,o,i,s,d,u,f,v,m,y,b,w,T,E,x,M=t.length,_="",H=S(),N=h("isRTL");for(r=0;M>r;r++)a=t[r],o=a.event,i=k(a.start,a.start),s=k(a.end,a.start),d=R(a.col),u=z(a.col),f=u-d,u-=.025*f,f=u-d,v=f*(a.forwardCoord-a.backwardCoord),h("slotEventOverlap")&&(v=Math.max(2*(v-10),v)),N?(y=u-a.backwardCoord*f,m=y-v):(m=d+a.backwardCoord*f,y=m+v),m=Math.max(m,d),y=Math.min(y,u),v=y-m,a.top=i,a.left=m,a.outerWidth=v,a.outerHeight=s-i,_+=l(o,a);for(H[0].innerHTML=_,b=H.children(),r=0;M>r;r++)a=t[r],o=a.event,w=e(b[r]),T=p("eventRender",o,o,w),T===!1?w.remove():(T&&T!==!0&&(w.remove(),w=e(T).css({position:"absolute",top:a.top,left:a.left}).appendTo(H)),a.element=w,o._id===n?c(o,w,a):w[0]._fci=r,B(o,w));for(g(H,t,c),r=0;M>r;r++)a=t[r],(w=a.element)&&(a.vsides=C(w,!0),a.hsides=D(w,!0),E=w.find(".fc-event-title"),E.length&&(a.contentTop=E[0].offsetTop));for(r=0;M>r;r++)a=t[r],(w=a.element)&&(w[0].style.width=Math.max(0,a.outerWidth-a.hsides)+"px",x=Math.max(0,a.outerHeight-a.vsides),w[0].style.height=x+"px",o=a.event,void 0!==a.contentTop&&10>x-a.contentTop&&(w.find("div.fc-event-time").text(J(o.start,h("timeFormat"))+" - "+o.title),w.find("div.fc-event-title").remove()),p("eventAfterRender",o,o,w))}function l(e,t){var n="<",r=e.url,a=O(e,h),o=["fc-event","fc-event-vert"];return m(e)&&o.push("fc-event-draggable"),t.isStart&&o.push("fc-event-start"),t.isEnd&&o.push("fc-event-end"),o=o.concat(e.className),e.source&&(o=o.concat(e.source.className||[])),n+=r?"a href='"+_(e.url)+"'":"div",n+=" class='"+o.join(" ")+"'"+" style="+"'"+"position:absolute;"+"top:"+t.top+"px;"+"left:"+t.left+"px;"+a+"'"+">"+"
"+"
"+_(v.getEventTimeText(e))+"
"+"
"+_(e.title||"")+"
"+"
"+"
",t.isEnd&&b(e)&&(n+="
=
"),n+=""}function c(e,t,n){var r=t.find("div.fc-event-time");m(e)&&u(e,t,r),n.isEnd&&b(e)&&f(e,t,r),w(e,t)}function d(e,n,r){function a(){d||(n.width(o).height("").draggable("option","grid",null),d=!0)}var o,i,s,l,c=r.isStart,d=!0,u=x(),f=F(),v=G(),g=L(),m=Y(),D=W(),b=A();n.draggable({opacity:h("dragOpacity","month"),revertDuration:h("dragRevertDuration"),start:function(t,r){p("eventDragStart",n[0],e,t,r),j(e,n),o=n.width(),u.start(function(t,r){if(X(),t){i=!1,l=r.col;var o=H(0,r.col),u=H(0,t.col);s=u.diff(o,"days"),t.row?c?d&&(n.width(f-10),y(n,Q.defaultTimedEventDuration/g*m),n.draggable("option","grid",[f,1]),d=!1):i=!0:($(e.start.clone().add(s,"days"),K(e).add(s,"days"),!0,1),a()),i=i||d&&!s}else a(),i=!0;n.draggable("option","revert",i)},t,"drag")},stop:function(r,o){if(u.stop(),X(),p("eventDragStop",n[0],e,r,o),i)a(),n.css("filter",""),P(e,n);else{var s=Math.round((n.offset().left-Z().offset().left)/f),c=e.resources;s!==l&&(c=[et()[s].id]);var h,g,m=e.start.clone();d||(g=Math.round((n.offset().top-Z().offset().top)/b),h=t.duration(v+g*D),m=Q.rezoneDate(m.clone().time(h))),I(n[0],e,c,m,r,o)}}})}function u(e,t,n){function r(){X(),s&&(c?(n.hide(),t.draggable("option","grid",null),$(b,w,!1,i.col+u)):(a(),n.css("display",""),t.draggable("option","grid",[E,S])))}function a(){b&&n.text(v.getEventTimeText(b,e.end?w:null))}var o,i,s,l,c,d,u,f,g,m,y,D,b,w,T=v.getCoordinateGrid(),C=N(),E=F(),S=A(),x=W();t.draggable({scroll:!1,grid:[E,S],axis:1==C?"y":!1,opacity:h("dragOpacity"),revertDuration:h("dragRevertDuration"),start:function(n,r){p("eventDragStart",t[0],e,n,r),j(e,t),T.build(),o=t.position(),i=T.cell(n.pageX,n.pageY),s=l=!0,c=d=M(i),u=f=0,g=0,m=0,y=D=0,b=null,w=null},drag:function(n,a){var i=T.cell(n.pageX,n.pageY);s=!!i,s&&(c=M(i),u=Math.round((a.position.left-o.left)/E),u!=f&&(m=u),c||(y=Math.round((a.position.top-o.top)/S))),(s!=l||c!=d||u!=f||y!=D)&&(c?(b=e.start.clone().stripTime().add(g,"days"),w=b.clone().add(Q.defaultAllDayEventDuration)):(b=e.start.clone().add(y*x).add(g,"days"),w=K(e).add(y*x).add(g,"days")),r(),l=s,d=c,f=u,D=y),t.draggable("option","revert",!s)},stop:function(n,a){if(X(),p("eventDragStop",t[0],e,n,a),s&&(c||m||y)){var l=e.resources.slice(0);if(m){var d=et(),f=d[i.col+m].id,v=d[i.col].id,h=e.resources.indexOf(v),D=e.resources.indexOf(f);D>-1?l.splice(h,1):l[h]=f}I(t[0],e,l,b,n,a)}else s=!0,c=!1,u=0,g=0,y=0,r(),t.css("filter",""),t.css(o),P(e,t)}})}function f(e,t,n){var r,a,o,i=A(),s=W();t.resizable({handles:{s:".ui-resizable-handle"},grid:i,start:function(n,o){r=a=0,j(e,t),p("eventResizeStart",t[0],e,n,o)},resize:function(l,c){if(r=Math.round((Math.max(i,t.height())-c.originalSize.height)/i),r!=a){o=K(e).add(s*r);var d;d=r?v.getEventTimeText(e.start,o):v.getEventTimeText(e),n.text(d),a=r}},stop:function(n,a){p("eventResizeStop",t[0],e,n,a),r?q(t[0],e,o,n,a):P(e,t)}})}var v=this;v.renderEvents=n,v.clearEvents=r,v.slotSegHtml=l,wt.call(v);var h=v.opt,p=v.trigger,m=v.isEventDraggable,b=v.isEventResizable,w=v.eventElementHandlers,T=v.setHeight,E=v.getDaySegmentContainer,S=v.getSlotSegmentContainer,x=v.getHoverListener,k=v.computeDateTop,M=v.getIsCellAllDay,R=v.colContentLeft,z=v.colContentRight,H=v.cellToDate,N=function(){return et().length},F=v.getColWidth,A=v.getSnapHeight,W=v.getSnapDuration,Y=v.getSlotHeight,L=v.getSlotDuration,Z=v.getSlotContainer,B=v.reportEventElement,P=v.showEvents,j=v.hideEvents,I=v.eventDrop,q=v.eventResize,$=v.renderDayOverlay,X=v.clearOverlays,V=v.renderDayEvents,G=v.getMinTime,U=v.getMaxTime,Q=v.calendar,J=Q.formatDate,K=Q.getEventEnd,et=v.getResources;v.draggableDayEvent=d}function bt(n,r,a){function o(t,n){var r=A[t];return e.isPlainObject(r)&&!i(t)?z(r,n||a):r}function s(e,t){return r.trigger.apply(r,[e,t||H].concat(Array.prototype.slice.call(arguments,2),[H]))}function l(e){var t=e.source||{};return W(e.startEditable,t.startEditable,o("eventStartEditable"),e.editable,t.editable,o("editable"))}function c(e){var t=e.source||{};return W(e.durationEditable,t.durationEditable,o("eventDurationEditable"),e.editable,t.editable,o("editable"))}function d(){F={},O=[]}function u(e,t){O.push({event:e,element:t}),F[e._id]?F[e._id].push(t):F[e._id]=[t]}function f(){e.each(O,function(e,t){H.trigger("eventDestroy",t.event,t.event,t.element)})}function v(e,t){t.click(function(n){return t.hasClass("ui-draggable-dragging")||t.hasClass("ui-resizable-resizing")?void 0:s("eventClick",this,e,n)}).hover(function(t){s("eventMouseover",this,e,t)},function(t){s("eventMouseout",this,e,t)})}function h(e,t){g(e,t,"show")}function p(e,t){g(e,t,"hide")}function g(e,t,n){var r,a=F[e._id],o=a.length;for(r=0;o>r;r++)t&&a[r][0]==t[0]||a[r][n]()}function m(e,t,n,a,o){var i=r.mutateEvent(t,n,null);s("eventDrop",e,t,i.dateDelta,function(){i.undo(),N(t._id)},a,o),N(t._id)}function y(e,t,n,a,o){var i=r.mutateEvent(t,null,n);s("eventResize",e,t,i.durationDelta,function(){i.undo(),N(t._id)},a,o),N(t._id)}function D(e){return t.isMoment(e)&&(e=e.day()),B[e]}function b(){return L}function w(e,t,n){var r=e.clone();for(t=t||1;B[(r.day()+(n?t:0)+7)%7];)r.add(t,"days");return r}function T(){var e=C.apply(null,arguments),t=E(e),n=S(t);return n}function C(e,t){var n=H.getColCnt(),r=I?-1:1,a=I?n-1:0;"object"==typeof e&&(t=e.col,e=e.row);var o=e*n+(t*r+a);return o}function E(e){var t=H.start.day();return e+=P[t],7*Math.floor(e/L)+j[(e%L+L)%L]-t}function S(e){return H.start.clone().add(e,"days")}function x(e){var t=k(e),n=M(t),r=R(n);return r}function k(e){return e.clone().stripTime().diff(H.start,"days")}function M(e){var t=H.start.day();return e+=t,Math.floor(e/7)*L+P[(e%7+7)%7]-P[t]}function R(e){var t=H.getColCnt(),n=I?-1:1,r=I?t-1:0,a=Math.floor(e/t),o=(e%t+t)%t*n+r;return{row:a,col:o}}function _(e,t){var n=H.getRowCnt(),r=H.getColCnt(),a=[],o=k(e),i=k(t),s=+t.time();s&&s>=Y&&i++,i=Math.max(i,o+1);for(var l=M(o),c=M(i)-1,d=0;n>d;d++){var u=d*r,f=u+r-1,v=Math.max(l,u),h=Math.min(c,f);if(h>=v){var p=R(v),g=R(h),m=[p.col,g.col].sort(),y=E(v)==o,D=E(h)+1==i;a.push({row:d,leftCol:m[0],rightCol:m[1],isStart:y,isEnd:D})}}return a}var H=this;H.element=n,H.calendar=r,H.name=a,H.opt=o,H.trigger=s,H.isEventDraggable=l,H.isEventResizable=c,H.clearEventData=d,H.reportEventElement=u,H.triggerEventDestroy=f,H.eventElementHandlers=v,H.showEvents=h,H.hideEvents=p,H.eventDrop=m,H.eventResize=y;var N=r.reportEventChange,F={},O=[],A=r.options,Y=t.duration(A.nextDayThreshold);H.getEventTimeText=function(e){var t,n;return 2===arguments.length?(t=arguments[0],n=arguments[1]):(t=e.start,n=e.end),n&&o("displayEventEnd")?r.formatRange(t,n,o("timeFormat")):r.formatDate(t,o("timeFormat"))},H.isHiddenDay=D,H.skipHiddenDays=w,H.getCellsPerWeek=b,H.dateToCell=x,H.dateToDayOffset=k,H.dayOffsetToCellOffset=M,H.cellOffsetToCell=R,H.cellToDate=T,H.cellToCellOffset=C,H.cellOffsetToDayOffset=E,H.dayOffsetToDate=S,H.rangeToSegments=_;var L,Z=o("hiddenDays")||[],B=[],P=[],j=[],I=o("isRTL");(function(){o("weekends")===!1&&Z.push(0,6);for(var t=0,n=0;7>t;t++)P[t]=n,B[t]=-1!=e.inArray(t,Z),B[t]||(j[n]=t,n++);if(L=n,!L)throw"invalid hiddenDays"})()}function wt(){function t(e,t){var n=r(e,!1,!0);Ct(n,function(e,t){M(e.event,t)}),y(n,t),Ct(n,function(e,t){S("eventAfterRender",e.event,e.event,t)})}function n(e,t,n){var a=r([e],!0,!1),o=[];return Ct(a,function(e,r){e.row===t&&r.css("top",n),o.push(r[0])}),o}function r(t,n,r){var o,i,c=q(),f=n?e("
"):c,v=a(t);return s(v),o=l(v),f[0].innerHTML=o,i=f.children(),n&&c.append(i),d(v,i),Ct(v,function(e,t){e.hsides=D(t,!0)}),Ct(v,function(e,t){t.width(Math.max(0,e.outerWidth-e.hsides))}),Ct(v,function(e,t){e.outerHeight=t.outerHeight(!0)}),u(v,r),v}function a(e){var t,n,r=C.getResources,a=[];if(r===void 0)for(t=0;e.length>t;t++)n=i(e[t]),a.push.apply(a,n);else for(t=0;r().length>t;t++)for(var s=o(r()[t],e),l=0;s.length>l;l++)n=i(s[l],t),a.push.apply(a,n);return a}function o(t,n){for(var r=[],a=function(n){return n.resources&&e.grep(n.resources,function(e){return e==t.id}).length},o=0;n.length>o;o++)a(n[o])&&r.push(n[o]);return r}function i(e,t){for(var n=U(e.start,rt(e)),r=0;n.length>r;r++)t!==void 0&&(n[r].leftCol=t,n[r].rightCol=t),n[r].event=e;return n}function s(e){for(var t=E("isRTL"),n=0;e.length>n;n++){var r=e[n],a=(t?r.isEnd:r.isStart)?j:B,o=(t?r.isStart:r.isEnd)?I:P,i=a(r.leftCol),s=o(r.rightCol);r.left=i,r.outerWidth=s-i}}function l(e){for(var t="",n=0;e.length>n;n++)t+=c(e[n]);return t}function c(e){var t="",n=E("isRTL"),r=e.event,a=r.url,o=["fc-event","fc-event-hori"];x(r)&&o.push("fc-event-draggable"),e.isStart&&o.push("fc-event-start"),e.isEnd&&o.push("fc-event-end"),o=o.concat(r.className),r.source&&(o=o.concat(r.source.className||[]));var i=O(r,E);return t+=a?""+"
",!r.allDay&&e.isStart&&(t+=""+_(C.getEventTimeText(r))+""),t+=""+_(r.title||"")+""+"
",r.allDay&&e.isEnd&&k(r)&&(t+="
"+"   "+"
"),t+=""}function d(t,n){for(var r=0;t.length>r;r++){var a=t[r],o=a.event,i=n.eq(r),s=S("eventRender",o,o,i); -s===!1?i.remove():(s&&s!==!0&&(s=e(s).css({position:"absolute",left:a.left}),i.replaceWith(s),i=s),a.element=i)}}function u(e,t){var n,r=f(e),a=m(),o=[];if(t)for(n=0;a.length>n;n++)a[n].height(r[n]);for(n=0;a.length>n;n++)o.push(a[n].position().top);Ct(e,function(e,t){t.css("top",o[e.row]+e.top)})}function f(e){for(var t,n=Y(),r=L(),a=[],o=v(e),i=0;n>i;i++){var s=o[i],l=[];for(t=0;r>t;t++)l.push(0);for(var c=0;s.length>c;c++){var d=s[c];for(d.top=R(l.slice(d.leftCol,d.rightCol+1)),t=d.leftCol;d.rightCol>=t;t++)l[t]=d.top+d.outerHeight}a.push(R(l))}return a}function v(e){var t,n,r,a=Y(),o=[];for(t=0;e.length>t;t++)n=e[t],r=n.row,n.element&&(o[r]?o[r].push(n):o[r]=[n]);for(r=0;a>r;r++)o[r]=h(o[r]||[]);return o}function h(e){for(var t=[],n=p(e),r=0;n.length>r;r++)t.push.apply(t,n[r]);return t}function p(e){e.sort(Et);for(var t=[],n=0;e.length>n;n++){for(var r=e[n],a=0;t.length>a&&Tt(r,t[a]);a++);t[a]?t[a].push(r):t[a]=[r]}return t}function m(){var e,t=Y(),n=[];for(e=0;t>e;e++)n[e]=Z(e).find("div.fc-day-content > div");return n}function y(e,t){var n=q();Ct(e,function(e,n,r){var a=e.event;a._id===t?b(a,n,e):n[0]._fci=r}),g(n,e,b)}function b(e,t,n){x(e)&&C.draggableDayEvent(e,t,n),e.allDay&&n.isEnd&&k(e)&&C.resizableDayEvent(e,t,n),z(e,t)}function w(e,t){var n,r,a=G();t.draggable({delay:50,opacity:E("dragOpacity"),revertDuration:E("dragRevertDuration"),start:function(o,i){S("eventDragStart",t[0],e,o,i),F(e,t),a.start(function(a,o,i,s){if(t.draggable("option","revert",!a||!i&&!s),X(),a){var l=Q(o),c=Q(a);n=c.diff(l,"days"),r=e.start.clone().add(n,"days"),$(r,rt(e).add(n,"days"))}else n=0},o,"drag")},stop:function(o,i){a.stop(),X(),S("eventDragStop",t[0],e,o,i),n?A(t[0],e,r,o,i):(t.css("filter",""),H(e,t))}})}function T(t,r,a){var o=E("isRTL"),i=o?"w":"e",s=r.find(".ui-resizable-"+i),l=!1;N(r),r.mousedown(function(e){e.preventDefault()}).click(function(e){l&&(e.preventDefault(),e.stopImmediatePropagation())}),s.mousedown(function(o){function s(n){S("eventResizeStop",r[0],t,n,{}),e("body").css("cursor",""),f.stop(),X(),c&&W(r[0],t,d,n,{}),setTimeout(function(){l=!1},0)}if(1==o.which){l=!0;var c,d,u,f=G(),v=r.css("top"),h=e.extend({},t),p=tt(et(t.start));V(),e("body").css("cursor",i+"-resize").one("mouseup",s),S("eventResizeStart",r[0],t,o,{}),f.start(function(r,o){if(r){var s=J(o),l=J(r);if(l=Math.max(l,p),c=K(l)-K(s),d=rt(t).add(c,"days"),c){h.end=d;var f=u;u=n(h,a.row,v),u=e(u),u.find("*").css("cursor",i+"-resize"),f&&f.remove(),F(t)}else u&&(H(t),u.remove(),u=null);X(),$(t.start,d)}},o)}})}var C=this;C.renderDayEvents=t,C.draggableDayEvent=w,C.resizableDayEvent=T;var E=C.opt,S=C.trigger,x=C.isEventDraggable,k=C.isEventResizable,M=C.reportEventElement,z=C.eventElementHandlers,H=C.showEvents,F=C.hideEvents,A=C.eventDrop,W=C.eventResize,Y=C.getRowCnt,L=C.getColCnt,Z=C.allDayRow,B=C.colLeft,P=C.colRight,j=C.colContentLeft,I=C.colContentRight,q=C.getDaySegmentContainer,$=C.renderDayOverlay,X=C.clearOverlays,V=C.clearSelection,G=C.getHoverListener,U=C.rangeToSegments,Q=C.cellToDate,J=C.cellToCellOffset,K=C.cellOffsetToDayOffset,et=C.dateToDayOffset,tt=C.dayOffsetToCellOffset,nt=C.calendar,rt=nt.getEventEnd}function Tt(e,t){for(var n=0;t.length>n;n++){var r=t[n];if(r.leftCol<=e.rightCol&&r.rightCol>=e.leftCol)return!0}return!1}function Ct(e,t){for(var n=0;e.length>n;n++){var r=e[n],a=r.element;a&&t(r,a,n)}}function Et(e,t){return t.rightCol-t.leftCol-(e.rightCol-e.leftCol)||t.event.allDay-e.event.allDay||e.event.start-t.event.start||(e.event.title||"").localeCompare(t.event.title)}function St(){function t(t){var n=c("unselectCancel");n&&e(t.target).parents(n).length||r(t)}function n(e,t){r(),e=l.moment(e),t=t?l.moment(t):u(e),f(e,t),a(e,t)}function r(e){h&&(h=!1,v(),d("unselect",null,e))}function a(e,t,n){h=!0,d("select",null,e,t,n)}function o(t){var n=s.cellToDate,o=s.getIsCellAllDay,i=s.getHoverListener(),l=s.reportDayClick;if(1==t.which&&c("selectable")){r(t);var d;i.start(function(e,t){v(),e&&o(e)?(d=[n(t),n(e)].sort(M),f(d[0],d[1].clone().add(1,"days"))):d=null},t),e(document).one("mouseup",function(e){i.stop(),d&&(+d[0]==+d[1]&&l(d[0],e),a(d[0],d[1].clone().add(1,"days"),e))})}}function i(){e(document).off("mousedown",t)}var s=this;s.select=n,s.unselect=r,s.reportSelection=a,s.daySelectionMousedown=o,s.selectionManagerDestroy=i;var l=s.calendar,c=s.opt,d=s.trigger,u=s.defaultSelectionEnd,f=s.renderSelection,v=s.clearSelection,h=!1;c("selectable")&&c("unselectAuto")&&e(document).on("mousedown",t)}function xt(){function t(t,n){var r=o.shift();return r||(r=e("
")),r[0].parentNode!=n[0]&&r.appendTo(n),a.push(r.css(t).show()),r}function n(){for(var e;e=a.shift();)o.push(e.hide().unbind())}var r=this;r.renderOverlay=t,r.clearOverlays=n;var a=[],o=[]}function kt(e){var t,n,r=this;r.build=function(){t=[],n=[],e(t,n)},r.cell=function(e,r){var a,o=t.length,i=n.length,s=-1,l=-1;for(a=0;o>a;a++)if(r>=t[a][0]&&t[a][1]>r){s=a;break}for(a=0;i>a;a++)if(e>=n[a][0]&&n[a][1]>e){l=a;break}return s>=0&&l>=0?{row:s,col:l}:null},r.rect=function(e,r,a,o,i){var s=i.offset();return{top:t[e][0]-s.top,left:n[r][0]-s.left,width:n[o][1]-n[r][0],height:t[a][1]-t[e][0]}}}function Mt(t){function n(e){Rt(e);var n=t.cell(e.pageX,e.pageY);(Boolean(n)!==Boolean(i)||n&&(n.row!=i.row||n.col!=i.col))&&(n?(o||(o=n),a(n,o,n.row-o.row,n.col-o.col)):a(n,o),i=n)}var r,a,o,i,s=this;s.start=function(s,l,c){a=s,o=i=null,t.build(),n(l),r=c||"mousemove",e(document).bind(r,n)},s.stop=function(){return e(document).unbind(r,n),i}}function Rt(e){void 0===e.pageX&&(e.pageX=e.originalEvent.pageX,e.pageY=e.originalEvent.pageY)}function zt(e){function t(t){return r[t]=r[t]||e(t)}var n=this,r={},a={},o={};n.left=function(e){return a[e]=void 0===a[e]?t(e).position().left:a[e]},n.right=function(e){return o[e]=void 0===o[e]?n.left(e)+t(e).width():o[e]},n.clear=function(){r={},a={},o={}}}var _t={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:r,day:"dddd"},timeFormat:{"default":n},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"},unselectAuto:!0,dropAccept:"*",handleWindowResize:!0,windowResizeDelay:200},Ht={en:{columnFormat:{week:"ddd M/D"}}},Nt={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"}},Ft=e.fullCalendar={version:"2.0.2"},Ot=Ft.views={};e.fn.fullCalendar=function(t){var n=Array.prototype.slice.call(arguments,1),r=this;return this.each(function(a,o){var i,l=e(o),c=l.data("fullCalendar");"string"==typeof t?c&&e.isFunction(c[t])&&(i=c[t].apply(c,n),a||(r=i),"destroy"===t&&l.removeData("fullCalendar")):c||(c=new s(l,t),l.data("fullCalendar",c),c.render())}),r},Ft.langs=Ht,Ft.datepickerLang=function(t,n,r){var a=Ht[t];a||(a=Ht[t]={}),o(a,{isRTL:r.isRTL,weekNumberTitle:r.weekHeader,titleFormat:{month:r.showMonthAfterYear?"YYYY["+r.yearSuffix+"] MMMM":"MMMM YYYY["+r.yearSuffix+"]"},defaultButtonText:{prev:H(r.prevText),next:H(r.nextText),today:H(r.currentText)}}),e.datepicker&&(e.datepicker.regional[n]=e.datepicker.regional[t]=r,e.datepicker.regional.en=e.datepicker.regional[""],e.datepicker.setDefaults(r))},Ft.lang=function(e,t){var n;t&&(n=Ht[e],n||(n=Ht[e]={}),o(n,t||{})),_t.lang=e},Ft.sourceNormalizers=[],Ft.sourceFetchers=[];var At={dataType:"json",cache:!1},Wt=1;Ft.applyAll=A;var Yt=["sun","mon","tue","wed","thu","fri","sat"],Lt=/^\s*\d{4}-\d\d$/,Zt=/^\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+)?)?)?)?)?$/;Ft.moment=function(){return Y(arguments)},Ft.moment.utc=function(){var e=Y(arguments,!0);return e.hasTime()&&e.utc(),e},Ft.moment.parseZone=function(){return Y(arguments,!0,!0)},L.prototype=f(t.fn),L.prototype.clone=function(){return Y([this])},L.prototype.time=function(e){if(null==e)return t.duration({hours:this.hours(),minutes:this.minutes(),seconds:this.seconds(),milliseconds:this.milliseconds()});delete this._ambigTime,t.isDuration(e)||t.isMoment(e)||(e=t.duration(e));var n=0;return t.isDuration(e)&&(n=24*Math.floor(e.asDays())),this.hours(n+e.hours()).minutes(e.minutes()).seconds(e.seconds()).milliseconds(e.milliseconds())},L.prototype.stripTime=function(){var e=this.toArray();return t.fn.utc.call(this),this.year(e[0]).month(e[1]).date(e[2]).hours(0).minutes(0).seconds(0).milliseconds(0),this._ambigTime=!0,this._ambigZone=!0,this},L.prototype.hasTime=function(){return!this._ambigTime},L.prototype.stripZone=function(){var e=this.toArray(),n=this._ambigTime;return t.fn.utc.call(this),this.year(e[0]).month(e[1]).date(e[2]).hours(e[3]).minutes(e[4]).seconds(e[5]).milliseconds(e[6]),n&&(this._ambigTime=!0),this._ambigZone=!0,this},L.prototype.hasZone=function(){return!this._ambigZone},L.prototype.zone=function(e){return null!=e&&(delete this._ambigTime,delete this._ambigZone),t.fn.zone.apply(this,arguments)},L.prototype.local=function(){var e=this.toArray(),n=this._ambigZone;return delete this._ambigTime,delete this._ambigZone,t.fn.local.apply(this,arguments),n&&this.year(e[0]).month(e[1]).date(e[2]).hours(e[3]).minutes(e[4]).seconds(e[5]).milliseconds(e[6]),this},L.prototype.utc=function(){return delete this._ambigTime,delete this._ambigZone,t.fn.utc.apply(this,arguments)},L.prototype.format=function(){return arguments[0]?P(this,arguments[0]):this._ambigTime?B(this,"YYYY-MM-DD"):this._ambigZone?B(this,"YYYY-MM-DD[T]HH:mm:ss"):B(this)},L.prototype.toISOString=function(){return this._ambigTime?B(this,"YYYY-MM-DD"):this._ambigZone?B(this,"YYYY-MM-DD[T]HH:mm:ss"):t.fn.toISOString.apply(this,arguments)},L.prototype.isWithin=function(e,t){var n=Z([this,e,t]);return n[0]>=n[1]&&n[0]").prependTo(n),se=new l(ne,ae),le=se.render(),le&&n.prepend(le),g(ae.defaultView),ae.handleWindowResize&&e(window).resize(E),p()||d()}function d(){setTimeout(function(){!ue.start&&p()&&y()},0)}function v(){ue&&(K("viewDestroy",ue,ue,ue.element),ue.triggerEventDestroy()),e(window).unbind("resize",E),ae.droppable&&e(document).off("dragstart",ee).off("dragstop",te),ue.selectionManagerDestroy&&ue.selectionManagerDestroy(),se.destroy(),ce.remove(),n.removeClass("fc fc-ltr fc-rtl ui-widget")}function h(){return n.is(":visible")}function p(){return e("body").is(":visible")}function g(e){ue&&e==ue.name||m(e)}function m(t){be++,ue&&(K("viewDestroy",ue,ue,ue.element),W(),ue.triggerEventDestroy(),V(),ue.element.remove(),se.deactivateButton(ue.name)),se.activateButton(t),ue=new Fe[t](e("
").appendTo(ce),ne),y(),G(),be--}function y(e){ue.start&&!e&&he.isWithin(ue.intervalStart,ue.intervalEnd)||h()&&D(e)}function D(e){be++,ue.start&&(K("viewDestroy",ue,ue,ue.element),W(),R()),V(),e&&(he=ue.incrementDate(he,e)),ue.render(he.clone()),T(),G(),(ue.afterRender||k)(),O(),F(),K("viewRender",ue,ue,ue.element),be--,z()}function b(){h()&&(W(),R(),w(),T(),M())}function w(){ve=ae.contentHeight?ae.contentHeight:ae.height?ae.height-(le?le.height():0)-C(ce):Math.round(ce.width()/Math.max(ae.aspectRatio,.5))}function T(){void 0===ve&&w(),be++,ue.setHeight(ve),ue.setWidth(ce.width()),be--,fe=n.outerWidth()}function E(e){if(!be&&e.target===window)if(ue.start){var t=++De;setTimeout(function(){t==De&&!be&&h()&&fe!=(fe=n.outerWidth())&&(be++,b(),ue.trigger("windowResize",ye),be--)},ae.windowResizeDelay)}else d()}function S(){R(),_()}function x(e){R(),M(e)}function M(e){h()&&(ue.renderEvents(we,e),ue.trigger("eventAfterAllRender"))}function R(){ue.triggerEventDestroy(),ue.clearEvents(),ue.clearEventData()}function z(){!ae.lazyFetching||ge(ue.start,ue.end)?_():M()}function _(){me(ue.start,ue.end)}function H(e){we=e,M()}function N(e){x(e)}function O(){se.updateTitle(ue.title)}function F(){var e=ne.getNow();e.isWithin(ue.intervalStart,ue.intervalEnd)?se.disableButton("today"):se.enableButton("today")}function A(e,t){ue.select(e,t)}function W(){ue&&ue.unselect()}function Y(){y(-1)}function L(){y(1)}function Z(){he.add("years",-1),y()}function B(){he.add("years",1),y()}function j(){he=ne.getNow(),y()}function I(e){he=ne.moment(e),y()}function $(e){he.add(t.duration(e)),y()}function X(){return he.clone()}function V(){ce.css({width:"100%",height:ce.height(),overflow:"hidden"})}function G(){ce.css({width:"",height:"",overflow:""})}function U(){return ne}function Q(){return ue}function J(e,t){return void 0===t?ae[e]:void(("height"==e||"contentHeight"==e||"aspectRatio"==e)&&(ae[e]=t,b()))}function K(e,t){return ae[e]?ae[e].apply(t||ye,Array.prototype.slice.call(arguments,2)):void 0}function ee(t,n){var r=t.target,a=e(r);if(!a.parents(".fc").length){var o=ae.dropAccept;(e.isFunction(o)?o.call(r,a):a.is(o))&&(pe=r,ue.dragStart(pe,t,n))}}function te(e,t){pe&&(ue.dragStop(pe,e,t),pe=null)}var ne=this;r=r||{};var re,ae=o({},_e,r);re=ae.lang in He?He[ae.lang]:He[_e.lang],re&&(ae=o({},_e,re,r)),ae.isRTL&&(ae=o({},_e,Ne,re||{},r)),ne.options=ae,ne.render=i,ne.destroy=v,ne.refetchEvents=S,ne.reportEvents=H,ne.reportEventChange=N,ne.rerenderEvents=x,ne.changeView=g,ne.select=A,ne.unselect=W,ne.prev=Y,ne.next=L,ne.prevYear=Z,ne.nextYear=B,ne.today=j,ne.gotoDate=I,ne.incrementDate=$,ne.getDate=X,ne.getCalendar=U,ne.getView=Q,ne.option=J,ne.trigger=K;var oe=f(a(ae.lang));if(ae.monthNames&&(oe._months=ae.monthNames),ae.monthNamesShort&&(oe._monthsShort=ae.monthNamesShort),ae.dayNames&&(oe._weekdays=ae.dayNames),ae.dayNamesShort&&(oe._weekdaysShort=ae.dayNamesShort),null!=ae.firstDay){var ie=f(oe._week);ie.dow=ae.firstDay,oe._week=ie}ne.defaultAllDayEventDuration=t.duration(ae.defaultAllDayEventDuration),ne.defaultTimedEventDuration=t.duration(ae.defaultTimedEventDuration),ne.moment=function(){var e;return"local"===ae.timezone?(e=Oe.moment.apply(null,arguments),e.hasTime()&&e.local()):e="UTC"===ae.timezone?Oe.moment.utc.apply(null,arguments):Oe.moment.parseZone.apply(null,arguments),"_locale"in e?e._locale=oe:e._lang=oe,e},ne.getIsAmbigTimezone=function(){return"local"!==ae.timezone&&"UTC"!==ae.timezone},ne.rezoneDate=function(e){return ne.moment(e.toArray())},ne.getNow=function(){var e=ae.now;return"function"==typeof e&&(e=e()),ne.moment(e)},ne.calculateWeekNumber=function(e){var t=ae.weekNumberCalculation;return"function"==typeof t?t(e):"local"===t?e.week():"ISO"===t.toUpperCase()?e.isoWeek():void 0},ne.getEventEnd=function(e){return e.end?e.end.clone():ne.getDefaultEventEnd(e.allDay,e.start)},ne.getDefaultEventEnd=function(e,t){var n=t.clone();return e?n.stripTime().add(ne.defaultAllDayEventDuration):n.add(ne.defaultTimedEventDuration),ne.getIsAmbigTimezone()&&n.stripZone(),n},ne.formatRange=function(e,t,n){return"function"==typeof n&&(n=n.call(ne,ae,oe)),q(e,t,n,null,ae.isRTL)},ne.formatDate=function(e,t){return"function"==typeof t&&(t=t.call(ne,ae,oe)),P(e,t)},c.call(ne,ae),u.call(ne,ae);var se,le,ce,de,ue,fe,ve,he,pe,ge=ne.isFetchNeeded,me=ne.fetchEvents,ye=n[0],De=0,be=0,we=[];he=null!=ae.defaultDate?ne.moment(ae.defaultDate):ne.getNow(),ae.droppable&&e(document).on("dragstart",ee).on("dragstop",te)}function l(t,n){function r(){f=n.theme?"ui":"fc";var t=n.header;return t?v=e("").append(e("").append(o("left")).append(o("center")).append(o("right"))):void 0}function a(){v.remove()}function o(r){var a=e("",oe&&(r+=""),e=0;U>e;e++)t=ue(0,e),r+="";return r+=""}function d(){var e,t,n,r=re+"-widget-content",a="";for(a+="",e=0;G>e;e++){for(a+="",oe&&(n=ue(e,0),a+=""),t=0;U>t;t++)n=ue(e,t),a+=u(n);a+=""}return a+=""}function u(e){var t=H.intervalStart.month(),r=n.getNow().stripTime(),a="",o=re+"-widget-content",i=["fc-day","fc-"+Ye[e.day()],o];return e.month()!=t&&i.push("fc-other-month"),e.isSame(r,"day")?i.push("fc-today",re+"-state-highlight"):r>e?i.push("fc-past"):i.push("fc-future"),a+=""}function f(t){$=t;var n,r,a,o=Math.max($-A.height(),0);"variable"==ie("weekMode")?n=r=Math.floor(o/(1==G?2:6)):(n=Math.floor(o/G),r=o-n*(G-1)),B.each(function(t,o){G>t&&(a=e(o),a.find("> div").css("min-height",(t==G-1?r:n)-C(a)))})}function v(e){q=e,te.clear(),ne.clear(),V=0,oe&&(V=A.find("th.fc-week-number").outerWidth()),X=Math.floor((q-V)/U),m(W.slice(0,-1),X)}function h(e){e.click(p).mousedown(de)}function p(t){if(!ie("selectable")){var r=n.moment(e(this).data("date"));se("dayClick",this,r,t)}}function g(e,t,n){n&&J.build();for(var r=ve(e,t),a=0;an&&(r=e(i),a=r.offset().top,n&&(o[1]=a),o=[a],t[n]=o)}),o[1]=a+r.outerHeight()}),K=new Me(J),te=new ze(function(e){return P.eq(e)}),ne=new ze(function(e){return j.eq(e)})}function ee(){function e(e,t){n.renderDayEvents(e,t)}function t(){n.getDaySegmentContainer().empty()}var n=this;n.renderEvents=e,n.clearEvents=t,we.call(n)}function te(e,t){function n(e,t){return e.clone().stripTime().add("weeks",t).startOf("week")}function r(e){a.intervalStart=e.clone().stripTime().startOf("week"),a.intervalEnd=a.intervalStart.clone().add("weeks",1),a.start=a.skipHiddenDays(a.intervalStart),a.end=a.skipHiddenDays(a.intervalEnd,-1,!0),a.title=t.formatRange(a.start,a.end.clone().subtract(1),a.opt("titleFormat")," — "),a.renderAgenda(a.getCellsPerWeek())}var a=this;a.incrementDate=n,a.render=r,oe.call(a,e,t,"agendaWeek")}function ne(e,t){function n(e,t){var n=e.clone().stripTime().add(t,"days");return n=a.skipHiddenDays(n,0>t?-1:1)}function r(e){a.start=a.intervalStart=e.clone().stripTime(),a.end=a.intervalEnd=a.start.clone().add(1,"days"),a.title=t.formatDate(a.start,a.opt("titleFormat")),a.renderAgenda(1)}var a=this;a.incrementDate=n,a.render=r,oe.call(a,e,t,"agendaDay")}function re(e,t){return t.longDateFormat("LT").replace(":mm","(:mm)").replace(/(\Wmm)$/,"($1)").replace(/\s*a$/i,"a")}function ae(e,t){return t.longDateFormat("LT").replace(/\s*a$/i,"")}function oe(n,r,a){function o(e){Te=e,i(),$?l():s()}function i(){Ne=Le("theme")?"ui":"fc",Oe=Le("isRTL"),We=Le("columnFormat"),Fe=t.duration(Le("minTime")),Ae=t.duration(Le("maxTime")),ge=t.duration(Le("slotDuration")),ye=Le("snapDuration"),ye=ye?t.duration(ye):ge}function s(){var r,a,o,i,s=Ne+"-widget-header",c=Ne+"-widget-content",d=ge.asMinutes()%15===0;for(l(),te=e("
").appendTo(n),Le("allDaySlot")?(ne=e("
").appendTo(te),r="
"),o=n.header[r];return o&&e.each(o.split(" "),function(r){r>0&&a.append("");var o;e.each(this.split(","),function(r,i){if("title"==i)a.append("

 

"),o&&o.addClass(f+"-corner-right"),o=null;else{var s;if(t[i]?s=t[i]:Fe[i]&&(s=function(){h.removeClass(f+"-state-hover"),t.changeView(i)}),s){var l,c=z(n.themeButtonIcons,i),d=z(n.buttonIcons,i),u=z(n.defaultButtonText,i),v=z(n.buttonText,i);l=v?_(v):c&&n.theme?"":d&&!n.theme?"":_(u||i);var h=e(""+l+"").click(function(){h.hasClass(f+"-state-disabled")||s()}).mousedown(function(){h.not("."+f+"-state-active").not("."+f+"-state-disabled").addClass(f+"-state-down")}).mouseup(function(){h.removeClass(f+"-state-down")}).hover(function(){h.not("."+f+"-state-active").not("."+f+"-state-disabled").addClass(f+"-state-hover")},function(){h.removeClass(f+"-state-hover").removeClass(f+"-state-down")}).appendTo(a);N(h),o||h.addClass(f+"-corner-left"),o=h}}}),o&&o.addClass(f+"-corner-right")}),a}function i(e){v.find("h2").html(e)}function s(e){v.find("span.fc-button-"+e).addClass(f+"-state-active")}function l(e){v.find("span.fc-button-"+e).removeClass(f+"-state-active")}function c(e){v.find("span.fc-button-"+e).addClass(f+"-state-disabled")}function d(e){v.find("span.fc-button-"+e).removeClass(f+"-state-disabled")}var u=this;u.render=r,u.destroy=a,u.updateTitle=i,u.activateButton=s,u.deactivateButton=l,u.disableButton=c,u.enableButton=d;var f,v=e([])}function c(t){function n(e,t){return!E||e.clone().stripZone()S.clone().stripZone()}function r(e,t){E=e,S=t,F=[];var n=++H,r=_.length;N=r;for(var o=0;r>o;o++)a(_[o],n)}function a(t,n){o(t,function(r){var a,o,i=e.isArray(t.events);if(n==H){if(r)for(a=0;ai;i++){var s=a(u[i],r);c=c.concat(s)}}return e.isFunction(t.resourceFilter)?e.grep(c,t.resourceFilter):c}function a(n,r){var a=n.resources;if(a){if(e.isFunction(a))return a()}else{var o=n.url;if(o){var i={};if("object"==typeof r){var s=t.startParam,l=t.endParam;s&&(i[s]=Math.round(+r.intervalStart/1e3)),l&&(i[l]=Math.round(+r.intervalEnd/1e3))}e.ajax(e.extend({},Ae,n,{data:i,dataType:"json",cache:!1,success:function(e){e=e||[],a=e},error:function(){},async:!1}))}}return a}function o(e){e.className?"string"==typeof e.className&&(e.className=e.className.split(/\s+/)):e.className=[];for(var t=Oe.sourceNormalizers,n=0;n=0;a--)if(n=e[r[a].toLowerCase()],void 0!==n)return n;return e["default"]}function _(e){return(e+"").replace(/&/g,"&").replace(//g,">").replace(/'/g,"'").replace(/"/g,""").replace(/\n/g,"
")}function H(e){return e.replace(/&.*?;/g,"")}function N(e){e.attr("unselectable","on").css("MozUserSelect","none").bind("selectstart.ui",function(){return!1})}function O(e){e.children().removeClass("fc-first fc-last").filter(":first-child").addClass("fc-first").end().filter(":last-child").addClass("fc-last")}function F(e,t){var n=e.source||{},r=e.color,a=n.color,o=t("eventColor"),i=e.backgroundColor||r||n.backgroundColor||a||t("eventBackgroundColor")||o,s=e.borderColor||r||n.borderColor||a||t("eventBorderColor")||o,l=e.textColor||n.textColor||t("eventTextColor"),c=[];return i&&c.push("background-color:"+i),s&&c.push("border-color:"+s),l&&c.push("color:"+l),c.join(";")}function A(t,n,r){if(e.isFunction(t)&&(t=[t]),t){var a,o;for(a=0;ai&&(o=X(e,t,n[s]),o!==!1);s--)d=o+d;for(l=i;s>=l;l++)u+=I(e,n[l]),f+=I(t,n[l]);return(u||f)&&(v=a?f+r+u:u+r+f),c+v+d}function X(e,t,n){var r,a;return"string"==typeof n?n:(r=n.token)&&(a=Pe[r.charAt(0)],a&&e.isSame(t,a))?B(e,r):!1}function V(e){return e in je?je[e]:je[e]=G(e)}function G(e){for(var t,n=[],r=/\[([^\]]*)\]|\(([^\)]*)\)|(LT|(\w)\4*o?)|([^\w\[\(]+)/g;t=r.exec(e);)t[1]?n.push(t[1]):t[2]?n.push({maybe:G(t[2])}):t[3]?n.push({token:t[3]}):t[5]&&n.push(t[5]);return n}function U(e,t){function n(e,t){return e.clone().stripTime().add("months",t).startOf("month")}function r(e){a.intervalStart=e.clone().stripTime().startOf("month"),a.intervalEnd=a.intervalStart.clone().add("months",1),a.start=a.intervalStart.clone(),a.start=a.skipHiddenDays(a.start),a.start.startOf("week"),a.start=a.skipHiddenDays(a.start),a.end=a.intervalEnd.clone(),a.end=a.skipHiddenDays(a.end,-1,!0),a.end.add((7-a.end.weekday())%7,"days"),a.end=a.skipHiddenDays(a.end,-1,!0);var n=Math.ceil(a.end.diff(a.start,"weeks",!0));"fixed"==a.opt("weekMode")&&(a.end.add("weeks",6-n),n=6),a.title=t.formatDate(a.intervalStart,a.opt("titleFormat")),a.renderBasic(n,a.getCellsPerWeek(),!0)}var a=this;a.incrementDate=n,a.render=r,K.call(a,e,t,"month")}function Q(e,t){function n(e,t){return e.clone().stripTime().add("weeks",t).startOf("week")}function r(e){a.intervalStart=e.clone().stripTime().startOf("week"),a.intervalEnd=a.intervalStart.clone().add("weeks",1),a.start=a.skipHiddenDays(a.intervalStart),a.end=a.skipHiddenDays(a.intervalEnd,-1,!0),a.title=t.formatRange(a.start,a.end.clone().subtract(1),a.opt("titleFormat")," — "),a.renderBasic(1,a.getCellsPerWeek(),!1)}var a=this;a.incrementDate=n,a.render=r,K.call(a,e,t,"basicWeek")}function J(e,t){function n(e,t){var n=e.clone().stripTime().add(t,"days");return n=a.skipHiddenDays(n,0>t?-1:1)}function r(e){a.start=a.intervalStart=e.clone().stripTime(),a.end=a.intervalEnd=a.start.clone().add(1,"days"),a.title=t.formatDate(a.start,a.opt("titleFormat")),a.renderBasic(1,1,!1)}var a=this;a.incrementDate=n,a.render=r,K.call(a,e,t,"basicDay")}function K(t,n,r){function a(e,t,n){G=e,U=t,Q=n,o(),Y||i(),s()}function o(){re=ie("theme")?"ui":"fc",ae=ie("columnFormat"),oe=ie("weekNumbers")}function i(){I=e("
").appendTo(t)}function s(){var n=l();F&&F.remove(),F=e(n).appendTo(t),A=F.find("thead"),W=A.find(".fc-day-header"),Y=F.find("tbody"),L=Y.find("tr"),Z=Y.find(".fc-day"),B=L.find("td:first-child"),P=L.eq(0).find(".fc-day > div"),j=L.eq(0).find(".fc-day-content > div"),O(A.add(A.find("tr"))),O(L),L.eq(0).addClass("fc-first"),L.filter(":last").addClass("fc-last"),Z.each(function(t,n){var r=ue(Math.floor(t/U),t%U);se("dayRender",H,r,e(n))}),h(Z)}function l(){var e=""+c()+d()+"
";return e}function c(){var e,t,n=re+"-widget-header",r="";for(r+="
"+_(ie("weekNumberTitle"))+""+_(he(t,ae))+"
"+_(pe(n))+"
",Q&&(a+="
"+e.date()+"
"),a+="
 
"+(Le("allDayHTML")||_(Le("allDayText")))+"
 
",re=e(r).appendTo(te),ae=re.find("tr"),g(ae.find("td")),te.append("
")):ne=e([]),oe=e("
").appendTo(te),se=e("
").appendTo(oe),le=e("
").appendTo(se),r="",a=t.duration(+Fe),Ce=0;Ae>a;)o=q.start.clone().time(a),i=o.minutes(),r+="",a.add(ge),Ce++;r+="
"+(d&&i?" ":_(Ue(o,Le("axisFormat"))))+"
 
",ce=e(r).appendTo(se),D(ce.find("td"))}function l(){var t=c();$&&$.remove(),$=e(t).appendTo(n),X=$.find("thead"),V=X.find("th").slice(1,-1),G=$.find("tbody"),U=G.find("td").slice(0,-1),Q=U.find("> div"),J=U.find(".fc-day-content > div"),K=U.eq(0),ee=Q.eq(0),O(X.add(X.find("tr"))),O(G.add(G.find("tr")))}function c(){var e=""+d()+u()+"
";return e}function d(){var e,t,n,r=Ne+"-widget-header",a="";for(a+="",Le("weekNumbers")?(e=Xe(0,0),t=Qe(e),Oe?t+=Le("weekNumberTitle"):t=Le("weekNumberTitle")+t,a+=""+_(t)+""):a+=" ",n=0;Te>n;n++)e=Xe(0,n),a+=""+_(Ue(e,We))+"";return a+=" "}function u(){var e,t,n,a,o,i=Ne+"-widget-header",s=Ne+"-widget-content",l=r.getNow().stripTime(),c="";for(c+=" ",n="",t=0;Te>t;t++)e=Xe(0,t),o=["fc-col"+t,"fc-"+Ye[e.day()],s],e.isSame(l,"day")?o.push(Ne+"-state-highlight","fc-today"):l>e?o.push("fc-past"):o.push("fc-future"),a="
 
",n+=a;return c+=n,c+=" "}function f(e){void 0===e&&(e=fe),fe=e,Je={};var t=G.position().top,n=oe.position().top,r=Math.min(e-t,ce.height()+n+1);ee.height(r-C(K)),te.css("top",t),oe.height(r-n-1);var a=ce.find("tr:first").height()+1,o=ce.find("tr:eq(1)").height();me=(a+o)/2,De=ge/ye,we=me/De}function v(t){ue=t,_e.clear(),He.clear();var n=X.find("th:first");re&&(n=n.add(re.find("th:first"))),n=n.add(ce.find("th:first")),ve=0,m(n.width("").each(function(t,n){ve=Math.max(ve,e(n).outerWidth())}),ve);var r=$.find(".fc-agenda-gutter");re&&(r=r.add(re.find("th.fc-agenda-gutter")));var a=oe[0].clientWidth;pe=oe.width()-a,pe?(m(r,pe),r.show().prev().removeClass("fc-last")):r.hide().prev().addClass("fc-last"),he=Math.floor((a-ve)/Te),m(V.slice(0,-1),he)}function h(){function e(){oe.scrollTop(n)}var n=A(t.duration(Le("scrollTime")))+1;e(),setTimeout(e,0)}function p(){h()}function g(e){e.click(b).mousedown(qe)}function D(e){e.click(b).mousedown(B)}function b(e){if(!Le("selectable")){var t=Math.min(Te-1,Math.floor((e.pageX-$.offset().left-ve)/he)),n=Xe(0,t),a=this.parentNode.className.match(/fc-slot(\d+)/);if(a){var o=parseInt(a[1],10);n.add(Fe+o*ge),n=r.rezoneDate(n),Ze("dayClick",U[t],n,e)}else Ze("dayClick",U[t],n,e)}}function w(e,t,n){n&&Ee.build();for(var r=Ge(e,t),a=0;an;n++){var r=Xe(0,n),a=r.clone().add(1,"days"),o=e>r?e:r,i=t>a?a:t;if(i>o){var s=Ee.rect(0,n,0,n,se),l=F(o,r),c=F(i,r);s.top=l,s.height=c-l,D(Be(s,se))}}}function S(e){return _e.left(e)}function x(e){return He.left(e)}function k(e){return _e.right(e)}function R(e){return He.right(e)}function z(e){return Le("allDaySlot")&&!e.row}function H(e){var n=Xe(0,e.col),a=e.row;return Le("allDaySlot")&&a--,a>=0&&(n.time(t.duration(Fe+a*ye)),n=r.rezoneDate(n)),n}function F(e,n){return A(t.duration(e.clone().stripZone()-n.clone().stripTime()))}function A(e){if(Fe>e)return 0;if(e>=Ae)return ce.height();var t=(e-Fe)/ge,n=Math.floor(t),r=t-n,a=Je[n];void 0===a&&(a=Je[n]=ce.find("tr").eq(n).find("td div")[0].offsetTop); + var o=a-1+r*me;return o=Math.max(o,0)}function W(e){return e.hasTime()?e.clone().add(ge):e.clone().add(1,"days")}function Y(e,t){e.hasTime()||t.hasTime()?L(e,t):Le("allDaySlot")&&w(e,t,!0)}function L(t,n){var r=Le("selectHelper");if(Ee.build(),r){var a=Ve(t).col;if(a>=0&&Te>a){var o=Ee.rect(0,a,0,a,se),i=F(t,t),s=F(n,t);if(s>i){if(o.top=i,o.height=s-i,o.left+=2,o.width-=5,e.isFunction(r)){var l=r(t,n);l&&(o.position="absolute",de=e(l).css(o).appendTo(se))}else o.isStart=!0,o.isEnd=!0,de=e($e({title:"",start:t,end:n,className:["fc-select-helper"],editable:!1},o)),de.css("opacity",Le("dragOpacity"));de&&(D(de),se.append(de),m(de,o.width,!0),y(de,o.height,!0))}}}else E(t,n)}function Z(){Pe(),de&&(de.remove(),de=null)}function B(t){if(1==t.which&&Le("selectable")){Ie(t);var n;Re.start(function(e,t){if(Z(),e&&e.col==t.col&&!z(e)){var r=H(t),a=H(e);n=[r,r.clone().add(ye),a,a.clone().add(ye)].sort(M),L(n[0],n[3])}else n=null},t),e(document).one("mouseup",function(e){Re.stop(),n&&(+n[0]==+n[1]&&P(n[0],e),je(n[0],n[3],e))})}}function P(e,t){Ze("dayClick",U[Ve(e).col],e,t)}function j(e,t,n){Re.start(function(e){if(Pe(),e){var t=H(e),n=t.clone();t.hasTime()?(n.add(r.defaultTimedEventDuration),E(t,n)):(n.add(r.defaultAllDayEventDuration),w(t,n))}},t)}function I(e,t,n){var r=Re.stop();Pe(),r&&Ze("drop",e,H(r),t,n)}var q=this;q.renderAgenda=o,q.setWidth=v,q.setHeight=f,q.afterRender=p,q.computeDateTop=F,q.getIsCellAllDay=z,q.allDayRow=function(){return ae},q.getCoordinateGrid=function(){return Ee},q.getHoverListener=function(){return Re},q.colLeft=S,q.colRight=k,q.colContentLeft=x,q.colContentRight=R,q.getDaySegmentContainer=function(){return ne},q.getSlotSegmentContainer=function(){return le},q.getSlotContainer=function(){return se},q.getRowCnt=function(){return 1},q.getColCnt=function(){return Te},q.getColWidth=function(){return he},q.getSnapHeight=function(){return we},q.getSnapDuration=function(){return ye},q.getSlotHeight=function(){return me},q.getSlotDuration=function(){return ge},q.getMinTime=function(){return Fe},q.getMaxTime=function(){return Ae},q.defaultSelectionEnd=W,q.renderDayOverlay=w,q.renderSelection=Y,q.clearSelection=Z,q.reportDayClick=P,q.dragStart=j,q.dragStop=I,be.call(q,n,r,a),xe.call(q),Se.call(q),ie.call(q);var $,X,V,G,U,Q,J,K,ee,te,ne,re,ae,oe,se,le,ce,de,ue,fe,ve,he,pe,ge,me,ye,De,we,Te,Ce,Ee,Re,_e,He,Ne,Oe,Fe,Ae,We,Le=q.opt,Ze=q.trigger,Be=q.renderOverlay,Pe=q.clearOverlays,je=q.reportSelection,Ie=q.unselect,qe=q.daySelectionMousedown,$e=q.slotSegHtml,Xe=q.cellToDate,Ve=q.dateToCell,Ge=q.rangeToSegments,Ue=r.formatDate,Qe=r.calculateWeekNumber,Je={};N(n.addClass("fc-agenda")),Ee=new ke(function(t,n){function r(e){return Math.max(l,Math.min(c,e))}var a,o,i;V.each(function(t,r){a=e(r),o=a.offset().left,t&&(i[1]=o),i=[o],n[t]=i}),i[1]=o+a.outerWidth(),Le("allDaySlot")&&(a=ae,o=a.offset().top,t[0]=[o,o+a.outerHeight()]);for(var s=se.offset().top,l=oe.offset().top,c=l+oe.outerHeight(),d=0;Ce*De>d;d++)t.push([r(s+we*d),r(s+we*(d+1))])}),Re=new Me(Ee),_e=new ze(function(e){return Q.eq(e)}),He=new ze(function(e){return J.eq(e)})}function ie(){function n(e,t){var n,r=e.length,o=[],s=[];for(n=0;r>n;n++)e[n].allDay?o.push(e[n]):s.push(e[n]);v("allDaySlot")&&(X(o,t),w()),i(a(s),t)}function r(){T().empty(),E().empty()}function a(e){var t,n,r,a,i,s=H(),l=V(),c=G(),d=[];for(n=0;s>n;n++)for(t=z(0,n),i=o(e,t.clone().time(l),t.clone().time(c)),i=se(i),r=0;rr;r++)a=e[r],o=a.start.clone().stripZone(),i=J(a).stripZone(),i>t&&n>o&&(t>o?(s=t.clone(),c=!1):(s=o,c=!0),i>n?(l=n.clone(),d=!1):(l=i,d=!0),u.push({event:a,start:s,end:l,isStart:c,isEnd:d}));return u.sort(ge)}function i(t,n){var r,a,o,i,c,d,u,f,p,m,y,b,w,T,S,k,z=t.length,_="",H=E(),N=v("isRTL");for(r=0;z>r;r++)a=t[r],o=a.event,i=x(a.start,a.start),c=x(a.end,a.start),d=M(a.col),u=R(a.col),f=u-d,u-=.025*f,f=u-d,p=f*(a.forwardCoord-a.backwardCoord),v("slotEventOverlap")&&(p=Math.max(2*(p-10),p)),N?(y=u-a.backwardCoord*f,m=y-p):(m=d+a.backwardCoord*f,y=m+p),m=Math.max(m,d),y=Math.min(y,u),p=y-m,a.top=i,a.left=m,a.outerWidth=p,a.outerHeight=c-i,_+=s(o,a);for(H[0].innerHTML=_,b=H.children(),r=0;z>r;r++)a=t[r],o=a.event,w=e(b[r]),T=h("eventRender",o,o,w),T===!1?w.remove():(T&&T!==!0&&(w.remove(),w=e(T).css({position:"absolute",top:a.top,left:a.left}).appendTo(H)),a.element=w,o._id===n?l(o,w,a):w[0]._fci=r,Z(o,w));for(g(H,t,l),r=0;z>r;r++)a=t[r],(w=a.element)&&(a.vsides=C(w,!0),a.hsides=D(w,!0),S=w.find(".fc-event-title"),S.length&&(a.contentTop=S[0].offsetTop));for(r=0;z>r;r++)a=t[r],(w=a.element)&&(w[0].style.width=Math.max(0,a.outerWidth-a.hsides)+"px",k=Math.max(0,a.outerHeight-a.vsides),w[0].style.height=k+"px",o=a.event,void 0!==a.contentTop&&k-a.contentTop<10&&(w.find("div.fc-event-time").text(Q(o.start,v("timeFormat"))+" - "+o.title),w.find("div.fc-event-title").remove()),h("eventAfterRender",o,o,w))}function s(e,t){var n="<",r=e.url,a=F(e,v),o=["fc-event","fc-event-vert"];return p(e)&&o.push("fc-event-draggable"),t.isStart&&o.push("fc-event-start"),t.isEnd&&o.push("fc-event-end"),o=o.concat(e.className),e.source&&(o=o.concat(e.source.className||[])),n+=r?"a href='"+_(e.url)+"'":"div",n+=" class='"+o.join(" ")+"' style='position:absolute;top:"+t.top+"px;left:"+t.left+"px;"+a+"'>
"+_(f.getEventTimeText(e))+"
"+_(e.title||"")+"
",t.isEnd&&m(e)&&(n+="
=
"),n+=""}function l(e,t,n){var r=t.find("div.fc-event-time");p(e)&&d(e,t,r),n.isEnd&&m(e)&&u(e,t,r),b(e,t)}function c(e,n,r){function a(){c||(n.width(o).height("").draggable("option","grid",null),c=!0)}var o,i,s,l=r.isStart,c=!0,d=S(),u=N(),f=V(),p=Y(),g=W(),m=A(),D=O();n.draggable({opacity:v("dragOpacity","month"),revertDuration:v("dragRevertDuration"),start:function(t,r){h("eventDragStart",n[0],e,t,r),P(e,n),o=n.width(),d.start(function(t,r){if($(),t){i=!1;var o=z(0,r.col),d=z(0,t.col);s=d.diff(o,"days"),t.row?l?c&&(n.width(u-10),y(n,U.defaultTimedEventDuration/p*g),n.draggable("option","grid",[u,1]),c=!1):i=!0:(q(e.start.clone().add(s,"days"),J(e).add(s,"days")),a()),i=i||c&&!s}else a(),i=!0;n.draggable("option","revert",i)},t,"drag")},stop:function(r,o){if(d.stop(),$(),h("eventDragStop",n[0],e,r,o),i)a(),n.css("filter",""),B(e,n);else{var l,u,v=e.start.clone().add(s,"days");c||(u=Math.round((n.offset().top-L().offset().top)/D),l=t.duration(f+u*m),v=U.rezoneDate(v.clone().time(l))),j(n[0],e,v,r,o)}}})}function d(e,t,n){function r(){$(),s&&(c?(n.hide(),t.draggable("option","grid",null),q(D,b)):(a(),n.css("display",""),t.draggable("option","grid",[C,E])))}function a(){D&&n.text(f.getEventTimeText(D,e.end?b:null))}var o,i,s,l,c,d,u,p,g,m,y,D,b,w=f.getCoordinateGrid(),T=H(),C=N(),E=O(),S=A();t.draggable({scroll:!1,grid:[C,E],axis:1==T?"y":!1,opacity:v("dragOpacity"),revertDuration:v("dragRevertDuration"),start:function(n,r){h("eventDragStart",t[0],e,n,r),P(e,t),w.build(),o=t.position(),i=w.cell(n.pageX,n.pageY),s=l=!0,c=d=k(i),u=p=0,g=0,m=y=0,D=null,b=null},drag:function(n,a){var f=w.cell(n.pageX,n.pageY);if(s=!!f){if(c=k(f),u=Math.round((a.position.left-o.left)/C),u!=p){var v=z(0,i.col),h=i.col+u;h=Math.max(0,h),h=Math.min(T-1,h);var x=z(0,h);g=x.diff(v,"days")}c||(m=Math.round((a.position.top-o.top)/E))}(s!=l||c!=d||u!=p||m!=y)&&(c?(D=e.start.clone().stripTime().add(g,"days"),b=D.clone().add(U.defaultAllDayEventDuration)):(D=e.start.clone().add(m*S).add(g,"days"),b=J(e).add(m*S).add(g,"days")),r(),l=s,d=c,p=u,y=m),t.draggable("option","revert",!s)},stop:function(n,a){$(),h("eventDragStop",t[0],e,n,a),s&&(c||g||m)?j(t[0],e,D,n,a):(s=!0,c=!1,u=0,g=0,m=0,r(),t.css("filter",""),t.css(o),B(e,t))}})}function u(e,t,n){var r,a,o,i=O(),s=A();t.resizable({handles:{s:".ui-resizable-handle"},grid:i,start:function(n,o){r=a=0,P(e,t),h("eventResizeStart",t[0],e,n,o)},resize:function(l,c){if(r=Math.round((Math.max(i,t.height())-c.originalSize.height)/i),r!=a){o=J(e).add(s*r);var d;d=r?f.getEventTimeText(e.start,o):f.getEventTimeText(e),n.text(d),a=r}},stop:function(n,a){h("eventResizeStop",t[0],e,n,a),r?I(t[0],e,o,n,a):B(e,t)}})}var f=this;f.renderEvents=n,f.clearEvents=r,f.slotSegHtml=s,we.call(f);var v=f.opt,h=f.trigger,p=f.isEventDraggable,m=f.isEventResizable,b=f.eventElementHandlers,w=f.setHeight,T=f.getDaySegmentContainer,E=f.getSlotSegmentContainer,S=f.getHoverListener,x=f.computeDateTop,k=f.getIsCellAllDay,M=f.colContentLeft,R=f.colContentRight,z=f.cellToDate,H=f.getColCnt,N=f.getColWidth,O=f.getSnapHeight,A=f.getSnapDuration,W=f.getSlotHeight,Y=f.getSlotDuration,L=f.getSlotContainer,Z=f.reportEventElement,B=f.showEvents,P=f.hideEvents,j=f.eventDrop,I=f.eventResize,q=f.renderDayOverlay,$=f.clearOverlays,X=f.renderDayEvents,V=f.getMinTime,G=f.getMaxTime,U=f.calendar,Q=U.formatDate,J=U.getEventEnd;f.draggableDayEvent=c}function se(e){var t,n=le(e),r=n[0];if(ce(n),r){for(t=0;tt.start&&e.startt?-1:1)}function r(e){a.start=a.intervalStart=e.clone().stripTime(),a.end=a.intervalEnd=a.start.clone().add(1,"days"),a.title=t.formatDate(a.start,a.opt("titleFormat")),a.renderResource(o().length)}var a=this;a.incrementDate=n,a.render=r,ye.call(a,e,t,"resourceDay");var o=a.getResources}function ye(n,r,a){function o(e){Re=e,i(),G?l():s()}function i(){Ae=Pe("theme")?"ui":"fc",We=Pe("isRTL"),Be=Pe("columnFormat"),Le=t.duration(Pe("minTime")),Ze=t.duration(Pe("maxTime")),ye=t.duration(Pe("slotDuration")),Te=Pe("snapDuration"),Te=Te?t.duration(Te):ye}function s(){var r,a,o,i,s=Ae+"-widget-header",c=Ae+"-widget-content",d=ye.asMinutes()%15===0;for(l(),ae=e("
").appendTo(n),Pe("allDaySlot")?(oe=e("
").appendTo(ae),r="
"+(Pe("allDayHTML")||_(Pe("allDayText")))+"
 
",ie=e(r).appendTo(ae),se=ie.find("tr"),g(se.find("td")),ae.append("
")):oe=e([]),le=e("
").appendTo(ae),ce=e("
").appendTo(le),de=e("
").appendTo(ce),r="",a=t.duration(+Le),_e=0;Ze>a;)o=V.start.clone().time(a),i=o.minutes(),r+="",a.add(ye),_e++;r+="
"+(d&&i?" ":_(Je(o,Pe("axisFormat"))))+"
 
",ue=e(r).appendTo(ce),D(ue.find("td"))}function l(){var t=c();G&&G.remove(),G=e(t).appendTo(n),U=G.find("thead"),Q=U.find("th").slice(1,-1),J=G.find("tbody"),K=J.find("td").slice(0,-1),ee=K.find("> div"),te=K.find(".fc-day-content > div"),ne=K.eq(0),re=ee.eq(0),O(U.add(U.find("tr"))),O(J.add(J.find("tr")))}function c(){var e=""+d()+u()+"
";return e}function d(){var e,t,n,r=Ae+"-widget-header",a="";for(a+="",Pe("weekNumbers")?(e=Ge(0,0),t=Ke(e),We?t+=Pe("weekNumberTitle"):t=Pe("weekNumberTitle")+t,a+=""+_(t)+""):a+=" ",n=0;Re>n;n++){var o=nt()[n],i=["fc-col"+n,o.className,r];a+=""+_(o.name)+""}return a+=" "}function u(){var e,t,n,a,o,i=Ae+"-widget-header",s=Ae+"-widget-content",l=r.getNow().stripTime(),c="";for(c+=" ",n="",t=0;(Re||1)>t;t++){var d=nt()[t];e=V.intervalStart.clone(),o=["fc-col"+t,"fc-"+Ye[e.day()],s],d&&d.className&&o.push(d.className),e.isSame(l,"day")?o.push(Ae+"-state-highlight","fc-today"):l>e?o.push("fc-past"):o.push("fc-future"),a="
 
",n+=a}return c+=n,c+=" "}function f(e){void 0===e&&(e=he),he=e,tt={};var t=J.position().top,n=le.position().top,r=Math.min(e-t,ue.height()+n+1);re.height(r-C(ne)),ae.css("top",t),le.height(r-n-1);var a=ue.find("tr:first").height()+1,o=ue.find("tr:eq(1)").height();we=(a+o)/2,Ce=ye/Te,Ee=we/Ce}function v(t){ve=t,Oe.clear(),Fe.clear();var n=U.find("th:first");ie&&(n=n.add(ie.find("th:first"))),n=n.add(ue.find("th:first")),pe=0,m(n.width("").each(function(t,n){pe=Math.max(pe,e(n).outerWidth())}),pe);var r=G.find(".fc-agenda-gutter");ie&&(r=r.add(ie.find("th.fc-agenda-gutter")));var a=le[0].clientWidth;me=le.width()-a,me?(m(r,me),r.show().prev().removeClass("fc-last")):r.hide().prev().addClass("fc-last"),ge=Math.floor((a-pe)/Re),m(Q.slice(0,-1),ge)}function h(){function e(){le.scrollTop(n)}var n=A(t.duration(Pe("scrollTime")))+1;e(),setTimeout(e,0)}function p(){h()}function g(e){e.click(b).mousedown(X)}function D(e){e.click(b).mousedown(B)}function b(e){if(!Pe("selectable")){var t=Math.min(Re-1,Math.floor((e.pageX-G.offset().left-pe)/ge)),n=Ge(0,0),a=this.parentNode.className.match(/fc-slot(\d+)/);if(e.data=nt()[t],a){var o=parseInt(a[1],10);n.add(Le+o*ye),n=r.rezoneDate(n),je("dayClick",K[t],n,e)}else je("dayClick",K[t],n,e)}}function w(e,t,n,r){n&&He.build();for(var a=Qe(e,t),o=0;or?e:r,i=t>a?a:t;if(i>o){var s=He.rect(0,n,0,n,ce),l=F(o,r),c=F(i,r);s.top=l,s.height=c-l,D(Ie(s,ce))}}function S(e){return Oe.left(e)}function x(e){return Fe.left(e)}function k(e){return Oe.right(e)}function R(e){return Fe.right(e)}function z(e){return Pe("allDaySlot")&&!e.row}function H(e){var n=Ge(0,0),a=e.row;return Pe("allDaySlot")&&a--,a>=0&&(n.time(t.duration(Le+a*Te)),n=r.rezoneDate(n)),n}function F(e,n){return A(t.duration(e.clone().stripZone()-n.clone().stripTime()))}function A(e){if(Le>e)return 0;if(e>=Ze)return ue.height();var t=(e-Le)/ye,n=Math.floor(t),r=t-n,a=tt[n];void 0===a&&(a=tt[n]=ue.find("tr").eq(n).find("td div")[0].offsetTop);var o=a-1+r*we;return o=Math.max(o,0)}function W(e){return e.hasTime()?e.clone().add(ye):e.clone().add(1,"days")}function Y(e,t,n){e.hasTime()||t.hasTime()?L(e,t):Pe("allDaySlot")&&w(e,t,!0,n)}function L(t,n,r){var a=Pe("selectHelper");if(He.build(),a){if(r=r||Ue(t).col,r>=0&&Re>r){var o=He.rect(0,r,0,r,ce),i=F(t,t),s=F(n,t);if(s>i){if(o.top=i,o.height=s-i,o.left+=2,o.width-=5,e.isFunction(a)){var l=a(t,n);l&&(o.position="absolute",fe=e(l).css(o).appendTo(ce))}else o.isStart=!0,o.isEnd=!0,fe=e(Ve({title:"",start:t,end:n,className:["fc-select-helper"],editable:!1},o)),fe.css("opacity",Pe("dragOpacity"));fe&&(D(fe),ce.append(fe),m(fe,o.width,!0),y(fe,o.height,!0))}}}else E(t,n,r)}function Z(){qe(),fe&&(fe.remove(),fe=null)}function B(t){if(1==t.which&&Pe("selectable")){Xe(t);var n,r;Ne.start(function(e,t){if(Z(),e&&e.col==t.col&&!z(e)){r=e.col;var a=H(t),o=H(e);n=[a,a.clone().add(Te),o,o.clone().add(Te)].sort(M),L(n[0],n[3],e.col)}else n=null},t),e(document).one("mouseup",function(e){Ne.stop(),n&&(+n[0]==+n[1]&&P(n[0],e),e.data=nt()[r],$e(n[0],n[3],e))})}}function P(e,t){je("dayClick",K[Ue(e).col],e,t)}function j(e,t,n,a,o,i){var s=r.mutateResourceEvent(t,n,a,null);je("eventDrop",e,t,s.dateDelta,function(){s.undo(),et(t._id)},o,i),et(t._id)}function I(e,t,n,a,o){var i=r.mutateResourceEvent(t,t.resources,null,n);je("eventResize",e,t,i.durationDelta,function(){i.undo(),et(t._id)},a,o),et(t._id)}function q(e,t,n){Ne.start(function(e){if(qe(),e){var t=H(e),n=t.clone();t.hasTime()?(n.add(r.defaultTimedEventDuration),E(t,n,e.col)):(n.add(r.defaultAllDayEventDuration),w(t,n,!0,e.col))}},t)}function $(e,t,n){var r=Ne.stop();qe(),r&&(t.data=nt()[r.col],je("drop",e,H(r),t,n))}function X(t){var n,r=V.getIsCellAllDay,a=V.getHoverListener(),o=V.reportDayClick;if(1==t.which&&Pe("selectable")){Xe(t);var i;a.start(function(e,t){Z(),e&&r(e)?(n=e.col,i=[H(t),H(e)].sort(M),Y(i[0],i[1],n)):i=null},t),e(document).one("mouseup",function(e){a.stop(),i&&(+i[0]==+i[1]&&o(i[0],!0,e),e.data=nt()[n],$e(i[0],i[1],e))})}}var V=this;V.renderResource=o,V.setWidth=v,V.setHeight=f,V.afterRender=p,V.computeDateTop=F,V.getIsCellAllDay=z,V.allDayRow=function(){return se},V.getCoordinateGrid=function(){return He},V.getHoverListener=function(){return Ne},V.colLeft=S,V.colRight=k,V.colContentLeft=x,V.colContentRight=R,V.getDaySegmentContainer=function(){return oe},V.getSlotSegmentContainer=function(){return de},V.getSlotContainer=function(){return ce},V.getRowCnt=function(){return 1},V.getColCnt=function(){return 1},V.getColWidth=function(){return ge},V.getSnapHeight=function(){return Ee},V.getSnapDuration=function(){return Te},V.getSlotHeight=function(){return we},V.getSlotDuration=function(){return ye},V.getMinTime=function(){return Le},V.getMaxTime=function(){return Ze},V.defaultSelectionEnd=W,V.renderDayOverlay=w,V.renderSelection=Y,V.clearSelection=Z,V.reportDayClick=P,V.dragStart=q,V.dragStop=$,V.getResources=r.fetchResources,be.call(V,n,r,a),V.eventDrop=j,V.eventResize=I,xe.call(V),Se.call(V),De.call(V);var G,U,Q,J,K,ee,te,ne,re,ae,oe,ie,se,le,ce,de,ue,fe,ve,he,pe,ge,me,ye,we,Te,Ce,Ee,Re,_e,He,Ne,Oe,Fe,Ae,We,Le,Ze,Be,Pe=V.opt,je=V.trigger,Ie=V.renderOverlay,qe=V.clearOverlays,$e=V.reportSelection,Xe=V.unselect,Ve=V.slotSegHtml,Ge=V.cellToDate,Ue=V.dateToCell,Qe=V.rangeToSegments,Je=r.formatDate,Ke=r.calculateWeekNumber,et=r.reportEventChange,tt={},nt=V.getResources;N(n.addClass("fc-agenda")),He=new ke(function(t,n){function r(e){return Math.max(l,Math.min(c,e))}var a,o,i;Q.each(function(t,r){a=e(r),o=a.offset().left,t&&(i[1]=o),i=[o],n[t]=i}),i[1]=o+a.outerWidth(),Pe("allDaySlot")&&(a=se,o=a.offset().top,t[0]=[o,o+a.outerHeight()]);for(var s=ce.offset().top,l=le.offset().top,c=l+le.outerHeight(),d=0;_e*Ce>d;d++)t.push([r(s+Ee*d),r(s+Ee*(d+1))])}),Ne=new Me(He),Oe=new ze(function(e){return ee.eq(e)}),Fe=new ze(function(e){return te.eq(e)})}function De(){function n(e,t){var n,r=e.length,o=[],i=[];for(n=0;r>n;n++)e[n].allDay?o.push(e[n]):i.push(e[n]);h("allDaySlot")&&(V(o,t),T()),s(a(i),t)}function r(){E().empty(),S().empty()}function a(e){var t,n,r,a,s,l=N(),c=G(),d=U(),u=[];for(n=0;l>n;n++){t=H(0,0);var f=i(ee()[n],e);for(s=o(f,t.clone().time(c),t.clone().time(d)),s=se(s),r=0;rr;r++)a=e[r],o=a.start.clone().stripZone(),i=K(a).stripZone(),i>t&&n>o&&(t>o?(s=t.clone(),c=!1):(s=o,c=!0),i>n?(l=n.clone(),d=!1):(l=i,d=!0),u.push({event:a,start:s,end:l,isStart:c,isEnd:d}));return u.sort(ge)}function i(t,n){for(var r=[],a=function(n){return n.resources&&e.grep(n.resources,function(e){return e==t.id}).length},o=0;or;r++)a=t[r],o=a.event,i=k(a.start,a.start),s=k(a.end,a.start),d=R(a.col),u=z(a.col),f=u-d,u-=.025*f,f=u-d,v=f*(a.forwardCoord-a.backwardCoord),h("slotEventOverlap")&&(v=Math.max(2*(v-10),v)),N?(y=u-a.backwardCoord*f,m=y-v):(m=d+a.backwardCoord*f,y=m+v),m=Math.max(m,d),y=Math.min(y,u),v=y-m,a.top=i,a.left=m,a.outerWidth=v,a.outerHeight=s-i,_+=l(o,a);for(H[0].innerHTML=_,b=H.children(),r=0;M>r;r++)a=t[r],o=a.event,w=e(b[r]),T=p("eventRender",o,o,w),T===!1?w.remove():(T&&T!==!0&&(w.remove(),w=e(T).css({position:"absolute",top:a.top,left:a.left}).appendTo(H)),a.element=w,o._id===n?c(o,w,a):w[0]._fci=r,B(o,w));for(g(H,t,c),r=0;M>r;r++)a=t[r],(w=a.element)&&(a.vsides=C(w,!0),a.hsides=D(w,!0),E=w.find(".fc-event-title"),E.length&&(a.contentTop=E[0].offsetTop));for(r=0;M>r;r++)a=t[r],(w=a.element)&&(w[0].style.width=Math.max(0,a.outerWidth-a.hsides)+"px",x=Math.max(0,a.outerHeight-a.vsides),w[0].style.height=x+"px",o=a.event,void 0!==a.contentTop&&x-a.contentTop<10&&(w.find("div.fc-event-time").text(J(o.start,h("timeFormat"))+" - "+o.title),w.find("div.fc-event-title").remove()),p("eventAfterRender",o,o,w))}function l(e,t){var n="<",r=e.url,a=F(e,h),o=["fc-event","fc-event-vert"];return m(e)&&o.push("fc-event-draggable"),t.isStart&&o.push("fc-event-start"),t.isEnd&&o.push("fc-event-end"),o=o.concat(e.className),e.source&&(o=o.concat(e.source.className||[])),n+=r?"a href='"+_(e.url)+"'":"div",n+=" class='"+o.join(" ")+"' style='position:absolute;top:"+t.top+"px;left:"+t.left+"px;"+a+"'>
"+_(v.getEventTimeText(e))+"
"+_(e.title||"")+"
",t.isEnd&&b(e)&&(n+="
=
"),n+=""}function c(e,t,n){var r=t.find("div.fc-event-time");m(e)&&u(e,t,r),n.isEnd&&b(e)&&f(e,t,r),w(e,t)}function d(e,n,r){function a(){d||(n.width(o).height("").draggable("option","grid",null),d=!0)}var o,i,s,l,c=r.isStart,d=!0,u=x(),f=O(),v=G(),g=L(),m=Y(),D=W(),b=A();n.draggable({opacity:h("dragOpacity","month"),revertDuration:h("dragRevertDuration"),start:function(t,r){p("eventDragStart",n[0],e,t,r),j(e,n),o=n.width(),u.start(function(t,r){if(X(),t){i=!1,l=r.col;var o=H(0,r.col),u=H(0,t.col);s=u.diff(o,"days"),t.row?c?d&&(n.width(f-10),y(n,Q.defaultTimedEventDuration/g*m),n.draggable("option","grid",[f,1]),d=!1):i=!0:($(e.start.clone().add(s,"days"),K(e).add(s,"days"),!0,1),a()),i=i||d&&!s}else a(),i=!0;n.draggable("option","revert",i)},t,"drag")},stop:function(r,o){if(u.stop(),X(),p("eventDragStop",n[0],e,r,o),i)a(),n.css("filter",""),P(e,n);else{var s=Math.round((n.offset().left-Z().offset().left)/f),c=e.resources;s!==l&&(c=[ee()[s].id]);var h,g,m=e.start.clone();d||(g=Math.round((n.offset().top-Z().offset().top)/b),h=t.duration(v+g*D),m=Q.rezoneDate(m.clone().time(h))),I(n[0],e,c,m,r,o)}}})}function u(e,t,n){function r(){X(),s&&(c?(n.hide(),t.draggable("option","grid",null),$(b,w,!1,i.col+u)):(a(),n.css("display",""),t.draggable("option","grid",[E,S])))}function a(){b&&n.text(v.getEventTimeText(b,e.end?w:null))}var o,i,s,l,c,d,u,f,g,m,y,D,b,w,T=v.getCoordinateGrid(),C=N(),E=O(),S=A(),x=W();t.draggable({scroll:!1,grid:[E,S],axis:1==C?"y":!1,opacity:h("dragOpacity"),revertDuration:h("dragRevertDuration"),start:function(n,r){p("eventDragStart",t[0],e,n,r),j(e,t),T.build(),o=t.position(),i=T.cell(n.pageX,n.pageY),s=l=!0,c=d=M(i),u=f=0,g=0,m=0,y=D=0,b=null,w=null},drag:function(n,a){var i=T.cell(n.pageX,n.pageY);s=!!i,s&&(c=M(i),u=Math.round((a.position.left-o.left)/E),u!=f&&(m=u),c||(y=Math.round((a.position.top-o.top)/S))),(s!=l||c!=d||u!=f||y!=D)&&(c?(b=e.start.clone().stripTime().add(g,"days"),w=b.clone().add(Q.defaultAllDayEventDuration)):(b=e.start.clone().add(y*x).add(g,"days"),w=K(e).add(y*x).add(g,"days")),r(),l=s,d=c,f=u,D=y),t.draggable("option","revert",!s)},stop:function(n,a){if(X(),p("eventDragStop",t[0],e,n,a),s&&(c||m||y)){var l=e.resources.slice(0);if(m){var d=ee(),f=d[i.col+m].id,v=d[i.col].id,h=e.resources.indexOf(v),D=e.resources.indexOf(f);D>-1?l.splice(h,1):l[h]=f}I(t[0],e,l,b,n,a)}else s=!0,c=!1,u=0,g=0,y=0,r(),t.css("filter",""),t.css(o),P(e,t)}})}function f(e,t,n){var r,a,o,i=A(),s=W();t.resizable({handles:{s:".ui-resizable-handle"},grid:i,start:function(n,o){r=a=0,j(e,t),p("eventResizeStart",t[0],e,n,o)},resize:function(l,c){if(r=Math.round((Math.max(i,t.height())-c.originalSize.height)/i),r!=a){o=K(e).add(s*r);var d;d=r?v.getEventTimeText(e.start,o):v.getEventTimeText(e),n.text(d),a=r}},stop:function(n,a){p("eventResizeStop",t[0],e,n,a),r?q(t[0],e,o,n,a):P(e,t)}})}var v=this;v.renderEvents=n,v.clearEvents=r,v.slotSegHtml=l,we.call(v);var h=v.opt,p=v.trigger,m=v.isEventDraggable,b=v.isEventResizable,w=v.eventElementHandlers,T=v.setHeight,E=v.getDaySegmentContainer,S=v.getSlotSegmentContainer,x=v.getHoverListener,k=v.computeDateTop,M=v.getIsCellAllDay,R=v.colContentLeft,z=v.colContentRight,H=v.cellToDate,N=function(){return ee().length},O=v.getColWidth,A=v.getSnapHeight,W=v.getSnapDuration,Y=v.getSlotHeight,L=v.getSlotDuration,Z=v.getSlotContainer,B=v.reportEventElement,P=v.showEvents,j=v.hideEvents,I=v.eventDrop,q=v.eventResize,$=v.renderDayOverlay,X=v.clearOverlays,V=v.renderDayEvents,G=v.getMinTime,U=v.getMaxTime,Q=v.calendar,J=Q.formatDate,K=Q.getEventEnd,ee=v.getResources;v.draggableDayEvent=d}function be(n,r,a){function o(t,n){var r=A[t];return e.isPlainObject(r)&&!i(t)?z(r,n||a):r}function s(e,t){return r.trigger.apply(r,[e,t||H].concat(Array.prototype.slice.call(arguments,2),[H]))}function l(e){var t=e.source||{};return W(e.startEditable,t.startEditable,o("eventStartEditable"),e.editable,t.editable,o("editable"))}function c(e){var t=e.source||{};return W(e.durationEditable,t.durationEditable,o("eventDurationEditable"),e.editable,t.editable,o("editable"))}function d(){O={},F=[]}function u(e,t){F.push({event:e,element:t}),O[e._id]?O[e._id].push(t):O[e._id]=[t]}function f(){e.each(F,function(e,t){H.trigger("eventDestroy",t.event,t.event,t.element)})}function v(e,t){t.click(function(n){return t.hasClass("ui-draggable-dragging")||t.hasClass("ui-resizable-resizing")?void 0:s("eventClick",this,e,n)}).hover(function(t){s("eventMouseover",this,e,t)},function(t){s("eventMouseout",this,e,t)})}function h(e,t){g(e,t,"show")}function p(e,t){g(e,t,"hide")}function g(e,t,n){var r,a=O[e._id],o=a.length;for(r=0;o>r;r++)t&&a[r][0]==t[0]||a[r][n]()}function m(e,t,n,a,o){var i=r.mutateEvent(t,n,null);s("eventDrop",e,t,i.dateDelta,function(){i.undo(),N(t._id)},a,o),N(t._id)}function y(e,t,n,a,o){var i=r.mutateEvent(t,null,n);s("eventResize",e,t,i.durationDelta,function(){i.undo(),N(t._id)},a,o),N(t._id)}function D(e){return t.isMoment(e)&&(e=e.day()),B[e]}function b(){return L}function w(e,t,n){var r=e.clone();for(t=t||1;B[(r.day()+(n?t:0)+7)%7];)r.add(t,"days");return r}function T(){var e=C.apply(null,arguments),t=E(e),n=S(t);return n}function C(e,t){var n=H.getColCnt(),r=I?-1:1,a=I?n-1:0;"object"==typeof e&&(t=e.col,e=e.row);var o=e*n+(t*r+a);return o}function E(e){var t=H.start.day();return e+=P[t],7*Math.floor(e/L)+j[(e%L+L)%L]-t}function S(e){return H.start.clone().add(e,"days")}function x(e){var t=k(e),n=M(t),r=R(n);return r}function k(e){return e.clone().stripTime().diff(H.start,"days")}function M(e){var t=H.start.day();return e+=t,Math.floor(e/7)*L+P[(e%7+7)%7]-P[t]}function R(e){var t=H.getColCnt(),n=I?-1:1,r=I?t-1:0,a=Math.floor(e/t),o=(e%t+t)%t*n+r;return{row:a,col:o}}function _(e,t){var n=H.getRowCnt(),r=H.getColCnt(),a=[],o=k(e),i=k(t),s=+t.time();s&&s>=Y&&i++,i=Math.max(i,o+1);for(var l=M(o),c=M(i)-1,d=0;n>d;d++){var u=d*r,f=u+r-1,v=Math.max(l,u),h=Math.min(c,f);if(h>=v){var p=R(v),g=R(h),m=[p.col,g.col].sort(),y=E(v)==o,D=E(h)+1==i;a.push({row:d,leftCol:m[0],rightCol:m[1],isStart:y,isEnd:D})}}return a}var H=this;H.element=n,H.calendar=r,H.name=a,H.opt=o,H.trigger=s,H.isEventDraggable=l,H.isEventResizable=c,H.clearEventData=d,H.reportEventElement=u,H.triggerEventDestroy=f,H.eventElementHandlers=v,H.showEvents=h,H.hideEvents=p,H.eventDrop=m,H.eventResize=y;var N=r.reportEventChange,O={},F=[],A=r.options,Y=t.duration(A.nextDayThreshold);H.getEventTimeText=function(e){var t,n;return 2===arguments.length?(t=arguments[0],n=arguments[1]):(t=e.start,n=e.end),n&&o("displayEventEnd")?r.formatRange(t,n,o("timeFormat")):r.formatDate(t,o("timeFormat"))},H.isHiddenDay=D,H.skipHiddenDays=w,H.getCellsPerWeek=b,H.dateToCell=x,H.dateToDayOffset=k,H.dayOffsetToCellOffset=M,H.cellOffsetToCell=R,H.cellToDate=T,H.cellToCellOffset=C,H.cellOffsetToDayOffset=E,H.dayOffsetToDate=S,H.rangeToSegments=_;var L,Z=o("hiddenDays")||[],B=[],P=[],j=[],I=o("isRTL");!function(){o("weekends")===!1&&Z.push(0,6);for(var t=0,n=0;7>t;t++)P[t]=n,B[t]=-1!=e.inArray(t,Z),B[t]||(j[n]=t,n++);if(L=n,!L)throw"invalid hiddenDays"}()}function we(){function t(e,t){var n=r(e,!1,!0);Ce(n,function(e,t){M(e.event,t)}),y(n,t),Ce(n,function(e,t){S("eventAfterRender",e.event,e.event,t)})}function n(e,t,n){var a=r([e],!0,!1),o=[];return Ce(a,function(e,r){e.row===t&&r.css("top",n),o.push(r[0])}),o}function r(t,n,r){var o,i,c=q(),f=n?e("
"):c,v=a(t);return s(v),o=l(v),f[0].innerHTML=o,i=f.children(),n&&c.append(i),d(v,i),Ce(v,function(e,t){e.hsides=D(t,!0)}),Ce(v,function(e,t){t.width(Math.max(0,e.outerWidth-e.hsides))}),Ce(v,function(e,t){e.outerHeight=t.outerHeight(!0)}),u(v,r),v}function a(e){var t,n,r=C.getResources,a=[];if("undefined"==typeof r)for(t=0;t
",!r.allDay&&e.isStart&&(t+=""+_(C.getEventTimeText(r))+""),t+=""+_(r.title||"")+"
",r.allDay&&e.isEnd&&k(r)&&(t+="
   
"),t+=""}function d(t,n){for(var r=0;ri;i++){var s=o[i],l=[];for(t=0;r>t;t++)l.push(0);for(var c=0;cr;r++)o[r]=h(o[r]||[]);return o}function h(e){for(var t=[],n=p(e),r=0;re;e++)n[e]=Z(e).find("div.fc-day-content > div");return n}function y(e,t){var n=q();Ce(e,function(e,n,r){var a=e.event;a._id===t?b(a,n,e):n[0]._fci=r}),g(n,e,b)}function b(e,t,n){x(e)&&C.draggableDayEvent(e,t,n),e.allDay&&n.isEnd&&k(e)&&C.resizableDayEvent(e,t,n),z(e,t)}function w(e,t){var n,r,a=G();t.draggable({delay:50,opacity:E("dragOpacity"),revertDuration:E("dragRevertDuration"),start:function(o,i){S("eventDragStart",t[0],e,o,i),O(e,t),a.start(function(a,o,i,s){if(t.draggable("option","revert",!a||!i&&!s),X(),a){var l=Q(o),c=Q(a);n=c.diff(l,"days"),r=e.start.clone().add(n,"days"),$(r,re(e).add(n,"days"))}else n=0},o,"drag")},stop:function(o,i){a.stop(),X(),S("eventDragStop",t[0],e,o,i),n?A(t[0],e,r,o,i):(t.css("filter",""),H(e,t))}})}function T(t,r,a){var o=E("isRTL"),i=o?"w":"e",s=r.find(".ui-resizable-"+i),l=!1;N(r),r.mousedown(function(e){e.preventDefault()}).click(function(e){l&&(e.preventDefault(),e.stopImmediatePropagation())}),s.mousedown(function(o){function s(n){S("eventResizeStop",r[0],t,n,{}),e("body").css("cursor",""),f.stop(),X(),c&&W(r[0],t,d,n,{}),setTimeout(function(){l=!1},0)}if(1==o.which){l=!0;var c,d,u,f=G(),v=r.css("top"),h=e.extend({},t),p=te(ee(t.start));V(),e("body").css("cursor",i+"-resize").one("mouseup",s),S("eventResizeStart",r[0],t,o,{}),f.start(function(r,o){if(r){var s=J(o),l=J(r);if(l=Math.max(l,p),c=K(l)-K(s),d=re(t).add(c,"days"),c){h.end=d;var f=u;u=n(h,a.row,v),u=e(u),u.find("*").css("cursor",i+"-resize"),f&&f.remove(),O(t)}else u&&(H(t),u.remove(),u=null);X(),$(t.start,d)}},o)}})}var C=this;C.renderDayEvents=t,C.draggableDayEvent=w,C.resizableDayEvent=T;var E=C.opt,S=C.trigger,x=C.isEventDraggable,k=C.isEventResizable,M=C.reportEventElement,z=C.eventElementHandlers,H=C.showEvents,O=C.hideEvents,A=C.eventDrop,W=C.eventResize,Y=C.getRowCnt,L=C.getColCnt,Z=C.allDayRow,B=C.colLeft,P=C.colRight,j=C.colContentLeft,I=C.colContentRight,q=C.getDaySegmentContainer,$=C.renderDayOverlay,X=C.clearOverlays,V=C.clearSelection,G=C.getHoverListener,U=C.rangeToSegments,Q=C.cellToDate,J=C.cellToCellOffset,K=C.cellOffsetToDayOffset,ee=C.dateToDayOffset,te=C.dayOffsetToCellOffset,ne=C.calendar,re=ne.getEventEnd}function Te(e,t){for(var n=0;n=e.leftCol)return!0}return!1}function Ce(e,t){for(var n=0;n")),r[0].parentNode!=n[0]&&r.appendTo(n),a.push(r.css(t).show()),r}function n(){for(var e;e=a.shift();)o.push(e.hide().unbind())}var r=this;r.renderOverlay=t,r.clearOverlays=n;var a=[],o=[]}function ke(e){var t,n,r=this;r.build=function(){t=[],n=[],e(t,n)},r.cell=function(e,r){var a,o=t.length,i=n.length,s=-1,l=-1;for(a=0;o>a;a++)if(r>=t[a][0]&&ra;a++)if(e>=n[a][0]&&e=0&&l>=0?{row:s,col:l}:null},r.rect=function(e,r,a,o,i){var s=i.offset();return{top:t[e][0]-s.top,left:n[r][0]-s.left,width:n[o][1]-n[r][0],height:t[a][1]-t[e][0]}}}function Me(t){function n(e){Re(e);var n=t.cell(e.pageX,e.pageY);(Boolean(n)!==Boolean(i)||n&&(n.row!=i.row||n.col!=i.col))&&(n?(o||(o=n),a(n,o,n.row-o.row,n.col-o.col)):a(n,o),i=n)}var r,a,o,i,s=this;s.start=function(s,l,c){a=s,o=i=null,t.build(),n(l),r=c||"mousemove",e(document).bind(r,n)},s.stop=function(){return e(document).unbind(r,n),i}}function Re(e){void 0===e.pageX&&(e.pageX=e.originalEvent.pageX,e.pageY=e.originalEvent.pageY)}function ze(e){function t(t){return r[t]=r[t]||e(t)}var n=this,r={},a={},o={};n.left=function(e){return a[e]=void 0===a[e]?t(e).position().left:a[e]},n.right=function(e){return o[e]=void 0===o[e]?n.left(e)+t(e).width():o[e]},n.clear=function(){r={},a={},o={}}}var _e={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:r,day:"dddd"},timeFormat:{"default":n},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"},unselectAuto:!0,dropAccept:"*",handleWindowResize:!0,windowResizeDelay:200},He={en:{columnFormat:{week:"ddd M/D"}}},Ne={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"}},Oe=e.fullCalendar={version:"2.0.2"},Fe=Oe.views={};e.fn.fullCalendar=function(t){var n=Array.prototype.slice.call(arguments,1),r=this;return this.each(function(a,o){var i,l=e(o),c=l.data("fullCalendar");"string"==typeof t?c&&e.isFunction(c[t])&&(i=c[t].apply(c,n),a||(r=i),"destroy"===t&&l.removeData("fullCalendar")):c||(c=new s(l,t),l.data("fullCalendar",c),c.render())}),r},Oe.langs=He,Oe.datepickerLang=function(t,n,r){var a=He[t];a||(a=He[t]={}),o(a,{isRTL:r.isRTL,weekNumberTitle:r.weekHeader,titleFormat:{month:r.showMonthAfterYear?"YYYY["+r.yearSuffix+"] MMMM":"MMMM YYYY["+r.yearSuffix+"]"},defaultButtonText:{prev:H(r.prevText),next:H(r.nextText),today:H(r.currentText)}}),e.datepicker&&(e.datepicker.regional[n]=e.datepicker.regional[t]=r,e.datepicker.regional.en=e.datepicker.regional[""],e.datepicker.setDefaults(r))},Oe.lang=function(e,t){var n;t&&(n=He[e],n||(n=He[e]={}),o(n,t||{})),_e.lang=e},Oe.sourceNormalizers=[],Oe.sourceFetchers=[];var Ae={dataType:"json",cache:!1},We=1;Oe.applyAll=A;var Ye=["sun","mon","tue","wed","thu","fri","sat"],Le=/^\s*\d{4}-\d\d$/,Ze=/^\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+)?)?)?)?)?$/;Oe.moment=function(){return Y(arguments)},Oe.moment.utc=function(){var e=Y(arguments,!0);return e.hasTime()&&e.utc(),e},Oe.moment.parseZone=function(){return Y(arguments,!0,!0)},L.prototype=f(t.fn),L.prototype.clone=function(){return Y([this])},L.prototype.time=function(e){if(null==e)return t.duration({hours:this.hours(),minutes:this.minutes(),seconds:this.seconds(),milliseconds:this.milliseconds()});delete this._ambigTime,t.isDuration(e)||t.isMoment(e)||(e=t.duration(e));var n=0;return t.isDuration(e)&&(n=24*Math.floor(e.asDays())),this.hours(n+e.hours()).minutes(e.minutes()).seconds(e.seconds()).milliseconds(e.milliseconds())},L.prototype.stripTime=function(){var e=this.toArray();return t.fn.utc.call(this),this.year(e[0]).month(e[1]).date(e[2]).hours(0).minutes(0).seconds(0).milliseconds(0),this._ambigTime=!0,this._ambigZone=!0,this},L.prototype.hasTime=function(){return!this._ambigTime},L.prototype.stripZone=function(){var e=this.toArray(),n=this._ambigTime;return t.fn.utc.call(this),this.year(e[0]).month(e[1]).date(e[2]).hours(e[3]).minutes(e[4]).seconds(e[5]).milliseconds(e[6]),n&&(this._ambigTime=!0),this._ambigZone=!0,this},L.prototype.hasZone=function(){return!this._ambigZone},L.prototype.utcOffset=function(e){return null!=e&&(delete this._ambigTime,delete this._ambigZone),t.fn.utcOffset.apply(this,arguments)},L.prototype.local=function(){var e=this.toArray(),n=this._ambigZone;return delete this._ambigTime,delete this._ambigZone,t.fn.local.apply(this,arguments),n&&this.year(e[0]).month(e[1]).date(e[2]).hours(e[3]).minutes(e[4]).seconds(e[5]).milliseconds(e[6]),this},L.prototype.utc=function(){return delete this._ambigTime,delete this._ambigZone,t.fn.utc.apply(this,arguments)},L.prototype.format=function(){return arguments[0]?P(this,arguments[0]):this._ambigTime?B(this,"YYYY-MM-DD"):this._ambigZone?B(this,"YYYY-MM-DD[T]HH:mm:ss"):B(this)},L.prototype.toISOString=function(){return this._ambigTime?B(this,"YYYY-MM-DD"):this._ambigZone?B(this,"YYYY-MM-DD[T]HH:mm:ss"):t.fn.toISOString.apply(this,arguments)},L.prototype.isWithin=function(e,t){var n=Z([this,e,t]);return n[0]>=n[1]&&n[0] Date: Fri, 15 Jan 2016 12:51:17 +0100 Subject: [PATCH 2/2] Fixes #1 added adjustments for initial slotHeight --- dist/fullcalendar.js | 6 ++++-- dist/fullcalendar.min.js | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/dist/fullcalendar.js b/dist/fullcalendar.js index 70e4d4ec27..b6c7de6524 100644 --- a/dist/fullcalendar.js +++ b/dist/fullcalendar.js @@ -4419,7 +4419,8 @@ function AgendaView(element, calendar, viewName) { var slotHeight0 = slotTable.find('tr:first').height() + 1; // +1 for bottom border var slotHeight1 = slotTable.find('tr:eq(1)').height(); // HACK: i forget why we do this, but i think a cross-browser issue - slotHeight = (slotHeight0 + slotHeight1) / 2; + // add slotHeight adjustment to prevent misplacing issue by selecting new timeslot + slotHeight = (slotHeight0 + slotHeight1) / 2 - 0.5; snapRatio = slotDuration / snapDuration; snapHeight = slotHeight / snapRatio; @@ -6352,7 +6353,8 @@ function ResourceView(element, calendar, viewName) { var slotHeight0 = slotTable.find('tr:first').height() + 1; // +1 for bottom border var slotHeight1 = slotTable.find('tr:eq(1)').height(); // HACK: i forget why we do this, but i think a cross-browser issue - slotHeight = (slotHeight0 + slotHeight1) / 2; + // add slotHeight adjustment to prevent misplacing issue by selecting new timeslot + slotHeight = (slotHeight0 + slotHeight1) / 2 - 0.5; snapRatio = slotDuration / snapDuration; snapHeight = slotHeight / snapRatio; diff --git a/dist/fullcalendar.min.js b/dist/fullcalendar.min.js index 4120271a89..fed4fa0b7b 100644 --- a/dist/fullcalendar.min.js +++ b/dist/fullcalendar.min.js @@ -3,6 +3,6 @@ * Docs & License: http://arshaw.com/fullcalendar/ * (c) 2014 Adam Shaw, Sean Kenny */ -!function(e){"function"==typeof define&&define.amd?define(["jquery","moment"],e):e(jQuery,moment)}(function(e,t){function n(e,t){return t.longDateFormat("LT").replace(":mm","(:mm)").replace(/(\Wmm)$/,"($1)").replace(/\s*a$/i,"t")}function r(e,t){var n=t.longDateFormat("L");return n=n.replace(/^Y+[^\w\s]*|[^\w\s]*Y+$/g,""),e.isRTL?n+=" ddd":n="ddd "+n,n}function a(e){o(_e,e)}function o(t){function n(n,r){e.isPlainObject(r)&&e.isPlainObject(t[n])&&!i(n)?t[n]=o({},t[n],r):void 0!==r&&(t[n]=r)}for(var r=1;r").prependTo(n),se=new l(ne,ae),le=se.render(),le&&n.prepend(le),g(ae.defaultView),ae.handleWindowResize&&e(window).resize(E),p()||d()}function d(){setTimeout(function(){!ue.start&&p()&&y()},0)}function v(){ue&&(K("viewDestroy",ue,ue,ue.element),ue.triggerEventDestroy()),e(window).unbind("resize",E),ae.droppable&&e(document).off("dragstart",ee).off("dragstop",te),ue.selectionManagerDestroy&&ue.selectionManagerDestroy(),se.destroy(),ce.remove(),n.removeClass("fc fc-ltr fc-rtl ui-widget")}function h(){return n.is(":visible")}function p(){return e("body").is(":visible")}function g(e){ue&&e==ue.name||m(e)}function m(t){be++,ue&&(K("viewDestroy",ue,ue,ue.element),W(),ue.triggerEventDestroy(),V(),ue.element.remove(),se.deactivateButton(ue.name)),se.activateButton(t),ue=new Fe[t](e("
").appendTo(ce),ne),y(),G(),be--}function y(e){ue.start&&!e&&he.isWithin(ue.intervalStart,ue.intervalEnd)||h()&&D(e)}function D(e){be++,ue.start&&(K("viewDestroy",ue,ue,ue.element),W(),R()),V(),e&&(he=ue.incrementDate(he,e)),ue.render(he.clone()),T(),G(),(ue.afterRender||k)(),O(),F(),K("viewRender",ue,ue,ue.element),be--,z()}function b(){h()&&(W(),R(),w(),T(),M())}function w(){ve=ae.contentHeight?ae.contentHeight:ae.height?ae.height-(le?le.height():0)-C(ce):Math.round(ce.width()/Math.max(ae.aspectRatio,.5))}function T(){void 0===ve&&w(),be++,ue.setHeight(ve),ue.setWidth(ce.width()),be--,fe=n.outerWidth()}function E(e){if(!be&&e.target===window)if(ue.start){var t=++De;setTimeout(function(){t==De&&!be&&h()&&fe!=(fe=n.outerWidth())&&(be++,b(),ue.trigger("windowResize",ye),be--)},ae.windowResizeDelay)}else d()}function S(){R(),_()}function x(e){R(),M(e)}function M(e){h()&&(ue.renderEvents(we,e),ue.trigger("eventAfterAllRender"))}function R(){ue.triggerEventDestroy(),ue.clearEvents(),ue.clearEventData()}function z(){!ae.lazyFetching||ge(ue.start,ue.end)?_():M()}function _(){me(ue.start,ue.end)}function H(e){we=e,M()}function N(e){x(e)}function O(){se.updateTitle(ue.title)}function F(){var e=ne.getNow();e.isWithin(ue.intervalStart,ue.intervalEnd)?se.disableButton("today"):se.enableButton("today")}function A(e,t){ue.select(e,t)}function W(){ue&&ue.unselect()}function Y(){y(-1)}function L(){y(1)}function Z(){he.add("years",-1),y()}function B(){he.add("years",1),y()}function j(){he=ne.getNow(),y()}function I(e){he=ne.moment(e),y()}function $(e){he.add(t.duration(e)),y()}function X(){return he.clone()}function V(){ce.css({width:"100%",height:ce.height(),overflow:"hidden"})}function G(){ce.css({width:"",height:"",overflow:""})}function U(){return ne}function Q(){return ue}function J(e,t){return void 0===t?ae[e]:void(("height"==e||"contentHeight"==e||"aspectRatio"==e)&&(ae[e]=t,b()))}function K(e,t){return ae[e]?ae[e].apply(t||ye,Array.prototype.slice.call(arguments,2)):void 0}function ee(t,n){var r=t.target,a=e(r);if(!a.parents(".fc").length){var o=ae.dropAccept;(e.isFunction(o)?o.call(r,a):a.is(o))&&(pe=r,ue.dragStart(pe,t,n))}}function te(e,t){pe&&(ue.dragStop(pe,e,t),pe=null)}var ne=this;r=r||{};var re,ae=o({},_e,r);re=ae.lang in He?He[ae.lang]:He[_e.lang],re&&(ae=o({},_e,re,r)),ae.isRTL&&(ae=o({},_e,Ne,re||{},r)),ne.options=ae,ne.render=i,ne.destroy=v,ne.refetchEvents=S,ne.reportEvents=H,ne.reportEventChange=N,ne.rerenderEvents=x,ne.changeView=g,ne.select=A,ne.unselect=W,ne.prev=Y,ne.next=L,ne.prevYear=Z,ne.nextYear=B,ne.today=j,ne.gotoDate=I,ne.incrementDate=$,ne.getDate=X,ne.getCalendar=U,ne.getView=Q,ne.option=J,ne.trigger=K;var oe=f(a(ae.lang));if(ae.monthNames&&(oe._months=ae.monthNames),ae.monthNamesShort&&(oe._monthsShort=ae.monthNamesShort),ae.dayNames&&(oe._weekdays=ae.dayNames),ae.dayNamesShort&&(oe._weekdaysShort=ae.dayNamesShort),null!=ae.firstDay){var ie=f(oe._week);ie.dow=ae.firstDay,oe._week=ie}ne.defaultAllDayEventDuration=t.duration(ae.defaultAllDayEventDuration),ne.defaultTimedEventDuration=t.duration(ae.defaultTimedEventDuration),ne.moment=function(){var e;return"local"===ae.timezone?(e=Oe.moment.apply(null,arguments),e.hasTime()&&e.local()):e="UTC"===ae.timezone?Oe.moment.utc.apply(null,arguments):Oe.moment.parseZone.apply(null,arguments),"_locale"in e?e._locale=oe:e._lang=oe,e},ne.getIsAmbigTimezone=function(){return"local"!==ae.timezone&&"UTC"!==ae.timezone},ne.rezoneDate=function(e){return ne.moment(e.toArray())},ne.getNow=function(){var e=ae.now;return"function"==typeof e&&(e=e()),ne.moment(e)},ne.calculateWeekNumber=function(e){var t=ae.weekNumberCalculation;return"function"==typeof t?t(e):"local"===t?e.week():"ISO"===t.toUpperCase()?e.isoWeek():void 0},ne.getEventEnd=function(e){return e.end?e.end.clone():ne.getDefaultEventEnd(e.allDay,e.start)},ne.getDefaultEventEnd=function(e,t){var n=t.clone();return e?n.stripTime().add(ne.defaultAllDayEventDuration):n.add(ne.defaultTimedEventDuration),ne.getIsAmbigTimezone()&&n.stripZone(),n},ne.formatRange=function(e,t,n){return"function"==typeof n&&(n=n.call(ne,ae,oe)),q(e,t,n,null,ae.isRTL)},ne.formatDate=function(e,t){return"function"==typeof t&&(t=t.call(ne,ae,oe)),P(e,t)},c.call(ne,ae),u.call(ne,ae);var se,le,ce,de,ue,fe,ve,he,pe,ge=ne.isFetchNeeded,me=ne.fetchEvents,ye=n[0],De=0,be=0,we=[];he=null!=ae.defaultDate?ne.moment(ae.defaultDate):ne.getNow(),ae.droppable&&e(document).on("dragstart",ee).on("dragstop",te)}function l(t,n){function r(){f=n.theme?"ui":"fc";var t=n.header;return t?v=e("").append(e("").append(o("left")).append(o("center")).append(o("right"))):void 0}function a(){v.remove()}function o(r){var a=e("",oe&&(r+=""),e=0;U>e;e++)t=ue(0,e),r+="";return r+=""}function d(){var e,t,n,r=re+"-widget-content",a="";for(a+="",e=0;G>e;e++){for(a+="",oe&&(n=ue(e,0),a+=""),t=0;U>t;t++)n=ue(e,t),a+=u(n);a+=""}return a+=""}function u(e){var t=H.intervalStart.month(),r=n.getNow().stripTime(),a="",o=re+"-widget-content",i=["fc-day","fc-"+Ye[e.day()],o];return e.month()!=t&&i.push("fc-other-month"),e.isSame(r,"day")?i.push("fc-today",re+"-state-highlight"):r>e?i.push("fc-past"):i.push("fc-future"),a+=""}function f(t){$=t;var n,r,a,o=Math.max($-A.height(),0);"variable"==ie("weekMode")?n=r=Math.floor(o/(1==G?2:6)):(n=Math.floor(o/G),r=o-n*(G-1)),B.each(function(t,o){G>t&&(a=e(o),a.find("> div").css("min-height",(t==G-1?r:n)-C(a)))})}function v(e){q=e,te.clear(),ne.clear(),V=0,oe&&(V=A.find("th.fc-week-number").outerWidth()),X=Math.floor((q-V)/U),m(W.slice(0,-1),X)}function h(e){e.click(p).mousedown(de)}function p(t){if(!ie("selectable")){var r=n.moment(e(this).data("date"));se("dayClick",this,r,t)}}function g(e,t,n){n&&J.build();for(var r=ve(e,t),a=0;an&&(r=e(i),a=r.offset().top,n&&(o[1]=a),o=[a],t[n]=o)}),o[1]=a+r.outerHeight()}),K=new Me(J),te=new ze(function(e){return P.eq(e)}),ne=new ze(function(e){return j.eq(e)})}function ee(){function e(e,t){n.renderDayEvents(e,t)}function t(){n.getDaySegmentContainer().empty()}var n=this;n.renderEvents=e,n.clearEvents=t,we.call(n)}function te(e,t){function n(e,t){return e.clone().stripTime().add("weeks",t).startOf("week")}function r(e){a.intervalStart=e.clone().stripTime().startOf("week"),a.intervalEnd=a.intervalStart.clone().add("weeks",1),a.start=a.skipHiddenDays(a.intervalStart),a.end=a.skipHiddenDays(a.intervalEnd,-1,!0),a.title=t.formatRange(a.start,a.end.clone().subtract(1),a.opt("titleFormat")," — "),a.renderAgenda(a.getCellsPerWeek())}var a=this;a.incrementDate=n,a.render=r,oe.call(a,e,t,"agendaWeek")}function ne(e,t){function n(e,t){var n=e.clone().stripTime().add(t,"days");return n=a.skipHiddenDays(n,0>t?-1:1)}function r(e){a.start=a.intervalStart=e.clone().stripTime(),a.end=a.intervalEnd=a.start.clone().add(1,"days"),a.title=t.formatDate(a.start,a.opt("titleFormat")),a.renderAgenda(1)}var a=this;a.incrementDate=n,a.render=r,oe.call(a,e,t,"agendaDay")}function re(e,t){return t.longDateFormat("LT").replace(":mm","(:mm)").replace(/(\Wmm)$/,"($1)").replace(/\s*a$/i,"a")}function ae(e,t){return t.longDateFormat("LT").replace(/\s*a$/i,"")}function oe(n,r,a){function o(e){Te=e,i(),$?l():s()}function i(){Ne=Le("theme")?"ui":"fc",Oe=Le("isRTL"),We=Le("columnFormat"),Fe=t.duration(Le("minTime")),Ae=t.duration(Le("maxTime")),ge=t.duration(Le("slotDuration")),ye=Le("snapDuration"),ye=ye?t.duration(ye):ge}function s(){var r,a,o,i,s=Ne+"-widget-header",c=Ne+"-widget-content",d=ge.asMinutes()%15===0;for(l(),te=e("
").appendTo(n),Le("allDaySlot")?(ne=e("
").appendTo(te),r="
"),o=n.header[r];return o&&e.each(o.split(" "),function(r){r>0&&a.append("");var o;e.each(this.split(","),function(r,i){if("title"==i)a.append("

 

"),o&&o.addClass(f+"-corner-right"),o=null;else{var s;if(t[i]?s=t[i]:Fe[i]&&(s=function(){h.removeClass(f+"-state-hover"),t.changeView(i)}),s){var l,c=z(n.themeButtonIcons,i),d=z(n.buttonIcons,i),u=z(n.defaultButtonText,i),v=z(n.buttonText,i);l=v?_(v):c&&n.theme?"":d&&!n.theme?"":_(u||i);var h=e(""+l+"").click(function(){h.hasClass(f+"-state-disabled")||s()}).mousedown(function(){h.not("."+f+"-state-active").not("."+f+"-state-disabled").addClass(f+"-state-down")}).mouseup(function(){h.removeClass(f+"-state-down")}).hover(function(){h.not("."+f+"-state-active").not("."+f+"-state-disabled").addClass(f+"-state-hover")},function(){h.removeClass(f+"-state-hover").removeClass(f+"-state-down")}).appendTo(a);N(h),o||h.addClass(f+"-corner-left"),o=h}}}),o&&o.addClass(f+"-corner-right")}),a}function i(e){v.find("h2").html(e)}function s(e){v.find("span.fc-button-"+e).addClass(f+"-state-active")}function l(e){v.find("span.fc-button-"+e).removeClass(f+"-state-active")}function c(e){v.find("span.fc-button-"+e).addClass(f+"-state-disabled")}function d(e){v.find("span.fc-button-"+e).removeClass(f+"-state-disabled")}var u=this;u.render=r,u.destroy=a,u.updateTitle=i,u.activateButton=s,u.deactivateButton=l,u.disableButton=c,u.enableButton=d;var f,v=e([])}function c(t){function n(e,t){return!E||e.clone().stripZone()S.clone().stripZone()}function r(e,t){E=e,S=t,F=[];var n=++H,r=_.length;N=r;for(var o=0;r>o;o++)a(_[o],n)}function a(t,n){o(t,function(r){var a,o,i=e.isArray(t.events);if(n==H){if(r)for(a=0;ai;i++){var s=a(u[i],r);c=c.concat(s)}}return e.isFunction(t.resourceFilter)?e.grep(c,t.resourceFilter):c}function a(n,r){var a=n.resources;if(a){if(e.isFunction(a))return a()}else{var o=n.url;if(o){var i={};if("object"==typeof r){var s=t.startParam,l=t.endParam;s&&(i[s]=Math.round(+r.intervalStart/1e3)),l&&(i[l]=Math.round(+r.intervalEnd/1e3))}e.ajax(e.extend({},Ae,n,{data:i,dataType:"json",cache:!1,success:function(e){e=e||[],a=e},error:function(){},async:!1}))}}return a}function o(e){e.className?"string"==typeof e.className&&(e.className=e.className.split(/\s+/)):e.className=[];for(var t=Oe.sourceNormalizers,n=0;n=0;a--)if(n=e[r[a].toLowerCase()],void 0!==n)return n;return e["default"]}function _(e){return(e+"").replace(/&/g,"&").replace(//g,">").replace(/'/g,"'").replace(/"/g,""").replace(/\n/g,"
")}function H(e){return e.replace(/&.*?;/g,"")}function N(e){e.attr("unselectable","on").css("MozUserSelect","none").bind("selectstart.ui",function(){return!1})}function O(e){e.children().removeClass("fc-first fc-last").filter(":first-child").addClass("fc-first").end().filter(":last-child").addClass("fc-last")}function F(e,t){var n=e.source||{},r=e.color,a=n.color,o=t("eventColor"),i=e.backgroundColor||r||n.backgroundColor||a||t("eventBackgroundColor")||o,s=e.borderColor||r||n.borderColor||a||t("eventBorderColor")||o,l=e.textColor||n.textColor||t("eventTextColor"),c=[];return i&&c.push("background-color:"+i),s&&c.push("border-color:"+s),l&&c.push("color:"+l),c.join(";")}function A(t,n,r){if(e.isFunction(t)&&(t=[t]),t){var a,o;for(a=0;ai&&(o=X(e,t,n[s]),o!==!1);s--)d=o+d;for(l=i;s>=l;l++)u+=I(e,n[l]),f+=I(t,n[l]);return(u||f)&&(v=a?f+r+u:u+r+f),c+v+d}function X(e,t,n){var r,a;return"string"==typeof n?n:(r=n.token)&&(a=Pe[r.charAt(0)],a&&e.isSame(t,a))?B(e,r):!1}function V(e){return e in je?je[e]:je[e]=G(e)}function G(e){for(var t,n=[],r=/\[([^\]]*)\]|\(([^\)]*)\)|(LT|(\w)\4*o?)|([^\w\[\(]+)/g;t=r.exec(e);)t[1]?n.push(t[1]):t[2]?n.push({maybe:G(t[2])}):t[3]?n.push({token:t[3]}):t[5]&&n.push(t[5]);return n}function U(e,t){function n(e,t){return e.clone().stripTime().add("months",t).startOf("month")}function r(e){a.intervalStart=e.clone().stripTime().startOf("month"),a.intervalEnd=a.intervalStart.clone().add("months",1),a.start=a.intervalStart.clone(),a.start=a.skipHiddenDays(a.start),a.start.startOf("week"),a.start=a.skipHiddenDays(a.start),a.end=a.intervalEnd.clone(),a.end=a.skipHiddenDays(a.end,-1,!0),a.end.add((7-a.end.weekday())%7,"days"),a.end=a.skipHiddenDays(a.end,-1,!0);var n=Math.ceil(a.end.diff(a.start,"weeks",!0));"fixed"==a.opt("weekMode")&&(a.end.add("weeks",6-n),n=6),a.title=t.formatDate(a.intervalStart,a.opt("titleFormat")),a.renderBasic(n,a.getCellsPerWeek(),!0)}var a=this;a.incrementDate=n,a.render=r,K.call(a,e,t,"month")}function Q(e,t){function n(e,t){return e.clone().stripTime().add("weeks",t).startOf("week")}function r(e){a.intervalStart=e.clone().stripTime().startOf("week"),a.intervalEnd=a.intervalStart.clone().add("weeks",1),a.start=a.skipHiddenDays(a.intervalStart),a.end=a.skipHiddenDays(a.intervalEnd,-1,!0),a.title=t.formatRange(a.start,a.end.clone().subtract(1),a.opt("titleFormat")," — "),a.renderBasic(1,a.getCellsPerWeek(),!1)}var a=this;a.incrementDate=n,a.render=r,K.call(a,e,t,"basicWeek")}function J(e,t){function n(e,t){var n=e.clone().stripTime().add(t,"days");return n=a.skipHiddenDays(n,0>t?-1:1)}function r(e){a.start=a.intervalStart=e.clone().stripTime(),a.end=a.intervalEnd=a.start.clone().add(1,"days"),a.title=t.formatDate(a.start,a.opt("titleFormat")),a.renderBasic(1,1,!1)}var a=this;a.incrementDate=n,a.render=r,K.call(a,e,t,"basicDay")}function K(t,n,r){function a(e,t,n){G=e,U=t,Q=n,o(),Y||i(),s()}function o(){re=ie("theme")?"ui":"fc",ae=ie("columnFormat"),oe=ie("weekNumbers")}function i(){I=e("
").appendTo(t)}function s(){var n=l();F&&F.remove(),F=e(n).appendTo(t),A=F.find("thead"),W=A.find(".fc-day-header"),Y=F.find("tbody"),L=Y.find("tr"),Z=Y.find(".fc-day"),B=L.find("td:first-child"),P=L.eq(0).find(".fc-day > div"),j=L.eq(0).find(".fc-day-content > div"),O(A.add(A.find("tr"))),O(L),L.eq(0).addClass("fc-first"),L.filter(":last").addClass("fc-last"),Z.each(function(t,n){var r=ue(Math.floor(t/U),t%U);se("dayRender",H,r,e(n))}),h(Z)}function l(){var e=""+c()+d()+"
";return e}function c(){var e,t,n=re+"-widget-header",r="";for(r+="
"+_(ie("weekNumberTitle"))+""+_(he(t,ae))+"
"+_(pe(n))+"
",Q&&(a+="
"+e.date()+"
"),a+="
 
"+(Le("allDayHTML")||_(Le("allDayText")))+"
 
",re=e(r).appendTo(te),ae=re.find("tr"),g(ae.find("td")),te.append("
")):ne=e([]),oe=e("
").appendTo(te),se=e("
").appendTo(oe),le=e("
").appendTo(se),r="",a=t.duration(+Fe),Ce=0;Ae>a;)o=q.start.clone().time(a),i=o.minutes(),r+="",a.add(ge),Ce++;r+="
"+(d&&i?" ":_(Ue(o,Le("axisFormat"))))+"
 
",ce=e(r).appendTo(se),D(ce.find("td"))}function l(){var t=c();$&&$.remove(),$=e(t).appendTo(n),X=$.find("thead"),V=X.find("th").slice(1,-1),G=$.find("tbody"),U=G.find("td").slice(0,-1),Q=U.find("> div"),J=U.find(".fc-day-content > div"),K=U.eq(0),ee=Q.eq(0),O(X.add(X.find("tr"))),O(G.add(G.find("tr")))}function c(){var e=""+d()+u()+"
";return e}function d(){var e,t,n,r=Ne+"-widget-header",a="";for(a+="",Le("weekNumbers")?(e=Xe(0,0),t=Qe(e),Oe?t+=Le("weekNumberTitle"):t=Le("weekNumberTitle")+t,a+=""+_(t)+""):a+=" ",n=0;Te>n;n++)e=Xe(0,n),a+=""+_(Ue(e,We))+"";return a+=" "}function u(){var e,t,n,a,o,i=Ne+"-widget-header",s=Ne+"-widget-content",l=r.getNow().stripTime(),c="";for(c+=" ",n="",t=0;Te>t;t++)e=Xe(0,t),o=["fc-col"+t,"fc-"+Ye[e.day()],s],e.isSame(l,"day")?o.push(Ne+"-state-highlight","fc-today"):l>e?o.push("fc-past"):o.push("fc-future"),a="
 
",n+=a;return c+=n,c+=" "}function f(e){void 0===e&&(e=fe),fe=e,Je={};var t=G.position().top,n=oe.position().top,r=Math.min(e-t,ce.height()+n+1);ee.height(r-C(K)),te.css("top",t),oe.height(r-n-1);var a=ce.find("tr:first").height()+1,o=ce.find("tr:eq(1)").height();me=(a+o)/2,De=ge/ye,we=me/De}function v(t){ue=t,_e.clear(),He.clear();var n=X.find("th:first");re&&(n=n.add(re.find("th:first"))),n=n.add(ce.find("th:first")),ve=0,m(n.width("").each(function(t,n){ve=Math.max(ve,e(n).outerWidth())}),ve);var r=$.find(".fc-agenda-gutter");re&&(r=r.add(re.find("th.fc-agenda-gutter")));var a=oe[0].clientWidth;pe=oe.width()-a,pe?(m(r,pe),r.show().prev().removeClass("fc-last")):r.hide().prev().addClass("fc-last"),he=Math.floor((a-ve)/Te),m(V.slice(0,-1),he)}function h(){function e(){oe.scrollTop(n)}var n=A(t.duration(Le("scrollTime")))+1;e(),setTimeout(e,0)}function p(){h()}function g(e){e.click(b).mousedown(qe)}function D(e){e.click(b).mousedown(B)}function b(e){if(!Le("selectable")){var t=Math.min(Te-1,Math.floor((e.pageX-$.offset().left-ve)/he)),n=Xe(0,t),a=this.parentNode.className.match(/fc-slot(\d+)/);if(a){var o=parseInt(a[1],10);n.add(Fe+o*ge),n=r.rezoneDate(n),Ze("dayClick",U[t],n,e)}else Ze("dayClick",U[t],n,e)}}function w(e,t,n){n&&Ee.build();for(var r=Ge(e,t),a=0;an;n++){var r=Xe(0,n),a=r.clone().add(1,"days"),o=e>r?e:r,i=t>a?a:t;if(i>o){var s=Ee.rect(0,n,0,n,se),l=F(o,r),c=F(i,r);s.top=l,s.height=c-l,D(Be(s,se))}}}function S(e){return _e.left(e)}function x(e){return He.left(e)}function k(e){return _e.right(e)}function R(e){return He.right(e)}function z(e){return Le("allDaySlot")&&!e.row}function H(e){var n=Xe(0,e.col),a=e.row;return Le("allDaySlot")&&a--,a>=0&&(n.time(t.duration(Fe+a*ye)),n=r.rezoneDate(n)),n}function F(e,n){return A(t.duration(e.clone().stripZone()-n.clone().stripTime()))}function A(e){if(Fe>e)return 0;if(e>=Ae)return ce.height();var t=(e-Fe)/ge,n=Math.floor(t),r=t-n,a=Je[n];void 0===a&&(a=Je[n]=ce.find("tr").eq(n).find("td div")[0].offsetTop); - var o=a-1+r*me;return o=Math.max(o,0)}function W(e){return e.hasTime()?e.clone().add(ge):e.clone().add(1,"days")}function Y(e,t){e.hasTime()||t.hasTime()?L(e,t):Le("allDaySlot")&&w(e,t,!0)}function L(t,n){var r=Le("selectHelper");if(Ee.build(),r){var a=Ve(t).col;if(a>=0&&Te>a){var o=Ee.rect(0,a,0,a,se),i=F(t,t),s=F(n,t);if(s>i){if(o.top=i,o.height=s-i,o.left+=2,o.width-=5,e.isFunction(r)){var l=r(t,n);l&&(o.position="absolute",de=e(l).css(o).appendTo(se))}else o.isStart=!0,o.isEnd=!0,de=e($e({title:"",start:t,end:n,className:["fc-select-helper"],editable:!1},o)),de.css("opacity",Le("dragOpacity"));de&&(D(de),se.append(de),m(de,o.width,!0),y(de,o.height,!0))}}}else E(t,n)}function Z(){Pe(),de&&(de.remove(),de=null)}function B(t){if(1==t.which&&Le("selectable")){Ie(t);var n;Re.start(function(e,t){if(Z(),e&&e.col==t.col&&!z(e)){var r=H(t),a=H(e);n=[r,r.clone().add(ye),a,a.clone().add(ye)].sort(M),L(n[0],n[3])}else n=null},t),e(document).one("mouseup",function(e){Re.stop(),n&&(+n[0]==+n[1]&&P(n[0],e),je(n[0],n[3],e))})}}function P(e,t){Ze("dayClick",U[Ve(e).col],e,t)}function j(e,t,n){Re.start(function(e){if(Pe(),e){var t=H(e),n=t.clone();t.hasTime()?(n.add(r.defaultTimedEventDuration),E(t,n)):(n.add(r.defaultAllDayEventDuration),w(t,n))}},t)}function I(e,t,n){var r=Re.stop();Pe(),r&&Ze("drop",e,H(r),t,n)}var q=this;q.renderAgenda=o,q.setWidth=v,q.setHeight=f,q.afterRender=p,q.computeDateTop=F,q.getIsCellAllDay=z,q.allDayRow=function(){return ae},q.getCoordinateGrid=function(){return Ee},q.getHoverListener=function(){return Re},q.colLeft=S,q.colRight=k,q.colContentLeft=x,q.colContentRight=R,q.getDaySegmentContainer=function(){return ne},q.getSlotSegmentContainer=function(){return le},q.getSlotContainer=function(){return se},q.getRowCnt=function(){return 1},q.getColCnt=function(){return Te},q.getColWidth=function(){return he},q.getSnapHeight=function(){return we},q.getSnapDuration=function(){return ye},q.getSlotHeight=function(){return me},q.getSlotDuration=function(){return ge},q.getMinTime=function(){return Fe},q.getMaxTime=function(){return Ae},q.defaultSelectionEnd=W,q.renderDayOverlay=w,q.renderSelection=Y,q.clearSelection=Z,q.reportDayClick=P,q.dragStart=j,q.dragStop=I,be.call(q,n,r,a),xe.call(q),Se.call(q),ie.call(q);var $,X,V,G,U,Q,J,K,ee,te,ne,re,ae,oe,se,le,ce,de,ue,fe,ve,he,pe,ge,me,ye,De,we,Te,Ce,Ee,Re,_e,He,Ne,Oe,Fe,Ae,We,Le=q.opt,Ze=q.trigger,Be=q.renderOverlay,Pe=q.clearOverlays,je=q.reportSelection,Ie=q.unselect,qe=q.daySelectionMousedown,$e=q.slotSegHtml,Xe=q.cellToDate,Ve=q.dateToCell,Ge=q.rangeToSegments,Ue=r.formatDate,Qe=r.calculateWeekNumber,Je={};N(n.addClass("fc-agenda")),Ee=new ke(function(t,n){function r(e){return Math.max(l,Math.min(c,e))}var a,o,i;V.each(function(t,r){a=e(r),o=a.offset().left,t&&(i[1]=o),i=[o],n[t]=i}),i[1]=o+a.outerWidth(),Le("allDaySlot")&&(a=ae,o=a.offset().top,t[0]=[o,o+a.outerHeight()]);for(var s=se.offset().top,l=oe.offset().top,c=l+oe.outerHeight(),d=0;Ce*De>d;d++)t.push([r(s+we*d),r(s+we*(d+1))])}),Re=new Me(Ee),_e=new ze(function(e){return Q.eq(e)}),He=new ze(function(e){return J.eq(e)})}function ie(){function n(e,t){var n,r=e.length,o=[],s=[];for(n=0;r>n;n++)e[n].allDay?o.push(e[n]):s.push(e[n]);v("allDaySlot")&&(X(o,t),w()),i(a(s),t)}function r(){T().empty(),E().empty()}function a(e){var t,n,r,a,i,s=H(),l=V(),c=G(),d=[];for(n=0;s>n;n++)for(t=z(0,n),i=o(e,t.clone().time(l),t.clone().time(c)),i=se(i),r=0;rr;r++)a=e[r],o=a.start.clone().stripZone(),i=J(a).stripZone(),i>t&&n>o&&(t>o?(s=t.clone(),c=!1):(s=o,c=!0),i>n?(l=n.clone(),d=!1):(l=i,d=!0),u.push({event:a,start:s,end:l,isStart:c,isEnd:d}));return u.sort(ge)}function i(t,n){var r,a,o,i,c,d,u,f,p,m,y,b,w,T,S,k,z=t.length,_="",H=E(),N=v("isRTL");for(r=0;z>r;r++)a=t[r],o=a.event,i=x(a.start,a.start),c=x(a.end,a.start),d=M(a.col),u=R(a.col),f=u-d,u-=.025*f,f=u-d,p=f*(a.forwardCoord-a.backwardCoord),v("slotEventOverlap")&&(p=Math.max(2*(p-10),p)),N?(y=u-a.backwardCoord*f,m=y-p):(m=d+a.backwardCoord*f,y=m+p),m=Math.max(m,d),y=Math.min(y,u),p=y-m,a.top=i,a.left=m,a.outerWidth=p,a.outerHeight=c-i,_+=s(o,a);for(H[0].innerHTML=_,b=H.children(),r=0;z>r;r++)a=t[r],o=a.event,w=e(b[r]),T=h("eventRender",o,o,w),T===!1?w.remove():(T&&T!==!0&&(w.remove(),w=e(T).css({position:"absolute",top:a.top,left:a.left}).appendTo(H)),a.element=w,o._id===n?l(o,w,a):w[0]._fci=r,Z(o,w));for(g(H,t,l),r=0;z>r;r++)a=t[r],(w=a.element)&&(a.vsides=C(w,!0),a.hsides=D(w,!0),S=w.find(".fc-event-title"),S.length&&(a.contentTop=S[0].offsetTop));for(r=0;z>r;r++)a=t[r],(w=a.element)&&(w[0].style.width=Math.max(0,a.outerWidth-a.hsides)+"px",k=Math.max(0,a.outerHeight-a.vsides),w[0].style.height=k+"px",o=a.event,void 0!==a.contentTop&&k-a.contentTop<10&&(w.find("div.fc-event-time").text(Q(o.start,v("timeFormat"))+" - "+o.title),w.find("div.fc-event-title").remove()),h("eventAfterRender",o,o,w))}function s(e,t){var n="<",r=e.url,a=F(e,v),o=["fc-event","fc-event-vert"];return p(e)&&o.push("fc-event-draggable"),t.isStart&&o.push("fc-event-start"),t.isEnd&&o.push("fc-event-end"),o=o.concat(e.className),e.source&&(o=o.concat(e.source.className||[])),n+=r?"a href='"+_(e.url)+"'":"div",n+=" class='"+o.join(" ")+"' style='position:absolute;top:"+t.top+"px;left:"+t.left+"px;"+a+"'>
"+_(f.getEventTimeText(e))+"
"+_(e.title||"")+"
",t.isEnd&&m(e)&&(n+="
=
"),n+=""}function l(e,t,n){var r=t.find("div.fc-event-time");p(e)&&d(e,t,r),n.isEnd&&m(e)&&u(e,t,r),b(e,t)}function c(e,n,r){function a(){c||(n.width(o).height("").draggable("option","grid",null),c=!0)}var o,i,s,l=r.isStart,c=!0,d=S(),u=N(),f=V(),p=Y(),g=W(),m=A(),D=O();n.draggable({opacity:v("dragOpacity","month"),revertDuration:v("dragRevertDuration"),start:function(t,r){h("eventDragStart",n[0],e,t,r),P(e,n),o=n.width(),d.start(function(t,r){if($(),t){i=!1;var o=z(0,r.col),d=z(0,t.col);s=d.diff(o,"days"),t.row?l?c&&(n.width(u-10),y(n,U.defaultTimedEventDuration/p*g),n.draggable("option","grid",[u,1]),c=!1):i=!0:(q(e.start.clone().add(s,"days"),J(e).add(s,"days")),a()),i=i||c&&!s}else a(),i=!0;n.draggable("option","revert",i)},t,"drag")},stop:function(r,o){if(d.stop(),$(),h("eventDragStop",n[0],e,r,o),i)a(),n.css("filter",""),B(e,n);else{var l,u,v=e.start.clone().add(s,"days");c||(u=Math.round((n.offset().top-L().offset().top)/D),l=t.duration(f+u*m),v=U.rezoneDate(v.clone().time(l))),j(n[0],e,v,r,o)}}})}function d(e,t,n){function r(){$(),s&&(c?(n.hide(),t.draggable("option","grid",null),q(D,b)):(a(),n.css("display",""),t.draggable("option","grid",[C,E])))}function a(){D&&n.text(f.getEventTimeText(D,e.end?b:null))}var o,i,s,l,c,d,u,p,g,m,y,D,b,w=f.getCoordinateGrid(),T=H(),C=N(),E=O(),S=A();t.draggable({scroll:!1,grid:[C,E],axis:1==T?"y":!1,opacity:v("dragOpacity"),revertDuration:v("dragRevertDuration"),start:function(n,r){h("eventDragStart",t[0],e,n,r),P(e,t),w.build(),o=t.position(),i=w.cell(n.pageX,n.pageY),s=l=!0,c=d=k(i),u=p=0,g=0,m=y=0,D=null,b=null},drag:function(n,a){var f=w.cell(n.pageX,n.pageY);if(s=!!f){if(c=k(f),u=Math.round((a.position.left-o.left)/C),u!=p){var v=z(0,i.col),h=i.col+u;h=Math.max(0,h),h=Math.min(T-1,h);var x=z(0,h);g=x.diff(v,"days")}c||(m=Math.round((a.position.top-o.top)/E))}(s!=l||c!=d||u!=p||m!=y)&&(c?(D=e.start.clone().stripTime().add(g,"days"),b=D.clone().add(U.defaultAllDayEventDuration)):(D=e.start.clone().add(m*S).add(g,"days"),b=J(e).add(m*S).add(g,"days")),r(),l=s,d=c,p=u,y=m),t.draggable("option","revert",!s)},stop:function(n,a){$(),h("eventDragStop",t[0],e,n,a),s&&(c||g||m)?j(t[0],e,D,n,a):(s=!0,c=!1,u=0,g=0,m=0,r(),t.css("filter",""),t.css(o),B(e,t))}})}function u(e,t,n){var r,a,o,i=O(),s=A();t.resizable({handles:{s:".ui-resizable-handle"},grid:i,start:function(n,o){r=a=0,P(e,t),h("eventResizeStart",t[0],e,n,o)},resize:function(l,c){if(r=Math.round((Math.max(i,t.height())-c.originalSize.height)/i),r!=a){o=J(e).add(s*r);var d;d=r?f.getEventTimeText(e.start,o):f.getEventTimeText(e),n.text(d),a=r}},stop:function(n,a){h("eventResizeStop",t[0],e,n,a),r?I(t[0],e,o,n,a):B(e,t)}})}var f=this;f.renderEvents=n,f.clearEvents=r,f.slotSegHtml=s,we.call(f);var v=f.opt,h=f.trigger,p=f.isEventDraggable,m=f.isEventResizable,b=f.eventElementHandlers,w=f.setHeight,T=f.getDaySegmentContainer,E=f.getSlotSegmentContainer,S=f.getHoverListener,x=f.computeDateTop,k=f.getIsCellAllDay,M=f.colContentLeft,R=f.colContentRight,z=f.cellToDate,H=f.getColCnt,N=f.getColWidth,O=f.getSnapHeight,A=f.getSnapDuration,W=f.getSlotHeight,Y=f.getSlotDuration,L=f.getSlotContainer,Z=f.reportEventElement,B=f.showEvents,P=f.hideEvents,j=f.eventDrop,I=f.eventResize,q=f.renderDayOverlay,$=f.clearOverlays,X=f.renderDayEvents,V=f.getMinTime,G=f.getMaxTime,U=f.calendar,Q=U.formatDate,J=U.getEventEnd;f.draggableDayEvent=c}function se(e){var t,n=le(e),r=n[0];if(ce(n),r){for(t=0;tt.start&&e.startt?-1:1)}function r(e){a.start=a.intervalStart=e.clone().stripTime(),a.end=a.intervalEnd=a.start.clone().add(1,"days"),a.title=t.formatDate(a.start,a.opt("titleFormat")),a.renderResource(o().length)}var a=this;a.incrementDate=n,a.render=r,ye.call(a,e,t,"resourceDay");var o=a.getResources}function ye(n,r,a){function o(e){Re=e,i(),G?l():s()}function i(){Ae=Pe("theme")?"ui":"fc",We=Pe("isRTL"),Be=Pe("columnFormat"),Le=t.duration(Pe("minTime")),Ze=t.duration(Pe("maxTime")),ye=t.duration(Pe("slotDuration")),Te=Pe("snapDuration"),Te=Te?t.duration(Te):ye}function s(){var r,a,o,i,s=Ae+"-widget-header",c=Ae+"-widget-content",d=ye.asMinutes()%15===0;for(l(),ae=e("
").appendTo(n),Pe("allDaySlot")?(oe=e("
").appendTo(ae),r="
"+(Pe("allDayHTML")||_(Pe("allDayText")))+"
 
",ie=e(r).appendTo(ae),se=ie.find("tr"),g(se.find("td")),ae.append("
")):oe=e([]),le=e("
").appendTo(ae),ce=e("
").appendTo(le),de=e("
").appendTo(ce),r="",a=t.duration(+Le),_e=0;Ze>a;)o=V.start.clone().time(a),i=o.minutes(),r+="",a.add(ye),_e++;r+="
"+(d&&i?" ":_(Je(o,Pe("axisFormat"))))+"
 
",ue=e(r).appendTo(ce),D(ue.find("td"))}function l(){var t=c();G&&G.remove(),G=e(t).appendTo(n),U=G.find("thead"),Q=U.find("th").slice(1,-1),J=G.find("tbody"),K=J.find("td").slice(0,-1),ee=K.find("> div"),te=K.find(".fc-day-content > div"),ne=K.eq(0),re=ee.eq(0),O(U.add(U.find("tr"))),O(J.add(J.find("tr")))}function c(){var e=""+d()+u()+"
";return e}function d(){var e,t,n,r=Ae+"-widget-header",a="";for(a+="",Pe("weekNumbers")?(e=Ge(0,0),t=Ke(e),We?t+=Pe("weekNumberTitle"):t=Pe("weekNumberTitle")+t,a+=""+_(t)+""):a+=" ",n=0;Re>n;n++){var o=nt()[n],i=["fc-col"+n,o.className,r];a+=""+_(o.name)+""}return a+=" "}function u(){var e,t,n,a,o,i=Ae+"-widget-header",s=Ae+"-widget-content",l=r.getNow().stripTime(),c="";for(c+=" ",n="",t=0;(Re||1)>t;t++){var d=nt()[t];e=V.intervalStart.clone(),o=["fc-col"+t,"fc-"+Ye[e.day()],s],d&&d.className&&o.push(d.className),e.isSame(l,"day")?o.push(Ae+"-state-highlight","fc-today"):l>e?o.push("fc-past"):o.push("fc-future"),a="
 
",n+=a}return c+=n,c+=" "}function f(e){void 0===e&&(e=he),he=e,tt={};var t=J.position().top,n=le.position().top,r=Math.min(e-t,ue.height()+n+1);re.height(r-C(ne)),ae.css("top",t),le.height(r-n-1);var a=ue.find("tr:first").height()+1,o=ue.find("tr:eq(1)").height();we=(a+o)/2,Ce=ye/Te,Ee=we/Ce}function v(t){ve=t,Oe.clear(),Fe.clear();var n=U.find("th:first");ie&&(n=n.add(ie.find("th:first"))),n=n.add(ue.find("th:first")),pe=0,m(n.width("").each(function(t,n){pe=Math.max(pe,e(n).outerWidth())}),pe);var r=G.find(".fc-agenda-gutter");ie&&(r=r.add(ie.find("th.fc-agenda-gutter")));var a=le[0].clientWidth;me=le.width()-a,me?(m(r,me),r.show().prev().removeClass("fc-last")):r.hide().prev().addClass("fc-last"),ge=Math.floor((a-pe)/Re),m(Q.slice(0,-1),ge)}function h(){function e(){le.scrollTop(n)}var n=A(t.duration(Pe("scrollTime")))+1;e(),setTimeout(e,0)}function p(){h()}function g(e){e.click(b).mousedown(X)}function D(e){e.click(b).mousedown(B)}function b(e){if(!Pe("selectable")){var t=Math.min(Re-1,Math.floor((e.pageX-G.offset().left-pe)/ge)),n=Ge(0,0),a=this.parentNode.className.match(/fc-slot(\d+)/);if(e.data=nt()[t],a){var o=parseInt(a[1],10);n.add(Le+o*ye),n=r.rezoneDate(n),je("dayClick",K[t],n,e)}else je("dayClick",K[t],n,e)}}function w(e,t,n,r){n&&He.build();for(var a=Qe(e,t),o=0;or?e:r,i=t>a?a:t;if(i>o){var s=He.rect(0,n,0,n,ce),l=F(o,r),c=F(i,r);s.top=l,s.height=c-l,D(Ie(s,ce))}}function S(e){return Oe.left(e)}function x(e){return Fe.left(e)}function k(e){return Oe.right(e)}function R(e){return Fe.right(e)}function z(e){return Pe("allDaySlot")&&!e.row}function H(e){var n=Ge(0,0),a=e.row;return Pe("allDaySlot")&&a--,a>=0&&(n.time(t.duration(Le+a*Te)),n=r.rezoneDate(n)),n}function F(e,n){return A(t.duration(e.clone().stripZone()-n.clone().stripTime()))}function A(e){if(Le>e)return 0;if(e>=Ze)return ue.height();var t=(e-Le)/ye,n=Math.floor(t),r=t-n,a=tt[n];void 0===a&&(a=tt[n]=ue.find("tr").eq(n).find("td div")[0].offsetTop);var o=a-1+r*we;return o=Math.max(o,0)}function W(e){return e.hasTime()?e.clone().add(ye):e.clone().add(1,"days")}function Y(e,t,n){e.hasTime()||t.hasTime()?L(e,t):Pe("allDaySlot")&&w(e,t,!0,n)}function L(t,n,r){var a=Pe("selectHelper");if(He.build(),a){if(r=r||Ue(t).col,r>=0&&Re>r){var o=He.rect(0,r,0,r,ce),i=F(t,t),s=F(n,t);if(s>i){if(o.top=i,o.height=s-i,o.left+=2,o.width-=5,e.isFunction(a)){var l=a(t,n);l&&(o.position="absolute",fe=e(l).css(o).appendTo(ce))}else o.isStart=!0,o.isEnd=!0,fe=e(Ve({title:"",start:t,end:n,className:["fc-select-helper"],editable:!1},o)),fe.css("opacity",Pe("dragOpacity"));fe&&(D(fe),ce.append(fe),m(fe,o.width,!0),y(fe,o.height,!0))}}}else E(t,n,r)}function Z(){qe(),fe&&(fe.remove(),fe=null)}function B(t){if(1==t.which&&Pe("selectable")){Xe(t);var n,r;Ne.start(function(e,t){if(Z(),e&&e.col==t.col&&!z(e)){r=e.col;var a=H(t),o=H(e);n=[a,a.clone().add(Te),o,o.clone().add(Te)].sort(M),L(n[0],n[3],e.col)}else n=null},t),e(document).one("mouseup",function(e){Ne.stop(),n&&(+n[0]==+n[1]&&P(n[0],e),e.data=nt()[r],$e(n[0],n[3],e))})}}function P(e,t){je("dayClick",K[Ue(e).col],e,t)}function j(e,t,n,a,o,i){var s=r.mutateResourceEvent(t,n,a,null);je("eventDrop",e,t,s.dateDelta,function(){s.undo(),et(t._id)},o,i),et(t._id)}function I(e,t,n,a,o){var i=r.mutateResourceEvent(t,t.resources,null,n);je("eventResize",e,t,i.durationDelta,function(){i.undo(),et(t._id)},a,o),et(t._id)}function q(e,t,n){Ne.start(function(e){if(qe(),e){var t=H(e),n=t.clone();t.hasTime()?(n.add(r.defaultTimedEventDuration),E(t,n,e.col)):(n.add(r.defaultAllDayEventDuration),w(t,n,!0,e.col))}},t)}function $(e,t,n){var r=Ne.stop();qe(),r&&(t.data=nt()[r.col],je("drop",e,H(r),t,n))}function X(t){var n,r=V.getIsCellAllDay,a=V.getHoverListener(),o=V.reportDayClick;if(1==t.which&&Pe("selectable")){Xe(t);var i;a.start(function(e,t){Z(),e&&r(e)?(n=e.col,i=[H(t),H(e)].sort(M),Y(i[0],i[1],n)):i=null},t),e(document).one("mouseup",function(e){a.stop(),i&&(+i[0]==+i[1]&&o(i[0],!0,e),e.data=nt()[n],$e(i[0],i[1],e))})}}var V=this;V.renderResource=o,V.setWidth=v,V.setHeight=f,V.afterRender=p,V.computeDateTop=F,V.getIsCellAllDay=z,V.allDayRow=function(){return se},V.getCoordinateGrid=function(){return He},V.getHoverListener=function(){return Ne},V.colLeft=S,V.colRight=k,V.colContentLeft=x,V.colContentRight=R,V.getDaySegmentContainer=function(){return oe},V.getSlotSegmentContainer=function(){return de},V.getSlotContainer=function(){return ce},V.getRowCnt=function(){return 1},V.getColCnt=function(){return 1},V.getColWidth=function(){return ge},V.getSnapHeight=function(){return Ee},V.getSnapDuration=function(){return Te},V.getSlotHeight=function(){return we},V.getSlotDuration=function(){return ye},V.getMinTime=function(){return Le},V.getMaxTime=function(){return Ze},V.defaultSelectionEnd=W,V.renderDayOverlay=w,V.renderSelection=Y,V.clearSelection=Z,V.reportDayClick=P,V.dragStart=q,V.dragStop=$,V.getResources=r.fetchResources,be.call(V,n,r,a),V.eventDrop=j,V.eventResize=I,xe.call(V),Se.call(V),De.call(V);var G,U,Q,J,K,ee,te,ne,re,ae,oe,ie,se,le,ce,de,ue,fe,ve,he,pe,ge,me,ye,we,Te,Ce,Ee,Re,_e,He,Ne,Oe,Fe,Ae,We,Le,Ze,Be,Pe=V.opt,je=V.trigger,Ie=V.renderOverlay,qe=V.clearOverlays,$e=V.reportSelection,Xe=V.unselect,Ve=V.slotSegHtml,Ge=V.cellToDate,Ue=V.dateToCell,Qe=V.rangeToSegments,Je=r.formatDate,Ke=r.calculateWeekNumber,et=r.reportEventChange,tt={},nt=V.getResources;N(n.addClass("fc-agenda")),He=new ke(function(t,n){function r(e){return Math.max(l,Math.min(c,e))}var a,o,i;Q.each(function(t,r){a=e(r),o=a.offset().left,t&&(i[1]=o),i=[o],n[t]=i}),i[1]=o+a.outerWidth(),Pe("allDaySlot")&&(a=se,o=a.offset().top,t[0]=[o,o+a.outerHeight()]);for(var s=ce.offset().top,l=le.offset().top,c=l+le.outerHeight(),d=0;_e*Ce>d;d++)t.push([r(s+Ee*d),r(s+Ee*(d+1))])}),Ne=new Me(He),Oe=new ze(function(e){return ee.eq(e)}),Fe=new ze(function(e){return te.eq(e)})}function De(){function n(e,t){var n,r=e.length,o=[],i=[];for(n=0;r>n;n++)e[n].allDay?o.push(e[n]):i.push(e[n]);h("allDaySlot")&&(V(o,t),T()),s(a(i),t)}function r(){E().empty(),S().empty()}function a(e){var t,n,r,a,s,l=N(),c=G(),d=U(),u=[];for(n=0;l>n;n++){t=H(0,0);var f=i(ee()[n],e);for(s=o(f,t.clone().time(c),t.clone().time(d)),s=se(s),r=0;rr;r++)a=e[r],o=a.start.clone().stripZone(),i=K(a).stripZone(),i>t&&n>o&&(t>o?(s=t.clone(),c=!1):(s=o,c=!0),i>n?(l=n.clone(),d=!1):(l=i,d=!0),u.push({event:a,start:s,end:l,isStart:c,isEnd:d}));return u.sort(ge)}function i(t,n){for(var r=[],a=function(n){return n.resources&&e.grep(n.resources,function(e){return e==t.id}).length},o=0;or;r++)a=t[r],o=a.event,i=k(a.start,a.start),s=k(a.end,a.start),d=R(a.col),u=z(a.col),f=u-d,u-=.025*f,f=u-d,v=f*(a.forwardCoord-a.backwardCoord),h("slotEventOverlap")&&(v=Math.max(2*(v-10),v)),N?(y=u-a.backwardCoord*f,m=y-v):(m=d+a.backwardCoord*f,y=m+v),m=Math.max(m,d),y=Math.min(y,u),v=y-m,a.top=i,a.left=m,a.outerWidth=v,a.outerHeight=s-i,_+=l(o,a);for(H[0].innerHTML=_,b=H.children(),r=0;M>r;r++)a=t[r],o=a.event,w=e(b[r]),T=p("eventRender",o,o,w),T===!1?w.remove():(T&&T!==!0&&(w.remove(),w=e(T).css({position:"absolute",top:a.top,left:a.left}).appendTo(H)),a.element=w,o._id===n?c(o,w,a):w[0]._fci=r,B(o,w));for(g(H,t,c),r=0;M>r;r++)a=t[r],(w=a.element)&&(a.vsides=C(w,!0),a.hsides=D(w,!0),E=w.find(".fc-event-title"),E.length&&(a.contentTop=E[0].offsetTop));for(r=0;M>r;r++)a=t[r],(w=a.element)&&(w[0].style.width=Math.max(0,a.outerWidth-a.hsides)+"px",x=Math.max(0,a.outerHeight-a.vsides),w[0].style.height=x+"px",o=a.event,void 0!==a.contentTop&&x-a.contentTop<10&&(w.find("div.fc-event-time").text(J(o.start,h("timeFormat"))+" - "+o.title),w.find("div.fc-event-title").remove()),p("eventAfterRender",o,o,w))}function l(e,t){var n="<",r=e.url,a=F(e,h),o=["fc-event","fc-event-vert"];return m(e)&&o.push("fc-event-draggable"),t.isStart&&o.push("fc-event-start"),t.isEnd&&o.push("fc-event-end"),o=o.concat(e.className),e.source&&(o=o.concat(e.source.className||[])),n+=r?"a href='"+_(e.url)+"'":"div",n+=" class='"+o.join(" ")+"' style='position:absolute;top:"+t.top+"px;left:"+t.left+"px;"+a+"'>
"+_(v.getEventTimeText(e))+"
"+_(e.title||"")+"
",t.isEnd&&b(e)&&(n+="
=
"),n+=""}function c(e,t,n){var r=t.find("div.fc-event-time");m(e)&&u(e,t,r),n.isEnd&&b(e)&&f(e,t,r),w(e,t)}function d(e,n,r){function a(){d||(n.width(o).height("").draggable("option","grid",null),d=!0)}var o,i,s,l,c=r.isStart,d=!0,u=x(),f=O(),v=G(),g=L(),m=Y(),D=W(),b=A();n.draggable({opacity:h("dragOpacity","month"),revertDuration:h("dragRevertDuration"),start:function(t,r){p("eventDragStart",n[0],e,t,r),j(e,n),o=n.width(),u.start(function(t,r){if(X(),t){i=!1,l=r.col;var o=H(0,r.col),u=H(0,t.col);s=u.diff(o,"days"),t.row?c?d&&(n.width(f-10),y(n,Q.defaultTimedEventDuration/g*m),n.draggable("option","grid",[f,1]),d=!1):i=!0:($(e.start.clone().add(s,"days"),K(e).add(s,"days"),!0,1),a()),i=i||d&&!s}else a(),i=!0;n.draggable("option","revert",i)},t,"drag")},stop:function(r,o){if(u.stop(),X(),p("eventDragStop",n[0],e,r,o),i)a(),n.css("filter",""),P(e,n);else{var s=Math.round((n.offset().left-Z().offset().left)/f),c=e.resources;s!==l&&(c=[ee()[s].id]);var h,g,m=e.start.clone();d||(g=Math.round((n.offset().top-Z().offset().top)/b),h=t.duration(v+g*D),m=Q.rezoneDate(m.clone().time(h))),I(n[0],e,c,m,r,o)}}})}function u(e,t,n){function r(){X(),s&&(c?(n.hide(),t.draggable("option","grid",null),$(b,w,!1,i.col+u)):(a(),n.css("display",""),t.draggable("option","grid",[E,S])))}function a(){b&&n.text(v.getEventTimeText(b,e.end?w:null))}var o,i,s,l,c,d,u,f,g,m,y,D,b,w,T=v.getCoordinateGrid(),C=N(),E=O(),S=A(),x=W();t.draggable({scroll:!1,grid:[E,S],axis:1==C?"y":!1,opacity:h("dragOpacity"),revertDuration:h("dragRevertDuration"),start:function(n,r){p("eventDragStart",t[0],e,n,r),j(e,t),T.build(),o=t.position(),i=T.cell(n.pageX,n.pageY),s=l=!0,c=d=M(i),u=f=0,g=0,m=0,y=D=0,b=null,w=null},drag:function(n,a){var i=T.cell(n.pageX,n.pageY);s=!!i,s&&(c=M(i),u=Math.round((a.position.left-o.left)/E),u!=f&&(m=u),c||(y=Math.round((a.position.top-o.top)/S))),(s!=l||c!=d||u!=f||y!=D)&&(c?(b=e.start.clone().stripTime().add(g,"days"),w=b.clone().add(Q.defaultAllDayEventDuration)):(b=e.start.clone().add(y*x).add(g,"days"),w=K(e).add(y*x).add(g,"days")),r(),l=s,d=c,f=u,D=y),t.draggable("option","revert",!s)},stop:function(n,a){if(X(),p("eventDragStop",t[0],e,n,a),s&&(c||m||y)){var l=e.resources.slice(0);if(m){var d=ee(),f=d[i.col+m].id,v=d[i.col].id,h=e.resources.indexOf(v),D=e.resources.indexOf(f);D>-1?l.splice(h,1):l[h]=f}I(t[0],e,l,b,n,a)}else s=!0,c=!1,u=0,g=0,y=0,r(),t.css("filter",""),t.css(o),P(e,t)}})}function f(e,t,n){var r,a,o,i=A(),s=W();t.resizable({handles:{s:".ui-resizable-handle"},grid:i,start:function(n,o){r=a=0,j(e,t),p("eventResizeStart",t[0],e,n,o)},resize:function(l,c){if(r=Math.round((Math.max(i,t.height())-c.originalSize.height)/i),r!=a){o=K(e).add(s*r);var d;d=r?v.getEventTimeText(e.start,o):v.getEventTimeText(e),n.text(d),a=r}},stop:function(n,a){p("eventResizeStop",t[0],e,n,a),r?q(t[0],e,o,n,a):P(e,t)}})}var v=this;v.renderEvents=n,v.clearEvents=r,v.slotSegHtml=l,we.call(v);var h=v.opt,p=v.trigger,m=v.isEventDraggable,b=v.isEventResizable,w=v.eventElementHandlers,T=v.setHeight,E=v.getDaySegmentContainer,S=v.getSlotSegmentContainer,x=v.getHoverListener,k=v.computeDateTop,M=v.getIsCellAllDay,R=v.colContentLeft,z=v.colContentRight,H=v.cellToDate,N=function(){return ee().length},O=v.getColWidth,A=v.getSnapHeight,W=v.getSnapDuration,Y=v.getSlotHeight,L=v.getSlotDuration,Z=v.getSlotContainer,B=v.reportEventElement,P=v.showEvents,j=v.hideEvents,I=v.eventDrop,q=v.eventResize,$=v.renderDayOverlay,X=v.clearOverlays,V=v.renderDayEvents,G=v.getMinTime,U=v.getMaxTime,Q=v.calendar,J=Q.formatDate,K=Q.getEventEnd,ee=v.getResources;v.draggableDayEvent=d}function be(n,r,a){function o(t,n){var r=A[t];return e.isPlainObject(r)&&!i(t)?z(r,n||a):r}function s(e,t){return r.trigger.apply(r,[e,t||H].concat(Array.prototype.slice.call(arguments,2),[H]))}function l(e){var t=e.source||{};return W(e.startEditable,t.startEditable,o("eventStartEditable"),e.editable,t.editable,o("editable"))}function c(e){var t=e.source||{};return W(e.durationEditable,t.durationEditable,o("eventDurationEditable"),e.editable,t.editable,o("editable"))}function d(){O={},F=[]}function u(e,t){F.push({event:e,element:t}),O[e._id]?O[e._id].push(t):O[e._id]=[t]}function f(){e.each(F,function(e,t){H.trigger("eventDestroy",t.event,t.event,t.element)})}function v(e,t){t.click(function(n){return t.hasClass("ui-draggable-dragging")||t.hasClass("ui-resizable-resizing")?void 0:s("eventClick",this,e,n)}).hover(function(t){s("eventMouseover",this,e,t)},function(t){s("eventMouseout",this,e,t)})}function h(e,t){g(e,t,"show")}function p(e,t){g(e,t,"hide")}function g(e,t,n){var r,a=O[e._id],o=a.length;for(r=0;o>r;r++)t&&a[r][0]==t[0]||a[r][n]()}function m(e,t,n,a,o){var i=r.mutateEvent(t,n,null);s("eventDrop",e,t,i.dateDelta,function(){i.undo(),N(t._id)},a,o),N(t._id)}function y(e,t,n,a,o){var i=r.mutateEvent(t,null,n);s("eventResize",e,t,i.durationDelta,function(){i.undo(),N(t._id)},a,o),N(t._id)}function D(e){return t.isMoment(e)&&(e=e.day()),B[e]}function b(){return L}function w(e,t,n){var r=e.clone();for(t=t||1;B[(r.day()+(n?t:0)+7)%7];)r.add(t,"days");return r}function T(){var e=C.apply(null,arguments),t=E(e),n=S(t);return n}function C(e,t){var n=H.getColCnt(),r=I?-1:1,a=I?n-1:0;"object"==typeof e&&(t=e.col,e=e.row);var o=e*n+(t*r+a);return o}function E(e){var t=H.start.day();return e+=P[t],7*Math.floor(e/L)+j[(e%L+L)%L]-t}function S(e){return H.start.clone().add(e,"days")}function x(e){var t=k(e),n=M(t),r=R(n);return r}function k(e){return e.clone().stripTime().diff(H.start,"days")}function M(e){var t=H.start.day();return e+=t,Math.floor(e/7)*L+P[(e%7+7)%7]-P[t]}function R(e){var t=H.getColCnt(),n=I?-1:1,r=I?t-1:0,a=Math.floor(e/t),o=(e%t+t)%t*n+r;return{row:a,col:o}}function _(e,t){var n=H.getRowCnt(),r=H.getColCnt(),a=[],o=k(e),i=k(t),s=+t.time();s&&s>=Y&&i++,i=Math.max(i,o+1);for(var l=M(o),c=M(i)-1,d=0;n>d;d++){var u=d*r,f=u+r-1,v=Math.max(l,u),h=Math.min(c,f);if(h>=v){var p=R(v),g=R(h),m=[p.col,g.col].sort(),y=E(v)==o,D=E(h)+1==i;a.push({row:d,leftCol:m[0],rightCol:m[1],isStart:y,isEnd:D})}}return a}var H=this;H.element=n,H.calendar=r,H.name=a,H.opt=o,H.trigger=s,H.isEventDraggable=l,H.isEventResizable=c,H.clearEventData=d,H.reportEventElement=u,H.triggerEventDestroy=f,H.eventElementHandlers=v,H.showEvents=h,H.hideEvents=p,H.eventDrop=m,H.eventResize=y;var N=r.reportEventChange,O={},F=[],A=r.options,Y=t.duration(A.nextDayThreshold);H.getEventTimeText=function(e){var t,n;return 2===arguments.length?(t=arguments[0],n=arguments[1]):(t=e.start,n=e.end),n&&o("displayEventEnd")?r.formatRange(t,n,o("timeFormat")):r.formatDate(t,o("timeFormat"))},H.isHiddenDay=D,H.skipHiddenDays=w,H.getCellsPerWeek=b,H.dateToCell=x,H.dateToDayOffset=k,H.dayOffsetToCellOffset=M,H.cellOffsetToCell=R,H.cellToDate=T,H.cellToCellOffset=C,H.cellOffsetToDayOffset=E,H.dayOffsetToDate=S,H.rangeToSegments=_;var L,Z=o("hiddenDays")||[],B=[],P=[],j=[],I=o("isRTL");!function(){o("weekends")===!1&&Z.push(0,6);for(var t=0,n=0;7>t;t++)P[t]=n,B[t]=-1!=e.inArray(t,Z),B[t]||(j[n]=t,n++);if(L=n,!L)throw"invalid hiddenDays"}()}function we(){function t(e,t){var n=r(e,!1,!0);Ce(n,function(e,t){M(e.event,t)}),y(n,t),Ce(n,function(e,t){S("eventAfterRender",e.event,e.event,t)})}function n(e,t,n){var a=r([e],!0,!1),o=[];return Ce(a,function(e,r){e.row===t&&r.css("top",n),o.push(r[0])}),o}function r(t,n,r){var o,i,c=q(),f=n?e("
"):c,v=a(t);return s(v),o=l(v),f[0].innerHTML=o,i=f.children(),n&&c.append(i),d(v,i),Ce(v,function(e,t){e.hsides=D(t,!0)}),Ce(v,function(e,t){t.width(Math.max(0,e.outerWidth-e.hsides))}),Ce(v,function(e,t){e.outerHeight=t.outerHeight(!0)}),u(v,r),v}function a(e){var t,n,r=C.getResources,a=[];if("undefined"==typeof r)for(t=0;t
",!r.allDay&&e.isStart&&(t+=""+_(C.getEventTimeText(r))+""),t+=""+_(r.title||"")+"
",r.allDay&&e.isEnd&&k(r)&&(t+="
   
"),t+=""}function d(t,n){for(var r=0;r").prependTo(n),se=new l(ne,ae),le=se.render(),le&&n.prepend(le),g(ae.defaultView),ae.handleWindowResize&&e(window).resize(E),p()||d()}function d(){setTimeout(function(){!ue.start&&p()&&y()},0)}function v(){ue&&(K("viewDestroy",ue,ue,ue.element),ue.triggerEventDestroy()),e(window).unbind("resize",E),ae.droppable&&e(document).off("dragstart",ee).off("dragstop",te),ue.selectionManagerDestroy&&ue.selectionManagerDestroy(),se.destroy(),ce.remove(),n.removeClass("fc fc-ltr fc-rtl ui-widget")}function h(){return n.is(":visible")}function p(){return e("body").is(":visible")}function g(e){ue&&e==ue.name||m(e)}function m(t){be++,ue&&(K("viewDestroy",ue,ue,ue.element),W(),ue.triggerEventDestroy(),V(),ue.element.remove(),se.deactivateButton(ue.name)),se.activateButton(t),ue=new Fe[t](e("
").appendTo(ce),ne),y(),G(),be--}function y(e){ue.start&&!e&&he.isWithin(ue.intervalStart,ue.intervalEnd)||h()&&D(e)}function D(e){be++,ue.start&&(K("viewDestroy",ue,ue,ue.element),W(),R()),V(),e&&(he=ue.incrementDate(he,e)),ue.render(he.clone()),T(),G(),(ue.afterRender||k)(),O(),F(),K("viewRender",ue,ue,ue.element),be--,z()}function b(){h()&&(W(),R(),w(),T(),M())}function w(){ve=ae.contentHeight?ae.contentHeight:ae.height?ae.height-(le?le.height():0)-C(ce):Math.round(ce.width()/Math.max(ae.aspectRatio,.5))}function T(){void 0===ve&&w(),be++,ue.setHeight(ve),ue.setWidth(ce.width()),be--,fe=n.outerWidth()}function E(e){if(!be&&e.target===window)if(ue.start){var t=++De;setTimeout(function(){t==De&&!be&&h()&&fe!=(fe=n.outerWidth())&&(be++,b(),ue.trigger("windowResize",ye),be--)},ae.windowResizeDelay)}else d()}function S(){R(),_()}function x(e){R(),M(e)}function M(e){h()&&(ue.renderEvents(we,e),ue.trigger("eventAfterAllRender"))}function R(){ue.triggerEventDestroy(),ue.clearEvents(),ue.clearEventData()}function z(){!ae.lazyFetching||ge(ue.start,ue.end)?_():M()}function _(){me(ue.start,ue.end)}function H(e){we=e,M()}function N(e){x(e)}function O(){se.updateTitle(ue.title)}function F(){var e=ne.getNow();e.isWithin(ue.intervalStart,ue.intervalEnd)?se.disableButton("today"):se.enableButton("today")}function A(e,t){ue.select(e,t)}function W(){ue&&ue.unselect()}function Y(){y(-1)}function L(){y(1)}function Z(){he.add("years",-1),y()}function B(){he.add("years",1),y()}function j(){he=ne.getNow(),y()}function I(e){he=ne.moment(e),y()}function $(e){he.add(t.duration(e)),y()}function X(){return he.clone()}function V(){ce.css({width:"100%",height:ce.height(),overflow:"hidden"})}function G(){ce.css({width:"",height:"",overflow:""})}function U(){return ne}function Q(){return ue}function J(e,t){return void 0===t?ae[e]:void(("height"==e||"contentHeight"==e||"aspectRatio"==e)&&(ae[e]=t,b()))}function K(e,t){return ae[e]?ae[e].apply(t||ye,Array.prototype.slice.call(arguments,2)):void 0}function ee(t,n){var r=t.target,a=e(r);if(!a.parents(".fc").length){var o=ae.dropAccept;(e.isFunction(o)?o.call(r,a):a.is(o))&&(pe=r,ue.dragStart(pe,t,n))}}function te(e,t){pe&&(ue.dragStop(pe,e,t),pe=null)}var ne=this;r=r||{};var re,ae=o({},_e,r);re=ae.lang in He?He[ae.lang]:He[_e.lang],re&&(ae=o({},_e,re,r)),ae.isRTL&&(ae=o({},_e,Ne,re||{},r)),ne.options=ae,ne.render=i,ne.destroy=v,ne.refetchEvents=S,ne.reportEvents=H,ne.reportEventChange=N,ne.rerenderEvents=x,ne.changeView=g,ne.select=A,ne.unselect=W,ne.prev=Y,ne.next=L,ne.prevYear=Z,ne.nextYear=B,ne.today=j,ne.gotoDate=I,ne.incrementDate=$,ne.getDate=X,ne.getCalendar=U,ne.getView=Q,ne.option=J,ne.trigger=K;var oe=f(a(ae.lang));if(ae.monthNames&&(oe._months=ae.monthNames),ae.monthNamesShort&&(oe._monthsShort=ae.monthNamesShort),ae.dayNames&&(oe._weekdays=ae.dayNames),ae.dayNamesShort&&(oe._weekdaysShort=ae.dayNamesShort),null!=ae.firstDay){var ie=f(oe._week);ie.dow=ae.firstDay,oe._week=ie}ne.defaultAllDayEventDuration=t.duration(ae.defaultAllDayEventDuration),ne.defaultTimedEventDuration=t.duration(ae.defaultTimedEventDuration),ne.moment=function(){var e;return"local"===ae.timezone?(e=Oe.moment.apply(null,arguments),e.hasTime()&&e.local()):e="UTC"===ae.timezone?Oe.moment.utc.apply(null,arguments):Oe.moment.parseZone.apply(null,arguments),"_locale"in e?e._locale=oe:e._lang=oe,e},ne.getIsAmbigTimezone=function(){return"local"!==ae.timezone&&"UTC"!==ae.timezone},ne.rezoneDate=function(e){return ne.moment(e.toArray())},ne.getNow=function(){var e=ae.now;return"function"==typeof e&&(e=e()),ne.moment(e)},ne.calculateWeekNumber=function(e){var t=ae.weekNumberCalculation;return"function"==typeof t?t(e):"local"===t?e.week():"ISO"===t.toUpperCase()?e.isoWeek():void 0},ne.getEventEnd=function(e){return e.end?e.end.clone():ne.getDefaultEventEnd(e.allDay,e.start)},ne.getDefaultEventEnd=function(e,t){var n=t.clone();return e?n.stripTime().add(ne.defaultAllDayEventDuration):n.add(ne.defaultTimedEventDuration),ne.getIsAmbigTimezone()&&n.stripZone(),n},ne.formatRange=function(e,t,n){return"function"==typeof n&&(n=n.call(ne,ae,oe)),q(e,t,n,null,ae.isRTL)},ne.formatDate=function(e,t){return"function"==typeof t&&(t=t.call(ne,ae,oe)),P(e,t)},c.call(ne,ae),u.call(ne,ae);var se,le,ce,de,ue,fe,ve,he,pe,ge=ne.isFetchNeeded,me=ne.fetchEvents,ye=n[0],De=0,be=0,we=[];he=null!=ae.defaultDate?ne.moment(ae.defaultDate):ne.getNow(),ae.droppable&&e(document).on("dragstart",ee).on("dragstop",te)}function l(t,n){function r(){f=n.theme?"ui":"fc";var t=n.header;return t?v=e("").append(e("").append(o("left")).append(o("center")).append(o("right"))):void 0}function a(){v.remove()}function o(r){var a=e("",oe&&(r+=""),e=0;U>e;e++)t=ue(0,e),r+="";return r+=""}function d(){var e,t,n,r=re+"-widget-content",a="";for(a+="",e=0;G>e;e++){for(a+="",oe&&(n=ue(e,0),a+=""),t=0;U>t;t++)n=ue(e,t),a+=u(n);a+=""}return a+=""}function u(e){var t=H.intervalStart.month(),r=n.getNow().stripTime(),a="",o=re+"-widget-content",i=["fc-day","fc-"+Ye[e.day()],o];return e.month()!=t&&i.push("fc-other-month"),e.isSame(r,"day")?i.push("fc-today",re+"-state-highlight"):r>e?i.push("fc-past"):i.push("fc-future"),a+=""}function f(t){$=t;var n,r,a,o=Math.max($-A.height(),0);"variable"==ie("weekMode")?n=r=Math.floor(o/(1==G?2:6)):(n=Math.floor(o/G),r=o-n*(G-1)),B.each(function(t,o){G>t&&(a=e(o),a.find("> div").css("min-height",(t==G-1?r:n)-C(a)))})}function v(e){q=e,te.clear(),ne.clear(),V=0,oe&&(V=A.find("th.fc-week-number").outerWidth()),X=Math.floor((q-V)/U),m(W.slice(0,-1),X)}function h(e){e.click(p).mousedown(de)}function p(t){if(!ie("selectable")){var r=n.moment(e(this).data("date"));se("dayClick",this,r,t)}}function g(e,t,n){n&&J.build();for(var r=ve(e,t),a=0;an&&(r=e(i),a=r.offset().top,n&&(o[1]=a),o=[a],t[n]=o)}),o[1]=a+r.outerHeight()}),K=new Me(J),te=new ze(function(e){return P.eq(e)}),ne=new ze(function(e){return j.eq(e)})}function ee(){function e(e,t){n.renderDayEvents(e,t)}function t(){n.getDaySegmentContainer().empty()}var n=this;n.renderEvents=e,n.clearEvents=t,we.call(n)}function te(e,t){function n(e,t){return e.clone().stripTime().add("weeks",t).startOf("week")}function r(e){a.intervalStart=e.clone().stripTime().startOf("week"),a.intervalEnd=a.intervalStart.clone().add("weeks",1),a.start=a.skipHiddenDays(a.intervalStart),a.end=a.skipHiddenDays(a.intervalEnd,-1,!0),a.title=t.formatRange(a.start,a.end.clone().subtract(1),a.opt("titleFormat")," — "),a.renderAgenda(a.getCellsPerWeek())}var a=this;a.incrementDate=n,a.render=r,oe.call(a,e,t,"agendaWeek")}function ne(e,t){function n(e,t){var n=e.clone().stripTime().add(t,"days");return n=a.skipHiddenDays(n,0>t?-1:1)}function r(e){a.start=a.intervalStart=e.clone().stripTime(),a.end=a.intervalEnd=a.start.clone().add(1,"days"),a.title=t.formatDate(a.start,a.opt("titleFormat")),a.renderAgenda(1)}var a=this;a.incrementDate=n,a.render=r,oe.call(a,e,t,"agendaDay")}function re(e,t){return t.longDateFormat("LT").replace(":mm","(:mm)").replace(/(\Wmm)$/,"($1)").replace(/\s*a$/i,"a")}function ae(e,t){return t.longDateFormat("LT").replace(/\s*a$/i,"")}function oe(n,r,a){function o(e){Te=e,i(),$?l():s()}function i(){Ne=Le("theme")?"ui":"fc",Oe=Le("isRTL"),We=Le("columnFormat"),Fe=t.duration(Le("minTime")),Ae=t.duration(Le("maxTime")),ge=t.duration(Le("slotDuration")),ye=Le("snapDuration"),ye=ye?t.duration(ye):ge}function s(){var r,a,o,i,s=Ne+"-widget-header",c=Ne+"-widget-content",d=ge.asMinutes()%15===0;for(l(),te=e("
").appendTo(n),Le("allDaySlot")?(ne=e("
").appendTo(te),r="
"),o=n.header[r];return o&&e.each(o.split(" "),function(r){r>0&&a.append("");var o;e.each(this.split(","),function(r,i){if("title"==i)a.append("

 

"),o&&o.addClass(f+"-corner-right"),o=null;else{var s;if(t[i]?s=t[i]:Fe[i]&&(s=function(){h.removeClass(f+"-state-hover"),t.changeView(i)}),s){var l,c=z(n.themeButtonIcons,i),d=z(n.buttonIcons,i),u=z(n.defaultButtonText,i),v=z(n.buttonText,i);l=v?_(v):c&&n.theme?"":d&&!n.theme?"":_(u||i);var h=e(""+l+"").click(function(){h.hasClass(f+"-state-disabled")||s()}).mousedown(function(){h.not("."+f+"-state-active").not("."+f+"-state-disabled").addClass(f+"-state-down")}).mouseup(function(){h.removeClass(f+"-state-down")}).hover(function(){h.not("."+f+"-state-active").not("."+f+"-state-disabled").addClass(f+"-state-hover")},function(){h.removeClass(f+"-state-hover").removeClass(f+"-state-down")}).appendTo(a);N(h),o||h.addClass(f+"-corner-left"),o=h}}}),o&&o.addClass(f+"-corner-right")}),a}function i(e){v.find("h2").html(e)}function s(e){v.find("span.fc-button-"+e).addClass(f+"-state-active")}function l(e){v.find("span.fc-button-"+e).removeClass(f+"-state-active")}function c(e){v.find("span.fc-button-"+e).addClass(f+"-state-disabled")}function d(e){v.find("span.fc-button-"+e).removeClass(f+"-state-disabled")}var u=this;u.render=r,u.destroy=a,u.updateTitle=i,u.activateButton=s,u.deactivateButton=l,u.disableButton=c,u.enableButton=d;var f,v=e([])}function c(t){function n(e,t){return!E||e.clone().stripZone()S.clone().stripZone()}function r(e,t){E=e,S=t,F=[];var n=++H,r=_.length;N=r;for(var o=0;r>o;o++)a(_[o],n)}function a(t,n){o(t,function(r){var a,o,i=e.isArray(t.events);if(n==H){if(r)for(a=0;ai;i++){var s=a(u[i],r);c=c.concat(s)}}return e.isFunction(t.resourceFilter)?e.grep(c,t.resourceFilter):c}function a(n,r){var a=n.resources;if(a){if(e.isFunction(a))return a()}else{var o=n.url;if(o){var i={};if("object"==typeof r){var s=t.startParam,l=t.endParam;s&&(i[s]=Math.round(+r.intervalStart/1e3)),l&&(i[l]=Math.round(+r.intervalEnd/1e3))}e.ajax(e.extend({},Ae,n,{data:i,dataType:"json",cache:!1,success:function(e){e=e||[],a=e},error:function(){},async:!1}))}}return a}function o(e){e.className?"string"==typeof e.className&&(e.className=e.className.split(/\s+/)):e.className=[];for(var t=Oe.sourceNormalizers,n=0;n=0;a--)if(n=e[r[a].toLowerCase()],void 0!==n)return n;return e["default"]}function _(e){return(e+"").replace(/&/g,"&").replace(//g,">").replace(/'/g,"'").replace(/"/g,""").replace(/\n/g,"
")}function H(e){return e.replace(/&.*?;/g,"")}function N(e){e.attr("unselectable","on").css("MozUserSelect","none").bind("selectstart.ui",function(){return!1})}function O(e){e.children().removeClass("fc-first fc-last").filter(":first-child").addClass("fc-first").end().filter(":last-child").addClass("fc-last")}function F(e,t){var n=e.source||{},r=e.color,a=n.color,o=t("eventColor"),i=e.backgroundColor||r||n.backgroundColor||a||t("eventBackgroundColor")||o,s=e.borderColor||r||n.borderColor||a||t("eventBorderColor")||o,l=e.textColor||n.textColor||t("eventTextColor"),c=[];return i&&c.push("background-color:"+i),s&&c.push("border-color:"+s),l&&c.push("color:"+l),c.join(";")}function A(t,n,r){if(e.isFunction(t)&&(t=[t]),t){var a,o;for(a=0;ai&&(o=X(e,t,n[s]),o!==!1);s--)d=o+d;for(l=i;s>=l;l++)u+=I(e,n[l]),f+=I(t,n[l]);return(u||f)&&(v=a?f+r+u:u+r+f),c+v+d}function X(e,t,n){var r,a;return"string"==typeof n?n:(r=n.token)&&(a=Pe[r.charAt(0)],a&&e.isSame(t,a))?B(e,r):!1}function V(e){return e in je?je[e]:je[e]=G(e)}function G(e){for(var t,n=[],r=/\[([^\]]*)\]|\(([^\)]*)\)|(LT|(\w)\4*o?)|([^\w\[\(]+)/g;t=r.exec(e);)t[1]?n.push(t[1]):t[2]?n.push({maybe:G(t[2])}):t[3]?n.push({token:t[3]}):t[5]&&n.push(t[5]);return n}function U(e,t){function n(e,t){return e.clone().stripTime().add("months",t).startOf("month")}function r(e){a.intervalStart=e.clone().stripTime().startOf("month"),a.intervalEnd=a.intervalStart.clone().add("months",1),a.start=a.intervalStart.clone(),a.start=a.skipHiddenDays(a.start),a.start.startOf("week"),a.start=a.skipHiddenDays(a.start),a.end=a.intervalEnd.clone(),a.end=a.skipHiddenDays(a.end,-1,!0),a.end.add((7-a.end.weekday())%7,"days"),a.end=a.skipHiddenDays(a.end,-1,!0);var n=Math.ceil(a.end.diff(a.start,"weeks",!0));"fixed"==a.opt("weekMode")&&(a.end.add("weeks",6-n),n=6),a.title=t.formatDate(a.intervalStart,a.opt("titleFormat")),a.renderBasic(n,a.getCellsPerWeek(),!0)}var a=this;a.incrementDate=n,a.render=r,K.call(a,e,t,"month")}function Q(e,t){function n(e,t){return e.clone().stripTime().add("weeks",t).startOf("week")}function r(e){a.intervalStart=e.clone().stripTime().startOf("week"),a.intervalEnd=a.intervalStart.clone().add("weeks",1),a.start=a.skipHiddenDays(a.intervalStart),a.end=a.skipHiddenDays(a.intervalEnd,-1,!0),a.title=t.formatRange(a.start,a.end.clone().subtract(1),a.opt("titleFormat")," — "),a.renderBasic(1,a.getCellsPerWeek(),!1)}var a=this;a.incrementDate=n,a.render=r,K.call(a,e,t,"basicWeek")}function J(e,t){function n(e,t){var n=e.clone().stripTime().add(t,"days");return n=a.skipHiddenDays(n,0>t?-1:1)}function r(e){a.start=a.intervalStart=e.clone().stripTime(),a.end=a.intervalEnd=a.start.clone().add(1,"days"),a.title=t.formatDate(a.start,a.opt("titleFormat")),a.renderBasic(1,1,!1)}var a=this;a.incrementDate=n,a.render=r,K.call(a,e,t,"basicDay")}function K(t,n,r){function a(e,t,n){G=e,U=t,Q=n,o(),Y||i(),s()}function o(){re=ie("theme")?"ui":"fc",ae=ie("columnFormat"),oe=ie("weekNumbers")}function i(){I=e("
").appendTo(t)}function s(){var n=l();F&&F.remove(),F=e(n).appendTo(t),A=F.find("thead"),W=A.find(".fc-day-header"),Y=F.find("tbody"),L=Y.find("tr"),Z=Y.find(".fc-day"),B=L.find("td:first-child"),P=L.eq(0).find(".fc-day > div"),j=L.eq(0).find(".fc-day-content > div"),O(A.add(A.find("tr"))),O(L),L.eq(0).addClass("fc-first"),L.filter(":last").addClass("fc-last"),Z.each(function(t,n){var r=ue(Math.floor(t/U),t%U);se("dayRender",H,r,e(n))}),h(Z)}function l(){var e=""+c()+d()+"
";return e}function c(){var e,t,n=re+"-widget-header",r="";for(r+="
"+_(ie("weekNumberTitle"))+""+_(he(t,ae))+"
"+_(pe(n))+"
",Q&&(a+="
"+e.date()+"
"),a+="
 
"+(Le("allDayHTML")||_(Le("allDayText")))+"
 
",re=e(r).appendTo(te),ae=re.find("tr"),g(ae.find("td")),te.append("
")):ne=e([]),oe=e("
").appendTo(te),se=e("
").appendTo(oe),le=e("
").appendTo(se),r="",a=t.duration(+Fe),Ce=0;Ae>a;)o=q.start.clone().time(a),i=o.minutes(),r+="",a.add(ge),Ce++;r+="
"+(d&&i?" ":_(Ue(o,Le("axisFormat"))))+"
 
",ce=e(r).appendTo(se),D(ce.find("td"))}function l(){var t=c();$&&$.remove(),$=e(t).appendTo(n),X=$.find("thead"),V=X.find("th").slice(1,-1),G=$.find("tbody"),U=G.find("td").slice(0,-1),Q=U.find("> div"),J=U.find(".fc-day-content > div"),K=U.eq(0),ee=Q.eq(0),O(X.add(X.find("tr"))),O(G.add(G.find("tr")))}function c(){var e=""+d()+u()+"
";return e}function d(){var e,t,n,r=Ne+"-widget-header",a="";for(a+="",Le("weekNumbers")?(e=Xe(0,0),t=Qe(e),Oe?t+=Le("weekNumberTitle"):t=Le("weekNumberTitle")+t,a+=""+_(t)+""):a+=" ",n=0;Te>n;n++)e=Xe(0,n),a+=""+_(Ue(e,We))+"";return a+=" "}function u(){var e,t,n,a,o,i=Ne+"-widget-header",s=Ne+"-widget-content",l=r.getNow().stripTime(),c="";for(c+=" ",n="",t=0;Te>t;t++)e=Xe(0,t),o=["fc-col"+t,"fc-"+Ye[e.day()],s],e.isSame(l,"day")?o.push(Ne+"-state-highlight","fc-today"):l>e?o.push("fc-past"):o.push("fc-future"),a="
 
",n+=a;return c+=n,c+=" "}function f(e){void 0===e&&(e=fe),fe=e,Je={};var t=G.position().top,n=oe.position().top,r=Math.min(e-t,ce.height()+n+1);ee.height(r-C(K)),te.css("top",t),oe.height(r-n-1);var a=ce.find("tr:first").height()+1,o=ce.find("tr:eq(1)").height();me=(a+o)/2-.5,De=ge/ye,we=me/De}function v(t){ue=t,_e.clear(),He.clear();var n=X.find("th:first");re&&(n=n.add(re.find("th:first"))),n=n.add(ce.find("th:first")),ve=0,m(n.width("").each(function(t,n){ve=Math.max(ve,e(n).outerWidth())}),ve);var r=$.find(".fc-agenda-gutter");re&&(r=r.add(re.find("th.fc-agenda-gutter")));var a=oe[0].clientWidth;pe=oe.width()-a,pe?(m(r,pe),r.show().prev().removeClass("fc-last")):r.hide().prev().addClass("fc-last"),he=Math.floor((a-ve)/Te),m(V.slice(0,-1),he)}function h(){function e(){oe.scrollTop(n)}var n=A(t.duration(Le("scrollTime")))+1;e(),setTimeout(e,0)}function p(){h()}function g(e){e.click(b).mousedown(qe)}function D(e){e.click(b).mousedown(B)}function b(e){if(!Le("selectable")){var t=Math.min(Te-1,Math.floor((e.pageX-$.offset().left-ve)/he)),n=Xe(0,t),a=this.parentNode.className.match(/fc-slot(\d+)/);if(a){var o=parseInt(a[1],10);n.add(Fe+o*ge),n=r.rezoneDate(n),Ze("dayClick",U[t],n,e)}else Ze("dayClick",U[t],n,e)}}function w(e,t,n){n&&Ee.build();for(var r=Ge(e,t),a=0;an;n++){var r=Xe(0,n),a=r.clone().add(1,"days"),o=e>r?e:r,i=t>a?a:t;if(i>o){var s=Ee.rect(0,n,0,n,se),l=F(o,r),c=F(i,r);s.top=l,s.height=c-l,D(Be(s,se))}}}function S(e){return _e.left(e)}function x(e){return He.left(e)}function k(e){return _e.right(e)}function R(e){return He.right(e)}function z(e){return Le("allDaySlot")&&!e.row}function H(e){var n=Xe(0,e.col),a=e.row;return Le("allDaySlot")&&a--,a>=0&&(n.time(t.duration(Fe+a*ye)),n=r.rezoneDate(n)),n}function F(e,n){return A(t.duration(e.clone().stripZone()-n.clone().stripTime()))}function A(e){if(Fe>e)return 0;if(e>=Ae)return ce.height();var t=(e-Fe)/ge,n=Math.floor(t),r=t-n,a=Je[n];void 0===a&&(a=Je[n]=ce.find("tr").eq(n).find("td div")[0].offsetTop); + var o=a-1+r*me;return o=Math.max(o,0)}function W(e){return e.hasTime()?e.clone().add(ge):e.clone().add(1,"days")}function Y(e,t){e.hasTime()||t.hasTime()?L(e,t):Le("allDaySlot")&&w(e,t,!0)}function L(t,n){var r=Le("selectHelper");if(Ee.build(),r){var a=Ve(t).col;if(a>=0&&Te>a){var o=Ee.rect(0,a,0,a,se),i=F(t,t),s=F(n,t);if(s>i){if(o.top=i,o.height=s-i,o.left+=2,o.width-=5,e.isFunction(r)){var l=r(t,n);l&&(o.position="absolute",de=e(l).css(o).appendTo(se))}else o.isStart=!0,o.isEnd=!0,de=e($e({title:"",start:t,end:n,className:["fc-select-helper"],editable:!1},o)),de.css("opacity",Le("dragOpacity"));de&&(D(de),se.append(de),m(de,o.width,!0),y(de,o.height,!0))}}}else E(t,n)}function Z(){Pe(),de&&(de.remove(),de=null)}function B(t){if(1==t.which&&Le("selectable")){Ie(t);var n;Re.start(function(e,t){if(Z(),e&&e.col==t.col&&!z(e)){var r=H(t),a=H(e);n=[r,r.clone().add(ye),a,a.clone().add(ye)].sort(M),L(n[0],n[3])}else n=null},t),e(document).one("mouseup",function(e){Re.stop(),n&&(+n[0]==+n[1]&&P(n[0],e),je(n[0],n[3],e))})}}function P(e,t){Ze("dayClick",U[Ve(e).col],e,t)}function j(e,t,n){Re.start(function(e){if(Pe(),e){var t=H(e),n=t.clone();t.hasTime()?(n.add(r.defaultTimedEventDuration),E(t,n)):(n.add(r.defaultAllDayEventDuration),w(t,n))}},t)}function I(e,t,n){var r=Re.stop();Pe(),r&&Ze("drop",e,H(r),t,n)}var q=this;q.renderAgenda=o,q.setWidth=v,q.setHeight=f,q.afterRender=p,q.computeDateTop=F,q.getIsCellAllDay=z,q.allDayRow=function(){return ae},q.getCoordinateGrid=function(){return Ee},q.getHoverListener=function(){return Re},q.colLeft=S,q.colRight=k,q.colContentLeft=x,q.colContentRight=R,q.getDaySegmentContainer=function(){return ne},q.getSlotSegmentContainer=function(){return le},q.getSlotContainer=function(){return se},q.getRowCnt=function(){return 1},q.getColCnt=function(){return Te},q.getColWidth=function(){return he},q.getSnapHeight=function(){return we},q.getSnapDuration=function(){return ye},q.getSlotHeight=function(){return me},q.getSlotDuration=function(){return ge},q.getMinTime=function(){return Fe},q.getMaxTime=function(){return Ae},q.defaultSelectionEnd=W,q.renderDayOverlay=w,q.renderSelection=Y,q.clearSelection=Z,q.reportDayClick=P,q.dragStart=j,q.dragStop=I,be.call(q,n,r,a),xe.call(q),Se.call(q),ie.call(q);var $,X,V,G,U,Q,J,K,ee,te,ne,re,ae,oe,se,le,ce,de,ue,fe,ve,he,pe,ge,me,ye,De,we,Te,Ce,Ee,Re,_e,He,Ne,Oe,Fe,Ae,We,Le=q.opt,Ze=q.trigger,Be=q.renderOverlay,Pe=q.clearOverlays,je=q.reportSelection,Ie=q.unselect,qe=q.daySelectionMousedown,$e=q.slotSegHtml,Xe=q.cellToDate,Ve=q.dateToCell,Ge=q.rangeToSegments,Ue=r.formatDate,Qe=r.calculateWeekNumber,Je={};N(n.addClass("fc-agenda")),Ee=new ke(function(t,n){function r(e){return Math.max(l,Math.min(c,e))}var a,o,i;V.each(function(t,r){a=e(r),o=a.offset().left,t&&(i[1]=o),i=[o],n[t]=i}),i[1]=o+a.outerWidth(),Le("allDaySlot")&&(a=ae,o=a.offset().top,t[0]=[o,o+a.outerHeight()]);for(var s=se.offset().top,l=oe.offset().top,c=l+oe.outerHeight(),d=0;Ce*De>d;d++)t.push([r(s+we*d),r(s+we*(d+1))])}),Re=new Me(Ee),_e=new ze(function(e){return Q.eq(e)}),He=new ze(function(e){return J.eq(e)})}function ie(){function n(e,t){var n,r=e.length,o=[],s=[];for(n=0;r>n;n++)e[n].allDay?o.push(e[n]):s.push(e[n]);v("allDaySlot")&&(X(o,t),w()),i(a(s),t)}function r(){T().empty(),E().empty()}function a(e){var t,n,r,a,i,s=H(),l=V(),c=G(),d=[];for(n=0;s>n;n++)for(t=z(0,n),i=o(e,t.clone().time(l),t.clone().time(c)),i=se(i),r=0;rr;r++)a=e[r],o=a.start.clone().stripZone(),i=J(a).stripZone(),i>t&&n>o&&(t>o?(s=t.clone(),c=!1):(s=o,c=!0),i>n?(l=n.clone(),d=!1):(l=i,d=!0),u.push({event:a,start:s,end:l,isStart:c,isEnd:d}));return u.sort(ge)}function i(t,n){var r,a,o,i,c,d,u,f,p,m,y,b,w,T,S,k,z=t.length,_="",H=E(),N=v("isRTL");for(r=0;z>r;r++)a=t[r],o=a.event,i=x(a.start,a.start),c=x(a.end,a.start),d=M(a.col),u=R(a.col),f=u-d,u-=.025*f,f=u-d,p=f*(a.forwardCoord-a.backwardCoord),v("slotEventOverlap")&&(p=Math.max(2*(p-10),p)),N?(y=u-a.backwardCoord*f,m=y-p):(m=d+a.backwardCoord*f,y=m+p),m=Math.max(m,d),y=Math.min(y,u),p=y-m,a.top=i,a.left=m,a.outerWidth=p,a.outerHeight=c-i,_+=s(o,a);for(H[0].innerHTML=_,b=H.children(),r=0;z>r;r++)a=t[r],o=a.event,w=e(b[r]),T=h("eventRender",o,o,w),T===!1?w.remove():(T&&T!==!0&&(w.remove(),w=e(T).css({position:"absolute",top:a.top,left:a.left}).appendTo(H)),a.element=w,o._id===n?l(o,w,a):w[0]._fci=r,Z(o,w));for(g(H,t,l),r=0;z>r;r++)a=t[r],(w=a.element)&&(a.vsides=C(w,!0),a.hsides=D(w,!0),S=w.find(".fc-event-title"),S.length&&(a.contentTop=S[0].offsetTop));for(r=0;z>r;r++)a=t[r],(w=a.element)&&(w[0].style.width=Math.max(0,a.outerWidth-a.hsides)+"px",k=Math.max(0,a.outerHeight-a.vsides),w[0].style.height=k+"px",o=a.event,void 0!==a.contentTop&&k-a.contentTop<10&&(w.find("div.fc-event-time").text(Q(o.start,v("timeFormat"))+" - "+o.title),w.find("div.fc-event-title").remove()),h("eventAfterRender",o,o,w))}function s(e,t){var n="<",r=e.url,a=F(e,v),o=["fc-event","fc-event-vert"];return p(e)&&o.push("fc-event-draggable"),t.isStart&&o.push("fc-event-start"),t.isEnd&&o.push("fc-event-end"),o=o.concat(e.className),e.source&&(o=o.concat(e.source.className||[])),n+=r?"a href='"+_(e.url)+"'":"div",n+=" class='"+o.join(" ")+"' style='position:absolute;top:"+t.top+"px;left:"+t.left+"px;"+a+"'>
"+_(f.getEventTimeText(e))+"
"+_(e.title||"")+"
",t.isEnd&&m(e)&&(n+="
=
"),n+=""}function l(e,t,n){var r=t.find("div.fc-event-time");p(e)&&d(e,t,r),n.isEnd&&m(e)&&u(e,t,r),b(e,t)}function c(e,n,r){function a(){c||(n.width(o).height("").draggable("option","grid",null),c=!0)}var o,i,s,l=r.isStart,c=!0,d=S(),u=N(),f=V(),p=Y(),g=W(),m=A(),D=O();n.draggable({opacity:v("dragOpacity","month"),revertDuration:v("dragRevertDuration"),start:function(t,r){h("eventDragStart",n[0],e,t,r),P(e,n),o=n.width(),d.start(function(t,r){if($(),t){i=!1;var o=z(0,r.col),d=z(0,t.col);s=d.diff(o,"days"),t.row?l?c&&(n.width(u-10),y(n,U.defaultTimedEventDuration/p*g),n.draggable("option","grid",[u,1]),c=!1):i=!0:(q(e.start.clone().add(s,"days"),J(e).add(s,"days")),a()),i=i||c&&!s}else a(),i=!0;n.draggable("option","revert",i)},t,"drag")},stop:function(r,o){if(d.stop(),$(),h("eventDragStop",n[0],e,r,o),i)a(),n.css("filter",""),B(e,n);else{var l,u,v=e.start.clone().add(s,"days");c||(u=Math.round((n.offset().top-L().offset().top)/D),l=t.duration(f+u*m),v=U.rezoneDate(v.clone().time(l))),j(n[0],e,v,r,o)}}})}function d(e,t,n){function r(){$(),s&&(c?(n.hide(),t.draggable("option","grid",null),q(D,b)):(a(),n.css("display",""),t.draggable("option","grid",[C,E])))}function a(){D&&n.text(f.getEventTimeText(D,e.end?b:null))}var o,i,s,l,c,d,u,p,g,m,y,D,b,w=f.getCoordinateGrid(),T=H(),C=N(),E=O(),S=A();t.draggable({scroll:!1,grid:[C,E],axis:1==T?"y":!1,opacity:v("dragOpacity"),revertDuration:v("dragRevertDuration"),start:function(n,r){h("eventDragStart",t[0],e,n,r),P(e,t),w.build(),o=t.position(),i=w.cell(n.pageX,n.pageY),s=l=!0,c=d=k(i),u=p=0,g=0,m=y=0,D=null,b=null},drag:function(n,a){var f=w.cell(n.pageX,n.pageY);if(s=!!f){if(c=k(f),u=Math.round((a.position.left-o.left)/C),u!=p){var v=z(0,i.col),h=i.col+u;h=Math.max(0,h),h=Math.min(T-1,h);var x=z(0,h);g=x.diff(v,"days")}c||(m=Math.round((a.position.top-o.top)/E))}(s!=l||c!=d||u!=p||m!=y)&&(c?(D=e.start.clone().stripTime().add(g,"days"),b=D.clone().add(U.defaultAllDayEventDuration)):(D=e.start.clone().add(m*S).add(g,"days"),b=J(e).add(m*S).add(g,"days")),r(),l=s,d=c,p=u,y=m),t.draggable("option","revert",!s)},stop:function(n,a){$(),h("eventDragStop",t[0],e,n,a),s&&(c||g||m)?j(t[0],e,D,n,a):(s=!0,c=!1,u=0,g=0,m=0,r(),t.css("filter",""),t.css(o),B(e,t))}})}function u(e,t,n){var r,a,o,i=O(),s=A();t.resizable({handles:{s:".ui-resizable-handle"},grid:i,start:function(n,o){r=a=0,P(e,t),h("eventResizeStart",t[0],e,n,o)},resize:function(l,c){if(r=Math.round((Math.max(i,t.height())-c.originalSize.height)/i),r!=a){o=J(e).add(s*r);var d;d=r?f.getEventTimeText(e.start,o):f.getEventTimeText(e),n.text(d),a=r}},stop:function(n,a){h("eventResizeStop",t[0],e,n,a),r?I(t[0],e,o,n,a):B(e,t)}})}var f=this;f.renderEvents=n,f.clearEvents=r,f.slotSegHtml=s,we.call(f);var v=f.opt,h=f.trigger,p=f.isEventDraggable,m=f.isEventResizable,b=f.eventElementHandlers,w=f.setHeight,T=f.getDaySegmentContainer,E=f.getSlotSegmentContainer,S=f.getHoverListener,x=f.computeDateTop,k=f.getIsCellAllDay,M=f.colContentLeft,R=f.colContentRight,z=f.cellToDate,H=f.getColCnt,N=f.getColWidth,O=f.getSnapHeight,A=f.getSnapDuration,W=f.getSlotHeight,Y=f.getSlotDuration,L=f.getSlotContainer,Z=f.reportEventElement,B=f.showEvents,P=f.hideEvents,j=f.eventDrop,I=f.eventResize,q=f.renderDayOverlay,$=f.clearOverlays,X=f.renderDayEvents,V=f.getMinTime,G=f.getMaxTime,U=f.calendar,Q=U.formatDate,J=U.getEventEnd;f.draggableDayEvent=c}function se(e){var t,n=le(e),r=n[0];if(ce(n),r){for(t=0;tt.start&&e.startt?-1:1)}function r(e){a.start=a.intervalStart=e.clone().stripTime(),a.end=a.intervalEnd=a.start.clone().add(1,"days"),a.title=t.formatDate(a.start,a.opt("titleFormat")),a.renderResource(o().length)}var a=this;a.incrementDate=n,a.render=r,ye.call(a,e,t,"resourceDay");var o=a.getResources}function ye(n,r,a){function o(e){Re=e,i(),G?l():s()}function i(){Ae=Pe("theme")?"ui":"fc",We=Pe("isRTL"),Be=Pe("columnFormat"),Le=t.duration(Pe("minTime")),Ze=t.duration(Pe("maxTime")),ye=t.duration(Pe("slotDuration")),Te=Pe("snapDuration"),Te=Te?t.duration(Te):ye}function s(){var r,a,o,i,s=Ae+"-widget-header",c=Ae+"-widget-content",d=ye.asMinutes()%15===0;for(l(),ae=e("
").appendTo(n),Pe("allDaySlot")?(oe=e("
").appendTo(ae),r="
"+(Pe("allDayHTML")||_(Pe("allDayText")))+"
 
",ie=e(r).appendTo(ae),se=ie.find("tr"),g(se.find("td")),ae.append("
")):oe=e([]),le=e("
").appendTo(ae),ce=e("
").appendTo(le),de=e("
").appendTo(ce),r="",a=t.duration(+Le),_e=0;Ze>a;)o=V.start.clone().time(a),i=o.minutes(),r+="",a.add(ye),_e++;r+="
"+(d&&i?" ":_(Je(o,Pe("axisFormat"))))+"
 
",ue=e(r).appendTo(ce),D(ue.find("td"))}function l(){var t=c();G&&G.remove(),G=e(t).appendTo(n),U=G.find("thead"),Q=U.find("th").slice(1,-1),J=G.find("tbody"),K=J.find("td").slice(0,-1),ee=K.find("> div"),te=K.find(".fc-day-content > div"),ne=K.eq(0),re=ee.eq(0),O(U.add(U.find("tr"))),O(J.add(J.find("tr")))}function c(){var e=""+d()+u()+"
";return e}function d(){var e,t,n,r=Ae+"-widget-header",a="";for(a+="",Pe("weekNumbers")?(e=Ge(0,0),t=Ke(e),We?t+=Pe("weekNumberTitle"):t=Pe("weekNumberTitle")+t,a+=""+_(t)+""):a+=" ",n=0;Re>n;n++){var o=nt()[n],i=["fc-col"+n,o.className,r];a+=""+_(o.name)+""}return a+=" "}function u(){var e,t,n,a,o,i=Ae+"-widget-header",s=Ae+"-widget-content",l=r.getNow().stripTime(),c="";for(c+=" ",n="",t=0;(Re||1)>t;t++){var d=nt()[t];e=V.intervalStart.clone(),o=["fc-col"+t,"fc-"+Ye[e.day()],s],d&&d.className&&o.push(d.className),e.isSame(l,"day")?o.push(Ae+"-state-highlight","fc-today"):l>e?o.push("fc-past"):o.push("fc-future"),a="
 
",n+=a}return c+=n,c+=" "}function f(e){void 0===e&&(e=he),he=e,tt={};var t=J.position().top,n=le.position().top,r=Math.min(e-t,ue.height()+n+1);re.height(r-C(ne)),ae.css("top",t),le.height(r-n-1);var a=ue.find("tr:first").height()+1,o=ue.find("tr:eq(1)").height();we=(a+o)/2-.5,Ce=ye/Te,Ee=we/Ce}function v(t){ve=t,Oe.clear(),Fe.clear();var n=U.find("th:first");ie&&(n=n.add(ie.find("th:first"))),n=n.add(ue.find("th:first")),pe=0,m(n.width("").each(function(t,n){pe=Math.max(pe,e(n).outerWidth())}),pe);var r=G.find(".fc-agenda-gutter");ie&&(r=r.add(ie.find("th.fc-agenda-gutter")));var a=le[0].clientWidth;me=le.width()-a,me?(m(r,me),r.show().prev().removeClass("fc-last")):r.hide().prev().addClass("fc-last"),ge=Math.floor((a-pe)/Re),m(Q.slice(0,-1),ge)}function h(){function e(){le.scrollTop(n)}var n=A(t.duration(Pe("scrollTime")))+1;e(),setTimeout(e,0)}function p(){h()}function g(e){e.click(b).mousedown(X)}function D(e){e.click(b).mousedown(B)}function b(e){if(!Pe("selectable")){var t=Math.min(Re-1,Math.floor((e.pageX-G.offset().left-pe)/ge)),n=Ge(0,0),a=this.parentNode.className.match(/fc-slot(\d+)/);if(e.data=nt()[t],a){var o=parseInt(a[1],10);n.add(Le+o*ye),n=r.rezoneDate(n),je("dayClick",K[t],n,e)}else je("dayClick",K[t],n,e)}}function w(e,t,n,r){n&&He.build();for(var a=Qe(e,t),o=0;or?e:r,i=t>a?a:t;if(i>o){var s=He.rect(0,n,0,n,ce),l=F(o,r),c=F(i,r);s.top=l,s.height=c-l,D(Ie(s,ce))}}function S(e){return Oe.left(e)}function x(e){return Fe.left(e)}function k(e){return Oe.right(e)}function R(e){return Fe.right(e)}function z(e){return Pe("allDaySlot")&&!e.row}function H(e){var n=Ge(0,0),a=e.row;return Pe("allDaySlot")&&a--,a>=0&&(n.time(t.duration(Le+a*Te)),n=r.rezoneDate(n)),n}function F(e,n){return A(t.duration(e.clone().stripZone()-n.clone().stripTime()))}function A(e){if(Le>e)return 0;if(e>=Ze)return ue.height();var t=(e-Le)/ye,n=Math.floor(t),r=t-n,a=tt[n];void 0===a&&(a=tt[n]=ue.find("tr").eq(n).find("td div")[0].offsetTop);var o=a-1+r*we;return o=Math.max(o,0)}function W(e){return e.hasTime()?e.clone().add(ye):e.clone().add(1,"days")}function Y(e,t,n){e.hasTime()||t.hasTime()?L(e,t):Pe("allDaySlot")&&w(e,t,!0,n)}function L(t,n,r){var a=Pe("selectHelper");if(He.build(),a){if(r=r||Ue(t).col,r>=0&&Re>r){var o=He.rect(0,r,0,r,ce),i=F(t,t),s=F(n,t);if(s>i){if(o.top=i,o.height=s-i,o.left+=2,o.width-=5,e.isFunction(a)){var l=a(t,n);l&&(o.position="absolute",fe=e(l).css(o).appendTo(ce))}else o.isStart=!0,o.isEnd=!0,fe=e(Ve({title:"",start:t,end:n,className:["fc-select-helper"],editable:!1},o)),fe.css("opacity",Pe("dragOpacity"));fe&&(D(fe),ce.append(fe),m(fe,o.width,!0),y(fe,o.height,!0))}}}else E(t,n,r)}function Z(){qe(),fe&&(fe.remove(),fe=null)}function B(t){if(1==t.which&&Pe("selectable")){Xe(t);var n,r;Ne.start(function(e,t){if(Z(),e&&e.col==t.col&&!z(e)){r=e.col;var a=H(t),o=H(e);n=[a,a.clone().add(Te),o,o.clone().add(Te)].sort(M),L(n[0],n[3],e.col)}else n=null},t),e(document).one("mouseup",function(e){Ne.stop(),n&&(+n[0]==+n[1]&&P(n[0],e),e.data=nt()[r],$e(n[0],n[3],e))})}}function P(e,t){je("dayClick",K[Ue(e).col],e,t)}function j(e,t,n,a,o,i){var s=r.mutateResourceEvent(t,n,a,null);je("eventDrop",e,t,s.dateDelta,function(){s.undo(),et(t._id)},o,i),et(t._id)}function I(e,t,n,a,o){var i=r.mutateResourceEvent(t,t.resources,null,n);je("eventResize",e,t,i.durationDelta,function(){i.undo(),et(t._id)},a,o),et(t._id)}function q(e,t,n){Ne.start(function(e){if(qe(),e){var t=H(e),n=t.clone();t.hasTime()?(n.add(r.defaultTimedEventDuration),E(t,n,e.col)):(n.add(r.defaultAllDayEventDuration),w(t,n,!0,e.col))}},t)}function $(e,t,n){var r=Ne.stop();qe(),r&&(t.data=nt()[r.col],je("drop",e,H(r),t,n))}function X(t){var n,r=V.getIsCellAllDay,a=V.getHoverListener(),o=V.reportDayClick;if(1==t.which&&Pe("selectable")){Xe(t);var i;a.start(function(e,t){Z(),e&&r(e)?(n=e.col,i=[H(t),H(e)].sort(M),Y(i[0],i[1],n)):i=null},t),e(document).one("mouseup",function(e){a.stop(),i&&(+i[0]==+i[1]&&o(i[0],!0,e),e.data=nt()[n],$e(i[0],i[1],e))})}}var V=this;V.renderResource=o,V.setWidth=v,V.setHeight=f,V.afterRender=p,V.computeDateTop=F,V.getIsCellAllDay=z,V.allDayRow=function(){return se},V.getCoordinateGrid=function(){return He},V.getHoverListener=function(){return Ne},V.colLeft=S,V.colRight=k,V.colContentLeft=x,V.colContentRight=R,V.getDaySegmentContainer=function(){return oe},V.getSlotSegmentContainer=function(){return de},V.getSlotContainer=function(){return ce},V.getRowCnt=function(){return 1},V.getColCnt=function(){return 1},V.getColWidth=function(){return ge},V.getSnapHeight=function(){return Ee},V.getSnapDuration=function(){return Te},V.getSlotHeight=function(){return we},V.getSlotDuration=function(){return ye},V.getMinTime=function(){return Le},V.getMaxTime=function(){return Ze},V.defaultSelectionEnd=W,V.renderDayOverlay=w,V.renderSelection=Y,V.clearSelection=Z,V.reportDayClick=P,V.dragStart=q,V.dragStop=$,V.getResources=r.fetchResources,be.call(V,n,r,a),V.eventDrop=j,V.eventResize=I,xe.call(V),Se.call(V),De.call(V);var G,U,Q,J,K,ee,te,ne,re,ae,oe,ie,se,le,ce,de,ue,fe,ve,he,pe,ge,me,ye,we,Te,Ce,Ee,Re,_e,He,Ne,Oe,Fe,Ae,We,Le,Ze,Be,Pe=V.opt,je=V.trigger,Ie=V.renderOverlay,qe=V.clearOverlays,$e=V.reportSelection,Xe=V.unselect,Ve=V.slotSegHtml,Ge=V.cellToDate,Ue=V.dateToCell,Qe=V.rangeToSegments,Je=r.formatDate,Ke=r.calculateWeekNumber,et=r.reportEventChange,tt={},nt=V.getResources;N(n.addClass("fc-agenda")),He=new ke(function(t,n){function r(e){return Math.max(l,Math.min(c,e))}var a,o,i;Q.each(function(t,r){a=e(r),o=a.offset().left,t&&(i[1]=o),i=[o],n[t]=i}),i[1]=o+a.outerWidth(),Pe("allDaySlot")&&(a=se,o=a.offset().top,t[0]=[o,o+a.outerHeight()]);for(var s=ce.offset().top,l=le.offset().top,c=l+le.outerHeight(),d=0;_e*Ce>d;d++)t.push([r(s+Ee*d),r(s+Ee*(d+1))])}),Ne=new Me(He),Oe=new ze(function(e){return ee.eq(e)}),Fe=new ze(function(e){return te.eq(e)})}function De(){function n(e,t){var n,r=e.length,o=[],i=[];for(n=0;r>n;n++)e[n].allDay?o.push(e[n]):i.push(e[n]);h("allDaySlot")&&(V(o,t),T()),s(a(i),t)}function r(){E().empty(),S().empty()}function a(e){var t,n,r,a,s,l=N(),c=G(),d=U(),u=[];for(n=0;l>n;n++){t=H(0,0);var f=i(ee()[n],e);for(s=o(f,t.clone().time(c),t.clone().time(d)),s=se(s),r=0;rr;r++)a=e[r],o=a.start.clone().stripZone(),i=K(a).stripZone(),i>t&&n>o&&(t>o?(s=t.clone(),c=!1):(s=o,c=!0),i>n?(l=n.clone(),d=!1):(l=i,d=!0),u.push({event:a,start:s,end:l,isStart:c,isEnd:d}));return u.sort(ge)}function i(t,n){for(var r=[],a=function(n){return n.resources&&e.grep(n.resources,function(e){return e==t.id}).length},o=0;or;r++)a=t[r],o=a.event,i=k(a.start,a.start),s=k(a.end,a.start),d=R(a.col),u=z(a.col),f=u-d,u-=.025*f,f=u-d,v=f*(a.forwardCoord-a.backwardCoord),h("slotEventOverlap")&&(v=Math.max(2*(v-10),v)),N?(y=u-a.backwardCoord*f,m=y-v):(m=d+a.backwardCoord*f,y=m+v),m=Math.max(m,d),y=Math.min(y,u),v=y-m,a.top=i,a.left=m,a.outerWidth=v,a.outerHeight=s-i,_+=l(o,a);for(H[0].innerHTML=_,b=H.children(),r=0;M>r;r++)a=t[r],o=a.event,w=e(b[r]),T=p("eventRender",o,o,w),T===!1?w.remove():(T&&T!==!0&&(w.remove(),w=e(T).css({position:"absolute",top:a.top,left:a.left}).appendTo(H)),a.element=w,o._id===n?c(o,w,a):w[0]._fci=r,B(o,w));for(g(H,t,c),r=0;M>r;r++)a=t[r],(w=a.element)&&(a.vsides=C(w,!0),a.hsides=D(w,!0),E=w.find(".fc-event-title"),E.length&&(a.contentTop=E[0].offsetTop));for(r=0;M>r;r++)a=t[r],(w=a.element)&&(w[0].style.width=Math.max(0,a.outerWidth-a.hsides)+"px",x=Math.max(0,a.outerHeight-a.vsides),w[0].style.height=x+"px",o=a.event,void 0!==a.contentTop&&x-a.contentTop<10&&(w.find("div.fc-event-time").text(J(o.start,h("timeFormat"))+" - "+o.title),w.find("div.fc-event-title").remove()),p("eventAfterRender",o,o,w))}function l(e,t){var n="<",r=e.url,a=F(e,h),o=["fc-event","fc-event-vert"];return m(e)&&o.push("fc-event-draggable"),t.isStart&&o.push("fc-event-start"),t.isEnd&&o.push("fc-event-end"),o=o.concat(e.className),e.source&&(o=o.concat(e.source.className||[])),n+=r?"a href='"+_(e.url)+"'":"div",n+=" class='"+o.join(" ")+"' style='position:absolute;top:"+t.top+"px;left:"+t.left+"px;"+a+"'>
"+_(v.getEventTimeText(e))+"
"+_(e.title||"")+"
",t.isEnd&&b(e)&&(n+="
=
"),n+=""}function c(e,t,n){var r=t.find("div.fc-event-time");m(e)&&u(e,t,r),n.isEnd&&b(e)&&f(e,t,r),w(e,t)}function d(e,n,r){function a(){d||(n.width(o).height("").draggable("option","grid",null),d=!0)}var o,i,s,l,c=r.isStart,d=!0,u=x(),f=O(),v=G(),g=L(),m=Y(),D=W(),b=A();n.draggable({opacity:h("dragOpacity","month"),revertDuration:h("dragRevertDuration"),start:function(t,r){p("eventDragStart",n[0],e,t,r),j(e,n),o=n.width(),u.start(function(t,r){if(X(),t){i=!1,l=r.col;var o=H(0,r.col),u=H(0,t.col);s=u.diff(o,"days"),t.row?c?d&&(n.width(f-10),y(n,Q.defaultTimedEventDuration/g*m),n.draggable("option","grid",[f,1]),d=!1):i=!0:($(e.start.clone().add(s,"days"),K(e).add(s,"days"),!0,1),a()),i=i||d&&!s}else a(),i=!0;n.draggable("option","revert",i)},t,"drag")},stop:function(r,o){if(u.stop(),X(),p("eventDragStop",n[0],e,r,o),i)a(),n.css("filter",""),P(e,n);else{var s=Math.round((n.offset().left-Z().offset().left)/f),c=e.resources;s!==l&&(c=[ee()[s].id]);var h,g,m=e.start.clone();d||(g=Math.round((n.offset().top-Z().offset().top)/b),h=t.duration(v+g*D),m=Q.rezoneDate(m.clone().time(h))),I(n[0],e,c,m,r,o)}}})}function u(e,t,n){function r(){X(),s&&(c?(n.hide(),t.draggable("option","grid",null),$(b,w,!1,i.col+u)):(a(),n.css("display",""),t.draggable("option","grid",[E,S])))}function a(){b&&n.text(v.getEventTimeText(b,e.end?w:null))}var o,i,s,l,c,d,u,f,g,m,y,D,b,w,T=v.getCoordinateGrid(),C=N(),E=O(),S=A(),x=W();t.draggable({scroll:!1,grid:[E,S],axis:1==C?"y":!1,opacity:h("dragOpacity"),revertDuration:h("dragRevertDuration"),start:function(n,r){p("eventDragStart",t[0],e,n,r),j(e,t),T.build(),o=t.position(),i=T.cell(n.pageX,n.pageY),s=l=!0,c=d=M(i),u=f=0,g=0,m=0,y=D=0,b=null,w=null},drag:function(n,a){var i=T.cell(n.pageX,n.pageY);s=!!i,s&&(c=M(i),u=Math.round((a.position.left-o.left)/E),u!=f&&(m=u),c||(y=Math.round((a.position.top-o.top)/S))),(s!=l||c!=d||u!=f||y!=D)&&(c?(b=e.start.clone().stripTime().add(g,"days"),w=b.clone().add(Q.defaultAllDayEventDuration)):(b=e.start.clone().add(y*x).add(g,"days"),w=K(e).add(y*x).add(g,"days")),r(),l=s,d=c,f=u,D=y),t.draggable("option","revert",!s)},stop:function(n,a){if(X(),p("eventDragStop",t[0],e,n,a),s&&(c||m||y)){var l=e.resources.slice(0);if(m){var d=ee(),f=d[i.col+m].id,v=d[i.col].id,h=e.resources.indexOf(v),D=e.resources.indexOf(f);D>-1?l.splice(h,1):l[h]=f}I(t[0],e,l,b,n,a)}else s=!0,c=!1,u=0,g=0,y=0,r(),t.css("filter",""),t.css(o),P(e,t)}})}function f(e,t,n){var r,a,o,i=A(),s=W();t.resizable({handles:{s:".ui-resizable-handle"},grid:i,start:function(n,o){r=a=0,j(e,t),p("eventResizeStart",t[0],e,n,o)},resize:function(l,c){if(r=Math.round((Math.max(i,t.height())-c.originalSize.height)/i),r!=a){o=K(e).add(s*r);var d;d=r?v.getEventTimeText(e.start,o):v.getEventTimeText(e),n.text(d),a=r}},stop:function(n,a){p("eventResizeStop",t[0],e,n,a),r?q(t[0],e,o,n,a):P(e,t)}})}var v=this;v.renderEvents=n,v.clearEvents=r,v.slotSegHtml=l,we.call(v);var h=v.opt,p=v.trigger,m=v.isEventDraggable,b=v.isEventResizable,w=v.eventElementHandlers,T=v.setHeight,E=v.getDaySegmentContainer,S=v.getSlotSegmentContainer,x=v.getHoverListener,k=v.computeDateTop,M=v.getIsCellAllDay,R=v.colContentLeft,z=v.colContentRight,H=v.cellToDate,N=function(){return ee().length},O=v.getColWidth,A=v.getSnapHeight,W=v.getSnapDuration,Y=v.getSlotHeight,L=v.getSlotDuration,Z=v.getSlotContainer,B=v.reportEventElement,P=v.showEvents,j=v.hideEvents,I=v.eventDrop,q=v.eventResize,$=v.renderDayOverlay,X=v.clearOverlays,V=v.renderDayEvents,G=v.getMinTime,U=v.getMaxTime,Q=v.calendar,J=Q.formatDate,K=Q.getEventEnd,ee=v.getResources;v.draggableDayEvent=d}function be(n,r,a){function o(t,n){var r=A[t];return e.isPlainObject(r)&&!i(t)?z(r,n||a):r}function s(e,t){return r.trigger.apply(r,[e,t||H].concat(Array.prototype.slice.call(arguments,2),[H]))}function l(e){var t=e.source||{};return W(e.startEditable,t.startEditable,o("eventStartEditable"),e.editable,t.editable,o("editable"))}function c(e){var t=e.source||{};return W(e.durationEditable,t.durationEditable,o("eventDurationEditable"),e.editable,t.editable,o("editable"))}function d(){O={},F=[]}function u(e,t){F.push({event:e,element:t}),O[e._id]?O[e._id].push(t):O[e._id]=[t]}function f(){e.each(F,function(e,t){H.trigger("eventDestroy",t.event,t.event,t.element)})}function v(e,t){t.click(function(n){return t.hasClass("ui-draggable-dragging")||t.hasClass("ui-resizable-resizing")?void 0:s("eventClick",this,e,n)}).hover(function(t){s("eventMouseover",this,e,t)},function(t){s("eventMouseout",this,e,t)})}function h(e,t){g(e,t,"show")}function p(e,t){g(e,t,"hide")}function g(e,t,n){var r,a=O[e._id],o=a.length;for(r=0;o>r;r++)t&&a[r][0]==t[0]||a[r][n]()}function m(e,t,n,a,o){var i=r.mutateEvent(t,n,null);s("eventDrop",e,t,i.dateDelta,function(){i.undo(),N(t._id)},a,o),N(t._id)}function y(e,t,n,a,o){var i=r.mutateEvent(t,null,n);s("eventResize",e,t,i.durationDelta,function(){i.undo(),N(t._id)},a,o),N(t._id)}function D(e){return t.isMoment(e)&&(e=e.day()),B[e]}function b(){return L}function w(e,t,n){var r=e.clone();for(t=t||1;B[(r.day()+(n?t:0)+7)%7];)r.add(t,"days");return r}function T(){var e=C.apply(null,arguments),t=E(e),n=S(t);return n}function C(e,t){var n=H.getColCnt(),r=I?-1:1,a=I?n-1:0;"object"==typeof e&&(t=e.col,e=e.row);var o=e*n+(t*r+a);return o}function E(e){var t=H.start.day();return e+=P[t],7*Math.floor(e/L)+j[(e%L+L)%L]-t}function S(e){return H.start.clone().add(e,"days")}function x(e){var t=k(e),n=M(t),r=R(n);return r}function k(e){return e.clone().stripTime().diff(H.start,"days")}function M(e){var t=H.start.day();return e+=t,Math.floor(e/7)*L+P[(e%7+7)%7]-P[t]}function R(e){var t=H.getColCnt(),n=I?-1:1,r=I?t-1:0,a=Math.floor(e/t),o=(e%t+t)%t*n+r;return{row:a,col:o}}function _(e,t){var n=H.getRowCnt(),r=H.getColCnt(),a=[],o=k(e),i=k(t),s=+t.time();s&&s>=Y&&i++,i=Math.max(i,o+1);for(var l=M(o),c=M(i)-1,d=0;n>d;d++){var u=d*r,f=u+r-1,v=Math.max(l,u),h=Math.min(c,f);if(h>=v){var p=R(v),g=R(h),m=[p.col,g.col].sort(),y=E(v)==o,D=E(h)+1==i;a.push({row:d,leftCol:m[0],rightCol:m[1],isStart:y,isEnd:D})}}return a}var H=this;H.element=n,H.calendar=r,H.name=a,H.opt=o,H.trigger=s,H.isEventDraggable=l,H.isEventResizable=c,H.clearEventData=d,H.reportEventElement=u,H.triggerEventDestroy=f,H.eventElementHandlers=v,H.showEvents=h,H.hideEvents=p,H.eventDrop=m,H.eventResize=y;var N=r.reportEventChange,O={},F=[],A=r.options,Y=t.duration(A.nextDayThreshold);H.getEventTimeText=function(e){var t,n;return 2===arguments.length?(t=arguments[0],n=arguments[1]):(t=e.start,n=e.end),n&&o("displayEventEnd")?r.formatRange(t,n,o("timeFormat")):r.formatDate(t,o("timeFormat"))},H.isHiddenDay=D,H.skipHiddenDays=w,H.getCellsPerWeek=b,H.dateToCell=x,H.dateToDayOffset=k,H.dayOffsetToCellOffset=M,H.cellOffsetToCell=R,H.cellToDate=T,H.cellToCellOffset=C,H.cellOffsetToDayOffset=E,H.dayOffsetToDate=S,H.rangeToSegments=_;var L,Z=o("hiddenDays")||[],B=[],P=[],j=[],I=o("isRTL");!function(){o("weekends")===!1&&Z.push(0,6);for(var t=0,n=0;7>t;t++)P[t]=n,B[t]=-1!=e.inArray(t,Z),B[t]||(j[n]=t,n++);if(L=n,!L)throw"invalid hiddenDays"}()}function we(){function t(e,t){var n=r(e,!1,!0);Ce(n,function(e,t){M(e.event,t)}),y(n,t),Ce(n,function(e,t){S("eventAfterRender",e.event,e.event,t)})}function n(e,t,n){var a=r([e],!0,!1),o=[];return Ce(a,function(e,r){e.row===t&&r.css("top",n),o.push(r[0])}),o}function r(t,n,r){var o,i,c=q(),f=n?e("
"):c,v=a(t);return s(v),o=l(v),f[0].innerHTML=o,i=f.children(),n&&c.append(i),d(v,i),Ce(v,function(e,t){e.hsides=D(t,!0)}),Ce(v,function(e,t){t.width(Math.max(0,e.outerWidth-e.hsides))}),Ce(v,function(e,t){e.outerHeight=t.outerHeight(!0)}),u(v,r),v}function a(e){var t,n,r=C.getResources,a=[];if("undefined"==typeof r)for(t=0;t
",!r.allDay&&e.isStart&&(t+=""+_(C.getEventTimeText(r))+""),t+=""+_(r.title||"")+"
",r.allDay&&e.isEnd&&k(r)&&(t+="
   
"),t+=""}function d(t,n){for(var r=0;ri;i++){var s=o[i],l=[];for(t=0;r>t;t++)l.push(0);for(var c=0;cr;r++)o[r]=h(o[r]||[]);return o}function h(e){for(var t=[],n=p(e),r=0;re;e++)n[e]=Z(e).find("div.fc-day-content > div");return n}function y(e,t){var n=q();Ce(e,function(e,n,r){var a=e.event;a._id===t?b(a,n,e):n[0]._fci=r}),g(n,e,b)}function b(e,t,n){x(e)&&C.draggableDayEvent(e,t,n),e.allDay&&n.isEnd&&k(e)&&C.resizableDayEvent(e,t,n),z(e,t)}function w(e,t){var n,r,a=G();t.draggable({delay:50,opacity:E("dragOpacity"),revertDuration:E("dragRevertDuration"),start:function(o,i){S("eventDragStart",t[0],e,o,i),O(e,t),a.start(function(a,o,i,s){if(t.draggable("option","revert",!a||!i&&!s),X(),a){var l=Q(o),c=Q(a);n=c.diff(l,"days"),r=e.start.clone().add(n,"days"),$(r,re(e).add(n,"days"))}else n=0},o,"drag")},stop:function(o,i){a.stop(),X(),S("eventDragStop",t[0],e,o,i),n?A(t[0],e,r,o,i):(t.css("filter",""),H(e,t))}})}function T(t,r,a){var o=E("isRTL"),i=o?"w":"e",s=r.find(".ui-resizable-"+i),l=!1;N(r),r.mousedown(function(e){e.preventDefault()}).click(function(e){l&&(e.preventDefault(),e.stopImmediatePropagation())}),s.mousedown(function(o){function s(n){S("eventResizeStop",r[0],t,n,{}),e("body").css("cursor",""),f.stop(),X(),c&&W(r[0],t,d,n,{}),setTimeout(function(){l=!1},0)}if(1==o.which){l=!0;var c,d,u,f=G(),v=r.css("top"),h=e.extend({},t),p=te(ee(t.start));V(),e("body").css("cursor",i+"-resize").one("mouseup",s),S("eventResizeStart",r[0],t,o,{}),f.start(function(r,o){if(r){var s=J(o),l=J(r);if(l=Math.max(l,p),c=K(l)-K(s),d=re(t).add(c,"days"),c){h.end=d;var f=u;u=n(h,a.row,v),u=e(u),u.find("*").css("cursor",i+"-resize"),f&&f.remove(),O(t)}else u&&(H(t),u.remove(),u=null);X(),$(t.start,d)}},o)}})}var C=this;C.renderDayEvents=t,C.draggableDayEvent=w,C.resizableDayEvent=T;var E=C.opt,S=C.trigger,x=C.isEventDraggable,k=C.isEventResizable,M=C.reportEventElement,z=C.eventElementHandlers,H=C.showEvents,O=C.hideEvents,A=C.eventDrop,W=C.eventResize,Y=C.getRowCnt,L=C.getColCnt,Z=C.allDayRow,B=C.colLeft,P=C.colRight,j=C.colContentLeft,I=C.colContentRight,q=C.getDaySegmentContainer,$=C.renderDayOverlay,X=C.clearOverlays,V=C.clearSelection,G=C.getHoverListener,U=C.rangeToSegments,Q=C.cellToDate,J=C.cellToCellOffset,K=C.cellOffsetToDayOffset,ee=C.dateToDayOffset,te=C.dayOffsetToCellOffset,ne=C.calendar,re=ne.getEventEnd}function Te(e,t){for(var n=0;n=e.leftCol)return!0}return!1}function Ce(e,t){for(var n=0;n")),r[0].parentNode!=n[0]&&r.appendTo(n),a.push(r.css(t).show()),r}function n(){for(var e;e=a.shift();)o.push(e.hide().unbind())}var r=this;r.renderOverlay=t,r.clearOverlays=n;var a=[],o=[]}function ke(e){var t,n,r=this;r.build=function(){t=[],n=[],e(t,n)},r.cell=function(e,r){var a,o=t.length,i=n.length,s=-1,l=-1;for(a=0;o>a;a++)if(r>=t[a][0]&&ra;a++)if(e>=n[a][0]&&e=0&&l>=0?{row:s,col:l}:null},r.rect=function(e,r,a,o,i){var s=i.offset();return{top:t[e][0]-s.top,left:n[r][0]-s.left,width:n[o][1]-n[r][0],height:t[a][1]-t[e][0]}}}function Me(t){function n(e){Re(e);var n=t.cell(e.pageX,e.pageY);(Boolean(n)!==Boolean(i)||n&&(n.row!=i.row||n.col!=i.col))&&(n?(o||(o=n),a(n,o,n.row-o.row,n.col-o.col)):a(n,o),i=n)}var r,a,o,i,s=this;s.start=function(s,l,c){a=s,o=i=null,t.build(),n(l),r=c||"mousemove",e(document).bind(r,n)},s.stop=function(){return e(document).unbind(r,n),i}}function Re(e){void 0===e.pageX&&(e.pageX=e.originalEvent.pageX,e.pageY=e.originalEvent.pageY)}function ze(e){function t(t){return r[t]=r[t]||e(t)}var n=this,r={},a={},o={};n.left=function(e){return a[e]=void 0===a[e]?t(e).position().left:a[e]},n.right=function(e){return o[e]=void 0===o[e]?n.left(e)+t(e).width():o[e]},n.clear=function(){r={},a={},o={}}}var _e={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:r,day:"dddd"},timeFormat:{"default":n},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"},unselectAuto:!0,dropAccept:"*",handleWindowResize:!0,windowResizeDelay:200},He={en:{columnFormat:{week:"ddd M/D"}}},Ne={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"}},Oe=e.fullCalendar={version:"2.0.2"},Fe=Oe.views={};e.fn.fullCalendar=function(t){var n=Array.prototype.slice.call(arguments,1),r=this;return this.each(function(a,o){var i,l=e(o),c=l.data("fullCalendar");"string"==typeof t?c&&e.isFunction(c[t])&&(i=c[t].apply(c,n),a||(r=i),"destroy"===t&&l.removeData("fullCalendar")):c||(c=new s(l,t),l.data("fullCalendar",c),c.render())}),r},Oe.langs=He,Oe.datepickerLang=function(t,n,r){var a=He[t];a||(a=He[t]={}),o(a,{isRTL:r.isRTL,weekNumberTitle:r.weekHeader,titleFormat:{month:r.showMonthAfterYear?"YYYY["+r.yearSuffix+"] MMMM":"MMMM YYYY["+r.yearSuffix+"]"},defaultButtonText:{prev:H(r.prevText),next:H(r.nextText),today:H(r.currentText)}}),e.datepicker&&(e.datepicker.regional[n]=e.datepicker.regional[t]=r,e.datepicker.regional.en=e.datepicker.regional[""],e.datepicker.setDefaults(r))},Oe.lang=function(e,t){var n;t&&(n=He[e],n||(n=He[e]={}),o(n,t||{})),_e.lang=e},Oe.sourceNormalizers=[],Oe.sourceFetchers=[];var Ae={dataType:"json",cache:!1},We=1;Oe.applyAll=A;var Ye=["sun","mon","tue","wed","thu","fri","sat"],Le=/^\s*\d{4}-\d\d$/,Ze=/^\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+)?)?)?)?)?$/;Oe.moment=function(){return Y(arguments)},Oe.moment.utc=function(){var e=Y(arguments,!0);return e.hasTime()&&e.utc(),e},Oe.moment.parseZone=function(){return Y(arguments,!0,!0)},L.prototype=f(t.fn),L.prototype.clone=function(){return Y([this])},L.prototype.time=function(e){if(null==e)return t.duration({hours:this.hours(),minutes:this.minutes(),seconds:this.seconds(),milliseconds:this.milliseconds()});delete this._ambigTime,t.isDuration(e)||t.isMoment(e)||(e=t.duration(e));var n=0;return t.isDuration(e)&&(n=24*Math.floor(e.asDays())),this.hours(n+e.hours()).minutes(e.minutes()).seconds(e.seconds()).milliseconds(e.milliseconds())},L.prototype.stripTime=function(){var e=this.toArray();return t.fn.utc.call(this),this.year(e[0]).month(e[1]).date(e[2]).hours(0).minutes(0).seconds(0).milliseconds(0),this._ambigTime=!0,this._ambigZone=!0,this},L.prototype.hasTime=function(){return!this._ambigTime},L.prototype.stripZone=function(){var e=this.toArray(),n=this._ambigTime;return t.fn.utc.call(this),this.year(e[0]).month(e[1]).date(e[2]).hours(e[3]).minutes(e[4]).seconds(e[5]).milliseconds(e[6]),n&&(this._ambigTime=!0),this._ambigZone=!0,this},L.prototype.hasZone=function(){return!this._ambigZone},L.prototype.utcOffset=function(e){return null!=e&&(delete this._ambigTime,delete this._ambigZone),t.fn.utcOffset.apply(this,arguments)},L.prototype.local=function(){var e=this.toArray(),n=this._ambigZone;return delete this._ambigTime,delete this._ambigZone,t.fn.local.apply(this,arguments),n&&this.year(e[0]).month(e[1]).date(e[2]).hours(e[3]).minutes(e[4]).seconds(e[5]).milliseconds(e[6]),this},L.prototype.utc=function(){return delete this._ambigTime,delete this._ambigZone,t.fn.utc.apply(this,arguments)},L.prototype.format=function(){return arguments[0]?P(this,arguments[0]):this._ambigTime?B(this,"YYYY-MM-DD"):this._ambigZone?B(this,"YYYY-MM-DD[T]HH:mm:ss"):B(this)},L.prototype.toISOString=function(){return this._ambigTime?B(this,"YYYY-MM-DD"):this._ambigZone?B(this,"YYYY-MM-DD[T]HH:mm:ss"):t.fn.toISOString.apply(this,arguments)},L.prototype.isWithin=function(e,t){var n=Z([this,e,t]);return n[0]>=n[1]&&n[0]