var COMPILED=!0,goog=goog||{};goog.global=this;goog.DEBUG=!0;goog.LOCALE="en";goog.provide=function(a){if(!COMPILED){if(goog.isProvided_(a))throw Error('Namespace "'+a+'" already declared.');delete goog.implicitNamespaces_[a];for(var b=a;b=b.substring(0,b.lastIndexOf("."));){if(goog.getObjectByName(b))break;goog.implicitNamespaces_[b]=!0}}goog.exportPath_(a)};
goog.setTestOnly=function(a){if(COMPILED&&!goog.DEBUG)throw a=a||"",Error("Importing test-only code into non-debug environment"+a?": "+a:".");};if(!COMPILED)goog.isProvided_=function(a){return!goog.implicitNamespaces_[a]&&!!goog.getObjectByName(a)},goog.implicitNamespaces_={};goog.exportPath_=function(a,b,c){a=a.split(".");c=c||goog.global;!(a[0]in c)&&c.execScript&&c.execScript("var "+a[0]);for(var d;a.length&&(d=a.shift());)!a.length&&goog.isDef(b)?c[d]=b:c=c[d]?c[d]:c[d]={}};
goog.getObjectByName=function(a,b){for(var c=a.split("."),d=b||goog.global,e;e=c.shift();)if(goog.isDefAndNotNull(d[e]))d=d[e];else return null;return d};goog.globalize=function(a,b){var c=b||goog.global,d;for(d in a)c[d]=a[d]};
goog.addDependency=function(a,b,c){if(!COMPILED){var d;a=a.replace(/\\/g,"/");for(var e=goog.dependencies_,f=0;d=b[f];f++)e.nameToPath[d]=a,a in e.pathToNames||(e.pathToNames[a]={}),e.pathToNames[a][d]=!0;for(d=0;b=c[d];d++)a in e.requires||(e.requires[a]={}),e.requires[a][b]=!0}};goog.ENABLE_DEBUG_LOADER=!0;
goog.require=function(a){if(!COMPILED&&!goog.isProvided_(a)){if(goog.ENABLE_DEBUG_LOADER){var b=goog.getPathFromDeps_(a);if(b){goog.included_[b]=!0;goog.writeScripts_();return}}a="goog.require could not find: "+a;goog.global.console&&goog.global.console.error(a);throw Error(a);}};goog.basePath="";goog.nullFunction=function(){};goog.identityFunction=function(a){return a};goog.abstractMethod=function(){throw Error("unimplemented abstract method");};
goog.addSingletonGetter=function(a){a.getInstance=function(){return a.instance_||(a.instance_=new a)}};
if(!COMPILED&&goog.ENABLE_DEBUG_LOADER)goog.included_={},goog.dependencies_={pathToNames:{},nameToPath:{},requires:{},visited:{},written:{}},goog.inHtmlDocument_=function(){var a=goog.global.document;return typeof a!="undefined"&&"write"in a},goog.findBasePath_=function(){if(goog.global.CLOSURE_BASE_PATH)goog.basePath=goog.global.CLOSURE_BASE_PATH;else if(goog.inHtmlDocument_())for(var a=goog.global.document.getElementsByTagName("script"),b=a.length-1;b>=0;--b){var c=a[b].src,d=c.lastIndexOf("?");
d=d==-1?c.length:d;if(c.substr(d-7,7)=="base.js"){goog.basePath=c.substr(0,d-7);break}}},goog.importScript_=function(a){var b=goog.global.CLOSURE_IMPORT_SCRIPT||goog.writeScriptTag_;!goog.dependencies_.written[a]&&b(a)&&(goog.dependencies_.written[a]=!0)},goog.writeScriptTag_=function(a){return goog.inHtmlDocument_()?(goog.global.document.write('<script type="text/javascript" src="'+a+'"><\/script>'),!0):!1},goog.writeScripts_=function(){function a(e){if(!(e in d.written)){if(!(e in d.visited)&&(d.visited[e]=
!0,e in d.requires))for(var g in d.requires[e])if(!goog.isProvided_(g))if(g in d.nameToPath)a(d.nameToPath[g]);else throw Error("Undefined nameToPath for "+g);e in c||(c[e]=!0,b.push(e))}}var b=[],c={},d=goog.dependencies_,e;for(e in goog.included_)d.written[e]||a(e);for(e=0;e<b.length;e++)if(b[e])goog.importScript_(goog.basePath+b[e]);else throw Error("Undefined script input");},goog.getPathFromDeps_=function(a){return a in goog.dependencies_.nameToPath?goog.dependencies_.nameToPath[a]:null},goog.findBasePath_(),
goog.global.CLOSURE_NO_DEPS||goog.importScript_(goog.basePath+"deps.js");
goog.typeOf=function(a){var b=typeof a;if(b=="object")if(a){if(a instanceof Array)return"array";else if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if(c=="[object Window]")return"object";if(c=="[object Array]"||typeof a.length=="number"&&typeof a.splice!="undefined"&&typeof a.propertyIsEnumerable!="undefined"&&!a.propertyIsEnumerable("splice"))return"array";if(c=="[object Function]"||typeof a.call!="undefined"&&typeof a.propertyIsEnumerable!="undefined"&&!a.propertyIsEnumerable("call"))return"function"}else return"null";
else if(b=="function"&&typeof a.call=="undefined")return"object";return b};goog.propertyIsEnumerableCustom_=function(a,b){if(b in a)for(var c in a)if(c==b&&Object.prototype.hasOwnProperty.call(a,b))return!0;return!1};goog.propertyIsEnumerable_=function(a,b){return a instanceof Object?Object.prototype.propertyIsEnumerable.call(a,b):goog.propertyIsEnumerableCustom_(a,b)};goog.isDef=function(a){return a!==void 0};goog.isNull=function(a){return a===null};goog.isDefAndNotNull=function(a){return a!=null};
goog.isArray=function(a){return goog.typeOf(a)=="array"};goog.isArrayLike=function(a){var b=goog.typeOf(a);return b=="array"||b=="object"&&typeof a.length=="number"};goog.isDateLike=function(a){return goog.isObject(a)&&typeof a.getFullYear=="function"};goog.isString=function(a){return typeof a=="string"};goog.isBoolean=function(a){return typeof a=="boolean"};goog.isNumber=function(a){return typeof a=="number"};goog.isFunction=function(a){return goog.typeOf(a)=="function"};
goog.isObject=function(a){a=goog.typeOf(a);return a=="object"||a=="array"||a=="function"};goog.getUid=function(a){return a[goog.UID_PROPERTY_]||(a[goog.UID_PROPERTY_]=++goog.uidCounter_)};goog.removeUid=function(a){"removeAttribute"in a&&a.removeAttribute(goog.UID_PROPERTY_);try{delete a[goog.UID_PROPERTY_]}catch(b){}};goog.UID_PROPERTY_="closure_uid_"+Math.floor(Math.random()*2147483648).toString(36);goog.uidCounter_=0;goog.getHashCode=goog.getUid;goog.removeHashCode=goog.removeUid;
goog.cloneObject=function(a){var b=goog.typeOf(a);if(b=="object"||b=="array"){if(a.clone)return a.clone();b=b=="array"?[]:{};for(var c in a)b[c]=goog.cloneObject(a[c]);return b}return a};goog.bindNative_=function(a){return a.call.apply(a.bind,arguments)};
goog.bindJs_=function(a,b){if(!a)throw Error();if(arguments.length>2){var c=Array.prototype.slice.call(arguments,2);return function(){var d=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(d,c);return a.apply(b,d)}}else return function(){return a.apply(b,arguments)}};goog.bind=function(){goog.bind=Function.prototype.bind&&Function.prototype.bind.toString().indexOf("native code")!=-1?goog.bindNative_:goog.bindJs_;return goog.bind.apply(null,arguments)};
goog.partial=function(a){var b=Array.prototype.slice.call(arguments,1);return function(){var c=Array.prototype.slice.call(arguments);c.unshift.apply(c,b);return a.apply(this,c)}};goog.mixin=function(a,b){for(var c in b)a[c]=b[c]};goog.now=Date.now||function(){return+new Date};
goog.globalEval=function(a){if(goog.global.execScript)goog.global.execScript(a,"JavaScript");else if(goog.global.eval){if(goog.evalWorksForGlobals_==null)goog.global.eval("var _et_ = 1;"),typeof goog.global._et_!="undefined"?(delete goog.global._et_,goog.evalWorksForGlobals_=!0):goog.evalWorksForGlobals_=!1;if(goog.evalWorksForGlobals_)goog.global.eval(a);else{var b=goog.global.document,c=b.createElement("script");c.type="text/javascript";c.defer=!1;c.appendChild(b.createTextNode(a));b.body.appendChild(c);
b.body.removeChild(c)}}else throw Error("goog.globalEval not available");};goog.evalWorksForGlobals_=null;goog.getCssName=function(a,b){var c=function(a){return goog.cssNameMapping_[a]||a},d;d=goog.cssNameMapping_?goog.cssNameMappingStyle_=="BY_WHOLE"?c:function(a){a=a.split("-");for(var b=[],d=0;d<a.length;d++)b.push(c(a[d]));return b.join("-")}:function(a){return a};return b?a+"-"+d(b):d(a)};goog.setCssNameMapping=function(a,b){goog.cssNameMapping_=a;goog.cssNameMappingStyle_=b};
if(!COMPILED&&goog.global.CLOSURE_CSS_NAME_MAPPING)goog.cssNameMapping_=goog.global.CLOSURE_CSS_NAME_MAPPING;goog.getMsg=function(a,b){var c=b||{},d;for(d in c){var e=(""+c[d]).replace(/\$/g,"$$$$");a=a.replace(RegExp("\\{\\$"+d+"\\}","gi"),e)}return a};goog.exportSymbol=function(a,b,c){goog.exportPath_(a,b,c)};goog.exportProperty=function(a,b,c){a[b]=c};goog.inherits=function(a,b){function c(){}c.prototype=b.prototype;a.superClass_=b.prototype;a.prototype=new c;a.prototype.constructor=a};
goog.base=function(a,b){var c=arguments.callee.caller;if(c.superClass_)return c.superClass_.constructor.apply(a,Array.prototype.slice.call(arguments,1));for(var d=Array.prototype.slice.call(arguments,2),e=!1,f=a.constructor;f;f=f.superClass_&&f.superClass_.constructor)if(f.prototype[b]===c)e=!0;else if(e)return f.prototype[b].apply(a,d);if(a[b]===c)return a.constructor.prototype[b].apply(a,d);else throw Error("goog.base called from a method of one name to a method of a different name");};
goog.scope=function(a){a.call(goog.global)};goog.string={};goog.string.Unicode={NBSP:"\u00a0"};goog.string.startsWith=function(a,b){return a.lastIndexOf(b,0)==0};goog.string.endsWith=function(a,b){var c=a.length-b.length;return c>=0&&a.indexOf(b,c)==c};goog.string.caseInsensitiveStartsWith=function(a,b){return goog.string.caseInsensitiveCompare(b,a.substr(0,b.length))==0};goog.string.caseInsensitiveEndsWith=function(a,b){return goog.string.caseInsensitiveCompare(b,a.substr(a.length-b.length,b.length))==0};
goog.string.subs=function(a){for(var b=1;b<arguments.length;b++){var c=String(arguments[b]).replace(/\$/g,"$$$$");a=a.replace(/\%s/,c)}return a};goog.string.collapseWhitespace=function(a){return a.replace(/[\s\xa0]+/g," ").replace(/^\s+|\s+$/g,"")};goog.string.isEmpty=function(a){return/^[\s\xa0]*$/.test(a)};goog.string.isEmptySafe=function(a){return goog.string.isEmpty(goog.string.makeSafe(a))};goog.string.isBreakingWhitespace=function(a){return!/[^\t\n\r ]/.test(a)};goog.string.isAlpha=function(a){return!/[^a-zA-Z]/.test(a)};
goog.string.isNumeric=function(a){return!/[^0-9]/.test(a)};goog.string.isAlphaNumeric=function(a){return!/[^a-zA-Z0-9]/.test(a)};goog.string.isSpace=function(a){return a==" "};goog.string.isUnicodeChar=function(a){return a.length==1&&a>=" "&&a<="~"||a>="\u0080"&&a<="\ufffd"};goog.string.stripNewlines=function(a){return a.replace(/(\r\n|\r|\n)+/g," ")};goog.string.canonicalizeNewlines=function(a){return a.replace(/(\r\n|\r|\n)/g,"\n")};
goog.string.normalizeWhitespace=function(a){return a.replace(/\xa0|\s/g," ")};goog.string.normalizeSpaces=function(a){return a.replace(/\xa0|[ \t]+/g," ")};goog.string.collapseBreakingSpaces=function(a){return a.replace(/[\t\r\n ]+/g," ").replace(/^[\t\r\n ]+|[\t\r\n ]+$/g,"")};goog.string.trim=function(a){return a.replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")};goog.string.trimLeft=function(a){return a.replace(/^[\s\xa0]+/,"")};goog.string.trimRight=function(a){return a.replace(/[\s\xa0]+$/,"")};
goog.string.caseInsensitiveCompare=function(a,b){var c=String(a).toLowerCase(),d=String(b).toLowerCase();return c<d?-1:c==d?0:1};goog.string.numerateCompareRegExp_=/(\.\d+)|(\d+)|(\D+)/g;
goog.string.numerateCompare=function(a,b){if(a==b)return 0;if(!a)return-1;if(!b)return 1;for(var c=a.toLowerCase().match(goog.string.numerateCompareRegExp_),d=b.toLowerCase().match(goog.string.numerateCompareRegExp_),e=Math.min(c.length,d.length),f=0;f<e;f++){var g=c[f],h=d[f];if(g!=h){c=parseInt(g,10);if(!isNaN(c)&&(d=parseInt(h,10),!isNaN(d)&&c-d))return c-d;return g<h?-1:1}}if(c.length!=d.length)return c.length-d.length;return a<b?-1:1};goog.string.encodeUriRegExp_=/^[a-zA-Z0-9\-_.!~*'()]*$/;
goog.string.urlEncode=function(a){a=String(a);if(!goog.string.encodeUriRegExp_.test(a))return encodeURIComponent(a);return a};goog.string.urlDecode=function(a){return decodeURIComponent(a.replace(/\+/g," "))};goog.string.newLineToBr=function(a,b){return a.replace(/(\r\n|\r|\n)/g,b?"<br />":"<br>")};
goog.string.htmlEscape=function(a,b){if(b)return a.replace(goog.string.amperRe_,"&amp;").replace(goog.string.ltRe_,"&lt;").replace(goog.string.gtRe_,"&gt;").replace(goog.string.quotRe_,"&quot;");else{if(!goog.string.allRe_.test(a))return a;a.indexOf("&")!=-1&&(a=a.replace(goog.string.amperRe_,"&amp;"));a.indexOf("<")!=-1&&(a=a.replace(goog.string.ltRe_,"&lt;"));a.indexOf(">")!=-1&&(a=a.replace(goog.string.gtRe_,"&gt;"));a.indexOf('"')!=-1&&(a=a.replace(goog.string.quotRe_,"&quot;"));return a}};
goog.string.amperRe_=/&/g;goog.string.ltRe_=/</g;goog.string.gtRe_=/>/g;goog.string.quotRe_=/\"/g;goog.string.allRe_=/[&<>\"]/;goog.string.unescapeEntities=function(a){if(goog.string.contains(a,"&"))return"document"in goog.global?goog.string.unescapeEntitiesUsingDom_(a):goog.string.unescapePureXmlEntities_(a);return a};
goog.string.unescapeEntitiesUsingDom_=function(a){var b={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"'},c=document.createElement("div");return a.replace(goog.string.HTML_ENTITY_PATTERN_,function(a,e){var f=b[a];if(f)return f;if(e.charAt(0)=="#"){var g=Number("0"+e.substr(1));isNaN(g)||(f=String.fromCharCode(g))}if(!f)c.innerHTML=a+" ",f=c.firstChild.nodeValue.slice(0,-1);return b[a]=f})};
goog.string.unescapePureXmlEntities_=function(a){return a.replace(/&([^;]+);/g,function(a,c){switch(c){case "amp":return"&";case "lt":return"<";case "gt":return">";case "quot":return'"';default:if(c.charAt(0)=="#"){var d=Number("0"+c.substr(1));if(!isNaN(d))return String.fromCharCode(d)}return a}})};goog.string.HTML_ENTITY_PATTERN_=/&([^;\s<&]+);?/g;goog.string.whitespaceEscape=function(a,b){return goog.string.newLineToBr(a.replace(/  /g," &#160;"),b)};
goog.string.stripQuotes=function(a,b){for(var c=b.length,d=0;d<c;d++){var e=c==1?b:b.charAt(d);if(a.charAt(0)==e&&a.charAt(a.length-1)==e)return a.substring(1,a.length-1)}return a};goog.string.truncate=function(a,b,c){c&&(a=goog.string.unescapeEntities(a));a.length>b&&(a=a.substring(0,b-3)+"...");c&&(a=goog.string.htmlEscape(a));return a};
goog.string.truncateMiddle=function(a,b,c,d){c&&(a=goog.string.unescapeEntities(a));if(d&&a.length>b){d>b&&(d=b);var e=a.length-d;a=a.substring(0,b-d)+"..."+a.substring(e)}else a.length>b&&(d=Math.floor(b/2),e=a.length-d,d+=b%2,a=a.substring(0,d)+"..."+a.substring(e));c&&(a=goog.string.htmlEscape(a));return a};goog.string.specialEscapeChars_={"\0":"\\0","\u0008":"\\b","\u000c":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\u000b":"\\x0B",'"':'\\"',"\\":"\\\\"};goog.string.jsEscapeCache_={"'":"\\'"};
goog.string.quote=function(a){a=String(a);if(a.quote)return a.quote();else{for(var b=['"'],c=0;c<a.length;c++){var d=a.charAt(c),e=d.charCodeAt(0);b[c+1]=goog.string.specialEscapeChars_[d]||(e>31&&e<127?d:goog.string.escapeChar(d))}b.push('"');return b.join("")}};goog.string.escapeString=function(a){for(var b=[],c=0;c<a.length;c++)b[c]=goog.string.escapeChar(a.charAt(c));return b.join("")};
goog.string.escapeChar=function(a){if(a in goog.string.jsEscapeCache_)return goog.string.jsEscapeCache_[a];if(a in goog.string.specialEscapeChars_)return goog.string.jsEscapeCache_[a]=goog.string.specialEscapeChars_[a];var b=a,c=a.charCodeAt(0);if(c>31&&c<127)b=a;else{if(c<256){if(b="\\x",c<16||c>256)b+="0"}else b="\\u",c<4096&&(b+="0");b+=c.toString(16).toUpperCase()}return goog.string.jsEscapeCache_[a]=b};goog.string.toMap=function(a){for(var b={},c=0;c<a.length;c++)b[a.charAt(c)]=!0;return b};
goog.string.contains=function(a,b){return a.indexOf(b)!=-1};goog.string.removeAt=function(a,b,c){var d=a;b>=0&&b<a.length&&c>0&&(d=a.substr(0,b)+a.substr(b+c,a.length-b-c));return d};goog.string.remove=function(a,b){var c=RegExp(goog.string.regExpEscape(b),"");return a.replace(c,"")};goog.string.removeAll=function(a,b){var c=RegExp(goog.string.regExpEscape(b),"g");return a.replace(c,"")};
goog.string.regExpEscape=function(a){return String(a).replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g,"\\$1").replace(/\x08/g,"\\x08")};goog.string.repeat=function(a,b){return Array(b+1).join(a)};goog.string.padNumber=function(a,b,c){a=goog.isDef(c)?a.toFixed(c):String(a);c=a.indexOf(".");if(c==-1)c=a.length;return goog.string.repeat("0",Math.max(0,b-c))+a};goog.string.makeSafe=function(a){return a==null?"":String(a)};goog.string.buildString=function(){return Array.prototype.join.call(arguments,"")};
goog.string.getRandomString=function(){return Math.floor(Math.random()*2147483648).toString(36)+Math.abs(Math.floor(Math.random()*2147483648)^goog.now()).toString(36)};
goog.string.compareVersions=function(a,b){for(var c=0,d=goog.string.trim(String(a)).split("."),e=goog.string.trim(String(b)).split("."),f=Math.max(d.length,e.length),g=0;c==0&&g<f;g++){var h=d[g]||"",i=e[g]||"",j=RegExp("(\\d*)(\\D*)","g"),k=RegExp("(\\d*)(\\D*)","g");do{var l=j.exec(h)||["","",""],m=k.exec(i)||["","",""];if(l[0].length==0&&m[0].length==0)break;c=l[1].length==0?0:parseInt(l[1],10);var n=m[1].length==0?0:parseInt(m[1],10);c=goog.string.compareElements_(c,n)||goog.string.compareElements_(l[2].length==
0,m[2].length==0)||goog.string.compareElements_(l[2],m[2])}while(c==0)}return c};goog.string.compareElements_=function(a,b){if(a<b)return-1;else if(a>b)return 1;return 0};goog.string.HASHCODE_MAX_=4294967296;goog.string.hashCode=function(a){for(var b=0,c=0;c<a.length;++c)b=31*b+a.charCodeAt(c),b%=goog.string.HASHCODE_MAX_;return b};goog.string.uniqueStringCounter_=Math.random()*2147483648|0;goog.string.createUniqueString=function(){return"goog_"+goog.string.uniqueStringCounter_++};
goog.string.toNumber=function(a){var b=Number(a);if(b==0&&goog.string.isEmpty(a))return NaN;return b};goog.string.toCamelCaseCache_={};goog.string.toCamelCase=function(a){return goog.string.toCamelCaseCache_[a]||(goog.string.toCamelCaseCache_[a]=String(a).replace(/\-([a-z])/g,function(a,c){return c.toUpperCase()}))};goog.string.toSelectorCaseCache_={};
goog.string.toSelectorCase=function(a){return goog.string.toSelectorCaseCache_[a]||(goog.string.toSelectorCaseCache_[a]=String(a).replace(/([A-Z])/g,"-$1").toLowerCase())};goog.userAgent={};goog.userAgent.ASSUME_IE=!1;goog.userAgent.ASSUME_GECKO=!1;goog.userAgent.ASSUME_WEBKIT=!1;goog.userAgent.ASSUME_MOBILE_WEBKIT=!1;goog.userAgent.ASSUME_OPERA=!1;goog.userAgent.BROWSER_KNOWN_=goog.userAgent.ASSUME_IE||goog.userAgent.ASSUME_GECKO||goog.userAgent.ASSUME_MOBILE_WEBKIT||goog.userAgent.ASSUME_WEBKIT||goog.userAgent.ASSUME_OPERA;goog.userAgent.getUserAgentString=function(){return goog.global.navigator?goog.global.navigator.userAgent:null};goog.userAgent.getNavigator=function(){return goog.global.navigator};
goog.userAgent.init_=function(){goog.userAgent.detectedOpera_=!1;goog.userAgent.detectedIe_=!1;goog.userAgent.detectedWebkit_=!1;goog.userAgent.detectedMobile_=!1;goog.userAgent.detectedGecko_=!1;var a;if(!goog.userAgent.BROWSER_KNOWN_&&(a=goog.userAgent.getUserAgentString())){var b=goog.userAgent.getNavigator();goog.userAgent.detectedOpera_=a.indexOf("Opera")==0;goog.userAgent.detectedIe_=!goog.userAgent.detectedOpera_&&a.indexOf("MSIE")!=-1;goog.userAgent.detectedWebkit_=!goog.userAgent.detectedOpera_&&
a.indexOf("WebKit")!=-1;goog.userAgent.detectedMobile_=goog.userAgent.detectedWebkit_&&a.indexOf("Mobile")!=-1;goog.userAgent.detectedGecko_=!goog.userAgent.detectedOpera_&&!goog.userAgent.detectedWebkit_&&b.product=="Gecko"}};goog.userAgent.BROWSER_KNOWN_||goog.userAgent.init_();goog.userAgent.OPERA=goog.userAgent.BROWSER_KNOWN_?goog.userAgent.ASSUME_OPERA:goog.userAgent.detectedOpera_;goog.userAgent.IE=goog.userAgent.BROWSER_KNOWN_?goog.userAgent.ASSUME_IE:goog.userAgent.detectedIe_;
goog.userAgent.GECKO=goog.userAgent.BROWSER_KNOWN_?goog.userAgent.ASSUME_GECKO:goog.userAgent.detectedGecko_;goog.userAgent.WEBKIT=goog.userAgent.BROWSER_KNOWN_?goog.userAgent.ASSUME_WEBKIT||goog.userAgent.ASSUME_MOBILE_WEBKIT:goog.userAgent.detectedWebkit_;goog.userAgent.MOBILE=goog.userAgent.ASSUME_MOBILE_WEBKIT||goog.userAgent.detectedMobile_;goog.userAgent.SAFARI=goog.userAgent.WEBKIT;goog.userAgent.determinePlatform_=function(){var a=goog.userAgent.getNavigator();return a&&a.platform||""};
goog.userAgent.PLATFORM=goog.userAgent.determinePlatform_();goog.userAgent.ASSUME_MAC=!1;goog.userAgent.ASSUME_WINDOWS=!1;goog.userAgent.ASSUME_LINUX=!1;goog.userAgent.ASSUME_X11=!1;goog.userAgent.PLATFORM_KNOWN_=goog.userAgent.ASSUME_MAC||goog.userAgent.ASSUME_WINDOWS||goog.userAgent.ASSUME_LINUX||goog.userAgent.ASSUME_X11;
goog.userAgent.initPlatform_=function(){goog.userAgent.detectedMac_=goog.string.contains(goog.userAgent.PLATFORM,"Mac");goog.userAgent.detectedWindows_=goog.string.contains(goog.userAgent.PLATFORM,"Win");goog.userAgent.detectedLinux_=goog.string.contains(goog.userAgent.PLATFORM,"Linux");goog.userAgent.detectedX11_=!!goog.userAgent.getNavigator()&&goog.string.contains(goog.userAgent.getNavigator().appVersion||"","X11")};goog.userAgent.PLATFORM_KNOWN_||goog.userAgent.initPlatform_();
goog.userAgent.MAC=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_MAC:goog.userAgent.detectedMac_;goog.userAgent.WINDOWS=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_WINDOWS:goog.userAgent.detectedWindows_;goog.userAgent.LINUX=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_LINUX:goog.userAgent.detectedLinux_;goog.userAgent.X11=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_X11:goog.userAgent.detectedX11_;
goog.userAgent.determineVersion_=function(){var a="",b;goog.userAgent.OPERA&&goog.global.opera?(a=goog.global.opera.version,a=typeof a=="function"?a():a):(goog.userAgent.GECKO?b=/rv\:([^\);]+)(\)|;)/:goog.userAgent.IE?b=/MSIE\s+([^\);]+)(\)|;)/:goog.userAgent.WEBKIT&&(b=/WebKit\/(\S+)/),b&&(a=(a=b.exec(goog.userAgent.getUserAgentString()))?a[1]:""));if(goog.userAgent.IE&&(b=goog.userAgent.getDocumentMode_(),b>parseFloat(a)))return String(b);return a};
goog.userAgent.getDocumentMode_=function(){var a=goog.global.document;return a?a.documentMode:void 0};goog.userAgent.VERSION=goog.userAgent.determineVersion_();goog.userAgent.compare=function(a,b){return goog.string.compareVersions(a,b)};goog.userAgent.isVersionCache_={};goog.userAgent.isVersion=function(a){return goog.userAgent.isVersionCache_[a]||(goog.userAgent.isVersionCache_[a]=goog.string.compareVersions(goog.userAgent.VERSION,a)>=0)};goog.userAgent.isDocumentModeCache_={};
goog.userAgent.isDocumentMode=function(a){return goog.userAgent.isDocumentModeCache_[a]||(goog.userAgent.isDocumentModeCache_[a]=goog.userAgent.IE&&document.documentMode&&document.documentMode>=a)};goog.debug={};goog.debug.errorHandlerWeakDep={protectEntryPoint:function(a){return a}};goog.events={};goog.events.Listener=function(){};goog.events.Listener.counter_=0;goog.events.Listener.prototype.key=0;goog.events.Listener.prototype.removed=!1;goog.events.Listener.prototype.callOnce=!1;
goog.events.Listener.prototype.init=function(a,b,c,d,e,f){if(goog.isFunction(a))this.isFunctionListener_=!0;else if(a&&a.handleEvent&&goog.isFunction(a.handleEvent))this.isFunctionListener_=!1;else throw Error("Invalid listener argument");this.listener=a;this.proxy=b;this.src=c;this.type=d;this.capture=!!e;this.handler=f;this.callOnce=!1;this.key=++goog.events.Listener.counter_;this.removed=!1};
goog.events.Listener.prototype.handleEvent=function(a){if(this.isFunctionListener_)return this.listener.call(this.handler||this.src,a);return this.listener.handleEvent.call(this.listener,a)};goog.object={};goog.object.forEach=function(a,b,c){for(var d in a)b.call(c,a[d],d,a)};goog.object.filter=function(a,b,c){var d={},e;for(e in a)b.call(c,a[e],e,a)&&(d[e]=a[e]);return d};goog.object.map=function(a,b,c){var d={},e;for(e in a)d[e]=b.call(c,a[e],e,a);return d};goog.object.some=function(a,b,c){for(var d in a)if(b.call(c,a[d],d,a))return!0;return!1};goog.object.every=function(a,b,c){for(var d in a)if(!b.call(c,a[d],d,a))return!1;return!0};
goog.object.getCount=function(a){var b=0,c;for(c in a)b++;return b};goog.object.getAnyKey=function(a){for(var b in a)return b};goog.object.getAnyValue=function(a){for(var b in a)return a[b]};goog.object.contains=function(a,b){return goog.object.containsValue(a,b)};goog.object.getValues=function(a){var b=[],c=0,d;for(d in a)b[c++]=a[d];return b};goog.object.getKeys=function(a){var b=[],c=0,d;for(d in a)b[c++]=d;return b};
goog.object.getValueByKeys=function(a,b){var c=goog.isArrayLike(b),d=c?b:arguments;for(c=c?0:1;c<d.length;c++)if(a=a[d[c]],!goog.isDef(a))break;return a};goog.object.containsKey=function(a,b){return b in a};goog.object.containsValue=function(a,b){for(var c in a)if(a[c]==b)return!0;return!1};goog.object.findKey=function(a,b,c){for(var d in a)if(b.call(c,a[d],d,a))return d};goog.object.findValue=function(a,b,c){return(b=goog.object.findKey(a,b,c))&&a[b]};
goog.object.isEmpty=function(a){for(var b in a)return!1;return!0};goog.object.clear=function(a){for(var b in a)delete a[b]};goog.object.remove=function(a,b){var c;(c=b in a)&&delete a[b];return c};goog.object.add=function(a,b,c){if(b in a)throw Error('The object already contains the key "'+b+'"');goog.object.set(a,b,c)};goog.object.get=function(a,b,c){if(b in a)return a[b];return c};goog.object.set=function(a,b,c){a[b]=c};goog.object.setIfUndefined=function(a,b,c){return b in a?a[b]:a[b]=c};
goog.object.clone=function(a){var b={},c;for(c in a)b[c]=a[c];return b};goog.object.unsafeClone=function(a){var b=goog.typeOf(a);if(b=="object"||b=="array"){if(a.clone)return a.clone();b=b=="array"?[]:{};for(var c in a)b[c]=goog.object.unsafeClone(a[c]);return b}return a};goog.object.transpose=function(a){var b={},c;for(c in a)b[a[c]]=c;return b};goog.object.PROTOTYPE_FIELDS_=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"];
goog.object.extend=function(a){for(var b,c,d=1;d<arguments.length;d++){c=arguments[d];for(b in c)a[b]=c[b];for(var e=0;e<goog.object.PROTOTYPE_FIELDS_.length;e++)b=goog.object.PROTOTYPE_FIELDS_[e],Object.prototype.hasOwnProperty.call(c,b)&&(a[b]=c[b])}};goog.object.create=function(){var a=arguments.length;if(a==1&&goog.isArray(arguments[0]))return goog.object.create.apply(null,arguments[0]);if(a%2)throw Error("Uneven number of arguments");for(var b={},c=0;c<a;c+=2)b[arguments[c]]=arguments[c+1];return b};
goog.object.createSet=function(){var a=arguments.length;if(a==1&&goog.isArray(arguments[0]))return goog.object.createSet.apply(null,arguments[0]);for(var b={},c=0;c<a;c++)b[arguments[c]]=!0;return b};goog.events.BrowserFeature={HAS_W3C_BUTTON:!goog.userAgent.IE||goog.userAgent.isDocumentMode(9),HAS_W3C_EVENT_SUPPORT:!goog.userAgent.IE||goog.userAgent.isDocumentMode(9),SET_KEY_CODE_TO_PREVENT_DEFAULT:goog.userAgent.IE&&!goog.userAgent.isVersion("8")};goog.debug.Error=function(a){this.stack=Error().stack||"";if(a)this.message=String(a)};goog.inherits(goog.debug.Error,Error);goog.debug.Error.prototype.name="CustomError";goog.asserts={};goog.asserts.ENABLE_ASSERTS=goog.DEBUG;goog.asserts.AssertionError=function(a,b){b.unshift(a);goog.debug.Error.call(this,goog.string.subs.apply(null,b));b.shift();this.messagePattern=a};goog.inherits(goog.asserts.AssertionError,goog.debug.Error);goog.asserts.AssertionError.prototype.name="AssertionError";goog.asserts.doAssertFailure_=function(a,b,c,d){var e="Assertion failed";if(c){e+=": "+c;var f=d}else a&&(e+=": "+a,f=b);throw new goog.asserts.AssertionError(""+e,f||[]);};
goog.asserts.assert=function(a,b){goog.asserts.ENABLE_ASSERTS&&!a&&goog.asserts.doAssertFailure_("",null,b,Array.prototype.slice.call(arguments,2));return a};goog.asserts.fail=function(a){if(goog.asserts.ENABLE_ASSERTS)throw new goog.asserts.AssertionError("Failure"+(a?": "+a:""),Array.prototype.slice.call(arguments,1));};
goog.asserts.assertNumber=function(a,b){goog.asserts.ENABLE_ASSERTS&&!goog.isNumber(a)&&goog.asserts.doAssertFailure_("Expected number but got %s: %s.",[goog.typeOf(a),a],b,Array.prototype.slice.call(arguments,2));return a};goog.asserts.assertString=function(a,b){goog.asserts.ENABLE_ASSERTS&&!goog.isString(a)&&goog.asserts.doAssertFailure_("Expected string but got %s: %s.",[goog.typeOf(a),a],b,Array.prototype.slice.call(arguments,2));return a};
goog.asserts.assertFunction=function(a,b){goog.asserts.ENABLE_ASSERTS&&!goog.isFunction(a)&&goog.asserts.doAssertFailure_("Expected function but got %s: %s.",[goog.typeOf(a),a],b,Array.prototype.slice.call(arguments,2));return a};goog.asserts.assertObject=function(a,b){goog.asserts.ENABLE_ASSERTS&&!goog.isObject(a)&&goog.asserts.doAssertFailure_("Expected object but got %s: %s.",[goog.typeOf(a),a],b,Array.prototype.slice.call(arguments,2));return a};
goog.asserts.assertArray=function(a,b){goog.asserts.ENABLE_ASSERTS&&!goog.isArray(a)&&goog.asserts.doAssertFailure_("Expected array but got %s: %s.",[goog.typeOf(a),a],b,Array.prototype.slice.call(arguments,2));return a};goog.asserts.assertBoolean=function(a,b){goog.asserts.ENABLE_ASSERTS&&!goog.isBoolean(a)&&goog.asserts.doAssertFailure_("Expected boolean but got %s: %s.",[goog.typeOf(a),a],b,Array.prototype.slice.call(arguments,2));return a};
goog.asserts.assertInstanceof=function(a,b,c){goog.asserts.ENABLE_ASSERTS&&!(a instanceof b)&&goog.asserts.doAssertFailure_("instanceof check failed.",null,c,Array.prototype.slice.call(arguments,3))};goog.array={};goog.array.ArrayLike={};goog.NATIVE_ARRAY_PROTOTYPES=!0;goog.array.peek=function(a){return a[a.length-1]};goog.array.ARRAY_PROTOTYPE_=Array.prototype;
goog.array.indexOf=goog.NATIVE_ARRAY_PROTOTYPES&&goog.array.ARRAY_PROTOTYPE_.indexOf?function(a,b,c){goog.asserts.assert(a.length!=null);return goog.array.ARRAY_PROTOTYPE_.indexOf.call(a,b,c)}:function(a,b,c){c=c==null?0:c<0?Math.max(0,a.length+c):c;if(goog.isString(a)){if(!goog.isString(b)||b.length!=1)return-1;return a.indexOf(b,c)}for(;c<a.length;c++)if(c in a&&a[c]===b)return c;return-1};
goog.array.lastIndexOf=goog.NATIVE_ARRAY_PROTOTYPES&&goog.array.ARRAY_PROTOTYPE_.lastIndexOf?function(a,b,c){goog.asserts.assert(a.length!=null);return goog.array.ARRAY_PROTOTYPE_.lastIndexOf.call(a,b,c==null?a.length-1:c)}:function(a,b,c){c=c==null?a.length-1:c;c<0&&(c=Math.max(0,a.length+c));if(goog.isString(a)){if(!goog.isString(b)||b.length!=1)return-1;return a.lastIndexOf(b,c)}for(;c>=0;c--)if(c in a&&a[c]===b)return c;return-1};
goog.array.forEach=goog.NATIVE_ARRAY_PROTOTYPES&&goog.array.ARRAY_PROTOTYPE_.forEach?function(a,b,c){goog.asserts.assert(a.length!=null);goog.array.ARRAY_PROTOTYPE_.forEach.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=goog.isString(a)?a.split(""):a,f=0;f<d;f++)f in e&&b.call(c,e[f],f,a)};goog.array.forEachRight=function(a,b,c){var d=a.length,e=goog.isString(a)?a.split(""):a;for(d-=1;d>=0;--d)d in e&&b.call(c,e[d],d,a)};
goog.array.filter=goog.NATIVE_ARRAY_PROTOTYPES&&goog.array.ARRAY_PROTOTYPE_.filter?function(a,b,c){goog.asserts.assert(a.length!=null);return goog.array.ARRAY_PROTOTYPE_.filter.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=[],f=0,g=goog.isString(a)?a.split(""):a,h=0;h<d;h++)if(h in g){var i=g[h];b.call(c,i,h,a)&&(e[f++]=i)}return e};
goog.array.map=goog.NATIVE_ARRAY_PROTOTYPES&&goog.array.ARRAY_PROTOTYPE_.map?function(a,b,c){goog.asserts.assert(a.length!=null);return goog.array.ARRAY_PROTOTYPE_.map.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=Array(d),f=goog.isString(a)?a.split(""):a,g=0;g<d;g++)g in f&&(e[g]=b.call(c,f[g],g,a));return e};goog.array.reduce=function(a,b,c,d){if(a.reduce)return d?a.reduce(goog.bind(b,d),c):a.reduce(b,c);var e=c;goog.array.forEach(a,function(c,g){e=b.call(d,e,c,g,a)});return e};
goog.array.reduceRight=function(a,b,c,d){if(a.reduceRight)return d?a.reduceRight(goog.bind(b,d),c):a.reduceRight(b,c);var e=c;goog.array.forEachRight(a,function(c,g){e=b.call(d,e,c,g,a)});return e};
goog.array.some=goog.NATIVE_ARRAY_PROTOTYPES&&goog.array.ARRAY_PROTOTYPE_.some?function(a,b,c){goog.asserts.assert(a.length!=null);return goog.array.ARRAY_PROTOTYPE_.some.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=goog.isString(a)?a.split(""):a,f=0;f<d;f++)if(f in e&&b.call(c,e[f],f,a))return!0;return!1};
goog.array.every=goog.NATIVE_ARRAY_PROTOTYPES&&goog.array.ARRAY_PROTOTYPE_.every?function(a,b,c){goog.asserts.assert(a.length!=null);return goog.array.ARRAY_PROTOTYPE_.every.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=goog.isString(a)?a.split(""):a,f=0;f<d;f++)if(f in e&&!b.call(c,e[f],f,a))return!1;return!0};goog.array.find=function(a,b,c){b=goog.array.findIndex(a,b,c);return b<0?null:goog.isString(a)?a.charAt(b):a[b]};
goog.array.findIndex=function(a,b,c){for(var d=a.length,e=goog.isString(a)?a.split(""):a,f=0;f<d;f++)if(f in e&&b.call(c,e[f],f,a))return f;return-1};goog.array.findRight=function(a,b,c){b=goog.array.findIndexRight(a,b,c);return b<0?null:goog.isString(a)?a.charAt(b):a[b]};goog.array.findIndexRight=function(a,b,c){var d=a.length,e=goog.isString(a)?a.split(""):a;for(d-=1;d>=0;d--)if(d in e&&b.call(c,e[d],d,a))return d;return-1};goog.array.contains=function(a,b){return goog.array.indexOf(a,b)>=0};
goog.array.isEmpty=function(a){return a.length==0};goog.array.clear=function(a){if(!goog.isArray(a))for(var b=a.length-1;b>=0;b--)delete a[b];a.length=0};goog.array.insert=function(a,b){goog.array.contains(a,b)||a.push(b)};goog.array.insertAt=function(a,b,c){goog.array.splice(a,c,0,b)};goog.array.insertArrayAt=function(a,b,c){goog.partial(goog.array.splice,a,c,0).apply(null,b)};
goog.array.insertBefore=function(a,b,c){var d;arguments.length==2||(d=goog.array.indexOf(a,c))<0?a.push(b):goog.array.insertAt(a,b,d)};goog.array.remove=function(a,b){var c=goog.array.indexOf(a,b),d;(d=c>=0)&&goog.array.removeAt(a,c);return d};goog.array.removeAt=function(a,b){goog.asserts.assert(a.length!=null);return goog.array.ARRAY_PROTOTYPE_.splice.call(a,b,1).length==1};goog.array.removeIf=function(a,b,c){b=goog.array.findIndex(a,b,c);if(b>=0)return goog.array.removeAt(a,b),!0;return!1};
goog.array.concat=function(){return goog.array.ARRAY_PROTOTYPE_.concat.apply(goog.array.ARRAY_PROTOTYPE_,arguments)};goog.array.clone=function(a){if(goog.isArray(a))return goog.array.concat(a);else{for(var b=[],c=0,d=a.length;c<d;c++)b[c]=a[c];return b}};goog.array.toArray=function(a){if(goog.isArray(a))return goog.array.concat(a);return goog.array.clone(a)};
goog.array.extend=function(a){for(var b=1;b<arguments.length;b++){var c=arguments[b],d;if(goog.isArray(c)||(d=goog.isArrayLike(c))&&c.hasOwnProperty("callee"))a.push.apply(a,c);else if(d)for(var e=a.length,f=c.length,g=0;g<f;g++)a[e+g]=c[g];else a.push(c)}};goog.array.splice=function(a){goog.asserts.assert(a.length!=null);return goog.array.ARRAY_PROTOTYPE_.splice.apply(a,goog.array.slice(arguments,1))};
goog.array.slice=function(a,b,c){goog.asserts.assert(a.length!=null);return arguments.length<=2?goog.array.ARRAY_PROTOTYPE_.slice.call(a,b):goog.array.ARRAY_PROTOTYPE_.slice.call(a,b,c)};goog.array.removeDuplicates=function(a,b){for(var c=b||a,d={},e=0,f=0;f<a.length;){var g=a[f++],h=goog.isObject(g)?"o"+goog.getUid(g):(typeof g).charAt(0)+g;Object.prototype.hasOwnProperty.call(d,h)||(d[h]=!0,c[e++]=g)}c.length=e};
goog.array.binarySearch=function(a,b,c){return goog.array.binarySearch_(a,c||goog.array.defaultCompare,!1,b)};goog.array.binarySelect=function(a,b,c){return goog.array.binarySearch_(a,b,!0,void 0,c)};goog.array.binarySearch_=function(a,b,c,d,e){for(var f=0,g=a.length,h;f<g;){var i=f+g>>1,j;j=c?b.call(e,a[i],i,a):b(d,a[i]);j>0?f=i+1:(g=i,h=!j)}return h?f:~f};goog.array.sort=function(a,b){goog.asserts.assert(a.length!=null);goog.array.ARRAY_PROTOTYPE_.sort.call(a,b||goog.array.defaultCompare)};
goog.array.stableSort=function(a,b){for(var c=0;c<a.length;c++)a[c]={index:c,value:a[c]};var d=b||goog.array.defaultCompare;goog.array.sort(a,function(a,b){return d(a.value,b.value)||a.index-b.index});for(c=0;c<a.length;c++)a[c]=a[c].value};goog.array.sortObjectsByKey=function(a,b,c){var d=c||goog.array.defaultCompare;goog.array.sort(a,function(a,c){return d(a[b],c[b])})};
goog.array.isSorted=function(a,b,c){b=b||goog.array.defaultCompare;for(var d=1;d<a.length;d++){var e=b(a[d-1],a[d]);if(e>0||e==0&&c)return!1}return!0};goog.array.equals=function(a,b,c){if(!goog.isArrayLike(a)||!goog.isArrayLike(b)||a.length!=b.length)return!1;var d=a.length;c=c||goog.array.defaultCompareEquality;for(var e=0;e<d;e++)if(!c(a[e],b[e]))return!1;return!0};goog.array.compare=function(a,b,c){return goog.array.equals(a,b,c)};
goog.array.compare3=function(a,b,c){c=c||goog.array.defaultCompare;for(var d=Math.min(a.length,b.length),e=0;e<d;e++){var f=c(a[e],b[e]);if(f!=0)return f}return goog.array.defaultCompare(a.length,b.length)};goog.array.defaultCompare=function(a,b){return a>b?1:a<b?-1:0};goog.array.defaultCompareEquality=function(a,b){return a===b};goog.array.binaryInsert=function(a,b,c){c=goog.array.binarySearch(a,b,c);if(c<0)return goog.array.insertAt(a,b,-(c+1)),!0;return!1};
goog.array.binaryRemove=function(a,b,c){b=goog.array.binarySearch(a,b,c);return b>=0?goog.array.removeAt(a,b):!1};goog.array.bucket=function(a,b){for(var c={},d=0;d<a.length;d++){var e=a[d],f=b(e,d,a);goog.isDef(f)&&(c[f]||(c[f]=[])).push(e)}return c};goog.array.repeat=function(a,b){for(var c=[],d=0;d<b;d++)c[d]=a;return c};goog.array.flatten=function(){for(var a=[],b=0;b<arguments.length;b++){var c=arguments[b];goog.isArray(c)?a.push.apply(a,goog.array.flatten.apply(null,c)):a.push(c)}return a};
goog.array.rotate=function(a,b){goog.asserts.assert(a.length!=null);a.length&&(b%=a.length,b>0?goog.array.ARRAY_PROTOTYPE_.unshift.apply(a,a.splice(-b,b)):b<0&&goog.array.ARRAY_PROTOTYPE_.push.apply(a,a.splice(0,-b)));return a};goog.array.zip=function(){if(!arguments.length)return[];for(var a=[],b=0;;b++){for(var c=[],d=0;d<arguments.length;d++){var e=arguments[d];if(b>=e.length)return a;c.push(e[b])}a.push(c)}};
goog.array.shuffle=function(a,b){for(var c=b||Math.random,d=a.length-1;d>0;d--){var e=Math.floor(c()*(d+1)),f=a[d];a[d]=a[e];a[e]=f}};goog.debug.entryPointRegistry={};goog.debug.EntryPointMonitor=function(){};goog.debug.entryPointRegistry.refList_=[];goog.debug.entryPointRegistry.monitors_=[];goog.debug.entryPointRegistry.monitorsMayExist_=!1;goog.debug.entryPointRegistry.register=function(a){goog.debug.entryPointRegistry.refList_[goog.debug.entryPointRegistry.refList_.length]=a;if(goog.debug.entryPointRegistry.monitorsMayExist_)for(var b=goog.debug.entryPointRegistry.monitors_,c=0;c<b.length;c++)a(goog.bind(b[c].wrap,b[c]))};
goog.debug.entryPointRegistry.monitorAll=function(a){goog.debug.entryPointRegistry.monitorsMayExist_=!0;for(var b=goog.bind(a.wrap,a),c=0;c<goog.debug.entryPointRegistry.refList_.length;c++)goog.debug.entryPointRegistry.refList_[c](b);goog.debug.entryPointRegistry.monitors_.push(a)};
goog.debug.entryPointRegistry.unmonitorAllIfPossible=function(a){var b=goog.debug.entryPointRegistry.monitors_;goog.asserts.assert(a==b[b.length-1],"Only the most recent monitor can be unwrapped.");a=goog.bind(a.unwrap,a);for(var c=0;c<goog.debug.entryPointRegistry.refList_.length;c++)goog.debug.entryPointRegistry.refList_[c](a);b.length--};goog.events.EventWrapper=function(){};goog.events.EventWrapper.prototype.listen=function(){};goog.events.EventWrapper.prototype.unlisten=function(){};goog.events.EventType={CLICK:"click",DBLCLICK:"dblclick",MOUSEDOWN:"mousedown",MOUSEUP:"mouseup",MOUSEOVER:"mouseover",MOUSEOUT:"mouseout",MOUSEMOVE:"mousemove",SELECTSTART:"selectstart",KEYPRESS:"keypress",KEYDOWN:"keydown",KEYUP:"keyup",BLUR:"blur",FOCUS:"focus",DEACTIVATE:"deactivate",FOCUSIN:goog.userAgent.IE?"focusin":"DOMFocusIn",FOCUSOUT:goog.userAgent.IE?"focusout":"DOMFocusOut",CHANGE:"change",SELECT:"select",SUBMIT:"submit",INPUT:"input",PROPERTYCHANGE:"propertychange",DRAGSTART:"dragstart",
DRAGENTER:"dragenter",DRAGOVER:"dragover",DRAGLEAVE:"dragleave",DROP:"drop",TOUCHSTART:"touchstart",TOUCHMOVE:"touchmove",TOUCHEND:"touchend",TOUCHCANCEL:"touchcancel",CONTEXTMENU:"contextmenu",ERROR:"error",HELP:"help",LOAD:"load",LOSECAPTURE:"losecapture",READYSTATECHANGE:"readystatechange",RESIZE:"resize",SCROLL:"scroll",UNLOAD:"unload",HASHCHANGE:"hashchange",PAGEHIDE:"pagehide",PAGESHOW:"pageshow",POPSTATE:"popstate",COPY:"copy",PASTE:"paste",CUT:"cut",BEFORECOPY:"beforecopy",BEFORECUT:"beforecut",
BEFOREPASTE:"beforepaste",MESSAGE:"message",CONNECT:"connect",TRANSITIONEND:goog.userAgent.WEBKIT?"webkitTransitionEnd":goog.userAgent.OPERA?"oTransitionEnd":"transitionend"};goog.disposable={};goog.disposable.IDisposable=function(){};goog.Disposable=function(){goog.Disposable.ENABLE_MONITORING&&(goog.Disposable.instances_[goog.getUid(this)]=this)};goog.Disposable.ENABLE_MONITORING=!1;goog.Disposable.instances_={};goog.Disposable.getUndisposedObjects=function(){var a=[],b;for(b in goog.Disposable.instances_)goog.Disposable.instances_.hasOwnProperty(b)&&a.push(goog.Disposable.instances_[Number(b)]);return a};goog.Disposable.clearUndisposedObjects=function(){goog.Disposable.instances_={}};goog.Disposable.prototype.disposed_=!1;
goog.Disposable.prototype.isDisposed=function(){return this.disposed_};goog.Disposable.prototype.getDisposed=goog.Disposable.prototype.isDisposed;goog.Disposable.prototype.dispose=function(){if(!this.disposed_&&(this.disposed_=!0,this.disposeInternal(),goog.Disposable.ENABLE_MONITORING)){var a=goog.getUid(this);if(!goog.Disposable.instances_.hasOwnProperty(a))throw Error(this+" did not call the goog.Disposable base constructor or was disposed of after a clearUndisposedObjects call");delete goog.Disposable.instances_[a]}};
goog.Disposable.prototype.registerDisposable=function(a){if(!this.dependentDisposables_)this.dependentDisposables_=[];this.dependentDisposables_.push(a)};goog.Disposable.prototype.disposeInternal=function(){this.dependentDisposables_&&goog.disposeAll.apply(null,this.dependentDisposables_)};goog.dispose=function(a){a&&typeof a.dispose=="function"&&a.dispose()};goog.disposeAll=function(){for(var a=0,b=arguments.length;a<b;++a){var c=arguments[a];goog.isArrayLike(c)?goog.disposeAll.apply(null,c):goog.dispose(c)}};goog.events.Event=function(a,b){goog.Disposable.call(this);this.type=a;this.currentTarget=this.target=b};goog.inherits(goog.events.Event,goog.Disposable);goog.events.Event.prototype.disposeInternal=function(){delete this.type;delete this.target;delete this.currentTarget};goog.events.Event.prototype.propagationStopped_=!1;goog.events.Event.prototype.returnValue_=!0;goog.events.Event.prototype.stopPropagation=function(){this.propagationStopped_=!0};
goog.events.Event.prototype.preventDefault=function(){this.returnValue_=!1};goog.events.Event.stopPropagation=function(a){a.stopPropagation()};goog.events.Event.preventDefault=function(a){a.preventDefault()};goog.reflect={};goog.reflect.object=function(a,b){return b};goog.reflect.sinkValue=function(a){goog.reflect.sinkValue[" "](a);return a};goog.reflect.sinkValue[" "]=goog.nullFunction;goog.reflect.canAccessProperty=function(a,b){try{return goog.reflect.sinkValue(a[b]),!0}catch(c){}return!1};goog.events.BrowserEvent=function(a,b){a&&this.init(a,b)};goog.inherits(goog.events.BrowserEvent,goog.events.Event);goog.events.BrowserEvent.MouseButton={LEFT:0,MIDDLE:1,RIGHT:2};goog.events.BrowserEvent.IEButtonMap=[1,4,2];goog.events.BrowserEvent.prototype.target=null;goog.events.BrowserEvent.prototype.relatedTarget=null;goog.events.BrowserEvent.prototype.offsetX=0;goog.events.BrowserEvent.prototype.offsetY=0;goog.events.BrowserEvent.prototype.clientX=0;
goog.events.BrowserEvent.prototype.clientY=0;goog.events.BrowserEvent.prototype.screenX=0;goog.events.BrowserEvent.prototype.screenY=0;goog.events.BrowserEvent.prototype.button=0;goog.events.BrowserEvent.prototype.keyCode=0;goog.events.BrowserEvent.prototype.charCode=0;goog.events.BrowserEvent.prototype.ctrlKey=!1;goog.events.BrowserEvent.prototype.altKey=!1;goog.events.BrowserEvent.prototype.shiftKey=!1;goog.events.BrowserEvent.prototype.metaKey=!1;
goog.events.BrowserEvent.prototype.platformModifierKey=!1;goog.events.BrowserEvent.prototype.event_=null;
goog.events.BrowserEvent.prototype.init=function(a,b){var c=this.type=a.type;goog.events.Event.call(this,c);this.target=a.target||a.srcElement;this.currentTarget=b;var d=a.relatedTarget;if(d)goog.userAgent.GECKO&&(goog.reflect.canAccessProperty(d,"nodeName")||(d=null));else if(c==goog.events.EventType.MOUSEOVER)d=a.fromElement;else if(c==goog.events.EventType.MOUSEOUT)d=a.toElement;this.relatedTarget=d;this.offsetX=a.offsetX!==void 0?a.offsetX:a.layerX;this.offsetY=a.offsetY!==void 0?a.offsetY:a.layerY;
this.clientX=a.clientX!==void 0?a.clientX:a.pageX;this.clientY=a.clientY!==void 0?a.clientY:a.pageY;this.screenX=a.screenX||0;this.screenY=a.screenY||0;this.button=a.button;this.keyCode=a.keyCode||0;this.charCode=a.charCode||(c=="keypress"?a.keyCode:0);this.ctrlKey=a.ctrlKey;this.altKey=a.altKey;this.shiftKey=a.shiftKey;this.metaKey=a.metaKey;this.platformModifierKey=goog.userAgent.MAC?a.metaKey:a.ctrlKey;this.state=a.state;this.event_=a;delete this.returnValue_;delete this.propagationStopped_};
goog.events.BrowserEvent.prototype.isButton=function(a){return goog.events.BrowserFeature.HAS_W3C_BUTTON?this.event_.button==a:this.type=="click"?a==goog.events.BrowserEvent.MouseButton.LEFT:!!(this.event_.button&goog.events.BrowserEvent.IEButtonMap[a])};goog.events.BrowserEvent.prototype.isMouseActionButton=function(){return this.isButton(goog.events.BrowserEvent.MouseButton.LEFT)&&!(goog.userAgent.WEBKIT&&goog.userAgent.MAC&&this.ctrlKey)};
goog.events.BrowserEvent.prototype.stopPropagation=function(){goog.events.BrowserEvent.superClass_.stopPropagation.call(this);this.event_.stopPropagation?this.event_.stopPropagation():this.event_.cancelBubble=!0};
goog.events.BrowserEvent.prototype.preventDefault=function(){goog.events.BrowserEvent.superClass_.preventDefault.call(this);var a=this.event_;if(a.preventDefault)a.preventDefault();else if(a.returnValue=!1,goog.events.BrowserFeature.SET_KEY_CODE_TO_PREVENT_DEFAULT)try{if(a.ctrlKey||a.keyCode>=112&&a.keyCode<=123)a.keyCode=-1}catch(b){}};goog.events.BrowserEvent.prototype.getBrowserEvent=function(){return this.event_};
goog.events.BrowserEvent.prototype.disposeInternal=function(){goog.events.BrowserEvent.superClass_.disposeInternal.call(this);this.relatedTarget=this.currentTarget=this.target=this.event_=null};goog.events.ASSUME_GOOD_GC=!1;goog.events.listeners_={};goog.events.listenerTree_={};goog.events.sources_={};goog.events.onString_="on";goog.events.onStringMap_={};goog.events.keySeparator_="_";
goog.events.listen=function(a,b,c,d,e){if(b)if(goog.isArray(b)){for(var f=0;f<b.length;f++)goog.events.listen(a,b[f],c,d,e);return null}else{d=!!d;var g=goog.events.listenerTree_;b in g||(g[b]={count_:0,remaining_:0});g=g[b];d in g||(g[d]={count_:0,remaining_:0},g.count_++);g=g[d];var h=goog.getUid(a),i;g.remaining_++;if(g[h]){i=g[h];for(f=0;f<i.length;f++)if(g=i[f],g.listener==c&&g.handler==e){if(g.removed)break;return i[f].key}}else i=g[h]=[],g.count_++;f=goog.events.getProxy();f.src=a;g=new goog.events.Listener;
g.init(c,f,a,b,d,e);c=g.key;f.key=c;i.push(g);goog.events.listeners_[c]=g;goog.events.sources_[h]||(goog.events.sources_[h]=[]);goog.events.sources_[h].push(g);a.addEventListener?(a==goog.global||!a.customEvent_)&&a.addEventListener(b,f,d):a.attachEvent(goog.events.getOnString_(b),f);return c}else throw Error("Invalid event type");};
goog.events.getProxy=function(){var a=goog.events.handleBrowserEvent_,b=goog.events.BrowserFeature.HAS_W3C_EVENT_SUPPORT?function(c){return a.call(b.src,b.key,c)}:function(c){c=a.call(b.src,b.key,c);if(!c)return c};return b};goog.events.listenOnce=function(a,b,c,d,e){if(goog.isArray(b)){for(var f=0;f<b.length;f++)goog.events.listenOnce(a,b[f],c,d,e);return null}a=goog.events.listen(a,b,c,d,e);goog.events.listeners_[a].callOnce=!0;return a};
goog.events.listenWithWrapper=function(a,b,c,d,e){b.listen(a,c,d,e)};goog.events.unlisten=function(a,b,c,d,e){if(goog.isArray(b)){for(var f=0;f<b.length;f++)goog.events.unlisten(a,b[f],c,d,e);return null}d=!!d;a=goog.events.getListeners_(a,b,d);if(!a)return!1;for(f=0;f<a.length;f++)if(a[f].listener==c&&a[f].capture==d&&a[f].handler==e)return goog.events.unlistenByKey(a[f].key);return!1};
goog.events.unlistenByKey=function(a){if(!goog.events.listeners_[a])return!1;var b=goog.events.listeners_[a];if(b.removed)return!1;var c=b.src,d=b.type,e=b.proxy,f=b.capture;c.removeEventListener?(c==goog.global||!c.customEvent_)&&c.removeEventListener(d,e,f):c.detachEvent&&c.detachEvent(goog.events.getOnString_(d),e);c=goog.getUid(c);e=goog.events.listenerTree_[d][f][c];if(goog.events.sources_[c]){var g=goog.events.sources_[c];goog.array.remove(g,b);g.length==0&&delete goog.events.sources_[c]}b.removed=
!0;e.needsCleanup_=!0;goog.events.cleanUp_(d,f,c,e);delete goog.events.listeners_[a];return!0};goog.events.unlistenWithWrapper=function(a,b,c,d,e){b.unlisten(a,c,d,e)};
goog.events.cleanUp_=function(a,b,c,d){if(!d.locked_&&d.needsCleanup_){for(var e=0,f=0;e<d.length;e++)d[e].removed?d[e].proxy.src=null:(e!=f&&(d[f]=d[e]),f++);d.length=f;d.needsCleanup_=!1;f==0&&(delete goog.events.listenerTree_[a][b][c],goog.events.listenerTree_[a][b].count_--,goog.events.listenerTree_[a][b].count_==0&&(delete goog.events.listenerTree_[a][b],goog.events.listenerTree_[a].count_--),goog.events.listenerTree_[a].count_==0&&delete goog.events.listenerTree_[a])}};
goog.events.removeAll=function(a,b,c){var d=0,e=b==null,f=c==null;c=!!c;if(a==null)goog.object.forEach(goog.events.sources_,function(a){for(var g=a.length-1;g>=0;g--){var h=a[g];if((e||b==h.type)&&(f||c==h.capture))goog.events.unlistenByKey(h.key),d++}});else if(a=goog.getUid(a),goog.events.sources_[a]){a=goog.events.sources_[a];for(var g=a.length-1;g>=0;g--){var h=a[g];if((e||b==h.type)&&(f||c==h.capture))goog.events.unlistenByKey(h.key),d++}}return d};
goog.events.getListeners=function(a,b,c){return goog.events.getListeners_(a,b,c)||[]};goog.events.getListeners_=function(a,b,c){var d=goog.events.listenerTree_;if(b in d&&(d=d[b],c in d&&(d=d[c],a=goog.getUid(a),d[a])))return d[a];return null};goog.events.getListener=function(a,b,c,d,e){d=!!d;if(a=goog.events.getListeners_(a,b,d))for(b=0;b<a.length;b++)if(!a[b].removed&&a[b].listener==c&&a[b].capture==d&&a[b].handler==e)return a[b];return null};
goog.events.hasListener=function(a,b,c){a=goog.getUid(a);var d=goog.events.sources_[a];if(d){var e=goog.isDef(b),f=goog.isDef(c);return e&&f?(d=goog.events.listenerTree_[b],!!d&&!!d[c]&&a in d[c]):!e&&!f?!0:goog.array.some(d,function(a){return e&&a.type==b||f&&a.capture==c})}return!1};goog.events.expose=function(a){var b=[],c;for(c in a)a[c]&&a[c].id?b.push(c+" = "+a[c]+" ("+a[c].id+")"):b.push(c+" = "+a[c]);return b.join("\n")};
goog.events.getOnString_=function(a){if(a in goog.events.onStringMap_)return goog.events.onStringMap_[a];return goog.events.onStringMap_[a]=goog.events.onString_+a};goog.events.fireListeners=function(a,b,c,d){var e=goog.events.listenerTree_;if(b in e&&(e=e[b],c in e))return goog.events.fireListeners_(e[c],a,b,c,d);return!0};
goog.events.fireListeners_=function(a,b,c,d,e){var f=1;b=goog.getUid(b);if(a[b]){a.remaining_--;a=a[b];a.locked_?a.locked_++:a.locked_=1;try{for(var g=a.length,h=0;h<g;h++){var i=a[h];i&&!i.removed&&(f&=goog.events.fireListener(i,e)!==!1)}}finally{a.locked_--,goog.events.cleanUp_(c,d,b,a)}}return Boolean(f)};goog.events.fireListener=function(a,b){var c=a.handleEvent(b);a.callOnce&&goog.events.unlistenByKey(a.key);return c};goog.events.getTotalListenerCount=function(){return goog.object.getCount(goog.events.listeners_)};
goog.events.dispatchEvent=function(a,b){var c=b.type||b,d=goog.events.listenerTree_;if(!(c in d))return!0;if(goog.isString(b))b=new goog.events.Event(b,a);else if(b instanceof goog.events.Event)b.target=b.target||a;else{var e=b;b=new goog.events.Event(c,a);goog.object.extend(b,e)}e=1;var f;d=d[c];c=!0 in d;var g;if(c){f=[];for(g=a;g;g=g.getParentEventTarget())f.push(g);g=d[!0];g.remaining_=g.count_;for(var h=f.length-1;!b.propagationStopped_&&h>=0&&g.remaining_;h--)b.currentTarget=f[h],e&=goog.events.fireListeners_(g,
f[h],b.type,!0,b)&&b.returnValue_!=!1}if(!1 in d)if(g=d[!1],g.remaining_=g.count_,c)for(h=0;!b.propagationStopped_&&h<f.length&&g.remaining_;h++)b.currentTarget=f[h],e&=goog.events.fireListeners_(g,f[h],b.type,!1,b)&&b.returnValue_!=!1;else for(d=a;!b.propagationStopped_&&d&&g.remaining_;d=d.getParentEventTarget())b.currentTarget=d,e&=goog.events.fireListeners_(g,d,b.type,!1,b)&&b.returnValue_!=!1;return Boolean(e)};
goog.events.protectBrowserEventEntryPoint=function(a){goog.events.handleBrowserEvent_=a.protectEntryPoint(goog.events.handleBrowserEvent_)};
goog.events.handleBrowserEvent_=function(a,b){if(!goog.events.listeners_[a])return!0;var c=goog.events.listeners_[a],d=c.type,e=goog.events.listenerTree_;if(!(d in e))return!0;e=e[d];var f,g;if(!goog.events.BrowserFeature.HAS_W3C_EVENT_SUPPORT){f=b||goog.getObjectByName("window.event");var h=!0 in e,i=!1 in e;if(h){if(goog.events.isMarkedIeEvent_(f))return!0;goog.events.markIeEvent_(f)}var j=new goog.events.BrowserEvent;j.init(f,this);f=!0;try{if(h){for(var k=[],l=j.currentTarget;l;l=l.parentNode)k.push(l);
g=e[!0];g.remaining_=g.count_;for(var m=k.length-1;!j.propagationStopped_&&m>=0&&g.remaining_;m--)j.currentTarget=k[m],f&=goog.events.fireListeners_(g,k[m],d,!0,j);if(i){g=e[!1];g.remaining_=g.count_;for(m=0;!j.propagationStopped_&&m<k.length&&g.remaining_;m++)j.currentTarget=k[m],f&=goog.events.fireListeners_(g,k[m],d,!1,j)}}else f=goog.events.fireListener(c,j)}finally{if(k)k.length=0;j.dispose()}return f}d=new goog.events.BrowserEvent(b,this);try{f=goog.events.fireListener(c,d)}finally{d.dispose()}return f};
goog.events.markIeEvent_=function(a){var b=!1;if(a.keyCode==0)try{a.keyCode=-1;return}catch(c){b=!0}if(b||a.returnValue==void 0)a.returnValue=!0};goog.events.isMarkedIeEvent_=function(a){return a.keyCode<0||a.returnValue!=void 0};goog.events.uniqueIdCounter_=0;goog.events.getUniqueId=function(a){return a+"_"+goog.events.uniqueIdCounter_++};goog.debug.entryPointRegistry.register(function(a){goog.events.handleBrowserEvent_=a(goog.events.handleBrowserEvent_)});goog.events.EventHandler=function(a){goog.Disposable.call(this);this.handler_=a;this.keys_=[]};goog.inherits(goog.events.EventHandler,goog.Disposable);goog.events.EventHandler.typeArray_=[];goog.events.EventHandler.prototype.listen=function(a,b,c,d,e){if(!goog.isArray(b))goog.events.EventHandler.typeArray_[0]=b,b=goog.events.EventHandler.typeArray_;for(var f=0;f<b.length;f++)this.keys_.push(goog.events.listen(a,b[f],c||this,d||!1,e||this.handler_||this));return this};
goog.events.EventHandler.prototype.listenOnce=function(a,b,c,d,e){if(goog.isArray(b))for(var f=0;f<b.length;f++)this.listenOnce(a,b[f],c,d,e);else this.keys_.push(goog.events.listenOnce(a,b,c||this,d,e||this.handler_||this));return this};goog.events.EventHandler.prototype.listenWithWrapper=function(a,b,c,d,e){b.listen(a,c,d,e||this.handler_,this);return this};goog.events.EventHandler.prototype.getListenerCount=function(){return this.keys_.length};
goog.events.EventHandler.prototype.unlisten=function(a,b,c,d,e){if(goog.isArray(b))for(var f=0;f<b.length;f++)this.unlisten(a,b[f],c,d,e);else if(a=goog.events.getListener(a,b,c||this,d,e||this.handler_||this))a=a.key,goog.events.unlistenByKey(a),goog.array.remove(this.keys_,a);return this};goog.events.EventHandler.prototype.unlistenWithWrapper=function(a,b,c,d,e){b.unlisten(a,c,d,e||this.handler_,this);return this};
goog.events.EventHandler.prototype.removeAll=function(){goog.array.forEach(this.keys_,goog.events.unlistenByKey);this.keys_.length=0};goog.events.EventHandler.prototype.disposeInternal=function(){goog.events.EventHandler.superClass_.disposeInternal.call(this);this.removeAll()};goog.events.EventHandler.prototype.handleEvent=function(){throw Error("EventHandler.handleEvent not implemented");};goog.math={};goog.math.Size=function(a,b){this.width=a;this.height=b};goog.math.Size.equals=function(a,b){if(a==b)return!0;if(!a||!b)return!1;return a.width==b.width&&a.height==b.height};goog.math.Size.prototype.clone=function(){return new goog.math.Size(this.width,this.height)};if(goog.DEBUG)goog.math.Size.prototype.toString=function(){return"("+this.width+" x "+this.height+")"};goog.math.Size.prototype.getLongest=function(){return Math.max(this.width,this.height)};
goog.math.Size.prototype.getShortest=function(){return Math.min(this.width,this.height)};goog.math.Size.prototype.area=function(){return this.width*this.height};goog.math.Size.prototype.perimeter=function(){return(this.width+this.height)*2};goog.math.Size.prototype.aspectRatio=function(){return this.width/this.height};goog.math.Size.prototype.isEmpty=function(){return!this.area()};goog.math.Size.prototype.ceil=function(){this.width=Math.ceil(this.width);this.height=Math.ceil(this.height);return this};
goog.math.Size.prototype.fitsInside=function(a){return this.width<=a.width&&this.height<=a.height};goog.math.Size.prototype.floor=function(){this.width=Math.floor(this.width);this.height=Math.floor(this.height);return this};goog.math.Size.prototype.round=function(){this.width=Math.round(this.width);this.height=Math.round(this.height);return this};goog.math.Size.prototype.scale=function(a){this.width*=a;this.height*=a;return this};
goog.math.Size.prototype.scaleToFit=function(a){return this.scale(this.aspectRatio()>a.aspectRatio()?a.width/this.width:a.height/this.height)};goog.math.Coordinate=function(a,b){this.x=goog.isDef(a)?a:0;this.y=goog.isDef(b)?b:0};goog.math.Coordinate.prototype.clone=function(){return new goog.math.Coordinate(this.x,this.y)};if(goog.DEBUG)goog.math.Coordinate.prototype.toString=function(){return"("+this.x+", "+this.y+")"};goog.math.Coordinate.equals=function(a,b){if(a==b)return!0;if(!a||!b)return!1;return a.x==b.x&&a.y==b.y};goog.math.Coordinate.distance=function(a,b){var c=a.x-b.x,d=a.y-b.y;return Math.sqrt(c*c+d*d)};
goog.math.Coordinate.squaredDistance=function(a,b){var c=a.x-b.x,d=a.y-b.y;return c*c+d*d};goog.math.Coordinate.difference=function(a,b){return new goog.math.Coordinate(a.x-b.x,a.y-b.y)};goog.math.Coordinate.sum=function(a,b){return new goog.math.Coordinate(a.x+b.x,a.y+b.y)};goog.math.Box=function(a,b,c,d){this.top=a;this.right=b;this.bottom=c;this.left=d};goog.math.Box.boundingBox=function(){for(var a=new goog.math.Box(arguments[0].y,arguments[0].x,arguments[0].y,arguments[0].x),b=1;b<arguments.length;b++){var c=arguments[b];a.top=Math.min(a.top,c.y);a.right=Math.max(a.right,c.x);a.bottom=Math.max(a.bottom,c.y);a.left=Math.min(a.left,c.x)}return a};goog.math.Box.prototype.clone=function(){return new goog.math.Box(this.top,this.right,this.bottom,this.left)};
if(goog.DEBUG)goog.math.Box.prototype.toString=function(){return"("+this.top+"t, "+this.right+"r, "+this.bottom+"b, "+this.left+"l)"};goog.math.Box.prototype.contains=function(a){return goog.math.Box.contains(this,a)};goog.math.Box.prototype.expand=function(a,b,c,d){goog.isObject(a)?(this.top-=a.top,this.right+=a.right,this.bottom+=a.bottom,this.left-=a.left):(this.top-=a,this.right+=b,this.bottom+=c,this.left-=d);return this};
goog.math.Box.prototype.expandToInclude=function(a){this.left=Math.min(this.left,a.left);this.top=Math.min(this.top,a.top);this.right=Math.max(this.right,a.right);this.bottom=Math.max(this.bottom,a.bottom)};goog.math.Box.equals=function(a,b){if(a==b)return!0;if(!a||!b)return!1;return a.top==b.top&&a.right==b.right&&a.bottom==b.bottom&&a.left==b.left};
goog.math.Box.contains=function(a,b){if(!a||!b)return!1;if(b instanceof goog.math.Box)return b.left>=a.left&&b.right<=a.right&&b.top>=a.top&&b.bottom<=a.bottom;return b.x>=a.left&&b.x<=a.right&&b.y>=a.top&&b.y<=a.bottom};
goog.math.Box.distance=function(a,b){if(b.x>=a.left&&b.x<=a.right){if(b.y>=a.top&&b.y<=a.bottom)return 0;return b.y<a.top?a.top-b.y:b.y-a.bottom}if(b.y>=a.top&&b.y<=a.bottom)return b.x<a.left?a.left-b.x:b.x-a.right;return goog.math.Coordinate.distance(b,new goog.math.Coordinate(b.x<a.left?a.left:a.right,b.y<a.top?a.top:a.bottom))};goog.math.Box.intersects=function(a,b){return a.left<=b.right&&b.left<=a.right&&a.top<=b.bottom&&b.top<=a.bottom};
goog.math.Box.intersectsWithPadding=function(a,b,c){return a.left<=b.right+c&&b.left<=a.right+c&&a.top<=b.bottom+c&&b.top<=a.bottom+c};goog.math.Rect=function(a,b,c,d){this.left=a;this.top=b;this.width=c;this.height=d};goog.math.Rect.prototype.clone=function(){return new goog.math.Rect(this.left,this.top,this.width,this.height)};goog.math.Rect.prototype.toBox=function(){return new goog.math.Box(this.top,this.left+this.width,this.top+this.height,this.left)};goog.math.Rect.createFromBox=function(a){return new goog.math.Rect(a.left,a.top,a.right-a.left,a.bottom-a.top)};
if(goog.DEBUG)goog.math.Rect.prototype.toString=function(){return"("+this.left+", "+this.top+" - "+this.width+"w x "+this.height+"h)"};goog.math.Rect.equals=function(a,b){if(a==b)return!0;if(!a||!b)return!1;return a.left==b.left&&a.width==b.width&&a.top==b.top&&a.height==b.height};
goog.math.Rect.prototype.intersection=function(a){var b=Math.max(this.left,a.left),c=Math.min(this.left+this.width,a.left+a.width);if(b<=c){var d=Math.max(this.top,a.top);a=Math.min(this.top+this.height,a.top+a.height);if(d<=a)return this.left=b,this.top=d,this.width=c-b,this.height=a-d,!0}return!1};
goog.math.Rect.intersection=function(a,b){var c=Math.max(a.left,b.left),d=Math.min(a.left+a.width,b.left+b.width);if(c<=d){var e=Math.max(a.top,b.top),f=Math.min(a.top+a.height,b.top+b.height);if(e<=f)return new goog.math.Rect(c,e,d-c,f-e)}return null};goog.math.Rect.intersects=function(a,b){return a.left<=b.left+b.width&&b.left<=a.left+a.width&&a.top<=b.top+b.height&&b.top<=a.top+a.height};goog.math.Rect.prototype.intersects=function(a){return goog.math.Rect.intersects(this,a)};
goog.math.Rect.difference=function(a,b){var c=goog.math.Rect.intersection(a,b);if(!c||!c.height||!c.width)return[a.clone()];c=[];var d=a.top,e=a.height,f=a.left+a.width,g=a.top+a.height,h=b.left+b.width,i=b.top+b.height;if(b.top>a.top)c.push(new goog.math.Rect(a.left,a.top,a.width,b.top-a.top)),d=b.top,e-=b.top-a.top;i<g&&(c.push(new goog.math.Rect(a.left,i,a.width,g-i)),e=i-d);b.left>a.left&&c.push(new goog.math.Rect(a.left,d,b.left-a.left,e));h<f&&c.push(new goog.math.Rect(h,d,f-h,e));return c};
goog.math.Rect.prototype.difference=function(a){return goog.math.Rect.difference(this,a)};goog.math.Rect.prototype.boundingRect=function(a){var b=Math.max(this.left+this.width,a.left+a.width),c=Math.max(this.top+this.height,a.top+a.height);this.left=Math.min(this.left,a.left);this.top=Math.min(this.top,a.top);this.width=b-this.left;this.height=c-this.top};goog.math.Rect.boundingRect=function(a,b){if(!a||!b)return null;var c=a.clone();c.boundingRect(b);return c};
goog.math.Rect.prototype.contains=function(a){return a instanceof goog.math.Rect?this.left<=a.left&&this.left+this.width>=a.left+a.width&&this.top<=a.top&&this.top+this.height>=a.top+a.height:a.x>=this.left&&a.x<=this.left+this.width&&a.y>=this.top&&a.y<=this.top+this.height};goog.math.Rect.prototype.getSize=function(){return new goog.math.Size(this.width,this.height)};goog.dom={};goog.dom.classes={};goog.dom.classes.set=function(a,b){a.className=b};goog.dom.classes.get=function(a){return(a=a.className)&&typeof a.split=="function"?a.split(/\s+/):[]};goog.dom.classes.add=function(a){var b=goog.dom.classes.get(a),c=goog.array.slice(arguments,1);c=goog.dom.classes.add_(b,c);a.className=b.join(" ");return c};goog.dom.classes.remove=function(a){var b=goog.dom.classes.get(a),c=goog.array.slice(arguments,1);c=goog.dom.classes.remove_(b,c);a.className=b.join(" ");return c};
goog.dom.classes.add_=function(a,b){for(var c=0,d=0;d<b.length;d++)goog.array.contains(a,b[d])||(a.push(b[d]),c++);return c==b.length};goog.dom.classes.remove_=function(a,b){for(var c=0,d=0;d<a.length;d++)goog.array.contains(b,a[d])&&(goog.array.splice(a,d--,1),c++);return c==b.length};goog.dom.classes.swap=function(a,b,c){for(var d=goog.dom.classes.get(a),e=!1,f=0;f<d.length;f++)d[f]==b&&(goog.array.splice(d,f--,1),e=!0);if(e)d.push(c),a.className=d.join(" ");return e};
goog.dom.classes.addRemove=function(a,b,c){var d=goog.dom.classes.get(a);goog.isString(b)?goog.array.remove(d,b):goog.isArray(b)&&goog.dom.classes.remove_(d,b);goog.isString(c)&&!goog.array.contains(d,c)?d.push(c):goog.isArray(c)&&goog.dom.classes.add_(d,c);a.className=d.join(" ")};goog.dom.classes.has=function(a,b){return goog.array.contains(goog.dom.classes.get(a),b)};goog.dom.classes.enable=function(a,b,c){c?goog.dom.classes.add(a,b):goog.dom.classes.remove(a,b)};
goog.dom.classes.toggle=function(a,b){var c=!goog.dom.classes.has(a,b);goog.dom.classes.enable(a,b,c);return c};goog.dom.TagName={A:"A",ABBR:"ABBR",ACRONYM:"ACRONYM",ADDRESS:"ADDRESS",APPLET:"APPLET",AREA:"AREA",B:"B",BASE:"BASE",BASEFONT:"BASEFONT",BDO:"BDO",BIG:"BIG",BLOCKQUOTE:"BLOCKQUOTE",BODY:"BODY",BR:"BR",BUTTON:"BUTTON",CANVAS:"CANVAS",CAPTION:"CAPTION",CENTER:"CENTER",CITE:"CITE",CODE:"CODE",COL:"COL",COLGROUP:"COLGROUP",DD:"DD",DEL:"DEL",DFN:"DFN",DIR:"DIR",DIV:"DIV",DL:"DL",DT:"DT",EM:"EM",FIELDSET:"FIELDSET",FONT:"FONT",FORM:"FORM",FRAME:"FRAME",FRAMESET:"FRAMESET",H1:"H1",H2:"H2",H3:"H3",H4:"H4",
H5:"H5",H6:"H6",HEAD:"HEAD",HR:"HR",HTML:"HTML",I:"I",IFRAME:"IFRAME",IMG:"IMG",INPUT:"INPUT",INS:"INS",ISINDEX:"ISINDEX",KBD:"KBD",LABEL:"LABEL",LEGEND:"LEGEND",LI:"LI",LINK:"LINK",MAP:"MAP",MENU:"MENU",META:"META",NOFRAMES:"NOFRAMES",NOSCRIPT:"NOSCRIPT",OBJECT:"OBJECT",OL:"OL",OPTGROUP:"OPTGROUP",OPTION:"OPTION",P:"P",PARAM:"PARAM",PRE:"PRE",Q:"Q",S:"S",SAMP:"SAMP",SCRIPT:"SCRIPT",SELECT:"SELECT",SMALL:"SMALL",SPAN:"SPAN",STRIKE:"STRIKE",STRONG:"STRONG",STYLE:"STYLE",SUB:"SUB",SUP:"SUP",TABLE:"TABLE",
TBODY:"TBODY",TD:"TD",TEXTAREA:"TEXTAREA",TFOOT:"TFOOT",TH:"TH",THEAD:"THEAD",TITLE:"TITLE",TR:"TR",TT:"TT",U:"U",UL:"UL",VAR:"VAR"};goog.dom.BrowserFeature={CAN_ADD_NAME_OR_TYPE_ATTRIBUTES:!goog.userAgent.IE||goog.userAgent.isDocumentMode(9),CAN_USE_CHILDREN_ATTRIBUTE:!goog.userAgent.GECKO&&!goog.userAgent.IE||goog.userAgent.IE&&goog.userAgent.isDocumentMode(9)||goog.userAgent.GECKO&&goog.userAgent.isVersion("1.9.1"),CAN_USE_INNER_TEXT:goog.userAgent.IE&&!goog.userAgent.isVersion("9"),INNER_HTML_NEEDS_SCOPED_ELEMENT:goog.userAgent.IE};goog.dom.ASSUME_QUIRKS_MODE=!1;goog.dom.ASSUME_STANDARDS_MODE=!1;goog.dom.COMPAT_MODE_KNOWN_=goog.dom.ASSUME_QUIRKS_MODE||goog.dom.ASSUME_STANDARDS_MODE;goog.dom.NodeType={ELEMENT:1,ATTRIBUTE:2,TEXT:3,CDATA_SECTION:4,ENTITY_REFERENCE:5,ENTITY:6,PROCESSING_INSTRUCTION:7,COMMENT:8,DOCUMENT:9,DOCUMENT_TYPE:10,DOCUMENT_FRAGMENT:11,NOTATION:12};goog.dom.getDomHelper=function(a){return a?new goog.dom.DomHelper(goog.dom.getOwnerDocument(a)):goog.dom.defaultDomHelper_||(goog.dom.defaultDomHelper_=new goog.dom.DomHelper)};
goog.dom.getDocument=function(){return document};goog.dom.getElement=function(a){return goog.isString(a)?document.getElementById(a):a};goog.dom.$=goog.dom.getElement;goog.dom.getElementsByTagNameAndClass=function(a,b,c){return goog.dom.getElementsByTagNameAndClass_(document,a,b,c)};
goog.dom.getElementsByClass=function(a,b){var c=b||document;if(goog.dom.canUseQuerySelector_(c))return c.querySelectorAll("."+a);else if(c.getElementsByClassName)return c.getElementsByClassName(a);return goog.dom.getElementsByTagNameAndClass_(document,"*",a,b)};goog.dom.getElementByClass=function(a,b){var c=b||document,d=null;return(d=goog.dom.canUseQuerySelector_(c)?c.querySelector("."+a):goog.dom.getElementsByClass(a,b)[0])||null};
goog.dom.canUseQuerySelector_=function(a){return a.querySelectorAll&&a.querySelector&&(!goog.userAgent.WEBKIT||goog.dom.isCss1CompatMode_(document)||goog.userAgent.isVersion("528"))};
goog.dom.getElementsByTagNameAndClass_=function(a,b,c,d){a=d||a;b=b&&b!="*"?b.toUpperCase():"";if(goog.dom.canUseQuerySelector_(a)&&(b||c))return a.querySelectorAll(b+(c?"."+c:""));if(c&&a.getElementsByClassName)if(a=a.getElementsByClassName(c),b){d={};for(var e=0,f=0,g;g=a[f];f++)b==g.nodeName&&(d[e++]=g);d.length=e;return d}else return a;a=a.getElementsByTagName(b||"*");if(c){d={};for(f=e=0;g=a[f];f++)b=g.className,typeof b.split=="function"&&goog.array.contains(b.split(/\s+/),c)&&(d[e++]=g);d.length=
e;return d}else return a};goog.dom.$$=goog.dom.getElementsByTagNameAndClass;goog.dom.setProperties=function(a,b){goog.object.forEach(b,function(b,d){d=="style"?a.style.cssText=b:d=="class"?a.className=b:d=="for"?a.htmlFor=b:d in goog.dom.DIRECT_ATTRIBUTE_MAP_?a.setAttribute(goog.dom.DIRECT_ATTRIBUTE_MAP_[d],b):goog.string.startsWith(d,"aria-")?a.setAttribute(d,b):a[d]=b})};
goog.dom.DIRECT_ATTRIBUTE_MAP_={cellpadding:"cellPadding",cellspacing:"cellSpacing",colspan:"colSpan",rowspan:"rowSpan",valign:"vAlign",height:"height",width:"width",usemap:"useMap",frameborder:"frameBorder",maxlength:"maxLength",type:"type"};goog.dom.getViewportSize=function(a){return goog.dom.getViewportSize_(a||window)};
goog.dom.getViewportSize_=function(a){var b=a.document;if(goog.userAgent.WEBKIT&&!goog.userAgent.isVersion("500")&&!goog.userAgent.MOBILE){typeof a.innerHeight=="undefined"&&(a=window);b=a.innerHeight;var c=a.document.documentElement.scrollHeight;a==a.top&&c<b&&(b-=15);return new goog.math.Size(a.innerWidth,b)}a=goog.dom.isCss1CompatMode_(b)?b.documentElement:b.body;return new goog.math.Size(a.clientWidth,a.clientHeight)};goog.dom.getDocumentHeight=function(){return goog.dom.getDocumentHeight_(window)};
goog.dom.getDocumentHeight_=function(a){var b=a.document,c=0;if(b){a=goog.dom.getViewportSize_(a).height;c=b.body;var d=b.documentElement;if(goog.dom.isCss1CompatMode_(b)&&d.scrollHeight)c=d.scrollHeight!=a?d.scrollHeight:d.offsetHeight;else{b=d.scrollHeight;var e=d.offsetHeight;if(d.clientHeight!=e)b=c.scrollHeight,e=c.offsetHeight;c=b>a?b>e?b:e:b<e?b:e}}return c};goog.dom.getPageScroll=function(a){return goog.dom.getDomHelper((a||goog.global||window).document).getDocumentScroll()};
goog.dom.getDocumentScroll=function(){return goog.dom.getDocumentScroll_(document)};goog.dom.getDocumentScroll_=function(a){var b=goog.dom.getDocumentScrollElement_(a);a=goog.dom.getWindow_(a);return new goog.math.Coordinate(a.pageXOffset||b.scrollLeft,a.pageYOffset||b.scrollTop)};goog.dom.getDocumentScrollElement=function(){return goog.dom.getDocumentScrollElement_(document)};
goog.dom.getDocumentScrollElement_=function(a){return!goog.userAgent.WEBKIT&&goog.dom.isCss1CompatMode_(a)?a.documentElement:a.body};goog.dom.getWindow=function(a){return a?goog.dom.getWindow_(a):window};goog.dom.getWindow_=function(a){return a.parentWindow||a.defaultView};goog.dom.createDom=function(){return goog.dom.createDom_(document,arguments)};
goog.dom.createDom_=function(a,b){var c=b[0],d=b[1];if(!goog.dom.BrowserFeature.CAN_ADD_NAME_OR_TYPE_ATTRIBUTES&&d&&(d.name||d.type)){c=["<",c];d.name&&c.push(' name="',goog.string.htmlEscape(d.name),'"');if(d.type){c.push(' type="',goog.string.htmlEscape(d.type),'"');var e={};goog.object.extend(e,d);d=e;delete d.type}c.push(">");c=c.join("")}c=a.createElement(c);if(d)goog.isString(d)?c.className=d:goog.isArray(d)?goog.dom.classes.add.apply(null,[c].concat(d)):goog.dom.setProperties(c,d);b.length>
2&&goog.dom.append_(a,c,b,2);return c};goog.dom.append_=function(a,b,c,d){function e(c){c&&b.appendChild(goog.isString(c)?a.createTextNode(c):c)}for(;d<c.length;d++){var f=c[d];goog.isArrayLike(f)&&!goog.dom.isNodeLike(f)?goog.array.forEach(goog.dom.isNodeList(f)?goog.array.clone(f):f,e):e(f)}};goog.dom.$dom=goog.dom.createDom;goog.dom.createElement=function(a){return document.createElement(a)};goog.dom.createTextNode=function(a){return document.createTextNode(a)};
goog.dom.createTable=function(a,b,c){return goog.dom.createTable_(document,a,b,!!c)};goog.dom.createTable_=function(a,b,c,d){for(var e=["<tr>"],f=0;f<c;f++)e.push(d?"<td>&nbsp;</td>":"<td></td>");e.push("</tr>");e=e.join("");c=["<table>"];for(f=0;f<b;f++)c.push(e);c.push("</table>");a=a.createElement(goog.dom.TagName.DIV);a.innerHTML=c.join("");return a.removeChild(a.firstChild)};goog.dom.htmlToDocumentFragment=function(a){return goog.dom.htmlToDocumentFragment_(document,a)};
goog.dom.htmlToDocumentFragment_=function(a,b){var c=a.createElement("div");goog.dom.BrowserFeature.INNER_HTML_NEEDS_SCOPED_ELEMENT?(c.innerHTML="<br>"+b,c.removeChild(c.firstChild)):c.innerHTML=b;if(c.childNodes.length==1)return c.removeChild(c.firstChild);else{for(var d=a.createDocumentFragment();c.firstChild;)d.appendChild(c.firstChild);return d}};goog.dom.getCompatMode=function(){return goog.dom.isCss1CompatMode()?"CSS1Compat":"BackCompat"};goog.dom.isCss1CompatMode=function(){return goog.dom.isCss1CompatMode_(document)};
goog.dom.isCss1CompatMode_=function(a){if(goog.dom.COMPAT_MODE_KNOWN_)return goog.dom.ASSUME_STANDARDS_MODE;return a.compatMode=="CSS1Compat"};goog.dom.canHaveChildren=function(a){if(a.nodeType!=goog.dom.NodeType.ELEMENT)return!1;switch(a.tagName){case goog.dom.TagName.APPLET:case goog.dom.TagName.AREA:case goog.dom.TagName.BASE:case goog.dom.TagName.BR:case goog.dom.TagName.COL:case goog.dom.TagName.FRAME:case goog.dom.TagName.HR:case goog.dom.TagName.IMG:case goog.dom.TagName.INPUT:case goog.dom.TagName.IFRAME:case goog.dom.TagName.ISINDEX:case goog.dom.TagName.LINK:case goog.dom.TagName.NOFRAMES:case goog.dom.TagName.NOSCRIPT:case goog.dom.TagName.META:case goog.dom.TagName.OBJECT:case goog.dom.TagName.PARAM:case goog.dom.TagName.SCRIPT:case goog.dom.TagName.STYLE:return!1}return!0};
goog.dom.appendChild=function(a,b){a.appendChild(b)};goog.dom.append=function(a){goog.dom.append_(goog.dom.getOwnerDocument(a),a,arguments,1)};goog.dom.removeChildren=function(a){for(var b;b=a.firstChild;)a.removeChild(b)};goog.dom.insertSiblingBefore=function(a,b){b.parentNode&&b.parentNode.insertBefore(a,b)};goog.dom.insertSiblingAfter=function(a,b){b.parentNode&&b.parentNode.insertBefore(a,b.nextSibling)};goog.dom.insertChildAt=function(a,b,c){a.insertBefore(b,a.childNodes[c]||null)};
goog.dom.removeNode=function(a){return a&&a.parentNode?a.parentNode.removeChild(a):null};goog.dom.replaceNode=function(a,b){var c=b.parentNode;c&&c.replaceChild(a,b)};goog.dom.flattenElement=function(a){var b,c=a.parentNode;if(c&&c.nodeType!=goog.dom.NodeType.DOCUMENT_FRAGMENT)if(a.removeNode)return a.removeNode(!1);else{for(;b=a.firstChild;)c.insertBefore(b,a);return goog.dom.removeNode(a)}};
goog.dom.getChildren=function(a){if(goog.dom.BrowserFeature.CAN_USE_CHILDREN_ATTRIBUTE&&a.children!=void 0)return a.children;return goog.array.filter(a.childNodes,function(a){return a.nodeType==goog.dom.NodeType.ELEMENT})};goog.dom.getFirstElementChild=function(a){if(a.firstElementChild!=void 0)return a.firstElementChild;return goog.dom.getNextElementNode_(a.firstChild,!0)};
goog.dom.getLastElementChild=function(a){if(a.lastElementChild!=void 0)return a.lastElementChild;return goog.dom.getNextElementNode_(a.lastChild,!1)};goog.dom.getNextElementSibling=function(a){if(a.nextElementSibling!=void 0)return a.nextElementSibling;return goog.dom.getNextElementNode_(a.nextSibling,!0)};goog.dom.getPreviousElementSibling=function(a){if(a.previousElementSibling!=void 0)return a.previousElementSibling;return goog.dom.getNextElementNode_(a.previousSibling,!1)};
goog.dom.getNextElementNode_=function(a,b){for(;a&&a.nodeType!=goog.dom.NodeType.ELEMENT;)a=b?a.nextSibling:a.previousSibling;return a};goog.dom.getNextNode=function(a){if(!a)return null;if(a.firstChild)return a.firstChild;for(;a&&!a.nextSibling;)a=a.parentNode;return a?a.nextSibling:null};goog.dom.getPreviousNode=function(a){if(!a)return null;if(!a.previousSibling)return a.parentNode;for(a=a.previousSibling;a&&a.lastChild;)a=a.lastChild;return a};
goog.dom.isNodeLike=function(a){return goog.isObject(a)&&a.nodeType>0};goog.dom.isElement=function(a){return goog.isObject(a)&&a.nodeType==goog.dom.NodeType.ELEMENT};goog.dom.isWindow=function(a){return goog.isObject(a)&&a.window==a};goog.dom.contains=function(a,b){if(a.contains&&b.nodeType==goog.dom.NodeType.ELEMENT)return a==b||a.contains(b);if(typeof a.compareDocumentPosition!="undefined")return a==b||Boolean(a.compareDocumentPosition(b)&16);for(;b&&a!=b;)b=b.parentNode;return b==a};
goog.dom.compareNodeOrder=function(a,b){if(a==b)return 0;if(a.compareDocumentPosition)return a.compareDocumentPosition(b)&2?1:-1;if("sourceIndex"in a||a.parentNode&&"sourceIndex"in a.parentNode){var c=a.nodeType==goog.dom.NodeType.ELEMENT,d=b.nodeType==goog.dom.NodeType.ELEMENT;if(c&&d)return a.sourceIndex-b.sourceIndex;else{var e=a.parentNode,f=b.parentNode;if(e==f)return goog.dom.compareSiblingOrder_(a,b);if(!c&&goog.dom.contains(e,b))return-1*goog.dom.compareParentsDescendantNodeIe_(a,b);if(!d&&
goog.dom.contains(f,a))return goog.dom.compareParentsDescendantNodeIe_(b,a);return(c?a.sourceIndex:e.sourceIndex)-(d?b.sourceIndex:f.sourceIndex)}}d=goog.dom.getOwnerDocument(a);c=d.createRange();c.selectNode(a);c.collapse(!0);d=d.createRange();d.selectNode(b);d.collapse(!0);return c.compareBoundaryPoints(goog.global.Range.START_TO_END,d)};
goog.dom.compareParentsDescendantNodeIe_=function(a,b){var c=a.parentNode;if(c==b)return-1;for(var d=b;d.parentNode!=c;)d=d.parentNode;return goog.dom.compareSiblingOrder_(d,a)};goog.dom.compareSiblingOrder_=function(a,b){for(var c=b;c=c.previousSibling;)if(c==a)return-1;return 1};
goog.dom.findCommonAncestor=function(){var a,b=arguments.length;if(b){if(b==1)return arguments[0]}else return null;var c=[],d=Infinity;for(a=0;a<b;a++){for(var e=[],f=arguments[a];f;)e.unshift(f),f=f.parentNode;c.push(e);d=Math.min(d,e.length)}e=null;for(a=0;a<d;a++){f=c[0][a];for(var g=1;g<b;g++)if(f!=c[g][a])return e;e=f}return e};goog.dom.getOwnerDocument=function(a){return a.nodeType==goog.dom.NodeType.DOCUMENT?a:a.ownerDocument||a.document};
goog.dom.getFrameContentDocument=function(a){return a.contentDocument||a.contentWindow.document};goog.dom.getFrameContentWindow=function(a){return a.contentWindow||goog.dom.getWindow_(goog.dom.getFrameContentDocument(a))};
goog.dom.setTextContent=function(a,b){if("textContent"in a)a.textContent=b;else if(a.firstChild&&a.firstChild.nodeType==goog.dom.NodeType.TEXT){for(;a.lastChild!=a.firstChild;)a.removeChild(a.lastChild);a.firstChild.data=b}else{goog.dom.removeChildren(a);var c=goog.dom.getOwnerDocument(a);a.appendChild(c.createTextNode(b))}};goog.dom.getOuterHtml=function(a){if("outerHTML"in a)return a.outerHTML;else{var b=goog.dom.getOwnerDocument(a).createElement("div");b.appendChild(a.cloneNode(!0));return b.innerHTML}};
goog.dom.findNode=function(a,b){var c=[];return goog.dom.findNodes_(a,b,c,!0)?c[0]:void 0};goog.dom.findNodes=function(a,b){var c=[];goog.dom.findNodes_(a,b,c,!1);return c};goog.dom.findNodes_=function(a,b,c,d){if(a!=null)for(a=a.firstChild;a;){if(b(a)&&(c.push(a),d))return!0;if(goog.dom.findNodes_(a,b,c,d))return!0;a=a.nextSibling}return!1};goog.dom.TAGS_TO_IGNORE_={SCRIPT:1,STYLE:1,HEAD:1,IFRAME:1,OBJECT:1};goog.dom.PREDEFINED_TAG_VALUES_={IMG:" ",BR:"\n"};
goog.dom.isFocusableTabIndex=function(a){var b=a.getAttributeNode("tabindex");if(b&&b.specified)return a=a.tabIndex,goog.isNumber(a)&&a>=0&&a<32768;return!1};goog.dom.setFocusableTabIndex=function(a,b){b?a.tabIndex=0:(a.tabIndex=-1,a.removeAttribute("tabIndex"))};
goog.dom.getTextContent=function(a){if(goog.dom.BrowserFeature.CAN_USE_INNER_TEXT&&"innerText"in a)a=goog.string.canonicalizeNewlines(a.innerText);else{var b=[];goog.dom.getTextContent_(a,b,!0);a=b.join("")}a=a.replace(/ \xAD /g," ").replace(/\xAD/g,"");a=a.replace(/\u200B/g,"");goog.dom.BrowserFeature.CAN_USE_INNER_TEXT||(a=a.replace(/ +/g," "));a!=" "&&(a=a.replace(/^\s*/,""));return a};goog.dom.getRawTextContent=function(a){var b=[];goog.dom.getTextContent_(a,b,!1);return b.join("")};
goog.dom.getTextContent_=function(a,b,c){if(!(a.nodeName in goog.dom.TAGS_TO_IGNORE_))if(a.nodeType==goog.dom.NodeType.TEXT)c?b.push(String(a.nodeValue).replace(/(\r\n|\r|\n)/g,"")):b.push(a.nodeValue);else if(a.nodeName in goog.dom.PREDEFINED_TAG_VALUES_)b.push(goog.dom.PREDEFINED_TAG_VALUES_[a.nodeName]);else for(a=a.firstChild;a;)goog.dom.getTextContent_(a,b,c),a=a.nextSibling};goog.dom.getNodeTextLength=function(a){return goog.dom.getTextContent(a).length};
goog.dom.getNodeTextOffset=function(a,b){for(var c=b||goog.dom.getOwnerDocument(a).body,d=[];a&&a!=c;){for(var e=a;e=e.previousSibling;)d.unshift(goog.dom.getTextContent(e));a=a.parentNode}return goog.string.trimLeft(d.join("")).replace(/ +/g," ").length};
goog.dom.getNodeAtOffset=function(a,b,c){a=[a];for(var d=0,e;a.length>0&&d<b;)if(e=a.pop(),!(e.nodeName in goog.dom.TAGS_TO_IGNORE_))if(e.nodeType==goog.dom.NodeType.TEXT){var f=e.nodeValue.replace(/(\r\n|\r|\n)/g,"").replace(/ +/g," ");d+=f.length}else if(e.nodeName in goog.dom.PREDEFINED_TAG_VALUES_)d+=goog.dom.PREDEFINED_TAG_VALUES_[e.nodeName].length;else for(f=e.childNodes.length-1;f>=0;f--)a.push(e.childNodes[f]);if(goog.isObject(c))c.remainder=e?e.nodeValue.length+b-d-1:0,c.node=e;return e};
goog.dom.isNodeList=function(a){if(a&&typeof a.length=="number")if(goog.isObject(a))return typeof a.item=="function"||typeof a.item=="string";else if(goog.isFunction(a))return typeof a.item=="function";return!1};goog.dom.getAncestorByTagNameAndClass=function(a,b,c){var d=b?b.toUpperCase():null;return goog.dom.getAncestor(a,function(a){return(!d||a.nodeName==d)&&(!c||goog.dom.classes.has(a,c))},!0)};goog.dom.getAncestorByClass=function(a,b){return goog.dom.getAncestorByTagNameAndClass(a,null,b)};
goog.dom.getAncestor=function(a,b,c,d){if(!c)a=a.parentNode;c=d==null;for(var e=0;a&&(c||e<=d);){if(b(a))return a;a=a.parentNode;e++}return null};goog.dom.getActiveElement=function(a){try{return a&&a.activeElement}catch(b){}return null};goog.dom.DomHelper=function(a){this.document_=a||goog.global.document||document};goog.dom.DomHelper.prototype.getDomHelper=goog.dom.getDomHelper;goog.dom.DomHelper.prototype.setDocument=function(a){this.document_=a};goog.dom.DomHelper.prototype.getDocument=function(){return this.document_};
goog.dom.DomHelper.prototype.getElement=function(a){return goog.isString(a)?this.document_.getElementById(a):a};goog.dom.DomHelper.prototype.$=goog.dom.DomHelper.prototype.getElement;goog.dom.DomHelper.prototype.getElementsByTagNameAndClass=function(a,b,c){return goog.dom.getElementsByTagNameAndClass_(this.document_,a,b,c)};goog.dom.DomHelper.prototype.getElementsByClass=function(a,b){return goog.dom.getElementsByClass(a,b||this.document_)};
goog.dom.DomHelper.prototype.getElementByClass=function(a,b){return goog.dom.getElementByClass(a,b||this.document_)};goog.dom.DomHelper.prototype.$$=goog.dom.DomHelper.prototype.getElementsByTagNameAndClass;goog.dom.DomHelper.prototype.setProperties=goog.dom.setProperties;goog.dom.DomHelper.prototype.getViewportSize=function(a){return goog.dom.getViewportSize(a||this.getWindow())};goog.dom.DomHelper.prototype.getDocumentHeight=function(){return goog.dom.getDocumentHeight_(this.getWindow())};
goog.dom.DomHelper.prototype.createDom=function(){return goog.dom.createDom_(this.document_,arguments)};goog.dom.DomHelper.prototype.$dom=goog.dom.DomHelper.prototype.createDom;goog.dom.DomHelper.prototype.createElement=function(a){return this.document_.createElement(a)};goog.dom.DomHelper.prototype.createTextNode=function(a){return this.document_.createTextNode(a)};goog.dom.DomHelper.prototype.createTable=function(a,b,c){return goog.dom.createTable_(this.document_,a,b,!!c)};
goog.dom.DomHelper.prototype.htmlToDocumentFragment=function(a){return goog.dom.htmlToDocumentFragment_(this.document_,a)};goog.dom.DomHelper.prototype.getCompatMode=function(){return this.isCss1CompatMode()?"CSS1Compat":"BackCompat"};goog.dom.DomHelper.prototype.isCss1CompatMode=function(){return goog.dom.isCss1CompatMode_(this.document_)};goog.dom.DomHelper.prototype.getWindow=function(){return goog.dom.getWindow_(this.document_)};goog.dom.DomHelper.prototype.getDocumentScrollElement=function(){return goog.dom.getDocumentScrollElement_(this.document_)};
goog.dom.DomHelper.prototype.getDocumentScroll=function(){return goog.dom.getDocumentScroll_(this.document_)};goog.dom.DomHelper.prototype.appendChild=goog.dom.appendChild;goog.dom.DomHelper.prototype.append=goog.dom.append;goog.dom.DomHelper.prototype.removeChildren=goog.dom.removeChildren;goog.dom.DomHelper.prototype.insertSiblingBefore=goog.dom.insertSiblingBefore;goog.dom.DomHelper.prototype.insertSiblingAfter=goog.dom.insertSiblingAfter;goog.dom.DomHelper.prototype.removeNode=goog.dom.removeNode;
goog.dom.DomHelper.prototype.replaceNode=goog.dom.replaceNode;goog.dom.DomHelper.prototype.flattenElement=goog.dom.flattenElement;goog.dom.DomHelper.prototype.getFirstElementChild=goog.dom.getFirstElementChild;goog.dom.DomHelper.prototype.getLastElementChild=goog.dom.getLastElementChild;goog.dom.DomHelper.prototype.getNextElementSibling=goog.dom.getNextElementSibling;goog.dom.DomHelper.prototype.getPreviousElementSibling=goog.dom.getPreviousElementSibling;
goog.dom.DomHelper.prototype.getNextNode=goog.dom.getNextNode;goog.dom.DomHelper.prototype.getPreviousNode=goog.dom.getPreviousNode;goog.dom.DomHelper.prototype.isNodeLike=goog.dom.isNodeLike;goog.dom.DomHelper.prototype.contains=goog.dom.contains;goog.dom.DomHelper.prototype.getOwnerDocument=goog.dom.getOwnerDocument;goog.dom.DomHelper.prototype.getFrameContentDocument=goog.dom.getFrameContentDocument;goog.dom.DomHelper.prototype.getFrameContentWindow=goog.dom.getFrameContentWindow;
goog.dom.DomHelper.prototype.setTextContent=goog.dom.setTextContent;goog.dom.DomHelper.prototype.findNode=goog.dom.findNode;goog.dom.DomHelper.prototype.findNodes=goog.dom.findNodes;goog.dom.DomHelper.prototype.getTextContent=goog.dom.getTextContent;goog.dom.DomHelper.prototype.getNodeTextLength=goog.dom.getNodeTextLength;goog.dom.DomHelper.prototype.getNodeTextOffset=goog.dom.getNodeTextOffset;goog.dom.DomHelper.prototype.getAncestorByTagNameAndClass=goog.dom.getAncestorByTagNameAndClass;
goog.dom.DomHelper.prototype.getAncestorByClass=goog.dom.getAncestorByClass;goog.dom.DomHelper.prototype.getAncestor=goog.dom.getAncestor;goog.events.EventTarget=function(){goog.Disposable.call(this)};goog.inherits(goog.events.EventTarget,goog.Disposable);goog.events.EventTarget.prototype.customEvent_=!0;goog.events.EventTarget.prototype.parentEventTarget_=null;goog.events.EventTarget.prototype.getParentEventTarget=function(){return this.parentEventTarget_};goog.events.EventTarget.prototype.setParentEventTarget=function(a){this.parentEventTarget_=a};
goog.events.EventTarget.prototype.addEventListener=function(a,b,c,d){goog.events.listen(this,a,b,c,d)};goog.events.EventTarget.prototype.removeEventListener=function(a,b,c,d){goog.events.unlisten(this,a,b,c,d)};goog.events.EventTarget.prototype.dispatchEvent=function(a){return goog.events.dispatchEvent(this,a)};goog.events.EventTarget.prototype.disposeInternal=function(){goog.events.EventTarget.superClass_.disposeInternal.call(this);goog.events.removeAll(this);this.parentEventTarget_=null};goog.fx={};goog.fx.Dragger=function(a,b,c){goog.events.EventTarget.call(this);this.target=a;this.handle=b||a;this.limits=c||new goog.math.Rect(NaN,NaN,NaN,NaN);this.document_=goog.dom.getOwnerDocument(a);this.eventHandler_=new goog.events.EventHandler(this);goog.events.listen(this.handle,[goog.events.EventType.TOUCHSTART,goog.events.EventType.MOUSEDOWN],this.startDrag,!1,this)};goog.inherits(goog.fx.Dragger,goog.events.EventTarget);
goog.fx.Dragger.HAS_SET_CAPTURE_=goog.userAgent.IE||goog.userAgent.GECKO&&goog.userAgent.isVersion("1.9.3");goog.fx.Dragger.EventType={EARLY_CANCEL:"earlycancel",START:"start",BEFOREDRAG:"beforedrag",DRAG:"drag",END:"end"};goog.fx.Dragger.prototype.clientX=0;goog.fx.Dragger.prototype.clientY=0;goog.fx.Dragger.prototype.screenX=0;goog.fx.Dragger.prototype.screenY=0;goog.fx.Dragger.prototype.startX=0;goog.fx.Dragger.prototype.startY=0;goog.fx.Dragger.prototype.deltaX=0;
goog.fx.Dragger.prototype.deltaY=0;goog.fx.Dragger.prototype.enabled_=!0;goog.fx.Dragger.prototype.dragging_=!1;goog.fx.Dragger.prototype.hysteresisDistanceSquared_=0;goog.fx.Dragger.prototype.mouseDownTime_=0;goog.fx.Dragger.prototype.ieDragStartCancellingOn_=!1;goog.fx.Dragger.prototype.getHandler=function(){return this.eventHandler_};goog.fx.Dragger.prototype.setLimits=function(a){this.limits=a||new goog.math.Rect(NaN,NaN,NaN,NaN)};
goog.fx.Dragger.prototype.setHysteresis=function(a){this.hysteresisDistanceSquared_=Math.pow(a,2)};goog.fx.Dragger.prototype.getHysteresis=function(){return Math.sqrt(this.hysteresisDistanceSquared_)};goog.fx.Dragger.prototype.setScrollTarget=function(a){this.scrollTarget_=a};goog.fx.Dragger.prototype.setCancelIeDragStart=function(a){this.ieDragStartCancellingOn_=a};goog.fx.Dragger.prototype.getEnabled=function(){return this.enabled_};
goog.fx.Dragger.prototype.setEnabled=function(a){this.enabled_=a};goog.fx.Dragger.prototype.disposeInternal=function(){goog.fx.Dragger.superClass_.disposeInternal.call(this);goog.events.unlisten(this.handle,[goog.events.EventType.TOUCHSTART,goog.events.EventType.MOUSEDOWN],this.startDrag,!1,this);this.eventHandler_.dispose();delete this.target;delete this.handle;delete this.eventHandler_};
goog.fx.Dragger.prototype.startDrag=function(a){var b=a.type==goog.events.EventType.MOUSEDOWN;if(this.enabled_&&!this.dragging_&&(!b||a.isMouseActionButton())){this.maybeReinitTouchEvent_(a);if(this.hysteresisDistanceSquared_==0)if(this.initializeDrag_(a),this.dragging_)a.preventDefault();else return;else a.preventDefault();this.setupDragHandlers();this.clientX=this.startX=a.clientX;this.clientY=this.startY=a.clientY;this.screenX=a.screenX;this.screenY=a.screenY;this.deltaX=this.target.offsetLeft;
this.deltaY=this.target.offsetTop;this.pageScroll=goog.dom.getDomHelper(this.document_).getDocumentScroll();this.mouseDownTime_=goog.now()}else this.dispatchEvent(goog.fx.Dragger.EventType.EARLY_CANCEL)};
goog.fx.Dragger.prototype.setupDragHandlers=function(){var a=this.document_,b=a.documentElement,c=!goog.fx.Dragger.HAS_SET_CAPTURE_;this.eventHandler_.listen(a,[goog.events.EventType.TOUCHMOVE,goog.events.EventType.MOUSEMOVE],this.handleMove_,c);this.eventHandler_.listen(a,[goog.events.EventType.TOUCHEND,goog.events.EventType.MOUSEUP],this.endDrag,c);goog.fx.Dragger.HAS_SET_CAPTURE_?(b.setCapture(!1),this.eventHandler_.listen(b,goog.events.EventType.LOSECAPTURE,this.endDrag)):this.eventHandler_.listen(goog.dom.getWindow(a),
goog.events.EventType.BLUR,this.endDrag);goog.userAgent.IE&&this.ieDragStartCancellingOn_&&this.eventHandler_.listen(a,goog.events.EventType.DRAGSTART,goog.events.Event.preventDefault);this.scrollTarget_&&this.eventHandler_.listen(this.scrollTarget_,goog.events.EventType.SCROLL,this.onScroll_,c)};goog.fx.Dragger.prototype.initializeDrag_=function(a){if(this.dispatchEvent(new goog.fx.DragEvent(goog.fx.Dragger.EventType.START,this,a.clientX,a.clientY,a))!==!1)this.dragging_=!0};
goog.fx.Dragger.prototype.endDrag=function(a,b){this.eventHandler_.removeAll();goog.fx.Dragger.HAS_SET_CAPTURE_&&this.document_.releaseCapture();var c=this.limitX(this.deltaX),d=this.limitY(this.deltaY);this.dragging_?(this.maybeReinitTouchEvent_(a),this.dragging_=!1,this.dispatchEvent(new goog.fx.DragEvent(goog.fx.Dragger.EventType.END,this,a.clientX,a.clientY,a,c,d,b||a.type==goog.events.EventType.TOUCHCANCEL))):this.dispatchEvent(goog.fx.Dragger.EventType.EARLY_CANCEL);(a.type==goog.events.EventType.TOUCHEND||
a.type==goog.events.EventType.TOUCHCANCEL)&&a.preventDefault()};goog.fx.Dragger.prototype.endDragCancel=function(a){this.endDrag(a,!0)};goog.fx.Dragger.prototype.maybeReinitTouchEvent_=function(a){var b=a.type;b==goog.events.EventType.TOUCHSTART||b==goog.events.EventType.TOUCHMOVE?a.init(a.getBrowserEvent().targetTouches[0],a.currentTarget):(b==goog.events.EventType.TOUCHEND||b==goog.events.EventType.TOUCHCANCEL)&&a.init(a.getBrowserEvent().changedTouches[0],a.currentTarget)};
goog.fx.Dragger.prototype.handleMove_=function(a){if(this.enabled_){this.maybeReinitTouchEvent_(a);var b=a.clientX-this.clientX,c=a.clientY-this.clientY;this.clientX=a.clientX;this.clientY=a.clientY;this.screenX=a.screenX;this.screenY=a.screenY;if(!this.dragging_){var d=this.startX-this.clientX,e=this.startY-this.clientY;if(d*d+e*e>this.hysteresisDistanceSquared_&&(this.initializeDrag_(a),!this.dragging_)){this.endDrag(a);return}}c=this.calculatePosition_(b,c);b=c.x;c=c.y;this.dragging_&&this.dispatchEvent(new goog.fx.DragEvent(goog.fx.Dragger.EventType.BEFOREDRAG,
this,a.clientX,a.clientY,a,b,c))!==!1&&(this.doDrag(a,b,c,!1),a.preventDefault())}};goog.fx.Dragger.prototype.calculatePosition_=function(a,b){var c=goog.dom.getDomHelper(this.document_).getDocumentScroll();a+=c.x-this.pageScroll.x;b+=c.y-this.pageScroll.y;this.pageScroll=c;this.deltaX+=a;this.deltaY+=b;c=this.limitX(this.deltaX);var d=this.limitY(this.deltaY);return new goog.math.Coordinate(c,d)};
goog.fx.Dragger.prototype.onScroll_=function(a){var b=this.calculatePosition_(0,0);a.clientX=this.clientX;a.clientY=this.clientY;this.doDrag(a,b.x,b.y,!0)};goog.fx.Dragger.prototype.doDrag=function(a,b,c){this.defaultAction(b,c);this.dispatchEvent(new goog.fx.DragEvent(goog.fx.Dragger.EventType.DRAG,this,a.clientX,a.clientY,a,b,c))};
goog.fx.Dragger.prototype.limitX=function(a){var b=this.limits,c=!isNaN(b.left)?b.left:null;b=!isNaN(b.width)?b.width:0;return Math.min(c!=null?c+b:Infinity,Math.max(c!=null?c:-Infinity,a))};goog.fx.Dragger.prototype.limitY=function(a){var b=this.limits,c=!isNaN(b.top)?b.top:null;b=!isNaN(b.height)?b.height:0;return Math.min(c!=null?c+b:Infinity,Math.max(c!=null?c:-Infinity,a))};goog.fx.Dragger.prototype.defaultAction=function(a,b){this.target.style.left=a+"px";this.target.style.top=b+"px"};
goog.fx.DragEvent=function(a,b,c,d,e,f,g,h){goog.events.Event.call(this,a);this.clientX=c;this.clientY=d;this.browserEvent=e;this.left=goog.isDef(f)?f:b.deltaX;this.top=goog.isDef(g)?g:b.deltaY;this.dragger=b;this.dragCanceled=!!h};goog.inherits(goog.fx.DragEvent,goog.events.Event);goog.style={};goog.style.setStyle=function(a,b,c){goog.isString(b)?goog.style.setStyle_(a,c,b):goog.object.forEach(b,goog.partial(goog.style.setStyle_,a))};goog.style.setStyle_=function(a,b,c){a.style[goog.string.toCamelCase(c)]=b};goog.style.getStyle=function(a,b){return a.style[goog.string.toCamelCase(b)]||""};
goog.style.getComputedStyle=function(a,b){var c=goog.dom.getOwnerDocument(a);if(c.defaultView&&c.defaultView.getComputedStyle&&(c=c.defaultView.getComputedStyle(a,null)))return c[b]||c.getPropertyValue(b);return""};goog.style.getCascadedStyle=function(a,b){return a.currentStyle?a.currentStyle[b]:null};goog.style.getStyle_=function(a,b){return goog.style.getComputedStyle(a,b)||goog.style.getCascadedStyle(a,b)||a.style[b]};goog.style.getComputedPosition=function(a){return goog.style.getStyle_(a,"position")};
goog.style.getBackgroundColor=function(a){return goog.style.getStyle_(a,"backgroundColor")};goog.style.getComputedOverflowX=function(a){return goog.style.getStyle_(a,"overflowX")};goog.style.getComputedOverflowY=function(a){return goog.style.getStyle_(a,"overflowY")};goog.style.getComputedZIndex=function(a){return goog.style.getStyle_(a,"zIndex")};goog.style.getComputedTextAlign=function(a){return goog.style.getStyle_(a,"textAlign")};
goog.style.getComputedCursor=function(a){return goog.style.getStyle_(a,"cursor")};goog.style.setPosition=function(a,b,c){var d,e=goog.userAgent.GECKO&&(goog.userAgent.MAC||goog.userAgent.X11)&&goog.userAgent.isVersion("1.9");b instanceof goog.math.Coordinate?(d=b.x,b=b.y):(d=b,b=c);a.style.left=goog.style.getPixelStyleValue_(d,e);a.style.top=goog.style.getPixelStyleValue_(b,e)};goog.style.getPosition=function(a){return new goog.math.Coordinate(a.offsetLeft,a.offsetTop)};
goog.style.getClientViewportElement=function(a){a=a?a.nodeType==goog.dom.NodeType.DOCUMENT?a:goog.dom.getOwnerDocument(a):goog.dom.getDocument();if(goog.userAgent.IE&&!goog.userAgent.isDocumentMode(9)&&!goog.dom.getDomHelper(a).isCss1CompatMode())return a.body;return a.documentElement};
goog.style.getBoundingClientRect_=function(a){var b=a.getBoundingClientRect();if(goog.userAgent.IE)a=a.ownerDocument,b.left-=a.documentElement.clientLeft+a.body.clientLeft,b.top-=a.documentElement.clientTop+a.body.clientTop;return b};
goog.style.getOffsetParent=function(a){if(goog.userAgent.IE)return a.offsetParent;var b=goog.dom.getOwnerDocument(a),c=goog.style.getStyle_(a,"position"),d=c=="fixed"||c=="absolute";for(a=a.parentNode;a&&a!=b;a=a.parentNode)if(c=goog.style.getStyle_(a,"position"),d=d&&c=="static"&&a!=b.documentElement&&a!=b.body,!d&&(a.scrollWidth>a.clientWidth||a.scrollHeight>a.clientHeight||c=="fixed"||c=="absolute"||c=="relative"))return a;return null};
goog.style.getVisibleRectForElement=function(a){for(var b=new goog.math.Box(0,Infinity,Infinity,0),c=goog.dom.getDomHelper(a),d=c.getDocument().body,e=c.getDocument().documentElement,f=c.getDocumentScrollElement();a=goog.style.getOffsetParent(a);)if((!goog.userAgent.IE||a.clientWidth!=0)&&(!goog.userAgent.WEBKIT||a.clientHeight!=0||a!=d)&&a!=d&&a!=e&&goog.style.getStyle_(a,"overflow")!="visible"){var g=goog.style.getPageOffset(a),h=goog.style.getClientLeftTop(a);g.x+=h.x;g.y+=h.y;b.top=Math.max(b.top,
g.y);b.right=Math.min(b.right,g.x+a.clientWidth);b.bottom=Math.min(b.bottom,g.y+a.clientHeight);b.left=Math.max(b.left,g.x)}d=f.scrollLeft;f=f.scrollTop;b.left=Math.max(b.left,d);b.top=Math.max(b.top,f);c=c.getViewportSize();b.right=Math.min(b.right,d+c.width);b.bottom=Math.min(b.bottom,f+c.height);return b.top>=0&&b.left>=0&&b.bottom>b.top&&b.right>b.left?b:null};
goog.style.scrollIntoContainerView=function(a,b,c){var d=goog.style.getPageOffset(a),e=goog.style.getPageOffset(b),f=goog.style.getBorderBox(b),g=d.x-e.x-f.left;d=d.y-e.y-f.top;e=b.clientWidth-a.offsetWidth;a=b.clientHeight-a.offsetHeight;c?(b.scrollLeft+=g-e/2,b.scrollTop+=d-a/2):(b.scrollLeft+=Math.min(g,Math.max(g-e,0)),b.scrollTop+=Math.min(d,Math.max(d-a,0)))};
goog.style.getClientLeftTop=function(a){if(goog.userAgent.GECKO&&!goog.userAgent.isVersion("1.9")){var b=parseFloat(goog.style.getComputedStyle(a,"borderLeftWidth"));if(goog.style.isRightToLeft(a)){var c=a.offsetWidth-a.clientWidth-b-parseFloat(goog.style.getComputedStyle(a,"borderRightWidth"));b+=c}return new goog.math.Coordinate(b,parseFloat(goog.style.getComputedStyle(a,"borderTopWidth")))}return new goog.math.Coordinate(a.clientLeft,a.clientTop)};
goog.style.getPageOffset=function(a){var b,c=goog.dom.getOwnerDocument(a),d=goog.style.getStyle_(a,"position"),e=goog.userAgent.GECKO&&c.getBoxObjectFor&&!a.getBoundingClientRect&&d=="absolute"&&(b=c.getBoxObjectFor(a))&&(b.screenX<0||b.screenY<0),f=new goog.math.Coordinate(0,0),g=goog.style.getClientViewportElement(c);if(a==g)return f;if(a.getBoundingClientRect)b=goog.style.getBoundingClientRect_(a),a=goog.dom.getDomHelper(c).getDocumentScroll(),f.x=b.left+a.x,f.y=b.top+a.y;else if(c.getBoxObjectFor&&
!e)b=c.getBoxObjectFor(a),a=c.getBoxObjectFor(g),f.x=b.screenX-a.screenX,f.y=b.screenY-a.screenY;else{b=a;do{f.x+=b.offsetLeft;f.y+=b.offsetTop;b!=a&&(f.x+=b.clientLeft||0,f.y+=b.clientTop||0);if(goog.userAgent.WEBKIT&&goog.style.getComputedPosition(b)=="fixed"){f.x+=c.body.scrollLeft;f.y+=c.body.scrollTop;break}b=b.offsetParent}while(b&&b!=a);if(goog.userAgent.OPERA||goog.userAgent.WEBKIT&&d=="absolute")f.y-=c.body.offsetTop;for(b=a;(b=goog.style.getOffsetParent(b))&&b!=c.body&&b!=g;)if(f.x-=b.scrollLeft,
!goog.userAgent.OPERA||b.tagName!="TR")f.y-=b.scrollTop}return f};goog.style.getPageOffsetLeft=function(a){return goog.style.getPageOffset(a).x};goog.style.getPageOffsetTop=function(a){return goog.style.getPageOffset(a).y};goog.style.getFramedPageOffset=function(a,b){var c=new goog.math.Coordinate(0,0),d=goog.dom.getWindow(goog.dom.getOwnerDocument(a)),e=a;do{var f=d==b?goog.style.getPageOffset(e):goog.style.getClientPosition(e);c.x+=f.x;c.y+=f.y}while(d&&d!=b&&(e=d.frameElement)&&(d=d.parent));return c};
goog.style.translateRectForAnotherFrame=function(a,b,c){if(b.getDocument()!=c.getDocument()){var d=b.getDocument().body;c=goog.style.getFramedPageOffset(d,c.getWindow());c=goog.math.Coordinate.difference(c,goog.style.getPageOffset(d));goog.userAgent.IE&&!b.isCss1CompatMode()&&(c=goog.math.Coordinate.difference(c,b.getDocumentScroll()));a.left+=c.x;a.top+=c.y}};
goog.style.getRelativePosition=function(a,b){var c=goog.style.getClientPosition(a),d=goog.style.getClientPosition(b);return new goog.math.Coordinate(c.x-d.x,c.y-d.y)};
goog.style.getClientPosition=function(a){var b=new goog.math.Coordinate;if(a.nodeType==goog.dom.NodeType.ELEMENT)if(a.getBoundingClientRect)a=goog.style.getBoundingClientRect_(a),b.x=a.left,b.y=a.top;else{var c=goog.dom.getDomHelper(a).getDocumentScroll();a=goog.style.getPageOffset(a);b.x=a.x-c.x;b.y=a.y-c.y}else{c=goog.isFunction(a.getBrowserEvent);var d=a;a.targetTouches?d=a.targetTouches[0]:c&&a.getBrowserEvent().targetTouches&&(d=a.getBrowserEvent().targetTouches[0]);b.x=d.clientX;b.y=d.clientY}return b};
goog.style.setPageOffset=function(a,b,c){var d=goog.style.getPageOffset(a);if(b instanceof goog.math.Coordinate)c=b.y,b=b.x;goog.style.setPosition(a,a.offsetLeft+(b-d.x),a.offsetTop+(c-d.y))};goog.style.setSize=function(a,b,c){if(b instanceof goog.math.Size)c=b.height,b=b.width;else if(c==void 0)throw Error("missing height argument");goog.style.setWidth(a,b);goog.style.setHeight(a,c)};goog.style.getPixelStyleValue_=function(a,b){typeof a=="number"&&(a=(b?Math.round(a):a)+"px");return a};
goog.style.setHeight=function(a,b){a.style.height=goog.style.getPixelStyleValue_(b,!0)};goog.style.setWidth=function(a,b){a.style.width=goog.style.getPixelStyleValue_(b,!0)};goog.style.getSize=function(a){if(goog.style.getStyle_(a,"display")!="none")return goog.style.getSizeWithDisplay_(a);var b=a.style,c=b.display,d=b.visibility,e=b.position;b.visibility="hidden";b.position="absolute";b.display="inline";a=goog.style.getSizeWithDisplay_(a);b.display=c;b.position=e;b.visibility=d;return a};
goog.style.getSizeWithDisplay_=function(a){var b=a.offsetWidth,c=a.offsetHeight,d=goog.userAgent.WEBKIT&&!b&&!c;if((!goog.isDef(b)||d)&&a.getBoundingClientRect)return a=goog.style.getBoundingClientRect_(a),new goog.math.Size(a.right-a.left,a.bottom-a.top);return new goog.math.Size(b,c)};goog.style.getBounds=function(a){var b=goog.style.getPageOffset(a);a=goog.style.getSize(a);return new goog.math.Rect(b.x,b.y,a.width,a.height)};goog.style.toCamelCase=function(a){return goog.string.toCamelCase(String(a))};
goog.style.toSelectorCase=function(a){return goog.string.toSelectorCase(a)};goog.style.getOpacity=function(a){var b=a.style;a="";"opacity"in b?a=b.opacity:"MozOpacity"in b?a=b.MozOpacity:"filter"in b&&(b=b.filter.match(/alpha\(opacity=([\d.]+)\)/))&&(a=String(b[1]/100));return a==""?a:Number(a)};goog.style.setOpacity=function(a,b){var c=a.style;if("opacity"in c)c.opacity=b;else if("MozOpacity"in c)c.MozOpacity=b;else if("filter"in c)c.filter=b===""?"":"alpha(opacity="+b*100+")"};
goog.style.setTransparentBackgroundImage=function(a,b){var c=a.style;goog.userAgent.IE&&!goog.userAgent.isVersion("8")?c.filter='progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'+b+'", sizingMethod="crop")':(c.backgroundImage="url("+b+")",c.backgroundPosition="top left",c.backgroundRepeat="no-repeat")};goog.style.clearTransparentBackgroundImage=function(a){a=a.style;"filter"in a?a.filter="":a.backgroundImage="none"};goog.style.showElement=function(a,b){a.style.display=b?"":"none"};
goog.style.isElementShown=function(a){return a.style.display!="none"};goog.style.installStyles=function(a,b){var c=goog.dom.getDomHelper(b),d=null;if(goog.userAgent.IE)d=c.getDocument().createStyleSheet(),goog.style.setStyles(d,a);else{var e=c.getElementsByTagNameAndClass("head")[0];e||(d=c.getElementsByTagNameAndClass("body")[0],e=c.createDom("head"),d.parentNode.insertBefore(e,d));d=c.createDom("style");goog.style.setStyles(d,a);c.appendChild(e,d)}return d};
goog.style.uninstallStyles=function(a){goog.dom.removeNode(a.ownerNode||a.owningElement||a)};goog.style.setStyles=function(a,b){goog.userAgent.IE?a.cssText=b:a[goog.userAgent.WEBKIT?"innerText":"innerHTML"]=b};goog.style.setPreWrap=function(a){a=a.style;goog.userAgent.IE&&!goog.userAgent.isVersion("8")?(a.whiteSpace="pre",a.wordWrap="break-word"):a.whiteSpace=goog.userAgent.GECKO?"-moz-pre-wrap":"pre-wrap"};
goog.style.setInlineBlock=function(a){a=a.style;a.position="relative";goog.userAgent.IE&&!goog.userAgent.isVersion("8")?(a.zoom="1",a.display="inline"):a.display=goog.userAgent.GECKO?goog.userAgent.isVersion("1.9a")?"inline-block":"-moz-inline-box":"inline-block"};goog.style.isRightToLeft=function(a){return"rtl"==goog.style.getStyle_(a,"direction")};goog.style.unselectableStyle_=goog.userAgent.GECKO?"MozUserSelect":goog.userAgent.WEBKIT?"WebkitUserSelect":null;
goog.style.isUnselectable=function(a){if(goog.style.unselectableStyle_)return a.style[goog.style.unselectableStyle_].toLowerCase()=="none";else if(goog.userAgent.IE||goog.userAgent.OPERA)return a.getAttribute("unselectable")=="on";return!1};
goog.style.setUnselectable=function(a,b,c){c=!c?a.getElementsByTagName("*"):null;var d=goog.style.unselectableStyle_;if(d){if(b=b?"none":"",a.style[d]=b,c){a=0;for(var e;e=c[a];a++)e.style[d]=b}}else if(goog.userAgent.IE||goog.userAgent.OPERA)if(b=b?"on":"",a.setAttribute("unselectable",b),c)for(a=0;e=c[a];a++)e.setAttribute("unselectable",b)};goog.style.getBorderBoxSize=function(a){return new goog.math.Size(a.offsetWidth,a.offsetHeight)};
goog.style.setBorderBoxSize=function(a,b){var c=goog.dom.getOwnerDocument(a),d=goog.dom.getDomHelper(c).isCss1CompatMode();if(goog.userAgent.IE&&(!d||!goog.userAgent.isVersion("8")))if(c=a.style,d){d=goog.style.getPaddingBox(a);var e=goog.style.getBorderBox(a);c.pixelWidth=b.width-e.left-d.left-d.right-e.right;c.pixelHeight=b.height-e.top-d.top-d.bottom-e.bottom}else c.pixelWidth=b.width,c.pixelHeight=b.height;else goog.style.setBoxSizingSize_(a,b,"border-box")};
goog.style.getContentBoxSize=function(a){var b=goog.dom.getOwnerDocument(a),c=goog.userAgent.IE&&a.currentStyle;return c&&goog.dom.getDomHelper(b).isCss1CompatMode()&&c.width!="auto"&&c.height!="auto"&&!c.boxSizing?(b=goog.style.getIePixelValue_(a,c.width,"width","pixelWidth"),a=goog.style.getIePixelValue_(a,c.height,"height","pixelHeight"),new goog.math.Size(b,a)):(c=goog.style.getBorderBoxSize(a),b=goog.style.getPaddingBox(a),a=goog.style.getBorderBox(a),new goog.math.Size(c.width-a.left-b.left-
b.right-a.right,c.height-a.top-b.top-b.bottom-a.bottom))};
goog.style.setContentBoxSize=function(a,b){var c=goog.dom.getOwnerDocument(a),d=goog.dom.getDomHelper(c).isCss1CompatMode();if(goog.userAgent.IE&&(!d||!goog.userAgent.isVersion("8")))if(c=a.style,d)c.pixelWidth=b.width,c.pixelHeight=b.height;else{d=goog.style.getPaddingBox(a);var e=goog.style.getBorderBox(a);c.pixelWidth=b.width+e.left+d.left+d.right+e.right;c.pixelHeight=b.height+e.top+d.top+d.bottom+e.bottom}else goog.style.setBoxSizingSize_(a,b,"content-box")};
goog.style.setBoxSizingSize_=function(a,b,c){a=a.style;goog.userAgent.GECKO?a.MozBoxSizing=c:goog.userAgent.WEBKIT?a.WebkitBoxSizing=c:a.boxSizing=c;a.width=b.width+"px";a.height=b.height+"px"};goog.style.getIePixelValue_=function(a,b,c,d){if(/^\d+px?$/.test(b))return parseInt(b,10);else{var e=a.style[c],f=a.runtimeStyle[c];a.runtimeStyle[c]=a.currentStyle[c];a.style[c]=b;b=a.style[d];a.style[c]=e;a.runtimeStyle[c]=f;return b}};
goog.style.getIePixelDistance_=function(a,b){return goog.style.getIePixelValue_(a,goog.style.getCascadedStyle(a,b),"left","pixelLeft")};
goog.style.getBox_=function(a,b){if(goog.userAgent.IE){var c=goog.style.getIePixelDistance_(a,b+"Left"),d=goog.style.getIePixelDistance_(a,b+"Right"),e=goog.style.getIePixelDistance_(a,b+"Top"),f=goog.style.getIePixelDistance_(a,b+"Bottom");return new goog.math.Box(e,d,f,c)}else return c=goog.style.getComputedStyle(a,b+"Left"),d=goog.style.getComputedStyle(a,b+"Right"),e=goog.style.getComputedStyle(a,b+"Top"),f=goog.style.getComputedStyle(a,b+"Bottom"),new goog.math.Box(parseFloat(e),parseFloat(d),
parseFloat(f),parseFloat(c))};goog.style.getPaddingBox=function(a){return goog.style.getBox_(a,"padding")};goog.style.getMarginBox=function(a){return goog.style.getBox_(a,"margin")};goog.style.ieBorderWidthKeywords_={thin:2,medium:4,thick:6};
goog.style.getIePixelBorder_=function(a,b){if(goog.style.getCascadedStyle(a,b+"Style")=="none")return 0;var c=goog.style.getCascadedStyle(a,b+"Width");if(c in goog.style.ieBorderWidthKeywords_)return goog.style.ieBorderWidthKeywords_[c];return goog.style.getIePixelValue_(a,c,"left","pixelLeft")};
goog.style.getBorderBox=function(a){if(goog.userAgent.IE){var b=goog.style.getIePixelBorder_(a,"borderLeft"),c=goog.style.getIePixelBorder_(a,"borderRight"),d=goog.style.getIePixelBorder_(a,"borderTop");a=goog.style.getIePixelBorder_(a,"borderBottom");return new goog.math.Box(d,c,a,b)}else return b=goog.style.getComputedStyle(a,"borderLeftWidth"),c=goog.style.getComputedStyle(a,"borderRightWidth"),d=goog.style.getComputedStyle(a,"borderTopWidth"),a=goog.style.getComputedStyle(a,"borderBottomWidth"),
new goog.math.Box(parseFloat(d),parseFloat(c),parseFloat(a),parseFloat(b))};goog.style.getFontFamily=function(a){var b=goog.dom.getOwnerDocument(a),c="";if(b.body.createTextRange){b=b.body.createTextRange();b.moveToElementText(a);try{c=b.queryCommandValue("FontName")}catch(d){c=""}}c||(c=goog.style.getStyle_(a,"fontFamily"));a=c.split(",");a.length>1&&(c=a[0]);return goog.string.stripQuotes(c,"\"'")};goog.style.lengthUnitRegex_=/[^\d]+$/;
goog.style.getLengthUnits=function(a){return(a=a.match(goog.style.lengthUnitRegex_))&&a[0]||null};goog.style.ABSOLUTE_CSS_LENGTH_UNITS_={cm:1,"in":1,mm:1,pc:1,pt:1};goog.style.CONVERTIBLE_RELATIVE_CSS_UNITS_={em:1,ex:1};
goog.style.getFontSize=function(a){var b=goog.style.getStyle_(a,"fontSize"),c=goog.style.getLengthUnits(b);if(b&&"px"==c)return parseInt(b,10);if(goog.userAgent.IE)if(c in goog.style.ABSOLUTE_CSS_LENGTH_UNITS_)return goog.style.getIePixelValue_(a,b,"left","pixelLeft");else if(a.parentNode&&a.parentNode.nodeType==goog.dom.NodeType.ELEMENT&&c in goog.style.CONVERTIBLE_RELATIVE_CSS_UNITS_)return a=a.parentNode,c=goog.style.getStyle_(a,"fontSize"),goog.style.getIePixelValue_(a,b==c?"1em":b,"left","pixelLeft");
c=goog.dom.createDom("span",{style:"visibility:hidden;position:absolute;line-height:0;padding:0;margin:0;border:0;height:1em;"});goog.dom.appendChild(a,c);b=c.offsetHeight;goog.dom.removeNode(c);return b};goog.style.parseStyleAttribute=function(a){var b={};goog.array.forEach(a.split(/\s*;\s*/),function(a){a=a.split(/\s*:\s*/);a.length==2&&(b[goog.string.toCamelCase(a[0].toLowerCase())]=a[1])});return b};
goog.style.toStyleAttribute=function(a){var b=[];goog.object.forEach(a,function(a,d){b.push(goog.string.toSelectorCase(d),":",a,";")});return b.join("")};goog.style.setFloat=function(a,b){a.style[goog.userAgent.IE?"styleFloat":"cssFloat"]=b};goog.style.getFloat=function(a){return a.style[goog.userAgent.IE?"styleFloat":"cssFloat"]||""};
goog.style.getScrollbarWidth=function(a){var b=goog.dom.createElement("div");if(a)b.className=a;b.style.cssText="visiblity:hidden;overflow:auto;position:absolute;top:0;width:100px;height:100px";a=goog.dom.createElement("div");goog.style.setSize(a,"200px","200px");b.appendChild(a);goog.dom.appendChild(goog.dom.getDocument().body,b);a=b.offsetWidth-b.clientWidth;goog.dom.removeNode(b);return a};goog.ui={};goog.ui.IdGenerator=function(){};goog.addSingletonGetter(goog.ui.IdGenerator);goog.ui.IdGenerator.prototype.nextId_=0;goog.ui.IdGenerator.prototype.getNextUniqueId=function(){return":"+(this.nextId_++).toString(36)};goog.ui.IdGenerator.instance=goog.ui.IdGenerator.getInstance();goog.ui.Component=function(a){goog.events.EventTarget.call(this);this.dom_=a||goog.dom.getDomHelper();this.rightToLeft_=goog.ui.Component.defaultRightToLeft_};goog.inherits(goog.ui.Component,goog.events.EventTarget);goog.ui.Component.prototype.idGenerator_=goog.ui.IdGenerator.getInstance();goog.ui.Component.defaultRightToLeft_=null;
goog.ui.Component.EventType={BEFORE_SHOW:"beforeshow",SHOW:"show",HIDE:"hide",DISABLE:"disable",ENABLE:"enable",HIGHLIGHT:"highlight",UNHIGHLIGHT:"unhighlight",ACTIVATE:"activate",DEACTIVATE:"deactivate",SELECT:"select",UNSELECT:"unselect",CHECK:"check",UNCHECK:"uncheck",FOCUS:"focus",BLUR:"blur",OPEN:"open",CLOSE:"close",ENTER:"enter",LEAVE:"leave",ACTION:"action",CHANGE:"change"};
goog.ui.Component.Error={NOT_SUPPORTED:"Method not supported",DECORATE_INVALID:"Invalid element to decorate",ALREADY_RENDERED:"Component already rendered",PARENT_UNABLE_TO_BE_SET:"Unable to set parent component",CHILD_INDEX_OUT_OF_BOUNDS:"Child component index out of bounds",NOT_OUR_CHILD:"Child is not in parent component",NOT_IN_DOCUMENT:"Operation not supported while component is not in document",STATE_INVALID:"Invalid component state"};
goog.ui.Component.State={ALL:255,DISABLED:1,HOVER:2,ACTIVE:4,SELECTED:8,CHECKED:16,FOCUSED:32,OPENED:64};
goog.ui.Component.getStateTransitionEvent=function(a,b){switch(a){case goog.ui.Component.State.DISABLED:return b?goog.ui.Component.EventType.DISABLE:goog.ui.Component.EventType.ENABLE;case goog.ui.Component.State.HOVER:return b?goog.ui.Component.EventType.HIGHLIGHT:goog.ui.Component.EventType.UNHIGHLIGHT;case goog.ui.Component.State.ACTIVE:return b?goog.ui.Component.EventType.ACTIVATE:goog.ui.Component.EventType.DEACTIVATE;case goog.ui.Component.State.SELECTED:return b?goog.ui.Component.EventType.SELECT:
goog.ui.Component.EventType.UNSELECT;case goog.ui.Component.State.CHECKED:return b?goog.ui.Component.EventType.CHECK:goog.ui.Component.EventType.UNCHECK;case goog.ui.Component.State.FOCUSED:return b?goog.ui.Component.EventType.FOCUS:goog.ui.Component.EventType.BLUR;case goog.ui.Component.State.OPENED:return b?goog.ui.Component.EventType.OPEN:goog.ui.Component.EventType.CLOSE}throw Error(goog.ui.Component.Error.STATE_INVALID);};
goog.ui.Component.setDefaultRightToLeft=function(a){goog.ui.Component.defaultRightToLeft_=a};goog.ui.Component.prototype.id_=null;goog.ui.Component.prototype.inDocument_=!1;goog.ui.Component.prototype.element_=null;goog.ui.Component.prototype.rightToLeft_=null;goog.ui.Component.prototype.model_=null;goog.ui.Component.prototype.parent_=null;goog.ui.Component.prototype.children_=null;goog.ui.Component.prototype.childIndex_=null;goog.ui.Component.prototype.wasDecorated_=!1;
goog.ui.Component.prototype.getId=function(){return this.id_||(this.id_=this.idGenerator_.getNextUniqueId())};goog.ui.Component.prototype.setId=function(a){this.parent_&&this.parent_.childIndex_&&(goog.object.remove(this.parent_.childIndex_,this.id_),goog.object.add(this.parent_.childIndex_,a,this));this.id_=a};goog.ui.Component.prototype.getElement=function(){return this.element_};goog.ui.Component.prototype.setElementInternal=function(a){this.element_=a};
goog.ui.Component.prototype.getElementsByClass=function(a){return this.element_?this.dom_.getElementsByClass(a,this.element_):[]};goog.ui.Component.prototype.getElementByClass=function(a){return this.element_?this.dom_.getElementByClass(a,this.element_):null};goog.ui.Component.prototype.getHandler=function(){return this.googUiComponentHandler_||(this.googUiComponentHandler_=new goog.events.EventHandler(this))};
goog.ui.Component.prototype.setParent=function(a){if(this==a)throw Error(goog.ui.Component.Error.PARENT_UNABLE_TO_BE_SET);if(a&&this.parent_&&this.id_&&this.parent_.getChild(this.id_)&&this.parent_!=a)throw Error(goog.ui.Component.Error.PARENT_UNABLE_TO_BE_SET);this.parent_=a;goog.ui.Component.superClass_.setParentEventTarget.call(this,a)};goog.ui.Component.prototype.getParent=function(){return this.parent_};
goog.ui.Component.prototype.setParentEventTarget=function(a){if(this.parent_&&this.parent_!=a)throw Error(goog.ui.Component.Error.NOT_SUPPORTED);goog.ui.Component.superClass_.setParentEventTarget.call(this,a)};goog.ui.Component.prototype.getDomHelper=function(){return this.dom_};goog.ui.Component.prototype.isInDocument=function(){return this.inDocument_};goog.ui.Component.prototype.createDom=function(){this.element_=this.dom_.createElement("div")};goog.ui.Component.prototype.render=function(a){this.render_(a)};
goog.ui.Component.prototype.renderBefore=function(a){this.render_(a.parentNode,a)};goog.ui.Component.prototype.render_=function(a,b){if(this.inDocument_)throw Error(goog.ui.Component.Error.ALREADY_RENDERED);this.element_||this.createDom();a?a.insertBefore(this.element_,b||null):this.dom_.getDocument().body.appendChild(this.element_);(!this.parent_||this.parent_.isInDocument())&&this.enterDocument()};
goog.ui.Component.prototype.decorate=function(a){if(this.inDocument_)throw Error(goog.ui.Component.Error.ALREADY_RENDERED);else if(a&&this.canDecorate(a)){this.wasDecorated_=!0;if(!this.dom_||this.dom_.getDocument()!=goog.dom.getOwnerDocument(a))this.dom_=goog.dom.getDomHelper(a);this.decorateInternal(a);this.enterDocument()}else throw Error(goog.ui.Component.Error.DECORATE_INVALID);};goog.ui.Component.prototype.canDecorate=function(){return!0};goog.ui.Component.prototype.wasDecorated=function(){return this.wasDecorated_};
goog.ui.Component.prototype.decorateInternal=function(a){this.element_=a};goog.ui.Component.prototype.enterDocument=function(){this.inDocument_=!0;this.forEachChild(function(a){!a.isInDocument()&&a.getElement()&&a.enterDocument()})};goog.ui.Component.prototype.exitDocument=function(){this.forEachChild(function(a){a.isInDocument()&&a.exitDocument()});this.googUiComponentHandler_&&this.googUiComponentHandler_.removeAll();this.inDocument_=!1};
goog.ui.Component.prototype.disposeInternal=function(){goog.ui.Component.superClass_.disposeInternal.call(this);this.inDocument_&&this.exitDocument();this.googUiComponentHandler_&&(this.googUiComponentHandler_.dispose(),delete this.googUiComponentHandler_);this.forEachChild(function(a){a.dispose()});!this.wasDecorated_&&this.element_&&goog.dom.removeNode(this.element_);this.parent_=this.model_=this.element_=this.childIndex_=this.children_=null};
goog.ui.Component.prototype.makeId=function(a){return this.getId()+"."+a};goog.ui.Component.prototype.makeIds=function(a){var b={},c;for(c in a)b[c]=this.makeId(a[c]);return b};goog.ui.Component.prototype.getModel=function(){return this.model_};goog.ui.Component.prototype.setModel=function(a){this.model_=a};goog.ui.Component.prototype.getFragmentFromId=function(a){return a.substring(this.getId().length+1)};
goog.ui.Component.prototype.getElementByFragment=function(a){if(!this.inDocument_)throw Error(goog.ui.Component.Error.NOT_IN_DOCUMENT);return this.dom_.getElement(this.makeId(a))};goog.ui.Component.prototype.addChild=function(a,b){this.addChildAt(a,this.getChildCount(),b)};
goog.ui.Component.prototype.addChildAt=function(a,b,c){if(a.inDocument_&&(c||!this.inDocument_))throw Error(goog.ui.Component.Error.ALREADY_RENDERED);if(b<0||b>this.getChildCount())throw Error(goog.ui.Component.Error.CHILD_INDEX_OUT_OF_BOUNDS);if(!this.childIndex_||!this.children_)this.childIndex_={},this.children_=[];a.getParent()==this?(goog.object.set(this.childIndex_,a.getId(),a),goog.array.remove(this.children_,a)):goog.object.add(this.childIndex_,a.getId(),a);a.setParent(this);goog.array.insertAt(this.children_,
a,b);a.inDocument_&&this.inDocument_&&a.getParent()==this?(c=this.getContentElement(),c.insertBefore(a.getElement(),c.childNodes[b]||null)):c?(this.element_||this.createDom(),b=this.getChildAt(b+1),a.render_(this.getContentElement(),b?b.element_:null)):this.inDocument_&&!a.inDocument_&&a.element_&&a.enterDocument()};goog.ui.Component.prototype.getContentElement=function(){return this.element_};
goog.ui.Component.prototype.isRightToLeft=function(){if(this.rightToLeft_==null)this.rightToLeft_=goog.style.isRightToLeft(this.inDocument_?this.element_:this.dom_.getDocument().body);return this.rightToLeft_};goog.ui.Component.prototype.setRightToLeft=function(a){if(this.inDocument_)throw Error(goog.ui.Component.Error.ALREADY_RENDERED);this.rightToLeft_=a};goog.ui.Component.prototype.hasChildren=function(){return!!this.children_&&this.children_.length!=0};
goog.ui.Component.prototype.getChildCount=function(){return this.children_?this.children_.length:0};goog.ui.Component.prototype.getChildIds=function(){var a=[];this.forEachChild(function(b){a.push(b.getId())});return a};goog.ui.Component.prototype.getChild=function(a){return this.childIndex_&&a?goog.object.get(this.childIndex_,a)||null:null};goog.ui.Component.prototype.getChildAt=function(a){return this.children_?this.children_[a]||null:null};
goog.ui.Component.prototype.forEachChild=function(a,b){this.children_&&goog.array.forEach(this.children_,a,b)};goog.ui.Component.prototype.indexOfChild=function(a){return this.children_&&a?goog.array.indexOf(this.children_,a):-1};
goog.ui.Component.prototype.removeChild=function(a,b){if(a){var c=goog.isString(a)?a:a.getId();a=this.getChild(c);c&&a&&(goog.object.remove(this.childIndex_,c),goog.array.remove(this.children_,a),b&&(a.exitDocument(),a.element_&&goog.dom.removeNode(a.element_)),a.setParent(null))}if(!a)throw Error(goog.ui.Component.Error.NOT_OUR_CHILD);return a};goog.ui.Component.prototype.removeChildAt=function(a,b){return this.removeChild(this.getChildAt(a),b)};
goog.ui.Component.prototype.removeChildren=function(a){for(;this.hasChildren();)this.removeChildAt(0,a)};goog.Timer=function(a,b){goog.events.EventTarget.call(this);this.interval_=a||1;this.timerObject_=b||goog.Timer.defaultTimerObject;this.boundTick_=goog.bind(this.tick_,this);this.last_=goog.now()};goog.inherits(goog.Timer,goog.events.EventTarget);goog.Timer.MAX_TIMEOUT_=2147483647;goog.Timer.prototype.enabled=!1;goog.Timer.defaultTimerObject=goog.global.window;goog.Timer.intervalScale=0.8;goog.Timer.prototype.timer_=null;goog.Timer.prototype.getInterval=function(){return this.interval_};
goog.Timer.prototype.setInterval=function(a){this.interval_=a;this.timer_&&this.enabled?(this.stop(),this.start()):this.timer_&&this.stop()};goog.Timer.prototype.tick_=function(){if(this.enabled){var a=goog.now()-this.last_;if(a>0&&a<this.interval_*goog.Timer.intervalScale)this.timer_=this.timerObject_.setTimeout(this.boundTick_,this.interval_-a);else if(this.dispatchTick(),this.enabled)this.timer_=this.timerObject_.setTimeout(this.boundTick_,this.interval_),this.last_=goog.now()}};
goog.Timer.prototype.dispatchTick=function(){this.dispatchEvent(goog.Timer.TICK)};goog.Timer.prototype.start=function(){this.enabled=!0;if(!this.timer_)this.timer_=this.timerObject_.setTimeout(this.boundTick_,this.interval_),this.last_=goog.now()};goog.Timer.prototype.stop=function(){this.enabled=!1;if(this.timer_)this.timerObject_.clearTimeout(this.timer_),this.timer_=null};goog.Timer.prototype.disposeInternal=function(){goog.Timer.superClass_.disposeInternal.call(this);this.stop();delete this.timerObject_};
goog.Timer.TICK="tick";goog.Timer.callOnce=function(a,b,c){if(goog.isFunction(a))c&&(a=goog.bind(a,c));else if(a&&typeof a.handleEvent=="function")a=goog.bind(a.handleEvent,a);else throw Error("Invalid listener argument");return b>goog.Timer.MAX_TIMEOUT_?-1:goog.Timer.defaultTimerObject.setTimeout(a,b||0)};goog.Timer.clear=function(a){goog.Timer.defaultTimerObject.clearTimeout(a)};goog.events.KeyCodes={MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,FF_SEMICOLON:59,QUESTION_MARK:63,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,META:91,WIN_KEY_RIGHT:92,
CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SCROLL_LOCK:145,FIRST_MEDIA_KEY:166,LAST_MEDIA_KEY:183,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,TILDE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,
BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,WIN_IME:229,PHANTOM:255};
goog.events.KeyCodes.isTextModifyingKeyEvent=function(a){if(a.altKey&&!a.ctrlKey||a.metaKey||a.keyCode>=goog.events.KeyCodes.F1&&a.keyCode<=goog.events.KeyCodes.F12)return!1;switch(a.keyCode){case goog.events.KeyCodes.ALT:case goog.events.KeyCodes.CAPS_LOCK:case goog.events.KeyCodes.CONTEXT_MENU:case goog.events.KeyCodes.CTRL:case goog.events.KeyCodes.DOWN:case goog.events.KeyCodes.END:case goog.events.KeyCodes.ESC:case goog.events.KeyCodes.HOME:case goog.events.KeyCodes.INSERT:case goog.events.KeyCodes.LEFT:case goog.events.KeyCodes.MAC_FF_META:case goog.events.KeyCodes.META:case goog.events.KeyCodes.NUMLOCK:case goog.events.KeyCodes.NUM_CENTER:case goog.events.KeyCodes.PAGE_DOWN:case goog.events.KeyCodes.PAGE_UP:case goog.events.KeyCodes.PAUSE:case goog.events.KeyCodes.PHANTOM:case goog.events.KeyCodes.PRINT_SCREEN:case goog.events.KeyCodes.RIGHT:case goog.events.KeyCodes.SCROLL_LOCK:case goog.events.KeyCodes.SHIFT:case goog.events.KeyCodes.UP:case goog.events.KeyCodes.WIN_KEY:case goog.events.KeyCodes.WIN_KEY_RIGHT:return!1;default:return a.keyCode<
goog.events.KeyCodes.FIRST_MEDIA_KEY||a.keyCode>goog.events.KeyCodes.LAST_MEDIA_KEY}};
goog.events.KeyCodes.firesKeyPressEvent=function(a,b,c,d,e){if(!goog.userAgent.IE&&(!goog.userAgent.WEBKIT||!goog.userAgent.isVersion("525")))return!0;if(goog.userAgent.MAC&&e)return goog.events.KeyCodes.isCharacterKey(a);if(e&&!d)return!1;if(!c&&(b==goog.events.KeyCodes.CTRL||b==goog.events.KeyCodes.ALT))return!1;if(goog.userAgent.IE&&d&&b==a)return!1;switch(a){case goog.events.KeyCodes.ENTER:return!(goog.userAgent.IE&&goog.userAgent.isDocumentMode(9));case goog.events.KeyCodes.ESC:return!goog.userAgent.WEBKIT}return goog.events.KeyCodes.isCharacterKey(a)};
goog.events.KeyCodes.isCharacterKey=function(a){if(a>=goog.events.KeyCodes.ZERO&&a<=goog.events.KeyCodes.NINE)return!0;if(a>=goog.events.KeyCodes.NUM_ZERO&&a<=goog.events.KeyCodes.NUM_MULTIPLY)return!0;if(a>=goog.events.KeyCodes.A&&a<=goog.events.KeyCodes.Z)return!0;if(goog.userAgent.WEBKIT&&a==0)return!0;switch(a){case goog.events.KeyCodes.SPACE:case goog.events.KeyCodes.QUESTION_MARK:case goog.events.KeyCodes.NUM_PLUS:case goog.events.KeyCodes.NUM_MINUS:case goog.events.KeyCodes.NUM_PERIOD:case goog.events.KeyCodes.NUM_DIVISION:case goog.events.KeyCodes.SEMICOLON:case goog.events.KeyCodes.FF_SEMICOLON:case goog.events.KeyCodes.DASH:case goog.events.KeyCodes.EQUALS:case goog.events.KeyCodes.COMMA:case goog.events.KeyCodes.PERIOD:case goog.events.KeyCodes.SLASH:case goog.events.KeyCodes.APOSTROPHE:case goog.events.KeyCodes.SINGLE_QUOTE:case goog.events.KeyCodes.OPEN_SQUARE_BRACKET:case goog.events.KeyCodes.BACKSLASH:case goog.events.KeyCodes.CLOSE_SQUARE_BRACKET:return!0;
default:return!1}};goog.fx.Transition=function(){};goog.fx.Transition.EventType={PLAY:"play",BEGIN:"begin",RESUME:"resume",END:"end",STOP:"stop",FINISH:"finish",PAUSE:"pause"};goog.ui.PopupBase=function(a,b){goog.events.EventTarget.call(this);this.handler_=new goog.events.EventHandler(this);this.setElement(a||null);b&&this.setType(b)};goog.inherits(goog.ui.PopupBase,goog.events.EventTarget);goog.ui.PopupBase.Type={TOGGLE_DISPLAY:"toggle_display",MOVE_OFFSCREEN:"move_offscreen"};goog.ui.PopupBase.prototype.element_=null;goog.ui.PopupBase.prototype.autoHide_=!0;goog.ui.PopupBase.prototype.autoHideRegion_=null;goog.ui.PopupBase.prototype.isVisible_=!1;
goog.ui.PopupBase.prototype.shouldHideAsync_=!1;goog.ui.PopupBase.prototype.lastShowTime_=-1;goog.ui.PopupBase.prototype.lastHideTime_=-1;goog.ui.PopupBase.prototype.hideOnEscape_=!1;goog.ui.PopupBase.prototype.enableCrossIframeDismissal_=!0;goog.ui.PopupBase.prototype.type_=goog.ui.PopupBase.Type.TOGGLE_DISPLAY;goog.ui.PopupBase.EventType={BEFORE_SHOW:"beforeshow",SHOW:"show",BEFORE_HIDE:"beforehide",HIDE:"hide"};goog.ui.PopupBase.DEBOUNCE_DELAY_MS=150;goog.ui.PopupBase.prototype.getType=function(){return this.type_};
goog.ui.PopupBase.prototype.setType=function(a){this.type_=a};goog.ui.PopupBase.prototype.shouldHideAsync=function(){return this.shouldHideAsync_};goog.ui.PopupBase.prototype.setShouldHideAsync=function(a){this.shouldHideAsync_=a};goog.ui.PopupBase.prototype.getElement=function(){return this.element_};goog.ui.PopupBase.prototype.setElement=function(a){this.ensureNotVisible_();this.element_=a};goog.ui.PopupBase.prototype.getAutoHide=function(){return this.autoHide_};
goog.ui.PopupBase.prototype.setAutoHide=function(a){this.ensureNotVisible_();this.autoHide_=a};goog.ui.PopupBase.prototype.getHideOnEscape=function(){return this.hideOnEscape_};goog.ui.PopupBase.prototype.setHideOnEscape=function(a){this.ensureNotVisible_();this.hideOnEscape_=a};goog.ui.PopupBase.prototype.getEnableCrossIframeDismissal=function(){return this.enableCrossIframeDismissal_};goog.ui.PopupBase.prototype.setEnableCrossIframeDismissal=function(a){this.enableCrossIframeDismissal_=a};
goog.ui.PopupBase.prototype.getAutoHideRegion=function(){return this.autoHideRegion_};goog.ui.PopupBase.prototype.setAutoHideRegion=function(a){this.autoHideRegion_=a};goog.ui.PopupBase.prototype.setTransition=function(a,b){this.showTransition_=a;this.hideTransition_=b};goog.ui.PopupBase.prototype.getLastShowTime=function(){return this.lastShowTime_};goog.ui.PopupBase.prototype.getLastHideTime=function(){return this.lastHideTime_};
goog.ui.PopupBase.prototype.ensureNotVisible_=function(){if(this.isVisible_)throw Error("Can not change this state of the popup while showing.");};goog.ui.PopupBase.prototype.isVisible=function(){return this.isVisible_};goog.ui.PopupBase.prototype.isOrWasRecentlyVisible=function(){return this.isVisible_||goog.now()-this.lastHideTime_<goog.ui.PopupBase.DEBOUNCE_DELAY_MS};
goog.ui.PopupBase.prototype.setVisible=function(a){this.showTransition_&&this.showTransition_.stop();this.hideTransition_&&this.hideTransition_.stop();a?this.show_():this.hide_()};goog.ui.PopupBase.prototype.reposition=goog.nullFunction;
goog.ui.PopupBase.prototype.show_=function(){if(!this.isVisible_&&this.onBeforeShow()){if(!this.element_)throw Error("Caller must call setElement before trying to show the popup");this.reposition();var a=goog.dom.getOwnerDocument(this.element_);this.hideOnEscape_&&this.handler_.listen(a,goog.events.EventType.KEYDOWN,this.onDocumentKeyDown_,!0);if(this.autoHide_)if(this.handler_.listen(a,goog.events.EventType.MOUSEDOWN,this.onDocumentMouseDown_,!0),goog.userAgent.IE){var b;try{b=a.activeElement}catch(c){}for(;b&&
b.nodeName=="IFRAME";){try{var d=goog.dom.getFrameContentDocument(b)}catch(e){break}a=d;b=a.activeElement}this.handler_.listen(a,goog.events.EventType.MOUSEDOWN,this.onDocumentMouseDown_,!0);this.handler_.listen(a,goog.events.EventType.DEACTIVATE,this.onDocumentBlur_)}else this.handler_.listen(a,goog.events.EventType.BLUR,this.onDocumentBlur_);this.type_==goog.ui.PopupBase.Type.TOGGLE_DISPLAY?this.showPopupElement():this.type_==goog.ui.PopupBase.Type.MOVE_OFFSCREEN&&this.reposition();this.isVisible_=
!0;if(this.showTransition_)goog.events.listenOnce(this.showTransition_,goog.fx.Transition.EventType.END,this.onShow_,!1,this),this.showTransition_.play();else this.onShow_()}};
goog.ui.PopupBase.prototype.hide_=function(a){if(!this.isVisible_||!this.onBeforeHide_(a))return!1;this.handler_&&this.handler_.removeAll();this.hideTransition_?(goog.events.listenOnce(this.hideTransition_,goog.fx.Transition.EventType.END,goog.partial(this.continueHidingPopup_,a),!1,this),this.hideTransition_.play()):this.continueHidingPopup_(a);return!0};
goog.ui.PopupBase.prototype.continueHidingPopup_=function(a){this.type_==goog.ui.PopupBase.Type.TOGGLE_DISPLAY?this.shouldHideAsync_?goog.Timer.callOnce(this.hidePopupElement_,0,this):this.hidePopupElement_():this.type_==goog.ui.PopupBase.Type.MOVE_OFFSCREEN&&this.moveOffscreen_();this.isVisible_=!1;this.onHide_(a)};goog.ui.PopupBase.prototype.showPopupElement=function(){this.element_.style.visibility="visible";goog.style.showElement(this.element_,!0)};
goog.ui.PopupBase.prototype.hidePopupElement_=function(){this.element_.style.visibility="hidden";goog.style.showElement(this.element_,!1)};goog.ui.PopupBase.prototype.moveOffscreen_=function(){this.element_.style.left="-200px";this.element_.style.top="-200px"};goog.ui.PopupBase.prototype.onBeforeShow=function(){return this.dispatchEvent(goog.ui.PopupBase.EventType.BEFORE_SHOW)};goog.ui.PopupBase.prototype.onShow_=function(){this.lastShowTime_=goog.now();this.lastHideTime_=-1;this.dispatchEvent(goog.ui.PopupBase.EventType.SHOW)};
goog.ui.PopupBase.prototype.onBeforeHide_=function(a){return this.dispatchEvent({type:goog.ui.PopupBase.EventType.BEFORE_HIDE,target:a})};goog.ui.PopupBase.prototype.onHide_=function(a){this.lastHideTime_=goog.now();this.dispatchEvent({type:goog.ui.PopupBase.EventType.HIDE,target:a})};goog.ui.PopupBase.prototype.onDocumentMouseDown_=function(a){a=a.target;!goog.dom.contains(this.element_,a)&&(!this.autoHideRegion_||goog.dom.contains(this.autoHideRegion_,a))&&!this.shouldDebounce_()&&this.hide_(a)};
goog.ui.PopupBase.prototype.onDocumentKeyDown_=function(a){a.keyCode==goog.events.KeyCodes.ESC&&this.hide_(a.target)&&(a.preventDefault(),a.stopPropagation())};goog.ui.PopupBase.prototype.onDocumentBlur_=function(a){if(this.enableCrossIframeDismissal_){var b=goog.dom.getOwnerDocument(this.element_);if(goog.userAgent.IE||goog.userAgent.OPERA){if(a=b.activeElement,!a||goog.dom.contains(this.element_,a)||a.tagName=="BODY")return}else if(a.target!=b)return;this.shouldDebounce_()||this.hide_()}};
goog.ui.PopupBase.prototype.shouldDebounce_=function(){return goog.now()-this.lastShowTime_<goog.ui.PopupBase.DEBOUNCE_DELAY_MS};goog.ui.PopupBase.prototype.disposeInternal=function(){goog.ui.PopupBase.superClass_.disposeInternal.call(this);this.handler_.dispose();goog.dispose(this.showTransition_);goog.dispose(this.hideTransition_);delete this.element_;delete this.handler_};goog.events.FocusHandler=function(a){goog.events.EventTarget.call(this);this.element_=a;a=goog.userAgent.IE?"focusout":"blur";this.listenKeyIn_=goog.events.listen(this.element_,goog.userAgent.IE?"focusin":"focus",this,!goog.userAgent.IE);this.listenKeyOut_=goog.events.listen(this.element_,a,this,!goog.userAgent.IE)};goog.inherits(goog.events.FocusHandler,goog.events.EventTarget);goog.events.FocusHandler.EventType={FOCUSIN:"focusin",FOCUSOUT:"focusout"};
goog.events.FocusHandler.prototype.handleEvent=function(a){var b=a.getBrowserEvent();b=new goog.events.BrowserEvent(b);b.type=a.type=="focusin"||a.type=="focus"?goog.events.FocusHandler.EventType.FOCUSIN:goog.events.FocusHandler.EventType.FOCUSOUT;try{this.dispatchEvent(b)}finally{b.dispose()}};
goog.events.FocusHandler.prototype.disposeInternal=function(){goog.events.FocusHandler.superClass_.disposeInternal.call(this);goog.events.unlistenByKey(this.listenKeyIn_);goog.events.unlistenByKey(this.listenKeyOut_);delete this.element_};goog.dom.iframe={};goog.dom.iframe.BLANK_SOURCE='javascript:""';goog.dom.iframe.STYLES_="border:0;vertical-align:bottom;";goog.dom.iframe.createBlank=function(a,b){return a.createDom("iframe",{frameborder:0,style:goog.dom.iframe.STYLES_+(b||""),src:goog.dom.iframe.BLANK_SOURCE})};goog.dom.iframe.writeContent=function(a,b){var c=goog.dom.getFrameContentDocument(a);c.open();c.write(b);c.close()};
goog.dom.iframe.createWithContent=function(a,b,c,d,e){var f=goog.dom.getDomHelper(a),g=[];e||g.push("<!DOCTYPE html>");g.push("<html><head>",b,"</head><body>",c,"</body></html>");b=goog.dom.iframe.createBlank(f,d);a.appendChild(b);goog.dom.iframe.writeContent(b,g.join(""));return b};goog.ui.ModalPopup=function(a,b){goog.ui.Component.call(this,b);this.useIframeMask_=!!a};goog.inherits(goog.ui.ModalPopup,goog.ui.Component);goog.ui.ModalPopup.prototype.focusHandler_=null;goog.ui.ModalPopup.prototype.visible_=!1;goog.ui.ModalPopup.prototype.bgEl_=null;goog.ui.ModalPopup.prototype.bgIframeEl_=null;goog.ui.ModalPopup.prototype.tabCatcherElement_=null;goog.ui.ModalPopup.prototype.getCssClass=function(){return"goog-modalpopup"};goog.ui.ModalPopup.prototype.getBackgroundIframe=function(){return this.bgIframeEl_};
goog.ui.ModalPopup.prototype.getBackgroundElement=function(){return this.bgEl_};goog.ui.ModalPopup.prototype.createDom=function(){goog.ui.ModalPopup.superClass_.createDom.call(this);var a=this.getElement();goog.dom.classes.add(a,this.getCssClass());goog.dom.setFocusableTabIndex(a,!0);goog.style.showElement(a,!1);this.manageBackgroundDom_();this.createTabCatcher_()};
goog.ui.ModalPopup.prototype.manageBackgroundDom_=function(){if(this.useIframeMask_&&!this.bgIframeEl_)this.bgIframeEl_=goog.dom.iframe.createBlank(this.getDomHelper()),this.bgIframeEl_.className=this.getCssClass()+"-bg",goog.style.showElement(this.bgIframeEl_,!1),goog.style.setOpacity(this.bgIframeEl_,0);if(!this.bgEl_)this.bgEl_=this.getDomHelper().createDom("div",this.getCssClass()+"-bg"),goog.style.showElement(this.bgEl_,!1)};
goog.ui.ModalPopup.prototype.createTabCatcher_=function(){if(!this.tabCatcherElement_)this.tabCatcherElement_=this.getDomHelper().createElement("span"),goog.style.showElement(this.tabCatcherElement_,!1),goog.dom.setFocusableTabIndex(this.tabCatcherElement_,!0),this.tabCatcherElement_.style.position="absolute"};
goog.ui.ModalPopup.prototype.renderBackground_=function(){goog.asserts.assert(!!this.bgEl_,"Background element must not be null.");this.bgIframeEl_&&goog.dom.insertSiblingBefore(this.bgIframeEl_,this.getElement());goog.dom.insertSiblingBefore(this.bgEl_,this.getElement())};goog.ui.ModalPopup.prototype.canDecorate=function(a){return!!a&&a.tagName==goog.dom.TagName.DIV};
goog.ui.ModalPopup.prototype.decorateInternal=function(a){goog.ui.ModalPopup.superClass_.decorateInternal.call(this,a);goog.dom.classes.add(this.getElement(),this.getCssClass());this.manageBackgroundDom_();this.createTabCatcher_();goog.style.showElement(this.getElement(),!1)};
goog.ui.ModalPopup.prototype.enterDocument=function(){this.renderBackground_();goog.ui.ModalPopup.superClass_.enterDocument.call(this);goog.dom.insertSiblingAfter(this.tabCatcherElement_,this.getElement());this.focusHandler_=new goog.events.FocusHandler(this.getDomHelper().getDocument());this.getHandler().listen(this.focusHandler_,goog.events.FocusHandler.EventType.FOCUSIN,this.onFocus_)};
goog.ui.ModalPopup.prototype.exitDocument=function(){this.isVisible()&&this.setVisible(!1);goog.dispose(this.focusHandler_);goog.ui.ModalPopup.superClass_.exitDocument.call(this);goog.dom.removeNode(this.bgIframeEl_);goog.dom.removeNode(this.bgEl_);goog.dom.removeNode(this.tabCatcherElement_)};goog.ui.ModalPopup.prototype.setVisible=function(a){goog.asserts.assert(this.isInDocument(),"ModalPopup must be rendered first.");a!=this.visible_&&(a?this.show_():this.hide_())};
goog.ui.ModalPopup.prototype.show_=function(){if(this.dispatchEvent(goog.ui.PopupBase.EventType.BEFORE_SHOW))this.resizeBackground_(),this.reposition(),this.getHandler().listen(this.getDomHelper().getWindow(),goog.events.EventType.RESIZE,this.resizeBackground_),this.showPopupElement_(!0),this.focus(),this.visible_=!0,this.dispatchEvent(goog.ui.PopupBase.EventType.SHOW)};
goog.ui.ModalPopup.prototype.hide_=function(){if(this.dispatchEvent(goog.ui.PopupBase.EventType.BEFORE_HIDE))this.getHandler().unlisten(this.getDomHelper().getWindow(),goog.events.EventType.RESIZE,this.resizeBackground_),this.showPopupElement_(!1),this.visible_=!1,this.dispatchEvent(goog.ui.PopupBase.EventType.HIDE)};
goog.ui.ModalPopup.prototype.showPopupElement_=function(a){this.bgIframeEl_&&goog.style.showElement(this.bgIframeEl_,a);this.bgEl_&&goog.style.showElement(this.bgEl_,a);goog.style.showElement(this.getElement(),a);goog.style.showElement(this.tabCatcherElement_,a)};goog.ui.ModalPopup.prototype.isVisible=function(){return this.visible_};goog.ui.ModalPopup.prototype.focus=function(){this.focusElement_()};
goog.ui.ModalPopup.prototype.resizeBackground_=function(){this.bgIframeEl_&&goog.style.showElement(this.bgIframeEl_,!1);this.bgEl_&&goog.style.showElement(this.bgEl_,!1);var a=this.getDomHelper().getDocument(),b=goog.dom.getWindow(a)||window,c=goog.dom.getViewportSize(b);b=Math.max(a.body.scrollWidth,c.width);a=Math.max(a.body.scrollHeight,c.height);this.bgIframeEl_&&(goog.style.showElement(this.bgIframeEl_,!0),goog.style.setSize(this.bgIframeEl_,b,a));this.bgEl_&&(goog.style.showElement(this.bgEl_,
!0),goog.style.setSize(this.bgEl_,b,a))};
goog.ui.ModalPopup.prototype.reposition=function(){var a=this.getDomHelper().getDocument(),b=goog.dom.getWindow(a)||window;if(goog.style.getComputedPosition(this.getElement())=="fixed")var c=a=0;else c=this.getDomHelper().getDocumentScroll(),a=c.x,c=c.y;var d=goog.style.getSize(this.getElement());b=goog.dom.getViewportSize(b);a=Math.max(a+b.width/2-d.width/2,0);c=Math.max(c+b.height/2-d.height/2,0);goog.style.setPosition(this.getElement(),a,c);goog.style.setPosition(this.tabCatcherElement_,a,c)};
goog.ui.ModalPopup.prototype.onFocus_=function(a){a.target==this.tabCatcherElement_&&goog.Timer.callOnce(this.focusElement_,0,this)};goog.ui.ModalPopup.prototype.focusElement_=function(){try{goog.userAgent.IE&&this.getDomHelper().getDocument().body.focus(),this.getElement().focus()}catch(a){}};goog.iter={};goog.iter.StopIteration="StopIteration"in goog.global?goog.global.StopIteration:Error("StopIteration");goog.iter.Iterator=function(){};goog.iter.Iterator.prototype.next=function(){throw goog.iter.StopIteration;};goog.iter.Iterator.prototype.__iterator__=function(){return this};
goog.iter.toIterator=function(a){if(a instanceof goog.iter.Iterator)return a;if(typeof a.__iterator__=="function")return a.__iterator__(!1);if(goog.isArrayLike(a)){var b=0,c=new goog.iter.Iterator;c.next=function(){for(;;){if(b>=a.length)throw goog.iter.StopIteration;if(b in a)return a[b++];else b++}};return c}throw Error("Not implemented");};
goog.iter.forEach=function(a,b,c){if(goog.isArrayLike(a))try{goog.array.forEach(a,b,c)}catch(d){if(d!==goog.iter.StopIteration)throw d;}else{a=goog.iter.toIterator(a);try{for(;;)b.call(c,a.next(),void 0,a)}catch(e){if(e!==goog.iter.StopIteration)throw e;}}};goog.iter.filter=function(a,b,c){a=goog.iter.toIterator(a);var d=new goog.iter.Iterator;d.next=function(){for(;;){var d=a.next();if(b.call(c,d,void 0,a))return d}};return d};
goog.iter.range=function(a,b,c){var d=0,e=a,f=c||1;arguments.length>1&&(d=a,e=b);if(f==0)throw Error("Range step argument must not be zero");var g=new goog.iter.Iterator;g.next=function(){if(f>0&&d>=e||f<0&&d<=e)throw goog.iter.StopIteration;var a=d;d+=f;return a};return g};goog.iter.join=function(a,b){return goog.iter.toArray(a).join(b)};goog.iter.map=function(a,b,c){a=goog.iter.toIterator(a);var d=new goog.iter.Iterator;d.next=function(){for(;;){var d=a.next();return b.call(c,d,void 0,a)}};return d};
goog.iter.reduce=function(a,b,c,d){var e=c;goog.iter.forEach(a,function(a){e=b.call(d,e,a)});return e};goog.iter.some=function(a,b,c){a=goog.iter.toIterator(a);try{for(;;)if(b.call(c,a.next(),void 0,a))return!0}catch(d){if(d!==goog.iter.StopIteration)throw d;}return!1};goog.iter.every=function(a,b,c){a=goog.iter.toIterator(a);try{for(;;)if(!b.call(c,a.next(),void 0,a))return!1}catch(d){if(d!==goog.iter.StopIteration)throw d;}return!0};
goog.iter.chain=function(){var a=arguments,b=a.length,c=0,d=new goog.iter.Iterator;d.next=function(){try{if(c>=b)throw goog.iter.StopIteration;return goog.iter.toIterator(a[c]).next()}catch(d){if(d!==goog.iter.StopIteration||c>=b)throw d;else return c++,this.next()}};return d};goog.iter.dropWhile=function(a,b,c){a=goog.iter.toIterator(a);var d=new goog.iter.Iterator,e=!0;d.next=function(){for(;;){var d=a.next();if(!e||!b.call(c,d,void 0,a))return e=!1,d}};return d};
goog.iter.takeWhile=function(a,b,c){a=goog.iter.toIterator(a);var d=new goog.iter.Iterator,e=!0;d.next=function(){for(;;)if(e){var d=a.next();if(b.call(c,d,void 0,a))return d;else e=!1}else throw goog.iter.StopIteration;};return d};goog.iter.toArray=function(a){if(goog.isArrayLike(a))return goog.array.toArray(a);a=goog.iter.toIterator(a);var b=[];goog.iter.forEach(a,function(a){b.push(a)});return b};
goog.iter.equals=function(a,b){a=goog.iter.toIterator(a);b=goog.iter.toIterator(b);var c,d;try{for(;;){c=d=!1;var e=a.next();c=!0;var f=b.next();d=!0;if(e!=f)break}}catch(g){if(g!==goog.iter.StopIteration)throw g;else{if(c&&!d)return!1;if(!d)try{b.next()}catch(h){if(h!==goog.iter.StopIteration)throw h;return!0}}}return!1};goog.iter.nextOrValue=function(a,b){try{return goog.iter.toIterator(a).next()}catch(c){if(c!=goog.iter.StopIteration)throw c;return b}};
goog.iter.product=function(){if(goog.array.some(arguments,function(a){return!a.length})||!arguments.length)return new goog.iter.Iterator;var a=new goog.iter.Iterator,b=arguments,c=goog.array.repeat(0,b.length);a.next=function(){if(c){for(var a=goog.array.map(c,function(a,c){return b[c][a]}),e=c.length-1;e>=0;e--){goog.asserts.assert(c);if(c[e]<b[e].length-1){c[e]++;break}if(e==0){c=null;break}c[e]=0}return a}throw goog.iter.StopIteration;};return a};
goog.iter.cycle=function(a){var b=goog.iter.toIterator(a),c=[],d=0;a=new goog.iter.Iterator;var e=!1;a.next=function(){var a=null;if(!e)try{return a=b.next(),c.push(a),a}catch(g){if(g!=goog.iter.StopIteration||goog.array.isEmpty(c))throw g;e=!0}a=c[d];d=(d+1)%c.length;return a};return a};goog.structs={};goog.structs.getCount=function(a){if(typeof a.getCount=="function")return a.getCount();if(goog.isArrayLike(a)||goog.isString(a))return a.length;return goog.object.getCount(a)};goog.structs.getValues=function(a){if(typeof a.getValues=="function")return a.getValues();if(goog.isString(a))return a.split("");if(goog.isArrayLike(a)){for(var b=[],c=a.length,d=0;d<c;d++)b.push(a[d]);return b}return goog.object.getValues(a)};
goog.structs.getKeys=function(a){if(typeof a.getKeys=="function")return a.getKeys();if(typeof a.getValues!="function"){if(goog.isArrayLike(a)||goog.isString(a)){var b=[];a=a.length;for(var c=0;c<a;c++)b.push(c);return b}return goog.object.getKeys(a)}};
goog.structs.contains=function(a,b){if(typeof a.contains=="function")return a.contains(b);if(typeof a.containsValue=="function")return a.containsValue(b);if(goog.isArrayLike(a)||goog.isString(a))return goog.array.contains(a,b);return goog.object.containsValue(a,b)};goog.structs.isEmpty=function(a){if(typeof a.isEmpty=="function")return a.isEmpty();if(goog.isArrayLike(a)||goog.isString(a))return goog.array.isEmpty(a);return goog.object.isEmpty(a)};
goog.structs.clear=function(a){typeof a.clear=="function"?a.clear():goog.isArrayLike(a)?goog.array.clear(a):goog.object.clear(a)};goog.structs.forEach=function(a,b,c){if(typeof a.forEach=="function")a.forEach(b,c);else if(goog.isArrayLike(a)||goog.isString(a))goog.array.forEach(a,b,c);else for(var d=goog.structs.getKeys(a),e=goog.structs.getValues(a),f=e.length,g=0;g<f;g++)b.call(c,e[g],d&&d[g],a)};
goog.structs.filter=function(a,b,c){if(typeof a.filter=="function")return a.filter(b,c);if(goog.isArrayLike(a)||goog.isString(a))return goog.array.filter(a,b,c);var d,e=goog.structs.getKeys(a),f=goog.structs.getValues(a),g=f.length;if(e){d={};for(var h=0;h<g;h++)b.call(c,f[h],e[h],a)&&(d[e[h]]=f[h])}else{d=[];for(h=0;h<g;h++)b.call(c,f[h],void 0,a)&&d.push(f[h])}return d};
goog.structs.map=function(a,b,c){if(typeof a.map=="function")return a.map(b,c);if(goog.isArrayLike(a)||goog.isString(a))return goog.array.map(a,b,c);var d,e=goog.structs.getKeys(a),f=goog.structs.getValues(a),g=f.length;if(e){d={};for(var h=0;h<g;h++)d[e[h]]=b.call(c,f[h],e[h],a)}else{d=[];for(h=0;h<g;h++)d[h]=b.call(c,f[h],void 0,a)}return d};
goog.structs.some=function(a,b,c){if(typeof a.some=="function")return a.some(b,c);if(goog.isArrayLike(a)||goog.isString(a))return goog.array.some(a,b,c);for(var d=goog.structs.getKeys(a),e=goog.structs.getValues(a),f=e.length,g=0;g<f;g++)if(b.call(c,e[g],d&&d[g],a))return!0;return!1};
goog.structs.every=function(a,b,c){if(typeof a.every=="function")return a.every(b,c);if(goog.isArrayLike(a)||goog.isString(a))return goog.array.every(a,b,c);for(var d=goog.structs.getKeys(a),e=goog.structs.getValues(a),f=e.length,g=0;g<f;g++)if(!b.call(c,e[g],d&&d[g],a))return!1;return!0};goog.structs.Map=function(a){this.map_={};this.keys_=[];var b=arguments.length;if(b>1){if(b%2)throw Error("Uneven number of arguments");for(var c=0;c<b;c+=2)this.set(arguments[c],arguments[c+1])}else a&&this.addAll(a)};goog.structs.Map.prototype.count_=0;goog.structs.Map.prototype.version_=0;goog.structs.Map.prototype.getCount=function(){return this.count_};
goog.structs.Map.prototype.getValues=function(){this.cleanupKeysArray_();for(var a=[],b=0;b<this.keys_.length;b++)a.push(this.map_[this.keys_[b]]);return a};goog.structs.Map.prototype.getKeys=function(){this.cleanupKeysArray_();return this.keys_.concat()};goog.structs.Map.prototype.containsKey=function(a){return goog.structs.Map.hasKey_(this.map_,a)};
goog.structs.Map.prototype.containsValue=function(a){for(var b=0;b<this.keys_.length;b++){var c=this.keys_[b];if(goog.structs.Map.hasKey_(this.map_,c)&&this.map_[c]==a)return!0}return!1};goog.structs.Map.prototype.equals=function(a,b){if(this===a)return!0;if(this.count_!=a.getCount())return!1;var c=b||goog.structs.Map.defaultEquals;this.cleanupKeysArray_();for(var d,e=0;d=this.keys_[e];e++)if(!c(this.get(d),a.get(d)))return!1;return!0};goog.structs.Map.defaultEquals=function(a,b){return a===b};
goog.structs.Map.prototype.isEmpty=function(){return this.count_==0};goog.structs.Map.prototype.clear=function(){this.map_={};this.version_=this.count_=this.keys_.length=0};goog.structs.Map.prototype.remove=function(a){if(goog.structs.Map.hasKey_(this.map_,a))return delete this.map_[a],this.count_--,this.version_++,this.keys_.length>2*this.count_&&this.cleanupKeysArray_(),!0;return!1};
goog.structs.Map.prototype.cleanupKeysArray_=function(){if(this.count_!=this.keys_.length){for(var a=0,b=0;a<this.keys_.length;){var c=this.keys_[a];goog.structs.Map.hasKey_(this.map_,c)&&(this.keys_[b++]=c);a++}this.keys_.length=b}if(this.count_!=this.keys_.length){var d={};for(b=a=0;a<this.keys_.length;)c=this.keys_[a],goog.structs.Map.hasKey_(d,c)||(this.keys_[b++]=c,d[c]=1),a++;this.keys_.length=b}};
goog.structs.Map.prototype.get=function(a,b){if(goog.structs.Map.hasKey_(this.map_,a))return this.map_[a];return b};goog.structs.Map.prototype.set=function(a,b){goog.structs.Map.hasKey_(this.map_,a)||(this.count_++,this.keys_.push(a),this.version_++);this.map_[a]=b};goog.structs.Map.prototype.addAll=function(a){var b;a instanceof goog.structs.Map?(b=a.getKeys(),a=a.getValues()):(b=goog.object.getKeys(a),a=goog.object.getValues(a));for(var c=0;c<b.length;c++)this.set(b[c],a[c])};
goog.structs.Map.prototype.clone=function(){return new goog.structs.Map(this)};goog.structs.Map.prototype.transpose=function(){for(var a=new goog.structs.Map,b=0;b<this.keys_.length;b++){var c=this.keys_[b];a.set(this.map_[c],c)}return a};goog.structs.Map.prototype.toObject=function(){this.cleanupKeysArray_();for(var a={},b=0;b<this.keys_.length;b++){var c=this.keys_[b];a[c]=this.map_[c]}return a};goog.structs.Map.prototype.getKeyIterator=function(){return this.__iterator__(!0)};
goog.structs.Map.prototype.getValueIterator=function(){return this.__iterator__(!1)};goog.structs.Map.prototype.__iterator__=function(a){this.cleanupKeysArray_();var b=0,c=this.keys_,d=this.map_,e=this.version_,f=this,g=new goog.iter.Iterator;g.next=function(){for(;;){if(e!=f.version_)throw Error("The map has changed since the iterator was created");if(b>=c.length)throw goog.iter.StopIteration;var g=c[b++];return a?g:d[g]}};return g};
goog.structs.Map.hasKey_=function(a,b){return Object.prototype.hasOwnProperty.call(a,b)};goog.dom.a11y={};
goog.dom.a11y.State={ACTIVEDESCENDANT:"activedescendant",ATOMIC:"atomic",AUTOCOMPLETE:"autocomplete",BUSY:"busy",CHECKED:"checked",CONTROLS:"controls",DESCRIBEDBY:"describedby",DISABLED:"disabled",DROPEFFECT:"dropeffect",EXPANDED:"expanded",FLOWTO:"flowto",GRABBED:"grabbed",HASPOPUP:"haspopup",HIDDEN:"hidden",INVALID:"invalid",LABEL:"label",LABELLEDBY:"labelledby",LEVEL:"level",LIVE:"live",MULTILINE:"multiline",MULTISELECTABLE:"multiselectable",ORIENTATION:"orientation",OWNS:"owns",POSINSET:"posinset",
PRESSED:"pressed",READONLY:"readonly",RELEVANT:"relevant",REQUIRED:"required",SELECTED:"selected",SETSIZE:"setsize",SORT:"sort",VALUEMAX:"valuemax",VALUEMIN:"valuemin",VALUENOW:"valuenow",VALUETEXT:"valuetext"};
goog.dom.a11y.Role={ALERT:"alert",ALERTDIALOG:"alertdialog",APPLICATION:"application",ARTICLE:"article",BANNER:"banner",BUTTON:"button",CHECKBOX:"checkbox",COLUMNHEADER:"columnheader",COMBOBOX:"combobox",COMPLEMENTARY:"complementary",DIALOG:"dialog",DIRECTORY:"directory",DOCUMENT:"document",FORM:"form",GRID:"grid",GRIDCELL:"gridcell",GROUP:"group",HEADING:"heading",IMG:"img",LINK:"link",LIST:"list",LISTBOX:"listbox",LISTITEM:"listitem",LOG:"log",MAIN:"main",MARQUEE:"marquee",MATH:"math",MENU:"menu",
MENUBAR:"menubar",MENU_ITEM:"menuitem",MENU_ITEM_CHECKBOX:"menuitemcheckbox",MENU_ITEM_RADIO:"menuitemradio",NAVIGATION:"navigation",NOTE:"note",OPTION:"option",PRESENTATION:"presentation",PROGRESSBAR:"progressbar",RADIO:"radio",RADIOGROUP:"radiogroup",REGION:"region",ROW:"row",ROWGROUP:"rowgroup",ROWHEADER:"rowheader",SCROLLBAR:"scrollbar",SEARCH:"search",SEPARATOR:"separator",SLIDER:"slider",SPINBUTTON:"spinbutton",STATUS:"status",TAB:"tab",TAB_LIST:"tablist",TAB_PANEL:"tabpanel",TEXTBOX:"textbox",
TIMER:"timer",TOOLBAR:"toolbar",TOOLTIP:"tooltip",TREE:"tree",TREEGRID:"treegrid",TREEITEM:"treeitem"};goog.dom.a11y.LivePriority={OFF:"off",POLITE:"polite",ASSERTIVE:"assertive"};goog.dom.a11y.setRole=function(a,b){a.setAttribute("role",b);a.roleName=b};goog.dom.a11y.getRole=function(a){return a.roleName||""};goog.dom.a11y.setState=function(a,b,c){a.setAttribute("aria-"+b,c)};goog.dom.a11y.getState=function(a,b){var c=a.getAttribute("aria-"+b);return c===!0||c===!1?c?"true":"false":c?String(c):""};
goog.dom.a11y.getActiveDescendant=function(a){var b=goog.dom.a11y.getState(a,goog.dom.a11y.State.ACTIVEDESCENDANT);return goog.dom.getOwnerDocument(a).getElementById(b)};goog.dom.a11y.setActiveDescendant=function(a,b){goog.dom.a11y.setState(a,goog.dom.a11y.State.ACTIVEDESCENDANT,b?b.id:"")};goog.dom.a11y.Announcer=function(a){goog.Disposable.call(this);this.domHelper_=a;this.liveRegions_={}};goog.inherits(goog.dom.a11y.Announcer,goog.Disposable);
goog.dom.a11y.Announcer.prototype.disposeInternal=function(){goog.object.forEach(this.liveRegions_,this.domHelper_.removeNode,this.domHelper_);this.domHelper_=this.liveRegions_=null;goog.dom.a11y.Announcer.superClass_.disposeInternal.call(this)};goog.dom.a11y.Announcer.prototype.say=function(a,b){goog.dom.setTextContent(this.getLiveRegion_(b||goog.dom.a11y.LivePriority.POLITE),a)};
goog.dom.a11y.Announcer.prototype.getLiveRegion_=function(a){if(this.liveRegions_[a])return this.liveRegions_[a];var b;b=this.domHelper_.createElement("div");b.style.position="absolute";b.style.top="-1000px";goog.dom.a11y.setState(b,"live",a);goog.dom.a11y.setState(b,"atomic","true");this.domHelper_.getDocument().body.appendChild(b);return this.liveRegions_[a]=b};goog.ui.Dialog=function(a,b,c){goog.ui.ModalPopup.call(this,b,c);this.class_=a||"modal-dialog";this.buttons_=goog.ui.Dialog.ButtonSet.createOkCancel()};goog.inherits(goog.ui.Dialog,goog.ui.ModalPopup);goog.ui.Dialog.prototype.escapeToCancel_=!0;goog.ui.Dialog.prototype.hasTitleCloseButton_=!0;goog.ui.Dialog.prototype.modal_=!0;goog.ui.Dialog.prototype.draggable_=!0;goog.ui.Dialog.prototype.backgroundElementOpacity_=0.5;goog.ui.Dialog.prototype.title_="";goog.ui.Dialog.prototype.content_="";
goog.ui.Dialog.prototype.dragger_=null;goog.ui.Dialog.prototype.disposeOnHide_=!1;goog.ui.Dialog.prototype.titleEl_=null;goog.ui.Dialog.prototype.titleTextEl_=null;goog.ui.Dialog.prototype.titleId_=null;goog.ui.Dialog.prototype.titleCloseEl_=null;goog.ui.Dialog.prototype.contentEl_=null;goog.ui.Dialog.prototype.buttonEl_=null;goog.ui.Dialog.prototype.getCssClass=function(){return this.class_};
goog.ui.Dialog.prototype.setTitle=function(a){this.title_=a;this.titleTextEl_&&goog.dom.setTextContent(this.titleTextEl_,a)};goog.ui.Dialog.prototype.getTitle=function(){return this.title_};goog.ui.Dialog.prototype.setContent=function(a){this.content_=a;if(this.contentEl_)this.contentEl_.innerHTML=a};goog.ui.Dialog.prototype.getContent=function(){return this.content_};goog.ui.Dialog.prototype.renderIfNoDom_=function(){this.getElement()||this.render()};
goog.ui.Dialog.prototype.getContentElement=function(){this.renderIfNoDom_();return this.contentEl_};goog.ui.Dialog.prototype.getTitleElement=function(){this.renderIfNoDom_();return this.titleEl_};goog.ui.Dialog.prototype.getTitleTextElement=function(){this.renderIfNoDom_();return this.titleTextEl_};goog.ui.Dialog.prototype.getTitleCloseElement=function(){this.renderIfNoDom_();return this.titleCloseEl_};goog.ui.Dialog.prototype.getButtonElement=function(){this.renderIfNoDom_();return this.buttonEl_};
goog.ui.Dialog.prototype.getDialogElement=function(){this.renderIfNoDom_();return this.getElement()};goog.ui.Dialog.prototype.getBackgroundElement=function(){this.renderIfNoDom_();return goog.ui.Dialog.superClass_.getBackgroundElement.call(this)};goog.ui.Dialog.prototype.getBackgroundElementOpacity=function(){return this.backgroundElementOpacity_};
goog.ui.Dialog.prototype.setBackgroundElementOpacity=function(a){this.backgroundElementOpacity_=a;this.getElement()&&(a=this.getBackgroundElement())&&goog.style.setOpacity(a,this.backgroundElementOpacity_)};goog.ui.Dialog.prototype.setModal=function(a){a!=this.modal_&&this.setModalInternal_(a)};
goog.ui.Dialog.prototype.setModalInternal_=function(a){this.modal_=a;if(this.isInDocument()){var b=this.getDomHelper(),c=this.getBackgroundElement(),d=this.getBackgroundIframe();a?(d&&b.insertSiblingBefore(d,this.getElement()),b.insertSiblingBefore(c,this.getElement())):(b.removeNode(d),b.removeNode(c))}};goog.ui.Dialog.prototype.getModal=function(){return this.modal_};goog.ui.Dialog.prototype.getClass=function(){return this.getCssClass()};
goog.ui.Dialog.prototype.setDraggable=function(a){this.draggable_=a;this.setDraggingEnabled_(a&&this.isInDocument())};goog.ui.Dialog.prototype.createDragger=function(){return new goog.fx.Dragger(this.getElement(),this.titleEl_)};goog.ui.Dialog.prototype.getDraggable=function(){return this.draggable_};
goog.ui.Dialog.prototype.setDraggingEnabled_=function(a){this.getElement()&&goog.dom.classes.enable(this.titleEl_,this.class_+"-title-draggable",a);if(a&&!this.dragger_)this.dragger_=this.createDragger(),goog.dom.classes.add(this.titleEl_,this.class_+"-title-draggable"),goog.events.listen(this.dragger_,goog.fx.Dragger.EventType.START,this.setDraggerLimits_,!1,this);else if(!a&&this.dragger_)this.dragger_.dispose(),this.dragger_=null};
goog.ui.Dialog.prototype.createDom=function(){goog.ui.Dialog.superClass_.createDom.call(this);var a=this.getElement();goog.asserts.assert(a,"getElement() returns null");var b=this.getDomHelper();this.titleEl_=b.createDom("div",{className:this.class_+"-title",id:this.getId()},this.titleTextEl_=b.createDom("span",this.class_+"-title-text",this.title_),this.titleCloseEl_=b.createDom("span",this.class_+"-title-close"));goog.dom.append(a,this.titleEl_,this.contentEl_=b.createDom("div",this.class_+"-content"),
this.buttonEl_=b.createDom("div",this.class_+"-buttons"));this.titleId_=this.titleEl_.id;goog.dom.a11y.setRole(a,"dialog");goog.dom.a11y.setState(a,"labelledby",this.titleId_||"");if(this.content_)this.contentEl_.innerHTML=this.content_;goog.style.showElement(this.titleCloseEl_,this.hasTitleCloseButton_);this.buttons_&&this.buttons_.attachToElement(this.buttonEl_);goog.style.showElement(this.buttonEl_,!!this.buttons_);this.setBackgroundElementOpacity(this.backgroundElementOpacity_)};
goog.ui.Dialog.prototype.decorateInternal=function(a){goog.ui.Dialog.superClass_.decorateInternal.call(this,a);a=this.class_+"-content";if(this.contentEl_=goog.dom.getElementsByTagNameAndClass(null,a,this.getElement())[0])this.content_=this.contentEl_.innerHTML;else{this.contentEl_=this.getDomHelper().createDom("div",a);if(this.content_)this.contentEl_.innerHTML=this.content_;this.getElement().appendChild(this.contentEl_)}a=this.class_+"-title";var b=this.class_+"-title-text",c=this.class_+"-title-close";
(this.titleEl_=goog.dom.getElementsByTagNameAndClass(null,a,this.getElement())[0])?(this.titleTextEl_=goog.dom.getElementsByTagNameAndClass(null,b,this.titleEl_)[0],this.titleCloseEl_=goog.dom.getElementsByTagNameAndClass(null,c,this.titleEl_)[0]):(this.titleEl_=this.getDomHelper().createDom("div",a),this.getElement().insertBefore(this.titleEl_,this.contentEl_));this.titleTextEl_?this.title_=goog.dom.getTextContent(this.titleTextEl_):(this.titleTextEl_=this.getDomHelper().createDom("span",b,this.title_),
this.titleEl_.appendChild(this.titleTextEl_));goog.dom.a11y.setState(this.getElement(),"labelledby",this.titleId_||"");if(!this.titleCloseEl_)this.titleCloseEl_=this.getDomHelper().createDom("span",c),this.titleEl_.appendChild(this.titleCloseEl_);goog.style.showElement(this.titleCloseEl_,this.hasTitleCloseButton_);a=this.class_+"-buttons";(this.buttonEl_=goog.dom.getElementsByTagNameAndClass(null,a,this.getElement())[0])?(this.buttons_=new goog.ui.Dialog.ButtonSet(this.getDomHelper()),this.buttons_.decorate(this.buttonEl_)):
(this.buttonEl_=this.getDomHelper().createDom("div",a),this.getElement().appendChild(this.buttonEl_),this.buttons_&&this.buttons_.attachToElement(this.buttonEl_),goog.style.showElement(this.buttonEl_,!!this.buttons_));this.setBackgroundElementOpacity(this.backgroundElementOpacity_)};
goog.ui.Dialog.prototype.enterDocument=function(){goog.ui.Dialog.superClass_.enterDocument.call(this);this.getHandler().listen(this,[goog.ui.PopupBase.EventType.SHOW,goog.ui.PopupBase.EventType.HIDE],this.setVisibleInternal_);this.setDraggingEnabled_(this.draggable_);this.getHandler().listen(this.titleCloseEl_,goog.events.EventType.CLICK,this.onTitleCloseClick_);goog.dom.a11y.setRole(this.getElement(),"dialog");this.titleTextEl_.id!==""&&goog.dom.a11y.setState(this.getElement(),"labelledby",this.titleTextEl_.id);
this.modal_||this.setModalInternal_(!1)};goog.ui.Dialog.prototype.exitDocument=function(){this.isVisible()&&this.setVisible(!1);this.setDraggingEnabled_(!1);goog.ui.Dialog.superClass_.exitDocument.call(this)};goog.ui.Dialog.prototype.setVisible=function(a){a!=this.isVisible()&&(this.isInDocument()||this.render(),goog.ui.Dialog.superClass_.setVisible.call(this,a))};
goog.ui.Dialog.prototype.setVisibleInternal_=function(a){a.target==this&&(this.isVisible()?(this.getHandler().listen(this.getElement(),goog.events.EventType.KEYDOWN,this.onKey_).listen(this.getElement(),goog.events.EventType.KEYPRESS,this.onKey_),this.dispatchEvent(goog.ui.Dialog.EventType.AFTER_SHOW),this.getHandler().listen(this.buttonEl_,goog.events.EventType.CLICK,this.onButtonClick_)):(this.getHandler().unlisten(this.getElement(),goog.events.EventType.KEYDOWN,this.onKey_).unlisten(this.getElement(),
goog.events.EventType.KEYPRESS,this.onKey_).unlisten(this.buttonEl_,goog.events.EventType.CLICK,this.onButtonClick_),this.dispatchEvent(goog.ui.Dialog.EventType.AFTER_HIDE),this.disposeOnHide_&&this.dispose()))};
goog.ui.Dialog.prototype.focus=function(){goog.ui.Dialog.superClass_.focus.call(this);if(this.getButtonSet()){var a=this.getButtonSet().getDefault();if(a)for(var b=this.getDomHelper().getDocument(),c=this.buttonEl_.getElementsByTagName("button"),d=0,e;e=c[d];d++)if(e.name==a){try{if(goog.userAgent.WEBKIT||goog.userAgent.OPERA){var f=b.createElement("input");f.style.cssText="position:fixed;width:0;height:0;left:0;top:0;";this.getElement().appendChild(f);f.focus();this.getElement().removeChild(f)}e.focus()}catch(g){}break}}};
goog.ui.Dialog.prototype.setDraggerLimits_=function(){var a=this.getDomHelper().getDocument(),b=goog.dom.getWindow(a)||window;b=goog.dom.getViewportSize(b);var c=Math.max(a.body.scrollWidth,b.width);a=Math.max(a.body.scrollHeight,b.height);var d=goog.style.getSize(this.getElement());goog.style.getComputedPosition(this.getElement())=="fixed"?this.dragger_.setLimits(new goog.math.Rect(0,0,Math.max(0,b.width-d.width),Math.max(0,b.height-d.height))):this.dragger_.setLimits(new goog.math.Rect(0,0,c-d.width,
a-d.height))};goog.ui.Dialog.prototype.onTitleCloseClick_=function(){if(this.hasTitleCloseButton_){var a=this.getButtonSet(),b=a&&a.getCancel();b?(a=a.get(b),this.dispatchEvent(new goog.ui.Dialog.Event(b,a))&&this.setVisible(!1)):this.setVisible(!1)}};goog.ui.Dialog.prototype.getHasTitleCloseButton=function(){return this.hasTitleCloseButton_};goog.ui.Dialog.prototype.setHasTitleCloseButton=function(a){this.hasTitleCloseButton_=a;this.titleCloseEl_&&goog.style.showElement(this.titleCloseEl_,this.hasTitleCloseButton_)};
goog.ui.Dialog.prototype.isEscapeToCancel=function(){return this.escapeToCancel_};goog.ui.Dialog.prototype.setEscapeToCancel=function(a){this.escapeToCancel_=a};goog.ui.Dialog.prototype.setDisposeOnHide=function(a){this.disposeOnHide_=a};goog.ui.Dialog.prototype.getDisposeOnHide=function(){return this.disposeOnHide_};goog.ui.Dialog.prototype.disposeInternal=function(){this.buttonEl_=this.titleCloseEl_=null;goog.ui.Dialog.superClass_.disposeInternal.call(this)};
goog.ui.Dialog.prototype.setButtonSet=function(a){this.buttons_=a;if(this.buttonEl_)this.buttons_?this.buttons_.attachToElement(this.buttonEl_):this.buttonEl_.innerHTML="",goog.style.showElement(this.buttonEl_,!!this.buttons_)};goog.ui.Dialog.prototype.getButtonSet=function(){return this.buttons_};goog.ui.Dialog.prototype.onButtonClick_=function(a){if((a=this.findParentButton_(a.target))&&!a.disabled){a=a.name;var b=this.getButtonSet().get(a);this.dispatchEvent(new goog.ui.Dialog.Event(a,b))&&this.setVisible(!1)}};
goog.ui.Dialog.prototype.findParentButton_=function(a){for(;a!=null&&a!=this.buttonEl_;){if(a.tagName=="BUTTON")return a;a=a.parentNode}return null};
goog.ui.Dialog.prototype.onKey_=function(a){var b=!1,c=!1,d=this.getButtonSet(),e=a.target;if(a.type==goog.events.EventType.KEYDOWN)if(this.escapeToCancel_&&a.keyCode==goog.events.KeyCodes.ESC){var f=d&&d.getCancel();e=e.tagName=="SELECT"&&!e.disabled;f&&!e?(c=!0,b=d.get(f),b=this.dispatchEvent(new goog.ui.Dialog.Event(f,b))):e||(b=!0)}else a.keyCode==goog.events.KeyCodes.TAB&&a.shiftKey&&e==this.getElement()&&(c=!0);else if(a.keyCode==goog.events.KeyCodes.ENTER){if(e.tagName=="BUTTON")f=e.name;else if(d){var g=
d.getDefault(),h=g&&d.getButton(g);e=(e.tagName=="TEXTAREA"||e.tagName=="SELECT")&&!e.disabled;h&&!h.disabled&&!e&&(f=g)}f&&d&&(c=!0,b=this.dispatchEvent(new goog.ui.Dialog.Event(f,String(d.get(f)))))}if(b||c)a.stopPropagation(),a.preventDefault();b&&this.setVisible(!1)};goog.ui.Dialog.Event=function(a,b){this.type=goog.ui.Dialog.EventType.SELECT;this.key=a;this.caption=b};goog.inherits(goog.ui.Dialog.Event,goog.events.Event);goog.ui.Dialog.SELECT_EVENT="dialogselect";
goog.ui.Dialog.EventType={SELECT:"dialogselect",AFTER_HIDE:"afterhide",AFTER_SHOW:"aftershow"};goog.ui.Dialog.ButtonSet=function(a){this.dom_=a||goog.dom.getDomHelper();goog.structs.Map.call(this)};goog.inherits(goog.ui.Dialog.ButtonSet,goog.structs.Map);goog.ui.Dialog.ButtonSet.prototype.class_="goog-buttonset";goog.ui.Dialog.ButtonSet.prototype.defaultButton_=null;goog.ui.Dialog.ButtonSet.prototype.element_=null;goog.ui.Dialog.ButtonSet.prototype.cancelButton_=null;
goog.ui.Dialog.ButtonSet.prototype.set=function(a,b,c,d){goog.structs.Map.prototype.set.call(this,a,b);if(c)this.defaultButton_=a;if(d)this.cancelButton_=a;return this};goog.ui.Dialog.ButtonSet.prototype.addButton=function(a,b,c){return this.set(a.key,a.caption,b,c)};goog.ui.Dialog.ButtonSet.prototype.attachToElement=function(a){this.element_=a;this.render()};
goog.ui.Dialog.ButtonSet.prototype.render=function(){if(this.element_){this.element_.innerHTML="";var a=goog.dom.getDomHelper(this.element_);goog.structs.forEach(this,function(b,c){var d=a.createDom("button",{name:c},b);if(c==this.defaultButton_)d.className=this.class_+"-default";this.element_.appendChild(d)},this)}};
goog.ui.Dialog.ButtonSet.prototype.decorate=function(a){if(a&&a.nodeType==goog.dom.NodeType.ELEMENT){this.element_=a;a=this.element_.getElementsByTagName("button");for(var b=0,c,d,e;c=a[b];b++)if(d=c.name||c.id,e=goog.dom.getTextContent(c)||c.value,d){var f=b==0;this.set(d,e,f,c.name==goog.ui.Dialog.DefaultButtonKeys.CANCEL);f&&goog.dom.classes.add(c,this.class_+"-default")}}};goog.ui.Dialog.ButtonSet.prototype.getElement=function(){return this.element_};
goog.ui.Dialog.ButtonSet.prototype.getDomHelper=function(){return this.dom_};goog.ui.Dialog.ButtonSet.prototype.setDefault=function(a){this.defaultButton_=a};goog.ui.Dialog.ButtonSet.prototype.getDefault=function(){return this.defaultButton_};goog.ui.Dialog.ButtonSet.prototype.setCancel=function(a){this.cancelButton_=a};goog.ui.Dialog.ButtonSet.prototype.getCancel=function(){return this.cancelButton_};
goog.ui.Dialog.ButtonSet.prototype.getButton=function(a){for(var b=this.getAllButtons(),c=0,d;d=b[c];c++)if(d.name==a||d.id==a)return d;return null};goog.ui.Dialog.ButtonSet.prototype.getAllButtons=function(){return this.element_.getElementsByTagName(goog.dom.TagName.BUTTON)};goog.ui.Dialog.ButtonSet.prototype.setButtonEnabled=function(a,b){var c=this.getButton(a);if(c)c.disabled=!b};
goog.ui.Dialog.ButtonSet.prototype.setAllButtonsEnabled=function(a){for(var b=this.getAllButtons(),c=0,d;d=b[c];c++)d.disabled=!a};goog.ui.Dialog.DefaultButtonKeys={OK:"ok",CANCEL:"cancel",YES:"yes",NO:"no",SAVE:"save",CONTINUE:"continue"};goog.ui.Dialog.MSG_DIALOG_OK_=goog.getMsg("OK");goog.ui.Dialog.MSG_DIALOG_CANCEL_=goog.getMsg("Cancel");goog.ui.Dialog.MSG_DIALOG_YES_=goog.getMsg("Yes");goog.ui.Dialog.MSG_DIALOG_NO_=goog.getMsg("No");goog.ui.Dialog.MSG_DIALOG_SAVE_=goog.getMsg("Save");
goog.ui.Dialog.MSG_DIALOG_CONTINUE_=goog.getMsg("Continue");goog.ui.Dialog.DefaultButtonCaptions={OK:goog.ui.Dialog.MSG_DIALOG_OK_,CANCEL:goog.ui.Dialog.MSG_DIALOG_CANCEL_,YES:goog.ui.Dialog.MSG_DIALOG_YES_,NO:goog.ui.Dialog.MSG_DIALOG_NO_,SAVE:goog.ui.Dialog.MSG_DIALOG_SAVE_,CONTINUE:goog.ui.Dialog.MSG_DIALOG_CONTINUE_};
goog.ui.Dialog.ButtonSet.DefaultButtons={OK:{key:goog.ui.Dialog.DefaultButtonKeys.OK,caption:goog.ui.Dialog.DefaultButtonCaptions.OK},CANCEL:{key:goog.ui.Dialog.DefaultButtonKeys.CANCEL,caption:goog.ui.Dialog.DefaultButtonCaptions.CANCEL},YES:{key:goog.ui.Dialog.DefaultButtonKeys.YES,caption:goog.ui.Dialog.DefaultButtonCaptions.YES},NO:{key:goog.ui.Dialog.DefaultButtonKeys.NO,caption:goog.ui.Dialog.DefaultButtonCaptions.NO},SAVE:{key:goog.ui.Dialog.DefaultButtonKeys.SAVE,caption:goog.ui.Dialog.DefaultButtonCaptions.SAVE},
CONTINUE:{key:goog.ui.Dialog.DefaultButtonKeys.CONTINUE,caption:goog.ui.Dialog.DefaultButtonCaptions.CONTINUE}};goog.ui.Dialog.ButtonSet.createOk=function(){return(new goog.ui.Dialog.ButtonSet).addButton(goog.ui.Dialog.ButtonSet.DefaultButtons.OK,!0,!0)};goog.ui.Dialog.ButtonSet.createOkCancel=function(){return(new goog.ui.Dialog.ButtonSet).addButton(goog.ui.Dialog.ButtonSet.DefaultButtons.OK,!0).addButton(goog.ui.Dialog.ButtonSet.DefaultButtons.CANCEL,!1,!0)};
goog.ui.Dialog.ButtonSet.createYesNo=function(){return(new goog.ui.Dialog.ButtonSet).addButton(goog.ui.Dialog.ButtonSet.DefaultButtons.YES,!0).addButton(goog.ui.Dialog.ButtonSet.DefaultButtons.NO,!1,!0)};goog.ui.Dialog.ButtonSet.createYesNoCancel=function(){return(new goog.ui.Dialog.ButtonSet).addButton(goog.ui.Dialog.ButtonSet.DefaultButtons.YES).addButton(goog.ui.Dialog.ButtonSet.DefaultButtons.NO,!0).addButton(goog.ui.Dialog.ButtonSet.DefaultButtons.CANCEL,!1,!0)};
goog.ui.Dialog.ButtonSet.createContinueSaveCancel=function(){return(new goog.ui.Dialog.ButtonSet).addButton(goog.ui.Dialog.ButtonSet.DefaultButtons.CONTINUE).addButton(goog.ui.Dialog.ButtonSet.DefaultButtons.SAVE).addButton(goog.ui.Dialog.ButtonSet.DefaultButtons.CANCEL,!0,!0)};
(function(){if(typeof document!="undefined")goog.ui.Dialog.ButtonSet.OK=goog.ui.Dialog.ButtonSet.createOk(),goog.ui.Dialog.ButtonSet.OK_CANCEL=goog.ui.Dialog.ButtonSet.createOkCancel(),goog.ui.Dialog.ButtonSet.YES_NO=goog.ui.Dialog.ButtonSet.createYesNo(),goog.ui.Dialog.ButtonSet.YES_NO_CANCEL=goog.ui.Dialog.ButtonSet.createYesNoCancel(),goog.ui.Dialog.ButtonSet.CONTINUE_SAVE_CANCEL=goog.ui.Dialog.ButtonSet.createContinueSaveCancel()})();goog.ui.RangeModel=function(){goog.events.EventTarget.call(this)};goog.inherits(goog.ui.RangeModel,goog.events.EventTarget);goog.ui.RangeModel.prototype.value_=0;goog.ui.RangeModel.prototype.minimum_=0;goog.ui.RangeModel.prototype.maximum_=100;goog.ui.RangeModel.prototype.extent_=0;goog.ui.RangeModel.prototype.step_=1;goog.ui.RangeModel.prototype.isChanging_=!1;goog.ui.RangeModel.prototype.mute_=!1;goog.ui.RangeModel.prototype.setMute=function(a){this.mute_=a};
goog.ui.RangeModel.prototype.setValue=function(a){a=this.roundToStepWithMin(a);if(this.value_!=a)this.value_=a+this.extent_>this.maximum_?this.maximum_-this.extent_:a<this.minimum_?this.minimum_:a,!this.isChanging_&&!this.mute_&&this.dispatchEvent(goog.ui.Component.EventType.CHANGE)};goog.ui.RangeModel.prototype.getValue=function(){return this.roundToStepWithMin(this.value_)};
goog.ui.RangeModel.prototype.setExtent=function(a){a=this.roundToStepWithMin(a);if(this.extent_!=a)this.extent_=a<0?0:this.value_+a>this.maximum_?this.maximum_-this.value_:a,!this.isChanging_&&!this.mute_&&this.dispatchEvent(goog.ui.Component.EventType.CHANGE)};goog.ui.RangeModel.prototype.getExtent=function(){return this.roundToStep(this.extent_)};
goog.ui.RangeModel.prototype.setMinimum=function(a){if(this.minimum_!=a){var b=this.isChanging_;this.isChanging_=!0;this.minimum_=a;if(a+this.extent_>this.maximum_)this.extent_=this.maximum_-this.minimum_;a>this.value_&&this.setValue(a);if(a>this.maximum_)this.extent_=0,this.setMaximum(a),this.setValue(a);this.isChanging_=b;!this.isChanging_&&!this.mute_&&this.dispatchEvent(goog.ui.Component.EventType.CHANGE)}};goog.ui.RangeModel.prototype.getMinimum=function(){return this.roundToStepWithMin(this.minimum_)};
goog.ui.RangeModel.prototype.setMaximum=function(a){a=this.roundToStepWithMin(a);if(this.maximum_!=a){var b=this.isChanging_;this.isChanging_=!0;this.maximum_=a;a<this.value_+this.extent_&&this.setValue(a-this.extent_);if(a<this.minimum_)this.extent_=0,this.setMinimum(a),this.setValue(this.maximum_);if(a<this.minimum_+this.extent_)this.extent_=this.maximum_-this.minimum_;this.isChanging_=b;!this.isChanging_&&!this.mute_&&this.dispatchEvent(goog.ui.Component.EventType.CHANGE)}};
goog.ui.RangeModel.prototype.getMaximum=function(){return this.roundToStepWithMin(this.maximum_)};goog.ui.RangeModel.prototype.getStep=function(){return this.step_};goog.ui.RangeModel.prototype.setStep=function(a){if(this.step_!=a)this.step_=a,a=this.isChanging_,this.isChanging_=!0,this.setMaximum(this.getMaximum()),this.setExtent(this.getExtent()),this.setValue(this.getValue()),this.isChanging_=a,!this.isChanging_&&!this.mute_&&this.dispatchEvent(goog.ui.Component.EventType.CHANGE)};
goog.ui.RangeModel.prototype.roundToStepWithMin=function(a){if(this.step_==null)return a;return this.minimum_+Math.round((a-this.minimum_)/this.step_)*this.step_};goog.ui.RangeModel.prototype.roundToStep=function(a){if(this.step_==null)return a;return Math.round(a/this.step_)*this.step_};goog.ui.ProgressBar=function(a){goog.ui.Component.call(this,a);this.rangeModel_=new goog.ui.RangeModel;goog.events.listen(this.rangeModel_,goog.ui.Component.EventType.CHANGE,this.handleChange_,!1,this)};goog.inherits(goog.ui.ProgressBar,goog.ui.Component);goog.ui.ProgressBar.Orientation={VERTICAL:"vertical",HORIZONTAL:"horizontal"};goog.ui.ProgressBar.ORIENTATION_TO_CSS_NAME_={};goog.ui.ProgressBar.ORIENTATION_TO_CSS_NAME_[goog.ui.ProgressBar.Orientation.VERTICAL]="progress-bar-vertical";
goog.ui.ProgressBar.ORIENTATION_TO_CSS_NAME_[goog.ui.ProgressBar.Orientation.HORIZONTAL]="progress-bar-horizontal";goog.ui.ProgressBar.prototype.createDom=function(){this.thumbElement_=this.createThumb_();var a=goog.ui.ProgressBar.ORIENTATION_TO_CSS_NAME_[this.orientation_];this.setElementInternal(this.getDomHelper().createDom("div",a,this.thumbElement_));this.setValueState_();this.setMinimumState_();this.setMaximumState_()};
goog.ui.ProgressBar.prototype.enterDocument=function(){goog.ui.ProgressBar.superClass_.enterDocument.call(this);this.attachEvents_();this.updateUi_();goog.dom.a11y.setRole(this.getElement(),"progressbar");goog.dom.a11y.setState(this.getElement(),"live","polite")};goog.ui.ProgressBar.prototype.exitDocument=function(){goog.ui.ProgressBar.superClass_.exitDocument.call(this);this.detachEvents_()};goog.ui.ProgressBar.prototype.createThumb_=function(){return this.getDomHelper().createDom("div","progress-bar-thumb")};
goog.ui.ProgressBar.prototype.attachEvents_=function(){goog.userAgent.IE&&goog.userAgent.VERSION<7&&goog.events.listen(this.getElement(),goog.events.EventType.RESIZE,this.updateUi_,!1,this)};goog.ui.ProgressBar.prototype.detachEvents_=function(){goog.userAgent.IE&&goog.userAgent.VERSION<7&&goog.events.unlisten(this.getElement(),goog.events.EventType.RESIZE,this.updateUi_,!1,this)};
goog.ui.ProgressBar.prototype.decorateInternal=function(a){goog.ui.ProgressBar.superClass_.decorateInternal.call(this,a);goog.dom.classes.add(this.getElement(),goog.ui.ProgressBar.ORIENTATION_TO_CSS_NAME_[this.orientation_]);a=goog.dom.getElementsByTagNameAndClass(null,"progress-bar-thumb",this.getElement())[0];a||(a=this.createThumb_(),this.getElement().appendChild(a));this.thumbElement_=a};goog.ui.ProgressBar.prototype.getValue=function(){return this.rangeModel_.getValue()};
goog.ui.ProgressBar.prototype.setValue=function(a){this.rangeModel_.setValue(a);this.getElement()&&this.setValueState_()};goog.ui.ProgressBar.prototype.setValueState_=function(){goog.dom.a11y.setState(this.getElement(),"valuenow",this.getValue())};goog.ui.ProgressBar.prototype.getMinimum=function(){return this.rangeModel_.getMinimum()};goog.ui.ProgressBar.prototype.setMinimum=function(a){this.rangeModel_.setMinimum(a);this.getElement()&&this.setMinimumState_()};
goog.ui.ProgressBar.prototype.setMinimumState_=function(){goog.dom.a11y.setState(this.getElement(),"valuemin",this.getMinimum())};goog.ui.ProgressBar.prototype.getMaximum=function(){return this.rangeModel_.getMaximum()};goog.ui.ProgressBar.prototype.setMaximum=function(a){this.rangeModel_.setMaximum(a);this.getElement()&&this.setMaximumState_()};goog.ui.ProgressBar.prototype.setMaximumState_=function(){goog.dom.a11y.setState(this.getElement(),"valuemax",this.getMaximum())};
goog.ui.ProgressBar.prototype.orientation_=goog.ui.ProgressBar.Orientation.HORIZONTAL;goog.ui.ProgressBar.prototype.handleChange_=function(){this.updateUi_();this.dispatchEvent(goog.ui.Component.EventType.CHANGE)};
goog.ui.ProgressBar.prototype.updateUi_=function(){if(this.thumbElement_){var a=this.getMinimum(),b=this.getMaximum();a=(this.getValue()-a)/(b-a);b=Math.round(a*100);this.orientation_==goog.ui.ProgressBar.Orientation.VERTICAL?goog.userAgent.IE&&goog.userAgent.VERSION<7?(this.thumbElement_.style.top=0,this.thumbElement_.style.height="100%",b=this.thumbElement_.offsetHeight,a=Math.round(a*b),this.thumbElement_.style.top=b-a+"px",this.thumbElement_.style.height=a+"px"):(this.thumbElement_.style.top=
100-b+"%",this.thumbElement_.style.height=b+"%"):this.thumbElement_.style.width=b+"%"}};goog.ui.ProgressBar.prototype.initializeUi_=function(){var a=this.thumbElement_.style;this.orientation_==goog.ui.ProgressBar.Orientation.VERTICAL?(a.left=0,a.width="100%"):(a.top=a.left=0,a.height="100%")};
goog.ui.ProgressBar.prototype.setOrientation=function(a){if(this.orientation_!=a){var b=goog.ui.ProgressBar.ORIENTATION_TO_CSS_NAME_[this.orientation_],c=goog.ui.ProgressBar.ORIENTATION_TO_CSS_NAME_[a];this.orientation_=a;this.getElement()&&(goog.dom.classes.swap(this.getElement(),b,c),this.initializeUi_(),this.updateUi_())}};goog.ui.ProgressBar.prototype.getOrientation=function(){return this.orientation_};
goog.ui.ProgressBar.prototype.disposeInternal=function(){this.detachEvents_();goog.ui.ProgressBar.superClass_.disposeInternal.call(this);this.thumbElement_=null;this.rangeModel_.dispose()};goog.ui.ProgressBar.prototype.getStep=function(){return this.rangeModel_.getStep()};goog.ui.ProgressBar.prototype.setStep=function(a){this.rangeModel_.setStep(a)};goog.functions={};goog.functions.constant=function(a){return function(){return a}};goog.functions.FALSE=goog.functions.constant(!1);goog.functions.TRUE=goog.functions.constant(!0);goog.functions.NULL=goog.functions.constant(null);goog.functions.identity=function(a){return a};goog.functions.error=function(a){return function(){throw Error(a);}};goog.functions.lock=function(a){return function(){return a.call(this)}};goog.functions.withReturnValue=function(a,b){return goog.functions.sequence(a,goog.functions.constant(b))};
goog.functions.compose=function(){var a=arguments,b=a.length;return function(){var c;b&&(c=a[b-1].apply(this,arguments));for(var d=b-2;d>=0;d--)c=a[d].call(this,c);return c}};goog.functions.sequence=function(){var a=arguments,b=a.length;return function(){for(var c,d=0;d<b;d++)c=a[d].apply(this,arguments);return c}};goog.functions.and=function(){var a=arguments,b=a.length;return function(){for(var c=0;c<b;c++)if(!a[c].apply(this,arguments))return!1;return!0}};
goog.functions.or=function(){var a=arguments,b=a.length;return function(){for(var c=0;c<b;c++)if(a[c].apply(this,arguments))return!0;return!1}};goog.functions.not=function(a){return function(){return!a.apply(this,arguments)}};goog.functions.create=function(a){var b=function(){};b.prototype=a.prototype;b=new b;a.apply(b,Array.prototype.slice.call(arguments,1));return b};goog.ui.editor={};goog.ui.editor.messages={};goog.ui.editor.messages.MSG_LINK_CAPTION=goog.getMsg("Link");goog.ui.editor.messages.MSG_EDIT_LINK=goog.getMsg("Edit Link");goog.ui.editor.messages.MSG_TEXT_TO_DISPLAY=goog.getMsg("Text to display:");goog.ui.editor.messages.MSG_LINK_TO=goog.getMsg("Link to:");goog.ui.editor.messages.MSG_ON_THE_WEB=goog.getMsg("Web address");goog.ui.editor.messages.MSG_ON_THE_WEB_TIP=goog.getMsg("Link to a page or file somewhere else on the web");
goog.ui.editor.messages.MSG_TEST_THIS_LINK=goog.getMsg("Test this link");
goog.ui.editor.messages.MSG_TR_LINK_EXPLANATION=goog.getMsg("{$startBold}Not sure what to put in the box?{$endBold} First, find the page on the web that you want to link to. (A {$searchEngineLink}search engine{$endLink} might be useful.) Then, copy the web address from the box in your browser's address bar, and paste it into the box above.",{startBold:"<b>",endBold:"</b>",searchEngineLink:"<a href='http://www.google.com/' target='_new'>",endLink:"</a>"});goog.ui.editor.messages.MSG_WHAT_URL=goog.getMsg("To what URL should this link go?");
goog.ui.editor.messages.MSG_EMAIL_ADDRESS=goog.getMsg("Email address");goog.ui.editor.messages.MSG_EMAIL_ADDRESS_TIP=goog.getMsg("Link to an email address");goog.ui.editor.messages.MSG_INVALID_EMAIL=goog.getMsg("Invalid email address");goog.ui.editor.messages.MSG_WHAT_EMAIL=goog.getMsg("To what email address should this link?");
goog.ui.editor.messages.MSG_EMAIL_EXPLANATION=goog.getMsg("{$preb}Be careful.{$postb} Remember that any time you include an email address on a web page, nasty spammers can find it too.",{preb:"<b>",postb:"</b>"});goog.ui.editor.messages.MSG_OPEN_IN_NEW_WINDOW=goog.getMsg("Open this link in a new window");goog.ui.editor.messages.MSG_IMAGE_CAPTION=goog.getMsg("Image");goog.dom.iter={};goog.dom.iter.SiblingIterator=function(a,b,c){this.node_=a;this.reverse_=!!c;a&&!b&&this.next()};goog.inherits(goog.dom.iter.SiblingIterator,goog.iter.Iterator);goog.dom.iter.SiblingIterator.prototype.next=function(){var a=this.node_;if(!a)throw goog.iter.StopIteration;this.node_=this.reverse_?a.previousSibling:a.nextSibling;return a};
goog.dom.iter.ChildIterator=function(a,b,c){goog.isDef(c)||(c=b&&a.childNodes.length?a.childNodes.length-1:0);goog.dom.iter.SiblingIterator.call(this,a.childNodes[c],!0,b)};goog.inherits(goog.dom.iter.ChildIterator,goog.dom.iter.SiblingIterator);goog.dom.iter.AncestorIterator=function(a,b){(this.node_=a)&&!b&&this.next()};goog.inherits(goog.dom.iter.AncestorIterator,goog.iter.Iterator);
goog.dom.iter.AncestorIterator.prototype.next=function(){var a=this.node_;if(!a)throw goog.iter.StopIteration;this.node_=a.parentNode;return a};goog.editor={};goog.editor.node={};goog.editor.node.BLOCK_TAG_NAMES_=goog.object.createSet("ADDRESS","BLOCKQUOTE","BODY","CAPTION","CENTER","COL","COLGROUP","DIR","DIV","DL","DD","DT","FIELDSET","FORM","H1","H2","H3","H4","H5","H6","HR","ISINDEX","OL","LI","MAP","MENU","OPTGROUP","OPTION","P","PRE","TABLE","TBODY","TD","TFOOT","TH","THEAD","TR","TL","UL");goog.editor.node.NON_EMPTY_TAGS_=goog.object.createSet(goog.dom.TagName.IMG,goog.dom.TagName.IFRAME,"EMBED");goog.editor.node.isStandardsMode=function(a){return goog.dom.getDomHelper(a).isCss1CompatMode()};
goog.editor.node.getRightMostLeaf=function(a){for(var b;b=goog.editor.node.getLastChild(a);)a=b;return a};goog.editor.node.getLeftMostLeaf=function(a){for(var b;b=goog.editor.node.getFirstChild(a);)a=b;return a};goog.editor.node.getFirstChild=function(a){return goog.editor.node.getChildHelper_(a,!1)};goog.editor.node.getLastChild=function(a){return goog.editor.node.getChildHelper_(a,!0)};
goog.editor.node.getPreviousSibling=function(a){return goog.editor.node.getFirstValue_(goog.iter.filter(new goog.dom.iter.SiblingIterator(a,!1,!0),goog.editor.node.isImportant))};goog.editor.node.getNextSibling=function(a){return goog.editor.node.getFirstValue_(goog.iter.filter(new goog.dom.iter.SiblingIterator(a),goog.editor.node.isImportant))};
goog.editor.node.getChildHelper_=function(a,b){return!a||a.nodeType!=goog.dom.NodeType.ELEMENT?null:goog.editor.node.getFirstValue_(goog.iter.filter(new goog.dom.iter.ChildIterator(a,b),goog.editor.node.isImportant))};goog.editor.node.getFirstValue_=function(a){try{return a.next()}catch(b){return null}};goog.editor.node.isImportant=function(a){return a.nodeType==goog.dom.NodeType.ELEMENT||a.nodeType==goog.dom.NodeType.TEXT&&!goog.editor.node.isAllNonNbspWhiteSpace(a)};
goog.editor.node.isAllNonNbspWhiteSpace=function(a){return goog.string.isBreakingWhitespace(a.nodeValue)};goog.editor.node.isEmpty=function(a,b){var c=goog.dom.getRawTextContent(a);if(a.getElementsByTagName)for(var d in goog.editor.node.NON_EMPTY_TAGS_)if(a.tagName==d||a.getElementsByTagName(d).length>0)return!1;return!b&&c==goog.string.Unicode.NBSP||goog.string.isBreakingWhitespace(c)};goog.editor.node.getLength=function(a){return a.length||a.childNodes.length};
goog.editor.node.findInChildren=function(a,b){for(var c=0,d=a.childNodes.length;c<d;c++)if(b(a.childNodes[c]))return c;return null};goog.editor.node.findHighestMatchingAncestor=function(a,b){for(var c=a.parentNode,d=null;c&&b(c);)d=c,c=c.parentNode;return d};goog.editor.node.isBlockTag=function(a){return!!goog.editor.node.BLOCK_TAG_NAMES_[a.tagName]};goog.editor.node.skipEmptyTextNodes=function(a){for(;a&&a.nodeType==goog.dom.NodeType.TEXT&&!a.nodeValue;)a=a.nextSibling;return a};
goog.editor.node.isEditableContainer=function(a){return a.getAttribute&&a.getAttribute("g_editable")=="true"};goog.editor.node.isEditable=function(a){return!!goog.dom.getAncestor(a,goog.editor.node.isEditableContainer)};goog.editor.node.findTopMostEditableAncestor=function(a,b){for(var c=null;a&&!goog.editor.node.isEditableContainer(a);)b(a)&&(c=a),a=a.parentNode;return c};
goog.editor.node.splitDomTreeAt=function(a,b,c){for(var d;a!=c&&(d=a.parentNode);)b=goog.editor.node.getSecondHalfOfNode_(d,a,b),a=d;return b};goog.editor.node.getSecondHalfOfNode_=function(a,b,c){for(a=a.cloneNode(!1);b.nextSibling;)goog.dom.appendChild(a,b.nextSibling);c&&a.insertBefore(c,a.firstChild);return a};goog.editor.node.transferChildren=function(a,b){goog.dom.append(a,b.childNodes)};goog.editor.Command={UNDO:"+undo",REDO:"+redo",LINK:"+link",FORMAT_BLOCK:"+formatBlock",INDENT:"+indent",OUTDENT:"+outdent",REMOVE_FORMAT:"+removeFormat",STRIKE_THROUGH:"+strikeThrough",HORIZONTAL_RULE:"+insertHorizontalRule",SUBSCRIPT:"+subscript",SUPERSCRIPT:"+superscript",UNDERLINE:"+underline",BOLD:"+bold",ITALIC:"+italic",FONT_SIZE:"+fontSize",FONT_FACE:"+fontName",FONT_COLOR:"+foreColor",EMOTICON:"+emoticon",EQUATION:"+equation",BACKGROUND_COLOR:"+backColor",ORDERED_LIST:"+insertOrderedList",
UNORDERED_LIST:"+insertUnorderedList",TABLE:"+table",JUSTIFY_CENTER:"+justifyCenter",JUSTIFY_FULL:"+justifyFull",JUSTIFY_RIGHT:"+justifyRight",JUSTIFY_LEFT:"+justifyLeft",BLOCKQUOTE:"+BLOCKQUOTE",DIR_LTR:"ltr",DIR_RTL:"rtl",IMAGE:"image",EDIT_HTML:"editHtml",DEFAULT_TAG:"+defaultTag",CLEAR_LOREM:"clearlorem",UPDATE_LOREM:"updatelorem",USING_LOREM:"usinglorem",MODAL_LINK_EDITOR:"link"};goog.structs.Collection=function(){};goog.structs.Set=function(a){this.map_=new goog.structs.Map;a&&this.addAll(a)};goog.structs.Set.getKey_=function(a){var b=typeof a;return b=="object"&&a||b=="function"?"o"+goog.getUid(a):b.substr(0,1)+a};goog.structs.Set.prototype.getCount=function(){return this.map_.getCount()};goog.structs.Set.prototype.add=function(a){this.map_.set(goog.structs.Set.getKey_(a),a)};goog.structs.Set.prototype.addAll=function(a){a=goog.structs.getValues(a);for(var b=a.length,c=0;c<b;c++)this.add(a[c])};
goog.structs.Set.prototype.removeAll=function(a){a=goog.structs.getValues(a);for(var b=a.length,c=0;c<b;c++)this.remove(a[c])};goog.structs.Set.prototype.remove=function(a){return this.map_.remove(goog.structs.Set.getKey_(a))};goog.structs.Set.prototype.clear=function(){this.map_.clear()};goog.structs.Set.prototype.isEmpty=function(){return this.map_.isEmpty()};goog.structs.Set.prototype.contains=function(a){return this.map_.containsKey(goog.structs.Set.getKey_(a))};
goog.structs.Set.prototype.containsAll=function(a){return goog.structs.every(a,this.contains,this)};goog.structs.Set.prototype.intersection=function(a){var b=new goog.structs.Set;a=goog.structs.getValues(a);for(var c=0;c<a.length;c++){var d=a[c];this.contains(d)&&b.add(d)}return b};goog.structs.Set.prototype.getValues=function(){return this.map_.getValues()};goog.structs.Set.prototype.clone=function(){return new goog.structs.Set(this)};
goog.structs.Set.prototype.equals=function(a){return this.getCount()==goog.structs.getCount(a)&&this.isSubsetOf(a)};goog.structs.Set.prototype.isSubsetOf=function(a){var b=goog.structs.getCount(a);if(this.getCount()>b)return!1;!(a instanceof goog.structs.Set)&&b>5&&(a=new goog.structs.Set(a));return goog.structs.every(this,function(b){return goog.structs.contains(a,b)})};goog.structs.Set.prototype.__iterator__=function(){return this.map_.__iterator__(!1)};goog.debug.catchErrors=function(a,b,c){c=c||goog.global;var d=c.onerror,e=goog.userAgent.WEBKIT?!b:!!b;c.onerror=function(b,c,h){d&&d(b,c,h);a({message:b,fileName:c,line:h});return e}};goog.debug.expose=function(a,b){if(typeof a=="undefined")return"undefined";if(a==null)return"NULL";var c=[],d;for(d in a)if(b||!goog.isFunction(a[d])){var e=d+" = ";try{e+=a[d]}catch(f){e+="*** "+f+" ***"}c.push(e)}return c.join("\n")};
goog.debug.deepExpose=function(a,b){var c=new goog.structs.Set,d=[],e=function(a,g){var h=g+"  ";try{if(goog.isDef(a))if(goog.isNull(a))d.push("NULL");else if(goog.isString(a))d.push('"'+a.replace(/\n/g,"\n"+g)+'"');else if(goog.isFunction(a))d.push(String(a).replace(/\n/g,"\n"+g));else if(goog.isObject(a))if(c.contains(a))d.push("*** reference loop detected ***");else{c.add(a);d.push("{");for(var i in a)if(b||!goog.isFunction(a[i]))d.push("\n"),d.push(h),d.push(i+" = "),e(a[i],h);d.push("\n"+g+"}")}else d.push(a);
else d.push("undefined")}catch(j){d.push("*** "+j+" ***")}};e(a,"");return d.join("")};goog.debug.exposeArray=function(a){for(var b=[],c=0;c<a.length;c++)goog.isArray(a[c])?b.push(goog.debug.exposeArray(a[c])):b.push(a[c]);return"[ "+b.join(", ")+" ]"};
goog.debug.exposeException=function(a,b){try{var c=goog.debug.normalizeErrorObject(a);return"Message: "+goog.string.htmlEscape(c.message)+'\nUrl: <a href="view-source:'+c.fileName+'" target="_new">'+c.fileName+"</a>\nLine: "+c.lineNumber+"\n\nBrowser stack:\n"+goog.string.htmlEscape(c.stack+"-> ")+"[end]\n\nJS stack traversal:\n"+goog.string.htmlEscape(goog.debug.getStacktrace(b)+"-> ")}catch(d){return"Exception trying to expose exception! You win, we lose. "+d}};
goog.debug.normalizeErrorObject=function(a){var b=goog.getObjectByName("window.location.href");if(goog.isString(a))return{message:a,name:"Unknown error",lineNumber:"Not available",fileName:b,stack:"Not available"};var c,d,e=!1;try{c=a.lineNumber||a.line||"Not available"}catch(f){c="Not available",e=!0}try{d=a.fileName||a.filename||a.sourceURL||b}catch(g){d="Not available",e=!0}if(e||!a.lineNumber||!a.fileName||!a.stack)return{message:a.message,name:a.name,lineNumber:c,fileName:d,stack:a.stack||"Not available"};
return a};goog.debug.enhanceError=function(a,b){var c=typeof a=="string"?Error(a):a;if(!c.stack)c.stack=goog.debug.getStacktrace(arguments.callee.caller);if(b){for(var d=0;c["message"+d];)++d;c["message"+d]=String(b)}return c};
goog.debug.getStacktraceSimple=function(a){for(var b=[],c=arguments.callee.caller,d=0;c&&(!a||d<a);){b.push(goog.debug.getFunctionName(c));b.push("()\n");try{c=c.caller}catch(e){b.push("[exception trying to get caller]\n");break}d++;if(d>=goog.debug.MAX_STACK_DEPTH){b.push("[...long stack...]");break}}a&&d>=a?b.push("[...reached max depth limit...]"):b.push("[end]");return b.join("")};goog.debug.MAX_STACK_DEPTH=50;
goog.debug.getStacktrace=function(a){return goog.debug.getStacktraceHelper_(a||arguments.callee.caller,[])};
goog.debug.getStacktraceHelper_=function(a,b){var c=[];if(goog.array.contains(b,a))c.push("[...circular reference...]");else if(a&&b.length<goog.debug.MAX_STACK_DEPTH){c.push(goog.debug.getFunctionName(a)+"(");for(var d=a.arguments,e=0;e<d.length;e++){e>0&&c.push(", ");var f;f=d[e];switch(typeof f){case "object":f=f?"object":"null";break;case "string":break;case "number":f=String(f);break;case "boolean":f=f?"true":"false";break;case "function":f=(f=goog.debug.getFunctionName(f))?f:"[fn]";break;default:f=
typeof f}f.length>40&&(f=f.substr(0,40)+"...");c.push(f)}b.push(a);c.push(")\n");try{c.push(goog.debug.getStacktraceHelper_(a.caller,b))}catch(g){c.push("[exception trying to get caller]\n")}}else a?c.push("[...long stack...]"):c.push("[end]");return c.join("")};goog.debug.setFunctionResolver=function(a){goog.debug.fnNameResolver_=a};
goog.debug.getFunctionName=function(a){if(goog.debug.fnNameCache_[a])return goog.debug.fnNameCache_[a];if(goog.debug.fnNameResolver_){var b=goog.debug.fnNameResolver_(a);if(b)return goog.debug.fnNameCache_[a]=b}a=String(a);goog.debug.fnNameCache_[a]||(b=/function ([^\(]+)/.exec(a),goog.debug.fnNameCache_[a]=b?b[1]:"[Anonymous]");return goog.debug.fnNameCache_[a]};
goog.debug.makeWhitespaceVisible=function(a){return a.replace(/ /g,"[_]").replace(/\f/g,"[f]").replace(/\n/g,"[n]\n").replace(/\r/g,"[r]").replace(/\t/g,"[t]")};goog.debug.fnNameCache_={};goog.debug.LogRecord=function(a,b,c,d,e){this.reset(a,b,c,d,e)};goog.debug.LogRecord.prototype.sequenceNumber_=0;goog.debug.LogRecord.prototype.exception_=null;goog.debug.LogRecord.prototype.exceptionText_=null;goog.debug.LogRecord.ENABLE_SEQUENCE_NUMBERS=!0;goog.debug.LogRecord.nextSequenceNumber_=0;
goog.debug.LogRecord.prototype.reset=function(a,b,c,d,e){if(goog.debug.LogRecord.ENABLE_SEQUENCE_NUMBERS)this.sequenceNumber_=typeof e=="number"?e:goog.debug.LogRecord.nextSequenceNumber_++;this.time_=d||goog.now();this.level_=a;this.msg_=b;this.loggerName_=c;delete this.exception_;delete this.exceptionText_};goog.debug.LogRecord.prototype.getLoggerName=function(){return this.loggerName_};goog.debug.LogRecord.prototype.getException=function(){return this.exception_};
goog.debug.LogRecord.prototype.setException=function(a){this.exception_=a};goog.debug.LogRecord.prototype.getExceptionText=function(){return this.exceptionText_};goog.debug.LogRecord.prototype.setExceptionText=function(a){this.exceptionText_=a};goog.debug.LogRecord.prototype.setLoggerName=function(a){this.loggerName_=a};goog.debug.LogRecord.prototype.getLevel=function(){return this.level_};goog.debug.LogRecord.prototype.setLevel=function(a){this.level_=a};
goog.debug.LogRecord.prototype.getMessage=function(){return this.msg_};goog.debug.LogRecord.prototype.setMessage=function(a){this.msg_=a};goog.debug.LogRecord.prototype.getMillis=function(){return this.time_};goog.debug.LogRecord.prototype.setMillis=function(a){this.time_=a};goog.debug.LogRecord.prototype.getSequenceNumber=function(){return this.sequenceNumber_};goog.debug.LogBuffer=function(){goog.asserts.assert(goog.debug.LogBuffer.isBufferingEnabled(),"Cannot use goog.debug.LogBuffer without defining goog.debug.LogBuffer.CAPACITY.");this.clear()};goog.debug.LogBuffer.getInstance=function(){if(!goog.debug.LogBuffer.instance_)goog.debug.LogBuffer.instance_=new goog.debug.LogBuffer;return goog.debug.LogBuffer.instance_};goog.debug.LogBuffer.CAPACITY=0;
goog.debug.LogBuffer.prototype.addRecord=function(a,b,c){var d=(this.curIndex_+1)%goog.debug.LogBuffer.CAPACITY;this.curIndex_=d;if(this.isFull_)return d=this.buffer_[d],d.reset(a,b,c),d;this.isFull_=d==goog.debug.LogBuffer.CAPACITY-1;return this.buffer_[d]=new goog.debug.LogRecord(a,b,c)};goog.debug.LogBuffer.isBufferingEnabled=function(){return goog.debug.LogBuffer.CAPACITY>0};
goog.debug.LogBuffer.prototype.clear=function(){this.buffer_=Array(goog.debug.LogBuffer.CAPACITY);this.curIndex_=-1;this.isFull_=!1};goog.debug.LogBuffer.prototype.forEachRecord=function(a){var b=this.buffer_;if(b[0]){var c=this.curIndex_,d=this.isFull_?c:-1;do d=(d+1)%goog.debug.LogBuffer.CAPACITY,a(b[d]);while(d!=c)}};goog.debug.Logger=function(a){this.name_=a};goog.debug.Logger.prototype.parent_=null;goog.debug.Logger.prototype.level_=null;goog.debug.Logger.prototype.children_=null;goog.debug.Logger.prototype.handlers_=null;goog.debug.Logger.ENABLE_HIERARCHY=!0;if(!goog.debug.Logger.ENABLE_HIERARCHY)goog.debug.Logger.rootHandlers_=[];goog.debug.Logger.Level=function(a,b){this.name=a;this.value=b};goog.debug.Logger.Level.prototype.toString=function(){return this.name};
goog.debug.Logger.Level.OFF=new goog.debug.Logger.Level("OFF",Infinity);goog.debug.Logger.Level.SHOUT=new goog.debug.Logger.Level("SHOUT",1200);goog.debug.Logger.Level.SEVERE=new goog.debug.Logger.Level("SEVERE",1E3);goog.debug.Logger.Level.WARNING=new goog.debug.Logger.Level("WARNING",900);goog.debug.Logger.Level.INFO=new goog.debug.Logger.Level("INFO",800);goog.debug.Logger.Level.CONFIG=new goog.debug.Logger.Level("CONFIG",700);goog.debug.Logger.Level.FINE=new goog.debug.Logger.Level("FINE",500);
goog.debug.Logger.Level.FINER=new goog.debug.Logger.Level("FINER",400);goog.debug.Logger.Level.FINEST=new goog.debug.Logger.Level("FINEST",300);goog.debug.Logger.Level.ALL=new goog.debug.Logger.Level("ALL",0);
goog.debug.Logger.Level.PREDEFINED_LEVELS=[goog.debug.Logger.Level.OFF,goog.debug.Logger.Level.SHOUT,goog.debug.Logger.Level.SEVERE,goog.debug.Logger.Level.WARNING,goog.debug.Logger.Level.INFO,goog.debug.Logger.Level.CONFIG,goog.debug.Logger.Level.FINE,goog.debug.Logger.Level.FINER,goog.debug.Logger.Level.FINEST,goog.debug.Logger.Level.ALL];goog.debug.Logger.Level.predefinedLevelsCache_=null;
goog.debug.Logger.Level.createPredefinedLevelsCache_=function(){goog.debug.Logger.Level.predefinedLevelsCache_={};for(var a=0,b;b=goog.debug.Logger.Level.PREDEFINED_LEVELS[a];a++)goog.debug.Logger.Level.predefinedLevelsCache_[b.value]=b,goog.debug.Logger.Level.predefinedLevelsCache_[b.name]=b};
goog.debug.Logger.Level.getPredefinedLevel=function(a){goog.debug.Logger.Level.predefinedLevelsCache_||goog.debug.Logger.Level.createPredefinedLevelsCache_();return goog.debug.Logger.Level.predefinedLevelsCache_[a]||null};
goog.debug.Logger.Level.getPredefinedLevelByValue=function(a){goog.debug.Logger.Level.predefinedLevelsCache_||goog.debug.Logger.Level.createPredefinedLevelsCache_();if(a in goog.debug.Logger.Level.predefinedLevelsCache_)return goog.debug.Logger.Level.predefinedLevelsCache_[a];for(var b=0;b<goog.debug.Logger.Level.PREDEFINED_LEVELS.length;++b){var c=goog.debug.Logger.Level.PREDEFINED_LEVELS[b];if(c.value<=a)return c}return null};goog.debug.Logger.getLogger=function(a){return goog.debug.LogManager.getLogger(a)};
goog.debug.Logger.logToProfilers=function(a){goog.global.console&&(goog.global.console.timeStamp?goog.global.console.timeStamp(a):goog.global.console.markTimeline&&goog.global.console.markTimeline(a));goog.global.msWriteProfilerMark&&goog.global.msWriteProfilerMark(a)};goog.debug.Logger.prototype.getName=function(){return this.name_};
goog.debug.Logger.prototype.addHandler=function(a){if(goog.debug.Logger.ENABLE_HIERARCHY){if(!this.handlers_)this.handlers_=[];this.handlers_.push(a)}else goog.asserts.assert(!this.name_,"Cannot call addHandler on a non-root logger when goog.debug.Logger.ENABLE_HIERARCHY is false."),goog.debug.Logger.rootHandlers_.push(a)};goog.debug.Logger.prototype.removeHandler=function(a){var b=goog.debug.Logger.ENABLE_HIERARCHY?this.handlers_:goog.debug.Logger.rootHandlers_;return!!b&&goog.array.remove(b,a)};
goog.debug.Logger.prototype.getParent=function(){return this.parent_};goog.debug.Logger.prototype.getChildren=function(){if(!this.children_)this.children_={};return this.children_};goog.debug.Logger.prototype.setLevel=function(a){goog.debug.Logger.ENABLE_HIERARCHY?this.level_=a:(goog.asserts.assert(!this.name_,"Cannot call setLevel() on a non-root logger when goog.debug.Logger.ENABLE_HIERARCHY is false."),goog.debug.Logger.rootLevel_=a)};goog.debug.Logger.prototype.getLevel=function(){return this.level_};
goog.debug.Logger.prototype.getEffectiveLevel=function(){if(!goog.debug.Logger.ENABLE_HIERARCHY)return goog.debug.Logger.rootLevel_;if(this.level_)return this.level_;if(this.parent_)return this.parent_.getEffectiveLevel();goog.asserts.fail("Root logger has no level set.");return null};goog.debug.Logger.prototype.isLoggable=function(a){return a.value>=this.getEffectiveLevel().value};goog.debug.Logger.prototype.log=function(a,b,c){this.isLoggable(a)&&this.doLogRecord_(this.getLogRecord(a,b,c))};
goog.debug.Logger.prototype.getLogRecord=function(a,b,c){var d=goog.debug.LogBuffer.isBufferingEnabled()?goog.debug.LogBuffer.getInstance().addRecord(a,b,this.name_):new goog.debug.LogRecord(a,String(b),this.name_);c&&(d.setException(c),d.setExceptionText(goog.debug.exposeException(c,arguments.callee.caller)));return d};goog.debug.Logger.prototype.shout=function(a,b){this.log(goog.debug.Logger.Level.SHOUT,a,b)};
goog.debug.Logger.prototype.severe=function(a,b){this.log(goog.debug.Logger.Level.SEVERE,a,b)};goog.debug.Logger.prototype.warning=function(a,b){this.log(goog.debug.Logger.Level.WARNING,a,b)};goog.debug.Logger.prototype.info=function(a,b){this.log(goog.debug.Logger.Level.INFO,a,b)};goog.debug.Logger.prototype.config=function(a,b){this.log(goog.debug.Logger.Level.CONFIG,a,b)};goog.debug.Logger.prototype.fine=function(a,b){this.log(goog.debug.Logger.Level.FINE,a,b)};
goog.debug.Logger.prototype.finer=function(a,b){this.log(goog.debug.Logger.Level.FINER,a,b)};goog.debug.Logger.prototype.finest=function(a,b){this.log(goog.debug.Logger.Level.FINEST,a,b)};goog.debug.Logger.prototype.logRecord=function(a){this.isLoggable(a.getLevel())&&this.doLogRecord_(a)};
goog.debug.Logger.prototype.doLogRecord_=function(a){goog.debug.Logger.logToProfilers("log:"+a.getMessage());if(goog.debug.Logger.ENABLE_HIERARCHY)for(var b=this;b;)b.callPublish_(a),b=b.getParent();else{b=0;for(var c;c=goog.debug.Logger.rootHandlers_[b++];)c(a)}};goog.debug.Logger.prototype.callPublish_=function(a){if(this.handlers_)for(var b=0,c;c=this.handlers_[b];b++)c(a)};goog.debug.Logger.prototype.setParent_=function(a){this.parent_=a};
goog.debug.Logger.prototype.addChild_=function(a,b){this.getChildren()[a]=b};goog.debug.LogManager={};goog.debug.LogManager.loggers_={};goog.debug.LogManager.rootLogger_=null;goog.debug.LogManager.initialize=function(){if(!goog.debug.LogManager.rootLogger_)goog.debug.LogManager.rootLogger_=new goog.debug.Logger(""),goog.debug.LogManager.loggers_[""]=goog.debug.LogManager.rootLogger_,goog.debug.LogManager.rootLogger_.setLevel(goog.debug.Logger.Level.CONFIG)};goog.debug.LogManager.getLoggers=function(){return goog.debug.LogManager.loggers_};
goog.debug.LogManager.getRoot=function(){goog.debug.LogManager.initialize();return goog.debug.LogManager.rootLogger_};goog.debug.LogManager.getLogger=function(a){goog.debug.LogManager.initialize();return goog.debug.LogManager.loggers_[a]||goog.debug.LogManager.createLogger_(a)};goog.debug.LogManager.createFunctionForCatchErrors=function(a){return function(b){(a||goog.debug.LogManager.getRoot()).severe("Error: "+b.message+" ("+b.fileName+" @ Line: "+b.line+")")}};
goog.debug.LogManager.createLogger_=function(a){var b=new goog.debug.Logger(a);if(goog.debug.Logger.ENABLE_HIERARCHY){var c=a.lastIndexOf("."),d=a.substr(0,c);c=a.substr(c+1);d=goog.debug.LogManager.getLogger(d);d.addChild_(c,b);b.setParent_(d)}return goog.debug.LogManager.loggers_[a]=b};goog.editor.Plugin=function(){goog.events.EventTarget.call(this);this.enabled_=this.activeOnUneditableFields()};goog.inherits(goog.editor.Plugin,goog.events.EventTarget);goog.editor.Plugin.prototype.fieldObject=null;goog.editor.Plugin.prototype.getFieldDomHelper=function(){return this.fieldObject&&this.fieldObject.getEditableDomHelper()};goog.editor.Plugin.prototype.autoDispose_=!0;goog.editor.Plugin.prototype.logger=goog.debug.Logger.getLogger("goog.editor.Plugin");
goog.editor.Plugin.prototype.registerFieldObject=function(a){this.fieldObject=a};goog.editor.Plugin.prototype.unregisterFieldObject=function(){if(this.fieldObject)this.disable(this.fieldObject),this.fieldObject=null};goog.editor.Plugin.prototype.enable=function(a){this.fieldObject==a?this.enabled_=!0:this.logger.severe("Trying to enable an unregistered field with this plugin.")};goog.editor.Plugin.prototype.disable=function(a){this.fieldObject==a?this.enabled_=!1:this.logger.severe("Trying to disable an unregistered field with this plugin.")};
goog.editor.Plugin.prototype.isEnabled=function(a){return this.fieldObject==a?this.enabled_:!1};goog.editor.Plugin.prototype.setAutoDispose=function(a){this.autoDispose_=a};goog.editor.Plugin.prototype.isAutoDispose=function(){return this.autoDispose_};goog.editor.Plugin.prototype.activeOnUneditableFields=goog.functions.FALSE;goog.editor.Plugin.prototype.isSilentCommand=goog.functions.FALSE;
goog.editor.Plugin.prototype.disposeInternal=function(){this.fieldObject&&this.unregisterFieldObject(this.fieldObject);goog.editor.Plugin.superClass_.disposeInternal.call(this)};goog.editor.Plugin.Op={KEYDOWN:1,KEYPRESS:2,KEYUP:3,SELECTION:4,SHORTCUT:5,EXEC_COMMAND:6,QUERY_COMMAND:7,PREPARE_CONTENTS_HTML:8,CLEAN_CONTENTS_HTML:10,CLEAN_CONTENTS_DOM:11};
goog.editor.Plugin.OPCODE=goog.object.transpose(goog.reflect.object(goog.editor.Plugin,{handleKeyDown:goog.editor.Plugin.Op.KEYDOWN,handleKeyPress:goog.editor.Plugin.Op.KEYPRESS,handleKeyUp:goog.editor.Plugin.Op.KEYUP,handleSelectionChange:goog.editor.Plugin.Op.SELECTION,handleKeyboardShortcut:goog.editor.Plugin.Op.SHORTCUT,execCommand:goog.editor.Plugin.Op.EXEC_COMMAND,queryCommandValue:goog.editor.Plugin.Op.QUERY_COMMAND,prepareContentsHtml:goog.editor.Plugin.Op.PREPARE_CONTENTS_HTML,cleanContentsHtml:goog.editor.Plugin.Op.CLEAN_CONTENTS_HTML,
cleanContentsDom:goog.editor.Plugin.Op.CLEAN_CONTENTS_DOM}));goog.editor.Plugin.IRREPRESSIBLE_OPS=goog.object.createSet(goog.editor.Plugin.Op.PREPARE_CONTENTS_HTML,goog.editor.Plugin.Op.CLEAN_CONTENTS_HTML,goog.editor.Plugin.Op.CLEAN_CONTENTS_DOM);
goog.editor.Plugin.prototype.execCommand=function(a){var b=this.isSilentCommand(a);b||(goog.userAgent.GECKO&&this.fieldObject.stopChangeEvents(!0,!0),this.fieldObject.dispatchBeforeChange());try{var c=this.execCommandInternal.apply(this,arguments)}finally{b||(this.fieldObject.dispatchChange(),a!=goog.editor.Command.LINK&&this.fieldObject.dispatchSelectionChangeEvent())}return c};goog.editor.Plugin.prototype.isSupportedCommand=function(){return!1};goog.editor.plugins={};goog.editor.plugins.LoremIpsum=function(a){goog.editor.Plugin.call(this);this.message_=a};goog.inherits(goog.editor.plugins.LoremIpsum,goog.editor.Plugin);goog.editor.plugins.LoremIpsum.prototype.getTrogClassId=goog.functions.constant("LoremIpsum");goog.editor.plugins.LoremIpsum.prototype.activeOnUneditableFields=goog.functions.TRUE;goog.editor.plugins.LoremIpsum.prototype.usingLorem_=!1;
goog.editor.plugins.LoremIpsum.prototype.queryCommandValue=function(a){return a==goog.editor.Command.USING_LOREM&&this.usingLorem_};goog.editor.plugins.LoremIpsum.prototype.execCommand=function(a,b){a==goog.editor.Command.CLEAR_LOREM?this.clearLorem_(b):a==goog.editor.Command.UPDATE_LOREM&&this.updateLorem_()};goog.editor.plugins.LoremIpsum.prototype.isSupportedCommand=function(a){return a==goog.editor.Command.CLEAR_LOREM||a==goog.editor.Command.UPDATE_LOREM||a==goog.editor.Command.USING_LOREM};
goog.editor.plugins.LoremIpsum.prototype.updateLorem_=function(){var a=this.fieldObject;if(!this.usingLorem_&&!a.inModalMode()&&goog.editor.Field.getActiveFieldId()!=a.id){var b=a.getElement();b||(b=a.getOriginalElement());goog.asserts.assert(b);if(goog.editor.node.isEmpty(b))this.usingLorem_=!0,this.oldFontStyle_=b.style.fontStyle,b.style.fontStyle="italic",a.setHtml(!0,this.message_,!0)}};
goog.editor.plugins.LoremIpsum.prototype.clearLorem_=function(a){var b=this.fieldObject;if(this.usingLorem_&&!b.inModalMode()){var c=b.getElement();c||(c=b.getOriginalElement());goog.asserts.assert(c);this.usingLorem_=!1;c.style.fontStyle=this.oldFontStyle_;b.setHtml(!0,null,!0);a&&b.isLoaded()&&(goog.userAgent.WEBKIT?(goog.dom.getOwnerDocument(b.getElement()).body.focus(),b.focusAndPlaceCursorAtStart()):goog.userAgent.OPERA&&b.placeCursorAtStart())}};goog.editor.defines={};goog.editor.defines.USE_CONTENTEDITABLE_IN_FIREFOX_3=!1;goog.userAgent.product={};goog.userAgent.product.ASSUME_FIREFOX=!1;goog.userAgent.product.ASSUME_CAMINO=!1;goog.userAgent.product.ASSUME_IPHONE=!1;goog.userAgent.product.ASSUME_IPAD=!1;goog.userAgent.product.ASSUME_ANDROID=!1;goog.userAgent.product.ASSUME_CHROME=!1;goog.userAgent.product.ASSUME_SAFARI=!1;
goog.userAgent.product.PRODUCT_KNOWN_=goog.userAgent.ASSUME_IE||goog.userAgent.ASSUME_OPERA||goog.userAgent.product.ASSUME_FIREFOX||goog.userAgent.product.ASSUME_CAMINO||goog.userAgent.product.ASSUME_IPHONE||goog.userAgent.product.ASSUME_IPAD||goog.userAgent.product.ASSUME_ANDROID||goog.userAgent.product.ASSUME_CHROME||goog.userAgent.product.ASSUME_SAFARI;
goog.userAgent.product.init_=function(){goog.userAgent.product.detectedFirefox_=!1;goog.userAgent.product.detectedCamino_=!1;goog.userAgent.product.detectedIphone_=!1;goog.userAgent.product.detectedIpad_=!1;goog.userAgent.product.detectedAndroid_=!1;goog.userAgent.product.detectedChrome_=!1;goog.userAgent.product.detectedSafari_=!1;var a=goog.userAgent.getUserAgentString();if(a)if(a.indexOf("Firefox")!=-1)goog.userAgent.product.detectedFirefox_=!0;else if(a.indexOf("Camino")!=-1)goog.userAgent.product.detectedCamino_=
!0;else if(a.indexOf("iPhone")!=-1||a.indexOf("iPod")!=-1)goog.userAgent.product.detectedIphone_=!0;else if(a.indexOf("iPad")!=-1)goog.userAgent.product.detectedIpad_=!0;else if(a.indexOf("Android")!=-1)goog.userAgent.product.detectedAndroid_=!0;else if(a.indexOf("Chrome")!=-1)goog.userAgent.product.detectedChrome_=!0;else if(a.indexOf("Safari")!=-1)goog.userAgent.product.detectedSafari_=!0};goog.userAgent.product.PRODUCT_KNOWN_||goog.userAgent.product.init_();goog.userAgent.product.OPERA=goog.userAgent.OPERA;
goog.userAgent.product.IE=goog.userAgent.IE;goog.userAgent.product.FIREFOX=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_FIREFOX:goog.userAgent.product.detectedFirefox_;goog.userAgent.product.CAMINO=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_CAMINO:goog.userAgent.product.detectedCamino_;goog.userAgent.product.IPHONE=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_IPHONE:goog.userAgent.product.detectedIphone_;
goog.userAgent.product.IPAD=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_IPAD:goog.userAgent.product.detectedIpad_;goog.userAgent.product.ANDROID=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_ANDROID:goog.userAgent.product.detectedAndroid_;goog.userAgent.product.CHROME=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_CHROME:goog.userAgent.product.detectedChrome_;
goog.userAgent.product.SAFARI=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_SAFARI:goog.userAgent.product.detectedSafari_;goog.userAgent.product.determineVersion_=function(){var a="",b,c;if(goog.userAgent.product.FIREFOX)b=/Firefox\/([0-9.]+)/;else if(goog.userAgent.product.IE||goog.userAgent.product.OPERA)return goog.userAgent.VERSION;else goog.userAgent.product.CHROME?b=/Chrome\/([0-9.]+)/:goog.userAgent.product.SAFARI?b=/Version\/([0-9.]+)/:goog.userAgent.product.IPHONE||goog.userAgent.product.IPAD?(b=/Version\/(\S+).*Mobile\/(\S+)/,c=!0):goog.userAgent.product.ANDROID?b=/Android\s+([0-9.]+)(?:.*Version\/([0-9.]+))?/:
goog.userAgent.product.CAMINO&&(b=/Camino\/([0-9.]+)/);b&&(a=(a=b.exec(goog.userAgent.getUserAgentString()))?c?a[1]+"."+a[2]:a[2]||a[1]:"");return a};goog.userAgent.product.VERSION=goog.userAgent.product.determineVersion_();goog.userAgent.product.isVersion=function(a){return goog.string.compareVersions(goog.userAgent.product.VERSION,a)>=0};goog.editor.BrowserFeature={HAS_IE_RANGES:goog.userAgent.IE&&!goog.userAgent.isDocumentMode(9),HAS_W3C_RANGES:goog.userAgent.GECKO||goog.userAgent.WEBKIT||goog.userAgent.OPERA||goog.userAgent.IE&&goog.userAgent.isDocumentMode(9),HAS_CONTENT_EDITABLE:goog.userAgent.IE||goog.userAgent.WEBKIT||goog.userAgent.OPERA||goog.editor.defines.USE_CONTENTEDITABLE_IN_FIREFOX_3&&goog.userAgent.GECKO&&goog.userAgent.isVersion("1.9"),USE_MUTATION_EVENTS:goog.userAgent.GECKO,HAS_DOM_SUBTREE_MODIFIED_EVENT:goog.userAgent.WEBKIT||
goog.editor.defines.USE_CONTENTEDITABLE_IN_FIREFOX_3&&goog.userAgent.GECKO&&goog.userAgent.isVersion("1.9"),HAS_DOCUMENT_INDEPENDENT_NODES:goog.userAgent.GECKO,PUTS_CURSOR_BEFORE_FIRST_BLOCK_ELEMENT_ON_FOCUS:goog.userAgent.GECKO,CLEARS_SELECTION_WHEN_FOCUS_LEAVES:goog.userAgent.IE||goog.userAgent.WEBKIT||goog.userAgent.OPERA,HAS_UNSELECTABLE_STYLE:goog.userAgent.GECKO||goog.userAgent.WEBKIT,FORMAT_BLOCK_WORKS_FOR_BLOCKQUOTES:goog.userAgent.GECKO||goog.userAgent.WEBKIT||goog.userAgent.OPERA,CREATES_MULTIPLE_BLOCKQUOTES:goog.userAgent.WEBKIT&&
!goog.userAgent.isVersion("534.16")||goog.userAgent.OPERA,WRAPS_BLOCKQUOTE_IN_DIVS:goog.userAgent.OPERA,PREFERS_READY_STATE_CHANGE_EVENT:goog.userAgent.IE,TAB_FIRES_KEYPRESS:!goog.userAgent.IE,NEEDS_99_WIDTH_IN_STANDARDS_MODE:goog.userAgent.IE,USE_DOCUMENT_FOR_KEY_EVENTS:goog.userAgent.GECKO&&!goog.editor.defines.USE_CONTENTEDITABLE_IN_FIREFOX_3,SHOWS_CUSTOM_ATTRS_IN_INNER_HTML:goog.userAgent.IE,COLLAPSES_EMPTY_NODES:goog.userAgent.GECKO||goog.userAgent.WEBKIT||goog.userAgent.OPERA,CONVERT_TO_B_AND_I_TAGS:goog.userAgent.GECKO||
goog.userAgent.OPERA,TABS_THROUGH_IMAGES:goog.userAgent.IE,UNESCAPES_URLS_WITHOUT_ASKING:goog.userAgent.IE&&!goog.userAgent.isVersion("7.0"),HAS_STYLE_WITH_CSS:goog.userAgent.GECKO&&goog.userAgent.isVersion("1.8")||goog.userAgent.WEBKIT||goog.userAgent.OPERA,FOLLOWS_EDITABLE_LINKS:goog.userAgent.WEBKIT,HAS_ACTIVE_ELEMENT:goog.userAgent.IE||goog.userAgent.OPERA||goog.userAgent.GECKO&&goog.userAgent.isVersion("1.9"),HAS_SET_CAPTURE:goog.userAgent.IE,EATS_EMPTY_BACKGROUND_COLOR:goog.userAgent.GECKO||
goog.userAgent.WEBKIT&&!goog.userAgent.isVersion("527"),SUPPORTS_FOCUSIN:goog.userAgent.IE||goog.userAgent.OPERA,SELECTS_IMAGES_ON_CLICK:goog.userAgent.IE||goog.userAgent.OPERA,MOVES_STYLE_TO_HEAD:goog.userAgent.WEBKIT,COLLAPSES_SELECTION_ONMOUSEDOWN:!1,CARET_INSIDE_SELECTION:goog.userAgent.OPERA,FOCUSES_EDITABLE_BODY_ON_HTML_CLICK:!0,USES_KEYDOWN:goog.userAgent.IE||goog.userAgent.WEBKIT&&goog.userAgent.isVersion("525"),ADDS_NBSPS_IN_REMOVE_FORMAT:goog.userAgent.WEBKIT&&!goog.userAgent.isVersion("531"),
GETS_STUCK_IN_LINKS:goog.userAgent.WEBKIT&&!goog.userAgent.isVersion("528"),NORMALIZE_CORRUPTS_EMPTY_TEXT_NODES:goog.userAgent.GECKO&&goog.userAgent.isVersion("1.9")||goog.userAgent.IE||goog.userAgent.OPERA||goog.userAgent.WEBKIT&&goog.userAgent.isVersion("531"),NORMALIZE_CORRUPTS_ALL_TEXT_NODES:goog.userAgent.IE,NESTS_SUBSCRIPT_SUPERSCRIPT:goog.userAgent.IE||goog.userAgent.GECKO||goog.userAgent.OPERA,CAN_SELECT_EMPTY_ELEMENT:!goog.userAgent.IE&&!goog.userAgent.WEBKIT,FORGETS_FORMATTING_WHEN_LISTIFYING:goog.userAgent.GECKO||
goog.userAgent.WEBKIT&&!goog.userAgent.isVersion("526"),LEAVES_P_WHEN_REMOVING_LISTS:goog.userAgent.IE||goog.userAgent.OPERA,CAN_LISTIFY_BR:!goog.userAgent.IE&&!goog.userAgent.OPERA,DOESNT_OVERRIDE_FONT_SIZE_IN_STYLE_ATTR:!goog.userAgent.WEBKIT,SUPPORTS_HTML5_FILE_DRAGGING:goog.userAgent.product.CHROME&&goog.userAgent.product.isVersion("4")||goog.userAgent.product.SAFARI&&goog.userAgent.isVersion("533")||goog.userAgent.GECKO&&goog.userAgent.isVersion("2.0"),SUPPORTS_OPERA_DEFAULTBLOCK_COMMAND:goog.userAgent.OPERA&&
goog.userAgent.isVersion("11.10"),SUPPORTS_FILE_PASTING:goog.userAgent.product.CHROME&&goog.userAgent.product.isVersion("12")};goog.editor.style={};goog.editor.style.getComputedOrCascadedStyle_=function(a,b){if(a.nodeType!=goog.dom.NodeType.ELEMENT)return null;return goog.userAgent.IE?goog.style.getCascadedStyle(a,b):goog.style.getComputedStyle(a,b)};goog.editor.style.isDisplayBlock=function(a){return goog.editor.style.getComputedOrCascadedStyle_(a,"display")=="block"};goog.editor.style.isContainer=function(a){var b=a&&a.nodeName.toLowerCase();return!(!a||!goog.editor.style.isDisplayBlock(a)&&!(b=="td"||b=="table"||b=="li"))};
goog.editor.style.getContainer=function(a){return goog.dom.getAncestor(a,goog.editor.style.isContainer,!0)};goog.editor.style.SELECTABLE_INPUT_TYPES_=goog.object.createSet("text","file","url");goog.editor.style.cancelMouseDownHelper_=function(a){var b=a.target.tagName;b!=goog.dom.TagName.TEXTAREA&&b!=goog.dom.TagName.INPUT&&a.preventDefault()};
goog.editor.style.makeUnselectable=function(a,b){goog.editor.BrowserFeature.HAS_UNSELECTABLE_STYLE&&b.listen(a,goog.events.EventType.MOUSEDOWN,goog.editor.style.cancelMouseDownHelper_,!0);goog.style.setUnselectable(a,!0);for(var c=a.getElementsByTagName(goog.dom.TagName.INPUT),d=0,e=c.length;d<e;d++){var f=c[d];f.type in goog.editor.style.SELECTABLE_INPUT_TYPES_&&goog.editor.style.makeSelectable(f)}goog.array.forEach(a.getElementsByTagName(goog.dom.TagName.TEXTAREA),goog.editor.style.makeSelectable)};
goog.editor.style.makeSelectable=function(a){goog.style.setUnselectable(a,!1);if(goog.editor.BrowserFeature.HAS_UNSELECTABLE_STYLE){var b=a;for(a=a.parentNode;a&&a.tagName!=goog.dom.TagName.HTML;){if(goog.style.isUnselectable(a)){goog.style.setUnselectable(a,!1,!0);for(var c=0,d=a.childNodes.length;c<d;c++){var e=a.childNodes[c];e!=b&&e.nodeType==goog.dom.NodeType.ELEMENT&&goog.style.setUnselectable(a.childNodes[c],!0)}}b=a;a=a.parentNode}}};goog.dom.RangeEndpoint={START:1,END:0};goog.dom.SavedRange=function(){goog.Disposable.call(this)};goog.inherits(goog.dom.SavedRange,goog.Disposable);goog.dom.SavedRange.logger_=goog.debug.Logger.getLogger("goog.dom.SavedRange");goog.dom.SavedRange.prototype.restore=function(a){this.isDisposed()&&goog.dom.SavedRange.logger_.severe("Disposed SavedRange objects cannot be restored.");var b=this.restoreInternal();a||this.dispose();return b};goog.dom.SavedCaretRange=function(a){goog.dom.SavedRange.call(this);this.startCaretId_=goog.string.createUniqueString();this.endCaretId_=goog.string.createUniqueString();this.dom_=goog.dom.getDomHelper(a.getDocument());a.surroundWithNodes(this.createCaret_(!0),this.createCaret_(!1))};goog.inherits(goog.dom.SavedCaretRange,goog.dom.SavedRange);
goog.dom.SavedCaretRange.prototype.toAbstractRange=function(){var a=null,b=this.getCaret(!0),c=this.getCaret(!1);b&&c&&(a=goog.dom.Range.createFromNodes(b,0,c,0));return a};goog.dom.SavedCaretRange.prototype.getCaret=function(a){return this.dom_.getElement(a?this.startCaretId_:this.endCaretId_)};goog.dom.SavedCaretRange.prototype.removeCarets=function(a){goog.dom.removeNode(this.getCaret(!0));goog.dom.removeNode(this.getCaret(!1));return a};
goog.dom.SavedCaretRange.prototype.setRestorationDocument=function(a){this.dom_.setDocument(a)};goog.dom.SavedCaretRange.prototype.restoreInternal=function(){var a=null,b=this.getCaret(!0),c=this.getCaret(!1);if(b&&c){a=b.parentNode;b=goog.array.indexOf(a.childNodes,b);var d=c.parentNode;c=goog.array.indexOf(d.childNodes,c);d==a&&(c-=1);a=goog.dom.Range.createFromNodes(a,b,d,c);a=this.removeCarets(a);a.select()}else this.removeCarets();return a};
goog.dom.SavedCaretRange.prototype.disposeInternal=function(){this.removeCarets();this.dom_=null};goog.dom.SavedCaretRange.prototype.createCaret_=function(a){return this.dom_.createDom(goog.dom.TagName.SPAN,{id:a?this.startCaretId_:this.endCaretId_})};goog.dom.SavedCaretRange.CARET_REGEX=/<span\s+id="?goog_\d+"?><\/span>/ig;goog.dom.SavedCaretRange.htmlEqual=function(a,b){return a==b||a.replace(goog.dom.SavedCaretRange.CARET_REGEX,"")==b.replace(goog.dom.SavedCaretRange.CARET_REGEX,"")};goog.dom.TagWalkType={START_TAG:1,OTHER:0,END_TAG:-1};goog.dom.TagIterator=function(a,b,c,d,e){this.reversed=!!b;a&&this.setPosition(a,d);this.depth=e!=void 0?e:this.tagType||0;this.reversed&&(this.depth*=-1);this.constrained=!c};goog.inherits(goog.dom.TagIterator,goog.iter.Iterator);goog.dom.TagIterator.prototype.node=null;goog.dom.TagIterator.prototype.tagType=goog.dom.TagWalkType.OTHER;goog.dom.TagIterator.prototype.started_=!1;
goog.dom.TagIterator.prototype.setPosition=function(a,b,c){if(this.node=a)this.tagType=goog.isNumber(b)?b:this.node.nodeType!=goog.dom.NodeType.ELEMENT?goog.dom.TagWalkType.OTHER:this.reversed?goog.dom.TagWalkType.END_TAG:goog.dom.TagWalkType.START_TAG;if(goog.isNumber(c))this.depth=c};goog.dom.TagIterator.prototype.copyFrom=function(a){this.node=a.node;this.tagType=a.tagType;this.depth=a.depth;this.reversed=a.reversed;this.constrained=a.constrained};
goog.dom.TagIterator.prototype.clone=function(){return new goog.dom.TagIterator(this.node,this.reversed,!this.constrained,this.tagType,this.depth)};goog.dom.TagIterator.prototype.skipTag=function(){var a=this.reversed?goog.dom.TagWalkType.END_TAG:goog.dom.TagWalkType.START_TAG;if(this.tagType==a)this.tagType=a*-1,this.depth+=this.tagType*(this.reversed?-1:1)};
goog.dom.TagIterator.prototype.restartTag=function(){var a=this.reversed?goog.dom.TagWalkType.START_TAG:goog.dom.TagWalkType.END_TAG;if(this.tagType==a)this.tagType=a*-1,this.depth+=this.tagType*(this.reversed?-1:1)};
goog.dom.TagIterator.prototype.next=function(){var a;if(this.started_){if(!this.node||this.constrained&&this.depth==0)throw goog.iter.StopIteration;a=this.node;var b=this.reversed?goog.dom.TagWalkType.END_TAG:goog.dom.TagWalkType.START_TAG;if(this.tagType==b){var c=this.reversed?a.lastChild:a.firstChild;c?this.setPosition(c):this.setPosition(a,b*-1)}else(c=this.reversed?a.previousSibling:a.nextSibling)?this.setPosition(c):this.setPosition(a.parentNode,b*-1);this.depth+=this.tagType*(this.reversed?
-1:1)}else this.started_=!0;a=this.node;if(!this.node)throw goog.iter.StopIteration;return a};goog.dom.TagIterator.prototype.isStarted=function(){return this.started_};goog.dom.TagIterator.prototype.isStartTag=function(){return this.tagType==goog.dom.TagWalkType.START_TAG};goog.dom.TagIterator.prototype.isEndTag=function(){return this.tagType==goog.dom.TagWalkType.END_TAG};goog.dom.TagIterator.prototype.isNonElement=function(){return this.tagType==goog.dom.TagWalkType.OTHER};
goog.dom.TagIterator.prototype.equals=function(a){return a.node==this.node&&(!this.node||a.tagType==this.tagType)};goog.dom.TagIterator.prototype.splice=function(){var a=this.node;this.restartTag();this.reversed=!this.reversed;goog.dom.TagIterator.prototype.next.call(this);this.reversed=!this.reversed;for(var b=goog.isArrayLike(arguments[0])?arguments[0]:arguments,c=b.length-1;c>=0;c--)goog.dom.insertSiblingAfter(b[c],a);goog.dom.removeNode(a)};goog.dom.RangeType={TEXT:"text",CONTROL:"control",MULTI:"mutli"};goog.dom.AbstractRange=function(){};goog.dom.AbstractRange.getBrowserSelectionForWindow=function(a){if(a.getSelection)return a.getSelection();else{a=a.document;var b=a.selection;if(b){try{var c=b.createRange();if(c.parentElement){if(c.parentElement().document!=a)return null}else if(!c.length||c.item(0).document!=a)return null}catch(d){return null}return b}return null}};
goog.dom.AbstractRange.isNativeControlRange=function(a){return!!a&&!!a.addElement};goog.dom.AbstractRange.prototype.setBrowserRangeObject=function(){return!1};goog.dom.AbstractRange.prototype.getTextRanges=function(){for(var a=[],b=0,c=this.getTextRangeCount();b<c;b++)a.push(this.getTextRange(b));return a};goog.dom.AbstractRange.prototype.getContainerElement=function(){var a=this.getContainer();return a.nodeType==goog.dom.NodeType.ELEMENT?a:a.parentNode};
goog.dom.AbstractRange.prototype.getAnchorNode=function(){return this.isReversed()?this.getEndNode():this.getStartNode()};goog.dom.AbstractRange.prototype.getAnchorOffset=function(){return this.isReversed()?this.getEndOffset():this.getStartOffset()};goog.dom.AbstractRange.prototype.getFocusNode=function(){return this.isReversed()?this.getStartNode():this.getEndNode()};goog.dom.AbstractRange.prototype.getFocusOffset=function(){return this.isReversed()?this.getStartOffset():this.getEndOffset()};
goog.dom.AbstractRange.prototype.isReversed=function(){return!1};goog.dom.AbstractRange.prototype.getDocument=function(){return goog.dom.getOwnerDocument(goog.userAgent.IE?this.getContainer():this.getStartNode())};goog.dom.AbstractRange.prototype.getWindow=function(){return goog.dom.getWindow(this.getDocument())};goog.dom.AbstractRange.prototype.containsNode=function(a,b){return this.containsRange(goog.dom.Range.createFromNodeContents(a),b)};
goog.dom.AbstractRange.prototype.replaceContentsWithNode=function(a){this.isCollapsed()||this.removeContents();return this.insertNode(a,!0)};goog.dom.AbstractRange.prototype.saveUsingCarets=function(){return this.getStartNode()&&this.getEndNode()?new goog.dom.SavedCaretRange(this):null};goog.dom.RangeIterator=function(a,b){goog.dom.TagIterator.call(this,a,b,!0)};goog.inherits(goog.dom.RangeIterator,goog.dom.TagIterator);goog.dom.AbstractMultiRange=function(){};goog.inherits(goog.dom.AbstractMultiRange,goog.dom.AbstractRange);goog.dom.AbstractMultiRange.prototype.containsRange=function(a,b){var c=this.getTextRanges(),d=a.getTextRanges();return(b?goog.array.some:goog.array.every)(d,function(a){return goog.array.some(c,function(c){return c.containsRange(a,b)})})};
goog.dom.AbstractMultiRange.prototype.insertNode=function(a,b){b?goog.dom.insertSiblingBefore(a,this.getStartNode()):goog.dom.insertSiblingAfter(a,this.getEndNode());return a};goog.dom.AbstractMultiRange.prototype.surroundWithNodes=function(a,b){this.insertNode(a,!0);this.insertNode(b,!1)};goog.dom.TextRangeIterator=function(a,b,c,d,e){var f;if(a){this.startNode_=a;this.startOffset_=b;this.endNode_=c;this.endOffset_=d;if(a.nodeType==goog.dom.NodeType.ELEMENT&&a.tagName!=goog.dom.TagName.BR)if(a=a.childNodes,b=a[b])this.startNode_=b,this.startOffset_=0;else{if(a.length)this.startNode_=goog.array.peek(a);f=!0}if(c.nodeType==goog.dom.NodeType.ELEMENT)(this.endNode_=c.childNodes[d])?this.endOffset_=0:this.endNode_=c}goog.dom.RangeIterator.call(this,e?this.endNode_:this.startNode_,e);if(f)try{this.next()}catch(g){if(g!=
goog.iter.StopIteration)throw g;}};goog.inherits(goog.dom.TextRangeIterator,goog.dom.RangeIterator);goog.dom.TextRangeIterator.prototype.startNode_=null;goog.dom.TextRangeIterator.prototype.endNode_=null;goog.dom.TextRangeIterator.prototype.startOffset_=0;goog.dom.TextRangeIterator.prototype.endOffset_=0;goog.dom.TextRangeIterator.prototype.getStartTextOffset=function(){return this.node.nodeType!=goog.dom.NodeType.TEXT?-1:this.node==this.startNode_?this.startOffset_:0};
goog.dom.TextRangeIterator.prototype.getEndTextOffset=function(){return this.node.nodeType!=goog.dom.NodeType.TEXT?-1:this.node==this.endNode_?this.endOffset_:this.node.nodeValue.length};goog.dom.TextRangeIterator.prototype.getStartNode=function(){return this.startNode_};goog.dom.TextRangeIterator.prototype.setStartNode=function(a){this.isStarted()||this.setPosition(a);this.startNode_=a;this.startOffset_=0};goog.dom.TextRangeIterator.prototype.getEndNode=function(){return this.endNode_};
goog.dom.TextRangeIterator.prototype.setEndNode=function(a){this.endNode_=a;this.endOffset_=0};goog.dom.TextRangeIterator.prototype.isLast=function(){return this.isStarted()&&this.node==this.endNode_&&(!this.endOffset_||!this.isStartTag())};goog.dom.TextRangeIterator.prototype.next=function(){if(this.isLast())throw goog.iter.StopIteration;return goog.dom.TextRangeIterator.superClass_.next.call(this)};
goog.dom.TextRangeIterator.prototype.skipTag=function(){goog.dom.TextRangeIterator.superClass_.skipTag.apply(this);if(goog.dom.contains(this.node,this.endNode_))throw goog.iter.StopIteration;};goog.dom.TextRangeIterator.prototype.copyFrom=function(a){this.startNode_=a.startNode_;this.endNode_=a.endNode_;this.startOffset_=a.startOffset_;this.endOffset_=a.endOffset_;this.isReversed_=a.isReversed_;goog.dom.TextRangeIterator.superClass_.copyFrom.call(this,a)};
goog.dom.TextRangeIterator.prototype.clone=function(){var a=new goog.dom.TextRangeIterator(this.startNode_,this.startOffset_,this.endNode_,this.endOffset_,this.isReversed_);a.copyFrom(this);return a};goog.userAgent.jscript={};goog.userAgent.jscript.ASSUME_NO_JSCRIPT=!1;goog.userAgent.jscript.init_=function(){goog.userAgent.jscript.DETECTED_HAS_JSCRIPT_="ScriptEngine"in goog.global&&goog.global.ScriptEngine()=="JScript";goog.userAgent.jscript.DETECTED_VERSION_=goog.userAgent.jscript.DETECTED_HAS_JSCRIPT_?goog.global.ScriptEngineMajorVersion()+"."+goog.global.ScriptEngineMinorVersion()+"."+goog.global.ScriptEngineBuildVersion():"0"};goog.userAgent.jscript.ASSUME_NO_JSCRIPT||goog.userAgent.jscript.init_();
goog.userAgent.jscript.HAS_JSCRIPT=goog.userAgent.jscript.ASSUME_NO_JSCRIPT?!1:goog.userAgent.jscript.DETECTED_HAS_JSCRIPT_;goog.userAgent.jscript.VERSION=goog.userAgent.jscript.ASSUME_NO_JSCRIPT?"0":goog.userAgent.jscript.DETECTED_VERSION_;goog.userAgent.jscript.isVersion=function(a){return goog.string.compareVersions(goog.userAgent.jscript.VERSION,a)>=0};goog.string.StringBuffer=function(a){this.buffer_=goog.userAgent.jscript.HAS_JSCRIPT?[]:"";a!=null&&this.append.apply(this,arguments)};goog.string.StringBuffer.prototype.set=function(a){this.clear();this.append(a)};
goog.userAgent.jscript.HAS_JSCRIPT?(goog.string.StringBuffer.prototype.bufferLength_=0,goog.string.StringBuffer.prototype.append=function(a,b){b==null?this.buffer_[this.bufferLength_++]=a:(this.buffer_.push.apply(this.buffer_,arguments),this.bufferLength_=this.buffer_.length);return this}):goog.string.StringBuffer.prototype.append=function(a,b){this.buffer_+=a;if(b!=null)for(var c=1;c<arguments.length;c++)this.buffer_+=arguments[c];return this};
goog.string.StringBuffer.prototype.clear=function(){goog.userAgent.jscript.HAS_JSCRIPT?this.bufferLength_=this.buffer_.length=0:this.buffer_=""};goog.string.StringBuffer.prototype.getLength=function(){return this.toString().length};goog.string.StringBuffer.prototype.toString=function(){if(goog.userAgent.jscript.HAS_JSCRIPT){var a=this.buffer_.join("");this.clear();a&&this.append(a);return a}else return this.buffer_};goog.dom.browserrange={};goog.dom.browserrange.AbstractRange=function(){};goog.dom.browserrange.AbstractRange.prototype.containsRange=function(a,b){var c=b&&!a.isCollapsed(),d=a.getBrowserRange(),e=goog.dom.RangeEndpoint.START,f=goog.dom.RangeEndpoint.END;try{return c?this.compareBrowserRangeEndpoints(d,f,e)>=0&&this.compareBrowserRangeEndpoints(d,e,f)<=0:this.compareBrowserRangeEndpoints(d,f,f)>=0&&this.compareBrowserRangeEndpoints(d,e,e)<=0}catch(g){if(!goog.userAgent.IE)throw g;return!1}};
goog.dom.browserrange.AbstractRange.prototype.containsNode=function(a,b){return this.containsRange(goog.dom.browserrange.createRangeFromNodeContents(a),b)};
goog.dom.browserrange.AbstractRange.prototype.getHtmlFragment=function(){var a=new goog.string.StringBuffer;goog.iter.forEach(this,function(b,c,d){b.nodeType==goog.dom.NodeType.TEXT?a.append(goog.string.htmlEscape(b.nodeValue.substring(d.getStartTextOffset(),d.getEndTextOffset()))):b.nodeType==goog.dom.NodeType.ELEMENT&&(d.isEndTag()?goog.dom.canHaveChildren(b)&&a.append("</"+b.tagName+">"):(c=b.cloneNode(!1),c=goog.dom.getOuterHtml(c),goog.userAgent.IE&&b.tagName==goog.dom.TagName.LI?a.append(c):
(b=c.lastIndexOf("<"),a.append(b?c.substr(0,b):c))))},this);return a.toString()};goog.dom.browserrange.AbstractRange.prototype.__iterator__=function(){return new goog.dom.TextRangeIterator(this.getStartNode(),this.getStartOffset(),this.getEndNode(),this.getEndOffset())};goog.dom.browserrange.W3cRange=function(a){this.range_=a};goog.inherits(goog.dom.browserrange.W3cRange,goog.dom.browserrange.AbstractRange);
goog.dom.browserrange.W3cRange.getBrowserRangeForNode=function(a){var b=goog.dom.getOwnerDocument(a).createRange();if(a.nodeType==goog.dom.NodeType.TEXT)b.setStart(a,0),b.setEnd(a,a.length);else if(goog.dom.browserrange.canContainRangeEndpoint(a)){for(var c,d=a;(c=d.firstChild)&&goog.dom.browserrange.canContainRangeEndpoint(c);)d=c;b.setStart(d,0);for(d=a;(c=d.lastChild)&&goog.dom.browserrange.canContainRangeEndpoint(c);)d=c;b.setEnd(d,d.nodeType==goog.dom.NodeType.ELEMENT?d.childNodes.length:d.length)}else c=
a.parentNode,a=goog.array.indexOf(c.childNodes,a),b.setStart(c,a),b.setEnd(c,a+1);return b};goog.dom.browserrange.W3cRange.getBrowserRangeForNodes=function(a,b,c,d){var e=goog.dom.getOwnerDocument(a).createRange();e.setStart(a,b);e.setEnd(c,d);return e};goog.dom.browserrange.W3cRange.createFromNodeContents=function(a){return new goog.dom.browserrange.W3cRange(goog.dom.browserrange.W3cRange.getBrowserRangeForNode(a))};
goog.dom.browserrange.W3cRange.createFromNodes=function(a,b,c,d){return new goog.dom.browserrange.W3cRange(goog.dom.browserrange.W3cRange.getBrowserRangeForNodes(a,b,c,d))};goog.dom.browserrange.W3cRange.prototype.clone=function(){return new this.constructor(this.range_.cloneRange())};goog.dom.browserrange.W3cRange.prototype.getBrowserRange=function(){return this.range_};goog.dom.browserrange.W3cRange.prototype.getContainer=function(){return this.range_.commonAncestorContainer};
goog.dom.browserrange.W3cRange.prototype.getStartNode=function(){return this.range_.startContainer};goog.dom.browserrange.W3cRange.prototype.getStartOffset=function(){return this.range_.startOffset};goog.dom.browserrange.W3cRange.prototype.getEndNode=function(){return this.range_.endContainer};goog.dom.browserrange.W3cRange.prototype.getEndOffset=function(){return this.range_.endOffset};
goog.dom.browserrange.W3cRange.prototype.compareBrowserRangeEndpoints=function(a,b,c){return this.range_.compareBoundaryPoints(c==goog.dom.RangeEndpoint.START?b==goog.dom.RangeEndpoint.START?goog.global.Range.START_TO_START:goog.global.Range.START_TO_END:b==goog.dom.RangeEndpoint.START?goog.global.Range.END_TO_START:goog.global.Range.END_TO_END,a)};goog.dom.browserrange.W3cRange.prototype.isCollapsed=function(){return this.range_.collapsed};goog.dom.browserrange.W3cRange.prototype.getText=function(){return this.range_.toString()};
goog.dom.browserrange.W3cRange.prototype.getValidHtml=function(){var a=goog.dom.getDomHelper(this.range_.startContainer).createDom("div");a.appendChild(this.range_.cloneContents());a=a.innerHTML;if(goog.string.startsWith(a,"<")||!this.isCollapsed()&&!goog.string.contains(a,"<"))return a;var b=this.getContainer();b=b.nodeType==goog.dom.NodeType.ELEMENT?b:b.parentNode;return goog.dom.getOuterHtml(b.cloneNode(!1)).replace(">",">"+a)};
goog.dom.browserrange.W3cRange.prototype.select=function(a){this.selectInternal(goog.dom.getWindow(goog.dom.getOwnerDocument(this.getStartNode())).getSelection(),a)};goog.dom.browserrange.W3cRange.prototype.selectInternal=function(a){a.removeAllRanges();a.addRange(this.range_)};
goog.dom.browserrange.W3cRange.prototype.removeContents=function(){var a=this.range_;a.extractContents();if(a.startContainer.hasChildNodes()&&(a=a.startContainer.childNodes[a.startOffset])){var b=a.previousSibling;goog.dom.getRawTextContent(a)==""&&goog.dom.removeNode(a);b&&goog.dom.getRawTextContent(b)==""&&goog.dom.removeNode(b)}};goog.dom.browserrange.W3cRange.prototype.surroundContents=function(a){this.range_.surroundContents(a);return a};
goog.dom.browserrange.W3cRange.prototype.insertNode=function(a,b){var c=this.range_.cloneRange();c.collapse(b);c.insertNode(a);c.detach();return a};
goog.dom.browserrange.W3cRange.prototype.surroundWithNodes=function(a,b){var c=goog.dom.getWindow(goog.dom.getOwnerDocument(this.getStartNode()));if(c=goog.dom.Range.createFromWindow(c))var d=c.getStartNode(),e=c.getEndNode(),f=c.getStartOffset(),g=c.getEndOffset();var h=this.range_.cloneRange(),i=this.range_.cloneRange();h.collapse(!1);i.collapse(!0);h.insertNode(b);i.insertNode(a);h.detach();i.detach();if(c){if(d.nodeType==goog.dom.NodeType.TEXT)for(;f>d.length;){f-=d.length;do d=d.nextSibling;
while(d==a||d==b)}if(e.nodeType==goog.dom.NodeType.TEXT)for(;g>e.length;){g-=e.length;do e=e.nextSibling;while(e==a||e==b)}goog.dom.Range.createFromNodes(d,f,e,g).select()}};goog.dom.browserrange.W3cRange.prototype.collapse=function(a){this.range_.collapse(a)};goog.dom.browserrange.WebKitRange=function(a){goog.dom.browserrange.W3cRange.call(this,a)};goog.inherits(goog.dom.browserrange.WebKitRange,goog.dom.browserrange.W3cRange);goog.dom.browserrange.WebKitRange.createFromNodeContents=function(a){return new goog.dom.browserrange.WebKitRange(goog.dom.browserrange.W3cRange.getBrowserRangeForNode(a))};
goog.dom.browserrange.WebKitRange.createFromNodes=function(a,b,c,d){return new goog.dom.browserrange.WebKitRange(goog.dom.browserrange.W3cRange.getBrowserRangeForNodes(a,b,c,d))};
goog.dom.browserrange.WebKitRange.prototype.compareBrowserRangeEndpoints=function(a,b,c){if(goog.userAgent.isVersion("528"))return goog.dom.browserrange.WebKitRange.superClass_.compareBrowserRangeEndpoints.call(this,a,b,c);return this.range_.compareBoundaryPoints(c==goog.dom.RangeEndpoint.START?b==goog.dom.RangeEndpoint.START?goog.global.Range.START_TO_START:goog.global.Range.END_TO_START:b==goog.dom.RangeEndpoint.START?goog.global.Range.START_TO_END:goog.global.Range.END_TO_END,a)};
goog.dom.browserrange.WebKitRange.prototype.selectInternal=function(a,b){a.removeAllRanges();b?a.setBaseAndExtent(this.getEndNode(),this.getEndOffset(),this.getStartNode(),this.getStartOffset()):a.setBaseAndExtent(this.getStartNode(),this.getStartOffset(),this.getEndNode(),this.getEndOffset())};goog.dom.NodeIterator=function(a,b,c,d){goog.dom.TagIterator.call(this,a,b,c,null,d)};goog.inherits(goog.dom.NodeIterator,goog.dom.TagIterator);goog.dom.NodeIterator.prototype.next=function(){do goog.dom.NodeIterator.superClass_.next.call(this);while(this.isEndTag());return this.node};goog.dom.browserrange.IeRange=function(a,b){this.range_=a;this.doc_=b};goog.inherits(goog.dom.browserrange.IeRange,goog.dom.browserrange.AbstractRange);goog.dom.browserrange.IeRange.logger_=goog.debug.Logger.getLogger("goog.dom.browserrange.IeRange");
goog.dom.browserrange.IeRange.getBrowserRangeForNode_=function(a){var b=goog.dom.getOwnerDocument(a).body.createTextRange();if(a.nodeType==goog.dom.NodeType.ELEMENT)b.moveToElementText(a),goog.dom.browserrange.canContainRangeEndpoint(a)&&!a.childNodes.length&&b.collapse(!1);else{for(var c=0,d=a;d=d.previousSibling;){var e=d.nodeType;if(e==goog.dom.NodeType.TEXT)c+=d.length;else if(e==goog.dom.NodeType.ELEMENT){b.moveToElementText(d);break}}d||b.moveToElementText(a.parentNode);b.collapse(!d);c&&b.move("character",
c);b.moveEnd("character",a.length)}return b};
goog.dom.browserrange.IeRange.getBrowserRangeForNodes_=function(a,b,c,d){var e=!1;a.nodeType==goog.dom.NodeType.ELEMENT&&(b>a.childNodes.length&&goog.dom.browserrange.IeRange.logger_.severe("Cannot have startOffset > startNode child count"),b=a.childNodes[b],e=!b,a=b||a.lastChild||a,b=0);var f=goog.dom.browserrange.IeRange.getBrowserRangeForNode_(a);b&&f.move("character",b);if(a==c&&b==d)return f.collapse(!0),f;e&&f.collapse(!1);e=!1;c.nodeType==goog.dom.NodeType.ELEMENT&&(d>c.childNodes.length&&
goog.dom.browserrange.IeRange.logger_.severe("Cannot have endOffset > endNode child count"),c=(b=c.childNodes[d])||c.lastChild||c,d=0,e=!b);a=goog.dom.browserrange.IeRange.getBrowserRangeForNode_(c);a.collapse(!e);d&&a.moveEnd("character",d);f.setEndPoint("EndToEnd",a);return f};
goog.dom.browserrange.IeRange.createFromNodeContents=function(a){var b=new goog.dom.browserrange.IeRange(goog.dom.browserrange.IeRange.getBrowserRangeForNode_(a),goog.dom.getOwnerDocument(a));if(goog.dom.browserrange.canContainRangeEndpoint(a)){for(var c,d=a;(c=d.firstChild)&&goog.dom.browserrange.canContainRangeEndpoint(c);)d=c;b.startNode_=d;b.startOffset_=0;for(d=a;(c=d.lastChild)&&goog.dom.browserrange.canContainRangeEndpoint(c);)d=c;b.endNode_=d;b.endOffset_=d.nodeType==goog.dom.NodeType.ELEMENT?
d.childNodes.length:d.length;b.parentNode_=a}else b.startNode_=b.endNode_=b.parentNode_=a.parentNode,b.startOffset_=goog.array.indexOf(b.parentNode_.childNodes,a),b.endOffset_=b.startOffset_+1;return b};goog.dom.browserrange.IeRange.createFromNodes=function(a,b,c,d){var e=new goog.dom.browserrange.IeRange(goog.dom.browserrange.IeRange.getBrowserRangeForNodes_(a,b,c,d),goog.dom.getOwnerDocument(a));e.startNode_=a;e.startOffset_=b;e.endNode_=c;e.endOffset_=d;return e};
goog.dom.browserrange.IeRange.prototype.parentNode_=null;goog.dom.browserrange.IeRange.prototype.startNode_=null;goog.dom.browserrange.IeRange.prototype.endNode_=null;goog.dom.browserrange.IeRange.prototype.startOffset_=-1;goog.dom.browserrange.IeRange.prototype.endOffset_=-1;goog.dom.browserrange.IeRange.prototype.clone=function(){var a=new goog.dom.browserrange.IeRange(this.range_.duplicate(),this.doc_);a.parentNode_=this.parentNode_;a.startNode_=this.startNode_;a.endNode_=this.endNode_;return a};
goog.dom.browserrange.IeRange.prototype.getBrowserRange=function(){return this.range_};goog.dom.browserrange.IeRange.prototype.clearCachedValues_=function(){this.parentNode_=this.startNode_=this.endNode_=null;this.startOffset_=this.endOffset_=-1};
goog.dom.browserrange.IeRange.prototype.getContainer=function(){if(!this.parentNode_){var a=this.range_.text,b=this.range_.duplicate(),c=a.replace(/ +$/,"");(c=a.length-c.length)&&b.moveEnd("character",-c);c=b.parentElement();b=goog.string.stripNewlines(b.htmlText).length;if(this.isCollapsed()&&b>0)return this.parentNode_=c;for(;b>goog.string.stripNewlines(c.outerHTML).length;)c=c.parentNode;for(;c.childNodes.length==1&&c.innerText==goog.dom.browserrange.IeRange.getNodeText_(c.firstChild);){if(!goog.dom.browserrange.canContainRangeEndpoint(c.firstChild))break;
c=c.firstChild}a.length==0&&(c=this.findDeepestContainer_(c));this.parentNode_=c}return this.parentNode_};
goog.dom.browserrange.IeRange.prototype.findDeepestContainer_=function(a){for(var b=a.childNodes,c=0,d=b.length;c<d;c++){var e=b[c];if(goog.dom.browserrange.canContainRangeEndpoint(e)){var f=goog.dom.browserrange.IeRange.getBrowserRangeForNode_(e),g=goog.dom.RangeEndpoint.START,h=goog.dom.RangeEndpoint.END,i=f.htmlText!=e.outerHTML;if(this.isCollapsed()&&i?this.compareBrowserRangeEndpoints(f,g,g)>=0&&this.compareBrowserRangeEndpoints(f,g,h)<=0:this.range_.inRange(f))return this.findDeepestContainer_(e)}}return a};
goog.dom.browserrange.IeRange.prototype.getStartNode=function(){if(!this.startNode_&&(this.startNode_=this.getEndpointNode_(goog.dom.RangeEndpoint.START),this.isCollapsed()))this.endNode_=this.startNode_;return this.startNode_};goog.dom.browserrange.IeRange.prototype.getStartOffset=function(){if(this.startOffset_<0&&(this.startOffset_=this.getOffset_(goog.dom.RangeEndpoint.START),this.isCollapsed()))this.endOffset_=this.startOffset_;return this.startOffset_};
goog.dom.browserrange.IeRange.prototype.getEndNode=function(){if(this.isCollapsed())return this.getStartNode();if(!this.endNode_)this.endNode_=this.getEndpointNode_(goog.dom.RangeEndpoint.END);return this.endNode_};goog.dom.browserrange.IeRange.prototype.getEndOffset=function(){if(this.isCollapsed())return this.getStartOffset();if(this.endOffset_<0&&(this.endOffset_=this.getOffset_(goog.dom.RangeEndpoint.END),this.isCollapsed()))this.startOffset_=this.endOffset_;return this.endOffset_};
goog.dom.browserrange.IeRange.prototype.compareBrowserRangeEndpoints=function(a,b,c){return this.range_.compareEndPoints((b==goog.dom.RangeEndpoint.START?"Start":"End")+"To"+(c==goog.dom.RangeEndpoint.START?"Start":"End"),a)};
goog.dom.browserrange.IeRange.prototype.getEndpointNode_=function(a,b){var c=b||this.getContainer();if(!c||!c.firstChild)return c;for(var d=goog.dom.RangeEndpoint.START,e=goog.dom.RangeEndpoint.END,f=a==d,g=0,h=c.childNodes.length;g<h;g++){var i=f?g:h-g-1,j=c.childNodes[i],k;try{k=goog.dom.browserrange.createRangeFromNodeContents(j)}catch(l){continue}var m=k.getBrowserRange();if(this.isCollapsed())if(goog.dom.browserrange.canContainRangeEndpoint(j)){if(k.containsRange(this))return this.getEndpointNode_(a,
j)}else{if(this.compareBrowserRangeEndpoints(m,d,d)==0){this.startOffset_=this.endOffset_=i;break}}else if(this.containsRange(k)){if(!goog.dom.browserrange.canContainRangeEndpoint(j)){f?this.startOffset_=i:this.endOffset_=i+1;break}return this.getEndpointNode_(a,j)}else if(this.compareBrowserRangeEndpoints(m,d,e)<0&&this.compareBrowserRangeEndpoints(m,e,d)>0)return this.getEndpointNode_(a,j)}return c};
goog.dom.browserrange.IeRange.prototype.compareNodeEndpoints_=function(a,b,c){return this.range_.compareEndPoints((b==goog.dom.RangeEndpoint.START?"Start":"End")+"To"+(c==goog.dom.RangeEndpoint.START?"Start":"End"),goog.dom.browserrange.createRangeFromNodeContents(a).getBrowserRange())};
goog.dom.browserrange.IeRange.prototype.getOffset_=function(a,b){var c=a==goog.dom.RangeEndpoint.START,d=b||(c?this.getStartNode():this.getEndNode());if(d.nodeType==goog.dom.NodeType.ELEMENT){d=d.childNodes;for(var e=d.length,f=c?1:-1,g=c?0:e-1;g>=0&&g<e;g+=f){var h=d[g];if(!goog.dom.browserrange.canContainRangeEndpoint(h)&&this.compareNodeEndpoints_(h,a,a)==0)return c?g:g+1}return g==-1?0:g}else return e=this.range_.duplicate(),f=goog.dom.browserrange.IeRange.getBrowserRangeForNode_(d),e.setEndPoint(c?
"EndToEnd":"StartToStart",f),e=e.text.length,c?d.length-e:e};goog.dom.browserrange.IeRange.getNodeText_=function(a){return a.nodeType==goog.dom.NodeType.TEXT?a.nodeValue:a.innerText};goog.dom.browserrange.IeRange.prototype.isRangeInDocument=function(){var a=this.doc_.body.createTextRange();a.moveToElementText(this.doc_.body);return this.containsRange(new goog.dom.browserrange.IeRange(a,this.doc_),!0)};
goog.dom.browserrange.IeRange.prototype.isCollapsed=function(){return this.range_.compareEndPoints("StartToEnd",this.range_)==0};goog.dom.browserrange.IeRange.prototype.getText=function(){return this.range_.text};goog.dom.browserrange.IeRange.prototype.getValidHtml=function(){return this.range_.htmlText};goog.dom.browserrange.IeRange.prototype.select=function(){this.range_.select()};
goog.dom.browserrange.IeRange.prototype.removeContents=function(){if(!this.isCollapsed()&&this.range_.htmlText){var a=this.getStartNode(),b=this.getEndNode(),c=this.range_.text,d=this.range_.duplicate();d.moveStart("character",1);d.moveStart("character",-1);if(d.text==c)this.range_=d;this.range_.text="";this.clearCachedValues_();c=this.getStartNode();d=this.getStartOffset();try{var e=a.nextSibling;if(a==b&&a.parentNode&&a.nodeType==goog.dom.NodeType.TEXT&&e&&e.nodeType==goog.dom.NodeType.TEXT)a.nodeValue+=
e.nodeValue,goog.dom.removeNode(e),this.range_=goog.dom.browserrange.IeRange.getBrowserRangeForNode_(c),this.range_.move("character",d),this.clearCachedValues_()}catch(f){}}};goog.dom.browserrange.IeRange.getDomHelper_=function(a){return goog.dom.getDomHelper(a.parentElement())};
goog.dom.browserrange.IeRange.pasteElement_=function(a,b,c){c=c||goog.dom.browserrange.IeRange.getDomHelper_(a);var d,e=d=b.id;if(!d)d=b.id=goog.string.createUniqueString();a.pasteHTML(b.outerHTML);(b=c.getElement(d))&&(e||b.removeAttribute("id"));return b};
goog.dom.browserrange.IeRange.prototype.surroundContents=function(a){goog.dom.removeNode(a);a.innerHTML=this.range_.htmlText;(a=goog.dom.browserrange.IeRange.pasteElement_(this.range_,a))&&this.range_.moveToElementText(a);this.clearCachedValues_();return a};
goog.dom.browserrange.IeRange.insertNode_=function(a,b,c,d){d=d||goog.dom.browserrange.IeRange.getDomHelper_(a);var e;b.nodeType!=goog.dom.NodeType.ELEMENT&&(e=!0,b=d.createDom(goog.dom.TagName.DIV,null,b));a.collapse(c);b=goog.dom.browserrange.IeRange.pasteElement_(a,b,d);if(e)a=b.firstChild,d.flattenElement(b),b=a;return b};goog.dom.browserrange.IeRange.prototype.insertNode=function(a,b){var c=goog.dom.browserrange.IeRange.insertNode_(this.range_.duplicate(),a,b);this.clearCachedValues_();return c};
goog.dom.browserrange.IeRange.prototype.surroundWithNodes=function(a,b){var c=this.range_.duplicate(),d=this.range_.duplicate();goog.dom.browserrange.IeRange.insertNode_(c,a,!0);goog.dom.browserrange.IeRange.insertNode_(d,b,!1);this.clearCachedValues_()};goog.dom.browserrange.IeRange.prototype.collapse=function(a){this.range_.collapse(a);a?(this.endNode_=this.startNode_,this.endOffset_=this.startOffset_):(this.startNode_=this.endNode_,this.startOffset_=this.endOffset_)};goog.dom.browserrange.GeckoRange=function(a){goog.dom.browserrange.W3cRange.call(this,a)};goog.inherits(goog.dom.browserrange.GeckoRange,goog.dom.browserrange.W3cRange);goog.dom.browserrange.GeckoRange.createFromNodeContents=function(a){return new goog.dom.browserrange.GeckoRange(goog.dom.browserrange.W3cRange.getBrowserRangeForNode(a))};
goog.dom.browserrange.GeckoRange.createFromNodes=function(a,b,c,d){return new goog.dom.browserrange.GeckoRange(goog.dom.browserrange.W3cRange.getBrowserRangeForNodes(a,b,c,d))};goog.dom.browserrange.GeckoRange.prototype.selectInternal=function(a,b){var c=b?this.getEndNode():this.getStartNode(),d=b?this.getEndOffset():this.getStartOffset(),e=b?this.getStartNode():this.getEndNode(),f=b?this.getStartOffset():this.getEndOffset();a.collapse(c,d);(c!=e||d!=f)&&a.extend(e,f)};goog.dom.browserrange.OperaRange=function(a){goog.dom.browserrange.W3cRange.call(this,a)};goog.inherits(goog.dom.browserrange.OperaRange,goog.dom.browserrange.W3cRange);goog.dom.browserrange.OperaRange.createFromNodeContents=function(a){return new goog.dom.browserrange.OperaRange(goog.dom.browserrange.W3cRange.getBrowserRangeForNode(a))};
goog.dom.browserrange.OperaRange.createFromNodes=function(a,b,c,d){return new goog.dom.browserrange.OperaRange(goog.dom.browserrange.W3cRange.getBrowserRangeForNodes(a,b,c,d))};goog.dom.browserrange.OperaRange.prototype.selectInternal=function(a){a.collapse(this.getStartNode(),this.getStartOffset());(this.getEndNode()!=this.getStartNode()||this.getEndOffset()!=this.getStartOffset())&&a.extend(this.getEndNode(),this.getEndOffset());a.rangeCount==0&&a.addRange(this.range_)};goog.dom.browserrange.Error={NOT_IMPLEMENTED:"Not Implemented"};goog.dom.browserrange.createRange=function(a){return goog.userAgent.IE&&!goog.userAgent.isDocumentMode(9)?new goog.dom.browserrange.IeRange(a,goog.dom.getOwnerDocument(a.parentElement())):goog.userAgent.WEBKIT?new goog.dom.browserrange.WebKitRange(a):goog.userAgent.GECKO?new goog.dom.browserrange.GeckoRange(a):goog.userAgent.OPERA?new goog.dom.browserrange.OperaRange(a):new goog.dom.browserrange.W3cRange(a)};
goog.dom.browserrange.createRangeFromNodeContents=function(a){return goog.userAgent.IE&&!goog.userAgent.isDocumentMode(9)?goog.dom.browserrange.IeRange.createFromNodeContents(a):goog.userAgent.WEBKIT?goog.dom.browserrange.WebKitRange.createFromNodeContents(a):goog.userAgent.GECKO?goog.dom.browserrange.GeckoRange.createFromNodeContents(a):goog.userAgent.OPERA?goog.dom.browserrange.OperaRange.createFromNodeContents(a):goog.dom.browserrange.W3cRange.createFromNodeContents(a)};
goog.dom.browserrange.createRangeFromNodes=function(a,b,c,d){return goog.userAgent.IE&&!goog.userAgent.isDocumentMode(9)?goog.dom.browserrange.IeRange.createFromNodes(a,b,c,d):goog.userAgent.WEBKIT?goog.dom.browserrange.WebKitRange.createFromNodes(a,b,c,d):goog.userAgent.GECKO?goog.dom.browserrange.GeckoRange.createFromNodes(a,b,c,d):goog.userAgent.OPERA?goog.dom.browserrange.OperaRange.createFromNodes(a,b,c,d):goog.dom.browserrange.W3cRange.createFromNodes(a,b,c,d)};
goog.dom.browserrange.canContainRangeEndpoint=function(a){return goog.dom.canHaveChildren(a)||a.nodeType==goog.dom.NodeType.TEXT};goog.dom.TextRange=function(){};goog.inherits(goog.dom.TextRange,goog.dom.AbstractRange);goog.dom.TextRange.createFromBrowserRange=function(a,b){return goog.dom.TextRange.createFromBrowserRangeWrapper_(goog.dom.browserrange.createRange(a),b)};goog.dom.TextRange.createFromBrowserRangeWrapper_=function(a,b){var c=new goog.dom.TextRange;c.browserRangeWrapper_=a;c.isReversed_=!!b;return c};
goog.dom.TextRange.createFromNodeContents=function(a,b){return goog.dom.TextRange.createFromBrowserRangeWrapper_(goog.dom.browserrange.createRangeFromNodeContents(a),b)};
goog.dom.TextRange.createFromNodes=function(a,b,c,d){var e=new goog.dom.TextRange;e.isReversed_=goog.dom.Range.isReversed(a,b,c,d);if(a.tagName=="BR"){var f=a.parentNode;b=goog.array.indexOf(f.childNodes,a);a=f}if(c.tagName=="BR")f=c.parentNode,d=goog.array.indexOf(f.childNodes,c),c=f;e.isReversed_?(e.startNode_=c,e.startOffset_=d,e.endNode_=a,e.endOffset_=b):(e.startNode_=a,e.startOffset_=b,e.endNode_=c,e.endOffset_=d);return e};goog.dom.TextRange.prototype.browserRangeWrapper_=null;
goog.dom.TextRange.prototype.startNode_=null;goog.dom.TextRange.prototype.startOffset_=null;goog.dom.TextRange.prototype.endNode_=null;goog.dom.TextRange.prototype.endOffset_=null;goog.dom.TextRange.prototype.isReversed_=!1;goog.dom.TextRange.prototype.clone=function(){var a=new goog.dom.TextRange;a.browserRangeWrapper_=this.browserRangeWrapper_;a.startNode_=this.startNode_;a.startOffset_=this.startOffset_;a.endNode_=this.endNode_;a.endOffset_=this.endOffset_;a.isReversed_=this.isReversed_;return a};
goog.dom.TextRange.prototype.getType=function(){return goog.dom.RangeType.TEXT};goog.dom.TextRange.prototype.getBrowserRangeObject=function(){return this.getBrowserRangeWrapper_().getBrowserRange()};goog.dom.TextRange.prototype.setBrowserRangeObject=function(a){if(goog.dom.AbstractRange.isNativeControlRange(a))return!1;this.browserRangeWrapper_=goog.dom.browserrange.createRange(a);this.clearCachedValues_();return!0};
goog.dom.TextRange.prototype.clearCachedValues_=function(){this.startNode_=this.startOffset_=this.endNode_=this.endOffset_=null};goog.dom.TextRange.prototype.getTextRangeCount=function(){return 1};goog.dom.TextRange.prototype.getTextRange=function(){return this};goog.dom.TextRange.prototype.getBrowserRangeWrapper_=function(){return this.browserRangeWrapper_||(this.browserRangeWrapper_=goog.dom.browserrange.createRangeFromNodes(this.getStartNode(),this.getStartOffset(),this.getEndNode(),this.getEndOffset()))};
goog.dom.TextRange.prototype.getContainer=function(){return this.getBrowserRangeWrapper_().getContainer()};goog.dom.TextRange.prototype.getStartNode=function(){return this.startNode_||(this.startNode_=this.getBrowserRangeWrapper_().getStartNode())};goog.dom.TextRange.prototype.getStartOffset=function(){return this.startOffset_!=null?this.startOffset_:this.startOffset_=this.getBrowserRangeWrapper_().getStartOffset()};
goog.dom.TextRange.prototype.getEndNode=function(){return this.endNode_||(this.endNode_=this.getBrowserRangeWrapper_().getEndNode())};goog.dom.TextRange.prototype.getEndOffset=function(){return this.endOffset_!=null?this.endOffset_:this.endOffset_=this.getBrowserRangeWrapper_().getEndOffset()};goog.dom.TextRange.prototype.moveToNodes=function(a,b,c,d,e){this.startNode_=a;this.startOffset_=b;this.endNode_=c;this.endOffset_=d;this.isReversed_=e;this.browserRangeWrapper_=null};
goog.dom.TextRange.prototype.isReversed=function(){return this.isReversed_};goog.dom.TextRange.prototype.containsRange=function(a,b){var c=a.getType();if(c==goog.dom.RangeType.TEXT)return this.getBrowserRangeWrapper_().containsRange(a.getBrowserRangeWrapper_(),b);else if(c==goog.dom.RangeType.CONTROL)return c=a.getElements(),(b?goog.array.some:goog.array.every)(c,function(a){return this.containsNode(a,b)},this);return!1};
goog.dom.TextRange.isAttachedNode=function(a){if(goog.userAgent.IE&&!goog.userAgent.isDocumentMode(9)){var b=!1;try{b=a.parentNode}catch(c){}return!!b}else return goog.dom.contains(a.ownerDocument.body,a)};goog.dom.TextRange.prototype.isRangeInDocument=function(){return(!this.startNode_||goog.dom.TextRange.isAttachedNode(this.startNode_))&&(!this.endNode_||goog.dom.TextRange.isAttachedNode(this.endNode_))&&(!(goog.userAgent.IE&&!goog.userAgent.isDocumentMode(9))||this.getBrowserRangeWrapper_().isRangeInDocument())};
goog.dom.TextRange.prototype.isCollapsed=function(){return this.getBrowserRangeWrapper_().isCollapsed()};goog.dom.TextRange.prototype.getText=function(){return this.getBrowserRangeWrapper_().getText()};goog.dom.TextRange.prototype.getHtmlFragment=function(){return this.getBrowserRangeWrapper_().getHtmlFragment()};goog.dom.TextRange.prototype.getValidHtml=function(){return this.getBrowserRangeWrapper_().getValidHtml()};
goog.dom.TextRange.prototype.getPastableHtml=function(){var a=this.getValidHtml();if(a.match(/^\s*<td\b/i))a="<table><tbody><tr>"+a+"</tr></tbody></table>";else if(a.match(/^\s*<tr\b/i))a="<table><tbody>"+a+"</tbody></table>";else if(a.match(/^\s*<tbody\b/i))a="<table>"+a+"</table>";else if(a.match(/^\s*<li\b/i)){for(var b=this.getContainer(),c=goog.dom.TagName.UL;b;){if(b.tagName==goog.dom.TagName.OL){c=goog.dom.TagName.OL;break}else if(b.tagName==goog.dom.TagName.UL)break;b=b.parentNode}a=goog.string.buildString("<",
c,">",a,"</",c,">")}return a};goog.dom.TextRange.prototype.__iterator__=function(){return new goog.dom.TextRangeIterator(this.getStartNode(),this.getStartOffset(),this.getEndNode(),this.getEndOffset())};goog.dom.TextRange.prototype.select=function(){this.getBrowserRangeWrapper_().select(this.isReversed_)};goog.dom.TextRange.prototype.removeContents=function(){this.getBrowserRangeWrapper_().removeContents();this.clearCachedValues_()};
goog.dom.TextRange.prototype.surroundContents=function(a){a=this.getBrowserRangeWrapper_().surroundContents(a);this.clearCachedValues_();return a};goog.dom.TextRange.prototype.insertNode=function(a,b){var c=this.getBrowserRangeWrapper_().insertNode(a,b);this.clearCachedValues_();return c};goog.dom.TextRange.prototype.surroundWithNodes=function(a,b){this.getBrowserRangeWrapper_().surroundWithNodes(a,b);this.clearCachedValues_()};goog.dom.TextRange.prototype.saveUsingDom=function(){return new goog.dom.DomSavedTextRange_(this)};
goog.dom.TextRange.prototype.collapse=function(a){a=this.isReversed()?!a:a;this.browserRangeWrapper_&&this.browserRangeWrapper_.collapse(a);a?(this.endNode_=this.startNode_,this.endOffset_=this.startOffset_):(this.startNode_=this.endNode_,this.startOffset_=this.endOffset_);this.isReversed_=!1};goog.dom.DomSavedTextRange_=function(a){this.anchorNode_=a.getAnchorNode();this.anchorOffset_=a.getAnchorOffset();this.focusNode_=a.getFocusNode();this.focusOffset_=a.getFocusOffset()};
goog.inherits(goog.dom.DomSavedTextRange_,goog.dom.SavedRange);goog.dom.DomSavedTextRange_.prototype.restoreInternal=function(){return goog.dom.Range.createFromNodes(this.anchorNode_,this.anchorOffset_,this.focusNode_,this.focusOffset_)};goog.dom.DomSavedTextRange_.prototype.disposeInternal=function(){goog.dom.DomSavedTextRange_.superClass_.disposeInternal.call(this);this.focusNode_=this.anchorNode_=null};goog.dom.ControlRange=function(){};goog.inherits(goog.dom.ControlRange,goog.dom.AbstractMultiRange);goog.dom.ControlRange.createFromBrowserRange=function(a){var b=new goog.dom.ControlRange;b.range_=a;return b};goog.dom.ControlRange.createFromElements=function(){for(var a=goog.dom.getOwnerDocument(arguments[0]).body.createControlRange(),b=0,c=arguments.length;b<c;b++)a.addElement(arguments[b]);return goog.dom.ControlRange.createFromBrowserRange(a)};goog.dom.ControlRange.prototype.range_=null;
goog.dom.ControlRange.prototype.elements_=null;goog.dom.ControlRange.prototype.sortedElements_=null;goog.dom.ControlRange.prototype.clearCachedValues_=function(){this.sortedElements_=this.elements_=null};goog.dom.ControlRange.prototype.clone=function(){return goog.dom.ControlRange.createFromElements.apply(this,this.getElements())};goog.dom.ControlRange.prototype.getType=function(){return goog.dom.RangeType.CONTROL};
goog.dom.ControlRange.prototype.getBrowserRangeObject=function(){return this.range_||document.body.createControlRange()};goog.dom.ControlRange.prototype.setBrowserRangeObject=function(a){if(!goog.dom.AbstractRange.isNativeControlRange(a))return!1;this.range_=a;return!0};goog.dom.ControlRange.prototype.getTextRangeCount=function(){return this.range_?this.range_.length:0};goog.dom.ControlRange.prototype.getTextRange=function(a){return goog.dom.TextRange.createFromNodeContents(this.range_.item(a))};
goog.dom.ControlRange.prototype.getContainer=function(){return goog.dom.findCommonAncestor.apply(null,this.getElements())};goog.dom.ControlRange.prototype.getStartNode=function(){return this.getSortedElements()[0]};goog.dom.ControlRange.prototype.getStartOffset=function(){return 0};goog.dom.ControlRange.prototype.getEndNode=function(){var a=this.getSortedElements(),b=goog.array.peek(a);return goog.array.find(a,function(a){return goog.dom.contains(a,b)})};
goog.dom.ControlRange.prototype.getEndOffset=function(){return this.getEndNode().childNodes.length};goog.dom.ControlRange.prototype.getElements=function(){if(!this.elements_&&(this.elements_=[],this.range_))for(var a=0;a<this.range_.length;a++)this.elements_.push(this.range_.item(a));return this.elements_};
goog.dom.ControlRange.prototype.getSortedElements=function(){if(!this.sortedElements_)this.sortedElements_=this.getElements().concat(),this.sortedElements_.sort(function(a,b){return a.sourceIndex-b.sourceIndex});return this.sortedElements_};goog.dom.ControlRange.prototype.isRangeInDocument=function(){var a=!1;try{a=goog.array.every(this.getElements(),function(a){return goog.userAgent.IE?a.parentNode:goog.dom.contains(a.ownerDocument.body,a)})}catch(b){}return a};
goog.dom.ControlRange.prototype.isCollapsed=function(){return!this.range_||!this.range_.length};goog.dom.ControlRange.prototype.getText=function(){return""};goog.dom.ControlRange.prototype.getHtmlFragment=function(){return goog.array.map(this.getSortedElements(),goog.dom.getOuterHtml).join("")};goog.dom.ControlRange.prototype.getValidHtml=function(){return this.getHtmlFragment()};goog.dom.ControlRange.prototype.getPastableHtml=goog.dom.ControlRange.prototype.getValidHtml;
goog.dom.ControlRange.prototype.__iterator__=function(){return new goog.dom.ControlRangeIterator(this)};goog.dom.ControlRange.prototype.select=function(){this.range_&&this.range_.select()};goog.dom.ControlRange.prototype.removeContents=function(){if(this.range_){for(var a=[],b=0,c=this.range_.length;b<c;b++)a.push(this.range_.item(b));goog.array.forEach(a,goog.dom.removeNode);this.collapse(!1)}};
goog.dom.ControlRange.prototype.replaceContentsWithNode=function(a){a=this.insertNode(a,!0);this.isCollapsed()||this.removeContents();return a};goog.dom.ControlRange.prototype.saveUsingDom=function(){return new goog.dom.DomSavedControlRange_(this)};goog.dom.ControlRange.prototype.collapse=function(){this.range_=null;this.clearCachedValues_()};goog.dom.DomSavedControlRange_=function(a){this.elements_=a.getElements()};goog.inherits(goog.dom.DomSavedControlRange_,goog.dom.SavedRange);
goog.dom.DomSavedControlRange_.prototype.restoreInternal=function(){for(var a=(this.elements_.length?goog.dom.getOwnerDocument(this.elements_[0]):document).body.createControlRange(),b=0,c=this.elements_.length;b<c;b++)a.addElement(this.elements_[b]);return goog.dom.ControlRange.createFromBrowserRange(a)};goog.dom.DomSavedControlRange_.prototype.disposeInternal=function(){goog.dom.DomSavedControlRange_.superClass_.disposeInternal.call(this);delete this.elements_};
goog.dom.ControlRangeIterator=function(a){if(a)this.elements_=a.getSortedElements(),this.startNode_=this.elements_.shift(),this.endNode_=goog.array.peek(this.elements_)||this.startNode_;goog.dom.RangeIterator.call(this,this.startNode_,!1)};goog.inherits(goog.dom.ControlRangeIterator,goog.dom.RangeIterator);goog.dom.ControlRangeIterator.prototype.startNode_=null;goog.dom.ControlRangeIterator.prototype.endNode_=null;goog.dom.ControlRangeIterator.prototype.elements_=null;
goog.dom.ControlRangeIterator.prototype.getStartTextOffset=function(){return 0};goog.dom.ControlRangeIterator.prototype.getEndTextOffset=function(){return 0};goog.dom.ControlRangeIterator.prototype.getStartNode=function(){return this.startNode_};goog.dom.ControlRangeIterator.prototype.getEndNode=function(){return this.endNode_};goog.dom.ControlRangeIterator.prototype.isLast=function(){return!this.depth&&!this.elements_.length};
goog.dom.ControlRangeIterator.prototype.next=function(){if(this.isLast())throw goog.iter.StopIteration;else if(!this.depth){var a=this.elements_.shift();this.setPosition(a,goog.dom.TagWalkType.START_TAG,goog.dom.TagWalkType.START_TAG);return a}return goog.dom.ControlRangeIterator.superClass_.next.call(this)};
goog.dom.ControlRangeIterator.prototype.copyFrom=function(a){this.elements_=a.elements_;this.startNode_=a.startNode_;this.endNode_=a.endNode_;goog.dom.ControlRangeIterator.superClass_.copyFrom.call(this,a)};goog.dom.ControlRangeIterator.prototype.clone=function(){var a=new goog.dom.ControlRangeIterator(null);a.copyFrom(this);return a};goog.dom.MultiRange=function(){this.browserRanges_=[];this.ranges_=[];this.container_=this.sortedRanges_=null};goog.inherits(goog.dom.MultiRange,goog.dom.AbstractMultiRange);goog.dom.MultiRange.createFromBrowserSelection=function(a){for(var b=new goog.dom.MultiRange,c=0,d=a.rangeCount;c<d;c++)b.browserRanges_.push(a.getRangeAt(c));return b};goog.dom.MultiRange.createFromBrowserRanges=function(a){var b=new goog.dom.MultiRange;b.browserRanges_=goog.array.clone(a);return b};
goog.dom.MultiRange.createFromTextRanges=function(a){var b=new goog.dom.MultiRange;b.ranges_=a;b.browserRanges_=goog.array.map(a,function(a){return a.getBrowserRangeObject()});return b};goog.dom.MultiRange.prototype.logger_=goog.debug.Logger.getLogger("goog.dom.MultiRange");goog.dom.MultiRange.prototype.clearCachedValues_=function(){this.ranges_=[];this.container_=this.sortedRanges_=null};goog.dom.MultiRange.prototype.clone=function(){return goog.dom.MultiRange.createFromBrowserRanges(this.browserRanges_)};
goog.dom.MultiRange.prototype.getType=function(){return goog.dom.RangeType.MULTI};goog.dom.MultiRange.prototype.getBrowserRangeObject=function(){this.browserRanges_.length>1&&this.logger_.warning("getBrowserRangeObject called on MultiRange with more than 1 range");return this.browserRanges_[0]};goog.dom.MultiRange.prototype.setBrowserRangeObject=function(){return!1};goog.dom.MultiRange.prototype.getTextRangeCount=function(){return this.browserRanges_.length};
goog.dom.MultiRange.prototype.getTextRange=function(a){this.ranges_[a]||(this.ranges_[a]=goog.dom.TextRange.createFromBrowserRange(this.browserRanges_[a]));return this.ranges_[a]};goog.dom.MultiRange.prototype.getContainer=function(){if(!this.container_){for(var a=[],b=0,c=this.getTextRangeCount();b<c;b++)a.push(this.getTextRange(b).getContainer());this.container_=goog.dom.findCommonAncestor.apply(null,a)}return this.container_};
goog.dom.MultiRange.prototype.getSortedRanges=function(){if(!this.sortedRanges_)this.sortedRanges_=this.getTextRanges(),this.sortedRanges_.sort(function(a,b){var c=a.getStartNode(),d=a.getStartOffset(),e=b.getStartNode(),f=b.getStartOffset();if(c==e&&d==f)return 0;return goog.dom.Range.isReversed(c,d,e,f)?1:-1});return this.sortedRanges_};goog.dom.MultiRange.prototype.getStartNode=function(){return this.getSortedRanges()[0].getStartNode()};goog.dom.MultiRange.prototype.getStartOffset=function(){return this.getSortedRanges()[0].getStartOffset()};
goog.dom.MultiRange.prototype.getEndNode=function(){return goog.array.peek(this.getSortedRanges()).getEndNode()};goog.dom.MultiRange.prototype.getEndOffset=function(){return goog.array.peek(this.getSortedRanges()).getEndOffset()};goog.dom.MultiRange.prototype.isRangeInDocument=function(){return goog.array.every(this.getTextRanges(),function(a){return a.isRangeInDocument()})};goog.dom.MultiRange.prototype.isCollapsed=function(){return this.browserRanges_.length==0||this.browserRanges_.length==1&&this.getTextRange(0).isCollapsed()};
goog.dom.MultiRange.prototype.getText=function(){return goog.array.map(this.getTextRanges(),function(a){return a.getText()}).join("")};goog.dom.MultiRange.prototype.getHtmlFragment=function(){return this.getValidHtml()};goog.dom.MultiRange.prototype.getValidHtml=function(){return goog.array.map(this.getTextRanges(),function(a){return a.getValidHtml()}).join("")};goog.dom.MultiRange.prototype.getPastableHtml=function(){return this.getValidHtml()};goog.dom.MultiRange.prototype.__iterator__=function(){return new goog.dom.MultiRangeIterator(this)};
goog.dom.MultiRange.prototype.select=function(){var a=goog.dom.AbstractRange.getBrowserSelectionForWindow(this.getWindow());a.removeAllRanges();for(var b=0,c=this.getTextRangeCount();b<c;b++)a.addRange(this.getTextRange(b).getBrowserRangeObject())};goog.dom.MultiRange.prototype.removeContents=function(){goog.array.forEach(this.getTextRanges(),function(a){a.removeContents()})};goog.dom.MultiRange.prototype.saveUsingDom=function(){return new goog.dom.DomSavedMultiRange_(this)};
goog.dom.MultiRange.prototype.collapse=function(a){if(!this.isCollapsed()){var b=a?this.getTextRange(0):this.getTextRange(this.getTextRangeCount()-1);this.clearCachedValues_();b.collapse(a);this.ranges_=[b];this.sortedRanges_=[b];this.browserRanges_=[b.getBrowserRangeObject()]}};goog.dom.DomSavedMultiRange_=function(a){this.savedRanges_=goog.array.map(a.getTextRanges(),function(a){return a.saveUsingDom()})};goog.inherits(goog.dom.DomSavedMultiRange_,goog.dom.SavedRange);
goog.dom.DomSavedMultiRange_.prototype.restoreInternal=function(){var a=goog.array.map(this.savedRanges_,function(a){return a.restore()});return goog.dom.MultiRange.createFromTextRanges(a)};goog.dom.DomSavedMultiRange_.prototype.disposeInternal=function(){goog.dom.DomSavedMultiRange_.superClass_.disposeInternal.call(this);goog.array.forEach(this.savedRanges_,function(a){a.dispose()});delete this.savedRanges_};
goog.dom.MultiRangeIterator=function(a){if(a)this.iterators_=goog.array.map(a.getSortedRanges(),function(a){return goog.iter.toIterator(a)});goog.dom.RangeIterator.call(this,a?this.getStartNode():null,!1)};goog.inherits(goog.dom.MultiRangeIterator,goog.dom.RangeIterator);goog.dom.MultiRangeIterator.prototype.iterators_=null;goog.dom.MultiRangeIterator.prototype.currentIdx_=0;goog.dom.MultiRangeIterator.prototype.getStartTextOffset=function(){return this.iterators_[this.currentIdx_].getStartTextOffset()};
goog.dom.MultiRangeIterator.prototype.getEndTextOffset=function(){return this.iterators_[this.currentIdx_].getEndTextOffset()};goog.dom.MultiRangeIterator.prototype.getStartNode=function(){return this.iterators_[0].getStartNode()};goog.dom.MultiRangeIterator.prototype.getEndNode=function(){return goog.array.peek(this.iterators_).getEndNode()};goog.dom.MultiRangeIterator.prototype.isLast=function(){return this.iterators_[this.currentIdx_].isLast()};
goog.dom.MultiRangeIterator.prototype.next=function(){try{var a=this.iterators_[this.currentIdx_],b=a.next();this.setPosition(a.node,a.tagType,a.depth);return b}catch(c){if(c!==goog.iter.StopIteration||this.iterators_.length-1==this.currentIdx_)throw c;else return this.currentIdx_++,this.next()}};goog.dom.MultiRangeIterator.prototype.copyFrom=function(a){this.iterators_=goog.array.clone(a.iterators_);goog.dom.MultiRangeIterator.superClass_.copyFrom.call(this,a)};
goog.dom.MultiRangeIterator.prototype.clone=function(){var a=new goog.dom.MultiRangeIterator(null);a.copyFrom(this);return a};goog.dom.Range={};goog.dom.Range.createFromWindow=function(a){return(a=goog.dom.AbstractRange.getBrowserSelectionForWindow(a||window))&&goog.dom.Range.createFromBrowserSelection(a)};
goog.dom.Range.createFromBrowserSelection=function(a){var b,c=!1;if(a.createRange)try{b=a.createRange()}catch(d){return null}else if(a.rangeCount)if(a.rangeCount>1)return goog.dom.MultiRange.createFromBrowserSelection(a);else b=a.getRangeAt(0),c=goog.dom.Range.isReversed(a.anchorNode,a.anchorOffset,a.focusNode,a.focusOffset);else return null;return goog.dom.Range.createFromBrowserRange(b,c)};
goog.dom.Range.createFromBrowserRange=function(a,b){return goog.dom.AbstractRange.isNativeControlRange(a)?goog.dom.ControlRange.createFromBrowserRange(a):goog.dom.TextRange.createFromBrowserRange(a,b)};goog.dom.Range.createFromNodeContents=function(a,b){return goog.dom.TextRange.createFromNodeContents(a,b)};goog.dom.Range.createCaret=function(a,b){return goog.dom.TextRange.createFromNodes(a,b,a,b)};goog.dom.Range.createFromNodes=function(a,b,c,d){return goog.dom.TextRange.createFromNodes(a,b,c,d)};
goog.dom.Range.clearSelection=function(a){if(a=goog.dom.AbstractRange.getBrowserSelectionForWindow(a||window))if(a.empty)try{a.empty()}catch(b){}else try{a.removeAllRanges()}catch(c){}};goog.dom.Range.hasSelection=function(a){a=goog.dom.AbstractRange.getBrowserSelectionForWindow(a||window);return!!a&&(goog.userAgent.IE?a.type!="None":!!a.rangeCount)};
goog.dom.Range.isReversed=function(a,b,c,d){if(a==c)return d<b;var e;if(a.nodeType==goog.dom.NodeType.ELEMENT&&b)if(e=a.childNodes[b])a=e,b=0;else if(goog.dom.contains(a,c))return!0;if(c.nodeType==goog.dom.NodeType.ELEMENT&&d)if(e=c.childNodes[d])c=e,d=0;else if(goog.dom.contains(c,a))return!1;return(goog.dom.compareNodeOrder(a,c)||b-d)>0};goog.editor.range={};goog.editor.range.narrow=function(a,b){var c=a.getStartNode(),d=a.getEndNode();if(c&&d){var e=function(a){return a==b};c=goog.dom.getAncestor(c,e,!0);d=goog.dom.getAncestor(d,e,!0);if(c&&d)return a.clone();else if(c)return d=goog.editor.node.getRightMostLeaf(b),goog.dom.Range.createFromNodes(a.getStartNode(),a.getStartOffset(),d,goog.editor.node.getLength(d));else if(d)return goog.dom.Range.createFromNodes(goog.editor.node.getLeftMostLeaf(b),0,a.getEndNode(),a.getEndOffset())}return null};
goog.editor.range.expand=function(a,b){var c=goog.editor.range.expandEndPointToContainer_(a,goog.dom.RangeEndpoint.START,b);c=goog.editor.range.expandEndPointToContainer_(c,goog.dom.RangeEndpoint.END,b);var d=c.getStartNode(),e=c.getEndNode(),f=c.getStartOffset();c=c.getEndOffset();if(d==e){for(;e!=b&&f==0&&c==goog.editor.node.getLength(e);)d=e.parentNode,f=goog.array.indexOf(d.childNodes,e),c=f+1,e=d;d=e}return goog.dom.Range.createFromNodes(d,f,e,c)};
goog.editor.range.expandEndPointToContainer_=function(a,b,c){for(var d=(b=b==goog.dom.RangeEndpoint.START)?a.getStartNode():a.getEndNode(),e=b?a.getStartOffset():a.getEndOffset(),f=a.getContainerElement();d!=f&&d!=c;){if(b&&e!=0||!b&&e!=goog.editor.node.getLength(d))break;var g=d.parentNode;d=goog.array.indexOf(g.childNodes,d);e=b?d:d+1;d=g}return goog.dom.Range.createFromNodes(b?d:a.getStartNode(),b?e:a.getStartOffset(),b?a.getEndNode():d,b?a.getEndOffset():e)};
goog.editor.range.selectNodeStart=function(a){goog.dom.Range.createCaret(goog.editor.node.getLeftMostLeaf(a),0).select()};goog.editor.range.placeCursorNextTo=function(a,b){var c=a.parentNode,d=goog.array.indexOf(c.childNodes,a)+(b?0:1);c=goog.editor.range.Point.createDeepestPoint(c,d,b);c=goog.dom.Range.createCaret(c.node,c.offset);c.select();return c};
goog.editor.range.selectionPreservingNormalize=function(a){var b=goog.dom.getOwnerDocument(a);b=goog.dom.Range.createFromWindow(goog.dom.getWindow(b));(a=goog.editor.range.rangePreservingNormalize(a,b))&&a.select()};goog.editor.range.normalizeNodeIe_=function(a){for(var b=null,c=a.firstChild;c;){var d=c.nextSibling;c.nodeType==goog.dom.NodeType.TEXT?c.nodeValue==""?a.removeChild(c):b?(b.nodeValue+=c.nodeValue,a.removeChild(c)):b=c:(goog.editor.range.normalizeNodeIe_(c),b=null);c=d}};
goog.editor.range.normalizeNode=function(a){goog.userAgent.IE?goog.editor.range.normalizeNodeIe_(a):a.normalize()};goog.editor.range.rangePreservingNormalize=function(a,b){if(b)var c=goog.editor.range.normalize(b),d=goog.editor.style.getContainer(b.getContainerElement());d?goog.editor.range.normalizeNode(goog.dom.findCommonAncestor(d,a)):a&&goog.editor.range.normalizeNode(a);return c?c():null};
goog.editor.range.getDeepEndPoint=function(a,b){return b?goog.editor.range.Point.createDeepestPoint(a.getStartNode(),a.getStartOffset()):goog.editor.range.Point.createDeepestPoint(a.getEndNode(),a.getEndOffset())};
goog.editor.range.normalize=function(a){var b=goog.editor.range.normalizePoint_(goog.editor.range.getDeepEndPoint(a,!0)),c=b.getParentPoint(),d=b.node.previousSibling;if(b.node.nodeType==goog.dom.NodeType.TEXT)b.node=null;var e=goog.editor.range.normalizePoint_(goog.editor.range.getDeepEndPoint(a,!1)),f=e.getParentPoint(),g=e.node.previousSibling;if(e.node.nodeType==goog.dom.NodeType.TEXT)e.node=null;return function(){if(!b.node&&d)b.node=d.nextSibling,b.node||(b=goog.editor.range.Point.getPointAtEndOfNode(d));
if(!e.node&&g)e.node=g.nextSibling,e.node||(e=goog.editor.range.Point.getPointAtEndOfNode(g));return goog.dom.Range.createFromNodes(b.node||c.node.firstChild||c.node,b.offset,e.node||f.node.firstChild||f.node,e.offset)}};
goog.editor.range.normalizePoint_=function(a){var b;if(a.node.nodeType==goog.dom.NodeType.TEXT)for(b=a.node.previousSibling;b&&b.nodeType==goog.dom.NodeType.TEXT;b=b.previousSibling)a.offset+=goog.editor.node.getLength(b);else b=a.node.previousSibling;var c=a.node.parentNode;a.node=b?b.nextSibling:c.firstChild;return a};goog.editor.range.isEditable=function(a){var b=a.getContainerElement();return a.getStartNode()!=b.parentElement&&goog.editor.node.isEditableContainer(b)||goog.editor.node.isEditable(b)};
goog.editor.range.intersectsTag=function(a,b){if(goog.dom.getAncestorByTagNameAndClass(a.getContainerElement(),b))return!0;return goog.iter.some(a,function(a){return a.tagName==b})};goog.editor.range.Point=function(a,b){this.node=a;this.offset=b};goog.editor.range.Point.prototype.getParentPoint=function(){var a=this.node.parentNode;return new goog.editor.range.Point(a,goog.array.indexOf(a.childNodes,this.node))};
goog.editor.range.Point.createDeepestPoint=function(a,b,c){for(;a.nodeType==goog.dom.NodeType.ELEMENT;){var d=a.childNodes[b];if(!d&&!a.lastChild)break;d?(a=d.previousSibling,c&&a?b=goog.editor.node.getLength(a):(a=d,b=0)):(a=a.lastChild,b=goog.editor.node.getLength(a))}return new goog.editor.range.Point(a,b)};goog.editor.range.Point.getPointAtEndOfNode=function(a){return new goog.editor.range.Point(a,goog.editor.node.getLength(a))};goog.editor.range.saveUsingNormalizedCarets=function(a){return new goog.editor.range.NormalizedCaretRange_(a)};
goog.editor.range.NormalizedCaretRange_=function(a){goog.dom.SavedCaretRange.call(this,a)};goog.inherits(goog.editor.range.NormalizedCaretRange_,goog.dom.SavedCaretRange);goog.editor.range.NormalizedCaretRange_.prototype.removeCarets=function(a){var b=this.getCaret(!0),c=this.getCaret(!1);b=b&&c?goog.dom.findCommonAncestor(b,c):b||c;goog.editor.range.NormalizedCaretRange_.superClass_.removeCarets.call(this);if(a)return goog.editor.range.rangePreservingNormalize(b,a);else b&&goog.editor.range.selectionPreservingNormalize(b)};goog.editor.icontent={};goog.editor.icontent.FieldFormatInfo=function(a,b,c,d,e){this.fieldId_=a;this.standards_=b;this.blended_=c;this.fixedHeight_=d;this.extraStyles_=e||{}};goog.editor.icontent.FieldStyleInfo=function(a,b){this.wrapper_=a;this.css_=b};goog.editor.icontent.useStandardsModeIframes_=!1;goog.editor.icontent.forceStandardsModeIframes=function(){goog.editor.icontent.useStandardsModeIframes_=!0};
goog.editor.icontent.getInitialIframeContent_=function(a,b,c){var d=[];(a.blended_&&a.standards_||goog.editor.icontent.useStandardsModeIframes_)&&d.push("<!DOCTYPE HTML>");d.push('<html style="background:none transparent;');a.blended_&&d.push("height:",a.fixedHeight_?"100%":"auto");d.push('">');d.push("<head><style>");c&&c.css_&&d.push(c.css_);goog.userAgent.GECKO&&a.standards_&&d.push(" img {-moz-force-broken-image-icon: 1;}");d.push("</style></head>");d.push('<body g_editable="true" hidefocus="true" ');
goog.editor.BrowserFeature.HAS_CONTENT_EDITABLE&&d.push("contentEditable ");d.push('class="editable ');d.push('" id="',a.fieldId_,'" style="');goog.userAgent.GECKO&&a.blended_&&(d.push(";width:100%;border:0;margin:0;background:none transparent;",";height:",a.standards_?"100%":"auto"),a.fixedHeight_?d.push(";overflow:auto"):d.push(";overflow-y:hidden;overflow-x:auto"));goog.userAgent.OPERA&&d.push(";outline:hidden");for(var e in a.extraStyles_)d.push(";"+e+":"+a.extraStyles_[e]);d.push('">',b,"</body></html>");
return d.join("")};goog.editor.icontent.writeNormalInitialBlendedIframe=function(a,b,c,d){if(a.blended_){var e=goog.style.getPaddingBox(c.wrapper_);(e.top||e.left||e.right||e.bottom)&&goog.style.setStyle(d,"margin",-e.top+"px "+-e.right+"px "+-e.bottom+"px "+-e.left+"px")}goog.editor.icontent.writeNormalInitialIframe(a,b,c,d)};
goog.editor.icontent.writeNormalInitialIframe=function(a,b,c,d){a=goog.editor.icontent.getInitialIframeContent_(a,b,c);d=goog.dom.getFrameContentDocument(d);d.open();d.write(a);d.close()};goog.editor.icontent.writeHttpsInitialIframe=function(a,b,c){b=b.body;if(goog.editor.BrowserFeature.HAS_CONTENT_EDITABLE)b.contentEditable=!0;b.className="editable";b.setAttribute("g_editable",!0);b.hideFocus=!0;b.id=a.fieldId_;goog.style.setStyle(b,a.extraStyles_);b.innerHTML=c};goog.async={};goog.async.Delay=function(a,b,c){goog.Disposable.call(this);this.listener_=a;this.interval_=b||0;this.handler_=c;this.callback_=goog.bind(this.doAction_,this)};goog.inherits(goog.async.Delay,goog.Disposable);goog.Delay=goog.async.Delay;goog.async.Delay.prototype.id_=0;goog.async.Delay.prototype.disposeInternal=function(){goog.async.Delay.superClass_.disposeInternal.call(this);this.stop();delete this.listener_;delete this.handler_};
goog.async.Delay.prototype.start=function(a){this.stop();this.id_=goog.Timer.callOnce(this.callback_,goog.isDef(a)?a:this.interval_)};goog.async.Delay.prototype.stop=function(){this.isActive()&&goog.Timer.clear(this.id_);this.id_=0};goog.async.Delay.prototype.fire=function(){this.stop();this.doAction_()};goog.async.Delay.prototype.fireIfActive=function(){this.isActive()&&this.fire()};goog.async.Delay.prototype.isActive=function(){return this.id_!=0};
goog.async.Delay.prototype.doAction_=function(){this.id_=0;this.listener_&&this.listener_.call(this.handler_)};goog.editor.Field=function(a,b){goog.events.EventTarget.call(this);this.hashCode_=this.id=a;this.editableDomHelper=null;this.plugins_={};this.indexedPlugins_={};for(var c in goog.editor.Plugin.OPCODE)this.indexedPlugins_[c]=[];this.cssStyles="";if(goog.userAgent.WEBKIT&&goog.userAgent.isVersion("525.13")&&goog.string.compareVersions(goog.userAgent.VERSION,"525.18")<=0)this.workaroundClassName_="tr-webkit-workaround",this.cssStyles="."+this.workaroundClassName_+">*{padding-right:1}";this.stoppedEvents_=
{};this.stopEvent(goog.editor.Field.EventType.CHANGE);this.stopEvent(goog.editor.Field.EventType.DELAYEDCHANGE);this.isEverModified_=this.isModified_=!1;this.delayedChangeTimer_=new goog.async.Delay(this.dispatchDelayedChange_,goog.editor.Field.DELAYED_CHANGE_FREQUENCY,this);this.debouncedEvents_={};for(var d in goog.editor.Field.EventType)this.debouncedEvents_[goog.editor.Field.EventType[d]]=0;if(goog.editor.BrowserFeature.USE_MUTATION_EVENTS)this.changeTimerGecko_=new goog.async.Delay(this.handleChange,
goog.editor.Field.CHANGE_FREQUENCY,this);this.eventRegister=new goog.events.EventHandler(this);this.wrappers_=[];this.loadState_=goog.editor.Field.LoadState_.UNEDITABLE;this.originalDomHelper=goog.dom.getDomHelper(b||document);this.originalElement=this.originalDomHelper.getElement(this.id);this.appWindow_=this.originalDomHelper.getWindow()};goog.inherits(goog.editor.Field,goog.events.EventTarget);goog.editor.Field.prototype.field=null;goog.editor.Field.prototype.originalElement=null;
goog.editor.Field.prototype.logger=goog.debug.Logger.getLogger("goog.editor.Field");goog.editor.Field.EventType={COMMAND_VALUE_CHANGE:"cvc",LOAD:"load",UNLOAD:"unload",BEFORECHANGE:"beforechange",CHANGE:"change",DELAYEDCHANGE:"delayedchange",BEFOREFOCUS:"beforefocus",FOCUS:"focus",BLUR:"blur",BEFORETAB:"beforetab",SELECTIONCHANGE:"selectionchange"};goog.editor.Field.LoadState_={UNEDITABLE:0,LOADING:1,EDITABLE:2};goog.editor.Field.DEBOUNCE_TIME_MS_=500;goog.editor.Field.activeFieldId_=null;
goog.editor.Field.prototype.inModalMode_=!1;goog.editor.Field.setActiveFieldId=function(a){goog.editor.Field.activeFieldId_=a};goog.editor.Field.getActiveFieldId=function(){return goog.editor.Field.activeFieldId_};goog.editor.Field.prototype.inModalMode=function(){return this.inModalMode_};goog.editor.Field.prototype.setModalMode=function(a){this.inModalMode_=a};goog.editor.Field.prototype.getHashCode=function(){return this.hashCode_};goog.editor.Field.prototype.getElement=function(){return this.field};
goog.editor.Field.prototype.getOriginalElement=function(){return this.originalElement};goog.editor.Field.prototype.addListener=function(a,b,c,d){var e=this.getElement();if(e&&goog.editor.BrowserFeature.USE_DOCUMENT_FOR_KEY_EVENTS)e=e.ownerDocument;this.eventRegister.listen(e,a,b,c,d)};goog.editor.Field.prototype.getPluginByClassId=function(a){return this.plugins_[a]};
goog.editor.Field.prototype.registerPlugin=function(a){var b=a.getTrogClassId();this.plugins_[b]&&this.logger.severe("Cannot register the same class of plugin twice.");this.plugins_[b]=a;for(var c in goog.editor.Plugin.OPCODE)a[goog.editor.Plugin.OPCODE[c]]&&this.indexedPlugins_[c].push(a);a.registerFieldObject(this);this.isLoaded()&&a.enable(this)};
goog.editor.Field.prototype.unregisterPlugin=function(a){var b=a.getTrogClassId();this.plugins_[b]||this.logger.severe("Cannot unregister a plugin that isn't registered.");delete this.plugins_[b];for(var c in goog.editor.Plugin.OPCODE)a[goog.editor.Plugin.OPCODE[c]]&&goog.array.remove(this.indexedPlugins_[c],a);a.unregisterFieldObject(this)};goog.editor.Field.prototype.setInitialStyle=function(a){this.cssText=a};
goog.editor.Field.prototype.resetOriginalElemProperties=function(){var a=this.getOriginalElement();a.removeAttribute("contentEditable");a.removeAttribute("g_editable");this.id?a.id=this.id:a.removeAttribute("id");a.className=this.savedClassName_||"";var b=this.cssText;b?goog.dom.setProperties(a,{style:b}):a.removeAttribute("style");if(goog.isString(this.originalFieldLineHeight_))goog.style.setStyle(a,"lineHeight",this.originalFieldLineHeight_),this.originalFieldLineHeight_=null};
goog.editor.Field.prototype.isModified=function(a){return a?this.isEverModified_:this.isModified_};goog.editor.Field.CHANGE_FREQUENCY=15;goog.editor.Field.DELAYED_CHANGE_FREQUENCY=250;goog.editor.Field.prototype.usesIframe=goog.functions.TRUE;goog.editor.Field.prototype.isFixedHeight=goog.functions.TRUE;goog.editor.Field.KEYS_CAUSING_CHANGES_={46:!0,8:!0};goog.userAgent.IE||(goog.editor.Field.KEYS_CAUSING_CHANGES_[9]=!0);goog.editor.Field.CTRL_KEYS_CAUSING_CHANGES_={86:!0,88:!0};
goog.userAgent.IE&&(goog.editor.Field.KEYS_CAUSING_CHANGES_[229]=!0);goog.editor.Field.isGeneratingKey_=function(a,b){if(goog.editor.Field.isSpecialGeneratingKey_(a))return!0;return!(!b||a.ctrlKey||a.metaKey||goog.userAgent.GECKO&&!a.charCode)};goog.editor.Field.isSpecialGeneratingKey_=function(a){var b=!(a.ctrlKey||a.metaKey)&&a.keyCode in goog.editor.Field.KEYS_CAUSING_CHANGES_;return(a.ctrlKey||a.metaKey)&&a.keyCode in goog.editor.Field.CTRL_KEYS_CAUSING_CHANGES_||b};
goog.editor.Field.prototype.setAppWindow=function(a){this.appWindow_=a};goog.editor.Field.prototype.getAppWindow=function(){return this.appWindow_};goog.editor.Field.prototype.setBaseZindex=function(a){this.baseZindex_=a};goog.editor.Field.prototype.getBaseZindex=function(){return this.baseZindex_||0};
goog.editor.Field.prototype.setupFieldObject=function(a){this.loadState_=goog.editor.Field.LoadState_.EDITABLE;this.field=a;this.editableDomHelper=goog.dom.getDomHelper(a);this.isEverModified_=this.isModified_=!1;a.setAttribute("g_editable","true")};goog.editor.Field.prototype.tearDownFieldObject_=function(){this.loadState_=goog.editor.Field.LoadState_.UNEDITABLE;for(var a in this.plugins_){var b=this.plugins_[a];b.activeOnUneditableFields()||b.disable(this)}this.editableDomHelper=this.field=null};
goog.editor.Field.prototype.setupChangeListeners_=function(){if(goog.userAgent.OPERA&&this.usesIframe()){this.boundFocusListenerOpera_=goog.bind(this.dispatchFocusAndBeforeFocus_,this);this.boundBlurListenerOpera_=goog.bind(this.dispatchBlur,this);var a=this.getEditableDomHelper().getWindow();a.addEventListener(goog.events.EventType.FOCUS,this.boundFocusListenerOpera_,!1);a.addEventListener(goog.events.EventType.BLUR,this.boundBlurListenerOpera_,!1)}else goog.editor.BrowserFeature.SUPPORTS_FOCUSIN?
(this.addListener(goog.events.EventType.FOCUS,this.dispatchFocus_),this.addListener(goog.events.EventType.FOCUSIN,this.dispatchBeforeFocus_)):this.addListener(goog.events.EventType.FOCUS,this.dispatchFocusAndBeforeFocus_),this.addListener(goog.events.EventType.BLUR,this.dispatchBlur,goog.editor.BrowserFeature.USE_MUTATION_EVENTS);goog.editor.BrowserFeature.USE_MUTATION_EVENTS?this.setupMutationEventHandlersGecko():(this.addListener(["beforecut","beforepaste","drop","dragend"],this.dispatchBeforeChange),
this.addListener(["cut","paste"],this.dispatchChange),this.addListener("drop",this.handleDrop_));this.addListener(goog.userAgent.WEBKIT?"dragend":"dragdrop",this.handleDrop_);this.addListener(goog.events.EventType.KEYDOWN,this.handleKeyDown_);this.addListener(goog.events.EventType.KEYPRESS,this.handleKeyPress_);this.addListener(goog.events.EventType.KEYUP,this.handleKeyUp_);this.selectionChangeTimer_=new goog.async.Delay(this.handleSelectionChangeTimer_,goog.editor.Field.SELECTION_CHANGE_FREQUENCY_,
this);goog.editor.BrowserFeature.FOLLOWS_EDITABLE_LINKS&&this.addListener(goog.events.EventType.CLICK,goog.editor.Field.cancelLinkClick_);this.addListener(goog.events.EventType.MOUSEDOWN,this.handleMouseDown_);this.addListener(goog.events.EventType.MOUSEUP,this.handleMouseUp_)};goog.editor.Field.SELECTION_CHANGE_FREQUENCY_=250;
goog.editor.Field.prototype.clearListeners_=function(){this.eventRegister&&this.eventRegister.removeAll();if(goog.userAgent.OPERA&&this.usesIframe()){try{var a=this.getEditableDomHelper().getWindow();a.removeEventListener(goog.events.EventType.FOCUS,this.boundFocusListenerOpera_,!1);a.removeEventListener(goog.events.EventType.BLUR,this.boundBlurListenerOpera_,!1)}catch(b){}delete this.boundFocusListenerOpera_;delete this.boundBlurListenerOpera_}this.changeTimerGecko_&&this.changeTimerGecko_.stop();
this.delayedChangeTimer_.stop()};
goog.editor.Field.prototype.disposeInternal=function(){(this.isLoading()||this.isLoaded())&&this.logger.warning("Disposing a field that is in use.");this.getOriginalElement()&&this.execCommand(goog.editor.Command.CLEAR_LOREM);this.tearDownFieldObject_();this.clearListeners_();this.originalDomHelper=null;if(this.eventRegister)this.eventRegister.dispose(),this.eventRegister=null;this.removeAllWrappers();goog.editor.Field.getActiveFieldId()==this.id&&goog.editor.Field.setActiveFieldId(null);for(var a in this.plugins_){var b=
this.plugins_[a];b.isAutoDispose()&&b.dispose()}delete this.plugins_;goog.editor.Field.superClass_.disposeInternal.call(this)};goog.editor.Field.prototype.attachWrapper=function(a){this.wrappers_.push(a)};goog.editor.Field.prototype.removeAllWrappers=function(){for(var a;a=this.wrappers_.pop();)a.dispose()};goog.editor.Field.MUTATION_EVENTS_GECKO=["DOMNodeInserted","DOMNodeRemoved","DOMNodeRemovedFromDocument","DOMNodeInsertedIntoDocument","DOMCharacterDataModified"];
goog.editor.Field.prototype.setupMutationEventHandlersGecko=function(){if(goog.editor.BrowserFeature.HAS_DOM_SUBTREE_MODIFIED_EVENT)this.eventRegister.listen(this.getElement(),"DOMSubtreeModified",this.handleMutationEventGecko_);else{var a=this.getEditableDomHelper().getDocument();this.eventRegister.listen(a,goog.editor.Field.MUTATION_EVENTS_GECKO,this.handleMutationEventGecko_,!0);this.eventRegister.listen(a,"DOMAttrModified",goog.bind(this.handleDomAttrChange,this,this.handleMutationEventGecko_),
!0)}};goog.editor.Field.prototype.handleBeforeChangeKeyEvent_=function(a){if(a.keyCode==goog.events.KeyCodes.TAB&&!this.dispatchBeforeTab_(a)||goog.userAgent.GECKO&&a.metaKey&&(a.keyCode==goog.events.KeyCodes.LEFT||a.keyCode==goog.events.KeyCodes.RIGHT))return a.preventDefault(),!1;else(this.gotGeneratingKey_=a.charCode||goog.editor.Field.isGeneratingKey_(a,goog.userAgent.GECKO))&&this.dispatchBeforeChange();return!0};
goog.editor.Field.SELECTION_CHANGE_KEYCODES_={8:1,9:1,13:1,33:1,34:1,35:1,36:1,37:1,38:1,39:1,40:1,46:1};goog.editor.Field.CTRL_KEYS_CAUSING_SELECTION_CHANGES_={65:!0,86:!0,88:!0};goog.editor.Field.POTENTIAL_SHORTCUT_KEYCODES_={8:1,9:1,13:1,27:1,33:1,34:1,37:1,38:1,39:1,40:1};
goog.editor.Field.prototype.invokeShortCircuitingOp_=function(a){for(var b=this.indexedPlugins_[a],c=goog.array.slice(arguments,1),d=0;d<b.length;++d){var e=b[d];if((e.isEnabled(this)||goog.editor.Plugin.IRREPRESSIBLE_OPS[a])&&e[goog.editor.Plugin.OPCODE[a]].apply(e,c))return!0}return!1};
goog.editor.Field.prototype.invokeOp_=function(a){for(var b=this.indexedPlugins_[a],c=goog.array.slice(arguments,1),d=0;d<b.length;++d){var e=b[d];(e.isEnabled(this)||goog.editor.Plugin.IRREPRESSIBLE_OPS[a])&&e[goog.editor.Plugin.OPCODE[a]].apply(e,c)}};
goog.editor.Field.prototype.reduceOp_=function(a){for(var b=this.indexedPlugins_[a],c=goog.array.slice(arguments,1),d=0;d<b.length;++d){var e=b[d];if(e.isEnabled(this)||goog.editor.Plugin.IRREPRESSIBLE_OPS[a])c[0]=e[goog.editor.Plugin.OPCODE[a]].apply(e,c)}return c[0]};goog.editor.Field.prototype.injectContents=function(a,b){var c={},d=this.getInjectableContents(a,c);goog.style.setStyle(b,c);b.innerHTML=d};
goog.editor.Field.prototype.getInjectableContents=function(a,b){return this.reduceOp_(goog.editor.Plugin.Op.PREPARE_CONTENTS_HTML,a||"",b)};goog.editor.Field.prototype.handleKeyDown_=function(a){(goog.editor.BrowserFeature.USE_MUTATION_EVENTS||this.handleBeforeChangeKeyEvent_(a))&&!this.invokeShortCircuitingOp_(goog.editor.Plugin.Op.KEYDOWN,a)&&goog.editor.BrowserFeature.USES_KEYDOWN&&this.handleKeyboardShortcut_(a)};
goog.editor.Field.prototype.handleKeyPress_=function(a){if(goog.editor.BrowserFeature.USE_MUTATION_EVENTS){if(!this.handleBeforeChangeKeyEvent_(a))return}else this.gotGeneratingKey_=!0,this.dispatchBeforeChange();!this.invokeShortCircuitingOp_(goog.editor.Plugin.Op.KEYPRESS,a)&&!goog.editor.BrowserFeature.USES_KEYDOWN&&this.handleKeyboardShortcut_(a)};
goog.editor.Field.prototype.handleKeyUp_=function(a){!goog.editor.BrowserFeature.USE_MUTATION_EVENTS&&(this.gotGeneratingKey_||goog.editor.Field.isSpecialGeneratingKey_(a))&&this.handleChange();this.invokeShortCircuitingOp_(goog.editor.Plugin.Op.KEYUP,a);this.isEventStopped(goog.editor.Field.EventType.SELECTIONCHANGE)||(goog.editor.Field.SELECTION_CHANGE_KEYCODES_[a.keyCode]||(a.ctrlKey||a.metaKey)&&goog.editor.Field.CTRL_KEYS_CAUSING_SELECTION_CHANGES_[a.keyCode])&&this.selectionChangeTimer_.start()};
goog.editor.Field.prototype.handleKeyboardShortcut_=function(a){if(!a.altKey){var b=goog.userAgent.MAC?a.metaKey:a.ctrlKey;if(b||goog.editor.Field.POTENTIAL_SHORTCUT_KEYCODES_[a.keyCode]){var c=a.charCode||a.keyCode;c!=17&&(c=String.fromCharCode(c).toLowerCase(),this.invokeShortCircuitingOp_(goog.editor.Plugin.Op.SHORTCUT,a,c,b)&&a.preventDefault())}}};
goog.editor.Field.prototype.execCommand=function(a){for(var b=arguments,c,d=this.indexedPlugins_[goog.editor.Plugin.Op.EXEC_COMMAND],e=0;e<d.length;++e){var f=d[e];if(f.isEnabled(this)&&f.isSupportedCommand(a)){c=f.execCommand.apply(f,b);break}}return c};
goog.editor.Field.prototype.queryCommandValue=function(a){var b=this.isLoaded()&&this.isSelectionEditable();if(goog.isString(a))return this.queryCommandValueInternal_(a,b);else{for(var c={},d=0;d<a.length;d++)c[a[d]]=this.queryCommandValueInternal_(a[d],b);return c}};
goog.editor.Field.prototype.queryCommandValueInternal_=function(a,b){for(var c=this.indexedPlugins_[goog.editor.Plugin.Op.QUERY_COMMAND],d=0;d<c.length;++d){var e=c[d];if(e.isEnabled(this)&&e.isSupportedCommand(a)&&(b||e.activeOnUneditableFields()))return e.queryCommandValue(a)}return b?null:!1};
goog.editor.Field.prototype.handleDomAttrChange=function(a,b){if(!this.isEventStopped(goog.editor.Field.EventType.CHANGE)){var c=b.getBrowserEvent();try{if(c.originalTarget.prefix||c.originalTarget.nodeName=="scrollbar")return}catch(d){return}c.prevValue!=c.newValue&&a.call(this,c)}};
goog.editor.Field.prototype.handleMutationEventGecko_=function(a){if(!this.isEventStopped(goog.editor.Field.EventType.CHANGE)&&(a=a.getBrowserEvent?a.getBrowserEvent():a,!a.target.firebugIgnore))this.isEverModified_=this.isModified_=!0,this.changeTimerGecko_.start()};goog.editor.Field.prototype.handleDrop_=function(){goog.userAgent.IE&&this.execCommand(goog.editor.Command.CLEAR_LOREM,!0);goog.editor.BrowserFeature.USE_MUTATION_EVENTS&&this.dispatchFocusAndBeforeFocus_();this.dispatchChange()};
goog.editor.Field.prototype.getEditableIframe=function(){var a;if(this.usesIframe()&&(a=this.getEditableDomHelper()))return(a=a.getWindow())&&a.frameElement;return null};goog.editor.Field.prototype.getEditableDomHelper=function(){return this.editableDomHelper};goog.editor.Field.prototype.getRange=function(){var a=this.editableDomHelper&&this.editableDomHelper.getWindow();return a&&goog.dom.Range.createFromWindow(a)};
goog.editor.Field.prototype.dispatchSelectionChangeEvent=function(a,b){if(!this.isEventStopped(goog.editor.Field.EventType.SELECTIONCHANGE)){var c=this.getRange();c=c&&c.getContainerElement();this.isSelectionEditable_=!!c&&goog.dom.contains(this.getElement(),c);this.dispatchCommandValueChange();this.dispatchEvent({type:goog.editor.Field.EventType.SELECTIONCHANGE,originalType:a&&a.type});this.invokeShortCircuitingOp_(goog.editor.Plugin.Op.SELECTION,a,b)}};
goog.editor.Field.prototype.handleSelectionChangeTimer_=function(){var a=this.selectionChangeTarget_;this.selectionChangeTarget_=null;this.dispatchSelectionChangeEvent(void 0,a)};goog.editor.Field.prototype.dispatchBeforeChange=function(){this.isEventStopped(goog.editor.Field.EventType.BEFORECHANGE)||this.dispatchEvent(goog.editor.Field.EventType.BEFORECHANGE)};
goog.editor.Field.prototype.dispatchBeforeTab_=function(a){return this.dispatchEvent({type:goog.editor.Field.EventType.BEFORETAB,shiftKey:a.shiftKey,altKey:a.altKey,ctrlKey:a.ctrlKey})};goog.editor.Field.prototype.stopChangeEvents=function(a,b){a&&(this.changeTimerGecko_&&this.changeTimerGecko_.fireIfActive(),this.stopEvent(goog.editor.Field.EventType.CHANGE));b&&(this.clearDelayedChange(),this.stopEvent(goog.editor.Field.EventType.DELAYEDCHANGE))};
goog.editor.Field.prototype.startChangeEvents=function(a,b){!a&&this.changeTimerGecko_&&this.changeTimerGecko_.fireIfActive();this.startEvent(goog.editor.Field.EventType.CHANGE);this.startEvent(goog.editor.Field.EventType.DELAYEDCHANGE);a&&this.handleChange();b&&this.dispatchDelayedChange_()};goog.editor.Field.prototype.stopEvent=function(a){this.stoppedEvents_[a]=1};goog.editor.Field.prototype.startEvent=function(a){this.stoppedEvents_[a]=0};
goog.editor.Field.prototype.debounceEvent=function(a){this.debouncedEvents_[a]=goog.now()};goog.editor.Field.prototype.isEventStopped=function(a){return!!this.stoppedEvents_[a]||this.debouncedEvents_[a]&&goog.now()-this.debouncedEvents_[a]<=goog.editor.Field.DEBOUNCE_TIME_MS_};
goog.editor.Field.prototype.manipulateDom=function(a,b,c){this.stopChangeEvents(!0,!0);try{a.call(c)}finally{this.isLoaded()&&(b?(this.startEvent(goog.editor.Field.EventType.CHANGE),this.handleChange(),this.startEvent(goog.editor.Field.EventType.DELAYEDCHANGE)):this.dispatchChange())}};goog.editor.Field.prototype.dispatchCommandValueChange=function(a){a?this.dispatchEvent({type:goog.editor.Field.EventType.COMMAND_VALUE_CHANGE,commands:a}):this.dispatchEvent(goog.editor.Field.EventType.COMMAND_VALUE_CHANGE)};
goog.editor.Field.prototype.dispatchChange=function(a){this.startChangeEvents(!0,a)};goog.editor.Field.prototype.handleChange=function(){if(!this.isEventStopped(goog.editor.Field.EventType.CHANGE))this.changeTimerGecko_&&this.changeTimerGecko_.stop(),this.isEverModified_=this.isModified_=!0,this.isEventStopped(goog.editor.Field.EventType.DELAYEDCHANGE)||this.delayedChangeTimer_.start()};
goog.editor.Field.prototype.dispatchDelayedChange_=function(){if(!this.isEventStopped(goog.editor.Field.EventType.DELAYEDCHANGE))this.delayedChangeTimer_.stop(),this.isModified_=!1,this.dispatchEvent(goog.editor.Field.EventType.DELAYEDCHANGE)};goog.editor.Field.prototype.clearDelayedChange=function(){this.changeTimerGecko_&&this.changeTimerGecko_.fireIfActive();this.delayedChangeTimer_.fireIfActive()};
goog.editor.Field.prototype.dispatchFocusAndBeforeFocus_=function(){this.dispatchBeforeFocus_();this.dispatchFocus_()};goog.editor.Field.prototype.dispatchBeforeFocus_=function(){this.isEventStopped(goog.editor.Field.EventType.BEFOREFOCUS)||(this.execCommand(goog.editor.Command.CLEAR_LOREM,!0),this.dispatchEvent(goog.editor.Field.EventType.BEFOREFOCUS))};
goog.editor.Field.prototype.dispatchFocus_=function(){if(!this.isEventStopped(goog.editor.Field.EventType.FOCUS)){goog.editor.Field.setActiveFieldId(this.id);this.isSelectionEditable_=!0;this.dispatchEvent(goog.editor.Field.EventType.FOCUS);if(goog.editor.BrowserFeature.PUTS_CURSOR_BEFORE_FIRST_BLOCK_ELEMENT_ON_FOCUS){var a=this.getElement(),b=this.getRange();if(b){var c=b.getFocusNode();b.getFocusOffset()==0&&(!c||c==a||c.tagName==goog.dom.TagName.BODY)&&goog.editor.range.selectNodeStart(a)}}!goog.editor.BrowserFeature.CLEARS_SELECTION_WHEN_FOCUS_LEAVES&&
this.usesIframe()&&this.getEditableDomHelper().getWindow().parent.getSelection().removeAllRanges()}};goog.editor.Field.prototype.dispatchBlur=function(){if(!this.isEventStopped(goog.editor.Field.EventType.BLUR))goog.editor.Field.getActiveFieldId()==this.id&&goog.editor.Field.setActiveFieldId(null),this.isSelectionEditable_=!1,this.dispatchEvent(goog.editor.Field.EventType.BLUR)};goog.editor.Field.prototype.isSelectionEditable=function(){return this.isSelectionEditable_};
goog.editor.Field.cancelLinkClick_=function(a){goog.dom.getAncestorByTagNameAndClass(a.target,goog.dom.TagName.A)&&a.preventDefault()};goog.editor.Field.prototype.handleMouseDown_=function(a){goog.editor.Field.getActiveFieldId()||goog.editor.Field.setActiveFieldId(this.id);if(goog.userAgent.IE){var b=a.target;b&&b.tagName==goog.dom.TagName.A&&a.ctrlKey&&this.originalDomHelper.getWindow().open(b.href)}};
goog.editor.Field.prototype.handleMouseUp_=function(a){this.dispatchSelectionChangeEvent(a);if(goog.userAgent.IE)this.selectionChangeTarget_=a.target,this.selectionChangeTimer_.start()};
goog.editor.Field.prototype.getCleanContents=function(){if(this.queryCommandValue(goog.editor.Command.USING_LOREM))return goog.string.Unicode.NBSP;if(!this.isLoaded()){var a=this.getOriginalElement();a||this.logger.shout("Couldn't get the field element to read the contents");return a.innerHTML}a=this.getFieldCopy();this.invokeOp_(goog.editor.Plugin.Op.CLEAN_CONTENTS_DOM,a);return this.reduceOp_(goog.editor.Plugin.Op.CLEAN_CONTENTS_HTML,a.innerHTML)};
goog.editor.Field.prototype.getFieldCopy=function(){var a=this.getElement(),b=a.cloneNode(!1);a=a.innerHTML;goog.userAgent.IE&&a.match(/^\s*<script/i)&&(a=goog.string.Unicode.NBSP+a);b.innerHTML=a;return b};
goog.editor.Field.prototype.setHtml=function(a,b,c,d){this.isLoading()?this.logger.severe("Can't set html while loading Trogedit"):(d&&this.execCommand(goog.editor.Command.CLEAR_LOREM),b&&a&&(b="<p>"+b+"</p>"),c&&this.stopChangeEvents(!1,!0),this.setInnerHtml_(b),d&&this.execCommand(goog.editor.Command.UPDATE_LOREM),this.isLoaded()&&(c?(goog.editor.BrowserFeature.USE_MUTATION_EVENTS&&this.changeTimerGecko_.fireIfActive(),this.startChangeEvents()):this.dispatchChange()))};
goog.editor.Field.prototype.setInnerHtml_=function(a){var b=this.getElement();if(b){if(this.usesIframe()&&goog.editor.BrowserFeature.MOVES_STYLE_TO_HEAD)for(var c=b.ownerDocument.getElementsByTagName("HEAD"),d=c.length-1;d>=1;--d)c[d].parentNode.removeChild(c[d])}else b=this.getOriginalElement();b&&this.injectContents(a,b)};
goog.editor.Field.prototype.turnOnDesignModeGecko=function(){var a=this.getEditableDomHelper().getDocument();a.designMode="on";goog.editor.BrowserFeature.HAS_STYLE_WITH_CSS&&a.execCommand("styleWithCSS",!1,!1)};goog.editor.Field.prototype.installStyles=function(){this.cssStyles&&this.shouldLoadAsynchronously()&&goog.style.installStyles(this.cssStyles,this.getElement())};
goog.editor.Field.prototype.dispatchLoadEvent_=function(){var a=this.getElement();this.workaroundClassName_&&goog.dom.classes.add(a,this.workaroundClassName_);this.installStyles();this.startChangeEvents();this.logger.info("Dispatching load "+this.id);this.dispatchEvent(goog.editor.Field.EventType.LOAD)};goog.editor.Field.prototype.isUneditable=function(){return this.loadState_==goog.editor.Field.LoadState_.UNEDITABLE};goog.editor.Field.prototype.isLoaded=function(){return this.loadState_==goog.editor.Field.LoadState_.EDITABLE};
goog.editor.Field.prototype.isLoading=function(){return this.loadState_==goog.editor.Field.LoadState_.LOADING};goog.editor.Field.prototype.focus=function(){if(!goog.editor.BrowserFeature.HAS_CONTENT_EDITABLE||goog.userAgent.WEBKIT)this.getEditableDomHelper().getWindow().focus();else{if(goog.userAgent.OPERA)var a=this.appWindow_.pageXOffset,b=this.appWindow_.pageYOffset;this.getElement().focus();goog.userAgent.OPERA&&this.appWindow_.scrollTo(a,b)}};
goog.editor.Field.prototype.focusAndPlaceCursorAtStart=function(){(goog.editor.BrowserFeature.HAS_IE_RANGES||goog.userAgent.WEBKIT)&&this.placeCursorAtStart();this.focus()};goog.editor.Field.prototype.placeCursorAtStart=function(){var a=this.getElement();if(a){var b=goog.editor.node.getLeftMostLeaf(a);a==b?goog.dom.Range.createCaret(a,0).select():goog.editor.range.placeCursorNextTo(b,!0);this.dispatchSelectionChangeEvent()}};
goog.editor.Field.prototype.makeEditable=function(a){this.loadState_=goog.editor.Field.LoadState_.LOADING;var b=this.getOriginalElement();this.nodeName=b.nodeName;this.savedClassName_=b.className;this.setInitialStyle(b.style.cssText);b.className+=" editable";this.makeEditableInternal(a)};goog.editor.Field.prototype.makeEditableInternal=function(a){this.makeIframeField_(a)};
goog.editor.Field.prototype.handleFieldLoad=function(){goog.userAgent.IE&&goog.dom.Range.clearSelection(this.editableDomHelper.getWindow());goog.editor.Field.getActiveFieldId()!=this.id&&this.execCommand(goog.editor.Command.UPDATE_LOREM);this.setupChangeListeners_();this.dispatchLoadEvent_();for(var a in this.plugins_)this.plugins_[a].enable(this)};
goog.editor.Field.prototype.makeUneditable=function(a){if(this.isUneditable())throw Error("makeUneditable: Field is already uneditable");this.clearDelayedChange();this.selectionChangeTimer_.fireIfActive();this.execCommand(goog.editor.Command.CLEAR_LOREM);var b=null;!a&&this.getElement()&&(b=this.getCleanContents());this.clearFieldLoadListener_();a=this.getOriginalElement();goog.editor.Field.getActiveFieldId()==a.id&&goog.editor.Field.setActiveFieldId(null);this.clearListeners_();if(goog.isString(b))a.innerHTML=
b,this.resetOriginalElemProperties();this.restoreDom();this.tearDownFieldObject_();goog.userAgent.WEBKIT&&a.blur();this.execCommand(goog.editor.Command.UPDATE_LOREM);this.dispatchEvent(goog.editor.Field.EventType.UNLOAD)};goog.editor.Field.prototype.restoreDom=function(){var a=this.getOriginalElement();if(a){var b=this.getEditableIframe();b&&goog.dom.replaceNode(a,b)}};
goog.editor.Field.prototype.shouldLoadAsynchronously=function(){if(!goog.isDef(this.isHttps_)&&(this.isHttps_=!1,goog.userAgent.IE&&this.usesIframe())){for(var a=this.originalDomHelper.getWindow();a!=a.parent;)try{a=a.parent}catch(b){break}a=a.location;this.isHttps_=a.protocol=="https:"&&a.search.indexOf("nocheckhttps")==-1}return this.isHttps_};
goog.editor.Field.prototype.makeIframeField_=function(a){var b=this.getOriginalElement();if(b){b=b.innerHTML;var c={};b=this.reduceOp_(goog.editor.Plugin.Op.PREPARE_CONTENTS_HTML,b,c);var d=this.originalDomHelper.createDom(goog.dom.TagName.IFRAME,this.getIframeAttributes());if(this.shouldLoadAsynchronously()){var e=goog.bind(this.iframeFieldLoadHandler,this,d,b,c);this.fieldLoadListenerKey_=goog.events.listen(d,goog.events.EventType.LOAD,e,!0);if(a)d.src=a}this.attachIframe(d);this.shouldLoadAsynchronously()||
this.iframeFieldLoadHandler(d,b,c)}};goog.editor.Field.prototype.attachIframe=function(a){var b=this.getOriginalElement();a.className=b.className;a.id=b.id;goog.dom.replaceNode(a,b)};goog.editor.Field.prototype.getFieldFormatInfo=function(a){var b=this.getOriginalElement();b=goog.editor.node.isStandardsMode(b);return new goog.editor.icontent.FieldFormatInfo(this.id,b,!1,!1,a)};
goog.editor.Field.prototype.writeIframeContent=function(a,b,c){c=this.getFieldFormatInfo(c);if(this.shouldLoadAsynchronously())a=goog.dom.getFrameContentDocument(a),goog.editor.icontent.writeHttpsInitialIframe(c,a,b);else{var d=new goog.editor.icontent.FieldStyleInfo(this.getElement(),this.cssStyles);goog.editor.icontent.writeNormalInitialIframe(c,b,d,a)}};
goog.editor.Field.prototype.iframeFieldLoadHandler=function(a,b,c){this.clearFieldLoadListener_();a.allowTransparency="true";this.writeIframeContent(a,b,c);this.setupFieldObject(goog.dom.getFrameContentDocument(a).body);goog.editor.BrowserFeature.HAS_CONTENT_EDITABLE||this.turnOnDesignModeGecko();this.handleFieldLoad()};goog.editor.Field.prototype.clearFieldLoadListener_=function(){if(this.fieldLoadListenerKey_)goog.events.unlistenByKey(this.fieldLoadListenerKey_),this.fieldLoadListenerKey_=null};
goog.editor.Field.prototype.getIframeAttributes=function(){var a="padding:0;"+this.getOriginalElement().style.cssText;goog.string.endsWith(a,";")||(a+=";");a+="background-color:white;";goog.userAgent.IE&&(a+="overflow:visible;");return{frameBorder:0,style:a}};goog.ui.editor.AbstractDialog=function(a){goog.events.EventTarget.call(this);this.dom=a};goog.inherits(goog.ui.editor.AbstractDialog,goog.events.EventTarget);goog.ui.editor.AbstractDialog.prototype.show=function(){if(!this.dialogInternal_)this.dialogInternal_=this.createDialogControl(),this.dialogInternal_.addEventListener(goog.ui.Dialog.EventType.AFTER_HIDE,this.handleAfterHide_,!1,this);this.dialogInternal_.setVisible(!0)};
goog.ui.editor.AbstractDialog.prototype.hide=function(){this.dialogInternal_&&this.dialogInternal_.setVisible(!1)};goog.ui.editor.AbstractDialog.prototype.isOpen=function(){return!!this.dialogInternal_&&this.dialogInternal_.isVisible()};goog.ui.editor.AbstractDialog.prototype.processOkAndClose=function(){this.handleOk(new goog.ui.Dialog.Event(goog.ui.Dialog.DefaultButtonKeys.OK,null))&&this.hide()};goog.ui.editor.AbstractDialog.EventType={AFTER_HIDE:"afterhide",CANCEL:"cancel",OK:"ok"};
goog.ui.editor.AbstractDialog.Builder=function(a){this.editorDialog_=a;this.wrappedDialog_=new goog.ui.Dialog("",!0,this.editorDialog_.dom);this.buttonSet_=new goog.ui.Dialog.ButtonSet(this.editorDialog_.dom);this.buttonHandlers_={};this.addClassName("tr-dialog")};goog.ui.editor.AbstractDialog.Builder.prototype.setTitle=function(a){this.wrappedDialog_.setTitle(a);return this};
goog.ui.editor.AbstractDialog.Builder.prototype.addOkButton=function(a){var b=goog.ui.Dialog.DefaultButtonKeys.OK,c=goog.getMsg("OK");this.buttonSet_.set(b,a||c,!0);this.buttonHandlers_[b]=goog.bind(this.editorDialog_.handleOk,this.editorDialog_);return this};
goog.ui.editor.AbstractDialog.Builder.prototype.addCancelButton=function(a){var b=goog.ui.Dialog.DefaultButtonKeys.CANCEL,c=goog.getMsg("Cancel");this.buttonSet_.set(b,a||c,!1,!0);this.buttonHandlers_[b]=goog.bind(this.editorDialog_.handleCancel,this.editorDialog_);return this};goog.ui.editor.AbstractDialog.Builder.prototype.addButton=function(a,b,c){c=c||goog.string.createUniqueString();this.buttonSet_.set(c,a);this.buttonHandlers_[c]=b;return this};
goog.ui.editor.AbstractDialog.Builder.prototype.addClassName=function(a){goog.dom.classes.add(this.wrappedDialog_.getDialogElement(),a);return this};goog.ui.editor.AbstractDialog.Builder.prototype.setContent=function(a){goog.dom.appendChild(this.wrappedDialog_.getContentElement(),a);return this};
goog.ui.editor.AbstractDialog.Builder.prototype.build=function(){this.buttonSet_.isEmpty()&&(this.addOkButton(),this.addCancelButton());this.wrappedDialog_.setButtonSet(this.buttonSet_);var a=this.buttonHandlers_;this.buttonHandlers_=null;this.wrappedDialog_.addEventListener(goog.ui.Dialog.EventType.SELECT,function(b){if(a[b.key])return a[b.key](b)});this.wrappedDialog_.setModal(!0);var b=this.wrappedDialog_;this.wrappedDialog_=null;return b};
goog.ui.editor.AbstractDialog.prototype.getOkButtonElement=function(){return this.getButtonElement(goog.ui.Dialog.DefaultButtonKeys.OK)};goog.ui.editor.AbstractDialog.prototype.getCancelButtonElement=function(){return this.getButtonElement(goog.ui.Dialog.DefaultButtonKeys.CANCEL)};goog.ui.editor.AbstractDialog.prototype.getButtonElement=function(a){return this.dialogInternal_.getButtonSet().getButton(a)};
goog.ui.editor.AbstractDialog.prototype.handleOk=function(a){return(a=this.createOkEvent(a))?this.dispatchEvent(a):!1};goog.ui.editor.AbstractDialog.prototype.handleCancel=function(){return this.dispatchEvent(goog.ui.editor.AbstractDialog.EventType.CANCEL)};goog.ui.editor.AbstractDialog.prototype.disposeInternal=function(){if(this.dialogInternal_)this.hide(),this.dialogInternal_.dispose(),this.dialogInternal_=null;goog.ui.editor.AbstractDialog.superClass_.disposeInternal.call(this)};
goog.ui.editor.AbstractDialog.prototype.handleAfterHide_=function(){this.dispatchEvent(goog.ui.editor.AbstractDialog.EventType.AFTER_HIDE)};goog.editor.plugins.AbstractDialogPlugin=function(a){goog.editor.Plugin.call(this);this.command_=a};goog.inherits(goog.editor.plugins.AbstractDialogPlugin,goog.editor.Plugin);goog.editor.plugins.AbstractDialogPlugin.prototype.isSupportedCommand=function(a){return a==this.command_};goog.editor.plugins.AbstractDialogPlugin.prototype.execCommand=function(){return this.execCommandInternal.apply(this,arguments)};goog.editor.plugins.AbstractDialogPlugin.EventType={OPENED:"dialogOpened",CLOSED:"dialogClosed"};
goog.editor.plugins.AbstractDialogPlugin.prototype.getDialog=function(){return this.dialog_};goog.editor.plugins.AbstractDialogPlugin.prototype.setReuseDialog=function(a){this.reuseDialog_=a};
goog.editor.plugins.AbstractDialogPlugin.prototype.execCommandInternal=function(a,b){this.reuseDialog_||this.disposeDialog_();if(!this.dialog_)this.dialog_=this.createDialog(goog.dom.getDomHelper(this.fieldObject.getAppWindow()),b);var c=this.fieldObject.getRange();this.savedRange_=c&&goog.editor.range.saveUsingNormalizedCarets(c);goog.dom.Range.clearSelection(this.fieldObject.getEditableDomHelper().getWindow());goog.events.listenOnce(this.dialog_,goog.ui.editor.AbstractDialog.EventType.AFTER_HIDE,
this.handleAfterHide,!1,this);this.fieldObject.setModalMode(!0);this.dialog_.show();this.dispatchEvent(goog.editor.plugins.AbstractDialogPlugin.EventType.OPENED);this.fieldObject.dispatchSelectionChangeEvent();return!0};
goog.editor.plugins.AbstractDialogPlugin.prototype.handleAfterHide=function(){this.fieldObject.setModalMode(!1);this.restoreOriginalSelection();this.reuseDialog_||this.disposeDialog_();this.dispatchEvent(goog.editor.plugins.AbstractDialogPlugin.EventType.CLOSED);this.fieldObject.dispatchSelectionChangeEvent();this.fieldObject.debounceEvent(goog.editor.Field.EventType.SELECTIONCHANGE)};
goog.editor.plugins.AbstractDialogPlugin.prototype.restoreOriginalSelection=function(){this.fieldObject.focus();if(this.savedRange_)this.savedRange_.restore(),this.savedRange_=null};goog.editor.plugins.AbstractDialogPlugin.prototype.disposeOriginalSelection=function(){if(this.savedRange_)this.savedRange_.dispose(),this.savedRange_=null};goog.editor.plugins.AbstractDialogPlugin.prototype.disposeInternal=function(){this.disposeDialog_();goog.editor.plugins.AbstractDialogPlugin.superClass_.disposeInternal.call(this)};
goog.editor.plugins.AbstractDialogPlugin.prototype.reuseDialog_=!1;goog.editor.plugins.AbstractDialogPlugin.prototype.isDisposingDialog_=!1;goog.editor.plugins.AbstractDialogPlugin.prototype.disposeDialog_=function(){if(this.dialog_&&!this.isDisposingDialog_)this.isDisposingDialog_=!0,this.dialog_.dispose(),this.dialog_=null,this.isDisposingDialog_=!1};goog.uri={};goog.uri.utils={};goog.uri.utils.QueryArray={};goog.uri.utils.QueryValue={};goog.uri.utils.CharCode_={AMPERSAND:38,EQUAL:61,HASH:35,QUESTION:63};goog.uri.utils.buildFromEncodedParts=function(a,b,c,d,e,f,g){var h=[];a&&h.push(a,":");c&&(h.push("//"),b&&h.push(b,"@"),h.push(c),d&&h.push(":",d));e&&h.push(e);f&&h.push("?",f);g&&h.push("#",g);return h.join("")};goog.uri.utils.splitRe_=RegExp("^(?:([^:/?#.]+):)?(?://(?:([^/?#]*)@)?([\\w\\d\\-\\u0100-\\uffff.%]*)(?::([0-9]+))?)?([^?#]+)?(?:\\?([^#]*))?(?:#(.*))?$");
goog.uri.utils.ComponentIndex={SCHEME:1,USER_INFO:2,DOMAIN:3,PORT:4,PATH:5,QUERY_DATA:6,FRAGMENT:7};goog.uri.utils.split=function(a){return a.match(goog.uri.utils.splitRe_)};goog.uri.utils.decodeIfPossible_=function(a){return a&&decodeURIComponent(a)};goog.uri.utils.getComponentByIndex_=function(a,b){return goog.uri.utils.split(b)[a]||null};goog.uri.utils.getScheme=function(a){return goog.uri.utils.getComponentByIndex_(goog.uri.utils.ComponentIndex.SCHEME,a)};
goog.uri.utils.getUserInfoEncoded=function(a){return goog.uri.utils.getComponentByIndex_(goog.uri.utils.ComponentIndex.USER_INFO,a)};goog.uri.utils.getUserInfo=function(a){return goog.uri.utils.decodeIfPossible_(goog.uri.utils.getUserInfoEncoded(a))};goog.uri.utils.getDomainEncoded=function(a){return goog.uri.utils.getComponentByIndex_(goog.uri.utils.ComponentIndex.DOMAIN,a)};goog.uri.utils.getDomain=function(a){return goog.uri.utils.decodeIfPossible_(goog.uri.utils.getDomainEncoded(a))};
goog.uri.utils.getPort=function(a){return Number(goog.uri.utils.getComponentByIndex_(goog.uri.utils.ComponentIndex.PORT,a))||null};goog.uri.utils.getPathEncoded=function(a){return goog.uri.utils.getComponentByIndex_(goog.uri.utils.ComponentIndex.PATH,a)};goog.uri.utils.getPath=function(a){return goog.uri.utils.decodeIfPossible_(goog.uri.utils.getPathEncoded(a))};goog.uri.utils.getQueryData=function(a){return goog.uri.utils.getComponentByIndex_(goog.uri.utils.ComponentIndex.QUERY_DATA,a)};
goog.uri.utils.getFragmentEncoded=function(a){var b=a.indexOf("#");return b<0?null:a.substr(b+1)};goog.uri.utils.setFragmentEncoded=function(a,b){return goog.uri.utils.removeFragment(a)+(b?"#"+b:"")};goog.uri.utils.getFragment=function(a){return goog.uri.utils.decodeIfPossible_(goog.uri.utils.getFragmentEncoded(a))};
goog.uri.utils.getHost=function(a){a=goog.uri.utils.split(a);return goog.uri.utils.buildFromEncodedParts(a[goog.uri.utils.ComponentIndex.SCHEME],a[goog.uri.utils.ComponentIndex.USER_INFO],a[goog.uri.utils.ComponentIndex.DOMAIN],a[goog.uri.utils.ComponentIndex.PORT])};goog.uri.utils.getPathAndAfter=function(a){a=goog.uri.utils.split(a);return goog.uri.utils.buildFromEncodedParts(null,null,null,null,a[goog.uri.utils.ComponentIndex.PATH],a[goog.uri.utils.ComponentIndex.QUERY_DATA],a[goog.uri.utils.ComponentIndex.FRAGMENT])};
goog.uri.utils.removeFragment=function(a){var b=a.indexOf("#");return b<0?a:a.substr(0,b)};goog.uri.utils.haveSameDomain=function(a,b){var c=goog.uri.utils.split(a),d=goog.uri.utils.split(b);return c[goog.uri.utils.ComponentIndex.DOMAIN]==d[goog.uri.utils.ComponentIndex.DOMAIN]&&c[goog.uri.utils.ComponentIndex.SCHEME]==d[goog.uri.utils.ComponentIndex.SCHEME]&&c[goog.uri.utils.ComponentIndex.PORT]==d[goog.uri.utils.ComponentIndex.PORT]};
goog.uri.utils.assertNoFragmentsOrQueries_=function(a){if(goog.DEBUG&&(a.indexOf("#")>=0||a.indexOf("?")>=0))throw Error("goog.uri.utils: Fragment or query identifiers are not supported: ["+a+"]");};goog.uri.utils.appendQueryData_=function(a){if(a[1]){var b=a[0],c=b.indexOf("#");c>=0&&(a.push(b.substr(c)),a[0]=b=b.substr(0,c));c=b.indexOf("?");c<0?a[1]="?":c==b.length-1&&(a[1]=void 0)}return a.join("")};
goog.uri.utils.appendKeyValuePairs_=function(a,b,c){if(goog.isArray(b))for(var d=0;d<b.length;d++)c.push("&",a),b[d]!==""&&c.push("=",goog.string.urlEncode(b[d]));else b!=null&&(c.push("&",a),b!==""&&c.push("=",goog.string.urlEncode(b)))};goog.uri.utils.buildQueryDataBuffer_=function(a,b,c){goog.asserts.assert(Math.max(b.length-(c||0),0)%2==0,"goog.uri.utils: Key/value lists must be even in length.");for(c=c||0;c<b.length;c+=2)goog.uri.utils.appendKeyValuePairs_(b[c],b[c+1],a);return a};
goog.uri.utils.buildQueryData=function(a,b){var c=goog.uri.utils.buildQueryDataBuffer_([],a,b);c[0]="";return c.join("")};goog.uri.utils.buildQueryDataBufferFromMap_=function(a,b){for(var c in b)goog.uri.utils.appendKeyValuePairs_(c,b[c],a);return a};goog.uri.utils.buildQueryDataFromMap=function(a){a=goog.uri.utils.buildQueryDataBufferFromMap_([],a);a[0]="";return a.join("")};
goog.uri.utils.appendParams=function(a){return goog.uri.utils.appendQueryData_(arguments.length==2?goog.uri.utils.buildQueryDataBuffer_([a],arguments[1],0):goog.uri.utils.buildQueryDataBuffer_([a],arguments,1))};goog.uri.utils.appendParamsFromMap=function(a,b){return goog.uri.utils.appendQueryData_(goog.uri.utils.buildQueryDataBufferFromMap_([a],b))};goog.uri.utils.appendParam=function(a,b,c){return goog.uri.utils.appendQueryData_([a,"&",b,"=",goog.string.urlEncode(c)])};
goog.uri.utils.findParam_=function(a,b,c,d){for(var e=c.length;(b=a.indexOf(c,b))>=0&&b<d;){var f=a.charCodeAt(b-1);if(f==goog.uri.utils.CharCode_.AMPERSAND||f==goog.uri.utils.CharCode_.QUESTION)if(f=a.charCodeAt(b+e),!f||f==goog.uri.utils.CharCode_.EQUAL||f==goog.uri.utils.CharCode_.AMPERSAND||f==goog.uri.utils.CharCode_.HASH)return b;b+=e+1}return-1};goog.uri.utils.hashOrEndRe_=/#|$/;
goog.uri.utils.hasParam=function(a,b){return goog.uri.utils.findParam_(a,0,b,a.search(goog.uri.utils.hashOrEndRe_))>=0};goog.uri.utils.getParamValue=function(a,b){var c=a.search(goog.uri.utils.hashOrEndRe_),d=goog.uri.utils.findParam_(a,0,b,c);if(d<0)return null;else{var e=a.indexOf("&",d);if(e<0||e>c)e=c;d+=b.length+1;return goog.string.urlDecode(a.substr(d,e-d))}};
goog.uri.utils.getParamValues=function(a,b){for(var c=a.search(goog.uri.utils.hashOrEndRe_),d=0,e,f=[];(e=goog.uri.utils.findParam_(a,d,b,c))>=0;){d=a.indexOf("&",e);if(d<0||d>c)d=c;e+=b.length+1;f.push(goog.string.urlDecode(a.substr(e,d-e)))}return f};goog.uri.utils.trailingQueryPunctuationRe_=/[?&]($|#)/;
goog.uri.utils.removeParam=function(a,b){for(var c=a.search(goog.uri.utils.hashOrEndRe_),d=0,e,f=[];(e=goog.uri.utils.findParam_(a,d,b,c))>=0;)f.push(a.substring(d,e)),d=Math.min(a.indexOf("&",e)+1||c,c);f.push(a.substr(d));return f.join("").replace(goog.uri.utils.trailingQueryPunctuationRe_,"$1")};goog.uri.utils.setParam=function(a,b,c){return goog.uri.utils.appendParam(goog.uri.utils.removeParam(a,b),b,c)};
goog.uri.utils.appendPath=function(a,b){goog.uri.utils.assertNoFragmentsOrQueries_(a);goog.string.endsWith(a,"/")&&(a=a.substr(0,a.length-1));goog.string.startsWith(b,"/")&&(b=b.substr(1));return goog.string.buildString(a,"/",b)};goog.uri.utils.StandardQueryParam={RANDOM:"zx"};goog.uri.utils.makeUnique=function(a){return goog.uri.utils.setParam(a,goog.uri.utils.StandardQueryParam.RANDOM,goog.string.getRandomString())};goog.editor.Link=function(a,b){this.anchor_=a;this.isNew_=b};goog.editor.Link.prototype.getAnchor=function(){return this.anchor_};goog.editor.Link.prototype.getCurrentText=function(){if(!this.currentText_)this.currentText_=goog.dom.getRawTextContent(this.getAnchor());return this.currentText_};goog.editor.Link.prototype.isNew=function(){return this.isNew_};goog.editor.Link.prototype.initializeUrl=function(a){this.getAnchor().href=a};
goog.editor.Link.prototype.removeLink=function(){goog.dom.flattenElement(this.anchor_);this.anchor_=null};goog.editor.Link.prototype.setTextAndUrl=function(a,b){var c=this.getAnchor();c.href=b;var d=this.getCurrentText();if(a!=d){var e=goog.editor.node.getLeftMostLeaf(c);if(e.nodeType==goog.dom.NodeType.TEXT)e=e.parentNode;goog.dom.getRawTextContent(e)!=d&&(e=c);goog.dom.removeChildren(e);c=goog.dom.getDomHelper(e);goog.dom.appendChild(e,c.createTextNode(a));this.currentText_=null}this.isNew_=!1};
goog.editor.Link.prototype.placeCursorRightOf=function(){var a=this.getAnchor();if(goog.editor.BrowserFeature.GETS_STUCK_IN_LINKS){var b;b=a.nextSibling;if(!b||!(b.nodeType==goog.dom.NodeType.TEXT&&(goog.string.startsWith(b.data,goog.string.Unicode.NBSP)||goog.string.startsWith(b.data," "))))b=goog.dom.getDomHelper(a).createTextNode(goog.string.Unicode.NBSP),goog.dom.insertSiblingAfter(b,a);goog.dom.Range.createCaret(b,1).select()}else goog.editor.range.placeCursorNextTo(a,!1)};
goog.editor.Link.createNewLink=function(a,b,c){var d=new goog.editor.Link(a,!0);d.initializeUrl(b);if(c)a.target=c;return d};
goog.editor.Link.isLikelyUrl=function(a){if(/\s/.test(a))return!1;if(goog.editor.Link.isLikelyEmailAddress(a))return!1;var b=!1;/^[^:\/?#.]+:/.test(a)||(a="http://"+a,b=!0);a=goog.uri.utils.split(a);if(goog.array.indexOf(["mailto","aim"],a[goog.uri.utils.ComponentIndex.SCHEME])!=-1)return!0;var c=a[goog.uri.utils.ComponentIndex.DOMAIN];if(!c||b&&c.indexOf(".")==-1)return!1;b=a[goog.uri.utils.ComponentIndex.PATH];return!b||b.indexOf("/")==0};goog.editor.Link.LIKELY_EMAIL_ADDRESS_=/^[\w-]+(\.[\w-]+)*\@([\w-]+\.)+(\d+|\w\w+)$/i;
goog.editor.Link.isLikelyEmailAddress=function(a){return goog.editor.Link.LIKELY_EMAIL_ADDRESS_.test(a)};goog.editor.Link.isMailto=function(a){return!!a&&goog.string.startsWith(a,"mailto:")};goog.events.InputHandler=function(a){goog.events.EventTarget.call(this);this.element_=a;this.inputEventEmulation_=goog.userAgent.IE||goog.userAgent.WEBKIT&&!goog.userAgent.isVersion("531")&&a.tagName=="TEXTAREA";this.eventHandler_=new goog.events.EventHandler(this);this.eventHandler_.listen(this.element_,this.inputEventEmulation_?["keydown","paste","cut","drop"]:"input",this)};goog.inherits(goog.events.InputHandler,goog.events.EventTarget);goog.events.InputHandler.EventType={INPUT:"input"};
goog.events.InputHandler.prototype.timer_=null;
goog.events.InputHandler.prototype.handleEvent=function(a){if(this.inputEventEmulation_){if(a.type!="keydown"||goog.events.KeyCodes.isTextModifyingKeyEvent(a)){var b=a.type=="keydown"?this.element_.value:null;goog.userAgent.IE&&a.keyCode==goog.events.KeyCodes.WIN_IME&&(b=null);var c=this.createInputEvent_(a);this.cancelTimerIfSet_();this.timer_=goog.Timer.callOnce(function(){this.timer_=null;this.element_.value!=b&&this.dispatchAndDisposeEvent_(c)},0,this)}}else(!goog.userAgent.OPERA||this.element_==
goog.dom.getOwnerDocument(this.element_).activeElement)&&this.dispatchAndDisposeEvent_(this.createInputEvent_(a))};goog.events.InputHandler.prototype.cancelTimerIfSet_=function(){if(this.timer_!=null)goog.Timer.clear(this.timer_),this.timer_=null};goog.events.InputHandler.prototype.createInputEvent_=function(a){a=new goog.events.BrowserEvent(a.getBrowserEvent());a.type=goog.events.InputHandler.EventType.INPUT;return a};goog.events.InputHandler.prototype.dispatchAndDisposeEvent_=function(a){try{this.dispatchEvent(a)}finally{a.dispose()}};
goog.events.InputHandler.prototype.disposeInternal=function(){goog.events.InputHandler.superClass_.disposeInternal.call(this);this.eventHandler_.dispose();this.cancelTimerIfSet_();delete this.element_};goog.ui.ControlContent={};goog.ui.ControlRenderer=function(){};goog.addSingletonGetter(goog.ui.ControlRenderer);goog.ui.ControlRenderer.getCustomRenderer=function(a,b){var c=new a;c.getCssClass=function(){return b};return c};goog.ui.ControlRenderer.CSS_CLASS="goog-control";goog.ui.ControlRenderer.IE6_CLASS_COMBINATIONS=[];goog.ui.ControlRenderer.prototype.getAriaRole=function(){};
goog.ui.ControlRenderer.prototype.createDom=function(a){var b=a.getDomHelper().createDom("div",this.getClassNames(a).join(" "),a.getContent());this.setAriaStates(a,b);return b};goog.ui.ControlRenderer.prototype.getContentElement=function(a){return a};
goog.ui.ControlRenderer.prototype.enableClassName=function(a,b,c){if(a=a.getElement?a.getElement():a)if(goog.userAgent.IE&&!goog.userAgent.isVersion("7")){var d=this.getAppliedCombinedClassNames_(goog.dom.classes.get(a),b);d.push(b);goog.partial(c?goog.dom.classes.add:goog.dom.classes.remove,a).apply(null,d)}else goog.dom.classes.enable(a,b,c)};goog.ui.ControlRenderer.prototype.enableExtraClassName=function(a,b,c){this.enableClassName(a,b,c)};goog.ui.ControlRenderer.prototype.canDecorate=function(){return!0};
goog.ui.ControlRenderer.prototype.decorate=function(a,b){b.id&&a.setId(b.id);var c=this.getContentElement(b);c&&c.firstChild?a.setContentInternal(c.firstChild.nextSibling?goog.array.clone(c.childNodes):c.firstChild):a.setContentInternal(null);var d=0,e=this.getCssClass(),f=this.getStructuralCssClass(),g=!1,h=!1;c=!1;var i=goog.dom.classes.get(b);goog.array.forEach(i,function(a){!g&&a==e?(g=!0,f==e&&(h=!0)):!h&&a==f?h=!0:d|=this.getStateFromClass(a)},this);a.setStateInternal(d);g||(i.push(e),f==e&&
(h=!0));h||i.push(f);var j=a.getExtraClassNames();j&&i.push.apply(i,j);if(goog.userAgent.IE&&!goog.userAgent.isVersion("7")){var k=this.getAppliedCombinedClassNames_(i);k.length>0&&(i.push.apply(i,k),c=!0)}(!g||!h||j||c)&&goog.dom.classes.set(b,i.join(" "));this.setAriaStates(a,b);return b};goog.ui.ControlRenderer.prototype.initializeDom=function(a){a.isRightToLeft()&&this.setRightToLeft(a.getElement(),!0);a.isEnabled()&&this.setFocusable(a,a.isVisible())};
goog.ui.ControlRenderer.prototype.setAriaRole=function(a,b){var c=b||this.getAriaRole();c&&goog.dom.a11y.setRole(a,c)};
goog.ui.ControlRenderer.prototype.setAriaStates=function(a,b){goog.asserts.assert(a);goog.asserts.assert(b);a.isEnabled()||this.updateAriaState(b,goog.ui.Component.State.DISABLED,!0);a.isSelected()&&this.updateAriaState(b,goog.ui.Component.State.SELECTED,!0);a.isSupportedState(goog.ui.Component.State.CHECKED)&&this.updateAriaState(b,goog.ui.Component.State.CHECKED,a.isChecked());a.isSupportedState(goog.ui.Component.State.OPENED)&&this.updateAriaState(b,goog.ui.Component.State.OPENED,a.isOpen())};
goog.ui.ControlRenderer.prototype.setAllowTextSelection=function(a,b){goog.style.setUnselectable(a,!b,!goog.userAgent.IE&&!goog.userAgent.OPERA)};goog.ui.ControlRenderer.prototype.setRightToLeft=function(a,b){this.enableClassName(a,this.getStructuralCssClass()+"-rtl",b)};goog.ui.ControlRenderer.prototype.isFocusable=function(a){var b;if(a.isSupportedState(goog.ui.Component.State.FOCUSED)&&(b=a.getKeyEventTarget()))return goog.dom.isFocusableTabIndex(b);return!1};
goog.ui.ControlRenderer.prototype.setFocusable=function(a,b){var c;if(a.isSupportedState(goog.ui.Component.State.FOCUSED)&&(c=a.getKeyEventTarget())){if(!b&&a.isFocused()){try{c.blur()}catch(d){}a.isFocused()&&a.handleBlur(null)}goog.dom.isFocusableTabIndex(c)!=b&&goog.dom.setFocusableTabIndex(c,b)}};goog.ui.ControlRenderer.prototype.setVisible=function(a,b){goog.style.showElement(a,b)};
goog.ui.ControlRenderer.prototype.setState=function(a,b,c){var d=a.getElement();if(d){var e=this.getClassForState(b);e&&this.enableClassName(a,e,c);this.updateAriaState(d,b,c)}};
goog.ui.ControlRenderer.prototype.updateAriaState=function(a,b,c){if(!goog.ui.ControlRenderer.ARIA_STATE_MAP_)goog.ui.ControlRenderer.ARIA_STATE_MAP_=goog.object.create(goog.ui.Component.State.DISABLED,goog.dom.a11y.State.DISABLED,goog.ui.Component.State.SELECTED,goog.dom.a11y.State.SELECTED,goog.ui.Component.State.CHECKED,goog.dom.a11y.State.CHECKED,goog.ui.Component.State.OPENED,goog.dom.a11y.State.EXPANDED);(b=goog.ui.ControlRenderer.ARIA_STATE_MAP_[b])&&goog.dom.a11y.setState(a,b,c)};
goog.ui.ControlRenderer.prototype.setContent=function(a,b){var c=this.getContentElement(a);if(c&&(goog.dom.removeChildren(c),b))if(goog.isString(b))goog.dom.setTextContent(c,b);else{var d=function(a){if(a){var b=goog.dom.getOwnerDocument(c);c.appendChild(goog.isString(a)?b.createTextNode(a):a)}};goog.isArray(b)?goog.array.forEach(b,d):goog.isArrayLike(b)&&!("nodeType"in b)?goog.array.forEach(goog.array.clone(b),d):d(b)}};goog.ui.ControlRenderer.prototype.getKeyEventTarget=function(a){return a.getElement()};
goog.ui.ControlRenderer.prototype.getCssClass=function(){return goog.ui.ControlRenderer.CSS_CLASS};goog.ui.ControlRenderer.prototype.getIe6ClassCombinations=function(){return[]};goog.ui.ControlRenderer.prototype.getStructuralCssClass=function(){return this.getCssClass()};
goog.ui.ControlRenderer.prototype.getClassNames=function(a){var b=this.getCssClass(),c=[b],d=this.getStructuralCssClass();d!=b&&c.push(d);b=this.getClassNamesForState(a.getState());c.push.apply(c,b);(a=a.getExtraClassNames())&&c.push.apply(c,a);goog.userAgent.IE&&!goog.userAgent.isVersion("7")&&c.push.apply(c,this.getAppliedCombinedClassNames_(c));return c};
goog.ui.ControlRenderer.prototype.getAppliedCombinedClassNames_=function(a,b){var c=[];b&&(a=a.concat([b]));goog.array.forEach(this.getIe6ClassCombinations(),function(d){goog.array.every(d,goog.partial(goog.array.contains,a))&&(!b||goog.array.contains(d,b))&&c.push(d.join("_"))});return c};goog.ui.ControlRenderer.prototype.getClassNamesForState=function(a){for(var b=[];a;){var c=a&-a;b.push(this.getClassForState(c));a&=~c}return b};
goog.ui.ControlRenderer.prototype.getClassForState=function(a){this.classByState_||this.createClassByStateMap_();return this.classByState_[a]};goog.ui.ControlRenderer.prototype.getStateFromClass=function(a){this.stateByClass_||this.createStateByClassMap_();a=parseInt(this.stateByClass_[a],10);return isNaN(a)?0:a};
goog.ui.ControlRenderer.prototype.createClassByStateMap_=function(){var a=this.getStructuralCssClass();this.classByState_=goog.object.create(goog.ui.Component.State.DISABLED,a+"-disabled",goog.ui.Component.State.HOVER,a+"-hover",goog.ui.Component.State.ACTIVE,a+"-active",goog.ui.Component.State.SELECTED,a+"-selected",goog.ui.Component.State.CHECKED,a+"-checked",goog.ui.Component.State.FOCUSED,a+"-focused",goog.ui.Component.State.OPENED,a+"-open")};
goog.ui.ControlRenderer.prototype.createStateByClassMap_=function(){this.classByState_||this.createClassByStateMap_();this.stateByClass_=goog.object.transpose(this.classByState_)};goog.ui.registry={};goog.ui.registry.getDefaultRenderer=function(a){for(var b;a;){b=goog.getUid(a);if(b=goog.ui.registry.defaultRenderers_[b])break;a=a.superClass_?a.superClass_.constructor:null}if(b)return goog.isFunction(b.getInstance)?b.getInstance():new b;return null};
goog.ui.registry.setDefaultRenderer=function(a,b){if(!goog.isFunction(a))throw Error("Invalid component class "+a);if(!goog.isFunction(b))throw Error("Invalid renderer class "+b);var c=goog.getUid(a);goog.ui.registry.defaultRenderers_[c]=b};goog.ui.registry.getDecoratorByClassName=function(a){return a in goog.ui.registry.decoratorFunctions_?goog.ui.registry.decoratorFunctions_[a]():null};
goog.ui.registry.setDecoratorByClassName=function(a,b){if(!a)throw Error("Invalid class name "+a);if(!goog.isFunction(b))throw Error("Invalid decorator function "+b);goog.ui.registry.decoratorFunctions_[a]=b};goog.ui.registry.getDecorator=function(a){for(var b=goog.dom.classes.get(a),c=0,d=b.length;c<d;c++)if(a=goog.ui.registry.getDecoratorByClassName(b[c]))return a;return null};goog.ui.registry.reset=function(){goog.ui.registry.defaultRenderers_={};goog.ui.registry.decoratorFunctions_={}};
goog.ui.registry.defaultRenderers_={};goog.ui.registry.decoratorFunctions_={};goog.ui.decorate=function(a){var b=goog.ui.registry.getDecorator(a);b&&b.decorate(a);return b};goog.events.KeyHandler=function(a,b){goog.events.EventTarget.call(this);a&&this.attach(a,b)};goog.inherits(goog.events.KeyHandler,goog.events.EventTarget);goog.events.KeyHandler.prototype.element_=null;goog.events.KeyHandler.prototype.keyPressKey_=null;goog.events.KeyHandler.prototype.keyDownKey_=null;goog.events.KeyHandler.prototype.keyUpKey_=null;goog.events.KeyHandler.prototype.lastKey_=-1;goog.events.KeyHandler.prototype.keyCode_=-1;goog.events.KeyHandler.EventType={KEY:"key"};
goog.events.KeyHandler.safariKey_={"3":goog.events.KeyCodes.ENTER,"12":goog.events.KeyCodes.NUMLOCK,"63232":goog.events.KeyCodes.UP,"63233":goog.events.KeyCodes.DOWN,"63234":goog.events.KeyCodes.LEFT,"63235":goog.events.KeyCodes.RIGHT,"63236":goog.events.KeyCodes.F1,"63237":goog.events.KeyCodes.F2,"63238":goog.events.KeyCodes.F3,"63239":goog.events.KeyCodes.F4,"63240":goog.events.KeyCodes.F5,"63241":goog.events.KeyCodes.F6,"63242":goog.events.KeyCodes.F7,"63243":goog.events.KeyCodes.F8,"63244":goog.events.KeyCodes.F9,
"63245":goog.events.KeyCodes.F10,"63246":goog.events.KeyCodes.F11,"63247":goog.events.KeyCodes.F12,"63248":goog.events.KeyCodes.PRINT_SCREEN,"63272":goog.events.KeyCodes.DELETE,"63273":goog.events.KeyCodes.HOME,"63275":goog.events.KeyCodes.END,"63276":goog.events.KeyCodes.PAGE_UP,"63277":goog.events.KeyCodes.PAGE_DOWN,"63289":goog.events.KeyCodes.NUMLOCK,"63302":goog.events.KeyCodes.INSERT};
goog.events.KeyHandler.keyIdentifier_={Up:goog.events.KeyCodes.UP,Down:goog.events.KeyCodes.DOWN,Left:goog.events.KeyCodes.LEFT,Right:goog.events.KeyCodes.RIGHT,Enter:goog.events.KeyCodes.ENTER,F1:goog.events.KeyCodes.F1,F2:goog.events.KeyCodes.F2,F3:goog.events.KeyCodes.F3,F4:goog.events.KeyCodes.F4,F5:goog.events.KeyCodes.F5,F6:goog.events.KeyCodes.F6,F7:goog.events.KeyCodes.F7,F8:goog.events.KeyCodes.F8,F9:goog.events.KeyCodes.F9,F10:goog.events.KeyCodes.F10,F11:goog.events.KeyCodes.F11,F12:goog.events.KeyCodes.F12,
"U+007F":goog.events.KeyCodes.DELETE,Home:goog.events.KeyCodes.HOME,End:goog.events.KeyCodes.END,PageUp:goog.events.KeyCodes.PAGE_UP,PageDown:goog.events.KeyCodes.PAGE_DOWN,Insert:goog.events.KeyCodes.INSERT};goog.events.KeyHandler.mozKeyCodeToKeyCodeMap_={61:187,59:186};goog.events.KeyHandler.USES_KEYDOWN_=goog.userAgent.IE||goog.userAgent.WEBKIT&&goog.userAgent.isVersion("525");
goog.events.KeyHandler.prototype.handleKeyDown_=function(a){if(goog.userAgent.WEBKIT&&(this.lastKey_==goog.events.KeyCodes.CTRL&&!a.ctrlKey||this.lastKey_==goog.events.KeyCodes.ALT&&!a.altKey))this.keyCode_=this.lastKey_=-1;goog.events.KeyHandler.USES_KEYDOWN_&&!goog.events.KeyCodes.firesKeyPressEvent(a.keyCode,this.lastKey_,a.shiftKey,a.ctrlKey,a.altKey)?this.handleEvent(a):this.keyCode_=goog.userAgent.GECKO&&a.keyCode in goog.events.KeyHandler.mozKeyCodeToKeyCodeMap_?goog.events.KeyHandler.mozKeyCodeToKeyCodeMap_[a.keyCode]:
a.keyCode};goog.events.KeyHandler.prototype.handleKeyup_=function(){this.keyCode_=this.lastKey_=-1};
goog.events.KeyHandler.prototype.handleEvent=function(a){var b=a.getBrowserEvent(),c,d;if(goog.userAgent.IE&&a.type==goog.events.EventType.KEYPRESS)c=this.keyCode_,d=c!=goog.events.KeyCodes.ENTER&&c!=goog.events.KeyCodes.ESC?b.keyCode:0;else if(goog.userAgent.WEBKIT&&a.type==goog.events.EventType.KEYPRESS)c=this.keyCode_,d=b.charCode>=0&&b.charCode<63232&&goog.events.KeyCodes.isCharacterKey(c)?b.charCode:0;else if(goog.userAgent.OPERA)c=this.keyCode_,d=goog.events.KeyCodes.isCharacterKey(c)?b.keyCode:
0;else if(c=b.keyCode||this.keyCode_,d=b.charCode||0,goog.userAgent.MAC&&d==goog.events.KeyCodes.QUESTION_MARK&&!c)c=goog.events.KeyCodes.SLASH;var e=c,f=b.keyIdentifier;c?c>=63232&&c in goog.events.KeyHandler.safariKey_?e=goog.events.KeyHandler.safariKey_[c]:c==25&&a.shiftKey&&(e=9):f&&f in goog.events.KeyHandler.keyIdentifier_&&(e=goog.events.KeyHandler.keyIdentifier_[f]);a=e==this.lastKey_;this.lastKey_=e;b=new goog.events.KeyEvent(e,d,a,b);try{this.dispatchEvent(b)}finally{b.dispose()}};
goog.events.KeyHandler.prototype.getElement=function(){return this.element_};goog.events.KeyHandler.prototype.attach=function(a,b){this.keyUpKey_&&this.detach();this.element_=a;this.keyPressKey_=goog.events.listen(this.element_,goog.events.EventType.KEYPRESS,this,b);this.keyDownKey_=goog.events.listen(this.element_,goog.events.EventType.KEYDOWN,this.handleKeyDown_,b,this);this.keyUpKey_=goog.events.listen(this.element_,goog.events.EventType.KEYUP,this.handleKeyup_,b,this)};
goog.events.KeyHandler.prototype.detach=function(){if(this.keyPressKey_)goog.events.unlistenByKey(this.keyPressKey_),goog.events.unlistenByKey(this.keyDownKey_),goog.events.unlistenByKey(this.keyUpKey_),this.keyUpKey_=this.keyDownKey_=this.keyPressKey_=null;this.element_=null;this.keyCode_=this.lastKey_=-1};goog.events.KeyHandler.prototype.disposeInternal=function(){goog.events.KeyHandler.superClass_.disposeInternal.call(this);this.detach()};
goog.events.KeyEvent=function(a,b,c,d){goog.events.BrowserEvent.call(this,d);this.type=goog.events.KeyHandler.EventType.KEY;this.keyCode=a;this.charCode=b;this.repeat=c};goog.inherits(goog.events.KeyEvent,goog.events.BrowserEvent);goog.ui.Control=function(a,b,c){goog.ui.Component.call(this,c);this.renderer_=b||goog.ui.registry.getDefaultRenderer(this.constructor);this.setContentInternal(a)};goog.inherits(goog.ui.Control,goog.ui.Component);goog.ui.Control.registerDecorator=goog.ui.registry.setDecoratorByClassName;goog.ui.Control.getDecorator=goog.ui.registry.getDecorator;goog.ui.Control.decorate=goog.ui.decorate;goog.ui.Control.prototype.content_=null;goog.ui.Control.prototype.state_=0;
goog.ui.Control.prototype.supportedStates_=goog.ui.Component.State.DISABLED|goog.ui.Component.State.HOVER|goog.ui.Component.State.ACTIVE|goog.ui.Component.State.FOCUSED;goog.ui.Control.prototype.autoStates_=goog.ui.Component.State.ALL;goog.ui.Control.prototype.statesWithTransitionEvents_=0;goog.ui.Control.prototype.visible_=!0;goog.ui.Control.prototype.extraClassNames_=null;goog.ui.Control.prototype.handleMouseEvents_=!0;goog.ui.Control.prototype.allowTextSelection_=!1;
goog.ui.Control.prototype.preferredAriaRole_=null;goog.ui.Control.prototype.isHandleMouseEvents=function(){return this.handleMouseEvents_};goog.ui.Control.prototype.setHandleMouseEvents=function(a){this.isInDocument()&&a!=this.handleMouseEvents_&&this.enableMouseEventHandling_(a);this.handleMouseEvents_=a};goog.ui.Control.prototype.getKeyEventTarget=function(){return this.renderer_.getKeyEventTarget(this)};
goog.ui.Control.prototype.getKeyHandler=function(){return this.keyHandler_||(this.keyHandler_=new goog.events.KeyHandler)};goog.ui.Control.prototype.getRenderer=function(){return this.renderer_};goog.ui.Control.prototype.setRenderer=function(a){if(this.isInDocument())throw Error(goog.ui.Component.Error.ALREADY_RENDERED);this.getElement()&&this.setElementInternal(null);this.renderer_=a};goog.ui.Control.prototype.getExtraClassNames=function(){return this.extraClassNames_};
goog.ui.Control.prototype.addClassName=function(a){if(a)this.extraClassNames_?goog.array.contains(this.extraClassNames_,a)||this.extraClassNames_.push(a):this.extraClassNames_=[a],this.renderer_.enableExtraClassName(this,a,!0)};goog.ui.Control.prototype.removeClassName=function(a){if(a&&this.extraClassNames_){goog.array.remove(this.extraClassNames_,a);if(this.extraClassNames_.length==0)this.extraClassNames_=null;this.renderer_.enableExtraClassName(this,a,!1)}};
goog.ui.Control.prototype.enableClassName=function(a,b){b?this.addClassName(a):this.removeClassName(a)};goog.ui.Control.prototype.createDom=function(){var a=this.renderer_.createDom(this);this.setElementInternal(a);this.renderer_.setAriaRole(a,this.getPreferredAriaRole());this.isAllowTextSelection()||this.renderer_.setAllowTextSelection(a,!1);this.isVisible()||this.renderer_.setVisible(a,!1)};goog.ui.Control.prototype.getPreferredAriaRole=function(){return this.preferredAriaRole_};
goog.ui.Control.prototype.setPreferredAriaRole=function(a){this.preferredAriaRole_=a};goog.ui.Control.prototype.getContentElement=function(){return this.renderer_.getContentElement(this.getElement())};goog.ui.Control.prototype.canDecorate=function(a){return this.renderer_.canDecorate(a)};
goog.ui.Control.prototype.decorateInternal=function(a){a=this.renderer_.decorate(this,a);this.setElementInternal(a);this.renderer_.setAriaRole(a,this.getPreferredAriaRole());this.isAllowTextSelection()||this.renderer_.setAllowTextSelection(a,!1);this.visible_=a.style.display!="none"};
goog.ui.Control.prototype.enterDocument=function(){goog.ui.Control.superClass_.enterDocument.call(this);this.renderer_.initializeDom(this);if(this.supportedStates_&~goog.ui.Component.State.DISABLED&&(this.isHandleMouseEvents()&&this.enableMouseEventHandling_(!0),this.isSupportedState(goog.ui.Component.State.FOCUSED))){var a=this.getKeyEventTarget();if(a){var b=this.getKeyHandler();b.attach(a);this.getHandler().listen(b,goog.events.KeyHandler.EventType.KEY,this.handleKeyEvent).listen(a,goog.events.EventType.FOCUS,
this.handleFocus).listen(a,goog.events.EventType.BLUR,this.handleBlur)}}};
goog.ui.Control.prototype.enableMouseEventHandling_=function(a){var b=this.getHandler(),c=this.getElement();a?(b.listen(c,goog.events.EventType.MOUSEOVER,this.handleMouseOver).listen(c,goog.events.EventType.MOUSEDOWN,this.handleMouseDown).listen(c,goog.events.EventType.MOUSEUP,this.handleMouseUp).listen(c,goog.events.EventType.MOUSEOUT,this.handleMouseOut),goog.userAgent.IE&&b.listen(c,goog.events.EventType.DBLCLICK,this.handleDblClick)):(b.unlisten(c,goog.events.EventType.MOUSEOVER,this.handleMouseOver).unlisten(c,
goog.events.EventType.MOUSEDOWN,this.handleMouseDown).unlisten(c,goog.events.EventType.MOUSEUP,this.handleMouseUp).unlisten(c,goog.events.EventType.MOUSEOUT,this.handleMouseOut),goog.userAgent.IE&&b.unlisten(c,goog.events.EventType.DBLCLICK,this.handleDblClick))};goog.ui.Control.prototype.exitDocument=function(){goog.ui.Control.superClass_.exitDocument.call(this);this.keyHandler_&&this.keyHandler_.detach();this.isVisible()&&this.isEnabled()&&this.renderer_.setFocusable(this,!1)};
goog.ui.Control.prototype.disposeInternal=function(){goog.ui.Control.superClass_.disposeInternal.call(this);this.keyHandler_&&(this.keyHandler_.dispose(),delete this.keyHandler_);delete this.renderer_;this.extraClassNames_=this.content_=null};goog.ui.Control.prototype.getContent=function(){return this.content_};goog.ui.Control.prototype.setContent=function(a){this.renderer_.setContent(this.getElement(),a);this.setContentInternal(a)};
goog.ui.Control.prototype.setContentInternal=function(a){this.content_=a};goog.ui.Control.prototype.getCaption=function(){var a=this.getContent();if(!a)return"";a=goog.isString(a)?a:goog.isArray(a)?goog.array.map(a,goog.dom.getRawTextContent).join(""):goog.dom.getTextContent(a);return goog.string.collapseBreakingSpaces(a)};goog.ui.Control.prototype.setCaption=function(a){this.setContent(a)};
goog.ui.Control.prototype.setRightToLeft=function(a){goog.ui.Control.superClass_.setRightToLeft.call(this,a);var b=this.getElement();b&&this.renderer_.setRightToLeft(b,a)};goog.ui.Control.prototype.isAllowTextSelection=function(){return this.allowTextSelection_};goog.ui.Control.prototype.setAllowTextSelection=function(a){this.allowTextSelection_=a;var b=this.getElement();b&&this.renderer_.setAllowTextSelection(b,a)};goog.ui.Control.prototype.isVisible=function(){return this.visible_};
goog.ui.Control.prototype.setVisible=function(a,b){if(b||this.visible_!=a&&this.dispatchEvent(a?goog.ui.Component.EventType.SHOW:goog.ui.Component.EventType.HIDE)){var c=this.getElement();c&&this.renderer_.setVisible(c,a);this.isEnabled()&&this.renderer_.setFocusable(this,a);this.visible_=a;return!0}return!1};goog.ui.Control.prototype.isEnabled=function(){return!this.hasState(goog.ui.Component.State.DISABLED)};
goog.ui.Control.prototype.isParentDisabled_=function(){var a=this.getParent();return!!a&&typeof a.isEnabled=="function"&&!a.isEnabled()};goog.ui.Control.prototype.setEnabled=function(a){!this.isParentDisabled_()&&this.isTransitionAllowed(goog.ui.Component.State.DISABLED,!a)&&(a||(this.setActive(!1),this.setHighlighted(!1)),this.isVisible()&&this.renderer_.setFocusable(this,a),this.setState(goog.ui.Component.State.DISABLED,!a))};goog.ui.Control.prototype.isHighlighted=function(){return this.hasState(goog.ui.Component.State.HOVER)};
goog.ui.Control.prototype.setHighlighted=function(a){this.isTransitionAllowed(goog.ui.Component.State.HOVER,a)&&this.setState(goog.ui.Component.State.HOVER,a)};goog.ui.Control.prototype.isActive=function(){return this.hasState(goog.ui.Component.State.ACTIVE)};goog.ui.Control.prototype.setActive=function(a){this.isTransitionAllowed(goog.ui.Component.State.ACTIVE,a)&&this.setState(goog.ui.Component.State.ACTIVE,a)};goog.ui.Control.prototype.isSelected=function(){return this.hasState(goog.ui.Component.State.SELECTED)};
goog.ui.Control.prototype.setSelected=function(a){this.isTransitionAllowed(goog.ui.Component.State.SELECTED,a)&&this.setState(goog.ui.Component.State.SELECTED,a)};goog.ui.Control.prototype.isChecked=function(){return this.hasState(goog.ui.Component.State.CHECKED)};goog.ui.Control.prototype.setChecked=function(a){this.isTransitionAllowed(goog.ui.Component.State.CHECKED,a)&&this.setState(goog.ui.Component.State.CHECKED,a)};goog.ui.Control.prototype.isFocused=function(){return this.hasState(goog.ui.Component.State.FOCUSED)};
goog.ui.Control.prototype.setFocused=function(a){this.isTransitionAllowed(goog.ui.Component.State.FOCUSED,a)&&this.setState(goog.ui.Component.State.FOCUSED,a)};goog.ui.Control.prototype.isOpen=function(){return this.hasState(goog.ui.Component.State.OPENED)};goog.ui.Control.prototype.setOpen=function(a){this.isTransitionAllowed(goog.ui.Component.State.OPENED,a)&&this.setState(goog.ui.Component.State.OPENED,a)};goog.ui.Control.prototype.getState=function(){return this.state_};
goog.ui.Control.prototype.hasState=function(a){return!!(this.state_&a)};goog.ui.Control.prototype.setState=function(a,b){if(this.isSupportedState(a)&&b!=this.hasState(a))this.renderer_.setState(this,a,b),this.state_=b?this.state_|a:this.state_&~a};goog.ui.Control.prototype.setStateInternal=function(a){this.state_=a};goog.ui.Control.prototype.isSupportedState=function(a){return!!(this.supportedStates_&a)};
goog.ui.Control.prototype.setSupportedState=function(a,b){if(this.isInDocument()&&this.hasState(a)&&!b)throw Error(goog.ui.Component.Error.ALREADY_RENDERED);!b&&this.hasState(a)&&this.setState(a,!1);this.supportedStates_=b?this.supportedStates_|a:this.supportedStates_&~a};goog.ui.Control.prototype.isAutoState=function(a){return!!(this.autoStates_&a)&&this.isSupportedState(a)};goog.ui.Control.prototype.setAutoStates=function(a,b){this.autoStates_=b?this.autoStates_|a:this.autoStates_&~a};
goog.ui.Control.prototype.isDispatchTransitionEvents=function(a){return!!(this.statesWithTransitionEvents_&a)&&this.isSupportedState(a)};goog.ui.Control.prototype.setDispatchTransitionEvents=function(a,b){this.statesWithTransitionEvents_=b?this.statesWithTransitionEvents_|a:this.statesWithTransitionEvents_&~a};
goog.ui.Control.prototype.isTransitionAllowed=function(a,b){return this.isSupportedState(a)&&this.hasState(a)!=b&&(!(this.statesWithTransitionEvents_&a)||this.dispatchEvent(goog.ui.Component.getStateTransitionEvent(a,b)))&&!this.isDisposed()};goog.ui.Control.prototype.handleMouseOver=function(a){!goog.ui.Control.isMouseEventWithinElement_(a,this.getElement())&&this.dispatchEvent(goog.ui.Component.EventType.ENTER)&&this.isEnabled()&&this.isAutoState(goog.ui.Component.State.HOVER)&&this.setHighlighted(!0)};
goog.ui.Control.prototype.handleMouseOut=function(a){!goog.ui.Control.isMouseEventWithinElement_(a,this.getElement())&&this.dispatchEvent(goog.ui.Component.EventType.LEAVE)&&(this.isAutoState(goog.ui.Component.State.ACTIVE)&&this.setActive(!1),this.isAutoState(goog.ui.Component.State.HOVER)&&this.setHighlighted(!1))};goog.ui.Control.isMouseEventWithinElement_=function(a,b){return!!a.relatedTarget&&goog.dom.contains(b,a.relatedTarget)};
goog.ui.Control.prototype.handleMouseDown=function(a){this.isEnabled()&&(this.isAutoState(goog.ui.Component.State.HOVER)&&this.setHighlighted(!0),a.isMouseActionButton()&&(this.isAutoState(goog.ui.Component.State.ACTIVE)&&this.setActive(!0),this.renderer_.isFocusable(this)&&this.getKeyEventTarget().focus()));!this.isAllowTextSelection()&&a.isMouseActionButton()&&a.preventDefault()};
goog.ui.Control.prototype.handleMouseUp=function(a){this.isEnabled()&&(this.isAutoState(goog.ui.Component.State.HOVER)&&this.setHighlighted(!0),this.isActive()&&this.performActionInternal(a)&&this.isAutoState(goog.ui.Component.State.ACTIVE)&&this.setActive(!1))};goog.ui.Control.prototype.handleDblClick=function(a){this.isEnabled()&&this.performActionInternal(a)};
goog.ui.Control.prototype.performActionInternal=function(a){this.isAutoState(goog.ui.Component.State.CHECKED)&&this.setChecked(!this.isChecked());this.isAutoState(goog.ui.Component.State.SELECTED)&&this.setSelected(!0);this.isAutoState(goog.ui.Component.State.OPENED)&&this.setOpen(!this.isOpen());var b=new goog.events.Event(goog.ui.Component.EventType.ACTION,this);if(a)for(var c=["altKey","ctrlKey","metaKey","shiftKey","platformModifierKey"],d,e=0;d=c[e];e++)b[d]=a[d];return this.dispatchEvent(b)};
goog.ui.Control.prototype.handleFocus=function(){this.isAutoState(goog.ui.Component.State.FOCUSED)&&this.setFocused(!0)};goog.ui.Control.prototype.handleBlur=function(){this.isAutoState(goog.ui.Component.State.ACTIVE)&&this.setActive(!1);this.isAutoState(goog.ui.Component.State.FOCUSED)&&this.setFocused(!1)};goog.ui.Control.prototype.handleKeyEvent=function(a){if(this.isVisible()&&this.isEnabled()&&this.handleKeyEventInternal(a))return a.preventDefault(),a.stopPropagation(),!0;return!1};
goog.ui.Control.prototype.handleKeyEventInternal=function(a){return a.keyCode==goog.events.KeyCodes.ENTER&&this.performActionInternal(a)};goog.ui.registry.setDefaultRenderer(goog.ui.Control,goog.ui.ControlRenderer);goog.ui.registry.setDecoratorByClassName(goog.ui.ControlRenderer.CSS_CLASS,function(){return new goog.ui.Control(null)});goog.ui.ButtonSide={NONE:0,START:1,END:2,BOTH:3};goog.ui.ButtonRenderer=function(){goog.ui.ControlRenderer.call(this)};goog.inherits(goog.ui.ButtonRenderer,goog.ui.ControlRenderer);goog.addSingletonGetter(goog.ui.ButtonRenderer);goog.ui.ButtonRenderer.CSS_CLASS="goog-button";goog.ui.ButtonRenderer.prototype.getAriaRole=function(){return goog.dom.a11y.Role.BUTTON};
goog.ui.ButtonRenderer.prototype.updateAriaState=function(a,b,c){b==goog.ui.Component.State.CHECKED?goog.dom.a11y.setState(a,goog.dom.a11y.State.PRESSED,c):goog.ui.ButtonRenderer.superClass_.updateAriaState.call(this,a,b,c)};
goog.ui.ButtonRenderer.prototype.createDom=function(a){var b=goog.ui.ButtonRenderer.superClass_.createDom.call(this,a),c=a.getTooltip();c&&this.setTooltip(b,c);(c=a.getValue())&&this.setValue(b,c);a.isSupportedState(goog.ui.Component.State.CHECKED)&&this.updateAriaState(b,goog.ui.Component.State.CHECKED,a.isChecked());return b};
goog.ui.ButtonRenderer.prototype.decorate=function(a,b){b=goog.ui.ButtonRenderer.superClass_.decorate.call(this,a,b);a.setValueInternal(this.getValue(b));a.setTooltipInternal(this.getTooltip(b));a.isSupportedState(goog.ui.Component.State.CHECKED)&&this.updateAriaState(b,goog.ui.Component.State.CHECKED,a.isChecked());return b};goog.ui.ButtonRenderer.prototype.getValue=goog.nullFunction;goog.ui.ButtonRenderer.prototype.setValue=goog.nullFunction;goog.ui.ButtonRenderer.prototype.getTooltip=function(a){return a.title};
goog.ui.ButtonRenderer.prototype.setTooltip=function(a,b){if(a)a.title=b||""};goog.ui.ButtonRenderer.prototype.setCollapsed=function(a,b){var c=a.isRightToLeft(),d=this.getStructuralCssClass()+"-collapse-left",e=this.getStructuralCssClass()+"-collapse-right";a.enableClassName(c?e:d,!!(b&goog.ui.ButtonSide.START));a.enableClassName(c?d:e,!!(b&goog.ui.ButtonSide.END))};goog.ui.ButtonRenderer.prototype.getCssClass=function(){return goog.ui.ButtonRenderer.CSS_CLASS};goog.ui.NativeButtonRenderer=function(){goog.ui.ButtonRenderer.call(this)};goog.inherits(goog.ui.NativeButtonRenderer,goog.ui.ButtonRenderer);goog.addSingletonGetter(goog.ui.NativeButtonRenderer);goog.ui.NativeButtonRenderer.prototype.getAriaRole=function(){};
goog.ui.NativeButtonRenderer.prototype.createDom=function(a){this.setUpNativeButton_(a);return a.getDomHelper().createDom("button",{"class":this.getClassNames(a).join(" "),disabled:!a.isEnabled(),title:a.getTooltip()||"",value:a.getValue()||""},a.getCaption()||"")};goog.ui.NativeButtonRenderer.prototype.canDecorate=function(a){return a.tagName=="BUTTON"||a.tagName=="INPUT"&&(a.type=="button"||a.type=="submit"||a.type=="reset")};
goog.ui.NativeButtonRenderer.prototype.decorate=function(a,b){this.setUpNativeButton_(a);b.disabled&&goog.dom.classes.add(b,this.getClassForState(goog.ui.Component.State.DISABLED));return goog.ui.NativeButtonRenderer.superClass_.decorate.call(this,a,b)};goog.ui.NativeButtonRenderer.prototype.initializeDom=function(a){a.getHandler().listen(a.getElement(),goog.events.EventType.CLICK,a.performActionInternal)};goog.ui.NativeButtonRenderer.prototype.setAllowTextSelection=goog.nullFunction;
goog.ui.NativeButtonRenderer.prototype.setRightToLeft=goog.nullFunction;goog.ui.NativeButtonRenderer.prototype.isFocusable=function(a){return a.isEnabled()};goog.ui.NativeButtonRenderer.prototype.setFocusable=goog.nullFunction;goog.ui.NativeButtonRenderer.prototype.setState=function(a,b,c){goog.ui.NativeButtonRenderer.superClass_.setState.call(this,a,b,c);if((a=a.getElement())&&b==goog.ui.Component.State.DISABLED)a.disabled=c};goog.ui.NativeButtonRenderer.prototype.getValue=function(a){return a.value};
goog.ui.NativeButtonRenderer.prototype.setValue=function(a,b){if(a)a.value=b};goog.ui.NativeButtonRenderer.prototype.updateAriaState=goog.nullFunction;goog.ui.NativeButtonRenderer.prototype.setUpNativeButton_=function(a){a.setHandleMouseEvents(!1);a.setAutoStates(goog.ui.Component.State.ALL,!1);a.setSupportedState(goog.ui.Component.State.FOCUSED,!1)};goog.ui.Button=function(a,b,c){goog.ui.Control.call(this,a,b||goog.ui.NativeButtonRenderer.getInstance(),c)};goog.inherits(goog.ui.Button,goog.ui.Control);goog.ui.Button.Side=goog.ui.ButtonSide;goog.ui.Button.prototype.getValue=function(){return this.value_};goog.ui.Button.prototype.setValue=function(a){this.value_=a;this.getRenderer().setValue(this.getElement(),a)};goog.ui.Button.prototype.setValueInternal=function(a){this.value_=a};goog.ui.Button.prototype.getTooltip=function(){return this.tooltip_};
goog.ui.Button.prototype.setTooltip=function(a){this.tooltip_=a;this.getRenderer().setTooltip(this.getElement(),a)};goog.ui.Button.prototype.setTooltipInternal=function(a){this.tooltip_=a};goog.ui.Button.prototype.setCollapsed=function(a){this.getRenderer().setCollapsed(this,a)};goog.ui.Button.prototype.disposeInternal=function(){goog.ui.Button.superClass_.disposeInternal.call(this);delete this.value_;delete this.tooltip_};
goog.ui.Button.prototype.enterDocument=function(){goog.ui.Button.superClass_.enterDocument.call(this);if(this.isSupportedState(goog.ui.Component.State.FOCUSED)){var a=this.getKeyEventTarget();a&&this.getHandler().listen(a,goog.events.EventType.KEYUP,this.handleKeyEventInternal)}};
goog.ui.Button.prototype.handleKeyEventInternal=function(a){if(a.keyCode==goog.events.KeyCodes.ENTER&&a.type==goog.events.KeyHandler.EventType.KEY||a.keyCode==goog.events.KeyCodes.SPACE&&a.type==goog.events.EventType.KEYUP)return this.performActionInternal(a);return a.keyCode==goog.events.KeyCodes.SPACE};goog.ui.registry.setDecoratorByClassName(goog.ui.ButtonRenderer.CSS_CLASS,function(){return new goog.ui.Button(null)});goog.ui.INLINE_BLOCK_CLASSNAME="goog-inline-block";goog.ui.FlatButtonRenderer=function(){goog.ui.ButtonRenderer.call(this)};goog.inherits(goog.ui.FlatButtonRenderer,goog.ui.ButtonRenderer);goog.addSingletonGetter(goog.ui.FlatButtonRenderer);goog.ui.FlatButtonRenderer.CSS_CLASS="goog-flat-button";goog.ui.FlatButtonRenderer.prototype.createDom=function(a){var b=this.getClassNames(a);b={"class":goog.ui.INLINE_BLOCK_CLASSNAME+" "+b.join(" "),title:a.getTooltip()||""};return a.getDomHelper().createDom("div",b,a.getContent())};
goog.ui.FlatButtonRenderer.prototype.getAriaRole=function(){return goog.dom.a11y.Role.BUTTON};goog.ui.FlatButtonRenderer.prototype.canDecorate=function(a){return a.tagName=="DIV"};goog.ui.FlatButtonRenderer.prototype.decorate=function(a,b){goog.dom.classes.add(b,goog.ui.INLINE_BLOCK_CLASSNAME);return goog.ui.FlatButtonRenderer.superClass_.decorate.call(this,a,b)};goog.ui.FlatButtonRenderer.prototype.getValue=function(){return null};goog.ui.FlatButtonRenderer.prototype.getCssClass=function(){return goog.ui.FlatButtonRenderer.CSS_CLASS};
goog.ui.registry.setDecoratorByClassName(goog.ui.FlatButtonRenderer.CSS_CLASS,function(){return new goog.ui.Button(null,goog.ui.FlatButtonRenderer.getInstance())});goog.ui.LinkButtonRenderer=function(){goog.ui.FlatButtonRenderer.call(this)};goog.inherits(goog.ui.LinkButtonRenderer,goog.ui.FlatButtonRenderer);goog.addSingletonGetter(goog.ui.LinkButtonRenderer);goog.ui.LinkButtonRenderer.CSS_CLASS="goog-link-button";goog.ui.LinkButtonRenderer.prototype.getCssClass=function(){return goog.ui.LinkButtonRenderer.CSS_CLASS};goog.ui.registry.setDecoratorByClassName(goog.ui.LinkButtonRenderer.CSS_CLASS,function(){return new goog.ui.Button(null,goog.ui.LinkButtonRenderer.getInstance())});goog.window={};goog.window.DEFAULT_POPUP_HEIGHT=500;goog.window.DEFAULT_POPUP_WIDTH=690;goog.window.DEFAULT_POPUP_TARGET="google_popup";
goog.window.open=function(a,b,c){b||(b={});var d=c||window;c=typeof a.href!="undefined"?a.href:String(a);a=b.target||a.target;var e=[],f;for(f in b)switch(f){case "width":case "height":case "top":case "left":e.push(f+"="+b[f]);break;case "target":case "noreferrer":break;default:e.push(f+"="+(b[f]?1:0))}f=e.join(",");if(b.noreferrer){if(b=d.open("",a,f))goog.userAgent.IE&&c.indexOf(";")!=-1&&(c="'"+c.replace(/'/g,"%27")+"'"),b.opener=null,goog.userAgent.WEBKIT?b.location.href=c:(c=goog.string.htmlEscape(c),
b.document.write('<META HTTP-EQUIV="refresh" content="0; url='+c+'">'),b.document.close())}else b=d.open(c,a,f);return b};goog.window.openBlank=function(a,b,c){a=a?goog.string.htmlEscape(a):"";return goog.window.open('javascript:"'+encodeURI(a)+'"',b,c)};
goog.window.popup=function(a,b){b||(b={});b.target=b.target||a.target||goog.window.DEFAULT_POPUP_TARGET;b.width=b.width||goog.window.DEFAULT_POPUP_WIDTH;b.height=b.height||goog.window.DEFAULT_POPUP_HEIGHT;var c=goog.window.open(a,b);if(!c)return!0;c.focus();return!1};goog.ui.TabRenderer=function(){goog.ui.ControlRenderer.call(this)};goog.inherits(goog.ui.TabRenderer,goog.ui.ControlRenderer);goog.addSingletonGetter(goog.ui.TabRenderer);goog.ui.TabRenderer.CSS_CLASS="goog-tab";goog.ui.TabRenderer.prototype.getCssClass=function(){return goog.ui.TabRenderer.CSS_CLASS};goog.ui.TabRenderer.prototype.getAriaRole=function(){return goog.dom.a11y.Role.TAB};
goog.ui.TabRenderer.prototype.createDom=function(a){var b=goog.ui.TabRenderer.superClass_.createDom.call(this,a);(a=a.getTooltip())&&this.setTooltip(b,a);return b};goog.ui.TabRenderer.prototype.decorate=function(a,b){b=goog.ui.TabRenderer.superClass_.decorate.call(this,a,b);var c=this.getTooltip(b);c&&a.setTooltipInternal(c);if(a.isSelected()&&(c=a.getParent())&&goog.isFunction(c.setSelectedTab))a.setState(goog.ui.Component.State.SELECTED,!1),c.setSelectedTab(a);return b};
goog.ui.TabRenderer.prototype.getTooltip=function(a){return a.title||""};goog.ui.TabRenderer.prototype.setTooltip=function(a,b){if(a)a.title=b||""};goog.ui.Tab=function(a,b,c){goog.ui.Control.call(this,a,b||goog.ui.TabRenderer.getInstance(),c);this.setSupportedState(goog.ui.Component.State.SELECTED,!0);this.setDispatchTransitionEvents(goog.ui.Component.State.DISABLED|goog.ui.Component.State.SELECTED,!0)};goog.inherits(goog.ui.Tab,goog.ui.Control);goog.ui.Tab.prototype.getTooltip=function(){return this.tooltip_};goog.ui.Tab.prototype.setTooltip=function(a){this.getRenderer().setTooltip(this.getElement(),a);this.setTooltipInternal(a)};
goog.ui.Tab.prototype.setTooltipInternal=function(a){this.tooltip_=a};goog.ui.registry.setDecoratorByClassName(goog.ui.TabRenderer.CSS_CLASS,function(){return new goog.ui.Tab(null)});goog.ui.MenuSeparatorRenderer=function(){goog.ui.ControlRenderer.call(this)};goog.inherits(goog.ui.MenuSeparatorRenderer,goog.ui.ControlRenderer);goog.addSingletonGetter(goog.ui.MenuSeparatorRenderer);goog.ui.MenuSeparatorRenderer.CSS_CLASS="goog-menuseparator";goog.ui.MenuSeparatorRenderer.prototype.createDom=function(a){return a.getDomHelper().createDom("div",this.getCssClass())};
goog.ui.MenuSeparatorRenderer.prototype.decorate=function(a,b){b.id&&a.setId(b.id);if(b.tagName=="HR"){var c=b;b=this.createDom(a);goog.dom.insertSiblingBefore(b,c);goog.dom.removeNode(c)}else goog.dom.classes.add(b,this.getCssClass());return b};goog.ui.MenuSeparatorRenderer.prototype.setContent=function(){};goog.ui.MenuSeparatorRenderer.prototype.getCssClass=function(){return goog.ui.MenuSeparatorRenderer.CSS_CLASS};goog.ui.Separator=function(a,b){goog.ui.Control.call(this,null,a||goog.ui.MenuSeparatorRenderer.getInstance(),b);this.setSupportedState(goog.ui.Component.State.DISABLED,!1);this.setSupportedState(goog.ui.Component.State.HOVER,!1);this.setSupportedState(goog.ui.Component.State.ACTIVE,!1);this.setSupportedState(goog.ui.Component.State.FOCUSED,!1);this.setStateInternal(goog.ui.Component.State.DISABLED)};goog.inherits(goog.ui.Separator,goog.ui.Control);
goog.ui.Separator.prototype.enterDocument=function(){goog.ui.Separator.superClass_.enterDocument.call(this);goog.dom.a11y.setRole(this.getElement(),"separator")};goog.ui.registry.setDecoratorByClassName(goog.ui.MenuSeparatorRenderer.CSS_CLASS,function(){return new goog.ui.Separator});goog.ui.ContainerRenderer=function(){};goog.addSingletonGetter(goog.ui.ContainerRenderer);goog.ui.ContainerRenderer.getCustomRenderer=function(a,b){var c=new a;c.getCssClass=function(){return b};return c};goog.ui.ContainerRenderer.CSS_CLASS="goog-container";goog.ui.ContainerRenderer.prototype.getAriaRole=function(){};goog.ui.ContainerRenderer.prototype.enableTabIndex=function(a,b){if(a)a.tabIndex=b?0:-1};
goog.ui.ContainerRenderer.prototype.createDom=function(a){return a.getDomHelper().createDom("div",this.getClassNames(a).join(" "))};goog.ui.ContainerRenderer.prototype.getContentElement=function(a){return a};goog.ui.ContainerRenderer.prototype.canDecorate=function(a){return a.tagName=="DIV"};
goog.ui.ContainerRenderer.prototype.decorate=function(a,b){b.id&&a.setId(b.id);var c=this.getCssClass(),d=!1,e=goog.dom.classes.get(b);e&&goog.array.forEach(e,function(b){b==c?d=!0:b&&this.setStateFromClassName(a,b,c)},this);d||goog.dom.classes.add(b,c);this.decorateChildren(a,this.getContentElement(b));return b};
goog.ui.ContainerRenderer.prototype.setStateFromClassName=function(a,b,c){b==c+"-disabled"?a.setEnabled(!1):b==c+"-horizontal"?a.setOrientation(goog.ui.Container.Orientation.HORIZONTAL):b==c+"-vertical"&&a.setOrientation(goog.ui.Container.Orientation.VERTICAL)};
goog.ui.ContainerRenderer.prototype.decorateChildren=function(a,b,c){if(b){c=c||b.firstChild;for(var d;c&&c.parentNode==b;){d=c.nextSibling;if(c.nodeType==goog.dom.NodeType.ELEMENT){var e=this.getDecoratorForChild(c);e&&(e.setElementInternal(c),a.isEnabled()||e.setEnabled(!1),a.addChild(e),e.decorate(c))}else(!c.nodeValue||goog.string.trim(c.nodeValue)=="")&&b.removeChild(c);c=d}}};goog.ui.ContainerRenderer.prototype.getDecoratorForChild=function(a){return goog.ui.registry.getDecorator(a)};
goog.ui.ContainerRenderer.prototype.initializeDom=function(a){a=a.getElement();goog.style.setUnselectable(a,!0,goog.userAgent.GECKO);if(goog.userAgent.IE)a.hideFocus=!0;var b=this.getAriaRole();b&&goog.dom.a11y.setRole(a,b)};goog.ui.ContainerRenderer.prototype.getKeyEventTarget=function(a){return a.getElement()};goog.ui.ContainerRenderer.prototype.getCssClass=function(){return goog.ui.ContainerRenderer.CSS_CLASS};
goog.ui.ContainerRenderer.prototype.getClassNames=function(a){var b=this.getCssClass(),c=a.getOrientation()==goog.ui.Container.Orientation.HORIZONTAL;c=[b,c?b+"-horizontal":b+"-vertical"];a.isEnabled()||c.push(b+"-disabled");return c};goog.ui.ContainerRenderer.prototype.getDefaultOrientation=function(){return goog.ui.Container.Orientation.VERTICAL};goog.ui.TabBarRenderer=function(){goog.ui.ContainerRenderer.call(this)};goog.inherits(goog.ui.TabBarRenderer,goog.ui.ContainerRenderer);goog.addSingletonGetter(goog.ui.TabBarRenderer);goog.ui.TabBarRenderer.CSS_CLASS="goog-tab-bar";goog.ui.TabBarRenderer.prototype.getCssClass=function(){return goog.ui.TabBarRenderer.CSS_CLASS};goog.ui.TabBarRenderer.prototype.getAriaRole=function(){return goog.dom.a11y.Role.TAB_LIST};
goog.ui.TabBarRenderer.prototype.setStateFromClassName=function(a,b,c){this.locationByClass_||this.createLocationByClassMap_();var d=this.locationByClass_[b];d?a.setLocation(d):goog.ui.TabBarRenderer.superClass_.setStateFromClassName.call(this,a,b,c)};goog.ui.TabBarRenderer.prototype.getClassNames=function(a){var b=goog.ui.TabBarRenderer.superClass_.getClassNames.call(this,a);this.classByLocation_||this.createClassByLocationMap_();b.push(this.classByLocation_[a.getLocation()]);return b};
goog.ui.TabBarRenderer.prototype.createClassByLocationMap_=function(){var a=this.getCssClass();this.classByLocation_=goog.object.create(goog.ui.TabBar.Location.TOP,a+"-top",goog.ui.TabBar.Location.BOTTOM,a+"-bottom",goog.ui.TabBar.Location.START,a+"-start",goog.ui.TabBar.Location.END,a+"-end")};goog.ui.TabBarRenderer.prototype.createLocationByClassMap_=function(){this.classByLocation_||this.createClassByLocationMap_();this.locationByClass_=goog.object.transpose(this.classByLocation_)};goog.ui.Container=function(a,b,c){goog.ui.Component.call(this,c);this.renderer_=b||goog.ui.ContainerRenderer.getInstance();this.orientation_=a||this.renderer_.getDefaultOrientation()};goog.inherits(goog.ui.Container,goog.ui.Component);goog.ui.Container.EventType={AFTER_SHOW:"aftershow",AFTER_HIDE:"afterhide"};goog.ui.Container.Orientation={HORIZONTAL:"horizontal",VERTICAL:"vertical"};goog.ui.Container.prototype.keyEventTarget_=null;goog.ui.Container.prototype.keyHandler_=null;
goog.ui.Container.prototype.renderer_=null;goog.ui.Container.prototype.orientation_=null;goog.ui.Container.prototype.visible_=!0;goog.ui.Container.prototype.enabled_=!0;goog.ui.Container.prototype.focusable_=!0;goog.ui.Container.prototype.highlightedIndex_=-1;goog.ui.Container.prototype.openItem_=null;goog.ui.Container.prototype.mouseButtonPressed_=!1;goog.ui.Container.prototype.allowFocusableChildren_=!1;goog.ui.Container.prototype.openFollowsHighlight_=!0;
goog.ui.Container.prototype.childElementIdMap_=null;goog.ui.Container.prototype.getKeyEventTarget=function(){return this.keyEventTarget_||this.renderer_.getKeyEventTarget(this)};
goog.ui.Container.prototype.setKeyEventTarget=function(a){if(this.focusable_){var b=this.getKeyEventTarget(),c=this.isInDocument();this.keyEventTarget_=a;var d=this.getKeyEventTarget();if(c)this.keyEventTarget_=b,this.enableFocusHandling_(!1),this.keyEventTarget_=a,this.getKeyHandler().attach(d),this.enableFocusHandling_(!0)}else throw Error("Can't set key event target for container that doesn't support keyboard focus!");};
goog.ui.Container.prototype.getKeyHandler=function(){return this.keyHandler_||(this.keyHandler_=new goog.events.KeyHandler(this.getKeyEventTarget()))};goog.ui.Container.prototype.getRenderer=function(){return this.renderer_};goog.ui.Container.prototype.setRenderer=function(a){if(this.getElement())throw Error(goog.ui.Component.Error.ALREADY_RENDERED);this.renderer_=a};goog.ui.Container.prototype.createDom=function(){this.setElementInternal(this.renderer_.createDom(this))};
goog.ui.Container.prototype.getContentElement=function(){return this.renderer_.getContentElement(this.getElement())};goog.ui.Container.prototype.canDecorate=function(a){return this.renderer_.canDecorate(a)};goog.ui.Container.prototype.decorateInternal=function(a){this.setElementInternal(this.renderer_.decorate(this,a));if(a.style.display=="none")this.visible_=!1};
goog.ui.Container.prototype.enterDocument=function(){goog.ui.Container.superClass_.enterDocument.call(this);this.forEachChild(function(a){a.isInDocument()&&this.registerChildId_(a)},this);var a=this.getElement();this.renderer_.initializeDom(this);this.setVisible(this.visible_,!0);this.getHandler().listen(this,goog.ui.Component.EventType.ENTER,this.handleEnterItem).listen(this,goog.ui.Component.EventType.HIGHLIGHT,this.handleHighlightItem).listen(this,goog.ui.Component.EventType.UNHIGHLIGHT,this.handleUnHighlightItem).listen(this,
goog.ui.Component.EventType.OPEN,this.handleOpenItem).listen(this,goog.ui.Component.EventType.CLOSE,this.handleCloseItem).listen(a,goog.events.EventType.MOUSEDOWN,this.handleMouseDown).listen(goog.dom.getOwnerDocument(a),goog.events.EventType.MOUSEUP,this.handleDocumentMouseUp).listen(a,[goog.events.EventType.MOUSEDOWN,goog.events.EventType.MOUSEUP,goog.events.EventType.MOUSEOVER,goog.events.EventType.MOUSEOUT],this.handleChildMouseEvents);this.isFocusable()&&this.enableFocusHandling_(!0)};
goog.ui.Container.prototype.enableFocusHandling_=function(a){var b=this.getHandler(),c=this.getKeyEventTarget();a?b.listen(c,goog.events.EventType.FOCUS,this.handleFocus).listen(c,goog.events.EventType.BLUR,this.handleBlur).listen(this.getKeyHandler(),goog.events.KeyHandler.EventType.KEY,this.handleKeyEvent):b.unlisten(c,goog.events.EventType.FOCUS,this.handleFocus).unlisten(c,goog.events.EventType.BLUR,this.handleBlur).unlisten(this.getKeyHandler(),goog.events.KeyHandler.EventType.KEY,this.handleKeyEvent)};
goog.ui.Container.prototype.exitDocument=function(){this.setHighlightedIndex(-1);this.openItem_&&this.openItem_.setOpen(!1);this.mouseButtonPressed_=!1;goog.ui.Container.superClass_.exitDocument.call(this)};goog.ui.Container.prototype.disposeInternal=function(){goog.ui.Container.superClass_.disposeInternal.call(this);if(this.keyHandler_)this.keyHandler_.dispose(),this.keyHandler_=null;this.renderer_=this.openItem_=this.childElementIdMap_=this.keyEventTarget_=null};
goog.ui.Container.prototype.handleEnterItem=function(){return!0};
goog.ui.Container.prototype.handleHighlightItem=function(a){var b=this.indexOfChild(a.target);if(b>-1&&b!=this.highlightedIndex_){var c=this.getHighlighted();c&&c.setHighlighted(!1);this.highlightedIndex_=b;c=this.getHighlighted();this.isMouseButtonPressed()&&c.setActive(!0);this.openFollowsHighlight_&&this.openItem_&&c!=this.openItem_&&(c.isSupportedState(goog.ui.Component.State.OPENED)?c.setOpen(!0):this.openItem_.setOpen(!1))}goog.dom.a11y.setState(this.getElement(),goog.dom.a11y.State.ACTIVEDESCENDANT,
a.target.getElement().id)};goog.ui.Container.prototype.handleUnHighlightItem=function(a){if(a.target==this.getHighlighted())this.highlightedIndex_=-1;goog.dom.a11y.setState(this.getElement(),goog.dom.a11y.State.ACTIVEDESCENDANT,"")};goog.ui.Container.prototype.handleOpenItem=function(a){if((a=a.target)&&a!=this.openItem_&&a.getParent()==this)this.openItem_&&this.openItem_.setOpen(!1),this.openItem_=a};
goog.ui.Container.prototype.handleCloseItem=function(a){if(a.target==this.openItem_)this.openItem_=null};goog.ui.Container.prototype.handleMouseDown=function(a){this.enabled_&&this.setMouseButtonPressed(!0);var b=this.getKeyEventTarget();b&&goog.dom.isFocusableTabIndex(b)?b.focus():a.preventDefault()};goog.ui.Container.prototype.handleDocumentMouseUp=function(){this.setMouseButtonPressed(!1)};
goog.ui.Container.prototype.handleChildMouseEvents=function(a){var b=this.getOwnerControl(a.target);if(b)switch(a.type){case goog.events.EventType.MOUSEDOWN:b.handleMouseDown(a);break;case goog.events.EventType.MOUSEUP:b.handleMouseUp(a);break;case goog.events.EventType.MOUSEOVER:b.handleMouseOver(a);break;case goog.events.EventType.MOUSEOUT:b.handleMouseOut(a)}};
goog.ui.Container.prototype.getOwnerControl=function(a){if(this.childElementIdMap_)for(var b=this.getElement();a&&a!==b;){var c=a.id;if(c in this.childElementIdMap_)return this.childElementIdMap_[c];a=a.parentNode}return null};goog.ui.Container.prototype.handleFocus=function(){};goog.ui.Container.prototype.handleBlur=function(){this.setHighlightedIndex(-1);this.setMouseButtonPressed(!1);this.openItem_&&this.openItem_.setOpen(!1)};
goog.ui.Container.prototype.handleKeyEvent=function(a){if(this.isEnabled()&&this.isVisible()&&(this.getChildCount()!=0||this.keyEventTarget_)&&this.handleKeyEventInternal(a))return a.preventDefault(),a.stopPropagation(),!0;return!1};
goog.ui.Container.prototype.handleKeyEventInternal=function(a){var b=this.getHighlighted();if(b&&typeof b.handleKeyEvent=="function"&&b.handleKeyEvent(a))return!0;if(this.openItem_&&this.openItem_!=b&&typeof this.openItem_.handleKeyEvent=="function"&&this.openItem_.handleKeyEvent(a))return!0;if(a.shiftKey||a.ctrlKey||a.metaKey||a.altKey)return!1;switch(a.keyCode){case goog.events.KeyCodes.ESC:if(this.isFocusable())this.getKeyEventTarget().blur();else return!1;break;case goog.events.KeyCodes.HOME:this.highlightFirst();
break;case goog.events.KeyCodes.END:this.highlightLast();break;case goog.events.KeyCodes.UP:if(this.orientation_==goog.ui.Container.Orientation.VERTICAL)this.highlightPrevious();else return!1;break;case goog.events.KeyCodes.LEFT:if(this.orientation_==goog.ui.Container.Orientation.HORIZONTAL)this.isRightToLeft()?this.highlightNext():this.highlightPrevious();else return!1;break;case goog.events.KeyCodes.DOWN:if(this.orientation_==goog.ui.Container.Orientation.VERTICAL)this.highlightNext();else return!1;
break;case goog.events.KeyCodes.RIGHT:if(this.orientation_==goog.ui.Container.Orientation.HORIZONTAL)this.isRightToLeft()?this.highlightPrevious():this.highlightNext();else return!1;break;default:return!1}return!0};goog.ui.Container.prototype.registerChildId_=function(a){var b=a.getElement();b=b.id||(b.id=a.getId());if(!this.childElementIdMap_)this.childElementIdMap_={};this.childElementIdMap_[b]=a};
goog.ui.Container.prototype.addChild=function(a,b){goog.ui.Container.superClass_.addChild.call(this,a,b)};
goog.ui.Container.prototype.addChildAt=function(a,b,c){a.setDispatchTransitionEvents(goog.ui.Component.State.HOVER,!0);a.setDispatchTransitionEvents(goog.ui.Component.State.OPENED,!0);(this.isFocusable()||!this.isFocusableChildrenAllowed())&&a.setSupportedState(goog.ui.Component.State.FOCUSED,!1);a.setHandleMouseEvents(!1);goog.ui.Container.superClass_.addChildAt.call(this,a,b,c);a.isInDocument()&&this.isInDocument()&&this.registerChildId_(a);b<=this.highlightedIndex_&&this.highlightedIndex_++};
goog.ui.Container.prototype.removeChild=function(a,b){if(a=goog.isString(a)?this.getChild(a):a){var c=this.indexOfChild(a);c!=-1&&(c==this.highlightedIndex_?a.setHighlighted(!1):c<this.highlightedIndex_&&this.highlightedIndex_--);(c=a.getElement())&&c.id&&this.childElementIdMap_&&goog.object.remove(this.childElementIdMap_,c.id)}a=goog.ui.Container.superClass_.removeChild.call(this,a,b);a.setHandleMouseEvents(!0);return a};goog.ui.Container.prototype.getOrientation=function(){return this.orientation_};
goog.ui.Container.prototype.setOrientation=function(a){if(this.getElement())throw Error(goog.ui.Component.Error.ALREADY_RENDERED);this.orientation_=a};goog.ui.Container.prototype.isVisible=function(){return this.visible_};
goog.ui.Container.prototype.setVisible=function(a,b){if(b||this.visible_!=a&&this.dispatchEvent(a?goog.ui.Component.EventType.SHOW:goog.ui.Component.EventType.HIDE)){this.visible_=a;var c=this.getElement();c&&(goog.style.showElement(c,a),this.isFocusable()&&this.renderer_.enableTabIndex(this.getKeyEventTarget(),this.enabled_&&this.visible_),b||this.dispatchEvent(this.visible_?goog.ui.Container.EventType.AFTER_SHOW:goog.ui.Container.EventType.AFTER_HIDE));return!0}return!1};
goog.ui.Container.prototype.isEnabled=function(){return this.enabled_};
goog.ui.Container.prototype.setEnabled=function(a){if(this.enabled_!=a&&this.dispatchEvent(a?goog.ui.Component.EventType.ENABLE:goog.ui.Component.EventType.DISABLE))a?(this.enabled_=!0,this.forEachChild(function(a){a.wasDisabled?delete a.wasDisabled:a.setEnabled(!0)})):(this.forEachChild(function(a){a.isEnabled()?a.setEnabled(!1):a.wasDisabled=!0}),this.enabled_=!1,this.setMouseButtonPressed(!1)),this.isFocusable()&&this.renderer_.enableTabIndex(this.getKeyEventTarget(),a&&this.visible_)};
goog.ui.Container.prototype.isFocusable=function(){return this.focusable_};goog.ui.Container.prototype.setFocusable=function(a){a!=this.focusable_&&this.isInDocument()&&this.enableFocusHandling_(a);this.focusable_=a;this.enabled_&&this.visible_&&this.renderer_.enableTabIndex(this.getKeyEventTarget(),a)};goog.ui.Container.prototype.isFocusableChildrenAllowed=function(){return this.allowFocusableChildren_};
goog.ui.Container.prototype.setFocusableChildrenAllowed=function(a){this.allowFocusableChildren_=a};goog.ui.Container.prototype.isOpenFollowsHighlight=function(){return this.openFollowsHighlight_};goog.ui.Container.prototype.setOpenFollowsHighlight=function(a){this.openFollowsHighlight_=a};goog.ui.Container.prototype.getHighlightedIndex=function(){return this.highlightedIndex_};
goog.ui.Container.prototype.setHighlightedIndex=function(a){(a=this.getChildAt(a))?a.setHighlighted(!0):this.highlightedIndex_>-1&&this.getHighlighted().setHighlighted(!1)};goog.ui.Container.prototype.setHighlighted=function(a){this.setHighlightedIndex(this.indexOfChild(a))};goog.ui.Container.prototype.getHighlighted=function(){return this.getChildAt(this.highlightedIndex_)};
goog.ui.Container.prototype.highlightFirst=function(){this.highlightHelper(function(a,b){return(a+1)%b},this.getChildCount()-1)};goog.ui.Container.prototype.highlightLast=function(){this.highlightHelper(function(a,b){a--;return a<0?b-1:a},0)};goog.ui.Container.prototype.highlightNext=function(){this.highlightHelper(function(a,b){return(a+1)%b},this.highlightedIndex_)};goog.ui.Container.prototype.highlightPrevious=function(){this.highlightHelper(function(a,b){a--;return a<0?b-1:a},this.highlightedIndex_)};
goog.ui.Container.prototype.highlightHelper=function(a,b){var c=b<0?this.indexOfChild(this.openItem_):b,d=this.getChildCount();c=a.call(this,c,d);for(var e=0;e<=d;){var f=this.getChildAt(c);if(f&&this.canHighlightItem(f))return this.setHighlightedIndexFromKeyEvent(c),!0;e++;c=a.call(this,c,d)}return!1};goog.ui.Container.prototype.canHighlightItem=function(a){return a.isVisible()&&a.isEnabled()&&a.isSupportedState(goog.ui.Component.State.HOVER)};
goog.ui.Container.prototype.setHighlightedIndexFromKeyEvent=function(a){this.setHighlightedIndex(a)};goog.ui.Container.prototype.getOpenItem=function(){return this.openItem_};goog.ui.Container.prototype.isMouseButtonPressed=function(){return this.mouseButtonPressed_};goog.ui.Container.prototype.setMouseButtonPressed=function(a){this.mouseButtonPressed_=a};goog.ui.TabBar=function(a,b,c){this.setLocation(a||goog.ui.TabBar.Location.TOP);goog.ui.Container.call(this,this.getOrientation(),b||goog.ui.TabBarRenderer.getInstance(),c);this.listenToTabEvents_()};goog.inherits(goog.ui.TabBar,goog.ui.Container);goog.ui.TabBar.Location={TOP:"top",BOTTOM:"bottom",START:"start",END:"end"};goog.ui.TabBar.prototype.autoSelectTabs_=!0;goog.ui.TabBar.prototype.selectedTab_=null;
goog.ui.TabBar.prototype.enterDocument=function(){goog.ui.TabBar.superClass_.enterDocument.call(this);this.listenToTabEvents_()};goog.ui.TabBar.prototype.disposeInternal=function(){goog.ui.TabBar.superClass_.disposeInternal.call(this);this.selectedTab_=null};goog.ui.TabBar.prototype.removeChild=function(a,b){this.deselectIfSelected(a);return goog.ui.TabBar.superClass_.removeChild.call(this,a,b)};goog.ui.TabBar.prototype.getLocation=function(){return this.location_};
goog.ui.TabBar.prototype.setLocation=function(a){this.setOrientation(goog.ui.TabBar.getOrientationFromLocation(a));this.location_=a};goog.ui.TabBar.prototype.isAutoSelectTabs=function(){return this.autoSelectTabs_};goog.ui.TabBar.prototype.setAutoSelectTabs=function(a){this.autoSelectTabs_=a};goog.ui.TabBar.prototype.setHighlightedIndexFromKeyEvent=function(a){goog.ui.TabBar.superClass_.setHighlightedIndexFromKeyEvent.call(this,a);this.autoSelectTabs_&&this.setSelectedTabIndex(a)};
goog.ui.TabBar.prototype.getSelectedTab=function(){return this.selectedTab_};goog.ui.TabBar.prototype.setSelectedTab=function(a){a?a.setSelected(!0):this.getSelectedTab()&&this.getSelectedTab().setSelected(!1)};goog.ui.TabBar.prototype.getSelectedTabIndex=function(){return this.indexOfChild(this.getSelectedTab())};goog.ui.TabBar.prototype.setSelectedTabIndex=function(a){this.setSelectedTab(this.getChildAt(a))};
goog.ui.TabBar.prototype.deselectIfSelected=function(a){if(a&&a==this.getSelectedTab()){for(var b=this.indexOfChild(a),c=b-1;a=this.getChildAt(c);c--)if(this.isSelectableTab(a)){this.setSelectedTab(a);return}for(b+=1;a=this.getChildAt(b);b++)if(this.isSelectableTab(a)){this.setSelectedTab(a);return}this.setSelectedTab(null)}};goog.ui.TabBar.prototype.isSelectableTab=function(a){return a.isVisible()&&a.isEnabled()};
goog.ui.TabBar.prototype.handleTabSelect=function(a){this.selectedTab_&&this.selectedTab_!=a.target&&this.selectedTab_.setSelected(!1);this.selectedTab_=a.target};goog.ui.TabBar.prototype.handleTabUnselect=function(a){if(a.target==this.selectedTab_)this.selectedTab_=null};goog.ui.TabBar.prototype.handleTabDisable=function(a){this.deselectIfSelected(a.target)};goog.ui.TabBar.prototype.handleTabHide=function(a){this.deselectIfSelected(a.target)};
goog.ui.TabBar.prototype.handleFocus=function(){this.getHighlighted()||this.setHighlighted(this.getSelectedTab()||this.getChildAt(0))};goog.ui.TabBar.prototype.listenToTabEvents_=function(){this.getHandler().listen(this,goog.ui.Component.EventType.SELECT,this.handleTabSelect).listen(this,goog.ui.Component.EventType.UNSELECT,this.handleTabUnselect).listen(this,goog.ui.Component.EventType.DISABLE,this.handleTabDisable).listen(this,goog.ui.Component.EventType.HIDE,this.handleTabHide)};
goog.ui.TabBar.getOrientationFromLocation=function(a){return a==goog.ui.TabBar.Location.START||a==goog.ui.TabBar.Location.END?goog.ui.Container.Orientation.VERTICAL:goog.ui.Container.Orientation.HORIZONTAL};goog.ui.registry.setDecoratorByClassName(goog.ui.TabBarRenderer.CSS_CLASS,function(){return new goog.ui.TabBar});goog.ui.editor.TabPane=function(a,b){goog.ui.Component.call(this,a);this.eventHandler_=new goog.events.EventHandler(this);this.tabBar_=new goog.ui.TabBar(goog.ui.TabBar.Location.START,void 0,this.dom_);this.tabBar_.setFocusable(!1);this.tabContent_=this.dom_.createDom(goog.dom.TagName.DIV,{className:"goog-tab-content"});this.visibleContent_=this.selectedRadio_=null;if(b){var c=new goog.ui.Control(b,void 0,this.dom_);c.addClassName("tr-tabpane-caption");c.setEnabled(!1);this.tabBar_.addChild(c,!0)}};
goog.inherits(goog.ui.editor.TabPane,goog.ui.Component);goog.ui.editor.TabPane.prototype.getCurrentTabId=function(){return this.tabBar_.getSelectedTab().getId()};goog.ui.editor.TabPane.prototype.setSelectedTabId=function(a){this.tabBar_.setSelectedTab(this.tabBar_.getChild(a))};
goog.ui.editor.TabPane.prototype.addTab=function(a,b,c,d){var e=this.dom_.createDom(goog.dom.TagName.INPUT,{type:"radio"});b=new goog.ui.Tab([e,this.dom_.createTextNode(b)],void 0,this.dom_);b.setId(a);b.setTooltip(c);this.tabBar_.addChild(b,!0);this.eventHandler_.listen(e,goog.events.EventType.SELECT,goog.bind(this.tabBar_.setSelectedTab,this.tabBar_,b));d.id=a+"-tab";this.tabContent_.appendChild(d);goog.style.showElement(d,!1)};
goog.ui.editor.TabPane.prototype.enterDocument=function(){goog.ui.editor.TabPane.superClass_.enterDocument.call(this);var a=this.getElement();goog.dom.classes.add(a,"tr-tabpane");this.addChild(this.tabBar_,!0);this.eventHandler_.listen(this.tabBar_,goog.ui.Component.EventType.SELECT,this.handleTabSelect_);a.appendChild(this.tabContent_);a.appendChild(this.dom_.createDom(goog.dom.TagName.DIV,{className:"goog-tab-bar-clear"}))};
goog.ui.editor.TabPane.prototype.handleTabSelect_=function(a){a=a.target;this.visibleContent_&&goog.style.showElement(this.visibleContent_,!1);this.visibleContent_=this.dom_.getElement(a.getId()+"-tab");goog.style.showElement(this.visibleContent_,!0);if(this.selectedRadio_)this.selectedRadio_.checked=!1;this.selectedRadio_=a.getElement().getElementsByTagName(goog.dom.TagName.INPUT)[0];this.selectedRadio_.checked=!0};goog.dom.selection={};goog.dom.selection.setStart=function(a,b){if(goog.dom.selection.useSelectionProperties_(a))a.selectionStart=b;else if(goog.userAgent.IE){var c=goog.dom.selection.getRangeIe_(a),d=c[0];d.inRange(c[1])&&(b=goog.dom.selection.canonicalizePositionIe_(a,b),d.collapse(!0),d.move("character",b),d.select())}};goog.dom.selection.getStart=function(a){return goog.dom.selection.getEndPoints_(a,!0)[0]};
goog.dom.selection.getEndPointsTextareaIe_=function(a,b,c){b=b.duplicate();for(var d=a.text,e=d,f=b.text,g=f,h=!1;!h;)a.compareEndPoints("StartToEnd",a)==0?h=!0:(a.moveEnd("character",-1),a.text==d?e+="\r\n":h=!0);if(c)return[e.length,-1];for(a=!1;!a;)b.compareEndPoints("StartToEnd",b)==0?a=!0:(b.moveEnd("character",-1),b.text==f?g+="\r\n":a=!0);return[e.length,e.length+g.length]};goog.dom.selection.getEndPoints=function(a){return goog.dom.selection.getEndPoints_(a,!1)};
goog.dom.selection.getEndPoints_=function(a,b){var c=0,d=0;if(goog.dom.selection.useSelectionProperties_(a))c=a.selectionStart,d=b?-1:a.selectionEnd;else if(goog.userAgent.IE){var e=goog.dom.selection.getRangeIe_(a),f=e[0];e=e[1];if(f.inRange(e)){f.setEndPoint("EndToStart",e);if(a.type=="textarea")return goog.dom.selection.getEndPointsTextareaIe_(f,e,b);c=f.text.length;d=b?-1:f.text.length+e.text.length}}return[c,d]};
goog.dom.selection.setEnd=function(a,b){if(goog.dom.selection.useSelectionProperties_(a))a.selectionEnd=b;else if(goog.userAgent.IE){var c=goog.dom.selection.getRangeIe_(a),d=c[1];c[0].inRange(d)&&(b=goog.dom.selection.canonicalizePositionIe_(a,b),c=goog.dom.selection.canonicalizePositionIe_(a,goog.dom.selection.getStart(a)),d.collapse(!0),d.moveEnd("character",b-c),d.select())}};goog.dom.selection.getEnd=function(a){return goog.dom.selection.getEndPoints_(a,!1)[1]};
goog.dom.selection.setCursorPosition=function(a,b){if(goog.dom.selection.useSelectionProperties_(a))a.selectionStart=b,a.selectionEnd=b;else if(goog.userAgent.IE){b=goog.dom.selection.canonicalizePositionIe_(a,b);var c=a.createTextRange();c.collapse(!0);c.move("character",b);c.select()}};
goog.dom.selection.setText=function(a,b){if(goog.dom.selection.useSelectionProperties_(a)){var c=a.value,d=a.selectionStart,e=c.substr(0,d);c=c.substr(a.selectionEnd);a.value=e+b+c;a.selectionStart=d;a.selectionEnd=d+b.length}else if(goog.userAgent.IE){if(e=goog.dom.selection.getRangeIe_(a),d=e[1],e[0].inRange(d))e=d.duplicate(),d.text=b,d.setEndPoint("StartToStart",e),d.select()}else throw Error("Cannot set the selection end");};
goog.dom.selection.getText=function(a){if(goog.dom.selection.useSelectionProperties_(a))return a.value.substring(a.selectionStart,a.selectionEnd);if(goog.userAgent.IE){var b=goog.dom.selection.getRangeIe_(a),c=b[1];if(b[0].inRange(c)){if(a.type=="textarea")return goog.dom.selection.getSelectionRangeText_(c)}else return"";return c.text}throw Error("Cannot get the selection text");};
goog.dom.selection.getSelectionRangeText_=function(a){a=a.duplicate();for(var b=a.text,c=b,d=!1;!d;)a.compareEndPoints("StartToEnd",a)==0?d=!0:(a.moveEnd("character",-1),a.text==b?c+="\r\n":d=!0);return c};goog.dom.selection.getRangeIe_=function(a){var b=a.ownerDocument||a.document,c=b.selection.createRange();a.type=="textarea"?(b=b.body.createTextRange(),b.moveToElementText(a)):b=a.createTextRange();return[b,c]};
goog.dom.selection.canonicalizePositionIe_=function(a,b){if(a.type=="textarea"){var c=a.value.substring(0,b);b=goog.string.canonicalizeNewlines(c).length}return b};goog.dom.selection.useSelectionProperties_=function(a){try{return typeof a.selectionStart=="number"}catch(b){return!1}};goog.editor.focus={};goog.editor.focus.focusInputField=function(a){a.focus();goog.dom.selection.setCursorPosition(a,a.value.length)};goog.ui.editor.LinkDialog=function(a,b){goog.ui.editor.AbstractDialog.call(this,a);this.targetLink_=b;this.eventHandler_=new goog.events.EventHandler(this)};goog.inherits(goog.ui.editor.LinkDialog,goog.ui.editor.AbstractDialog);goog.ui.editor.LinkDialog.EventType={BEFORE_TEST_LINK:"beforetestlink"};goog.ui.editor.LinkDialog.OkEvent=function(a,b,c){goog.events.Event.call(this,goog.ui.editor.AbstractDialog.EventType.OK);this.linkText=a;this.linkUrl=b;this.openInNewWindow=c};
goog.inherits(goog.ui.editor.LinkDialog.OkEvent,goog.events.Event);goog.ui.editor.LinkDialog.BeforeTestLinkEvent=function(a){goog.events.Event.call(this,goog.ui.editor.LinkDialog.EventType.BEFORE_TEST_LINK);this.url=a};goog.inherits(goog.ui.editor.LinkDialog.BeforeTestLinkEvent,goog.events.Event);goog.ui.editor.LinkDialog.prototype.showOpenLinkInNewWindow_=!1;goog.ui.editor.LinkDialog.prototype.isOpenLinkInNewWindowChecked_=!1;
goog.ui.editor.LinkDialog.prototype.setEmailWarning=function(a){this.emailWarning_=a};goog.ui.editor.LinkDialog.prototype.showOpenLinkInNewWindow=function(a){this.showOpenLinkInNewWindow_=!0;this.isOpenLinkInNewWindowChecked_=a};
goog.ui.editor.LinkDialog.prototype.show=function(){goog.ui.editor.LinkDialog.superClass_.show.call(this);this.selectAppropriateTab_(this.textToDisplayInput_.value,this.getTargetUrl_());this.syncOkButton_();if(this.showOpenLinkInNewWindow_){if(!this.targetLink_.isNew())this.isOpenLinkInNewWindowChecked_=this.targetLink_.getAnchor().target=="_blank";this.openInNewWindowCheckbox_.checked=this.isOpenLinkInNewWindowChecked_}};
goog.ui.editor.LinkDialog.prototype.hide=function(){this.disableAutogenFlag_(!1);goog.ui.editor.LinkDialog.superClass_.hide.call(this)};goog.ui.editor.LinkDialog.prototype.setTextToDisplayVisible=function(a){this.textToDisplayDiv_&&goog.style.setStyle(this.textToDisplayDiv_,"display",a?"block":"none")};goog.ui.editor.LinkDialog.prototype.setStopReferrerLeaks=function(a){this.stopReferrerLeaks_=a};
goog.ui.editor.LinkDialog.prototype.setAutogenFeatureEnabled=function(a){this.autogenFeatureEnabled_=a};
goog.ui.editor.LinkDialog.prototype.createDialogControl=function(){this.textToDisplayDiv_=this.buildTextToDisplayDiv_();var a=this.dom.createDom(goog.dom.TagName.DIV,null,this.textToDisplayDiv_),b=new goog.ui.editor.AbstractDialog.Builder(this);b.setTitle(goog.ui.editor.messages.MSG_EDIT_LINK).setContent(a);this.tabPane_=new goog.ui.editor.TabPane(this.dom,goog.ui.editor.messages.MSG_LINK_TO);this.tabPane_.addTab(goog.ui.editor.LinkDialog.Id_.ON_WEB_TAB,goog.ui.editor.messages.MSG_ON_THE_WEB,goog.ui.editor.messages.MSG_ON_THE_WEB_TIP,
this.buildTabOnTheWeb_());this.tabPane_.addTab(goog.ui.editor.LinkDialog.Id_.EMAIL_ADDRESS_TAB,goog.ui.editor.messages.MSG_EMAIL_ADDRESS,goog.ui.editor.messages.MSG_EMAIL_ADDRESS_TIP,this.buildTabEmailAddress_());this.tabPane_.render(a);this.eventHandler_.listen(this.tabPane_,goog.ui.Component.EventType.SELECT,this.onChangeTab_);this.showOpenLinkInNewWindow_&&a.appendChild(this.buildOpenInNewWindowDiv_());return b.build()};
goog.ui.editor.LinkDialog.prototype.createOkEvent=function(){return this.tabPane_.getCurrentTabId()==goog.ui.editor.LinkDialog.Id_.EMAIL_ADDRESS_TAB?this.createOkEventFromEmailTab_():this.createOkEventFromWebTab_()};goog.ui.editor.LinkDialog.prototype.disposeInternal=function(){this.eventHandler_.dispose();this.eventHandler_=null;this.urlInputHandler_.dispose();this.urlInputHandler_=null;this.emailInputHandler_.dispose();this.emailInputHandler_=null;goog.ui.editor.LinkDialog.superClass_.disposeInternal.call(this)};
goog.ui.editor.LinkDialog.prototype.autogenFeatureEnabled_=!0;goog.ui.editor.LinkDialog.prototype.stopReferrerLeaks_=!1;
goog.ui.editor.LinkDialog.prototype.buildTextToDisplayDiv_=function(){var a=this.dom.createTable(1,2);a.cellSpacing="0";a.cellPadding="0";a.style.fontSize="10pt";var b=this.dom.createDom(goog.dom.TagName.DIV);a.rows[0].cells[0].innerHTML='<span style="position: relative; bottom: 2px; padding-right: 1px; white-space: nowrap;">'+goog.ui.editor.messages.MSG_TEXT_TO_DISPLAY+"&nbsp;</span>";var c=this.textToDisplayInput_=this.dom.createDom(goog.dom.TagName.INPUT,{id:goog.ui.editor.LinkDialog.Id_.TEXT_TO_DISPLAY});
goog.style.setStyle(c,"width","98%");goog.style.setStyle(a.rows[0].cells[1],"width","100%");goog.dom.appendChild(a.rows[0].cells[1],c);c.value=this.targetLink_.getCurrentText();this.eventHandler_.listen(c,goog.events.EventType.KEYUP,goog.bind(this.onTextToDisplayEdit_,this));goog.dom.appendChild(b,a);return b};
goog.ui.editor.LinkDialog.prototype.buildOpenInNewWindowDiv_=function(){this.openInNewWindowCheckbox_=this.dom.createDom(goog.dom.TagName.INPUT,{type:"checkbox"});return this.dom.createDom(goog.dom.TagName.DIV,null,this.dom.createDom(goog.dom.TagName.LABEL,null,this.openInNewWindowCheckbox_,goog.ui.editor.messages.MSG_OPEN_IN_NEW_WINDOW))};
goog.ui.editor.LinkDialog.prototype.buildTabOnTheWeb_=function(){var a=this.dom.createElement(goog.dom.TagName.DIV),b=this.dom.createDom(goog.dom.TagName.DIV,{innerHTML:"<b>"+goog.ui.editor.messages.MSG_WHAT_URL+"</b>"}),c=this.dom.createDom(goog.dom.TagName.INPUT,{id:goog.ui.editor.LinkDialog.Id_.ON_WEB_INPUT,className:goog.ui.editor.LinkDialog.TARGET_INPUT_CLASSNAME_});if(!goog.userAgent.IE)c.type="url";if(goog.editor.BrowserFeature.NEEDS_99_WIDTH_IN_STANDARDS_MODE&&goog.editor.node.isStandardsMode(c))c.style.width=
"99%";var d=this.dom.createDom(goog.dom.TagName.DIV,null,c);this.urlInputHandler_=new goog.events.InputHandler(c);this.eventHandler_.listen(this.urlInputHandler_,goog.events.InputHandler.EventType.INPUT,this.onUrlOrEmailInputChange_);c=new goog.ui.Button(goog.ui.editor.messages.MSG_TEST_THIS_LINK,goog.ui.LinkButtonRenderer.getInstance(),this.dom);c.render(d);c.getElement().style.marginTop="1em";this.eventHandler_.listen(c,goog.ui.Component.EventType.ACTION,this.onWebTestLink_);c=this.dom.createDom(goog.dom.TagName.DIV,
{className:goog.ui.editor.LinkDialog.EXPLANATION_TEXT_CLASSNAME_,innerHTML:goog.ui.editor.messages.MSG_TR_LINK_EXPLANATION});a.appendChild(b);a.appendChild(d);a.appendChild(c);return a};
goog.ui.editor.LinkDialog.prototype.buildTabEmailAddress_=function(){var a=this.dom.createDom(goog.dom.TagName.DIV),b=this.dom.createDom(goog.dom.TagName.DIV,{innerHTML:"<b>"+goog.ui.editor.messages.MSG_WHAT_EMAIL+"</b>"});goog.dom.appendChild(a,b);b=this.dom.createDom(goog.dom.TagName.INPUT,{id:goog.ui.editor.LinkDialog.Id_.EMAIL_ADDRESS_INPUT,className:goog.ui.editor.LinkDialog.TARGET_INPUT_CLASSNAME_});if(goog.editor.BrowserFeature.NEEDS_99_WIDTH_IN_STANDARDS_MODE&&goog.editor.node.isStandardsMode(b))b.style.width=
"99%";goog.dom.appendChild(a,b);this.emailInputHandler_=new goog.events.InputHandler(b);this.eventHandler_.listen(this.emailInputHandler_,goog.events.InputHandler.EventType.INPUT,this.onUrlOrEmailInputChange_);goog.dom.appendChild(a,this.dom.createDom(goog.dom.TagName.DIV,{id:goog.ui.editor.LinkDialog.Id_.EMAIL_WARNING,className:goog.ui.editor.LinkDialog.EMAIL_WARNING_CLASSNAME_,style:"visibility:hidden"},goog.ui.editor.messages.MSG_INVALID_EMAIL));this.emailWarning_&&(b=this.dom.createDom(goog.dom.TagName.DIV,
{className:goog.ui.editor.LinkDialog.EXPLANATION_TEXT_CLASSNAME_,innerHTML:this.emailWarning_}),goog.dom.appendChild(a,b));return a};goog.ui.editor.LinkDialog.prototype.getTargetUrl_=function(){return this.targetLink_.getAnchor().getAttribute("href")||""};
goog.ui.editor.LinkDialog.prototype.selectAppropriateTab_=function(a,b){this.isNewLink_()?this.guessUrlAndSelectTab_(a):(goog.editor.Link.isMailto(b)?(this.tabPane_.setSelectedTabId(goog.ui.editor.LinkDialog.Id_.EMAIL_ADDRESS_TAB),this.dom.getElement(goog.ui.editor.LinkDialog.Id_.EMAIL_ADDRESS_INPUT).value=b.substring(b.indexOf(":")+1)):(this.tabPane_.setSelectedTabId(goog.ui.editor.LinkDialog.Id_.ON_WEB_TAB),this.dom.getElement(goog.ui.editor.LinkDialog.Id_.ON_WEB_INPUT).value=this.isNewLink_()?
"http://":b),this.setAutogenFlagFromCurInput_())};
goog.ui.editor.LinkDialog.prototype.guessUrlAndSelectTab_=function(a){goog.editor.Link.isLikelyEmailAddress(a)?(this.tabPane_.setSelectedTabId(goog.ui.editor.LinkDialog.Id_.EMAIL_ADDRESS_TAB),this.dom.getElement(goog.ui.editor.LinkDialog.Id_.EMAIL_ADDRESS_INPUT).value=a,this.setAutogenFlag_(!0),this.disableAutogenFlag_(!0)):goog.editor.Link.isLikelyUrl(a)?(this.tabPane_.setSelectedTabId(goog.ui.editor.LinkDialog.Id_.ON_WEB_TAB),this.dom.getElement(goog.ui.editor.LinkDialog.Id_.ON_WEB_INPUT).value=a,
this.setAutogenFlag_(!0),this.disableAutogenFlag_(!0)):(this.targetLink_.getCurrentText()||this.setAutogenFlag_(!0),this.tabPane_.setSelectedTabId(goog.ui.editor.LinkDialog.Id_.ON_WEB_TAB))};
goog.ui.editor.LinkDialog.prototype.syncOkButton_=function(){var a;if(this.tabPane_.getCurrentTabId()==goog.ui.editor.LinkDialog.Id_.EMAIL_ADDRESS_TAB)a=this.dom.getElement(goog.ui.editor.LinkDialog.Id_.EMAIL_ADDRESS_INPUT).value,this.toggleInvalidEmailWarning_(a!=""&&!goog.editor.Link.isLikelyEmailAddress(a));else if(this.tabPane_.getCurrentTabId()==goog.ui.editor.LinkDialog.Id_.ON_WEB_TAB)a=this.dom.getElement(goog.ui.editor.LinkDialog.Id_.ON_WEB_INPUT).value;else return;this.getOkButtonElement().disabled=
goog.string.isEmpty(a)};goog.ui.editor.LinkDialog.prototype.toggleInvalidEmailWarning_=function(a){this.dom.getElement(goog.ui.editor.LinkDialog.Id_.EMAIL_WARNING).style.visibility=a?"visible":"hidden"};goog.ui.editor.LinkDialog.prototype.onTextToDisplayEdit_=function(){this.textToDisplayInput_.value==""?this.setAutogenFlag_(!0):this.setAutogenFlagFromCurInput_()};
goog.ui.editor.LinkDialog.prototype.createOkEventFromWebTab_=function(){var a=this.dom.getElement(goog.ui.editor.LinkDialog.Id_.ON_WEB_INPUT).value;return goog.editor.Link.isLikelyEmailAddress(a)?this.createOkEventFromEmailTab_(goog.ui.editor.LinkDialog.Id_.ON_WEB_INPUT):(a.search(/:/)<0&&(a="http://"+goog.string.trimLeft(a)),this.createOkEventFromUrl_(a))};
goog.ui.editor.LinkDialog.prototype.createOkEventFromEmailTab_=function(a){a=this.dom.getElement(a||goog.ui.editor.LinkDialog.Id_.EMAIL_ADDRESS_INPUT).value;return this.createOkEventFromUrl_("mailto:"+a)};
goog.ui.editor.LinkDialog.prototype.onWebTestLink_=function(){var a=this.dom.getElement(goog.ui.editor.LinkDialog.Id_.ON_WEB_INPUT).value;a.search(/:/)<0&&(a="http://"+goog.string.trimLeft(a));if(this.dispatchEvent(new goog.ui.editor.LinkDialog.BeforeTestLinkEvent(a))){var b=this.dom.getWindow(),c=goog.dom.getViewportSize(b);goog.window.open(a,{target:"_blank",width:Math.max(c.width-50,50),height:Math.max(c.height-50,50),toolbar:!0,scrollbars:!0,location:!0,statusbar:!1,menubar:!0,resizable:!0,noreferrer:this.stopReferrerLeaks_},
b)}};goog.ui.editor.LinkDialog.prototype.onUrlOrEmailInputChange_=function(){this.autogenerateTextToDisplay_?this.setTextToDisplayFromAuto_():this.textToDisplayInput_.value==""&&this.setAutogenFlagFromCurInput_();this.syncOkButton_()};goog.ui.editor.LinkDialog.prototype.onChangeTab_=function(a){a=this.dom.getElement(a.target.getId()+goog.ui.editor.LinkDialog.Id_.TAB_INPUT_SUFFIX);goog.editor.focus.focusInputField(a);a.style.width="";a.style.width=a.offsetWidth+"px";this.syncOkButton_();this.setTextToDisplayFromAuto_()};
goog.ui.editor.LinkDialog.prototype.setTextToDisplayFromAuto_=function(){if(this.autogenFeatureEnabled_&&this.autogenerateTextToDisplay_)this.textToDisplayInput_.value=this.dom.getElement(this.tabPane_.getCurrentTabId()+goog.ui.editor.LinkDialog.Id_.TAB_INPUT_SUFFIX).value};goog.ui.editor.LinkDialog.prototype.setAutogenFlag_=function(a){this.autogenerateTextToDisplay_=a};goog.ui.editor.LinkDialog.prototype.disableAutogenFlag_=function(a){this.setAutogenFlag_(!a);this.disableAutogen_=a};
goog.ui.editor.LinkDialog.prototype.createOkEventFromUrl_=function(a){this.setTextToDisplayFromAuto_();if(this.showOpenLinkInNewWindow_)this.isOpenLinkInNewWindowChecked_=this.openInNewWindowCheckbox_.checked;return new goog.ui.editor.LinkDialog.OkEvent(this.textToDisplayInput_.value,a,this.showOpenLinkInNewWindow_&&this.isOpenLinkInNewWindowChecked_)};
goog.ui.editor.LinkDialog.prototype.setAutogenFlagFromCurInput_=function(){var a=!1;this.disableAutogen_||(a=this.dom.getElement(this.tabPane_.getCurrentTabId()+goog.ui.editor.LinkDialog.Id_.TAB_INPUT_SUFFIX).value==this.textToDisplayInput_.value);this.setAutogenFlag_(a)};goog.ui.editor.LinkDialog.prototype.isNewLink_=function(){return this.targetLink_.isNew()};
goog.ui.editor.LinkDialog.Id_={TEXT_TO_DISPLAY:"linkdialog-text",ON_WEB_TAB:"linkdialog-onweb",ON_WEB_INPUT:"linkdialog-onweb-tab-input",EMAIL_ADDRESS_TAB:"linkdialog-email",EMAIL_ADDRESS_INPUT:"linkdialog-email-tab-input",EMAIL_WARNING:"linkdialog-email-warning",TAB_INPUT_SUFFIX:"-tab-input"};goog.ui.editor.LinkDialog.TARGET_INPUT_CLASSNAME_="tr-link-dialog-target-input";goog.ui.editor.LinkDialog.EMAIL_WARNING_CLASSNAME_="tr-link-dialog-email-warning";
goog.ui.editor.LinkDialog.EXPLANATION_TEXT_CLASSNAME_="tr-link-dialog-explanation-text";goog.editor.plugins.LinkDialogPlugin=function(){goog.editor.plugins.AbstractDialogPlugin.call(this,goog.editor.Command.MODAL_LINK_EDITOR);this.eventHandler_=new goog.events.EventHandler(this)};goog.inherits(goog.editor.plugins.LinkDialogPlugin,goog.editor.plugins.AbstractDialogPlugin);goog.editor.plugins.LinkDialogPlugin.prototype.showOpenLinkInNewWindow_=!1;goog.editor.plugins.LinkDialogPlugin.prototype.isOpenLinkInNewWindowChecked_=!1;
goog.editor.plugins.LinkDialogPlugin.prototype.stopReferrerLeaks_=!1;goog.editor.plugins.LinkDialogPlugin.prototype.getTrogClassId=goog.functions.constant("LinkDialogPlugin");goog.editor.plugins.LinkDialogPlugin.prototype.showOpenLinkInNewWindow=function(a){this.showOpenLinkInNewWindow_=!0;this.isOpenLinkInNewWindowChecked_=a};goog.editor.plugins.LinkDialogPlugin.prototype.getOpenLinkInNewWindowCheckedState=function(){return this.isOpenLinkInNewWindowChecked_};
goog.editor.plugins.LinkDialogPlugin.prototype.stopReferrerLeaks=function(){this.stopReferrerLeaks_=!0};goog.editor.plugins.LinkDialogPlugin.prototype.setEmailWarning=function(a){this.emailWarning_=a};goog.editor.plugins.LinkDialogPlugin.prototype.execCommandInternal=function(a,b){this.currentLink_=b;return goog.editor.plugins.LinkDialogPlugin.superClass_.execCommandInternal.call(this,a,b)};
goog.editor.plugins.LinkDialogPlugin.prototype.handleAfterHide=function(a){goog.editor.plugins.LinkDialogPlugin.superClass_.handleAfterHide.call(this,a);this.currentLink_=null};goog.editor.plugins.LinkDialogPlugin.prototype.getEventHandler=function(){return this.eventHandler_};goog.editor.plugins.LinkDialogPlugin.prototype.getCurrentLink=function(){return this.currentLink_};
goog.editor.plugins.LinkDialogPlugin.prototype.createDialog=function(a,b){var c=new goog.ui.editor.LinkDialog(a,b);this.emailWarning_&&c.setEmailWarning(this.emailWarning_);this.showOpenLinkInNewWindow_&&c.showOpenLinkInNewWindow(this.isOpenLinkInNewWindowChecked_);c.setStopReferrerLeaks(this.stopReferrerLeaks_);this.eventHandler_.listen(c,goog.ui.editor.AbstractDialog.EventType.OK,this.handleOk_).listen(c,goog.ui.editor.AbstractDialog.EventType.CANCEL,this.handleCancel_);return c};
goog.editor.plugins.LinkDialogPlugin.prototype.disposeInternal=function(){goog.editor.plugins.LinkDialogPlugin.superClass_.disposeInternal.call(this);this.eventHandler_.dispose()};
goog.editor.plugins.LinkDialogPlugin.prototype.handleOk_=function(a){this.disposeOriginalSelection();this.currentLink_.setTextAndUrl(a.linkText,a.linkUrl);if(this.showOpenLinkInNewWindow_){var b=this.currentLink_.getAnchor();if(a.openInNewWindow)b.target="_blank";else if(b.target=="_blank")b.target="";this.isOpenLinkInNewWindowChecked_=a.openInNewWindow}this.currentLink_.placeCursorRightOf();this.fieldObject.dispatchSelectionChangeEvent();this.fieldObject.dispatchChange();this.eventHandler_.removeAll()};
goog.editor.plugins.LinkDialogPlugin.prototype.handleCancel_=function(){this.currentLink_.isNew()&&(goog.dom.flattenElement(this.currentLink_.getAnchor()),this.fieldObject.dispatchChange());this.eventHandler_.removeAll()};goog.net={};goog.net.XhrMonitor_=function(){if(goog.userAgent.GECKO)this.contextsToXhr_={},this.xhrToContexts_={},this.stack_=[]};goog.net.XhrMonitor_.getKey=function(a){return goog.isString(a)?a:goog.isObject(a)?goog.getUid(a):""};goog.net.XhrMonitor_.prototype.logger_=goog.debug.Logger.getLogger("goog.net.xhrMonitor");goog.net.XhrMonitor_.prototype.enabled_=goog.userAgent.GECKO;goog.net.XhrMonitor_.prototype.setEnabled=function(a){this.enabled_=goog.userAgent.GECKO&&a};
goog.net.XhrMonitor_.prototype.pushContext=function(a){if(this.enabled_){var b=goog.net.XhrMonitor_.getKey(a);this.logger_.finest("Pushing context: "+a+" ("+b+")");this.stack_.push(b)}};goog.net.XhrMonitor_.prototype.popContext=function(){if(this.enabled_){var a=this.stack_.pop();this.logger_.finest("Popping context: "+a);this.updateDependentContexts_(a)}};
goog.net.XhrMonitor_.prototype.isContextSafe=function(a){if(!this.enabled_)return!0;var b=this.contextsToXhr_[goog.net.XhrMonitor_.getKey(a)];this.logger_.fine("Context is safe : "+a+" - "+b);return!b};goog.net.XhrMonitor_.prototype.markXhrOpen=function(a){if(this.enabled_){a=goog.getUid(a);this.logger_.fine("Opening XHR : "+a);for(var b=0;b<this.stack_.length;b++){var c=this.stack_[b];this.addToMap_(this.contextsToXhr_,c,a);this.addToMap_(this.xhrToContexts_,a,c)}}};
goog.net.XhrMonitor_.prototype.markXhrClosed=function(a){if(this.enabled_)for(var b in a=goog.getUid(a),this.logger_.fine("Closing XHR : "+a),delete this.xhrToContexts_[a],this.contextsToXhr_)goog.array.remove(this.contextsToXhr_[b],a),this.contextsToXhr_[b].length==0&&delete this.contextsToXhr_[b]};
goog.net.XhrMonitor_.prototype.updateDependentContexts_=function(a){var b=this.xhrToContexts_[a],c=this.contextsToXhr_[a];b&&c&&(this.logger_.finest("Updating dependent contexts"),goog.array.forEach(b,function(a){goog.array.forEach(c,function(b){this.addToMap_(this.contextsToXhr_,a,b);this.addToMap_(this.xhrToContexts_,b,a)},this)},this))};goog.net.XhrMonitor_.prototype.addToMap_=function(a,b,c){a[b]||(a[b]=[]);goog.array.contains(a[b],c)||a[b].push(c)};goog.net.xhrMonitor=new goog.net.XhrMonitor_;goog.net.ErrorCode={NO_ERROR:0,ACCESS_DENIED:1,FILE_NOT_FOUND:2,FF_SILENT_ERROR:3,CUSTOM_ERROR:4,EXCEPTION:5,HTTP_ERROR:6,ABORT:7,TIMEOUT:8,OFFLINE:9};
goog.net.ErrorCode.getDebugMessage=function(a){switch(a){case goog.net.ErrorCode.NO_ERROR:return"No Error";case goog.net.ErrorCode.ACCESS_DENIED:return"Access denied to content document";case goog.net.ErrorCode.FILE_NOT_FOUND:return"File not found";case goog.net.ErrorCode.FF_SILENT_ERROR:return"Firefox silently errored";case goog.net.ErrorCode.CUSTOM_ERROR:return"Application custom error";case goog.net.ErrorCode.EXCEPTION:return"An exception occurred";case goog.net.ErrorCode.HTTP_ERROR:return"Http response at 400 or 500 level";
case goog.net.ErrorCode.ABORT:return"Request was aborted";case goog.net.ErrorCode.TIMEOUT:return"Request timed out";case goog.net.ErrorCode.OFFLINE:return"The resource is not available offline";default:return"Unrecognized error code"}};goog.net.HttpStatus={CONTINUE:100,SWITCHING_PROTOCOLS:101,OK:200,CREATED:201,ACCEPTED:202,NON_AUTHORITATIVE_INFORMATION:203,NO_CONTENT:204,RESET_CONTENT:205,PARTIAL_CONTENT:206,MULTIPLE_CHOICES:300,MOVED_PERMANENTLY:301,FOUND:302,SEE_OTHER:303,NOT_MODIFIED:304,USE_PROXY:305,TEMPORARY_REDIRECT:307,BAD_REQUEST:400,UNAUTHORIZED:401,PAYMENT_REQUIRED:402,FORBIDDEN:403,NOT_FOUND:404,METHOD_NOT_ALLOWED:405,NOT_ACCEPTABLE:406,PROXY_AUTHENTICATION_REQUIRED:407,REQUEST_TIMEOUT:408,CONFLICT:409,GONE:410,LENGTH_REQUIRED:411,
PRECONDITION_FAILED:412,REQUEST_ENTITY_TOO_LARGE:413,REQUEST_URI_TOO_LONG:414,UNSUPPORTED_MEDIA_TYPE:415,REQUEST_RANGE_NOT_SATISFIABLE:416,EXPECTATION_FAILED:417,INTERNAL_SERVER_ERROR:500,NOT_IMPLEMENTED:501,BAD_GATEWAY:502,SERVICE_UNAVAILABLE:503,GATEWAY_TIMEOUT:504,HTTP_VERSION_NOT_SUPPORTED:505,QUIRK_IE_NO_CONTENT:1223};goog.json={};goog.json.isValid_=function(a){if(/^\s*$/.test(a))return!1;return/^[\],:{}\s\u2028\u2029]*$/.test(a.replace(/\\["\\\/bfnrtu]/g,"@").replace(/"[^"\\\n\r\u2028\u2029\x00-\x08\x10-\x1f\x80-\x9f]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:[\s\u2028\u2029]*\[)+/g,""))};goog.json.parse=function(a){a=String(a);if(goog.json.isValid_(a))try{return eval("("+a+")")}catch(b){}throw Error("Invalid JSON string: "+a);};
goog.json.unsafeParse=function(a){return eval("("+a+")")};goog.json.serialize=function(a,b){return(new goog.json.Serializer(b)).serialize(a)};goog.json.Serializer=function(a){this.replacer_=a};goog.json.Serializer.prototype.serialize=function(a){var b=[];this.serialize_(a,b);return b.join("")};
goog.json.Serializer.prototype.serialize_=function(a,b){switch(typeof a){case "string":this.serializeString_(a,b);break;case "number":this.serializeNumber_(a,b);break;case "boolean":b.push(a);break;case "undefined":b.push("null");break;case "object":if(a==null){b.push("null");break}if(goog.isArray(a)){this.serializeArray_(a,b);break}this.serializeObject_(a,b);break;case "function":break;default:throw Error("Unknown type: "+typeof a);}};
goog.json.Serializer.charToJsonCharCache_={'"':'\\"',"\\":"\\\\","/":"\\/","\u0008":"\\b","\u000c":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\u000b":"\\u000b"};goog.json.Serializer.charsToReplace_=/\uffff/.test("\uffff")?/[\\\"\x00-\x1f\x7f-\uffff]/g:/[\\\"\x00-\x1f\x7f-\xff]/g;
goog.json.Serializer.prototype.serializeString_=function(a,b){b.push('"',a.replace(goog.json.Serializer.charsToReplace_,function(a){if(a in goog.json.Serializer.charToJsonCharCache_)return goog.json.Serializer.charToJsonCharCache_[a];var b=a.charCodeAt(0),e="\\u";b<16?e+="000":b<256?e+="00":b<4096&&(e+="0");return goog.json.Serializer.charToJsonCharCache_[a]=e+b.toString(16)}),'"')};goog.json.Serializer.prototype.serializeNumber_=function(a,b){b.push(isFinite(a)&&!isNaN(a)?a:"null")};
goog.json.Serializer.prototype.serializeArray_=function(a,b){var c=a.length;b.push("[");for(var d="",e=0;e<c;e++)b.push(d),d=a[e],this.serialize_(this.replacer_?this.replacer_.call(a,String(e),d):d,b),d=",";b.push("]")};
goog.json.Serializer.prototype.serializeObject_=function(a,b){b.push("{");var c="",d;for(d in a)if(Object.prototype.hasOwnProperty.call(a,d)){var e=a[d];typeof e!="function"&&(b.push(c),this.serializeString_(d,b),b.push(":"),this.serialize_(this.replacer_?this.replacer_.call(a,d,e):e,b),c=",")}b.push("}")};goog.net.XmlHttpFactory=function(){};goog.net.XmlHttpFactory.prototype.cachedOptions_=null;goog.net.XmlHttpFactory.prototype.getOptions=function(){return this.cachedOptions_||(this.cachedOptions_=this.internalGetOptions())};goog.net.WrapperXmlHttpFactory=function(a,b){goog.net.XmlHttpFactory.call(this);this.xhrFactory_=a;this.optionsFactory_=b};goog.inherits(goog.net.WrapperXmlHttpFactory,goog.net.XmlHttpFactory);goog.net.WrapperXmlHttpFactory.prototype.createInstance=function(){return this.xhrFactory_()};goog.net.WrapperXmlHttpFactory.prototype.getOptions=function(){return this.optionsFactory_()};goog.net.XmlHttp=function(){return goog.net.XmlHttp.factory_.createInstance()};goog.net.XmlHttp.getOptions=function(){return goog.net.XmlHttp.factory_.getOptions()};goog.net.XmlHttp.OptionType={USE_NULL_FUNCTION:0,LOCAL_REQUEST_ERROR:1};goog.net.XmlHttp.ReadyState={UNINITIALIZED:0,LOADING:1,LOADED:2,INTERACTIVE:3,COMPLETE:4};goog.net.XmlHttp.setFactory=function(a,b){goog.net.XmlHttp.setGlobalFactory(new goog.net.WrapperXmlHttpFactory(a,b))};
goog.net.XmlHttp.setGlobalFactory=function(a){goog.net.XmlHttp.factory_=a};goog.net.DefaultXmlHttpFactory=function(){goog.net.XmlHttpFactory.call(this)};goog.inherits(goog.net.DefaultXmlHttpFactory,goog.net.XmlHttpFactory);goog.net.DefaultXmlHttpFactory.prototype.createInstance=function(){var a=this.getProgId_();return a?new ActiveXObject(a):new XMLHttpRequest};
goog.net.DefaultXmlHttpFactory.prototype.internalGetOptions=function(){var a={};this.getProgId_()&&(a[goog.net.XmlHttp.OptionType.USE_NULL_FUNCTION]=!0,a[goog.net.XmlHttp.OptionType.LOCAL_REQUEST_ERROR]=!0);return a};goog.net.DefaultXmlHttpFactory.prototype.ieProgId_=null;
goog.net.DefaultXmlHttpFactory.prototype.getProgId_=function(){if(!this.ieProgId_&&typeof XMLHttpRequest=="undefined"&&typeof ActiveXObject!="undefined"){for(var a=["MSXML2.XMLHTTP.6.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"],b=0;b<a.length;b++){var c=a[b];try{return new ActiveXObject(c),this.ieProgId_=c}catch(d){}}throw Error("Could not create ActiveXObject. ActiveX might be disabled, or MSXML might not be installed");}return this.ieProgId_};goog.net.XmlHttp.setGlobalFactory(new goog.net.DefaultXmlHttpFactory);goog.net.EventType={COMPLETE:"complete",SUCCESS:"success",ERROR:"error",ABORT:"abort",READY:"ready",READY_STATE_CHANGE:"readystatechange",TIMEOUT:"timeout",INCREMENTAL_DATA:"incrementaldata",PROGRESS:"progress"};goog.net.XhrIo=function(a){goog.events.EventTarget.call(this);this.headers=new goog.structs.Map;this.xmlHttpFactory_=a||null};goog.inherits(goog.net.XhrIo,goog.events.EventTarget);goog.net.XhrIo.ResponseType={DEFAULT:"",TEXT:"text",DOCUMENT:"document",BLOB:"blob",ARRAY_BUFFER:"arraybuffer"};goog.net.XhrIo.prototype.logger_=goog.debug.Logger.getLogger("goog.net.XhrIo");goog.net.XhrIo.CONTENT_TYPE_HEADER="Content-Type";goog.net.XhrIo.HTTP_SCHEME_PATTERN=/^https?:?$/i;
goog.net.XhrIo.FORM_CONTENT_TYPE="application/x-www-form-urlencoded;charset=utf-8";goog.net.XhrIo.sendInstances_=[];goog.net.XhrIo.send=function(a,b,c,d,e,f){var g=new goog.net.XhrIo;goog.net.XhrIo.sendInstances_.push(g);b&&goog.events.listen(g,goog.net.EventType.COMPLETE,b);goog.events.listen(g,goog.net.EventType.READY,goog.partial(goog.net.XhrIo.cleanupSend_,g));f&&g.setTimeoutInterval(f);g.send(a,c,d,e)};goog.net.XhrIo.cleanup=function(){for(var a=goog.net.XhrIo.sendInstances_;a.length;)a.pop().dispose()};
goog.net.XhrIo.protectEntryPoints=function(a){goog.net.XhrIo.prototype.onReadyStateChangeEntryPoint_=a.protectEntryPoint(goog.net.XhrIo.prototype.onReadyStateChangeEntryPoint_)};goog.net.XhrIo.cleanupSend_=function(a){a.dispose();goog.array.remove(goog.net.XhrIo.sendInstances_,a)};goog.net.XhrIo.prototype.active_=!1;goog.net.XhrIo.prototype.xhr_=null;goog.net.XhrIo.prototype.xhrOptions_=null;goog.net.XhrIo.prototype.lastUri_="";goog.net.XhrIo.prototype.lastMethod_="";
goog.net.XhrIo.prototype.lastErrorCode_=goog.net.ErrorCode.NO_ERROR;goog.net.XhrIo.prototype.lastError_="";goog.net.XhrIo.prototype.errorDispatched_=!1;goog.net.XhrIo.prototype.inSend_=!1;goog.net.XhrIo.prototype.inOpen_=!1;goog.net.XhrIo.prototype.inAbort_=!1;goog.net.XhrIo.prototype.timeoutInterval_=0;goog.net.XhrIo.prototype.timeoutId_=null;goog.net.XhrIo.prototype.responseType_=goog.net.XhrIo.ResponseType.DEFAULT;goog.net.XhrIo.prototype.withCredentials_=!1;
goog.net.XhrIo.prototype.getTimeoutInterval=function(){return this.timeoutInterval_};goog.net.XhrIo.prototype.setTimeoutInterval=function(a){this.timeoutInterval_=Math.max(0,a)};goog.net.XhrIo.prototype.setResponseType=function(a){this.responseType_=a};goog.net.XhrIo.prototype.getResponseType=function(){return this.responseType_};goog.net.XhrIo.prototype.setWithCredentials=function(a){this.withCredentials_=a};goog.net.XhrIo.prototype.getWithCredentials=function(){return this.withCredentials_};
goog.net.XhrIo.prototype.send=function(a,b,c,d){if(this.xhr_)throw Error("[goog.net.XhrIo] Object is active with another request");b=b?b.toUpperCase():"GET";this.lastUri_=a;this.lastError_="";this.lastErrorCode_=goog.net.ErrorCode.NO_ERROR;this.lastMethod_=b;this.errorDispatched_=!1;this.active_=!0;this.xhr_=this.createXhr();this.xhrOptions_=this.xmlHttpFactory_?this.xmlHttpFactory_.getOptions():goog.net.XmlHttp.getOptions();goog.net.xhrMonitor.markXhrOpen(this.xhr_);this.xhr_.onreadystatechange=
goog.bind(this.onReadyStateChange_,this);try{this.logger_.fine(this.formatMsg_("Opening Xhr")),this.inOpen_=!0,this.xhr_.open(b,a,!0),this.inOpen_=!1}catch(e){this.logger_.fine(this.formatMsg_("Error opening Xhr: "+e.message));this.error_(goog.net.ErrorCode.EXCEPTION,e);return}a=c||"";var f=this.headers.clone();d&&goog.structs.forEach(d,function(a,b){f.set(b,a)});b=="POST"&&!f.containsKey(goog.net.XhrIo.CONTENT_TYPE_HEADER)&&f.set(goog.net.XhrIo.CONTENT_TYPE_HEADER,goog.net.XhrIo.FORM_CONTENT_TYPE);
goog.structs.forEach(f,function(a,b){this.xhr_.setRequestHeader(b,a)},this);if(this.responseType_)this.xhr_.responseType=this.responseType_;if(goog.object.containsKey(this.xhr_,"withCredentials"))this.xhr_.withCredentials=this.withCredentials_;try{if(this.timeoutId_)goog.Timer.defaultTimerObject.clearTimeout(this.timeoutId_),this.timeoutId_=null;if(this.timeoutInterval_>0)this.logger_.fine(this.formatMsg_("Will abort after "+this.timeoutInterval_+"ms if incomplete")),this.timeoutId_=goog.Timer.defaultTimerObject.setTimeout(goog.bind(this.timeout_,
this),this.timeoutInterval_);this.logger_.fine(this.formatMsg_("Sending request"));this.inSend_=!0;this.xhr_.send(a);this.inSend_=!1}catch(g){this.logger_.fine(this.formatMsg_("Send error: "+g.message)),this.error_(goog.net.ErrorCode.EXCEPTION,g)}};goog.net.XhrIo.prototype.createXhr=function(){return this.xmlHttpFactory_?this.xmlHttpFactory_.createInstance():goog.net.XmlHttp()};
goog.net.XhrIo.prototype.dispatchEvent=function(a){if(this.xhr_){goog.net.xhrMonitor.pushContext(this.xhr_);try{return goog.net.XhrIo.superClass_.dispatchEvent.call(this,a)}finally{goog.net.xhrMonitor.popContext()}}else return goog.net.XhrIo.superClass_.dispatchEvent.call(this,a)};
goog.net.XhrIo.prototype.timeout_=function(){if(typeof goog!="undefined"&&this.xhr_)this.lastError_="Timed out after "+this.timeoutInterval_+"ms, aborting",this.lastErrorCode_=goog.net.ErrorCode.TIMEOUT,this.logger_.fine(this.formatMsg_(this.lastError_)),this.dispatchEvent(goog.net.EventType.TIMEOUT),this.abort(goog.net.ErrorCode.TIMEOUT)};
goog.net.XhrIo.prototype.error_=function(a,b){this.active_=!1;if(this.xhr_)this.inAbort_=!0,this.xhr_.abort(),this.inAbort_=!1;this.lastError_=b;this.lastErrorCode_=a;this.dispatchErrors_();this.cleanUpXhr_()};goog.net.XhrIo.prototype.dispatchErrors_=function(){if(!this.errorDispatched_)this.errorDispatched_=!0,this.dispatchEvent(goog.net.EventType.COMPLETE),this.dispatchEvent(goog.net.EventType.ERROR)};
goog.net.XhrIo.prototype.abort=function(a){if(this.xhr_&&this.active_)this.logger_.fine(this.formatMsg_("Aborting")),this.active_=!1,this.inAbort_=!0,this.xhr_.abort(),this.inAbort_=!1,this.lastErrorCode_=a||goog.net.ErrorCode.ABORT,this.dispatchEvent(goog.net.EventType.COMPLETE),this.dispatchEvent(goog.net.EventType.ABORT),this.cleanUpXhr_()};goog.net.XhrIo.prototype.disposeInternal=function(){if(this.xhr_){if(this.active_)this.active_=!1,this.inAbort_=!0,this.xhr_.abort(),this.inAbort_=!1;this.cleanUpXhr_(!0)}goog.net.XhrIo.superClass_.disposeInternal.call(this)};
goog.net.XhrIo.prototype.onReadyStateChange_=function(){if(!this.inOpen_&&!this.inSend_&&!this.inAbort_)this.onReadyStateChangeEntryPoint_();else this.onReadyStateChangeHelper_()};goog.net.XhrIo.prototype.onReadyStateChangeEntryPoint_=function(){this.onReadyStateChangeHelper_()};
goog.net.XhrIo.prototype.onReadyStateChangeHelper_=function(){if(this.active_&&typeof goog!="undefined")if(this.xhrOptions_[goog.net.XmlHttp.OptionType.LOCAL_REQUEST_ERROR]&&this.getReadyState()==goog.net.XmlHttp.ReadyState.COMPLETE&&this.getStatus()==2)this.logger_.fine(this.formatMsg_("Local request error detected and ignored"));else if(this.inSend_&&this.getReadyState()==goog.net.XmlHttp.ReadyState.COMPLETE)goog.Timer.defaultTimerObject.setTimeout(goog.bind(this.onReadyStateChange_,this),0);else if(this.dispatchEvent(goog.net.EventType.READY_STATE_CHANGE),
this.isComplete())this.logger_.fine(this.formatMsg_("Request complete")),this.active_=!1,this.isSuccess()?(this.dispatchEvent(goog.net.EventType.COMPLETE),this.dispatchEvent(goog.net.EventType.SUCCESS)):(this.lastErrorCode_=goog.net.ErrorCode.HTTP_ERROR,this.lastError_=this.getStatusText()+" ["+this.getStatus()+"]",this.dispatchErrors_()),this.cleanUpXhr_()};
goog.net.XhrIo.prototype.cleanUpXhr_=function(a){if(this.xhr_){var b=this.xhr_,c=this.xhrOptions_[goog.net.XmlHttp.OptionType.USE_NULL_FUNCTION]?goog.nullFunction:null;this.xhrOptions_=this.xhr_=null;if(this.timeoutId_)goog.Timer.defaultTimerObject.clearTimeout(this.timeoutId_),this.timeoutId_=null;a||(goog.net.xhrMonitor.pushContext(b),this.dispatchEvent(goog.net.EventType.READY),goog.net.xhrMonitor.popContext());goog.net.xhrMonitor.markXhrClosed(b);try{b.onreadystatechange=c}catch(d){this.logger_.severe("Problem encountered resetting onreadystatechange: "+
d.message)}}};goog.net.XhrIo.prototype.isActive=function(){return!!this.xhr_};goog.net.XhrIo.prototype.isComplete=function(){return this.getReadyState()==goog.net.XmlHttp.ReadyState.COMPLETE};
goog.net.XhrIo.prototype.isSuccess=function(){switch(this.getStatus()){case 0:return!this.isLastUriEffectiveSchemeHttp_();case goog.net.HttpStatus.OK:case goog.net.HttpStatus.CREATED:case goog.net.HttpStatus.ACCEPTED:case goog.net.HttpStatus.NO_CONTENT:case goog.net.HttpStatus.NOT_MODIFIED:case goog.net.HttpStatus.QUIRK_IE_NO_CONTENT:return!0;default:return!1}};
goog.net.XhrIo.prototype.isLastUriEffectiveSchemeHttp_=function(){var a=goog.isString(this.lastUri_)?goog.uri.utils.getScheme(this.lastUri_):this.lastUri_.getScheme();if(a)return goog.net.XhrIo.HTTP_SCHEME_PATTERN.test(a);return self.location?goog.net.XhrIo.HTTP_SCHEME_PATTERN.test(self.location.protocol):!0};goog.net.XhrIo.prototype.getReadyState=function(){return this.xhr_?this.xhr_.readyState:goog.net.XmlHttp.ReadyState.UNINITIALIZED};
goog.net.XhrIo.prototype.getStatus=function(){try{return this.getReadyState()>goog.net.XmlHttp.ReadyState.LOADED?this.xhr_.status:-1}catch(a){return this.logger_.warning("Can not get status: "+a.message),-1}};goog.net.XhrIo.prototype.getStatusText=function(){try{return this.getReadyState()>goog.net.XmlHttp.ReadyState.LOADED?this.xhr_.statusText:""}catch(a){return this.logger_.fine("Can not get status: "+a.message),""}};goog.net.XhrIo.prototype.getLastUri=function(){return String(this.lastUri_)};
goog.net.XhrIo.prototype.getResponseText=function(){try{return this.xhr_?this.xhr_.responseText:""}catch(a){return this.logger_.fine("Can not get responseText: "+a.message),""}};goog.net.XhrIo.prototype.getResponseXml=function(){try{return this.xhr_?this.xhr_.responseXML:null}catch(a){return this.logger_.fine("Can not get responseXML: "+a.message),null}};goog.net.XhrIo.prototype.getResponseJson=function(a){if(this.xhr_){var b=this.xhr_.responseText;a&&b.indexOf(a)==0&&(b=b.substring(a.length));return goog.json.parse(b)}};
goog.net.XhrIo.prototype.getResponse=function(){try{if(!this.xhr_)return null;if("response"in this.xhr_)return this.xhr_.response;switch(this.responseType_){case goog.net.XhrIo.ResponseType.DEFAULT:case goog.net.XhrIo.ResponseType.TEXT:return this.xhr_.responseText;case goog.net.XhrIo.ResponseType.ARRAY_BUFFER:if("mozResponseArrayBuffer"in this.xhr_)return this.xhr_.mozResponseArrayBuffer}this.logger_.severe("Response type "+this.responseType_+" is not supported on this browser");return null}catch(a){return this.logger_.fine("Can not get response: "+
a.message),null}};goog.net.XhrIo.prototype.getResponseHeader=function(a){return this.xhr_&&this.isComplete()?this.xhr_.getResponseHeader(a):void 0};goog.net.XhrIo.prototype.getAllResponseHeaders=function(){return this.xhr_&&this.isComplete()?this.xhr_.getAllResponseHeaders():""};goog.net.XhrIo.prototype.getLastErrorCode=function(){return this.lastErrorCode_};goog.net.XhrIo.prototype.getLastError=function(){return goog.isString(this.lastError_)?this.lastError_:String(this.lastError_)};
goog.net.XhrIo.prototype.formatMsg_=function(a){return a+" ["+this.lastMethod_+" "+this.lastUri_+" "+this.getStatus()+"]"};goog.debug.entryPointRegistry.register(function(a){goog.net.XhrIo.prototype.onReadyStateChangeEntryPoint_=a(goog.net.XhrIo.prototype.onReadyStateChangeEntryPoint_)});goog.math.randomInt=function(a){return Math.floor(Math.random()*a)};goog.math.uniformRandom=function(a,b){return a+Math.random()*(b-a)};goog.math.clamp=function(a,b,c){return Math.min(Math.max(a,b),c)};goog.math.modulo=function(a,b){var c=a%b;return c*b<0?c+b:c};goog.math.lerp=function(a,b,c){return a+c*(b-a)};goog.math.nearlyEquals=function(a,b,c){return Math.abs(a-b)<=(c||1.0E-6)};goog.math.standardAngle=function(a){return goog.math.modulo(a,360)};
goog.math.toRadians=function(a){return a*Math.PI/180};goog.math.toDegrees=function(a){return a*180/Math.PI};goog.math.angleDx=function(a,b){return b*Math.cos(goog.math.toRadians(a))};goog.math.angleDy=function(a,b){return b*Math.sin(goog.math.toRadians(a))};goog.math.angle=function(a,b,c,d){return goog.math.standardAngle(goog.math.toDegrees(Math.atan2(d-b,c-a)))};goog.math.angleDifference=function(a,b){var c=goog.math.standardAngle(b)-goog.math.standardAngle(a);c>180?c-=360:c<=-180&&(c=360+c);return c};
goog.math.sign=function(a){return a==0?0:a<0?-1:1};goog.math.longestCommonSubsequence=function(a,b,c,d){c=c||function(a,b){return a==b};d=d||function(b){return a[b]};for(var e=a.length,f=b.length,g=[],h=0;h<e+1;h++)g[h]=[],g[h][0]=0;for(var i=0;i<f+1;i++)g[0][i]=0;for(h=1;h<=e;h++)for(i=1;i<=e;i++)g[h][i]=c(a[h-1],b[i-1])?g[h-1][i-1]+1:Math.max(g[h-1][i],g[h][i-1]);var j=[];h=e;for(i=f;h>0&&i>0;)c(a[h-1],b[i-1])?(j.unshift(d(h-1,i-1)),h--,i--):g[h-1][i]>g[h][i-1]?h--:i--;return j};
goog.math.sum=function(){return goog.array.reduce(arguments,function(a,b){return a+b},0)};goog.math.average=function(){return goog.math.sum.apply(null,arguments)/arguments.length};goog.math.standardDeviation=function(){var a=arguments.length;if(a<2)return 0;var b=goog.math.average.apply(null,arguments);a=goog.math.sum.apply(null,goog.array.map(arguments,function(a){return Math.pow(a-b,2)}))/(a-1);return Math.sqrt(a)};goog.math.isInt=function(a){return isFinite(a)&&a%1==0};
goog.math.isFiniteNumber=function(a){return isFinite(a)&&!isNaN(a)};goog.Uri=function(a,b){var c;a instanceof goog.Uri?(this.setIgnoreCase(b==null?a.getIgnoreCase():b),this.setScheme(a.getScheme()),this.setUserInfo(a.getUserInfo()),this.setDomain(a.getDomain()),this.setPort(a.getPort()),this.setPath(a.getPath()),this.setQueryData(a.getQueryData().clone()),this.setFragment(a.getFragment())):a&&(c=goog.uri.utils.split(String(a)))?(this.setIgnoreCase(!!b),this.setScheme(c[goog.uri.utils.ComponentIndex.SCHEME]||"",!0),this.setUserInfo(c[goog.uri.utils.ComponentIndex.USER_INFO]||
"",!0),this.setDomain(c[goog.uri.utils.ComponentIndex.DOMAIN]||"",!0),this.setPort(c[goog.uri.utils.ComponentIndex.PORT]),this.setPath(c[goog.uri.utils.ComponentIndex.PATH]||"",!0),this.setQuery(c[goog.uri.utils.ComponentIndex.QUERY_DATA]||"",!0),this.setFragment(c[goog.uri.utils.ComponentIndex.FRAGMENT]||"",!0)):(this.setIgnoreCase(!!b),this.queryData_=new goog.Uri.QueryData(null,this,this.ignoreCase_))};goog.Uri.RANDOM_PARAM=goog.uri.utils.StandardQueryParam.RANDOM;goog.Uri.prototype.scheme_="";
goog.Uri.prototype.userInfo_="";goog.Uri.prototype.domain_="";goog.Uri.prototype.port_=null;goog.Uri.prototype.path_="";goog.Uri.prototype.fragment_="";goog.Uri.prototype.isReadOnly_=!1;goog.Uri.prototype.ignoreCase_=!1;
goog.Uri.prototype.toString=function(){if(this.cachedToString_)return this.cachedToString_;var a=[];this.scheme_&&a.push(goog.Uri.encodeSpecialChars_(this.scheme_,goog.Uri.reDisallowedInSchemeOrUserInfo_),":");this.domain_&&(a.push("//"),this.userInfo_&&a.push(goog.Uri.encodeSpecialChars_(this.userInfo_,goog.Uri.reDisallowedInSchemeOrUserInfo_),"@"),a.push(goog.Uri.encodeString_(this.domain_)),this.port_!=null&&a.push(":",String(this.getPort())));this.path_&&(this.hasDomain()&&this.path_.charAt(0)!=
"/"&&a.push("/"),a.push(goog.Uri.encodeSpecialChars_(this.path_,this.path_.charAt(0)=="/"?goog.Uri.reDisallowedInAbsolutePath_:goog.Uri.reDisallowedInRelativePath_)));var b=String(this.queryData_);b&&a.push("?",b);this.fragment_&&a.push("#",goog.Uri.encodeSpecialChars_(this.fragment_,goog.Uri.reDisallowedInFragment_));return this.cachedToString_=a.join("")};
goog.Uri.prototype.resolve=function(a){var b=this.clone(),c=a.hasScheme();c?b.setScheme(a.getScheme()):c=a.hasUserInfo();c?b.setUserInfo(a.getUserInfo()):c=a.hasDomain();c?b.setDomain(a.getDomain()):c=a.hasPort();var d=a.getPath();if(c)b.setPort(a.getPort());else if(c=a.hasPath()){if(d.charAt(0)!="/")if(this.hasDomain()&&!this.hasPath())d="/"+d;else{var e=b.getPath().lastIndexOf("/");e!=-1&&(d=b.getPath().substr(0,e+1)+d)}d=goog.Uri.removeDotSegments(d)}c?b.setPath(d):c=a.hasQuery();c?b.setQuery(a.getDecodedQuery()):
c=a.hasFragment();c&&b.setFragment(a.getFragment());return b};goog.Uri.prototype.clone=function(){return goog.Uri.create(this.scheme_,this.userInfo_,this.domain_,this.port_,this.path_,this.queryData_.clone(),this.fragment_,this.ignoreCase_)};goog.Uri.prototype.getScheme=function(){return this.scheme_};goog.Uri.prototype.setScheme=function(a,b){this.enforceReadOnly();delete this.cachedToString_;if(this.scheme_=b?goog.Uri.decodeOrEmpty_(a):a)this.scheme_=this.scheme_.replace(/:$/,"");return this};
goog.Uri.prototype.hasScheme=function(){return!!this.scheme_};goog.Uri.prototype.getUserInfo=function(){return this.userInfo_};goog.Uri.prototype.setUserInfo=function(a,b){this.enforceReadOnly();delete this.cachedToString_;this.userInfo_=b?goog.Uri.decodeOrEmpty_(a):a;return this};goog.Uri.prototype.hasUserInfo=function(){return!!this.userInfo_};goog.Uri.prototype.getDomain=function(){return this.domain_};
goog.Uri.prototype.setDomain=function(a,b){this.enforceReadOnly();delete this.cachedToString_;this.domain_=b?goog.Uri.decodeOrEmpty_(a):a;return this};goog.Uri.prototype.hasDomain=function(){return!!this.domain_};goog.Uri.prototype.getPort=function(){return this.port_};goog.Uri.prototype.setPort=function(a){this.enforceReadOnly();delete this.cachedToString_;if(a){a=Number(a);if(isNaN(a)||a<0)throw Error("Bad port number "+a);this.port_=a}else this.port_=null;return this};
goog.Uri.prototype.hasPort=function(){return this.port_!=null};goog.Uri.prototype.getPath=function(){return this.path_};goog.Uri.prototype.setPath=function(a,b){this.enforceReadOnly();delete this.cachedToString_;this.path_=b?goog.Uri.decodeOrEmpty_(a):a;return this};goog.Uri.prototype.hasPath=function(){return!!this.path_};goog.Uri.prototype.hasQuery=function(){return this.queryData_.toString()!==""};
goog.Uri.prototype.setQueryData=function(a,b){this.enforceReadOnly();delete this.cachedToString_;a instanceof goog.Uri.QueryData?(this.queryData_=a,this.queryData_.uri_=this,this.queryData_.setIgnoreCase(this.ignoreCase_)):(b||(a=goog.Uri.encodeSpecialChars_(a,goog.Uri.reDisallowedInQuery_)),this.queryData_=new goog.Uri.QueryData(a,this,this.ignoreCase_));return this};goog.Uri.prototype.setQuery=function(a,b){return this.setQueryData(a,b)};goog.Uri.prototype.getEncodedQuery=function(){return this.queryData_.toString()};
goog.Uri.prototype.getDecodedQuery=function(){return this.queryData_.toDecodedString()};goog.Uri.prototype.getQueryData=function(){return this.queryData_};goog.Uri.prototype.getQuery=function(){return this.getEncodedQuery()};goog.Uri.prototype.setParameterValue=function(a,b){this.enforceReadOnly();delete this.cachedToString_;this.queryData_.set(a,b);return this};
goog.Uri.prototype.setParameterValues=function(a,b){this.enforceReadOnly();delete this.cachedToString_;goog.isArray(b)||(b=[String(b)]);this.queryData_.setValues(a,b);return this};goog.Uri.prototype.getParameterValues=function(a){return this.queryData_.getValues(a)};goog.Uri.prototype.getParameterValue=function(a){return this.queryData_.get(a)};goog.Uri.prototype.getFragment=function(){return this.fragment_};
goog.Uri.prototype.setFragment=function(a,b){this.enforceReadOnly();delete this.cachedToString_;this.fragment_=b?goog.Uri.decodeOrEmpty_(a):a;return this};goog.Uri.prototype.hasFragment=function(){return!!this.fragment_};goog.Uri.prototype.hasSameDomainAs=function(a){return(!this.hasDomain()&&!a.hasDomain()||this.getDomain()==a.getDomain())&&(!this.hasPort()&&!a.hasPort()||this.getPort()==a.getPort())};
goog.Uri.prototype.makeUnique=function(){this.enforceReadOnly();this.setParameterValue(goog.Uri.RANDOM_PARAM,goog.string.getRandomString());return this};goog.Uri.prototype.removeParameter=function(a){this.enforceReadOnly();this.queryData_.remove(a);return this};goog.Uri.prototype.setReadOnly=function(a){this.isReadOnly_=a;return this};goog.Uri.prototype.isReadOnly=function(){return this.isReadOnly_};
goog.Uri.prototype.enforceReadOnly=function(){if(this.isReadOnly_)throw Error("Tried to modify a read-only Uri");};goog.Uri.prototype.setIgnoreCase=function(a){this.ignoreCase_=a;this.queryData_&&this.queryData_.setIgnoreCase(a);return this};goog.Uri.prototype.getIgnoreCase=function(){return this.ignoreCase_};goog.Uri.parse=function(a,b){return a instanceof goog.Uri?a.clone():new goog.Uri(a,b)};
goog.Uri.create=function(a,b,c,d,e,f,g,h){h=new goog.Uri(null,h);a&&h.setScheme(a);b&&h.setUserInfo(b);c&&h.setDomain(c);d&&h.setPort(d);e&&h.setPath(e);f&&h.setQueryData(f);g&&h.setFragment(g);return h};goog.Uri.resolve=function(a,b){a instanceof goog.Uri||(a=goog.Uri.parse(a));b instanceof goog.Uri||(b=goog.Uri.parse(b));return a.resolve(b)};
goog.Uri.removeDotSegments=function(a){if(a==".."||a==".")return"";else if(!goog.string.contains(a,"./")&&!goog.string.contains(a,"/."))return a;else{var b=goog.string.startsWith(a,"/");a=a.split("/");for(var c=[],d=0;d<a.length;){var e=a[d++];e=="."?b&&d==a.length&&c.push(""):e==".."?((c.length>1||c.length==1&&c[0]!="")&&c.pop(),b&&d==a.length&&c.push("")):(c.push(e),b=!0)}return c.join("/")}};goog.Uri.decodeOrEmpty_=function(a){return a?decodeURIComponent(a):""};
goog.Uri.encodeString_=function(a){if(goog.isString(a))return encodeURIComponent(a);return null};goog.Uri.encodeSpecialRegExp_=/^[a-zA-Z0-9\-_.!~*'():\/;?]*$/;goog.Uri.encodeSpecialChars_=function(a,b){var c=null;goog.isString(a)&&(c=a,goog.Uri.encodeSpecialRegExp_.test(c)||(c=encodeURI(a)),c.search(b)>=0&&(c=c.replace(b,goog.Uri.encodeChar_)));return c};goog.Uri.encodeChar_=function(a){a=a.charCodeAt(0);return"%"+(a>>4&15).toString(16)+(a&15).toString(16)};
goog.Uri.reDisallowedInSchemeOrUserInfo_=/[#\/\?@]/g;goog.Uri.reDisallowedInRelativePath_=/[\#\?:]/g;goog.Uri.reDisallowedInAbsolutePath_=/[\#\?]/g;goog.Uri.reDisallowedInQuery_=/[\#\?@]/g;goog.Uri.reDisallowedInFragment_=/#/g;goog.Uri.haveSameDomain=function(a,b){var c=goog.uri.utils.split(a),d=goog.uri.utils.split(b);return c[goog.uri.utils.ComponentIndex.DOMAIN]==d[goog.uri.utils.ComponentIndex.DOMAIN]&&c[goog.uri.utils.ComponentIndex.PORT]==d[goog.uri.utils.ComponentIndex.PORT]};
goog.Uri.QueryData=function(a,b,c){this.encodedQuery_=a||null;this.uri_=b||null;this.ignoreCase_=!!c};goog.Uri.QueryData.prototype.ensureKeyMapInitialized_=function(){if(!this.keyMap_&&(this.keyMap_=new goog.structs.Map,this.count_=0,this.encodedQuery_))for(var a=this.encodedQuery_.split("&"),b=0;b<a.length;b++){var c=a[b].indexOf("="),d=null,e=null;c>=0?(d=a[b].substring(0,c),e=a[b].substring(c+1)):d=a[b];d=goog.string.urlDecode(d);d=this.getKeyName_(d);this.add(d,e?goog.string.urlDecode(e):"")}};
goog.Uri.QueryData.createFromMap=function(a,b,c){var d=goog.structs.getKeys(a);if(typeof d=="undefined")throw Error("Keys are undefined");return goog.Uri.QueryData.createFromKeysValues(d,goog.structs.getValues(a),b,c)};goog.Uri.QueryData.createFromKeysValues=function(a,b,c,d){if(a.length!=b.length)throw Error("Mismatched lengths for keys/values");c=new goog.Uri.QueryData(null,c,d);for(d=0;d<a.length;d++)c.add(a[d],b[d]);return c};goog.Uri.QueryData.prototype.keyMap_=null;
goog.Uri.QueryData.prototype.count_=null;goog.Uri.QueryData.decodedQuery_=null;goog.Uri.QueryData.prototype.getCount=function(){this.ensureKeyMapInitialized_();return this.count_};goog.Uri.QueryData.prototype.add=function(a,b){this.ensureKeyMapInitialized_();this.invalidateCache_();a=this.getKeyName_(a);if(this.containsKey(a)){var c=this.keyMap_.get(a);goog.isArray(c)?c.push(b):this.keyMap_.set(a,[c,b])}else this.keyMap_.set(a,b);this.count_++;return this};
goog.Uri.QueryData.prototype.remove=function(a){this.ensureKeyMapInitialized_();a=this.getKeyName_(a);if(this.keyMap_.containsKey(a)){this.invalidateCache_();var b=this.keyMap_.get(a);goog.isArray(b)?this.count_-=b.length:this.count_--;return this.keyMap_.remove(a)}return!1};goog.Uri.QueryData.prototype.clear=function(){this.invalidateCache_();this.keyMap_&&this.keyMap_.clear();this.count_=0};goog.Uri.QueryData.prototype.isEmpty=function(){this.ensureKeyMapInitialized_();return this.count_==0};
goog.Uri.QueryData.prototype.containsKey=function(a){this.ensureKeyMapInitialized_();a=this.getKeyName_(a);return this.keyMap_.containsKey(a)};goog.Uri.QueryData.prototype.containsValue=function(a){var b=this.getValues();return goog.array.contains(b,a)};goog.Uri.QueryData.prototype.getKeys=function(){this.ensureKeyMapInitialized_();for(var a=this.keyMap_.getValues(),b=this.keyMap_.getKeys(),c=[],d=0;d<b.length;d++){var e=a[d];if(goog.isArray(e))for(var f=0;f<e.length;f++)c.push(b[d]);else c.push(b[d])}return c};
goog.Uri.QueryData.prototype.getValues=function(a){this.ensureKeyMapInitialized_();if(a)if(a=this.getKeyName_(a),this.containsKey(a)){var b=this.keyMap_.get(a);if(goog.isArray(b))return b;else a=[],a.push(b)}else a=[];else{b=this.keyMap_.getValues();a=[];for(var c=0;c<b.length;c++){var d=b[c];goog.isArray(d)?goog.array.extend(a,d):a.push(d)}}return a};
goog.Uri.QueryData.prototype.set=function(a,b){this.ensureKeyMapInitialized_();this.invalidateCache_();a=this.getKeyName_(a);if(this.containsKey(a)){var c=this.keyMap_.get(a);goog.isArray(c)?this.count_-=c.length:this.count_--}this.keyMap_.set(a,b);this.count_++;return this};goog.Uri.QueryData.prototype.get=function(a,b){this.ensureKeyMapInitialized_();a=this.getKeyName_(a);if(this.containsKey(a)){var c=this.keyMap_.get(a);return goog.isArray(c)?c[0]:c}else return b};
goog.Uri.QueryData.prototype.setValues=function(a,b){this.ensureKeyMapInitialized_();this.invalidateCache_();a=this.getKeyName_(a);if(this.containsKey(a)){var c=this.keyMap_.get(a);goog.isArray(c)?this.count_-=c.length:this.count_--}b.length>0&&(this.keyMap_.set(a,b),this.count_+=b.length)};
goog.Uri.QueryData.prototype.toString=function(){if(this.encodedQuery_)return this.encodedQuery_;if(!this.keyMap_)return"";for(var a=[],b=0,c=this.keyMap_.getKeys(),d=0;d<c.length;d++){var e=c[d],f=goog.string.urlEncode(e);e=this.keyMap_.get(e);if(goog.isArray(e))for(var g=0;g<e.length;g++)b>0&&a.push("&"),a.push(f),e[g]!==""&&a.push("=",goog.string.urlEncode(e[g])),b++;else b>0&&a.push("&"),a.push(f),e!==""&&a.push("=",goog.string.urlEncode(e)),b++}return this.encodedQuery_=a.join("")};
goog.Uri.QueryData.prototype.toDecodedString=function(){if(!this.decodedQuery_)this.decodedQuery_=goog.Uri.decodeOrEmpty_(this.toString());return this.decodedQuery_};goog.Uri.QueryData.prototype.invalidateCache_=function(){delete this.decodedQuery_;delete this.encodedQuery_;this.uri_&&delete this.uri_.cachedToString_};goog.Uri.QueryData.prototype.filterKeys=function(a){this.ensureKeyMapInitialized_();goog.structs.forEach(this.keyMap_,function(b,c){goog.array.contains(a,c)||this.remove(c)},this);return this};
goog.Uri.QueryData.prototype.clone=function(){var a=new goog.Uri.QueryData;if(this.decodedQuery_)a.decodedQuery_=this.decodedQuery_;if(this.encodedQuery_)a.encodedQuery_=this.encodedQuery_;if(this.keyMap_)a.keyMap_=this.keyMap_.clone();return a};goog.Uri.QueryData.prototype.getKeyName_=function(a){a=String(a);this.ignoreCase_&&(a=a.toLowerCase());return a};
goog.Uri.QueryData.prototype.setIgnoreCase=function(a){a&&!this.ignoreCase_&&(this.ensureKeyMapInitialized_(),this.invalidateCache_(),goog.structs.forEach(this.keyMap_,function(a,c){var d=c.toLowerCase();c!=d&&(this.remove(c),this.add(d,a))},this));this.ignoreCase_=a};goog.Uri.QueryData.prototype.extend=function(){for(var a=0;a<arguments.length;a++)goog.structs.forEach(arguments[a],function(a,c){this.add(c,a)},this)};goog.net.IframeIo=function(){this.name_=goog.net.IframeIo.getNextName_();this.iframesForDisposal_=[];goog.net.IframeIo.instances_[this.name_]=this};goog.inherits(goog.net.IframeIo,goog.events.EventTarget);goog.net.IframeIo.instances_={};goog.net.IframeIo.FRAME_NAME_PREFIX="closure_frame";goog.net.IframeIo.INNER_FRAME_SUFFIX="_inner";goog.net.IframeIo.IFRAME_DISPOSE_DELAY_MS=2E3;goog.net.IframeIo.counter_=0;
goog.net.IframeIo.send=function(a,b,c,d,e){var f=new goog.net.IframeIo;goog.events.listen(f,goog.net.EventType.READY,f.dispose,!1,f);b&&goog.events.listen(f,goog.net.EventType.COMPLETE,b);f.send(a,c,d,e)};goog.net.IframeIo.getIframeByName=function(a){return window.frames[a]};goog.net.IframeIo.getInstanceByName=function(a){return goog.net.IframeIo.instances_[a]};
goog.net.IframeIo.handleIncrementalData=function(a,b){var c=goog.string.endsWith(a.name,goog.net.IframeIo.INNER_FRAME_SUFFIX)?a.parent.name:a.name,d=c.substring(0,c.lastIndexOf("_"));(d=goog.net.IframeIo.getInstanceByName(d))&&c==d.iframeName_?d.handleIncrementalData_(b):goog.debug.Logger.getLogger("goog.net.IframeIo").info("Incremental iframe data routed for unknown iframe")};goog.net.IframeIo.getNextName_=function(){return goog.net.IframeIo.FRAME_NAME_PREFIX+goog.net.IframeIo.counter_++};
goog.net.IframeIo.getForm_=function(){if(!goog.net.IframeIo.form_){goog.net.IframeIo.form_=goog.dom.createDom("form");goog.net.IframeIo.form_.acceptCharset="utf-8";var a=goog.net.IframeIo.form_.style;a.position="absolute";a.visibility="hidden";a.top=a.left="-10px";a.width=a.height="10px";a.overflow="hidden";goog.dom.getDocument().body.appendChild(goog.net.IframeIo.form_)}return goog.net.IframeIo.form_};
goog.net.IframeIo.addFormInputs_=function(a,b){goog.structs.forEach(b,function(b,d){var e=goog.dom.createDom("input",{type:"hidden",name:d,value:b});a.appendChild(e)})};goog.net.IframeIo.prototype.logger_=goog.debug.Logger.getLogger("goog.net.IframeIo");goog.net.IframeIo.prototype.form_=null;goog.net.IframeIo.prototype.iframe_=null;goog.net.IframeIo.prototype.iframeName_=null;goog.net.IframeIo.prototype.nextIframeId_=0;goog.net.IframeIo.prototype.active_=!1;goog.net.IframeIo.prototype.complete_=!1;
goog.net.IframeIo.prototype.success_=!1;goog.net.IframeIo.prototype.lastUri_=null;goog.net.IframeIo.prototype.lastContent_=null;goog.net.IframeIo.prototype.lastErrorCode_=goog.net.ErrorCode.NO_ERROR;goog.net.IframeIo.prototype.timeoutInterval_=0;goog.net.IframeIo.prototype.timeoutId_=null;goog.net.IframeIo.prototype.firefoxSilentErrorTimeout_=null;goog.net.IframeIo.prototype.iframeDisposalTimer_=null;
goog.net.IframeIo.prototype.send=function(a,b,c,d){if(this.active_)throw Error("[goog.net.IframeIo] Unable to send, already active.");this.lastUri_=a=new goog.Uri(a);b=b?b.toUpperCase():"GET";c&&a.makeUnique();this.logger_.info("Sending iframe request: "+a+" ["+b+"]");this.form_=goog.net.IframeIo.getForm_();b=="GET"&&goog.net.IframeIo.addFormInputs_(this.form_,a.getQueryData());d&&goog.net.IframeIo.addFormInputs_(this.form_,d);this.form_.action=a.toString();this.form_.method=b;this.sendFormInternal_()};
goog.net.IframeIo.prototype.sendFromForm=function(a,b,c){if(this.active_)throw Error("[goog.net.IframeIo] Unable to send, already active.");b=new goog.Uri(b||a.action);c&&b.makeUnique();this.logger_.info("Sending iframe request from form: "+b);this.lastUri_=b;this.form_=a;this.form_.action=b.toString();this.sendFormInternal_()};
goog.net.IframeIo.prototype.abort=function(a){if(this.active_)this.logger_.info("Request aborted"),goog.events.removeAll(this.getRequestIframe_()),this.success_=this.active_=this.complete_=!1,this.lastErrorCode_=a||goog.net.ErrorCode.ABORT,this.dispatchEvent(goog.net.EventType.ABORT),this.makeReady_()};
goog.net.IframeIo.prototype.disposeInternal=function(){this.logger_.fine("Disposing iframeIo instance");this.active_&&(this.logger_.fine("Aborting active request"),this.abort());goog.net.IframeIo.superClass_.disposeInternal.call(this);this.iframe_&&this.scheduleIframeDisposal_();this.disposeForm_();delete this.errorChecker_;this.lastUri_=this.lastCustomError_=this.lastContent_=this.lastContentHtml_=this.form_=null;this.lastErrorCode_=goog.net.ErrorCode.NO_ERROR;delete goog.net.IframeIo.instances_[this.name_]};
goog.net.IframeIo.prototype.isComplete=function(){return this.complete_};goog.net.IframeIo.prototype.isSuccess=function(){return this.success_};goog.net.IframeIo.prototype.isActive=function(){return this.active_};goog.net.IframeIo.prototype.getResponseText=function(){return this.lastContent_};goog.net.IframeIo.prototype.getResponseHtml=function(){return this.lastContentHtml_};goog.net.IframeIo.prototype.getResponseJson=function(){return goog.json.parse(this.lastContent_)};
goog.net.IframeIo.prototype.getResponseXml=function(){if(!this.iframe_)return null;return this.getContentDocument_()};goog.net.IframeIo.prototype.getLastUri=function(){return this.lastUri_};goog.net.IframeIo.prototype.getLastErrorCode=function(){return this.lastErrorCode_};goog.net.IframeIo.prototype.getLastError=function(){return goog.net.ErrorCode.getDebugMessage(this.lastErrorCode_)};goog.net.IframeIo.prototype.getLastCustomError=function(){return this.lastCustomError_};
goog.net.IframeIo.prototype.setErrorChecker=function(a){this.errorChecker_=a};goog.net.IframeIo.prototype.getErrorChecker=function(){return this.errorChecker_};goog.net.IframeIo.prototype.getTimeoutInterval=function(){return this.timeoutInterval_};goog.net.IframeIo.prototype.setTimeoutInterval=function(a){this.timeoutInterval_=Math.max(0,a)};
goog.net.IframeIo.prototype.dispatchEvent=function(a){this.iframe_&&goog.net.xhrMonitor.pushContext(this.iframe_);try{return goog.net.IframeIo.superClass_.dispatchEvent.call(this,a)}finally{return this.iframe_&&goog.net.xhrMonitor.popContext(),!0}};
goog.net.IframeIo.prototype.sendFormInternal_=function(){this.active_=!0;this.complete_=!1;this.lastErrorCode_=goog.net.ErrorCode.NO_ERROR;this.createIframe_();if(goog.userAgent.IE){this.form_.target=this.iframeName_||"";this.appendIframe_();goog.events.listen(this.iframe_,goog.events.EventType.READYSTATECHANGE,this.onIeReadyStateChange_,!1,this);try{this.errorHandled_=!1,this.form_.submit()}catch(a){goog.events.unlisten(this.iframe_,goog.events.EventType.READYSTATECHANGE,this.onIeReadyStateChange_,
!1,this),this.handleError_(goog.net.ErrorCode.ACCESS_DENIED)}}else{this.logger_.fine("Setting up iframes and cloning form");this.appendIframe_();var b=this.iframeName_+goog.net.IframeIo.INNER_FRAME_SUFFIX,c=goog.dom.getFrameContentDocument(this.iframe_),d="<body><iframe id="+b+" name="+b+"></iframe>";document.baseURI&&(d='<head><base href="'+goog.string.htmlEscape(document.baseURI)+'"></head>'+d);goog.userAgent.OPERA?c.documentElement.innerHTML=d:c.write(d);goog.events.listen(c.getElementById(b),
goog.events.EventType.LOAD,this.onIframeLoaded_,!1,this);var e=this.form_.getElementsByTagName("textarea");d=0;for(var f=e.length;d<f;d++){var g=e[d].value;if(goog.dom.getRawTextContent(e[d])!=g)goog.dom.setTextContent(e[d],g),e[d].value=g}e=c.importNode(this.form_,!0);e.target=b;e.action=this.form_.action;c.body.appendChild(e);g=this.form_.getElementsByTagName("select");var h=e.getElementsByTagName("select");d=0;for(f=g.length;d<f;d++)for(var i=g[d].getElementsByTagName("option"),j=h[d].getElementsByTagName("option"),
k=0,l=i.length;k<l;k++)j[k].selected=i[k].selected;g=this.form_.getElementsByTagName("input");h=e.getElementsByTagName("input");d=0;for(f=g.length;d<f;d++)if(g[d].type=="file"&&g[d].value!=h[d].value){this.logger_.fine("File input value not cloned properly.  Will submit using original form.");this.form_.target=b;e=this.form_;break}this.logger_.fine("Submitting form");try{if(this.errorHandled_=!1,e.submit(),c.close(),goog.userAgent.GECKO)this.firefoxSilentErrorTimeout_=goog.Timer.callOnce(this.testForFirefoxSilentError_,
250,this)}catch(m){this.logger_.severe("Error when submitting form: "+goog.debug.exposeException(m)),goog.events.unlisten(c.getElementById(b),goog.events.EventType.LOAD,this.onIframeLoaded_,!1,this),c.close(),this.handleError_(goog.net.ErrorCode.FILE_NOT_FOUND)}}};
goog.net.IframeIo.prototype.onIeReadyStateChange_=function(){if(this.iframe_.readyState=="complete"){goog.events.unlisten(this.iframe_,goog.events.EventType.READYSTATECHANGE,this.onIeReadyStateChange_,!1,this);var a;try{if(a=goog.dom.getFrameContentDocument(this.iframe_),goog.userAgent.IE&&a.location=="about:blank"&&!navigator.onLine){this.handleError_(goog.net.ErrorCode.OFFLINE);return}}catch(b){this.handleError_(goog.net.ErrorCode.ACCESS_DENIED);return}this.handleLoad_(a)}};
goog.net.IframeIo.prototype.onIframeLoaded_=function(){goog.userAgent.OPERA&&this.getContentDocument_().location=="about:blank"||(goog.events.unlisten(this.getRequestIframe_(),goog.events.EventType.LOAD,this.onIframeLoaded_,!1,this),this.handleLoad_(this.getContentDocument_()))};
goog.net.IframeIo.prototype.handleLoad_=function(a){this.logger_.fine("Iframe loaded");this.complete_=!0;this.active_=!1;var b;try{var c=a.body;this.lastContent_=c.textContent||c.innerText;this.lastContentHtml_=c.innerHTML}catch(d){b=goog.net.ErrorCode.ACCESS_DENIED}var e;if(!b&&typeof this.errorChecker_=="function"&&(e=this.errorChecker_(a)))b=goog.net.ErrorCode.CUSTOM_ERROR;this.logger_.finer("Last content: "+this.lastContent_);this.logger_.finer("Last uri: "+this.lastUri_);b?(this.logger_.fine("Load event occurred but failed"),
this.handleError_(b,e)):(this.logger_.fine("Load succeeded"),this.success_=!0,this.lastErrorCode_=goog.net.ErrorCode.NO_ERROR,this.dispatchEvent(goog.net.EventType.COMPLETE),this.dispatchEvent(goog.net.EventType.SUCCESS),this.makeReady_())};
goog.net.IframeIo.prototype.handleError_=function(a,b){if(!this.errorHandled_){this.active_=this.success_=!1;this.complete_=!0;this.lastErrorCode_=a;if(a==goog.net.ErrorCode.CUSTOM_ERROR)this.lastCustomError_=b;this.dispatchEvent(goog.net.EventType.COMPLETE);this.dispatchEvent(goog.net.EventType.ERROR);this.makeReady_();this.errorHandled_=!0}};goog.net.IframeIo.prototype.handleIncrementalData_=function(a){this.dispatchEvent(new goog.net.IframeIo.IncrementalDataEvent(a))};
goog.net.IframeIo.prototype.makeReady_=function(){this.logger_.info("Ready for new requests");var a=this.iframe_;this.scheduleIframeDisposal_();this.disposeForm_();goog.net.xhrMonitor.pushContext(a);try{this.dispatchEvent(goog.net.EventType.READY)}finally{goog.net.xhrMonitor.popContext()}};
goog.net.IframeIo.prototype.createIframe_=function(){this.logger_.fine("Creating iframe");this.iframeName_=this.name_+"_"+(this.nextIframeId_++).toString(36);var a={name:this.iframeName_,id:this.iframeName_};if(goog.userAgent.IE&&goog.userAgent.VERSION<7)a.src='javascript:""';this.iframe_=goog.dom.createDom("iframe",a);a=this.iframe_.style;a.visibility="hidden";a.width=a.height="10px";goog.userAgent.WEBKIT?a.marginTop=a.marginLeft="-10px":(a.position="absolute",a.top=a.left="-10px")};
goog.net.IframeIo.prototype.appendIframe_=function(){goog.dom.getDocument().body.appendChild(this.iframe_)};
goog.net.IframeIo.prototype.scheduleIframeDisposal_=function(){var a=this.iframe_;if(a)a.onreadystatechange=null,a.onload=null,a.onerror=null,this.iframesForDisposal_.push(a);if(this.iframeDisposalTimer_)goog.Timer.clear(this.iframeDisposalTimer_),this.iframeDisposalTimer_=null;goog.userAgent.GECKO||goog.userAgent.OPERA?this.iframeDisposalTimer_=goog.Timer.callOnce(this.disposeIframes_,goog.net.IframeIo.IFRAME_DISPOSE_DELAY_MS,this):this.disposeIframes_();this.iframeName_=this.iframe_=null};
goog.net.IframeIo.prototype.disposeIframes_=function(){if(this.iframeDisposalTimer_)goog.Timer.clear(this.iframeDisposalTimer_),this.iframeDisposalTimer_=null;for(var a=0;a<this.iframesForDisposal_.length;){var b=this.iframesForDisposal_[a];goog.net.xhrMonitor.isContextSafe(b)?(this.logger_.info("Disposing iframe"),goog.array.removeAt(this.iframesForDisposal_,a),goog.dom.removeNode(b)):a++}if(this.iframesForDisposal_.length!=0)this.logger_.info("Requests outstanding, waiting to dispose"),this.iframeDisposalTimer_=
goog.Timer.callOnce(this.disposeIframes_,goog.net.IframeIo.IFRAME_DISPOSE_DELAY_MS,this)};goog.net.IframeIo.prototype.disposeForm_=function(){this.form_&&this.form_==goog.net.IframeIo.form_&&goog.dom.removeChildren(this.form_);this.form_=null};goog.net.IframeIo.prototype.getContentDocument_=function(){if(this.iframe_)return goog.dom.getFrameContentDocument(this.getRequestIframe_());return null};
goog.net.IframeIo.prototype.getRequestIframe_=function(){if(this.iframe_)return goog.userAgent.IE?this.iframe_:goog.dom.getFrameContentDocument(this.iframe_).getElementById(this.iframeName_+goog.net.IframeIo.INNER_FRAME_SUFFIX);return null};
goog.net.IframeIo.prototype.testForFirefoxSilentError_=function(){if(this.active_){var a=this.getContentDocument_();a&&!goog.reflect.canAccessProperty(a,"documentUri")?(goog.events.unlisten(this.getRequestIframe_(),goog.events.EventType.LOAD,this.onIframeLoaded_,!1,this),navigator.onLine?(this.logger_.warning("Silent Firefox error detected"),this.handleError_(goog.net.ErrorCode.FF_SILENT_ERROR)):(this.logger_.warning("Firefox is offline so report offline error instead of silent error"),this.handleError_(goog.net.ErrorCode.OFFLINE))):
this.firefoxSilentErrorTimeout_=goog.Timer.callOnce(this.testForFirefoxSilentError_,250,this)}};goog.net.IframeIo.IncrementalDataEvent=function(a){goog.events.Event.call(this,goog.net.EventType.INCREMENTAL_DATA);this.data=a};goog.inherits(goog.net.IframeIo.IncrementalDataEvent,goog.events.Event);goog.editor.plugins.AbstractTabHandler=function(){goog.editor.Plugin.call(this)};goog.inherits(goog.editor.plugins.AbstractTabHandler,goog.editor.Plugin);goog.editor.plugins.AbstractTabHandler.prototype.handleKeyboardShortcut=function(a){if(goog.userAgent.GECKO&&this.fieldObject.inModalMode())return!1;if(a.keyCode==goog.events.KeyCodes.TAB&&!a.metaKey&&!a.ctrlKey)return this.handleTabKey(a);return!1};goog.editor.plugins.SpacesTabHandler=function(){goog.editor.plugins.AbstractTabHandler.call(this)};goog.inherits(goog.editor.plugins.SpacesTabHandler,goog.editor.plugins.AbstractTabHandler);goog.editor.plugins.SpacesTabHandler.prototype.getTrogClassId=function(){return"SpacesTabHandler"};
goog.editor.plugins.SpacesTabHandler.prototype.handleTabKey=function(a){var b=this.getFieldDomHelper(),c=this.fieldObject.getRange();if(!goog.editor.range.intersectsTag(c,goog.dom.TagName.LI))return a.shiftKey||(this.fieldObject.stopChangeEvents(!0,!0),c.isCollapsed()||(b.getDocument().execCommand("delete",!1,null),c=this.fieldObject.getRange()),b=b.createDom("span",null,"\u00a0\u00a0 \u00a0"),b=c.insertNode(b,!1),this.fieldObject.dispatchChange(),goog.editor.range.placeCursorNextTo(b,!1),this.fieldObject.dispatchSelectionChangeEvent()),
a.preventDefault(),!0;return!1};goog.editor.plugins.ListTabHandler=function(){goog.editor.plugins.AbstractTabHandler.call(this)};goog.inherits(goog.editor.plugins.ListTabHandler,goog.editor.plugins.AbstractTabHandler);goog.editor.plugins.ListTabHandler.prototype.getTrogClassId=function(){return"ListTabHandler"};
goog.editor.plugins.ListTabHandler.prototype.handleTabKey=function(a){var b=this.fieldObject.getRange();if(goog.dom.getAncestorByTagNameAndClass(b.getContainerElement(),goog.dom.TagName.LI)||goog.iter.some(b,function(a){return a.tagName==goog.dom.TagName.LI}))return this.fieldObject.execCommand(a.shiftKey?goog.editor.Command.OUTDENT:goog.editor.Command.INDENT),a.preventDefault(),!0;return!1};goog.dom.forms={};goog.dom.forms.getFormDataMap=function(a){var b=new goog.structs.Map;goog.dom.forms.getFormDataHelper_(a,b,goog.dom.forms.addFormDataToMap_);return b};goog.dom.forms.getFormDataString=function(a){var b=[];goog.dom.forms.getFormDataHelper_(a,b,goog.dom.forms.addFormDataToStringBuffer_);return b.join("&")};
goog.dom.forms.getFormDataHelper_=function(a,b,c){for(var d=a.elements,e,f=0;e=d[f];f++)if(!(e.disabled||e.tagName.toLowerCase()=="fieldset")){var g=e.name;switch(e.type.toLowerCase()){case "file":case "submit":case "reset":case "button":break;case "select-multiple":e=goog.dom.forms.getValue(e);if(e!=null)for(var h,i=0;h=e[i];i++)c(b,g,h);break;default:h=goog.dom.forms.getValue(e),h!=null&&c(b,g,h)}}d=a.getElementsByTagName("input");for(f=0;e=d[f];f++)if(e.form==a&&e.type.toLowerCase()=="image")g=
e.name,c(b,g,e.value),c(b,g+".x","0"),c(b,g+".y","0")};goog.dom.forms.addFormDataToMap_=function(a,b,c){var d=a.get(b);d||(d=[],a.set(b,d));d.push(c)};goog.dom.forms.addFormDataToStringBuffer_=function(a,b,c){a.push(encodeURIComponent(b)+"="+encodeURIComponent(c))};goog.dom.forms.hasFileInput=function(a){a=a.elements;for(var b,c=0;b=a[c];c++)if(!b.disabled&&b.type&&b.type.toLowerCase()=="file")return!0;return!1};
goog.dom.forms.setDisabled=function(a,b){if(a.tagName=="FORM")for(var c=a.elements,d=0;a=c[d];d++)goog.dom.forms.setDisabled(a,b);else b==!0&&a.blur(),a.disabled=b};goog.dom.forms.focusAndSelect=function(a){a.focus();a.select&&a.select()};goog.dom.forms.hasValue=function(a){return!!goog.dom.forms.getValue(a)};goog.dom.forms.hasValueByName=function(a,b){return!!goog.dom.forms.getValueByName(a,b)};
goog.dom.forms.getValue=function(a){var b=a.type;if(!goog.isDef(b))return null;switch(b.toLowerCase()){case "checkbox":case "radio":return goog.dom.forms.getInputChecked_(a);case "select-one":return goog.dom.forms.getSelectSingle_(a);case "select-multiple":return goog.dom.forms.getSelectMultiple_(a);default:return goog.isDef(a.value)?a.value:null}};goog.dom.$F=goog.dom.forms.getValue;
goog.dom.forms.getValueByName=function(a,b){var c=a.elements[b];if(c.type)return goog.dom.forms.getValue(c);else{for(var d=0;d<c.length;d++){var e=goog.dom.forms.getValue(c[d]);if(e)return e}return null}};goog.dom.forms.getInputChecked_=function(a){return a.checked?a.value:null};goog.dom.forms.getSelectSingle_=function(a){var b=a.selectedIndex;return b>=0?a.options[b].value:null};
goog.dom.forms.getSelectMultiple_=function(a){for(var b=[],c,d=0;c=a.options[d];d++)c.selected&&b.push(c.value);return b.length?b:null};goog.dom.forms.setValue=function(a,b){var c=a.type;if(goog.isDef(c))switch(c.toLowerCase()){case "checkbox":case "radio":goog.dom.forms.setInputChecked_(a,b);break;case "select-one":goog.dom.forms.setSelectSingle_(a,b);break;case "select-multiple":goog.dom.forms.setSelectMultiple_(a,b);break;default:a.value=goog.isDefAndNotNull(b)?b:""}};
goog.dom.forms.setInputChecked_=function(a,b){a.checked=b?"checked":null};goog.dom.forms.setSelectSingle_=function(a,b){a.selectedIndex=-1;if(goog.isString(b))for(var c,d=0;c=a.options[d];d++)if(c.value==b){c.selected=!0;break}};goog.dom.forms.setSelectMultiple_=function(a,b){goog.isString(b)&&(b=[b]);for(var c,d=0;c=a.options[d];d++)if(c.selected=!1,b)for(var e,f=0;e=b[f];f++)if(c.value==e)c.selected=!0};goog.dom.NodeOffset=function(a,b){goog.Disposable.call(this);this.offsetStack_=[];for(this.nameStack_=[];a&&a.nodeName!=goog.dom.TagName.BODY&&a!=b;){for(var c=0,d=a.previousSibling;d;)d=d.previousSibling,++c;this.offsetStack_.unshift(c);this.nameStack_.unshift(a.nodeName);a=a.parentNode}};goog.inherits(goog.dom.NodeOffset,goog.Disposable);goog.dom.NodeOffset.prototype.toString=function(){for(var a=[],b,c=0;b=this.nameStack_[c];c++)a.push(this.offsetStack_[c]+","+b);return a.join("\n")};
goog.dom.NodeOffset.prototype.findTargetNode=function(a){for(var b=a,c=0;a=this.nameStack_[c];++c)if(b=b.childNodes[this.offsetStack_[c]],!b||b.nodeName!=a)return null;return b};goog.dom.NodeOffset.prototype.disposeInternal=function(){delete this.offsetStack_;delete this.nameStack_};goog.editor.plugins.Blockquote=function(a,b){goog.editor.Plugin.call(this);this.requiresClassNameToSplit_=a;this.className_=b||"tr_bq"};goog.inherits(goog.editor.plugins.Blockquote,goog.editor.Plugin);goog.editor.plugins.Blockquote.SPLIT_COMMAND="+splitBlockquote";goog.editor.plugins.Blockquote.CLASS_ID="Blockquote";goog.editor.plugins.Blockquote.prototype.logger=goog.debug.Logger.getLogger("goog.editor.plugins.Blockquote");goog.editor.plugins.Blockquote.prototype.getTrogClassId=function(){return goog.editor.plugins.Blockquote.CLASS_ID};
goog.editor.plugins.Blockquote.prototype.isSilentCommand=goog.functions.TRUE;goog.editor.plugins.Blockquote.isBlockquote=function(a,b,c,d){if(a.tagName!=goog.dom.TagName.BLOCKQUOTE)return!1;if(!c)return b;a=goog.dom.classes.has(a,d);return b?a:!a};goog.editor.plugins.Blockquote.prototype.isSplittableBlockquote=function(a){if(a.tagName!=goog.dom.TagName.BLOCKQUOTE)return!1;if(!this.requiresClassNameToSplit_)return!0;return goog.dom.classes.has(a,this.className_)};
goog.editor.plugins.Blockquote.prototype.isSetupBlockquote=function(a){return a.tagName==goog.dom.TagName.BLOCKQUOTE&&goog.dom.classes.has(a,this.className_)};goog.editor.plugins.Blockquote.prototype.isUnsetupBlockquote=function(a){return a.tagName==goog.dom.TagName.BLOCKQUOTE&&!this.isSetupBlockquote(a)};goog.editor.plugins.Blockquote.prototype.getBlockquoteClassName=function(){return this.className_};
goog.editor.plugins.Blockquote.findAndRemoveSingleChildAncestor_=function(a,b){var c=goog.editor.node.findHighestMatchingAncestor(a,function(a){return a!=b&&a.childNodes.length==1});c||(c=a);goog.dom.removeNode(c)};goog.editor.plugins.Blockquote.removeAllWhiteSpaceNodes_=function(a){for(var b=0;b<a.length;++b)goog.editor.node.isEmpty(a[b],!0)&&goog.dom.removeNode(a[b])};goog.editor.plugins.Blockquote.prototype.isSupportedCommand=function(a){return a==goog.editor.plugins.Blockquote.SPLIT_COMMAND};
goog.editor.plugins.Blockquote.prototype.execCommandInternal=function(a,b){if(a==goog.editor.plugins.Blockquote.SPLIT_COMMAND&&b&&(this.className_||!this.requiresClassNameToSplit_))return goog.editor.BrowserFeature.HAS_W3C_RANGES?this.splitQuotedBlockW3C_(b):this.splitQuotedBlockIE_(b)};
goog.editor.plugins.Blockquote.prototype.splitQuotedBlockW3C_=function(a){var b=a.node,c=goog.editor.node.findTopMostEditableAncestor(b.parentNode,goog.bind(this.isSplittableBlockquote,this)),d,e,f=!1;c?b.nodeType==goog.dom.NodeType.TEXT?a.offset==b.length?(d=b.nextSibling)&&d.tagName==goog.dom.TagName.BR?(b=d,d=d.nextSibling):d=e=b.splitText(a.offset):d=b.splitText(a.offset):b.tagName==goog.dom.TagName.BR?d=b.nextSibling:f=!0:this.isSetupBlockquote(b)&&(c=b,f=!0);f&&(b=this.insertEmptyTextNodeBeforeRange_(),
d=this.insertEmptyTextNodeBeforeRange_());if(!c)return!1;d=goog.editor.node.splitDomTreeAt(b,d,c);goog.dom.insertSiblingAfter(d,c);a=this.getFieldDomHelper();b=this.fieldObject.queryCommandValue(goog.editor.Command.DEFAULT_TAG)||goog.dom.TagName.DIV;b=a.createElement(b);b.innerHTML="&nbsp;";c.parentNode.insertBefore(b,d);a.getWindow().getSelection().collapse(b,0);e&&goog.editor.plugins.Blockquote.findAndRemoveSingleChildAncestor_(e,d);goog.editor.plugins.Blockquote.removeAllWhiteSpaceNodes_([c,d]);
return!0};goog.editor.plugins.Blockquote.prototype.insertEmptyTextNodeBeforeRange_=function(){var a=this.fieldObject.getRange(),b=this.getFieldDomHelper().createTextNode("");a.insertNode(b,!0);return b};
goog.editor.plugins.Blockquote.prototype.splitQuotedBlockIE_=function(a){var b=this.getFieldDomHelper(),c=goog.editor.node.findTopMostEditableAncestor(a.parentNode,goog.bind(this.isSplittableBlockquote,this));if(!c)return!1;var d=a.cloneNode(!1);if(a.nextSibling&&a.nextSibling.tagName==goog.dom.TagName.BR)a=a.nextSibling;var e=goog.editor.node.splitDomTreeAt(a,d,c);goog.dom.insertSiblingAfter(e,c);var f=this.fieldObject.queryCommandValue(goog.editor.Command.DEFAULT_TAG)||goog.dom.TagName.DIV;f=b.createElement(f);
c.parentNode.insertBefore(f,e);f.innerHTML="&nbsp;";b=b.getDocument().selection.createRange();b.moveToElementText(a);b.move("character",2);b.select();f.innerHTML="";b.pasteHTML("");goog.editor.plugins.Blockquote.findAndRemoveSingleChildAncestor_(d,e);goog.editor.plugins.Blockquote.removeAllWhiteSpaceNodes_([c,e]);return!0};goog.editor.plugins.EnterHandler=function(){goog.editor.Plugin.call(this)};goog.inherits(goog.editor.plugins.EnterHandler,goog.editor.Plugin);goog.editor.plugins.EnterHandler.prototype.tag=goog.dom.TagName.DIV;goog.editor.plugins.EnterHandler.prototype.getTrogClassId=function(){return"EnterHandler"};
goog.editor.plugins.EnterHandler.prototype.enable=function(a){goog.editor.plugins.EnterHandler.superClass_.enable.call(this,a);goog.editor.BrowserFeature.SUPPORTS_OPERA_DEFAULTBLOCK_COMMAND&&(this.tag==goog.dom.TagName.P||this.tag==goog.dom.TagName.DIV)&&this.getFieldDomHelper().getDocument().execCommand("opera-defaultBlock",!1,this.tag)};
goog.editor.plugins.EnterHandler.prototype.prepareContentsHtml=function(a){if(!a||goog.string.isBreakingWhitespace(a))return goog.editor.BrowserFeature.COLLAPSES_EMPTY_NODES?this.getNonCollapsingBlankHtml():"";return a};goog.editor.plugins.EnterHandler.prototype.getNonCollapsingBlankHtml=goog.functions.constant("<br>");
goog.editor.plugins.EnterHandler.prototype.handleBackspaceInternal=function(a,b){var c=this.fieldObject.getElement(),d=b&&b.getStartNode();c.firstChild==d&&goog.editor.node.isEmpty(d)&&(a.preventDefault(),a.stopPropagation())};
goog.editor.plugins.EnterHandler.prototype.processParagraphTagsInternal=function(a,b){if(goog.userAgent.IE||goog.userAgent.OPERA)this.ensureBlockIeOpera(goog.dom.TagName.DIV);else if(!b&&goog.userAgent.WEBKIT){var c=this.fieldObject.getRange();if(c&&goog.editor.plugins.EnterHandler.isDirectlyInBlockquote(c.getContainerElement())){var d=this.getFieldDomHelper(),e=d.createElement(goog.dom.TagName.BR);c.insertNode(e,!0);goog.editor.node.isBlockTag(e.parentNode)&&!goog.editor.node.skipEmptyTextNodes(e.nextSibling)&&
goog.dom.insertSiblingBefore(d.createElement(goog.dom.TagName.BR),e);goog.editor.range.placeCursorNextTo(e,!1);a.preventDefault()}}};goog.editor.plugins.EnterHandler.isDirectlyInBlockquote=function(a){for(;a;a=a.parentNode)if(goog.editor.node.isBlockTag(a))return a.tagName==goog.dom.TagName.BLOCKQUOTE;return!1};goog.editor.plugins.EnterHandler.prototype.handleDeleteGecko=function(a){this.deleteBrGecko(a)};
goog.editor.plugins.EnterHandler.prototype.deleteBrGecko=function(a){var b=this.fieldObject.getRange();if(b.isCollapsed()){var c=b.getEndNode();if(c.nodeType==goog.dom.NodeType.ELEMENT&&(b=c.childNodes[b.getEndOffset()])&&b.tagName==goog.dom.TagName.BR){var d=goog.editor.node.getPreviousSibling(b),e=b.nextSibling;c.removeChild(b);a.preventDefault();e&&goog.editor.node.isBlockTag(e)&&(d&&!(d.tagName==goog.dom.TagName.BR||goog.editor.node.isBlockTag(d))?goog.dom.Range.createCaret(d,goog.editor.node.getLength(d)).select():
(a=goog.editor.node.getLeftMostLeaf(e),goog.dom.Range.createCaret(a,0).select()))}}};
goog.editor.plugins.EnterHandler.prototype.handleKeyPress=function(a){if(goog.userAgent.GECKO&&this.fieldObject.inModalMode())return!1;if(a.keyCode==goog.events.KeyCodes.BACKSPACE)this.handleBackspaceInternal(a,this.fieldObject.getRange());else if(a.keyCode==goog.events.KeyCodes.ENTER)if(goog.userAgent.GECKO)a.shiftKey||this.handleEnterGecko_(a);else{this.fieldObject.dispatchBeforeChange();var b=this.deleteCursorSelection_(),c=!!this.fieldObject.execCommand(goog.editor.plugins.Blockquote.SPLIT_COMMAND,
b);c&&(a.preventDefault(),a.stopPropagation());this.releasePositionObject_(b);goog.userAgent.WEBKIT&&this.handleEnterWebkitInternal(a);this.processParagraphTagsInternal(a,c);this.fieldObject.dispatchChange()}else goog.userAgent.GECKO&&a.keyCode==goog.events.KeyCodes.DELETE&&this.handleDeleteGecko(a);return!1};goog.editor.plugins.EnterHandler.prototype.handleKeyUp=function(a){if(goog.userAgent.GECKO&&this.fieldObject.inModalMode())return!1;this.handleKeyUpInternal(a);return!1};
goog.editor.plugins.EnterHandler.prototype.handleKeyUpInternal=function(a){(goog.userAgent.IE||goog.userAgent.OPERA)&&a.keyCode==goog.events.KeyCodes.ENTER&&this.ensureBlockIeOpera(goog.dom.TagName.DIV,!0)};
goog.editor.plugins.EnterHandler.prototype.handleEnterGecko_=function(a){var b=this.fieldObject.getRange(),c=!b||b.isCollapsed(),d=this.deleteCursorSelection_(),e=this.fieldObject.execCommand(goog.editor.plugins.Blockquote.SPLIT_COMMAND,d);e&&(a.preventDefault(),a.stopPropagation());this.releasePositionObject_(d);e||this.handleEnterAtCursorGeckoInternal(a,c,b)};goog.editor.plugins.EnterHandler.prototype.handleEnterWebkitInternal=goog.nullFunction;
goog.editor.plugins.EnterHandler.prototype.handleEnterAtCursorGeckoInternal=goog.nullFunction;goog.editor.plugins.EnterHandler.DO_NOT_ENSURE_BLOCK_NODES_=goog.object.createSet(goog.dom.TagName.LI,goog.dom.TagName.DIV,goog.dom.TagName.H1,goog.dom.TagName.H2,goog.dom.TagName.H3,goog.dom.TagName.H4,goog.dom.TagName.H5,goog.dom.TagName.H6);goog.editor.plugins.EnterHandler.isBrElem=function(a){return goog.editor.node.isEmpty(a)&&a.getElementsByTagName(goog.dom.TagName.BR).length==1};
goog.editor.plugins.EnterHandler.prototype.ensureBlockIeOpera=function(a,b){for(var c=this.fieldObject.getRange(),d=c.getContainer(),e=this.fieldObject.getElement(),f;d&&d!=e;){var g=d.nodeName;if(g==a||goog.editor.plugins.EnterHandler.DO_NOT_ENSURE_BLOCK_NODES_[g]&&(!b||!goog.editor.plugins.EnterHandler.isBrElem(d))){if(goog.userAgent.OPERA&&f){g==a&&f==d.lastChild&&goog.editor.node.isEmpty(f)&&(goog.dom.insertSiblingAfter(f,d),goog.dom.Range.createFromNodeContents(f).select());break}return}goog.userAgent.OPERA&&
b&&g==goog.dom.TagName.P&&g!=a&&(f=d);d=d.parentNode}if(goog.userAgent.IE&&!goog.userAgent.isVersion(9)){var h=!1;c=c.getBrowserRangeObject();d=c.duplicate();d.moveEnd("character",1);if(d.text.length&&(h=d.parentElement(),d=d.duplicate(),d.collapse(!1),d=d.parentElement(),h=h!=d&&d!=c.parentElement()))c.move("character",-1),c.select()}this.fieldObject.getEditableDomHelper().getDocument().execCommand("FormatBlock",!1,"<"+a+">");h&&(c.move("character",1),c.select())};
goog.editor.plugins.EnterHandler.prototype.deleteCursorSelection_=function(){return goog.editor.BrowserFeature.HAS_W3C_RANGES?this.deleteCursorSelectionW3C_():this.deleteCursorSelectionIE_()};goog.editor.plugins.EnterHandler.prototype.releasePositionObject_=function(a){goog.editor.BrowserFeature.HAS_W3C_RANGES||a.removeNode(!0)};
goog.editor.plugins.EnterHandler.prototype.deleteCursorSelectionIE_=function(){var a=this.getFieldDomHelper().getDocument(),b=a.selection.createRange(),c=goog.string.createUniqueString();b.pasteHTML('<span id="'+c+'"></span>');a=a.getElementById(c);a.id="";return a};
goog.editor.plugins.EnterHandler.prototype.deleteCursorSelectionW3C_=function(){var a=this.fieldObject.getRange();if(!a.isCollapsed()){var b=!0;if(goog.userAgent.OPERA){var c=a.getStartNode(),d=a.getStartOffset();c==a.getEndNode()&&c.lastChild&&c.lastChild.tagName==goog.dom.TagName.BR&&d==c.childNodes.length-1&&(b=!1)}b&&goog.editor.plugins.EnterHandler.deleteW3cRange_(a)}return goog.editor.range.getDeepEndPoint(a,!0)};
goog.editor.plugins.EnterHandler.deleteW3cRange_=function(a){if(a&&!a.isCollapsed()){var b=!0,c=a.getContainerElement(),d=new goog.dom.NodeOffset(a.getStartNode(),c),e=a.getStartOffset(),f=goog.editor.plugins.EnterHandler.isInOneContainerW3c_(a),g=!f&&goog.editor.plugins.EnterHandler.isPartialEndW3c_(a);a.removeContents();a=goog.dom.Range.createCaret(d.findTargetNode(c),e);a.select();if(f&&(f=goog.editor.style.getContainer(a.getStartNode()),goog.editor.node.isEmpty(f,!0)))b="&nbsp;",goog.userAgent.OPERA&&
f.tagName==goog.dom.TagName.LI&&(b="<br>"),f.innerHTML=b,goog.editor.range.selectNodeStart(f.firstChild),b=!1;g&&(a=goog.editor.style.getContainer(a.getStartNode()),g=goog.editor.node.getNextSibling(a),a&&g&&(goog.dom.append(a,g.childNodes),goog.dom.removeNode(g)));b&&(a=goog.dom.Range.createCaret(d.findTargetNode(c),e),a.select())}};
goog.editor.plugins.EnterHandler.isInOneContainerW3c_=function(a){var b=a.getStartNode();goog.editor.style.isContainer(b)&&(b=b.childNodes[a.getStartOffset()]||b);b=goog.editor.style.getContainer(b);var c=a.getEndNode();goog.editor.style.isContainer(c)&&(c=c.childNodes[a.getEndOffset()]||c);c=goog.editor.style.getContainer(c);return b==c};
goog.editor.plugins.EnterHandler.isPartialEndW3c_=function(a){var b=a.getEndNode();a=a.getEndOffset();var c=b;if(goog.editor.style.isContainer(c)){var d=c.childNodes[a];if(!d||d.nodeType==goog.dom.NodeType.ELEMENT&&goog.editor.style.isContainer(d))return!1}for(d=goog.editor.style.getContainer(c);d!=c;){if(goog.editor.node.getNextSibling(c))return!0;c=c.parentNode}return a!=goog.editor.node.getLength(b)};goog.editor.plugins.TagOnEnterHandler=function(a){this.tag=a;goog.editor.plugins.EnterHandler.call(this)};goog.inherits(goog.editor.plugins.TagOnEnterHandler,goog.editor.plugins.EnterHandler);goog.editor.plugins.TagOnEnterHandler.prototype.getTrogClassId=function(){return"TagOnEnterHandler"};goog.editor.plugins.TagOnEnterHandler.prototype.getNonCollapsingBlankHtml=function(){if(this.tag==goog.dom.TagName.P)return"<p>&nbsp;</p>";else if(this.tag==goog.dom.TagName.DIV)return"<div><br></div>";return"<br>"};
goog.editor.plugins.TagOnEnterHandler.prototype.activeOnUneditableFields=goog.functions.TRUE;goog.editor.plugins.TagOnEnterHandler.prototype.isSupportedCommand=function(a){return a==goog.editor.Command.DEFAULT_TAG};goog.editor.plugins.TagOnEnterHandler.prototype.queryCommandValue=function(a){return a==goog.editor.Command.DEFAULT_TAG?this.tag:null};
goog.editor.plugins.TagOnEnterHandler.prototype.handleBackspaceInternal=function(a,b){goog.editor.plugins.TagOnEnterHandler.superClass_.handleBackspaceInternal.call(this,a,b);goog.userAgent.GECKO&&this.markBrToNotBeRemoved_(b,!0)};goog.editor.plugins.TagOnEnterHandler.prototype.processParagraphTagsInternal=function(){(goog.userAgent.OPERA||goog.userAgent.IE)&&this.tag!=goog.dom.TagName.P&&this.ensureBlockIeOpera(this.tag)};
goog.editor.plugins.TagOnEnterHandler.prototype.handleDeleteGecko=function(a){var b=this.fieldObject.getRange(),c=goog.editor.style.getContainer(b&&b.getContainerElement());this.fieldObject.getElement().lastChild==c&&goog.editor.plugins.EnterHandler.isBrElem(c)?(a.preventDefault(),a.stopPropagation()):(this.markBrToNotBeRemoved_(b,!1),this.deleteBrGecko(a))};
goog.editor.plugins.TagOnEnterHandler.prototype.handleKeyUpInternal=function(a){goog.userAgent.GECKO?a.keyCode==goog.events.KeyCodes.DELETE?this.removeBrIfNecessary_(!1):a.keyCode==goog.events.KeyCodes.BACKSPACE&&this.removeBrIfNecessary_(!0):(goog.userAgent.IE||goog.userAgent.OPERA)&&a.keyCode==goog.events.KeyCodes.ENTER&&this.ensureBlockIeOpera(this.tag,!0)};goog.editor.plugins.TagOnEnterHandler.BrOrNbspSurroundedWithWhiteSpace_="[\t\n\r ]*(<br[^>]*/?>|&nbsp;)[\t\n\r ]*";
goog.editor.plugins.TagOnEnterHandler.emptyLiRegExp_=RegExp("^"+goog.editor.plugins.TagOnEnterHandler.BrOrNbspSurroundedWithWhiteSpace_+"$");goog.editor.plugins.TagOnEnterHandler.prototype.ensureNodeIsWrappedW3c_=function(a,b){if(b==this.fieldObject.getElement()){var c=goog.dom.getAncestor(a,function(a){return b==a.parentNode},!0);b=goog.editor.plugins.TagOnEnterHandler.wrapInContainerW3c_(this.tag,{node:c,offset:0},b)}return b};
goog.editor.plugins.TagOnEnterHandler.prototype.handleEnterWebkitInternal=function(){if(this.tag==goog.dom.TagName.DIV){var a=this.fieldObject.getRange(),b=goog.editor.style.getContainer(a.getContainerElement());a=goog.editor.range.getDeepEndPoint(a,!0);this.ensureNodeIsWrappedW3c_(a.node,b);goog.dom.Range.createCaret(a.node,a.offset).select()}};
goog.editor.plugins.TagOnEnterHandler.prototype.handleEnterAtCursorGeckoInternal=function(a,b,c){var d=null;b&&(d=goog.dom.getAncestorByTagNameAndClass(c&&c.getContainerElement(),goog.dom.TagName.LI));b=d&&d.innerHTML.match(goog.editor.plugins.TagOnEnterHandler.emptyLiRegExp_)?this.breakOutOfEmptyListItemGecko_(d):this.handleRegularEnterGecko_();this.scrollCursorIntoViewGecko_(b);if(goog.editor.plugins.EnterHandler.isBrElem(b)&&(c=b.getElementsByTagName(goog.dom.TagName.BR)[0],c.previousSibling&&
c.previousSibling.nodeType==goog.dom.NodeType.TEXT))b=c.previousSibling;goog.editor.range.selectNodeStart(b);a.preventDefault();a.stopPropagation()};
goog.editor.plugins.TagOnEnterHandler.prototype.breakOutOfEmptyListItemGecko_=function(a){var b=a.parentNode,c=b.parentNode;c=c.tagName==goog.dom.TagName.OL||c.tagName==goog.dom.TagName.UL;c=goog.dom.getDomHelper(a).createElement(c?goog.dom.TagName.LI:this.tag);if(a.previousSibling){if(a.nextSibling){for(var d=b.cloneNode(!1);a.nextSibling;)d.appendChild(a.nextSibling);goog.dom.insertSiblingAfter(d,b)}goog.dom.insertSiblingAfter(c,b)}else goog.dom.insertSiblingBefore(c,b);goog.editor.node.isEmpty(b)&&
goog.dom.removeNode(b);goog.dom.removeNode(a);c.innerHTML="&nbsp;";return c};
goog.editor.plugins.TagOnEnterHandler.wrapInContainerW3c_=function(a,b,c){for(var d=b.node;d.previousSibling&&!goog.editor.style.isContainer(d.previousSibling);)d=d.previousSibling;for(b=b.node;b.nextSibling&&!goog.editor.style.isContainer(b.nextSibling);)b=b.nextSibling;for(a=c.ownerDocument.createElement(a);d!=b;){var e=d.nextSibling;goog.dom.appendChild(a,d);d=e}d=b.nextSibling;goog.dom.appendChild(a,b);c.insertBefore(a,d);return a};
goog.editor.plugins.TagOnEnterHandler.prototype.markBrToNotBeRemoved_=function(a,b){var c=a.getFocusNode(),d=a.getFocusOffset();if(goog.editor.node.getLength(c)==(b?d:d+1))if((c=c.nextSibling)&&c.tagName==goog.dom.TagName.BR)this.brToKeep_=c};
goog.editor.plugins.TagOnEnterHandler.prototype.removeBrIfNecessary_=function(a){var b=this.fieldObject.getRange(),c=b.getFocusNode();b=b.getFocusOffset();var d;if(a&&c.data=="")d=c.nextSibling;else if(a&&b==0){for(a=c;a&&!a.previousSibling&&a.parentNode!=this.fieldObject.getElement();)a=a.parentNode;d=a.previousSibling}else if(c.length==b)d=c.nextSibling;if(d&&!(d.tagName!=goog.dom.TagName.BR||this.brToKeep_==d))if(goog.dom.removeNode(d),c.nodeType==goog.dom.NodeType.TEXT)c.data=goog.editor.plugins.TagOnEnterHandler.trimTabsAndLineBreaks_(c.data),
goog.dom.Range.createCaret(c,Math.min(b,c.length)).select()};goog.editor.plugins.TagOnEnterHandler.trimTabsAndLineBreaks_=function(a){return a.replace(/^[\t\n\r]|[\t\n\r]$/g,"")};
goog.editor.plugins.TagOnEnterHandler.prototype.handleRegularEnterGecko_=function(){var a=this.fieldObject.getRange(),b=goog.editor.style.getContainer(a.getContainerElement());if(goog.editor.plugins.EnterHandler.isBrElem(b))b.tagName==goog.dom.TagName.BODY&&(b=this.ensureNodeIsWrappedW3c_(b.getElementsByTagName(goog.dom.TagName.BR)[0],b)),a=b.cloneNode(!0),goog.dom.insertSiblingAfter(a,b);else{if(!b.firstChild)b.innerHTML="&nbsp;";a=goog.editor.range.getDeepEndPoint(a,!0);b=this.ensureNodeIsWrappedW3c_(a.node,
b);a=goog.editor.plugins.TagOnEnterHandler.splitDomAndAppend_(a.node,a.offset,b);b=goog.editor.plugins.TagOnEnterHandler.findAnchorInTraversal_(b);var c=goog.editor.plugins.TagOnEnterHandler.findAnchorInTraversal_(a,!0);b&&c&&b.tagName==goog.dom.TagName.A&&c.tagName==goog.dom.TagName.A&&(b=goog.editor.node.isEmpty(b,!1)?b:c,goog.dom.flattenElement(b))}return a};
goog.editor.plugins.TagOnEnterHandler.prototype.scrollCursorIntoViewGecko_=function(a){if(this.fieldObject.isFixedHeight()){var b=this.fieldObject.getElement();a=goog.style.getPageOffsetTop(a)+a.offsetHeight;var c=this.getFieldDomHelper(),d=this.getFieldDomHelper().getWindow();c=c.getDocumentScroll().y;d=goog.dom.getViewportSize(d).height;if(a>d+c){if(b.tagName==goog.dom.TagName.BODY&&goog.editor.node.isStandardsMode(b))b=b.parentNode;b.scrollTop=a-d}}};
goog.editor.plugins.TagOnEnterHandler.splitDom_=function(a,b,c){if(!c)c=a.ownerDocument.body;var d=a.nodeType==goog.dom.NodeType.TEXT,e;d?goog.userAgent.IE&&b==a.nodeValue.length?(e=goog.dom.getDomHelper(a).createTextNode(""),goog.dom.insertSiblingAfter(e,a)):e=a.splitText(b):a=b?a.childNodes[b-1]:e=a.firstChild||a;b=goog.editor.node.splitDomTreeAt(a,e,c);d&&(e=goog.editor.plugins.TagOnEnterHandler.joinTextNodes_(e,!0),goog.editor.plugins.TagOnEnterHandler.replaceWhiteSpaceWithNbsp_(e,!0,!!e.nextSibling),
a=goog.editor.plugins.TagOnEnterHandler.joinTextNodes_(a,!1),goog.editor.plugins.TagOnEnterHandler.replaceWhiteSpaceWithNbsp_(a,!1,!1));return b};goog.editor.plugins.TagOnEnterHandler.splitDomAndAppend_=function(a,b,c){a=goog.editor.plugins.TagOnEnterHandler.splitDom_(a,b,c);goog.dom.insertSiblingAfter(a,c);return a};
goog.editor.plugins.TagOnEnterHandler.joinTextNodes_=function(a,b){if(a&&a.nodeName=="#text"){for(var c=b?"nextSibling":"previousSibling",d=b?"previousSibling":"nextSibling",e=[a.nodeValue];a[c]&&a[c].nodeType==goog.dom.NodeType.TEXT;)a=a[c],e.push(a.nodeValue),goog.dom.removeNode(a[d]);b||e.reverse();a.nodeValue=e.join("")}return a};
goog.editor.plugins.TagOnEnterHandler.replaceWhiteSpaceWithNbsp_=function(a,b,c){a.nodeValue=a.nodeValue.replace(b?/ ^[\t\r\n]+/:/[ \t\r\n]+$/,goog.string.Unicode.NBSP);if(!c&&a.nodeValue=="")a.nodeValue=goog.string.Unicode.NBSP};goog.editor.plugins.TagOnEnterHandler.findAnchorInTraversal_=function(a,b){for(;(a=b?a.firstChild:a.lastChild)&&a.tagName!=goog.dom.TagName.A;);return a};goog.dom.ViewportSizeMonitor=function(a){goog.events.EventTarget.call(this);this.window_=a||window;this.listenerKey_=goog.events.listen(this.window_,goog.events.EventType.RESIZE,this.handleResize_,!1,this);this.size_=goog.dom.getViewportSize(this.window_);if(this.isPollingRequired_())this.windowSizePollInterval_=window.setInterval(goog.bind(this.checkForSizeChange_,this),goog.dom.ViewportSizeMonitor.WINDOW_SIZE_POLL_RATE)};goog.inherits(goog.dom.ViewportSizeMonitor,goog.events.EventTarget);
goog.dom.ViewportSizeMonitor.getInstanceForWindow=function(a){a=a||window;var b=goog.getUid(a);return goog.dom.ViewportSizeMonitor.windowInstanceMap_[b]=goog.dom.ViewportSizeMonitor.windowInstanceMap_[b]||new goog.dom.ViewportSizeMonitor(a)};goog.dom.ViewportSizeMonitor.windowInstanceMap_={};goog.dom.ViewportSizeMonitor.WINDOW_SIZE_POLL_RATE=500;goog.dom.ViewportSizeMonitor.prototype.listenerKey_=null;goog.dom.ViewportSizeMonitor.prototype.window_=null;
goog.dom.ViewportSizeMonitor.prototype.size_=null;goog.dom.ViewportSizeMonitor.prototype.windowSizePollInterval_=null;goog.dom.ViewportSizeMonitor.prototype.isPollingRequired_=function(){return goog.userAgent.WEBKIT&&goog.userAgent.WINDOWS||goog.userAgent.OPERA&&this.window_.self!=this.window_.top};goog.dom.ViewportSizeMonitor.prototype.getSize=function(){return this.size_?this.size_.clone():null};
goog.dom.ViewportSizeMonitor.prototype.disposeInternal=function(){goog.dom.ViewportSizeMonitor.superClass_.disposeInternal.call(this);if(this.listenerKey_)goog.events.unlistenByKey(this.listenerKey_),this.listenerKey_=null;if(this.windowSizePollInterval_)window.clearInterval(this.windowSizePollInterval_),this.windowSizePollInterval_=null;this.size_=this.window_=null};goog.dom.ViewportSizeMonitor.prototype.handleResize_=function(){this.checkForSizeChange_()};
goog.dom.ViewportSizeMonitor.prototype.checkForSizeChange_=function(){var a=goog.dom.getViewportSize(this.window_);if(!goog.math.Size.equals(a,this.size_))this.size_=a,this.dispatchEvent(goog.events.EventType.RESIZE)};goog.positioning={};goog.positioning.Corner={TOP_LEFT:0,TOP_RIGHT:2,BOTTOM_LEFT:1,BOTTOM_RIGHT:3,TOP_START:4,TOP_END:6,BOTTOM_START:5,BOTTOM_END:7};goog.positioning.CornerBit={BOTTOM:1,RIGHT:2,FLIP_RTL:4};goog.positioning.Overflow={IGNORE:0,ADJUST_X:1,FAIL_X:2,ADJUST_Y:4,FAIL_Y:8,RESIZE_WIDTH:16,RESIZE_HEIGHT:32,ADJUST_X_EXCEPT_OFFSCREEN:65,ADJUST_Y_EXCEPT_OFFSCREEN:132};
goog.positioning.OverflowStatus={NONE:0,ADJUSTED_X:1,ADJUSTED_Y:2,WIDTH_ADJUSTED:4,HEIGHT_ADJUSTED:8,FAILED_LEFT:16,FAILED_RIGHT:32,FAILED_TOP:64,FAILED_BOTTOM:128,FAILED_OUTSIDE_VIEWPORT:256};goog.positioning.OverflowStatus.FAILED=goog.positioning.OverflowStatus.FAILED_LEFT|goog.positioning.OverflowStatus.FAILED_RIGHT|goog.positioning.OverflowStatus.FAILED_TOP|goog.positioning.OverflowStatus.FAILED_BOTTOM|goog.positioning.OverflowStatus.FAILED_OUTSIDE_VIEWPORT;
goog.positioning.OverflowStatus.FAILED_HORIZONTAL=goog.positioning.OverflowStatus.FAILED_LEFT|goog.positioning.OverflowStatus.FAILED_RIGHT;goog.positioning.OverflowStatus.FAILED_VERTICAL=goog.positioning.OverflowStatus.FAILED_TOP|goog.positioning.OverflowStatus.FAILED_BOTTOM;
goog.positioning.positionAtAnchor=function(a,b,c,d,e,f,g,h){var i,j=c.offsetParent;if(j){var k=j.tagName==goog.dom.TagName.HTML||j.tagName==goog.dom.TagName.BODY;if(!k||goog.style.getComputedPosition(j)!="static")i=goog.style.getPageOffset(j),k||(i=goog.math.Coordinate.difference(i,new goog.math.Coordinate(j.scrollLeft,j.scrollTop)))}j=goog.positioning.getVisiblePart_(a);goog.style.translateRectForAnotherFrame(j,goog.dom.getDomHelper(a),goog.dom.getDomHelper(c));a=goog.positioning.getEffectiveCorner(a,
b);b=new goog.math.Coordinate(a&goog.positioning.CornerBit.RIGHT?j.left+j.width:j.left,a&goog.positioning.CornerBit.BOTTOM?j.top+j.height:j.top);i&&(b=goog.math.Coordinate.difference(b,i));e&&(b.x+=(a&goog.positioning.CornerBit.RIGHT?-1:1)*e.x,b.y+=(a&goog.positioning.CornerBit.BOTTOM?-1:1)*e.y);var l;if(g&&(l=goog.style.getVisibleRectForElement(c))&&i)l.top-=i.y,l.right-=i.x,l.bottom-=i.y,l.left-=i.x;return goog.positioning.positionAtCoordinate(b,c,d,f,l,g,h)};
goog.positioning.getVisiblePart_=function(a){var b=goog.style.getBounds(a);(a=goog.style.getVisibleRectForElement(a))&&b.intersection(goog.math.Rect.createFromBox(a));return b};
goog.positioning.positionAtCoordinate=function(a,b,c,d,e,f,g){a=a.clone();var h=goog.positioning.OverflowStatus.NONE;c=goog.positioning.getEffectiveCorner(b,c);var i=goog.style.getSize(b);g=g?g.clone():i.clone();if(d||c!=goog.positioning.Corner.TOP_LEFT)c&goog.positioning.CornerBit.RIGHT?a.x-=g.width+(d?d.right:0):d&&(a.x+=d.left),c&goog.positioning.CornerBit.BOTTOM?a.y-=g.height+(d?d.bottom:0):d&&(a.y+=d.top);if(f&&(h=e?goog.positioning.adjustForViewport_(a,g,e,f):goog.positioning.OverflowStatus.FAILED_OUTSIDE_VIEWPORT,
h&goog.positioning.OverflowStatus.FAILED))return h;goog.style.setPosition(b,a);goog.math.Size.equals(i,g)||goog.style.setBorderBoxSize(b,g);return h};
goog.positioning.adjustForViewport_=function(a,b,c,d){var e=goog.positioning.OverflowStatus.NONE,f=goog.positioning.Overflow.ADJUST_X_EXCEPT_OFFSCREEN,g=goog.positioning.Overflow.ADJUST_Y_EXCEPT_OFFSCREEN;if((d&f)==f&&(a.x<c.left||a.x>=c.right))d&=~goog.positioning.Overflow.ADJUST_X;if((d&g)==g&&(a.y<c.top||a.y>=c.bottom))d&=~goog.positioning.Overflow.ADJUST_Y;if(a.x<c.left&&d&goog.positioning.Overflow.ADJUST_X)a.x=c.left,e|=goog.positioning.OverflowStatus.ADJUSTED_X;a.x<c.left&&a.x+b.width>c.right&&
d&goog.positioning.Overflow.RESIZE_WIDTH&&(b.width-=a.x+b.width-c.right,e|=goog.positioning.OverflowStatus.WIDTH_ADJUSTED);if(a.x+b.width>c.right&&d&goog.positioning.Overflow.ADJUST_X)a.x=Math.max(c.right-b.width,c.left),e|=goog.positioning.OverflowStatus.ADJUSTED_X;d&goog.positioning.Overflow.FAIL_X&&(e|=(a.x<c.left?goog.positioning.OverflowStatus.FAILED_LEFT:0)|(a.x+b.width>c.right?goog.positioning.OverflowStatus.FAILED_RIGHT:0));if(a.y<c.top&&d&goog.positioning.Overflow.ADJUST_Y)a.y=c.top,e|=goog.positioning.OverflowStatus.ADJUSTED_Y;
a.y>=c.top&&a.y+b.height>c.bottom&&d&goog.positioning.Overflow.RESIZE_HEIGHT&&(b.height-=a.y+b.height-c.bottom,e|=goog.positioning.OverflowStatus.HEIGHT_ADJUSTED);if(a.y+b.height>c.bottom&&d&goog.positioning.Overflow.ADJUST_Y)a.y=Math.max(c.bottom-b.height,c.top),e|=goog.positioning.OverflowStatus.ADJUSTED_Y;d&goog.positioning.Overflow.FAIL_Y&&(e|=(a.y<c.top?goog.positioning.OverflowStatus.FAILED_TOP:0)|(a.y+b.height>c.bottom?goog.positioning.OverflowStatus.FAILED_BOTTOM:0));return e};
goog.positioning.getEffectiveCorner=function(a,b){return(b&goog.positioning.CornerBit.FLIP_RTL&&goog.style.isRightToLeft(a)?b^goog.positioning.CornerBit.RIGHT:b)&~goog.positioning.CornerBit.FLIP_RTL};goog.positioning.flipCornerHorizontal=function(a){return a^goog.positioning.CornerBit.RIGHT};goog.positioning.flipCornerVertical=function(a){return a^goog.positioning.CornerBit.BOTTOM};goog.positioning.flipCorner=function(a){return a^goog.positioning.CornerBit.BOTTOM^goog.positioning.CornerBit.RIGHT};goog.ui.editor.Bubble=function(a,b){goog.events.EventTarget.call(this);this.dom_=goog.dom.getDomHelper(a);this.eventHandler_=new goog.events.EventHandler(this);this.viewPortSizeMonitor_=new goog.dom.ViewportSizeMonitor(this.dom_.getWindow());this.panels_={};this.bubbleContainer_=this.dom_.createDom(goog.dom.TagName.DIV,{className:goog.ui.editor.Bubble.BUBBLE_CLASSNAME});goog.style.showElement(this.bubbleContainer_,!1);goog.dom.appendChild(a,this.bubbleContainer_);goog.style.setStyle(this.bubbleContainer_,
"zIndex",b);this.bubbleContents_=this.createBubbleDom(this.dom_,this.bubbleContainer_);this.closeBox_=this.dom_.createDom(goog.dom.TagName.DIV,{className:"tr_bubble_closebox",innerHTML:"&nbsp;"});this.bubbleContents_.appendChild(this.closeBox_);goog.editor.style.makeUnselectable(this.bubbleContainer_,this.eventHandler_);this.popup_=new goog.ui.PopupBase(this.bubbleContainer_)};goog.inherits(goog.ui.editor.Bubble,goog.events.EventTarget);goog.ui.editor.Bubble.BUBBLE_CLASSNAME="tr_bubble";
goog.ui.editor.Bubble.prototype.createBubbleDom=function(a,b){return b};goog.ui.editor.Bubble.prototype.logger=goog.debug.Logger.getLogger("goog.ui.editor.Bubble");goog.ui.editor.Bubble.prototype.disposeInternal=function(){goog.ui.editor.Bubble.superClass_.disposeInternal.call(this);goog.dom.removeNode(this.bubbleContainer_);this.bubbleContainer_=null;this.eventHandler_.dispose();this.eventHandler_=null;this.viewPortSizeMonitor_.dispose();this.viewPortSizeMonitor_=null};
goog.ui.editor.Bubble.prototype.getContentElement=function(){return this.bubbleContents_};goog.ui.editor.Bubble.prototype.getContainerElement=function(){return this.bubbleContainer_};goog.ui.editor.Bubble.prototype.getEventHandler=function(){return this.eventHandler_};goog.ui.editor.Bubble.prototype.handleWindowResize_=function(){this.isVisible()&&this.reposition()};goog.ui.editor.Bubble.prototype.hasPanelOfType=function(a){return goog.object.some(this.panels_,function(b){return b.type==a})};
goog.ui.editor.Bubble.prototype.addPanel=function(a,b,c,d,e){var f=goog.string.createUniqueString();b=new goog.ui.editor.Bubble.Panel_(this.dom_,f,a,b,c,!e);this.panels_[f]=b;var g;c=0;for(e=this.bubbleContents_.childNodes.length-1;c<e;c++){var h=this.bubbleContents_.childNodes[c];if(this.panels_[h.id].type>a){g=h;break}}goog.dom.insertSiblingBefore(b.element,g||this.bubbleContents_.lastChild);d(b.getContentElement());goog.editor.style.makeUnselectable(b.element,this.eventHandler_);a=goog.object.getCount(this.panels_);
a==1?this.openBubble_():a==2&&goog.dom.classes.add(this.bubbleContainer_,"tr_multi_bubble");this.reposition();return f};goog.ui.editor.Bubble.prototype.removePanel=function(a){goog.dom.removeNode(this.panels_[a].element);delete this.panels_[a];a=goog.object.getCount(this.panels_);a<=1&&goog.dom.classes.remove(this.bubbleContainer_,"tr_multi_bubble");a==0?this.closeBubble_():this.reposition()};
goog.ui.editor.Bubble.prototype.openBubble_=function(){this.eventHandler_.listen(this.closeBox_,goog.events.EventType.CLICK,this.closeBubble_).listen(this.viewPortSizeMonitor_,goog.events.EventType.RESIZE,this.handleWindowResize_).listen(this.popup_,goog.ui.PopupBase.EventType.HIDE,this.handlePopupHide);this.popup_.setVisible(!0);this.reposition()};goog.ui.editor.Bubble.prototype.closeBubble_=function(){this.popup_.setVisible(!1)};
goog.ui.editor.Bubble.prototype.handlePopupHide=function(){for(var a in this.panels_)goog.dom.removeNode(this.panels_[a].element);this.panels_={};goog.dom.classes.remove(this.bubbleContainer_,"tr_multi_bubble");this.eventHandler_.removeAll();this.dispatchEvent(goog.ui.Component.EventType.HIDE)};goog.ui.editor.Bubble.prototype.isVisible=function(){return this.popup_.isVisible()};goog.ui.editor.Bubble.VERTICAL_CLEARANCE_=goog.userAgent.IE?4:2;
goog.ui.editor.Bubble.MARGIN_BOX_=new goog.math.Box(goog.ui.editor.Bubble.VERTICAL_CLEARANCE_,0,goog.ui.editor.Bubble.VERTICAL_CLEARANCE_,0);
goog.ui.editor.Bubble.prototype.reposition=function(){var a=null,b=!0,c;for(c in this.panels_){var d=this.panels_[c];a=d.targetElement;b=b&&d.preferBottomPosition}c=goog.positioning.OverflowStatus.FAILED;a=goog.style.isRightToLeft(this.bubbleContainer_)!=goog.style.isRightToLeft(a);b&&(c=this.positionAtAnchor_(a?goog.positioning.Corner.BOTTOM_END:goog.positioning.Corner.BOTTOM_START,goog.positioning.Corner.TOP_START,goog.positioning.Overflow.ADJUST_X|goog.positioning.Overflow.FAIL_Y));c&goog.positioning.OverflowStatus.FAILED&&
(c=this.positionAtAnchor_(a?goog.positioning.Corner.TOP_END:goog.positioning.Corner.TOP_START,goog.positioning.Corner.BOTTOM_START,goog.positioning.Overflow.ADJUST_X|goog.positioning.Overflow.FAIL_Y));c&goog.positioning.OverflowStatus.FAILED&&(c=this.positionAtAnchor_(a?goog.positioning.Corner.BOTTOM_END:goog.positioning.Corner.BOTTOM_START,goog.positioning.Corner.TOP_START,goog.positioning.Overflow.ADJUST_X|goog.positioning.Overflow.ADJUST_Y),c&goog.positioning.OverflowStatus.FAILED&&this.logger.warning("reposition(): positionAtAnchor() failed with "+
c))};goog.ui.editor.Bubble.prototype.positionAtAnchor_=function(a,b,c){var d=null,e;for(e in this.panels_){var f=this.panels_[e].targetElement;if(!d||goog.dom.contains(f,d))d=this.panels_[e].targetElement}return goog.positioning.positionAtAnchor(d,a,this.bubbleContainer_,b,null,goog.ui.editor.Bubble.MARGIN_BOX_,c)};
goog.ui.editor.Bubble.Panel_=function(a,b,c,d,e,f){this.type=c;this.targetElement=e;this.preferBottomPosition=f;this.element=a.createDom(goog.dom.TagName.DIV,{className:"tr_bubble_panel",id:b},a.createDom(goog.dom.TagName.DIV,{className:"tr_bubble_panel_title"},d+":"),a.createDom(goog.dom.TagName.DIV,{className:"tr_bubble_panel_content"}))};goog.ui.editor.Bubble.Panel_.prototype.getContentElement=function(){return this.element.lastChild};goog.editor.plugins.AbstractBubblePlugin=function(){goog.editor.Plugin.call(this);this.eventRegister=new goog.events.EventHandler(this)};goog.inherits(goog.editor.plugins.AbstractBubblePlugin,goog.editor.Plugin);goog.editor.plugins.AbstractBubblePlugin.OPTION_LINK_CLASSNAME_="tr_option-link";goog.editor.plugins.AbstractBubblePlugin.LINK_CLASSNAME_="tr_bubble_link";goog.editor.plugins.AbstractBubblePlugin.DASH_NBSP_STRING=goog.string.Unicode.NBSP+"-"+goog.string.Unicode.NBSP;
goog.editor.plugins.AbstractBubblePlugin.defaultBubbleFactory_=function(a,b){return new goog.ui.editor.Bubble(a,b)};goog.editor.plugins.AbstractBubblePlugin.bubbleFactory_=goog.editor.plugins.AbstractBubblePlugin.defaultBubbleFactory_;goog.editor.plugins.AbstractBubblePlugin.setBubbleFactory=function(a){goog.editor.plugins.AbstractBubblePlugin.bubbleFactory_=a};goog.editor.plugins.AbstractBubblePlugin.bubbleMap_={};goog.editor.plugins.AbstractBubblePlugin.prototype.panelId_=null;
goog.editor.plugins.AbstractBubblePlugin.prototype.setBubbleParent=function(a){this.bubbleParent_=a};goog.editor.plugins.AbstractBubblePlugin.prototype.getBubbleDom=function(){return this.dom_};goog.editor.plugins.AbstractBubblePlugin.prototype.getTrogClassId=goog.functions.constant("AbstractBubblePlugin");goog.editor.plugins.AbstractBubblePlugin.prototype.getTargetElement=function(){return this.targetElement_};
goog.editor.plugins.AbstractBubblePlugin.prototype.handleKeyUp=function(){this.isVisible()&&this.handleSelectionChange();return!1};
goog.editor.plugins.AbstractBubblePlugin.prototype.handleSelectionChange=function(a,b){var c;if(a)c=a.target;else if(b)c=b;else{var d=this.fieldObject.getRange();if(d){var e=d.getStartNode(),f=d.getEndNode(),g=d.getStartOffset(),h=d.getEndOffset();goog.userAgent.IE&&d.isCollapsed()&&e!=f&&(d=goog.dom.Range.createCaret(e,g));e.nodeType==goog.dom.NodeType.ELEMENT&&e==f&&g==h-1&&(e=e.childNodes[g],e.nodeType==goog.dom.NodeType.ELEMENT&&(c=e))}c=c||d&&d.getContainerElement()}return this.handleSelectionChangeInternal_(c)};
goog.editor.plugins.AbstractBubblePlugin.prototype.handleSelectionChangeInternal_=function(a){if(a&&(a=this.getBubbleTargetFromSelection(a))){if(a!=this.targetElement_||!this.panelId_)this.panelId_&&this.closeBubble(),this.createBubble(a);return!1}this.panelId_&&this.closeBubble();return!1};goog.editor.plugins.AbstractBubblePlugin.prototype.disable=function(a){if(a.isUneditable()){var b=goog.editor.plugins.AbstractBubblePlugin.bubbleMap_[a.id];b&&(b.dispose(),delete goog.editor.plugins.AbstractBubblePlugin.bubbleMap_[a.id])}};
goog.editor.plugins.AbstractBubblePlugin.prototype.getSharedBubble_=function(){var a=this.bubbleParent_||this.fieldObject.getAppWindow().document.body;this.dom_=goog.dom.getDomHelper(a);var b=goog.editor.plugins.AbstractBubblePlugin.bubbleMap_[this.fieldObject.id];b||(b=goog.editor.plugins.AbstractBubblePlugin.bubbleFactory_.call(null,a,this.fieldObject.getBaseZindex()),goog.editor.plugins.AbstractBubblePlugin.bubbleMap_[this.fieldObject.id]=b);return b};
goog.editor.plugins.AbstractBubblePlugin.prototype.createBubble=function(a){var b=this.getSharedBubble_();if(!b.hasPanelOfType(this.getBubbleType()))this.targetElement_=a,this.panelId_=b.addPanel(this.getBubbleType(),this.getBubbleTitle(),a,goog.bind(this.createBubbleContents,this),this.shouldPreferBubbleAboveElement()),this.eventRegister.listen(b,goog.ui.Component.EventType.HIDE,this.handlePanelClosed_),this.onShow()};goog.editor.plugins.AbstractBubblePlugin.prototype.getBubbleType=function(){return""};
goog.editor.plugins.AbstractBubblePlugin.prototype.getBubbleTitle=function(){return""};goog.editor.plugins.AbstractBubblePlugin.prototype.shouldPreferBubbleAboveElement=goog.functions.FALSE;goog.editor.plugins.AbstractBubblePlugin.prototype.registerClickHandler=function(a,b){this.eventRegister.listen(a,goog.events.EventType.CLICK,b)};goog.editor.plugins.AbstractBubblePlugin.prototype.closeBubble=function(){this.panelId_&&(this.getSharedBubble_().removePanel(this.panelId_),this.handlePanelClosed_())};
goog.editor.plugins.AbstractBubblePlugin.prototype.onShow=goog.nullFunction;goog.editor.plugins.AbstractBubblePlugin.prototype.handlePanelClosed_=function(){this.panelId_=this.targetElement_=null;this.eventRegister.removeAll()};goog.editor.plugins.AbstractBubblePlugin.prototype.isVisible=function(){return!!this.panelId_};goog.editor.plugins.AbstractBubblePlugin.prototype.reposition=function(){var a=this.getSharedBubble_();a&&a.reposition()};
goog.editor.plugins.AbstractBubblePlugin.prototype.createLinkOption=function(a){return this.dom_.createDom(goog.dom.TagName.SPAN,{id:a,className:goog.editor.plugins.AbstractBubblePlugin.OPTION_LINK_CLASSNAME_},this.dom_.createTextNode(goog.editor.plugins.AbstractBubblePlugin.DASH_NBSP_STRING))};goog.editor.plugins.AbstractBubblePlugin.prototype.createLink=function(a,b,c,d){a=this.createLinkHelper(a,b,!1,d);c&&this.registerClickHandler(a,c);return a};
goog.editor.plugins.AbstractBubblePlugin.prototype.createLinkHelper=function(a,b,c,d){b=this.dom_.createDom(c?goog.dom.TagName.A:goog.dom.TagName.SPAN,{className:goog.editor.plugins.AbstractBubblePlugin.LINK_CLASSNAME_},b);this.setupLink(b,a,d);goog.editor.style.makeUnselectable(b,this.eventRegister);return b};goog.editor.plugins.AbstractBubblePlugin.prototype.setupLink=function(a,b,c){c?c.appendChild(a):(c=this.dom_.getElement(b))&&goog.dom.replaceNode(a,c);a.id=b};goog.editor.plugins.RemoveFormatting=function(){goog.editor.Plugin.call(this);this.optRemoveFormattingFunc_=null};goog.inherits(goog.editor.plugins.RemoveFormatting,goog.editor.Plugin);goog.editor.plugins.RemoveFormatting.REMOVE_FORMATTING_COMMAND="+removeFormat";goog.editor.plugins.RemoveFormatting.BLOCK_RE_=/^(DIV|TR|LI|BLOCKQUOTE|H\d|PRE|XMP)/;goog.editor.plugins.RemoveFormatting.appendNewline_=function(a){a.push("<br>")};
goog.editor.plugins.RemoveFormatting.createRangeDelimitedByRanges_=function(a,b){return goog.dom.Range.createFromNodes(a.getStartNode(),a.getStartOffset(),b.getEndNode(),b.getEndOffset())};goog.editor.plugins.RemoveFormatting.prototype.getTrogClassId=function(){return"RemoveFormatting"};goog.editor.plugins.RemoveFormatting.prototype.isSupportedCommand=function(a){return a==goog.editor.plugins.RemoveFormatting.REMOVE_FORMATTING_COMMAND};
goog.editor.plugins.RemoveFormatting.prototype.execCommandInternal=function(a){a==goog.editor.plugins.RemoveFormatting.REMOVE_FORMATTING_COMMAND&&this.removeFormatting_()};goog.editor.plugins.RemoveFormatting.prototype.handleKeyboardShortcut=function(a,b,c){if(!c)return!1;if(b==" ")return this.fieldObject.execCommand(goog.editor.plugins.RemoveFormatting.REMOVE_FORMATTING_COMMAND),!0;return!1};
goog.editor.plugins.RemoveFormatting.prototype.removeFormatting_=function(){this.fieldObject.getRange().isCollapsed()||(this.convertSelectedHtmlText_(this.optRemoveFormattingFunc_||goog.bind(this.removeFormattingWorker_,this)),this.getFieldDomHelper().getDocument().execCommand("RemoveFormat",!1,void 0),goog.editor.BrowserFeature.ADDS_NBSPS_IN_REMOVE_FORMAT&&this.convertSelectedHtmlText_(function(a){var b=goog.userAgent.isVersion("528")?/&nbsp;/g:/\u00A0/g;return a.replace(b," ")}))};
goog.editor.plugins.RemoveFormatting.getTableAncestor_=function(a){return goog.dom.getAncestor(a,function(a){return a.tagName==goog.dom.TagName.TABLE},!0)};
goog.editor.plugins.RemoveFormatting.prototype.pasteHtml_=function(a){var b=this.fieldObject.getRange(),c=this.getFieldDomHelper(),d=goog.string.createUniqueString(),e=goog.string.createUniqueString();a='<span id="'+d+'"></span>'+a+'<span id="'+e+'"></span>';var f=goog.string.createUniqueString(),g='<span id="'+f+'"></span>';if(goog.editor.BrowserFeature.HAS_IE_RANGES){var h=b.getTextRange(0).getBrowserRangeObject();h.pasteHTML(g);for(var i;(i=h.parentElement())&&goog.editor.node.isEmpty(i)&&!goog.editor.node.isEditableContainer(i);){b=
i.nodeName;if(b==goog.dom.TagName.TD||b==goog.dom.TagName.TR||b==goog.dom.TagName.TH)break;goog.dom.removeNode(i)}h.pasteHTML(a);(f=c.getElement(f))&&goog.dom.removeNode(f)}else if(goog.editor.BrowserFeature.HAS_W3C_RANGES){c.getDocument().execCommand("insertImage",!1,f);b=RegExp("<[^<]*"+f+"[^>]*>");i=this.fieldObject.getRange().getContainerElement();if(i.nodeType==goog.dom.NodeType.TEXT)i=i.parentNode;for(;!b.test(i.innerHTML);)i=i.parentNode;if(goog.userAgent.GECKO)i.innerHTML=i.innerHTML.replace(b,
a);else{i.innerHTML=i.innerHTML.replace(b,g);for(i=f=c.getElement(f);(i=f.parentNode)&&goog.editor.node.isEmpty(i)&&!goog.editor.node.isEditableContainer(i);){b=i.nodeName;if(b==goog.dom.TagName.TD||b==goog.dom.TagName.TR||b==goog.dom.TagName.TH)break;goog.dom.insertSiblingAfter(f,i);goog.dom.removeNode(i)}i.innerHTML=i.innerHTML.replace(RegExp(g,"i"),a)}}a=c.getElement(d);c=c.getElement(e);goog.dom.Range.createFromNodes(a,0,c,c.childNodes.length).select();goog.dom.removeNode(a);goog.dom.removeNode(c)};
goog.editor.plugins.RemoveFormatting.prototype.getHtmlText_=function(a){var b=this.getFieldDomHelper().createDom("div"),c=a.getBrowserRangeObject();if(goog.editor.BrowserFeature.HAS_W3C_RANGES)b.appendChild(c.cloneContents());else if(goog.editor.BrowserFeature.HAS_IE_RANGES){var d=a.getText();d=d.replace(/\r\n/g,"\r");var e=d.length;a=e-goog.string.trimLeft(d).length;d=e-goog.string.trimRight(d).length;c.moveStart("character",a);c.moveEnd("character",-d);a=c.htmlText;c.queryCommandValue("formatBlock")==
"Formatted"&&(a=goog.string.newLineToBr(c.htmlText));b.innerHTML=a}return b.innerHTML};
goog.editor.plugins.RemoveFormatting.prototype.adjustRangeForTables_=function(a,b,c){var d=goog.editor.range.saveUsingNormalizedCarets(a),e=a.getStartNode(),f=a.getStartOffset(),g=a.getEndNode();a=a.getEndOffset();var h=this.getFieldDomHelper();if(b){var i=h.createTextNode("");goog.dom.insertSiblingAfter(i,b);e=i;f=0}c&&(i=h.createTextNode(""),goog.dom.insertSiblingBefore(i,c),g=i,a=0);goog.dom.Range.createFromNodes(e,f,g,a).select();return d};
goog.editor.plugins.RemoveFormatting.prototype.putCaretInCave_=function(a,b){var c=goog.dom.removeNode(a.getCaret(b));b?this.startCaretInCave_=c:this.endCaretInCave_=c};goog.editor.plugins.RemoveFormatting.prototype.restoreCaretsFromCave_=function(){var a=this.fieldObject.getElement();if(this.startCaretInCave_)a.insertBefore(this.startCaretInCave_,a.firstChild),this.startCaretInCave_=null;if(this.endCaretInCave_)a.appendChild(this.endCaretInCave_),this.endCaretInCave_=null};
goog.editor.plugins.RemoveFormatting.prototype.convertSelectedHtmlText_=function(a){var b=this.fieldObject.getRange();if(!(b.getTextRangeCount()>1)){if(goog.userAgent.GECKO){var c=goog.editor.range.expand(b,this.fieldObject.getElement()),d=goog.editor.plugins.RemoveFormatting.getTableAncestor_(c.getStartNode()),e=goog.editor.plugins.RemoveFormatting.getTableAncestor_(c.getEndNode());if(d||e){if(d==e)return;var f=this.adjustRangeForTables_(b,d,e);d||this.putCaretInCave_(f,!0);e||this.putCaretInCave_(f,
!1);b=this.fieldObject.getRange();c=goog.editor.range.expand(b,this.fieldObject.getElement())}c.select();b=c}b=this.getHtmlText_(b);this.pasteHtml_(a(b));goog.userAgent.GECKO&&f&&(b=this.fieldObject.getRange(),this.restoreCaretsFromCave_(),a=f.toAbstractRange(),goog.editor.plugins.RemoveFormatting.createRangeDelimitedByRanges_(d?a:b,e?a:b).select(),f.dispose())}};
goog.editor.plugins.RemoveFormatting.prototype.removeFormattingWorker_=function(a){var b=goog.dom.createElement("div");b.innerHTML=a;a=[];b=[b.childNodes,0];for(var c=[],d=0,e=[],f=0,g=0;g>=0;g-=2){for(var h=!1;f>0&&g<=e[f-1];)f--,h=!0;h&&goog.editor.plugins.RemoveFormatting.appendNewline_(a);for(h=!1;d>0&&g<=c[d-1];)d--,h=!0;h&&goog.editor.plugins.RemoveFormatting.appendNewline_(a);h=b[g];for(var i=b[g+1];i<h.length;){var j=h[i++],k=j.nodeName,l=this.getValueForNode(j);if(goog.isDefAndNotNull(l))a.push(l);
else{switch(k){case "#text":j=d>0?j.nodeValue:goog.string.stripNewlines(j.nodeValue);j=goog.string.htmlEscape(j);a.push(j);continue;case goog.dom.TagName.P:goog.editor.plugins.RemoveFormatting.appendNewline_(a);goog.editor.plugins.RemoveFormatting.appendNewline_(a);break;case goog.dom.TagName.BR:goog.editor.plugins.RemoveFormatting.appendNewline_(a);continue;case goog.dom.TagName.TABLE:goog.editor.plugins.RemoveFormatting.appendNewline_(a);e[f++]=g;break;case goog.dom.TagName.PRE:case "XMP":c[d++]=
g;break;case goog.dom.TagName.STYLE:case goog.dom.TagName.SCRIPT:case goog.dom.TagName.SELECT:continue;case goog.dom.TagName.A:if(j.href&&j.href!=""){a.push("<a href='");a.push(j.href);a.push("'>");a.push(this.removeFormattingWorker_(j.innerHTML));a.push("</a>");continue}else break;case goog.dom.TagName.IMG:a.push("<img src='");a.push(j.src);a.push("'");j.border=="0"&&a.push(" border='0'");a.push(">");continue;case goog.dom.TagName.TD:j.previousSibling&&a.push(" ");break;case goog.dom.TagName.TR:j.previousSibling&&
goog.editor.plugins.RemoveFormatting.appendNewline_(a);break;case goog.dom.TagName.DIV:if(l=j.parentNode,l.firstChild==j&&goog.editor.plugins.RemoveFormatting.BLOCK_RE_.test(l.tagName))break;default:goog.editor.plugins.RemoveFormatting.BLOCK_RE_.test(k)&&goog.editor.plugins.RemoveFormatting.appendNewline_(a)}j=j.childNodes;j.length>0&&(b[g++]=h,b[g++]=i,h=j,i=0)}}}return goog.string.normalizeSpaces(a.join(""))};goog.editor.plugins.RemoveFormatting.prototype.getValueForNode=function(){return null};
goog.editor.plugins.RemoveFormatting.prototype.setRemoveFormattingFunc=function(a){this.optRemoveFormattingFunc_=a};goog.math.Integer=function(a,b){this.bits_=[];this.sign_=b;for(var c=!0,d=a.length-1;d>=0;d--){var e=a[d]|0;if(!c||e!=b)this.bits_[d]=e,c=!1}};goog.math.Integer.IntCache_={};goog.math.Integer.fromInt=function(a){if(-128<=a&&a<128){var b=goog.math.Integer.IntCache_[a];if(b)return b}b=new goog.math.Integer([a|0],a<0?-1:0);-128<=a&&a<128&&(goog.math.Integer.IntCache_[a]=b);return b};
goog.math.Integer.fromNumber=function(a){if(isNaN(a)||!isFinite(a))return goog.math.Integer.ZERO;else if(a<0)return goog.math.Integer.fromNumber(-a).negate();else{for(var b=[],c=1,d=0;a>=c;d++)b[d]=a/c|0,c*=goog.math.Integer.TWO_PWR_32_DBL_;return new goog.math.Integer(b,0)}};goog.math.Integer.fromBits=function(a){return new goog.math.Integer(a,a[a.length-1]&-2147483648?-1:0)};
goog.math.Integer.fromString=function(a,b){if(a.length==0)throw Error("number format error: empty string");var c=b||10;if(c<2||36<c)throw Error("radix out of range: "+c);if(a.charAt(0)=="-")return goog.math.Integer.fromString(a.substring(1),c).negate();else if(a.indexOf("-")>=0)throw Error('number format error: interior "-" character');for(var d=goog.math.Integer.fromNumber(Math.pow(c,8)),e=goog.math.Integer.ZERO,f=0;f<a.length;f+=8){var g=Math.min(8,a.length-f),h=parseInt(a.substring(f,f+g),c);g<
8?(g=goog.math.Integer.fromNumber(Math.pow(c,g)),e=e.multiply(g).add(goog.math.Integer.fromNumber(h))):(e=e.multiply(d),e=e.add(goog.math.Integer.fromNumber(h)))}return e};goog.math.Integer.TWO_PWR_32_DBL_=4294967296;goog.math.Integer.ZERO=goog.math.Integer.fromInt(0);goog.math.Integer.ONE=goog.math.Integer.fromInt(1);goog.math.Integer.TWO_PWR_24_=goog.math.Integer.fromInt(16777216);goog.math.Integer.prototype.toInt=function(){return this.bits_.length>0?this.bits_[0]:this.sign_};
goog.math.Integer.prototype.toNumber=function(){if(this.isNegative())return-this.negate().toNumber();else{for(var a=0,b=1,c=0;c<this.bits_.length;c++)a+=this.getBitsUnsigned(c)*b,b*=goog.math.Integer.TWO_PWR_32_DBL_;return a}};
goog.math.Integer.prototype.toString=function(a){a=a||10;if(a<2||36<a)throw Error("radix out of range: "+a);if(this.isZero())return"0";else if(this.isNegative())return"-"+this.negate().toString(a);for(var b=goog.math.Integer.fromNumber(Math.pow(a,6)),c=this,d="";;){var e=c.divide(b),f=c.subtract(e.multiply(b)).toInt().toString(a);c=e;if(c.isZero())return f+d;else{for(;f.length<6;)f="0"+f;d=""+f+d}}};goog.math.Integer.prototype.getBits=function(a){return a<0?0:a<this.bits_.length?this.bits_[a]:this.sign_};
goog.math.Integer.prototype.getBitsUnsigned=function(a){a=this.getBits(a);return a>=0?a:goog.math.Integer.TWO_PWR_32_DBL_+a};goog.math.Integer.prototype.getSign=function(){return this.sign_};goog.math.Integer.prototype.isZero=function(){if(this.sign_!=0)return!1;for(var a=0;a<this.bits_.length;a++)if(this.bits_[a]!=0)return!1;return!0};goog.math.Integer.prototype.isNegative=function(){return this.sign_==-1};
goog.math.Integer.prototype.isOdd=function(){return this.bits_.length==0&&this.sign_==-1||this.bits_.length>0&&(this.bits_[0]&1)!=0};goog.math.Integer.prototype.equals=function(a){if(this.sign_!=a.sign_)return!1;for(var b=Math.max(this.bits_.length,a.bits_.length),c=0;c<b;c++)if(this.getBits(c)!=a.getBits(c))return!1;return!0};goog.math.Integer.prototype.notEquals=function(a){return!this.equals(a)};goog.math.Integer.prototype.greaterThan=function(a){return this.compare(a)>0};
goog.math.Integer.prototype.greaterThanOrEqual=function(a){return this.compare(a)>=0};goog.math.Integer.prototype.lessThan=function(a){return this.compare(a)<0};goog.math.Integer.prototype.lessThanOrEqual=function(a){return this.compare(a)<=0};goog.math.Integer.prototype.compare=function(a){a=this.subtract(a);return a.isNegative()?-1:a.isZero()?0:1};
goog.math.Integer.prototype.shorten=function(a){var b=a-1>>5;a=(a-1)%32;for(var c=[],d=0;d<b;d++)c[d]=this.getBits(d);d=a==31?4294967295:(1<<a+1)-1;var e=this.getBits(b)&d;return e&1<<a?(e|=4294967295-d,c[b]=e,new goog.math.Integer(c,-1)):(c[b]=e,new goog.math.Integer(c,0))};goog.math.Integer.prototype.negate=function(){return this.not().add(goog.math.Integer.ONE)};
goog.math.Integer.prototype.add=function(a){for(var b=Math.max(this.bits_.length,a.bits_.length),c=[],d=0,e=0;e<=b;e++){var f=this.getBits(e)>>>16,g=this.getBits(e)&65535,h=a.getBits(e)>>>16,i=a.getBits(e)&65535;g=d+g+i;f=(g>>>16)+f+h;d=f>>>16;g&=65535;f&=65535;c[e]=f<<16|g}return goog.math.Integer.fromBits(c)};goog.math.Integer.prototype.subtract=function(a){return this.add(a.negate())};
goog.math.Integer.prototype.multiply=function(a){if(this.isZero())return goog.math.Integer.ZERO;else if(a.isZero())return goog.math.Integer.ZERO;if(this.isNegative())return a.isNegative()?this.negate().multiply(a.negate()):this.negate().multiply(a).negate();else if(a.isNegative())return this.multiply(a.negate()).negate();if(this.lessThan(goog.math.Integer.TWO_PWR_24_)&&a.lessThan(goog.math.Integer.TWO_PWR_24_))return goog.math.Integer.fromNumber(this.toNumber()*a.toNumber());for(var b=this.bits_.length+
a.bits_.length,c=[],d=0;d<2*b;d++)c[d]=0;for(d=0;d<this.bits_.length;d++)for(var e=0;e<a.bits_.length;e++){var f=this.getBits(d)>>>16,g=this.getBits(d)&65535,h=a.getBits(e)>>>16,i=a.getBits(e)&65535;c[2*d+2*e]+=g*i;goog.math.Integer.carry16_(c,2*d+2*e);c[2*d+2*e+1]+=f*i;goog.math.Integer.carry16_(c,2*d+2*e+1);c[2*d+2*e+1]+=g*h;goog.math.Integer.carry16_(c,2*d+2*e+1);c[2*d+2*e+2]+=f*h;goog.math.Integer.carry16_(c,2*d+2*e+2)}for(d=0;d<b;d++)c[d]=c[2*d+1]<<16|c[2*d];for(d=b;d<2*b;d++)c[d]=0;return new goog.math.Integer(c,
0)};goog.math.Integer.carry16_=function(a,b){for(;(a[b]&65535)!=a[b];)a[b+1]+=a[b]>>>16,a[b]&=65535};
goog.math.Integer.prototype.divide=function(a){if(a.isZero())throw Error("division by zero");else if(this.isZero())return goog.math.Integer.ZERO;if(this.isNegative())return a.isNegative()?this.negate().divide(a.negate()):this.negate().divide(a).negate();else if(a.isNegative())return this.divide(a.negate()).negate();for(var b=goog.math.Integer.ZERO,c=this;c.greaterThanOrEqual(a);){var d=Math.max(1,Math.floor(c.toNumber()/a.toNumber())),e=Math.ceil(Math.log(d)/Math.LN2);e=e<=48?1:Math.pow(2,e-48);for(var f=
goog.math.Integer.fromNumber(d),g=f.multiply(a);g.isNegative()||g.greaterThan(c);)d-=e,f=goog.math.Integer.fromNumber(d),g=f.multiply(a);if(f.isZero())f=goog.math.Integer.ONE;b=b.add(f);c=c.subtract(g)}return b};goog.math.Integer.prototype.modulo=function(a){return this.subtract(this.divide(a).multiply(a))};goog.math.Integer.prototype.not=function(){for(var a=this.bits_.length,b=[],c=0;c<a;c++)b[c]=~this.bits_[c];return new goog.math.Integer(b,~this.sign_)};
goog.math.Integer.prototype.and=function(a){for(var b=Math.max(this.bits_.length,a.bits_.length),c=[],d=0;d<b;d++)c[d]=this.getBits(d)&a.getBits(d);return new goog.math.Integer(c,this.sign_&a.sign_)};goog.math.Integer.prototype.or=function(a){for(var b=Math.max(this.bits_.length,a.bits_.length),c=[],d=0;d<b;d++)c[d]=this.getBits(d)|a.getBits(d);return new goog.math.Integer(c,this.sign_|a.sign_)};
goog.math.Integer.prototype.xor=function(a){for(var b=Math.max(this.bits_.length,a.bits_.length),c=[],d=0;d<b;d++)c[d]=this.getBits(d)^a.getBits(d);return new goog.math.Integer(c,this.sign_^a.sign_)};goog.math.Integer.prototype.shiftLeft=function(a){var b=a>>5;a%=32;for(var c=this.bits_.length+b+(a>0?1:0),d=[],e=0;e<c;e++)d[e]=a>0?this.getBits(e-b)<<a|this.getBits(e-b-1)>>>32-a:this.getBits(e-b);return new goog.math.Integer(d,this.sign_)};
goog.math.Integer.prototype.shiftRight=function(a){var b=a>>5;a%=32;for(var c=this.bits_.length-b,d=[],e=0;e<c;e++)d[e]=a>0?this.getBits(e+b)>>>a|this.getBits(e+b+1)<<32-a:this.getBits(e+b);return new goog.math.Integer(d,this.sign_)};goog.editor.plugins.UndoRedoState=function(a){this.asynchronous_=a};goog.inherits(goog.editor.plugins.UndoRedoState,goog.events.EventTarget);goog.editor.plugins.UndoRedoState.ACTION_COMPLETED="action_completed";goog.editor.plugins.UndoRedoState.prototype.isAsynchronous=function(){return this.asynchronous_};goog.editor.plugins.UndoRedoManager=function(){goog.events.EventTarget.call(this);this.maxUndoDepth_=100;this.undoStack_=[];this.redoStack_=[];this.pendingActions_=[]};goog.inherits(goog.editor.plugins.UndoRedoManager,goog.events.EventTarget);goog.editor.plugins.UndoRedoManager.EventType={STATE_CHANGE:"state_change",STATE_ADDED:"state_added",BEFORE_UNDO:"before_undo",BEFORE_REDO:"before_redo"};goog.editor.plugins.UndoRedoManager.prototype.inProgressActionKey_=null;
goog.editor.plugins.UndoRedoManager.prototype.setMaxUndoDepth=function(a){this.maxUndoDepth_=a};
goog.editor.plugins.UndoRedoManager.prototype.addState=function(a){if(this.undoStack_.length==0||!a.equals(this.undoStack_[this.undoStack_.length-1])){this.undoStack_.push(a);this.undoStack_.length>this.maxUndoDepth_&&this.undoStack_.shift();var b=this.redoStack_.length;this.redoStack_.length=0;this.dispatchEvent({type:goog.editor.plugins.UndoRedoManager.EventType.STATE_ADDED,state:a});(this.undoStack_.length==1||b)&&this.dispatchStateChange_()}};
goog.editor.plugins.UndoRedoManager.prototype.dispatchStateChange_=function(){this.dispatchEvent(goog.editor.plugins.UndoRedoManager.EventType.STATE_CHANGE)};goog.editor.plugins.UndoRedoManager.prototype.undo=function(){this.shiftState_(this.undoStack_,this.redoStack_)};goog.editor.plugins.UndoRedoManager.prototype.redo=function(){this.shiftState_(this.redoStack_,this.undoStack_)};goog.editor.plugins.UndoRedoManager.prototype.hasUndoState=function(){return this.undoStack_.length>0};
goog.editor.plugins.UndoRedoManager.prototype.hasRedoState=function(){return this.redoStack_.length>0};goog.editor.plugins.UndoRedoManager.prototype.shiftState_=function(a,b){if(a.length){var c=a.pop();b.push(c);this.addAction_({type:a==this.undoStack_?goog.editor.plugins.UndoRedoManager.EventType.BEFORE_UNDO:goog.editor.plugins.UndoRedoManager.EventType.BEFORE_REDO,func:a==this.undoStack_?c.undo:c.redo,state:c});(a.length==0||b.length==1)&&this.dispatchStateChange_()}};
goog.editor.plugins.UndoRedoManager.prototype.addAction_=function(a){this.pendingActions_.push(a);this.pendingActions_.length==1&&this.doAction_()};
goog.editor.plugins.UndoRedoManager.prototype.doAction_=function(){if(!(this.inProgressActionKey_||this.pendingActions_.length==0)){var a=this.pendingActions_.shift();if(this.dispatchEvent({type:a.type,state:a.state}))a.state.isAsynchronous()?(this.inProgressActionKey_=goog.events.listen(a.state,goog.editor.plugins.UndoRedoState.ACTION_COMPLETED,this.finishAction_,!1,this),a.func.call(a.state)):(a.func.call(a.state),this.doAction_())}};
goog.editor.plugins.UndoRedoManager.prototype.finishAction_=function(){goog.events.unlistenByKey(this.inProgressActionKey_);this.inProgressActionKey_=null;this.doAction_()};goog.editor.plugins.UndoRedoManager.prototype.clearHistory=function(){if(this.undoStack_.length>0||this.redoStack_.length>0)this.undoStack_.length=0,this.redoStack_.length=0,this.dispatchStateChange_()};goog.editor.plugins.UndoRedoManager.prototype.undoPeek=function(){return this.undoStack_[this.undoStack_.length-1]};
goog.editor.plugins.UndoRedoManager.prototype.redoPeek=function(){return this.redoStack_[this.redoStack_.length-1]};goog.editor.plugins.UndoRedo=function(a){goog.editor.Plugin.call(this);this.setUndoRedoManager(a||new goog.editor.plugins.UndoRedoManager);this.eventHandlers_={};this.currentStates_={};this.initialFieldChange_=null;this.boundRestoreState_=goog.bind(this.restoreState,this)};goog.inherits(goog.editor.plugins.UndoRedo,goog.editor.Plugin);goog.editor.plugins.UndoRedo.prototype.logger=goog.debug.Logger.getLogger("goog.editor.plugins.UndoRedo");goog.editor.plugins.UndoRedo.prototype.inProgressUndo_=null;
goog.editor.plugins.UndoRedo.COMMAND={UNDO:"+undo",REDO:"+redo"};goog.editor.plugins.UndoRedo.SUPPORTED_COMMANDS_=goog.object.transpose(goog.editor.plugins.UndoRedo.COMMAND);goog.editor.plugins.UndoRedo.prototype.setMaxUndoDepth=function(a){this.undoManager_.setMaxUndoDepth(a)};
goog.editor.plugins.UndoRedo.prototype.setUndoRedoManager=function(a){this.managerStateChangeKey_&&goog.events.unlistenByKey(this.managerStateChangeKey_);this.undoManager_=a;this.managerStateChangeKey_=goog.events.listen(this.undoManager_,goog.editor.plugins.UndoRedoManager.EventType.STATE_CHANGE,this.dispatchCommandValueChange_,!1,this)};goog.editor.plugins.UndoRedo.prototype.isSupportedCommand=function(a){return a in goog.editor.plugins.UndoRedo.SUPPORTED_COMMANDS_};
goog.editor.plugins.UndoRedo.prototype.registerFieldObject=function(a){this.fieldObject=a};goog.editor.plugins.UndoRedo.prototype.unregisterFieldObject=function(a){this.disable(a);this.fieldObject=null};goog.editor.plugins.UndoRedo.protot
