UNPKG

ares-ecosystem-ide

Version:

A browser-based code editor and UI designer for Enyo 2 projects

7 lines (5 loc) 845 kB
// lib/enyo-ilib/version.js enyo&&enyo.version&&(enyo.version["enyo-ilib"]="2.3.0-rc.3"); // lib/enyo-ilib/ilib/js/ilib-dyn-standard.js var ilib=ilib||{};ilib.getVersion=function(){return"4.0"},ilib.data={norm:{nfc:{},nfd:{},nfkd:{},ccc:{}}},"undefined"!=typeof window&&(window.ilib=ilib),"undefined"!=typeof exports&&(exports.ilib=ilib),ilib._getPlatform=function(){return ilib._platform||(ilib._platform="undefined"!=typeof environment?"rhino":"undefined"!=typeof process||"undefined"!=typeof require?"nodejs":"undefined"!=typeof window?"undefined"!=typeof PalmSystem?"webos":"browser":"unknown"),ilib._platform},ilib._isGlobal=function(t){switch(ilib._getPlatform()){case"rhino":var i=function(){return"object"==typeof global?global:this}();return void 0!==typeof i[t];case"nodejs":var e="undefined"!=typeof global?global:this;return e&&void 0!==typeof e[t];default:return void 0!==typeof window[t]}},ilib.setLocale=function(t){"string"==typeof t&&(ilib.locale=t)},ilib.getLocale=function(){if("string"!=typeof ilib.locale){if("undefined"!=typeof navigator&&navigator.language!==void 0){if(ilib.locale=navigator.language,!ilib.locale){var t=navigator.browserLanguage!==void 0?navigator.browserLanguage:navigator.userLanguage!==void 0?navigator.userLanguage:navigator.systemLanguage!==void 0?navigator.systemLanguage:void 0;t!==void 0&&t&&(ilib.locale=t.substring(0,3)+t.substring(3,5).toUpperCase())}}else if("undefined"!=typeof PalmSystem&&PalmSystem.locales!==void 0)PalmSystem.locales.UI!==void 0&&PalmSystem.locales.UI.length>0&&(ilib.locale=PalmSystem.locales.UI);else if("undefined"!=typeof environment&&environment.user!==void 0)"string"==typeof environment.user.language&&environment.user.language.length>0&&(ilib.locale=environment.user.language,"string"==typeof environment.user.country&&environment.user.country.length>0&&(ilib.locale+="-"+environment.user.country));else if("undefined"!=typeof process&&process.env!==void 0){var t=process.env.LANG||process.env.LC_ALL;t&&"undefined"!==t&&(ilib.locale=t.substring(0,2).toLowerCase()+"-"+t.substring(3,5).toUpperCase())}ilib.locale="string"==typeof ilib.locale?ilib.locale:"en-US"}return ilib.locale},ilib.setTimeZone=function(t){ilib.tz=t||ilib.tz},ilib.getTimeZone=function(){return ilib.tz===void 0&&("undefined"!=typeof navigator&&navigator.timezone!==void 0?navigator.timezone.length>0&&(ilib.tz=navigator.timezone):"undefined"!=typeof PalmSystem&&PalmSystem.timezone!==void 0?PalmSystem.timezone.length>0&&(ilib.tz=PalmSystem.timezone):"undefined"!=typeof environment&&environment.user!==void 0?environment.user.timezone!==void 0&&environment.user.timezone.length>0&&(ilib.tz=environment.user.timezone):"undefined"!=typeof process&&process.env!==void 0&&process.env.TZ&&"undefined"!==process.env.TZ&&(ilib.tz=process.env.TZ),ilib.tz=ilib.tz||"local"),ilib.tz},ilib.setLoaderCallback=function(t){return"function"==typeof t||t===void 0?(ilib._load=t,!0):!1},ilib.Locale=function(t,i,e,n){if(i===void 0){var a=t||ilib.getLocale();if("string"==typeof a){for(var o=a.split("-"),r=0;o.length>r;r++)ilib.Locale._isLanguageCode(o[r])?this.language=o[r]:ilib.Locale._isRegionCode(o[r])?this.region=o[r]:ilib.Locale._isScriptCode(o[r])?this.script=o[r]:this.variant=o[r];this.language=this.language||void 0,this.region=this.region||void 0,this.script=this.script||void 0,this.variant=this.variant||void 0}else"object"==typeof a&&(this.language=a.language||void 0,this.region=a.region||void 0,this.script=a.script||void 0,this.variant=a.variant||void 0)}else t?(t=t.trim(),this.language=t.length>0?t.toLowerCase():void 0):this.language=void 0,i?(i=i.trim(),this.region=i.length>0?i.toUpperCase():void 0):this.region=void 0,e?(e=e.trim(),this.variant=e.length>0?e:void 0):this.variant=void 0,n?(n=n.trim(),this.script=n.length>0?n:void 0):this.script=void 0;this.spec=this.language||"",this.script&&(this.spec.length>0&&(this.spec+="-"),this.spec+=this.script),this.region&&(this.spec.length>0&&(this.spec+="-"),this.spec+=this.region),this.variant&&(this.spec.length>0&&(this.spec+="-"),this.spec+=this.variant)},ilib.Locale.a2toa3regmap={AF:"AFG",AX:"ALA",AL:"ALB",DZ:"DZA",AS:"ASM",AD:"AND",AO:"AGO",AI:"AIA",AQ:"ATA",AG:"ATG",AR:"ARG",AM:"ARM",AW:"ABW",AU:"AUS",AT:"AUT",AZ:"AZE",BS:"BHS",BH:"BHR",BD:"BGD",BB:"BRB",BY:"BLR",BE:"BEL",BZ:"BLZ",BJ:"BEN",BM:"BMU",BT:"BTN",BO:"BOL",BQ:"BES",BA:"BIH",BW:"BWA",BV:"BVT",BR:"BRA",IO:"IOT",BN:"BRN",BG:"BGR",BF:"BFA",BI:"BDI",KH:"KHM",CM:"CMR",CA:"CAN",CV:"CPV",KY:"CYM",CF:"CAF",TD:"TCD",CL:"CHL",CN:"CHN",CX:"CXR",CC:"CCK",CO:"COL",KM:"COM",CG:"COG",CD:"COD",CK:"COK",CR:"CRI",CI:"CIV",HR:"HRV",CU:"CUB",CW:"CUW",CY:"CYP",CZ:"CZE",DK:"DNK",DJ:"DJI",DM:"DMA",DO:"DOM",EC:"ECU",EG:"EGY",SV:"SLV",GQ:"GNQ",ER:"ERI",EE:"EST",ET:"ETH",FK:"FLK",FO:"FRO",FJ:"FJI",FI:"FIN",FR:"FRA",GF:"GUF",PF:"PYF",TF:"ATF",GA:"GAB",GM:"GMB",GE:"GEO",DE:"DEU",GH:"GHA",GI:"GIB",GR:"GRC",GL:"GRL",GD:"GRD",GP:"GLP",GU:"GUM",GT:"GTM",GG:"GGY",GN:"GIN",GW:"GNB",GY:"GUY",HT:"HTI",HM:"HMD",VA:"VAT",HN:"HND",HK:"HKG",HU:"HUN",IS:"ISL",IN:"IND",ID:"IDN",IR:"IRN",IQ:"IRQ",IE:"IRL",IM:"IMN",IL:"ISR",IT:"ITA",JM:"JAM",JP:"JPN",JE:"JEY",JO:"JOR",KZ:"KAZ",KE:"KEN",KI:"KIR",KP:"PRK",KR:"KOR",KW:"KWT",KG:"KGZ",LA:"LAO",LV:"LVA",LB:"LBN",LS:"LSO",LR:"LBR",LY:"LBY",LI:"LIE",LT:"LTU",LU:"LUX",MO:"MAC",MK:"MKD",MG:"MDG",MW:"MWI",MY:"MYS",MV:"MDV",ML:"MLI",MT:"MLT",MH:"MHL",MQ:"MTQ",MR:"MRT",MU:"MUS",YT:"MYT",MX:"MEX",FM:"FSM",MD:"MDA",MC:"MCO",MN:"MNG",ME:"MNE",MS:"MSR",MA:"MAR",MZ:"MOZ",MM:"MMR",NA:"NAM",NR:"NRU",NP:"NPL",NL:"NLD",NC:"NCL",NZ:"NZL",NI:"NIC",NE:"NER",NG:"NGA",NU:"NIU",NF:"NFK",MP:"MNP",NO:"NOR",OM:"OMN",PK:"PAK",PW:"PLW",PS:"PSE",PA:"PAN",PG:"PNG",PY:"PRY",PE:"PER",PH:"PHL",PN:"PCN",PL:"POL",PT:"PRT",PR:"PRI",QA:"QAT",RE:"REU",RO:"ROU",RU:"RUS",RW:"RWA",BL:"BLM",SH:"SHN",KN:"KNA",LC:"LCA",MF:"MAF",PM:"SPM",VC:"VCT",WS:"WSM",SM:"SMR",ST:"STP",SA:"SAU",SN:"SEN",RS:"SRB",SC:"SYC",SL:"SLE",SG:"SGP",SX:"SXM",SK:"SVK",SI:"SVN",SB:"SLB",SO:"SOM",ZA:"ZAF",GS:"SGS",SS:"SSD",ES:"ESP",LK:"LKA",SD:"SDN",SR:"SUR",SJ:"SJM",SZ:"SWZ",SE:"SWE",CH:"CHE",SY:"SYR",TW:"TWN",TJ:"TJK",TZ:"TZA",TH:"THA",TL:"TLS",TG:"TGO",TK:"TKL",TO:"TON",TT:"TTO",TN:"TUN",TR:"TUR",TM:"TKM",TC:"TCA",TV:"TUV",UG:"UGA",UA:"UKR",AE:"ARE",GB:"GBR",US:"USA",UM:"UMI",UY:"URY",UZ:"UZB",VU:"VUT",VE:"VEN",VN:"VNM",VG:"VGB",VI:"VIR",WF:"WLF",EH:"ESH",YE:"YEM",ZM:"ZMB",ZW:"ZWE"},ilib.Locale.a1toa3langmap={ab:"abk",aa:"aar",af:"afr",ak:"aka",sq:"sqi",am:"amh",ar:"ara",an:"arg",hy:"hye",as:"asm",av:"ava",ae:"ave",ay:"aym",az:"aze",bm:"bam",ba:"bak",eu:"eus",be:"bel",bn:"ben",bh:"bih",bi:"bis",bs:"bos",br:"bre",bg:"bul",my:"mya",ca:"cat",ch:"cha",ce:"che",ny:"nya",zh:"zho",cv:"chv",kw:"cor",co:"cos",cr:"cre",hr:"hrv",cs:"ces",da:"dan",dv:"div",nl:"nld",dz:"dzo",en:"eng",eo:"epo",et:"est",ee:"ewe",fo:"fao",fj:"fij",fi:"fin",fr:"fra",ff:"ful",gl:"glg",ka:"kat",de:"deu",el:"ell",gn:"grn",gu:"guj",ht:"hat",ha:"hau",he:"heb",hz:"her",hi:"hin",ho:"hmo",hu:"hun",ia:"ina",id:"ind",ie:"ile",ga:"gle",ig:"ibo",ik:"ipk",io:"ido",is:"isl",it:"ita",iu:"iku",ja:"jpn",jv:"jav",kl:"kal",kn:"kan",kr:"kau",ks:"kas",kk:"kaz",km:"khm",ki:"kik",rw:"kin",ky:"kir",kv:"kom",kg:"kon",ko:"kor",ku:"kur",kj:"kua",la:"lat",lb:"ltz",lg:"lug",li:"lim",ln:"lin",lo:"lao",lt:"lit",lu:"lub",lv:"lav",gv:"glv",mk:"mkd",mg:"mlg",ms:"msa",ml:"mal",mt:"mlt",mi:"mri",mr:"mar",mh:"mah",mn:"mon",na:"nau",nv:"nav",nb:"nob",nd:"nde",ne:"nep",ng:"ndo",nn:"nno",no:"nor",ii:"iii",nr:"nbl",oc:"oci",oj:"oji",cu:"chu",om:"orm",or:"ori",os:"oss",pa:"pan",pi:"pli",fa:"fas",pl:"pol",ps:"pus",pt:"por",qu:"que",rm:"roh",rn:"run",ro:"ron",ru:"rus",sa:"san",sc:"srd",sd:"snd",se:"sme",sm:"smo",sg:"sag",sr:"srp",gd:"gla",sn:"sna",si:"sin",sk:"slk",sl:"slv",so:"som",st:"sot",az:"azb",es:"spa",su:"sun",sw:"swa",ss:"ssw",sv:"swe",ta:"tam",te:"tel",tg:"tgk",th:"tha",ti:"tir",bo:"bod",tk:"tuk",tl:"tgl",tn:"tsn",to:"ton",tr:"tur",ts:"tso",tt:"tat",tw:"twi",ty:"tah",ug:"uig",uk:"ukr",ur:"urd",uz:"uzb",ve:"ven",vi:"vie",vo:"vol",wa:"wln",cy:"cym",wo:"wol",fy:"fry",xh:"xho",yi:"yid",yo:"yor",za:"zha",zu:"zul"},ilib.Locale._notLower=function(t){var i=t.charCodeAt(0);return 97>i||i>122},ilib.Locale._notUpper=function(t){var i=t.charCodeAt(0);return 65>i||i>90},ilib.Locale._notDigit=function(t){var i=t.charCodeAt(0);return 48>i||i>57},ilib.Locale._isLanguageCode=function(t){if(t===void 0||2>t.length||t.length>3)return!1;for(var i=0;t.length>i;i++)if(ilib.Locale._notLower(t.charAt(i)))return!1;return!0},ilib.Locale._isRegionCode=function(t){if(t===void 0||2>t.length||t.length>3)return!1;if(2===t.length){for(var i=0;t.length>i;i++)if(ilib.Locale._notUpper(t.charAt(i)))return!1}else for(var i=0;t.length>i;i++)if(ilib.Locale._notDigit(t.charAt(i)))return!1;return!0},ilib.Locale._isScriptCode=function(t){if(t===void 0||4!==t.length||ilib.Locale._notUpper(t.charAt(0)))return!1;for(var i=1;4>i;i++)if(ilib.Locale._notLower(t.charAt(i)))return!1;return!0},ilib.Locale.regionAlpha2ToAlpha3=function(t){return ilib.Locale.a2toa3regmap[t]||t},ilib.Locale.languageAlpha1ToAlpha3=function(t){return ilib.Locale.a1toa3langmap[t]||t},ilib.Locale.prototype={getLanguage:function(){return this.language},getLanguageAlpha3:function(){return ilib.Locale.languageAlpha1ToAlpha3(this.language)},getRegion:function(){return this.region},getRegionAlpha3:function(){return ilib.Locale.regionAlpha2ToAlpha3(this.region)},getScript:function(){return this.script},getVariant:function(){return this.variant},getSpec:function(){return this.spec},toString:function(){return this.getSpec()},equals:function(t){return this.language===t.language&&this.region===t.region&&this.script===t.script&&this.variant===t.variant},isPseudo:function(){return"zxx"===this.language&&"XX"===this.region}},ilib.Locale.locales=[],ilib.Locale.getAvailableLocales=function(){return ilib.Locale.locales},ilib.LocaleInfo=function(t,i){var e=!0,n=void 0;switch(this.info=ilib.LocaleInfo.defaultInfo,typeof t){case"string":this.locale=new ilib.Locale(t);break;default:case"undefined":this.locale=new ilib.Locale;break;case"object":this.locale=t}i&&(i.sync!==void 0&&(e=1==i.sync),i.loadParams!==void 0&&(n=i.loadParams)),ilib.LocaleInfo.cache||(ilib.LocaleInfo.cache={}),ilib.loadData({object:ilib.LocaleInfo,locale:this.locale,name:"localeinfo.json",sync:e,loadParams:n,callback:ilib.bind(this,function(t){if(!t){t=ilib.LocaleInfo.defaultInfo;var e=this.locale.getSpec().replace(/-/g,"_");ilib.LocaleInfo.cache[e]=t}this.info=t,i&&"function"==typeof i.onLoad&&i.onLoad(this)})})},ilib.LocaleInfo.defaultInfo=ilib.data.localeinfo,ilib.LocaleInfo.defaultInfo=ilib.LocaleInfo.defaultInfo||{scripts:["Latn"],timezone:"Etc/UTC",units:"metric",calendar:"gregorian",clock:"24",currency:"USD",firstDayOfWeek:1,numfmt:{currencyFormats:{common:"{s}{n}",commonNegative:"{s}-{n}",iso:"{s}{n}",isoNegative:"{s}-{n}"},script:"Latn",decimalChar:",",groupChar:".",prigroupSize:3,secgroupSize:0,pctFmt:"{n}%",negativepctFmt:"-{n}%",pctChar:"%",roundingMode:"halfdown",exponential:"e",digits:""}},ilib.LocaleInfo.prototype={getLanguageName:function(){return this.info["language.name"]},getRegionName:function(){return this.info["region.name"]},getClock:function(){return this.info.clock},getLocale:function(){return this.locale},getUnits:function(){return this.info.units},getCalendar:function(){return this.info.calendar},getFirstDayOfWeek:function(){return this.info.firstDayOfWeek},getTimeZone:function(){return this.info.timezone},getDecimalSeparator:function(){return this.info.numfmt.decimalChar},getNativeDecimalSeparator:function(){return this.info.native_numfmt&&this.info.native_numfmt.decimalChar||this.info.numfmt.decimalChar},getGroupingSeparator:function(){return this.info.numfmt.groupChar},getNativeGroupingSeparator:function(){return this.info.native_numfmt&&this.info.native_numfmt.groupChar||this.info.numfmt.groupChar},getPrimaryGroupingDigits:function(){return this.info.numfmt.prigroupSize!==void 0&&this.info.numfmt.prigroupSize||0},getSecondaryGroupingDigits:function(){return this.info.numfmt.secgroupSize||0},getPercentageFormat:function(){return this.info.numfmt.pctFmt},getNegativePercentageFormat:function(){return this.info.numfmt.negativepctFmt},getPercentageSymbol:function(){return this.info.numfmt.pctChar||"%"},getExponential:function(){return this.info.numfmt.exponential},getNativeExponential:function(){return this.info.native_numfmt&&this.info.native_numfmt.exponential||this.info.numfmt.exponential},getNativePercentageSymbol:function(){return this.info.native_numfmt&&this.info.native_numfmt.pctChar||this.info.numfmt.pctChar||"%"},getNegativeNumberFormat:function(){return this.info.numfmt.negativenumFmt},getCurrencyFormats:function(){return this.info.numfmt.currencyFormats},getCurrency:function(){return this.info.currency},getDigits:function(){return this.info.numfmt.digits},getNativeDigits:function(){return this.info.native_numfmt&&this.info.native_numfmt.digits},getRoundingMode:function(){return this.info.numfmt.roundingMode},getDefaultScript:function(){return this.info.scripts?this.info.scripts[0]:"Latn"},getScript:function(){return this.locale.getScript()||this.getDefaultScript()},getAllScripts:function(){return this.info.scripts||["Latn"]}},ilib.Date=function(t){this.year=t&&t.year||0,this.month=t&&t.month||1,this.day=t&&t.day||1,this.hour=t&&t.hour||0,this.minute=t&&t.minute||0,this.second=t&&t.second||0,this.millisecond=t&&t.millisecond||0},ilib.Date.newInstance=function(t){var i,e=t&&t.locale,n=t&&t.type;if(e||(e=new ilib.Locale),!n){var a=new ilib.LocaleInfo(e);n=a.getCalendar()}return i=ilib.Date._constructors[n],i&&new i(t)},ilib.Date._constructors={},ilib.Date.prototype={getType:function(){return"ilib.Date"},getDays:function(){return this.day},getMonths:function(){return this.month},getYears:function(){return this.year},getHours:function(){return this.hour},getMinutes:function(){return this.minute},getSeconds:function(){return this.second},getMilliseconds:function(){return this.millisecond},setDays:function(t){this.day=t},setMonths:function(t){this.month=t},setYears:function(t){this.year=t},setHours:function(t){this.hour=t},setMinutes:function(t){this.minute=t},setSeconds:function(t){this.second=t},setMilliseconds:function(t){this.millisecond=t}},ilib.bind=function(t,i){function e(t,i){for(var e=[],n=i||0,a=t.length;a>n;n++)e.push(t[n]);return e}if(!t||!i)return void 0;if("function"==typeof i){var n,a=e(arguments,2);return n="function"==typeof i.bind?i.bind.apply(i,[t].concat(a)):function(){var n=e(arguments);return i.apply(t,a.concat(n))}}return void 0},ilib.mod=function(t,i){if(0==i)return 0;var e=t%i;return 0>e?e+i:e},ilib.merge=function(t,i,e,n){var a=void 0,o={};for(a in t)a&&t[a]!==void 0&&(o[a]=t[a]);for(a in i)a&&i[a]!==void 0&&(t[a]instanceof Array&&i[a]instanceof Array?(o[a]=[],o[a]=o[a].concat(t[a]),o[a]=o[a].concat(i[a])):"object"==typeof t[a]&&"object"==typeof i[a]?o[a]=ilib.merge(t[a],i[a]):(e&&n&&o[a]==i[a]&&console.log("Property "+a+" in "+e+" is being overridden by the same value in "+n),o[a]=i[a]));return o},ilib.mergeLocData=function(t,i){var e=void 0,n=i||new ilib.Locale,a=!1,o=t;return e=ilib.data[t]||{},n.getLanguage()&&(o=t+"_"+n.getLanguage(),ilib.data[o]&&(a=!0,e=ilib.merge(e,ilib.data[o]))),n.getRegion()&&(o=t+"_"+n.getRegion(),ilib.data[o]&&(a=!0,e=ilib.merge(e,ilib.data[o]))),n.getLanguage()&&(o=t+"_"+n.getLanguage(),n.getScript()&&(o=t+"_"+n.getLanguage()+"_"+n.getScript(),ilib.data[o]&&(a=!0,e=ilib.merge(e,ilib.data[o]))),n.getRegion()&&(o=t+"_"+n.getLanguage()+"_"+n.getRegion(),ilib.data[o]&&(a=!0,e=ilib.merge(e,ilib.data[o])))),n.getRegion()&&n.getVariant()&&(o=t+"_"+n.getLanguage()+"_"+n.getVariant(),ilib.data[o]&&(a=!0,e=ilib.merge(e,ilib.data[o]))),n.getLanguage()&&n.getScript()&&n.getRegion()&&(o=t+"_"+n.getLanguage()+"_"+n.getScript()+"_"+n.getRegion(),ilib.data[o]&&(a=!0,e=ilib.merge(e,ilib.data[o]))),n.getLanguage()&&n.getRegion()&&n.getVariant()&&(o=t+"_"+n.getLanguage()+"_"+n.getRegion()+"_"+n.getVariant(),ilib.data[o]&&(a=!0,e=ilib.merge(e,ilib.data[o]))),n.getLanguage()&&n.getScript()&&n.getRegion()&&n.getVariant()&&(o=t+"_"+n.getLanguage()+"_"+n.getScript()+"_"+n.getRegion()+"_"+n.getVariant(),ilib.data[o]&&(a=!0,e=ilib.merge(e,ilib.data[o]))),a?e:void 0},ilib.getLocFiles=function(t,i){var e="",n=[],a=i||"resources.json",o=t||new ilib.Locale,r=o.getLanguage(),s=o.getRegion(),l=o.getScript(),h=o.getVariant();return n.push(a),r&&(e=r+"/",n.push(e+a)),s&&(e="und/"+s+"/",n.push(e+a)),r&&(l&&(e=r+"/"+l+"/",n.push(e+a)),s&&(e=r+"/"+s+"/",n.push(e+a))),s&&h&&(e="und/"+s+"/"+h+"/",n.push(e+a)),r&&l&&s&&(e=r+"/"+l+"/"+s+"/",n.push(e+a)),r&&s&&h&&(e=r+"/"+s+"/"+h+"/",n.push(e+a)),r&&l&&s&&h&&(e=r+"/"+l+"/"+s+"/"+h+"/",n.push(e+a)),n},ilib.isEmpty=function(t){var i=void 0;if(!t)return!0;for(i in t)if(i&&t[i]!==void 0)return!1;return!0},ilib.hashCode=function(t){function i(t,i){return t*=65543,t+=i,t%=2147483647}function e(t){for(var e=0,n=0;t.length>n;n++)e=i(e,t.charCodeAt(n));return e}var n=0;switch(typeof t){case"undefined":n=0;break;case"string":n=e(t);break;case"function":case"number":case"xml":n=e(t+"");break;case"boolean":n=t?1:0;break;case"object":var a=[];for(var o in t)t.hasOwnProperty(o)&&a.push(o);a.sort();for(var r=0;a.length>r;r++)n=i(n,e(a[r])),n=i(n,ilib.hashCode(t[a[r]]))}return n},ilib.loadData=function(t){var i,e="resources.json",n=void 0,a=new ilib.Locale(ilib.getLocale()),o=!1,r={},s=void 0;if(t&&"function"==typeof t.callback){if(t.name&&(e=t.name),t.object&&(n=t.object),t.locale&&(a="string"==typeof t.locale?new ilib.Locale(t.locale):t.locale),t.type&&(i=t.type),t.loadParams&&(r=t.loadParams),t.sync&&(o=t.sync),s=t.callback,n&&!n.cache&&(n.cache={}),!i){var l=e.lastIndexOf(".");i=-1!==l?e.substring(l+1):"text"}var h=(a.getSpec().replace(/-/g,"_")||"root")+","+e+","+(ilib.hashCode(r)+"");if(n&&n.cache[h]!==void 0)s(n.cache[h]);else{var c;if("json"===i){var u=e.substring(0,e.lastIndexOf("."));if(c=ilib.mergeLocData(u,a))return n&&(n.cache[h]=c),s(c),void 0}if("function"==typeof ilib._load){var g=ilib.getLocFiles(a,e);"json"!==i&&(r.returnOne=!0),ilib._load(g,o,r,ilib.bind(this,function(t){if("json"===i){c=ilib.data[u]||{};for(var e=0;t.length>e;e++)t[e]!==void 0&&(c=ilib.merge(c,t[e]));n&&(n.cache[h]=c),s(c)}else{for(var e=t.length-1;e>-1&&!t[e];)e--;e>-1?(n&&(n.cache[h]=t[e]),s(t[e])):s(void 0)}}))}else n&&c&&(n.cache[h]=c),s(c)}}},ilib.String=function(t){this.str="object"==typeof t?t.str:"string"==typeof t?new String(t):"",this.length=this.str.length,this.cpLength=-1,this.localeSpec=ilib.getLocale()},ilib.String._isSurrogate=function(t){var i=t.charCodeAt(0);return i>=56320&&57343>=i||i>=55296&&56319>=i},ilib.String.fromCodePoint=function(t){if(65536>t)return String.fromCharCode(t);var i=Math.floor(t/65536)-1,e=65535&t;return String.fromCharCode(55296|(15&i)<<6|(64512&e)>>10)+String.fromCharCode(56320|1023&e)},ilib.String.loadPlurals=function(t,i,e,n){var a;a=i?"string"==typeof i?new ilib.Locale(i):i:new ilib.Locale(ilib.getLocale());var o=a.getLanguage();ilib.data["plurals_"+o]?n&&"function"==typeof n&&n(ilib.data["plurals_"+o]):ilib.loadData({name:"plurals.json",object:ilib.String,locale:a,sync:t,loadParams:e,callback:ilib.bind(this,function(t){t||(ilib.String.cache[o]={}),ilib.data["plurals_"+o]=t||{},n&&"function"==typeof n&&n(ilib.data["plurals_"+o])})})},ilib.String._fncs={firstProp:function(t){for(var i in t)if(i&&t[i])return i;return void 0},getValue:function(t,i){if("object"==typeof t){var e=ilib.String._fncs.firstProp(t);return ilib.String._fncs[e](t[e],i)}return"string"==typeof t?i:t},matchRangeContinuous:function(t,i){for(var e in i)if(e!==void 0&&i[e]!==void 0){var n=i[e];if("number"==typeof n){if(t===i[e])return!0}else if("[object Array]"===Object.prototype.toString.call(n)&&t>=n[0]&&n[1]>=t)return!0}return!1},matchRange:function(t,i){return Math.floor(t)!==t?!1:ilib.String._fncs.matchRangeContinuous(t,i)},is:function(t,i){var e=ilib.String._fncs.getValue(t[0],i),n=ilib.String._fncs.getValue(t[1],i);return e==n},isnot:function(t,i){return ilib.String._fncs.getValue(t[0],i)!=ilib.String._fncs.getValue(t[1],i)},inrange:function(t,i){return ilib.String._fncs.matchRange(ilib.String._fncs.getValue(t[0],i),t[1])},notin:function(t,i){return!ilib.String._fncs.matchRange(ilib.String._fncs.getValue(t[0],i),t[1])},within:function(t,i){return ilib.String._fncs.matchRangeContinuous(ilib.String._fncs.getValue(t[0],i),t[1])},mod:function(t,i){return ilib.mod(ilib.String._fncs.getValue(t[0],i),ilib.String._fncs.getValue(t[1],i))},n:function(t,i){return i},or:function(t,i){return ilib.String._fncs.getValue(t[0],i)||ilib.String._fncs.getValue(t[1],i)},and:function(t,i){return ilib.String._fncs.getValue(t[0],i)&&ilib.String._fncs.getValue(t[1],i)}},ilib.String.prototype={_length:function(){return this.str.length},format:function(t){var i=this.str;if(t){var e;for(var n in t)t[n]!==void 0&&(e=RegExp("{"+n+"}","g"),i=i.replace(e,t[n]))}return""+i},formatChoice:function(t,i){var e,n,a,o,r=this.str.split("|"),s=typeof t,l=[],h=[],c=void 0,u="";if(0===this.str.length)return"";for(e=0;r.length>e;e++)if(n=r[e].split("#"),n.length>2)l[e]=n[0],n=n.shift(),h[e]=n.join("#");else{if(2!==n.length)throw"syntax error in choice format pattern: "+r[e];l[e]=n[0],h[e]=n[1]}for(e=0;l.length>e;e++)if(0===l[e].length)u=new ilib.String(h[e]);else switch(s){case"number":if(o=parseInt(t,10),"<="===l[e].substring(0,2))a=parseFloat(l[e].substring(2)),a>=o&&(c=new ilib.String(h[e]),e=l.length);else if(">="===l[e].substring(0,2))a=parseFloat(l[e].substring(2)),o>=a&&(c=new ilib.String(h[e]),e=l.length);else if("<"===l[e].charAt(0))a=parseFloat(l[e].substring(1)),a>o&&(c=new ilib.String(h[e]),e=l.length);else if(">"===l[e].charAt(0))a=parseFloat(l[e].substring(1)),o>a&&(c=new ilib.String(h[e]),e=l.length);else switch(this.locale=this.locale||new ilib.Locale(this.localeSpec),l[e]){case"zero":case"one":case"two":case"few":case"many":var g=ilib.data["plurals_"+this.locale.getLanguage()];if(g){var f=g[l[e]];ilib.String._fncs.getValue(f,o)&&(c=new ilib.String(h[e]),e=l.length)}break;default:var m=l[e].indexOf("-");if(-1!==m){var d=l[e].substring(0,m),p=l[e].substring(m+1);o>=parseInt(d,10)&&parseInt(p,10)>=o&&(c=new ilib.String(h[e]),e=l.length)}else o===parseInt(l[e],10)&&(c=new ilib.String(h[e]),e=l.length)}break;case"boolean":"true"===l[e]&&t===!0?(c=new ilib.String(h[e]),e=l.length):"false"===l[e]&&t===!1&&(c=new ilib.String(h[e]),e=l.length);break;case"string":var b=RegExp(l[e],"i");b.test(t)&&(c=new ilib.String(h[e]),e=l.length);break;case"object":throw"syntax error: fmtChoice parameter for the argument index cannot be an object"}return c||(c=u||new ilib.String("")),c=c.format(i),""+c},toString:function(){return""+this.str},valueOf:function(){return this.str.valueOf()},charAt:function(t){return new ilib.String(this.str.charAt(t))},charCodeAt:function(t){return this.str.charCodeAt(t)},concat:function(t){return new ilib.String(this.str.concat(t))},indexOf:function(t,i){return this.str.indexOf(t,i)},lastIndexOf:function(t,i){return this.str.lastIndexOf(t,i)},match:function(t){return this.str.match(t)},replace:function(t,i){return new ilib.String(this.str.replace(t,i))},search:function(t){return this.str.search(t)},slice:function(t,i){return new ilib.String(this.str.slice(t,i))},split:function(t,i){return this.str.split(t,i)},substr:function(t,i){return new ilib.String(this.str.substr(t,i))},substring:function(t,i){return this.str.substring(t,i)},toLowerCase:function(){return this.str.toLowerCase()},toUpperCase:function(){return this.str.toUpperCase()},_toCodePoint:function(t){if(0===this.str.length)return-1;var i=-1,e=this.str.charCodeAt(t);if(e>=55296&&56319>=e){if(this.str.length>t+1){var n=this.str.charCodeAt(t+1);n>=56320&&57343>=n&&(i=((960&e)>>6)+1<<16|((63&e)<<10|1023&n))}}else i=e;return i},iterator:function(){function t(t){this.index=0,this.hasNext=function(){return this.index<t.str.length},this.next=function(){if(this.index<t.str.length){var i=t._toCodePoint(this.index);this.index+=i>65535?2:1}else i=-1;return i}}return new t(this)},charIterator:function(){function t(t){this.index=0,this.hasNext=function(){return this.index<t.str.length},this.next=function(){var i;return this.index<t.str.length&&(i=t.str.charAt(this.index),ilib.String._isSurrogate(i)&&this.index+1<t.str.length&&ilib.String._isSurrogate(t.str.charAt(this.index+1))&&(this.index++,i+=t.str.charAt(this.index)),this.index++),i}}return new t(this)},codePointAt:function(t){if(0>t)return-1;var i,e,n=this.iterator();for(i=t;i>=0&&n.hasNext();i--)e=n.next();return 0>i?e:-1},setLocale:function(t,i,e,n){"object"==typeof t?this.locale=t:(this.localeSpec=t,this.locale=new ilib.Locale(t)),ilib.String.loadPlurals(i!==void 0?i:!0,this.locale,e,n)},getLocale:function(){return(this.locale?this.locale.getSpec():this.localeSpec)||ilib.getLocale()},codePointLength:function(){if(-1===this.cpLength){var t=this.iterator();for(this.cpLength=0;t.hasNext();)this.cpLength++,t.next()}return this.cpLength}},ilib.Cal=function(){},ilib.Cal.newInstance=function(t){var i,e=t&&t.locale,n=t&&t.type;if(e||(e=new ilib.Locale),!n){var a=new ilib.LocaleInfo(e);n=a.getCalendar()}return i=ilib.Cal._constructors[n],i&&new i(t)},ilib.Cal._constructors={},ilib.Cal.getCalendars=function(){var t,i=[];for(t in ilib.Cal._constructors)t&&ilib.Cal._constructors[t]&&i.push(t);return i},ilib.Cal.prototype={getType:function(){throw"Cannot call methods of abstract class ilib.Cal"},getNumMonths:function(){throw"Cannot call methods of abstract class ilib.Cal"},getMonLength:function(){throw"Cannot call methods of abstract class ilib.Cal"},isLeapYear:function(){throw"Cannot call methods of abstract class ilib.Cal"}},ilib.signum=function(t){var i=t;if("string"==typeof t)i=parseInt(t,10);else if("number"!=typeof t)return 1;return 0>i?-1:1},ilib._roundFnc={floor:function(t){return Math.floor(t)},ceiling:function(t){return Math.ceil(t)},down:function(t){return 0>t?Math.ceil(t):Math.floor(t)},up:function(t){return 0>t?Math.floor(t):Math.ceil(t)},halfup:function(t){return 0>t?Math.ceil(t-.5):Math.floor(t+.5)},halfdown:function(t){return 0>t?Math.floor(t+.5):Math.ceil(t-.5)},halfeven:function(t){return 0===Math.floor(t)%2?Math.ceil(t-.5):Math.floor(t+.5)},halfodd:function(t){return 0!==Math.floor(t)%2?Math.ceil(t-.5):Math.floor(t+.5)}},ilib.JulianDay=function(t){this.jd=t,this.days=Math.floor(this.jd),this.frac=t-this.days},ilib.JulianDay.prototype={getDays:function(){return this.days},setDays:function(t){this.days=Math.floor(t),this.jd=this.days+this.frac},getDayFraction:function(){return this.frac},setDayFraction:function(t){var i=Math.floor(t);this.frac=t-i,this.jd=this.days+this.frac},getDate:function(){return this.jd},setDate:function(t){this.jd=t},addDate:function(t){"number"==typeof t&&(this.jd+=t,this.days=Math.floor(this.jd),this.frac=this.jd-this.days)}},ilib.Cal.Gregorian=function(){this.type="gregorian"},ilib.Cal.Gregorian.monthLengths=[31,28,31,30,31,30,31,31,30,31,30,31],ilib.Cal.Gregorian.prototype.getNumMonths=function(){return 12},ilib.Cal.Gregorian.prototype.getMonLength=function(t,i){return 2===t&&this.isLeapYear(i)?29:ilib.Cal.Gregorian.monthLengths[t-1]},ilib.Cal.Gregorian.prototype.isLeapYear=function(t){var i="number"==typeof t?t:t.getYears(),e=ilib.mod(i,400);return 0===ilib.mod(i,4)&&100!==e&&200!==e&&300!==e},ilib.Cal.Gregorian.prototype.getType=function(){return this.type},ilib.Cal.Gregorian.prototype.newDateInstance=function(t){return new ilib.Date.GregDate(t)},ilib.Cal._constructors.gregorian=ilib.Cal.Gregorian,ilib.bsearch=function(t,i,e){if(i===void 0||!i||t===void 0)return-1;for(var n,a=i.length-1,o=0,r=0,s=e||ilib.bsearch.numbers;a>=o;)if(r=Math.floor((a+o)/2),n=s(i[r],t),n>0)a=r-1;else{if(!(0>n))return r;o=r+1}return o},ilib.bsearch.numbers=function(t,i){return t-i},ilib.Date.GregDate=function(t){if(this.cal=new ilib.Cal.Gregorian,t){if(t.timezone&&(this.timezone=t.timezone),t.locale&&(this.locale="string"==typeof t.locale?new ilib.Locale(t.locale):t.locale,!this.timezone)){var i=new ilib.LocaleInfo(this.locale);this.timezone=i.getTimeZone()}if(t.unixtime!==void 0)this.setTime(parseInt(t.unixtime,10));else if(t.julianday!==void 0)this.timezone="Etc/UTC",this.setJulianDay(parseFloat(t.julianday));else if(t.year||t.month||t.day||t.hour||t.minute||t.second||t.millisecond)this.year=parseInt(t.year,10)||0,this.month=parseInt(t.month,10)||1,this.day=parseInt(t.day,10)||1,this.hour=parseInt(t.hour,10)||0,this.minute=parseInt(t.minute,10)||0,this.second=parseInt(t.second,10)||0,this.millisecond=parseInt(t.millisecond,10)||0;else if(t.rd!==void 0)this.setRd(t.rd);else{var e=new Date;this.setTime(e.getTime())}}else{var e=new Date;this.setTime(e.getTime())}},ilib.Date.GregDate.prototype=new ilib.Date,ilib.Date.GregDate.prototype.parent=ilib.Date,ilib.Date.GregDate.prototype.constructor=ilib.Date.GregDate,ilib.Date.GregDate.cumMonthLengths=[0,31,59,90,120,151,181,212,243,273,304,334,365],ilib.Date.GregDate.cumMonthLengthsLeap=[0,31,60,91,121,152,182,213,244,274,305,335,366],ilib.Date.GregDate.epoch=1721424.5,ilib.Date.GregDate.prototype.calcRataDie=function(t){var i=365*(t.year-1)+Math.floor((t.year-1)/4)-Math.floor((t.year-1)/100)+Math.floor((t.year-1)/400),e=(t.month>1?ilib.Date.GregDate.cumMonthLengths[t.month-1]:0)+t.day+(ilib.Cal.Gregorian.prototype.isLeapYear.call(this.cal,t.year)&&t.month>2?1:0),n=(36e5*t.hour+6e4*t.minute+1e3*t.second+t.millisecond)/864e5;return i+e+n},ilib.Date.GregDate.prototype.getRataDie=function(){return this.calcRataDie(this)},ilib.Date.GregDate.prototype.calcComponents=function(t){var i,e,n,a,o,r,s,l,h,c,u={};return o=Math.floor((t-1)/146097),i=ilib.mod(t-1,146097),r=Math.floor(i/36524),e=ilib.mod(i,36524),s=Math.floor(e/1461),n=ilib.mod(e,1461),l=Math.floor(n/365),a=ilib.mod(n,365)+1,u.year=400*o+100*r+4*s+l,4!==r&&4!==l&&u.year++,u.month=1,u.day=1,u.hour=0,u.minute=0,u.second=0,u.millisecond=0,h=t-ilib.Date.GregDate.prototype.calcRataDie.call(this,u)+1,c=ilib.Cal.Gregorian.prototype.isLeapYear.call(this.cal,u.year)?ilib.Date.GregDate.cumMonthLengthsLeap:ilib.Date.GregDate.cumMonthLengths,u.month=ilib.bsearch(Math.floor(h),c),h-=c[u.month-1],u.day=Math.floor(h),h-=u.day,h=Math.round(864e5*h),u.hour=Math.floor(h/36e5),h-=36e5*u.hour,u.minute=Math.floor(h/6e4),h-=6e4*u.minute,u.second=Math.floor(h/1e3),h-=1e3*u.second,u.millisecond=h,u},ilib.Date.GregDate.prototype.setRd=function(t){var i=this.calcComponents(t);this.year=i.year,this.month=i.month,this.day=i.day,this.hour=i.hour,this.minute=i.minute,this.second=i.second,this.millisecond=i.millisecond},ilib.Date.GregDate.prototype.setJulianDay=function(t){var i,e="number"==typeof t?new ilib.JulianDay(t):t;i=e.getDate()-ilib.Date.GregDate.epoch,this.setRd(i)},ilib.Date.GregDate.prototype.getDayOfWeek=function(){var t=Math.floor(this.getRataDie());return ilib.mod(t,7)},ilib.Date.GregDate.prototype.onOrBeforeRd=function(t,i){return t-ilib.mod(Math.floor(t)-i,7)},ilib.Date.GregDate.prototype.onOrAfterRd=function(t,i){return this.onOrBeforeRd(t+6,i)},ilib.Date.GregDate.prototype.beforeRd=function(t,i){return this.onOrBeforeRd(t-1,i)},ilib.Date.GregDate.prototype.afterRd=function(t,i){return this.onOrBeforeRd(t+7,i)},ilib.Date.GregDate.prototype.firstSunday=function(t){var i=this.calcRataDie({year:t,month:1,day:1,hour:0,minute:0,second:0,millisecond:0}),e=this.onOrAfterRd(i,4);return this.beforeRd(e,0)},ilib.Date.GregDate.prototype.before=function(t){return this.cal.newDateInstance({rd:this.beforeRd(this.getRataDie(),t)})},ilib.Date.GregDate.prototype.after=function(t){return this.cal.newDateInstance({rd:this.afterRd(this.getRataDie(),t)})},ilib.Date.GregDate.prototype.onOrBefore=function(t){return this.cal.newDateInstance({rd:this.onOrBeforeRd(this.getRataDie(),t)})},ilib.Date.GregDate.prototype.onOrAfter=function(t){return this.cal.newDateInstance({rd:this.onOrAfterRd(this.getRataDie(),t)})},ilib.Date.GregDate.prototype.getWeekOfYear=function(){var t,i=Math.floor(this.getRataDie()),e=this.firstSunday(this.year);return e>i?e=this.firstSunday(this.year-1):12==this.month&&this.day>25&&(t=this.firstSunday(this.year+1),i>=t&&(e=t)),Math.floor((i-e)/7)+1},ilib.Date.GregDate.prototype.getDayOfYear=function(){var t=this.cal.isLeapYear(this.year)?ilib.Date.GregDate.cumMonthLengthsLeap:ilib.Date.GregDate.cumMonthLengths; return t[this.month-1]+this.day},ilib.Date.GregDate.prototype.getWeekOfMonth=function(t){var i=new ilib.LocaleInfo(t),e=this.calcRataDie({year:this.year,month:this.month,day:1,hour:0,minute:0,second:0,millisecond:0}),n=this.getRataDie(),a=this.onOrAfterRd(e,i.getFirstDayOfWeek());return a-e>3&&(a-=7),Math.floor((n-a)/7)+1},ilib.Date.GregDate.prototype.getEra=function(){return 1>this.year?-1:1},ilib.Date.GregDate.prototype.getTime=function(){var t=this.calcRataDie({year:this.year,month:this.month,day:this.day,hour:this.hour,minute:this.minute,second:this.second,millisecond:0});if(719163>t||t>744018.134803241)return-1;var i=86400*Math.floor(t-719163)+3600*this.hour+60*this.minute+this.second,e=1e3*i+this.millisecond;return e},ilib.Date.GregDate.prototype.setTime=function(t){var i=719163+t/864e5;this.setRd(i)},ilib.Date.GregDate.prototype.getJSDate=function(){var t=this.getTime();return-1===t?void 0:new Date(t)},ilib.Date.GregDate.prototype.getJulianDay=function(){return this.getRataDie()+ilib.Date.GregDate.epoch},ilib.Date.GregDate.prototype.getCalendar=function(){return"gregorian"},ilib.Date.GregDate.prototype.getTimeZone=function(){return this.timezone||"local"},ilib.Date.GregDate.prototype.setTimeZone=function(t){t&&""!==t?"string"==typeof t&&(this.timezone=t):this.timezone=void 0},ilib.Date._constructors.gregorian=ilib.Date.GregDate,ilib.TimeZone=function(t){if(this.sync=!0,this.locale=new ilib.Locale,this.isLocal=!1,t){if(t.locale&&(this.locale="string"==typeof t.locale?new ilib.Locale(t.locale):t.locale),t.id){if("local"===t.id){this.isLocal=!0;var i=new Date,e=new Date(i.getFullYear(),0,1),n=new Date(i.getFullYear(),5,1);this.offsetJan1=-e.getTimezoneOffset(),this.offsetJun1=-n.getTimezoneOffset(),this.offset=Math.max(this.offsetJan1,this.offsetJun1)}this.id=t.id}else t.offset&&(this.offset="string"==typeof t.offset?parseInt(t.offset,10):t.offset,this.id=this.getDisplayName(void 0,void 0));t.sync!==void 0&&(this.sync=t.sync),this.loadParams=t.loadParams,this.onLoad=t.onLoad}this.id?this._loadtzdata():new ilib.LocaleInfo(this.locale,{sync:this.sync,onLoad:ilib.bind(this,function(t){this.id=t.getTimeZone()||"Etc/UTC",this._loadtzdata()})})},ilib.data.defaultZones={"Etc/UTC":{o:"0:0",f:"UTC"}},ilib.TimeZone.prototype._loadtzdata=function(){ilib.data.timezones?this._initZone():ilib.loadData({object:ilib.TimeZone,locale:"-",name:"timezones.json",sync:this.sync,loadParams:this.loadParams,callback:ilib.bind(this,function(t){ilib.data.timezones=t||ilib.data.defaultZones,this._initZone()})})},ilib.TimeZone.prototype._initZone=function(){this.zone=ilib.data.timezones[this.id],this.zone||void 0!==this.offset||(this.id="Etc/UTC",this.zone=ilib.data.timezones[this.id]),this.onLoad&&"function"==typeof this.onLoad&&this.onLoad(this)},ilib.TimeZone.getAvailableIds=function(t){var i,e=[];t||e.push("local");for(i in ilib.data.timezones)!i||t&&ilib.data.timezones[i].c!==t||e.push(i);return e},ilib.TimeZone.prototype.getId=function(){return this.id},ilib.TimeZone.prototype.getDisplayName=function(t,i){switch(i=this.isLocal||this.zone===void 0?"rfc822":i||"standard"){default:case"standard":if(this.zone.f&&"zzz"!==this.zone.f){if(-1!==this.zone.f.indexOf("{c}")){var e="";e=this.inDaylightTime(t)?this.zone.s.c:this.zone.e.c;var n=new ilib.String(this.zone.f);return n.format({c:e||""})}return this.zone.f}var n="GMT"+this.zone.o;return this.inDaylightTime(t)&&(n+="+"+this.zone.s.v),n;case"rfc822":var a=this.getOffset(t),o="UTC",r=a.h||0,s=a.m||0;return o+=r>0?"+":"-",10>Math.abs(r)&&(o+="0"),o+=0>r?-r:r,10>s&&(o+="0"),o+=s;case"long":if(this.zone.n){if(-1!==this.zone.n.indexOf("{c}")){var l=this.inDaylightTime(t)?"Daylight":"Standard",n=new ilib.String(this.zone.n);return n.format({c:l||""})}return this.zone.n}var n="GMT"+this.zone.o;return this.inDaylightTime(t)&&(n+="+"+this.zone.s.v),n}},ilib.TimeZone.prototype._offsetStringToObj=function(t){var i,e="string"==typeof t?t.split(":"):[],n={h:0};return e.length>0&&(n.h=parseInt(e[0],10),e.length>1&&(i=parseInt(e[1],10),i&&(n.m=i),e.length>2&&(i=parseInt(e[2],10),i&&(n.s=i)))),n},ilib.TimeZone.prototype.getOffset=function(t){var i=this.getOffsetMillis(t)/6e4,e=ilib._roundFnc.down(i/60),n=Math.abs(i)-60*Math.abs(e),a={h:e};return 0!=n&&(a.m=n),a},ilib.TimeZone.prototype.getOffsetMillis=function(t){var i;if(this.isLocal){var e=t?new Date(t.getTime()):new Date;return 1e3*60*-e.getTimezoneOffset()}return this.dstSavings===void 0&&this._calcDSTSavings(),this.offset===void 0&&this._calcOffset(),i=this.offset,t&&this.inDaylightTime(t)&&(i+=this.dstSavings),1e3*60*i},ilib.TimeZone.prototype.getOffsetStr=function(t){var i,e=this.getOffset(t);return i=e.h,e.m!==void 0?(i+=":"+e.m,e.s!==void 0&&(i+=":"+e.s)):i+=":0",i},ilib.TimeZone.prototype.getRawOffset=function(){var t=this.getRawOffsetMillis()/6e4,i=ilib._roundFnc.down(t/60),e=Math.abs(t)-60*Math.abs(i),n={h:i};return 0!=e&&(n.m=e),n},ilib.TimeZone.prototype.getRawOffsetMillis=function(){return this.offset===void 0&&this._calcOffset(),1e3*60*this.offset},ilib.TimeZone.prototype.getRawOffsetStr=function(){if(this.isLocal){var t=this.getRawOffset();return t.h+":"+t.m}return this.offset!==void 0?this.getOffsetStr(void 0):this.zone&&this.zone.o||"0:0"},ilib.TimeZone.prototype.getDSTSavings=function(){if(this.isLocal){var t=Math.abs(this.offsetJan1-this.offsetJun1),i=ilib._roundFnc.down(t/60),e=t-60*i;return{h:i,m:e}}return this.zone&&this.zone.s?this._offsetStringToObj(this.zone.s.v):{h:0}},ilib.TimeZone.prototype.getDSTSavingsStr=function(){if(this.isLocal){var t=this.getDSTSavings();return t.h+":"+t.m}return this.offset===void 0&&this.zone&&this.zone.s?this.zone.s.v:"0:0"},ilib.TimeZone.prototype._calcRuleStart=function(t,i){var e,n,a,o,r,s,l,h=0,c=0,u=0,g=0;switch("l"==t.r.charAt(0)||"f"==t.r.charAt(0)?(o=ilib.Cal.newInstance({type:"gregorian"}),e=t.r.charAt(0),h=parseInt(t.r.substring(1),10),n="l"===e?o.getMonLength(t.m,i):1):(e="=",l=t.r.indexOf("<"),-1==l&&(l=t.r.indexOf(">")),-1!=l?(e=t.r.charAt(l),h=parseInt(t.r.substring(0,l),10),n=parseInt(t.r.substring(l+1),10)):n=parseInt(t.r,10)),t.t&&(s=t.t.split(":"),c=parseInt(s[0],10),s.length>1&&(u=parseInt(s[1],10),s.length>2&&(g=parseInt(s[2],10)))),a=new ilib.Date.GregDate({year:i,month:t.m,day:n,hour:c,minute:u,second:g}),r=a.getRataDie(),e){case"l":case"<":return a.onOrBeforeRd(r,h);case"f":case">":return a.onOrAfterRd(r,h);default:return r}},ilib.TimeZone.prototype._calcDSTSavings=function(){var t=this.getDSTSavings();this.dstSavings=(60*Math.abs(t.h||0)+(t.m||0))*ilib.signum(t.h||0)},ilib.TimeZone.prototype._calcOffset=function(){if(this.zone.o){var t=this._offsetStringToObj(this.zone.o);this.offset=(60*Math.abs(t.h||0)+(t.m||0))*ilib.signum(t.h||0)}},ilib.TimeZone.prototype.inDaylightTime=function(t){var i,e,n;if(!this.useDaylightTime())return!1;if(this.isLocal){var a=new Date(t?t.getTime():void 0),o=Math.min(this.offsetJan1,this.offsetJun1);return-a.getTimezoneOffset()===o}return t||(t=ilib.Date.newInstance()),i=t.getRataDie(),e=this._calcRuleStart(this.zone.s,t.year),n=this._calcRuleStart(this.zone.e,t.year),n>e?i>=e&&n>i?!0:!1:i>=e||n>i?!0:!1},ilib.TimeZone.prototype.useDaylightTime=function(){return this.isLocal&&this.offsetJan1!==this.offsetJun1||this.zone!==void 0&&this.zone.s!==void 0&&this.zone.e!==void 0},ilib.TimeZone.prototype.getCountry=function(){return this.zone.c},ilib.ResBundle=function(t){var i,e;this.locale=new ilib.Locale,this.baseName="strings",this.type="text",this.loadParams={},this.missing="source",this.sync=!0,t&&(t.locale&&(this.locale="string"==typeof t.locale?new ilib.Locale(t.locale):t.locale),t.name&&(this.baseName=t.name),t.type&&(this.type=t.type),this.lengthen=t.lengthen||!1,t.sync!==void 0&&(this.sync=1==t.sync),t.loadParams!==void 0&&(this.loadParams=t.loadParams),t.missing!==void 0&&("pseudo"===t.missing||"empty"===t.missing)&&(this.missing=t.missing)),this.map={},ilib.ResBundle[this.baseName]||(ilib.ResBundle[this.baseName]={}),i=this.locale.isPseudo()?new ilib.Locale("en-US"):this.locale,ilib.loadData({object:ilib.ResBundle[this.baseName],locale:i,name:this.baseName+".json",sync:this.sync,loadParams:this.loadParams,callback:ilib.bind(this,function(n){n||(n=ilib.data[this.baseName]||{},e=i.getSpec().replace(/-/g,"_"),ilib.ResBundle[this.baseName].cache[e]=n),this.map=n,this.locale.isPseudo()?(ilib.ResBundle.pseudomap||(ilib.ResBundle.pseudomap={}),this._loadPseudo(this.locale,t.onLoad)):"pseudo"===this.missing?(ilib.ResBundle.pseudomap||(ilib.ResBundle.pseudomap={}),new ilib.LocaleInfo(this.locale,{sync:this.sync,loadParams:this.loadParams,onLoad:ilib.bind(this,function(i){var e=new ilib.Locale("zxx","XX",void 0,i.getDefaultScript());this._loadPseudo(e,t.onLoad)})})):t&&"function"==typeof t.onLoad&&t.onLoad(this)})})},ilib.ResBundle.defaultPseudo=ilib.data.pseudomap||{a:"\u00e0",e:"\u00eb",i:"\u00ed",o:"\u00f5",u:"\u00fc",y:"\u00ff",A:"\u00c3",E:"\u00cb",I:"\u00cf",O:"\u00d8",U:"\u00da",Y:"\u0176"},ilib.ResBundle.prototype={_loadPseudo:function(t,i){ilib.loadData({object:ilib.ResBundle.pseudomap,locale:t,name:"pseudomap.json",sync:this.sync,loadParams:this.loadParams,callback:ilib.bind(this,function(e){if(!e||ilib.isEmpty(e)){e=ilib.ResBundle.defaultPseudo;var n=t.getSpec().replace(/-/g,"_");ilib.ResBundle.pseudomap.cache[n]=e}this.pseudomap=e,"function"==typeof i&&i(this)})})},getLocale:function(){return this.locale},getName:function(){return this.baseName},getType:function(){return this.type},pseudo:function(t){if(!t)return void 0;var i,e="";for(i=0;t.length>i;i++)if("raw"!==this.type){if("html"===this.type||"xml"===this.type)if("<"===t.charAt(i)){for(e+=t.charAt(i++);t.length>i&&">"!==t.charAt(i);)e+=t.charAt(i++);t.length>i&&(e+=t.charAt(i++))}else if("&"===t.charAt(i)){for(e+=t.charAt(i++);t.length>i&&";"!==t.charAt(i)&&" "!==t.charAt(i);)e+=t.charAt(i++);t.length>i&&(e+=t.charAt(i++))}if(t.length>i)if("{"===t.charAt(i)){for(e+=t.charAt(i++);t.length>i&&"}"!==t.charAt(i);)e+=t.charAt(i++);t.length>i&&(e+=t.charAt(i))}else e+=this.pseudomap[t.charAt(i)]||t.charAt(i)}else e+=this.pseudomap[t.charAt(i)]||t.charAt(i);if(this.lengthen){var n;for(n=20>=e.length?Math.round(e.length/2):e.length>20&&40>=e.length?Math.round(e.length/3):Math.round(e.length/5),i=n-1;i>=0;i--)e+=i%10}return("Hans"===this.locale.getScript()||"Hant"===this.locale.getScript()||"Hani"===this.locale.getScript()||"Hrkt"===this.locale.getScript()||"Jpan"===this.locale.getScript()||"Hira"===this.locale.getScript()||"Kana"===this.locale.getScript())&&(e=e.replace(/ /g,"")),e},escapeXml:function(t){return t=t.replace(/&/g,"&amp;"),t=t.replace(/</g,"&lt;"),t=t.replace(/>/g,"&gt;")},unescapeXml:function(t){return t=t.replace(/&amp;/g,"&"),t=t.replace(/&lt;/g,"<"),t=t.replace(/&gt;/g,">")},makeKey:function(t){var i=t.replace(/\s+/gm," ");return"xml"===this.type||"html"===this.type?this.unescapeXml(i):i},getString:function(t,i,e){if(!t&&!i)return new ilib.String("");var n;if(this.locale.isPseudo()){var a=t?t:this.map[i];n=this.pseudo(a||i)}else{var o=i||this.makeKey(t);n=this.map[o]!==void 0?this.map[o]:"pseudo"===this.missing?this.pseudo(t||i):"empty"===this.missing?"":t}if(e&&"none"!==e&&("default"==e&&(e=this.type),"xml"===e||"html"===e?n=this.escapeXml(n):("js"==e||"attribute"===e)&&(n=n.replace(/'/g,"\\'").replace(/"/g,'\\"'))),void 0===n)return void 0;var r=new ilib.String(n);return r.setLocale(this.locale.getSpec(),!0,this.loadParams),r},containsKey:function(t,i){if(t===void 0&&i===void 0)return!1;var e=i||this.makeKey(t);return this.map[e]!==void 0},getResObj:function(){return this.map}},ilib.shallowCopy=function(t,i){var e=void 0;if(t&&i)for(e in t)void 0!==e&&t[e]&&(i[e]=t[e])},ilib.mapString=function(t,i){var e="";if(i&&t)for(var n=0;t.length>n;n++){var a=t.charAt(n);e+=i[a]||a}else e=t;return e},ilib.indexOf=function(t,i){if(!t||!i)return-1;if("function"==typeof t.indexOf)return t.indexOf(i);for(var e=0;t.length>e;e++)if(t[e]===i)return e;return-1},ilib.DateFmt=function(t){var i,e,n,a=!0,o=void 0;if(this.locale=new ilib.Locale,this.type="date",this.length="s",this.dateComponents="dmy",this.timeComponents="ahm",this.useNative=!1,t){if(t.locale&&(this.locale="string"==typeof t.locale?new ilib.Locale(t.locale):t.locale),t.type&&("date"===t.type||"time"===t.type||"datetime"===t.type)&&(this.type=t.type),t.calendar&&(this.calName=t.calendar),t.length&&("short"===t.length||"medium"===t.length||"long"===t.length||"full"===t.length)&&(this.length=t.length.charAt(0)),t.date){for(i=t.date.split(""),i.sort(function(t,i){return i>t?-1:t>i?1:0}),n=!1,e=0;i.length>e;e++)if("d"!==i[e]&&"m"!==i[e]&&"y"!==i[e]&&"w"!==i[e]&&"n"!==i[e]){n=!0;break}n||(this.dateComponents=i.join(""))}if(t.time){for(i=t.time.split(""),i.sort(function(t,i){return i>t?-1:t>i?1:0}),this.badTime=!1,e=0;i.length>e;e++)if("h"!==i[e]&&"m"!==i[e]&&"s"!==i[e]&&"a"!==i[e]&&"z"!==i[e]){this.badTime=!0;break}this.badTime||(this.timeComponents=i.join(""))}!t.clock||"12"!==t.clock&&"24"!==t.clock||(this.clock=t.clock),t.template&&(this.type="",this.length="",this.dateComponents="",this.timeComponents="",this.template=t.template),t.timezone?this.tz=new ilib.TimeZone({locale:this.locale,id:t.timezone}):t.locale&&(this.tz=new ilib.TimeZone({locale:this.locale})),t.useNative!==void 0&&(this.useNative=t.useNative),t.sync!==void 0&&(a=1==t.sync),o=t.loadParams}ilib.DateFmt.cache||(ilib.DateFmt.cache={}),new ilib.LocaleInfo(this.locale,{sync:a,onLoad:ilib.bind(this,function(i){this.locinfo=i,this.calName=this.calName||this.locinfo.getCalendar()||"gregorian",this.cal=ilib.Cal.newInstance({type:this.calName}),this.cal||(this.cal=new ilib.Cal.Gregorian),new ilib.ResBundle({locale:this.locale,name:"sysres",sync:a,onLoad:ilib.bind(this,function(i){this.sysres=i,this.template?(this._massageTemplate(),t&&"function"==typeof t.onLoad&&t.onLoad(this)):ilib.loadData({object:ilib.DateFmt,locale:this.locale,name:"dateformats.json",sync:a,loadParams:o,callback:ilib.bind(this,function(i){if(!i){i=ilib.DateFmt.defaultFmt;var e=this.locale.getSpec().replace(/-/g,"_");ilib.DateFmt.cache[e]=i}this.clock===void 0&&(this.clock=this.locinfo.getClock()),this._initTemplate(i),this._massageTemplate(),t&&"function"==typeof t.onLoad&&t.onLoad(this)})})})})})})},ilib.DateFmt.lenmap={s:"short",m:"medium",l:"long",f:"full"},ilib.DateFmt.zeros="0000",ilib.DateFmt.defaultFmt=ilib.data.dateformats||{gregorian:{order:"{date} {time}",date:{dmwy:"EEE d/MM/yyyy",dmy:"d/MM/yyyy",dmw:"EEE d/MM",dm:"d/MM",my:"MM/yyyy",dw:"EEE d",d:"dd",m:"MM",y:"yyyy",n:"NN",w:"EEE"},time:{12:"h:mm:ssa",24:"H:mm:ss"},range:{c00:"{st} - {et}, {sd}/{sm}/{sy}",c01:"{sd}/{sm} {st} - {ed}/{em} {et}, {sy}",c02:"{sd}/{sm} {st} - {ed}/{em} {et}, {sy}",c03:"{sd}/{sm}/{sy} {st} - {ed}/{em}/{ey} {et}",c10:"{sd}-{ed}/{sm}/{sy}",c11:"{sd}/{sm} - {ed}/{em} {sy}",c12:"{sd}/{sm}/{sy} - {ed}/{em}/{ey}",c20:"{sm}/{sy} - {em}/{ey}",c30:"{sy} - {ey}"}},islamic:"gregorian",hebrew:"gregorian",julian:"gregorian",buddhist:"gregorian"},ilib.DateFmt.prototype={_initTemplate:function(t){if(!t[this.calName])throw"No formats available for calendar "+this.calName+" in locale "+(""+this.locale);switch(this.formats=t[this.calName],"string"==typeof this.formats&&(this.formats=t[this.formats]),this.template="",this.type){case"datetime":this.template=this.formats&&this._getLengthFormat(this.formats.order,this.length)||"{date} {time}",this.template=this.template.replace("{date}",this._getFormat(this.formats.date,this.dateComponents,this.length)||""),this.template=this.template.replace("{time}",this._getFormat(this.formats.time[this.clock],this.timeComponents,this.length)||"");break;case"date":this.template=this._getFormat(this.formats.date,this.dateComponents,this.length);break;case"time":this.template=this._getFormat(this.formats.time[this.clock],this.timeComponents,this.length)}},_massageTemplate:function(){var t;if(this.clock&&this.template){var i="";switch(this.clock){case"24":for(t=0;this.template.length>t;t++)if("'"==this.template.charAt(t)){for(i+=this.template.charAt(t++);this.template.length>t&&"'"!==this.template.charAt(t);)i+=this.template.charAt(t++);this.template.length>t&&(i+=this.template.charAt(t))}else i+="K"==this.template.charAt(t)?"k":"h"==this.template.charAt(t)?"H":this.template.charAt(t);this.template=i;break;case"12":for(t=0;this.template.length>t;t++)if("'"==this.template.charAt(t)){for(i+=this.template.charAt(t++);this.template.length>t&&"'"!==this.template.charAt(t);)i+=this.template.charAt(t++);this.template.length>t&&(i+=this.template.charAt(t))}else i+="k"==this.template.charAt(t)?"K":"H"==this.template.charAt(t)?"h":this.template.charAt(t);this.template=i}}this.templateArr=this._tokenize(this.template);var e=this.locinfo.getDigits();e&&"0123456789"!=e&&(this.digits=e),this.useNative&&(e=this.locinfo.getNativeDigits(),e&&(this.digits=e))},_tokenize:function(t){var i,e,n,a=0,o=[];if(t)for(;t.length>a;){if(e=t.charAt(a),i=a,"'"===e){for(a++;t.length>a&&"'"!==t.charAt(a);)a++;t.length>a&&a++}else if(e>="a"&&"z">=e||e>="A"&&"Z">=e)for(n=t.charAt(a);t.length>a&&e===n;)e=t.charAt(++a);else for(;t.length>a&&"'"!==e&&("a">e||e>"z")&&("A">e||e>"Z");)e=t.charAt(++a);o.push(t.substring(i,a))}return o},_getFormat:function(t,i,e){return i!==void 0&&t[i]?this._getLengthFormat(t[i],e):void 0},_getLengthFormat:function(t,i){return"string"==typeof t?t:t[i]?t[i]:void 0},getLocale:function(){return this.locale},getTemplate:function(){return this.template},getType:function(){return this.type},getCalendar:function(){return this.cal.getType()},getLength:function(){return ilib.DateFmt.lenmap[this.length]||""},getDateComponents:function(){return this.dateComponents||""},getTimeComponents:function(){return this.timeComponents||""},getTimeZone:function(){return this.tz||(this.tz=new ilib.TimeZone({id:ilib.getTimeZone()})),this.