mirror of
https://github.com/OpenXE-org/OpenXE.git
synced 2024-11-14 20:17:14 +01:00
1 line
49 KiB
JavaScript
1 line
49 KiB
JavaScript
!function(t,e){var n,r={defaultView:"month",aspectRatio:1.35,header:{left:"title",center:"",right:"today prev,next"},weekends:!0,weekNumbers:!1,weekNumberCalculation:"iso",weekNumberTitle:"W",allDayDefault:!0,ignoreTimezone:!0,lazyFetching:!0,startParam:"start",endParam:"end",titleFormat:{month:"MMMM yyyy",week:"MMM d[ yyyy]{ '—'[ MMM] d yyyy}",day:"dddd, MMM d, yyyy"},columnFormat:{month:"ddd",week:"ddd M/d",day:"dddd M/d"},timeFormat:{"":"h(:mm)t"},isRTL:!1,firstDay:0,monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],buttonText:{prev:"<span class='fc-text-arrow'>‹</span>",next:"<span class='fc-text-arrow'>›</span>",prevYear:"<span class='fc-text-arrow'>«</span>",nextYear:"<span class='fc-text-arrow'>»</span>",today:"today",month:"month",week:"week",day:"day"},theme:!1,buttonIcons:{prev:"circle-triangle-w",next:"circle-triangle-e"},unselectAuto:!0,dropAccept:"*",handleWindowResize:!0},a={header:{left:"next,prev today",center:"",right:"title"},buttonText:{prev:"<span class='fc-text-arrow'>›</span>",next:"<span class='fc-text-arrow'>‹</span>",prevYear:"<span class='fc-text-arrow'>»</span>",nextYear:"<span class='fc-text-arrow'>«</span>"},buttonIcons:{prev:"circle-triangle-e",next:"circle-triangle-w"}},o=t.fullCalendar={version:"1.6.7"},i=o.views={};function s(e){t.extend(!0,r,e)}function l(n,r,a){var s=this;s.options=r,s.render=function(e){v?W()&&(Y(),P(e)):function(){r.theme?"ui":"fc",n.addClass("fc"),r.isRTL?n.addClass("fc-rtl"):n.addClass("fc-ltr");r.theme&&n.addClass("ui-widget");v=t("<div class='fc-content' style='position:relative'/>").prependTo(n),l=new c(s,r),(d=l.render())&&n.prepend(d);O(r.defaultView),r.handleWindowResize&&t(window).resize(j);A()||z()}()},s.destroy=function(){h&&(K("viewDestroy",h,h,h.element),h.triggerEventDestroy());t(window).unbind("resize",j),l.destroy(),v.remove(),n.removeClass("fc fc-rtl ui-widget")},s.refetchEvents=function(){U(),Z()},s.reportEvents=function(t){N=t,X()},s.reportEventChange=function(t){I(t)},s.rerenderEvents=I,s.changeView=O,s.select=function(t,n,r){h.select(t,n,r===e||r)},s.unselect=G,s.prev=function(){_(-1)},s.next=function(){_(1)},s.prevYear=function(){p(R,-1),_()},s.nextYear=function(){p(R,1),_()},s.today=function(){R=new Date,_()},s.gotoDate=function(t,e,n){t instanceof Date?R=C(t):S(R,t,e,n);_()},s.incrementDate=function(t,n,r){t!==e&&p(R,t);n!==e&&m(R,n);r!==e&&y(R,r);_()},s.formatDate=function(t,e){return H(t,e,r)},s.formatDates=function(t,e,n){return F(t,e,n,r)},s.getDate=function(){return C(R)},s.getView=function(){return h},s.option=function(t,n){if(n===e)return r[t];"height"!=t&&"contentHeight"!=t&&"aspectRatio"!=t||(r[t]=n,q())},s.trigger=K,function(n,r){var a=this;a.isFetchNeeded=function(t,e){return!i||t<i||e>s},a.fetchEvents=function(t,e){i=t,s=e,y=[];var n=++g,r=h.length;p=r;for(var a=0;a<r;a++)b(h[a],n)},a.addEventSource=function(t){(t=D(t))&&(p++,b(t,g))},a.removeEventSource=function(e){h=t.grep(h,function(t){return!x(t,e)}),y=t.grep(y,function(t){return!x(t.source,e)}),d(y)},a.updateEvent=function(t){var e,n,r=y.length,a=c().defaultEventEnd,o=t.start-t._start,i=t.end?t.end-(t._end||a(t)):0;for(e=0;e<r;e++)(n=y[e])._id==t._id&&n!=t&&(n.start=new Date(+n.start+o),t.end?n.end?n.end=new Date(+n.end+i):n.end=new Date(+a(n)+i):n.end=null,n.title=t.title,n.url=t.url,n.allDay=t.allDay,n.className=t.className,n.editable=t.editable,n.color=t.color,n.backgroundColor=t.backgroundColor,n.borderColor=t.borderColor,n.textColor=t.textColor,S(n));S(t),d(y)},a.renderEvent=function(t,e){S(t),t.source||(e&&(v.events.push(t),t.source=v),y.push(t));d(y)},a.removeEvents=function(e){if(e){if(!t.isFunction(e)){var n=e+"";e=function(t){return t._id==n}}y=t.grep(y,e,!0);for(var r=0;r<h.length;r++)t.isArray(h[r].events)&&(h[r].events=t.grep(h[r].events,e,!0))}else{y=[];for(var r=0;r<h.length;r++)t.isArray(h[r].events)&&(h[r].events=[])}d(y)},a.clientEvents=function(e){if(t.isFunction(e))return t.grep(y,e);if(e)return e+="",t.grep(y,function(t){return t._id==e});return y},a.normalizeEvent=S;for(var i,s,l=a.trigger,c=a.getView,d=a.reportEvents,v={events:[]},h=[v],g=0,p=0,m=0,y=[],w=0;w<r.length;w++)D(r[w]);function b(e,r){!function e(r,a){var l;var c=o.sourceFetchers;var f;for(l=0;l<c.length;l++){if(!0===(f=c[l](r,i,s,a)))return;if("object"==typeof f)return void e(f,a)}var d=r.events;if(d)t.isFunction(d)?(M(),d(C(i),C(s),function(t){a(t),E()})):t.isArray(d)?a(d):a();else{var v=r.url;if(v){var h,g=r.success,p=r.error,m=r.complete;h=t.isFunction(r.data)?r.data():r.data;var y=t.extend({},h||{}),w=V(r.startParam,n.startParam),b=V(r.endParam,n.endParam);w&&(y[w]=Math.round(+i/1e3)),b&&(y[b]=Math.round(+s/1e3)),M(),t.ajax(t.extend({},u,r,{data:y,success:function(e){e=e||[];var n=J(g,this,arguments);t.isArray(n)&&(e=n),a(e)},error:function(){J(p,this,arguments),a()},complete:function(){J(m,this,arguments),E()}}))}else a()}}(e,function(a){if(r==g){if(a){n.eventDataTransform&&(a=t.map(a,n.eventDataTransform)),e.eventDataTransform&&(a=t.map(a,e.eventDataTransform));for(var o=0;o<a.length;o++)a[o].source=e,S(a[o]);y=y.concat(a)}--p||d(y)}})}function D(e){if(t.isFunction(e)||t.isArray(e)?e={events:e}:"string"==typeof e&&(e={url:e}),"object"==typeof e)return function(t){t.className?"string"==typeof t.className&&(t.className=t.className.split(/\s+/)):t.className=[];for(var e=o.sourceNormalizers,n=0;n<e.length;n++)e[n](t)}(e),h.push(e),e}function M(){m++||l("loading",null,!0,c())}function E(){--m||l("loading",null,!1,c())}function S(t){var r=t.source||{},a=V(r.ignoreTimezone,n.ignoreTimezone);t._id=t._id||(t.id===e?"_fc"+f++:t.id+""),t.date&&(t.start||(t.start=t.date),delete t.date),t._start=C(t.start=T(t.start,a)),t.end=T(t.end,a),t.end&&t.end<=t.start&&(t.end=null),t._end=t.end?C(t.end):null,t.allDay===e&&(t.allDay=V(r.allDayDefault,n.allDayDefault)),t.className?"string"==typeof t.className&&(t.className=t.className.split(/\s+/)):t.className=[]}function x(t,e){return t&&e&&k(t)==k(e)}function k(t){return("object"==typeof t?t.googleCalendarId||t.events||t.url:"")||t}}.call(s,r,a);var l,d,v,h,g,w,b,D=s.isFetchNeeded,M=s.fetchEvents,E=n[0],x=0,k=0,R=new Date,N=[];function z(){setTimeout(function(){!h.start&&A()&&_()},0)}function W(){return n.is(":visible")}function A(){return t("body").is(":visible")}function O(e){h&&e==h.name||function(e){k++,h&&(K("viewDestroy",h,h,h.element),G(),h.triggerEventDestroy(),$(),h.element.remove(),l.deactivateButton(h.name));l.activateButton(e),h=new i[e](t("<div class='fc-view fc-view-"+e+"' style='position:relative'/>").appendTo(v),s),_(),Q(),k--}(e)}function _(t){(!h.start||t||R<h.start||R>=h.end)&&W()&&P(t)}function P(t){var e;k++,h.start&&(K("viewDestroy",h,h,h.element),G(),U()),$(),h.render(R,t||0),B(),Q(),(h.afterRender||function(){})(),l.updateTitle(h.title),(e=new Date)>=h.start&&e<h.end?l.disableButton("today"):l.enableButton("today"),K("viewRender",h,h,h.element),h.trigger("viewDisplay",E),k--,!r.lazyFetching||D(h.visStart,h.visEnd)?Z():X()}function q(){W()&&(G(),U(),Y(),B(),X())}function Y(){w=r.contentHeight?r.contentHeight:r.height?r.height-(d?d.height():0)-L(v):Math.round(v.width()/Math.max(r.aspectRatio,.5))}function B(){w===e&&Y(),k++,h.setHeight(w),h.setWidth(v.width()),k--,g=n.outerWidth()}function j(){if(!k)if(h.start){var t=++x;setTimeout(function(){t==x&&!k&&W()&&g!=(g=n.outerWidth())&&(k++,q(),h.trigger("windowResize",E),k--)},200)}else z()}function I(t){U(),X(t)}function X(t){W()&&(h.setEventData(N),h.renderEvents(N,t),h.trigger("eventAfterAllRender"))}function U(){h.triggerEventDestroy(),h.clearEvents(),h.clearEventData()}function Z(){M(h.visStart,h.visEnd)}function G(){h&&h.unselect()}function $(){v.css({width:"100%",height:v.height(),overflow:"hidden"})}function Q(){v.css({width:"",height:"",overflow:""})}function K(t,e){if(r[t])return r[t].apply(e||E,Array.prototype.slice.call(arguments,2))}S(R,r.year,r.month,r.date),r.droppable&&t(document).bind("dragstart",function(e,n){var a=e.target,o=t(a);if(!o.parents(".fc").length){var i=r.dropAccept;(t.isFunction(i)?i.call(a,o):o.is(i))&&(b=a,h.dragStart(b,e,n))}}).bind("dragstop",function(t,e){b&&(h.dragStop(b,t,e),b=null)})}function c(e,n){var r=this;r.render=function(){if(a=n.theme?"ui":"fc",n.header)return o=t("<table class='fc-header' style='width:100%'/>").append(t("<tr/>").append(s("left")).append(s("center")).append(s("right")))},r.destroy=function(){o.remove()},r.updateTitle=function(t){o.find("h2").html(t)},r.activateButton=function(t){o.find("span.fc-button-"+t).addClass(a+"-state-active")},r.deactivateButton=function(t){o.find("span.fc-button-"+t).removeClass(a+"-state-active")},r.disableButton=function(t){o.find("span.fc-button-"+t).addClass(a+"-state-disabled")},r.enableButton=function(t){o.find("span.fc-button-"+t).removeClass(a+"-state-disabled")};var a,o=t([]);function s(r){var o=t("<td class='fc-header-"+r+"'/>"),s=n.header[r];return s&&t.each(s.split(" "),function(r){var s;r>0&&o.append("<span class='fc-header-space'/>"),t.each(this.split(","),function(r,l){var c;if("title"==l)o.append("<span class='fc-header-title'><h2> </h2></span>"),s&&s.addClass(a+"-corner-right"),s=null;else if(e[l]?c=e[l]:i[l]&&(c=function(){d.removeClass(a+"-state-hover"),e.changeView(l)}),c){var u=n.theme?Y(n.buttonIcons,l):null,f=Y(n.buttonText,l),d=t("<span class='fc-button fc-button-"+l+" "+a+"-state-default'>"+(u?"<span class='fc-icon-wrap'><span class='ui-icon ui-icon-"+u+"'/></span>":f)+"</span>").click(function(){d.hasClass(a+"-state-disabled")||c()}).mousedown(function(){d.not("."+a+"-state-active").not("."+a+"-state-disabled").addClass(a+"-state-down")}).mouseup(function(){d.removeClass(a+"-state-down")}).hover(function(){d.not("."+a+"-state-active").not("."+a+"-state-disabled").addClass(a+"-state-hover")},function(){d.removeClass(a+"-state-hover").removeClass(a+"-state-down")}).appendTo(o);j(d),s||d.addClass(a+"-corner-left"),s=d}}),s&&s.addClass(a+"-corner-right")}),o}}t.fn.fullCalendar=function(o){if(n=t(this),"string"==typeof o){var i,s=Array.prototype.slice.call(arguments,1);return this.each(function(){var n=t.data(this,"fullCalendar");if(n&&t.isFunction(n[o])){var r=n[o].apply(n,s);i===e&&(i=r),"destroy"==o&&t.removeData(this,"fullCalendar")}}),i!==e?i:this}var c=(o=o||{}).eventSources||[];return delete o.eventSources,o.events&&(c.push(o.events),delete o.events),o=t.extend(!0,{},r,o.isRTL||o.isRTL===e&&r.isRTL?a:{},o),this.each(function(e,n){var r=t(n),a=new l(r,o,c);r.data("fullCalendar",a),a.render()}),this},o.sourceNormalizers=[],o.sourceFetchers=[];var u={dataType:"json",cache:!1},f=1;o.addDays=y,o.cloneDate=C,o.parseDate=T,o.parseISO8601=x,o.parseTime=k,o.formatDate=H,o.formatDates=F;var d=["sun","mon","tue","wed","thu","fri","sat"],v=864e5,h=36e5,g=6e4;function p(t,e,n){return t.setFullYear(t.getFullYear()+e),n||D(t),t}function m(t,e,n){if(+t){var r=t.getMonth()+e,a=C(t);for(a.setDate(1),a.setMonth(r),t.setMonth(r),n||D(t);t.getMonth()!=a.getMonth();)t.setDate(t.getDate()+(t<a?1:-1))}return t}function y(t,e,n){if(+t){var r=t.getDate()+e,a=C(t);a.setHours(9),a.setDate(r),t.setDate(r),n||D(t),w(t,a)}return t}function w(t,e){if(+t)for(;t.getDate()!=e.getDate();)t.setTime(+t+(t<e?1:-1)*h)}function b(t,e){return t.setMinutes(t.getMinutes()+e),t}function D(t){return t.setHours(0),t.setMinutes(0),t.setSeconds(0),t.setMilliseconds(0),t}function C(t,e){return e?D(new Date(+t)):new Date(+t)}function M(){var t,e=0;do{t=new Date(1970,e++,1)}while(t.getHours());return t}function E(t,e){return Math.round((C(t,!0)-C(e,!0))/v)}function S(t,n,r,a){n!==e&&n!=t.getFullYear()&&(t.setDate(1),t.setMonth(0),t.setFullYear(n)),r!==e&&r!=t.getMonth()&&(t.setDate(1),t.setMonth(r)),a!==e&&t.setDate(a)}function T(t,n){return"object"==typeof t?t:"number"==typeof t?new Date(1e3*t):"string"==typeof t?t.match(/^\d+(\.\d+)?$/)?new Date(1e3*parseFloat(t)):(n===e&&(n=!0),x(t,n)||(t?new Date(t):null)):null}function x(t,e){var n=t.match(/^([0-9]{4})(-([0-9]{2})(-([0-9]{2})([T ]([0-9]{2}):([0-9]{2})(:([0-9]{2})(\.([0-9]+))?)?(Z|(([-+])([0-9]{2})(:?([0-9]{2}))?))?)?)?)?$/);if(!n)return null;var r=new Date(n[1],0,1);if(e||!n[13]){var a=new Date(n[1],0,1,9,0);n[3]&&(r.setMonth(n[3]-1),a.setMonth(n[3]-1)),n[5]&&(r.setDate(n[5]),a.setDate(n[5])),w(r,a),n[7]&&r.setHours(n[7]),n[8]&&r.setMinutes(n[8]),n[10]&&r.setSeconds(n[10]),n[12]&&r.setMilliseconds(1e3*Number("0."+n[12])),w(r,a)}else if(r.setUTCFullYear(n[1],n[3]?n[3]-1:0,n[5]||1),r.setUTCHours(n[7]||0,n[8]||0,n[10]||0,n[12]?1e3*Number("0."+n[12]):0),n[14]){var o=60*Number(n[16])+(n[18]?Number(n[18]):0);o*="-"==n[15]?1:-1,r=new Date(+r+60*o*1e3)}return r}function k(t){if("number"==typeof t)return 60*t;if("object"==typeof t)return 60*t.getHours()+t.getMinutes();var e=t.match(/(\d+)(?::(\d+))?\s*(\w+)?/);if(e){var n=parseInt(e[1],10);return e[3]&&(n%=12,"p"==e[3].toLowerCase().charAt(0)&&(n+=12)),60*n+(e[2]?parseInt(e[2],10):0)}}function H(t,e,n){return F(t,null,e,n)}function F(t,e,n,a){a=a||r;var o,i,s,l,c=t,u=e,f=n.length,d="";for(o=0;o<f;o++)if("'"==(i=n.charAt(o))){for(s=o+1;s<f;s++)if("'"==n.charAt(s)){c&&(d+=s==o+1?"'":n.substring(o+1,s),o=s);break}}else if("("==i){for(s=o+1;s<f;s++)if(")"==n.charAt(s)){var v=H(c,n.substring(o+1,s),a);parseInt(v.replace(/\D/,""),10)&&(d+=v),o=s;break}}else if("["==i){for(s=o+1;s<f;s++)if("]"==n.charAt(s)){var h=n.substring(o+1,s);(v=H(c,h,a))!=H(u,h,a)&&(d+=v),o=s;break}}else if("{"==i)c=e,u=t;else if("}"==i)c=t,u=e;else{for(s=f;s>o;s--)if(l=R[n.substring(o,s)]){c&&(d+=l(c,a)),o=s-1;break}s==o&&c&&(d+=i)}return d}var R={s:function(t){return t.getSeconds()},ss:function(t){return q(t.getSeconds())},m:function(t){return t.getMinutes()},mm:function(t){return q(t.getMinutes())},h:function(t){return t.getHours()%12||12},hh:function(t){return q(t.getHours()%12||12)},H:function(t){return t.getHours()},HH:function(t){return q(t.getHours())},d:function(t){return t.getDate()},dd:function(t){return q(t.getDate())},ddd:function(t,e){return e.dayNamesShort[t.getDay()]},dddd:function(t,e){return e.dayNames[t.getDay()]},M:function(t){return t.getMonth()+1},MM:function(t){return q(t.getMonth()+1)},MMM:function(t,e){return e.monthNamesShort[t.getMonth()]},MMMM:function(t,e){return e.monthNames[t.getMonth()]},yy:function(t){return(t.getFullYear()+"").substring(2)},yyyy:function(t){return t.getFullYear()},t:function(t){return t.getHours()<12?"a":"p"},tt:function(t){return t.getHours()<12?"am":"pm"},T:function(t){return t.getHours()<12?"A":"P"},TT:function(t){return t.getHours()<12?"AM":"PM"},u:function(t){return H(t,"yyyy-MM-dd'T'HH:mm:ss'Z'")},S:function(t){var e=t.getDate();return e>10&&e<20?"th":["st","nd","rd"][e%10-1]||"th"},w:function(t,e){return e.weekNumberCalculation(t)},W:function(t){return(n=new Date(t.getTime())).setDate(n.getDate()+4-(n.getDay()||7)),e=n.getTime(),n.setMonth(0),n.setDate(1),Math.floor(Math.round((e-n)/864e5)/7)+1;var e,n}};function N(t){return t.end?(e=t.end,n=t.allDay,e=C(e),n||e.getHours()||e.getMinutes()?y(e,1):D(e)):y(C(t.start),1);var e,n}function z(n,r,a){n.unbind("mouseover").mouseover(function(n){for(var o,i,s,l=n.target;l!=this;)o=l,l=l.parentNode;(i=o._fci)!==e&&(o._fci=e,s=r[i],a(s.event,s.element,s),t(n.target).trigger(n)),n.stopPropagation()})}function W(e,n,r){for(var a,o=0;o<e.length;o++)(a=t(e[o])).width(Math.max(0,n-O(a,r)))}function A(e,n,r){for(var a,o=0;o<e.length;o++)(a=t(e[o])).height(Math.max(0,n-L(a,r)))}function O(e,n){return function(e){return(parseFloat(t.css(e[0],"paddingLeft",!0))||0)+(parseFloat(t.css(e[0],"paddingRight",!0))||0)}(e)+function(e){return(parseFloat(t.css(e[0],"borderLeftWidth",!0))||0)+(parseFloat(t.css(e[0],"borderRightWidth",!0))||0)}(e)+(n?function(e){return(parseFloat(t.css(e[0],"marginLeft",!0))||0)+(parseFloat(t.css(e[0],"marginRight",!0))||0)}(e):0)}function L(e,n){return function(e){return(parseFloat(t.css(e[0],"paddingTop",!0))||0)+(parseFloat(t.css(e[0],"paddingBottom",!0))||0)}(e)+function(e){return(parseFloat(t.css(e[0],"borderTopWidth",!0))||0)+(parseFloat(t.css(e[0],"borderBottomWidth",!0))||0)}(e)+(n?function(e){return(parseFloat(t.css(e[0],"marginTop",!0))||0)+(parseFloat(t.css(e[0],"marginBottom",!0))||0)}(e):0)}function _(t,e){return t-e}function P(t){return Math.max.apply(Math,t)}function q(t){return(t<10?"0":"")+t}function Y(t,n){if(t[n]!==e)return t[n];for(var r,a=n.split(/(?=[A-Z])/),o=a.length-1;o>=0;o--)if((r=t[a[o].toLowerCase()])!==e)return r;return t[""]}function B(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/'/g,"'").replace(/"/g,""").replace(/\n/g,"<br />")}function j(t){t.attr("unselectable","on").css("MozUserSelect","none").bind("selectstart.ui",function(){return!1})}function I(t){t.children().removeClass("fc-first fc-last").filter(":first-child").addClass("fc-first").end().filter(":last-child").addClass("fc-last")}function X(t,e){var n=t.source||{},r=t.color,a=n.color,o=e("eventColor"),i=t.backgroundColor||r||n.backgroundColor||a||e("eventBackgroundColor")||o,s=t.borderColor||r||n.borderColor||a||e("eventBorderColor")||o,l=t.textColor||n.textColor||e("eventTextColor"),c=[];return i&&c.push("background-color:"+i),s&&c.push("border-color:"+s),l&&c.push("color:"+l),c.join(";")}function J(e,n,r){if(t.isFunction(e)&&(e=[e]),e){var a,o;for(a=0;a<e.length;a++)o=e[a].apply(n,r)||o;return o}}function V(){for(var t=0;t<arguments.length;t++)if(arguments[t]!==e)return arguments[t]}function U(e,n,r){var a=this;a.renderBasic=function(n,r,p){b=n,M=r,E=p,F=O("theme")?"ui":"fc",R=O("columnFormat"),N=O("weekNumbers"),z=O("weekNumberTitle"),A="iso"!=O("weekNumberCalculation")?"w":"W",l||(g=t("<div class='fc-event-container' style='position:absolute;z-index:8;top:0;left:0'/>").appendTo(e));!function(){var n="<table class='fc-border-separate' style='width:100%' cellspacing='0'>"+function(){var t,e,n=F+"-widget-header",r="";for(r+="<thead><tr>",N&&(r+="<th class='fc-week-number "+n+"'>"+B(z)+"</th>"),t=0;t<M;t++)e=X(0,t),r+="<th class='fc-day-header fc-"+d[e.getDay()]+" "+n+"'>"+B(U(e,R))+"</th>";return r+="</tr></thead>"}()+function(){var t,e,n,r=F+"-widget-content",a="";for(a+="<tbody>",t=0;t<b;t++){for(a+="<tr class='fc-week'>",N&&(n=X(t,0),a+="<td class='fc-week-number "+r+"'><div>"+B(U(n,A))+"</div></td>"),e=0;e<M;e++)n=X(t,e),a+=Z(n);a+="</tr>"}return a+="</tbody>"}()+"</table>";o&&o.remove();o=t(n).appendTo(e),i=o.find("thead"),s=i.find(".fc-day-header"),l=o.find("tbody"),c=l.find("tr"),u=l.find(".fc-day"),f=c.find("td:first-child"),v=c.eq(0).find(".fc-day > div"),h=c.eq(0).find(".fc-day-content > div"),I(i.add(i.find("tr"))),I(c),c.eq(0).addClass("fc-first"),c.filter(":last").addClass("fc-last"),u.each(function(e,n){var r=X(Math.floor(e/M),e%M);_("dayRender",a,r,t(n))}),G(u)}()},a.setHeight=function(e){var n,r,a,o=e-i.height();"variable"==O("weekMode")?n=r=Math.floor(o/(1==b?2:6)):(n=Math.floor(o/b),r=o-n*(b-1));f.each(function(e,o){e<b&&(a=t(o)).find("> div").css("min-height",(e==b-1?r:n)-L(a))})},a.setWidth=function(t){p=t,k.clear(),H.clear(),w=0,N&&(w=i.find("th.fc-week-number").outerWidth());m=Math.floor((p-w)/M),W(s.slice(0,-1),m)},a.renderDayOverlay=Q,a.defaultSelectionEnd=function(t,e){return C(t)},a.renderSelection=function(t,e,n){Q(t,y(C(e),1),!0)},a.clearSelection=function(){q()},a.reportDayClick=function(t,e,n){var r=J(t),a=u[r.row*M+r.col];_("dayClick",a,t,e,n)},a.dragStart=function(t,e,n){T.start(function(t){q(),t&&K(t.row,t.col,t.row,t.col)},e)},a.dragStop=function(t,e,n){var r=T.stop();if(q(),r){var a=X(r);_("drop",t,a,!0,e,n)}},a.defaultEventEnd=function(t){return C(t.start)},a.getHoverListener=function(){return T},a.colLeft=function(t){return k.left(t)},a.colRight=function(t){return k.right(t)},a.colContentLeft=function(t){return H.left(t)},a.colContentRight=function(t){return H.right(t)},a.getIsCellAllDay=function(){return!0},a.allDayRow=function(t){return c.eq(t)},a.getRowCnt=function(){return b},a.getColCnt=function(){return M},a.getColWidth=function(){return m},a.getDaySegmentContainer=function(){return g},nt.call(a,e,n,r),lt.call(a),st.call(a),function(){var t=this;t.renderEvents=function(e,n){t.renderDayEvents(e,n)},t.clearEvents=function(){t.getDaySegmentContainer().empty()},rt.call(t)}.call(a);var o,i,s,l,c,u,f,v,h,g,p,m,w,b,M,E,S,T,k,H,F,R,N,z,A,O=a.opt,_=a.trigger,P=a.renderOverlay,q=a.clearOverlays,Y=a.daySelectionMousedown,X=a.cellToDate,J=a.dateToCell,V=a.rangeToSegments,U=n.formatDate;function Z(t){var e=F+"-widget-content",n=a.start.getMonth(),r=D(new Date),o="",i=["fc-day","fc-"+d[t.getDay()],e];return t.getMonth()!=n&&i.push("fc-other-month"),+t==+r?i.push("fc-today",F+"-state-highlight"):t<r?i.push("fc-past"):i.push("fc-future"),o+="<td class='"+i.join(" ")+"' data-date='"+U(t,"yyyy-MM-dd")+"'><div>",E&&(o+="<div class='fc-day-number'>"+t.getDate()+"</div>"),o+="<div class='fc-day-content'><div style='position:relative'> </div></div></div></td>"}function G(t){t.click($).mousedown(Y)}function $(e){if(!O("selectable")){var n=x(t(this).data("date"));_("dayClick",this,n,!0,e)}}function Q(t,e,n){n&&S.build();for(var r=V(t,e),a=0;a<r.length;a++){var o=r[a];G(K(o.row,o.leftCol,o.row,o.rightCol))}}function K(t,n,r,a){var o=S.rect(t,n,r,a,e);return P(o,e)}j(e.addClass("fc-grid")),S=new ct(function(e,n){var r,a,o;s.each(function(e,i){r=t(i),a=r.offset().left,e&&(o[1]=a),o=[a],n[e]=o}),o[1]=a+r.outerWidth(),c.each(function(n,i){n<b&&(r=t(i),a=r.offset().top,n&&(o[1]=a),o=[a],e[n]=o)}),o[1]=a+r.outerHeight()}),T=new ut(S),k=new ft(function(t){return v.eq(t)}),H=new ft(function(t){return h.eq(t)})}function Z(n,r,a){var o=this;o.renderAgenda=function(e){K=e,vt=Dt("theme")?"ui":"fc",ht=Dt("isRTL"),gt=k(Dt("minTime")),pt=k(Dt("maxTime")),mt=Dt("columnFormat"),yt=Dt("weekNumbers"),wt=Dt("weekNumberTitle"),bt="iso"!=Dt("weekNumberCalculation")?"w":"W",Z=Dt("snapMinutes")||Dt("slotMinutes"),i?Wt():function(){var e,r,a,o,i,s=vt+"-widget-header",l=vt+"-widget-content",c=Dt("slotMinutes")%15==0;Wt(),m=t("<div style='position:absolute;z-index:2;left:0;width:100%'/>").appendTo(n),Dt("allDaySlot")?(w=t("<div class='fc-event-container' style='position:absolute;z-index:8;top:0;left:0'/>").appendTo(m),e="<table style='width:100%' class='fc-agenda-allday' cellspacing='0'><tr><th class='"+s+" fc-agenda-axis'>"+Dt("allDayText")+"</th><td><div class='fc-day-content'><div style='position:relative'/></div></td><th class='"+s+" fc-agenda-gutter'> </th></tr></table>",S=t(e).appendTo(m),At((T=S.find("tr")).find("td")),m.append("<div class='fc-agenda-divider "+s+"'><div class='fc-agenda-divider-inner'/></div>")):w=t([]);for(x=t("<div style='position:absolute;width:100%;overflow-x:hidden;overflow-y:auto'/>").appendTo(m),H=t("<div style='position:relative;width:100%;overflow:hidden'/>").appendTo(x),F=t("<div class='fc-event-container' style='position:absolute;z-index:8;top:0;left:0'/>").appendTo(H),e="<table class='fc-agenda-slots' style='width:100%' cellspacing='0'><tbody>",r=M(),o=b(C(r),pt),b(r,gt),tt=0,a=0;r<o;a++)i=r.getMinutes(),e+="<tr class='fc-slot"+a+" "+(i?"fc-minor":"")+"'><th class='fc-agenda-axis "+s+"'>"+(c&&i?" ":Nt(r,Dt("axisFormat")))+"</th><td class='"+l+"'><div style='position:relative'> </div></td></tr>",b(r,Dt("slotMinutes")),tt++;Ot((R=t(e+="</tbody></table>").appendTo(H)).find("td"))}()},o.setWidth=function(e){e,it.clear(),dt.clear();var n=s.find("th:first");S&&(n=n.add(S.find("th:first")));n=n.add(R.find("th:first")),Y=0,W(n.width("").each(function(e,n){Y=Math.max(Y,t(n).outerWidth())}),Y);var r=i.find(".fc-agenda-gutter");S&&(r=r.add(S.find("th.fc-agenda-gutter")));var a=x[0].clientWidth;(V=x.width()-a)?(W(r,V),r.show().prev().removeClass("fc-last")):r.hide().prev().addClass("fc-last");J=Math.floor((a-Y)/K),W(l.slice(0,-1),J)},o.setHeight=function(t){t===e&&(t=q);q=t,zt={};var n=c.position().top,r=x.position().top,a=Math.min(t-n,R.height()+r+1);p.height(a-L(h)),m.css("top",n),x.height(a-r-1),U=R.find("tr:first").height()+1,$=Dt("slotMinutes")/Z,Q=U/$},o.afterRender=function(){!function(){var t=M(),e=C(t);e.setHours(Dt("firstHour"));var n=jt(t,e)+1;function r(){x.scrollTop(n)}r(),setTimeout(r,0)}()},o.defaultEventEnd=function(t){var e=C(t.start);if(t.allDay)return e;return b(e,Dt("defaultEventMinutes"))},o.timePosition=jt,o.getIsCellAllDay=Yt,o.allDayRow=function(t){return T},o.getCoordinateGrid=function(){return at},o.getHoverListener=function(){return ot},o.colLeft=function(t){return it.left(t)},o.colRight=function(t){return it.right(t)},o.colContentLeft=function(t){return dt.left(t)},o.colContentRight=function(t){return dt.right(t)},o.getDaySegmentContainer=function(){return w},o.getSlotSegmentContainer=function(){return F},o.getMinMinute=function(){return gt},o.getMaxMinute=function(){return pt},o.getSlotContainer=function(){return H},o.getRowCnt=function(){return 1},o.getColCnt=function(){return K},o.getColWidth=function(){return J},o.getSnapHeight=function(){return Q},o.getSnapMinutes=function(){return Z},o.defaultSelectionEnd=function(t,e){if(e)return C(t);return b(C(t),Dt("slotMinutes"))},o.renderDayOverlay=_t,o.renderSelection=function(t,e,n){n?Dt("allDaySlot")&&_t(t,y(C(e),1),!0):It(t,e)},o.clearSelection=Xt,o.reportDayClick=Vt,o.dragStart=function(t,e,n){ot.start(function(t){if(Et(),t)if(Yt(t))Pt(t.row,t.col,t.row,t.col);else{var e=Bt(t),n=b(C(e),Dt("defaultEventMinutes"));qt(e,n)}},e)},o.dragStop=function(t,e,n){var r=ot.stop();Et(),r&&Ct("drop",t,Bt(r),Yt(r),e,n)},nt.call(o,n,r,a),lt.call(o),st.call(o),function(){var n=this;n.renderEvents=function(n,o){var i,s=n.length,l=[],u=[];for(i=0;i<s;i++)n[i].allDay?l.push(n[i]):u.push(n[i]);r("allDaySlot")&&(j(l,o),c());!function(n,o){var i,s,l,c,u,d,v,h,g,m,y,b,C,M,E,S,T=n.length,x="",k=f(),H=r("isRTL");for(i=0;i<T;i++)s=n[i],l=s.event,c=p(s.start,s.start),u=p(s.start,s.end),d=w(s.col),v=D(s.col),g=(h=(v-=.025*(h=v-d))-d)*(s.forwardCoord-s.backwardCoord),r("slotEventOverlap")&&(g=Math.max(2*(g-10),g)),H?(y=v-s.backwardCoord*h,m=y-g):(m=d+s.backwardCoord*h,y=m+g),m=Math.max(m,d),y=Math.min(y,v),g=y-m,s.top=c,s.left=m,s.outerWidth=g,s.outerHeight=u-c,x+=$(l,s);for(k[0].innerHTML=x,b=k.children(),i=0;i<T;i++)s=n[i],l=s.event,C=t(b[i]),!1===(M=a("eventRender",l,l,C))?C.remove():(M&&!0!==M&&(C.remove(),C=t(M).css({position:"absolute",top:s.top,left:s.left}).appendTo(k)),s.element=C,l._id===o?Q(l,C,s):C[0]._fci=i,F(l,C));for(z(k,n,Q),i=0;i<T;i++)s=n[i],(C=s.element)&&(s.vsides=L(C,!0),s.hsides=O(C,!0),(E=C.find(".fc-event-title")).length&&(s.contentTop=E[0].offsetTop));for(i=0;i<T;i++)s=n[i],(C=s.element)&&(C[0].style.width=Math.max(0,s.outerWidth-s.hsides)+"px",S=Math.max(0,s.outerHeight-s.vsides),C[0].style.height=S+"px",l=s.event,s.contentTop!==e&&S-s.contentTop<10&&(C.find("div.fc-event-time").text(J(l.start,r("timeFormat"))+" - "+l.title),C.find("div.fc-event-title").remove()),a("eventAfterRender",l,l,C))}(function(e){var n,r,a,o,i,s=S(),l=h(),c=v(),u=t.map(e,Z),f=[];for(r=0;r<s;r++)for(b(n=M(0,r),l),i=G(i=U(e,u,n,b(C(n),c-l))),a=0;a<i.length;a++)(o=i[a]).col=r,f.push(o);return f}(u),o)},n.clearEvents=function(){u().empty(),f().empty()},n.slotSegHtml=$,rt.call(n);var r=n.opt,a=n.trigger,o=n.isEventDraggable,i=n.isEventResizable,s=n.eventEnd,l=n.eventElementHandlers,c=n.setHeight,u=n.getDaySegmentContainer,f=n.getSlotSegmentContainer,d=n.getHoverListener,v=n.getMaxMinute,h=n.getMinMinute,p=n.timePosition,m=n.getIsCellAllDay,w=n.colContentLeft,D=n.colContentRight,M=n.cellToDate,S=n.getColCnt,T=n.getColWidth,x=n.getSnapHeight,k=n.getSnapMinutes,H=n.getSlotContainer,F=n.reportEventElement,R=n.showEvents,W=n.hideEvents,_=n.eventDrop,P=n.eventResize,q=n.renderDayOverlay,Y=n.clearOverlays,j=n.renderDayEvents,I=n.calendar,J=I.formatDate,V=I.formatDates;function U(t,e,n,r){var a,o,i,s,l,c,u,f,d=[],v=t.length;for(a=0;a<v;a++)o=t[a],i=o.start,(s=e[a])>n&&i<r&&(i<n?(l=C(n),u=!1):(l=i,u=!0),s>r?(c=C(r),f=!1):(c=s,f=!0),d.push({event:o,start:l,end:c,isStart:u,isEnd:f}));return d.sort(et)}function Z(t){return t.end?C(t.end):b(C(t.start),r("defaultEventMinutes"))}function $(t,e){var n="<",a=t.url,s=X(t,r),l=["fc-event","fc-event-vert"];return o(t)&&l.push("fc-event-draggable"),e.isStart&&l.push("fc-event-start"),e.isEnd&&l.push("fc-event-end"),l=l.concat(t.className),t.source&&(l=l.concat(t.source.className||[])),n+=a?"a href='"+B(t.url)+"'":"div",n+=" class='"+l.join(" ")+"' style='position:absolute;top:"+e.top+"px;left:"+e.left+"px;"+s+"'><div class='fc-event-inner'><div class='fc-event-time'>"+B(V(t.start,t.end,r("timeFormat")))+"</div><div class='fc-event-title'>"+B(t.title||"")+"</div></div><div class='fc-event-bg'></div>",e.isEnd&&i(t)&&(n+="<div class='ui-resizable-handle ui-resizable-s'>=</div>"),n+="</"+(a?"a":"div")+">"}function Q(t,e,c){var u=e.find("div.fc-event-time");o(t)&&function(t,e,o){var i,s,l,c,u,f,d,v,h,g,p,w=n.getCoordinateGrid(),D=S(),H=T(),F=x(),z=k();function A(){Y(),l&&(u?(o.hide(),e.draggable("option","grid",null),q(y(C(t.start),h),y(N(t),h))):(!function(e){var n,a=b(C(t.start),e);t.end&&(n=b(C(t.end),e));o.text(V(a,n,r("timeFormat")))}(g),o.css("display",""),e.draggable("option","grid",[H,F])))}e.draggable({scroll:!1,grid:[H,F],axis:1==D&&"y",opacity:r("dragOpacity"),revertDuration:r("dragRevertDuration"),start:function(n,r){a("eventDragStart",e,t,n,r),W(t,e),w.build(),i=e.position(),s=w.cell(n.pageX,n.pageY),l=c=!0,u=f=m(s),d=v=0,h=0,g=p=0},drag:function(t,n){var r=w.cell(t.pageX,t.pageY);if(l=!!r){if(u=m(r),(d=Math.round((n.position.left-i.left)/H))!=v){var a=M(0,s.col),o=s.col+d;o=Math.max(0,o),o=Math.min(D-1,o);var y=M(0,o);h=E(y,a)}u||(g=Math.round((n.position.top-i.top)/F)*z)}l==c&&u==f&&d==v&&g==p||(A(),c=l,f=u,v=d,p=g),e.draggable("option","revert",!l)},stop:function(n,r){Y(),a("eventDragStop",e,t,n,r),l&&(u||h||g)?_(this,t,h,u?0:g,u,n,r):(l=!0,u=!1,d=0,h=0,g=0,A(),e.css("filter",""),e.css(i),R(t,e))}})}(t,e,u),c.isEnd&&i(t)&&function(t,e,n){var o,i,l=x(),c=k();e.resizable({handles:{s:".ui-resizable-handle"},grid:l,start:function(n,r){o=i=0,W(t,e),a("eventResizeStart",this,t,n,r)},resize:function(a,u){(o=Math.round((Math.max(l,e.height())-u.originalSize.height)/l))!=i&&(n.text(V(t.start,o||t.end?b(s(t),c*o):null,r("timeFormat"))),i=o)},stop:function(n,r){a("eventResizeStop",this,t,n,r),o?P(this,t,0,c*o,n,r):R(t,e)}})}(t,e,u),l(t,e)}n.draggableDayEvent=function(t,e,n){var o,i,s,l=n.isStart,c=!0,u=d(),f=T(),v=x(),p=k(),m=h();function w(){c||(e.width(o).height("").draggable("option","grid",null),c=!0)}e.draggable({opacity:r("dragOpacity","month"),revertDuration:r("dragRevertDuration"),start:function(n,d){a("eventDragStart",e,t,n,d),W(t,e),o=e.width(),u.start(function(n,a){if(Y(),n){i=!1;var o=M(0,a.col),u=M(0,n.col);s=E(u,o),n.row?l?c&&(e.width(f-10),A(e,v*Math.round((t.end?(t.end-t.start)/g:r("defaultEventMinutes"))/p)),e.draggable("option","grid",[f,1]),c=!1):i=!0:(q(y(C(t.start),s),y(N(t),s)),w()),i=i||c&&!s}else w(),i=!0;e.draggable("option","revert",i)},n,"drag")},stop:function(n,r){if(u.stop(),Y(),a("eventDragStop",e,t,n,r),i)w(),e.css("filter",""),R(t,e);else{var o=0;c||(o=Math.round((e.offset().top-H().offset().top)/v)*p+m-(60*t.start.getHours()+t.start.getMinutes())),_(this,t,s,o,c,n,r)}}})}}.call(o);var i,s,l,c,u,f,v,h,p,m,w,S,T,x,H,F,R,P,q,Y,J,V,U,Z,$,Q,K,tt,at,ot,it,dt,vt,ht,gt,pt,mt,yt,wt,bt,Dt=o.opt,Ct=o.trigger,Mt=o.renderOverlay,Et=o.clearOverlays,St=o.reportSelection,Tt=o.unselect,xt=o.daySelectionMousedown,kt=o.slotSegHtml,Ht=o.cellToDate,Ft=o.dateToCell,Rt=o.rangeToSegments,Nt=r.formatDate,zt={};function Wt(){var e="<table style='width:100%' class='fc-agenda-days fc-border-separate' cellspacing='0'>"+function(){var t,e,n,r=vt+"-widget-header",a="";for(a+="<thead><tr>",yt?(t=Ht(0,0),e=Nt(t,bt),ht?e+=wt:e=wt+e,a+="<th class='fc-agenda-axis fc-week-number "+r+"'>"+B(e)+"</th>"):a+="<th class='fc-agenda-axis "+r+"'> </th>",n=0;n<K;n++)t=Ht(0,n),a+="<th class='fc-"+d[t.getDay()]+" fc-col"+n+" "+r+"'>"+B(Nt(t,mt))+"</th>";return a+="<th class='fc-agenda-gutter "+r+"'> </th></tr></thead>"}()+function(){var t,e,n,r,a,o=vt+"-widget-header",i=vt+"-widget-content",s=D(new Date),l="";for(l+="<tbody><tr><th class='fc-agenda-axis "+o+"'> </th>",n="",e=0;e<K;e++)t=Ht(0,e),a=["fc-col"+e,"fc-"+d[t.getDay()],i],+t==+s?a.push(vt+"-state-highlight","fc-today"):t<s?a.push("fc-past"):a.push("fc-future"),r="<td class='"+a.join(" ")+"'><div><div class='fc-day-content'><div style='position:relative'> </div></div></div></td>",n+=r;return l+=n,l+="<td class='fc-agenda-gutter "+i+"'> </td></tr></tbody>"}()+"</table>";i&&i.remove(),i=t(e).appendTo(n),s=i.find("thead"),l=s.find("th").slice(1,-1),c=i.find("tbody"),u=c.find("td").slice(0,-1),f=u.find("> div"),v=u.find(".fc-day-content > div"),h=u.eq(0),p=f.eq(0),I(s.add(s.find("tr"))),I(c.add(c.find("tr")))}function At(t){t.click(Lt).mousedown(xt)}function Ot(t){t.click(Lt).mousedown(Jt)}function Lt(t){if(!Dt("selectable")){var e=Math.min(K-1,Math.floor((t.pageX-i.offset().left-Y)/J)),n=Ht(0,e),r=this.parentNode.className.match(/fc-slot(\d+)/);if(r){var a=parseInt(r[1])*Dt("slotMinutes"),o=Math.floor(a/60);n.setHours(o),n.setMinutes(a%60+gt),Ct("dayClick",u[e],n,!1,t)}else Ct("dayClick",u[e],n,!0,t)}}function _t(t,e,n){n&&at.build();for(var r=Rt(t,e),a=0;a<r.length;a++){var o=r[a];At(Pt(o.row,o.leftCol,o.row,o.rightCol))}}function Pt(t,e,n,r){var a=at.rect(t,e,n,r,m);return Mt(a,m)}function qt(t,e){for(var n=0;n<K;n++){var r=Ht(0,n),a=y(C(r),1),o=new Date(Math.max(r,t)),i=new Date(Math.min(a,e));if(o<i){var s=at.rect(0,n,0,n,H),l=jt(r,o),c=jt(r,i);s.top=l,s.height=c-l,Ot(Mt(s,H))}}}function Yt(t){return Dt("allDaySlot")&&!t.row}function Bt(t){var e=Ht(0,t.col),n=t.row;return Dt("allDaySlot")&&n--,n>=0&&b(e,gt+n*Z),e}function jt(t,n){if(t=C(t,!0),n<b(C(t),gt))return 0;if(n>=b(C(t),pt))return R.height();var r=Dt("slotMinutes"),a=60*n.getHours()+n.getMinutes()-gt,o=Math.floor(a/r),i=zt[o];return i===e&&(i=zt[o]=R.find("tr").eq(o).find("td div")[0].offsetTop),Math.max(0,Math.round(i-1+U*(a%r/r)))}function It(e,n){var r=Dt("selectHelper");if(at.build(),r){var a=Ft(e).col;if(a>=0&&a<K){var o=at.rect(0,a,0,a,H),i=jt(e,e),s=jt(e,n);if(s>i){if(o.top=i,o.height=s-i,o.left+=2,o.width-=5,t.isFunction(r)){var l=r(e,n);l&&(o.position="absolute",P=t(l).css(o).appendTo(H))}else o.isStart=!0,o.isEnd=!0,(P=t(kt({title:"",start:e,end:n,className:["fc-select-helper"],editable:!1},o))).css("opacity",Dt("dragOpacity"));P&&(Ot(P),H.append(P),W(P,o.width,!0),A(P,o.height,!0))}}}else qt(e,n)}function Xt(){Et(),P&&(P.remove(),P=null)}function Jt(e){var n;1==e.which&&Dt("selectable")&&(Tt(e),ot.start(function(t,e){if(Xt(),t&&t.col==e.col&&!Yt(t)){var r=Bt(e),a=Bt(t);It((n=[r,b(C(r),Z),a,b(C(a),Z)].sort(_))[0],n[3])}else n=null},e),t(document).one("mouseup",function(t){ot.stop(),n&&(+n[0]==+n[1]&&Vt(n[0],!1,t),St(n[0],n[3],!1,t))}))}function Vt(t,e,n){Ct("dayClick",u[Ft(t).col],t,e,n)}j(n.addClass("fc-agenda")),at=new ct(function(e,n){var r,a,o;l.each(function(e,i){r=t(i),a=r.offset().left,e&&(o[1]=a),o=[a],n[e]=o}),o[1]=a+r.outerWidth(),Dt("allDaySlot")&&(a=(r=T).offset().top,e[0]=[a,a+r.outerHeight()]);var i=H.offset().top,s=x.offset().top,c=s+x.outerHeight();function u(t){return Math.max(s,Math.min(c,t))}for(var f=0;f<tt*$;f++)e.push([u(i+Q*f),u(i+Q*(f+1))])}),ot=new ut(at),it=new ft(function(t){return f.eq(t)}),dt=new ft(function(t){return v.eq(t)})}function G(t){var e,n=function(t){var e,n,r,a=[];for(e=0;e<t.length;e++){for(n=t[e],r=0;r<a.length&&K(n,a[r]).length;r++);(a[r]||(a[r]=[])).push(n)}return a}(t),r=n[0];if(function(t){var e,n,r,a,o;for(e=0;e<t.length;e++)for(n=t[e],r=0;r<n.length;r++)for((a=n[r]).forwardSegs=[],o=e+1;o<t.length;o++)K(a,t[o],a.forwardSegs)}(n),r){for(e=0;e<r.length;e++)$(r[e]);for(e=0;e<r.length;e++)Q(r[e],0,0)}return function(t){var e,n,r,a=[];for(e=0;e<t.length;e++)for(n=t[e],r=0;r<n.length;r++)a.push(n[r]);return a}(n)}function $(t){var n,r,a=t.forwardSegs,o=0;if(t.forwardPressure===e){for(n=0;n<a.length;n++)$(r=a[n]),o=Math.max(o,1+r.forwardPressure);t.forwardPressure=o}}function Q(t,n,r){var a,o=t.forwardSegs;if(t.forwardCoord===e)for(o.length?(o.sort(tt),Q(o[0],n+1,r),t.forwardCoord=o[0].backwardCoord):t.forwardCoord=1,t.backwardCoord=t.forwardCoord-(t.forwardCoord-r)/(n+1),a=0;a<o.length;a++)Q(o[a],0,t.forwardCoord)}function K(t,e,n){n=n||[];for(var r=0;r<e.length;r++)a=t,o=e[r],a.end>o.start&&a.start<o.end&&n.push(e[r]);var a,o;return n}function tt(t,e){return e.forwardPressure-t.forwardPressure||(t.backwardCoord||0)-(e.backwardCoord||0)||et(t,e)}function et(t,e){return t.start-e.start||e.end-e.start-(t.end-t.start)||(t.event.title||"").localeCompare(e.event.title)}function nt(n,r,a){var o=this;o.element=n,o.calendar=r,o.name=a,o.opt=v,o.trigger=h,o.isEventDraggable=function(t){var e=t.source||{};return V(t.startEditable,e.startEditable,v("eventStartEditable"),t.editable,e.editable,v("editable"))&&!v("disableDragging")},o.isEventResizable=function(t){var e=t.source||{};return V(t.durationEditable,e.durationEditable,v("eventDurationEditable"),t.editable,e.editable,v("editable"))&&!v("disableResizing")},o.setEventData=function(t){c={};var e,n,r=t.length;for(e=0;e<r;e++)n=t[e],c[n._id]?c[n._id].push(n):c[n._id]=[n]},o.clearEventData=function(){c={},u={},f=[]},o.eventEnd=g,o.reportEventElement=function(t,e){f.push({event:t,element:e}),u[t._id]?u[t._id].push(e):u[t._id]=[e]},o.triggerEventDestroy=function(){t.each(f,function(t,e){o.trigger("eventDestroy",e.event,e.event,e.element)})},o.eventElementHandlers=function(t,e){e.click(function(n){if(!e.hasClass("ui-draggable-dragging")&&!e.hasClass("ui-resizable-resizing"))return h("eventClick",this,t,n)}).hover(function(e){h("eventMouseover",this,t,e)},function(e){h("eventMouseout",this,t,e)})},o.showEvents=function(t,e){p(t,e,"show")},o.hideEvents=function(t,e){p(t,e,"hide")},o.eventDrop=function(t,e,n,r,a,o,i){var s=e.allDay,u=e._id;m(c[u],n,r,a),h("eventDrop",t,e,n,r,a,function(){m(c[u],-n,-r,s),l(u)},o,i),l(u)},o.eventResize=function(t,e,n,r,a,o){var i=e._id;w(c[i],n,r),h("eventResize",t,e,n,r,function(){w(c[i],-n,-r),l(i)},a,o),l(i)};var i=o.defaultEventEnd,s=r.normalizeEvent,l=r.reportEventChange,c={},u={},f=[],d=r.options;function v(e,n){var r=d[e];return t.isPlainObject(r)?Y(r,n||a):r}function h(t,e){return r.trigger.apply(r,[t,e||o].concat(Array.prototype.slice.call(arguments,2),[o]))}function g(t){return t.end?C(t.end):i(t)}function p(t,e,n){var r,a=u[t._id],o=a.length;for(r=0;r<o;r++)e&&a[r][0]==e[0]||a[r][n]()}function m(t,n,r,a){r=r||0;for(var o,i=t.length,l=0;l<i;l++)o=t[l],a!==e&&(o.allDay=a),b(y(o.start,n,!0),r),o.end&&(o.end=b(y(o.end,n,!0),r)),s(o,d)}function w(t,e,n){n=n||0;for(var r,a=t.length,o=0;o<a;o++)(r=t[o]).end=b(y(g(r),e,!0),n),s(r,d)}o.isHiddenDay=function(t){"object"==typeof t&&(t=t.getDay());return S[t]},o.skipHiddenDays=function(t,e,n){e=e||1;for(;S[(t.getDay()+(n?e:0)+7)%7];)y(t,e)},o.getCellsPerWeek=function(){return D},o.dateToCell=function(t){return W(z(N(t)))},o.dateToDayOffset=N,o.dayOffsetToCellOffset=z,o.cellOffsetToCell=W,o.cellToDate=function(){return R(F(H.apply(null,arguments)))},o.cellToCellOffset=H,o.cellOffsetToDayOffset=F,o.dayOffsetToDate=R,o.rangeToSegments=function(t,e){for(var n=o.getRowCnt(),r=o.getColCnt(),a=[],i=N(t),s=N(e),l=z(i),c=z(s)-1,u=0;u<n;u++){var f=u*r,d=f+r-1,v=Math.max(l,f),h=Math.min(c,d);if(v<=h){var g=W(v),p=W(h),m=[g.col,p.col].sort(),y=F(v)==i,w=F(h)+1==s;a.push({row:u,leftCol:m[0],rightCol:m[1],isStart:y,isEnd:w})}}return a};var D,M=v("hiddenDays")||[],S=[],T=[],x=[],k=v("isRTL");function H(t,e){var n=o.getColCnt(),r=k?-1:1,a=k?n-1:0;return"object"==typeof t&&(e=t.col,t=t.row),t*n+(e*r+a)}function F(t){var e=o.visStart.getDay();return t+=T[e],7*Math.floor(t/D)+x[(t%D+D)%D]-e}function R(t){var e=C(o.visStart);return y(e,t),e}function N(t){return E(t,o.visStart)}function z(t){var e=o.visStart.getDay();return t+=e,Math.floor(t/7)*D+T[(t%7+7)%7]-T[e]}function W(t){var e=o.getColCnt(),n=k?-1:1,r=k?e-1:0;return{row:Math.floor(t/e),col:(t%e+e)%e*n+r}}!function(){!1===v("weekends")&&M.push(0,6);for(var e=0,n=0;e<7;e++)T[e]=n,S[e]=-1!=t.inArray(e,M),S[e]||(x[n]=e,n++);if(!(D=n))throw"invalid hiddenDays"}()}function rt(){var e=this;e.renderDayEvents=function(t,e){var n=q(t,!1,!0);ot(n,function(t,e){l(t.event,e)}),function(t,e){var n=M();ot(t,function(t,n,r){var a=t.event;a._id===e?V(a,n,t):n[0]._fci=r}),z(n,t,V)}(n,e),ot(n,function(t,e){a("eventAfterRender",t.event,t.event,e)})},e.draggableDayEvent=function(t,e){var n,o=H();e.draggable({delay:50,opacity:r("dragOpacity"),revertDuration:r("dragRevertDuration"),start:function(r,i){a("eventDragStart",e,t,r,i),f(t,e),o.start(function(r,a,o,i){if(e.draggable("option","revert",!r||!o&&!i),x(),r){var s=R(a),l=R(r);n=E(l,s),T(y(C(t.start),n),y(N(t),n))}else n=0},r,"drag")},stop:function(r,i){o.stop(),x(),a("eventDragStop",e,t,r,i),n?d(this,t,n,0,t.allDay,r,i):(e.css("filter",""),u(t,e))}})},e.resizableDayEvent=function(e,n,o){var i=r("isRTL")?"w":"e",l=n.find(".ui-resizable-"+i),c=!1;j(n),n.mousedown(function(t){t.preventDefault()}).click(function(t){c&&(t.preventDefault(),t.stopImmediatePropagation())}),l.mousedown(function(r){if(1==r.which){c=!0;var l,d,p=H(),m=(h(),g(),n.css("top")),w=t.extend({},e),b=_(L(e.start));k(),t("body").css("cursor",i+"-resize").one("mouseup",function(n){a("eventResizeStop",this,e,n),t("body").css("cursor",""),p.stop(),x(),l&&v(this,e,l,0,n);setTimeout(function(){c=!1},0)}),a("eventResizeStart",this,e,r),p.start(function(n,r){if(n){var a=W(r),c=W(n);if(c=Math.max(c,b),l=A(c)-A(a)){w.end=y(s(e),l,!0);var v=d;d=function(t,e,n){var r=q([t],!0,!1),a=[];return ot(r,function(t,r){t.row===e&&r.css("top",n),a.push(r[0])}),a}(w,o.row,m),(d=t(d)).find("*").css("cursor",i+"-resize"),v&&v.remove(),f(e)}else d&&(u(e),d.remove(),d=null);x(),T(e.start,y(N(e),l))}},r)}})};var r=e.opt,a=e.trigger,o=e.isEventDraggable,i=e.isEventResizable,s=e.eventEnd,l=e.reportEventElement,c=e.eventElementHandlers,u=e.showEvents,f=e.hideEvents,d=e.eventDrop,v=e.eventResize,h=e.getRowCnt,g=e.getColCnt,p=(e.getColWidth,e.allDayRow),m=e.colLeft,w=e.colRight,b=e.colContentLeft,D=e.colContentRight,M=(e.dateToCell,e.getDaySegmentContainer),S=e.calendar.formatDates,T=e.renderDayOverlay,x=e.clearOverlays,k=e.clearSelection,H=e.getHoverListener,F=e.rangeToSegments,R=e.cellToDate,W=e.cellToCellOffset,A=e.cellOffsetToDayOffset,L=e.dateToDayOffset,_=e.dayOffsetToCellOffset;function q(e,o,i){var s,l,c=M(),u=o?t("<div/>"):c,f=function(t){for(var e=[],n=0;n<t.length;n++){var r=Y(t[n]);e.push.apply(e,r)}return e}(e);return function(t){for(var e=r("isRTL"),a=0;a<t.length;a++){var o=t[a],i=(e?o.isEnd:o.isStart)?b:m,s=(e?o.isStart:o.isEnd)?D:w,l=i(o.leftCol),c=s(o.rightCol);o.left=l,o.isEnd?o.outerWidth=c-l:o.outerWidth=n.width()-o.left}}(f),s=function(t){for(var e="",n=0;n<t.length;n++)e+=I(t[n]);return e}(f),u[0].innerHTML=s,l=u.children(),o&&c.append(l),function(e,n){for(var r=0;r<e.length;r++){var o=e[r],i=o.event,s=n.eq(r),l=a("eventRender",i,i,s);!1===l?s.remove():(l&&!0!==l&&(l=t(l).css({position:"absolute",left:o.left}),s.replaceWith(l),s=l),o.element=s)}}(f,l),ot(f,function(t,e){t.hsides=O(e,!0)}),ot(f,function(t,e){e.width(Math.max(0,t.outerWidth-t.hsides))}),ot(f,function(t,e){t.outerHeight=e.outerHeight(!0)}),function(t,e){var n=function(t){for(var e=h(),n=g(),r=[],a=function(t){var e,n,r,a=h(),o=[];for(e=0;e<t.length;e++)n=t[e],r=n.row,n.element&&(o[r]?o[r].push(n):o[r]=[n]);for(r=0;r<a;r++)o[r]=J(o[r]||[]);return o}(t),o=0;o<e;o++){for(var i=a[o],s=[],l=0;l<n;l++)s.push(0);for(var c=0;c<i.length;c++){var u=i[c];u.top=P(s.slice(u.leftCol,u.rightCol+1));for(var l=u.leftCol;l<=u.rightCol;l++)s[l]=u.top+u.outerHeight}r.push(P(s))}return r}(t),r=function(){var t,e=h(),n=[];for(t=0;t<e;t++)n[t]=p(t).find("div.fc-day-content > div");return n}(),a=[];if(e)for(var o=0;o<r.length;o++)r[o].height(n[o]);for(var o=0;o<r.length;o++)a.push(r[o].position().top);ot(t,function(t,e){e.css("top",a[t.row]+t.top)})}(f,i),f}function Y(t){for(var e=t.start,n=N(t),r=F(e,n),a=0;a<r.length;a++)r[a].event=t;return r}function I(t){var e="",n=r("isRTL"),a=t.event,s=a.url,l=["fc-event","fc-event-hori"];o(a)&&l.push("fc-event-draggable"),t.isStart&&l.push("fc-event-start"),t.isEnd&&l.push("fc-event-end"),l=l.concat(a.className),a.source&&(l=l.concat(a.source.className||[]));var c=X(a,r);return e+=s?"<a href='"+B(s)+"'":"<div",e+=" class='"+l.join(" ")+"' style='position:absolute;left:"+t.left+"px;"+c+"'><div class='fc-event-inner'>",!a.allDay&&t.isStart&&(e+="<span class='fc-event-time'>"+B(S(a.start,a.end,r("timeFormat")))+"</span>"),e+="<span class='fc-event-title'>"+B(a.title||"")+"</span></div>",t.isEnd&&i(a)&&(e+="<div class='ui-resizable-handle ui-resizable-"+(n?"w":"e")+"'> </div>"),e+="</"+(s?"a":"div")+">"}function J(t){for(var e=[],n=function(t){t.sort(it);for(var e=[],n=0;n<t.length;n++){for(var r=t[n],a=0;a<e.length&&at(r,e[a]);a++);e[a]?e[a].push(r):e[a]=[r]}return e}(t),r=0;r<n.length;r++)e.push.apply(e,n[r]);return e}function V(t,n,r){o(t)&&e.draggableDayEvent(t,n,r),r.isEnd&&i(t)&&e.resizableDayEvent(t,n,r),c(t,n)}}function at(t,e){for(var n=0;n<e.length;n++){var r=e[n];if(r.leftCol<=t.rightCol&&r.rightCol>=t.leftCol)return!0}return!1}function ot(t,e){for(var n=0;n<t.length;n++){var r=t[n],a=r.element;a&&e(r,a,n)}}function it(t,e){return e.rightCol-e.leftCol-(t.rightCol-t.leftCol)||e.event.allDay-t.event.allDay||t.event.start-e.event.start||(t.event.title||"").localeCompare(e.event.title)}function st(){var e=this;e.select=function(t,e,n){l(),e||(e=a(t,n));o(t,e,n),c(t,e,n)},e.unselect=l,e.reportSelection=c,e.daySelectionMousedown=function(r){var a=e.cellToDate,s=e.getIsCellAllDay,u=e.getHoverListener(),f=e.reportDayClick;if(1==r.which&&n("selectable")){l(r);var d;u.start(function(t,e){i(),t&&s(t)?(d=[a(e),a(t)].sort(_),o(d[0],d[1],!0)):d=null},r),t(document).one("mouseup",function(t){u.stop(),d&&(+d[0]==+d[1]&&f(d[0],!0,t),c(d[0],d[1],!0,t))})}};var n=e.opt,r=e.trigger,a=e.defaultSelectionEnd,o=e.renderSelection,i=e.clearSelection,s=!1;function l(t){s&&(s=!1,i(),r("unselect",null,t))}function c(t,e,n,a){s=!0,r("select",null,t,e,n,a)}n("selectable")&&n("unselectAuto")&&t(document).mousedown(function(e){var r=n("unselectCancel");r&&t(e.target).parents(r).length||l(e)})}function lt(){this.renderOverlay=function(r,a){var o=n.shift();o||(o=t("<div class='fc-cell-overlay' style='position:absolute;z-index:3'/>"));o[0].parentNode!=a[0]&&o.appendTo(a);return e.push(o.css(r).show()),o},this.clearOverlays=function(){var t;for(;t=e.shift();)n.push(t.hide().unbind())};var e=[],n=[]}function ct(t){var e,n,r=this;r.build=function(){t(e=[],n=[])},r.cell=function(t,r){var a,o=e.length,i=n.length,s=-1,l=-1;for(a=0;a<o;a++)if(r>=e[a][0]&&r<e[a][1]){s=a;break}for(a=0;a<i;a++)if(t>=n[a][0]&&t<n[a][1]){l=a;break}return s>=0&&l>=0?{row:s,col:l}:null},r.rect=function(t,r,a,o,i){var s=i.offset();return{top:e[t][0]-s.top,left:n[r][0]-s.left,width:n[o][1]-n[r][0],height:e[a][1]-e[t][0]}}}function ut(n){var r,a,o,i;function s(t){var r;(r=t).pageX===e&&(r.pageX=r.originalEvent.pageX,r.pageY=r.originalEvent.pageY);var s=n.cell(t.pageX,t.pageY);(!s!=!i||s&&(s.row!=i.row||s.col!=i.col))&&(s?(o||(o=s),a(s,o,s.row-o.row,s.col-o.col)):a(s,o),i=s)}this.start=function(e,l,c){a=e,o=i=null,n.build(),s(l),r=c||"mousemove",t(document).bind(r,s)},this.stop=function(){return t(document).unbind(r,s),i}}function ft(t){var n=this,r={},a={},o={};function i(e){return r[e]=r[e]||t(e)}n.left=function(t){return a[t]=a[t]===e?i(t).position().left:a[t]},n.right=function(t){return o[t]=o[t]===e?n.left(t)+i(t).width():o[t]},n.clear=function(){r={},a={},o={}}}o.dateFormatters=R,o.applyAll=J,i.month=function(t,e){var n=this;n.render=function(t,e){e&&(m(t,e),t.setDate(1));var l=r("firstDay"),c=C(t,!0);c.setDate(1);var u=m(C(c),1),f=C(c);y(f,-(f.getDay()-l+7)%7),o(f);var d=C(u);y(d,(7-d.getDay()+l)%7),o(d,-1,!0);var v=i(),h=Math.round(E(d,f)/7);"fixed"==r("weekMode")&&(y(d,7*(6-h)),h=6);n.title=s(c,r("titleFormat")),n.start=c,n.end=u,n.visStart=f,n.visEnd=d,a(h,v,!0)},U.call(n,t,e,"month");var r=n.opt,a=n.renderBasic,o=n.skipHiddenDays,i=n.getCellsPerWeek,s=e.formatDate},i.basicWeek=function(t,e){var n=this;n.render=function(t,e){e&&y(t,7*e);var l=y(C(t),-(t.getDay()-r("firstDay")+7)%7),c=y(C(l),7),u=C(l);o(u);var f=C(c);o(f,-1,!0);var d=i();n.start=l,n.end=c,n.visStart=u,n.visEnd=f,n.title=s(u,y(C(f),-1),r("titleFormat")),a(1,d,!1)},U.call(n,t,e,"basicWeek");var r=n.opt,a=n.renderBasic,o=n.skipHiddenDays,i=n.getCellsPerWeek,s=e.formatDates},i.basicDay=function(t,e){var n=this;n.render=function(t,e){e&&y(t,e);o(t,e<0?-1:1);var s=C(t,!0),l=y(C(s),1);n.title=i(t,r("titleFormat")),n.start=n.visStart=s,n.end=n.visEnd=l,a(1,1,!1)},U.call(n,t,e,"basicDay");var r=n.opt,a=n.renderBasic,o=n.skipHiddenDays,i=e.formatDate},s({weekMode:"fixed"}),i.agendaWeek=function(t,e){var n=this;n.render=function(t,e){e&&y(t,7*e);var l=y(C(t),-(t.getDay()-r("firstDay")+7)%7),c=y(C(l),7),u=C(l);o(u);var f=C(c);o(f,-1,!0);var d=i();n.title=s(u,y(C(f),-1),r("titleFormat")),n.start=l,n.end=c,n.visStart=u,n.visEnd=f,a(d)},Z.call(n,t,e,"agendaWeek");var r=n.opt,a=n.renderAgenda,o=n.skipHiddenDays,i=n.getCellsPerWeek,s=e.formatDates},i.agendaDay=function(t,e){var n=this;n.render=function(t,e){e&&y(t,e);o(t,e<0?-1:1);var s=C(t,!0),l=y(C(s),1);n.title=i(t,r("titleFormat")),n.start=n.visStart=s,n.end=n.visEnd=l,a(1)},Z.call(n,t,e,"agendaDay");var r=n.opt,a=n.renderAgenda,o=n.skipHiddenDays,i=e.formatDate},s({allDaySlot:!0,allDayText:"all-day",firstHour:6,slotMinutes:30,defaultEventMinutes:120,axisFormat:"h(:mm)tt",timeFormat:{agenda:"h:mm{ - h:mm}"},dragOpacity:{agenda:.5},minTime:0,maxTime:24,slotEventOverlap:!0})}(jQuery); |