/*
	Copyright (c) 2004-2016, The JS Foundation All Rights Reserved.
	Available via Academic Free License >= 2.1 OR the modified BSD license.
	see: http://dojotoolkit.org/license for details
*/

//>>built
define("dojo/date/locale","../_base/lang ../_base/array ../date ../cldr/supplemental ../i18n ../regexp ../string ../i18n!../cldr/nls/gregorian module".split(" "),function(t,q,w,B,x,G,y,K,C){function H(c,e,d,f){return f.replace(/([a-z])\1*/ig,function(g){var b=g.charAt(0);g=g.length;var l=["abbr","wide","narrow"];switch(b){case "G":var a=e[4>g?"eraAbbr":"eraNames"][0>c.getFullYear()?0:1];break;case "y":a=c.getFullYear();switch(g){case 1:break;case 2:if(!d.fullYear){a=String(a);a=a.substr(a.length-
2);break}default:var k=!0}break;case "Q":case "q":a=Math.ceil((c.getMonth()+1)/3);k=!0;break;case "M":case "L":a=c.getMonth();3>g?(a+=1,k=!0):(b=["months","L"==b?"standAlone":"format",l[g-3]].join("-"),a=e[b][a]);break;case "w":a=m._getWeekOfYear(c,0);k=!0;break;case "d":a=c.getDate();k=!0;break;case "D":a=m._getDayOfYear(c);k=!0;break;case "e":case "c":if(a=c.getDay(),2>g){a=(a-B.getFirstDayOfWeek(d.locale)+8)%7;break}case "E":a=c.getDay();3>g?(a+=1,k=!0):(b=["days","c"==b?"standAlone":"format",
l[g-3]].join("-"),a=e[b][a]);break;case "a":b=12>c.getHours()?"am":"pm";a=d[b]||e["dayPeriods-format-wide-"+b];break;case "h":case "H":case "K":case "k":k=c.getHours();switch(b){case "h":a=k%12||12;break;case "H":a=k;break;case "K":a=k%12;break;case "k":a=k||24}k=!0;break;case "m":a=c.getMinutes();k=!0;break;case "s":a=c.getSeconds();k=!0;break;case "S":a=Math.round(c.getMilliseconds()*Math.pow(10,g-3));k=!0;break;case "v":case "z":if(a=m._getZone(c,!0,d))break;g=4;case "Z":b=m._getZone(c,!1,d);b=
[0>=b?"+":"-",y.pad(Math.floor(Math.abs(b)/60),2),y.pad(Math.abs(b)%60,2)];4==g&&(b.splice(0,0,"GMT"),b.splice(3,0,":"));a=b.join("");break;default:throw Error("dojo.date.locale.format: invalid pattern char: "+f);}k&&(a=y.pad(a,g));return a})}function u(c,e,d,f){var g=function(a){return a};e=e||g;d=d||g;f=f||g;var b=c.match(/(''|[^'])+/g),l="'"==c.charAt(0);q.forEach(b,function(a,k){a?(b[k]=(l?d:e)(a.replace(/''/g,"'")),l=!l):b[k]=""});return f(b.join(""))}function I(c,e,d,f){f=G.escapeString(f);
d.strict||(f=f.replace(" a"," ?a"));return f.replace(/([a-z])\1*/ig,function(g){var b=g.charAt(0);var l=g.length,a="",k="";d.strict?(1<l&&(a="0{"+(l-1)+"}"),2<l&&(k="0{"+(l-2)+"}")):(a="0?",k="0{0,2}");switch(b){case "y":b="\\d{2,4}";break;case "M":case "L":2<l?(b=e["months-"+("L"==b?"standAlone":"format")+"-"+J[l-3]].slice(0).join("|"),d.strict||(b=b.replace(/\./g,""),b="(?:"+b+")\\.?")):b="1[0-2]|"+a+"[1-9]";break;case "D":b="[12][0-9][0-9]|3[0-5][0-9]|36[0-6]|"+a+"[1-9][0-9]|"+k+"[1-9]";break;
case "d":b="3[01]|[12]\\d|"+a+"[1-9]";break;case "w":b="[1-4][0-9]|5[0-3]|"+a+"[1-9]";break;case "E":case "e":case "c":b=".+?";break;case "h":b="1[0-2]|"+a+"[1-9]";break;case "k":b="1[01]|"+a+"\\d";break;case "H":b="1\\d|2[0-3]|"+a+"\\d";break;case "K":b="1\\d|2[0-4]|"+a+"[1-9]";break;case "m":case "s":b="[0-5]\\d";break;case "S":b="\\d{"+l+"}";break;case "a":l=d.am||e["dayPeriods-format-wide-am"];a=d.pm||e["dayPeriods-format-wide-pm"];b=l+"|"+a;d.strict||(l!=l.toLowerCase()&&(b+="|"+l.toLowerCase()),
a!=a.toLowerCase()&&(b+="|"+a.toLowerCase()),-1!=b.indexOf(".")&&(b+="|"+b.replace(/\./g,"")));b=b.replace(/\./g,"\\.");break;default:b=".*"}c&&c.push(g);return"("+b+")"}).replace(/[\xa0 ]/g,"[\\s\\xa0]")}var m={};t.setObject(C.id.replace(/\//g,"."),m);m._getZone=function(c,e,d){return e?w.getTimezoneName(c):c.getTimezoneOffset()};m.format=function(c,e){e=e||{};var d=x.normalizeLocale(e.locale),f=e.formatLength||"short";d=m._getGregorianBundle(d);var g=[],b=t.hitch(this,H,c,d,e);if("year"==e.selector)return u(d["dateFormatItem-yyyy"]||
"yyyy",b);var l;"date"!=e.selector&&(l=e.timePattern||d["timeFormat-"+f])&&g.push(u(l,b));"time"!=e.selector&&(l=e.datePattern||d["dateFormat-"+f])&&g.push(u(l,b));return 1==g.length?g[0]:d["dateTimeFormat-"+f].replace(/'/g,"").replace(/\{(\d+)\}/g,function(a,k){return g[k]})};m.regexp=function(c){return m._parseInfo(c).regexp};m._parseInfo=function(c){c=c||{};var e=x.normalizeLocale(c.locale);e=m._getGregorianBundle(e);var d=c.formatLength||"short",f=c.datePattern||e["dateFormat-"+d],g=c.timePattern||
e["timeFormat-"+d];d="date"==c.selector?f:"time"==c.selector?g:e["dateTimeFormat-"+d].replace(/\{(\d+)\}/g,function(l,a){return[g,f][a]});var b=[];return{regexp:u(d,t.hitch(this,I,b,e,c)),tokens:b,bundle:e}};m.parse=function(c,e){var d=/[\u200E\u200F\u202A\u202E]/g,f=m._parseInfo(e),g=f.tokens,b=f.bundle;d=(new RegExp("^"+f.regexp.replace(d,"")+"$",f.strict?"":"i")).exec(c&&c.replace(d,""));if(!d)return null;var l=["abbr","wide","narrow"],a=[1970,0,1,0,0,0,0],k="";d=q.every(d,function(h,D){if(!D)return!0;
var p=g[D-1],n=p.length;p=p.charAt(0);switch(p){case "y":if(2!=n&&e.strict)a[0]=h;else if(100>h)h=Number(h),p=""+(new Date).getFullYear(),n=100*p.substring(0,2),p=Math.min(Number(p.substring(2,4))+20,99),a[0]=h<p?n+h:n-100+h;else{if(e.strict)return!1;a[0]=h}break;case "M":case "L":if(2<n){if(n=b["months-"+("L"==p?"standAlone":"format")+"-"+l[n-3]].concat(),e.strict||(h=h.replace(".","").toLowerCase(),n=q.map(n,function(z){return z.replace(".","").toLowerCase()})),h=q.indexOf(n,h),-1==h)return!1}else h--;
a[1]=h;break;case "E":case "e":case "c":n=b["days-"+("c"==p?"standAlone":"format")+"-"+l[n-3]].concat();e.strict||(h=h.toLowerCase(),n=q.map(n,function(z){return z.toLowerCase()}));h=q.indexOf(n,h);if(-1==h)return!1;break;case "D":a[1]=0;case "d":a[2]=h;break;case "a":n=e.am||b["dayPeriods-format-wide-am"];p=e.pm||b["dayPeriods-format-wide-pm"];if(!e.strict){var A=/\./g;h=h.replace(A,"").toLowerCase();n=n.replace(A,"").toLowerCase();p=p.replace(A,"").toLowerCase()}if(e.strict&&h!=n&&h!=p)return!1;
k=h==p?"p":h==n?"a":"";break;case "K":24==h&&(h=0);case "h":case "H":case "k":if(23<h)return!1;a[3]=h;break;case "m":a[4]=h;break;case "s":a[5]=h;break;case "S":a[6]=h}return!0});f=+a[3];"p"===k&&12>f?a[3]=f+12:"a"===k&&12==f&&(a[3]=0);f=new Date(a[0],a[1],a[2],a[3],a[4],a[5],a[6]);e.strict&&f.setFullYear(a[0]);var r=g.join(""),E=-1!=r.indexOf("d");r=-1!=r.indexOf("M");if(!d||r&&f.getMonth()>a[1]||E&&f.getDate()>a[2])return null;if(r&&f.getMonth()<a[1]||E&&f.getDate()<a[2])f=w.add(f,"hour",1);return f};
var J=["abbr","wide","narrow"],F=[],v={};m.addCustomFormats=function(c,e){F.push({pkg:c,name:e});v={}};m._getGregorianBundle=function(c){if(v[c])return v[c];var e={};q.forEach(F,function(d){d=x.getLocalization(d.pkg,d.name,c);e=t.mixin(e,d)},this);return v[c]=e};m.addCustomFormats(C.id.replace(/\/date\/locale$/,".cldr"),"gregorian");m.getNames=function(c,e,d,f){f=m._getGregorianBundle(f);c=[c,d,e];if("standAlone"==d){d=c.join("-");var g=f[d];1==g[0]&&(g=void 0)}c[1]="format";return(g||f[c.join("-")]).concat()};
m.isWeekend=function(c,e){var d=B.getWeekend(e),f=(c||new Date).getDay();d.end<d.start&&(d.end+=7,f<d.start&&(f+=7));return f>=d.start&&f<=d.end};m._getDayOfYear=function(c){return w.difference(new Date(c.getFullYear(),0,1,c.getHours()),c)+1};m._getWeekOfYear=function(c,e){1==arguments.length&&(e=0);var d=(new Date(c.getFullYear(),0,1)).getDay(),f=(d-e+7)%7;f=Math.floor((m._getDayOfYear(c)+f-1)/7);d==e&&f++;return f};return m});