Google
Edit File: calendar-block-renderer-fca60c4f497049673aa6-min.js
webpackJsonp([28],{0:function(u,B,f){f(1705);f(1376);f(1401);f(1400);f(956);f(849);f(955);f(1402);f(1273)},849:function(u,B){YUI.add("datatype-date-format",function(f,v){var a=function(b,e,a){"undefined"===typeof a&&(a=10);for(e+="";parseInt(b,10)<a&&1<a;a/=10)b=e+b;return b.toString()},g={formats:{a:function(b,e){return e.a[b.getDay()]},A:function(b,e){return e.A[b.getDay()]},b:function(b,e){return e.b[b.getMonth()]},B:function(b,e){return e.B[b.getMonth()]},C:function(b){return a(parseInt(b.getFullYear()/ 100,10),0)},d:["getDate","0"],e:["getDate"," "],g:function(b){return a(parseInt(g.formats.G(b)%100,10),0)},G:function(b){var e=b.getFullYear(),a=parseInt(g.formats.V(b),10);b=parseInt(g.formats.W(b),10);b>a?e++:0===b&&52<=a&&e--;return e},H:["getHours","0"],I:function(b){b=b.getHours()%12;return a(0===b?12:b,0)},j:function(b){var e=new Date(""+b.getFullYear()+"/1/1 GMT");b=new Date(""+b.getFullYear()+"/"+(b.getMonth()+1)+"/"+b.getDate()+" GMT")-e;b=parseInt(b/6E4/60/24,10)+1;return a(b,0,100)},k:["getHours", " "],l:function(b){b=b.getHours()%12;return a(0===b?12:b," ")},m:function(b){return a(b.getMonth()+1,0)},M:["getMinutes","0"],p:function(b,e){return e.p[12<=b.getHours()?1:0]},P:function(b,e){return e.P[12<=b.getHours()?1:0]},s:function(b,e){return parseInt(b.getTime()/1E3,10)},S:["getSeconds","0"],u:function(b){b=b.getDay();return 0===b?7:b},U:function(b){var e=parseInt(g.formats.j(b),10);b=6-b.getDay();e=parseInt((e+b)/7,10);return a(e,0)},V:function(b){var e=parseInt(g.formats.W(b),10),d=(new Date(""+ b.getFullYear()+"/1/1")).getDay(),e=e+(4<d||1>=d?0:1);53===e&&4>(new Date(""+b.getFullYear()+"/12/31")).getDay()?e=1:0===e&&(e=g.formats.V(new Date(""+(b.getFullYear()-1)+"/12/31")));return a(e,0)},w:"getDay",W:function(b){var e=parseInt(g.formats.j(b),10);b=7-g.formats.u(b);e=parseInt((e+b)/7,10);return a(e,0,10)},y:function(b){return a(b.getFullYear()%100,0)},Y:"getFullYear",z:function(b){b=b.getTimezoneOffset();var e=a(parseInt(Math.abs(b/60),10),0),d=a(Math.abs(b%60),0);return(0<b?"-":"+")+e+ d},Z:function(b){var e=b.toString().replace(/^.*:\d\d( GMT[+-]\d+)? \(?([A-Za-z ]+)\)?\d*$/,"$2").replace(/[a-z ]/g,"");4<e.length&&(e=g.formats.z(b));return e},"%":function(b){return"%"}},aggregates:{c:"locale",D:"%m/%d/%y",F:"%Y-%m-%d",h:"%b",n:"\n",r:"%I:%M:%S %p",R:"%H:%M",t:"\t",T:"%H:%M:%S",x:"locale",X:"locale"},format:function(b,e){e=e||{};if(!f.Lang.isDate(b))return f.Lang.isValue(b)?b:"";var d,L;d=e.format||"%Y-%m-%d";L=f.Intl.get("datatype-date-format");for(var r=function(e,b){var a=g.aggregates[b]; return"locale"===a?L[b]:a},n=function(e,d){var r=g.formats[d];switch(f.Lang.type(r)){case "string":return b[r]();case "function":return r.call(b,b,L);case "array":if("string"===f.Lang.type(r[0]))return a(b[r[0]](),r[1]);default:return d}};d.match(/%[cDFhnrRtTxX]/);)d=d.replace(/%([cDFhnrRtTxX])/g,r);d=d.replace(/%([aAbBCdegGHIjklmMpPsSuUVwWyYzZ%])/g,n);r=n=void 0;return d}};f.mix(f.namespace("Date"),g);f.namespace("DataType");f.DataType.Date=f.Date},"3.17.2",{lang:"ar ar-JO ca ca-ES da da-DK de de-AT de-DE el el-GR en en-AU en-CA en-GB en-IE en-IN en-JO en-MY en-NZ en-PH en-SG en-US es es-AR es-BO es-CL es-CO es-EC es-ES es-MX es-PE es-PY es-US es-UY es-VE fi fi-FI fr fr-BE fr-CA fr-FR hi hi-IN hu id id-ID it it-IT ja ja-JP ko ko-KR ms ms-MY nb nb-NO nl nl-BE nl-NL pl pl-PL pt pt-BR ro ro-RO ru ru-RU sv sv-SE th th-TH tr tr-TR vi vi-VN zh-Hans zh-Hans-CN zh-Hant zh-Hant-HK zh-Hant-TW".split(" ")})}, 955:function(u,B){YUI.add("datatype-date-math",function(f,v){var a=f.Lang;f.mix(f.namespace("Date"),{isValidDate:function(g){return a.isDate(g)&&isFinite(g)&&"Invalid Date"!=g&&!isNaN(g)&&null!=g?!0:!1},areEqual:function(a,b){return this.isValidDate(a)&&this.isValidDate(b)&&a.getTime()==b.getTime()},isGreater:function(a,b){return this.isValidDate(a)&&this.isValidDate(b)&&a.getTime()>b.getTime()},isGreaterOrEqual:function(a,b){return this.isValidDate(a)&&this.isValidDate(b)&&a.getTime()>=b.getTime()}, isInRange:function(a,b,e){return this.isGreaterOrEqual(a,b)&&this.isGreaterOrEqual(e,a)},addDays:function(a,b){return new Date(a.getTime()+864E5*b)},addMonths:function(a,b){var e=a.getFullYear(),d=a.getMonth()+b,e=Math.floor(e+d/12),d=(d%12+12)%12,f=new Date(a.getTime());f.setFullYear(e);f.setMonth(d);return f},addYears:function(a,b){var e=a.getFullYear()+b,d=new Date(a.getTime());d.setFullYear(e);return d},listOfDatesInMonth:function(a){if(!this.isValidDate(a))return[];var b=this.daysInMonth(a), e=a.getFullYear();a=a.getMonth();for(var d=[],f=1;f<=b;f++)d.push(new Date(e,a,f,12,0,0));return d},daysInMonth:function(a){if(!this.isValidDate(a))return 0;var b=a.getMonth(),e=[31,28,31,30,31,30,31,31,30,31,30,31];if(1!=b)return e[b];a=a.getFullYear();return 0===a%400?29:0===a%100?28:0===a%4?29:28}});f.namespace("DataType");f.DataType.Date=f.Date},"3.17.2",{requires:["yui-base"]})},956:function(u,B){YUI.add("datatype-date-parse",function(f,v){f.mix(f.namespace("Date"),{parse:function(a){a=new Date(+a|| a);return f.Lang.isDate(a)?a:null}});f.namespace("Parsers").date=f.Date.parse;f.namespace("DataType");f.DataType.Date=f.Date},"3.17.2")},1273:function(u,B){YUI.add("squarespace-calendar-day-template",function(f){var v=f.Handlebars;(function(){var a=v.template;(v.templates=v.templates||{})["calendar-day.html"]=a(function(a,b,e,d,f){function r(e,a){return""}function n(a,h){var b,c,d;b='\n\t<div class="background';if((d=e["if"].call(a,(c=(c=(c=a.events,null==c||!1===c?c:c[0]),null==c||!1===c?c:c.structuredContent), null==c||!1===c?c:c.startDate),{hash:{},inverse:l.noop,fn:l.program(5,m,h),data:h}))||0===d)b+=d;return b+='">\n\t\t<a href="'+p((c=(c=(c=a.events,null==c||!1===c?c:c[0]),null==c||!1===c?c:c.fullUrl),typeof c===x?c.apply(a):c))+'" class="background-image-link"><img data-src="'+p((c=(c=(c=a.events,null==c||!1===c?c:c[0]),null==c||!1===c?c:c.assetUrl),typeof c===x?c.apply(a):c))+'" data-image-dimensions="'+p((c=(c=(c=a.events,null==c||!1===c?c:c[0]),null==c||!1===c?c:c.originalSize),typeof c===x?c.apply(a): c))+'" data-load="false" class="background-image"></a>\n\t</div>\n\t'}function m(e,a){return" background--iseventscollection"}function z(e,a){return" itemlist--iseventscollection"}function E(a,h){var b,c,d;b='\n\t<li class="item';if((c=e["if"].call(a,a.isMultiday,{hash:{},inverse:l.noop,fn:l.program(11,k,h),data:h}))||0===c)b+=c;if((c=e["if"].call(a,a.isSubsequentDayOfMultidayEvent,{hash:{},inverse:l.noop,fn:l.program(13,y,h),data:h}))||0===c)b+=c;b+='">\n\t\t<a href="';(c=e.fullUrl)?c=c.call(a,{hash:{}, data:h}):(c=a.fullUrl,c=typeof c===x?c.apply(a):c);b+=p(c)+'" class="item-link">\n\t\t\t<span class="item-time item-time--12hr">';d={hash:{},data:h};b+=p((c=e["calendar-compact-time-format"]||a["calendar-compact-time-format"],c?c.call(a,(c=a.structuredContent,null==c||!1===c?c:c.startDate),d):A.call(a,"calendar-compact-time-format",(c=a.structuredContent,null==c||!1===c?c:c.startDate),d)))+' </span>\n\t\t\t<span class="item-time item-time--24hr">';d={hash:{format:"%H:%M"},data:h};b+=p((c=e["date-format"]|| a["date-format"],c?c.call(a,(c=a.structuredContent,null==c||!1===c?c:c.startDate),d):A.call(a,"date-format",(c=a.structuredContent,null==c||!1===c?c:c.startDate),d)))+' </span>\n\t\t\t<span class="item-title">';(c=e.title)?c=c.call(a,{hash:{},data:h}):(c=a.title,c=typeof c===x?c.apply(a):c);b+=p(c)+"</span>\n\t\t\t";if((c=e["if"].call(a,a.isMultiday,{hash:{},inverse:l.noop,fn:l.program(15,D,h),data:h}))||0===c)b+=c;return b+"\n\t\t</a>\n\t</li>\n\t"}function k(e,a){return" item--multiday"}function y(e, a){return" item--ongoing"}function D(a,b){var h,c;h={hash:{format:"%b %e"},data:b};return h='<span class="item-enddate"> '+(p((c=e["date-format"]||a["date-format"],c?c.call(a,(c=a.structuredContent,null==c||!1===c?c:c.endDate),h):A.call(a,"date-format",(c=a.structuredContent,null==c||!1===c?c:c.endDate),h)))+"</span>")}function s(e,a){return" flyoutitemlist--iseventscollection"}function v(e,a){return" \n\t\tflyoutitemlist--hasmorecontent\n\t"}function q(a,h){var b,c,d;b="\n\t\t";d={hash:{},inverse:l.noop, fn:l.program(22,u,h),data:h};(c=e.events)?c=c.call(a,d):(c=a.events,c=typeof c===x?c.apply(a):c);e.events||(c=M.call(a,c,d));if(c||0===c)b+=c;return b+"\n\t"}function u(a,b){var h,c;h="\n\t\t\t";if((c=e["if"].call(a,a.excerpt,{hash:{},inverse:l.program(25,F,b),fn:l.program(23,B,b),data:b}))||0===c)h+=c;return h+"\n\t\t"}function B(e,a){return" \n\t\t\t\tflyoutitemlist--hasmorecontent\n\t\t\t"}function F(a,b){var h,c,d;h="\n\t\t\t\t";if((d=e["if"].call(a,(c=a.location,null==c||!1===c?c:c.addressLine1), {hash:{},inverse:l.noop,fn:l.program(26,C,b),data:b}))||0===d)h+=d;return h+"\n\t\t\t"}function C(e,a){return" \n\t\t\t\t\tflyoutitemlist--hasmorecontent\n\t\t\t\t"}function H(a,b){var d,c,k;d='\n\t<li class="flyoutitem';if((c=e["if"].call(a,a.isMultiday,{hash:{},inverse:l.noop,fn:l.program(29,I,b),data:b}))||0===c)d+=c;if((c=e["if"].call(a,a.isSubsequentDayOfMultidayEvent,{hash:{},inverse:l.noop,fn:l.program(31,J,b),data:b}))||0===c)d+=c;d+='">\n\t\t<h1 class="flyoutitem-title"><a href="';(c=e.fullUrl)? c=c.call(a,{hash:{},data:b}):(c=a.fullUrl,c=typeof c===x?c.apply(a):c);d+=p(c)+'" class="flyoutitem-link">';(c=e.title)?c=c.call(a,{hash:{},data:b}):(c=a.title,c=typeof c===x?c.apply(a):c);d+=p(c);if((c=e["if"].call(a,a.isMultiday,{hash:{},inverse:l.noop,fn:l.program(33,G,b),data:b}))||0===c)d+=c;d+=' <span class="flyoutitem-link-arrow"></span></a></h1>\n\t\t<div class="flyoutitem-datetime flyoutitem-datetime--12hr">\n\t\t\t';if((c=e["if"].call(a,a.isMultiday,{hash:{},inverse:l.program(37,K, b),fn:l.program(35,N,b),data:b}))||0===c)d+=c;d+='\n\t\t</div>\n\t\t<div class="flyoutitem-datetime flyoutitem-datetime--24hr">\n\t\t\t';if((c=e["if"].call(a,a.isMultiday,{hash:{},inverse:l.program(41,h,b),fn:l.program(39,w,b),data:b}))||0===c)d+=c;d+='\n\t\t</div>\n\t\t<div class="flyoutitem-location">\n\t\t\t';if((k=e["if"].call(a,(c=a.location,null==c||!1===c?c:c.addressTitle),{hash:{},inverse:l.noop,fn:l.program(43,Q,b),data:b}))||0===k)d+=k;d+="\n\t\t\t";if((k=e["if"].call(a,(c=a.location,null== c||!1===c?c:c.addressLine1),{hash:{},inverse:l.noop,fn:l.program(45,R,b),data:b}))||0===k)d+=k;d+="\n\t\t\t";if((k=e["if"].call(a,(c=a.location,null==c||!1===c?c:c.addressLine2),{hash:{},inverse:l.noop,fn:l.program(47,S,b),data:b}))||0===k)d+=k;d+="\n\t\t\t";if((k=e["if"].call(a,(c=a.location,null==c||!1===c?c:c.addressCountry),{hash:{},inverse:l.noop,fn:l.program(49,T,b),data:b}))||0===k)d+=k;d+="\n\t\t</div>\n\t\t";if((k=e["if"].call(a,a.excerpt,{hash:{},inverse:l.noop,fn:l.program(51,U,b),data:b}))|| 0===k)d+=k;return d+"\n\t</li>\n\t"}function I(a,e){return" flyoutitem--multiday"}function J(a,e){return" flyoutitem--ongoing"}function G(a,b){var h,c;h={hash:{format:"%b %e"},data:b};return h=' <span class="flyoutitem-enddate">'+(p((c=e["date-format"]||a["date-format"],c?c.call(a,(c=a.structuredContent,null==c||!1===c?c:c.endDate),h):A.call(a,"date-format",(c=a.structuredContent,null==c||!1===c?c:c.endDate),h)))+"</span>")}function N(a,b){var h,c,d;d={hash:{format:"%a, %b %e, %l:%M%P"},data:b};h= "\n\t\t\t\t"+(p((c=e["date-format"]||a["date-format"],c?c.call(a,(c=a.structuredContent,null==c||!1===c?c:c.startDate),d):A.call(a,"date-format",(c=a.structuredContent,null==c||!1===c?c:c.startDate),d)))+" – ");d={hash:{format:"%a, %b %e, %l:%M%P"},data:b};return h+=p((c=e["date-format"]||a["date-format"],c?c.call(a,(c=a.structuredContent,null==c||!1===c?c:c.endDate),d):A.call(a,"date-format",(c=a.structuredContent,null==c||!1===c?c:c.endDate),d)))+"\n\t\t\t"}function K(a,b){var h,c,d;d={hash:{format:"%l:%M%P"}, data:b};h="\n\t\t\t\t"+(p((c=e["date-format"]||a["date-format"],c?c.call(a,(c=a.structuredContent,null==c||!1===c?c:c.startDate),d):A.call(a,"date-format",(c=a.structuredContent,null==c||!1===c?c:c.startDate),d)))+" – ");d={hash:{format:"%l:%M%P"},data:b};return h+=p((c=e["date-format"]||a["date-format"],c?c.call(a,(c=a.structuredContent,null==c||!1===c?c:c.endDate),d):A.call(a,"date-format",(c=a.structuredContent,null==c||!1===c?c:c.endDate),d)))+"\n\t\t\t"}function w(a,b){var h,c,d;d={hash:{format:"%a, %b %e, %H:%M"}, data:b};h="\n\t\t\t\t"+(p((c=e["date-format"]||a["date-format"],c?c.call(a,(c=a.structuredContent,null==c||!1===c?c:c.startDate),d):A.call(a,"date-format",(c=a.structuredContent,null==c||!1===c?c:c.startDate),d)))+" – ");d={hash:{format:"%a, %b %e, %H:%M"},data:b};return h+=p((c=e["date-format"]||a["date-format"],c?c.call(a,(c=a.structuredContent,null==c||!1===c?c:c.endDate),d):A.call(a,"date-format",(c=a.structuredContent,null==c||!1===c?c:c.endDate),d)))+"\n\t\t\t"}function h(a,b){var h,c, d;d={hash:{format:"%H:%M"},data:b};h="\n\t\t\t\t"+(p((c=e["date-format"]||a["date-format"],c?c.call(a,(c=a.structuredContent,null==c||!1===c?c:c.startDate),d):A.call(a,"date-format",(c=a.structuredContent,null==c||!1===c?c:c.startDate),d)))+" – ");d={hash:{format:"%H:%M"},data:b};return h+=p((c=e["date-format"]||a["date-format"],c?c.call(a,(c=a.structuredContent,null==c||!1===c?c:c.endDate),d):A.call(a,"date-format",(c=a.structuredContent,null==c||!1===c?c:c.endDate),d)))+"\n\t\t\t"}function Q(a, e){var b,c;return b=""+('<div class="flyoutitem-location-addresstitle">'+p((c=(c=a.location,null==c||!1===c?c:c.addressTitle),typeof c===x?c.apply(a):c))+"</div>")}function R(a,e){var b,c;return b=""+('<div class="flyoutitem-location-address1">'+p((c=(c=a.location,null==c||!1===c?c:c.addressLine1),typeof c===x?c.apply(a):c))+"</div>")}function S(a,e){var b,c;return b=""+('<div class="flyoutitem-location-address2">'+p((c=(c=a.location,null==c||!1===c?c:c.addressLine2),typeof c===x?c.apply(a):c))+"</div>")} function T(a,e){var b,c;return b=""+('<div class="flyoutitem-location-addresscountry">'+p((c=(c=a.location,null==c||!1===c?c:c.addressCountry),typeof c===x?c.apply(a):c))+"</div>")}function U(a,b){var h,c;h='<div class="flyoutitem-excerpt">';(c=e.excerpt)?c=c.call(a,{hash:{},data:b}):(c=a.excerpt,c=typeof c===x?c.apply(a):c);if(c||0===c)h+=c;return h+"</div>"}this.compilerInfo=[4,">= 1.0.0"];e=this.merge(e,a.helpers);f=f||{};a="";var t,l=this,x="function",p=this.escapeExpression,A=e.helperMissing, M=e.blockHelperMissing;if((d=e["if"].call(b,(t=(t=b.events,null==t||!1===t?t:t[0]),null==t||!1===t?t:t.systemDataId),{hash:{},inverse:l.noop,fn:l.program(1,function(a,b){var h,c,d;h="\n\t";if((d=e["if"].call(a,(c=(c=a.events,null==c||!1===c?c:c[1]),null==c||!1===c?c:c.title),{hash:{},inverse:l.program(4,n,b),fn:l.program(2,r,b),data:b}))||0===d)h+=d;return h+"\n"},f),data:f}))||0===d)a+=d;d={hash:{format:"%a"},data:f};a=a+'\n\n<div class="marker">\n\t<div class="marker-dayname">'+(p((t=e["day-of-month-format"]|| b["day-of-month-format"],t?t.call(b,b.date,d):A.call(b,"day-of-month-format",b.date,d)))+'</div>\n\t<div class="marker-daynum">');d={hash:{format:"%e"},data:f};a+=p((t=e["day-of-month-format"]||b["day-of-month-format"],t?t.call(b,b.date,d):A.call(b,"day-of-month-format",b.date,d)))+"</div>\n</div>\n\n";if((d=e["if"].call(b,b.events,{hash:{},inverse:l.noop,fn:l.program(7,function(a,b){var h,c,d,k;h='\n<ul class="itemlist';if((d=e["if"].call(a,(c=(c=(c=a.events,null==c||!1===c?c:c[0]),null==c||!1=== c?c:c.structuredContent),null==c||!1===c?c:c.startDate),{hash:{},inverse:l.noop,fn:l.program(8,z,b),data:b}))||0===d)h+=d;h+='">\n\t';k={hash:{},inverse:l.noop,fn:l.program(10,E,b),data:b};(d=e.events)?d=d.call(a,k):(d=a.events,d=typeof d===x?d.apply(a):d);e.events||(d=M.call(a,d,k));if(d||0===d)h+=d;h+='\n</ul>\n\n<ul class="\n\tflyoutitemlist\n\t';if((d=e["if"].call(a,(c=(c=(c=a.events,null==c||!1===c?c:c[0]),null==c||!1===c?c:c.structuredContent),null==c||!1===c?c:c.startDate),{hash:{},inverse:l.noop, fn:l.program(17,s,b),data:b}))||0===d)h+=d;h+="\n\t";if((d=e["if"].call(a,(c=(c=a.events,null==c||!1===c?c:c[1]),null==c||!1===c?c:c.title),{hash:{},inverse:l.program(21,q,b),fn:l.program(19,v,b),data:b}))||0===d)h+=d;h+='\n">\n\t';k={hash:{},inverse:l.noop,fn:l.program(28,H,b),data:b};(d=e.events)?d=d.call(a,k):(d=a.events,d=typeof d===x?d.apply(a):d);e.events||(d=M.call(a,d,k));if(d||0===d)h+=d;return h+='\n</ul>\n\n<div class="itemcount">'+p((c=(c=a.events,null==c||!1===c?c:c.length),typeof c=== x?c.apply(a):c))+"</div>\n"},f),data:f}))||0===d)a+=d;return a+="\n"})})();f.Handlebars.registerPartial("calendar-day.html".replace("/","."),v.templates["calendar-day.html"])},"1.0",{requires:["handlebars-base"]})},1376:function(u,B,f){var v=f(92);YUI.add("squarespace-calendar-core-renderer",function(a){var f=function(a){return a.recordType===v.EVENT?a.structuredContent.startDate:a.addedOn};a.Squarespace.SquarespaceCalendar=a.Base.create("SquarespaceCalendar",a.Calendar,[],{initializer:function(){this._fetchEvents()}, bindUI:function(){a.Calendar.superclass.bindUI.call(this);this.before("dateChange",this._clearEvents,this);this.after("dateChange",this._fetchEvents,this);this.after("collectionIdChange",this._fetchEvents,this)},_clearEvents:function(){this.set("events",[])},_fetchEvents:function(){var b=this.get("date"),b=a.DataType.Date.format(b,{format:"%B-%Y",locale:"en"});a.Data.get({url:this._getFetchUrl(b),success:this._parseResponse,failure:this._handleResponseError},this)},_parseResponse:function(a){this.set("events", a)},_handleResponseError:function(a){this.fire("fetchEventsFailure");console.error("Failed fetch data: "+a)},_getFetchUrl:function(a){return"/api/open/GetItemsByMonth"+this._buildQueryString(a)},_buildQueryString:function(b){var d=this.get("collectionId"),f=this.get("pageCollectionId"),g=this.get("category"),n=this.get("tag"),m=this.get("author");b="?collectionId="+d+"&month="+b+(g?"&category="+g:"")+(n?"&tag="+n:"")+(m?"&author="+m:"");a.Lang.isValue(f)&&(b+="&pageCollectionId="+f);return b}},{ATTRS:{events:{value:[], validator:a.Lang.isArray},collectionId:{value:null,validator:a.Lang.isString},pageCollectionId:{value:null,validator:a.Lang.isString},category:{value:"",validator:a.Lang.isString},tag:{value:"",validator:a.Lang.isString},author:{value:"",validator:a.Lang.isString}}});a.Squarespace.CalendarBaseRenderer=a.Base.create("CalendarBaseRenderer",a.Plugin.Base,[],{initializer:function(a){this.host=a.host;this.afterHostEvent("eventsChange",this._onEventsChange,this)},_onEventsChange:function(b){var d=null; a.Lang.isArray(b.newVal)&&0<b.newVal.length&&(d=a.bind(this._calendarFilterFunction,this));this.host.set("customRenderer",{rules:{all:"events"},filterFunction:d})},_calendarFilterFunction:function(a,b,f){f=this.host.get("events");f=this._getEventsOfDay(f,a);this._sortEvents(f);this._renderDay(a,b,f)},_renderDay:function(a,b,f){0<f.length&&b.setStyle("background","gray")},_sortEvents:function(a){a.sort(function(a,b){var e=f(a);return f(b)-e})},_getEventsOfDay:function(b,d){var f=a.DataType.Date.format(d, {format:"%Y-%m-%d"});return a.Lang.isArray(b)&&0<b.length?a.Array.filter(b,function(a){return this._isEventPartOfDay(a,f)},this):[]},_isEventPartOfDay:function(b,d){var f,g;g=b.structuredContent;if(b.recordType!==v.EVENT)return f=a.Squarespace.DateUtils.dateFormat(b.addedOn,{format:"%Y-%m-%d"}),f===d;f=a.Squarespace.DateUtils.dateFormat(g.startDate,{format:"%Y-%m-%d"});g=a.Squarespace.DateUtils.dateFormat(g.endDate,{format:"%Y-%m-%d"});return d==f||d==g||new Date(d)>new Date(f)&&new Date(d)<new Date(g)? !0:!1},_getEventDisplayTime:function(b){b=f(b);return a.Squarespace.DateUtils.dateFormat(b,{format:"%l:%M%P"}).trim()},_isSameDay:function(b,d){if(b.recordType!==v.EVENT)return!0;var f=a.Squarespace.DateUtils.dateFormat(b.structuredContent.startDate,{format:"%Y-%m-%d"}),g=a.DataType.Date.format(d,{format:"%Y-%m-%d"});return f===g}},{NS:"calendarPlugin"});var b=a.namespace("Squarespace").SquarespaceCalendarRenderer=a.Base.create("squarespaceCalendarRenderer",a.Squarespace.CalendarBaseRenderer,[],{initializer:function(b){this._loadingSpinner= new a.Squarespace.Spinner({color:"dark",size:"extra-large",render:this.host.get("contentBox")});this.onceAfterHostEvent("eventsChange",this._renderCalendar);this.onceAfterHostEvent("fetchEventsFailure",function(){this._loadingSpinner&&this._loadingSpinner.destroy(!0);window.SQUARESPACE_LOGIN&&window.SQUARESPACE_LOGIN.isLoggedIn()&&this.host.get("boundingBox").ancestor().append('<div class="sqs-state-message">Please choose a valid collection for this calendar to display. It is possible that this calendar is pointing to a deleted collection.</div>'); this.host.destroy()},this);this._bindUI()},destructor:function(){this._loadingSpinner&&this._loadingSpinner.destroy(!0);this._resizeEvent.detach()},_bindUI:function(){this._resizeEvent=a.on("resize",this._syncUI,a.config.win,this)},_syncUI:function(){this.host.get("contentBox").getDOMNode()&&(this._fitToContainer(),this._setupCells(),this.host.get("contentBox").hasClass(b.COMPACT_LAYOUT_CLASS)||this._loadImages(),this._setFlyoutHeights())},_onEventsChange:function(b){b=a.bind(this._calendarFilterFunction, this);this.host.set("customRenderer",{rules:{all:{all:{all:{0:"sunday",1:"monday",2:"tuesday",3:"wednesday",4:"thursday",5:"friday",6:"saturday"}}}},filterFunction:b});this.get("isRendered")&&this._syncUI()},_calendarFilterFunction:function(a,d,f){b.superclass._calendarFilterFunction.apply(this,arguments);0<=f.indexOf("sunday")?d.addClass("sunday"):0<=f.indexOf("monday")?d.addClass("monday"):0<=f.indexOf("friday")?d.addClass("friday"):0<=f.indexOf("saturday")&&d.addClass("saturday")},_fitToContainer:function(){var a= this.host.get("contentBox");a.toggleClass(b.SMALL_LAYOUT_CLASS,770>=a.get("offsetWidth"));a.toggleClass(b.COMPACT_LAYOUT_CLASS,600>=a.get("offsetWidth"));a.toggleClass(b.TINY_LAYOUT_CLASS,300>=a.get("offsetWidth"))},_setupHeader:function(){this.host.get("contentBox").one(".yui3-calendar-header-label").wrap("<h1></h1>")},_setupCells:function(){var a=this.host.get("contentBox").one("table");a.setStyle("width",null);this.cellSpacing=parseInt(a.getComputedStyle("borderSpacing"),10);var b=7*parseInt((a.get("offsetWidth")- 8*this.cellSpacing)/7,10)+8*this.cellSpacing;a.setStyle("width",b);a.all("td").setStyles({width:parseInt(b/7,10)-this.cellSpacing,height:parseInt(b/7,10)-this.cellSpacing})},_loadImages:function(){this.host.get("contentBox").all("img[data-src]").each(function(a){ImageLoader.load(a,{mode:"fill",load:!0})},this)},_setFlyoutHeights:function(){this.host.get("contentBox").all(".flyoutitemlist--hasmorecontent").each(function(a){var b=a.ancestor("tr"),f=this._getRowHeight(b),b=a.ancestor("tr:nth-child(4)")|| a.ancestor("tr:nth-child(5)")||a.ancestor("tr:nth-child(6)")?this._getRowHeight(b.previous("tr")):this._getRowHeight(b.next("tr"));a.setStyle("height",f+b+this.cellSpacing)},this);this.host.get("contentBox").all("tr").removeAttribute("data-row-height")},_getRowHeight:function(a){if(a.getAttribute("data-row-height"))return parseInt(a.getAttribute("data-row-height"),10);var b=a.get("offsetHeight");a.setAttribute("data-row-height",b);return b},_renderCalendar:function(){this._setupHeader();this._syncUI(); this._loadingSpinner&&this._loadingSpinner.destroy(!0);this.host.get("boundingBox").addClass("loaded");this.set("isRendered",!0)},_renderDay:function(a,b,f){this.setAttrs({date:a,node:b,events:this._groupEvents(f,a)});this._highlightToday();this._highlightDaysWithEvents();a=this._getTemplateInfo().template(this._getHBTemplateContext());b.empty().append(a)},_highlightToday:function(){var e=new Date,e=new Date(e.setMinutes(e.getMinutes()+a.Squarespace.DateUtils.getTimeOffsetToWebsiteTimezone(e)));this.get("date").setHours(0, 0,0,0)===e.setHours(0,0,0,0)&&this.get("node").addClass(b.TODAY_CLASS)},_highlightDaysWithEvents:function(){0<this.get("events").length&&this.get("node").addClass(b.HAS_EVENT_CLASS)},_getTemplateInfo:function(){return{template:a.Squarespace.UITemplates.getCompiledTemplate(b.HANDLEBARS_TEMPLATE)}},_getHBTemplateContext:function(){return{date:this.get("date"),events:this.get("events")}},_groupEvents:function(b,d){var f=[],g=[];a.Array.each(b,function(a){this._isSameDay(a,d)?f.unshift(a):(a.isSubsequentDayOfMultidayEvent= !0,g.unshift(a));this._isMultidayEvent(a)&&(a.isMultiday=!0)},this);return g.concat(f)},_isMultidayEvent:function(b){if(b.recordType===v.EVENT){var d=b.structuredContent;b=a.Squarespace.DateUtils.dateFormat(d.startDate,{format:"%d%m%Y"});d=a.Squarespace.DateUtils.dateFormat(d.endDate,{format:"%d%m%Y"});return b!==d}}},{NS:"calendarPlugin",TODAY_CLASS:"today",HAS_EVENT_CLASS:"has-event",SMALL_LAYOUT_CLASS:"small-layout",COMPACT_LAYOUT_CLASS:"compact-layout",TINY_LAYOUT_CLASS:"tiny-layout",HANDLEBARS_TEMPLATE:"calendar-day.html"}); a.Handlebars.registerHelper("day-of-month-format",function(b,d){return a.DataType.Date.format(b,{format:d.hash.format||"%B %e, %Y"})});a.Handlebars.registerHelper("date-format",function(b,d){return a.Squarespace.DateUtils.dateFormat(b,{format:d.hash.format||"%B %e, %Y"})});a.Handlebars.registerHelper("calendar-compact-time-format",function(b){var d="PM"==a.Squarespace.DateUtils.dateFormat(b,{format:"%p"})?"p":"a";return 0===(new Date(b)).getMinutes()?a.Squarespace.DateUtils.dateFormat(b,{format:"%l"})+ d:a.Squarespace.DateUtils.dateFormat(b,{format:"%l:%M"})+d})},"1.0",{requires:"base calendar node squarespace-attr-validators squarespace-calendar-day-template squarespace-date-utils squarespace-spinner squarespace-ui-base squarespace-ui-templates squarespace-widgets-alert".split(" ")})},1400:function(u,B){YUI.add("calendar-base",function(f,v){function a(){a.superclass.constructor.apply(this,arguments)}var g=f.ClassNameManager.getClassName,b=g("calendar","grid"),e=g("calendar","left-grid"),d=g("calendar", "right-grid"),u=g("calendar","body"),r=g("calendar","header"),n=g("calendar","header-label"),m=g("calendar","weekdayrow"),z=g("calendar","weekday"),E=g("calendar","column-hidden"),k=g("calendar","day-selected"),y=g("calendar","selection-disabled"),D=g("calendar","row"),s=g("calendar","day"),O=g("calendar","prevmonth-day"),q=g("calendar","nextmonth-day"),B=g("calendar","anchor"),P=g("calendar","pane"),g=g("calendar","status"),F=f.Lang,C=F.sub,H=f.Array.each,I=f.Object.each,J=f.Array.indexOf,G=f.Object.hasKey, N=f.Object.setValue,K=f.Object.isEmpty,w=f.DataType.Date;f.CalendarBase=f.extend(a,f.Widget,{_paneProperties:{},_paneNumber:1,_calendarId:null,_selectedDates:{},_rules:{},_filterFunction:null,_storedDateCells:{},initializer:function(){this._paneProperties={};this._calendarId=f.guid("calendar");this._selectedDates={};K(this._rules)&&(this._rules={});this._storedDateCells={}},renderUI:function(){this.get("contentBox").appendChild(this._initCalendarHTML(this.get("date")));this.get("showPrevMonth")&& this._afterShowPrevMonthChange();this.get("showNextMonth")&&this._afterShowNextMonthChange();this._renderCustomRules();this._renderSelectedDates();this.get("boundingBox").setAttribute("aria-labelledby",this._calendarId+"_header")},bindUI:function(){this.after("dateChange",this._afterDateChange);this.after("showPrevMonthChange",this._afterShowPrevMonthChange);this.after("showNextMonthChange",this._afterShowNextMonthChange);this.after("headerRendererChange",this._afterHeaderRendererChange);this.after("customRendererChange", this._afterCustomRendererChange);this.after("enabledDatesRuleChange",this._afterCustomRendererChange);this.after("disabledDatesRuleChange",this._afterCustomRendererChange);this.after("focusedChange",this._afterFocusedChange);this.after("selectionChange",this._renderSelectedDates);this._bindCalendarEvents()},_getSelectedDatesList:function(){var a=[];I(this._selectedDates,function(b){I(b,function(b){I(b,function(b){a.push(b)},this)},this)},this);return a},_getSelectedDatesInMonth:function(a){var b= a.getFullYear();a=a.getMonth();return G(this._selectedDates,b)&&G(this._selectedDates[b],a)?f.Object.values(this._selectedDates[b][a]):[]},_isNumInList:function(a,b){if("all"===b)return!0;for(var d=b.split(","),e=d.length,f;e--;)if(f=d[e].split("-"),2===f.length&&a>=parseInt(f[0],10)&&a<=parseInt(f[1],10)||1===f.length&&parseInt(d[e],10)===a)return!0;return!1},_getRulesForDate:function(a){var b=a.getFullYear(),d=a.getMonth(),e=a.getDate();a=a.getDay();var f=this._rules,k=[],g,l,y,s;for(g in f)if(this._isNumInList(b, g))if(F.isString(f[g]))k.push(f[g]);else for(l in f[g])if(this._isNumInList(d,l))if(F.isString(f[g][l]))k.push(f[g][l]);else for(y in f[g][l])if(this._isNumInList(e,y))if(F.isString(f[g][l][y]))k.push(f[g][l][y]);else for(s in f[g][l][y])this._isNumInList(a,s)&&F.isString(f[g][l][y][s])&&k.push(f[g][l][y][s]);return k},_matchesRule:function(a,b){return 0<=J(this._getRulesForDate(a),b)},_canBeSelected:function(a){var b=this.get("enabledDatesRule"),d=this.get("disabledDatesRule");return b?this._matchesRule(a, b):d?!this._matchesRule(a,d):!0},selectDates:function(a){w.isValidDate(a)?this._addDateToSelection(a):F.isArray(a)&&this._addDatesToSelection(a);return this},deselectDates:function(a){a?w.isValidDate(a)?this._removeDateFromSelection(a):F.isArray(a)&&this._removeDatesFromSelection(a):this._clearSelection();return this},_addDateToSelection:function(a,b){a=this._normalizeTime(a);if(this._canBeSelected(a)){var d=a.getFullYear(),e=a.getMonth(),f=a.getDate();G(this._selectedDates,d)?G(this._selectedDates[d], e)||(this._selectedDates[d][e]={}):(this._selectedDates[d]={},this._selectedDates[d][e]={});this._selectedDates[d][e][f]=a;this._selectedDates=N(this._selectedDates,[d,e,f],a);b||this._fireSelectionChange()}},_addDatesToSelection:function(a){H(a,this._addDateToSelection,this);this._fireSelectionChange()},_addDateRangeToSelection:function(a,b){var d=6E4*(b.getTimezoneOffset()-a.getTimezoneOffset()),e=a.getTime(),f=b.getTime(),k;e>f?(k=e,e=f,f=k+d):f-=d;for(d=e;d<=f;d+=864E5)e=new Date(d),e.setHours(12), this._addDateToSelection(e,d);this._fireSelectionChange()},_removeDateFromSelection:function(a,b){var d=a.getFullYear(),e=a.getMonth(),f=a.getDate();G(this._selectedDates,d)&&(G(this._selectedDates[d],e)&&G(this._selectedDates[d][e],f))&&(delete this._selectedDates[d][e][f],b||this._fireSelectionChange())},_removeDatesFromSelection:function(a){H(a,this._removeDateFromSelection,this);this._fireSelectionChange()},_removeDateRangeFromSelection:function(a,b){for(var d=a.getTime(),e=b.getTime();d<=e;d+= 864E5)this._removeDateFromSelection(new Date(d),d);this._fireSelectionChange()},_clearSelection:function(a){this._selectedDates={};this.get("contentBox").all("."+k).removeClass(k).setAttribute("aria-selected",!1);a||this._fireSelectionChange()},_fireSelectionChange:function(){this.fire("selectionChange",{newSelection:this._getSelectedDatesList()})},_restoreModifiedCells:function(){var a=this.get("contentBox"),b;for(b in this._storedDateCells)a.one("#"+b).replace(this._storedDateCells[b]),delete this._storedDateCells[b]}, _renderCustomRules:function(){this.get("contentBox").all("."+s+",."+q).removeClass(y).setAttribute("aria-disabled",!1);if(!K(this._rules)){var a,b;for(a=0;a<this._paneNumber;a++)b=w.addMonths(this.get("date"),a),b=w.listOfDatesInMonth(b),H(b,f.bind(this._renderCustomRulesHelper,this))}},_renderCustomRulesHelper:function(a){var b=this.get("enabledDatesRule"),d=this.get("disabledDatesRule"),e;e=this._getRulesForDate(a);0<e.length?((b&&0>J(e,b)||!b&&d&&0<=J(e,d))&&this._disableDate(a),F.isFunction(this._filterFunction)&& (b=this._dateToNode(a),this._storedDateCells[b.get("id")]=b.cloneNode(!0),this._filterFunction(a,b,e))):b&&this._disableDate(a)},_renderSelectedDates:function(){this.get("contentBox").all("."+k).removeClass(k).setAttribute("aria-selected",!1);var a,b;for(a=0;a<this._paneNumber;a++)b=w.addMonths(this.get("date"),a),b=this._getSelectedDatesInMonth(b),H(b,f.bind(this._renderSelectedDatesHelper,this))},_renderSelectedDatesHelper:function(a){this._dateToNode(a).addClass(k).setAttribute("aria-selected", !0)},_disableDate:function(a){this._dateToNode(a).addClass(y).setAttribute("aria-disabled",!0)},_dateToNode:function(a){var b=a.getDate(),d=0,e=b%7;a=(12+a.getMonth()-this.get("date").getMonth())%12;var f=this._paneProperties[this._calendarId+"_pane_"+a].cutoffCol;switch(e){case 0:d=6<=f?12:5;break;case 1:d=6;break;case 2:d=0<f?7:0;break;case 3:d=1<f?8:1;break;case 4:d=2<f?9:2;break;case 5:d=3<f?10:3;break;case 6:d=4<f?11:4}return this.get("contentBox").one("#"+this._calendarId+"_pane_"+a+"_"+d+"_"+ b)},_nodeToDate:function(a){a=a.get("id").split("_").reverse();var b=parseInt(a[2],10);a=parseInt(a[0],10);var d=w.addMonths(this.get("date"),b),b=d.getFullYear(),d=d.getMonth();return new Date(b,d,a,12,0,0,0)},_bindCalendarEvents:function(){},_normalizeDate:function(a){return a?new Date(a.getFullYear(),a.getMonth(),1,12,0,0,0):null},_normalizeTime:function(a){return a?new Date(a.getFullYear(),a.getMonth(),a.getDate(),12,0,0,0):null},_getCutoffColumn:function(a,b){return 6-(this._normalizeDate(a).getDay()- b+7)%7},_turnPrevMonthOn:function(a){var b=a.get("id"),d=w.daysInMonth(w.addMonths(this._paneProperties[b].paneDate,-1)),e;this._paneProperties[b].hasOwnProperty("daysInPrevMonth")||(this._paneProperties[b].daysInPrevMonth=0);if(d!==this._paneProperties[b].daysInPrevMonth){this._paneProperties[b].daysInPrevMonth=d;for(e=5;0<=e;e--)a.one("#"+b+"_"+e+"_"+(e-5)).set("text",d--)}},_turnPrevMonthOff:function(a){var b=a.get("id"),d;this._paneProperties[b].daysInPrevMonth=0;for(d=5;0<=d;d--)a.one("#"+b+ "_"+d+"_"+(d-5)).setContent(" ")},_cleanUpNextMonthCells:function(a){var b=a.get("id");a.one("#"+b+"_6_29").removeClass(q);a.one("#"+b+"_7_30").removeClass(q);a.one("#"+b+"_8_31").removeClass(q);a.one("#"+b+"_0_30").removeClass(q);a.one("#"+b+"_1_31").removeClass(q)},_turnNextMonthOn:function(a){var b=1,d=a.get("id"),e=this._paneProperties[d].daysInMonth,f=this._paneProperties[d].cutoffCol,k;for(k=e-22;k<f+7;k++)a.one("#"+d+"_"+k+"_"+(k+23)).set("text",b++).addClass(q);k=f;for(31===e&&1>=f?k= 2:30===e&&0===f&&(k=1);k<f+7;k++)a.one("#"+d+"_"+k+"_"+(k+30)).set("text",b++).addClass(q)},_turnNextMonthOff:function(a){var b=a.get("id"),d=this._paneProperties[b].daysInMonth,e=this._paneProperties[b].cutoffCol,f;for(f=d-22;12>=f;f++)a.one("#"+b+"_"+f+"_"+(f+23)).setContent(" ").addClass(q);f=0;for(31===d&&1>=e?f=2:30===d&&0===e&&(f=1);12>=f;f++)a.one("#"+b+"_"+f+"_"+(f+30)).setContent(" ").addClass(q)},_afterShowNextMonthChange:function(){var a=this.get("contentBox").one("#"+this._calendarId+ "_pane_"+(this._paneNumber-1));this._cleanUpNextMonthCells(a);this.get("showNextMonth")?this._turnNextMonthOn(a):this._turnNextMonthOff(a)},_afterShowPrevMonthChange:function(){var a=this.get("contentBox").one("#"+this._calendarId+"_pane_0");this.get("showPrevMonth")?this._turnPrevMonthOn(a):this._turnPrevMonthOff(a)},_afterHeaderRendererChange:function(){this.get("contentBox").one("."+n).setContent(this._updateCalendarHeader(this.get("date")))},_afterCustomRendererChange:function(){this._restoreModifiedCells(); this._renderCustomRules()},_afterDateChange:function(){var a=this.get("contentBox"),d=a.one("."+r).one("."+n),e=a.all("."+b),f=this.get("date"),k=0;a.setStyle("visibility","hidden");d.setContent(this._updateCalendarHeader(f));this._restoreModifiedCells();e.each(function(a){this._rerenderCalendarPane(w.addMonths(f,k++),a)},this);this._afterShowPrevMonthChange();this._afterShowNextMonthChange();this._renderCustomRules();this._renderSelectedDates();a.setStyle("visibility","inherit")},_initCalendarPane:function(b, d){var e=this.get("strings.very_short_weekdays")||"Su Mo Tu We Th Fr Sa".split(" "),k=f.Intl.get("datatype-date-format").A,g=this.get("strings.first_weekday")||0,y=this._getCutoffColumn(b,g),t=w.daysInMonth(b),l=" ".split(" "),m={},D,z,n;m.weekday_row="";for(D=g;D<=g+6;D++)m.weekday_row+=C(a.WEEKDAY_TEMPLATE,{short_weekdayname:e[D%7],weekdayname:k[D%7]});m.weekday_row_template=C(a.WEEKDAY_ROW_TEMPLATE,m);for(e=0;5>=e;e++)for(k=0;12>=k;k++){g=7*e-5+k;D=d+"_"+k+"_"+g;z=s;1>g?z=O:g>t&&(z=q);if(1> g||g>t)g=" ";n=k>=y&&k<y+7?"":E;l[e]+=C(a.CALDAY_TEMPLATE,{day_content:g,calendar_col_class:"calendar_col"+k,calendar_col_visibility_class:n,calendar_day_class:z,calendar_day_id:D})}m.body_template="";H(l,function(b){m.body_template+=C(a.CALDAY_ROW_TEMPLATE,{calday_row:b})});m.calendar_pane_id=d;m.calendar_pane_tabindex=this.get("tabIndex");m.pane_arialabel=w.format(b,{format:"%B %Y"});l=C(C(a.CALENDAR_GRID_TEMPLATE,m),a.CALENDAR_STRINGS);this._paneProperties[d]={cutoffCol:y,daysInMonth:t,paneDate:b}; return l},_rerenderCalendarPane:function(a,b){var d=this.get("strings.first_weekday")||0,d=this._getCutoffColumn(a,d),e=w.daysInMonth(a),f=b.get("id"),k,g;b.setStyle("visibility","hidden");b.setAttribute("aria-label",w.format(a,{format:"%B %Y"}));for(k=0;12>=k;k++)if(g=b.all(".calendar_col"+k),g.removeClass(E),k<d||k>=d+7)g.addClass(E);else switch(k){case 0:g=b.one("#"+f+"_0_30");30<=e?(g.set("text","30"),g.removeClass(q).addClass(s)):(g.setContent(" "),g.removeClass(s).addClass(q));break;case 1:g= b.one("#"+f+"_1_31");31<=e?(g.set("text","31"),g.removeClass(q).addClass(s)):(g.setContent(" "),g.removeClass(s).addClass(q));break;case 6:g=b.one("#"+f+"_6_29");29<=e?(g.set("text","29"),g.removeClass(q).addClass(s)):(g.setContent(" "),g.removeClass(s).addClass(q));break;case 7:g=b.one("#"+f+"_7_30");30<=e?(g.set("text","30"),g.removeClass(q).addClass(s)):(g.setContent(" "),g.removeClass(s).addClass(q));break;case 8:g=b.one("#"+f+"_8_31"),31<=e?(g.set("text","31"),g.removeClass(q).addClass(s)): (g.setContent(" "),g.removeClass(s).addClass(q))}this._paneProperties[f].cutoffCol=d;this._paneProperties[f].daysInMonth=e;this._paneProperties[f].paneDate=a;b.setStyle("visibility","inherit")},_updateCalendarHeader:function(a){var b="",d=this.get("headerRenderer");f.Lang.isString(d)?b=w.format(a,{format:d}):d instanceof Function&&(b=d.call(this,a));return b},_initCalendarHeader:function(b){return C(C(a.HEADER_TEMPLATE,{calheader:this._updateCalendarHeader(b),calendar_id:this._calendarId}),a.CALENDAR_STRINGS)}, _initCalendarHTML:function(b){var d={},e=0,k,g;d.header_template=this._initCalendarHeader(b);d.calendar_id=this._calendarId;d.body_template=C(C(a.CONTENT_TEMPLATE,d),a.CALENDAR_STRINGS);g=d.body_template.replace(/\{calendar_grid_template\}/g,f.bind(function(){k=this._initCalendarPane(w.addMonths(b,e),d.calendar_id+"_pane_"+e);e++;return k},this));this._paneNumber=e;return g}},{CALENDAR_STRINGS:{calendar_grid_class:b,calendar_body_class:u,calendar_hd_class:r,calendar_hd_label_class:n,calendar_weekdayrow_class:m, calendar_weekday_class:z,calendar_row_class:D,calendar_day_class:s,calendar_dayanchor_class:B,calendar_pane_class:P,calendar_right_grid_class:d,calendar_left_grid_class:e,calendar_status_class:g},CONTENT_TEMPLATE:'<div class="yui3-g {calendar_pane_class}" id="{calendar_id}">{header_template}<div class="yui3-u-1">{calendar_grid_template}</div></div>',ONE_PANE_TEMPLATE:'<div class="yui3-g {calendar_pane_class}" id="{calendar_id}">{header_template}<div class="yui3-u-1">{calendar_grid_template}</div></div>', TWO_PANE_TEMPLATE:'<div class="yui3-g {calendar_pane_class}" id="{calendar_id}">{header_template}<div class="yui3-u-1-2"><div class = "{calendar_left_grid_class}">{calendar_grid_template}</div></div><div class="yui3-u-1-2"><div class = "{calendar_right_grid_class}">{calendar_grid_template}</div></div></div>',THREE_PANE_TEMPLATE:'<div class="yui3-g {calendar_pane_class}" id="{calendar_id}">{header_template}<div class="yui3-u-1-3"><div class="{calendar_left_grid_class}">{calendar_grid_template}</div></div><div class="yui3-u-1-3">{calendar_grid_template}</div><div class="yui3-u-1-3"><div class="{calendar_right_grid_class}">{calendar_grid_template}</div></div></div>', CALENDAR_GRID_TEMPLATE:'<table class="{calendar_grid_class}" id="{calendar_pane_id}" role="grid" aria-readonly="true" aria-label="{pane_arialabel}" tabindex="{calendar_pane_tabindex}"><thead>{weekday_row_template}</thead><tbody>{body_template}</tbody></table>',HEADER_TEMPLATE:'<div class="yui3-g {calendar_hd_class}"><div class="yui3-u {calendar_hd_label_class}" id="{calendar_id}_header" aria-role="heading">{calheader}</div></div>',WEEKDAY_ROW_TEMPLATE:'<tr class="{calendar_weekdayrow_class}" role="row">{weekday_row}</tr>', CALDAY_ROW_TEMPLATE:'<tr class="{calendar_row_class}" role="row">{calday_row}</tr>',WEEKDAY_TEMPLATE:'<th class="{calendar_weekday_class}" role="columnheader" aria-label="{weekdayname}">{short_weekdayname}</th>',CALDAY_TEMPLATE:'<td class="{calendar_col_class} {calendar_day_class} {calendar_col_visibility_class}" id="{calendar_day_id}" role="gridcell" tabindex="-1">{day_content}</td>',NAME:"calendarBase",ATTRS:{tabIndex:{value:1},date:{value:new Date,setter:function(a){a=this._normalizeDate(a);return w.areEqual(a, this.get("date"))?this.get("date"):a}},showPrevMonth:{value:!1},showNextMonth:{value:!1},strings:{valueFn:function(){return f.Intl.get("calendar-base")}},headerRenderer:{value:"%B %Y"},enabledDatesRule:{value:null},disabledDatesRule:{value:null},selectedDates:{readOnly:!0,getter:function(){return this._getSelectedDatesList()}},customRenderer:{lazyAdd:!1,value:{},setter:function(a){this._rules=a.rules;this._filterFunction=a.filterFunction}}}})},"3.17.2",{requires:["widget","datatype-date","datatype-date-math", "cssgrids"],lang:"de en es es-AR fr hu it ja nb-NO nl pt-BR ru zh-Hans zh-Hans-CN zh-Hant zh-Hant-HK zh-HANT-TW".split(" "),skinnable:!0})},1401:function(u,B){YUI.add("calendar",function(f,v){function a(){a.superclass.constructor.apply(this,arguments)}var g=f.ClassNameManager.getClassName,b=g("calendar","day-selected"),e=g("calendar","day-highlighted"),d=g("calendar","day"),u=g("calendar","prevmonth-day"),r=g("calendar","nextmonth-day"),n=g("calendar","grid"),m=f.DataType.Date,z=g("calendar","pane"), E=f.UA.os;f.Calendar=f.extend(a,f.CalendarBase,{_keyEvents:[],_highlightedDateNode:null,_lastSelectedDate:null,initializer:function(){this.plug(f.Plugin.CalendarNavigator);this._keyEvents=[];this._lastSelectedDate=this._highlightedDateNode=null},_bindCalendarEvents:function(){var a=this.get("contentBox").one("."+z);a.on("selectstart",this._preventSelectionStart);a.delegate("click",this._clickCalendar,"."+d+", ."+u+", ."+r,this);a.delegate("keydown",this._keydownCalendar,"."+n,this);a.delegate("focus", this._focusCalendarGrid,"."+n,this);a.delegate("focus",this._focusCalendarCell,"."+d,this);a.delegate("blur",this._blurCalendarGrid,"."+n+",."+d,this);this.after(["minimumDateChange","maximumDateChange"],this._afterCustomRendererChange)},_preventSelectionStart:function(a){a.preventDefault()},_highlightDateNode:function(a){this._unhighlightCurrentDateNode();a=this._dateToNode(a);a.focus();a.addClass(e)},_unhighlightCurrentDateNode:function(){var a=this.get("contentBox").all("."+e);a&&a.removeClass(e)}, _getGridNumber:function(a){a=a.get("id").split("_").reverse();return parseInt(a[0],10)},_blurCalendarGrid:function(){this._unhighlightCurrentDateNode()},_focusCalendarCell:function(a){this._highlightedDateNode=a.target;a.stopPropagation()},_focusCalendarGrid:function(){this._unhighlightCurrentDateNode();this._highlightedDateNode=null},_keydownCalendar:function(a){var d=this._getGridNumber(a.target),e=!this._highlightedDateNode?null:this._nodeToDate(this._highlightedDateNode),f=a.keyCode,g=0,z;switch(f){case 40:g= 7;break;case 38:g=-7;break;case 37:g=-1;break;case 39:g=1;break;case 32:case 13:if(a.preventDefault(),this._highlightedDateNode)if(z=this.get("selectionMode"),"single"===z&&!this._highlightedDateNode.hasClass(b))this._clearSelection(!0),this._addDateToSelection(e);else if("multiple"===z||"multiple-sticky"===z)this._highlightedDateNode.hasClass(b)?this._removeDateFromSelection(e):this._addDateToSelection(e)}if(40===f||38===f||37===f||39===f)e||(e=m.addMonths(this.get("date"),d),g=0),a.preventDefault(), a=m.addDays(e,g),d=this.get("date"),e=m.addMonths(this.get("date"),this._paneNumber-1),f=new Date(e),e.setDate(m.daysInMonth(e)),m.isInRange(a,d,e)?this._highlightDateNode(a):m.isGreater(d,a)?m.isGreaterOrEqual(this.get("minimumDate"),d)||(this.set("date",m.addMonths(d,-1)),this._highlightDateNode(a)):m.isGreater(a,e)&&!m.isGreaterOrEqual(f,this.get("maximumDate"))&&(this.set("date",m.addMonths(d,1)),this._highlightDateNode(a))},_clickCalendar:function(a){var e=a.currentTarget,f=e.hasClass(d)&&!e.hasClass(u)&& !e.hasClass(r),g=e.hasClass(b);switch(this.get("selectionMode")){case "single":f&&!g&&(this._clearSelection(!0),this._addDateToSelection(this._nodeToDate(e)));break;case "multiple-sticky":f&&(g?this._removeDateFromSelection(this._nodeToDate(e)):this._addDateToSelection(this._nodeToDate(e)));break;case "multiple":f&&(!a.metaKey&&!a.ctrlKey&&!a.shiftKey?(this._clearSelection(!0),this._lastSelectedDate=this._nodeToDate(e),this._addDateToSelection(this._lastSelectedDate)):("macintosh"===E&&a.metaKey|| "macintosh"!==E&&a.ctrlKey)&&!a.shiftKey?g?(this._removeDateFromSelection(this._nodeToDate(e)),this._lastSelectedDate=null):(this._lastSelectedDate=this._nodeToDate(e),this._addDateToSelection(this._lastSelectedDate)):("macintosh"===E&&a.metaKey||"macintosh"!==E&&a.ctrlKey)&&a.shiftKey?this._lastSelectedDate?(a=this._nodeToDate(e),this._addDateRangeToSelection(a,this._lastSelectedDate),this._lastSelectedDate=a):(this._lastSelectedDate=this._nodeToDate(e),this._addDateToSelection(this._lastSelectedDate)): a.shiftKey&&(this._lastSelectedDate?(a=this._nodeToDate(e),this._clearSelection(!0),this._addDateRangeToSelection(a,this._lastSelectedDate),this._lastSelectedDate=a):(this._clearSelection(!0),this._lastSelectedDate=this._nodeToDate(e),this._addDateToSelection(this._lastSelectedDate))))}f?this.fire("dateClick",{cell:e,date:this._nodeToDate(e)}):e.hasClass(u)?this.fire("prevMonthClick"):e.hasClass(r)&&this.fire("nextMonthClick")},_canBeSelected:function(b){var d=this.get("minimumDate"),e=this.get("maximumDate"); return d&&!m.isGreaterOrEqual(b,d)||e&&m.isGreater(b,e)?!1:a.superclass._canBeSelected.call(this,b)},_renderCustomRules:function(){a.superclass._renderCustomRules.call(this);var b=this.get("minimumDate"),d=this.get("maximumDate"),e=[],f,g;if(b||d){for(g=0;g<this._paneNumber;g++)f=m.addMonths(this.get("date"),g),e=e.concat(m.listOfDatesInMonth(f));if(b){f=0;for(g=e.length;f<g&&!m.isGreaterOrEqual(e[f],b);f++)this._disableDate(e[f])}if(d)for(f=e.length-1;0<=f;f--)if(m.isGreater(e[f],d))this._disableDate(e[f]); else break}},subtractMonth:function(a){this.set("date",m.addMonths(this.get("date"),-1));a&&a.halt();return this},subtractYear:function(a){this.set("date",m.addYears(this.get("date"),-1));a&&a.halt();return this},addMonth:function(a){this.set("date",m.addMonths(this.get("date"),1));a&&a.halt();return this},addYear:function(a){this.set("date",m.addYears(this.get("date"),1));a&&a.halt();return this}},{NAME:"calendar",ATTRS:{selectionMode:{value:"single"},date:{value:new Date,lazyAdd:!1,setter:function(a){a= this._normalizeDate(a);var b=m.addMonths(a,this._paneNumber-1),d=this.get("minimumDate"),e=this.get("maximumDate");if((!d||m.isGreaterOrEqual(a,d))&&(!e||m.isGreaterOrEqual(e,b)))return a;if(d&&m.isGreater(d,a))return this._normalizeDate(d);if(e&&m.isGreater(b,e))return m.addMonths(this._normalizeDate(e),1-this._paneNumber)}},minimumDate:{value:null,setter:function(a){if(f.Lang.isDate(a)){var b=this.get("date"),d=this._normalizeTime(a);b&&!m.isGreaterOrEqual(b,d)&&this.set("date",a);return d}return null}}, maximumDate:{value:null,setter:function(a){if(f.Lang.isDate(a)){var b=this.get("date");b&&!m.isGreaterOrEqual(a,m.addMonths(b,this._paneNumber-1))&&this.set("date",m.addMonths(this._normalizeDate(a),1-this._paneNumber));return this._normalizeTime(a)}return null}}}})},"3.17.2",{requires:["calendar-base","calendarnavigator"],skinnable:!0})},1402:function(u,B){YUI.add("calendarnavigator",function(f,v){function a(){a.superclass.constructor.apply(this,arguments)}var g=f.ClassNameManager.getClassName,b= f.Lang.sub,e=f.Node.create,d=g("calendar","header"),u=g("calendarnav","prevmonth"),r=g("calendarnav","nextmonth"),n=g("calendarnav","month-disabled"),m=f.DataType.Date;a.NS="navigator";a.NAME="pluginCalendarNavigator";a.ATTRS={shiftByMonths:{value:1}};a.CALENDARNAV_STRINGS={prev_month_class:u,next_month_class:r};a.PREV_MONTH_CONTROL_TEMPLATE='<a class="yui3-u {prev_month_class}" role="button" aria-label="{prev_month_arialabel}" tabindex="{control_tabindex}" />';a.NEXT_MONTH_CONTROL_TEMPLATE='<a class="yui3-u {next_month_class}" role="button" aria-label="{next_month_arialabel}" tabindex="{control_tabindex}" />'; f.extend(a,f.Plugin.Base,{_eventAttachments:{},_controls:{},initializer:function(){this._controls={};this._eventAttachments={};this.afterHostMethod("renderUI",this._initNavigationControls)},destructor:function(){},_focusNavigation:function(a){a.currentTarget.focus()},_subtractMonths:function(a){if("click"===a.type||"keydown"===a.type&&(13===a.keyCode||32===a.keyCode)){var b=this.get("host"),d=b.get("date");b.set("date",m.addMonths(d,-1*this.get("shiftByMonths")));a.preventDefault()}},_addMonths:function(a){if("click"=== a.type||"keydown"===a.type&&(13===a.keyCode||32===a.keyCode)){var b=this.get("host"),d=b.get("date");b.set("date",m.addMonths(d,this.get("shiftByMonths")));a.preventDefault()}},_updateControlState:function(){var a=this.get("host"),b=a.get("date"),d=m.addMonths(b,a._paneNumber-1),e=a._normalizeDate(a.get("minimumDate")),a=a._normalizeDate(a.get("maximumDate"));m.areEqual(e,b)?(this._eventAttachments.prevMonth&&(this._eventAttachments.prevMonth.detach(),this._eventAttachments.prevMonth=!1),this._controls.prevMonth.hasClass(n)|| this._controls.prevMonth.addClass(n).setAttribute("aria-disabled","true")):(this._eventAttachments.prevMonth||(this._eventAttachments.prevMonth=this._controls.prevMonth.on(["click","keydown"],this._subtractMonths,this)),this._controls.prevMonth.hasClass(n)&&this._controls.prevMonth.removeClass(n).setAttribute("aria-disabled","false"));m.areEqual(a,d)?(this._eventAttachments.nextMonth&&(this._eventAttachments.nextMonth.detach(),this._eventAttachments.nextMonth=!1),this._controls.nextMonth.hasClass(n)|| this._controls.nextMonth.addClass(n).setAttribute("aria-disabled","true")):(this._eventAttachments.nextMonth||(this._eventAttachments.nextMonth=this._controls.nextMonth.on(["click","keydown"],this._addMonths,this)),this._controls.nextMonth.hasClass(n)&&this._controls.nextMonth.removeClass(n).setAttribute("aria-disabled","false"));this._controls.prevMonth.on(["click","keydown"],this._focusNavigation,this);this._controls.nextMonth.on(["click","keydown"],this._focusNavigation,this)},_renderPrevControls:function(){var d= e(b(a.PREV_MONTH_CONTROL_TEMPLATE,a.CALENDARNAV_STRINGS));d.on("selectstart",this.get("host")._preventSelectionStart);return d},_renderNextControls:function(){var d=e(b(a.NEXT_MONTH_CONTROL_TEMPLATE,a.CALENDARNAV_STRINGS));d.on("selectstart",this.get("host")._preventSelectionStart);return d},_initNavigationControls:function(){var b=this.get("host"),e=b.get("contentBox").one("."+d);a.CALENDARNAV_STRINGS.control_tabindex=b.get("tabIndex");a.CALENDARNAV_STRINGS.prev_month_arialabel="Go to previous month"; a.CALENDARNAV_STRINGS.next_month_arialabel="Go to next month";this._controls.prevMonth=this._renderPrevControls();this._controls.nextMonth=this._renderNextControls();this._updateControlState();b.after(["dateChange","minimumDateChange","maximumDateChange"],this._updateControlState,this);e.prepend(this._controls.prevMonth);e.append(this._controls.nextMonth)}});f.namespace("Plugin").CalendarNavigator=a},"3.17.2",{requires:["plugin","classnamemanager","datatype-date","node"],skinnable:!0})},1705:function(u, B,f){var v=f(1);YUI.add("squarespace-calendar-block-renderer",function(a){a.namespace("Squarespace");a.Squarespace.CalendarBlockRenderer={};a.Squarespace.CalendarBlockRenderer.renderCalendar=function(b,e,d){if(!a.Lang.isString(e))if(a.Object.hasKey(e,"collectionId"))if(null!==e.collectionId)e=e.collectionId;else{d=v('<div class="sqs-state-message">Please choose a collection for this calendar to display.</div>');b.empty().setHTML(d);return}else e=a.instanceOf(e,a.Squarespace.Models.ContentCollection)? e.get("id"):CONFIG_PANEL.getPreviewFrameCollection().get("id");e={date:new Date,collectionId:e};a.Lang.isValue(d)&&a.merge(e,{pageCollectionId:d});d=new a.Squarespace.SquarespaceCalendar(e);d.plug(a.Squarespace.SquarespaceCalendarRenderer);d.render(b);return d};var f;a.config.win.Squarespace.onInitialize(a,function(){f=[];var b=a.all(".sqs-block.calendar-block[data-block-json]");b.size()&&b.each(function(b){var d=b.one(".sqs-block-content");b=a.JSON.parse(b.getAttribute("data-block-json"));f.push(a.Squarespace.CalendarBlockRenderer.renderCalendar(d, b))},this)});a.config.win.Squarespace.onDestroy(a,function(){f.forEach(function(a){a.destroy()});f=null})},"1.0",{requires:["squarespace-calendar-core-renderer"]})}});