tiseza_oss_live/Scripts/globalize.min.js

6 lines
3.1 KiB
JavaScript

/*!
* Globalize v1.4.2 2019-03-07T13:47Z Released under the MIT license
* http://git.io/TrdQbw
*/
!function(e,n){"function"==typeof define&&define.amd?define(["cldr","cldr/event"],n):"object"==typeof exports?module.exports=n(require("cldrjs")):e.Globalize=n(e.Cldr)}(this,function(e){function n(e){e.once("get",v),e.get("supplemental/likelySubtags")}function t(e){return this instanceof t?(p(e,"locale"),h(e,"locale"),this.cldr=A(e),void n(this.cldr)):new t(e)}var r=function(e){return"string"==typeof e?e:"number"==typeof e?""+e:JSON.stringify(e)},i=function(e,n){return e=e.replace(/{[0-9a-zA-Z-_. ]+}/g,function(e){return e=e.replace(/^{([^}]*)}$/,"$1"),r(n[e])})},a=function(){var e=arguments[0],n=[].slice.call(arguments,1);return n.forEach(function(n){var t;for(t in n)e[t]=n[t]}),e},o=function(e,n,t){var r;return n=e+(n?": "+i(n,t):""),r=new Error(n),r.code=e,a(r,t),r},u=function(e){return JSON.stringify(e,function(e,n){return n&&n.runtimeKey?n.runtimeKey:n})},c=function(e){return[].reduce.call(e,function(e,n){var t=n.charCodeAt(0);return e=(e<<5)-e+t,0|e},0)},l=function(e,n,t,r){var i;return r=r||u(t),i=c(e+n+r),i>0?"a"+i:"b"+Math.abs(i)},f=function(e){if(void 0!==e.name)return e.name;var n=/^function\s+([\w\$]+)\s*\(/.exec(e.toString());return n&&n.length>0?n[1]:void 0},d=function(e,n,t,r){var i=u(e),a=f(t),o=n.locale;return a?(t.runtimeKey=l(a,o,null,i),t.generatorString=function(){return'Globalize("'+o+'").'+a+"("+i.slice(1,-1)+")"},t.runtimeArgs=r,t):t},s=function(e,n,t,r){if(!t)throw o(e,n,r)},m=function(e){return Array.isArray(e)?e:e?[e]:[]},v=function(e,n,t){var r;t=t||{},r=m(t.skip).some(function(n){return n.test(e)}),s("E_MISSING_CLDR","Missing required CLDR content `{path}`.",n||r,{path:e})},_=function(e){s("E_DEFAULT_LOCALE_NOT_DEFINED","Default locale has not been defined.",void 0!==e,{})},p=function(e,n){s("E_MISSING_PARAMETER","Missing required parameter `{name}`.",void 0!==e,{name:n})},g=function(e,n,t,r){s("E_PAR_OUT_OF_RANGE","Parameter `{name}` has value `{value}` out of range [{minimum}, {maximum}].",void 0===e||e>=t&&e<=r,{maximum:r,minimum:t,name:n,value:e})},y=function(e,n,t,r){s("E_INVALID_PAR_TYPE","Invalid `{name}` parameter ({value}). {expected} expected.",t,{expected:r,name:n,value:e})},h=function(n,t){y(n,t,void 0===n||"string"==typeof n||n instanceof e,"String or Cldr instance")},E=function(e){return null!==e&&""+e=="[object Object]"},b=function(e,n){y(e,n,void 0===e||E(e),"Plain Object")},A=function(n){return n instanceof e?n:new e(n)},P=function(e){return e.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1")},S=function(e,n,t){var r;for("string"!=typeof e&&(e=String(e)),r=e.length;r<n;r+=1)e=t?e+"0":"0"+e;return e};return t.load=function(){e.load.apply(e,arguments)},t.locale=function(e){return h(e,"locale"),arguments.length&&(this.cldr=A(e),n(this.cldr)),this.cldr},t._alwaysArray=m,t._createError=o,t._formatMessage=i,t._isPlainObject=E,t._objectExtend=a,t._regexpEscape=P,t._runtimeBind=d,t._stringPad=S,t._validate=s,t._validateCldr=v,t._validateDefaultLocale=_,t._validateParameterPresence=p,t._validateParameterRange=g,t._validateParameterTypePlainObject=b,t._validateParameterType=y,t});