meshviewer/vendor/Intl.min.js

1 line
27 KiB
JavaScript
Raw Normal View History

2015-03-28 22:27:18 +00:00
(function(){"use strict";function a(a){return _.test(a)?ab.test(a)?!1:bb.test(a)?!1:!0:!1}function b(a){var b,c;a=a.toLowerCase(),c=a.split("-");for(var d=1,e=c.length;e>d;d++)if(2===c[d].length)c[d]=c[d].toUpperCase();else if(4===c[d].length)c[d]=c[d].charAt(0).toUpperCase()+c[d].slice(1);else if(1===c[d].length&&"x"!=c[d])break;a=nb.call(c,"-"),(b=a.match(cb))&&b.length>1&&(b.sort(),a=a.replace(RegExp("(?:"+cb.source+")+","i"),nb.call(b,""))),gb.call(xb.tags,a)&&(a=xb.tags[a]),c=a.split("-");for(var d=1,e=c.length;e>d;d++)gb.call(xb.subtags,c[d])?c[d]=xb.subtags[c[d]]:gb.call(xb.extLang,c[d])&&(c[d]=xb.extLang[c[d]][0],1===d&&xb.extLang[c[1]][1]===c[0]&&(c=kb.call(c,d++),e-=1));return nb.call(c,"-")}function c(){return O}function d(a){var b=String(a),c=L(b);return vb.test(c)===!1?!1:!0}function e(c){if(void 0===c)return new J;for(var d=new J,c="string"==typeof c?[c]:c,e=M(c),f=e.length,g=0;f>g;){var h=String(g),i=h in e;if(i){var j=e[h];if(null==j||"string"!=typeof j&&"object"!=typeof j)throw new TypeError("String or Object type expected");var k=String(j);if(!a(k))throw new RangeError("'"+k+"' is not a structurally valid language tag");k=b(k),-1===ib.call(d,k)&&mb.call(d,k)}g++}return d}function f(a,b){for(var c=b;;){if(ib.call(a,c)>-1)return c;var d=c.lastIndexOf("-");if(0>d)return;d>=2&&"-"==c.charAt(d-2)&&(d-=2),c=c.substring(0,d)}}function g(a,b){for(var d,e=0,g=b.length;g>e&&!d;){var h=b[e],i=String(h).replace(wb,""),d=f(a,i);e++}var j=new I;if(void 0!==d){if(j["[[locale]]"]=d,String(h)!==String(i)){var k=h.match(wb)[0],l=h.indexOf("-u-");j["[[extension]]"]=k,j["[[extensionIndex]]"]=l}}else j["[[locale]]"]=c();return j}function h(a,b){return g(a,b)}function i(a,b,c,d,e){if(0===a.length)throw new ReferenceError("No locale data has been provided for this object yet.");var f=c["[[localeMatcher]]"];if("lookup"===f)var i=g(a,b);else var i=h(a,b);var j=i["[[locale]]"];if(gb.call(i,"[[extension]]"))var k=i["[[extension]]"],l=i["[[extensionIndex]]"],m=String.prototype.split,n=m.call(k,"-"),o=n.length;var p=new I;p["[[dataLocale]]"]=j;for(var q="-u",r=0,s=d.length;s>r;){var t=d[r],u=e[j],v=u[t],w=v[0],x="",y=ib;if(void 0!==n){var z=y.call(n,t);if(-1!==z)if(o>z+1&&n[z+1].length>2){var A=n[z+1],B=y.call(v,A);if(-1!==B)var w=A,x="-"+t+"-"+w}else{var B=y(v,"true");if(-1!==B)var w="true"}}if(gb.call(c,"[["+t+"]]")){var C=c["[["+t+"]]"];-1!==y.call(v,C)&&C!==w&&(w=C,x="")}p["[["+t+"]]"]=w,q+=x,r++}if(q.length>2)var D=j.substring(0,l),E=j.substring(l),j=D+q+E;return p["[[locale]]"]=j,p}function j(a,b){for(var c=b.length,d=new J,e=0;c>e;){var g=b[e],h=String(g).replace(wb,""),i=f(a,h);void 0!==i&&mb.call(d,g),e++}var j=kb.call(d);return j}function k(a,b){return j(a,b)}function l(a,b,c){if(void 0!==c){var c=new I(M(c)),d=c.localeMatcher;if(void 0!==d&&(d=String(d),"lookup"!==d&&"best fit"!==d))throw new RangeError('matcher should be "lookup" or "best fit"')}if(void 0===d||"best fit"===d)var e=k(a,b);else var e=j(a,b);for(var f in e)gb.call(e,f)&&hb(e,f,{writable:!1,configurable:!1,value:e[f]});return hb(e,"length",{writable:!1}),e}function m(a,b,c,d,e){var f=a[b];if(void 0!==f){if(f="boolean"===c?Boolean(f):"string"===c?String(f):f,void 0!==d&&-1===ib.call(d,f))throw new RangeError("'"+f+"' is not an allowed value for `"+b+"`");return f}return e}function n(a,b,c,d,e){var f=a[b];if(void 0!==f){if(f=Number(f),isNaN(f)||c>f||f>d)throw new RangeError("Value is not a number or outside accepted range");return Math.floor(f)}return e}function o(){var a=arguments[0],b=arguments[1];return this&&this!==db?p(M(this),a,b):new db.NumberFormat(a,b)}function p(a,b,c){var f=N(a),g=K();if(f["[[initializedIntlObject]]"]===!0)throw new TypeError("`this` object has already been initialized as an Intl object");hb(a,"__getInternalProperties",{value:function(){return arguments[0]===rb?f:void 0}}),f["[[initializedIntlObject]]"]=!0;var h=e(b);c=void 0===c?{}:M(c);var j=new I,k=m(c,"localeMatcher","string",new J("lookup","best fit"),"best fit");j["[[localeMatcher]]"]=k;var l=qb.NumberFormat["[[localeData]]"],o=i(qb.NumberFormat["[[availableLocales]]"],h,j,q