/*
YUI 3.10.3 (build 2fb5187)
Copyright 2013 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
if (typeof __coverage__ === 'undefined') { __coverage__ = {}; }
if (!__coverage__['build/widget-locale/widget-locale.js']) {
__coverage__['build/widget-locale/widget-locale.js'] = {"path":"build/widget-locale/widget-locale.js","s":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0},"b":{"1":[0,0],"2":[0,0],"3":[0,0],"4":[0,0],"5":[0,0],"6":[0,0],"7":[0,0],"8":[0,0],"9":[0,0],"10":[0,0],"11":[0,0],"12":[0,0],"13":[0,0]},"f":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0},"fnMap":{"1":{"name":"(anonymous_1)","line":1,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":44}}},"2":{"name":"(anonymous_2)","line":46,"loc":{"start":{"line":46,"column":18},"end":{"line":46,"column":44}}},"3":{"name":"(anonymous_3)","line":65,"loc":{"start":{"line":65,"column":18},"end":{"line":65,"column":35}}},"4":{"name":"(anonymous_4)","line":79,"loc":{"start":{"line":79,"column":17},"end":{"line":79,"column":34}}},"5":{"name":"(anonymous_5)","line":120,"loc":{"start":{"line":120,"column":16},"end":{"line":120,"column":38}}},"6":{"name":"(anonymous_6)","line":158,"loc":{"start":{"line":158,"column":23},"end":{"line":158,"column":34}}},"7":{"name":"(anonymous_7)","line":162,"loc":{"start":{"line":162,"column":17},"end":{"line":162,"column":31}}},"8":{"name":"(anonymous_8)","line":166,"loc":{"start":{"line":166,"column":17},"end":{"line":166,"column":31}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":172,"column":44}},"2":{"start":{"line":12,"column":0},"end":{"line":17,"column":22}},"3":{"start":{"line":28,"column":0},"end":{"line":30,"column":2}},"4":{"start":{"line":33,"column":0},"end":{"line":33,"column":37}},"5":{"start":{"line":35,"column":0},"end":{"line":169,"column":9}},"6":{"start":{"line":47,"column":8},"end":{"line":47,"column":30}},"7":{"start":{"line":48,"column":8},"end":{"line":48,"column":38}},"8":{"start":{"line":50,"column":8},"end":{"line":52,"column":9}},"9":{"start":{"line":51,"column":12},"end":{"line":51,"column":30}},"10":{"start":{"line":54,"column":8},"end":{"line":54,"column":49}},"11":{"start":{"line":55,"column":8},"end":{"line":55,"column":28}},"12":{"start":{"line":66,"column":8},"end":{"line":66,"column":48}},"13":{"start":{"line":81,"column":8},"end":{"line":81,"column":60}},"14":{"start":{"line":84,"column":8},"end":{"line":90,"column":19}},"15":{"start":{"line":93,"column":8},"end":{"line":105,"column":9}},"16":{"start":{"line":94,"column":12},"end":{"line":94,"column":31}},"17":{"start":{"line":95,"column":12},"end":{"line":104,"column":13}},"18":{"start":{"line":96,"column":16},"end":{"line":96,"column":44}},"19":{"start":{"line":99,"column":16},"end":{"line":99,"column":54}},"20":{"start":{"line":100,"column":16},"end":{"line":102,"column":17}},"21":{"start":{"line":101,"column":20},"end":{"line":101,"column":56}},"22":{"start":{"line":103,"column":16},"end":{"line":103,"column":33}},"23":{"start":{"line":107,"column":8},"end":{"line":107,"column":20}},"24":{"start":{"line":122,"column":8},"end":{"line":122,"column":60}},"25":{"start":{"line":125,"column":8},"end":{"line":128,"column":45}},"26":{"start":{"line":131,"column":8},"end":{"line":146,"column":9}},"27":{"start":{"line":132,"column":12},"end":{"line":145,"column":32}},"28":{"start":{"line":134,"column":16},"end":{"line":134,"column":48}},"29":{"start":{"line":135,"column":16},"end":{"line":138,"column":17}},"30":{"start":{"line":136,"column":20},"end":{"line":136,"column":36}},"31":{"start":{"line":137,"column":20},"end":{"line":137,"column":26}},"32":{"start":{"line":139,"column":16},"end":{"line":139,"column":49}},"33":{"start":{"line":141,"column":16},"end":{"line":143,"column":17}},"34":{"start":{"line":142,"column":20},"end":{"line":142,"column":54}},"35":{"start":{"line":148,"column":8},"end":{"line":148,"column":19}},"36":{"start":{"line":159,"column":8},"end":{"line":159,"column":51}},"37":{"start":{"line":163,"column":8},"end":{"line":163,"column":55}},"38":{"start":{"line":167,"column":8},"end":{"line":167,"column":50}}},"branchMap":{"1":{"line":50,"type":"if","locations":[{"start":{"line":50,"column":8},"end":{"line":50,"column":8}},{"start":{"line":50,"column":8},"end":{"line":50,"column":8}}]},"2":{"line":81,"type":"binary-expr","locations":[{"start":{"line":81,"column":18},"end":{"line":81,"column":24}},{"start":{"line":81,"column":28},"end":{"line":81,"column":44}}]},"3":{"line":86,"type":"cond-expr","locations":[{"start":{"line":86,"column":31},"end":{"line":86,"column":47}},{"start":{"line":86,"column":50},"end":{"line":86,"column":52}}]},"4":{"line":93,"type":"if","locations":[{"start":{"line":93,"column":8},"end":{"line":93,"column":8}},{"start":{"line":93,"column":8},"end":{"line":93,"column":8}}]},"5":{"line":93,"type":"binary-expr","locations":[{"start":{"line":93,"column":12},"end":{"line":93,"column":32}},{"start":{"line":93,"column":36},"end":{"line":93,"column":61}}]},"6":{"line":100,"type":"if","locations":[{"start":{"line":100,"column":16},"end":{"line":100,"column":16}},{"start":{"line":100,"column":16},"end":{"line":100,"column":16}}]},"7":{"line":122,"type":"binary-expr","locations":[{"start":{"line":122,"column":18},"end":{"line":122,"column":24}},{"start":{"line":122,"column":28},"end":{"line":122,"column":44}}]},"8":{"line":126,"type":"binary-expr","locations":[{"start":{"line":126,"column":19},"end":{"line":126,"column":46}},{"start":{"line":126,"column":50},"end":{"line":126,"column":52}}]},"9":{"line":131,"type":"if","locations":[{"start":{"line":131,"column":8},"end":{"line":131,"column":8}},{"start":{"line":131,"column":8},"end":{"line":131,"column":8}}]},"10":{"line":131,"type":"binary-expr","locations":[{"start":{"line":131,"column":12},"end":{"line":131,"column":32}},{"start":{"line":131,"column":36},"end":{"line":131,"column":45}}]},"11":{"line":135,"type":"if","locations":[{"start":{"line":135,"column":16},"end":{"line":135,"column":16}},{"start":{"line":135,"column":16},"end":{"line":135,"column":16}}]},"12":{"line":135,"type":"binary-expr","locations":[{"start":{"line":135,"column":20},"end":{"line":135,"column":24}},{"start":{"line":135,"column":28},"end":{"line":135,"column":39}}]},"13":{"line":141,"type":"if","locations":[{"start":{"line":141,"column":16},"end":{"line":141,"column":16}},{"start":{"line":141,"column":16},"end":{"line":141,"column":16}}]}},"code":["(function () { YUI.add('widget-locale', function (Y, NAME) {","","/**"," * Provides string support for widget with BCP 47 language tag lookup. This module has been deprecated."," * It's replaced by the \"intl\" module which provides generic internationalization and BCP 47 language tag"," * support with externalization."," *"," * @module widget-locale"," * @deprecated This module has been deprecated. It's replaced by the \"intl\" module which provides"," * generic internationalization and BCP 47 language tag support with externalization."," */","var TRUE = true,"," LOCALE = \"locale\","," INIT_VALUE = \"initValue\","," HYPHEN = \"-\","," EMPTY_STR = \"\","," Widget = Y.Widget;","","/**"," * @attribute locale"," * @deprecated Use Y.config.lang and Y.Intl externalization support"," * @description"," * The default locale for the widget. NOTE: Using get/set on the \"strings\" attribute will"," * return/set strings for this locale."," * @default \"en\""," * @type String"," */","Widget.ATTRS[LOCALE] = {"," value: \"en\"","};","","// Since strings support with locale needs the private _strs setup","Widget.ATTRS.strings.lazyAdd = false;","","Y.mix(Widget.prototype, {",""," /**"," * Sets strings for a particular locale, merging with any existing"," * strings which may already be defined for the locale."," *"," * @method _setStrings"," * @protected"," * @param {Object} strings The hash of string key/values to set"," * @param {Object} locale The locale for the string values being set"," */"," _setStrings : function(strings, locale) {"," var strs = this._strs;"," locale = locale.toLowerCase();",""," if (!strs[locale]) {"," strs[locale] = {};"," }",""," Y.aggregate(strs[locale], strings, TRUE);"," return strs[locale];"," },",""," /**"," * Returns the strings key/value hash for a paricular locale, without locale lookup applied."," *"," * @method _getStrings"," * @protected"," * @param {Object} locale"," */"," _getStrings : function(locale) {"," return this._strs[locale.toLowerCase()];"," },",""," /**"," * Gets the entire strings hash for a particular locale, performing locale lookup."," * <p>"," * If no values of the key are defined for a particular locale the value for the"," * default locale (in initial locale set for the class) is returned."," * </p>"," * @method getStrings"," * @param {String} locale (optional) The locale for which the string value is required. Defaults to the current locale, if not provided."," */"," // TODO: Optimize/Cache. Clear cache on _setStrings call."," getStrings : function(locale) {",""," locale = (locale || this.get(LOCALE)).toLowerCase();","",""," var defLocale = this.getDefaultLocale().toLowerCase(),"," defStrs = this._getStrings(defLocale),"," strs = (defStrs) ? Y.merge(defStrs) : {},"," localeSegments = locale.split(HYPHEN),"," localeStrs,"," i, l,"," lookup;",""," // If locale is different than the default, or needs lookup support"," if (locale !== defLocale || localeSegments.length > 1) {"," lookup = EMPTY_STR;"," for (i = 0, l = localeSegments.length; i < l; ++i) {"," lookup += localeSegments[i];","",""," localeStrs = this._getStrings(lookup);"," if (localeStrs) {"," Y.aggregate(strs, localeStrs, TRUE);"," }"," lookup += HYPHEN;"," }"," }",""," return strs;"," },",""," /**"," * Gets the string for a particular key, for a particular locale, performing locale lookup."," * <p>"," * If no values if defined for the key, for the given locale, the value for the"," * default locale (in initial locale set for the class) is returned."," * </p>"," * @method getString"," * @param {String} key The key."," * @param {String} locale (optional) The locale for which the string value is required. Defaults to the current locale, if not provided."," */"," getString : function(key, locale) {",""," locale = (locale || this.get(LOCALE)).toLowerCase();","",""," var defLocale = (this.getDefaultLocale()).toLowerCase(),"," strs = this._getStrings(defLocale) || {},"," str = strs[key],"," idx = locale.lastIndexOf(HYPHEN);",""," // If locale is different than the default, or needs lookup support"," if (locale !== defLocale || idx != -1) {"," do {",""," strs = this._getStrings(locale);"," if (strs && key in strs) {"," str = strs[key];"," break;"," }"," idx = locale.lastIndexOf(HYPHEN);"," // Chop of last locale segment"," if (idx != -1) {"," locale = locale.substring(0, idx);"," }",""," } while (idx != -1);"," }",""," return str;"," },",""," /**"," * Returns the default locale for the widget (the locale value defined by the"," * widget class, or provided by the user during construction)."," *"," * @method getDefaultLocale"," * @return {String} The default locale for the widget"," */"," getDefaultLocale : function() {"," return this._state.get(LOCALE, INIT_VALUE);"," },",""," _strSetter : function(val) {"," return this._setStrings(val, this.get(LOCALE));"," },",""," _strGetter : function(val) {"," return this._getStrings(this.get(LOCALE));"," }","}, true);","","","}, '3.10.3', {\"requires\": [\"widget-base\"]});","","}());"]};
}
var __cov_lVYLu9H8d2QefkUqy3nVLg = __coverage__['build/widget-locale/widget-locale.js'];
__cov_lVYLu9H8d2QefkUqy3nVLg.s['1']++;YUI.add('widget-locale',function(Y,NAME){__cov_lVYLu9H8d2QefkUqy3nVLg.f['1']++;__cov_lVYLu9H8d2QefkUqy3nVLg.s['2']++;var TRUE=true,LOCALE='locale',INIT_VALUE='initValue',HYPHEN='-',EMPTY_STR='',Widget=Y.Widget;__cov_lVYLu9H8d2QefkUqy3nVLg.s['3']++;Widget.ATTRS[LOCALE]={value:'en'};__cov_lVYLu9H8d2QefkUqy3nVLg.s['4']++;Widget.ATTRS.strings.lazyAdd=false;__cov_lVYLu9H8d2QefkUqy3nVLg.s['5']++;Y.mix(Widget.prototype,{_setStrings:function(strings,locale){__cov_lVYLu9H8d2QefkUqy3nVLg.f['2']++;__cov_lVYLu9H8d2QefkUqy3nVLg.s['6']++;var strs=this._strs;__cov_lVYLu9H8d2QefkUqy3nVLg.s['7']++;locale=locale.toLowerCase();__cov_lVYLu9H8d2QefkUqy3nVLg.s['8']++;if(!strs[locale]){__cov_lVYLu9H8d2QefkUqy3nVLg.b['1'][0]++;__cov_lVYLu9H8d2QefkUqy3nVLg.s['9']++;strs[locale]={};}else{__cov_lVYLu9H8d2QefkUqy3nVLg.b['1'][1]++;}__cov_lVYLu9H8d2QefkUqy3nVLg.s['10']++;Y.aggregate(strs[locale],strings,TRUE);__cov_lVYLu9H8d2QefkUqy3nVLg.s['11']++;return strs[locale];},_getStrings:function(locale){__cov_lVYLu9H8d2QefkUqy3nVLg.f['3']++;__cov_lVYLu9H8d2QefkUqy3nVLg.s['12']++;return this._strs[locale.toLowerCase()];},getStrings:function(locale){__cov_lVYLu9H8d2QefkUqy3nVLg.f['4']++;__cov_lVYLu9H8d2QefkUqy3nVLg.s['13']++;locale=((__cov_lVYLu9H8d2QefkUqy3nVLg.b['2'][0]++,locale)||(__cov_lVYLu9H8d2QefkUqy3nVLg.b['2'][1]++,this.get(LOCALE))).toLowerCase();__cov_lVYLu9H8d2QefkUqy3nVLg.s['14']++;var defLocale=this.getDefaultLocale().toLowerCase(),defStrs=this._getStrings(defLocale),strs=defStrs?(__cov_lVYLu9H8d2QefkUqy3nVLg.b['3'][0]++,Y.merge(defStrs)):(__cov_lVYLu9H8d2QefkUqy3nVLg.b['3'][1]++,{}),localeSegments=locale.split(HYPHEN),localeStrs,i,l,lookup;__cov_lVYLu9H8d2QefkUqy3nVLg.s['15']++;if((__cov_lVYLu9H8d2QefkUqy3nVLg.b['5'][0]++,locale!==defLocale)||(__cov_lVYLu9H8d2QefkUqy3nVLg.b['5'][1]++,localeSegments.length>1)){__cov_lVYLu9H8d2QefkUqy3nVLg.b['4'][0]++;__cov_lVYLu9H8d2QefkUqy3nVLg.s['16']++;lookup=EMPTY_STR;__cov_lVYLu9H8d2QefkUqy3nVLg.s['17']++;for(i=0,l=localeSegments.length;i<l;++i){__cov_lVYLu9H8d2QefkUqy3nVLg.s['18']++;lookup+=localeSegments[i];__cov_lVYLu9H8d2QefkUqy3nVLg.s['19']++;localeStrs=this._getStrings(lookup);__cov_lVYLu9H8d2QefkUqy3nVLg.s['20']++;if(localeStrs){__cov_lVYLu9H8d2QefkUqy3nVLg.b['6'][0]++;__cov_lVYLu9H8d2QefkUqy3nVLg.s['21']++;Y.aggregate(strs,localeStrs,TRUE);}else{__cov_lVYLu9H8d2QefkUqy3nVLg.b['6'][1]++;}__cov_lVYLu9H8d2QefkUqy3nVLg.s['22']++;lookup+=HYPHEN;}}else{__cov_lVYLu9H8d2QefkUqy3nVLg.b['4'][1]++;}__cov_lVYLu9H8d2QefkUqy3nVLg.s['23']++;return strs;},getString:function(key,locale){__cov_lVYLu9H8d2QefkUqy3nVLg.f['5']++;__cov_lVYLu9H8d2QefkUqy3nVLg.s['24']++;locale=((__cov_lVYLu9H8d2QefkUqy3nVLg.b['7'][0]++,locale)||(__cov_lVYLu9H8d2QefkUqy3nVLg.b['7'][1]++,this.get(LOCALE))).toLowerCase();__cov_lVYLu9H8d2QefkUqy3nVLg.s['25']++;var defLocale=this.getDefaultLocale().toLowerCase(),strs=(__cov_lVYLu9H8d2QefkUqy3nVLg.b['8'][0]++,this._getStrings(defLocale))||(__cov_lVYLu9H8d2QefkUqy3nVLg.b['8'][1]++,{}),str=strs[key],idx=locale.lastIndexOf(HYPHEN);__cov_lVYLu9H8d2QefkUqy3nVLg.s['26']++;if((__cov_lVYLu9H8d2QefkUqy3nVLg.b['10'][0]++,locale!==defLocale)||(__cov_lVYLu9H8d2QefkUqy3nVLg.b['10'][1]++,idx!=-1)){__cov_lVYLu9H8d2QefkUqy3nVLg.b['9'][0]++;__cov_lVYLu9H8d2QefkUqy3nVLg.s['27']++;do{__cov_lVYLu9H8d2QefkUqy3nVLg.s['28']++;strs=this._getStrings(locale);__cov_lVYLu9H8d2QefkUqy3nVLg.s['29']++;if((__cov_lVYLu9H8d2QefkUqy3nVLg.b['12'][0]++,strs)&&(__cov_lVYLu9H8d2QefkUqy3nVLg.b['12'][1]++,key in strs)){__cov_lVYLu9H8d2QefkUqy3nVLg.b['11'][0]++;__cov_lVYLu9H8d2QefkUqy3nVLg.s['30']++;str=strs[key];__cov_lVYLu9H8d2QefkUqy3nVLg.s['31']++;break;}else{__cov_lVYLu9H8d2QefkUqy3nVLg.b['11'][1]++;}__cov_lVYLu9H8d2QefkUqy3nVLg.s['32']++;idx=locale.lastIndexOf(HYPHEN);__cov_lVYLu9H8d2QefkUqy3nVLg.s['33']++;if(idx!=-1){__cov_lVYLu9H8d2QefkUqy3nVLg.b['13'][0]++;__cov_lVYLu9H8d2QefkUqy3nVLg.s['34']++;locale=locale.substring(0,idx);}else{__cov_lVYLu9H8d2QefkUqy3nVLg.b['13'][1]++;}}while(idx!=-1);}else{__cov_lVYLu9H8d2QefkUqy3nVLg.b['9'][1]++;}__cov_lVYLu9H8d2QefkUqy3nVLg.s['35']++;return str;},getDefaultLocale:function(){__cov_lVYLu9H8d2QefkUqy3nVLg.f['6']++;__cov_lVYLu9H8d2QefkUqy3nVLg.s['36']++;return this._state.get(LOCALE,INIT_VALUE);},_strSetter:function(val){__cov_lVYLu9H8d2QefkUqy3nVLg.f['7']++;__cov_lVYLu9H8d2QefkUqy3nVLg.s['37']++;return this._setStrings(val,this.get(LOCALE));},_strGetter:function(val){__cov_lVYLu9H8d2QefkUqy3nVLg.f['8']++;__cov_lVYLu9H8d2QefkUqy3nVLg.s['38']++;return this._getStrings(this.get(LOCALE));}},true);},'3.10.3',{'requires':['widget-base']});