text: !function(e,a){"function"==typeof define&&define.amd?define(["cldr","../globalize","./number","cldr/event","cldr/supplemental"],a):"object"==typeof exports?module.exports=a(require("cldrjs"),require("../globalize")):a(e.Cldr,e.Globalize)}(this,function(t,e){var d=e._createError,b=e._createErrorUnsupportedFeature,y=e._formatMessage,k=e._isPlainObject,D=e._looseMatching,w=e._numberNumberingSystemDigitsMap,H=e._numberSymbol,Z=e._regexpEscape,v=e._removeLiteralQuotes,f=e._runtimeBind,h=e._stringPad,r=e._validate,n=e._validateCldr,g=e._validateDefaultLocale,z=e._validateParameterPresence,s=e._validateParameterType,p=e._validateParameterTypePlainObject,M=e._validateParameterTypeString,N=function(e,a){s(e,a,void 0===e||e instanceof Date,"Date")},F="GyYuUrQqMLlwWEecdDFghHKkmsSAzZOvVXx".split("").reduce(function(e,a,t){return e[a]=t,e},{}),a=function(t,r){return r=r||function(e,a,t){return e[t]=a,e},Object.keys(t).reduce(function(e,a){return r(e,a,t[a])},{})},i=a({e:"eEc",L:"ML"},function(a,t,e){return e.split("").forEach(function(e){a[e]=t}),a}),T=function(e){return i[e]||e},O=/([a-z])\1*|'([^']|'')+'|''|./gi,l=function(e,a){var t,r="";for(t=0;t<a;t++)r+=e;return r};var c=function(e,a,t){var r,n,s;return r=(n=e.match(/S/g))?n.length:0,-1!==(s=(a=function(e,a){var t,r,n,s,i,o,u,m,c=T;for(m=e.match(O),n=a.match(O),t=0;t<n.length;t++)for(s=n[t].charAt(0),i=n[t].length,r=0;r<m.length;r++)o=m[r].charAt(0),u=m[r].length,c(s)===c(o)&&i<u&&(n[t]=l(s,u));return n.join("")}(e.replace(/S/g,""),a)).lastIndexOf("s"))&&0!==r&&(a=a.slice(0,s+1)+t+l("S",r)+a.slice(s+1)),a},E=function(e,a){var t,r,n,s,i,o,u,m,c,l=T;if(e===a)return 0;if(e=e.match(O),a=a.match(O),e.length!==a.length)return-1;for(n=1,m=0;m<e.length;m++){for(o=l(t=e[m].charAt(0)),u=null,c=0;c<a.length&&o!==(u=l(r=a[c].charAt(0)));c++)u=null;if(null===u)return-1;s=e[m].length,i=a[c].length,n+=Math.abs(s-i),t!==r&&(n+=1),(s<3&&3<=i||3<=s&&i<3)&&(n+=20)}return n},x=function(e,a){var t,r,n,s,i,o="dates/calendars/gregorian/dateTimeFormats/availableFormats",u=c,m=E;if(n=e.main([o,a]),a&&!n){for(i in s=[],t=e.main([o]))s.push({skeleton:i,pattern:t[i],rate:m(a,i)});(s=s.filter(function(e){return-1<e.rate}).sort(function(e,a){return e.rate-a.rate})).length&&(r=H("decimal",e),n=u(a,s[0].pattern,r))}return n},S=function(e,r){var a,t,n,s,i,o,u,m,c,l=x;function f(e,a,t){return y(r.main(["dates/calendars/gregorian/dateTimeFormats",e]),[t,a])}switch(!0){case"skeleton"in e:if(n=(n=e.skeleton).replace(/j/g,function(){return r.supplemental.timeData.preferred()}),c=F,(u=n).replace(/[^GyYuUrQqMLlwWEecdDFghHKkmsSAzZOvVXx]/,function(e){throw d("E_INVALID_OPTIONS","Invalid field `{invalidField}` of skeleton `{value}`",{invalidField:e,type:"skeleton",value:u})}),u.split("").every(function(e){if(c[e]<m)throw d("E_INVALID_OPTIONS","Invalid order `{invalidField}` of skeleton `{value}`",{invalidField:e,type:"skeleton",value:u});return m=c[e],!0}),t=l(r,n))break;s=n.split(/[^hHKkmsSAzZOvVXx]/).slice(-1)[0],a=n.split(/[^GyYuUrQqMLlwWdDFgEec]/)[0],a=l(r,a),s=l(r,s),i=/(MMMM|LLLL).*[Ec]/.test(a)?"full":/MMMM|LLLL/.test(a)?"long":/MMM|LLL/.test(a)?"medium":"short",t=a&&s?f(i,a,s):a||s;break;case"date"in e:case"time"in e:t=r.main(["dates/calendars/gregorian","date"in e?"dateFormats":"timeFormats",e.date||e.time]);break;case"datetime"in e:t=f(e.datetime,r.main(["dates/calendars/gregorian/dateFormats",e.datetime]),r.main(["dates/calendars/gregorian/timeFormats",e.datetime]));break;case"raw"in e:t=e.raw;break;default:throw d("E_INVALID_PAR_VALUE","Invalid `{name}` value ({value}).",{name:{name:"options",value:e},value:o})}return t},A=["sun","mon","tue","wed","thu","fri","sat"],_=function(e){return A.indexOf(e.supplemental.weekData.firstDay())},L=function(e,a,t,r){var n,s;if(t)return(s=r.main(["dates/timeZoneNames/zone",t,e<4?"short":"long",a]))?s:(n=r.supplemental(["metaZones/metazoneInfo/timezone",t,0,"usesMetazone/_mzone"]),r.main(["dates/timeZoneNames/metazone",n,e<4?"short":"long",a]))},P=function(e){return e.split(";").map(function(e){return e.slice(0,e.indexOf("H")+1)}).join(";")},I=function(e,t){return e.split(";").map(function(e){var a=e.split(/H+/);return a.splice(1,0,t),a.join("")}).join(";")},R=function(e,a){var t=function(){return a};return t.dataCacheKey=e,t},q=function(){function t(e,a,t){Object.defineProperty(e,a,{value:t})}function r(e,a){for(var t=0,r=e.getTime();t<a.length-1&&r>=a[t];)t++;return t}function n(e){var a=this.getTimezoneOffset(),t=e();this.original.setTime(new Date(this.getTime()));var r=this.getTimezoneOffset();return r-a&&this.original.setMinutes(this.original.getMinutes()+r-a),t}var s=function(e,a){if(t(this,"original",new Date(e.getTime())),t(this,"local",new Date(e.getTime())),t(this,"timeZoneData",a),t(this,"setWrap",n),!(a.untils&&a.offsets&&a.isdsts))throw new Error("Invalid IANA data");this.setTime(this.local.getTime()-60*this.getTimezoneOffset()*1e3)};return s.prototype.clone=function(){return new s(this.original,this.timeZoneData)},["getFullYear","getMonth","getDate","getDay","getHours","getMinutes","getSeconds","getMilliseconds"].forEach(function(e){var a="getUTC"+e.substr(3);s.prototype[e]=function(){return this.local[a]()}}),s.prototype.valueOf=s.prototype.getTime=function(){return this.local.getTime()+60*this.getTimezoneOffset()*1e3},s.prototype.getTimezoneOffset=function(){var e=r(this.original,this.timeZoneData.untils);return this.timeZoneData.offsets[e]},["setFullYear","setMonth","setDate","setHours","setMinutes","setSeconds","setMilliseconds"].forEach(function(e){var t="setUTC"+e.substr(3);s.prototype[e]=function(e){var a=this.local;return this.setWrap(function(){return a[t](e)})}}),s.prototype.setTime=function(e){return this.local.setTime(e)},s.prototype.isDST=function(){var e=r(this.original,this.timeZoneData.untils);return Boolean(this.timeZoneData.isdsts[e])},s.prototype.inspect=function(){var e=r(this.original,this.timeZoneData.untils),a=this.timeZoneData.abbrs;return this.local.toISOString().replace(/Z$/,"")+" "+(a&&a[e]+" "||-1*this.getTimezoneOffset()+" ")+(this.isDST()?"(daylight savings)":"")},s.prototype.toDate=function(){return new Date(this.getTime())},["toISOString","toJSON","toUTCString"].forEach(function(e){s.prototype[e]=function(){return this.toDate()[e]()}}),s}(),j=function(e,a){switch(e=e instanceof q?e.clone():new Date(e.getTime()),a){case"year":e.setMonth(0);case"month":e.setDate(1);case"day":e.setHours(0);case"hour":e.setMinutes(0);case"minute":e.setSeconds(0);case"second":e.setMilliseconds(0)}return e},Y=function(e,a){var t,r,n,s=e.getDate();e.setDate(1),e.setMonth(a),t=e,r=s,n=new Date(t.getFullYear(),t.getMonth()+1,0).getDate(),t.setDate(r<1?1:r<n?r:n)},V=function(e,a,t){return e<a||t<e},o=function(e,a,n){var s,i,o,u,m,c,l,f,t,r,d=new Date,g=[];if(n.timeZoneData&&(d=new q(d,n.timeZoneData())),!a.length)return null;if(!a.every(function(e){var a,t,r;if("literal"===e.type)return!0;switch(a=e.type.charAt(0),r=e.type.length,"j"===a&&(a=n.preferredTimeData),a){case"G":g.push(0),m=+e.value;break;case"y":if(t=e.value,2===r){if(V(t,0,99))return!1;(t+=100*Math.floor(d.getFullYear()/100))>d.getFullYear()+20&&(t-=100)}d.setFullYear(t),g.push(0);break;case"Y":throw b({feature:"year pattern `"+a+"`"});case"Q":case"q":break;case"M":case"L":if(t=r<=2?e.value:+e.value,V(t,1,12))return!1;u=t,g.push(1);break;case"w":case"W":break;case"d":i=e.value,g.push(2);break;case"D":o=e.value,g.push(2);break;case"F":break;case"e":case"c":case"E":break;case"a":s=e.value;break;case"h":if(t=e.value,V(t,1,12))return!1;c=l=!0,d.setHours(12===t?0:t),g.push(3);break;case"K":if(t=e.value,V(t,0,11))return!1;c=l=!0,d.setHours(t),g.push(3);break;case"k":if(t=e.value,V(t,1,24))return!1;c=!0,d.setHours(24===t?0:t),g.push(3);break;case"H":if(t=e.value,V(t,0,23))return!1;c=!0,d.setHours(t),g.push(3);break;case"m":if(t=e.value,V(t,0,59))return!1;d.setMinutes(t),g.push(4);break;case"s":if(t=e.value,V(t,0,59))return!1;d.setSeconds(t),g.push(5);break;case"A":d.setHours(0),d.setMinutes(0),d.setSeconds(0);case"S":t=Math.round(e.value*Math.pow(10,3-r)),d.setMilliseconds(t),g.push(6);break;case"z":case"Z":case"O":case"v":case"V":case"X":case"x":"number"==typeof e.value&&(f=e.value)}return!0}))return null;if(c&&!(!s^l))return null;if(0===m&&d.setFullYear(-1*d.getFullYear()+1),void 0!==u&&Y(d,u-1),void 0!==i){if(V(i,1,(r=d,new Date(r.getFullYear(),r.getMonth()+1,0).getDate())))return null;d.setDate(i)}else if(void 0!==o){if(V(o,1,(t=d.getFullYear(),1===new Date(t,1,29).getMonth()?366:365)))return null;d.setMonth(0),d.setDate(o)}return l&&"pm"===s&&d.setHours(d.getHours()+12),void 0!==f&&d.setMinutes(d.getMinutes()+f-d.getTimezoneOffset()),g=Math.max.apply(null,g),(d=j(d,["year","month","day","hour","minute","second","milliseconds"][g]))instanceof q&&(d=d.toDate()),d},Q=function(t,r,n){return function(e){var l,f,d,g,a,p,h;return z(e,"value"),M(e,"value"),l=e,f=t,p=[],h=["abbreviated","wide","narrow"],g=(d=n).digitsRe,l=D(l),a=d.pattern.match(O).every(function(e){var a,t,r,n,s={};function i(e,a){var t,r,n=l.match(e);return a=a||function(e){return+e},!!n&&(r=n[1],n.length<6?(t=r?1:3,s.value=60*a(n[t])):n.length<10?(t=r?[1,3]:[5,7],s.value=60*a(n[t[0]])+a(n[t[1]])):(t=r?[1,3,5]:[7,9,11],s.value=60*a(n[t[0]])+a(n[t[1]])+a(n[t[2]])/60),r&&(s.value*=-1),!0)}function o(){if(1===t)return r=!0,n=g}function u(){if(1===t||2===t)return r=!0,n=new RegExp("^("+g.source+"){1,2}")}function m(){if(2===t)return r=!0,n=new RegExp("^("+g.source+"){2}")}function c(e){var a=d[e.join("/")];return a&&a.some(function(e){if(e[1].test(l))return s.value=e[0],n=e[1],!0}),null}switch(a=(s.type=e).charAt(0),t=e.length,"Z"===a&&(t=t<4?(a="x",4):t<5?(a="O",4):(a="X",5)),"z"===a&&d.standardOrDaylightTzName&&(s.value=null,n=d.standardOrDaylightTzName),"v"===a&&(d.genericTzName?(s.value=null,n=d.genericTzName):(a="V",t=4)),"V"===a&&d.timeZoneName&&(s.value=2===t?d.timeZoneName:null,n=d.timeZoneNameRe),a){case"G":c(["gregorian/eras",t<=3?"eraAbbr":4===t?"eraNames":"eraNarrow"]);break;case"y":case"Y":r=!0,n=1===t?new RegExp("^("+g.source+")+"):2===t?new RegExp("^("+g.source+"){1,2}"):new RegExp("^("+g.source+"){"+t+",}");break;case"Q":case"q":o()||m()||c(["gregorian/quarters","Q"===a?"format":"stand-alone",h[t-3]]);break;case"M":case"L":u()||c(["gregorian/months","M"===a?"format":"stand-alone",h[t-3]]);break;case"D":t<=3&&(r=!0,n=new RegExp("^("+g.source+"){"+t+",3}"));break;case"W":case"F":o();break;case"e":case"c":if(t<=2){o()||m();break}case"E":6===t?c(["gregorian/days",["c"===a?"stand-alone":"format"],"short"])||c(["gregorian/days",["c"===a?"stand-alone":"format"],"abbreviated"]):c(["gregorian/days",["c"===a?"stand-alone":"format"],h[t<3?0:t-3]]);break;case"a":c(["gregorian/dayPeriods/format/wide"]);break;case"w":(function(){if(1===t)return r=!0,n=new RegExp("^("+g.source+"){1,2}")})()||m();break;case"d":case"h":case"H":case"K":case"k":case"j":case"m":case"s":u();break;case"S":r=!0,n=new RegExp("^("+g.source+"){"+t+"}");break;case"A":r=!0,n=new RegExp("^("+g.source+"){"+(t+5)+"}");break;case"v":case"V":case"z":if(n&&n.test(l))break;if("V"===a&&2===t)break;case"O":if(l===d["timeZoneNames/gmtZeroFormat"])s.value=0,n=d["timeZoneNames/gmtZeroFormatRe"];else if(!d["timeZoneNames/hourFormat"].some(function(e){if(i(e,f))return n=e,!0}))return null;break;case"X":if("Z"===l){s.value=0,n=/^Z/;break}case"x":if(!d.x.some(function(e){if(i(e))return n=e,!0}))return null;break;case"'":s.type="literal",n=new RegExp("^"+Z(v(e)));break;default:s.type="literal",n=new RegExp("^"+Z(e))}return!(!n||(l=l.replace(n,function(e){return s.lexeme=e,r&&(s.value=f(e)),""}),!s.lexeme||r&&isNaN(s.value)||(p.push(s),0)))}),""!==l&&(a=!1),o(0,a?p:[],r)||null}},U=function(e,a){return(e.getDay()-a+7)%7},X=function(e){return Math.floor((a=j(e,"year"),(e.getTime()-a.getTime())/864e5));var a},C=a({era:"G",year:"yY",quarter:"qQ",month:"ML",week:"wW",day:"dDF",weekday:"ecE",dayperiod:"a",hour:"hHkK",minute:"m",second:"sSA",zone:"zvVOxX"},function(a,t,e){return e.split("").forEach(function(e){a[e]=t}),a}),G=function(e,a,t,r){var n,s=e.getTimezoneOffset();return n=Math.abs(s),r=r||{1:function(e){return h(e,1)},2:function(e){return h(e,2)}},a.split(";")[0<s?1:0].replace(":",t).replace(/HH?/,function(e){return r[e.length](Math.floor(n/60))}).replace(/mm/,function(){return r[2](Math.floor(n%60))}).replace(/ss/,function(){return r[2](Math.floor(n%1*60))})},W=function(o,u,m){var c=[],l=m.timeSeparator;return m.timeZoneData&&(o=new q(o,m.timeZoneData())),m.pattern.replace(O,function(e){var a,t,r,n,s=e.charAt(0),i=e.length;switch("j"===s&&(s=m.preferredTime),"Z"===s&&(i=i<4?(s="x",4):i<5?(s="O",4):(s="X",5)),"z"===s&&(o.isDST&&(r=o.isDST()?m.daylightTzName:m.standardTzName),r||(s="O",i<4&&(i=1))),s){case"G":r=m.eras[o.getFullYear()<0?0:1];break;case"y":r=o.getFullYear(),2===i&&(r=+(r=String(r)).substr(r.length-2));break;case"Y":(r=new Date(o.getTime())).setDate(r.getDate()+7-U(o,m.firstDay)-m.firstDay-m.minDays),r=r.getFullYear(),2===i&&(r=+(r=String(r)).substr(r.length-2));break;case"Q":case"q":r=Math.ceil((o.getMonth()+1)/3),2<i&&(r=m.quarters[s][i][r]);break;case"M":case"L":r=o.getMonth()+1,2<i&&(r=m.months[s][i][r]);break;case"w":r=U(j(o,"year"),m.firstDay),r=Math.ceil((X(o)+r)/7)-(7-r>=m.minDays?0:1);break;case"W":r=U(j(o,"month"),m.firstDay),r=Math.ceil((o.getDate()+r)/7)-(7-r>=m.minDays?0:1);break;case"d":r=o.getDate();break;case"D":r=X(o)+1;break;case"F":r=Math.floor(o.getDate()/7)+1;break;case"e":case"c":if(i<=2){r=U(o,m.firstDay)+1;break}case"E":r=A[o.getDay()],r=m.days[s][i][r];break;case"a":r=m.dayPeriods[o.getHours()<12?"am":"pm"];break;case"h":r=o.getHours()%12||12;break;case"H":r=o.getHours();break;case"K":r=o.getHours()%12;break;case"k":r=o.getHours()||24;break;case"m":r=o.getMinutes();break;case"s":r=o.getSeconds();break;case"S":r=Math.round(o.getMilliseconds()*Math.pow(10,i-3));break;case"A":r=Math.round(((n=o)-j(n,"day"))*Math.pow(10,i-3));break;case"z":break;case"v":if(m.genericTzName){r=m.genericTzName;break}case"V":if(m.timeZoneName){r=m.timeZoneName;break}"v"===e&&(i=1);case"O":r=0===o.getTimezoneOffset()?m.gmtZeroFormat:(a=i<4?(a=o.getTimezoneOffset(),m.hourFormat[a%60-a%1==0?0:1]):m.hourFormat,r=G(o,a,l,u),m.gmtFormat.replace(/\{0\}/,r));break;case"X":if(0===o.getTimezoneOffset()){r="Z";break}case"x":a=o.getTimezoneOffset(),1===i&&a%60-a%1!=0&&(i+=1),4!==i&&5!==i||a%1!=0||(i-=2),r=G(o,r=["+HH;-HH","+HHmm;-HHmm","+HH:mm;-HH:mm","+HHmmss;-HHmmss","+HH:mm:ss;-HH:mm:ss"][i-1],":");break;case":":r=l;break;case"'":r=v(e);break;default:r=e}"number"==typeof r&&(r=u[i](r)),"literal"===(t=C[s]||"literal")&&c.length&&"literal"===c[c.length-1].type?c[c.length-1].value+=r:c.push({type:t,value:r})}),c};function K(e){return void 0!==e.skeleton||void 0!==e.date||void 0!==e.time||void 0!==e.datetime||void 0!==e.raw}function J(e,a){n(e,a,{skip:[/dates\/calendars\/gregorian\/dateTimeFormats\/availableFormats/,/dates\/calendars\/gregorian\/days\/.*\/short/,/dates\/timeZoneNames\/zone/,/dates\/timeZoneNames\/metazone/,/globalize-iana/,/supplemental\/metaZones/,/supplemental\/timeData\/(?!001)/,/supplemental\/weekData\/(?!001)/]})}function B(e){u("date",e),u("time",e),u("datetime",e)}function u(e,a){var t=a[e];r("E_INVALID_OPTIONS",'Invalid `{{type}: "{value}"}`.',void 0===t||-1!==["short","medium","long","full"].indexOf(t),{type:e,value:t})}function $(e,a){r("E_INVALID_OPTIONS",'Invalid `{skeleton: "{value}"}` based on provided CLDR.',void 0===a||"string"==typeof e&&e,{type:"skeleton",value:a})}function ee(t){return function(e,a){/globalize-iana/.test(e)&&r("E_MISSING_IANA_TZ","Missing required IANA timezone content for `{timeZone}`: `{path}`.",a,{path:e.replace(/globalize-iana\//,""),timeZone:t})}}return e.loadTimeZone=function(e){var a={"globalize-iana":e};z(e,"json"),p(e,"json"),t.load(a)},e.dateFormatter=e.prototype.dateFormatter=function(e){var a,t,r,n;return p(e,"options"),K(e=e||{})||(e.skeleton="yMd"),a=[e],t=this.dateToPartsFormatter(e),n=t,r=function(e){return n(e).map(function(e){return e.value}).join("")},f(a,this.cldr,r,[t]),r},e.dateToPartsFormatter=e.prototype.dateToPartsFormatter=function(e){var a,t,r,n,s,i,o,u,m,c,l;for(n in p(e,"options"),t=this.cldr,K(e=e||{})||(e.skeleton="yMd"),B(e),g(t),u=e.timeZone,M(u,"options.timeZone"),a=[e],t.on("get",J),u&&(m=ee(u),t.on("get",m)),$(s=S(e,t),e.skeleton),i=function(c,l,f){var d={numberFormatters:{},pattern:c,timeSeparator:H("timeSeparator",l)},g=["abbreviated","wide","narrow"];function p(e){d.numberFormatters[e]=h("",e)}return f&&(d.timeZoneData=R("iana/"+f,{offsets:l.get(["globalize-iana/zoneData",f,"offsets"]),untils:l.get(["globalize-iana/zoneData",f,"untils"]),isdsts:l.get(["globalize-iana/zoneData",f,"isdsts"])})),c.replace(O,function(e){var a,t,r,n,s,i,o;switch(t=e.charAt(0),i=e.length,"j"===t&&(d.preferredTime=t=l.supplemental.timeData.preferred()),"Z"===t&&4===i&&(t="O",i=4),"z"===t&&(o=L(i,"standard",f,l),r=L(i,"daylight",f,l),o&&(d.standardTzName=o),r&&(d.daylightTzName=r),o&&r||(t="O",i<4&&(i=1))),"v"===t&&((s=L(i,"generic",f,l))||(t="V",i=4)),t){case"G":d.eras=l.main(["dates/calendars/gregorian/eras",i<=3?"eraAbbr":4===i?"eraNames":"eraNarrow"]);break;case"y":n=!0;break;case"Y":d.firstDay=_(l),d.minDays=l.supplemental.weekData.minDays(),n=!0;break;case"u":case"U":throw b({feature:"year pattern `"+t+"`"});case"Q":case"q":2<i?(d.quarters||(d.quarters={}),d.quarters[t]||(d.quarters[t]={}),d.quarters[t][i]=l.main(["dates/calendars/gregorian/quarters","Q"===t?"format":"stand-alone",g[i-3]])):n=!0;break;case"M":case"L":2<i?(d.months||(d.months={}),d.months[t]||(d.months[t]={}),d.months[t][i]=l.main(["dates/calendars/gregorian/months","M"===t?"format":"stand-alone",g[i-3]])):n=!0;break;case"w":case"W":d.firstDay=_(l),d.minDays=l.supplemental.weekData.minDays(),n=!0;break;case"d":case"D":case"F":n=!0;break;case"g":throw b({feature:"Julian day pattern `g`"});case"e":case"c":if(i<=2){d.firstDay=_(l),n=!0;break}case"E":d.days||(d.days={}),d.days[t]||(d.days[t]={}),d.days[t][i]=6===i?l.main(["dates/calendars/gregorian/days","c"===t?"stand-alone":"format","short"])||l.main(["dates/calendars/gregorian/days","c"===t?"stand-alone":"format","abbreviated"]):l.main(["dates/calendars/gregorian/days","c"===t?"stand-alone":"format",g[i<3?0:i-3]]);break;case"a":d.dayPeriods={am:l.main("dates/calendars/gregorian/dayPeriods/format/wide/am"),pm:l.main("dates/calendars/gregorian/dayPeriods/format/wide/pm")};break;case"h":case"H":case"K":case"k":case"m":case"s":case"S":case"A":n=!0;break;case"v":if(1!==i&&4!==i)throw b({feature:"timezone pattern `"+c+"`"});d.genericTzName=s;break;case"V":if(1===i)throw b({feature:"timezone pattern `"+c+"`"});if(f){if(2===i){d.timeZoneName=f;break}var u,m=l.main(["dates/timeZoneNames/zone",f,"exemplarCity"]);if(3===i&&(m||(m=l.main(["dates/timeZoneNames/zone/Etc/Unknown/exemplarCity"])),u=m),m&&4===i&&(u=y(l.main("dates/timeZoneNames/regionFormat"),[m])),u){d.timeZoneName=u;break}}"v"===e&&(i=1);case"O":d.gmtFormat=l.main("dates/timeZoneNames/gmtFormat"),d.gmtZeroFormat=l.main("dates/timeZoneNames/gmtZeroFormat"),a=l.main("dates/timeZoneNames/hourFormat"),d.hourFormat=i<4?[P(a),I(a,"H")]:I(a,"HH");case"Z":case"X":case"x":p(1),p(2)}n&&p(i)}),d}(s,t,u),t.off("get",J),m&&t.off("get",m),r=i.numberFormatters,delete i.numberFormatters,r)r[n]=this.numberFormatter({raw:r[n]});return f(a,t,o=function(e){return z(e,"value"),N(e,"value"),W(e,c,l)},[c=r,l=i]),o},e.dateParser=e.prototype.dateParser=function(e){var a,t,r,n,s,i,o,u,m,c,l;return p(e,"options"),t=this.cldr,K(e=e||{})||(e.skeleton="yMd"),B(e),g(t),o=e.timeZone,M(o,"options.timeZone"),a=[e],t.on("get",J),o&&t.on("get",ee(o)),$(s=S(e,t),e.skeleton),u=function(c,l,f){var d,g={pattern:D(c)},p=H("timeSeparator",l),h=["abbreviated","wide","narrow"];function v(e,a,t,r){var n;return t||(t="\\d"),a||(a="{0}"),n=e.replace("+","\\+").replace(/HH|mm|ss/g,"(("+t+"){2})").replace(/H|m/g,"(("+t+"){1,2})"),r&&(n=n.replace(/:/g,r)),n=n.split(";").map(function(e){return a.replace("{0}",e)}).join("|"),new RegExp("^"+n)}function e(e,a){/(timeZoneNames\/zone|supplemental\/metaZones|timeZoneNames\/metazone|timeZoneNames\/regionFormat|timeZoneNames\/gmtFormat)/.test(e)||a&&("gregorian/dayPeriods/format/wide"===(e=e.replace(/^.*\/dates\//,"").replace(/calendars\//,""))&&(a=function(e,a){var t,r={};for(t in e)a.test(t)&&(r[t]=e[t]);return r}(a,/^am|^pm/)),a=k(a)?Object.keys(a).map(function(e){return[e,new RegExp("^"+Z(D(a[e])))]}).sort(function(e,a){return a[1].source.length-e[1].source.length}):D(a),g[e]=a)}return d=(d=w(l))?"["+d+"]":"\\d",g.digitsRe=new RegExp(d),l.on("get",e),c.match(O).forEach(function(e){var a,t,r,n,s,i;if(t=e.charAt(0),s=e.length,"Z"===t&&(s=s<5?(t="O",4):(t="X",5)),"z"===t&&(i=L(s,"standard",f,l),r=L(s,"daylight",f,l),i&&(i=Z(D(i))),r&&(r=Z(D(r))),(i||r)&&(g.standardOrDaylightTzName=new RegExp("^("+[i,r].filter(function(e){return e}).reduce(function(e,a){return e+"|"+a})+")")),i&&r||(t="O",s<4&&(s=1))),"v"===t){if(1!==s&&4!==s)throw b({feature:"timezone pattern `"+c+"`"});var o=L(s,"generic",f,l);o?(g.genericTzName=new RegExp("^"+Z(D(o))),t="O"):(t="V",s=4)}switch(t){case"G":l.main(["dates/calendars/gregorian/eras",s<=3?"eraAbbr":4===s?"eraNames":"eraNarrow"]);break;case"u":case"U":throw b({feature:"year pattern `"+t+"`"});case"Q":case"q":2<s&&l.main(["dates/calendars/gregorian/quarters","Q"===t?"format":"stand-alone",h[s-3]]);break;case"M":case"L":2<s&&l.main(["dates/calendars/gregorian/months","M"===t?"format":"stand-alone",h[s-3]]);break;case"g":throw b({feature:"Julian day pattern `g`"});case"e":case"c":if(s<=2)break;case"E":6===s?l.main(["dates/calendars/gregorian/days",["c"===t?"stand-alone":"format"],"short"])||l.main(["dates/calendars/gregorian/days",["c"===t?"stand-alone":"format"],"abbreviated"]):l.main(["dates/calendars/gregorian/days",["c"===t?"stand-alone":"format"],h[s<3?0:s-3]]);break;case"a":l.main("dates/calendars/gregorian/dayPeriods/format/wide");break;case"V":if(1===s)throw b({feature:"timezone pattern `"+c+"`"});if(f){if(2===s){g.timeZoneName=f,g.timeZoneNameRe=new RegExp("^"+Z(f));break}var u,m=l.main(["dates/timeZoneNames/zone",f,"exemplarCity"]);3===s&&(m||(m=l.main(["dates/timeZoneNames/zone/Etc/Unknown/exemplarCity"])),u=m),m&&4===s&&(u=y(l.main("dates/timeZoneNames/regionFormat"),[m])),u&&(u=D(u),g.timeZoneName=u,g.timeZoneNameRe=new RegExp("^"+Z(u)))}"v"===e&&(s=1);case"z":case"O":n=l.main("dates/timeZoneNames/gmtFormat"),l.main("dates/timeZoneNames/gmtZeroFormat"),l.main("dates/timeZoneNames/hourFormat"),g["timeZoneNames/gmtZeroFormatRe"]=new RegExp("^"+Z(g["timeZoneNames/gmtZeroFormat"])),a=g["timeZoneNames/hourFormat"],g["timeZoneNames/hourFormat"]=(s<4?[I(a,"H"),P(a)]:[I(a,"HH")]).map(function(e){return v(e,n,d,p)});case"X":case"x":g.x=[["+HHmm;-HHmm","+HH;-HH"],["+HHmm;-HHmm"],["+HH:mm;-HH:mm"],["+HHmmss;-HHmmss","+HHmm;-HHmm"],["+HH:mm:ss;-HH:mm:ss","+HH:mm;-HH:mm"]][s-1].map(function(e){return v(e)})}}),l.off("get",e),g}(s,t,o),c=o,l={preferredTimeData:(m=t).supplemental.timeData.preferred()},c&&(l.timeZoneData=R("iana/"+c,{offsets:m.get(["globalize-iana/zoneData",c,"offsets"]),untils:m.get(["globalize-iana/zoneData",c,"untils"]),isdsts:m.get(["globalize-iana/zoneData",c,"isdsts"])})),n=l,t.off("get",J),o&&t.off("get",ee(o)),r=this.numberParser({raw:"0"}),i=Q(r,n,u),f(a,t,i,[r,n,u]),i},e.formatDate=e.prototype.formatDate=function(e,a){return z(e,"value"),N(e,"value"),this.dateFormatter(a)(e)},e.formatDateToParts=e.prototype.formatDateToParts=function(e,a){return z(e,"value"),N(e,"value"),this.dateToPartsFormatter(a)(e)},e.parseDate=e.prototype.parseDate=function(e,a){return z(e,"value"),M(e,"value"),this.dateParser(a)(e)},e});